text:
package com.redhat.ceylon.compiler.typechecker.analyzer;

import static com.redhat.ceylon.compiler.typechecker.analyzer.AnalyzerUtil.isAlwaysSatisfied;
import static com.redhat.ceylon.compiler.typechecker.analyzer.AnalyzerUtil.isAtLeastOne;
import static com.redhat.ceylon.compiler.typechecker.analyzer.AnalyzerUtil.isNeverSatisfied;
import static com.redhat.ceylon.compiler.typechecker.tree.TreeUtil.name;

import java.util.List;

import com.redhat.ceylon.compiler.typechecker.tree.Node;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;

/**
 * Validates that flow of control is well-defined. Checks
 * that control directives occur only where they are
 * allowed, and that every non-void method always ends via
 * return or throw.
 *
 * @author Gavin King
 *
 */
public class ControlFlowVisitor extends Visitor {

    private boolean definitelyReturns = false;
    private boolean definitelyBreaksOrContinues = false;
    private boolean canReturn = false;
    private boolean canExecute = true;
    private Boolean possiblyBreaks = null;
    private boolean unreachabilityReported = false;

    boolean beginDefiniteReturnScope() {
        boolean dr = definitelyReturns;
        definitelyReturns = false;
        return dr;
    }

    boolean beginIndefiniteReturnScope() {
        return definitelyReturns;
    }

    void endDefiniteReturnScope(boolean dr) {
        definitelyReturns = dr;
        unreachabilityReported = false;
    }

    void exit() {
        definitelyReturns = true;
    }

    boolean beginReturnScope(boolean cr) {
        boolean ocr = canReturn;
        canReturn = cr;
        return ocr;
    }

    void endReturnScope(boolean cr) {
        canReturn = cr;
    }

    boolean beginStatementScope(boolean ce) {
        boolean oce = canExecute;
        canExecute = ce;
        return oce;
    }

    void endStatementScope(boolean ce) {
        canExecute = ce;
    }

    Boolean beginLoop() {
        Boolean efl = possiblyBreaks;
        possiblyBreaks = false;
        return efl;
    }

    void endLoop(Boolean efl) {
        possiblyBreaks = efl;
    }

    boolean beginLoopScope() {
        boolean obc = definitelyBreaksOrContinues;
        definitelyBreaksOrContinues = false;
        return obc;
    }

    void exitLoopScope() {
    	definitelyBreaksOrContinues = true;
    }

    void endLoopScope(boolean bc) {
    	definitelyBreaksOrContinues = bc;
    }

    void exitLoop() {
        possiblyBreaks = true;
    }

    boolean inLoop() {
        return possiblyBreaks!=null;
    }

    Boolean pauseLoop() {
        Boolean efl = possiblyBreaks;
        possiblyBreaks = null;
        return efl;
    }

    void unpauseLoop(Boolean efl) {
        possiblyBreaks = efl;
    }

    boolean pauseLoopScope() {
        Boolean bc = definitelyBreaksOrContinues;
        definitelyBreaksOrContinues = false;
        return bc;
    }

    void unpauseLoopScope(boolean bc) {
    	definitelyBreaksOrContinues = bc;
    }

    @Override
    public void visit(Tree.AttributeGetterDefinition that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        checkDefiniteReturn(that, name(that.getIdentifier()));
        endDefiniteReturnScope(d);
        endReturnScope(c);
    }

    @Override
    public void visit(Tree.AttributeArgument that) {
        if (that.getSpecifierExpression()==null) {
            boolean c = beginReturnScope(true);
            boolean d = beginDefiniteReturnScope();
            super.visit(that);
            checkDefiniteReturn(that, name(that.getIdentifier()));
            endDefiniteReturnScope(d);
            endReturnScope(c);
        }
        else {
        	super.visit(that);
        }
    }

    private void checkDefiniteReturn(Node that, String name) {
        if (!definitelyReturns) {
            if (name==null) {
                name = "anonymous function";
            }
            else {
                name = "'" + name + "'";
            }
            that.addError("does not definitely return: " +
                    name + " has branches which do not end in a 'return' statement",
                    12100);
        }
    }

//    @Override
//    public void visit(Tree.MethodDeclaration that) {
//        if (that.getSpecifierExpression()!=null) {
//            checkExecutableStatementAllowed(that.getSpecifierExpression());
//            super.visit(that);
//        }
//    }
//
    @Override
    public void visit(Tree.MethodDefinition that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        if (!that.getDeclarationModel().isDeclaredVoid()) {
            checkDefiniteReturn(that, name(that.getIdentifier()));
        }
        endDefiniteReturnScope(d);
        endReturnScope(c);
    }

    @Override
    public void visit(Tree.MethodArgument that) {
        if (that.getSpecifierExpression()==null) {
        	boolean c = beginReturnScope(true);
        	boolean d = beginDefiniteReturnScope();
        	super.visit(that);
        	if (!that.getDeclarationModel().isDeclaredVoid()) {
        		checkDefiniteReturn(that, name(that.getIdentifier()));
        	}
        	endDefiniteReturnScope(d);
        	endReturnScope(c);
        }
        else {
        	super.visit(that);
        }
    }

    @Override
    public void visit(Tree.FunctionArgument that) {
        if (that.getExpression()==null) {
            Boolean efl = pauseLoop();
            boolean bc = pauseLoopScope();
        	boolean c = beginReturnScope(true);
        	boolean d = beginDefiniteReturnScope();
        	super.visit(that);
        	if (!(that.getDeclarationModel().isDeclaredVoid())) {
        		checkDefiniteReturn(that, null);
        	}
        	endDefiniteReturnScope(d);
        	endReturnScope(c);
            unpauseLoop(efl);
            unpauseLoopScope(bc);
        }
        else {
        	super.visit(that);
        }
    }

    @Override
    public void visit(Tree.AttributeDeclaration that) {
        if (!that.getDeclarationModel().isParameter() &&
            that.getSpecifierOrInitializerExpression()!=null &&
        		!(that.getSpecifierOrInitializerExpression() instanceof Tree.LazySpecifierExpression)) {
            checkExecutableStatementAllowed(that.getSpecifierOrInitializerExpression());
            super.visit(that);
        }
        else {
        	super.visit(that);
        }
    }

    @Override
    public void visit(Tree.AttributeSetterDefinition that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.Constructor that) {
        checkReachable(that);
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.Enumerated that) {
        checkReachable(that);
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.ClassDefinition that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.InterfaceDefinition that) {
        boolean c = beginReturnScope(false);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.ObjectDefinition that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.ObjectArgument that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.ObjectExpression that) {
        boolean c = beginReturnScope(true);
        boolean d = beginDefiniteReturnScope();
        super.visit(that);
        endReturnScope(c);
        endDefiniteReturnScope(d);
    }

    @Override
    public void visit(Tree.Body that) {
        boolean e = beginStatementScope(!(that instanceof Tree.InterfaceBody));
        super.visit(that);
        endStatementScope(e);
    }

    @Override
    public void visit(Tree.LazySpecifierExpression that) {
        boolean e = beginStatementScope(true);
        super.visit(that);
        endStatementScope(e);
    }

    @Override
    public void visit(Tree.Block that) {
        super.visit(that);
        that.setDefinitelyReturns(definitelyReturns);
    }

    @Override
    public void visit(Tree.Declaration that) {
        Boolean efl = pauseLoop();
        boolean bc = pauseLoopScope();
        super.visit(that);
        unpauseLoop(efl);
        unpauseLoopScope(bc);
    }

    @Override
    public void visit(Tree.TypedArgument that) {
        Boolean efl = pauseLoop();
        boolean bc = pauseLoopScope();
        super.visit(that);
        unpauseLoop(efl);
        unpauseLoopScope(bc);
    }

    @Override
    public void visit(Tree.ExecutableStatement that) {
    	boolean executable = true;
    	//shortcut refinement statements with => aren't really "executable"
    	if (that instanceof Tree.SpecifierStatement) {
    		Tree.SpecifierStatement s = (Tree.SpecifierStatement) that;
    		executable = !(s.getSpecifierExpression() instanceof Tree.LazySpecifierExpression) ||
    					!s.getRefinement();
    	}
		if (executable) {
    		checkExecutableStatementAllowed(that);
    	}
        super.visit(that);
    }

