text:
using System;
using System.Linq;
using System.Threading;
using NUnit.Framework;
using SupaCharge.Core.ThreadingAbstractions;
using SupaCharge.Testing;

namespace SupaCharge.UnitTests.Core.ThreadingAbstractions {
  [TestFixture]
  public class ThreadPoolWorkQueueTest : BaseTestCase {
    [Test]
    public void TestEnqueueWithWorkThatSetsFutureWithResult() {
      var future = mQueue.Enqueue(() => {
                                    CheckDifferentThread();
                                    return 55;
                                  });
      Assert.That(future.Wait(), Is.EqualTo(55));
    }

    [Test]
    public void TestEnqueueWithWorkThatThrowsFutureWithResult() {
      var future = mQueue.Enqueue(() => {
                                    CheckDifferentThread();
                                    throw new Exception("something bad");
                                  });
      var actualEx = Assert.Throws<FutureException>(future.Wait);
      Assert.That(actualEx.Message, Is.EqualTo("Error Resolving Future"));
      Assert.That(actualEx.InnerException.Message, Is.EqualTo("something bad"));
    }

    [Test]
    public void TestEnqueueWithWorkWithDataThatSetsFutureWithResult() {
      var future = mQueue.Enqueue(2, x => {
                                       CheckDifferentThread();
                                       return 55 * x;
                                     });
      Assert.That(future.Wait(), Is.EqualTo(110));
    }

    [Test]
    public void TestEnqueueWithWorkWithDataThatThrowsFutureWithResult() {
      var future = mQueue.Enqueue<int, int>(2, x => {
                                                 CheckDifferentThread();
                                                 throw new Exception("something bad");
                                               });
      var actualEx = Assert.Throws<FutureException>(() => future.Wait());
      Assert.That(actualEx.Message, Is.EqualTo("Error Resolving Future"));
      Assert.That(actualEx.InnerException.Message, Is.EqualTo("something bad"));
    }

    [Test]
    public void TestEnqueueWithWorkThatSetsFutureWithNoResult() {
      var ctr = 0;
      mQueue.Enqueue(() => {
                       CheckDifferentThread();
                       Interlocked.Increment(ref ctr);
                     }).Wait();
      var val = 1;
      Interlocked.CompareExchange(ref val, 0, ctr);
      Assert.That(val, Is.EqualTo(0));
    }

    [Test]
    public void TestEnqueueWithWorkThatThrowsFutureWithNoResult() {
      var future = mQueue.Enqueue(() => {
                                    CheckDifferentThread();
                                    throw new Exception("something bad");
                                  });
      var actualEx = Assert.Throws<FutureException>(future.Wait);
      Assert.That(actualEx.Message, Is.EqualTo("Error Resolving Future"));
      Assert.That(actualEx.InnerException.Message, Is.EqualTo("something bad"));
    }

    [Test]
    public void TestEnqueueWithWorkWithDataThatSetsFutureWithNoResult() {
      var ctr = 0;
      mQueue.Enqueue(10, x => {
                           CheckDifferentThread();
                           Interlocked.Add(ref ctr, x);
                         }).Wait();
      var val = 10;
      Interlocked.CompareExchange(ref val, 0, ctr);
      Assert.That(val, Is.EqualTo(0));
    }

    [Test]
    public void TestEnqueueWithWorkWithDataThatThrowsFutureWithNoResult() {
      var future = mQueue.Enqueue(15, x => {
                                        CheckDifferentThread();
                                        throw new Exception("something bad " + x);
                                      });
      var actualEx = Assert.Throws<FutureException>(future.Wait);
      Assert.That(actualEx.Message, Is.EqualTo("Error Resolving Future"));
      Assert.That(actualEx.InnerException.Message, Is.EqualTo("something bad 15"));
    }

    [Test]
    public void TestEnqueueMultipleItems() {
      var results = Enumerable
        .Range(0, 3)
        .Select(x => mQueue.Enqueue(() => x))
        .Select(f => f.Wait())
        .ToArray();

      Assert.That(results, Is.EqualTo(BA(0, 1, 2)));
    }

    [SetUp]
    public void DoSetup() {
      mQueue = new ThreadPoolWorkQueue();
      mThreadID = Thread.CurrentThread.ManagedThreadId;
    }

    private void CheckDifferentThread() {
      Assert.That(Thread.CurrentThread.ManagedThreadId, Is.Not.EqualTo(mThreadID));
    }

    private ThreadPoolWorkQueue mQueue;
    private int mThreadID;
  }
}


text:
<?php
	class Controller_spritecomics_index extends Controller_main
	{
		public function get_index()
		{
			\Eliya\Tpl::set([
				'page_title'		=>	Library_i18n::get('spritecomics.index.page_title'),
				'page_description'	=>	Library_i18n::get('spritecomics.index.page_description'),
			]);

			$this->response->set(\Eliya\Tpl::get('spritecomics/index'));
		}
	}

redpajama_set_name: RedPajamaGithub


text:
Common
======

