text:
/**
	 * Класс представляет собой view
	 */
export default class View {
		/**
		 * Создаёт новую view
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		constructor(options = {}) {
			if (options.createElement) {
				this.tagName = options.tagName || 'div';
			}
			else{
				this.tagName = 'div';
			}
			this._el = document.createElement(this.tagName);
		}

		/**
		 * Инициализация параметров view (выполняется сразу после создания)
		 * Необходимо перепределять
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		init(options = {}) {
			this.setAttrs(options.attrs);
		}

		/**
		 * Вызывается при приостановке работы view (при скрытии view или переходе на другую view)
		 * Необходимо переопределять своей логикой
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		pause(options = {}) {
			this.hide();
		}

		/**
		 * Вызывается при начале или продолжении работы view (после того, как view была скрыта)
		 * Необходимо переопределять своей логикой
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		resume(options = {}) {
			this.show();
		}

		/**
		 * Показывает view
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		show(options = {}) {
			this._el.hidden = false;
		}

		/**
		 * Скрывает view
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		hide(options = {}){
			this._el.hidden = true;
		}

		/**
		 * Рендерит view
		 * Необходимо переопределять
		 * @param {Object} [options={}] - Объект с параметрами
		 */
		render(options = {}) {

		}

		/**
		 * Вставляет текущую view в переданный элемент
		 * @param {HTMLElement} el - HTML-элемент, к которому добавляется элемент текущей view
		 */
		appendTo(el) {
			el.appendChild(this._el);
		}

		/**
		 * Удаляет элемент текущей view
		 */
		remove() {
			this._el && this._el.remove();
		}

		/**
		 * Заменяет элемент текущей view
		 * @param {HTMLElement} el - HTML-элемент, который становится элементом текущей view
		 */
		setElement(el) {
			this._el && this._el.remove();
			this._el = el;
		}

		/**
		 * Устанавливает текущей view набор атрибутов
		 * @param {Object} [attrs={}] - Объект с атрибутами, которые будут установлены у текущего элемента view
		 */
		setAttrs(attrs = {}) {
			Object.keys(attrs).forEach(name => {
				this._el.setAttribute(name, attrs[name]);
			})
		}

		/**
		 * Возвращает строку, содержашую текстовое представление текущей view
		 * @returns {string}
		 */
		toString() {
			return this._el.outerHTML;
		}

		/**
		 * Устанавливает текущей view роутер
		 * @param {Router} router - инстанс роутера
		 */
		setRouter(router) {
			this.router = router;
		}

	}


text: apache_module "alias"

redpajama_set_name: RedPajamaGithub


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

<title>EXTUnpackSubimage (LWJGL API)</title>
<meta name="date" content="2013-12-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.lwjgl.opengles

Class EXTUnpackSubimage

java.lang.Object

org.lwjgl.opengles.EXTUnpackSubimage

public final class EXTUnpackSubimage
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static int
GL_UNPACK_ROW_LENGTH

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

static int
GL_UNPACK_SKIP_PIXELS

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

static int
GL_UNPACK_SKIP_ROWS

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GL_UNPACK_ROW_LENGTH

public static final int GL_UNPACK_ROW_LENGTH

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

See Also:

Constant Field Values

GL_UNPACK_SKIP_ROWS

public static final int GL_UNPACK_SKIP_ROWS

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

See Also:

Constant Field Values

GL_UNPACK_SKIP_PIXELS

public static final int GL_UNPACK_SKIP_PIXELS

Accepted by the <pname> parameters of PixelStorei, GetIntegerv, and
  GetFloatv:

See Also:

Constant Field Values

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2002-2009 lwjgl.org. All Rights Reserved.


text:
function Import-VSTemplateConfig {
    <#
    .SYNOPSIS
        Imports a configuration from either a JSON or PSD1 file at the specified key.

    .DESCRIPTION
        Imports a configuration from either a JSON or PSD1 file at the specified key.

    .PARAMETER Path
		The path to the configuration file. This can be relative or absolute

    .PARAMETER Key
        The key of the sub-configuration to return, i.e. "Dev".

    .EXAMPLE
        Import-VSTemplateConfig -Path .\WebServerConfig.psd1 -Key Prd

        Imports the "Prd" sub-configuration from the WebServerConfig.psd1 configuration file

    .FUNCTIONALITY
        Vaporshell
    #>
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $true, Position = 0)]
        [ValidateScript({Test-Path $_})]
        [String]
        $Path,
        [parameter(Mandatory = $true, Position = 1)]
        [String]
        $Key
    )
    try {
        $item = Get-Item $Path -ErrorAction Stop
        $contents = Get-Content $item.FullName -Raw -ErrorAction Stop
        $Global:VSConfig = switch ($item.Extension) {
            '.json' {
                $obj = ConvertFrom-Json -InputObject $contents -ErrorAction Stop
                [PSCustomObject]$obj.$key
            }
            '.psd1' {
                $sb = [scriptblock]::Create($contents)
                $hash = $sb.Invoke()
                [PSCustomObject]($hash.$Key)
            }
            Default {
                throw "$Path must be a JSON or PSD1 file!"
            }
        }
        Write-Verbose "Imported config:`n`n$(($Global:VSConfig | Out-String).Trim())"
        return $Global:VSConfig
    }
    catch {
        $PSCmdlet.ThrowTerminatingError($_)
    }
}


text:
/**
 * @fileoverview Defines the goog.storage.mechanism.Mechanism implementation
 * for cookie storage.
 */

goog.provide('firebaseui.auth.CookieMechanism');

goog.require('goog.net.cookies');
goog.require('goog.storage.mechanism.Mechanism');

/**
 * Defines a goog.storage.mechanism.Mechanism implementation for storing
 * cookies.
 */
firebaseui.auth.CookieMechanism =
    class extends goog.storage.mechanism.Mechanism {
  /**
   * @param {?number=} opt_maxAge  The max age in seconds (from now). Use -1 to
   *     set a session cookie. If not provided, the default is -1
   *     (i.e. set a session cookie).
   * @param {?string=} opt_path  The path of the cookie. If not present then
   *     this uses the full request path.
   * @param {?string=} opt_domain  The domain of the cookie, or null to not
   *     specify a domain attribute (browser will use the full request host
   * name). If not provided, the default is null (i.e. let browser use full
   * request host name).
   * @param {boolean=} opt_secure Whether the cookie should only be sent over
   *     a secure channel.
   */
  constructor(opt_maxAge, opt_path, opt_domain, opt_secure) {
    super();
    /** @const @private {number} The cookie max age in seconds. */
    this.maxAge_ = typeof opt_maxAge !== 'undefined' && opt_maxAge !== null ?
        opt_maxAge :
        -1;
    /** @const @private {?string} The cookie path. */
    this.path_ = opt_path || null;
    /** @const @private {?string} The cookie domain policy. */
    this.domain_ = opt_domain || null;
    /** @const @private {boolean} The cookie secure policy. */
    this.secure_ = !!opt_secure;
  }

  /**
   * Set a value for a key.
   *
   * @param {string} key The key to set.
   * @param {string} value The string to save.
   * @override
   */
  set(key, value) {
    goog.net.cookies.set(
        key, value, this.maxAge_, this.path_, this.domain_, this.secure_);
  }

  /**
   * Get the value stored under a key.
   *
   * @param {string} key The key to get.
   * @return {?string} The corresponding value, null if not found.
   * @override
   */
  get(key) {
    return goog.net.cookies.get(key) || null;
  }

  /**
   * Remove a key and its value.
   *
   * @param {string} key The key to remove.
   * @override
   */
  remove(key) {
    goog.net.cookies.remove(key, this.path_, this.domain_);
  }
};


text:
package ca.uhn.fhir.jpa.cache;