    private void checkExecutableStatementAllowed(Node that) {
        if (!canExecute) {
            that.addError("statement or initializer may not occur directly in interface body");
        }
    }

    @Override
    public void visit(Tree.Return that) {
        if (!canReturn) {
            that.addError("nothing to return from");
        }
        super.visit(that);
        exit();
        exitLoopScope();
    }

    @Override
    public void visit(Tree.Throw that) {
        super.visit(that);
        exit();
        exitLoopScope();
    }

    @Override
    public void visit(Tree.Break that) {
        if (!inLoop()) {
            that.addError("no surrounding loop to break");
        }
        super.visit(that);
        exitLoop();
        exitLoopScope();
    }

    @Override
    public void visit(Tree.Continue that) {
        if (!inLoop()) {
            that.addError("no surrounding loop to continue");
        }
        super.visit(that);
        exitLoopScope();
    }

    @Override
    public void visit(Tree.Statement that) {
        if (!(that instanceof Tree.Variable)) {
            checkReachable(that);
        }
        super.visit(that);
    }

    private void checkReachable(Tree.Statement that) {
        if (definitelyReturns || definitelyBreaksOrContinues) {
            if (!unreachabilityReported) {
                that.addError("unreachable code");
                unreachabilityReported = true;
            }
        }
    }

    @Override
    public void visit(Tree.WhileStatement that) {
        checkExecutableStatementAllowed(that);
        checkReachable(that);
        boolean d = beginIndefiniteReturnScope();
        Boolean b = beginLoop();
        boolean bc = beginLoopScope();
        that.getWhileClause().visit(this);
        boolean definitelyDoesNotBreakFromWhile = !possiblyBreaks;
        boolean definitelyReturnsFromWhile = definitelyReturns;
        endDefiniteReturnScope(d);
        endLoop(b);
        endLoopScope(bc);
        if (isAlwaysSatisfied(that.getWhileClause().getConditionList())) {
        	if (definitelyDoesNotBreakFromWhile
        			|| definitelyReturnsFromWhile) { //superfluous?
        		definitelyReturns = true;
        	}
        }
    }

    @Override
    public void visit(Tree.ForStatement that) {
        checkExecutableStatementAllowed(that);
        checkReachable(that);
        boolean d = beginIndefiniteReturnScope();

        Boolean b = beginLoop();
        boolean bc = beginLoopScope();
        boolean atLeastOneIteration = false;
        Tree.ForClause forClause = that.getForClause();
        if (forClause!=null) {
            forClause.visit(this);
            atLeastOneIteration = isAtLeastOne(forClause);
        }
        boolean definitelyDoesNotBreakFromFor = !possiblyBreaks;
        boolean definitelyReturnsFromFor = definitelyReturns &&
        		atLeastOneIteration && definitelyDoesNotBreakFromFor;
        that.setExits(possiblyBreaks);
        endLoop(b);
        endLoopScope(bc);

        definitelyReturns = d || definitelyReturnsFromFor;

        boolean definitelyReturnsFromElse;
        Tree.ElseClause elseClause = that.getElseClause();
        if (elseClause!=null) {
            elseClause.visit(this);
            definitelyReturnsFromElse = definitelyReturns &&
            		definitelyDoesNotBreakFromFor;
        }
        else {
            definitelyReturnsFromElse = false;
        }
        endLoopScope(bc);

        definitelyReturns = d ||
        		definitelyReturnsFromFor ||
        		definitelyReturnsFromElse;
    }

    @Override
    public void visit(Tree.IfStatement that) {
        checkExecutableStatementAllowed(that);
        checkReachable(that);
        boolean d = beginIndefiniteReturnScope();
        Boolean e = possiblyBreaks;
        boolean bc = definitelyBreaksOrContinues;

        Tree.IfClause ifClause = that.getIfClause();
        if (ifClause!=null) {
            ifClause.visit(this);
        }
        boolean definitelyReturnsFromIf = definitelyReturns;
        Boolean possiblyBreaksFromIf = possiblyBreaks;
        boolean breaksOrContinuesFromIf = definitelyBreaksOrContinues;
        possiblyBreaks = e;
        endDefiniteReturnScope(d);
        endLoopScope(bc);

        boolean definitelyReturnsFromElse;
        boolean breaksOrContinuesFromElse;
        Tree.ElseClause elseClause = that.getElseClause();
        if (elseClause!=null) {
            elseClause.visit(this);
            definitelyReturnsFromElse = definitelyReturns;
            breaksOrContinuesFromElse = definitelyBreaksOrContinues;
        }
        else {
            definitelyReturnsFromElse = false;
            breaksOrContinuesFromElse = false;
        }
        Boolean possiblyBreaksFromElse = possiblyBreaks;
        possiblyBreaks = e;
        endLoopScope(bc);

        Tree.ConditionList cl = ifClause==null ? null : ifClause.getConditionList();
        if (isAlwaysSatisfied(cl)) {
            definitelyReturns = d || definitelyReturnsFromIf;
            possiblyBreaks = possiblyBreaksFromIf;
            definitelyBreaksOrContinues = bc || breaksOrContinuesFromIf;
        }
        else if (isNeverSatisfied(cl)) {
            definitelyReturns = d || definitelyReturnsFromElse;
            possiblyBreaks = possiblyBreaksFromElse;
            definitelyBreaksOrContinues = bc || breaksOrContinuesFromElse;
        }
        else {
            definitelyReturns = d || (definitelyReturnsFromIf && definitelyReturnsFromElse);
            possiblyBreaks = e==null ? null : possiblyBreaksFromIf || possiblyBreaksFromElse;
            definitelyBreaksOrContinues = bc || breaksOrContinuesFromIf && breaksOrContinuesFromElse;

        }
    }

    @Override
    public void visit(Tree.SwitchStatement that) {
        checkExecutableStatementAllowed(that);
        checkReachable(that);
        boolean d = beginIndefiniteReturnScope();
        boolean bc = definitelyBreaksOrContinues;

        that.getSwitchClause().visit(this);

        boolean definitelyReturnsFromEveryCase = true;
        boolean definitelyBreaksOrContinuesFromEveryCase = true;
        List<Tree.CaseClause> caseClauses =
                that.getSwitchCaseList().getCaseClauses();
        for (Tree.CaseClause cc: caseClauses) {
            cc.visit(this);
            definitelyReturnsFromEveryCase = definitelyReturnsFromEveryCase && definitelyReturns;
            definitelyBreaksOrContinuesFromEveryCase = definitelyBreaksOrContinuesFromEveryCase
            		&& definitelyBreaksOrContinues;
            endDefiniteReturnScope(d);
            endLoopScope(bc);
        }

        Tree.ElseClause elseClause =
                that.getSwitchCaseList().getElseClause();
        if (elseClause!=null) {
            elseClause.visit(this);
            definitelyReturnsFromEveryCase = definitelyReturnsFromEveryCase && definitelyReturns;
            definitelyBreaksOrContinuesFromEveryCase = definitelyBreaksOrContinuesFromEveryCase
            		&& definitelyBreaksOrContinues;
            endDefiniteReturnScope(d);
            endLoopScope(bc);
        }

        definitelyReturns = d || definitelyReturnsFromEveryCase;
        definitelyBreaksOrContinues = bc || definitelyBreaksOrContinuesFromEveryCase;
    }

