text:
package com.matt.forgehax.asm.utils;

import java.util.Objects;
import org.objectweb.asm.tree.AbstractInsnNode;

public class InsnPattern {

  private final AbstractInsnNode first;
  private final AbstractInsnNode last;

  public InsnPattern(AbstractInsnNode first, AbstractInsnNode last) {
    Objects.requireNonNull(first);
    Objects.requireNonNull(last);
    this.first = first;
    this.last = last;
  }

  public <T extends AbstractInsnNode> T getFirst() {
    return (T) this.first;
  }

  public <T extends AbstractInsnNode> T getLast() {
    return (T) this.last;
  }

  public <T extends AbstractInsnNode> T getIndex(final int index) {
    AbstractInsnNode node = this.first;
    for (int i = 0; i < index; i++) {
      node = node.getNext();
      // if (node == this.last && i < index)
      //    throw new ArrayIndexOutOfBoundsException(String.valueOf(index));
    }
    return (T) node;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Nett </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Nett ">
    <meta name="generator" content="docfx 2.40.11.0">

    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="styles/docfx.vendor.css">
    <link rel="stylesheet" href="styles/docfx.css">
    <link rel="stylesheet" href="styles/main.css">
    <meta property="docfx:navrel" content="toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

Nett

A TOML parser and configuration library for .Net.

Gitub

NuGet

Class to TOML mapping

TODO

Supports TOML 0.5.0

TODO

Supports .Net 4.0 and .Net Core Standard 2.0

TODO

Hierarchical configuration system

TODO

Asp.Net Core config provider

TODO

About this documentation

This documentation is work in progress.

                    Improve this Doc

              Back to top

            Generated by DocFX


text:
'use strict';

var
  BUF_SIZE = 256,
  ALGORITHM_CIPHER = 'aes-256-cbc',
  ALGORITHM_HASH = 'sha256',

  promptText = '> ',
  encoding = 'utf8',
  fs = require('fs'),
  stdin = process.stdin,
  stdout = process.stdout,
  buffer = new Buffer(BUF_SIZE),
  useShell = true, print, tempdir, salt = 0;

function _readlineSync(display, options) {
  var input = '', rsize, err;

  if (display !== '') { // null and undefined were excluded.
    if (typeof print === 'function') { print(display, encoding); }
    stdout.write(display + '', encoding);
  }

  if (options && options.noEchoBack) { // Try reading via shell

    input = _readlineShell(true);
    if (typeof input !== 'string') {
      if (display !== '') { stdout.write('\n', encoding); } // Return from prompt line.
      throw new Error('Can\'t read via shell');
    }

  } else {

    stdin.resume();
    while (true) {
      rsize = 0;

      try {
        rsize = fs.readSync(stdin.fd, buffer, 0, BUF_SIZE);
      } catch (e) {
        if (e.code === 'EOF') { break; } // pipe

        if (useShell) {
          // Try reading via shell
          input = _readlineShell();
          if (typeof input === 'string') { break; }
        }

        // Give up...
        if (e.code === 'EAGAIN') { // EAGAIN, resource temporarily unavailable
          // util can't inherit Error.
          err = new Error('The platform doesn\'t support interactive reading from stdin');
          err.errno = e.errno;
          err.code = e.code;
        }
        if (display !== '') { stdout.write('\n', encoding); } // Return from prompt line.
        throw err || e;
      }

      if (rsize === 0) { break; }
      input += buffer.toString(encoding, 0, rsize);
      if (/[\r\n]$/.test(input)) { break; }
    }
    stdin.pause();

  }

  return options && options.noTrim ? input.replace(/[\r\n]+$/, '') : input.trim();
}

function _readlineShell(noEchoBack) {
  // piping via files instead of execSync (node v0.12+)
  // https://github.com/joyent/node/blob/master/doc/api/child_process.markdown#child_processexecsynccommand-options
  // see README > Note
  var shellPath, args, shellStdout,
    pathStdout = getTempfile('readline-sync.stdout'),
    pathStatus = getTempfile('readline-sync.status'),
    pathDone   = getTempfile('readline-sync.done'),
    optEchoBack = noEchoBack ? ' noechoback' : '',
    crypto = require('crypto'), shasum, decipher, password;

  shasum = crypto.createHash(ALGORITHM_HASH);
  shasum.update('' + process.pid + (salt++) + Math.random());
  password = shasum.digest('hex');
  decipher = crypto.createDecipher(ALGORITHM_CIPHER, password);

  if (process.platform === 'win32') {
    // The quote (") is escaped by node before parsed by shell. Then use ENV{Q}.
    shellPath = 'cmd.exe';
    args = ['/V:ON', '/S', '/C',
      '%Q%' + __dirname + '\\read.bat%Q%' + optEchoBack +
      ' |%Q%' + process.execPath + '%Q% %Q%' + __dirname + '\\encrypt.js%Q%' +
        ' %Q%' + ALGORITHM_CIPHER + '%Q% %Q%' + password + '%Q%' +
      ' >%Q%' + pathStdout + '%Q%' +
      ' & (echo !ERRORLEVEL!)>%Q%' + pathStatus + '%Q% & (echo 1)>%Q%' + pathDone + '%Q%'];
  } else {
    shellPath = '/bin/sh';
    args = ['-c',
      'DATA=`(' + shellPath + ' "' + __dirname + '/read.sh"' + optEchoBack + ')`; RTN=$?;' +
      ' if [ $RTN -eq 0 ]; then (echo $DATA |' +
      '"' + process.execPath + '" "' + __dirname + '/encrypt.js"' +
        ' "' + ALGORITHM_CIPHER + '" "' + password + '"' +
      ' >"' + pathStdout + '") fi;' +
      ' expr $RTN + $? >"' + pathStatus + '"; echo 1 >"' + pathDone + '"'];
  }

  stdin.pause(); // re-start in child process
  require('child_process').execFile(shellPath, args, {env: {Q: '"'}});

  while (fs.readFileSync(pathDone, {encoding: encoding}).trim() !== '1') {}
  if (fs.readFileSync(pathStatus, {encoding: encoding}).trim() === '0') {
    shellStdout =
      decipher.update(fs.readFileSync(pathStdout, {encoding: 'binary'}), 'hex', encoding) +
      decipher.final(encoding);
  }

  fs.unlinkSync(pathStdout);
  fs.unlinkSync(pathStatus);
  fs.unlinkSync(pathDone);
  return shellStdout;
}

function getTempfile(name) {
  var path = require('path'), filepath, suffix = '', fd;
  tempdir = tempdir || require('os').tmpdir();

  while (true) {
    filepath = path.join(tempdir, name + suffix);
    try {
      fd = fs.openSync(filepath, 'wx');
    } catch (e) {
      if (e.code === 'EEXIST') {
        suffix++;
        continue;
      } else {
        throw e;
      }
    }
    fs.closeSync(fd);
    break;
  }
  return filepath;
}

// for dev
exports.useShellSet = function(use) { useShell = use; };

exports.setPrint = function(fnc) { print = fnc; };

exports.setPrompt = function(newPrompt) {
/* jshint eqnull:true */
  if (newPrompt != null) {
/* jshint eqnull:false */
    promptText = newPrompt;
  }
  return promptText;
};

exports.setEncoding = function(newEncoding) {
  if (typeof newEncoding === 'string') {
    encoding = newEncoding;
  }
  return encoding;
};

exports.prompt = function(options) {
  return _readlineSync(promptText, options);
};

exports.question = function(query, options) {
  return _readlineSync(
/* jshint eqnull:true */
    query != null ? query : '',
/* jshint eqnull:false */
    options);
};


text:
using System;
using System.Collections.Generic;
using ZippyNet.Interfaces;
using System.Text;
using System.Web;

namespace ZippyNet.Html.Form
{
    public class CheckBox : HtmlFormDataElement, IRequestable, IChangeListener
    {
        private object change = null;

        public CheckBox(string id)
            : base(id)
        {
            this.value = false;
        }

        protected override void RenderImpl()
        {
            this.setAttribute("name", this.id);

            if (this.isChecked())
            {
                this.setAttribute("checked", "On");
            }
            else
            {
                this.setAttribute("checked", null); //remove  attribute
            }
            if(this.change != null)
            {
                string formid = this.getFormOwner().id;
                string url = this.owner.getURLNode() + "::" + this.id;
                url = url.Substring(2 + url.IndexOf("q="));
                this.setAttribute("onclick", "javascript:{if(beforeZippy('" + this.id + "') ==false) return false; $('#" + formid + "_q').attr('value','" + url + "'); $('#" + formid + " ').submit();}");
            }
        }

        public override void getRequestData()
        {
            this.setChecked(HttpContext.Current.Request.Form[this.id] != null);
        }

        public void  onChange(Change callee,bool ajax=false)
        {
            this.change = callee;
        }

        public  void RequestHandle()
        {
            OnEvent();
        }

        private void OnEvent()
        {
            if (this.change == null) return;
            ((Change)change)(this);
         }

        public bool isChecked()
        {
            return (bool)this.value;
        }
        public void setChecked(bool value)
        {
            this.value = value;
        }
    }
}


text:
package MIP::Recipes::Analysis::Rseqc;

use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use File::Basename qw{ basename fileparse };
use File::Spec::Functions qw{ catdir catfile };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use POSIX qw{ floor };
use utf8;
use warnings;
use warnings qw{ FATAL utf8 };

## CPANM
use autodie qw{ :all };
use Readonly;

## MIPs lib/
use MIP::Constants qw{ $LOG_NAME $NEWLINE $UNDERSCORE };

BEGIN {

    require Exporter;
    use base qw{ Exporter };

    # Functions and variables which can be optionally exported
    our @EXPORT_OK = qw{ analysis_rseqc };

}

sub analysis_rseqc {

## Function : Rseqc analysis for RNA-seq
## Returns  :
## Arguments: $active_parameter_href   => Active parameters for this analysis hash {REF}
##          : $case_id                 => Family id
##          : $file_info_href          => File info hash {REF}
##          : $job_id_href             => Job id hash {REF}
##          : $parameter_href          => Parameter hash {REF}
##          : $profile_base_command    => Submission profile base command
##          : $recipe_name             => Program name
##          : $sample_id               => Sample id
##          : $sample_info_href        => Info on samples and case hash {REF}
##          : $temp_directory          => Temporary directory
##          : $xargs_file_counter      => The xargs file counter

    my ($arg_href) = @_;

    ## Flatten argument(s)
    my $active_parameter_href;
    my $file_info_href;
    my $job_id_href;
    my $parameter_href;
    my $recipe_name;
    my $sample_id;
    my $sample_info_href;

    ## Default(s)
    my $case_id;
    my $profile_base_command;
    my $temp_directory;
    my $xargs_file_counter;

    my $tmpl = {
        active_parameter_href => {
            default     => {},
            defined     => 1,
            required    => 1,
            store       => \$active_parameter_href,
            strict_type => 1,
        },
        case_id_ref => {
            default     => $arg_href->{active_parameter_href}{case_id},
            store       => \$case_id,
            strict_type => 1,
        },
        file_info_href => {
            default     => {},
            defined     => 1,
            required    => 1,
            store       => \$file_info_href,
            strict_type => 1,
        },
        job_id_href => {
            default     => {},
            defined     => 1,
            required    => 1,
            store       => \$job_id_href,
            strict_type => 1,
        },
        parameter_href => {
            default     => {},
            defined     => 1,
            required    => 1,
            store       => \$parameter_href,
            strict_type => 1,
        },
        profile_base_command => {
            default     => q{sbatch},
            store       => \$profile_base_command,
            strict_type => 1,
        },
        recipe_name => {
            defined     => 1,
            required    => 1,
            store       => \$recipe_name,
            strict_type => 1,
        },
        sample_id => {
            defined     => 1,
            required    => 1,
            store       => \$sample_id,
            strict_type => 1,
        },
        sample_info_href => {
            default     => {},
            defined     => 1,
            required    => 1,
            store       => \$sample_info_href,
            strict_type => 1,
        },
        temp_directory => {
            default     => $arg_href->{active_parameter_href}{temp_directory},
            store       => \$temp_directory,
            strict_type => 1,
        },
        xargs_file_counter => {
            default     => 0,
            allow       => qr{ ^\d+$ }xsm,
            strict_type => 1,
            store       => \$xargs_file_counter,
        },
    };

    check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};

    use MIP::File_info qw{ get_io_files parse_io_outfiles };
    use MIP::Processmanagement::Processes qw{ submit_recipe };
    use MIP::Program::Rseqc
      qw{ rseqc_bam_stat rseqc_infer_experiment rseqc_inner_distance rseqc_junction_annotation rseqc_junction_saturation rseqc_read_distribution rseqc_read_duplication };
    use MIP::Recipe qw{ parse_recipe_prerequisites };
    use MIP::Reference qw{ get_transcript_annotation_file_path };
    use MIP::Script::Setup_script qw{ setup_script };

    ### PREPROCESSING

    ## Retrieve logger object
    my $log = Log::Log4perl->get_logger($LOG_NAME);

    ## Unpack parameters
    my %io = get_io_files(
        {
            file_info_href => $file_info_href,
            id             => $sample_id,
            parameter_href => $parameter_href,
            recipe_name    => $recipe_name,
            stream         => q{in},
            temp_directory => $temp_directory,
        }
    );
    my $infile_path_prefix        = $io{in}{file_path_prefix};
    my @infile_name_prefixes      = @{ $io{in}{file_name_prefixes} };
    my $infile_suffix             = $io{in}{file_suffix};
    my $infile_path               = $infile_path_prefix . $infile_suffix;
    my $transcript_annotation_bed = get_transcript_annotation_file_path(
        {
            active_parameter_href => $active_parameter_href,
            file_format           => q{bed},
            file_info_href        => $file_info_href,
        }
    );
    my %recipe = parse_recipe_prerequisites(
        {
            active_parameter_href => $active_parameter_href,
            parameter_href        => $parameter_href,
            recipe_name           => $recipe_name,
        }
    );

    ## Set and get the io files per chain, id and stream
    %io = (
        %io,
        parse_io_outfiles(
            {
                chain_id               => $recipe{job_id_chain},
                id                     => $sample_id,
                file_info_href         => $file_info_href,
                outdata_dir            => $active_parameter_href->{outdata_dir},
                file_name_prefixes_ref => \@infile_name_prefixes,
                parameter_href         => $parameter_href,
                recipe_name            => $recipe_name,
                temp_directory         => $temp_directory,
            }
        )
    );
    my $outfile_path_prefix = $io{out}{file_path_prefix};
    my $outfile_suffix      = $io{out}{file_suffix};

    ## Filehandles
    # Create anonymous filehandle
    my $filehandle = IO::Handle->new();

    ## Creates recipe directories (info & data & script), recipe script filenames and writes sbatch header
    my ( $recipe_file_path, $recipe_info_path ) = setup_script(
        {
            active_parameter_href => $active_parameter_href,
            core_number           => $recipe{core_number},
            directory_id          => $sample_id,
            filehandle            => $filehandle,
            job_id_href           => $job_id_href,
            memory_allocation     => $recipe{memory},
            process_time          => $recipe{time},
            recipe_directory      => $recipe_name,
            recipe_name           => $recipe_name,
            temp_directory        => $temp_directory,
        }
    );

    ## SHELL

    ## Rseq
    say {$filehandle} q{## Rseq infer_experiment.py};
    rseqc_infer_experiment(
        {
            bed_file_path   => $transcript_annotation_bed,
            filehandle      => $filehandle,
            infile_path     => $infile_path,
            stdoutfile_path => $outfile_path_prefix
              . $UNDERSCORE
              . q{infer_experiment}
              . $outfile_suffix,
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseq junction_annotation.py};
    rseqc_junction_annotation(
        {
            bed_file_path        => $transcript_annotation_bed,
            filehandle           => $filehandle,
            infile_path          => $infile_path,
            outfiles_path_prefix => $outfile_path_prefix . $UNDERSCORE . q{junction_annotation},
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseq junction_saturation.py};
    rseqc_junction_saturation(
        {
            bed_file_path        => $transcript_annotation_bed,
            filehandle           => $filehandle,
            infile_path          => $infile_path,
            outfiles_path_prefix => $outfile_path_prefix . $UNDERSCORE . q{junction_saturation},
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseq inner_distance.py};
    rseqc_inner_distance(
        {
            bed_file_path        => $transcript_annotation_bed,
            filehandle           => $filehandle,
            infile_path          => $infile_path,
            outfiles_path_prefix => $outfile_path_prefix . $UNDERSCORE . q{inner_distance},
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseq bam_stat.py};
    rseqc_bam_stat(
        {
            filehandle      => $filehandle,
            infile_path     => $infile_path,
            stdoutfile_path => $outfile_path_prefix . $UNDERSCORE . q{bam_stat} . $outfile_suffix,
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseq read_distribution.py};
    rseqc_read_distribution(
        {
            bed_file_path   => $transcript_annotation_bed,
            filehandle      => $filehandle,
            infile_path     => $infile_path,
            stdoutfile_path => $outfile_path_prefix
              . $UNDERSCORE
              . q{read_distribution}
              . $outfile_suffix,
        }
    );
    say {$filehandle} $NEWLINE;

    say {$filehandle} q{## Rseqc read_duplication};
    rseqc_read_duplication(
        {
            filehandle           => $filehandle,
            infile_path          => $infile_path,
            outfiles_path_prefix => $outfile_path_prefix . $UNDERSCORE . q{read_duplication},
        }
    );
    say {$filehandle} $NEWLINE;

    close $filehandle;

    if ( $recipe{mode} == 1 ) {

        submit_recipe(
            {
                base_command                      => $profile_base_command,
                dependency_method                 => q{sample_to_island},
                case_id                           => $case_id,
                job_id_chain                      => $recipe{job_id_chain},
                job_id_href                       => $job_id_href,
                job_reservation_name              => $active_parameter_href->{job_reservation_name},
                log                               => $log,
                max_parallel_processes_count_href =>
                  $file_info_href->{max_parallel_processes_count},
                recipe_file_path   => $recipe_file_path,
                sample_id          => $sample_id,
                submission_profile => $active_parameter_href->{submission_profile},
            }
        );
    }
    return 1;
}

1;


text:
package cn.edu.ustc.appseed.clubseed.data;

import java.util.LinkedList;

/**
 * Created by Hengruo on 2015/3/5.
 */
public class ClubPhp {
    private int error;
    private String errormessage;
    private LinkedList<Club> data;
    public ClubPhp(){

    }
    public ClubPhp(int error, String errormessage, LinkedList<Club> data) {
        this.error = error;
        this.errormessage = errormessage;
        this.data = data;
    }

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getErrormessage() {
        return errormessage;
    }

    public void setErrormessage(String errormessage) {
        this.errormessage = errormessage;
    }

    public LinkedList<Club> getData() {
        return data;
    }

    public void setData(LinkedList<Club> data) {
        this.data = data;
    }
}


text:
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class HomeAction extends AbstractAction {
    public function execute() {
        $this->loadView('home', array('page'=>'home'));
//        $this->loadView('home');
    }

}


text:
package errors_test

import (
	"errors"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	. "github.com/cloudfoundry/bosh-agent/errors"
)

var _ = Describe("MultiError", func() {
	Describe("Error", func() {
		Context("when reasons are given", func() {
			It("returns each reason as bullet points", func() {
				err := NewMultiError(errors.New("reason 1"), errors.New("reason 2"))
				Expect(err.Error()).To(Equal("reason 1\nreason 2"))
			})
		})

		Context("when no reasons are given", func() {
			It("returns empty string", func() {
				err := NewMultiError()
				Expect(err.Error()).To(Equal(""))
			})
		})
	})
})


text:
Pair with Padding
--DESCRIPTION--
Superfluous in-tag whitespace should be ignored.
--SKIPIF--
<?php if(!extension_loaded('mustache')) die('skip '); ?>
--FILE--
<?php
$test = array (
  'name' => 'Pair with Padding',
  'desc' => 'Superfluous in-tag whitespace should be ignored.',
  'data' =>
  array (
  ),
  'template' => '|{{= @   @ =}}|',
  'expected' => '||',
);
$mustache = new Mustache();
echo $mustache->render($test["template"], $test["data"]);
?>
--EXPECTREGEX--
\|\|


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Xml;
using log4net;
using log4net.Config;

namespace JetBrains.TeamCity.NuGet.Feed
{
  [Serializable]
  public class Log4netInitializer
  {
    private static readonly ILog LOG = LogManagerHelper.GetCurrentClassLogger();

    public const string LOG_FILE_ENV_KEY = "teamcity-dotnet-log-file";
    public const string LOG_FOLDER_ENV_KEY = "teamcity-dotnet-log-folder";
    private const string LOG_CONFIG_REPLACE_CONSTANT = "teamcity-dotnet-log-file";

    private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
      var exception = e.ExceptionObject as Exception;
      if (exception == null)
      {
        LOG.Warn("Unhandled (null) exception in current domain");
        return;
      }

      LOG.WarnFormat("Unhandled exception in current domain: {0}, {1}, {2}", exception, exception.StackTrace,
        exception.InnerException == null ? "(null)" : (object)exception.InnerException);
    }

    public void InitializeLogging(string logConfigFile, string defaultName)
    {
      LoadConfigFromFile(logConfigFile, defaultName);
      AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

      LOG.Info(Environment.NewLine + Environment.NewLine + Environment.NewLine + "===============================");
      LOG.InfoFormat("Started log4net from {0}", logConfigFile);
    }

    public void ShutdownLogging()
    {
      LOG.Info("Shutting down logging");
      LOG.Info(Environment.NewLine + Environment.NewLine + Environment.NewLine + "===============================");

      LogManager.Shutdown();
      LogManager.ResetConfiguration();
      AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
    }

    private static void LoadConfigFromFile(string file, string defaultName)
    {
      var doc = new XmlDocument();

      string config = File.ReadAllText(file);

      var logFileName = GetLogFileName(defaultName);
      config = config.Replace("${" + LOG_CONFIG_REPLACE_CONSTANT + "}", logFileName);
      doc.LoadXml(config);

      XmlConfigurator.Configure(doc.DocumentElement);
    }

    private static string GetLogFileName(string defaultName)
    {
      var file = Environment.GetEnvironmentVariable(LOG_FILE_ENV_KEY);
      if (file != null) return file;

      string destPath = Environment.GetEnvironmentVariable(LOG_FOLDER_ENV_KEY)
                        ??
                        Path.Combine(Path.GetTempPath(), "TeamCity.NET");

      if (!Directory.Exists(destPath))
        Directory.CreateDirectory(destPath);

      string logFile = Path.Combine(destPath, string.Format("{1}-{0}.log", (DateTime.Now - new DateTime(2011, 02, 05, 16, 22, 10)).Ticks, defaultName));

      string newLogFile = logFile;
      int i = 1;
      while (File.Exists(newLogFile))
      {
        newLogFile = logFile + "." + ++i;
      }

      return newLogFile;
    }
  }

  public static class LogManagerHelper {
    [MethodImpl(MethodImplOptions.NoInlining)]
    public static ILog GetCurrentClassLogger()
    {
      return LogManager.GetLogger(new StackFrame(1, false).GetMethod().DeclaringType);
    }
  }

}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.4.4.17-3-19
description: >
    Array.prototype.some - value of 'length' is an Object which has an
    own toString method
---*/

        function callbackfn1(val, idx, obj) {
            return val > 10;
        }

        function callbackfn2(val, idx, obj) {
            return val > 11;
        }

        var toStringAccessed = false;
        var obj = {
            0: 9,
            1: 11,
            2: 12,

            length: {
                toString: function () {
                    toStringAccessed = true;
                    return '2';
                }
            }
        };

assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
assert(toStringAccessed, 'toStringAccessed !== true');


text:
__author__ = 'mendrugory'

import sys
import json
import tweepy
import random
import time

import tweetsanalyzer.settings as secret
from tweetsanalyzer.twitter_processing.models import Tweet
from tweetsanalyzer.twitter_processing.tweet_process import SourceProcessor
from tweetsanalyzer.twitter_processing.tweet_process import LanguageProcessor
from tweetsanalyzer.source_research.models import TweetSource
from tweetsanalyzer.lang_research.models import TweetLanguage
from tweetsanalyzer.twitter_processing.twitter_worker import Worker
from tweetsanalyzer.settings import MONGODB_USER

class CustomStreamListener(tweepy.StreamListener):
    '''
    Custom class to manage the twitter streaming
    '''

    def __init__(self):
        super(CustomStreamListener, self).__init__()

    def on_data(self, tweet):
        pass

    def on_status(self, status):
        '''
        Get the streaming status
        '''
        print status.text

    def on_error(self, status_code):
        '''
        don't kill the stream although an error happened.
        '''
        print >> sys.stderr, 'Encountered error with status code:', status_code
        return True # Don't kill the stream

    def on_timeout(self):
        '''
        don't kill the stream although a timeout happened.
        '''
        print >> sys.stderr, 'Timeout...'
        return True # Don't kill the stream

    @staticmethod
    def delay():
        delay = random.randint(0, 9) / 100.0
        time.sleep(delay)

class MongoDBStreamListener(CustomStreamListener):

    def __init__(self):
        super(MongoDBStreamListener, self).__init__()

    def on_data(self, tweet):
        super(MongoDBStreamListener, self).on_data(tweet)
        json_tweet = json.loads(tweet)
        doc = self.process_tweet(json_tweet)
        MongoDBStreamListener.process_all_studies(doc)

    def on_status(self, status):
        super(MongoDBStreamListener, self).on_status(status)

    def on_error(self, status_code):
        '''
        don't kill the stream although an error happened.
        '''
        super(MongoDBStreamListener, self).on_error(status_code)

    def on_timeout(self):
        super(MongoDBStreamListener, self).on_timeout()

    def process_tweet(self, tweet):
        doc = Tweet()
        doc.created_at = tweet["created_at"]
        doc.favorite_count = tweet["favorite_count"]
        doc.favorited = tweet["favorited"]
        doc.lang = tweet["lang"]
        doc.retweet_count = tweet["retweet_count"]
        doc.retweeted = tweet["retweeted"]
        doc.source = tweet["source"]
        doc.tweet_text = tweet["text"]
        doc.filter_level = tweet["filter_level"]
        doc.tweet_id = tweet["id"]
        if tweet["coordinates"] is not None:
            doc.longitude = tweet["coordinates"]["coordinates"][0]
            doc.latitude = tweet["coordinates"]["coordinates"][1]
        self.save_tweet(doc, tweet)
        MongoDBStreamListener.delay()
        return doc

    @staticmethod
    def process_all_studies(tweet):
        source_worker = Worker(SourceProcessor(TweetSource), tweet)
        source_worker.start()
        lang_worker = Worker(LanguageProcessor(TweetLanguage), tweet)
        lang_worker.start()

    def save_tweet(self, doc, tweet):
        if MONGODB_USER is None:
            doc.save()
            # try:
            #     print str(tweet)
            # except Exception as ex:
            #     print ex.message

    def get_user_info(self, tweet):
        pass

class TwitterAuth(object):
    '''
    class to manage the twitter authorization
    '''

    def __init__(self):
        self.auth = tweepy.OAuthHandler(secret.CONSUMER_KEY, secret.CONSUMER_SECRET)
        self.auth.set_access_token(secret.ACCESS_TOKEN, secret.ACCESS_TOKEN_SECRET)
        self.api = tweepy.API(self.auth)

    def get_auth(self):
        return self.auth

    def get_api(self):
        return self.api

class TwitterStreaming(object):
    '''
    Twitter Streaming
    '''

    def __init__(self, stream_listener=MongoDBStreamListener, auth=TwitterAuth):
        self.twitter_auth = auth()
        self.stream_listener = stream_listener

    def run(self, tracking=None, locations=None):
        '''
        Run the streaming

        tracking: list of topics
        '''

        sapi = tweepy.streaming.Stream(self.twitter_auth.get_auth(), self.stream_listener())
        sapi.filter(track=tracking, locations=[])


text:
namespace test.sacs
{
    /// <summary>
    /// Tests the initial default DataWriterQos and the getting and setting
    /// of the default DataWriterQos in the Publisher.
    /// </summary>
    /// <remarks>
    /// Tests the initial default DataWriterQos and the getting and setting
    /// of the default DataWriterQos in the Publisher.
    /// </remarks>
    public class Publisher4 : Test.Framework.TestCase
    {
        /// <summary>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </summary>
        /// <remarks>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </remarks>
        public Publisher4()
            : base("sacs_publisher_tc4", "sacs_publisher", "publisher", "Test if a DataWriterQos can be resolved/set."
                , "Test if a DataWriterQos can be resolved/set.", null)
        {
            this.AddPreItem(new test.sacs.PublisherItemInit());
            this.AddPreItem(new test.sacs.TopicInit());
            this.AddPostItem(new test.sacs.TopicDeinit());
            this.AddPostItem(new test.sacs.PublisherItemDeinit());
        }

        /// <summary>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </summary>
        /// <remarks>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </remarks>
        public override Test.Framework.TestResult Run()
        {
            DDS.IPublisher publisher;
			DDS.DataWriterQos qos = null;
            string expResult = "DataWriterQos test succeeded";
            Test.Framework.TestResult result;
            DDS.ReturnCode rc;
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            publisher = (DDS.IPublisher)this.ResolveObject("publisher");

            if (publisher.GetDefaultDataWriterQos(ref qos) != DDS.ReturnCode.Ok)
            {
                result.Result = "Failed to get the default datawriter qos (1)";
                return result;
            }
            if (!test.sacs.QosComparer.DataWriterQosEquals(qos, test.sacs.QosComparer.defaultDataWriterQos
                ))
            {
                result.Result = "The default DataWriterQos != default (2)";
                return result;
            }
            qos.Deadline.Period.NanoSec = DDS.Duration.InfiniteNanoSec + 1;
            rc = publisher.SetDefaultDataWriterQos(qos);
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "Received return code " + rc + " but expected RETCODE_BAD_PARAMETER (3)";
                return result;
            }

            if (publisher.GetDefaultDataWriterQos(ref qos) != DDS.ReturnCode.Ok)
            {
                result.Result = "Failed to get the default datawriter qos (4)";
                return result;
            }
            if (!test.sacs.QosComparer.DataWriterQosEquals(qos, test.sacs.QosComparer.defaultDataWriterQos))
            {
                result.Result = "The default DataWriterQos != default (4)";
                return result;
            }
            qos.History.Depth = 8;
            qos.ResourceLimits.MaxSamplesPerInstance = 2;
            rc = publisher.SetDefaultDataWriterQos(qos);
            if (rc != DDS.ReturnCode.InconsistentPolicy)
            {
                result.Result = "Received return code " + rc + " but expected RETCODE_INCONSISTENT_POLICY (5)";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
    }
}


text:
var debug                     = require('debug')('venn'),
    request                   = require('request'),
    MessagingServiceProvider  = require("../../messaging_service_provider"),
    MessagingServiceStatus    = require('../../messaging_service_status'),
    MessagingUserStatus       = require('../../messaging_user_status');

/*=============================================================================

Define Roost Service Provider

=============================================================================*/
function Roost(keys) {
  if (!keys) return;
  this.name = 'roost';
  this.keys = keys;

  this.send = function (data, callback) {
    var context = this;

    // Make the request to Roost endpoint
    request( getRoostSendOptions(this.keys.api_key, this.keys.api_secret, getRoostSendBody(data) ), function (err, result) {
      var roostStat;

      if (err) {
        roostStat = new RoostErrorStatus(err);
        debug("-_-_ FAILED with roost _-_-");
        debug(err);
        debug(roostStat);
        return callback(roostStat);

      } else if (typeof result.body === 'undefined') {
        // This is neccessary since Roost is sending 200, undefined result when invalid auth username is given
        roostStat = new RoostErrorStatus({success: false, error: 'Login using basic auth and the configuration\'s key and secret as username and password.'});
        debug("-_-_ FAILED with roost _-_-");
        debug(roostStat);
        return callback(roostStat);

      } else if (!result.body.success) {
        result.body.statusCode = result.statusCode;
        roostStat = new RoostErrorStatus(result.body);
        debug("-_-_ FAILED with roost _-_-");
        debug(roostStat);
        return callback(roostStat);

      } else {
        roostStat = new RoostSuccessStatus(result.body);
        result.service = context;
        result.status = roostStat;
        debug("-_-_ sent with roost _-_-");
        debug(result);
        return callback(null, result);
      }
    });
  };
};

Roost.prototype = new MessagingServiceProvider()

/*=============================================================================

Define Roost Service Status Handlers

=============================================================================*/

/*
Success Status

@param response     JSON response object from Roost service
*/
function RoostSuccessStatus(response) {
  MessagingServiceStatus.call(this, 'roost');

  // Message successfully sent
  this.state.message = 'Notification Id: ' + response.notification_id + '. ' + response.message;
  this.state.code = this.StatusCodes.SUCCESS;
}

RoostSuccessStatus.prototype = Object.create(MessagingServiceStatus.prototype);
RoostSuccessStatus.prototype.constructor = RoostSuccessStatus;

/*
Error Status

@param response     JSON response object from Roost service
*/
function RoostErrorStatus(response) {
  MessagingServiceStatus.call(this, 'roost');

  // There was an error when attempting to send message
  this.state.message = response.code ? 'Code: ' + response.code + '. ' : '';
  this.state.message += response.error;

  // Determine the correct status code
  // No code is being passed from Roost at this time, so we must depend on the error string
  if (response.error.match(/auth/g)) this.state.code = this.StatusCodes.UNAUTHORIZED;
  else if (response.error.match(/Invalid/g)) this.state.code = this.StatusCodes.DATA_REJECTED;
  else if (response.error.match(/Incorrectly formatted/g)) this.state.code = this.StatusCodes.DATA_REJECTED;
  else this.state.code = this.StatusCodes.DEFAULT;
}

RoostErrorStatus.prototype = Object.create(MessagingServiceStatus.prototype);
RoostErrorStatus.prototype.constructor = RoostErrorStatus;

/*=============================================================================

Define Roost User Status Handler

=============================================================================*/
function RoostUserStatus(message, code) {
  MessagingUserStatus.call(this, 'roost');

  this.state.message = message;

  if (code === 'missing') {
    this.state.code = this.StatusCodes.MISSING;

  } else if (code === 'ok') {
    this.state.code = this.StatusCodes.VALID;

  } else {
    this.state.code = this.STatusCodes.DEFAULT;
  }
}

RoostUserStatus.prototype = Object.create(MessagingUserStatus.prototype);
RoostUserStatus.prototype.constructor = RoostUserStatus;

/*=============================================================================

Define Roost Helper Functions

=============================================================================*/

/*
Format incoming data to Roost specification

@param data             The incoming, unformatted data
@return                 The formatted JSON object
*/
getRoostSendBody = function (data) {

  // See http://docs.goroost.com/docs/specification for details.
  var sendBody = {
    alert:          data.message,
    url:            data.url,
    segments:       data.groups,
    aliases:        data.aliases,
    device_tokens:  data.devices,
    exclude_tokens: data.excludes,
    test_type:      data.type,
    schedule_for:   data.schedule
  };

  return sendBody;
};

/*
Format request options to Roost specification

@param apiKey           The HTTP basic-auth username for the request
@param apiSecret        The HTTP basic-auth password for the request
@param sendBody         The data to send formatted to Roost specification
@return                 The formatted JSON object
*/
getRoostSendOptions = function (apiKey, apiSecret, sendBody) {
  var buffer = apiKey + ':' + apiSecret;
  var auth = new Buffer(buffer).toString('base64');

  // See http://docs.goroost.com/docs/specification for details.
  var options = {
    url: 'https://api.goroost.com/api/push',
    method: 'POST',
    headers: {
      'Authorization': 'Basic ' + auth,
      'Content-Type': 'application/json'
    },
    json: true,
    body: sendBody
  };

  return options;
};

module.exports = Roost


text:
require("ZeroBraineProjects/dvdlualib/common")
-- require("ZeroBraineProjects/dvdlualib/gmodlib")

local pairs                = pairs
local Angle                = Angle
local Vector               = Vector
local IsValid              = IsValid
local tonumber             = tonumber
local tostring             = tostring
local CreateConVar         = CreateConVar
local bitBor               = bit and bit.bor
local mathFloor            = math and math.floor
local vguiCreate           = vgui and vgui.Create
local fileExists           = file and file.Exists
local stringSub            = string and string.sub
local stringFind           = string and string.find
local stringGsub           = string and string.gsub
local stringUpper          = string and string.upper
local stringLower          = string and string.lower
--local stringExplode        = string and string.Explode
local surfaceScreenWidth   = surface and surface.ScreenWidth
local surfaceScreenHeight  = surface and surface.ScreenHeight
local duplicatorStoreEntityModifier = duplicator and duplicator.StoreEntityModifier

function makeNode()
  local self = {}
  function self:SetName(sName)
    self.Name = sName
  end
  function self:GetName()
    return self.Name
  end
end

local t = makeNode()

local function a(pnNode, sName)
  pnNode:SetName(sName)
  pnNode.DoRightClick = function(pnSelf) logStatus(nil,pnSelf:GetName()) end
end

a(t,"Test")

t.DoRightClick()


text:
/* model */
export * from './model/Response';

/* service */
export * from './service/base.service';

/* directive */
export * from './directive/popover.directive';


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.outlook;
import com.wilutions.com.*;

/**
 * ExchangeUser.
 *
 */
@CoClass(guid="{000610C9-0000-0000-C000-000000000046}")
public class ExchangeUser extends Dispatch implements _ExchangeUser {
  static boolean __typelib__loaded = __TypeLib.load();
  @DeclDISPID(61440)  public _Application getApplication() throws ComException {
    final Object obj = this._dispatchCall(61440,"Application", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.outlook.impl._ApplicationImpl.class);
  }
  @DeclDISPID(61450)  public OlObjectClass getClass_() throws ComException {
    final Object obj = this._dispatchCall(61450,"Class", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return OlObjectClass.valueOf((Integer)obj);
  }
  @DeclDISPID(61451)  public _NameSpace getSession() throws ComException {
    final Object obj = this._dispatchCall(61451,"Session", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.outlook.impl._NameSpaceImpl.class);
  }
  @DeclDISPID(61441)  public IDispatch getParent() throws ComException {
    final Object obj = this._dispatchCall(61441,"Parent", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(12291)  public String getAddress() throws ComException {
    final Object obj = this._dispatchCall(12291,"Address", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(12291)  public void setAddress(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(12291,"Address", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14592)  public OlDisplayType getDisplayType() throws ComException {
    final Object obj = this._dispatchCall(14592,"DisplayType", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return OlDisplayType.valueOf((Integer)obj);
  }
  @DeclDISPID(61470)  public String getID() throws ComException {
    final Object obj = this._dispatchCall(61470,"ID", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(12289)  public String getName() throws ComException {
    final Object obj = this._dispatchCall(12289,"Name", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(12289)  public void setName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(12289,"Name", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(12290)  public String getType() throws ComException {
    final Object obj = this._dispatchCall(12290,"Type", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(12290)  public void setType(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(12290,"Type", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(770)  public void Delete() throws ComException {
    this._dispatchCall(770,"Delete", DISPATCH_METHOD,null);
  }
  @DeclDISPID(769)  public void Details(final Object HWnd) throws ComException {
    assert(HWnd != null);
    this._dispatchCall(769,"Details", DISPATCH_METHOD,null,Variant.param(HWnd));
  }
  @DeclDISPID(774)  public String GetFreeBusy(final java.util.Date Start, final Integer MinPerChar, final Object CompleteFormat) throws ComException {
    assert(Start != null);
    assert(MinPerChar != null);
    assert(CompleteFormat != null);
    final Object obj = this._dispatchCall(774,"GetFreeBusy", DISPATCH_METHOD,null,Start,MinPerChar,Variant.param(CompleteFormat));
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(768)  public void Update(final Object MakePermanent, final Object Refresh) throws ComException {
    assert(MakePermanent != null);
    assert(Refresh != null);
    this._dispatchCall(768,"Update", DISPATCH_METHOD,null,Variant.param(MakePermanent),Variant.param(Refresh));
  }
  @DeclDISPID(64240)  public _ContactItem GetContact() throws ComException {
    final Object obj = this._dispatchCall(64240,"GetContact", DISPATCH_METHOD,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.outlook.impl._ContactItemImpl.class);
  }
  @DeclDISPID(64241)  public ExchangeUser GetExchangeUser() throws ComException {
    final Object obj = this._dispatchCall(64241,"GetExchangeUser", DISPATCH_METHOD,null);
    if (obj == null) return null;
    final Dispatch disp = (Dispatch)obj;
    return disp.as(ExchangeUser.class);
  }
  @DeclDISPID(64242)  public OlAddressEntryUserType getAddressEntryUserType() throws ComException {
    final Object obj = this._dispatchCall(64242,"AddressEntryUserType", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return OlAddressEntryUserType.valueOf((Integer)obj);
  }
  @DeclDISPID(64239)  public ExchangeDistributionList GetExchangeDistributionList() throws ComException {
    final Object obj = this._dispatchCall(64239,"GetExchangeDistributionList", DISPATCH_METHOD,null);
    if (obj == null) return null;
    final Dispatch disp = (Dispatch)obj;
    return disp.as(ExchangeDistributionList.class);
  }
  @DeclDISPID(64253)  public PropertyAccessor getPropertyAccessor() throws ComException {
    final Object obj = this._dispatchCall(64253,"PropertyAccessor", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    final Dispatch disp = (Dispatch)obj;
    return disp.as(PropertyAccessor.class);
  }
  @DeclDISPID(64243)  public AddressEntries GetDirectReports() throws ComException {
    final Object obj = this._dispatchCall(64243,"GetDirectReports", DISPATCH_METHOD,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.outlook.impl.AddressEntriesImpl.class);
  }
  @DeclDISPID(64244)  public AddressEntries GetMemberOfList() throws ComException {
    final Object obj = this._dispatchCall(64244,"GetMemberOfList", DISPATCH_METHOD,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.outlook.impl.AddressEntriesImpl.class);
  }
  @DeclDISPID(14848)  public String getAlias() throws ComException {
    final Object obj = this._dispatchCall(14848,"Alias", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14896)  public String getAssistantName() throws ComException {
    final Object obj = this._dispatchCall(14896,"AssistantName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14896)  public void setAssistantName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14896,"AssistantName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14856)  public String getBusinessTelephoneNumber() throws ComException {
    final Object obj = this._dispatchCall(14856,"BusinessTelephoneNumber", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14856)  public void setBusinessTelephoneNumber(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14856,"BusinessTelephoneNumber", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14887)  public String getCity() throws ComException {
    final Object obj = this._dispatchCall(14887,"City", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14887)  public void setCity(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14887,"City", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(12292)  public String getComments() throws ComException {
    final Object obj = this._dispatchCall(12292,"Comments", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(12292)  public void setComments(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(12292,"Comments", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14870)  public String getCompanyName() throws ComException {
    final Object obj = this._dispatchCall(14870,"CompanyName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14870)  public void setCompanyName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14870,"CompanyName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14872)  public String getDepartment() throws ComException {
    final Object obj = this._dispatchCall(14872,"Department", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14872)  public void setDepartment(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14872,"Department", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14854)  public String getFirstName() throws ComException {
    final Object obj = this._dispatchCall(14854,"FirstName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14854)  public void setFirstName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14854,"FirstName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14871)  public String getJobTitle() throws ComException {
    final Object obj = this._dispatchCall(14871,"JobTitle", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14871)  public void setJobTitle(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14871,"JobTitle", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14865)  public String getLastName() throws ComException {
    final Object obj = this._dispatchCall(14865,"LastName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14865)  public void setLastName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14865,"LastName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14876)  public String getMobileTelephoneNumber() throws ComException {
    final Object obj = this._dispatchCall(14876,"MobileTelephoneNumber", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14876)  public void setMobileTelephoneNumber(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14876,"MobileTelephoneNumber", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14873)  public String getOfficeLocation() throws ComException {
    final Object obj = this._dispatchCall(14873,"OfficeLocation", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14873)  public void setOfficeLocation(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14873,"OfficeLocation", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14890)  public String getPostalCode() throws ComException {
    final Object obj = this._dispatchCall(14890,"PostalCode", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14890)  public void setPostalCode(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14890,"PostalCode", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(64245)  public String getPrimarySmtpAddress() throws ComException {
    final Object obj = this._dispatchCall(64245,"PrimarySmtpAddress", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14888)  public String getStateOrProvince() throws ComException {
    final Object obj = this._dispatchCall(14888,"StateOrProvince", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14888)  public void setStateOrProvince(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14888,"StateOrProvince", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(14889)  public String getStreetAddress() throws ComException {
    final Object obj = this._dispatchCall(14889,"StreetAddress", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(14889)  public void setStreetAddress(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(14889,"StreetAddress", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(64249)  public ExchangeUser GetExchangeUserManager() throws ComException {
    final Object obj = this._dispatchCall(64249,"GetExchangeUserManager", DISPATCH_METHOD,null);
    if (obj == null) return null;
    final Dispatch disp = (Dispatch)obj;
    return disp.as(ExchangeUser.class);
  }
  @DeclDISPID(32814)  public String getYomiCompanyName() throws ComException {
    final Object obj = this._dispatchCall(32814,"YomiCompanyName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(32814)  public void setYomiCompanyName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(32814,"YomiCompanyName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(32812)  public String getYomiFirstName() throws ComException {
    final Object obj = this._dispatchCall(32812,"YomiFirstName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(32812)  public void setYomiFirstName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(32812,"YomiFirstName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(32813)  public String getYomiLastName() throws ComException {
    final Object obj = this._dispatchCall(32813,"YomiLastName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(32813)  public void setYomiLastName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(32813,"YomiLastName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(64487)  public String getYomiDisplayName() throws ComException {
    final Object obj = this._dispatchCall(64487,"YomiDisplayName", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(64487)  public void setYomiDisplayName(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(64487,"YomiDisplayName", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(64488)  public String getYomiDepartment() throws ComException {
    final Object obj = this._dispatchCall(64488,"YomiDepartment", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(64488)  public void setYomiDepartment(final String value) throws ComException {
    assert(value != null);
    this._dispatchCall(64488,"YomiDepartment", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(64631)  public com.wilutions.mslib.stdole.Picture GetPicture() throws ComException {
    final Object obj = this._dispatchCall(64631,"GetPicture", DISPATCH_METHOD,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.stdole.impl.PictureImpl.class);
  }
  public ExchangeUser() throws ComException {
    super("{000610C9-0000-0000-C000-000000000046}", "{000630C9-0000-0000-C000-000000000046}");
  }
  protected ExchangeUser(long ndisp) {
    super(ndisp);
  }
  public String toString() {
    return "[ExchangeUser" + super.toString() + "]";
  }
}


text:
<!--
     Copyright 2015 Comcast Cable Communications Management, LLC

     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.
 -->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.comcast.cdn.traffic_control.traffic_router</groupId>
	<artifactId>traffic_router_connector</artifactId>
	<packaging>jar</packaging>
	<version>1.0.0</version>
	<name>traffic_router_connector</name>

	<parent>
		<groupId>com.comcast.cdn.traffic_control.traffic_router</groupId>
		<artifactId>traffic_router</artifactId>
        <version>${env.TRAFFIC_CONTROL_VERSION}</version>
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.4.1</version>
				<executions>
					<execution>
						<phase>validate</phase>
						<id>enforce-environment-variable-is-set</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireEnvironmentVariable>
									<variableName>TRAFFIC_CONTROL_VERSION</variableName>
								</requireEnvironmentVariable>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>PMD</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<targetJdk>1.6</targetJdk>
							<verbose>true</verbose>
							<failurePriority>2</failurePriority>
							<rulesets>
								<ruleset>build/pmd/ruleset.xml</ruleset>
							</rulesets>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<targetJdk>1.6</targetJdk>
					<verbose>true</verbose>
					<failurePriority>2</failurePriority>
					<rulesets>
						<ruleset>build/pmd/ruleset.xml</ruleset>
					</rulesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<encoding>UTF-8</encoding>
					<showWarnings>true</showWarnings>
					<showDeprecation>true</showDeprecation>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<downloadSources>true</downloadSources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>com.comcast.cdn.traffic_control.traffic_router.connector.Connector</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>coyote</artifactId>
			<version>6.0.37</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>
</project>


text:
A simple procedural terrain example. This should generate a landscape using
Perlin Noise, and scatter some entities around - for example houses and trees.
This will demonstrate the initialisation of buffers and shaders, and how the
library can be composed with other external dependencies.

## Screenshot

![Terrain Example](screenshot.png)

## Useful libraries

- [glfw-rs](https://github.com/bjz/glfw-rs)
- [cgmath-rs](https://github.com/bjz/cgmath-rs)
- [noise-rs](https://github.com/bjz/noise-rs)
- [color-rs](https://github.com/bjz/color-rs) (could use some work)

## Images of possible output

_Sourced from [voyager3.tumblr.com](http://voyager3.tumblr.com/)_

![Terrain Entities](http://25.media.tumblr.com/tumblr_m165bl19YG1qgurm4o1_1280.png)

![Night Terrain](http://25.media.tumblr.com/tumblr_lyannkY9pg1qgurm4o1_r1_1280.png)

![Trees](http://24.media.tumblr.com/tumblr_lxkeau5hUf1qgurm4o1_1280.png)


text:
package uk.ac.ncl.openlab.intake24.foodsql

import java.sql.Connection

import anorm.{Macro, SQL, SqlParser}
import uk.ac.ncl.openlab.intake24.errors._

trait SimpleValidation {

  private val foodAndLocaleValidationQuery = "SELECT (SELECT true FROM foods WHERE code={food_code}) AS food_exists, (SELECT true FROM locales WHERE id={locale_id}) as locale_exists"

  private val categoryAndLocaleValidationQuery = "SELECT (SELECT true FROM categories WHERE code={category_code}) AS category_exists, (SELECT true FROM locales WHERE id={locale_id}) as locale_exists"

  private val localeValidationQuery = "SELECT (SELECT true FROM locales WHERE id={locale_id}) AS locale_exists"

  private case class FoodAndLocaleValidationRow(food_exists: Option[Boolean], locale_exists: Option[Boolean])

  private case class CategoryAndLocaleValidationRow(category_exists: Option[Boolean], locale_exists: Option[Boolean])

  private def checkTransactionIsolation[E >: UnexpectedDatabaseError](conn: Connection)(block: => Either[E, Unit]) = {
    if (conn.getAutoCommit() || (conn.getTransactionIsolation != Connection.TRANSACTION_REPEATABLE_READ))
      Left(UnexpectedDatabaseError(new RuntimeException("Connection must be in manual commit, repeatable read mode for simple validation")))
    else
      block
  }

  protected def validateLocale(locale: String)(implicit conn: java.sql.Connection): Either[LocaleError, Unit] = {
    checkTransactionIsolation[LocaleError](conn) {
      val validation = SQL(localeValidationQuery).on("locale_id" -> locale).executeQuery().as(SqlParser.bool("locale_exists").?.single)

      if (validation.isEmpty)
        Left(UndefinedLocale(new RuntimeException()))
      else
        Right(())
    }
  }

  protected def validateFoodAndLocale(foodCode: String, locale: String)(implicit conn: java.sql.Connection): Either[LocalLookupError, Unit] = {
    checkTransactionIsolation[LocalLookupError](conn) {
      val validation = SQL(foodAndLocaleValidationQuery).on("food_code" -> foodCode, "locale_id" -> locale).executeQuery().as(Macro.namedParser[FoodAndLocaleValidationRow].single)

      if (validation.food_exists.isEmpty) {
        Left(RecordNotFound(new RuntimeException(foodCode)))
      } else if (validation.locale_exists.isEmpty) {
        Left(UndefinedLocale(new RuntimeException(locale)))
      } else {
        Right(())
      }
    }
  }

  protected def validateCategoryAndLocale(categoryCode: String, locale: String)(implicit conn: Connection): Either[LocalLookupError, Unit] = {
    checkTransactionIsolation[LocalLookupError](conn) {
      val validation = SQL(categoryAndLocaleValidationQuery).on("category_code" -> categoryCode, "locale_id" -> locale).executeQuery().as(Macro.namedParser[CategoryAndLocaleValidationRow].single)

      if (validation.category_exists.isEmpty) {
        Left(RecordNotFound(new RuntimeException(categoryCode)))
      } else if (validation.locale_exists.isEmpty) {
        Left(UndefinedLocale(new RuntimeException(locale)))
      } else {
        Right(())
      }
    }
  }
}


text:
var drawps071 = function drawps071(){

    var canvas = document.getElementById('canvas71')
    var context = canvas.getContext('2d')

    // context.canvas.width  = window.innerWidth;
    // context.canvas.height = window.innerHeight;
    context.clearRect(0, 0, canvas.width, canvas.height);

    pixelArray=[];
    var setColor = function(hue, saturation, lightness){

        var colorString = "hsl("+
        hue+","
        +saturation
        +"%,"
        +lightness
        +"%)";
        context.fillStyle = colorString;
    }
    function drawImage(imageObj) {
        var imageX = 0;
        var imageY = 0;
        var imageWidth = imageObj.width;
        var imageHeight = imageObj.height;
        context.drawImage(imageObj, imageX, imageY);
        var imageData = context.getImageData(imageX, imageY, imageWidth, imageHeight);
        var data = imageData.data;
        //console.log(data)
        //iterate over all pixels
        for (var i = 0, n = data.length; i < n; i +=4){
            var red = data[i];
            var green = data[i + 1];
            var blue = data[i + 2];
            var alpha = data[i + 3];
        }
        //iterate over all pixels based on x and y coordinates
        for (var y = 0; y < imageHeight; y+=5){
            //loop through each column
            for (var x = 0; x < imageWidth; x+=5){
                var red = data[((imageWidth * y) + x) * 4];
                var green = data[((imageWidth * y) + x) * 4 + 1];
                var blue = data [((imageWidth * y) + x) * 4 + 2];
                var alpha = data[((imageWidth * y) + x) * 4 + 3];
                pixelArray.push({ x:x, y:y, red:red, green:green, blue:blue, a:alpha })
            }
        }
    }

    var imageObj = new Image();
        imageObj.onload = function(){
        drawImage(this);

    };
    imageObj.src = "pointalism.jpg";

    $('#canvas71').mousemove(function(e) {
        var pos = findPos(this);
        var x = e.pageX - pos.x;
        var y = e.pageY - pos.y;
        var coord = "x=" + x + ", y=" + y;
        console.log(coord)
        var c = context;
        var p = c.getImageData(x, y, 1, 1).data;
        var hex = "#" + ("000000" + rgbToHex(p[0], p[1], p[2])).slice(-6);

       // context.fillRect(x,y,50,20);

        context.beginPath();
        context.arc(x, y, 10, 0, 2 * Math.PI, true);
        context.fill();
        context.fillStyle = hex;
        //drawGrid()
    });

    function findPos(obj) {
        var curleft = 0, curtop = 0;
        if (obj.offsetParent) {
            do {
                curleft += obj.offsetLeft;
                curtop += obj.offsetTop;
            } while (obj = obj.offsetParent);
            return { x: curleft, y: curtop };
        }
        return undefined;
    }

    function rgbToHex(r, g, b) {
        if (r > 255 || g > 255 || b > 255)
            throw "Invalid color component";
        return ((r << 16) | (g << 8) | b).toString(16);
    }

}

function configuration() {
  return {
    "rows": 80,
    "cols": 52,
    "size": 6,
    "separation": 2,
    // "color_1": "#dd0000",
    // "color_2": "#00dd00",
  };
}

function drawGrid(n) {

    var config = configuration(),
        canvas  = document.getElementById('canvas71');

    function getOffset(el) {
        var _x = 0;
        var _y = 0;
        while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
            _x += el.offsetLeft - el.scrollLeft;
            _y += el.offsetTop - el.scrollTop;
            el = el.offsetParent;
        }
        return { top: _y, left: _x };
    };

    function getMousePos(canvas, evt) {
        var rect = canvas.getBoundingClientRect();
        var offset = getOffset(canvas);
        return {
            x: evt.pageX - offset.left,
            y: evt.pageY - offset.top,
        };
    };

    function getCoordinateByNum(num) {
        return config.separation + num * (config.separation + config.size)
    }

    function getNumByCoordinate(x) {
        return Math.floor((x - config.separation) / (config.size +  config.separation))
    }

    function onMouseOver(evt) {
        var x = evt.pageX,
            y = evt.pageY,
            mPos = getMousePos(canvas, evt),
            tooltipSpan = document.getElementById('tt'); // relative position

        tooltipSpan.style.top = (y + 20) + 'px';
        tooltipSpan.style.left = (x + 20) + 'px';

        var numX = getNumByCoordinate(mPos.x);
        var numY = getNumByCoordinate(mPos.y);

        tooltipSpan.innerHTML = 'row:' + (numY + 1) + ', col:' + (numX + 1 );
        tooltipSpan.style.display = 'none';
        if(
            mPos.x >= getCoordinateByNum(numX)
            && mPos.x < config.size+ getCoordinateByNum(numX)
            && mPos.y >= getCoordinateByNum(numY)
            && mPos.y < config.size + getCoordinateByNum(numY)

        ) {
            tooltipSpan.style.display = 'block';
        }
    }

    function init() {
        var i, j,
            x = config.separation,
            y = config.separation,
            nSquares = 0, context = canvas.getContext('2d');

        canvas.width = getCoordinateByNum(config.cols);
        canvas.height = getCoordinateByNum(config.rows);
        canvas.style.backgroundColor = '#d3d3d3'; //light grey, so we see where canvas is

        //drawing
        context.fillStyle = config.color_1;
        context.beginPath();
        for(i = 0; i < config.rows; i++) {
            for(j = 0; j < config.cols; j++) {
                x = getCoordinateByNum(j);
                y = getCoordinateByNum(i);
                context.rect(x, y, config.size, config.size);

                nSquares++;
                if(nSquares == n) {
                    context.fill();
                    context.beginPath();
                    context.fillStyle = config.color_2;
                }
            }

        }
        context.fill();
        canvas.addEventListener('mousemove', onMouseOver, false);
    }

    init();

}


text:
import uuid
import random
import os

from django.conf import settings
from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser

NAMES = ['Liam', 'Emma', 'Noah', 'Olivia', 'Ethan', 'Sophia', 'Mason', 'Ava', 'Logan', 'Isabella', 'Lucas', 'Mia', 'Jacob', 'Charlotte', 'Aiden', 'Emily', 'Jackson', 'Abigail', 'Jack', 'Harper', 'Elijah', 'Avery', 'Benjamin', 'Madison', 'James', 'Ella', 'Luke', 'Amelia', 'William', 'Lily', 'Michael', 'Chloe', 'Alexander', 'Sofia', 'Oliver', 'Evelyn', 'Gabriel', 'Hannah', 'Daniel', 'Zoey', 'Carter', 'Aria', 'Owen', 'Addison', 'Henry', 'Grace', 'Matthew', 'Aubrey', 'Ryan', 'Ellie', 'Jayden', 'Zoe', 'Wyatt', 'Audrey', 'Caleb', 'Natalie', 'Nathan', 'Elizabeth', 'Andrew', 'Scarlett', 'Dylan', 'Layla', 'Isaac', 'Victoria', 'Joshua', 'Brooklyn', 'Connor', 'Lucy', 'Sebastian', 'Claire', 'Hunter', 'Lillian', 'David', 'Anna', 'Eli', 'Mila', 'Landon', 'Nora', 'Samuel', 'Leah']

def file_name_generator(ins, filename):
    _, ext = os.path.splitext(filename)
    filename = '{}{}'.format(uuid.uuid4(), ext)
    return os.path.join('files', filename)

class ExtendedUserManager(BaseUserManager):
    def create_user(self, email, password=None, first_name=None, last_name=None):
        """
        Creates and saves a User with the given email, date of
        birth and password.
        """
        if not email:
            raise ValueError('Users must have an email address')

        if first_name is None or last_name is None:
            first_name = random.choice(NAMES)
            last_name = 'Jung'

        user = self.model(
            email=self.normalize_email(email),
            first_name=first_name,
            last_name=last_name
        )

        user.set_password(password)
        user.save(using=self._db)
        return user

    def create_superuser(self, email, password):
        """
        Creates and saves a superuser with the given email, date of
        birth and password.
        """
        user = self.create_user(email,
                                password=password)
        user.is_admin = True
        user.save(using=self._db)
        return user

class ExtendedUser(AbstractBaseUser):
    email = models.EmailField(max_length=255, unique=True)
    first_name = models.CharField(max_length=100)
    last_name = models.CharField(max_length=100)
    is_active = models.BooleanField(default=True)
    is_admin = models.BooleanField(default=False)
    lat = models.DecimalField(max_digits=10, decimal_places=7, default=0.0)
    lang = models.DecimalField(max_digits=10, decimal_places=7, default=0.0)
    placename = models.TextField(default='')
    address = models.TextField(default='')

    USERNAME_FIELD = 'email'

    objects = ExtendedUserManager()
    REQUIRED_FIELDS = []

    def get_full_name(self):
        # The user is identified by their email address
        return self.first_name + ' ' + self.last_name

    def get_short_name(self):
        # The user is identified by their email address
        return self.first_name

    def __unicode__(self):
        return self.email

    def has_perm(self, perm, obj=None):
        return True

    def has_module_perms(self, app_label):
        return True

    @property
    def is_staff(self):
        return self.is_admin

class UserFiles(models.Model):
    userid = models.ForeignKey(ExtendedUser, related_name='files')
    uploaded_file = models.FileField(upload_to=file_name_generator, max_length=100)
    actual_name = models.CharField(max_length=100)
    upload_time = models.DateTimeField(auto_now_add=True)


text:
{
    matrix_id: '2769',
    name: 'mycielskian13',
    group: 'Mycielski',
    description: 'Mycielskian graph M13',
    author: 'J. Mycielski',
    editor: 'S. Kolodziej',
    date: '2018',
    kind: 'undirected graph',
    problem_2D_or_3D: '0',
    num_rows: '6143',
    num_cols: '6143',
    nonzeros: '1227742',
    num_explicit_zeros: '0',
    num_strongly_connected_components: '1',
    pattern_symmetry: '1.000',
    numeric_symmetry: '1.000',
    rb_type: 'binary',
    structure: 'symmetric',
    cholesky_candidate: 'no',
    positive_definite: 'no',
    notes: 'Mycielskian graph M13.

The Mycielskian graph sequence generates graphs that are triangle-free
and with a known chromatic number (i.e. the minimum number of colors
required to color the vertices of the graph).

Known properties of this graph (M13) include the following:

 * M13 has a minimum chromatic number of 13.
 * M13 is triangle-free (i.e. no cycles of length 3 exist).
 * M13 has a Hamiltonian cycle.
 * M13 has a clique number of 2.
 * M13 is factor-critical, meaning every subgraph of |V|-1 vertices has
   a perfect matching.

Mycielski graphs were first described by Jan Mycielski in the following
publication:

    Mycielski, J., 1955. Sur le coloriage des graphes. Colloq. Math.,
    3: 161-162.

',
    image_files: 'mycielskian13.png,',
}


text:
var bluebird    = require('bluebird')
var nodeUUID    = require('uuid')
var affirm      = require('affirm.js')
var _           = require('lodash')
var mangler     = require('mangler')
var util        = require('util')
var InsightUtil = require('insight-util')
var marginUtil  = require('coinpit-common/marginUtil')
var bitcoinutil = require("bitcoinutil")
var txutil      = require('./txutil')

module.exports = function (loginless, configs) {
  var account = {}
  var positions, pnl, availableMargin, readonlyApp, ioconnected
  var bidAsk  = {}

  var promises        = {}
  var band            = {}
  account.loginless   = loginless
  account.config      = configs.config
  account.instruments = configs.instruments
  account.insightUtil = InsightUtil(account.config.blockchainapi.uri)
  require('coinpit-common/instruments').init(account.instruments)
  var validator      = require("./validator")
  account.openOrders = {}
  account.logging    = false

  // account.multisigBalance
  // account.marginBalance

  account.getOpenOrders = function () {
    return _.cloneDeep(account.openOrders)
  }

  account.getInstruments = function () {
    return account.instruments
  }

  account.getBidAsk = function () {
    return bidAsk
  }

  account.getIndexBands = function () {
    return band
  }

  account.getBalance = function () {
    return {
      balance        : account.multisigBalance.balance + account.marginBalance.balance + (pnl ? pnl.pnl : 0),
      availableMargin: availableMargin,
      multisig       : _.cloneDeep(account.multisigBalance),
      margin         : _.cloneDeep(account.marginBalance)
    }
  }

  var PATCH_OPS     = {}
  PATCH_OPS.add     = function (patch) {
    affirm(patch.value && Array.isArray(patch.value), 'value must be a list of orders')
  }
  PATCH_OPS.remove  = function (patch) {
    affirm(patch.value && Array.isArray(patch.value), 'value must be a list of orders uuids to be cancelled')
  }
  PATCH_OPS.replace = function (patch) {
    affirm(patch.value && Array.isArray(patch.value), 'value must be a list of orders')
  }
  PATCH_OPS.merge   = function (patch) {
    affirm(patch.value && Array.isArray(patch.value), 'value must be a list of orders uuids to be merged')
  }
  PATCH_OPS.split   = function (patch) {
    // affirm(patch.value && Array.isArray(patch.value), 'value must be a uuid to be split')
  }

  account.patchOrders = function (patch) {
    try {
      affirm(patch && Array.isArray(patch), 'patch must be an array')
      if (patch.length === 0) return emptyPromise()
      for (var i = 0; i < patch.length; i++) {
        var each       = patch[i];
        var opValidate = PATCH_OPS[each.op]
        affirm(opValidate, 'Invalid operation')
        opValidate(each)
      }
      logPatch(patch)
    } catch (e) {
      return promiseError(e)
    }
    return promised(patch, "PATCH", "/order")
  }

  account.createOrders = function (orders) {
    try {
      logOrders(orders)
      validator.validateCreateOrder(account.instruments, orders)
      account.assertAvailableMargin(orders)
    } catch (e) {
      return promiseError(e)
    }
    return promised(orders, "POST", "/order")
  }

  account.updateOrders = function (orders) {
    try {
      logOrders(orders)
      // validator.validateUpdateOrder(account.instruments, orders, account.openOrders)
      // account.assertAvailableMargin(orders)
    } catch (e) {
      return promiseError(e)
    }
    return promised({ orders: orders }, "PUT", "/order")
  }

  account.cancelOrder = function (order) {
    return promised([order.uuid], "DELETE", "/order")
  }

  account.cancelOrders = function (orders) {
    return bluebird.all(orders.map(function (order) {
      return account.cancelOrder(order)
    }))
  }

  account.getClosedOrders = function (symbol, uuid) {
    return loginless.rest.get("/contract/" + symbol + "/order/closed" + (uuid ? "?from=" + uuid : ""))
  }

  account.transferToMargin = function (amountInSatoshi, feeInclusive) {
    return account.insightUtil.getConfirmedUnspents(account.multisigBalance.address).then(function (confirmedUnspents) {
      var tx     = txutil.createTx(
        {
          input       : account.multisigBalance.address,
          destination : account.marginBalance.address,
          amount      : amountInSatoshi,
          unspents    : confirmedUnspents,
          isMultisig  : true,
          network     : account.config.network,
          feeInclusive: feeInclusive
        })
      var signed = bitcoinutil.sign(tx, account.userPrivateKey, account.redeem, true)
      return loginless.rest.post('/margin', { requestid: nodeUUID.v4() }, [{ txs: [signed] }])
    })
  }

  account.withdraw = function (address, amountSatoshi, feeSatoshi) {
    return account.insightUtil.getConfirmedUnspents(account.accountid).then(function (unspents) {
      var amount   = Math.floor(amountSatoshi)
      var fee      = Math.floor(feeSatoshi)
      var tx       = txutil.createTx({ input: account.accountid, isMultisig: true, amount: amount, destination: address, unspents: unspents, txFee: fee })
      var signedTx = bitcoinutil.sign(tx, account.userPrivateKey, account.redeem, true)
      return loginless.rest.post('/tx', {}, { tx: signedTx })
    })
  }

  account.recoveryTx = function () {
    return loginless.rest.get('/withdrawtx').then(function (withdraw) {
      return bitcoinutil.sign(withdraw.tx, account.userPrivateKey, account.redeem)
    }).catch(handleError)
  }

  account.clearMargin = function () {
    return loginless.rest.del("/margin").catch(handleError)
  }

  account.updateAccountBalance = function () {
    return bluebird.all([account.insightUtil.getAddress(account.serverAddress), account.insightUtil.getAddress(account.accountid)])
      .then(function (balances) {
        addressListener(balances[0])
        addressListener(balances[1])
      })
  }

  account.getAll = function () {
    return loginless.rest.get("/account").then(refreshWithUserDetails).catch(handleError)
  }

  account.getPositions = function () {
    return _.cloneDeep(positions)
  }

  account.getPnl = function () {
    return _.cloneDeep(pnl)
  }

  account.fixedPrice = function (symbol, price) {
    affirm(price, 'Invalid Price:' + price)
    return price.toFixed(instrument(symbol).ticksize) - 0
  }

  account.newUUID = function () {
    return nodeUUID.v4()
  }

  account.getPriceBand = function (symbol) {
    return band[symbol]
  }

  function onReadOnly(status) {
    try {
      if (readonlyApp === status.readonly) return
      if (status.readonly) return (readonlyApp = status.readonly)
      loginless.socket.register()
      account.getAll().then(function () {
        readonlyApp = status.readonly
      })
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onConnect(message) {
    try {
      if (!ioconnected) {
        ioconnected = true
        loginless.socket.register()
        account.getAll()
      }
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onDisconnect() {
    ioconnected = false
  }

  function onAuthError(message) {
    try {
      loginless.socket.onAuthError(message)
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  var PATCH_HANDLER = {
    remove : removeOrders,
    replace: updateOrders,
    add    : updateOrders,
    merge  : onOrderMerge,
    split  : updateOrders
  }

  function removeOrders(response) {
    removeOrdersFromCache(response)
    availableMargin = account.calculateAvailableMargin(account.getOpenOrders())
  }

  function onOrderMerge(response) {
    removeOrdersFromCache(response.removed)
    response.added.forEach(function (added) {
      account.openOrders[added.instrument]             = account.openOrders[added.instrument] || {}
      account.openOrders[added.instrument][added.uuid] = added
    })
  }

  function removeOrdersFromCache(uuids) {
    Object.keys(account.openOrders).forEach(function (symol) {
      var orders = account.openOrders[symol]
      uuids.forEach(function (uuid) {
        delete orders[uuid]
      })
    })
  }

  function onOrderPatch(response) {
    try {
      var result = response.result
      result.forEach(function (eachResponse) {
        if (eachResponse.error) return console.log('could not complete the request ', eachResponse)
        if (PATCH_HANDLER[eachResponse.op]) PATCH_HANDLER[eachResponse.op](eachResponse.response)
        else console.log('eachResponse.op not found ', eachResponse.op, eachResponse)
      })
      account.respondSuccess(response.requestid, _.cloneDeep(response.result))
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onOrderAdd(response) {
    try {
      updateOrders(response.result)
      account.respondSuccess(response.requestid, _.cloneDeep(response.result))
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onOrderUpdate(response) {
    onOrderAdd(response)
  }

  account.onOrderDel = function onOrderDel(response) {
    try {
      removeOrdersFromCache(response.result)
      availableMargin = account.calculateAvailableMargin(account.getOpenOrders())
      account.respondSuccess(response.requestid, response.result)
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onFlat(response) {
    try {
      account.getAll().then(function () {
        account.respondSuccess(response.requestid, _.cloneDeep(account.openOrders))
      })
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onError(response) {
    try {
      respondError(response.requestid, response.error)
      // refreshWithUserDetails(response.userDetails)
      if (!response.requestid) {
        //todo: this needs to be handled
        handleError("Error without requestid", response.error)
      }
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onUserMessage(message) {
    try {
      if (account.logging) util.log(Date.now(), "user details refreshed ")
      if (message.error) {
        handleError(message.error)
      }
      refreshWithUserDetails(message.account)
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onTrade(trade) {
    // util.log('Date.now(), trades', trade)

  }

  function promised(body, method, uri) {
    var requestid = nodeUUID.v4()
    return new bluebird(function (resolve, reject) {
      try {
        promises[requestid] = { resolve: resolve, reject: reject, time: Date.now() }
        loginless.socket.send({ method: method, uri: uri, headers: { requestid: requestid }, body: body })
      } catch (e) {
        onError({ requestid: requestid, error: e })
      }
    })
  }

  function updateOrders(orders) {
    for (var i = 0; i < orders.length; i++) {
      account.openOrders[orders[i].instrument]                 = account.openOrders[orders[i].instrument] || {}
      account.openOrders[orders[i].instrument][orders[i].uuid] = orders[i]
    }
    availableMargin = account.calculateAvailableMarginIfCrossShifted(account.getOpenOrders())
  }

  function onOrderBook(data) {
    try {
      var symbols = Object.keys(data)
      for (var i = 0; i < symbols.length; i++) {
        var symbol     = symbols[i];
        bidAsk[symbol] = {
          bid: data[symbol].bid,
          ask: data[symbol].ask
        }
      }
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onDiffOrderBook(diffOrderBook) {
    try {
      onOrderBook(diffOrderBook)
    } catch (e) {
      util.log(e);
      util.log(e.stack)
    }
  }

  function onConfig(config) {
    account.config = config
  }

  account.respondSuccess = function (requestid, response) {
    respond(requestid, response, 'resolve')
  }

  function respondError(requestid, response) {
    respond(requestid, response, 'reject')
  }

  function respond(requestid, response, method) {
    if (!requestid || !promises[requestid]) return
    promises[requestid][method](response)
    delete promises[requestid]
  }

  function handleError() {
    if (account.logging) util.log(Date.now(), arguments)
  }

  function refreshWithUserDetails(userDetails) {
    if (!userDetails) return
    account.openOrders = userDetails.orders
    positions          = userDetails.positions
    pnl                = userDetails.pnl
    availableMargin    = userDetails.margin
    return userDetails
  }

  account.assertAvailableMargin = function (orders) {
    var margin = account.getPostAvailableMargin(orders)
    affirm(margin >= 0, "Insufficient margin ", margin, ".add margin")
  }

  account.getPostAvailableMargin = function (orders) {
    var ordersMap = getOpenOrdersIfSuccess(orders)
    return account.calculateAvailableMarginIfCrossShifted(ordersMap)
  }

  function getOpenOrdersIfSuccess(orders) {
    var ordersMap = _.cloneDeep(account.openOrders)
    for (var i = 0; i < orders.length; i++) {
      var order                         = orders[i];
      var uuid                          = order.uuid || nodeUUID.v4()
      ordersMap[order.instrument]       = ordersMap[order.instrument] || {}
      ordersMap[order.instrument][uuid] = order
    }
    return ordersMap
  }

  account.calculateAvailableMargin = function (orders) {
    return marginUtil.getMaxCrossStopMargin(orders, pnl, positions, account.marginBalance.balance, band)
  }

  account.calculateAvailableMarginIfCrossShifted = function (orders) {
    return marginUtil.getMinCrossStopMargin(orders, pnl, positions, account.marginBalance.balance, band)
  }

  /*
   account.getMaxMargin = function () {
   return account.calculateAvailableMarginIfCrossShifted(account.getOpenOrders())
   }
   */

  function logPatch(payload) {
    if (!account.logging) return
    util.log(Date.now(), JSON.stringify(payload, null, -2))
  }

  function logOrders(orders) {
    if (!account.logging) return
    orders.forEach(function (order) {
      util.log(Date.now(), order.uuid ? "update" : "create", "uuid", order.uuid, "price", order.price, "side", order.side, "type", order.orderType)
    })
  }

  function copyFromLoginlessAccount() {
    Object.keys(loginless.account).forEach(function (key) {
      account[key] = loginless.account[key]
    })
  }

  function setupSocketEvents() {
    var eventMap = {
      // version         : onVersion,
      trade           : onTrade,
      orderbook       : onOrderBook,
      difforderbook   : onDiffOrderBook,
      config          : onConfig,
      readonly        : onReadOnly,
      // advisory        : onAdvisory,
      reconnect       : onConnect,
      connect_error   : onDisconnect,
      connect_timeout : onDisconnect,
      reconnect_error : onDisconnect,
      reconnect_failed: onDisconnect,
      order_add       : onOrderAdd,
      order_del       : account.onOrderDel,
      order_error     : onError,
      order_del_all   : onFlat,
      order_update    : onOrderUpdate,
      order_patch     : onOrderPatch,
      account         : onUserMessage,
      auth_error      : onAuthError,
      priceband       : onPriceBand,
      instruments     : updateInstruments
    }

    Object.keys(eventMap).forEach(function (event) {
      loginless.socket.removeListener(event, eventMap[event])
      loginless.socket.on(event, eventMap[event])

    })
    loginless.socket.emit('GET /state', "")
  }

  function updateInstruments(instrumentConfigs) {
    account.instruments = instrumentConfigs
    require('coinpit-common/instruments').init(account.instruments)
    return account.getAll()
  }

  function addressListener(addressInfo) {
    switch (addressInfo.address) {
      case account.accountid:
        // if (myConfirmedBalance !== addressInfo.confirmed) adjustMarginSequentially()
        account.multisigBalance = addressInfo
        break;
      case account.serverAddress:
        account.marginBalance = addressInfo
        break
      default:
        account.insightUtil.unsubscribe(addressInfo.address)
    }
  }

  function onPriceBand(priceBand) {
    band = priceBand
  }

  account.init = function init() {
    setupSocketEvents()
    copyFromLoginlessAccount()
    account.insightUtil.subscribe(account.accountid, addressListener)
    account.insightUtil.subscribe(account.serverAddress, addressListener)
    setInterval(timeoutPromises, 1000)
  }

  function emptyPromise() {
    return new bluebird(function (resolve, reject) {
      return resolve()
    })
  }

  function promiseError(e) {
    return new bluebird(function (resolve, reject) {
      return reject(e)
    })
  }

  function timeoutPromises() {
    try {
      Object.keys(promises).forEach(function (requestid) {
        var promise = promises[requestid]
        if ((Date.now() - promise.time) > 10000) {
          onError({ requestid: requestid, error: 'Request Timed Out for ' + requestid })
          util.log('timeoutPromises: promise removed for', requestid, 'after ', (Date.now() - promise.time), 'ms')
        }
      })
    } catch (e) {
      util.log('ERROR: timeout promises', e.stack)
    }
  }

  return account
}


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

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Azure.Devices.Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4680cfbc-a5f8-4d62-9aa4-44a7b62a02d3")]

[assembly: AssemblyVersion("1.0.0.0")]

#if (RELEASE_DELAY_SIGN)
[assembly: AssemblyDelaySignAttribute(true)]
[assembly: AssemblyKeyFileAttribute("35MSSharedLib1024.snk")]
#else
[assembly: InternalsVisibleTo("Microsoft.Azure.Devices.Client.Test")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
#endif

// Version information for an assembly follows semantic versioning 1.0.0 (because
// NuGet didn't support semver 2.0.0 before VS 2015). See semver.org for details.
[assembly: AssemblyInformationalVersion("1.0.0-preview-010")]


text:
package org.apache.hyracks.test.support;

import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManager;
import org.apache.hyracks.storage.am.common.api.IIndexLifecycleManagerProvider;

public class TestIndexLifecycleManagerProvider implements IIndexLifecycleManagerProvider {

    private static final long serialVersionUID = 1L;

    @Override
    public IIndexLifecycleManager getLifecycleManager(IHyracksTaskContext ctx) {
        return TestStorageManagerComponentHolder.getIndexLifecycleManager(ctx);
    }

}


text:
#pragma once

#include "Base/BaseTypes.h"
#include "Base/Token.h"

#if defined(__DAVAENGINE_IPHONE__)

#include "Engine/Private/EnginePrivateFwd.h"
#include "Engine/Private/Dispatcher/UIDispatcher.h"
#include "Engine/EngineTypes.h"
#include "Functional/Function.h"

namespace rhi
{
struct InitParam;
}

namespace DAVA
{
namespace Private
{
class WindowImpl final
{
public:
    WindowImpl(EngineBackend* engineBackend, Window* window);
    ~WindowImpl();

    bool Create();
    void Resize(float32 width, float32 height);
    void Activate();
    void Close(bool appIsTerminating);
    void SetTitle(const String& title);
    void SetMinimumSize(Size2f size);
    void SetFullscreen(eFullscreen newMode);

    void RunAsyncOnUIThread(const Function<void()>& task);
    void RunAndWaitOnUIThread(const Function<void()>& task);

    void* GetHandle() const;

    bool IsWindowReadyForRender() const;
    void InitCustomRenderParams(rhi::InitParam& params);

    void TriggerPlatformEvents();
    void ProcessPlatformEvents();

    void SetSurfaceScaleAsync(const float32 scale);

    void SetCursorCapture(eCursorCapture mode);
    void SetCursorVisibility(bool visible);

    void UIEventHandler(const UIDispatcherEvent& e);

    EngineBackend* engineBackend = nullptr;
    Window* window = nullptr; // Window frontend reference
    MainDispatcher* mainDispatcher = nullptr; // Dispatcher that dispatches events to DAVA main thread
    UIDispatcher uiDispatcher; // Dispatcher that dispatches events to window UI thread

    std::unique_ptr<WindowNativeBridge> bridge;

    Token appBecomeOrResignActiveToken;
    Token appDidEnterForegroundOrBackgroundToken;

    // Friends
    friend class PlatformCore;
    friend struct WindowNativeBridge;
};

inline void WindowImpl::InitCustomRenderParams(rhi::InitParam& /*params*/)
{
    // No custom render params
}

} // namespace Private
} // namespace DAVA

#endif // __DAVAENGINE_IPHONE__


text:
<!doctype html>

    <meta charset="UTF-8">

    <title>World of Warplanes | Статистика</title>
    <meta name="description" content="Статистика игроков World of Warplanes">

    <meta name="viewport" content="width=500,user-scalable=no">

    <link rel="stylesheet" href="css/main.css">


text:
package com.github.joshholl.intellij.csharp.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface CSharpDelegateModifier extends PsiElement {

}