import ca.uhn.fhir.interceptor.api.Hook;
import ca.uhn.fhir.interceptor.api.IInterceptorService;
import ca.uhn.fhir.interceptor.api.Pointcut;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * This interceptor watches all resource changes on the server and compares them to the {@link IResourceChangeListenerCache}
 * entries.  If the resource matches the resource type and search parameter map of that entry, then the corresponding cache
 * will be expired so it is refreshed and listeners are notified of that change within {@link ResourceChangeListenerCacheRefresherImpl#LOCAL_REFRESH_INTERVAL_MS}.
 */
@Service
public class ResourceChangeListenerRegistryInterceptor {
	@Autowired
	private IInterceptorService myInterceptorBroadcaster;
	@Autowired
	private IResourceChangeListenerRegistry myResourceChangeListenerRegistry;

	@PostConstruct
	public void start() {
		myInterceptorBroadcaster.registerInterceptor(this);
	}

	@PreDestroy
	public void stop() {
		myInterceptorBroadcaster.unregisterInterceptor(this);
	}

	@Hook(Pointcut.STORAGE_PRECOMMIT_RESOURCE_CREATED)
	public void created(IBaseResource theResource) {
		handle(theResource);
	}

	@Hook(Pointcut.STORAGE_PRECOMMIT_RESOURCE_DELETED)
	public void deleted(IBaseResource theResource) {
		handle(theResource);
	}

	@Hook(Pointcut.STORAGE_PRECOMMIT_RESOURCE_UPDATED)
	public void updated(IBaseResource theResource) {
		handle(theResource);
	}

	private void handle(IBaseResource theResource) {
		if (theResource == null) {
			return;
		}
		myResourceChangeListenerRegistry.requestRefreshIfWatching(theResource);
	}
}


text:
layout: sieutv
title: disanviet
tags: [VNplus]
thumb: vn_disanviet
---
{% include tvadv key="vn_disanviet" %}


text:
#region License
//
// Copyright Tony Beveridge 2015. All rights reserved.
// MIT license applies.
//
#endregion
using System;
using System.Threading.Tasks;
using System.Threading;
using Infra;

namespace Quorum {

    public abstract class BaseMasterWorkAdapter : IMasterWorkAdapter {

        private SemaphoreSlim Region { get; set; }

        public BaseMasterWorkAdapter() {
            Region = new SemaphoreSlim(1, 1);
        }

        private bool Finish { get; set; }

        public async Task Activated() {
            LogFacade.Instance.LogInfo("Activating worker adapter");
            Finish = false;
            int delay = 1;
            while (!Finish) {
                await Task.Delay(delay);
                await Region.WaitAsync();
                if (!Finish) {
                    var result = await Work();
                    Finish = ! result.Continue;
                    delay = result.BackOffPeriod.HasValue ? result.BackOffPeriod.Value : delay;
                }
                Region.Release();
            }
            LogFacade.Instance.LogInfo("Finishing worker adapter");
            Stopped();
        }

        protected abstract Task<WorkResult> Work();

        protected abstract Task Stopping();

        protected virtual void Stopped() {
        }

        public async Task DeActivated() {
            await Region.WaitAsync();
            Finish = true;
            await Stopping();
            Region.Release();
            await Region.WaitAsync();
            Region.Release();
        }

        public Action WorkUnitExecuted { get; set; }

        protected bool ContinueExecuting {  get { return true; } }

        public class WorkResult {
            public bool Continue { get; set; }
            public int? BackOffPeriod { get; set; }
            public static WorkResult KeepWorking {
                get {
                    return new WorkResult { Continue = true };
                }
            }
            public static WorkResult Conclude {
                get {
                    return new WorkResult { Continue = false };
                }
            }
        }
    }

}


text:
using Buddy.BehaviorTree;
using DefaultCombat.Core;
using DefaultCombat.Helpers;

namespace DefaultCombat.Routines
{
    public class Saboteur : RotationBase
    {
        public override string Name
        {
            get { return "Gunslinger Saboteur"; }
        }

        public override Composite Buffs
        {
            get
            {
                return new PrioritySelector(
                    Spell.Buff("Lucky Shots")
                    );
            }
        }

        public override Composite Cooldowns
        {
            get
            {
                return new PrioritySelector(
                    Spell.Buff("Escape", ret => Me.IsStunned),
                    Spell.Buff("Defense Screen", ret => Me.HealthPercent <= 50),
                    Spell.Buff("Dodge", ret => Me.HealthPercent <= 30),
                    Spell.Cast("Cool Head", ret => Me.EnergyPercent <= 50),
                    Spell.Cast("Smuggler's Luck", ret => Me.CurrentTarget.BossOrGreater()),
                    Spell.Cast("Illegal Mods", ret => Me.CurrentTarget.BossOrGreater()),
                    Spell.Buff("Unity", ret => Me.Companion != null && Me.HealthPercent <= 15)
                    );
            }
        }

        public override Composite SingleTarget
        {
            get
            {
                return new PrioritySelector(
                    //Low Energy
                    new Decorator(ret => Me.EnergyPercent < 60,
                        new PrioritySelector(
                            Spell.Cast("Thermal Grenade", ret => Me.HasBuff("Seize the Moment")),
                            Spell.Cast("Flurry of Bolts")
                            )),

                    //Movement
                    CombatMovement.CloseDistance(Distance.Ranged),

                    //Legacy Heroic Moment Abilities --will only be active when user initiates Heroic Moment--
                    Spell.Cast("Legacy Force Sweep", ret => Me.HasBuff("Heroic Moment") && Me.CurrentTarget.Distance < .6f),
                    Spell.CastOnGround("Legacy Orbital Strike", ret => Me.HasBuff("Heroic Moment")),
                    Spell.Cast("Legacy Project", ret => Me.HasBuff("Heroic Moment")),
                    Spell.Cast("Legacy Dirty Kick", ret => Me.HasBuff("Heroic Moment") && Me.CurrentTarget.Distance < .5f),
                    Spell.Cast("Legacy Sticky Plasma Grenade", ret => Me.HasBuff("Heroic Moment")),
                    Spell.Cast("Legacy Flame Thrower", ret => Me.HasBuff("Heroic Moment")),
                    Spell.Cast("Legacy Force Lightning", ret => Me.HasBuff("Heroic Moment")),
                    Spell.Cast("Legacy Force Choke", ret => Me.HasBuff("Heroic Moment")),

                    //Rotation
                    Spell.Cast("Distraction", ret => Me.CurrentTarget.IsCasting && CombatHotkeys.EnableInterrupts),
                    Spell.Cast("Explosive Charge"),
                    Spell.DoTGround("Incendiary Grenade", 9000),
                    Spell.Cast("Speed Shot"),
                    Spell.DoT("Shock Charge", "Shock Charge"),
                    Spell.Cast("Sabotage", ret => Me.CurrentTarget.HasDebuff("Shock Charge")),
                    Spell.Cast("Thermal Grenade", ret => Me.HasBuff("Seize the Moment")),
                    Spell.DoT("Vital Shot", "Vital Shot"),
					Spell.CastOnGround("XS Freighter Flyby", ret => Me.EnergyPercent > 80),
                    Spell.Cast("Quickdraw", ret => Me.CurrentTarget.HealthPercent <= 30)
                    );
            }
        }

        public override Composite AreaOfEffect
        {
            get
            {
                return new Decorator(ret => Targeting.ShouldAoe,
                    new PrioritySelector(
                        Spell.Buff("Crouch", ret => !Me.IsInCover() && !Me.IsMoving),
                        Spell.CastOnGround("XS Freighter Flyby", ret => Me.IsInCover() && Me.EnergyPercent > 30),
                        Spell.CastOnGround("Sweeping Gunfire", ret => Me.IsInCover() && Me.EnergyPercent > 10),
                        Spell.Cast("Incendiary Grenade"),
                        Spell.Cast("Thermal Grenade")
                        ));
            }
        }
    }
}


text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "AppSettings" do
  before(:each) do
    @settings = AppSettings.new(File.join(File.dirname(__FILE__), %w(.. example_config/example_for_rails.yml)))
  end

  describe '[]' do
    it "should support single keys" do
      @settings['domains/legacy'].should == 'www.AppSettings.com'
    end

    it "should support nested keys" do
      @settings[:items_per_page].should == 50
    end

    it "should not die on keys that don't exist" do
      lambda {
        @settings['a/b/c/d/e/f/g'].should be_nil
      }.should_not raise_error
    end
  end

  describe '.value' do
    it "should work" do
      @settings.domains['legacy'].should == 'www.AppSettings.com'
    end
  end
end


text:
title: Profile
body_class: page-profile
---

{{#extend "layout-default"}}

  {{#content "css" mode="prepend"}}
    <link rel="stylesheet" href="{{assets}}/examples/css/pages/profile.css">
  {{/content}}

  {{#content "body"}}

Terrance arnold

Art director

Hi! I'm Adrian the Senior UI Designer at AmazingSurge. We hope
                    you enjoy the design and quality of Social.

                  <button type="button" class="btn btn-primary">Follow</button>

                    260
                    Follower

                    180
                    Following

                    2000
                    Tweets

Activities 5

Profile

Messages

Ida Fleming
                              posted an updated

                            active 14 minutes ago

"Check if it can be corrected with overflow : hidden"

Julius
                              uploaded 4 photos

                            active 14 minutes ago

Owen Hunt
                              posted a new note

                            active 14 minutes ago

Lorem ipsum dolor sit amet, consectetur adipiscing
                              elit. Integer nec odio. Praesent libero. Sed cursus
                              ante dapibus diam. Sed nisi. Nulla quis sem at nibh
                              elementum imperdiet. Duis sagittis ipsum. Praesent
                              mauris. Fusce nec tellus sed augue semper porta.
                              Mauris massa.

Terrance Arnold
                              posted a new blog

                            active 14 minutes ago

Getting Started

Lorem ipsum dolor sit amet, consectetur adipiscing
                                    elit. Integer nec odio. Praesent libero. Sed
                                    cursus ante dapibus diam. Sed nisi. Nulla quis
                                    sem at nibh elementum imperdiet. Duis sagittis
                                    ipsum. Praesent mauris.

Ida Fleming
                              posted an new activity comment

                            active 14 minutes ago

Cras sit amet nibh libero, in gravida nulla. Nulla
                              vel metus.

Julius
                              posted an updated

                            active 14 minutes ago

Lorem ipsum dolor sit amet, consectetur adipiscing
                              elit. Integer nec odio. Praesent libero. Sed cursus
                              ante dapibus diam.

                    Show more

Terrance Arnold
                              posted a new blog

                            active 14 minutes ago

Getting Started

Lorem ipsum dolor sit amet, consectetur adipiscing
                                    elit. Integer nec odio. Praesent libero. Sed
                                    cursus ante dapibus diam. Sed nisi. Nulla quis
                                    sem at nibh elementum imperdiet. Duis sagittis
                                    ipsum. Praesent mauris.

Ida Fleming
                              posted an updated

                            active 14 minutes ago

"Check if it can be corrected with overflow : hidden"

Owen Hunt
                              posted a new note

                            active 14 minutes ago

Lorem ipsum dolor sit amet, consectetur adipiscing
                              elit. Integer nec odio. Praesent libero. Sed cursus
                              ante dapibus diam. Sed nisi. Nulla quis sem at nibh
                              elementum imperdiet. Duis sagittis ipsum. Praesent
                              mauris. Fusce nec tellus sed augue semper porta.
                              Mauris massa.

Ida Fleming
                              posted an new activity comment

                            active 14 minutes ago

Cras sit amet nibh libero, in gravida nulla. Nulla
                              vel metus.

Julius
                              uploaded 4 photos

                            active 14 minutes ago

Ida Fleming
                              posted an updated

                            active 14 minutes ago

"Check if it can be corrected with overflow : hidden"

Terrance Arnold
                              posted a new blog

                            active 14 minutes ago

Getting Started

Lorem ipsum dolor sit amet, consectetur adipiscing
                                    elit. Integer nec odio. Praesent libero. Sed
                                    cursus ante dapibus diam. Sed nisi. Nulla quis
                                    sem at nibh elementum imperdiet. Duis sagittis
                                    ipsum. Praesent mauris.

Owen Hunt
                              posted a new note

                            active 14 minutes ago

Lorem ipsum dolor sit amet, consectetur adipiscing
                              elit. Integer nec odio. Praesent libero. Sed cursus
                              ante dapibus diam. Sed nisi. Nulla quis sem at nibh
                              elementum imperdiet. Duis sagittis ipsum. Praesent
                              mauris. Fusce nec tellus sed augue semper porta.
                              Mauris massa.

Julius
                              posted an updated

                            active 14 minutes ago

Lorem ipsum dolor sit amet, consectetur adipiscing
                              elit. Integer nec odio. Praesent libero. Sed cursus
                              ante dapibus diam.

  {{/content}}
{{/extend}}


text:
package jadx.gui.treemodel;

import jadx.api.ResourceFile;
import jadx.api.ResourceType;
import jadx.core.codegen.CodeWriter;
import jadx.gui.utils.OverlayIcon;
import jadx.gui.utils.Utils;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.fife.ui.rsyntaxtextarea.SyntaxConstants;

public class JResource extends JNode implements Comparable<JResource> {
	private static final long serialVersionUID = -201018424302612434L;

	private static final ImageIcon ROOT_ICON = Utils.openIcon("cf_obj");
	private static final ImageIcon FOLDER_ICON = Utils.openIcon("folder");
	private static final ImageIcon FILE_ICON = Utils.openIcon("file_obj");
	private static final ImageIcon MANIFEST_ICON = Utils.openIcon("template_obj");
	private static final ImageIcon JAVA_ICON = Utils.openIcon("java_ovr");
	private static final ImageIcon ERROR_ICON = Utils.openIcon("error_co");

	public enum JResType {
		ROOT,
		DIR,
		FILE
	}

	private final String name;
	private final List<JResource> files = new ArrayList<JResource>(1);
	private final JResType type;
	private final ResourceFile resFile;

	private boolean loaded;
	private String content;
	private Map<Integer, Integer> lineMapping;

	public JResource(ResourceFile resFile, String name, JResType type) {
		this.resFile = resFile;
		this.name = name;
		this.type = type;
	}

	public final void update() {
		removeAllChildren();
		for (JResource res : files) {
			res.update();
			add(res);
		}
	}

	public String getName() {
		return name;
	}

	public List<JResource> getFiles() {
		return files;
	}

	public String getContent() {
		if (!loaded && resFile != null && type == JResType.FILE) {
			loaded = true;
			if (isSupportedForView(resFile.getType())) {
				CodeWriter cw = resFile.getContent();
				if (cw != null) {
					lineMapping = cw.getLineMapping();
					content = cw.toString();
				}
			}
		}
		return content;
	}

	@Override
	public Integer getSourceLine(int line) {
		if (lineMapping == null) {
			return null;
		}
		return lineMapping.get(line);
	}

	@Override
	public String getSyntaxName() {
		switch (resFile.getType()) {
			case CODE:
				return super.getSyntaxName();
			case MANIFEST:
			case XML:
				return SyntaxConstants.SYNTAX_STYLE_XML;
		}
		String syntax = getSyntaxByExtension(resFile.getName());
		if (syntax != null) {
			return syntax;
		}
		return super.getSyntaxName();
	}

	private String getSyntaxByExtension(String name) {
		int dot = name.lastIndexOf('.');
		if (dot == -1) {
			return null;
		}
		String ext = name.substring(dot + 1);
		if (ext.equals("js")) {
			return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
		}
		if (ext.equals("css")) {
			return SyntaxConstants.SYNTAX_STYLE_CSS;
		}
		if (ext.equals("html")) {
			return SyntaxConstants.SYNTAX_STYLE_HTML;
		}
		return null;
	}

	@Override
	public Icon getIcon() {
		switch (type) {
			case ROOT:
				return ROOT_ICON;
			case DIR:
				return FOLDER_ICON;

			case FILE:
				ResourceType resType = resFile.getType();
				if (resType == ResourceType.MANIFEST) {
					return MANIFEST_ICON;
				}
				if (resType == ResourceType.CODE) {
					return new OverlayIcon(FILE_ICON, ERROR_ICON, JAVA_ICON);
				}
				if (!isSupportedForView(resType)) {
					return new OverlayIcon(FILE_ICON, ERROR_ICON);
				}
				return FILE_ICON;
		}
		return FILE_ICON;
	}

	private boolean isSupportedForView(ResourceType type) {
		switch (type) {
			case CODE:
			case FONT:
			case IMG:
			case LIB:
				return false;

			case MANIFEST:
			case XML:
			case ARSC:
			case UNKNOWN:
				return true;
		}
		return true;
	}

	@Override
	public JClass getJParent() {
		return null;
	}

	@Override
	public int compareTo(JResource o) {
		return name.compareTo(o.name);
	}

	@Override
	public String makeString() {
		return name;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		return name.equals(((JResource) o).name);
	}

	@Override
	public int hashCode() {
		return name.hashCode();
	}

}


text:
import {Component} from "./component";

/**
 * Add prefix word on the decorated field.
 * @decorator
 * @formio
 * @property
 * @schema
 */
export function Prefix(prefix: string) {
  return Component({
    prefix
  });
}


text:
/* WiFi station Example

   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"

#include "lwip/err.h"
#include "lwip/sys.h"

/* The examples use WiFi configuration that you can set via project configuration menu

   If you'd rather not, just change the below entries to strings with
   the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid"
*/
#define EXAMPLE_ESP_WIFI_SSID      CONFIG_ESP_WIFI_SSID
#define EXAMPLE_ESP_WIFI_PASS      CONFIG_ESP_WIFI_PASSWORD
#define EXAMPLE_ESP_MAXIMUM_RETRY  CONFIG_ESP_MAXIMUM_RETRY

#if CONFIG_ESP_WIFI_AUTH_OPEN
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_OPEN
#elif CONFIG_ESP_WIFI_AUTH_WEP
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WEP
#elif CONFIG_ESP_WIFI_AUTH_WPA_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA2_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA_WPA2_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_WPA2_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA3_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA3_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA2_WPA3_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_WPA3_PSK
#elif CONFIG_ESP_WIFI_AUTH_WAPI_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WAPI_PSK
#endif

/* FreeRTOS event group to signal when we are connected*/
static EventGroupHandle_t s_wifi_event_group;

/* The event group allows multiple bits for each event, but we only care about two events:
 * - we are connected to the AP with an IP
 * - we failed to connect after the maximum amount of retries */
#define WIFI_CONNECTED_BIT BIT0
#define WIFI_FAIL_BIT      BIT1

static const char *TAG = "wifi station";

static int s_retry_num = 0;

static void event_handler(void* arg, esp_event_base_t event_base,
                                int32_t event_id, void* event_data)
{
    if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
        esp_wifi_connect();
    } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
        if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) {
            esp_wifi_connect();
            s_retry_num++;
            ESP_LOGI(TAG, "retry to connect to the AP");
        } else {
            xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
        }
        ESP_LOGI(TAG,"connect to the AP fail");
    } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
        ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
        ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
        s_retry_num = 0;
        xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
    }
}

void wifi_init_sta(void)
{
    s_wifi_event_group = xEventGroupCreate();

    ESP_ERROR_CHECK(esp_netif_init());

    ESP_ERROR_CHECK(esp_event_loop_create_default());
    esp_netif_create_default_wifi_sta();

    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));

    esp_event_handler_instance_t instance_any_id;
    esp_event_handler_instance_t instance_got_ip;
    ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                                                        ESP_EVENT_ANY_ID,
                                                        &event_handler,
                                                        NULL,
                                                        &instance_any_id));
    ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
                                                        IP_EVENT_STA_GOT_IP,
                                                        &event_handler,
                                                        NULL,
                                                        &instance_got_ip));

    wifi_config_t wifi_config = {
        .sta = {
            .ssid = EXAMPLE_ESP_WIFI_SSID,
            .password = EXAMPLE_ESP_WIFI_PASS,
            /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (pasword len => 8).
             * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value
             * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to
	     * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards.
             */
            .threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD,
            .sae_pwe_h2e = WPA3_SAE_PWE_BOTH,
        },
    };
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
    ESP_ERROR_CHECK(esp_wifi_start() );

    ESP_LOGI(TAG, "wifi_init_sta finished.");

    /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
     * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */
    EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,
            WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
            pdFALSE,
            pdFALSE,
            portMAX_DELAY);

    /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
     * happened. */
    if (bits & WIFI_CONNECTED_BIT) {
        ESP_LOGI(TAG, "connected to ap SSID:%s password:%s",
                 EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
    } else if (bits & WIFI_FAIL_BIT) {
        ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",
                 EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
    } else {
        ESP_LOGE(TAG, "UNEXPECTED EVENT");
    }
}