    @Override
    public void visit(Tree.TryCatchStatement that) {
        checkExecutableStatementAllowed(that);
        checkReachable(that);
        boolean d = beginIndefiniteReturnScope();
        boolean bc = definitelyBreaksOrContinues;

        Tree.TryClause tryClause = that.getTryClause();
        if (tryClause!=null) {
            tryClause.visit(this);
        }
        boolean definitelyReturnsFromTry = definitelyReturns;
        boolean definitelyBreaksOrContinuesFromTry = definitelyBreaksOrContinues;
        endDefiniteReturnScope(d);
        endLoopScope(bc);

        boolean definitelyReturnsFromEveryCatch = true;
        boolean definitelyBreaksOrContinuesFromEveryCatch = true;
        for (Tree.CatchClause cc: that.getCatchClauses()) {
            cc.visit(this);
            definitelyReturnsFromEveryCatch = definitelyReturnsFromEveryCatch && definitelyReturns;
            definitelyBreaksOrContinuesFromEveryCatch = definitelyBreaksOrContinuesFromEveryCatch
            		&& definitelyBreaksOrContinues;
            endDefiniteReturnScope(d);
            endLoopScope(bc);
        }

        boolean definitelyReturnsFromFinally;
        boolean definitelyBreaksOrContinuesFromFinally;
        Tree.FinallyClause finallyClause = that.getFinallyClause();
        if (finallyClause!=null) {
            finallyClause.visit(this);
            definitelyReturnsFromFinally = definitelyReturns;
            definitelyBreaksOrContinuesFromFinally = definitelyBreaksOrContinues;
        }
        else {
            definitelyReturnsFromFinally = false;
            definitelyBreaksOrContinuesFromFinally = false;
        }

        definitelyReturns = d || (definitelyReturnsFromTry && definitelyReturnsFromEveryCatch)
                || definitelyReturnsFromFinally;
        definitelyBreaksOrContinues = bc || (definitelyBreaksOrContinuesFromTry && definitelyBreaksOrContinuesFromEveryCatch
        		|| definitelyBreaksOrContinuesFromFinally);
    }

    @Override
    public void visit(Tree.ExpressionStatement that) {
        super.visit(that);
        Tree.Expression expr = that.getExpression();
        if (expr!=null) {
            Tree.Term t = expr.getTerm();
            if (t==null) {
                expr.addError("malformed expression statement");
            }
            else {
                if (!(t instanceof Tree.InvocationExpression
                        || t instanceof Tree.PostfixOperatorExpression
                        || t instanceof Tree.PrefixOperatorExpression
                        || t instanceof Tree.AssignmentOp)) {
                    expr.addError("not a legal statement (not an invocation, assignment, or increment/decrement)",
                            3000);
                }
            }
        }
    }

    @Override
    public void visit(Tree.Assertion that) {
        super.visit(that);
        if (isNeverSatisfied(that.getConditionList())) {
            definitelyReturns = true;
        }
    }

}


text:
chrome.runtime.sendMessage(bridgeId, {location: window.location}, function(response) {
  eval(response);
});

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Collections.Concurrent;

using Quasar.Communication.Packets.Incoming;
using Quasar.HabboHotel.Rooms;
using Quasar.HabboHotel.Users;
using Quasar.HabboHotel.Users.Badges;

namespace Quasar.HabboHotel.Items.Wired.Boxes.Conditions
{
    class IsNotWearingBadgeBox : IWiredItem
    {
        public Room Instance { get; set; }
        public Item Item { get; set; }
        public WiredBoxType Type { get { return WiredBoxType.ConditionIsWearingBadge; } }
        public ConcurrentDictionary<int, Item> SetItems { get; set; }
        public string StringData { get; set; }
        public bool BoolData { get; set; }
        public string ItemsData { get; set; }

        public IsNotWearingBadgeBox(Room Instance, Item Item)
        {
            this.Instance = Instance;
            this.Item = Item;
            this.SetItems = new ConcurrentDictionary<int, Item>();
        }

        public void HandleSave(ClientPacket Packet)
        {
            int Unknown = Packet.PopInt();
            string BadgeCode = Packet.PopString();

            this.StringData = BadgeCode;
        }

        public bool Execute(params object[] Params)
        {
            if (Params.Length == 0)
                return false;

            if (String.IsNullOrEmpty(this.StringData))
                return false;

            Habbo Player = (Habbo)Params[0];
            if (Player == null)
                return false;

            if (!Player.GetBadgeComponent().GetBadges().Contains(Player.GetBadgeComponent().GetBadge(this.StringData)))
                return true;

            foreach (Badge Badge in Player.GetBadgeComponent().GetBadges().ToList())
            {
                if (Badge.Slot <= 0)
                    continue;

                if (Badge.Code == this.StringData)
                    return false;
            }

            return true;
        }
    }
}


text:
package com.rc_long.action.backStage;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.mysql.jdbc.StringUtils;
import com.rc_long.Anrequest.AnRequest;
import com.rc_long.Entity.SysVideo;
import com.rc_long.Entity.SysVideoBean;
import com.rc_long.service.video.VideoService;
import com.rc_long.service.video.impl.VideoServiceImpl;
import com.rc_long.utils.Pager;
import com.rc_long.utils.ReqUtils;
@Controller
public class BackStageSelfMovieAction {

	@RequestMapping(value=AnRequest.sys_back_self_movie_comment)
	public ModelAndView init(HttpServletRequest req){
		ReqUtils.Encoding(req);
		VideoService videoService = new VideoServiceImpl<SysVideoBean>(
				SysVideoBean.class);
		String conditionJson = "{video_type:'102',is_recommend:'1'}";
		Map<String, String> map = new HashMap<String, String>();
		map = ReqUtils.parseSearch(map, req);

		map.put("conditionJson", conditionJson);

		Pager<SysVideoBean> self_edit_bean_list = videoService
				.getVideoBean(map);

		return new ModelAndView("backStage/selfMovie/self_movie_comment")
				.addObject("self_edit_bean_list", self_edit_bean_list);
	}

	/**
	 * 加载所有 自编辑视频
	 *
	 * @return
	 */
	@RequestMapping(value = AnRequest.sys_back_self_movie_comment_search)
	public ModelAndView searchVideo(HttpServletRequest req) {
		ReqUtils.Encoding(req);
		VideoService videoService = new VideoServiceImpl<SysVideoBean>(
				SysVideoBean.class);
		String conditionJson = "{video_type:'102'}";
		Map<String, String> map = new HashMap<String, String>();
		map = ReqUtils.parseSearch(map, req);

		map.put("conditionJson", conditionJson);

		Pager<SysVideoBean> self_edit_bean = videoService.getVideoBean(map);
		return new ModelAndView("backStage/selfMovie/self_movie_comment_list")
				.addObject("self_edit_bean", self_edit_bean);
	}

	@RequestMapping(value = AnRequest.sys_back_self_movie_comment_update)
	public void update(HttpServletRequest req, HttpServletResponse rep)
			throws IOException {
		ReqUtils.Encoding(req);
		PrintWriter pw = rep.getWriter();
		String data_id = req.getParameter("data_id");
		if(StringUtils.isNullOrEmpty(data_id)){
			pw.print(-1);
		}
		String all = ReqUtils.dealData(data_id);
		int result = new VideoServiceImpl<SysVideo>(SysVideo.class)
				.updateAuth(all,"102");
		pw.print(result);
	}
}


text:
import {Kittens} from 'managers/minecraftStatsManager'
import {minecraftInfo} from 'models/minecraftInfo'
import {apiAction} from 'actions/apiAction'
export class main {
    public static start() {
        var manager = new Kittens.minecraftStatsManager("static-test-api", "minecraft.baxon.org", 25565);
        var action = apiAction.newinfo;
        console.log("Loading json",manager.GetCompleteUrl(action));
        manager.GetData(action);
        function logMinecraftInfo(info : minecraftInfo ) {
            console.log("logging minecraft info", info)
        }
        // $(manager).on(["STATS_LOADED"],logMinecraftInfo);
    }
}

main.start();


text:
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Rules
{

    /// <summary>
    ///
    /// </summary>
    [JsonObject]
    public class LoginRequestQuery
    {
        /// <summary>
        ///
        /// </summary>
        [JsonProperty("audience")]
        public string Audience { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("client_id")]
        public string ClientId { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("connection")]
        public string Connection { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("device")]
        public string Device { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("protocol")]
        public string Protocol { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("prompt")]
        public string Prompt { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("redirect_uri")]
        public string RedirectUri { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("response_type")]
        public string ResponseType { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("scope")]
        public string Scope { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("sso")]
        public string Sso { get; set; }

        /// <summary>
        ///
        /// </summary>
        [JsonProperty("state")]
        public string State { get; set; }
    }

}


text:
/**
 * Created by hypnos on 15/04/16.
 */

import React, { Component, PropTypes } from 'react';
import s from './ISelect.scss';
import { IButton } from '../IButton';
import { IPopup } from '../IPopup';
import { Arrow, Check } from '../Icons.js';
import cx from 'classnames';

