text:
TEST_CASE("parser::alternation_parser class", "[parser]") {
	using namespace thewizardplusplus::wizard_parser;
	using namespace thewizardplusplus::wizard_parser::parser::operators;

	SECTION("without tokens") {
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse({});
		CHECK(!ast.has_value());
		CHECK(rest_tokens.empty());

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::Verify(Method(right_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("without matches and with both rests offsets of a same length") {
		auto left_tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{{}, left_tokens});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_tokens = lexer::token_group{
			{"five", "six", 1},
			{"seven", "eight", 4}
		};
		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{{}, right_tokens});
		fakeit::Fake(Dtor(right_mock_parser));

		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8},
			{"seven", "eight", 11}
		};
		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		CHECK(!ast.has_value());
		CHECK(rest_tokens == lexer::token_span{left_tokens});

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::Verify(Method(right_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("without matches and with a left rest offset less than right one") {
		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(1)});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(2)});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		CHECK(!ast.has_value());
		CHECK(rest_tokens == lexer::token_span{tokens}.subspan(2));

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::Verify(Method(right_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("without matches and with a right rest offset less than left one") {
		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(2)});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(1)});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		CHECK(!ast.has_value());
		CHECK(rest_tokens == lexer::token_span{tokens}.subspan(2));

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::Verify(Method(right_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("with a left match") {
		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{
				parser::ast_node{"one", "two", {}, 1},
				lexer::token_span{tokens}.subspan(1)
			});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(2)});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		REQUIRE(ast.has_value());
		CHECK(*ast == parser::ast_node{"one", "two", {}, 1});
		CHECK(rest_tokens == lexer::token_span{tokens}.subspan(1));

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("with a right match") {
		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(1)});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{
				parser::ast_node{"three", "four", {}, 4},
				lexer::token_span{tokens}.subspan(2)
			});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		REQUIRE(ast.has_value());
		CHECK(*ast == parser::ast_node{"three", "four", {}, 4});
		CHECK(rest_tokens == lexer::token_span{tokens}.subspan(2));

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::Verify(Method(right_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}

	SECTION("with left and right matches") {
		auto tokens = lexer::token_group{
			{"one", "two", 1},
			{"three", "four", 4},
			{"five", "six", 8}
		};
		auto left_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(left_mock_parser, parse))
			.Return(parser::parsing_result{
				parser::ast_node{"one", "two", {}, 1},
				lexer::token_span{tokens}.subspan(1)
			});
		fakeit::Fake(Dtor(left_mock_parser));

		auto right_mock_parser = fakeit::Mock<parser::rule_parser>{};
		fakeit::When(Method(right_mock_parser, parse))
			.Return(parser::parsing_result{
				parser::ast_node{"three", "four", {}, 4},
				lexer::token_span{tokens}.subspan(2)
			});
		fakeit::Fake(Dtor(right_mock_parser));

		const auto alternation_parser =
			parser::rule_parser::pointer{&left_mock_parser.get()}
			| parser::rule_parser::pointer{&right_mock_parser.get()};
		const auto [ast, rest_tokens] = alternation_parser->parse(tokens);
		REQUIRE(ast.has_value());
		CHECK(*ast == parser::ast_node{"one", "two", {}, 1});
		CHECK(rest_tokens == lexer::token_span{tokens}.subspan(1));

		fakeit::Verify(Method(left_mock_parser, parse)).Once();
		fakeit::VerifyNoOtherInvocations(left_mock_parser);
		fakeit::VerifyNoOtherInvocations(right_mock_parser);
	}
}


text:
import json
import logging
import os
from unittest import TestCase

from config import Config
import gevent
from gevent.socket import create_connection

class HerdClient(object):
    """The object responsible to manage the user functions of herd."""
    def __init__(self, seed=None, config=None):
        self.logger = logging.getLogger('herd.manager.client')
        self.seed = seed
        self.config = config
        self.load_config()
        self.host, self.port = self.seed.split(':')

    def load_config(self):
        """Load the config for connecting to the Herd."""
        # Open the file at default lcoation, unless something else
        # is passed in instead
        self.logger.info('Running load_config() for HerdClient')
        if self.config is not None:
            self.logger.debug("There's a config file passed in")
            f = file(self.config)
            self.cfg = Config(f)

            # Allow parameters passed on the command line to override the
            # config file
            if self.seed is None:
                self.logger.debug("There's no seed passed in")
                self.seed = self.cfg.management.seed

    def request(self, data):
        """Connect to the manager and send, and optionally receive information."""
        self.logger.info("Sending data to HerdManager")
        response = ""
        s = create_connection((self.host, self.port))
        timeout = gevent.spawn_later(10, lambda: s.close())
        f = s.makefile()
        f.write(json.dumps(data)+'\n')
        f.flush()
        try:
            response = f.readline()
        except IOError:
            self.logger.debug("The socket couldn't be read from.")
            response = ""
        if response:
            self.logger.debug("There's a response coming back from HerdManager.")
            response = json.loads(response)
        f.close()
        s.close()
        return response

redpajama_set_name: RedPajamaGithub


text:
package com.aol.cyclops.matcher;

import static java.util.Spliterator.ORDERED;
import static java.util.Spliterators.spliteratorUnknownSize;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.StreamSupport;

import lombok.val;

import com.aol.cyclops.lambda.api.AsDecomposable;
import com.aol.cyclops.lambda.api.Decomposable;
import com.aol.cyclops.lambda.api.ReflectionCache;
import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.lambda.utils.LazyImmutable;
import com.nurkiewicz.lazyseq.LazySeq;

/**
 * Generic extractors for use s pre and post data extractors.
 *
 * @author johnmcclean
 *
 */
public class Extractors {

	private static final Object NOT_SET = new Object();

	private static final Map<Class,Function> decomposers= new HashMap<>();

	/**
	 * Register decomposition function in standard hashmap
	 * Global mutable state - use with care
	 *
	 * @param c Class to decompose
	 * @param f Function to do decomposition
	 */
	public static final <T,R> void registerDecompositionFunction(Class<T> c, Function<T,R> f){
		decomposers.put(c, f);
	}
	/**
	 * An extractor that caches the extraction result
	 *
	 * @param extractor to memoise (cache result of)
	 * @return Memoised extractor
	 */
	public static final <T,R > Extractor<T,R> memoised( Extractor<T,R> extractor){
		final LazyImmutable<R> value = new LazyImmutable<>();
		return input -> {
			return value.computeIfAbsent(()->extractor.apply(input));

		};

	}
	/**
	 * @return Extractor that decomposes Case classes into iterables
	 */
	public static final <T,R> Extractor<T,R> decompose() {
		return input -> {
			if(input instanceof  Decomposable)
				return (R)((Decomposable)input).unapply();
			else if(decomposers.get(input.getClass())!=null)
				return (R)decomposers.get(input.getClass()).apply(input);
			else if(input instanceof Iterable)
				return (R)input;

			return (R)ReflectionCache.getUnapplyMethod(input.getClass()).map(unchecked(m->m.invoke(input))).orElse(AsDecomposable.asDecomposable(input).unapply());

		};
	}
	private static <T,R> Function<T,R> unchecked(Unchecked<T,R> u){

			return t ->{
				try {
				return u.apply(t);
			}catch (Throwable e) {
				ExceptionSoftener.singleton.factory.getInstance().throwSoftenedException(e);
			}
			return null;
		};
	}
	private static interface Unchecked<T,R>{
		public R apply(T t) throws Throwable;
	}
	/**
	 * An extractor that will generte a Tuple2 with two values at the specified index.
	 * Works on Iterable data structures.
	 *
	 * @param v1 position of the first element to extract
	 * @param v2 position of the second element to extract
	 * @return Tuple with 2 specified elements
	 */
	public final static <V1,V2> Extractor<Iterable,Two<V1,V2>> of(int v1,int v2){

		return  ( Iterable it)-> {

			List l  = (List)LazySeq.of(it).zip(LazySeq.numbers(0),(a,b)->Two.tuple(a, b))
								.drop(Math.min(v1,v2))
								.limit(Math.max(v1,v2)+1)
								.filter(t -> ((Two<Object,Integer>)t).v2.equals(v1) || ((Two<Object,Integer>)t).v2.equals(v2))
								.map(t->((Two)t).v1)
								.toList();
			return Two.tuple((V1)l.get(0),(V2)l.get(1));

		};

	}
	/**
	 * Return element or first element in an Iterable.
	 *
	 *
	 * @return value
	 */
	public final static <R> Extractor<?,R> first(){

		Extractor<Object,R> result =  ( item)-> {
			if(item instanceof Iterable)
				return (R)((Iterable)item).iterator().next();
			return (R)item;
		};
		return result;

	}
	/**
	 * Iterate to position and retieve value at position in an iterable data structure.
	 *
	 * @param pos Position to extract
	 * @return value
	 */
	public final static <R> Extractor<Iterable<R>,R> at(int pos){

		return  ( Iterable<R> it)-> {
			return StreamSupport.stream(spliteratorUnknownSize(it.iterator(), ORDERED), false).skip(pos).limit(1).findFirst().get();

		};

	}
	/**
	 *
	 * Look up element at position in a list
	 *
	 * @param pos Position to extract element from
	 * @return Value at position
	 */
	public final static <R> Extractor<List<R>,R> get(int pos){
		return (List<R> c) ->{
			return c.get(pos);
		};

	}
	/**
	 * @param key Look up a value from a map
	 * @return Value for key specified
	 */
	public final static <K,R> Extractor<Map<K,R>,R> get(K key){
		return (Map<K,R> c) ->{
			return c.get(key);
		};

	}

	/**
	 * @return identity extractor, returns same value
	 */
	public final static <R>  Extractor<R,R> same(){
		return (R c) -> c;
	}

}


text:
<!doctype html>

		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link href="../../css/mui.min.css" rel="stylesheet" />

numbox

				  <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
				  <input class="mui-numbox-input" type="number" />
				  <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>

				<button type="button" name="get" class="mui-btn mui-btn-blue mui-btn-outlined">获取当前值</button>
				<button type="button" name="set" class="mui-btn mui-btn-blue mui-btn-outlined">改变当前值</button>
				<button type="button" name="setOption" class="mui-btn mui-btn-blue mui-btn-outlined">改变步长</button>


text:
npm install

NODE_ENV=development ./node_modules/supervisor/lib/cli-wrapper.js -n error -w .,views,routes -e js,jade,yaml -- jingo -c config.yml


text:
'use strict';

Connector.playerSelector = '#playerContents';

Connector.artistSelector = '#songartist div:first-child, #songartist';

Connector.getArtist = () => getScrollableText('#songartist');