void app_main(void)
{
    //Initialize NVS
    esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
      ESP_ERROR_CHECK(nvs_flash_erase());
      ret = nvs_flash_init();
    }
    ESP_ERROR_CHECK(ret);

    ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
    wifi_init_sta();
}


text:
using System;
using System.Linq;

namespace Sharp48.Solvers.Evaluators.RowEvaluation
{
    public class MonotonicityEvaluator : RowEvaluatorBase
    {
        protected override double EvaluateImplementation(uint[] tiles)
        {
            var monotonicityLeft = 0d;
            var monotonicityRight = 0d;
            for (var i = 1; i < 4; ++i)
            {
                if (tiles[i - 1] > tiles[i])
                    monotonicityLeft += tiles[i - 1] - tiles[i];
                else
                    monotonicityRight += tiles[i] - tiles[i - 1];
            }
            return Math.Min(monotonicityLeft, monotonicityRight);
        }
    }
}


text:
package com.intellij.execution;

import com.intellij.execution.actions.RunContextAction;
import com.intellij.execution.configurations.ConfigurationPerRunnerSettings;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.runners.ProgramRunner;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.*;
import com.intellij.openapi.util.Trinity;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.messages.MessageBusConnection;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author spleaner
 */
public class ExecutorRegistryImpl extends ExecutorRegistry {
  private static final Logger LOG = Logger.getInstance("#com.intellij.execution.ExecutorRegistryImpl");

  @NonNls public static final String RUNNERS_GROUP = "RunnerActions";
  @NonNls public static final String RUN_CONTEXT_GROUP = "RunContextGroup";

  private List<Executor> myExecutors = new ArrayList<Executor>();
  private ActionManager myActionManager;
  private final Map<String, Executor> myId2Executor = new HashMap<String, Executor>();
  private final Set<String> myContextActionIdSet = new HashSet<String>();
  private final Map<String, AnAction> myId2Action = new HashMap<String, AnAction>();
  private final Map<String, AnAction> myContextActionId2Action = new HashMap<String, AnAction>();

  // [Project, ExecutorId, RunnerId]
  private final Set<Trinity<Project, String, String>> myInProgress = new java.util.HashSet<Trinity<Project, String, String>>();

  public ExecutorRegistryImpl(ActionManager actionManager) {
    myActionManager = actionManager;
  }

  synchronized void initExecutor(@NotNull final Executor executor) {
    if (myId2Executor.get(executor.getId()) != null) {
      LOG.error("Executor with id: \"" + executor.getId() + "\" was already registered!");
    }

    if (myContextActionIdSet.contains(executor.getContextActionId())) {
      LOG.error("Executor with context action id: \"" + executor.getContextActionId() + "\" was already registered!");
    }

    myExecutors.add(executor);
    myId2Executor.put(executor.getId(), executor);
    myContextActionIdSet.add(executor.getContextActionId());

    registerAction(executor.getId(), new ExecutorAction(executor), RUNNERS_GROUP, myId2Action);
    registerAction(executor.getContextActionId(), new RunContextAction(executor), RUN_CONTEXT_GROUP, myContextActionId2Action);
  }

  private void registerAction(@NotNull final String actionId, @NotNull final AnAction anAction, @NotNull final String groupId, @NotNull final Map<String, AnAction> map) {
    AnAction action = myActionManager.getAction(actionId);
    if (action == null) {
      myActionManager.registerAction(actionId, anAction);
      map.put(actionId, anAction);
      action = anAction;
    }

    final DefaultActionGroup group = (DefaultActionGroup) myActionManager.getAction(groupId);
    group.add(action);
  }

  synchronized void deinitExecutor(@NotNull final Executor executor) {
    myExecutors.remove(executor);
    myId2Executor.remove(executor.getId());
    myContextActionIdSet.remove(executor.getContextActionId());

    unregisterAction(executor.getId(), RUNNERS_GROUP, myId2Action);
    unregisterAction(executor.getContextActionId(), RUN_CONTEXT_GROUP, myContextActionId2Action);
  }

  private void unregisterAction(@NotNull final String actionId, @NotNull final String groupId, @NotNull final Map<String, AnAction> map) {
    final DefaultActionGroup group = (DefaultActionGroup)myActionManager.getAction(groupId);
    if (group != null) {
      group.remove(myActionManager.getAction(actionId));
      final AnAction action = map.get(actionId);
      if (action != null) {
        myActionManager.unregisterAction(actionId);
        map.remove(actionId);
      }
    }
  }