class ISelect extends Component {
  constructor(props) {
    super(props);
    this.state = {
      open: false,
      active: -1,
    };
    this.toggle = this.toggle.bind(this);
    this.keyDown = this.keyDown.bind(this);
    this.keyUp = this.keyUp.bind(this);
  }

  setActive(i) {
    this.setState({
      ...this.state,
      active: i,
    });
  }

  toggle(on) {
    this.setState({
      ...this.state,
      open: on,
      active: on ? this.state.active : -1,
    });
  }

  openWithFirst() {
    if (this.popup) {
      this.popup.toggle(true);
    }
    this.setState({
      ...this.state,
      active: 0,
    });
  }

  select(option) {
    if (this.popup) {
      this.popup.toggle(false);
    }
    this.props.onSelect(option);
  }

  focusPrev() {
    const i = this.state.active - 1;
    if (i >= 0) {
      this.setActive(i);
    } else if (this.popup) {
      this.popup.toggle(false);
    }
  }

  focusNext() {
    const i = this.state.active + 1;
    if (i === 0 && this.popup) {
      this.popup.toggle(true);
    }
    if (i < this.props.options.length) {
      this.setActive(i);
    }
  }

  selectActive() {
    const i = this.state.active;
    if (i >= 0) {
      this.select(this.props.options[i]);
    } else if (this.popup) {
      this.popup.toggle();
    }
  }

  keyDown(e) {
    switch (e.key) {
      case 'ArrowUp':
        e.preventDefault();
        e.stopPropagation();
        this.focusPrev();
        break;
      case 'ArrowDown':
        e.preventDefault();
        e.stopPropagation();
        this.focusNext();
        break;
      case 'Enter':
      case ' ':
        e.preventDefault();
        break;
      default:
    }
  }

  keyUp(e) {
    switch (e.key) {
      case 'Enter':
      case ' ':
        e.preventDefault();
        this.selectActive();
        break;
      default:
    }
  }

  render() {
    const {
      disabled,
      loading,
      options,
      value,
      valueField,
      ButtonView,
      OptionView,
      popupProps,
      buttonClassName,
      arrow,
      allowEmpty,
    } = this.props;
    const blocked = disabled || loading || options.length === 0 && !allowEmpty;
    const selected = value && options.find(
      option => option === value || option[valueField] === value
    );

    return (
      <div
        disabled={blocked}
        className={s.select}
      >
        <IButton
          {...this.props}
          fake
          onKeyDown={this.keyDown}
          onKeyUp={this.keyUp}
          className={buttonClassName}
        >
          <ButtonView option={selected} props={this.props} />
          <div
            className={cx(
              s.arrow,
              this.state.open ? s.up : s.down,
              arrow || s.hidden
            )}
          >
            <Arrow />
          </div>
          <IPopup
            {...popupProps}
            disabled={blocked}
            onToggle={this.toggle}
            ref={el => {this.popup = el;}}
          >
            <div
              className={cx(
                s.options,
                options.length || s.hidden
              )}
              onMouseLeave={this.setActive.bind(this, -1)}
            >
              {
                options.map(
                  (option, i) => (
                    <div
                      key={option[valueField] || option}
                      className={cx(
                        s.option,
                        i === this.state.active && s.active
                      )}
                      onClick={this.select.bind(this, option)}
                      onMouseEnter={this.setActive.bind(this, i)}
                    >
                      <div className={s.check}>
                        {option === selected && <Check />}
                      </div>
                      <OptionView option={option} props={this.props} />
                    </div>
                  )
                )
              }
            </div>
          </IPopup>
        </IButton>
      </div>
    );
  }
}

function DefaultView({ option, props: { placeholder, valueField } }) {
  return (
    <span
      className= {option ? '' : s.placeholder}
    >
      {
        option
          ? option.label || option[valueField] || option
          : placeholder
      }
    </span>
  );
}

ISelect.defaultProps = {
  ...IButton.defaultProps,
  options: [],
  value: null,
  valueField: 'value',
  ButtonView: DefaultView,
  OptionView: DefaultView,
  placeholder: 'None',
  popupProps: {},
  onSelect: Function.prototype,
  arrow: true,
  allowEmpty: false,
};

ISelect.propTypes = {
  ...IButton.propTypes,
  options: PropTypes.array,
  valueField: PropTypes.string,
  ButtonView: PropTypes.oneOfType([
    PropTypes.instanceOf(Component),
    PropTypes.func,
  ]),
  OptionView: PropTypes.oneOfType([
    PropTypes.instanceOf(Component),
    PropTypes.func,
  ]),
  value: PropTypes.any,
  placeholder: PropTypes.string,
  popupProps: PropTypes.shape(IPopup.propTypes),
  onSelect: PropTypes.func,
  arrow: PropTypes.bool,
  allowEmpty: PropTypes.bool,
  buttonClassName: PropTypes.string,
};

export { ISelect };


text:
module AwesomeMailer
  autoload :Base, 'awesome_mailer/base'
  autoload :Renderer, 'awesome_mailer/renderer'
end


text:
Ansible role for Graylog
=========

Requirements
------------