Common methods all Habari powered sites/apps should have


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.DocAsCode.MarkdownLite
{
    using System;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System.Net;

    public static class StringHelper
    {

        private static readonly string[] EmptyArray = new string[0];

        public static string DecodeURIComponent(string str)
        {
            return Uri.UnescapeDataString(str);
        }

        public static string HtmlEncode(string html)
        {
            return WebUtility.HtmlEncode(html);
        }

        public static string HtmlDecode(string html)
        {
            return WebUtility.HtmlDecode(html);
        }

        public static string Escape(string html, bool encode = false)
        {
            return html
                .ReplaceRegex(encode ? Regexes.Helper.HtmlEscapeWithEncode : Regexes.Helper.HtmlEscapeWithoutEncode, "&")
                .Replace("<", "<")
                .Replace(">", ">")
                .Replace("\"", """)
                .Replace("'", "'");
        }

        public static string Unescape(string html)
        {
            return Regexes.Helper.HtmlUnescape.Replace(html, match =>
            {
                var n = match.Groups[1].Value;

                n = n.ToLower();
                if (n == "amp") return "&";
                if (n == "colon") return ":";
                if (n[0] == '#')
                {
                    return n[1] == 'x'
                        ? ((char)Convert.ToInt32(n.Substring(2), 16)).ToString()
                        : ((char)Convert.ToInt32(n.Substring(1))).ToString();
                }
                return string.Empty;
            });
        }

        public static string EscapeMarkdown(string text)
        {
            return Regexes.Helper.MarkdownEscape.Replace(text, m => "\\" + m.Value);
        }

        public static string EscapeMarkdownHref(string text)
        {
            return Regexes.Helper.MarkdownHrefEscape.Replace(text, m => "\\" + m.Value);
        }

        [Obsolete]
        public static string LegacyEscapeMarkdown(string text)
        {
            return Regexes.Helper.LegacyMarkdownEscape.Replace(text, m => "\\" + m.Value);
        }

        public static string UnescapeMarkdown(string markdown)
        {
            return Regexes.Helper.MarkdownUnescape.Replace(markdown, m => m.Groups[1].Value);
        }

        [Obsolete]
        public static string LegacyUnescapeMarkdown(string markdown)
        {
            return Regexes.Helper.LegacyMarkdownUnescape.Replace(markdown, m => m.Groups[1].Value);
        }

        public static string NotEmpty(IList<string> source, int index1, int index2)
        {
            if (source.Count > index1 && !string.IsNullOrEmpty(source[index1]))
            {
                return source[index1];
            }
            return source[index2];
        }

        public static string ReplaceRegex(this string input, Regex pattern, string replacement)
        {
            return pattern.Replace(input, replacement);
        }

        public static string[] SplitRegex(this string input, Regex pattern)
        {
            return pattern.Split(input);
        }

        public static string[] Apply(this Regex regex, string src, int index = 0)
        {
            var match = regex.Match(src, index);
            if (!match.Success)
            {
                return EmptyArray;
            }
            var result = new string[match.Groups.Count];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = match.Groups[i].Value;
            }
            return result;
        }

        public static string[] Match(this string src, Regex regex)
        {
            var matches = regex.Matches(src);
            var result = new string[matches.Count];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = matches[i].Value;
            }
            return result;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->
<!DOCTYPE log4j:configuration>

<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">

  <appender name="ROLL" class="org.apache.log4j.rolling.RollingFileAppender">
    <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
      <param name="fileNamePattern" value="output/test1-%d{yyyy-MM-dd_HH_mm_ss}"/>
    </rollingPolicy>

    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%c{1} - %m%n"/>
    </layout>
  </appender>

<!--
  <logger name="org.apache.log4j.joran"><level value="INFO"/></logger>
  <logger name="org.apache.log4j.rolling.RollingFileAppender"><level value="INFO"/></logger>
  <logger name="org.apache.log4j.rolling.TimeBasedRollingPolicy"><level value="INFO"/></logger>
  <logger name="org.apache.log4j.config.PropertySetter"><level value="INFO"/></logger>
-->
  <logger name="org.apache.log4j.rolling.TimeBasedRollingTest">
    <appender-ref ref="ROLL"/>
  </logger>

</log4j:configuration>


text:
package org.jamocha.function.fwa;

import lombok.AllArgsConstructor;

import org.jamocha.dn.memory.SlotType;
import org.jamocha.function.Function;
import org.jamocha.languages.common.ScopeStack.Symbol;
import org.jamocha.languages.common.errors.VariableNotDeclaredError;

/**
 * @author Fabian Ohler <fabian.ohler1@rwth-aachen.de>
 */
@AllArgsConstructor
public class RHSVariableLeaf implements ExchangeableLeaf<RHSVariableLeaf>, VariableLeaf {
    final VariableValueContext context;
    final Symbol key;
    final SlotType type;

    @Override
    public Object evaluate(final Object... params) {
        final Object value = context.get(key);
        if (null == value) throw new VariableNotDeclaredError(key.getImage());
        return value;
    }

    @Override
    public <V extends FunctionWithArgumentsVisitor<RHSVariableLeaf>> V accept(final V visitor) {
        visitor.visit(this);
        return visitor;
    }

    @Override
    public SlotType[] getParamTypes() {
        return SlotType.EMPTY;
    }

    @Override
    public SlotType getReturnType() {
        return type;
    }

    @Override
    public Function<?> lazyEvaluate(final Function<?>... params) {
        return new GenericWithArgumentsComposite.LazyObject<>(evaluate());
    }

    @Override
    public int hashPositionIsIrrelevant() {
        return 0;
    }

    @Override
    public ExchangeableLeaf<RHSVariableLeaf> copy() {
        throw new UnsupportedOperationException("Can't copy stateful leafs!");
    }

    @Override
    public Object reset() {
        context.put(key, null);
        return null;
    }

    @Override
    public Object set(final Object value) {
        context.put(key, value);
        return value;
    }
}


text:
/**
 * Created by ZZQ on 2017/4/5.
 */
(function() {

    // init stats
    let stats = new Stats();
    document.body.appendChild(stats.domElement);

    // init renderer
    let renderer = new THREE.WebGLRenderer({ antialias: true });
    renderer.setPixelRatio(window.devicePixelRatio);
    renderer.setSize(window.innerWidth,window.innerHeight);
    renderer.setClearColor(0x666666);
    renderer.shadowMap.enabled = true;

    document.body.appendChild(renderer.domElement);

    // init scene
    let scene = new THREE.Scene();

    // init camera
    let camera = new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,100);
    camera.position.set(4,3,5);
    camera.lookAt(new THREE.Vector3(0,0,0));
    scene.add(camera);

    // init controls
    let controls = new THREE.TrackballControls(camera);
    controls.staticMoving = true;
    controls.addEventListener("change", render);

    // init texture loader
    let textureLoader = new THREE.TextureLoader();

    // make plane
    let planeTexture = textureLoader.load("images/wood.jpg", () => render());
    let plane = new THREE.Mesh(new THREE.PlaneGeometry(20,20), new THREE.MeshPhongMaterial({ map: planeTexture, specular: 0xffffff, side: THREE.DoubleSide }));
    plane.rotation.x = -Math.PI/2;
    plane.position.y = -1.4;
    plane.receiveShadow = true;
    scene.add(plane);

    // load vehicle
    let vehicle;
    let vehicleModelPath = "models/vehicle/";
    let mtlLoader = new THREE.MTLLoader();
    mtlLoader.setPath(vehicleModelPath);
    mtlLoader.load("vehicle.mtl", materials => {
        materials.preload();
        let objLoader = new THREE.OBJLoader();
        objLoader.setMaterials(materials);
        objLoader.setPath(vehicleModelPath);
        objLoader.load("vehicle.obj", object => {
            vehicle = object;
            vehicle.position.set(0,-1.4,0);
            vehicle.scale.set(0.05,0.05,0.05);
            vehicle.traverse(child => {
                if (child instanceof THREE.Mesh)
                    child.castShadow = true;
            });
            scene.add(vehicle);
            render();
        });
    });

    // light up
    let ambientLight = new THREE.AmbientLight(0x666666);
    scene.add(ambientLight);
    let directionalLight = new THREE.DirectionalLight(0x666666);
    directionalLight.position.set(-12,3,6);
    directionalLight.castShadow = true;
    directionalLight.shadow.camera.left = -15;
    directionalLight.shadow.camera.right = 15;
    scene.add(directionalLight);

    // init flags
    let moveForward = false;
    let moveBackward = false;
    let turnLeft = false;
    let turnRight = false;

    // bind events
    window.addEventListener("resize", function () {
        camera.aspect = window.innerWidth/window.innerHeight;
        camera.updateProjectionMatrix();
        renderer.setSize(window.innerWidth,window.innerHeight);
        controls.handleResize();
        render();
    });

    document.body.onkeyup = function (e) {
        switch (e.keyCode) {
            case 87: moveForward = false; break;
            case 65: turnLeft = false; break;
            case 83: moveBackward = false; break;
            case 68: turnRight = false; break;
        }
    };

    document.body.onkeydown = function (e) {
        switch (e.keyCode) {
            case 87: moveForward = true; break;
            case 65: turnLeft = true; break;
            case 83: moveBackward = true; break;
            case 68: turnRight = true; break;
        }
    };

    // render
    render();
    animate();

    // helper functions
    function render() {
        renderer.render(scene, camera);
        stats.update();
    }

    function animate() {
        requestAnimationFrame(animate);
        controls.update();
        if (moveForward) {
            vehicle.translateX(-0.05);
            render();
        }
        if (moveBackward) {
            vehicle.translateX(0.05);
            render();
        }
        if (turnLeft) {
            vehicle.rotateY(0.01);
            render();
        }
        if (turnRight) {
            vehicle.rotateY(-0.01);
            render();
        }
    }

}());


text: export {OrderComponent} from './order.component';


text:
package entities;

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

/**
 * Describes an employee who can realize a feature
 * @author Vavou
 *
 */
public class Employee {

	/* --- Atributes --- */

	/**
	 * The name of the employee
	 */
	private String name;

	/**
	 * The skills of the employee
	 */
	private List<Skill> skills;

	/**
	 * The available number of hours per week
	 */
	private double weekAvailability;

	/* --- Getters and setters --- */

	/**
	 * Returns the name of the employee
	 * @return the name of the employee
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name of the employee
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Returns the skills of the employee
	 * @return the skills of the employee
	 */
	public List<Skill> getSkills() {
		return skills;
	}

	/**
	 * @param skills the skills to set
	 */
	public void setSkills(List<Skill> skills) {
		this.skills = skills;
	}

	/**
	 * @return the weekAvailability
	 */
	public double getWeekAvailability() {
		return weekAvailability;
	}

	/**
	 * @param weekAvailability the weekAvailability to set
	 */
	public void setWeekAvailability(double weekAvailability) {
		this.weekAvailability = weekAvailability;
	}

	/* --- Constructor --- */

	/**
	 * Constructs a new employee
	 * @param name
	 * @param weekAvailability in hours per week
	 */
	public Employee(String name, double weekAvailability, List<Skill> skills) {
		this.name = name;
		this.weekAvailability = weekAvailability;
		this.skills = skills == null ? new ArrayList<Skill>() : skills;
	}

	/**
	 * Returns the name of the employee
	 * @return the name of the employee
	 */
	@Override
	public String toString() {
		return getName();
	}

	/**
	 * Two employees are equals if they have the same name
	 * @param obj The other object to compare
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;

		if (getClass() != obj.getClass())
			return false;

		Employee other = (Employee) obj;

		return this.getName().equals(other.getName());
	}

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


text:
package main

import (
	"flag"
	"github.com/xiaonanln/pktconn"

	"math/rand"
	"time"

	"os"

	_ "net/http/pprof"

	"runtime"

	"os/signal"

	"syscall"

	"fmt"

	"path"

	"github.com/xiaonanln/goworld/engine/binutil"
	"github.com/xiaonanln/goworld/engine/common"
	"github.com/xiaonanln/goworld/engine/config"
	"github.com/xiaonanln/goworld/engine/dispatchercluster"
	"github.com/xiaonanln/goworld/engine/dispatchercluster/dispatcherclient"
	"github.com/xiaonanln/goworld/engine/gwlog"
	"github.com/xiaonanln/goworld/engine/post"
)

var (
	args struct {
		gateid          uint16
		configFile      string
		logLevel        string
		runInDaemonMode bool
		//listenAddr      string
	}
	gateService *GateService
	signalChan  = make(chan os.Signal, 1)
)

func parseArgs() {
	var gateIdArg int
	flag.IntVar(&gateIdArg, "gid", 0, "set gateid")
	flag.StringVar(&args.configFile, "configfile", "", "set config file path")
	flag.StringVar(&args.logLevel, "log", "", "set log level, will override log level in config")
	flag.BoolVar(&args.runInDaemonMode, "d", false, "run in daemon mode")
	//flag.StringVar(&args.listenAddr, "listen-addr", "", "set listen address for gate, overriding listen_addr in config file")
	flag.Parse()
	args.gateid = uint16(gateIdArg)
}

func main() {
	rand.Seed(time.Now().UnixNano())
	parseArgs()

	if args.runInDaemonMode {
		daemoncontext := binutil.Daemonize()
		defer daemoncontext.Release()
	}

	if args.configFile != "" {
		config.SetConfigFile(args.configFile)
	}

	if args.gateid <= 0 {
		gwlog.Errorf("gateid %d is not valid, should be positive", args.gateid)
		os.Exit(1)
	}

	gateConfig := config.GetGate(args.gateid)
	verifyGateConfig(gateConfig)
	if gateConfig.GoMaxProcs > 0 {
		gwlog.Infof("SET GOMAXPROCS = %d", gateConfig.GoMaxProcs)
		runtime.GOMAXPROCS(gateConfig.GoMaxProcs)
	}
	logLevel := args.logLevel
	if logLevel == "" {
		logLevel = gateConfig.LogLevel
	}
	binutil.SetupGWLog(fmt.Sprintf("gate%d", args.gateid), logLevel, gateConfig.LogFile, gateConfig.LogStderr)

	gateService = newGateService()
	if gateConfig.EncryptConnection {
		cfgdir := config.GetConfigDir()
		rsaCert := path.Join(cfgdir, gateConfig.RSACertificate)
		rsaKey := path.Join(cfgdir, gateConfig.RSAKey)
		binutil.SetupHTTPServerTLS(gateConfig.HTTPAddr, gateService.handleWebSocketConn, rsaCert, rsaKey)
	} else {
		binutil.SetupHTTPServer(gateConfig.HTTPAddr, gateService.handleWebSocketConn)
	}

	dispatchercluster.Initialize(args.gateid, dispatcherclient.GateDispatcherClientType, false, false, &gateDispatcherClientDelegate{})
	//dispatcherclient.Initialize(&gateDispatcherClientDelegate{}, true)
	setupSignals()
	gateService.run() // run gate service in another goroutine
}

func verifyGateConfig(gateConfig *config.GateConfig) {
}

func setupSignals() {
	gwlog.Infof("Setup signals ...")
	signal.Ignore(syscall.Signal(10), syscall.Signal(12), syscall.SIGPIPE, syscall.SIGHUP)
	signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)

	go func() {
		for {
			sig := <-signalChan
			if sig == syscall.SIGINT || sig == syscall.SIGTERM {
				// terminating gate ...
				gwlog.Infof("Terminating gate service ...")
				post.Post(func() {
					gateService.terminate()
				})

				gateService.terminated.Wait()
				gwlog.Infof("Gate %d terminated gracefully.", args.gateid)
				os.Exit(0)
			} else {
				gwlog.Errorf("unexpected signal: %s", sig)
			}
		}
	}()
}

type gateDispatcherClientDelegate struct {
}

func (delegate *gateDispatcherClientDelegate) GetDispatcherClientPacketQueue() chan *pktconn.Packet {
	return gateService.dispatcherClientPacketQueue
}

func (delegate *gateDispatcherClientDelegate) HandleDispatcherClientDisconnect() {
	//gwlog.Errorf("Disconnected from dispatcher, try reconnecting ...")
	// if gate is disconnected from dispatcher, we just quit
	gwlog.Infof("Disconnected from dispatcher, gate has to quit.")
	signalChan <- syscall.SIGTERM // let gate quit
}

func (deleget *gateDispatcherClientDelegate) GetEntityIDsForDispatcher(dispid uint16) []common.EntityID {
	return nil
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: window.cpp Example File (widgets/groupbox/window.cpp)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

window.cpp Example File
widgets/groupbox/window.cpp

 #include <QtGui>

 #include "window.h"

 Window::Window(QWidget *parent)
     : QWidget(parent)
 {
     QGridLayout *grid = new QGridLayout;
     grid->addWidget(createFirstExclusiveGroup(), 0, 0);
     grid->addWidget(createSecondExclusiveGroup(), 1, 0);
     grid->addWidget(createNonExclusiveGroup(), 0, 1);
     grid->addWidget(createPushButtonGroup(), 1, 1);
     setLayout(grid);

     setWindowTitle(tr("Group Boxes"));
     resize(480, 320);
 }

 QGroupBox *Window::createFirstExclusiveGroup()
 {
     QGroupBox *groupBox = new QGroupBox(tr("Exclusive Radio Buttons"));

     QRadioButton *radio1 = new QRadioButton(tr("&Radio button 1"));
     QRadioButton *radio2 = new QRadioButton(tr("R&adio button 2"));
     QRadioButton *radio3 = new QRadioButton(tr("Ra&dio button 3"));

     radio1->setChecked(true);

     QVBoxLayout *vbox = new QVBoxLayout;
     vbox->addWidget(radio1);
     vbox->addWidget(radio2);
     vbox->addWidget(radio3);
     vbox->addStretch(1);
     groupBox->setLayout(vbox);

     return groupBox;
 }

 QGroupBox *Window::createSecondExclusiveGroup()
 {
     QGroupBox *groupBox = new QGroupBox(tr("E&xclusive Radio Buttons"));
     groupBox->setCheckable(true);
     groupBox->setChecked(false);

     QRadioButton *radio1 = new QRadioButton(tr("Rad&io button 1"));
     QRadioButton *radio2 = new QRadioButton(tr("Radi&o button 2"));
     QRadioButton *radio3 = new QRadioButton(tr("Radio &button 3"));
     radio1->setChecked(true);
     QCheckBox *checkBox = new QCheckBox(tr("Ind&ependent checkbox"));
     checkBox->setChecked(true);

     QVBoxLayout *vbox = new QVBoxLayout;
     vbox->addWidget(radio1);
     vbox->addWidget(radio2);
     vbox->addWidget(radio3);
     vbox->addWidget(checkBox);
     vbox->addStretch(1);
     groupBox->setLayout(vbox);

     return groupBox;
 }

 QGroupBox *Window::createNonExclusiveGroup()
 {
     QGroupBox *groupBox = new QGroupBox(tr("Non-Exclusive Checkboxes"));
     groupBox->setFlat(true);

     QCheckBox *checkBox1 = new QCheckBox(tr("&Checkbox 1"));
     QCheckBox *checkBox2 = new QCheckBox(tr("C&heckbox 2"));
     checkBox2->setChecked(true);
     QCheckBox *tristateBox = new QCheckBox(tr("Tri-&state button"));
     tristateBox->setTristate(true);
     tristateBox->setCheckState(Qt::PartiallyChecked);

     QVBoxLayout *vbox = new QVBoxLayout;
     vbox->addWidget(checkBox1);
     vbox->addWidget(checkBox2);
     vbox->addWidget(tristateBox);
     vbox->addStretch(1);
     groupBox->setLayout(vbox);

     return groupBox;
 }

 QGroupBox *Window::createPushButtonGroup()
 {
     QGroupBox *groupBox = new QGroupBox(tr("&Push Buttons"));
     groupBox->setCheckable(true);
     groupBox->setChecked(true);

     QPushButton *pushButton = new QPushButton(tr("&Normal Button"));
     QPushButton *toggleButton = new QPushButton(tr("&Toggle Button"));
     toggleButton->setCheckable(true);
     toggleButton->setChecked(true);
     QPushButton *flatButton = new QPushButton(tr("&Flat Button"));
     flatButton->setFlat(true);

     QPushButton *popupButton = new QPushButton(tr("Pop&up Button"));
     QMenu *menu = new QMenu(this);
     menu->addAction(tr("&First Item"));
     menu->addAction(tr("&Second Item"));
     menu->addAction(tr("&Third Item"));
     menu->addAction(tr("F&ourth Item"));
     popupButton->setMenu(menu);

     QAction *newAction = menu->addAction(tr("Submenu"));
     QMenu *subMenu = new QMenu(tr("Popup Submenu"));
     subMenu->addAction(tr("Item 1"));
     subMenu->addAction(tr("Item 2"));
     subMenu->addAction(tr("Item 3"));
     newAction->setMenu(subMenu);

     QVBoxLayout *vbox = new QVBoxLayout;
     vbox->addWidget(pushButton);
     vbox->addWidget(toggleButton);
     vbox->addWidget(flatButton);
     vbox->addWidget(popupButton);
     vbox->addStretch(1);
     groupBox->setLayout(vbox);

     return groupBox;
 }

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
#include <assert.h>
#include <jni.h>
#include <QApplication>
#include <QThread>
#include <gnu_java_awt_peer_qt_MainQtThread.h>
#include "mainthreadinterface.h"

MainThreadInterface *mainThread;
QApplication *qApplication;

/**
 * Starts up a QApplication
 */
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_qt_MainQtThread_init
(JNIEnv *env, jobject obj, jstring theme, jboolean doublebuffer)
{
  int *argc;
  char **argv;

  if(theme != NULL)
    {
      argc = (int*)malloc(sizeof(int));
      *argc = 3;
      argv = (char **)malloc( 3 * sizeof(char *) );
      argv[0] = (char *)malloc(10 * sizeof(char));
      argv[1] = (char *)malloc(10 * sizeof(char));
      argv[2] = (char *)malloc(100 * sizeof(char));
      strncpy(argv[0], "\0", 2);
      strncpy(argv[1], "-style\0", 8);
      strncpy(argv[2], (char *)env->GetStringUTFChars( theme, NULL ), 100);
    }
   else
    {
      argc = (int*)malloc(sizeof(int));
      *argc = 1;
      argv = (char **)malloc( 3 * sizeof(char *) );
      argv[0] = (char *)malloc(10 * sizeof(char));
      strncpy(argv[0], " \0", 3);
    }
  QApplication *qtApp = new QApplication( *argc, argv );
  assert( qtApp );

  qApplication = qtApp;

  if( theme != NULL)
    env->ReleaseStringUTFChars( theme, argv[1] );

  mainThread = new MainThreadInterface( qtApp );

  jclass cls = env->GetObjectClass(obj);
  jfieldID nofid = env->GetFieldID( cls, "mainThreadInterface", "J" );
  env->SetLongField( obj, nofid, (jlong)mainThread );

  return (jlong)qtApp;
}

/*
 * Calls QApplication::exec()
 */
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_MainQtThread_exec
(JNIEnv *env, jobject obj, jlong ptr)
{
  QApplication *app = (QApplication *)ptr;
  if(app)
    app->exec();
}


text:
import {onMainHallPage} from "../support/page_objects/mainHallPage";
import {onShopPage} from "../support/page_objects/shopPage";

describe('Main Hall - Weapons Shop', () => {

  beforeEach(() => {
    cy.intercept('GET', '**/players.json*', {fixture: 'characters.json'});
    cy.intercept('GET', '**/players/*.json*', {fixture: 'character.json'});
    // cy.intercept('PUT', '**/players/*.json*', {fixture: 'character.json'});
    cy.visit('/main-hall/shop');
  })

  it('Can go to the shop', () => {
    cy.visit('/main-hall/hall');
    onMainHallPage.goToShop();
    cy.url().should('match', /main-hall\/shop$/);
  });

  it('Can buy standard weapons', () => {
    cy.visit('/main-hall/shop');
    onShopPage.goToBuyPage();
    onShopPage.expectGoldAmount(4200);
    cy.get('.weapons .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(8);
      cy.wrap(tiles).first().find('.btn-primary').click();
      cy.wrap(tiles).first().find('.message').should('be.visible').and('have.text', 'Bought!');
      cy.wait(2000);
      cy.wrap(tiles).first().find('.message').should('not.be.visible');
    });
    onShopPage.expectGoldAmount(4175);
    cy.get('.weapons .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(8);  // item didn't disappear
    });
  });

  it('Can buy non-standard weapons', () => {
    cy.visit('/main-hall/shop');
    onShopPage.goToBuyPage();
    onShopPage.expectGoldAmount(4200);
    cy.get('.weapons .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(8);
      const itemName = tiles.last().find('.artifact-name').text();
      const itemPrice = tiles.last().find('.artifact-price').text();
      cy.log(`Buying item ${itemName} for ${itemPrice}`);
      cy.wrap(tiles).last().find('.btn-primary').click();
      cy.wrap(tiles).last().find('.message').should('be.visible').and('have.text', 'Bought!');
      cy.wait(2000);
      cy.contains('.artifact-tile', itemName).should('not.exist');
      onShopPage.expectGoldAmount(4200 - itemPrice);
    });
    cy.get('.weapons .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(7);  // item disappeared
    });
  });

  it('Can buy armor', () => {
    cy.visit('/main-hall/shop');
    onShopPage.goToBuyPage();
    onShopPage.expectGoldAmount(4200);
    cy.get('.armor .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(5);
      cy.wrap(tiles).first().find('.btn-primary').click();
      cy.wrap(tiles).first().find('.message').should('be.visible').and('have.text', 'Bought!');
      cy.wait(2000);
      cy.wrap(tiles).first().find('.message').should('not.be.visible');
    });
    onShopPage.expectGoldAmount(4100);
    cy.get('.armor .artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(5);  // item didn't disappear
    });
  });

  it('Can sell items', () => {
    cy.visit('/main-hall/shop');
    onShopPage.goToSellPage();
    onShopPage.expectGoldAmount(4200);
    cy.get('.artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(3);
      const itemName = tiles.first().find('.artifact-name').text();
      const itemPrice = tiles.first().find('.artifact-price').text();
      cy.log(`Selling item ${itemName} for ${itemPrice}`);
      cy.wrap(tiles).first().find('.btn-primary').click();
      cy.wrap(tiles).first().find('.message').should('be.visible').and('have.text', 'Sold!');
      cy.wait(2000);
      cy.contains('.artifact-tile', itemName).should('not.exist');
      onShopPage.expectGoldAmount(4200 + +itemPrice);
    });
    cy.get('.artifact-tile').then(tiles => {
      expect(tiles.length).to.equal(2);  // item disappeared
    });
  });

});


text:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://pad.polito.it/boardList")
package it.polito.dp2.FDS.sol4.client.boardList.jaxb;


text:
package com.study.design.observer;

public interface Observer {

    void update(NumberGenerator numberGenerator);

}


text:
package microsoft.exchange.webservices.data.core.request;

import microsoft.exchange.webservices.data.core.EwsServiceXmlWriter;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.core.ExchangeService;
import microsoft.exchange.webservices.data.core.XmlElementNames;
import microsoft.exchange.webservices.data.core.response.ServiceResponse;
import microsoft.exchange.webservices.data.core.service.item.Item;
import microsoft.exchange.webservices.data.enumeration.ExchangeVersion;
import microsoft.exchange.webservices.data.enumeration.ServiceErrorHandling;
import microsoft.exchange.webservices.data.enumeration.ServiceObjectType;
import microsoft.exchange.webservices.data.enumeration.XmlNamespace;
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
import microsoft.exchange.webservices.data.misc.ItemIdWrapperList;

/**
 * Represents an abstract GetItem request.
 *
 * @param <TResponse> the generic type
 */
abstract class GetItemRequestBase<TResponse extends ServiceResponse> extends GetRequest<Item, TResponse> {

  /**
   * The item ids.
   */
  private ItemIdWrapperList itemIds = new ItemIdWrapperList();

  /**
   * Initializes a new instance of the class.
   *
   * @param service           the service
   * @param errorHandlingMode the error handling mode
   * @throws Exception
   */
  protected GetItemRequestBase(ExchangeService service,
      ServiceErrorHandling errorHandlingMode)
      throws Exception {
    super(service, errorHandlingMode);
  }

  /**
   * Validate request.
   *
   * @throws microsoft.exchange.webservices.data.exception.ServiceLocalException the service local exception
   * @throws Exception             the exception
   */
  protected void validate() throws ServiceLocalException, Exception {
    super.validate();
    EwsUtilities.validateParamCollection(this.getItemIds().iterator(), "ItemIds");
  }

  /**
   * Gets the expected response message count.
   *
   * @return Number of expected response messages
   */
  protected int getExpectedResponseMessageCount() {
    return this.itemIds.getCount();
  }

  /**
   * Gets the type of the service object this request applies to.
   *
   * @return The type of service object the request applies to
   */
  protected ServiceObjectType getServiceObjectType() {
    return ServiceObjectType.Item;
  }

  /**
   * Writes XML elements.
   *
   * @param writer the writer
   * @throws Exception the exception
   */
  protected void writeElementsToXml(EwsServiceXmlWriter writer)
      throws Exception {
    super.writeElementsToXml(writer);

    this.itemIds.writeToXml(writer, XmlNamespace.Messages,
        XmlElementNames.ItemIds);
  }

  /**
   * Gets the name of the XML element.
   *
   * @return XML element name
   */
  public String getXmlElementName() {
    return XmlElementNames.GetItem;
  }

  /**
   * Gets the name of the XML element.
   *
   * @return XML element name
   */
  protected String getResponseXmlElementName() {
    return XmlElementNames.GetItemResponse;
  }

  /**
   * Gets the name of the XML element.
   *
   * @return XML element name
   */
  protected String getResponseMessageXmlElementName() {
    return XmlElementNames.GetItemResponseMessage;
  }

  /**
   * Gets the request version.
   *
   * @return Earliest Exchange version in which this request is supported
   */
  protected ExchangeVersion getMinimumRequiredServerVersion() {
    return ExchangeVersion.Exchange2007_SP1;
  }

  /**
   * Gets the item ids.
   *
   * @return the item ids
   */
  public ItemIdWrapperList getItemIds() {
    return this.itemIds;
  }
}


text:
package iunet.service;

import java.util.Map;

import iunet.model.proj.UmActivation;
import iunet.model.proj.UmUser;

public interface RegisterService {

	boolean emailHasRegister(Map<String, Object> map);

	boolean emailHasRegisterOccupy(String email);

	int insertActivationByUUID(UmActivation record);

	String queryActivationDataByUUID(String uuid);

	int updateActivationStateByUUID(String uuid);
}


text:
using DrawIde.Core.Drawables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace DrawIde.Core.ExpressionParsers
{
    class FunctionDrawerParser : IExpressionParser
    {
        private static readonly string MATCH = @"^FUNCTION (?<function>'[xX\-\+\*\/\(\)0123456789\^]+')$";

        public bool MatchesExpression(string expression)
        {
            return Regex.Match(expression, MATCH, RegexOptions.IgnoreCase).Success;
        }

        public IDrawable Parse(string expression)
        {
            var match = Regex.Match(expression, MATCH, RegexOptions.IgnoreCase);
            if (!match.Success)
            {
                return null;
            }

            var function = match.Groups["function"].Value;

            return new FunctionDrawer(function);
        }

        public IDrawable Parse(string[] expressions, ref int index)
        {
            index++;
            return Parse(expressions[index - 1]);
        }
    }
}


text:
/**********************************************************
// Author   : K.(k79k06k02k)
// FileName : Utility.cs
**********************************************************/
using UnityEngine;

namespace ClientDataBase
{
    public class Utility
    {
        public struct TypeRelate
        {
            public static bool StringToBool(string value)
            {
                if (value == "T")
                    return true;
                else if (value == "F")
                    return false;
                else
                {
                    Debug.LogError(string.Format("Unable to convert value:[{0}]", value));
                    return false;
                }
            }
            public static Vector2 StringToVector2(string value)
            {
                string[] str = value.Split(',');
                return new Vector2(float.Parse(str[0]), float.Parse(str[1]));
            }
            public static Vector3 StringToVector3(string value)
            {
                string[] str = value.Split(',');
                return new Vector3(float.Parse(str[0]), float.Parse(str[1]), float.Parse(str[2]));
            }
        }

        public struct AssetRelate
        {
            /// <summary>
            /// Resources.Load 並檢查是否null
            /// </summary>
            public static T ResourcesLoadCheckNull<T>(string name) where T : UnityEngine.Object
            {
                T loadGo = Resources.Load<T>(name);

                if (loadGo == null)
                {
                    Debug.LogError("Resources.Load [ " + name + " ] is Null !!");
                    return default(T);
                }

                return loadGo;
            }
        }
    }
}


text:
from lib.net import http
from lib.net import utils
from lib.utils import printer
import re

class CommonDirectory():
	def __init__(self,url,agent,proxy,redirect):
		self.url = url
		self.printer = printer.Printer()
		self.http = http.Http(agent=agent,proxy=proxy,redirect=redirect)
		self.checker = utils.Checker()

	def Run(self):
		info = {
		'name'        : 'CommonDirectory',
		'author'      : 'Momo Outaadi (@M4ll0k)',
		'description' : 'Common directories'
		}
		dbcommondirs = open('data/CommDirs.txt','rb')
		dbfiles = list([x.split('\n') for x in dbcommondirs])
		for x in dbfiles:
			try:
				resp = self.http.Send(self.checker.Path(self.url,x[0]))
				if resp.status_code == 200 and resp._content:
					self.printer.plus('Directory Found: %s'%resp.url)
					if re.search(r'index of',resp.content,re.I):
						self.printer.plus('Dir \'%s\' listing enabled.'%x[0])
			except Exception:
				pass


text:
package org.mobilitydata.gtfsvalidator.notice.testnotices;

import org.mobilitydata.gtfsvalidator.notice.SeverityLevel;
import org.mobilitydata.gtfsvalidator.notice.ValidationNotice;

public class DoubleFieldNotice extends ValidationNotice {

  private final double doubleField;

  public DoubleFieldNotice(double doubleField, SeverityLevel severityLevel) {
    super(severityLevel);
    this.doubleField = doubleField;
  }
}


text:
#pragma once

#ifndef GEODE_STATISTICS_STATISTICSTYPEIMPL_H_
#define GEODE_STATISTICS_STATISTICSTYPEIMPL_H_

#include <map>
#include <string>
#include <vector>

#include <geode/ExceptionTypes.hpp>

#include "StatisticsFactory.hpp"
#include "StatisticsType.hpp"
#include "StatsDef.hpp"

namespace apache {
namespace geode {
namespace statistics {

/**
 * Gathers together a number of {@link StatisticDescriptor statistics}
 * into one logical type.
 *
 */

typedef std::map<std::string, std::shared_ptr<StatisticDescriptor>>
    StatisticsDescMap;

class StatisticsTypeImpl : public StatisticsType {
  std::string name;
  std::string description;
  std::vector<std::shared_ptr<StatisticDescriptor>> stats;
  StatisticsDescMap statsDescMap;
  int32_t intStatCount;
  int32_t longStatCount;
  int32_t doubleStatCount;

 public:
  StatisticsTypeImpl(std::string name, std::string description,
                     std::vector<std::shared_ptr<StatisticDescriptor>> stats);

  ~StatisticsTypeImpl() override;

  const std::string& getName() const override;

  const std::string& getDescription() const override;

  const std::vector<std::shared_ptr<StatisticDescriptor>>& getStatistics()
      const override;

  int32_t nameToId(const std::string& name) const override;

  std::shared_ptr<StatisticDescriptor> nameToDescriptor(
      const std::string& name) const override;

  /**
   *  Gets the number of statistics in this type that are ints.
   */
  int32_t getIntStatCount() const;

  /*
   * Gets the number of statistics in this type that are longs.
   */
  int32_t getLongStatCount() const;

  /*
   * Gets the number of statistics that are doubles.
   */
  int32_t getDoubleStatCount() const;

  /*
   * Gets the total number of statistic descriptors in the Type
   */
  size_t getDescriptorsCount() const override;
};  // class
}  // namespace statistics
}  // namespace geode
}  // namespace apache

#endif  // GEODE_STATISTICS_STATISTICSTYPEIMPL_H_


text:
package org.apache.ws.security.saml.ext.bean;

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

/**
 * Class SamlAttribute represents an instance of a SAML attribute.
 * <p/>
 * Created on May 18, 2009
 */
public class AttributeBean {
    private String simpleName;
    private String qualifiedName;
    private String nameFormat;
    private List<String> attributeValues;
    private List<?> customAttributeValues;

    /**
     * Constructor SamlAttribute creates a new SamlAttribute instance.
     */
    public AttributeBean() {
        attributeValues = new ArrayList<String>();
    }

    /**
     * Constructor SamlAttribute creates a new SamlAttribute instance.
     *
     * @param simpleName of type String
     * @param qualifiedName of type String
     * @param attributeValues of type List<String>
     */
    public AttributeBean(String simpleName, String qualifiedName, List<String> attributeValues) {
        this.simpleName = simpleName;
        this.qualifiedName = qualifiedName;
        this.attributeValues = attributeValues;
    }

    /**
     * Method getSimpleName returns the simpleName of this SamlAttribute object.
     *
     * @return the simpleName (type String) of this SamlAttribute object.
     */
    public String getSimpleName() {
        return simpleName;
    }

    /**
     * Method setSimpleName sets the simpleName of this SamlAttribute object.
     *
     * @param simpleName the simpleName of this SamlAttribute object.
     */
    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    /**
     * Method getNameFormat returns the nameFormat of this SamlAttribute object
     *
     * @return he nameFormat of this SamlAttribute object
     */
    public String getNameFormat() {
        return nameFormat;
    }

    /**
     * Method setNameFormat sets the nameFormat of this SamlAttribute object.
     *
     * @param nameFormat the nameFormat of this SamlAttribute object.
     */
    public void setNameFormat(String nameFormat) {
        this.nameFormat = nameFormat;
    }

    /**
     * Method getQualifiedName returns the qualifiedName of this SamlAttribute object.
     *
     * @return the qualifiedName (type String) of this SamlAttribute object.
     */
    public String getQualifiedName() {
        return qualifiedName;
    }

    /**
     * Method setQualifiedName sets the qualifiedName of this SamlAttribute object.
     *
     * @param qualifiedName the qualifiedName of this SamlAttribute object.
     */
    public void setQualifiedName(String qualifiedName) {
        this.qualifiedName = qualifiedName;
    }

    /**
     * Method getAttributeValues returns the attributeValues of this SamlAttribute object.
     *
     * @return the attributeValues (type List) of this SamlAttribute object.
     */
    public List<String> getAttributeValues() {
        return attributeValues;
    }

    /**
     * Method setAttributeValues sets the attributeValues of this SamlAttribute object.
     *
     * @param attributeValues the attributeValues of this SamlAttribute object.
     */
    public void setAttributeValues(List<String> attributeValues) {
        this.attributeValues = attributeValues;
    }

    /**
     * Method setCustomAttributeValues sets the attributeValues of this SamlAttribute object.
     * This method allows the user to specify OpenSAML XMLObject attributes.
     *
     * @param customAttributeValues the attributeValues of this SamlAttribute object.
     */
    public void setCustomAttributeValues(List<?> customAttributeValues) {
        this.customAttributeValues = customAttributeValues;
    }

    /**
     * Method getCustomAttributeValues returns the attributeValues of this SamlAttribute object.
     *
     * @return the attributeValues (type List) of this SamlAttribute object.
     */
    public List<?> getCustomAttributeValues() {
        return customAttributeValues;
    }

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

        AttributeBean that = (AttributeBean) o;

        if (attributeValues == null && that.attributeValues != null) {
            return false;
        } else if (attributeValues != null && !attributeValues.equals(that.attributeValues)) {
            return false;
        }

        if (customAttributeValues == null && that.customAttributeValues != null) {
            return false;
        } else if (customAttributeValues != null
                && !customAttributeValues.equals(that.customAttributeValues)) {
            return false;
        }

        if (qualifiedName == null && that.qualifiedName != null) {
            return false;
        } else if (qualifiedName != null && !qualifiedName.equals(that.qualifiedName)) {
            return false;
        }

        if (nameFormat == null && that.nameFormat != null) {
            return false;
        } else if (nameFormat != null && !nameFormat.equals(that.nameFormat)) {
            return false;
        }

        if (simpleName == null && that.simpleName != null) {
            return false;
        } else if (simpleName != null && !simpleName.equals(that.simpleName)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = 0;
        if (simpleName != null) {
            result = 31 * result + simpleName.hashCode();
        }
        if (qualifiedName != null) {
            result = 31 * result + qualifiedName.hashCode();
        }
        if (nameFormat != null) {
            result = 31 * result + nameFormat.hashCode();
        }
        if (attributeValues != null) {
            result = 31 * result + attributeValues.hashCode();
        }
        if (customAttributeValues != null) {
            result = 31 * result + customAttributeValues.hashCode();
        }
        return result;
    }
}


text:
static NSString *const GADMAdapterInMobiVersion = @"10.1.2.0";

/// InMobi SDK key.
static NSString *const GADMAdapterInMobiAccountID = @"accountid";

/// InMobi placement identifier.
static NSString *const GADMAdapterInMobiPlacementID = @"placementid";

/// InMobi adapter error domain.
static NSString *const GADMAdapterInMobiErrorDomain = @"com.google.mediation.inmobi";


text:
package labgob

//
// trying to send non-capitalized fields over RPC produces a range of
// misbehavior, including both mysterious incorrect computation and
// outright crashes. so this wrapper around Go's encoding/gob warns
// about non-capitalized field names.
//

import "encoding/gob"
import "io"
import "reflect"
import "fmt"
import "sync"
import "unicode"
import "unicode/utf8"

var mu sync.Mutex
var errorCount int // for TestCapital
var checked map[reflect.Type]bool

type LabEncoder struct {
	gob *gob.Encoder
}

func NewEncoder(w io.Writer) *LabEncoder {
	enc := &LabEncoder{}
	enc.gob = gob.NewEncoder(w)
	return enc
}

func (enc *LabEncoder) Encode(e interface{}) error {
	checkValue(e)
	return enc.gob.Encode(e)
}

func (enc *LabEncoder) EncodeValue(value reflect.Value) error {
	checkValue(value.Interface())
	return enc.gob.EncodeValue(value)
}

type LabDecoder struct {
	gob *gob.Decoder
}

func NewDecoder(r io.Reader) *LabDecoder {
	dec := &LabDecoder{}
	dec.gob = gob.NewDecoder(r)
	return dec
}

func (dec *LabDecoder) Decode(e interface{}) error {
	checkValue(e)
	checkDefault(e)
	return dec.gob.Decode(e)
}

func Register(value interface{}) {
	checkValue(value)
	gob.Register(value)
}

func RegisterName(name string, value interface{}) {
	checkValue(value)
	gob.RegisterName(name, value)
}

func checkValue(value interface{}) {
	checkType(reflect.TypeOf(value))
}

func checkType(t reflect.Type) {
	k := t.Kind()

	mu.Lock()
	// only complain once, and avoid recursion.
	if checked == nil {
		checked = map[reflect.Type]bool{}
	}
	if checked[t] {
		mu.Unlock()
		return
	}
	checked[t] = true
	mu.Unlock()

	switch k {
	case reflect.Struct:
		for i := 0; i < t.NumField(); i++ {
			f := t.Field(i)
			rune, _ := utf8.DecodeRuneInString(f.Name)
			if unicode.IsUpper(rune) == false {
				// ta da
				fmt.Printf("labgob error: lower-case field %v of %v in RPC or persist/snapshot will break your Raft\n",
					f.Name, t.Name())
				mu.Lock()
				errorCount += 1
				mu.Unlock()
			}
			checkType(f.Type)
		}
		return
	case reflect.Slice, reflect.Array, reflect.Ptr:
		checkType(t.Elem())
		return
	case reflect.Map:
		checkType(t.Elem())
		checkType(t.Key())
		return
	default:
		return
	}
}

//
// warn if the value contains non-default values,
// as it would if one sent an RPC but the reply
// struct was already modified. if the RPC reply
// contains default values, GOB won't overwrite
// the non-default value.
//
func checkDefault(value interface{}) {
	if value == nil {
		return
	}
	checkDefault1(reflect.ValueOf(value), 1, "")
}

func checkDefault1(value reflect.Value, depth int, name string) {
	if depth > 3 {
		return
	}

	t := value.Type()
	k := t.Kind()

	switch k {
	case reflect.Struct:
		for i := 0; i < t.NumField(); i++ {
			vv := value.Field(i)
			name1 := t.Field(i).Name
			if name != "" {
				name1 = name + "." + name1
			}
			checkDefault1(vv, depth+1, name1)
		}
		return
	case reflect.Ptr:
		if value.IsNil() {
			return
		}
		checkDefault1(value.Elem(), depth+1, name)
		return
	case reflect.Bool,
		reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
		reflect.Uintptr, reflect.Float32, reflect.Float64,
		reflect.String:
		if reflect.DeepEqual(reflect.Zero(t).Interface(), value.Interface()) == false {
			mu.Lock()
			if errorCount < 1 {
				what := name
				if what == "" {
					what = t.Name()
				}
				// this warning typically arises if code re-uses the same RPC reply
				// variable for multiple RPC calls, or if code restores persisted
				// state into variable that already have non-default values.
				fmt.Printf("labgob warning: Decoding into a non-default variable/field %v may not work\n",
					what)
			}
			errorCount += 1
			mu.Unlock()
		}
		return
	}
}


text:
#ifndef __CONTIKI_CONF_H__
#define __CONTIKI_CONF_H__

#include <inttypes.h>
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/select.h>
#endif

struct select_callback {
  int  (* set_fd)(fd_set *fdr, fd_set *fdw);
  void (* handle_fd)(fd_set *fdr, fd_set *fdw);
};
int select_set_callback(int fd, const struct select_callback *callback);

#define CC_CONF_REGISTER_ARGS          1
#define CC_CONF_FUNCTION_POINTER_ARGS  1
#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS                1
/*#define CC_CONF_INLINE                 inline*/

#define CCIF
#define CLIF

/* These names are deprecated, use C99 names. */
typedef uint8_t   u8_t;
typedef uint16_t u16_t;
typedef uint32_t u32_t;
typedef  int32_t s32_t;

typedef unsigned short uip_stats_t;

#define UIP_CONF_UDP             1
#define UIP_CONF_MAX_CONNECTIONS 40
#define UIP_CONF_MAX_LISTENPORTS 40
#define UIP_CONF_BUFFER_SIZE     420
#define UIP_CONF_BYTE_ORDER      UIP_LITTLE_ENDIAN
#define UIP_CONF_TCP       1
#define UIP_CONF_TCP_SPLIT       0
#define UIP_CONF_LOGGING         0
#define UIP_CONF_UDP_CHECKSUMS   1

#ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
#endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */

#if UIP_CONF_IPV6

#define RIMEADDR_CONF_SIZE              8

#ifndef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC     nullmac_driver
#endif /* NETSTACK_CONF_MAC */

#ifndef NETSTACK_CONF_RDC
#define NETSTACK_CONF_RDC     nullrdc_driver
#endif /* NETSTACK_CONF_RDC */

#ifndef NETSTACK_CONF_RADIO
#define NETSTACK_CONF_RADIO   nullradio_driver
#endif /* NETSTACK_CONF_RADIO */

#ifndef NETSTACK_CONF_FRAMER
#define NETSTACK_CONF_FRAMER  framer_802154
#endif /* NETSTACK_CONF_FRAMER */

#define NETSTACK_CONF_NETWORK sicslowpan_driver

#define UIP_CONF_ROUTER                 1
#ifndef UIP_CONF_IPV6_RPL
#define UIP_CONF_IPV6_RPL               1
#endif /* UIP_CONF_IPV6_RPL */

#define SICSLOWPAN_CONF_COMPRESSION_IPV6        0
#define SICSLOWPAN_CONF_COMPRESSION_HC1         1
#define SICSLOWPAN_CONF_COMPRESSION_HC01        2
#define SICSLOWPAN_CONF_COMPRESSION             SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG                    1
#define SICSLOWPAN_CONF_MAXAGE                  8
#endif /* SICSLOWPAN_CONF_FRAG */
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC	1
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS       2
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS   5
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */

#define UIP_CONF_IPV6_CHECKS     1
#define UIP_CONF_IPV6_QUEUE_PKT  1
#define UIP_CONF_IPV6_REASSEMBLY 0
#define UIP_CONF_NETIF_MAX_ADDRESSES  3
#define UIP_CONF_ND6_MAX_PREFIXES     3
#define UIP_CONF_ND6_MAX_NEIGHBORS    4
#define UIP_CONF_ND6_MAX_DEFROUTERS   2
#define UIP_CONF_ICMP6           1

/* configure number of neighbors and routes */
#ifndef UIP_CONF_DS6_NBR_NBU
#define UIP_CONF_DS6_NBR_NBU     30
#endif /* UIP_CONF_DS6_NBR_NBU */
#ifndef UIP_CONF_DS6_ROUTE_NBU
#define UIP_CONF_DS6_ROUTE_NBU   30
#endif /* UIP_CONF_DS6_ROUTE_NBU */

#define UIP_CONF_ND6_SEND_RA		0
#define UIP_CONF_ND6_REACHABLE_TIME     600000
#define UIP_CONF_ND6_RETRANS_TIMER      10000

#define UIP_CONF_IP_FORWARD             0
#ifndef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE		240
#endif

#define UIP_CONF_LLH_LEN                0
#define UIP_CONF_LL_802154              1

#define UIP_CONF_ICMP_DEST_UNREACH 1

#define UIP_CONF_DHCP_LIGHT
#define UIP_CONF_RECEIVE_WINDOW  48
#define UIP_CONF_TCP_MSS         48
#define UIP_CONF_UDP_CONNS       12
#define UIP_CONF_FWCACHE_SIZE    30
#define UIP_CONF_BROADCAST       1
#define UIP_ARCH_IPCHKSUM        1
#define UIP_CONF_UDP             1
#define UIP_CONF_UDP_CHECKSUMS   1
#define UIP_CONF_PINGADDRCONF    0
#define UIP_CONF_LOGGING         0

#endif /* UIP_CONF_IPV6 */

typedef unsigned long clock_time_t;

#define CLOCK_CONF_SECOND 1000

#define LOG_CONF_ENABLED 1

/* Not part of C99 but actually present */
int strcasecmp(const char*, const char*);

/* include the project config */
/* PROJECT_CONF_H might be defined in the project Makefile */
#ifdef PROJECT_CONF_H
#include PROJECT_CONF_H
#endif /* PROJECT_CONF_H */

#endif /* __CONTIKI_CONF_H__ */


text:
import React from 'react';
import { Room } from "matrix-js-sdk/src/models/room";

import { _t, _td } from '../../../languageHandler';
import SettingsStore from "../../../settings/SettingsStore";
import dis from "../../../dispatcher/dispatcher";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { Action } from "../../../dispatcher/actions";
import { SettingLevel } from "../../../settings/SettingLevel";
import SettingsFlag from "../elements/SettingsFlag";
import SettingsFieldset from '../settings/SettingsFieldset';
import AccessibleButton from '../elements/AccessibleButton';

interface IProps {
    room: Room;
}

export default class UrlPreviewSettings extends React.Component<IProps> {
    private onClickUserSettings = (e: React.MouseEvent): void => {
        e.preventDefault();
        e.stopPropagation();
        dis.fire(Action.ViewUserSettings);
    };

    public render(): JSX.Element {
        const roomId = this.props.room.roomId;
        const isEncrypted = MatrixClientPeg.get().isRoomEncrypted(roomId);

        let previewsForAccount = null;
        let previewsForRoom = null;

        if (!isEncrypted) {
            // Only show account setting state and room state setting state in non-e2ee rooms where they apply
            const accountEnabled = SettingsStore.getValueAt(SettingLevel.ACCOUNT, "urlPreviewsEnabled");
            if (accountEnabled) {
                previewsForAccount = (
                    _t("You have enabled URL previews by default.", {}, {
                        'a': (sub) => <AccessibleButton
                            kind='link_inline'
                            onClick={this.onClickUserSettings}>
                            { sub }
                        </AccessibleButton>,
                    })
                );
            } else {
                previewsForAccount = (
                    _t("You have disabled URL previews by default.", {}, {
                        'a': (sub) => <AccessibleButton
                            kind='link_inline'
                            onClick={this.onClickUserSettings}>
                            { sub }
                        </AccessibleButton>,
                    })
                );
            }

            if (SettingsStore.canSetValue("urlPreviewsEnabled", roomId, SettingLevel.ROOM)) {
                previewsForRoom = (

                        <SettingsFlag
                            name="urlPreviewsEnabled"
                            level={SettingLevel.ROOM}
                            roomId={roomId}
                            isExplicit={true}
                        />

                );
            } else {
                let str = _td("URL previews are enabled by default for participants in this room.");
                if (!SettingsStore.getValueAt(SettingLevel.ROOM, "urlPreviewsEnabled", roomId, /*explicit=*/true)) {
                    str = _td("URL previews are disabled by default for participants in this room.");
                }
                previewsForRoom = ({ _t(str) });
            }
        } else {
            previewsForAccount = (
                _t("In encrypted rooms, like this one, URL previews are disabled by default to ensure that your " +
                    "homeserver (where the previews are generated) cannot gather information about links you see in " +
                    "this room.")
            );
        }

        const previewsForRoomAccount = ( // in an e2ee room we use a special key to enforce per-room opt-in
            <SettingsFlag name={isEncrypted ? 'urlPreviewsEnabled_e2ee' : 'urlPreviewsEnabled'}
                level={SettingLevel.ROOM_ACCOUNT}
                roomId={roomId} />
        );

        const description = <>

                { _t('When someone puts a URL in their message, a URL preview can be shown to give more ' +
                        'information about that link such as the title, description, and an image from the website.') }

{ previewsForAccount }

        </>;

        return (
            <SettingsFieldset legend={_t("URL Previews")} description={description}>
                { previewsForRoom }
                { previewsForRoomAccount }
            </SettingsFieldset>
        );
    }
}


text:
require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')

describe "comments/feed" do
  before :all do
    Merb::Router.prepare { |r| slice(:BlogSlice, :name_prefix => nil, :path_prefix => nil, :default_routes => false) } if standalone?
  end

  after :all do
    Merb::Router.reset! if standalone?
  end

  before(:each) do
    @controller = BlogSlice::Comments.new(fake_request)

    post = Post.new(:title => "My First Blog Post", :slug => 'my-first-blog-post', :content => "Bla bla", :created_at => Time.now)

    first_comment = Comment.new(:id => 1, :author => "Maxime", :email => "your@email.com", :content => "Fantastic", :created_at => Time.now)

    second_comment = Comment.new(:id => 2, :author => "Another Guy", :email => "your@email.com", :content => "Cool", :created_at => Time.now)

    @controller.instance_variable_set(:@post, post)
    @controller.instance_variable_set(:@comments, [first_comment, second_comment])

    @body = @controller.render(:feed, :format => :rss, :layout => false)
  end

  it "should have a rss tag" do
    @body.should have_tag(:rss)
  end

  it "should have a channel tag in the rss tag" do
    @body.should have_tag(:channel)
  end

  it "should have the required channel elements" do
    @body.should have_tag(:title)
    @body.should have_tag(:link)
    @body.should have_tag(:description)
  end

  it "should have an item with a title and a description" do
    @body.should have_tag(:item)
    @body.should have_tag(:title)
    @body.should have_tag(:description)
  end
end


text:
layout: page
title:  Exemption Error - Bad data in exemption - Category value must be in the range 0 to 13
product: communications
doctype: comms_rest_v2_dev_guide
chapter: reference
nav: apis
disqus: 0
---

Previous

Error Description

The Category field (cat) is set to an invalid enumerator in Exemption (exms).

Example

{% highlight json %}
{
  "err": [
    {
      "code": -2000,
      "msg": "Exemption Error - {\"frc\":true,\"loc\":{\"ctry\":\"USA\",\"st\":\"NC\",\"zip\":\"27701\"},\"tpe\":1,\"lvl\":200,\"cat\":200,\"dom\":0,\"scp\":0,\"exnb\":true} - Bad data in exemption: Category value must be in the range 0 to 13."
    }
  ]
}
{% endhighlight %}

How to Resolve

Ensure that Category (cat) in Exemption (exms) is set to a valid selection:

0: No Category Description

1: Sales and Use Taxes

2: Business Taxes

3: Gross Receipts Taxes

4: Excise Taxes

5: Connectivity Charges

6: Regulatory Charges

7: E-911 Charges

8: Utility User Taxes

9: Right of Way Fees

10: Communications Services Tax

11: Cable Regulatory Fees

12: Reserved

13: Value Added Taxes

For more information, see Exemption.

Previous


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/activity_bg_color">

    <TextView
        android:id="@+id/tv_no_draft"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:visibility="gone"
        android:text="@string/no_draft"/>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/mRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:padding="5dp" />

</RelativeLayout>


text:
Progress as a percentage of closed story points/total story points
<!--
customfield_10336 = sum of open children story points
customfield_10344 = sum of all children story points
-->
<!-- @@Formula:
    (
     ((issue.get("customfield_10334") != null && issue.get("customfield_10336") != null)? ((issue.get("customfield_10334") - issue.get("customfield_10336"))/issue.get("customfield_10334")*100) : 0)
     ).intValue()
 -->
<!-- @@Format: numberTool.format(value) -->


text:
angular.module('domegis')

.directive('viewItem', [
  'Server',
  function(Server) {
    return {
      restrict: 'A',
      scope: {
        'view': '=viewItem'
      },
      templateUrl: '/views/view/item.html',
      link: function(scope, element, attrs) {

        var viewService = Server.service('views');

        scope.$on('server.views.updated', function(ev, data) {
          if(data.id == scope.view.id)
            scope.view = data;
        });
        scope.$on('server.views.patched', function(ev, data) {
          if(data.id == scope.view.id)
            scope.view = data;
        });

        scope.user = Server.app.get('user');

        scope.canEdit = function(view) {
          if(scope.user) {
            return scope.user.roles.indexOf('editor') != -1 || scope.user.id == view.creatorId;
          } else {
            return false;
          }
        };

        scope.remove = function(view) {
          if(confirm('Are you sure?')) {
            Server.remove(viewService, view.id);
          }
        };
      }
    }
  }
]);


text:
<?php

namespace UniMapper\Mongo\Tests\Fixtures;

/**
 * @property integer $id m:primary
 */
class Entity extends \UniMapper\Entity
{

}


text:
package com.cliqueup.controllers;

import org.springframework.context.ApplicationListener;
import org.springframework.web.socket.messaging.SessionDisconnectEvent;

import java.util.HashMap;

/**
 * Created by michaelplott on 11/19/16.
 */
public class SessionDisconnectListener implements ApplicationListener<SessionDisconnectEvent> {
    @Override
    public void onApplicationEvent(SessionDisconnectEvent event) {
        String sessionId = event.getSessionId();
        HashMap m = new HashMap();
        m.put("id", sessionId);
        WebSocketController.messenger.convertAndSend("remove-user", m);
    }
}


text: require 'aggregate_root'


text:
Yii2 GitHub Browser App
============================

Yii2 GitHub Browser App was built on Yii 2 Basic Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
rapidly creating small projects.

REQUIREMENTS
------------

The minimum requirement by this project template that your Web server supports PHP 5.4.0.

VIRTUAL HOST CONFIGURATION
---------------------------

1)	C:\Windows\System32\drivers\etc\hosts
    add lines:

~~~
    127.0.0.1       your-name-site.local
    127.0.0.1       www.your-name-site.local
~~~

2)	For your local server must change httpd-vhosts.conf.
    For example in my case find
    C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
    and add lines:

~~~
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/your-name-site/web/"
    ServerName your-name-site.local
	SetEnv APPLICATION_ENV "development"
	<Directory "c:/wamp/www/your-name-site/web/">
		DirectoryIndex index.php
		AllowOverride All
		Order allow,deny
		Allow from all
    </Directory>
</VirtualHost>
~~~

INSTALLATION
------------

### Step 1 - install APP from an Archive File

Click «Download ZIP» on https://github.com/alenkasun/yii2-github-browser and unzip in local site
…\your-name-site\, so you must receive the next structure in local site root::

~~~
  assets/             contains assets definition
  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  mail/               contains view files for e-mails
  models/             contains model classes
  runtime/            contains files generated during runtime
  tests/              contains various tests for the basic application
  vendor/             contains dependent 3rd-party packages
  views/              contains view files for the Web application
  web/                contains the entry script and Web resources
  ....
~~~

### Step 2 - install dependency libs via Composer

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).

Install folder VENDOR with all dependency libs via Copmoser:
open cmd.exe in site root (shirt + command from context menu) and perform:

      - if composer was installed globally:

~~~
        composer self-update
        composer install
~~~

      - else:

~~~
        php composer.phar self-update
        php composer.phar install
~~~

As a result there is a folder VENDOR at site root.

DATABASE CONFIGURATION
-----------------------

###	Database installation

Create new BD and import github_browser.sql via convinient BD-client
(example: via phpMyAdmin or HeidiSql).

### Database config

Edit the file `config/db.php` with real data, for example:

```php
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=github_browser',
    'username' => 'git',
    'password' => 'git',
    'charset' => 'utf8',
];
```

-----------------------------------------------------

Now you should be able to access the application through the following URL:

~~~
http://your-name-site.local/
~~~


text:
<?php echo ALM_TITLE; ?>: <?php _e('Shortcode Builder', ALM_NAME); ?>

<?php _e('Create your own Ajax Load More shortcode by adjusting the values below', ALM_NAME); ?>

		   <form id="alm-shortcode-builder-form">
			   <?php include_once( ALM_PATH . 'admin/shortcode-builder/shortcode-builder.php');	?>
		   </form>

 <?php _e('Back to Top', ALM_NAME); ?>

   	   	   <select class="toc"></select>

<?php _e('Shortcode Output', ALM_NAME); ?>

<?php _e('Place the following shortcode into the content editor or widget area of your theme.', ALM_NAME); ?>

   					<?php _e('Copy', ALM_NAME); ?>

<a href="javascript:void(0);" title="<?php _e('Clear all Shortcode Builder settings', ALM_NAME); ?>"> Reset Shortcode Builder


text:
package org.jboss.arquillian.container.reloaded.embedded_1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.jboss.arquillian.spi.Profile;

/**
 * ReloadedProfile
 *
 * @author Aslak Knutsen
 * @version $Revision: $
 */
public class ReloadedProfile implements Profile
{
   /* (non-Javadoc)
    * @see org.jboss.arquillian.spi.Profile#getClientProfile()
    */
   @Override
   public Collection<Class<?>> getClientProfile()
   {
      List<Class<?>> listeners = new ArrayList<Class<?>>();
      listeners.add(TestServiceUninstaller.class);
      return listeners;
   }

   /* (non-Javadoc)
    * @see org.jboss.arquillian.spi.Profile#getContainerProfile()
    */
   @Override
   public Collection<Class<?>> getContainerProfile()
   {
      return new ArrayList<Class<?>>();
   }
}


text:
/// <reference path='fourslash.ts' />

////// no a or b
////(a, b) => { }/*1*/

goTo.marker("1");
verify.not.completionListContains("a");
verify.not.completionListContains("b");


text:
/*
 * Author: Kim Min-Ho (ISKU)
 * Date: 2016.09.25
 * email: minho1a@hanmail.net
 *
 * https://github.com/ISKU/Algorithm
 * https://www.acmicpc.net/problem/5523
 */

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer parser = new StringTokenizer(input.readLine());
		int testCase = Integer.parseInt(parser.nextToken());
		int[] wins = new int[2];

		while (testCase-- > 0) {
			parser = new StringTokenizer(input.readLine());
			int A = Integer.parseInt(parser.nextToken());
			int B = Integer.parseInt(parser.nextToken());

			if (A > B)
				wins[0]++;
			else if (A < B)
				wins[1]++;
		}

		System.out.print(wins[0] + " " + wins[1]);
	}
}


text:
#region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kooboo.CMS.Modules.CMIS.Models
{
    public partial class cmisPropertyString
    {
        public override string stringValue
        {
            get
            {
                if (this.value != null && this.value.Length > 0)
                {
                    return string.Join(",", this.value.Where(it => it != null).Select(it => it.ToString()));
                }
                return null;
            }
        }
    }
}


text:
//Generated by the Argon Build System

//
//  Text.h
//  ArgonTest
//
//  Created by Skyler Saleh on 8/7/13.
//  Copyright (c) 2013 Skyler Saleh. All rights reserved.
//

#ifndef __ArgonTest__Text__
#define __ArgonTest__Text__
#include <ArgonEngine/Utility.h>
#include "ArgonEngine/VirtualResourceImage.h"
#include "ArgonEngine/Node.h"
#include <iostream>

namespace Argon{
    enum LineStyle{
        kLineLeft,
        kLineCenter,
        kLineRight,
    };

    const int kGlyphTextureSize = 1024;

    const int kGlyphWidth = 64;
    const int kGlyphHeight =64;
    const int kGlyphRenderRes = 220;
    const float kGlyphRFactor = kGlyphRenderRes/float(kGlyphHeight);

    const int kGlyphCacheSize = (kGlyphTextureSize/kGlyphWidth)*(kGlyphTextureSize/kGlyphHeight)*4;

    const int kGlyphCacheBorder = 16;

    struct Layout{
        float line_height;
        float line_width;
        float height;
        LineStyle style;
    };
    struct GlyphStyle{
        float skew=0.;
        float weight=1.;
        float scale=1.;
        float subpixel=1.;
        float outline_width=0.;
        float v_align=0.;
        Vector4f fill_color=kWhiteColor;
        Vector4f outline_color=kClearColor;
    };

    struct Glyph{
        int glyph;
        float tex_x;
        float tex_y;

        float width_ratio;
        float height_ratio;

        float xmin;
        float xmax;
        float ymin;
        float ymax;

        Argon::Vector4f map_color;
        Argon::VirtualResource font;
    };

    struct GlyphCache{
        Argon::VirtualResource texture;
        Argon::VirtualResourceImage *image;
        static GlyphCache & get_cache(){
            static GlyphCache cache;
            return cache;
        }
        struct GlyphKey{
            Argon::VirtualResource resource;
            int glyph;
            bool operator !=(const GlyphKey& k)const{return resource!=k.resource||glyph!=k.glyph;}
            bool operator >(const GlyphKey& k)const{return resource!=k.resource?resource>k.resource:glyph>k.glyph;}
            bool operator <(const GlyphKey& k)const{return resource!=k.resource?resource<k.resource:glyph<k.glyph;}
            bool operator >=(const GlyphKey& k)const{return resource!=k.resource?resource>k.resource:glyph>=k.glyph;}
            bool operator <=(const GlyphKey& k)const{return resource!=k.resource?resource<k.resource:glyph<=k.glyph;}
            bool operator ==(const GlyphKey& k)const{return resource==k.resource&&glyph==k.glyph;}
        };
        Argon::PriorityCache<Glyph, GlyphKey, kGlyphCacheSize> glyphs;

        GlyphCache();
        inline void set_val(const int x,int y, unsigned char* array);
        unsigned char interpolate(float x, float y, unsigned char *bu);
        void build_distance_field(uint8_t * bu,int pos);
        Glyph* get_glyph(Argon::VirtualResource font, int glyph);
    };
    struct Font:public Argon::VirtualResourceIMPL::Data{
        Font(){}
        virtual void get_font_size_ratio(float &w_r, float & h_r)=0;
        virtual void get_glyph_size_ratio(int glyph, float &w_r, float & h_r)=0;

        virtual void get_glyph_size(int glyph, Glyph &g)=0;

        virtual float get_advance(int last_glyph,int glyph)=0;
        virtual void get_glyph_bitmap(int glyph, uint8_t* d, int w, int h,int border=0)=0;

        virtual bool reload(Argon::VirtualResourceIMPL::Source* s)=0;

        virtual Data* clone_type(const std::string& arguments)const=0;
        virtual bool loaded()=0;
        virtual bool save(Argon::VirtualResourceIMPL::Source* s){return false;}
        virtual size_t update_id(){return 0;}

    };

    struct Label: public Renderable{
        Argon::Vector2f glpyh_scale;
        Label();
        void render_str(const char* string,Argon::VirtualResource font,LineStyle s = kLineLeft);
        MAKE_VISIT_HEAD(Label)
    };

};

#endif /* defined(__ArgonTest__Text__) */


text:
MMTabBarView -- Sierra Style Fork
=================================

This is a fork of the MMTabBarView to add a macOS Sierra style tabs. This enables look-alike tabs in use-cases where the built in macOS won't function.

There are many Apple apps that include tabs that are similarly styled in Sierra, but each have subtle variations. After careful analysis it seems that the tabs in Safari are the most feature complete and stylistically consistent. So all gradient curves and behaviors are matched as closely as possible to that.

I have intentionally chosen to support the overflow menu instead of the overflowing bunched-tabs of macOS Sierra as it seems a bit more friendly.

Original ReadMe

A Mac OS X tab bar view that works on 10.9+ with Xcode 8.0 or higher.

MMTabBarView is a modernized and view based re-write of PSMTabBarControl,

which can be found here: https://github.com/dorianj/PSMTabBarControl

Though MMTabBarView's API is quite similar, it is no drop-in replacement for PSMTabBarControl.
The MMTabBarViewDelegate protocol is somewhat different.
But MMTabBarView will help you: The methods of the delegate protocol of PSMTabBarControl have been
included and set to deprecated. That means your compiler shows deprecation warnings (if switched on) for
all your old delegate method implementations. Transition will be a matter of minutes.

If you want to support this project, there are various ways in which you could do this:

Send me a pull request.

Review it on your site or blog.

Make a donation via PayPal following the link below (credit cards etc. accepted too).

Donating via PayPal is as easy as clicking the donate button on this page:
http://mimo42.github.com/MMTabBarView/

If you make any improvements, please submit them as pull requests.

## Building

To, build, simply open default.xcworkspace, choose MMTabBarView Demo scheme and run.
The workspace contains two projects, the MMTabBarView framework and the Demo application.

## Installing
Add the .framework bundle to your Xcode project, and add it to the Linked Frameworks and Libraries (under Target -> Summary). Next, under Target -> Build Phases, Add a new build phase that copies it to the Frameworks directory of your app. (Add Build Phase > Copy Files. Destination: Frameworks).

Do not forget to set LD_RUNPATH_SEARCH_PATHS to @loader_path/../Frameworks in your Xcode project.

## Copying
Some components and lines originally were created by Positive Spin Media. The original is BSD licensed.

See: http://www.positivespinmedia.com/dev/PSMTabBarControl.html License

The re-write is also BSD licensed.

Since 2005 there have been lots of commits by various contributors.

Thanks to the guys recently improved PSMTabBarControl and inspired me to finally do the re-write!

## License
Copyright © 2005, Positive Spin Media. All rights reserved.

Copyright © 2014, Michael Monscheuer. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
"""
error messages
"""
political_cat = 'Politically Incorrect Cat'

ERROR_GENERAL = '{cat}: Its not my fault. You must have done something.'.format(cat=political_cat)
ERROR_INVALID_DATA_SUPPLIED = '{cat}: You sent invalid or incomplete data. you are an idiot!'.format(cat=political_cat)
ERROR_INVALID_JSON = '{cat}: You seem too stupid to send valid JSON.'.format(cat=political_cat)
ERROR_INVALID_REQUEST = '{cat}: Losers keep trying to hack into my computer.'.format(cat=political_cat)


text:
Trinkwasser Visualisierung: Härtegrad, Bestandteile und Kosten
=======================

* Im Verzeichnis converter/ befinden sich die Rohdaten + kleine Skripte, die diese Rohdaten für die Webansicht aufbereiten
* Im Verzeichnis src/ befinden sich die HTML, CSS und JavaScript Dateien + die aufbereiteten Daten für die Visualisierung. Nach Änderungen einfach grunt gh-pages ausführen, um die Online-Version zu aktualisieren.

Online-Version: http://opendatalab.de/projects/trinkwasser/

Datenquellen:
==================

* Stadtwerke Heilbronn: https://www.stadtwerke-heilbronn.de/index/hsw/Wasserh%C3%A4rte.html
* Stadtwerke Neckarsulm: http://www.sw-neckarsulm.de/main/produkte/trinkwasser/wasseranalyse.html
* Webseiten der Gemeinden im Landkreis Heilbronn


text:
package org.javagems.core.hibernate;

import com.googlecode.genericdao.search.ISearch;

import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;

public class SingleTransactionDAOAdapter<T, ID extends Serializable> extends DAO<T, ID> {

    private static final int BULK_SIZE = 2048;

    public SingleTransactionDAOAdapter(SessionFactory sessionFactory) {
        super(sessionFactory);
    }

    protected void closeQuietly(Transaction transaction) {
        if (transaction != null && transaction.isActive()) {
            transaction.rollback();
        }
    }

    @Override
    public T find(Serializable id) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            T result = super.find(id);
            transaction.commit();
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public List<T> findAll() {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            List<T> result = super.findAll();
            transaction.commit();
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public boolean save(T user) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            boolean result = super.save(user);
            transaction.commit();
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public boolean[] save(T... entities) {
        Transaction transaction = null;
        try {
            boolean[] result = new boolean[entities.length];
            if (entities.length > 0) {
                transaction = this.getSession().beginTransaction();
                int bulkSize = BULK_SIZE;
                int beginIndex = 0;
                int endIndex = Math.min(bulkSize, entities.length);
                while(beginIndex < endIndex) {
                    T[] slice = Arrays.copyOfRange(entities, beginIndex, endIndex);
                    System.arraycopy(super.save(slice), 0, result, beginIndex, slice.length);
                    super.flush();
                    beginIndex = endIndex;
                    endIndex = Math.min(endIndex + bulkSize, entities.length);
                }
                transaction.commit();
            }
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public <RT> RT searchUnique(ISearch search) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            RT result = super.searchUnique(search);
            transaction.commit();
            return result;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public <RT> List<RT> search(ISearch search) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            List<RT> result = super.search(search);
            transaction.commit();
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    public void remove(ISearch search) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            List<T> result = super.<T>search(search);
            if (result.size() > 0) {
                @SuppressWarnings("unchecked")
                T[] array = (T[])Array.newInstance(result.get(0).getClass(), 0);
                super.remove(result.toArray(array));
            }
            transaction.commit();
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public boolean removeById(Serializable id) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            boolean result = super.removeById(id);
            transaction.commit();
            return result;
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public void removeByIds(Serializable... ids) {
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            super.removeByIds(ids);
            super.flush(); // needed for bulks
            transaction.commit();
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }
    }

    @Override
    public boolean remove(T entity) {
        boolean result = false;
        Transaction transaction = null;
        try {
            transaction = this.getSession().beginTransaction();
            result = super.remove(entity);
            super.flush(); // needed for bulks
            transaction.commit();
        } catch (RuntimeException ex) {
            this.closeQuietly(transaction);
            throw ex;
        } finally {
            this.closeSessionQuietly();
        }

        return result;
    }
}


text:
package org.elasticsearch.index.query;

import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.ConstantScoreQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermRangeQuery;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.mapper.FieldMapper;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper;

import java.io.IOException;
import java.util.List;

/**
 *
 */
public class ExistsQueryParser implements QueryParser {

    public static final String NAME = "exists";

    @Inject
    public ExistsQueryParser() {
    }

    @Override
    public String[] names() {
        return new String[]{NAME};
    }

    @Override
    public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
        XContentParser parser = parseContext.parser();

        String fieldPattern = null;
        String queryName = null;

        XContentParser.Token token;
        String currentFieldName = null;
        while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
            if (token == XContentParser.Token.FIELD_NAME) {
                currentFieldName = parser.currentName();
            } else if (token.isValue()) {
                if ("field".equals(currentFieldName)) {
                    fieldPattern = parser.text();
                } else if ("_name".equals(currentFieldName)) {
                    queryName = parser.text();
                } else {
                    throw new QueryParsingException(parseContext, "[exists] query does not support [" + currentFieldName + "]");
                }
            }
        }

        if (fieldPattern == null) {
            throw new QueryParsingException(parseContext, "exists must be provided with a [field]");
        }

        return newFilter(parseContext, fieldPattern, queryName);
    }

    public static Query newFilter(QueryParseContext parseContext, String fieldPattern, String queryName) {
        final FieldNamesFieldMapper fieldNamesMapper = (FieldNamesFieldMapper)parseContext.mapperService().fullName(FieldNamesFieldMapper.NAME);

        MapperService.SmartNameObjectMapper smartNameObjectMapper = parseContext.smartObjectMapper(fieldPattern);
        if (smartNameObjectMapper != null && smartNameObjectMapper.hasMapper()) {
            // automatic make the object mapper pattern
            fieldPattern = fieldPattern + ".*";
        }

        List<String> fields = parseContext.simpleMatchToIndexNames(fieldPattern);
        if (fields.isEmpty()) {
            // no fields exists, so we should not match anything
            return Queries.newMatchNoDocsQuery();
        }

        BooleanQuery boolFilter = new BooleanQuery();
        for (String field : fields) {
            FieldMapper mapper = parseContext.fieldMapper(field);
            Query filter = null;
            if (fieldNamesMapper!= null && fieldNamesMapper.enabled()) {
                final String f;
                if (mapper != null) {
                    f = mapper.names().indexName();
                } else {
                    f = field;
                }
                filter = fieldNamesMapper.termQuery(f, parseContext);
            }
            // if _field_names are not indexed, we need to go the slow way
            if (filter == null && mapper != null) {
                filter = mapper.rangeQuery(null, null, true, true, parseContext);
            }
            if (filter == null) {
                filter = new TermRangeQuery(field, null, null, true, true);
            }
            boolFilter.add(filter, BooleanClause.Occur.SHOULD);
        }

        if (queryName != null) {
            parseContext.addNamedQuery(queryName, boolFilter);
        }
        return new ConstantScoreQuery(boolFilter);
    }

}


text:
package clickhouse

import (
	"database/sql/driver"
	"fmt"
	"io"
	"reflect"
	"sync"
	"time"

	"github.com/kshvakov/clickhouse/lib/column"
	"github.com/kshvakov/clickhouse/lib/data"
	"github.com/kshvakov/clickhouse/lib/protocol"
)

type rows struct {
	ch           *clickhouse
	err          error
	mutex        sync.RWMutex
	finish       func()
	offset       int
	block        *data.Block
	totals       *data.Block
	extremes     *data.Block
	stream       chan *data.Block
	columns      []string
	blockColumns []column.Column
}

func (rows *rows) Columns() []string {
	return rows.columns
}

func (rows *rows) ColumnTypeScanType(idx int) reflect.Type {
	return rows.blockColumns[idx].ScanType()
}

func (rows *rows) ColumnTypeDatabaseTypeName(idx int) string {
	return rows.blockColumns[idx].CHType()
}

func (rows *rows) Next(dest []driver.Value) error {
	if rows.block == nil || int(rows.block.NumRows) <= rows.offset {
		switch block, ok := <-rows.stream; true {
		case !ok:
			if err := rows.error(); err != nil {
				return err
			}
			return io.EOF
		default:
			rows.block = block
			rows.offset = 0
		}
	}
	for i := range dest {
		dest[i] = rows.block.Values[i][rows.offset]
	}
	rows.offset++
	return nil
}

func (rows *rows) HasNextResultSet() bool {
	return rows.totals != nil || rows.extremes != nil
}

func (rows *rows) NextResultSet() error {
	switch {
	case rows.totals != nil:
		rows.block = rows.totals
		rows.offset = 0
		rows.totals = nil
	case rows.extremes != nil:
		rows.block = rows.extremes
		rows.offset = 0
		rows.extremes = nil
	default:
		return io.EOF
	}
	return nil
}

func (rows *rows) receiveData() error {
	defer close(rows.stream)
	var (
		err         error
		packet      uint64
		progress    *progress
		profileInfo *profileInfo
	)
	for {
		if packet, err = rows.ch.decoder.Uvarint(); err != nil {
			return rows.setError(err)
		}
		switch packet {
		case protocol.ServerException:
			rows.ch.logf("[rows] <- exception")
			return rows.setError(rows.ch.exception())
		case protocol.ServerProgress:
			if progress, err = rows.ch.progress(); err != nil {
				return rows.setError(err)
			}
			rows.ch.logf("[rows] <- progress: rows=%d, bytes=%d, total rows=%d",
				progress.rows,
				progress.bytes,
				progress.totalRows,
			)
		case protocol.ServerProfileInfo:
			if profileInfo, err = rows.ch.profileInfo(); err != nil {
				return rows.setError(err)
			}
			rows.ch.logf("[rows] <- profiling: rows=%d, bytes=%d, blocks=%d", profileInfo.rows, profileInfo.bytes, profileInfo.blocks)
		case protocol.ServerData, protocol.ServerTotals, protocol.ServerExtremes:
			var (
				block *data.Block
				begin = time.Now()
			)
			if block, err = rows.ch.readBlock(); err != nil {
				return rows.setError(err)
			}
			rows.ch.logf("[rows] <- data: packet=%d, columns=%d, rows=%d, elapsed=%s", packet, block.NumColumns, block.NumRows, time.Since(begin))
			if block.NumRows == 0 {
				continue
			}
			switch packet {
			case protocol.ServerData:
				rows.stream <- block
			case protocol.ServerTotals:
				rows.totals = block
			case protocol.ServerExtremes:
				rows.extremes = block
			}
		case protocol.ServerEndOfStream:
			rows.ch.logf("[rows] <- end of stream")
			return nil
		default:
			rows.ch.conn.Close()
			rows.ch.logf("[rows] unexpected packet [%d]", packet)
			return rows.setError(fmt.Errorf("[rows] unexpected packet [%d] from server", packet))
		}
	}
}

func (rows *rows) Close() error {
	rows.ch.logf("[rows] close")
	rows.columns = nil
	for range rows.stream {
	}
	if rows.finish != nil {
		rows.finish()
	}
	return nil
}

func (rows *rows) error() error {
	rows.mutex.RLock()
	defer rows.mutex.RUnlock()
	return rows.err
}

func (rows *rows) setError(err error) error {
	rows.mutex.Lock()
	rows.err = err
	rows.mutex.Unlock()
	return err
}