Connector.getTrack = () => getScrollableText('#songtitle');

Connector.getAlbum = () => getScrollableText('#songalbum');

Connector.trackArtSelector = '#albumArtImg';

Connector.pauseButtonSelector = '#playerPauseButton';

function getScrollableText(selector) {
	return $(`${selector} div`).first().text() || $(selector).text();
}


text:
package weixin.popular.bean.menu;

import java.util.List;

public class Button{

	private String type;	//click|view
	private String name;
	private String key;
	private String url;

	private List<Button> sub_button;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Button> getSub_button() {
		return sub_button;
	}

	public void setSub_button(List<Button> subButton) {
		sub_button = subButton;
	}

}


text:
import * as t from "../../../types";

export var metadata = {
  optional: true,
  group: "builtin-pre"
};

export var visitor = {
  TemplateLiteral(node, parent) {
    if (t.isTaggedTemplateExpression(parent)) return;

    for (var i = 0; i < node.expressions.length; i++) {
      node.expressions[i] = t.callExpression(t.identifier("String"), [node.expressions[i]]);
    }
  }
};


text:
Boen's Bar
Bar / venue webiste


text: /** Main CSS by Author **/


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using Wox.Helper;
using Wox.Infrastructure;
using Wox.Plugin;
using MessageBox = System.Windows.MessageBox;
using UserControl = System.Windows.Controls.UserControl;

namespace Wox
{
    public partial class ResultPanel : UserControl
    {
        public event Action<Result> OnMouseClickItem;

        protected virtual void OnOnMouseClickItem(Result result)
        {
            Action<Result> handler = OnMouseClickItem;
            if (handler != null) handler(result);
        }

        public bool Dirty { get; set; }

        public void AddResults(List<Result> results)
        {
            if (Dirty)
            {
                Dirty = false;
                lbResults.Items.Clear();
            }
            foreach (var result in results)
            {
                int position = GetInsertLocation(result.Score);
                lbResults.Items.Insert(position, result);
            }
            gridContainer.Margin = lbResults.Items.Count > 0 ? new Thickness { Top = 8 } : new Thickness { Top = 0 };
            SelectFirst();
        }

        private int GetInsertLocation(int currentScore)
        {
            int location = lbResults.Items.Count;
            if (lbResults.Items.Count == 0) return 0;
            if (currentScore > ((Result)lbResults.Items[0]).Score) return 0;

            for (int index = 1; index < lbResults.Items.Count; index++)
            {
                Result next = lbResults.Items[index] as Result;
                Result prev = lbResults.Items[index - 1] as Result;
                if (next != null && prev != null)
                {
                    if ((currentScore >= next.Score && currentScore <= prev.Score))
                    {
                        if (currentScore == next.Score)
                        {
                            location = index + 1;
                        }
                        else
                        {
                            location = index;
                        }
                    }
                }
            }

            return location;
        }

        private FrameworkElement FindByName(string name, FrameworkElement root)
        {
            Stack<FrameworkElement> tree = new Stack<FrameworkElement>();
            tree.Push(root);

            while (tree.Count > 0)
            {
                FrameworkElement current = tree.Pop();
                if (current.Name == name)
                    return current;

                int count = VisualTreeHelper.GetChildrenCount(current);
                for (int i = 0; i < count; ++i)
                {
                    DependencyObject child = VisualTreeHelper.GetChild(current, i);
                    if (child is FrameworkElement)
                        tree.Push((FrameworkElement)child);
                }
            }

            return null;
        }

        public void SelectNext()
        {
            int index = lbResults.SelectedIndex;
            if (index == lbResults.Items.Count - 1)
            {
                index = -1;
            }
            Select(index + 1);
        }

        public void SelectPrev()
        {
            int index = lbResults.SelectedIndex;
            if (index == 0)
            {
                index = lbResults.Items.Count;
            }
            Select(index - 1);
        }

        private void SelectFirst()
        {
            Select(0);
        }

        private void Select(int index)
        {
            if (index >= 0 && index < lbResults.Items.Count)
            {
                lbResults.SelectedItem = lbResults.Items.GetItemAt(index);
            }
        }

        public Result AcceptSelect()
        {
            int index = lbResults.SelectedIndex;
            if (index < 0) return null;

            return lbResults.Items[index] as Result;
        }

        public ResultPanel()
        {
            InitializeComponent();
        }

        public void Clear()
        {
            lbResults.Items.Clear();
            gridContainer.Margin = new Thickness { Top = 0 };
        }

        private void lbResults_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                lbResults.ScrollIntoView(e.AddedItems[0]);
            }
        }

        private void LbResults_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var item = ItemsControl.ContainerFromElement(lbResults, e.OriginalSource as DependencyObject) as ListBoxItem;
            if (item != null)
            {
                OnOnMouseClickItem(item.DataContext as Result);
            }
        }

        public void SelectNextPage()
        {
            int index = lbResults.SelectedIndex;
            index += 5;
            if (index >= lbResults.Items.Count)
            {
                index = lbResults.Items.Count - 1;
            }
            Select(index);
        }

        public void SelectPrevPage()
        {
            int index = lbResults.SelectedIndex;
            index -= 5;
            if (index < 0)
            {
                index = 0;
            }
            Select(index);
        }
    }
}


text:
brackets-minimap
==================

---