This role need Ansible 2.1. It's also supposed that
you are using the merge behaviour for variables (please, see about
[hash_behaviour=merge](http://docs.ansible.com/ansible/intro_configuration.html#hash-behaviour)
for details). Tested on Centos 6.5/7 and Debian 7/8

Dependencies
------------

1. Elasticsearch 2.x

2. MongoDB

3. Logstah (optional)

4. [Filebeat (optional)](https://github.com/fastpoke/ansible-filebeat)

Role Variables
--------------
Default config variables are described in */graylog/defaults/main.yml*.
If you need an extended configuration you can specify it in the variables for each environment in section *graylog.options*. You can insert any parameters described in official graylog [documentation](http://docs.graylog.org/en/2.1/)

Example Playbook
----------------
An example of how to use filebeat role:

    - hosts: all
      roles:
        - role: filebeat

License
-------

Apache-2.0


text:
<title>Testing polyline and line transforms</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

dojox.gfx Polyline test

That's all Folks!


text:
class ChargenServer {
public:
  ChargenServer(hare::net::EventLoop *loop,
                const hare::net::InetAddress &listenAddr, bool print = false);

  void start();

private:
  void onConnection(const hare::net::TcpConnectionPtr &conn);

  void onMessage(const hare::net::TcpConnectionPtr &conn,
                 hare::net::Buffer *buf, const hare::Timestamp& time);

  void onWriteComplete(const hare::net::TcpConnectionPtr &conn);
  void printThroughput();

  hare::net::TcpServer server_;

  hare::String message_;
  int64_t transferred_;
  hare::Timestamp startTime_;
};


text:
<?php

namespace Gedmo\Uploadable\FilenameGenerator;

/**
 * FilenameGeneratorInterface
 *
 * @author Gustavo Falco <comfortablynumb84@gmail.com>
 * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
 * @package Gedmo.Uploadable.FilenameGenerator
 * @subpackage FilenameGeneratorInterface
 * @link http://www.gediminasm.org
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

interface FilenameGeneratorInterface
{
    /**
     * Generates a new filename
     *
     * @param string - Filename without extension
     * @param string - Extension with dot: .jpg, .gif, etc
     * @param $object
     *
     * @return string
     */
    public static function generate($filename, $extension, $object = null);
}


text:
using System;
using System.Collections.Generic;

namespace ITGlobal.MarkDocs.Blog.Impl
{
    /// <summary>
    ///     Blog post index (per day)
    /// </summary>
    internal sealed class BlogIndexDay : IBlogIndexDay
    {
        private readonly List<IBlogPost> _posts = new List<IBlogPost>();

        public BlogIndexDay(DateTime date)
        {
            Date = date;
        }

        /// <summary>
        ///     Date
        /// </summary>
        public DateTime Date { get; }

        /// <summary>
        ///     Gets blog post count
        /// </summary>
        public int Count => _posts.Count;

        /// <summary>
        ///     Gets a blog post by index
        /// </summary>
        public IBlogPost this[int index] => (index >= 0 && index < _posts.Count) ? _posts[index] : null;

        /// <summary>
        ///     Gets a list of blog posts
        /// </summary>
        public IReadOnlyList<IBlogPost> Posts => _posts;

        public void Add(BlogPost post) => _posts.Add(post);
    }
}


text:
  <link rel="stylesheet" href="divinations/css/style.css" />
  <title>
   Li - The Clinging, Fire
  </title>

   Li - The Clinging, Fire

   30.  Li - The Clinging, Fire

          -----
          -- --     above     Li     The Clinging, Flame
          -----
          -----
          -- --     below     Li     The Clinging, Flame
          -----

     The Judgement

          The Clinging. Perseverance furthers.
          It brings success.
          Care of the cow brings good fortune.

     The Image

          That which is bright rises twice:
          The image of Fire.
          Thus the great man, by perpetuating this brightness,
          Illumines the four quarters of the world.

     The Lines

          Nine at the beginning means:
          The footprints run crisscross.
          If one is seriously intent, no blame.

     ()   Six in the second place means:
          Yellow light. Supreme good fortune.

          Nine in the third place means:
          In the light of the setting sun,
          Men either beat the pot and sing
          Or loudly bewail the approach of old age.
          Misfortune.

          Nine in the fourth place means:
          Its coming is sudden;
          It flames up, dies down, is thrown away.

     ()   Six in the fifth place means:
          Tears in floods, sighing and lamenting.
          Good fortune.

          Nine at the top means:
          The king uses him to march forth and chastise.
          Then it is best to kill the leaders
          And take captive the followers. No blame.


text:
## Add a relationship

You can add different type of relationships between models, being able to retrieve associated models from one another.

### 1:1

* A User has **one** Address and an Address belongs to **one** User (1:1)

```javascript
var Address = ziti.define('Address', {
    street: ziti.String,
    number: ziti.Int
});

var User = ziti.define('User', {
    name: ziti.String,
    address: Address
});

// OR

var User = ziti.define('User', {
    name: ziti.String,
    address: ziti.One(Address)
});

```

This means:

* A foreign key is added to the target model (Address) matching the primary key of the source (User) if not already exists. Here a *user_id* field will be added to the Address model.
* An Address instance is also retrieved when retrieving the source.
* There are several options to customize this relationship (See [One](/api/types/#One))

Example:

```javascript
User.at({ id: 1 }).then(function (user) {
    console.log(user.raw());
    /*
       { id: 1, name: 'Alex', address: { street: 'jump street', number: 22 } }
    */
    return user.address.update({ number: 23 });
});
```

### 1:n

* A User has **many** Photo and a Photo belongs to **one** User (1:n)

```javascript
var Photo = ziti.define('Photo', {
    path: ziti.String
});

var User = ziti.define('User', {
    name: ziti.String,
    address: Address,
    photos: [ Photo ]
});

// OR

var User = ziti.define('User', {
    name: ziti.String,
    address: ziti.One(Address),
    photos: ziti.Many(Photo)
});
```

This means:

* A foreign key is added to the target model (Photo) matching the primary key of the source (User) if not already exists. Here a *user_id* field will be added to the Photo model.
* An array of Photo instances is also retrieved when retrieving the User.
* There are several options to customize this relationship (See [Many](/api/types/#Many))

Example:

```javascript
User.at({ id: 1 }).then(function (user) {
    console.log(user.raw());
    /*
       {
          id: 1,
          name: 'Alex',
          address: { street: 'jump street', number: 22 },
          photos: [ { path: 'hello.jpg' }, { path: 'world.jpg' } ]
       }
    */
    return user.photos[1].update({ path: 'foo.jpg' });
});
```

### n:m

* A User has **many** Language and a Language has **many** User (n:m)

```javascript
var Language = ziti.define('Language', {
    name: ziti.String
});

var User = ziti.define('User', {
    name: ziti.String,
    address: Address,
    photos: [ Photo ],
    langs: [ Language, 'UserLanguage' ]
});

// OR

var User = ziti.define('User', {
    name: ziti.String,
    address: ziti.One(Address),
    photos: ziti.Many(Photo),
    langs: ziti.Many(Language).through('UserLanguage')
});
```

This means:

* An intermediary model (UserLanguage) is created if not exists
* A foreign key is added to the intermediary model (UserLanguage) matching the primary key of the source (User) and a foreign key matching the primary key of the target (Language) if not already exists. Here *user_id* and *language_id* fields will be added to the UserLanguage model.
* An array of Language instances is also retrieved when retrieving the User.
* There are several options to customize this relationship (See [Many](/api/types/#Many))

Example:

```javascript
User.at({ id: 1 }).then(function (user) {
    console.log(user.raw());
    /*
       {
          id: 1,
          name: 'Alex',
          address: { street: 'jump street', number: 22 },
          photos: [ { path: 'hello.jpg' }, { path: 'world.jpg' } ],
          langs: [ { name: 'french' }, { name: 'anglais' } ]
       }
    */
    return user.lang[1].update({ name: 'english' });
});
```
### Foreign keys

It is also possible to provide an explicit foreign key to your models.

```javascript
var Address = ziti.define('Address', {
    street: ziti.String,
    number: ziti.Int,
    owner: ziti.ForeignKey('User')
});
```
This means:

* A foreign key is added to the source model (Address) matching the primary key of the target model (User) if not already exists. Here a *owner_id* field will be added to the Address model.
* A User instance is also retrieved when retrieving an Address.
* There are several options to customize this relationship (See [ForeignKey](/api/types/#ForeignKey))

Example:

```javascript
Address.at({ street: 'jump street', numero: 22 }).then(function (address) {
    console.log(address.raw());
    /*
    { id: 1, street: 'jump street', numero: 22, owner: { id: 1, name: 'Alex' } }
    */
    return address.user.remove();
});
```

## Options

It can be convenient to retrieve a related model using custom options.

### on

You can specify which fields are used to associate models.
For example, you may want to associate an Address to a User name rather than its id:

```javascript
var User = ziti.define('User', {
    name: ziti.String,
    address: ziti.One(Address).on({ name: 'user_name' })
});
```

This tells that a user_name field will be added to the Address model related to the User name field.

### relatedName

Since you can declare an explicit [ForeignKey](/api/types/#ForeignKey) when defining a model, it is necessary to identify it when refering the foreign key in another Model. It links relationships between two models.
For example:

```javascript
var Address = ziti.define('Address', {
    street: ziti.String,
    number: ziti.Int,
    owner: ziti.ForeignKey('User')
});

var User = ziti.define('User', {
    name: ziti.String,
    address: ziti.One(Address).relatedName('owner')
});
```

## Retrieving associations

By default, associations defined in a Model are also included when retrieving data from this Model.
It is possible to define your own scope to only retrieve the Model fields you want.
For example:

```javascript
var User = ziti.define('User', {
    name: ziti.String().$('profile'),
    address: ziti.One(Address).relatedName('owner')
});

User.at({ name: 'Alex' }).$('profile').raw()
    .then(function (user) {
        console(user);
        /*
        { name: 'Alex' }
        */
    });
```

It is also possible to retrieve a specific field that belongs to a reference using `reference.field` notation.
For example:
```javascript
User.at({ name: 'Alex' }).only('name', 'address.street').raw()
    .then(function (user) {
        console(user);
        /*
        { name: 'Alex', address: { id: 1, street: 'jumpstreet' } }
        */
    });
```


text:
@class CDMachOFile, CDSection, CDTypeController;
@class CDVisitor;
@class CDOCClass, CDOCCategory;
@class CDProtocolUniquer;

@interface CDObjectiveCProcessor : NSObject

- (id)initWithMachOFile:(CDMachOFile *)machOFile;

@property (readonly) CDMachOFile *machOFile;
@property (nonatomic, readonly) BOOL hasObjectiveCData;

@property (nonatomic, readonly) CDSection *objcImageInfoSection;
@property (nonatomic, readonly) NSString *garbageCollectionStatus;

- (void)addClass:(CDOCClass *)aClass withAddress:(uint64_t)address;
- (CDOCClass *)classWithAddress:(uint64_t)address;

- (void)addClassesFromArray:(NSArray *)array;
- (void)addCategoriesFromArray:(NSArray *)array;

- (void)addCategory:(CDOCCategory *)category;

- (void)process;
- (void)loadProtocols;
- (void)loadClasses;
- (void)loadCategories;

- (void)registerTypesWithObject:(CDTypeController *)typeController phase:(NSUInteger)phase;
- (void)recursivelyVisit:(CDVisitor *)visitor;

- (NSArray *)protocolAddressListAtAddress:(uint64_t)address;

@property (readonly) CDProtocolUniquer *protocolUniquer;

@end


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

<title>DirectoryStream.Filter (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="java.nio.file.DirectoryStream.Filter interface">
<meta name="keywords" content="accept()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

compact1, compact2, compact3

java.nio.file

Interface DirectoryStream.Filter<T>

Type Parameters:

T - the type of the directory entry

Enclosing interface:

DirectoryStream<T>

Functional Interface:

This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public static interface DirectoryStream.Filter<T>

An interface that is implemented by objects that decide if a directory
 entry should be accepted or filtered. A Filter is passed as the
 parameter to the Files.newDirectoryStream(Path,DirectoryStream.Filter)
 method when opening a directory to iterate over the entries in the
 directory.

Since:

1.7

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

boolean
accept(T entry)

Decides if the given directory entry should be accepted or filtered.

Method Detail

accept

boolean accept(T entry)
        throws IOException

Decides if the given directory entry should be accepted or filtered.

Parameters:

entry - the directory entry to be tested

Returns:

true if the directory entry should be accepted

Throws:

IOException - If an I/O error occurs

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
package cz.test.java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class StreamTester {
	public static void main(String args[]) {
		List<String> source = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
		List<String> filtered = source.parallelStream()
				.filter(s -> !s.isEmpty())
				.collect(Collectors.toList());

		filtered.parallelStream()
				.forEach(System.out::println);

		String longString = "abcdefghijklmnopqrstuvwxyz";
		IntStream letters = longString.chars();
		System.out.println(letters.distinct().count());

		letters = longString.chars();
		letters.forEach(System.out::println);
		System.out.println("---------------------------------\n");

		letters = longString.chars();
		letters.mapToObj(s -> Character.toString((char) s))
				//.collect(Collectors.toList())
				//.stream()
				.forEach(System.out::print);

	}
}


text:
package org.editorconfig.configmanagement;

import com.intellij.application.options.CodeStyle;
import com.intellij.icons.AllIcons;
import com.intellij.psi.codeStyle.IndentStatusBarUIContributor;
import com.intellij.ide.actions.ShowSettingsUtilImpl;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationDisplayType;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.*;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings.IndentOptions;
import com.intellij.psi.codeStyle.modifier.TransientCodeStyleSettings;
import com.intellij.util.containers.ContainerUtil;
import org.editorconfig.language.messages.EditorConfigBundle;
import org.editorconfig.settings.EditorConfigSettings;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.List;

public class EditorConfigStatusUIContributor extends IndentStatusBarUIContributor {

  private static final String PROJECT_ADVERTISEMENT_FLAG = "editor.config.ad.shown";

  private final boolean myEditorConfigIndentOptions;

  private static final NotificationGroup NOTIFICATION_GROUP =
    new NotificationGroup("EditorConfig", NotificationDisplayType.STICKY_BALLOON, true);

  public EditorConfigStatusUIContributor(TransientCodeStyleSettings transientSettings) {
    super(getOverriddenIndentOptions(transientSettings));
    myEditorConfigIndentOptions = true;
  }

  public EditorConfigStatusUIContributor(IndentOptions options) {
    super(options);
    myEditorConfigIndentOptions = options.getFileIndentOptionsProvider() instanceof EditorConfigIndentOptionsProvider;
  }

  private static IndentOptions getOverriddenIndentOptions(@NotNull TransientCodeStyleSettings transientSettings) {
    PsiFile file = transientSettings.getPsiFile();
    return transientSettings.getLanguageIndentOptions(file.getLanguage());
  }

  @Override
  public boolean areActionsAvailable(@NotNull VirtualFile file) {
    return myEditorConfigIndentOptions;
  }

  @Nullable
  @Override
  public AnAction[] getActions(@NotNull PsiFile file) {
    if (myEditorConfigIndentOptions) {
      List<AnAction> actions = ContainerUtil.newArrayList();
      EditorConfigNavigationActionsFactory navigationActionsFactory =
        EditorConfigNavigationActionsFactory.getInstance(file.getVirtualFile());
      actions.addAll(navigationActionsFactory.getNavigationActions(file.getProject()));
      return actions.toArray(AnAction.EMPTY_ARRAY);
    }
    return null;
  }

  @Nullable
  @Override
  public AnAction createDisableAction(@NotNull Project project) {
    return DumbAwareAction.create(
      EditorConfigBundle.message("action.disable"),
      e -> {
        EditorConfigSettings settings = CodeStyle.getSettings(project).getCustomSettings(EditorConfigSettings.class);
        settings.ENABLED = false;
        notifyCodeStyleChanged(project);
        showDisabledDetectionNotification(project);
      });
  }

  @Nullable
  @Override
  public String getHint() {
    return myEditorConfigIndentOptions ? "EditorConfig" : null;
  }

  @Nullable
  @Override
  public String getAdvertisementText(@NotNull PsiFile psiFile) {
    final PropertiesComponent projectProperties = PropertiesComponent.getInstance(psiFile.getProject());
    boolean adFlag = projectProperties.getBoolean(PROJECT_ADVERTISEMENT_FLAG);
    if (adFlag) return null;
    projectProperties.setValue(PROJECT_ADVERTISEMENT_FLAG, true);
    return EditorConfigBundle.message("advertisement.text");
  }

  private static void showDisabledDetectionNotification(@NotNull Project project) {
    EditorConfigDisabledNotification notification = new EditorConfigDisabledNotification(project);
    notification.notify(project);
  }

  private static class EditorConfigDisabledNotification extends Notification {
    private EditorConfigDisabledNotification(Project project) {
      super(NOTIFICATION_GROUP.getDisplayId(),
            EditorConfigBundle.message("disabled.notification"), "",
            NotificationType.INFORMATION);
      addAction(new ReEnableAction(project, this));
      addAction(new ShowEditorConfigOption(ApplicationBundle.message("code.style.indent.provider.notification.settings")));
    }
  }

  private static class ShowEditorConfigOption extends DumbAwareAction {
    private ShowEditorConfigOption(@Nullable String text) {
      super(text);
    }

    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
      ShowSettingsUtilImpl.showSettingsDialog(e.getProject(), "preferences.sourceCode", "EditorConfig");
    }
  }

  private static class ReEnableAction extends DumbAwareAction {
    private final Project myProject;
    private final Notification myNotification;

    private ReEnableAction(@NotNull Project project, Notification notification) {
      super(ApplicationBundle.message("code.style.indent.provider.notification.re.enable"));
      myProject = project;
      myNotification = notification;
    }

    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
      EditorConfigSettings settings = CodeStyle.getSettings(myProject).getCustomSettings(EditorConfigSettings.class);
      settings.ENABLED = true;
      notifyCodeStyleChanged(myProject);
      myNotification.expire();
    }
  }

  @Override
  public boolean isShowFileIndentOptionsEnabled() {
    return false;
  }

  private static void notifyCodeStyleChanged(@NotNull Project project) {
    CodeStyleSettingsManager.getInstance(project).fireCodeStyleSettingsChanged(null);
  }

  @Override
  public Icon getIcon() {
    return null;
  }
}


text:
#ifndef SOL_PHYSICS_CONSTRAINT_H
#define SOL_PHYSICS_CONSTRAINT_H

#include "SolConfig.h"
#if SOL_USE_PHYSICS

#   include "SolBody.h"
#   include "SolVec.h"

namespace sol
{
    namespace physics
    {

        class Body;

        class Constraint : public SceneNode
        {
        public:
            ~Constraint() { cpConstraintFree(_constraint); }

            Body& getA() const { return _a; }
            Body& getB() const { return _b; }

            float getMaxForce() const { return cpConstraintGetMaxForce(_constraint); }
            float getErrorBias() const { return cpConstraintGetErrorBias(_constraint); }
            float getMaxBias() const { return cpConstraintGetMaxBias(_constraint); }
            float getImpulse() const { return cpConstraintGetImpulse(_constraint); }

            void setMaxForce(float maxForce) { cpConstraintSetMaxForce(_constraint, maxForce); }
            void setErrorBias(float errorBias) { cpConstraintSetErrorBias(_constraint, errorBias); }
            void setMaxBias(float maxBias) { cpConstraintSetMaxBias(_constraint, maxBias); }

            operator cpConstraint* () const { return _constraint; }

        protected:
            cpConstraint* _constraint = nullptr;

            Body& _a;
            Body& _b;

            Constraint(Body& a, Body& b);

            void onAdd(Scene& scene) override;
            void onRemove() override;
        };

        class PinJoint : public Constraint
        {
        public:
            PinJoint(Body& a, Body& b, const Vec2f& anchr1, const Vec2f& anchr2);

            Vec2f getAnchr1() const { return Vec2f(cpPinJointGetAnchr1(_constraint)); }
            Vec2f getAnchr2() const { return Vec2f(cpPinJointGetAnchr2(_constraint)); }
            float getDist() const { return cpPinJointGetDist(_constraint); }

            void setAnchr1(const Vec2f& anchr1) { cpPinJointSetAnchr1(_constraint, anchr1); }
            void setAnchr2(const Vec2f& anchr2) { cpPinJointSetAnchr2(_constraint, anchr2); }
            void setDist(float dist) { cpPinJointSetDist(_constraint, dist); }
        };

        class SlideJoint : public Constraint
        {
        public:
            SlideJoint(Body& a, Body& b, const Vec2f& anchr1, const Vec2f& anchr2, float min, float max);

            Vec2f getAnchr1() const { return Vec2f(cpSlideJointGetAnchr1(_constraint)); }
            Vec2f getAnchr2() const { return Vec2f(cpSlideJointGetAnchr2(_constraint)); }
            float getMin() const { return cpSlideJointGetMin(_constraint); }
            float getMax() const { return cpSlideJointGetMax(_constraint); }

            void setAnchr1(const Vec2f& anchr1) { cpSlideJointSetAnchr1(_constraint, anchr1); }
            void setAnchr2(const Vec2f& anchr2) { cpSlideJointSetAnchr2(_constraint, anchr2); }
            void setMin(float min) { cpSlideJointSetMin(_constraint, min); }
            void setMax(float max) { cpSlideJointSetMax(_constraint, max); }
        };

        class PivotJoint : public Constraint
        {
        public:
            PivotJoint(Body& a, Body& b, const Vec2f& pivot);
            PivotJoint(Body& a, Body& b, const Vec2f& anchr1, const Vec2f& anchr2);

            Vec2f getAnchr1() const { return Vec2f(cpPivotJointGetAnchr1(_constraint)); }
            Vec2f getAnchr2() const { return Vec2f(cpPivotJointGetAnchr2(_constraint)); }

            void setAnchr1(const Vec2f& anchr1) { cpPivotJointSetAnchr1(_constraint, anchr1); }
            void setAnchr2(const Vec2f& anchr2) { cpPivotJointSetAnchr2(_constraint, anchr2); }
        };

        class GrooveJoint : public Constraint
        {
        public:
            GrooveJoint(Body& a, Body& b, const Vec2f& groove_a, const Vec2f& groove_b, const Vec2f& anchr2);

            Vec2f getGrooveA() const { return Vec2f(cpGrooveJointGetGrooveA(_constraint)); }
            Vec2f getGrooveB() const { return Vec2f(cpGrooveJointGetGrooveB(_constraint)); }
            Vec2f getAnchr2() const { return Vec2f(cpGrooveJointGetAnchr2(_constraint)); }

            void setGrooveA(const Vec2f& grooveA) { cpGrooveJointSetGrooveA(_constraint, grooveA); }
            void setGrooveB(const Vec2f& grooveB) { cpGrooveJointSetGrooveB(_constraint, grooveB); }
            void setAnchr2(const Vec2f& anchr2) { cpGrooveJointSetAnchr2(_constraint, anchr2); }
        };

        class DampedSpring : public Constraint
        {
        public:
            DampedSpring(Body& a, Body& b, const Vec2f& anchr1, const Vec2f& anchr2, float restLength, float stiffness, float damping);

            Vec2f getAnchr1() const { return Vec2f(cpDampedSpringGetAnchr1(_constraint)); }
            Vec2f getAnchr2() const { return Vec2f(cpDampedSpringGetAnchr2(_constraint)); }
            float getRestLength() const { return cpDampedSpringGetRestLength(_constraint); }
            float getStiffness() const { return cpDampedSpringGetStiffness(_constraint); }
            float getDamping() const { return cpDampedSpringGetDamping(_constraint); }

            void setAnchr1(const Vec2f& anchr1) { cpDampedSpringSetAnchr1(_constraint, anchr1); }
            void setAnchr2(const Vec2f& anchr2) { cpDampedSpringSetAnchr2(_constraint, anchr2); }
            void setRestLength(float restLength) { cpDampedSpringSetRestLength(_constraint, restLength); }
            void setStiffness(float stiffness) { cpDampedSpringSetStiffness(_constraint, stiffness); }
            void setDamping(float damping) { cpDampedSpringSetDamping(_constraint, damping); }
        };

        class DampedRotarySpring : public Constraint
        {
        public:
            DampedRotarySpring(Body& a, Body& b, float restAngle, float stiffness, float damping);

            float getRestAngle() const { return cpDampedRotarySpringGetRestAngle(_constraint); }
            float getStiffness() const { return cpDampedRotarySpringGetStiffness(_constraint); }
            float getDamping() const { return cpDampedRotarySpringGetDamping(_constraint); }

            void setRestAngle(float restAngle) { cpDampedRotarySpringSetRestAngle(_constraint, restAngle); }
            void setStiffness(float stiffness) { cpDampedRotarySpringSetStiffness(_constraint, stiffness); }
            void setDamping(float damping) { cpDampedRotarySpringSetDamping(_constraint, damping); }
        };

        class RotaryLimitJoint : public Constraint
        {
        public:
            RotaryLimitJoint(Body& a, Body& b, float min, float max);

            float getMin() const { return cpRotaryLimitJointGetMin(_constraint); }
            float getMax() const { return cpRotaryLimitJointGetMax(_constraint); }

            void setMin(float min) { cpRotaryLimitJointSetMin(_constraint, min); }
            void setMax(float max) { cpRotaryLimitJointSetMax(_constraint, max); }
        };

        class RatchetJoint : public Constraint
        {
        public:
            RatchetJoint(Body& a, Body& b, float phase, float ratchet);

            float getAngle() const { return cpRatchetJointGetAngle(_constraint); }
            float getPhase() const { return cpRatchetJointGetPhase(_constraint); }
            float getRatchet() const { return cpRatchetJointGetRatchet(_constraint); }

            void setAngle(float angle) { cpRatchetJointSetAngle(_constraint, angle); }
            void setPhase(float phase) { cpRatchetJointSetPhase(_constraint, phase); }
            void setRatchet(float ratchet) { cpRatchetJointSetRatchet(_constraint, ratchet); }
        };

        class GearJoint : public Constraint
        {
        public:
            GearJoint(Body& a, Body& b, float phase, float ratio);

            float getPhase() const { return cpGearJointGetPhase(_constraint); }
            float getRatio() const { return cpGearJointGetRatio(_constraint); }

            void setPhase(float phase) { cpGearJointSetPhase(_constraint, phase); }
            void setRatio(float ratio) { cpGearJointSetRatio(_constraint, ratio); }
        };

        class SimpleMotor : public Constraint
        {
        public:
            SimpleMotor(Body& a, Body& b, float rate);

            float getRate() const { return cpSimpleMotorGetRate(_constraint); }

            void setRate(float rate) { cpSimpleMotorSetRate(_constraint, rate); }
        };

    }
}

#endif // SOL_USE_PHYSICS

#endif


text:
<?php

/**
 * @file
 * Boilerplate WordPress plugin.
 *
 * Plugin and custom plugin framework created by: Topsitemakers.
 * http://www.topsitemakers.com/
 */

/**
 * Plugin name: OOP Boilerplate
 * Description: Custom plugin boilerplate. Based on the Laguna WordPress plugin framework.
 * Author: Topsitemakers
 * Author URI: http://www.topsitemakers.com/
 * Version: 1.0
 */

// Sanity check.
if (!defined('ABSPATH')) die('Direct access is not allowed.');

// Constant variables used in the plugin.
require dirname(__FILE__) . '/includes/constants.php';

// Helper functions.
require dirname(__FILE__) . '/includes/helper.common.php';

// User list table class.
require dirname(__FILE__) . '/includes/class.user-list.php';

// Widgets.
require dirname(__FILE__) . '/widgets/sample.php';

/**
 * Main plugin class.
 */
class Boilerplate {

  // Plugin name; to be used throughout this class
  // Has to be the same as the plugin folder name.
  var $namespace = 'boilerplate';

  /**
   * Constructor.
   */
  function __construct() {
    // Localization.
    load_plugin_textdomain($this->namespace . '-locale', FALSE, dirname(plugin_basename(__FILE__)) . '/lang');
    // Actions.
    add_action('init',                                         array(&$this, 'init'));
    add_action('admin_init',                                   array(&$this, 'admin_init'));
    add_action('admin_menu',                                   array(&$this, 'admin_menu'));
    add_action('wp_ajax_nopriv_' . $this->namespace . '_ajax', array(&$this, 'ajax'));
    add_action('wp_ajax_' . $this->namespace . '_ajax',        array(&$this, 'ajax'));
    add_action('save_post',                                    array(&$this, 'save_post'));
    add_action('before_delete_post',                           array(&$this, 'before_delete_post'));
    add_action('comment_post',                                 array(&$this, 'comment_post'));
    add_action('profile_update',                               array(&$this, 'profile_update'), 100);
    add_action('user_register',                                array(&$this, 'user_register'), 100);
    add_action('delete_user',                                  array(&$this, 'delete_user'), 100);
    add_action($this->namespace . '_execute_cron',             array(&$this, 'cron'));
    // Filters.
    //
    // Registers.
    register_activation_hook(__FILE__, array(&$this, 'install'));
    // Shortcodes.
    add_shortcode('sample', array(&$this, 'shortcode_sample'));
    // Widgets.
    add_action('widgets_init', array(&$this, 'widgets'));
  }

  /**
   * Plugin installation.
   */
  public function install() {

    global $wpdb;

    // Define table names.
    $table_name_sample   = $wpdb->prefix . 'boilerplate_sample';

    // Check if the tables already exist.
    if ($wpdb->get_var("SHOW TABLES LIKE '" . $table_name_sample . "'") != $table_name_sample) {
      // Table SQL
      $table_sample = "CREATE TABLE " . $table_name_sample . "(
                        sid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
                        time INT NOT NULL,
                        text VARCHAR(8) NOT NULL);";

      // Get the upgrade PHP and create the tables.
      require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
      dbDelta($table_sample);
    }

    // Setup default values of the variables.
    add_option(BOILERPLATE_SHORTNAME . 'sample_variable', '0');

  }

  /**
   * Front-end init.
   */
  public function init() {

    // Front-end styles.
    wp_enqueue_style($this->namespace . '-style-common', plugins_url($this->namespace . '/assets/css/front.css'));
    // Front-end scripts.
    wp_enqueue_script($this->namespace . '-script-common', plugins_url($this->namespace . '/assets/js/front.js'), array('jquery'));

    // Hook our cron.
    if (!wp_next_scheduled($this->namespace . '_execute_cron')) {
      wp_schedule_event(current_time('timestamp'), 'every_minute', $this->namespace . '_execute_cron');
    }

  }

  /**
   * Admin init.
   */
  public function admin_init() {

    // Admin styles.
    wp_enqueue_style($this->namespace . '-style-admin', plugins_url($this->namespace . '/assets/css/admin.css'));
    wp_enqueue_style('thickbox');
    // Admin scripts.
    wp_enqueue_script($this->namespace . '-script-admin', plugins_url($this->namespace . '/assets/js/admin.js'), array('jquery'));
    wp_enqueue_script('media-upload');

  }

  /**
   * Cron callback.
   */
  public function cron() {
    global $wpdb;

    //

  }

  /**
   * Define links for administrators.
   */
  public function admin_menu() {

    // Main settings page.
    add_menu_page(__('Boilerplate'), __('Boilerplate'), 'manage_options', $this->namespace . '/admin-pages/options.php');

    // Subpages.
    add_submenu_page($this->namespace . '/admin-pages/options.php', __('Options'), __('Options'), 'manage_options', $this->namespace . '/admin-pages/options.php');
    add_submenu_page($this->namespace . '/admin-pages/options.php', __('Subpage'), __('Subpage'), 'manage_options', $this->namespace . '/admin-pages/subpage.php');
    add_submenu_page($this->namespace . '/admin-pages/options.php', __('User List'), __('User List'), 'manage_options', $this->namespace . '/admin-pages/user-list.php');

  }

  /**
   * AJAX callback.
   */
  public function ajax() {

    // Check if the nonces match.
    if (!wp_verify_nonce($_POST['nonce'], $this->namespace . '-post-nonce')) die('Disallowed action.');

    // Check the operation.
    $op = filter_input(INPUT_POST, 'op', FILTER_SANITIZE_STRING);
    if (!$op) die('Disallowed operation.');

    // Perform the actions.
    global $wpdb;
    switch ($op) {

      // Sample AJAX callback action.
      case 'settings':
        break;

      // Default handler.
      default:
        die('Disallowed action.');

    }

    // Required by WP.
    exit;

  }

  /**
   * Register custom widgets.
   *
   * Widgets should be placed in separate files in /widgets and included at
   * the beginning of this file.
   */
  public function widgets() {
    register_widget('Boilerplate_Sample_Widget');
  }

  /**
   * Custom shortcode.
   */
  public function shortcode_sample($atts) {
    global $wpdb;

    extract(shortcode_atts(array(
      'attribute' => 'value',
    ), $atts));

    return 'attribute = "' . $attribute . '"';
  }

  /**
   * Action called upon saving a new post.
   */
  public function save_post($post_id) {
    // Make sure this is not a revision.
    if (!wp_is_post_revision($post_id)) {
      global $wpdb;
      $post = get_post($post_id);

      // Custom processing based on post type.
      switch ($post->post_type) {
        case 'page':
          break;

        case 'post':
          break;
      }

    }
  }

  /**
   * Action called upon saving a new post.
   */
  public function before_delete_post($post_id) {
    // Make sure this is not a revision.
    if (!wp_is_post_revision($post_id)) {
      global $wpdb;
      $post = get_post($post_id);

      // Custom processing based on post type.
      switch ($post->post_type) {
        case 'page':
          break;

        case 'post':
          break;
      }

    }
  }

  /**
   * Action called upon submitting a new comment.
   */
  public function comment_post($comment_id, $approval_status) {
    global $wpdb;
    $comment = get_comment($comment_id);

    //

  }

  /**
   * Action called upon updating user profile.
   */
  public function profile_update($user_id = NULL, $old_user_data = NULL) {
    if ($user_id) {
      global $wpdb;
      $user = get_userdata($user_id);

      //

    }
  }

  /**
   * Action called upon user registration.
   */
  public function user_register($user_id) {
    global $wpdb;
    $user = get_userdata($user_id);

    //

  }

  /**
   * Action called upon user deletion.
   *
   * Note: the action call in $this->init() has weight of 100. This might need
   * to be adjusted for purposes of the plugin.
   */
  public function delete_user($user_id) {
    global $wpdb;
    $user = get_userdata($user_id);

    //

  }

}

// Initiate our plugin.
new Boilerplate();


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SpyComponent } from './spy.component';

describe('SpyComponent', () => {
  let component: SpyComponent;
  let fixture: ComponentFixture<SpyComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ SpyComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SpyComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


text:
using GalaSoft.MvvmLight.Messaging;

namespace gestadh45.business.PersonalizedMsg
{
	/// <summary>
	/// NotificationMessage demandant l'effacement du filtre.
	/// </summary>
	public class NMClearFilter : NotificationMessage
	{
		/// <summary>
		/// Initialise une nouvelle instance de NMClearFilter.
		/// </summary>
		public NMClearFilter() : base(NMType.NMClearFilter) {
		}
	}
}