text:
/* */
System.register(["./lexer", "./ast"], function (_export) {
  var Lexer, Token, Expression, ArrayOfExpression, Chain, ValueConverter, Assign, Conditional, AccessScope, AccessMember, AccessKeyed, CallScope, CallFunction, CallMember, PrefixNot, Binary, LiteralPrimitive, LiteralArray, LiteralObject, LiteralString, _prototypeProperties, _classCallCheck, EOF, Parser, ParserImplementation;

  return {
    setters: [function (_lexer) {
      Lexer = _lexer.Lexer;
      Token = _lexer.Token;
    }, function (_ast) {
      Expression = _ast.Expression;
      ArrayOfExpression = _ast.ArrayOfExpression;
      Chain = _ast.Chain;
      ValueConverter = _ast.ValueConverter;
      Assign = _ast.Assign;
      Conditional = _ast.Conditional;
      AccessScope = _ast.AccessScope;
      AccessMember = _ast.AccessMember;
      AccessKeyed = _ast.AccessKeyed;
      CallScope = _ast.CallScope;
      CallFunction = _ast.CallFunction;
      CallMember = _ast.CallMember;
      PrefixNot = _ast.PrefixNot;
      Binary = _ast.Binary;
      LiteralPrimitive = _ast.LiteralPrimitive;
      LiteralArray = _ast.LiteralArray;
      LiteralObject = _ast.LiteralObject;
      LiteralString = _ast.LiteralString;
    }],
    execute: function () {
      "use strict";

      _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

      _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

      EOF = new Token(-1, null);
      Parser = _export("Parser", (function () {
        function Parser() {
          _classCallCheck(this, Parser);

          this.cache = {};
          this.lexer = new Lexer();
        }

        _prototypeProperties(Parser, null, {
          parse: {
            value: function parse(input) {
              input = input || "";

              return this.cache[input] || (this.cache[input] = new ParserImplementation(this.lexer, input).parseChain());
            },
            writable: true,
            configurable: true
          }
        });

        return Parser;
      })());
      ParserImplementation = _export("ParserImplementation", (function () {
        function ParserImplementation(lexer, input) {
          _classCallCheck(this, ParserImplementation);

          this.index = 0;
          this.input = input;
          this.tokens = lexer.lex(input);
        }

        _prototypeProperties(ParserImplementation, null, {
          peek: {
            get: function () {
              return this.index < this.tokens.length ? this.tokens[this.index] : EOF;
            },
            configurable: true
          },
          parseChain: {
            value: function parseChain() {
              var isChain = false,
                  expressions = [];

              while (this.optional(";")) {
                isChain = true;
              }

              while (this.index < this.tokens.length) {
                if (this.peek.text === ")" || this.peek.text === "}" || this.peek.text === "]") {
                  this.error("Unconsumed token " + this.peek.text);
                }

                var expr = this.parseValueConverter();
                expressions.push(expr);

                while (this.optional(";")) {
                  isChain = true;
                }

                if (isChain && expr instanceof ValueConverter) {
                  this.error("cannot have a value converter in a chain");
                }
              }

              return expressions.length === 1 ? expressions[0] : new Chain(expressions);
            },
            writable: true,
            configurable: true
          },
          parseValueConverter: {
            value: function parseValueConverter() {
              var result = this.parseExpression();

              while (this.optional("|")) {
                var name = this.peek.text,
                    // TODO(kasperl): Restrict to identifier?
                args = [];

                this.advance();

                while (this.optional(":")) {
                  // TODO(kasperl): Is this really supposed to be expressions?
                  args.push(this.parseExpression());
                }

                result = new ValueConverter(result, name, args, [result].concat(args));
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          parseExpression: {
            value: function parseExpression() {
              var start = this.peek.index,
                  result = this.parseConditional();

              while (this.peek.text === "=") {
                if (!result.isAssignable) {
                  var end = this.index < this.tokens.length ? this.peek.index : this.input.length;
                  var expression = this.input.substring(start, end);

                  this.error("Expression " + expression + " is not assignable");
                }

                this.expect("=");
                result = new Assign(result, this.parseConditional());
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          parseConditional: {
            value: function parseConditional() {
              var start = this.peek.index,
                  result = this.parseLogicalOr();

              if (this.optional("?")) {
                var yes = this.parseExpression();

                if (!this.optional(":")) {
                  var end = this.index < this.tokens.length ? this.peek.index : this.input.length;
                  var expression = this.input.substring(start, end);

                  this.error("Conditional expression " + expression + " requires all 3 expressions");
                }

                var no = this.parseExpression();
                result = new Conditional(result, yes, no);
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          parseLogicalOr: {
            value: function parseLogicalOr() {
              var result = this.parseLogicalAnd();

              while (this.optional("||")) {
                result = new Binary("||", result, this.parseLogicalAnd());
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          parseLogicalAnd: {
            value: function parseLogicalAnd() {
              var result = this.parseEquality();

              while (this.optional("&&")) {
                result = new Binary("&&", result, this.parseEquality());
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          parseEquality: {
            value: function parseEquality() {
              var result = this.parseRelational();

              while (true) {
                if (this.optional("==")) {
                  result = new Binary("==", result, this.parseRelational());
                } else if (this.optional("!=")) {
                  result = new Binary("!=", result, this.parseRelational());
                } else if (this.optional("===")) {
                  result = new Binary("===", result, this.parseRelational());
                } else if (this.optional("!==")) {
                  result = new Binary("!==", result, this.parseRelational());
                } else {
                  return result;
                }
              }
            },
            writable: true,
            configurable: true
          },
          parseRelational: {
            value: function parseRelational() {
              var result = this.parseAdditive();

              while (true) {
                if (this.optional("<")) {
                  result = new Binary("<", result, this.parseAdditive());
                } else if (this.optional(">")) {
                  result = new Binary(">", result, this.parseAdditive());
                } else if (this.optional("<=")) {
                  result = new Binary("<=", result, this.parseAdditive());
                } else if (this.optional(">=")) {
                  result = new Binary(">=", result, this.parseAdditive());
                } else {
                  return result;
                }
              }
            },
            writable: true,
            configurable: true
          },
          parseAdditive: {
            value: function parseAdditive() {
              var result = this.parseMultiplicative();

              while (true) {
                if (this.optional("+")) {
                  result = new Binary("+", result, this.parseMultiplicative());
                } else if (this.optional("-")) {
                  result = new Binary("-", result, this.parseMultiplicative());
                } else {
                  return result;
                }
              }
            },
            writable: true,
            configurable: true
          },
          parseMultiplicative: {
            value: function parseMultiplicative() {
              var result = this.parsePrefix();

              while (true) {
                if (this.optional("*")) {
                  result = new Binary("*", result, this.parsePrefix());
                } else if (this.optional("%")) {
                  result = new Binary("%", result, this.parsePrefix());
                } else if (this.optional("/")) {
                  result = new Binary("/", result, this.parsePrefix());
                } else {
                  return result;
                }
              }
            },
            writable: true,
            configurable: true
          },
          parsePrefix: {
            value: function parsePrefix() {
              if (this.optional("+")) {
                return this.parsePrefix(); // TODO(kasperl): This is different than the original parser.
              } else if (this.optional("-")) {
                return new Binary("-", new LiteralPrimitive(0), this.parsePrefix());
              } else if (this.optional("!")) {
                return new PrefixNot("!", this.parsePrefix());
              } else {
                return this.parseAccessOrCallMember();
              }
            },
            writable: true,
            configurable: true
          },
          parseAccessOrCallMember: {
            value: function parseAccessOrCallMember() {
              var result = this.parsePrimary();

              while (true) {
                if (this.optional(".")) {
                  var name = this.peek.text; // TODO(kasperl): Check that this is an identifier. Are keywords okay?

                  this.advance();

                  if (this.optional("(")) {
                    var args = this.parseExpressionList(")");
                    this.expect(")");
                    result = new CallMember(result, name, args);
                  } else {
                    result = new AccessMember(result, name);
                  }
                } else if (this.optional("[")) {
                  var key = this.parseExpression();
                  this.expect("]");
                  result = new AccessKeyed(result, key);
                } else if (this.optional("(")) {
                  var args = this.parseExpressionList(")");
                  this.expect(")");
                  result = new CallFunction(result, args);
                } else {
                  return result;
                }
              }
            },
            writable: true,
            configurable: true
          },
          parsePrimary: {
            value: function parsePrimary() {
              if (this.optional("(")) {
                var result = this.parseExpression();
                this.expect(")");
                return result;
              } else if (this.optional("null") || this.optional("undefined")) {
                return new LiteralPrimitive(null);
              } else if (this.optional("true")) {
                return new LiteralPrimitive(true);
              } else if (this.optional("false")) {
                return new LiteralPrimitive(false);
              } else if (this.optional("[")) {
                var elements = this.parseExpressionList("]");
                this.expect("]");
                return new LiteralArray(elements);
              } else if (this.peek.text == "{") {
                return this.parseObject();
              } else if (this.peek.key != null) {
                return this.parseAccessOrCallScope();
              } else if (this.peek.value != null) {
                var value = this.peek.value;
                this.advance();
                return isNaN(value) ? new LiteralString(value) : new LiteralPrimitive(value);
              } else if (this.index >= this.tokens.length) {
                throw new Error("Unexpected end of expression: " + this.input);
              } else {
                this.error("Unexpected token " + this.peek.text);
              }
            },
            writable: true,
            configurable: true
          },
          parseAccessOrCallScope: {
            value: function parseAccessOrCallScope() {
              var name = this.peek.key;

              this.advance();

              if (!this.optional("(")) {
                return new AccessScope(name);
              }

              var args = this.parseExpressionList(")");
              this.expect(")");
              return new CallScope(name, args);
            },
            writable: true,
            configurable: true
          },
          parseObject: {
            value: function parseObject() {
              var keys = [],
                  values = [];

              this.expect("{");

              if (this.peek.text !== "}") {
                do {
                  // TODO(kasperl): Stricter checking. Only allow identifiers
                  // and strings as keys. Maybe also keywords?
                  var value = this.peek.value;
                  keys.push(typeof value === "string" ? value : this.peek.text);

                  this.advance();
                  this.expect(":");

                  values.push(this.parseExpression());
                } while (this.optional(","));
              }

              this.expect("}");

              return new LiteralObject(keys, values);
            },
            writable: true,
            configurable: true
          },
          parseExpressionList: {
            value: function parseExpressionList(terminator) {
              var result = [];

              if (this.peek.text != terminator) {
                do {
                  result.push(this.parseExpression());
                } while (this.optional(","));
              }

              return result;
            },
            writable: true,
            configurable: true
          },
          optional: {
            value: function optional(text) {
              if (this.peek.text === text) {
                this.advance();
                return true;
              }

              return false;
            },
            writable: true,
            configurable: true
          },
          expect: {
            value: function expect(text) {
              if (this.peek.text === text) {
                this.advance();
              } else {
                this.error("Missing expected " + text);
              }
            },
            writable: true,
            configurable: true
          },
          advance: {
            value: function advance() {
              this.index++;
            },
            writable: true,
            configurable: true
          },
          error: {
            value: function error(message) {
              var location = this.index < this.tokens.length ? "at column " + (this.tokens[this.index].index + 1) + " in" : "at the end of the expression";

              throw new Error("Parser Error: " + message + " " + location + " [" + this.input + "]");
            },
            writable: true,
            configurable: true
          }
        });

        return ParserImplementation;
      })());
    }
  };
});


text:
package com.taro;

import junit.framework.Assert;

import org.junit.Test;

public class FactorialTest {

	@Test
	public void testFactorial1() {
		Factorial fact = new Factorial();
		Assert.assertEquals(1, fact.factorial(0));
		Assert.assertEquals(1, fact.factorial(1));
		Assert.assertEquals(6, fact.factorial(3));
		Assert.assertEquals(120, fact.factorial(5));
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<!-- Iron elements -->
<link rel="import" href="../bower_components/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../bower_components/iron-pages/iron-pages.html">
<link rel="import" href="../bower_components/iron-selector/iron-selector.html">

<!-- Paper elements -->
<link rel="import" href="../bower_components/paper-drawer-panel/paper-drawer-panel.html">
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../bower_components/paper-item/paper-item.html">
<link rel="import" href="../bower_components/paper-material/paper-material.html">
<link rel="import" href="../bower_components/paper-menu/paper-menu.html">
<link rel="import" href="../bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html">
<link rel="import" href="../bower_components/paper-styles/paper-styles-classes.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<link rel="import" href="../bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/platinum-sw/platinum-sw-register.html">
<link rel="import" href="../bower_components/platinum-sw/platinum-sw-cache.html">

<!-- Uncomment next block to enable Service Worker Support (2/2) -->

<link rel="import" href="../bower_components/platinum-sw/platinum-sw-cache.html">
<link rel="import" href="../bower_components/platinum-sw/platinum-sw-register.html">

<!-- Configure your routes here -->
<link rel="import" href="routing.html">

<!-- Add your elements here -->
<link rel="import" href="../styles/app-theme.html">
<link rel="import" href="../styles/shared-styles.html">
<link rel="import" href="my-greeting/my-greeting.html">
<link rel="import" href="my-list/my-list.html">
<link rel="import" href="tech-card/tech-card.html">
<link rel="import" href="kit-info/kit-info.html">
<link rel="import" href="fw-info/fw-info.html">
<link rel="import" href="flash-page/flash-page.html">
<link rel="import" href="flash-options/flash-options.html">
<link rel="import" href="flash-dialog/flash-dialog.html">
<link rel="import" href="vin-dialog/vin-dialog.html">
<link rel="import" href="home-screen/home-screen.html">
<link rel="import" href="menu-card/menu-card.html">


text:
"""Logging tensorflow::tfprof::OpLog.

OpLog is used to add extra model information for offline analysis by tfprof.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os

import tensorflow as tf
from tensorflow.contrib.tfprof.python.tools.tfprof import tfprof_log_pb2
from tensorflow.python.framework import ops

TRAINABLE_VARIABLES = '_trainable_variables'
REGISTERED_FLOP_STATS = 'flops'

def _get_logged_ops(graph):
  """Extract trainable model parameters and FLOPs for ops from a Graph.

  Args:
    graph: tf.Graph.
  Returns:
    logged_ops: dict mapping from op_name to OpLogEntry.
  """
  logged_ops = {}

  graph_def = graph.as_graph_def()
  for node in graph_def.node:
    try:
      stats = ops.get_stats_for_node_def(graph, node, REGISTERED_FLOP_STATS)
    except ValueError:
      # Catch Exception When shape is incomplete. Skip it.
      stats = None

    if not stats or not stats.value:
      continue
    if node.name not in logged_ops:
      entry = tfprof_log_pb2.OpLogEntry()
      entry.name = node.name
      entry.float_ops = stats.value
      logged_ops[entry.name] = entry

  for v in graph.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES):
    if v.op.name not in logged_ops:
      entry = tfprof_log_pb2.OpLogEntry()
      entry.name = v.op.name
      entry.types.append(TRAINABLE_VARIABLES)
      logged_ops[entry.name] = entry
    else:
      logged_ops[v.op.name].types.append(TRAINABLE_VARIABLES)
  return logged_ops

def _merge_default_with_oplog(graph, op_log=None):
  """Merge the tfprof default extra info with caller's op_log.

  Args:
    graph: tf.Graph.
    op_log: OpLog proto.
  Returns:
    tmp_op_log: Merged OpLog proto.
  """
  tmp_op_log = tfprof_log_pb2.OpLog()
  logged_ops = _get_logged_ops(graph)
  if not op_log:
    tmp_op_log.log_entries.extend(logged_ops.values())
  else:
    all_ops = dict()
    for entry in op_log.log_entries:
      all_ops[entry.name] = entry
    for op_name, entry in logged_ops.iteritems():
      if op_name in all_ops:
        all_ops[op_name].types.extend(entry.types)
        if entry.float_ops > 0 and all_ops[op_name].float_ops == 0:
          all_ops[op_name].float_ops = entry.float_ops
      else:
        all_ops[op_name] = entry
    tmp_op_log.log_entries.extend(all_ops.values())
  return tmp_op_log

def write_op_log(graph, log_dir, op_log=None):
  """Log provided 'op_log', and add additional model information below.

    The API also assigns ops in tf.trainable_variables() an op type called
    '_trainable_variables'.
    The API also logs 'flops' statistics for ops with op.RegisterStatistics()
    defined.

  Args:
    graph: tf.Graph.
    log_dir: directory to write the log file.
    op_log: OpLog proto.
  """
  op_log = _merge_default_with_oplog(graph, op_log)

  with tf.gfile.Open(os.path.join(log_dir, 'tfprof_log'), 'w') as log:
    log.write(op_log.SerializeToString())


text:
<?php

/**
 *
 *
 * @author <marcus@silverstripe.com.au>
 * @license BSD License http://www.silverstripe.org/bsd-license
 */
class DataObjectXmlConverter {
	public function convert(DataObject $object) {
		if ($object->hasMethod('toFilteredMap')) {
			$data = $object->toFilteredMap();
		} else {
			$data = $object->toMap();
		}

		$converter = new ArrayToXml('item');
		return $converter->convertArray($data);
	}
}


text:
import React, { useCallback, useState } from 'react';
import {
  Slide,
  SlideProps,
  Snackbar,
  SnackbarCloseReason,
  SnackbarProps,
  Alert,
  AlertProps,
  Card,
} from '@mui/material';

function SlideTransition(props: SlideProps) {
  return <Slide {...props} direction="up" />;
}

export function useToast() {
  const [isOpen, setIsOpen] = useState(false);
  const [message, setMessage] = useState<React.ReactNode>('');

  const handleClose = useCallback((reason: SnackbarCloseReason) => {
    setIsOpen(false);
  }, []);

  const showToast = useCallback((message: React.ReactNode) => {
    setMessage(message);
    setIsOpen(true);
  }, []);

  return {
    isOpen,
    message,
    handleClose,
    showToast,
  };
}

export function useErrorToast(): {
  showErrorToast: (message: React.ReactNode) => void;
  toastProps: ToastProps;
} {
  const { handleClose, isOpen, message, showToast } = useToast();

  const showErrorToast = useCallback(
    (message: React.ReactNode) => {
      showToast(message);
    },
    [showToast]
  );

  return {
    toastProps: {
      message,
      onClose: handleClose,
      open: isOpen,
      severity: 'error',
    },
    showErrorToast,
  };
}

interface ToastProps {
  open: SnackbarProps['open'];
  message: React.ReactNode;
  severity: AlertProps['severity'];
  onClose: (reason: SnackbarCloseReason) => void;
}

export function Toast({ onClose, open, message, severity }: ToastProps) {
  const handleClose = useCallback(
    (
      event: Event | React.SyntheticEvent<any, Event>,
      reason: SnackbarCloseReason
    ) => {
      onClose?.(reason);
    },
    [onClose]
  );

  return (
    <Snackbar
      open={open}
      onClose={handleClose}
      autoHideDuration={5000}
      TransitionComponent={SlideTransition}
    >
      <Card elevation={10}>
        <Alert severity={severity} variant="filled">
          {message}
        </Alert>
      </Card>
    </Snackbar>
  );
}


text:
{% extends '/comprayventa/html.html' %}
 {% load static %}
  <!DOCTYPE html>

 <meta charset="UTF-8">

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="shortcut icon" href="{% static 'Iconodeautos.jpg' %}">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

    <title>Detalles</title>

{% block content %}
        {% for post in posts %}

                    {{ post.published_date }}

{{ post.title }}

{{ post.text|linebreaksbr }}

        {% endfor %}
    {% endblock content %}


text:
\chapter{Reference Implementation}

\section{Overview}

The program in this project plays the role of the code breaker. The goal is to find out the secret using as few guesses as possible. The program supports both the Mastermind rules and the GuessNumber rules, subject to the following limits:

Maximum number of colors (defined by MM\_MAX\_COLORS): 10.

Maximum number of pegs (defined by MM\_MAX\_PEGS): 6.

Program Optimization Techniques

While the code-breaking algorithms are quite straightforward, much effort of this project has been put to optimize the performance of a real-time code breaker. Some of the hot-spots are identified by the profiler. The major points of optimization are described below. Most of the optimized routines are implemented in standalone source files for clarity.

Search space pruning. While all codewords are candidates for making a guess, some of them are equivalent in terms of bringing new information. For example, in the first round of a Number Guessing game, any guess works the same. Aware of this, we implement pruning by classifying digits into three classes: impossible, unguessed, and the rest. After each round of feedback, we update the list of distinct guesses (in terms of bringing information) and search within this list only. This reduces the search space significantly.

Codeword comparison. This is the most intensive operation in the program, accounting for 40\% of all CPU time. The program uses SSE2 instructions (implemented via compiler intrinsics) to compare each pair of codewords in four instructions.

Feedback frequency counting. The heuristic code breaker relies heavily on these routines to count statistics on partitions. This is an intensive operation which accounts for about 20\% of all CPU time. The program uses an ASM implementation to maximize performance. See Frequency.cpp.

\section{Data Structure}

\subsection{Codeword}

\subsection{Feedback}

\subsection{Strategy Tree}

\section{Basic operations}

\subsection{Codeword comparison}

\subsection{Frequency table generation}

\subsection{Codeword set partitioning}

\section{Implementing Heuristic Strategies}

 Obvious guesses

\section{Implementing Optimal Strategies}

\section{Implementing randomized strategies}


text:
module DrawExt
  module Include

  public
    def draw_gauge_base(*args)
      DrawExt.draw_gauge_base(bitmap, *args)
    end

    def draw_gauge_bar(*args)
      DrawExt.draw_gauge_bar(bitmap, *args)
    end

    def draw_gauge_ext(*args)
      DrawExt.draw_gauge_ext(bitmap, *args)
    end

    def draw_gauge_ext_wtxt(*args)
      DrawExt.draw_gauge_ext_wtxt(bitmap, *args)
    end
  end
end


text:
{-@ LIQUID "--expect-any-error" @-}
module Vector1a () where

import Language.Haskell.Liquid.Prelude
import Data.Vector hiding (map, concat, zipWith, filter, foldr, foldl, (++))

-- HA this needs a non-TOP spec due to contravariance...
foo = (Data.Vector.!)

for :: Int -> Int -> a -> (Int -> a -> a) -> a
for lo hi acc f
  | lo <= hi   = for (lo + 1) hi (f lo acc) f
  | otherwise = acc

dotProd       :: Vector Int -> Vector Int -> Int
dotProd v1 v2 = for 0 n 0 $ \i -> (((v1!i) * (v2!i)) +)
  where n = Data.Vector.length v1

sumSquare   :: Vector Int -> Int
sumSquare v = dotProd v v

total = sumSquare $ Data.Vector.fromList [0..100]


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

 -->

<!--  These resources are around just to allow their values to be customized
     for different hardware and product builds.  -->

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string-array name="wfcOperatorErrorAlertMessages">
    <item msgid="3177110876268966">"Da biste telefonirali i slali poruke putem Wi-Fi-ja, od mobilnog operatera morate tražiti da vam postavi tu uslugu. Zatim ponovo uključite Wi-Fi pozive u postavkama."</item>
  </string-array>
  <string-array name="wfcOperatorErrorNotificationMessages">
    <item msgid="5743977848030289234">"Registrirajte se kod mobilnog operatera"</item>
  </string-array>
    <string name="wfcSpnFormat" msgid="1221554601313232001">"%s Wi-Fi pozivi"</string>
</resources>


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

/// <summary>
/// There can be multiple ones.
///
/// Shouldnt have another waypoint on this object
/// </summary>
class StartingWaypoint : Waypoint {

    void Start() {
        StartCoroutine(DrawPath());

    }

    public IEnumerator DrawPath() {
        while (true) {
            yield return DrawAllConnections(0);
            yield return new WaitForSeconds(1);
        }
    }
}


text:
This repo will contain all sorts of scripts for usage on [Mafia2-Online](http://mafia2-online.com/).

If you find anything useful here then just go ahead and take it, use it for whatever you want. I'm pushing and sharing them here for others to use and build neat things with.

## License
Everything in this repo is licensed under MIT license.


text:
MyFirstHelloWorld
=================

this is a hello world program .It just a test


text:
(function() {
    var __WS_send = WebSocket.prototype.send;
    window.__WS_send = WebSocket.prototype.send;

    WebSocket.prototype.send = function(data) {
        var websocketURL = this.url;

        console.log(websocketURL);

        try {
            var agarBaseURL = 'http://agar.io/?sip=';
            var agarConnectedHost = /[^:\/]+\.agar\.io/.exec(websocketURL);

            console.log(agarBaseURL + agarConnectedHost[0]);
        } catch (err) {
            console.error(err.message);
        }

        try {
            __WS_send.apply(this, [data]);
            WebSocket.prototype.send = __WS_send;
        } catch (err) {
            window.__WS_send.apply(this, [data]);
            WebSocket.prototype.send = window.__WS_send;
        }
    }
})();


text:
import * as Router from 'koa-router';

const router = new Router();

/* GET api listing. */
router.get('/', async (ctx) => {
  ctx.status = 200;
  ctx.body = {
    msg: "api works!"
  }
});

export const api = router;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Michelia 2(no. 8): 623 (1882)

#### Original name
Diplodia clandestina f. folicrum Sacc.

### Remarks
null


text:
namespace WpfMdiApp1.CIL
{
    public enum MessageType { Loaded }

    public class Message
    {
        public MessageType MessageType { get; private set; }

        public object MessageBody { get; private set; }

        public Message(MessageType type, object body)
        {
            MessageType = type;
            MessageBody = body;
        }

        public Message(MessageType type)
        {
            MessageType = type;
        }
    }
}


text:
import { select } from 'd3-selection';
import test from 'tape-catch';

// needed to handle Babel's conversion of for `(x of array)`
// import 'babel-polyfill';

import LineUp from '..';

test('LineUp component', t => {
  const div = document.createElement('div');
  div.setAttribute('style', 'width: 800px; height: 600px');
  document.body.appendChild(div);

  t.ok(LineUp, 'LineUp exists');
  t.ok(LineUp.options, 'LineUp options exists');
  let lu = new LineUp(div, {
    data: [
      {a: 1, b: 2, c: 'a', d: true},
      {a: 3, b: 4, c: 'b', d: false},
      {a: -1, b: 0, c: 'c', d: false}
    ],
    fields: ['d', 'a', 'c'],
    stacked: true,
    histograms: true,
    animation: false
  });
  t.ok(lu.lineUpConfig, 'LineUp configured');
  t.equal(lu.lineUpConfig.renderingOptions.histograms, true, 'LineUp options set');
  lu.render();
  t.ok(lu.lineupInstances.main, 'LineUp rendered');
  // still need to add tests for dragging columns and recording their weights,
  // tooltip updates, select callback, and date-based columns

  window.setTimeout(() => {
    const rows = select(lu.el)
      .selectAll('g.row')
      .nodes();
    t.assert(rows.length > 0, 'Plot has rendered some data rows');

    t.end();
  }, 200);
});


text:
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;

describe('trailing slashes in path names, issue 105', function() {
  beforeEach(util.setup);
  afterEach(util.cleanup);

  it('should deal with trailing slashes properly, path == path/', function(done) {
    var fs = util.fs();

    fs.mkdir('/tmp', function(err) {
      if(err) throw err;

      fs.mkdir('/tmp/foo', function(err) {
        if(err) throw err;

        // Without trailing slash
        fs.readdir('/tmp', function(err, result1) {
          if(err) throw err;
          expect(result1).to.exist;
          expect(result1.length).to.equal(1);

          // With trailing slash
          fs.readdir('/tmp/', function(err, result2) {
            if(err) throw err;
            expect(result2).to.exist;
            expect(result2[0]).to.equal('foo');
            expect(result1).to.deep.equal(result2);
            done();
          });
        });
      });
    });
  });
});


text:
testnames=simple
tests=$(addprefix test_, $(testnames))
trash=.trash/

all: ucat

test: clean ucat ${tests}
	@echo ${tests}
	@echo "*** tests passed ***"

# not sue why this doesn't work:
# test_%: test_%.sh
test_simple: test_simple.sh
	@echo "*** running $@ ***"
	./$@.sh

clean:
	@echo "*** $@ ***"
	-rm -r ${trash}

deps: random ucat

ucat:
	go build

random:
	@echo "*** installing $@ ***"
	go get github.com/jbenet/go-random/random
	go build -o random github.com/jbenet/go-random/random

.PHONY: clean ucat ${tests}


text:
layout: talk
title: How to look at psychoanalysis?
description: "Seminar presentation on Adorno's use of psychoanalysis"
author:
    name: Maarten Steenhagen
    url: http://msteenhagen.github.io
paper: How to look at psychoanalysis?
where: "Adorno: Art & Politics, UCL"
city: London
<!-- time: -->
<!-- link:  -->
<!-- handout:  -->
<!-- slides:  -->
<!-- details: true -->
---

What I focus on here is one of Adorno's methods of cultural and social criticism: classical Freudian psychoanalysis. What has Adorno to do with Freud? First I sketch the theory, and after that I look at what Adorno says about TV-shows, to bring out the practical side of it.


text:
class NetMsg
{
	size_t mSize = 0;
public:
	std::vector<std::string> mDatas;

	// deserialize only methods
	enum State { NONE, PART, OK, ERROR, } mState = NONE;
	size_t deserialize(char const * buf, size_t buf_size);
	size_t getSize() const; // only when deserialize

	// serialize only methods
	void push(std::string const & data);
	size_t serialize(std::vector<char> & buf);
	size_t calcSize() const;

	void clear();
};


text:
using System.ComponentModel.DataAnnotations;

namespace Umbraco.Cms.Core.PropertyEditors.Validation;

/// <summary>
///     A collection of <see cref="ValidationResult" /> for a property type within a complex editor represented by an
///     Element Type
/// </summary>
/// <remarks>
///     For a more indepth explanation of how server side validation works with the angular app, see this GitHub PR:
///     https://github.com/umbraco/Umbraco-CMS/pull/8339
/// </remarks>
public class ComplexEditorPropertyTypeValidationResult : ValidationResult
{
    private readonly List<ValidationResult> _validationResults = new();

    public ComplexEditorPropertyTypeValidationResult(string propertyTypeAlias)
        : base(string.Empty) =>
        PropertyTypeAlias = propertyTypeAlias;

    public IReadOnlyList<ValidationResult> ValidationResults => _validationResults;

    public string PropertyTypeAlias { get; }

    public void AddValidationResult(ValidationResult validationResult)
    {
        if (validationResult is ComplexEditorValidationResult &&
            _validationResults.Any(x => x is ComplexEditorValidationResult))
        {
            throw new InvalidOperationException($"Cannot add more than one {typeof(ComplexEditorValidationResult)}");
        }

        _validationResults.Add(validationResult);
    }
}


text:
Change Log
===

v2.4.2
---
* [bug] remove npm-shrinkwrap.json from the published package

v2.4.0
---
* Upgraded Typescript compiler to 1.5.3
* [bugs] #332, #493, #509, #483
* [bug] fix error message in `no-var-keyword` rule
* [enhancement] CI tests are now run on node v0.12 in addition to v0.10
* **BREAKING**
	* `-f` option removed from CLI

v2.3.1-beta
---
* [bugs] #137 #434 #451 #456
* [new-rule] `no-require-imports` disallows `require()` style imports
* [new-rule] `no-shadowed-variable` moves over shadowed variable checking from `no-duplicate-variable` into its own rule
* **BREAKING**
	* `no-duplicate-variable` now only checks for duplicates within the same block scope; enable `no-shadowed-variable` to get duplicate-variable checking across block scopes
* [enhancement] `no-duplicate-variable`, `no-shadowed-variable`, and `no-use-before-declare` now support ES6 destructuring
* [enhancement] tslint CLI now uses a default configuration if no config file is found

v2.3.0-beta
---
* [bugs] #401 #367 #324 #352
* [new-rule] `no-var-keyword` disallows `var` in favor of `let` and `const`
* [new-rule] `sort-object-literal-keys` forces object-literal keys to be sorted alphabetically
* Add support for ES6 destructuring and module syntax (affects `variable-name`, `no-use-before-declare`, `whitespace` and `no-unused-variable`)
* Add support for ES6 for-of and spread operator syntax
* Use tsconfig.json & JSCS in the build system

v2.2.0-beta
---
* Upgraded Typescript compiler to 1.5.0-beta
* **BREAKING CHANGES**
	* due to changes to the typescript compiler API, old custom rules may no longer work and may need to be rewritten
	* the JSON formatter's line and character positions are now back to being 0-indexed instead of 1-indexed
* [bugs] #328 #334 #319 #351 #365 #254
* [bug] fixes for tslint behavior around template strings (fixes #357, #349, #332, and more)
* [new-rule] `align` rule now enforces vertical alignment on parameters, arguments, and statements
* [new-rule] `switch-default` enforces a `default` case in `switch` statements
* [feature] `no-duplicate-variable` rule now additionally checks if function parameters have been shadowed
* Additional fixes to existing rules to work as before with the typescript 1.5 compiler

v2.1.1
---
* [bugs] #292 #293 #295 #301 #302
* Some internal refactoring
* Added Windows CI testing (appveyor)

v2.1.0
---
* Fix crash on Windows

v2.0.1
---
* Upgraded Typescript compiler to 1.4
* **BREAKING CHANGES**
	* typedef rule options were modified:
		* index-signature removed as no longer necessary
		* property-signature renamed to property-declaration
		* variable-declarator renamed to variable-declaration
		* member-variable-declarator renamed to member-variable-declaration
	* typedef-whitespace rule options were modified:
		* catch-clause was removed as invalid
		* further options were added, see readme for more details
	* due to changes to the typescript compiler API, old custom rules may no longer work and may need to be rewritten
	* the JSON formatter's line and character positions are now 1-indexed instead of 0-indexed

v1.2.0
---
* [bug] #245

v1.0.1
---
* [bug] #238

v1.0.0
---
* upgrade TypeScript compiler to 1.3
* **BREAKING CHANGES**
	* all error messages now start with a lower-case character and do not end with a period
	* all rule options are consistent in nomenclature. The `typedef` and `typedef-whitespace` rules now take in hyphenated options
	* `unused-variables` rule cannot find unused private variables defined in the constructor due to a bug in 1.3 compiler
	* `indent` rule has changed to only check for tabs or spaces and not enforce indentation levels

v0.4.12
---
* multiple files with -f on cli
* config file search starts with input file

v0.4.11
---
* [bugs] #136, #163
* internal refactors

v0.4.10
---
* [bugs] #138, #145, #146, #148

v0.4.9
---
* [new-rule] `no-any` disallows all uses of `any`
* [bug] `/* tslint:disable */` now disables semicolon rule as well
* [bug] delete operator no longer results in a false positive for `no-unused-expression`

v0.4.8
---
* [new-rule] `no-var-requires` disallows require statements not part of an import statement
* [new-rule] `typedef` rule also checks for member variables
* [bug] `no-unused-variable` no longer triggers false positives for class members labeled only `static`
* [bug] `no-unused-expression` no longer triggers false positives for `"use strict";` expressions
* [bug] `use-strict` works correctly on function declarations
* [bug] config file is now discoverable from other drives on Windows

v0.4.7
---
* [new-rule] added `no-unused-expression` rule which disallows unused expression statements
* [feature] the `check-operator` option for the `whitespace` rule now checks whitespace around the => token
* [bug] `no-use-before-declare-rule` no longer triggers false positives for member variables of classes used before the class is declared
* [bug] semicolon at end of file no longer triggers false positives for `whitespace` rule
* [bug] hoisted functions no longer cause false positives for the `no-unreachable` rule
* [bug] the rule loader no longer transforms/ignores the leading and trailing underscores and dashes of rule names in the config file
* [bug] `export import` statements no longer false positives for `no-unused-variable-rule`
* [docs] added documentation for creating custom rules and formatters
* [docs] added sample `tslint.json` file, under `docs/sample.tslint.json`

v0.4.6
---
* [build] migrated build to use `grunt-ts` instead of `grunt-typescript`
* [feature] `package.json` now contains a `tslintConfig` paramater to allow users to specify the location of the configuration file there
* [feature] tslint now searches for the configuration file in the user's home directory if not found in the current path
* [bug] unbraced conditionals no longer cause false positives for the `no-unreachable` rule

v0.4.5
---
* [feature] `no-unused-variable` no longer checks parameters by defualt. Parameters are now only checked if the `check-parameters` option is set.
* [bug] `no-unused-variable` parameter check no longer fails on variable argument parameters (like ...args) and on cases where the parameters are broken up by newlines.

v0.4.4
---
* [bug] `no-unused-variable` validates function parameters and constructor methods
* [bug] `no-empty` and `no-trailing-comma` rules handle empty objects

v0.4.3
---
* [new-rule] `no-unused-variable`
* [new-rule] `no-trailing-comma`
* [new-rule] `no-use-before-declare`
* [feature] support `--version` in CLI
* [feature] expose rule names to custom formatters
* [feature] add `verbose` formatter
* [bug] `no-empty` allows constructors with member declaration parameters
* [bug] CLI supports `--help`
* [bug] `max-line-length` allows CRLF endings


text:
using System;

namespace DvachBrowser3.Lifecycle
{
    /// <summary>
    /// Îøèáêà ìåíåäæåðà ñîõðàíåíèÿ ñîñòîÿíèÿ.
    /// </summary>
    public class SuspensionManagerException : Exception
    {
        public SuspensionManagerException()
        {
        }

        public SuspensionManagerException(Exception e)
            : base("SuspensionManager failed", e)
        {

        }
    }
}