  @NotNull
  public synchronized Executor[] getRegisteredExecutors() {
    return myExecutors.toArray(new Executor[myExecutors.size()]);
  }

  public Executor getExecutorById(final String executorId) {
    return myId2Executor.get(executorId);
  }

  @NonNls
  @NotNull
  public String getComponentName() {
    return "ExecutorRegistyImpl";
  }

  public void initComponent() {
    ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
      public void projectOpened(final Project project) {
        final MessageBusConnection connect = project.getMessageBus().connect(project);
        connect.subscribe(ExecutionManager.EXECUTION_TOPIC, new ExecutionAdapter(){
          public void processStartScheduled(String executorId, ExecutionEnvironment env) {
            myInProgress.add(createExecutionId(executorId, env, project));
          }

          public void processNotStarted(String executorId, @NotNull ExecutionEnvironment env) {
            myInProgress.remove(createExecutionId(executorId, env, project));
          }

          public void processStarted(String executorId, @NotNull ExecutionEnvironment env, @NotNull ProcessHandler handler) {
            myInProgress.remove(createExecutionId(executorId, env, project));
          }
        });
      }
    });

    final Executor[] executors = Extensions.getExtensions(Executor.EXECUTOR_EXTENSION_NAME);
    for (Executor executor : executors) {
      initExecutor(executor);
    }
  }

  private static Trinity<Project, String, String> createExecutionId(String executorId, ExecutionEnvironment env, Project project) {
    final ConfigurationPerRunnerSettings settings = env.getConfigurationSettings();
    return new Trinity<Project, String, String>(project, executorId, settings != null? settings.getRunnerId() : null);
  }

  public boolean isStarting(Project project, final String executorId, final String runnerId) {
    return myInProgress.contains(new Trinity<Project, String, String>(project, executorId, runnerId));
  }

  public synchronized void disposeComponent() {
    if (myExecutors.size() > 0) {
      List<Executor> executors = new ArrayList<Executor>(myExecutors);
      for (Executor executor : executors) {
        deinitExecutor(executor);
      }

      myExecutors = null;
    }

    myActionManager = null;
  }

  private class ExecutorAction extends AnAction implements DumbAware {
    private final Executor myExecutor;

    private ExecutorAction(@NotNull final Executor executor) {
      super(executor.getStartActionText(), executor.getActionName(), executor.getIcon());
      myExecutor = executor;
    }

    public void update(final AnActionEvent e) {
      super.update(e);

      final Presentation presentation = e.getPresentation();
      boolean enabled = false;
      final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());

      if (project == null || !project.isInitialized() || project.isDisposed() || DumbService.getInstance(project).isDumb()) {
        presentation.setEnabled(false);
        return;
      }

      final RunnerAndConfigurationSettings selectedConfiguration = getConfiguration(project);
      if (selectedConfiguration != null) {
        final ProgramRunner runner = RunnerRegistry.getInstance().getRunner(myExecutor.getId(), selectedConfiguration.getConfiguration());
        enabled = runner != null && !isStarting(project, myExecutor.getId(), runner.getRunnerId());

        if (enabled) {
          presentation.setDescription(myExecutor.getDescription());
        }
      }

      String text = getTemplatePresentation().getTextWithMnemonic();

      presentation.setEnabled(enabled);
      presentation.setText(text);
    }

    @Nullable
    private RunnerAndConfigurationSettings getConfiguration(@NotNull final Project project) {
      return RunManagerEx.getInstanceEx(project).getSelectedConfiguration();
    }

    public void actionPerformed(final AnActionEvent e) {
      final DataContext dataContext = e.getDataContext();
      final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
      if (project == null || project.isDisposed()) {
        return;
      }
      final RunnerAndConfigurationSettings configuration = getConfiguration(project);
      if (configuration == null) {
        return;
      }
      ProgramRunnerUtil.executeConfiguration(project, configuration, myExecutor);
    }
  }
}


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: occul_000
 * Date: 03/03/13
 * Time: 23:02
 * To change this template use File | Settings | File Templates.
 */
class Comment
{

      private $id, $job, $user_publish, $postId, $body;

    function __construct($id, $body, $job, $postId, $user_publish)
    {
        $this->body = $body;
        $this->id = $id;
        $this->job = $job;
        $this->postId = $postId;
        $this->user_publish = $user_publish;
    }

    public function setBody($body)
    {
        $this->body = $body;
    }

    public function getBody()
    {
        return $this->body;
    }

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setJob($job)
    {
        $this->job = $job;
    }

    public function getJob()
    {
        return $this->job;
    }

    public function setPost($post)
    {
        $this->post = $post;
    }

    public function getPost()
    {
        return $this->post;
    }

    public function setUserPublish($user_publish)
    {
        $this->user_publish = $user_publish;
    }

    public function getUserPublish()
    {
        return $this->user_publish;
    }

}


text:
static id OBJCInitWithArg(id  target,
                          SEL initializer,
                          id  argument)
{
    IMP imp = [target methodForSelector:initializer];
    id (*initFunc)(id, SEL, id) = (void *)imp;
    return initFunc(target, initializer, argument);
}

@implementation OBJCObjectFactory

+ (id)create:(NSString *)className
{
    return [NSClassFromString(className) new];
}

+ (id)create:(NSString *)className
 initializer:(SEL)init
    argument:(id)arg
{
    Class class = NSClassFromString(className);
    return (class && init)
    ? OBJCInitWithArg([class alloc], init, arg)
    : nil;
}

+ (NSError*)tryCatch:(void (^)())tryBlock convertNSException:(NSError *(^)(NSException *))convertNSException
{
    NSError *error = nil;
    @try {
        tryBlock();
    }
    @catch (NSException *exception) {
        error = convertNSException(exception);
    }
    @finally {
        return error;
    }
}

@end


text:
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by fpdfsdkdll.rc
//

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        104
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1000
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif


text:
//
//  LHManage.h
//  lhfmdb
//
//  Created by 刘辉 on 2017/8/24.
//  Copyright © 2017年 刘辉. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <FMDB/FMDB.h>

@interface LHManage : NSObject

@property(nonatomic,retain)FMDatabase*db;
@property(nonatomic,retain)NSString*dbPath;
@property(nonatomic,retain)FMDatabaseQueue*dbQueue;

/**
 单例方法
 */
+(instancetype)sharedLH;
/**
 根据一个类创建一个表且指定一个PRIMARYKEY(PRIMARYKEY必须未当前类的某一个属性名)
 */
- (BOOL)initLHDBWithPRIMARYKEY:(NSString*)PRIMARYKEY forClass:(Class)modleClass;
/**
 添加一个模型
 */
- (void)addGoods:(id)model;
/**
 修改模型的一个字段(目前只支持单个表的单个字段的修改)
 */
- (BOOL)updateGoodsWithModelClass:(Class)modelClass withPRIMARYKEYValue:(NSString*)PRIMARYKEYValue withKey:(NSString*)key withValue:(NSString*)value;
/**
 查询所有模型
 */
- (NSArray*)searchAllModelWithModle:(Class)model;
/**
 查询单个字段
 */
- (id)searchAProWithPRIMARYKEYValue:(NSString*)PRIMARYKEYValue withKey:(NSString*)key withModelClass:(Class)modelClass;
/**
 插入一个列
 */
/**
 删除某个记录
 */
- (BOOL)deleteAElementWithPRIMARYKEYValue:(NSString*)PRIMARYKEYValue withModelClass:(Class)modelClass;
/**
 删除数据库
 */
- (BOOL)deleteTableWithModleClass:(Class)modelClass;

@end


text:
from django import template
from django.db.models import Q, get_model

PageGroup = get_model('fancypages', 'PageGroup')
FancyPage = get_model('fancypages', 'FancyPage')

register = template.Library()

def build_tree(root, parent, data, depth):
    for instance in data[depth]:
        if not parent or instance.is_child_of(parent):
            node = (instance, [])
            if depth < len(data) - 1:
                build_tree(node[1], instance, data, depth + 1)
            root.append(node)
    return root

@register.assignment_tag
def get_pages(group):
    """
    Get pages within the same page group where *group* is the slug of the
    PageGroup object. Only visible pages within this group are returned and
    are not reflecting their tree structure. A simple queryset is returned.
    """
    if isinstance(group, PageGroup):
        group = group.slug
    return FancyPage._default_manager.visible(groups__slug=group)

@register.assignment_tag
def get_page_tree(group=None, depth=1, relative_to=None):
    depth_offset = 0
    pages = FancyPage.objects.all()

    if relative_to:
        depth_offset = relative_to.depth
        pages = pages.filter(
            Q(node__path__startswith=relative_to.path) &
            ~Q(node__path=relative_to.path))

    pages = pages.filter(node__depth__lte=(depth + depth_offset))

    if group:
        if isinstance(group, PageGroup):
            group = group.slug
        pages = pages.filter(groups__slug=group)

    page_buckets = [[] for i in range(depth)]
    for page in pages:
        page_buckets[page.depth - depth_offset - 1].append(page)

    page_subtree = []
    build_tree(page_subtree, None, page_buckets, 0)

    return page_subtree


text:
#include "io/ClientSocket.h"
#ifndef WIN32
#include <netinet/tcp.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <unistd.h>
#endif
#include <sys/types.h>

#include <cstdio>
#include <memory>
#include <utility>
#include <vector>
#include <cerrno>
#include <iostream>
#include <string>
#include "io/validation.h"
#include "core/logging/LoggerConfiguration.h"

namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace io {

Socket::Socket(const std::shared_ptr<SocketContext> &context, const std::string &hostname, const uint16_t port, const uint16_t listeners = -1)
    : requested_hostname_(hostname),
      port_(port),
      addr_info_(0),
      socket_file_descriptor_(-1),
      socket_max_(0),
      total_written_(0),
      total_read_(0),
      is_loopback_only_(false),
      listeners_(listeners),
      canonical_hostname_(""),
      nonBlocking_(false),
      logger_(logging::LoggerFactory<Socket>::getLogger()) {
  FD_ZERO(&total_list_);
  FD_ZERO(&read_fds_);
  initialize_socket();
}

Socket::Socket(const std::shared_ptr<SocketContext> &context, const std::string &hostname, const uint16_t port)
    : Socket(context, hostname, port, 0) {
  initialize_socket();
}

Socket::Socket(const Socket &&other)
    : requested_hostname_(std::move(other.requested_hostname_)),
      port_(std::move(other.port_)),
      is_loopback_only_(false),
      addr_info_(std::move(other.addr_info_)),
      socket_file_descriptor_(other.socket_file_descriptor_),
      socket_max_(other.socket_max_.load()),
      listeners_(other.listeners_),
      total_list_(other.total_list_),
      read_fds_(other.read_fds_),
      canonical_hostname_(std::move(other.canonical_hostname_)),
      nonBlocking_(false),
      logger_(std::move(other.logger_)) {
  total_written_ = other.total_written_.load();
  total_read_ = other.total_read_.load();
}

Socket::~Socket() {
  closeStream();
}

void Socket::closeStream() {
  if (0 != addr_info_) {
    freeaddrinfo(addr_info_);
    addr_info_ = 0;
  }
  if (socket_file_descriptor_ >= 0 && socket_file_descriptor_ != INVALID_SOCKET) {
    logging::LOG_DEBUG(logger_) << "Closing " << socket_file_descriptor_;
#ifdef WIN32
    closesocket(socket_file_descriptor_);
#else
    close(socket_file_descriptor_);
#endif
    socket_file_descriptor_ = -1;
  }
  if (total_written_ > 0) {
    local_network_interface_.log_write(total_written_);
    total_written_ = 0;
  }
  if (total_read_ > 0) {
    local_network_interface_.log_read(total_read_);
    total_read_ = 0;
  }
}

void Socket::setNonBlocking() {
  if (listeners_ <= 0) {
    nonBlocking_ = true;
  }
}
#ifdef WIN32
int8_t Socket::createConnection(const addrinfo *p, struct in_addr &addr) {
#else
int8_t Socket::createConnection(const addrinfo *p, in_addr_t &addr) {
#endif
  if ((socket_file_descriptor_ = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == INVALID_SOCKET) {
    logger_->log_error("error while connecting to server socket");
    return -1;
  }

  setSocketOptions(socket_file_descriptor_);

  if (listeners_ <= 0 && !local_network_interface_.getInterface().empty()) {
    // bind to local network interface
#ifndef WIN32
    ifaddrs* list = NULL;
    ifaddrs* item = NULL;
    ifaddrs* itemFound = NULL;
    int result = getifaddrs(&list);
    if (result == 0) {
      item = list;
      while (item) {
        if ((item->ifa_addr != NULL) && (item->ifa_name != NULL) && (AF_INET == item->ifa_addr->sa_family)) {
          if (strcmp(item->ifa_name, local_network_interface_.getInterface().c_str()) == 0) {
            itemFound = item;
            break;
          }
        }
        item = item->ifa_next;
      }

      if (itemFound != NULL) {
        result = bind(socket_file_descriptor_, itemFound->ifa_addr, sizeof(struct sockaddr_in));
        if (result < 0)
          logger_->log_info("Bind to interface %s failed %s", local_network_interface_.getInterface(), strerror(errno));
        else
          logger_->log_info("Bind to interface %s", local_network_interface_.getInterface());
      }
      freeifaddrs(list);
    }
#endif
  }

  if (listeners_ > 0) {
    struct sockaddr_in *sa_loc = (struct sockaddr_in*) p->ai_addr;
    sa_loc->sin_family = AF_INET;
    sa_loc->sin_port = htons(port_);
    if (is_loopback_only_) {
      sa_loc->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    } else {
      sa_loc->sin_addr.s_addr = htonl(INADDR_ANY);
    }
    if (bind(socket_file_descriptor_, p->ai_addr, p->ai_addrlen) == -1) {
      logger_->log_error("Could not bind to socket, reason %s", strerror(errno));
      return -1;
    }
  }
  {
    if (listeners_ <= 0) {
      struct sockaddr_in sa_loc;
      memset(&sa_loc, 0x00, sizeof(sa_loc));
      sa_loc.sin_family = AF_INET;
      sa_loc.sin_port = htons(port_);

      // use any address if you are connecting to the local machine for testing
      // otherwise we must use the requested hostname
      if (IsNullOrEmpty(requested_hostname_) || requested_hostname_ == "localhost") {
        if (is_loopback_only_) {
          sa_loc.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
        } else {
          sa_loc.sin_addr.s_addr = htonl(INADDR_ANY);
        }
      } else {
#ifdef WIN32
        sa_loc.sin_addr.s_addr = addr.s_addr;
#else
        sa_loc.sin_addr.s_addr = addr;
#endif
      }
      if (connect(socket_file_descriptor_, (struct sockaddr*) &sa_loc, sizeof(sa_loc)) == -1) {
#ifdef WIN32
        int err = WSAGetLastError();
        if (err == WSAEADDRNOTAVAIL) {
          logger_->log_error("invalid or unknown IP");
        } else if (err == WSAECONNREFUSED) {
          logger_->log_error("Connection refused");
        } else {
          logger_->log_error("Unknown error");
        }

#endif
        closeStream();
        socket_file_descriptor_ = -1;
        return -1;
      }
    }
  }

  // listen
  if (listeners_ > 0) {
    if (listen(socket_file_descriptor_, listeners_) == -1) {
      return -1;
    } else {
      logger_->log_debug("Created connection with %d listeners", listeners_);
    }
  }
  // add the listener to the total set
  FD_SET(socket_file_descriptor_, &total_list_);
  socket_max_ = socket_file_descriptor_;
  logger_->log_debug("Created connection with file descriptor %d", socket_file_descriptor_);
  return 0;
}

int16_t Socket::initialize() {
  addrinfo hints = { sizeof(addrinfo) };
  memset(&hints, 0, sizeof hints);  // make sure the struct is empty
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_CANONNAME;
  if (listeners_ > 0)
    hints.ai_flags |= AI_PASSIVE;
  hints.ai_protocol = 0; /* any protocol */

  int errcode = getaddrinfo(requested_hostname_.c_str(), 0, &hints, &addr_info_);

  if (errcode != 0) {
    logger_->log_error("Saw error during getaddrinfo, error: %s", strerror(errno));
    return -1;
  }

  socket_file_descriptor_ = -1;

#ifndef WIN32
  in_addr_t addr;
#else
  in_addr addr;
#endif
  struct hostent *h;
#if defined( __MACH__ ) || defined(WIN32)
  h = gethostbyname(requested_hostname_.c_str());
#else
  const char *host;

  host = requested_hostname_.c_str();
  char buf[1024];
  struct hostent he;
  int hh_errno;
  gethostbyname_r(host, &he, buf, sizeof(buf), &h, &hh_errno);
#endif
  if (h == nullptr) {
    return -1;
  }
  memcpy(reinterpret_cast<char*>(&addr), h->h_addr_list[0], h->h_length);

  auto p = addr_info_;
  for (; p != NULL; p = p->ai_next) {
    if (IsNullOrEmpty(canonical_hostname_)) {
      if (!IsNullOrEmpty(p) && !IsNullOrEmpty(p->ai_canonname))
        canonical_hostname_ = p->ai_canonname;
    }
    // we've successfully connected
    if (port_ > 0 && createConnection(p, addr) >= 0) {
      // Put the socket in non-blocking mode:
      if (nonBlocking_) {
#ifndef WIN32
        if (fcntl(socket_file_descriptor_, F_SETFL, O_NONBLOCK) < 0) {
          // handle error
          logger_->log_error("Could not create non blocking to socket", strerror(errno));
        } else {
          logger_->log_debug("Successfully applied O_NONBLOCK to fd");
        }
#else
        u_long iMode = 1;
        if (ioctlsocket(socket_file_descriptor_, FIONBIO, &iMode) == NO_ERROR) {
          logger_->log_debug("Successfully applied O_NONBLOCK to fd");
        }
#endif
      }
      logger_->log_debug("Successfully created connection");
      return 0;
      break;
    }
  }

  logger_->log_debug("Could not find device for our connection");
  return -1;
}

int16_t Socket::select_descriptor(const uint16_t msec) {
  if (listeners_ == 0) {
    return socket_file_descriptor_;
  }

  struct timeval tv;

  read_fds_ = total_list_;

  tv.tv_sec = msec / 1000;
  tv.tv_usec = (msec % 1000) * 1000;

  std::lock_guard<std::recursive_mutex> guard(selection_mutex_);

  if (msec > 0)
    select(socket_max_ + 1, &read_fds_, NULL, NULL, &tv);
  else
    select(socket_max_ + 1, &read_fds_, NULL, NULL, NULL);

  for (int i = 0; i <= socket_max_; i++) {
    if (FD_ISSET(i, &read_fds_)) {
      if (i == socket_file_descriptor_) {
        if (listeners_ > 0) {
          struct sockaddr_storage remoteaddr;  // client address
          socklen_t addrlen = sizeof remoteaddr;
          int newfd = accept(socket_file_descriptor_, (struct sockaddr *) &remoteaddr, &addrlen);
          FD_SET(newfd, &total_list_);  // add to master set
          if (newfd > socket_max_) {    // keep track of the max
            socket_max_ = newfd;
          }
          return newfd;

        } else {
          return socket_file_descriptor_;
        }
        // we have a new connection
      } else {
        // data to be received on i
        return i;
      }
    }
  }

  logger_->log_debug("Could not find a suitable file descriptor or select timed out");

  return -1;
}

int16_t Socket::setSocketOptions(const SocketDescriptor sock) {
  int opt = 1;
#ifndef WIN32
#ifndef __MACH__
  if (setsockopt(sock, SOL_TCP, TCP_NODELAY, static_cast<void*>(&opt), sizeof(opt)) < 0) {
    logger_->log_error("setsockopt() TCP_NODELAY failed");
    close(sock);
    return -1;
  }
  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&opt), sizeof(opt)) < 0) {
    logger_->log_error("setsockopt() SO_REUSEADDR failed");
    close(sock);
    return -1;
  }

  int sndsize = 256 * 1024;
  if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char *>(&sndsize), sizeof(sndsize)) < 0) {
    logger_->log_error("setsockopt() SO_SNDBUF failed");
    close(sock);
    return -1;
  }

#else
  if (listeners_ > 0) {
    // lose the pesky "address already in use" error message
    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char *>(&opt), sizeof(opt)) < 0) {
      logger_->log_error("setsockopt() SO_REUSEADDR failed");
      close(sock);
      return -1;
    }
  }
#endif
#endif
  return 0;
}

std::string Socket::getHostname() const {
  return canonical_hostname_;
}

int Socket::writeData(std::vector<uint8_t> &buf, int buflen) {
  if (static_cast<int>(buf.capacity()) < buflen)
    return -1;
  return writeData(reinterpret_cast<uint8_t *>(&buf[0]), buflen);
}

// data stream overrides

int Socket::writeData(uint8_t *value, int size) {
  int ret = 0, bytes = 0;

  int fd = select_descriptor(1000);
  while (bytes < size) {
#ifdef WIN32
    const char *vts = (const char*)value;
    ret = send(fd, vts + bytes, size - bytes, 0);
#else
    ret = send(fd, value + bytes, size - bytes, 0);
#endif
    // check for errors
    if (ret <= 0) {
      close(fd);
      logger_->log_error("Could not send to %d, error: %s", fd, strerror(errno));
      return ret;
    }
    bytes += ret;
  }

  if (ret)
    logger_->log_trace("Send data size %d over socket %d", size, fd);
  total_written_ += bytes;
  return bytes;
}

template<typename T>
inline std::vector<uint8_t> Socket::readBuffer(const T& t) {
  std::vector<uint8_t> buf;
  buf.resize(sizeof t);
  readData(reinterpret_cast<uint8_t *>(&buf[0]), sizeof(t));
  return buf;
}