This is a fork of [brackets-wdminimap](https://github.com/websiteduck/brackets-wdminimap) that is edited to work better with my current Brackets setup

---

A minimap extension for the [Brackets IDE](http://www.brackets.io).

![minimap](https://raw.github.com/zorgzerg/brackets-minimap/master/brackets-minimap.png)

## Features
* Syntax highlighting.
* Autohide functionality.
* Adjustable fading transparency.
* Quick-preview function.
* Slower, Smoother scrolling.
* Zooming.
* Reacts to current theme - syntax highlighting changes based on theme being used even with 3rd party themes.

## How to use
* To show or hide the minimap, in the toolbar click View > Show Minimap or press Ctrl+`.
* Click on the top edge of the minimap to adjust its vertical offset. Its looks good with file-tab extensions.
* Hold CTRL while dragging minimap (or holding mouse click at a line of code) to quickly look at part of your code. Your viewport will return to normal when you stop.
* Scroll with the mouse wheel while hovering over the minmap for slow smooth scrolling.
* Change the width of the minimap by pulling the left edge into place.
* Hold CTRL (or CMD on Mac) while scrolling. The zoom of the minimap will change with a range of x2-x10.
* SHIFT-Click the minimap on a line of code to make that line the center of the code-editor.
* Hold SHIFT while scrolling. The transparency of the minimap will change with a range of 20%-100%.
* CTRL+SHIFT+Click centers that line, and has the same functionallity as CTRL+Click above (quick preview), except it centers that line of code.
* Middle clicking on the slider will enable or disable minimap fading.


text:
function DataSourceEvent(type, bubbles,cancelable)
{
    if( !System.instanceOf(this,DataSourceEvent) )return new DataSourceEvent(type, bubbles,cancelable);
    Event.call(this, type, bubbles,cancelable );
    return this;
}

module.exports = DataSourceEvent;
var System = require("./System.js");
var Object = require("./Object.js");
var Event = require("./Event.js");

DataSourceEvent.prototype= Object.create(Event.prototype,{
    "constructor":{value:DataSourceEvent}
});
DataSourceEvent.prototype.condition=null;
DataSourceEvent.prototype.index=NaN;
DataSourceEvent.prototype.data=null;
DataSourceEvent.prototype.oldValue=null;
DataSourceEvent.prototype.newValue=null;
DataSourceEvent.prototype.current = NaN;
DataSourceEvent.prototype.offset = NaN;
DataSourceEvent.prototype.waiting=false;
DataSourceEvent.prototype.totalSize=NaN;
DataSourceEvent.prototype.pageSize=NaN;
DataSourceEvent.prototype.totalSize=NaN;

DataSourceEvent.APPEND='dataSourceAppend';
DataSourceEvent.REMOVE='dataSourceRemove';
DataSourceEvent.UPDATE='dataSourceUpdate';
DataSourceEvent.SELECT ='dataSourceSelect';
DataSourceEvent.CHANGED='dataSourceChanged';

//属性事件
Event.registerEvent(function ( type , target, originalEvent )
{
    if( originalEvent instanceof DataSourceEvent )return originalEvent;
    switch ( type ){
        case DataSourceEvent.APPEND :
        case DataSourceEvent.REMOVE :
        case DataSourceEvent.UPDATE :
        case DataSourceEvent.SELECT :
        case DataSourceEvent.CHANGED :
            return new DataSourceEvent( type );
    }
});


text:
from rest_framework import serializers

from waldur_core.core.serializers import GenericRelatedField
from waldur_core.quotas import models, utils

class QuotaSerializer(serializers.HyperlinkedModelSerializer):
    scope = GenericRelatedField(
        related_models=utils.get_models_with_quotas(), read_only=True
    )

    class Meta:
        model = models.Quota
        fields = ('url', 'uuid', 'name', 'limit', 'usage', 'scope', 'threshold')
        read_only_fields = ('uuid', 'name', 'usage')
        extra_kwargs = {
            'url': {'lookup_field': 'uuid'},
        }

class BasicQuotaSerializer(serializers.HyperlinkedModelSerializer):
    """
    It does not expose scope in order to reduce number of queries
    """

    class Meta:
        model = models.Quota
        fields = ('url', 'uuid', 'name', 'limit', 'usage')
        read_only_fields = ('uuid', 'name', 'usage')
        extra_kwargs = {
            'url': {'lookup_field': 'uuid'},
        }


text:
package com.si.jupiter.smart.cluster;

import com.alibaba.fastjson.JSON;
import com.si.jupiter.smart.utils.zk.ZkOperator;
import com.si.jupiter.smart.route.ServerNode;
import com.si.jupiter.smart.server.ServerConfig;
import org.apache.zookeeper.CreateMode;

/**
 * todo       : todo something
 * Version    : 1.0
 * Author     : lizhipeng
 * makeResource     :  17-5-15 下午2:38
 * Last Update:  17-5-15 下午2:38
 */
public class ZkRegistCenter extends ServerRegistCenter{
    public final ZkOperator zkOperator;
    private final String registPath;
    public ZkRegistCenter(ServerConfig serverConfig) {
        super(serverConfig);
        //以下
        this.zkOperator = new ZkOperator("127.0.0.1:2181");
        this.registPath = "/si/jupiter/smart/testServer/rpc";
    }

    public boolean regist(ServerNode registNode){
        try{
            String serverId=registNode.getServerId();
            String value = JSON.toJSONString(registNode);
            this.zkOperator.writeString(registPath+"/"+serverId,value, CreateMode.EPHEMERAL);
            return true;
        }catch (Exception e){
            e.printStackTrace();
        }
        return false;
    }
    public boolean update(ServerNode updateNode){
        try{
            String serverId=updateNode.getServerId();
            String value = JSON.toJSONString(updateNode);
            String oldValue = this.zkOperator.readString(registPath+"/"+serverId);
            ServerNode oldNode = (ServerNode) JSON.parse(oldValue);
            if(updateNode!=null&&updateNode.getServerId()!=null&&updateNode.getServerId().equals(oldNode.getServerId())){
                this.zkOperator.writeString(registPath+"/"+serverId,value, CreateMode.EPHEMERAL);
                return true;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return false;

    }
    public boolean remove(ServerNode removeNode){
        try{
            String serverId=removeNode.getServerId();
            if(removeNode!=null&&removeNode.getServerId()!=null){
                this.zkOperator.deleteZkNode(registPath+"/"+serverId);
                return true;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return false;

    }
}


text:
Check the [code folder](https://github.com/MatthijsKamstra/haxejs/tree/master/docs/03vanillajs/code).

I would advice to check [the jQuery example](../01jquery/about.md), its without mentioning it that explicit there, also externs.
The same mechanism that are describe here, are also at work there.

- you need to "embed" the original js-files
- you need to have externals
- and that will enable you to write (very) similar Haxe code

I will give a short example of how to write, by hand, an extern.
The example is from [here](http://philippe.elsass.me/2014/11/haxe-working-with-javascript-libraries/))

_The code used in this example can be found [here](https://github.com/MatthijsKamstra/haxejs/tree/master/docs/05externs/code)._

## How to start

Create a folder named **foobar** (please use a better name; any name will do) and create folders **bin** and **src**.
See example below:

```
+ foobar
	+ bin
	+ src
		- Main.hx
	- build.hxml
```

if you have a JavaScript with looks like this

## foobar.js

So copy and paste the code and save the file in the `bin` folder (`!important`)

```js
// JavaScript
function MyJSClass() {}
MyJSClass.SOME_PROP = 42;
MyJSClass.someFunc = function () {
  return "hello";
};
MyJSClass.prototype.myProp = null;
MyJSClass.prototype.myFunc = function (prop) {
  this.myProp = prop;
};
```

## MyJSClass.hx

Create a file with the name `MyJSClass.hx` and save it in the `src` folder (`!important`)

Write your externs by hand like this:

```haxe
// Haxe extern
extern class MyJSClass {
    static var SOME_PROP:Int;
    static function someFunc():String;

    var myProp:String;
    function new();
    function myFunc(prop:String):Void;
}
```

## The Main.hx

Copy/paste the code and save it in the `src` folder.

```haxe
package ;
class Main
{
    function new()
    {
        trace("Externs Example");
        trace ("MyJSClass.SOME_PROP: " + MyJSClass.SOME_PROP); // 42 (Answer to The Ultimate Question of Life, the Universe, and Everything)
        trace ("MyJSClass.someFunc(): " + MyJSClass.someFunc()); // hello

        var _js = new MyJSClass();
        trace ("myProp: " + _js.myProp); // null
        _js.myFunc("Haxe Externs");
        trace ("myProp: " + _js.myProp); // Haxe Externs
    }

    static public function main()
    {
        var main = new Main();
    }
}
```

## index.html

Now we have to adjust the index.html

```html
<html>
  <head>
    <title>Haxe JS - Externs example</title>
  </head>
  <body>
    <div class="container">Check your console.log</div>

    <!-- the original javasript file -->
    <script type="text/javascript" src="foobar.js"></script>

    <!-- Your Haxe compiled script -->
    <script type="text/javascript" src="example.js"></script>
  </body>
</html>
```

---

## The Haxe build file, build.hxml

There are a lot of different arguments that you are able to pass to the Haxe compiler.
These arguments can also be placed into a text file of one per line with the extension hxml. This file can then be passed directly to the Haxe compiler as a build script.

```
# // build.hxml
-cp src
-main Main
-js bin/example.js
-dce full
```

## Build js with Haxe

To finish and see what we have, build the file and see the result

1. Open your terminal
2. `cd ` to the correct folder where you have saved the `build.hxml`
3. type `haxe build.hxml`
4. press enter

You could build everything directly in the terminal.

```
haxe -cp src -main Main -js bin/example.js -dce full
```

It will have the same result


text:
package spec.concordion.command.assertEquals.nonString;

import org.concordion.integration.junit3.ConcordionTestCase;

import test.concordion.TestRig;

public class NonStringTest extends ConcordionTestCase {

    public String outcomeOfPerformingAssertEquals(String fragment, String expectedString, String result, String resultType) {

        Object simulatedResult;
        if (resultType.equals("String")) {
            simulatedResult = result;
        } else if (resultType.equals("Integer")) {
            simulatedResult = new Integer(result);
        } else if (resultType.equals("Double")) {
            simulatedResult = new Double(result);
        } else {
            throw new RuntimeException("Unsupported result-type '" + resultType + "'.");
        }

        fragment = fragment.replaceAll("\\(some expectation\\)", expectedString);

        return new TestRig()
            .withStubbedEvaluationResult(simulatedResult)
            .processFragment(fragment)
            .successOrFailureInWords();
    }
}


text:
package pe.com.ccpl.siconc.web.dao;

import pe.com.ccpl.siconc.web.model.Role;

public interface RoleDAO {

	 Role getRole(int id);

}


text:
<css href="__PC_STATIC__/css/product-detail.css" />
<include file="Public:guid" />

{$currentProduct.name}-[{$currentProduct.short_name}]

{$currentProduct.title}

{$currentProduct.bref}

        <php>$imageList = explode('|', $currentProduct['images']);</php>

                    <foreach name="imageList" item="image">
                        <php>$active = $key==0?'active':'';</php>

                    </foreach>

                    <foreach name="imageList" item="image">
                        <php>$active = $key==0?'active':'';</php>

                    </foreach>

            产品描述

            详细参数

            更新历史

            <button class="fa fa-download subscriber"> 了解更多</button>
            <button class="fa fa-star buy"> 直接购买</button>
            <button class="fa fa-qq ask"> 咨询顾问</button>
            <button class="fa fa-headphones"> 400-9910-560</button>

{$currentProduct['description']|htmlspecialchars_decode}

                    编号
                    参数名称
                    参数值

                <foreach name="paramList" item="param">

                        {$key}
                        {$param.name}
                        {$param.value}

                </foreach>

                <foreach name="versionList" item="version">

                                版本:{$version.version} 更新时间:{$version.update_date}

{$version.content|htmlspecialchars_decode}

                </foreach>

            <form action="__ROOT__/subscribe/product" method="post">

                    <button type="button" class="close" data-dismiss="modal">
                        ×
                        关闭
                    </button>

获取详细资料并申请体验

                            产品:
                            <input type="text" name="subscribe_product_name" class="form-control" readonly="true" value="{$currentProduct.name}"/>

                            称谓:
                            <input type="text" name="subscriber_name" class="form-control" maxlength="20" minlength="2" required="true" />

                            手机:
                            <input type="number" name="subscriber_mobile" class="form-control" min="1300000000" maxlength="19999999999" minlength="11" maxlength="11" required="true" />

                        <button type="submit" class="btn btn-danger" name="subscribe_product" value="{$currentProduct.id}">获取</button>

            </form>


text:
Examples for using parallelization in Python

## File descriptions
*Parallel Testing.ipynb* is an IPython notebook for testing out code used for
parallel jobs.

*parallel_example.py* is a script from a introduction to parallel programming
tutorial using Python's multiprocessing module written by Sebastian Raschka.

*parallel_prime_test.py* and *serial_prime_test.py* are parallel and serial
versions, respectively, of code to determine how many primes there are in a
given range.

*parallel_test.py* is a script to compare serial and parallel code in computing
the sum of consecutive integers.

## License
See [LICENSE](LICENSE)


text:
<!-- Love javascript-obfuscator? Please consider supporting our collective:
👉  https://opencollective.com/javascript-obfuscator/donate -->

<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Obfuscator version used:
* Node version used:

# Stack trace
<!--- Include stack trace -->

## Minimal working example that will help to reproduce issue
<!--- Include code -->


text:
<?php

declare(strict_types=1);

namespace FSi\Bundle\DoctrineExtensionsBundle\Request;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\NoResultException;
use FSi\DoctrineExtensions\Translatable\Mapping\ClassMetadata as TranslatableClassMetadata;
use FSi\DoctrineExtensions\Translatable\Model\TranslatableRepositoryInterface;
use FSi\DoctrineExtensions\Translatable\TranslatableListener;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class TranslatableParamConverter implements ParamConverterInterface
{
    /**
     * @var ManagerRegistry
     */
    private $registry;

    /**
     * @var TranslatableListener
     */
    private $translatableListener;

    public function __construct(ManagerRegistry $registry, TranslatableListener $translatableListener)
    {
        $this->registry = $registry;
        $this->translatableListener = $translatableListener;
    }

    /**
     * @param Request $request
     * @param ParamConverter $configuration
     * @return boolean
     * @throws NotFoundHttpException
     */
    public function apply(Request $request, ParamConverter $configuration): bool
    {
        $criteria = $this->buildSearchCriteria($configuration, $request);
        if (empty($criteria)) {
            return false;
        }

        try {
            $object = $this->getRepository($configuration)->findTranslatableOneBy(
                $criteria,
                null,
                $request->getLocale()
            );
        } catch (NoResultException $e) {
            throw new NotFoundHttpException(sprintf(
                'Object of class "%s" has not been found.',
                $configuration->getClass()
            ));
        }

        $request->attributes->set($configuration->getName(), $object);

        return true;
    }

    public function supports(ParamConverter $configuration): bool
    {
        return $this->validateClass($configuration)
            && $this->validateManager($configuration)
            && $this->validateRepository($configuration)
            && $this->hasTranslatableProperties($configuration)
        ;
    }

    private function getMapping(ParamConverter $configuration, Request $request): array
    {
        $mapping = $this->getMappingOption($configuration);
        if (empty($mapping)) {
            $keys = $request->attributes->keys();
            $mapping = $keys ? array_combine($keys, $keys) : [];
        }

        $exclude = $this->getExcludeOption($configuration);
        foreach ($exclude as $excluded) {
            unset($mapping[$excluded]);
        }

        return $mapping;
    }

    private function getMappingOption(ParamConverter $configuration): array
    {
        $options = $configuration->getOptions();

        if (isset($options['mapping'])) {
            return $options['mapping'];
        }

        return [];
    }

    private function getExcludeOption(ParamConverter $configuration): array
    {
        $options = $configuration->getOptions();

        if (isset($options['exclude'])) {
            return $options['exclude'];
        }

        return [];
    }

    private function getManager(ParamConverter $configuration): ?ObjectManager
    {
        $options = $configuration->getOptions();

        if (isset($options['entity_manager'])) {
            return $this->registry->getManager($options['entity_manager']);
        }

        return $this->registry->getManagerForClass($configuration->getClass());
    }

    private function buildSearchCriteria(ParamConverter $configuration, Request $request): array
    {
        $mapping = $this->getMapping($configuration, $request);
        $metadata = $this->getDoctrineMetadata($configuration);
        $translatableMetadata = $this->getTranslatableMetadata($configuration);

        $criteria = [];
        foreach ($mapping as $attribute => $field) {
            if (
                $this->isFieldSearchable($metadata, $field)
                || $this->isFieldTranslatable($translatableMetadata, $field)
            ) {
                $criteria[$field] = $request->attributes->get($attribute);
            }
        }

        return $this->filterNullCriteria($criteria, $configuration);
    }

    private function filterNullCriteria(array $criteria, ParamConverter $configuration): array
    {
        if ($this->getStripNullOption($configuration)) {
            return array_filter($criteria, static function ($value): bool {
                return null !== $value;
            });
        }

        return $criteria;
    }

    private function getStripNullOption(ParamConverter $configuration): bool
    {
        $options = $configuration->getOptions();

        if (isset($options['strip_null'])) {
            return (bool) $options['strip_null'];
        }

        return false;
    }

    private function isFieldSearchable(ClassMetadata $classMetadata, string $field): bool
    {
        return $classMetadata->hasField($field)
            || ($classMetadata->hasAssociation($field) && $classMetadata->isSingleValuedAssociation($field))
        ;
    }

    private function isFieldTranslatable(TranslatableClassMetadata $translatableMetadata, string $field): bool
    {
        foreach ($translatableMetadata->getTranslatableProperties() as $properties) {
            if (isset($properties[$field])) {
                return true;
            }
        }

        return false;
    }

    private function getRepository(ParamConverter $configuration): EntityRepository
    {
        return $this->getManager($configuration)->getRepository($configuration->getClass());
    }

    private function validateClass(ParamConverter $configuration): bool
    {
        return null !== $configuration->getClass();
    }

    private function validateManager(ParamConverter $configuration): bool
    {
        $manager = $this->getManager($configuration);

        if (null === $manager) {
            return false;
        }

        return !$manager->getMetadataFactory()->isTransient($configuration->getClass());
    }

    private function validateRepository(ParamConverter $configuration): bool
    {
        return $this->getRepository($configuration) instanceof TranslatableRepositoryInterface;
    }

    private function getDoctrineMetadata(ParamConverter $configuration): ClassMetadata
    {
        return $this->getManager($configuration)->getClassMetadata($configuration->getClass());
    }

    private function getTranslatableMetadata(ParamConverter $configuration): TranslatableClassMetadata
    {
        return $this->translatableListener->getExtendedMetadata(
            $this->getManager($configuration),
            $configuration->getClass()
        );
    }

    private function hasTranslatableProperties(ParamConverter $configuration): bool
    {
        return $this->getTranslatableMetadata($configuration)->hasTranslatableProperties();
    }
}


text:
#include "rae/ui/Input.hpp"

#include "loguru/loguru.hpp"
#include "rae/core/ScreenSystem.hpp"
#include "rae/ui/WindowSystem.hpp"

using namespace rae;

void Input::onFrameEnd()
{
	ISystem::onFrameEnd();

	m_changed = UpdateStatus::NotChanged;
	key.clearFrame();

	// Clear button events
	for (int i = 0; i < (int)MouseButton::Count; ++i)
	{
		MouseButton iButton = intToMouseButton(i);
		mouse.setButtonEvent(iButton, EventType::Undefined);
	}
}

bool Input::getKeyState(int keyValue) const
{
	if (keyValue < key.keyStatesSize)
		return key.keyStates[keyValue];
	return false;
}

bool Input::getKeyPressed(int keyValue) const
{
	if (keyValue < key.keyStatesSize)
		return key.pressedThisFrame[keyValue];
	return false;
}

bool Input::getKeyReleased(int keyValue) const
{
	if (keyValue < key.keyStatesSize)
		return key.releasedThisFrame[keyValue];
	return false;
}

void Input::addTouchPoint(TouchPointState setState, int setId, float xPixels, float yPixels)
{
	isHandled = false;

	eventType = EventType::Touch;

	//touch.addTouchPoint(setId, xPixels, yPixels);

	#ifdef DebugTouch
		LOG_F(INFO, "Input::addTouchPoint: x: %f y: %f", xPixels, yPixels);
	#endif

	if (setId < touch.touchPoints_size)
	{
		touch.eventId = setId;
	}
	else
	{
		touch.eventId = 0;
		LOG_F(ERROR, "ERROR: Input::addTouchPoint. ID is over 20. id: %i", setId);
	}

	for (int i = 0; i < touch.touchPoints_size; i++ )
	{
		if (setId == touch.touchPoints[i].id)
		{
			touch.touchPoints[i].state = setState;

			touch.touchPoints[i].xDeltaP = xPixels - touch.touchPoints[i].xP;
			touch.touchPoints[i].yDeltaP = yPixels - touch.touchPoints[i].yP;

			touch.touchPoints[i].xP = xPixels;
			touch.touchPoints[i].yP = yPixels;

			return;
		}
	}
	LOG_F(ERROR, "ERROR: Input::addTouchPoint. Touch ID not found. id: %i", setId);
}

void Input::osScrollEvent(const Window& window, float deltaX, float deltaY)
{
	m_changed = UpdateStatus::Changed;
	isHandled = false;
	eventType = EventType::Scroll;

	mouse.scrollX = deltaX;
	mouse.scrollY = deltaY;

	emitScrollEvent();
}

void Input::osKeyEvent(const Window& window, EventType setEventType, int setKey, int32_t setUnicode)
{
	//LOG_F(INFO, "Input.keyEvent() setKey: %i", setKey);

	m_changed = UpdateStatus::Changed;
	isHandled = false;
	//window = set_window;
	eventType = setEventType;

	key.value = setKey;
	//key.unicode = setUnicode;

	/*
	version(gtk)
	{
		key.value = setKey;
		key.unicode = keyValueToUnicode(setKey);
	}
	version(glfw)
	{
		key.value = setKey;
		key.unicode = cast(dchar) setKey;
	}
	*/

	if (setEventType == EventType::KeyPress)
	{
		//LOG_F(INFO, "KEY_PRESS: %i unicode: %i", setKey, setUnicode);
		if (key.value < key.keyStatesSize)
		{
			key.keyStates[key.value] = true;
			key.pressedThisFrame[key.value] = true;
		}
		else LOG_F(ERROR, "key.value: %i is bigger than keyStatesSize.", key.value);
	}
	else if (setEventType == EventType::KeyRelease)
	{
		//LOG_F(INFO, "KEY_RELEASE: %i unicode: %i", setKey, setUnicode);
		if (key.value < key.keyStatesSize)
		{
			key.keyStates[key.value] = false;
			key.releasedThisFrame[key.value] = true;
		}
		else LOG_F(ERROR, "key.value: %i is bigger than keyStatesSize.", key.value);
	}

	emitKeyEvent();
}

void Input::osMouseEvent(const Window& window, EventType setEventType, int setButton,
	float rawXPixels, float rawYPixels, float setAmount)
{
	//assert(setButton >= 0); // "Mouse button is smaller than 0. Platform not supported yet."

	float xPixels = rawXPixels;
	float yPixels = rawYPixels;

	//LOG_F(INFO, "Input::osMouseEvent: xPixels: %f yPixels: %f xHeight: %f yHeight: %f", xPixels, yPixels,
	//	xHeight, yHeight);

	m_changed = UpdateStatus::Changed;
	isHandled = false;
	//eventWindow = setWindow;
	eventType = setEventType;

	MouseButton mouseButton = intToMouseButton(setButton);
	mouse.eventButton = mouseButton;

	mouse.amount = setAmount;

	mouse.doubleClickButton = 0; // Zero this, we can only emit one double click button per event...
	// Is that bad? Propably ok,
	// as there can only be one eventButton per event as well.

	if (eventType == EventType::MouseMotion)
	{
		/////doubleClickValid1 = false;
	}
	else if (eventType == EventType::MouseButtonPress)
	{
		mouse.setButtonEvent(mouseButton, eventType);
		mouse.setButtonDown(mouseButton, true);
		mouse.xOnButtonPressP[setButton] = xPixels;
		mouse.yOnButtonPressP[setButton] = yPixels;
	}
	else if (eventType == EventType::MouseButtonRelease)
	{
		/*
		//Double click handling is on button release.
		//We measure the time between mouse button releases.
		if( setButton == MouseButton.LEFT )
		{

			if( doubleClickValid1 == true )
			{
				if( doubleClickTimer1.stop() <= 0.75 )//Currently 0.75 sec. TODO preferences in class Rae.
				{
					//It's a double click.
					debug(mouse) Trace.formatln("Input.Double click LEFT.");
					mouse.doubleClickButton = setButton;
				}
				else
				{
					debug(mouse) Trace.formatln("Input.NO .... Double click LEFT." );
				}

				doubleClickTimer1.start();
			}
			else
			{
				debug(mouse) Trace.formatln("Input.Start double click timer.");
				doubleClickValid1 = true;
				doubleClickTimer1.start();
			}
		}
		*/
		mouse.setButtonEvent(mouseButton, eventType);
		mouse.setButtonDown((MouseButton)setButton, false);
	}
	//else
	//{
		//LOG_F(INFO, "Input NO PRESS.");
	//}

	mouse.xDeltaP = xPixels - mouse.xP;
	mouse.yDeltaP = yPixels - mouse.yP;

	//

	mouse.xP = xPixels;
	mouse.yP = yPixels;

	mouse.xMM = m_screenSystem.pixelsToMM(rawXPixels);
	mouse.yMM = m_screenSystem.pixelsToMM(rawYPixels);

	mouse.xDeltaMM = m_screenSystem.pixelsToMM(mouse.xDeltaP);
	mouse.yDeltaMM = m_screenSystem.pixelsToMM(mouse.yDeltaP);

	mouse.xNormalizedWindow = window.xPixelsToNormalizedWindow(rawXPixels);
	mouse.yNormalizedWindow = window.yPixelsToNormalizedWindow(rawYPixels);

	if (eventType == EventType::MouseMotion)
	{
		emitMouseMotionEvent();
	}
	else if (eventType == EventType::MouseButtonPress)
	{
		emitMouseButtonPressEvent();
	}
	else if (eventType == EventType::MouseButtonRelease)
	{
		emitMouseButtonReleaseEvent();
	}
}


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page

class EngagementContextList(ListResource):
    """  """

    def __init__(self, version, flow_sid, engagement_sid):
        """
        Initialize the EngagementContextList

        :param Version version: Version that contains the resource
        :param flow_sid: Flow SID
        :param engagement_sid: Engagement SID

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
        """
        super(EngagementContextList, self).__init__(version)

        # Path Solution
        self._solution = {'flow_sid': flow_sid, 'engagement_sid': engagement_sid, }

    def get(self):
        """
        Constructs a EngagementContextContext

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        """
        return EngagementContextContext(
            self._version,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
        )

    def __call__(self):
        """
        Constructs a EngagementContextContext

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        """
        return EngagementContextContext(
            self._version,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Studio.V1.EngagementContextList>'

class EngagementContextPage(Page):
    """  """

    def __init__(self, version, response, solution):
        """
        Initialize the EngagementContextPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param flow_sid: Flow SID
        :param engagement_sid: Engagement SID

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextPage
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextPage
        """
        super(EngagementContextPage, self).__init__(version, response)

        # Path Solution
        self._solution = solution

    def get_instance(self, payload):
        """
        Build an instance of EngagementContextInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        """
        return EngagementContextInstance(
            self._version,
            payload,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Studio.V1.EngagementContextPage>'

class EngagementContextContext(InstanceContext):
    """  """

    def __init__(self, version, flow_sid, engagement_sid):
        """
        Initialize the EngagementContextContext

        :param Version version: Version that contains the resource
        :param flow_sid: Flow SID
        :param engagement_sid: Engagement SID

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        """
        super(EngagementContextContext, self).__init__(version)

        # Path Solution
        self._solution = {'flow_sid': flow_sid, 'engagement_sid': engagement_sid, }
        self._uri = '/Flows/{flow_sid}/Engagements/{engagement_sid}/Context'.format(**self._solution)

    def fetch(self):
        """
        Fetch a EngagementContextInstance

        :returns: Fetched EngagementContextInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return EngagementContextInstance(
            self._version,
            payload,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Studio.V1.EngagementContextContext {}>'.format(context)

class EngagementContextInstance(InstanceResource):
    """  """

    def __init__(self, version, payload, flow_sid, engagement_sid):
        """
        Initialize the EngagementContextInstance

        :returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        """
        super(EngagementContextInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload.get('account_sid'),
            'context': payload.get('context'),
            'engagement_sid': payload.get('engagement_sid'),
            'flow_sid': payload.get('flow_sid'),
            'url': payload.get('url'),
        }

        # Context
        self._context = None
        self._solution = {'flow_sid': flow_sid, 'engagement_sid': engagement_sid, }

    @property
    def _proxy(self):
        """
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: EngagementContextContext for this EngagementContextInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextContext
        """
        if self._context is None:
            self._context = EngagementContextContext(
                self._version,
                flow_sid=self._solution['flow_sid'],
                engagement_sid=self._solution['engagement_sid'],
            )
        return self._context

    @property
    def account_sid(self):
        """
        :returns: Account SID
        :rtype: unicode
        """
        return self._properties['account_sid']

    @property
    def context(self):
        """
        :returns: Flow state
        :rtype: dict
        """
        return self._properties['context']

    @property
    def engagement_sid(self):
        """
        :returns: Engagement SID
        :rtype: unicode
        """
        return self._properties['engagement_sid']

    @property
    def flow_sid(self):
        """
        :returns: Flow SID
        :rtype: unicode
        """
        return self._properties['flow_sid']

    @property
    def url(self):
        """
        :returns: The URL of the resource
        :rtype: unicode
        """
        return self._properties['url']

    def fetch(self):
        """
        Fetch a EngagementContextInstance

        :returns: Fetched EngagementContextInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextInstance
        """
        return self._proxy.fetch()

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Studio.V1.EngagementContextInstance {}>'.format(context)


text:
class RenderCrashHandlerHostLinux : public MessageLoopForIO::Watcher,
                                    public MessageLoop::DestructionObserver {
 public:
  // Get the file descriptor which renderers should be given in order to signal
  // crashes to the browser.
  int GetDeathSignalSocket() const {
    return renderer_socket_;
  }

  // MessagePumbLibevent::Watcher impl:
  virtual void OnFileCanWriteWithoutBlocking(int fd);
  virtual void OnFileCanReadWithoutBlocking(int fd);

  // MessageLoop::DestructionObserver impl:
  virtual void WillDestroyCurrentMessageLoop();

 private:
  friend struct DefaultSingletonTraits<RenderCrashHandlerHostLinux>;
  RenderCrashHandlerHostLinux();
  ~RenderCrashHandlerHostLinux();
  void Init();

  int renderer_socket_;
  int browser_socket_;
  MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;

  DISALLOW_EVIL_CONSTRUCTORS(RenderCrashHandlerHostLinux);
};

#endif  // CHROME_BROWSER_RENDERER_HOST_RENDER_CRASH_HANDLER_HOST_LINUX_H_


text:
from django.conf import settings
from django.urls import reverse

from dimagi.utils.web import get_url_base

from dropbox import Dropbox
from dropbox.files import CommitInfo, UploadSessionCursor, WriteMode
from dropbox.oauth import DropboxOAuth2Flow

DROPBOX_CSRF_TOKEN = 'dropbox-auth-csrf-token'
CHUNK_SIZE = 5000000  # Read file in 5 MB chunks

def get_dropbox_auth_flow(session):
    from .views import DropboxAuthCallback

    redirect_uri = '{}{}'.format(
        get_url_base(),
        reverse(DropboxAuthCallback.slug),
    )
    return DropboxOAuth2Flow(
        settings.DROPBOX_KEY,
        settings.DROPBOX_SECRET,
        redirect_uri,
        session,
        DROPBOX_CSRF_TOKEN
    )

def upload_to_dropbox(access_token, dropbox_path, file_path, progress_callback=None):
    dbx = Dropbox(access_token)
    with open(file_path, 'rb') as file:
        chunk = file.read(CHUNK_SIZE)
        offset = len(chunk)

        upload_session = dbx.files_upload_session_start(chunk)
        progress_callback and progress_callback(offset)

        while True:
            chunk = file.read(CHUNK_SIZE)
            if not chunk:
                break
            dbx.files_upload_session_append_v2(
                chunk,
                UploadSessionCursor(
                    upload_session.session_id,
                    offset,
                ),
            )
            offset += len(chunk)
            progress_callback and progress_callback(offset)

        file_metadata = dbx.files_upload_session_finish(
            b'',
            UploadSessionCursor(
                upload_session.session_id,
                offset=offset,
            ),
            CommitInfo(
                dropbox_path,
                # When writing the file it won't overwrite an existing file, just add
                # another file like "filename (2).txt"
                WriteMode('add'),
            ),
        )
        progress_callback and progress_callback(offset)
        return file_metadata.path_display


text:
package com.outofbounds.empire;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
public class DBBackup {

    @Autowired
    private org.springframework.core.env.Environment env;

    @CrossOrigin(origins = {"http://localhost:8000"})
    @RequestMapping(method = RequestMethod.GET, value = "/backup/now")
    public @ResponseBody
    void Backupdbtosql() throws IOException {
        Process p = null;
        try {
            Date dNow = new Date( );
            SimpleDateFormat ft = new SimpleDateFormat ("dd.MM.yyyy.hh.mm.ss");
            String dbusername = env.getProperty("spring.datasource.username");
            String dbpassword = env.getProperty("spring.datasource.password");
            Runtime runtime = Runtime.getRuntime();
            p = runtime.exec("mysqldump -u"+dbusername+" -p"+dbpassword+" --add-drop-database -B empire -r " + "C:\\DatabaseBackup\\" + ft.format(dNow) + ".sql");

            int processComplete = p.waitFor();

            if (processComplete == 0) {

                System.out.println("Succes: Backup created successfully!");

            } else {
                System.out.println("FAILED: No Backup created");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


text:
#include "phylip.h"

#define nmlngth         10   /* Length of species name                       */
#define maxstates       20   /* Maximum number of states in multi chars      */
#define maxoutput       80   /* Maximum length of output line                */
#define sizearray       5000 /* Size of symbarray; must be >= the sum of     */
                             /* squares of the number of states in each multi*/
                             /* char to be factored                          */
#define factchar        ':'  /* character to indicate state connections      */
#define unkchar         '?'  /* input character to indicate state unknown    */

#define ibmpc0          false /* true if terminal is an IBM PC screen        */
#define ansi0           true  /* true if terminal is an ANSI terminal        */
#define vt520           false /* true if terminal is a VT52  terminal        */

typedef struct node {     /* Node of multifurcating tree */
  struct node *ancstr, *sibling, *descendant;
  Char state;             /* Symbol of character state   */
  short edge;             /* Number of subtending edge   */
} node;

Static FILE *infile, *outfile;
Static short neus, nchars, charindex, lastindex;
Static Char ch;
Static boolean ancstrrequest, factorrequest, rooted,  ibmpc, vt52,
	       ansi, progress;
Static Char symbarray[sizearray];
 /* Holds multi symbols and their factored equivs        */
Static short *charnum;     /* Multis           */
Static short *chstart;     /* Position of each */
Static short *numstates;   /* Number of states */
Static Char  *ancsymbol;   /* Ancestral state  */

/*  local variables for dotrees, propagated to global level. */
  short npairs, offset, charnumber, nstates;
  node *root;
  Char pair[maxstates][2];
  node *nodes[maxstates];

openfile(fp,filename,mode,application,perm)
FILE **fp;
char *filename;
char *mode;
char *application;
char *perm;
{
  FILE *of;
  char file[100];
  strcpy(file,filename);
  while (1){
    of = fopen(file,mode);
    if (of)
      break;
    else {
      switch (*mode){
      case 'r':
        printf("%s:  can't read %s\n",application,file);
	file[0] = '\0';
        while (file[0] =='\0'){
          printf("Please enter a new filename>");
          gets(file);}
        break;
      case 'w':
      case 'a':
        printf("%s: can't write %s\n",application,file);
	file[0] = '\0';
        while (file[0] =='\0'){
          printf("Please enter a new filename>");
          gets(file);}
        break;
      }
    }
  }
  *fp=of;
  if (perm != NULL)
    strcpy(perm,file);
}

void uppercase(ch)
Char *ch;
{  /* convert a character to upper case -- either ASCII or EBCDIC */
   *ch = (islower(*ch) ?  toupper(*ch) : (*ch));
}  /* uppercase */

void getoptions()
{
  /* interactively set options */
  Char ch;
  boolean done;

  ibmpc = ibmpc0;
  vt52 = vt520;
  ansi = ansi0;
  progress = true;
  factorrequest = false;
  ancstrrequest = false;
  putchar('\n');
  for (;;){
    printf(ansi ? "\033[2J\033[H" :
	   vt52 ? "\033E\033H"    : "\n");
    printf("\nFactor -- multistate to binary recoding program, version %s\n\n"
	   ,VERSION);
    printf("Settings for this run:\n");
    printf("  A      put ancestral states in output file?  %s\n",
	   ancstrrequest ? "Yes" : "No");
    printf("  F   put factors information in output file?  %s\n",
	   factorrequest ? "Yes" : "No");
    printf("  0       Terminal type (IBM PC, VT52, ANSI)?  %s\n",
	   ibmpc ? "IBM PC" :
	   ansi  ? "ANSI"   :
	   vt52  ? "VT52"   : "(none)");
    printf("  1      Print indications of progress of run  %s\n",
	   (progress ? "Yes" : "No"));
    printf("\nAre these settings correct? (type Y or the letter for one to change)\n");
    scanf("%c%*[^\n]", &ch);
    getchar();
    uppercase(&ch);
    if (ch == 'Y')
      break;
    if (ch == 'A' || ch == 'F' || ch == '0' || ch == '1') {
      switch (ch) {

      case 'A':
	ancstrrequest = !ancstrrequest;
	break;

      case 'F':
	factorrequest = !factorrequest;
	break;

      case '0':
	if (ibmpc) {
	  ibmpc = false;
	  vt52 = true;
	} else {
	  if (vt52) {
	    vt52 = false;
	    ansi = true;
	  } else if (ansi)
	    ansi = false;
	  else
	    ibmpc = true;
	}
	break;

      case '1':
        progress = !progress;
      break;
      }
    } else
      printf("Not a possible option!\n");
  }
}  /* getoptions */

void nextch(ch)
Char *ch;
{
  *ch = ' ';
  while (*ch == ' ' && !eoln(infile))
    *ch = getc(infile);
}  /* nextch */

void readtree()
{
  /* Reads a single character-state tree; puts adjacent symbol
     pairs into array 'pairs' */

  npairs = 0;
  while (!eoln(infile)) {
    nextch(&ch);
    if (eoln(infile))
      break;
    npairs++;
    pair[npairs - 1][0] = ch;
    nextch(&ch);
    if (eoln(infile) || (ch != factchar)) {
      printf("CHARACTER%4hd:  ERROR IN CHARACTER STATE TREE FORMAT\n",
	     charnumber);
      exit(-1);}

    nextch(&pair[npairs - 1][1]);
    if (eoln(infile) && pair[npairs - 1][1] == ' '){
      printf("CHARACTER%4hd:  ERROR IN CHARACTER STATE TREE FORMAT\n",
	     charnumber);
      exit(-1);}
  }
  fscanf(infile, "%*[^\n]");
  getc(infile);

}  /* readtree */

void attachnodes(poynter,otherone)
node *poynter;
Char *otherone;
{
  /* Makes linked list of all nodes to which passed node is
     ancestral.  First such node is 'descendant'; second
     such node is 'sibling' of first; third such node is
     sibling of second; etc.  */
  node *linker, *ptr;
  short i, j, k;

  linker = poynter;
  for (i = 0; i < (npairs); i++) {
    for (j = 1; j <= 2; j++) {
      if (poynter->state == pair[i][j - 1]) {
	if (j == 1)
	  *otherone = pair[i][1];
	else
	  *otherone = pair[i][0];
	if (*otherone != '.' && *otherone != poynter->ancstr->state) {
	  k = offset + 1;
	  while (*otherone != symbarray[k - 1])
	    k++;
	  if (nodes[k - offset - 1] != NULL)
	    exit(-1);
	  ptr = (node *)Malloc(sizeof(node));
	  ptr->ancstr = poynter;
	  ptr->descendant = NULL;
	  ptr->sibling = NULL;
	  ptr->state = *otherone;
	  if (linker == poynter)   /* If not first */
	    poynter->descendant = ptr;   /* If first */
	  else
	    linker->sibling = ptr;
	  nodes[k - offset - 1] = ptr;
	      /* Save pntr to node */
	  linker = ptr;
	}
      }
    }
  }
}  /* attachnodes */

void maketree(poynter, otherone)
node *poynter;
Char *otherone;
{
  /* Recursively attach nodes */
  if (poynter == NULL )
    return;
  attachnodes(poynter, otherone);
  maketree(poynter->descendant, otherone);
  maketree(poynter->sibling, otherone);
}  /* maketree */

void construct()
{
  /* Puts tree together from array 'pairs' */
  Char rootstate;
  short i, j, k;
  boolean done;
  node *poynter;
  char otherone;

  rooted = false;
  ancsymbol[charindex - 1] = '?';
  rootstate = pair[0][0];
  nstates = 0;
  for (i = 0; i < (npairs); i++) {
    for (j = 1; j <= 2; j++) {
      k = 1;
      done = false;
      while (!done) {
	if (k > nstates) {
	  done = true;
	  break;
	}
	if (pair[i][j - 1] == symbarray[offset + k - 1])
	  done = true;
	else
	  k++;
      }
      if (k > nstates) {
	if (pair[i][j - 1] == '.') {
	  if (rooted)
	    exit(-1);
	  rooted = true;
	  ancsymbol[charindex - 1] = '0';
	  if (j == 1)
	    rootstate = pair[i][1];
	  else
	    rootstate = pair[i][0];
	} else {
	  nstates++;
	  symbarray[offset + nstates - 1] = pair[i][j - 1];
	}
      }
    }
  }
  if ((rooted && nstates != npairs) ||
      (!rooted && nstates != npairs + 1))
    exit(-1);
  root = (node *)Malloc(sizeof(node));
  root->state = ' ';
  root->descendant = (node *)Malloc(sizeof(node));
  root->descendant->ancstr = root;
  root = root->descendant;
  root->descendant = NULL;
  root->sibling = NULL;
  root->state = rootstate;
  for (i = 0; i < (nstates); i++)
    nodes[i] = NULL;
  i = 1;
  while (symbarray[offset + i - 1] != rootstate)
    i++;
  nodes[i - 1] = root;
  maketree(root, &otherone);
  for (i = 0; i < (nstates); i++) {
    if (nodes[i] != root) {
      if (nodes[i] == NULL){
	printf("CHARACTER%4hd:  INVALID CHARACTER STATE TREE DESCRIPTION\n",
	       charnumber);
	exit(-1);}
      else {
	poynter = nodes[i]->ancstr;
	while (poynter != root && poynter != nodes[i])
	  poynter = poynter->ancstr;
	if (poynter != root){
	  printf("CHARACTER%4hd:  INVALID CHARACTER STATE TREE DESCRIPTION\n",
		 charnumber);
	  exit(-1);}
      }
    }
  }
}  /* construct */

void numberedges(poynter,edgenum)
node *poynter;
short *edgenum;
{
  /* Assign to each node a number for the edge below it.
     The root is zero */
  if (poynter == NULL)
    return;
  poynter->edge = *edgenum;
  (*edgenum)++;
  numberedges(poynter->descendant, edgenum);
  numberedges(poynter->sibling, edgenum);
}  /* numberedges */

void factortree()
{
  /* Generate the string of 0's and 1's that will be
     substituted for each symbol of the multistate char. */
  short i, j, place, factoroffset;
  node *poynter;
  short edgenum=0;

  numberedges(root, &edgenum);
  factoroffset = offset + nstates;
  for (i = 0; i < (nstates); i++) {
    place = factoroffset + (nstates - 1) * i;
    for (j = place; j <= (place + nstates - 2); j++)
      symbarray[j] = '0';
    poynter = nodes[i];
    while (poynter != root) {
      symbarray[place + poynter->edge - 1] = '1';
      poynter = poynter->ancstr;
    }
  }
}  /* factortree */

void dotrees()
{
  /* Process character-state trees */
  short lastchar;

  charindex = 0;
  lastchar = 0;
  offset = 0;
  charnumber = 0;
  fscanf(infile, "%hd", &charnumber);
  while (charnumber < 999) {
    if (charnumber < lastchar) {
      printf("CHARACTER%4hd:  OUT OF ORDER", charnumber);
      exit(-1);
    }
    charindex++;
    lastindex = charindex;
    readtree();   /* Process character-state tree  */
    if (npairs > 0) {
      construct();   /* Link tree together  */
      factortree();
    } else {
      nstates = 0;
      ancsymbol[charindex - 1] = '?';
    }
    lastchar = charnumber;
    charnum[charindex - 1] = charnumber;
    chstart[charindex - 1] = offset;
    numstates[charindex - 1] = nstates;
    offset += nstates * nstates;
    fscanf(infile, "%hd", &charnumber);
  }
  fscanf(infile, "%*[^\n]");
  getc(infile);

  /*    each multistate character */
  /*    symbol  */
}  /* dotrees */

void writech(ch, chposition)
Char ch;
short *chposition;
{
  /* Writes a single character to output */
  if (*chposition > maxoutput) {
    putc('\n', outfile);
    *chposition = 1;
  }
  putc(ch, outfile);
  (*chposition)++;
}  /* writech */

Local Void writefactors(chposition)
short *chposition;
{  /* Writes 'FACTORS' line */

  short i, charindex;
  Char symbol;

  fprintf(outfile, "FACTORS   ");
  *chposition = 11;
  symbol = '-';
  for (charindex = 0; charindex < (lastindex); charindex++) {
    if (symbol == '-')
      symbol = '+';
    else
      symbol = '-';
    if (numstates[charindex] == 0)
      writech(symbol,chposition);
    else {
      for (i = 1; i < (numstates[charindex]); i++)
	writech(symbol, chposition);
    }
  }
  putc('\n', outfile);
}  /* writefactors */

void writeancestor(chposition)
short *chposition;
{
  /* Writes 'ANCESTOR' line */
  short i, charindex;

  charindex = 1;
  while (ancsymbol[charindex - 1] == '?')
    charindex++;
  if (charindex > lastindex)
    return;
  fprintf(outfile, "ANCESTOR  ");
  *chposition = 11;
  for (charindex = 0; charindex < (lastindex); charindex++) {
    if (numstates[charindex] == 0)
      writech(ancsymbol[charindex], chposition);
    else {
      for (i = 1; i < (numstates[charindex]); i++)
	writech(ancsymbol[charindex], chposition);
    }
  }
  putc('\n', outfile);
}  /* writeancestor */

void doeu(chposition,eu)
short *chposition,eu;
{
  /* Writes factored data for a single species  */
  short i, charindex, place;
  Char *multichar;

  for (i = 1; i <= nmlngth; i++) {
    ch = getc(infile);
    putc(ch, outfile);
  }
  multichar = (Char *)Malloc(nchars*sizeof(Char));
  *chposition = 11;
  for (i = 0; i < (nchars); i++) {
    do {
      if (eoln(infile)) {
	fscanf(infile, "%*[^\n]");
	getc(infile);
      }
      ch = getc(infile);
    } while (ch == ' ');
    multichar[i] = ch;
  }
  fscanf(infile, "%*[^\n]");
  getc(infile);
  for (charindex = 0; charindex < (lastindex); charindex++) {
    if (numstates[charindex] == 0)
      writech(multichar[charnum[charindex] - 1], chposition);
    else {
      i = 1;
      while (symbarray[chstart[charindex] + i - 1] !=
	     multichar[charnum[charindex] - 1] && i <= numstates[charindex])
	i++;
      if (i > numstates[charindex]) {
	if( multichar[charnum[charindex] - 1] == unkchar){
	  for (i = 1; i < (numstates[charindex]); i++)
	    writech('?', chposition);
	} else {
	  putc('\n', outfile);
	  printf("IN SPECIES %3hd, MULTISTATE CHARACTER%4hd:  ",
		 eu,charnum[charindex]);
	  printf("'%c' IS NOT A DOCUMENTED STATE\n",
		 multichar[charnum[charindex] - 1]);
	  exit(-1);
	}
      } else {
	place = chstart[charindex] + numstates[charindex] +
		(numstates[charindex] - 1) * (i - 1);
	for (i = 0; i <= (numstates[charindex] - 2); i++)
	  writech(symbarray[place + i], chposition);
      }
    }
  }
  putc('\n', outfile);
  free(multichar);
}  /* doeu */

void dodatamatrix()
{
  /* Reads species information and write factored data set */
  short charindex, totalfactors,eu,chposition;
  totalfactors = 0;
  for (charindex = 0; charindex < (lastindex); charindex++) {
    if (numstates[charindex] == 0)
      totalfactors++;
    else
      totalfactors += numstates[charindex] - 1;
  }
  if (rooted && ancstrrequest)
    fprintf(outfile, "%5hd %5hd    A", neus + 1, totalfactors);
  else
    fprintf(outfile, "%5hd %5hd", neus, totalfactors);
  if (factorrequest)
    fprintf(outfile, " F\n");
  else
    fprintf(outfile, "\n");
  if (factorrequest)
    writefactors(&chposition);
  if (ancstrrequest)
    writeancestor(&chposition);
  eu = 1;
  while (eu <= neus) {
    eu++;
    doeu(&chposition,eu);
  }
  if (progress)
    printf("\nData matrix written on output file\n\n");
}  /* dodatamatrix */

main(argc, argv)
int argc;
Char *argv[];
{
char infilename[100],outfilename[100];
#ifdef MAC
  macsetup("Factor","");
  argv[0] = "Factor";
#endif
  openfile(&infile,INFILE,"r",argv[0],infilename);
  openfile(&outfile,OUTFILE,"w",argv[0],outfilename);

  getoptions();
  fscanf(infile, "%hd%hd%*[^\n]", &neus, &nchars);
  getc(infile);
  charnum = (short *)Malloc(nchars*sizeof(short));
  chstart = (short *)Malloc(nchars*sizeof(short));
  numstates = (short *)Malloc(nchars*sizeof(short));
  ancsymbol = (Char *)Malloc(nchars*sizeof(Char));
  dotrees();   /* Read and factor character-state trees */
  dodatamatrix();
  FClose(infile);
  FClose(outfile);
#ifdef MAC
  fixmacfile(outfilename);
#endif
  exit(0);
}  /* factor */

int eof(f)
FILE *f;
{
    register int ch;

    if (feof(f))
	return 1;
    if (f == stdin)
	return 0;
    ch = getc(f);
    if (ch == EOF)
	return 1;
    ungetc(ch, f);
    return 0;
}

int eoln(f)
FILE *f;
{
    register int ch;

    ch = getc(f);
    if (ch == EOF)
        return 1;
    ungetc(ch, f);
    return (ch == '\n');
}

void memerror()
{
printf("Error allocating memory\n");
exit(-1);
}

MALLOCRETURN *mymalloc(x)
long x;
{
MALLOCRETURN *mem;
mem = (MALLOCRETURN *)malloc(x);
if (!mem)
  memerror();
else
  return (MALLOCRETURN *)mem;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="windowBackground">#FFFFFF</color>
    <color name="titleTextColor">#FFFFFF</color>
    <color name="titleTabColor">#000000</color>
    <color name="titleSelectedTabColor">#3F51B5</color>
</resources>


text:
'use strict';

describe('Controller: LoginCtrl', function () {

  // load the controller's module
  beforeEach(module('dashboardApp'));

  var LoginCtrl, scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope) {
    scope = $rootScope.$new();
    LoginCtrl = $controller('LoginCtrl', {
      $scope: scope
    });
  }));

  it('should ...', function () {
    expect(1).toEqual(1);
  });
});


text:
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed 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.
// ------------------------------------------------------------------------

//! \addtogroup SpMat
//! @{

///////////////////////////////////////////////////////////////////////////////
// SpMat::iterator_base implementation                                       //
///////////////////////////////////////////////////////////////////////////////

template<typename eT>
inline
SpMat<eT>::iterator_base::iterator_base()
  : M(NULL)
  , internal_col(0)
  , internal_pos(0)
  {
  // Technically this iterator is invalid (it may not point to a real element)
  }

template<typename eT>
inline
SpMat<eT>::iterator_base::iterator_base(const SpMat<eT>& in_M)
  : M(&in_M)
  , internal_col(0)
  , internal_pos(0)
  {
  // Technically this iterator is invalid (it may not point to a real element)
  }

template<typename eT>
inline
SpMat<eT>::iterator_base::iterator_base(const SpMat<eT>& in_M, const uword in_col, const uword in_pos)
  : M(&in_M)
  , internal_col(in_col)
  , internal_pos(in_pos)
  {
  // Nothing to do.
  }

template<typename eT>
inline
arma_hot
eT
SpMat<eT>::iterator_base::operator*() const
  {
  return M->values[internal_pos];
  }

///////////////////////////////////////////////////////////////////////////////
// SpMat::const_iterator implementation                                      //
///////////////////////////////////////////////////////////////////////////////

template<typename eT>
inline
SpMat<eT>::const_iterator::const_iterator()
  : iterator_base()
  {
  }

template<typename eT>
inline
SpMat<eT>::const_iterator::const_iterator(const SpMat<eT>& in_M, uword initial_pos)
  : iterator_base(in_M, 0, initial_pos)
  {
  // Corner case for empty matrices.
  if(in_M.n_nonzero == 0)
    {
    iterator_base::internal_col = in_M.n_cols;
    return;
    }

  // Determine which column we should be in.
  while(iterator_base::M->col_ptrs[iterator_base::internal_col + 1] <= iterator_base::internal_pos)
    {
    iterator_base::internal_col++;
    }
  }

template<typename eT>
inline
SpMat<eT>::const_iterator::const_iterator(const SpMat<eT>& in_M, uword in_row, uword in_col)
  : iterator_base(in_M, in_col, 0)
  {
  // So we have a position we want to be right after.  Skip to the column.
  iterator_base::internal_pos = iterator_base::M->col_ptrs[iterator_base::internal_col];

  // Now we have to make sure that is the right column.
  while(iterator_base::M->col_ptrs[iterator_base::internal_col + 1] <= iterator_base::internal_pos)
    {
    iterator_base::internal_col++;
    }

  // Now we have to get to the right row.
  while((iterator_base::M->row_indices[iterator_base::internal_pos] < in_row) && (iterator_base::internal_col == in_col))
    {
    ++(*this); // Increment iterator.
    }
  }

template<typename eT>
inline
SpMat<eT>::const_iterator::const_iterator(const SpMat<eT>& in_M, const uword /* in_row */, const uword in_col, const uword in_pos)
  : iterator_base(in_M, in_col, in_pos)
  {
  // Nothing to do.
  }

template<typename eT>
inline
SpMat<eT>::const_iterator::const_iterator(const typename SpMat<eT>::const_iterator& other)
  : iterator_base(*other.M, other.internal_col, other.internal_pos)
  {
  // Nothing to do.
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_iterator&
SpMat<eT>::const_iterator::operator++()
  {
  ++iterator_base::internal_pos;

  if (iterator_base::internal_pos == iterator_base::M->n_nonzero)
    {
    iterator_base::internal_col = iterator_base::M->n_cols;
    return *this;
    }

  // Check to see if we moved a column.
  while (iterator_base::M->col_ptrs[iterator_base::internal_col + 1] <= iterator_base::internal_pos)
    {
    ++iterator_base::internal_col;
    }

  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_iterator
SpMat<eT>::const_iterator::operator++(int)
  {
  typename SpMat<eT>::const_iterator tmp(*this);

  ++(*this);

  return tmp;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_iterator&
SpMat<eT>::const_iterator::operator--()
  {
  //iterator_base::M.print("M");

  // printf("decrement from %d, %d, %d\n", iterator_base::internal_pos, iterator_base::internal_col, iterator_base::row());

  --iterator_base::internal_pos;

  // printf("now pos %d\n", iterator_base::internal_pos);

  // First, see if we moved back a column.
  while (iterator_base::internal_pos < iterator_base::M->col_ptrs[iterator_base::internal_col])
    {
    // printf("colptr %d (col %d)\n", iterator_base::M.col_ptrs[iterator_base::internal_col], iterator_base::internal_col);

    --iterator_base::internal_col;
    }

  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_iterator
SpMat<eT>::const_iterator::operator--(int)
  {
  typename SpMat<eT>::const_iterator tmp(*this);

  --(*this);

  return tmp;
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator==(const const_iterator& rhs) const
  {
  return (rhs.row() == (*this).row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator!=(const const_iterator& rhs) const
  {
  return (rhs.row() != (*this).row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator==(const typename SpSubview<eT>::const_iterator& rhs) const
  {
  return (rhs.row() == (*this).row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator!=(const typename SpSubview<eT>::const_iterator& rhs) const
  {
  return (rhs.row() != (*this).row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator==(const const_row_iterator& rhs) const
  {
  return (rhs.row() == (*this).row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator!=(const const_row_iterator& rhs) const
  {
  return (rhs.row() != (*this).row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator==(const typename SpSubview<eT>::const_row_iterator& rhs) const
  {
  return (rhs.row() == (*this).row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_iterator::operator!=(const typename SpSubview<eT>::const_row_iterator& rhs) const
  {
  return (rhs.row() != (*this).row()) || (rhs.col() != iterator_base::internal_col);
  }

///////////////////////////////////////////////////////////////////////////////
// SpMat::iterator implementation                                            //
///////////////////////////////////////////////////////////////////////////////

template<typename eT>
inline
arma_hot
SpValProxy<SpMat<eT> >
SpMat<eT>::iterator::operator*()
  {
  return SpValProxy<SpMat<eT> >(
    iterator_base::M->row_indices[iterator_base::internal_pos],
    iterator_base::internal_col,
    access::rw(*iterator_base::M),
    &access::rw(iterator_base::M->values[iterator_base::internal_pos]));
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::iterator&
SpMat<eT>::iterator::operator++()
  {
  const_iterator::operator++();
  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::iterator
SpMat<eT>::iterator::operator++(int)
  {
  typename SpMat<eT>::iterator tmp(*this);

  const_iterator::operator++();

  return tmp;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::iterator&
SpMat<eT>::iterator::operator--()
  {
  const_iterator::operator--();
  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::iterator
SpMat<eT>::iterator::operator--(int)
  {
  typename SpMat<eT>::iterator tmp(*this);

  const_iterator::operator--();

  return tmp;
  }

///////////////////////////////////////////////////////////////////////////////
// SpMat::const_row_iterator implementation                                  //
///////////////////////////////////////////////////////////////////////////////

/**
 * Initialize the const_row_iterator.
 */

template<typename eT>
inline
SpMat<eT>::const_row_iterator::const_row_iterator()
  : iterator_base()
  , internal_row(0)
  , actual_pos(0)
  {
  }

template<typename eT>
inline
SpMat<eT>::const_row_iterator::const_row_iterator(const SpMat<eT>& in_M, uword initial_pos)
  : iterator_base(in_M, 0, initial_pos)
  , internal_row(0)
  , actual_pos(0)
  {
  // Corner case for empty matrix.
  if(in_M.n_nonzero == 0)
    {
    iterator_base::internal_col = 0;
    internal_row = in_M.n_rows;
    return;
    }

  // We don't count zeros in our position count, so we have to find the nonzero
  // value corresponding to the given initial position.  We assume initial_pos
  // is valid.

  // This is irritating because we don't know where the elements are in each
  // row.  What we will do is loop across all columns looking for elements in
  // row 0 (and add to our sum), then in row 1, and so forth, until we get to
  // the desired position.
  uword cur_pos = std::numeric_limits<uword>::max(); // Invalid value.
  uword cur_row = 0;
  uword cur_col = 0;

  while(true) // This loop is terminated from the inside.
    {
    // Is there anything in the column we are looking at?
    for (uword ind = 0; ((iterator_base::M->col_ptrs[cur_col] + ind < iterator_base::M->col_ptrs[cur_col + 1]) && (iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind] <= cur_row)); ind++)
      {
      // There is something in this column.  Is it in the row we are looking at?
      const uword row_index = iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind];
      if (row_index == cur_row)
        {
        // Yes, it is what we are looking for.  Increment our current position.
        if (++cur_pos == iterator_base::internal_pos)   // TODO: HACK: if cur_pos is std::numeric_limits<uword>::max(), ++cur_pos relies on a wraparound/overflow, which is not portable
          {
          actual_pos = iterator_base::M->col_ptrs[cur_col] + ind;
          internal_row = cur_row;
          iterator_base::internal_col = cur_col;

          return;
          }

        // We are done with this column.  Break to the column incrementing code (directly below).
        break;
        }
      else if(row_index > cur_row)
        {
        break; // Can't be in this column.
        }
      }

    cur_col++; // Done with the column.  Move on.
    if (cur_col == iterator_base::M->n_cols)
      {
      // We are out of columns.  Loop back to the beginning and look on the
      // next row.
      cur_col = 0;
      cur_row++;
      }
    }
  }

template<typename eT>
inline
SpMat<eT>::const_row_iterator::const_row_iterator(const SpMat<eT>& in_M, uword in_row, uword in_col)
  : iterator_base(in_M, in_col, 0)
  , internal_row(0)
  , actual_pos(0)
  {
  // This is slow.  It needs to be rewritten.
  // So we have a destination we want to be just after, but don't know what position that is.  Make another iterator to find out...
  const_row_iterator it(in_M, 0);
  while((it.row() < in_row) || ((it.row() == in_row) && (it.col() < in_col)))
    {
    it++;
    }

  // Now that it is at the right place, take its position.
  iterator_base::internal_col = it.internal_col;
  iterator_base::internal_pos = it.internal_pos;
  internal_row = it.internal_row;
  actual_pos = it.actual_pos;
  }

/**
 * Initialize the const_row_iterator from another const_row_iterator.
 */
template<typename eT>
inline
SpMat<eT>::const_row_iterator::const_row_iterator(const typename SpMat<eT>::const_row_iterator& other)
  : iterator_base(*other.M, other.internal_col, other.internal_pos)
  , internal_row(other.internal_row)
  , actual_pos(other.actual_pos)
  {
  // Nothing to do.
  }

/**
 * Increment the row_iterator.
 */
template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_row_iterator&
SpMat<eT>::const_row_iterator::operator++()
  {
  // We just need to find the next nonzero element.
  iterator_base::internal_pos++;

  if(iterator_base::internal_pos == iterator_base::M->n_nonzero)
    {
    internal_row = iterator_base::M->n_rows;
    iterator_base::internal_col = 0;
    actual_pos = iterator_base::M->n_nonzero;

    return *this;
    }

  // Otherwise, we need to search.
  uword cur_col = iterator_base::internal_col;
  uword cur_row = internal_row;

  while (true) // This loop is terminated from the inside.
    {
    // Increment the current column and see if we are now on a new row.
    if (++cur_col == iterator_base::M->n_cols)
      {
      cur_col = 0;
      cur_row++;
      }

    // Is there anything in this new column?
    for (uword ind = 0; ((iterator_base::M->col_ptrs[cur_col] + ind < iterator_base::M->col_ptrs[cur_col + 1]) && (iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind] <= cur_row)); ind++)
      {
      if (iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind] == cur_row)
        {
        // We have successfully incremented.
        internal_row = cur_row;
        iterator_base::internal_col = cur_col;
        actual_pos = iterator_base::M->col_ptrs[cur_col] + ind;

        return *this; // Now we are done.
        }
      }
    }
  }

/**
 * Increment the row_iterator (but do not return anything.
 */
template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_row_iterator
SpMat<eT>::const_row_iterator::operator++(int)
  {
  typename SpMat<eT>::const_row_iterator tmp(*this);

  ++(*this);

  return tmp;
  }

/**
 * Decrement the row_iterator.
 */
template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_row_iterator&
SpMat<eT>::const_row_iterator::operator--()
  {
  iterator_base::internal_pos--;

  // We have to search backwards.
  uword cur_col = iterator_base::internal_col;
  uword cur_row = internal_row;

  while (true) // This loop is terminated from the inside.
    {
    // Decrement the current column and see if we are now on a new row.  This is a uword so a negativity check won't work.
    if (--cur_col > iterator_base::M->n_cols /* this means it underflew */)
      {
      cur_col = iterator_base::M->n_cols - 1;
      cur_row--;
      }

    // Is there anything in this new column?
    for (uword ind = 0; ((iterator_base::M->col_ptrs[cur_col] + ind < iterator_base::M->col_ptrs[cur_col + 1]) && (iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind] <= cur_row)); ind++)
      {
      if (iterator_base::M->row_indices[iterator_base::M->col_ptrs[cur_col] + ind] == cur_row)
        {
        // We have successfully decremented.
        iterator_base::internal_col = cur_col;
        internal_row = cur_row;
        actual_pos = iterator_base::M->col_ptrs[cur_col] + ind;

        return *this; // Now we are done.
        }
      }
    }
  }

/**
 * Decrement the row_iterator.
 */
template<typename eT>
inline
arma_hot
typename SpMat<eT>::const_row_iterator
SpMat<eT>::const_row_iterator::operator--(int)
  {
  typename SpMat<eT>::const_row_iterator tmp(*this);

  --(*this);

  return tmp;
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator==(const const_iterator& rhs) const
  {
  return (rhs.row() == row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator!=(const const_iterator& rhs) const
  {
  return (rhs.row() != row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator==(const typename SpSubview<eT>::const_iterator& rhs) const
  {
  return (rhs.row() == row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator!=(const typename SpSubview<eT>::const_iterator& rhs) const
  {
  return (rhs.row() != row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator==(const const_row_iterator& rhs) const
  {
  return (rhs.row() == row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator!=(const const_row_iterator& rhs) const
  {
  return (rhs.row() != row()) || (rhs.col() != iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator==(const typename SpSubview<eT>::const_row_iterator& rhs) const
  {
  return (rhs.row() == row()) && (rhs.col() == iterator_base::internal_col);
  }

template<typename eT>
inline
arma_hot
bool
SpMat<eT>::const_row_iterator::operator!=(const typename SpSubview<eT>::const_row_iterator& rhs) const
  {
  return (rhs.row() != row()) || (rhs.col() != iterator_base::internal_col);
  }

///////////////////////////////////////////////////////////////////////////////
// SpMat::row_iterator implementation                                        //
///////////////////////////////////////////////////////////////////////////////

template<typename eT>
inline
arma_hot
SpValProxy<SpMat<eT> >
SpMat<eT>::row_iterator::operator*()
  {
  return SpValProxy<SpMat<eT> >(
    const_row_iterator::internal_row,
    iterator_base::internal_col,
    access::rw(*iterator_base::M),
    &access::rw(iterator_base::M->values[const_row_iterator::actual_pos]));
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::row_iterator&
SpMat<eT>::row_iterator::operator++()
  {
  const_row_iterator::operator++();
  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::row_iterator
SpMat<eT>::row_iterator::operator++(int)
  {
  typename SpMat<eT>::row_iterator tmp(*this);

  const_row_iterator::operator++();

  return tmp;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::row_iterator&
SpMat<eT>::row_iterator::operator--()
  {
  const_row_iterator::operator--();
  return *this;
  }

template<typename eT>
inline
arma_hot
typename SpMat<eT>::row_iterator
SpMat<eT>::row_iterator::operator--(int)
  {
  typename SpMat<eT>::row_iterator tmp(*this);

  const_row_iterator::operator--();

  return tmp;
  }

//! @}