int Socket::write(uint64_t base_value, bool is_little_endian) {
  return Serializable::write(base_value, this, is_little_endian);
}

int Socket::write(uint32_t base_value, bool is_little_endian) {
  return Serializable::write(base_value, this, is_little_endian);
}

int Socket::write(uint16_t base_value, bool is_little_endian) {
  return Serializable::write(base_value, this, is_little_endian);
}

int Socket::read(uint64_t &value, bool is_little_endian) {
  auto buf = readBuffer(value);

  if (is_little_endian) {
    value = ((uint64_t) buf[0] << 56) | ((uint64_t) (buf[1] & 255) << 48) | ((uint64_t) (buf[2] & 255) << 40) | ((uint64_t) (buf[3] & 255) << 32) | ((uint64_t) (buf[4] & 255) << 24)
        | ((uint64_t) (buf[5] & 255) << 16) | ((uint64_t) (buf[6] & 255) << 8) | ((uint64_t) (buf[7] & 255) << 0);
  } else {
    value = ((uint64_t) buf[0] << 0) | ((uint64_t) (buf[1] & 255) << 8) | ((uint64_t) (buf[2] & 255) << 16) | ((uint64_t) (buf[3] & 255) << 24) | ((uint64_t) (buf[4] & 255) << 32)
        | ((uint64_t) (buf[5] & 255) << 40) | ((uint64_t) (buf[6] & 255) << 48) | ((uint64_t) (buf[7] & 255) << 56);
  }
  return sizeof(value);
}

int Socket::read(uint32_t &value, bool is_little_endian) {
  auto buf = readBuffer(value);

  if (is_little_endian) {
    value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
  } else {
    value = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24;
  }
  return sizeof(value);
}

int Socket::read(uint16_t &value, bool is_little_endian) {
  auto buf = readBuffer(value);

  if (is_little_endian) {
    value = (buf[0] << 8) | buf[1];
  } else {
    value = buf[0] | buf[1] << 8;
  }
  return sizeof(value);
}

int Socket::readData(std::vector<uint8_t> &buf, int buflen, bool retrieve_all_bytes) {
  if (static_cast<int>(buf.capacity()) < buflen) {
    buf.resize(buflen);
  }
  return readData(reinterpret_cast<uint8_t*>(&buf[0]), buflen, retrieve_all_bytes);
}

int Socket::readData(uint8_t *buf, int buflen, bool retrieve_all_bytes) {
  int32_t total_read = 0;
  while (buflen) {
    int16_t fd = select_descriptor(1000);
    if (fd < 0) {
      if (listeners_ <= 0) {
        logger_->log_debug("fd %d close %i", fd, buflen);
        close(socket_file_descriptor_);
      }
      return -1;
    }
#ifdef WIN32
    char *bfs = reinterpret_cast<char*>(buf);
    int bytes_read = recv(fd, bfs, buflen, 0);
#else
    int bytes_read = recv(fd, buf, buflen, 0);
#endif
    logger_->log_trace("Recv call %d", bytes_read);
    if (bytes_read <= 0) {
      if (bytes_read == 0) {
        logger_->log_debug("Other side hung up on %d", fd);
      } else {
        if (errno == EAGAIN || errno == EWOULDBLOCK) {
          // continue
          return -2;
        }
        logger_->log_error("Could not recv on %d, error: %s", fd, strerror(errno));
      }
      return -1;
    }
    buflen -= bytes_read;
    buf += bytes_read;
    total_read += bytes_read;
    if (!retrieve_all_bytes) {
      break;
    }
  }
  total_read_ += total_read;
  return total_read;
}

} /* namespace io */
} /* namespace minifi */
} /* namespace nifi */
} /* namespace apache */
} /* namespace org */


text:
package org.jbpm.process.core.timer.impl;

import org.drools.core.time.InternalSchedulerService;
import org.drools.core.time.Job;
import org.drools.core.time.JobContext;
import org.drools.core.time.JobHandle;
import org.drools.core.time.TimerService;
import org.drools.core.time.Trigger;
import org.drools.core.time.impl.TimerJobFactoryManager;
import org.drools.core.time.impl.TimerJobInstance;
import org.jbpm.process.core.timer.TimerServiceRegistry;
import org.kie.api.time.SessionClock;

import java.util.Collection;

/**
 * Simple delegate for timer service that fetches the real instance of timer service from
 * TimerServiceRegistry under "default" key.
 * That requires TimerService to be registered prior to using this delegate, which usually
 * means before any session is created.
 *
 * This delegate should be configured in session configuration so when initializing it will use
 * right TimerService implementation:
 * <code>
 *      Properties conf = new Properties();
 *      conf.setProperty("drools.timerService", "org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate");
 *      KieSessionConfiguration sessionConf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(conf);
 * </code>
 *
 */
public class RegisteredTimerServiceDelegate implements TimerService, InternalSchedulerService, SessionClock {

    private TimerService timerService;

    public RegisteredTimerServiceDelegate() {
        this("default");
    }

    public RegisteredTimerServiceDelegate(String timerServiceKey) {
        timerService = TimerServiceRegistry.getInstance().get(timerServiceKey);
        if (timerService == null) {
            throw new IllegalStateException("TimerService with key " + timerServiceKey + " was not found in the registry");
        }
    }

    @Override
    public JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger) {
        return timerService.scheduleJob(job, ctx, trigger);
    }

    @Override
    public boolean removeJob(JobHandle jobHandle) {

        return timerService.removeJob(jobHandle);
    }

    @Override
    public void setTimerJobFactoryManager(
            TimerJobFactoryManager timerJobFactoryManager) {
        timerService.setTimerJobFactoryManager(timerJobFactoryManager);
    }

    @Override
    public TimerJobFactoryManager getTimerJobFactoryManager() {
        return timerService.getTimerJobFactoryManager();
    }

    @Override
    public void internalSchedule(TimerJobInstance timerJobInstance) {
        ((InternalSchedulerService)timerService).internalSchedule(timerJobInstance);
    }

    @Override
    public long getCurrentTime() {
        return timerService.getCurrentTime();
    }

    @Override
    public void shutdown() {
        timerService.shutdown();
    }

    @Override
    public long getTimeToNextJob() {
        return timerService.getTimeToNextJob();
    }

    @Override
    public Collection<TimerJobInstance> getTimerJobInstances(long id) {
        return timerService.getTimerJobInstances(id);
    }

}


text:
using namespace eyesore;

using std::string;
using std::ifstream;
using std::cout;
using std::endl;

eyesore::Scene::Scene(string path, Camera *camera): camera(camera)
{
	GLint viewport[4];

	glGetIntegerv(GL_VIEWPORT,  viewport);

	width = viewport[2];
	height = viewport[3];

	Shader vert("../shaders/vert.glsl", GL_VERTEX_SHADER);
	Shader frag("../shaders/frag.glsl", GL_FRAGMENT_SHADER);

	shader.attach(vert);
	shader.attach(frag);
	shader.link();
	shader.use();

	ifstream file(path);
	string line;

	while (getline(file, line)) {
		auto i = line.find(" ");
		string type = line.substr(0, i);

		if (type == "MODEL")
			models.push_back(Model(line.substr(i + 1)));
		else if (type == "ENV")
			environment = new Environment(line.substr(i + 1), camera);
	}
}

void eyesore::Scene::add(Model model)
{
	models.push_back(model);
}

void eyesore::Scene::render()
{
	glViewport(0, 0, width, height);

	shader.use();
	environment->use();

	for (Model &model : models)
		model.render(*camera);

	environment->render();
}


text:
<?php

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.model');

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');

class K2ModelUserGroup extends K2Model
{

    function getData()
    {
        $cid = JRequest::getVar('cid');
        $row = JTable::getInstance('K2UserGroup', 'Table');
        $row->load($cid);
        return $row;
    }

    function save()
    {
        $mainframe = JFactory::getApplication();
        $row = JTable::getInstance('K2UserGroup', 'Table');

        if (!$row->bind(JRequest::get('post')))
        {
        	$mainframe->enqueueMessage($row->getError(), 'error');
            $mainframe->redirect('index.php?option=com_k2&view=usergroups');
        }

        if (!$row->check())
        {
        	$mainframe->enqueueMessage($row->getError(), 'error');
            $mainframe->redirect('index.php?option=com_k2&view=usergroup&cid='.$row->id);
        }

        if (!$row->store())
        {
        	$mainframe->enqueueMessage($row->getError(), 'error');
            $mainframe->redirect('index.php?option=com_k2&view=usergroups');
        }

        $cache = JFactory::getCache('com_k2');
        $cache->clean();

        switch(JRequest::getCmd('task'))
        {
            case 'apply' :
                $msg = JText::_('K2_CHANGES_TO_USER_GROUP_SAVED');
                $link = 'index.php?option=com_k2&view=usergroup&cid='.$row->id;
                break;
            case 'save' :
            default :
                $msg = JText::_('K2_USER_GROUP_SAVED');
                $link = 'index.php?option=com_k2&view=usergroups';
                break;
        }
		$mainframe->enqueueMessage($msg);
        $mainframe->redirect($link);
    }

}


text:
namespace SurgSim
{
namespace Physics
{

/// A description of a physical mixed LCP system to be solved.
///

/// This extends \ref SurgSim::Math::MlcpProblem "the pure mathematical MLCP problem" by storing the intermediate
/// matrices \ref H and \ref CHt that are necessary to physically interpret the solution.
///
/// Note that the matrix \f$\mathbf{A}\f$ used in the MlcpProblem is computed in the physical problem as
/// \f$\mathbf{H\;C\;H^T}\f$, where \f$\mathbf{C}\f$ is the compliance matrix.  For contact constraints, \f$b\f$ is
/// the initial signed displacements between the colliding representations, \f$b_i \lt 0\f$ when the representations
/// interpenetrate, \f$x\f$ is the forces to apply at each contact to prevent penetration, and \f$c\f$ is the signed
/// displacements after the forces are applied.
/// \note The solution to the MLCP will only address the constraints that were provided, and application of \f$x\f$ to
/// the representations in the scene may cause new collisions for constraints that were not originally incorporated in
/// the MLCP.
///
/// \sa SurgSim::Math::MlcpProblem
struct MlcpPhysicsProblem : public SurgSim::Math::MlcpProblem
{
	/// Destructor
	~MlcpPhysicsProblem() override;

	/// The matrix \f$\mathbf{H}\f$, which is a matrix of size \f$c\times n\f$ that converts from
	/// the \f$n\f$ degrees of freedom in the system (i.e., the sum of all the DOF over all the representations in the
	/// scene), to the
	/// \f$c\f$ degrees of freedom summed over all the constraints being applied to the system.
	/// It is used to convert the vector of \f$n\f$ displacements of each degree of freedom of the system to the vector
	/// of \f$c\f$ displacements of each degree of freedom of the constraints.
	/// Given a set of constraints \f$\mathbf{G}(t, \mathbf{x})\f$, then
	/// \f$\mathbf{H} = \frac{d \mathbf{G}}{d \mathbf{x}}\f$ (i.e., the constraints' tangential space).
	Eigen::SparseMatrix<double, Eigen::RowMajor, ptrdiff_t> H;

	/// The matrix \f$\mathbf{C\;H^T}\f$, which is a matrix of size \f$n\times c\f$ that is used to convert the
	/// vector of \f$c\f$ constraint forces to the \f$n\f$ displacements of each degree of freedom of the system.
	Matrix CHt;

	/// Applies a new constraint to a specific Representation
	/// \param newSubH New constraint to be added to H
	/// \param newCHt Compliance matrix (system matrix inverse) times newSubH
	/// \param indexSubC Index of the Representation's compliance matrix
	/// \param indexNewSubH Index of the new constraint within H
	void updateConstraint(
		const Eigen::SparseVector<double, Eigen::RowMajor, ptrdiff_t>& newSubH,
		const Vector& newCHt,
		size_t indexSubC,
		size_t indexNewSubH);

	/// Resize an MlcpPhysicsProblem and set to zero.
	/// \param numDof the total degrees of freedom.
	/// \param numConstraintDof the total constrained degrees of freedom.
	/// \param numConstraints the number of constraints.
	void setZero(size_t numDof, size_t numConstraintDof, size_t numConstraints) override;

	/// Initialize an MlcpPhysicsProblem with zero values.
	/// \param numDof the total degrees of freedom for the MlcpPhysicsProblem to be constructed.
	/// \param numConstraintDof the total constrained degrees of freedom for the MlcpPhysicsProblem to be constructed.
	/// \param numConstraints the number of constraints for the MlcpPhysicsProblem to be constructed.
	/// \return An MlcpPhysicsProblem appropriately sized and initialized to zero.
	static MlcpPhysicsProblem Zero(size_t numDof, size_t numConstraintDof, size_t numConstraints);
};

};  // namespace Physics
};  // namespace SurgSim

#endif  // SURGSIM_PHYSICS_MLCPPHYSICSPROBLEM_H


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using System.ComponentModel;
using osu.Game.Screens.Tournament;
using osu.Game.Screens.Tournament.Teams;

namespace osu.Game.Tests.Visual
{
    [Description("for tournament use")]
    public class TestCaseDrawings : ScreenTestCase
    {
        public TestCaseDrawings()
        {
            LoadScreen(new Drawings
            {
                TeamList = new TestTeamList(),
            });
        }

        private class TestTeamList : ITeamList
        {
            public IEnumerable<DrawingsTeam> Teams { get; } = new[]
            {
                new DrawingsTeam
                {
                    FlagName = "GB",
                    FullName = "United Kingdom",
                    Acronym = "UK"
                },
                new DrawingsTeam
                {
                    FlagName = "FR",
                    FullName = "France",
                    Acronym = "FRA"
                },
                new DrawingsTeam
                {
                    FlagName = "CN",
                    FullName = "China",
                    Acronym = "CHN"
                },
                new DrawingsTeam
                {
                    FlagName = "AU",
                    FullName = "Australia",
                    Acronym = "AUS"
                },
                new DrawingsTeam
                {
                    FlagName = "JP",
                    FullName = "Japan",
                    Acronym = "JPN"
                },
                new DrawingsTeam
                {
                    FlagName = "RO",
                    FullName = "Romania",
                    Acronym = "ROM"
                },
                new DrawingsTeam
                {
                    FlagName = "IT",
                    FullName = "Italy",
                    Acronym = "PIZZA"
                },
                new DrawingsTeam
                {
                    FlagName = "VE",
                    FullName = "Venezuela",
                    Acronym = "VNZ"
                },
                new DrawingsTeam
                {
                    FlagName = "US",
                    FullName = "United States of America",
                    Acronym = "USA"
                },
            };
        }
    }
}


text:
module Rokuby
  # This class describes how a library instance can be found on a system.
  # [LibraryFileSpec] The file specification for the library file.
  # [LinkFileSpec] The file specification for the file that should be linked against.
  # [IncludeFileSpec] The file specification for the include files of the library.
  class LibraryLocationSpec < InformationSpecification
    attr_accessor :LibraryFileSpec
    attr_accessor :LinkFileSpec
    attr_accessor :IncludeFileSpec

    def initialize(valueMap=nil)
      @LibraryFileSpec = FileSpecification.new()
      @LinkFileSpec = FileSpecification.new()
      @IncludeFileSpec = FileSpecification.new()
      super(valueMap)
      Extend(valueMap, false)
    end

    def initialize_copy(original)
      super(original)
      @LibraryFileSpec = Clone(original.LibraryFileSpec)
      @LinkFileSpec = Clone(original.LinkFileSpec)
      @IncludeFileSpec = Clone(original.IncludeFileSpec)
    end

    # Gather the defines from this information unit and all subunits.
    def GatherDefines()
      defines = @Defines
      defines.concat(@LibraryFileSpec.GatherDefines())
      defines.concat(@LinkFileSpec.GatherDefines())
      defines.concat(@IncludeFileSpec.GatherDefines())
      return defines
    end

    def Extend(valueMap, callParent=true)
      if(valueMap == nil)
        return
      end

      if(callParent)
        super(valueMap)
      end

      libraryFileSpec = valueMap[:LibraryFileSpec] || valueMap[:libSpec]
      if(libraryFileSpec)
        @LibraryFileSpec = libraryFileSpec
      end

      linkFileSpec = valueMap[:LinkFileSpec] || valueMap[:linkSpec]
      if(linkFileSpec)
        @LinkFileSpec = linkFileSpec
      end

      includeFileSpec = valueMap[:IncludeFileSpec] || valueMap[:inclSpec]
      if(includeFileSpec)
        @IncludeFileSpec = includeFileSpec
      end
    end
  end
end


text:
require 'nokogiri'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class AuthorizeNetGateway < Gateway
      include Empty

      self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
      self.live_url = 'https://api.authorize.net/xml/v1/request.api'

      self.supported_countries = %w(AD AT AU BE BG CA CH CY CZ DE DK ES FI FR GB GB GI GR HU IE IT LI LU MC MT NL NO PL PT RO SE SI SK SM TR US VA)
      self.default_currency = 'USD'
      self.money_format = :dollars
      self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]

      self.homepage_url = 'http://www.authorize.net/'
      self.display_name = 'Authorize.Net'

      class_attribute :duplicate_window

      APPROVED, DECLINED, ERROR, FRAUD_REVIEW = 1, 2, 3, 4
      TRANSACTION_ALREADY_ACTIONED = %w(310 311)

      CARD_CODE_ERRORS = %w(N S)
      AVS_ERRORS = %w(A E N R W Z)
      AVS_REASON_CODES = %w(27 45)

      TRACKS = {
          1 => /^%(?<format_code>.)(?<pan>[\d]{1,19}+)\^(?<name>.{2,26})\^(?<expiration>[\d]{0,4}|\^)(?<service_code>[\d]{0,3}|\^)(?<discretionary_data>.*)\?\Z/,
          2 => /\A;(?<pan>[\d]{1,19}+)=(?<expiration>[\d]{0,4}|=)(?<service_code>[\d]{0,3}|=)(?<discretionary_data>.*)\?\Z/
      }.freeze

      APPLE_PAY_DATA_DESCRIPTOR = "COMMON.APPLE.INAPP.PAYMENT"

      def initialize(options={})
        requires!(options, :login, :password)
        super
      end

      def purchase(amount, payment, options = {})
        commit("AUTH_CAPTURE") do |xml|
          add_order_id(xml, options)
          xml.transactionRequest do
            xml.transactionType('authCaptureTransaction')
            xml.amount(amount(amount))

            add_payment_source(xml, payment)
            add_invoice(xml, options)
            add_customer_data(xml, payment, options)
            add_retail_data(xml, payment)
            add_settings(xml, payment, options)
            add_user_fields(xml, amount, options)
          end
        end
      end

      def authorize(amount, payment, options={})
        commit("AUTH_ONLY") do |xml|
          add_order_id(xml, options)
          xml.transactionRequest do
            xml.transactionType('authOnlyTransaction')
            xml.amount(amount(amount))

            add_payment_source(xml, payment)
            add_invoice(xml, options)
            add_customer_data(xml, payment, options)
            add_settings(xml, payment, options)
            add_user_fields(xml, amount, options)
          end
        end
      end

      def capture(amount, authorization, options={})
        commit("PRIOR_AUTH_CAPTURE") do |xml|
          add_order_id(xml, options)
          xml.transactionRequest do
            xml.transactionType('priorAuthCaptureTransaction')
            xml.amount(amount(amount))
            xml.refTransId(split_authorization(authorization)[0])

            add_invoice(xml, options)
            add_user_fields(xml, amount, options)
          end
        end
      end

      def refund(amount, authorization, options={})
        transaction_id, card_number = split_authorization(authorization)
        commit("CREDIT") do |xml|
          xml.transactionRequest do
            xml.transactionType('refundTransaction')
            xml.amount(amount.nil? ? 0 : amount(amount))
            xml.payment do
              xml.creditCard do
                xml.cardNumber(card_number || options[:card_number])
                xml.expirationDate('XXXX')
              end
            end
            xml.refTransId(transaction_id)

            add_customer_data(xml, nil, options)
            add_user_fields(xml, amount, options)
          end
        end
      end

      def void(authorization, options={})
        commit("VOID") do |xml|
          add_order_id(xml, options)
          xml.transactionRequest do
            xml.transactionType('voidTransaction')
            xml.refTransId(split_authorization(authorization)[0])

            add_user_fields(xml, nil, options)
          end
        end
      end

      def verify(credit_card, options = {})
        MultiResponse.run(:use_first_response) do |r|
          r.process { authorize(100, credit_card, options) }
          r.process(:ignore_result) { void(r.authorization, options) }
        end
      end

      def supports_scrubbing?
        true
      end

      def scrub(transcript)
        transcript.
          gsub(%r((<cardNumber>).+(</cardNumber>)), '\1[FILTERED]\2').
          gsub(%r((<cardCode>).+(</cardCode>)), '\1[FILTERED]\2')
      end

      private

      def add_payment_source(xml, source)
        return unless source
        if card_brand(source) == 'check'
          add_check(xml, source)
        elsif card_brand(source) == 'apple_pay'
          add_apple_pay_payment_token(xml, source)
        else
          add_credit_card(xml, source)
        end
      end

      def add_settings(xml, source, options)
        xml.transactionSettings do
          if card_brand(source) == "check" && options[:recurring]
            xml.setting do
              xml.settingName("recurringBilling")
              xml.settingValue("true")
            end
          end
          if options[:duplicate_window]
            set_duplicate_window(xml, options[:duplicate_window])
          elsif self.class.duplicate_window
            ActiveMerchant.deprecated "Using the duplicate_window class_attribute is deprecated. Use the transaction options hash instead."
            set_duplicate_window(xml, self.class.duplicate_window)
          end
        end
      end

      def set_duplicate_window(xml, value)
        xml.setting do
          xml.settingName("duplicateWindow")
          xml.settingValue(value)
        end
      end

      def add_user_fields(xml, amount, options)
        xml.userFields do
          if currency = (options[:currency] || currency(amount))
            xml.userField do
              xml.name("x_currency_code")
              xml.value(currency)
            end
          end
          if application_id.present? && application_id != "ActiveMerchant"
            xml.userField do
              xml.name("x_solution_id")
              xml.value(application_id)
            end
          end
        end
      end

      def add_credit_card(xml, credit_card)
        if credit_card.track_data
          add_swipe_data(xml, credit_card)
        else
          xml.payment do
            xml.creditCard do
              xml.cardNumber(credit_card.number)
              xml.expirationDate(format(credit_card.month, :two_digits) + '/' + format(credit_card.year, :four_digits))
              unless empty?(credit_card.verification_value)
                xml.cardCode(credit_card.verification_value)
              end
            end
          end
        end
      end

      def add_swipe_data(xml, credit_card)
        TRACKS.each do |key, regex|
          if regex.match(credit_card.track_data)
            @valid_track_data = true
            xml.payment do
              xml.trackData do
                xml.public_send(:"track#{key}", credit_card.track_data)
              end
            end
          end
        end
      end

      # http://developer.authorize.net/api/reference/#apple-pay-transactions
      def add_apple_pay_payment_token(xml, apple_pay_payment_token)
        xml.payment do
          xml.opaqueData do
            xml.dataDescriptor(APPLE_PAY_DATA_DESCRIPTOR)
            xml.dataValue(Base64.strict_encode64(apple_pay_payment_token.payment_data.to_json))
          end
        end
      end

      def add_retail_data(xml, payment)
        return unless valid_track_data
        xml.retail do
          # As per http://www.authorize.net/support/CP_guide.pdf, '2' is for Retail, the only current market_type
          xml.marketType(2)
        end
      end

      def valid_track_data
        @valid_track_data ||= false
      end

      def add_check(xml, check)
        xml.payment do
          xml.bankAccount do
            xml.routingNumber(check.routing_number)
            xml.accountNumber(check.account_number)
            xml.nameOnAccount(check.name)
            xml.echeckType("WEB")
            xml.bankName(check.bank_name)
            xml.checkNumber(check.number)
          end
        end
      end

      def add_customer_data(xml, payment_source, options)
        billing_address = options[:billing_address] || options[:address] || {}
        shipping_address = options[:shipping_address] || options[:address] || {}

        xml.customer do
          xml.id(options[:customer]) unless empty?(options[:customer]) || options[:customer] !~ /^\d+$/
          xml.email(options[:email]) unless empty?(options[:email])
        end

        xml.billTo do
          first_name, last_name = names_from(payment_source, billing_address, options)
          xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
          xml.lastName(truncate(last_name, 50)) unless empty?(last_name)

          xml.company(truncate(billing_address[:company], 50)) unless empty?(billing_address[:company])
          xml.address(truncate(billing_address[:address1], 60))
          xml.city(truncate(billing_address[:city], 40))
          xml.state(empty?(billing_address[:state]) ? 'n/a' : truncate(billing_address[:state], 40))
          xml.zip(truncate((billing_address[:zip] || options[:zip]), 20))
          xml.country(truncate(billing_address[:country], 60))
          xml.phoneNumber(truncate(billing_address[:phone], 25)) unless empty?(billing_address[:phone])
          xml.faxNumber(truncate(billing_address[:fax], 25)) unless empty?(billing_address[:fax])
        end

        unless shipping_address.blank?
          xml.shipTo do
            (first_name, last_name) = if shipping_address[:name]
              shipping_address[:name].split
            else
              [shipping_address[:first_name], shipping_address[:last_name]]
            end
            xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
            xml.lastName(truncate(last_name, 50)) unless empty?(last_name)

            xml.company(truncate(shipping_address[:company], 50)) unless empty?(shipping_address[:company])
            xml.address(truncate(shipping_address[:address1], 60))
            xml.city(truncate(shipping_address[:city], 40))
            xml.state(truncate(shipping_address[:state], 40))
            xml.zip(truncate(shipping_address[:zip], 20))
            xml.country(truncate(shipping_address[:country], 60))
          end
        end

        xml.customerIP(options[:ip]) unless empty?(options[:ip])

        xml.cardholderAuthentication do
          xml.authenticationIndicator(options[:authentication_indicator])
          xml.cardholderAuthenticationValue(options[:cardholder_authentication_value])
        end
      end

      def add_order_id(xml, options)
        xml.refId(truncate(options[:order_id], 20))
      end

      def add_invoice(xml, options)
        xml.order do
          xml.invoiceNumber(truncate(options[:order_id], 20))
          xml.description(truncate(options[:description], 255))
        end
      end

      def names_from(payment_source, address, options)
        if payment_source && !payment_source.is_a?(PaymentToken)
          first_name, last_name = (address[:name] || "").split
          [(payment_source.first_name || first_name), (payment_source.last_name || last_name)]
        else
          [options[:first_name], options[:last_name]]
        end
      end

      def commit(action, &payload)
        url = (test? ? test_url : live_url)
        response = parse(action, ssl_post(url, post_data(&payload), 'Content-Type' => 'text/xml'))

        avs_result = AVSResult.new(code: response[:avs_result_code])
        cvv_result = CVVResult.new(response[:card_code])
        if using_live_gateway_in_test_mode?(response)
          Response.new(false, "Using a live Authorize.net account in Test Mode is not permitted.")
        else
          Response.new(
            success_from(response),
            message_from(response, avs_result, cvv_result),
            response,
            authorization: authorization_from(response),
            test: test?,
            avs_result: avs_result,
            cvv_result: cvv_result,
            fraud_review: fraud_review?(response)
          )
        end
      end

      def post_data
        Nokogiri::XML::Builder.new do |xml|
          xml.createTransactionRequest('xmlns' => 'AnetApi/xml/v1/schema/AnetApiSchema.xsd') do
            xml.merchantAuthentication do
              xml.name(@options[:login])
              xml.transactionKey(@options[:password])
            end
            yield(xml)
          end
        end.to_xml(indent: 0)
      end

      def parse(action, body)
        doc = Nokogiri::XML(body)
        doc.remove_namespaces!

        response = {action: action}

        response[:response_code] = if(element = doc.at_xpath("//transactionResponse/responseCode"))
          (empty?(element.content) ? nil : element.content.to_i)
        end

        if(element = doc.at_xpath("//errors/error"))
          response[:response_reason_code] = element.at_xpath("errorCode").content[/0*(\d+)$/, 1]
          response[:response_reason_text] = element.at_xpath("errorText").content.chomp('.')
        elsif(element = doc.at_xpath("//transactionResponse/messages/message"))
          response[:response_reason_code] = element.at_xpath("code").content[/0*(\d+)$/, 1]
          response[:response_reason_text] = element.at_xpath("description").content.chomp('.')
        elsif(element = doc.at_xpath("//messages/message"))
          response[:response_reason_code] = element.at_xpath("code").content[/0*(\d+)$/, 1]
          response[:response_reason_text] = element.at_xpath("text").content.chomp('.')
        else
          response[:response_reason_code] = nil
          response[:response_reason_text] = ""
        end

        response[:avs_result_code] = if(element = doc.at_xpath("//avsResultCode"))
          (empty?(element.content) ? nil : element.content)
        end

        response[:transaction_id] = if(element = doc.at_xpath("//transId"))
          (empty?(element.content) ? nil : element.content)
        end

        response[:card_code] = if(element = doc.at_xpath("//cvvResultCode"))
          (empty?(element.content) ? nil : element.content)
        end

        response[:authorization_code] = if(element = doc.at_xpath("//authCode"))
          (empty?(element.content) ? nil : element.content)
        end

        response[:cardholder_authentication_code] = if(element = doc.at_xpath("//cavvResultCode"))
          (empty?(element.content) ? nil : element.content)
        end

        response[:account_number] = if(element = doc.at_xpath("//accountNumber"))
          (empty?(element.content) ? nil : element.content[-4..-1])
        end

        response[:test_request] = if(element = doc.at_xpath("//testRequest"))
          (empty?(element.content) ? nil : element.content)
        end

        response
      end

      def success_from(response)
        (
          response[:response_code] == APPROVED &&
          TRANSACTION_ALREADY_ACTIONED.exclude?(response[:response_reason_code])
        )
      end

      def message_from(response, avs_result, cvv_result)
        if response[:response_code] == DECLINED
          if CARD_CODE_ERRORS.include?(cvv_result.code)
            return cvv_result.message
          elsif(AVS_REASON_CODES.include?(response[:response_reason_code]) && AVS_ERRORS.include?(avs_result.code))
            return avs_result.message
          end
        end

        response[:response_reason_text]
      end

      def authorization_from(response)
        [response[:transaction_id], response[:account_number]].join("#")
      end

      def split_authorization(authorization)
        transaction_id, card_number = authorization.split("#")
        [transaction_id, card_number]
      end

      def fraud_review?(response)
        (response[:response_code] == FRAUD_REVIEW)
      end

      def truncate(value, max_size)
        return nil unless value
        value.to_s[0, max_size]
      end

      def using_live_gateway_in_test_mode?(response)
        !test? && response[:test_request] == "1"
      end
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Nova Hedwigia 59: 215 (1979)

#### Original name
Rhodophyllus pseudodochmiopus Romagn. & Gilles

### Remarks
null


text:
<!doctype html>

		<title>NexusUI Demo</title>

		<canvas nx="waveform" style="width:600px;height:300px;display:block;margin:100px auto 0px"></canvas>

Made with the waveform element of NexusUI


text:
#include <aws/kinesis/model/StreamStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Kinesis
  {
    namespace Model
    {
      namespace StreamStatusMapper
      {

        static const int CREATING_HASH = HashingUtils::HashString("CREATING");
        static const int DELETING_HASH = HashingUtils::HashString("DELETING");
        static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE");
        static const int UPDATING_HASH = HashingUtils::HashString("UPDATING");

        StreamStatus GetStreamStatusForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == CREATING_HASH)
          {
            return StreamStatus::CREATING;
          }
          else if (hashCode == DELETING_HASH)
          {
            return StreamStatus::DELETING;
          }
          else if (hashCode == ACTIVE_HASH)
          {
            return StreamStatus::ACTIVE;
          }
          else if (hashCode == UPDATING_HASH)
          {
            return StreamStatus::UPDATING;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<StreamStatus>(hashCode);
          }

          return StreamStatus::NOT_SET;
        }

        Aws::String GetNameForStreamStatus(StreamStatus enumValue)
        {
          switch(enumValue)
          {
          case StreamStatus::CREATING:
            return "CREATING";
          case StreamStatus::DELETING:
            return "DELETING";
          case StreamStatus::ACTIVE:
            return "ACTIVE";
          case StreamStatus::UPDATING:
            return "UPDATING";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return "";
          }
        }

      } // namespace StreamStatusMapper
    } // namespace Model
  } // namespace Kinesis
} // namespace Aws