text:
var $$ = function(selector, el) {
  if (!el) {
    el = document;
  }
  // return el.querySelectorAll(selector);
  // Note: the returned object is a NodeList.
  // If you'd like to convert it to a Array for convenience, use this instead:
  return Array.prototype.slice.call(el.querySelectorAll(selector));
}

var $ = function(selector, el) {
  if (!el) {
    el = document;
  }
  var result = $$(selector, el);
  return result;
}

/**
 * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
 *
 * @param {String} text The text to be rendered.
 * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
 *
 * @see http://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
 */
var getTextWidth = function(text, font) {
  // re-use canvas object for better performance
  var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
  var context = canvas.getContext('2d');
  context.font = font || '12px arial';
  var metrics = context.measureText(text);
  return metrics.width;
};

var createNotice = function(pos) {
  var div = document.createElement('div');
  div.style.font = '12px arial';
  div.style.height = '2em';
  div.style.lineHeight = '2em';
  div.style.borderRadius = '2px';
  div.style.width = (getTextWidth('Magnet link added.') + 4) + 'px';
  div.innerHTML = 'Magnet link added.';
  div.style.position = 'absolute';
  div.style.top = pos.y  + 'px';
  div.style.left = pos.x  + 'px';
  div.style.background = '#2491FF';
  div.style.border = '1px solid #4DC0E8';
  div.style.padding = '2px';
  return div;
};

//http://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window
var getSize = function() {
  return {x: window.innerWidth, y: window.innerHeight};
}

//The magnet link has been added and we can show taht to the user.
self.port.on('magnetAdded', function() {
  var size = getSize();
  size.x = 10;
  size.y -= 40;
  console.log(size);
  var div = createNotice(size);
  document.body.appendChild(div);

  setTimeout(function() {
    div.style.visibility = 'hidden';
    div.style.display = 'none';
  }, 3000);
});

var elems = $('a[href^="magnet:"]');
elems.forEach(function(elem) {
  elem.addEventListener('click', function(event) {
    event.preventDefault();
    self.port.emit('addMagnet', event.currentTarget.getAttribute('href'));
  });
});


text:
package com.xf.college.model;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xufeng on 2017/3/27.
 */
public class HonorType {

    private  int id;
    private String name;
    private String des;
    private String img;

    public static final Map<Integer,String> typeMap = new HashMap();

    static {
        typeMap.put(1,"竞赛类");
        typeMap.put(2,"书法类");
        typeMap.put(3,"计算机科学与技术");
        typeMap.put(4,"体育类");
        typeMap.put(5,"音乐类");
    }

    public  static String getTypeName(int code ){
        return typeMap.get(code);
    }

    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }

    public HonorType() {

    }
    public HonorType(String name, String des) {
        this.name = name;
        this.des = des;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="add">Add</string>
    <string name="remove">Remove</string>
    <string name="home">Home</string>
    <string name="misc">Misc.</string>
    <string name="search">Search</string>
</resources>


text:
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// 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.
package com.google.devtools.build.lib.runtime.commands;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.buildtool.AqueryBuildTool;
import com.google.devtools.build.lib.buildtool.AqueryBuildTool.AqueryActionFilterException;
import com.google.devtools.build.lib.buildtool.BuildRequest;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.query2.aquery.ActionGraphQueryEnvironment;
import com.google.devtools.build.lib.query2.aquery.AqueryOptions;
import com.google.devtools.build.lib.query2.engine.QueryEnvironment.QueryFunction;
import com.google.devtools.build.lib.query2.engine.QueryException;
import com.google.devtools.build.lib.query2.engine.QueryExpression;
import com.google.devtools.build.lib.query2.engine.QueryParser;
import com.google.devtools.build.lib.runtime.BlazeCommand;
import com.google.devtools.build.lib.runtime.BlazeCommandResult;
import com.google.devtools.build.lib.runtime.BlazeRuntime;
import com.google.devtools.build.lib.runtime.Command;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.util.ExitCode;
import com.google.devtools.common.options.OptionPriority.PriorityCategory;
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.OptionsParsingResult;

/** Handles the 'aquery' command on the Blaze command line. */
@Command(
    name = "aquery",
    builds = true,
    inherits = {BuildCommand.class},
    options = {AqueryOptions.class},
    usesConfigurationOptions = true,
    shortDescription = "Analyzes the given targets and queries the action graph.",
    allowResidue = true,
    completion = "label",
    help = "resource:aquery.txt")
public final class AqueryCommand implements BlazeCommand {

  @Override
  public void editOptions(OptionsParser optionsParser) {
    try {
      optionsParser.parse(
          PriorityCategory.COMPUTED_DEFAULT,
          "Option required by aquery",
          ImmutableList.of("--nobuild"));
    } catch (OptionsParsingException e) {
      throw new IllegalStateException("Aquery's known options failed to parse", e);
    }
  }

  @Override
  public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult options) {
    // TODO(twerth): Reduce overlap with CqueryCommand.
    AqueryOptions aqueryOptions = options.getOptions(AqueryOptions.class);
    boolean queryCurrentSkyframeState = aqueryOptions.queryCurrentSkyframeState;

    // When querying for the state of Skyframe, it's possible to omit the query expression.
    if (options.getResidue().isEmpty() && !queryCurrentSkyframeState) {
      env.getReporter()
          .handle(
              Event.error(
                  "Missing query expression. Use the 'help aquery' command for syntax and help."));
      return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
    }

    String query = Joiner.on(' ').join(options.getResidue());
    ImmutableMap<String, QueryFunction> functions = getFunctionsMap(env);

    // Query expression might be null in the case of --skyframe_state.
    QueryExpression expr;
    try {
      expr = query.isEmpty() ? null : QueryParser.parse(query, functions);
    } catch (QueryException e) {
      env.getReporter()
          .handle(Event.error("Error while parsing '" + query + "': " + e.getMessage()));
      return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
    }

    ImmutableList<String> topLevelTargets;
    try {
      topLevelTargets =
          AqueryCommandUtils.getTopLevelTargets(
              aqueryOptions.universeScope, expr, queryCurrentSkyframeState, query);
    } catch (QueryException e) {
      env.getReporter().handle(Event.error(e.getMessage()));
      return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
    }

    BlazeRuntime runtime = env.getRuntime();

    BuildRequest request =
        BuildRequest.create(
            getClass().getAnnotation(Command.class).name(),
            options,
            runtime.getStartupOptionsProvider(),
            topLevelTargets,
            env.getReporter().getOutErr(),
            env.getCommandId(),
            env.getCommandStartTime());

    AqueryBuildTool aqueryBuildTool;

    try {
      aqueryBuildTool = new AqueryBuildTool(env, expr);
    } catch (AqueryActionFilterException e) {
      env.getReporter().handle(Event.error(e.getMessage() + "\n" + expr));
      return BlazeCommandResult.exitCode(ExitCode.PARSING_FAILURE);
    }

    if (queryCurrentSkyframeState) {
      try {
        return aqueryBuildTool.dumpActionGraphFromSkyframe(request);
      } catch (IllegalStateException e) {
        env.getReporter().handle(Event.error(e.getMessage()));
        return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
      }
    }
    ExitCode exitCode = aqueryBuildTool.processRequest(request, null).getExitCondition();
    return BlazeCommandResult.exitCode(exitCode);
  }

  private ImmutableMap<String, QueryFunction> getFunctionsMap(CommandEnvironment env) {
    ImmutableMap.Builder<String, QueryFunction> functionsBuilder = ImmutableMap.builder();

    for (QueryFunction queryFunction : ActionGraphQueryEnvironment.FUNCTIONS) {
      functionsBuilder.put(queryFunction.getName(), queryFunction);
    }

    for (QueryFunction queryFunction : ActionGraphQueryEnvironment.AQUERY_FUNCTIONS) {
      functionsBuilder.put(queryFunction.getName(), queryFunction);
    }

    for (QueryFunction queryFunction : env.getRuntime().getQueryFunctions()) {
      functionsBuilder.put(queryFunction.getName(), queryFunction);
    }
    return functionsBuilder.build();
  }
}


text:
#pragma once

#include <backend.hpp>
#include <memory.hpp>
#include <platform.hpp>
#include <thrust/system/cuda/execution_policy.h>

namespace cuda {
struct ThrustArrayFirePolicy
    : thrust::cuda::execution_policy<ThrustArrayFirePolicy> {};

template<typename T>
thrust::pair<thrust::pointer<T, ThrustArrayFirePolicy>, std::ptrdiff_t>
get_temporary_buffer(ThrustArrayFirePolicy, std::ptrdiff_t n) {
    thrust::pointer<T, ThrustArrayFirePolicy> result(
        cuda::memAlloc<T>(n / sizeof(T)).release());

    return thrust::make_pair(result, n);
}

template<typename Pointer>
inline void return_temporary_buffer(ThrustArrayFirePolicy, Pointer p) {
    memFree(thrust::raw_pointer_cast(p));
}

}  // namespace cuda

namespace thrust {
namespace cuda_cub {
template<>
__DH__ inline cudaStream_t get_stream<::cuda::ThrustArrayFirePolicy>(
    execution_policy<::cuda::ThrustArrayFirePolicy> &) {
#if defined(__CUDA_ARCH__)
    return 0;
#else
    return ::cuda::getActiveStream();
#endif
}

__DH__
inline cudaError_t synchronize_stream(const ::cuda::ThrustArrayFirePolicy &) {
#if defined(__CUDA_ARCH__)
    return cudaDeviceSynchronize();
#else
    return cudaStreamSynchronize(::cuda::getActiveStream());
#endif
}

}  // namespace cuda_cub
}  // namespace thrust


text:
package com.newsrxtech.charsetutils.log;

import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;

/**
 *
 * @author https://github.com/michael-joyner/SimpleTextUi
 *
 */
class PrintFormatter extends Formatter {
	private final SimpleDateFormat sdf;

	public PrintFormatter() {
		sdf = new SimpleDateFormat("yyyyMMdd HH:mm:ss z");
		sdf.setTimeZone(TimeZone.getTimeZone("EST5EDT"));
	}

	@Override
	public String format(LogRecord record) {
		String format_date;
		StringBuilder sb = new StringBuilder();
		synchronized (sdf) {
			format_date = sdf.format(new java.util.Date(record.getMillis()));
		}
		sb.append(format_date);
		appendSourceClassName(sb, record);
		sb.append(", ");
		sb.append(record.getMessage());
		return sb.toString();
	}

	private void appendSourceClassName(StringBuilder sb, LogRecord record) {
		String sourceClassName = record.getSourceClassName();
		if (sourceClassName != null) {
			sb.append(" ");
			sb.append(sourceClassName);
		}
	}
}


text:
import codecs
import configparser
import json
import logging
import os
import praw
import sys
import time
from datetime import datetime, timedelta, timezone
from peewee import *

# Set up logging
logging.basicConfig(filename = os.path.join(sys.path[0], "copykun.log"), format = "%(asctime)s %(message)s")
logger = logging.getLogger("copykun")
logger.setLevel(logging.DEBUG)

# Read the config file
if not os.path.isfile(os.path.join(sys.path[0], "copykun.cfg")):
    logger.critical("Configuration file not found: copykun.cfg")
    exit(1)
config = configparser.ConfigParser()
with codecs.open(os.path.join(sys.path[0], "copykun.cfg"), "r", "utf8") as f:
    config.read_file(f)

database = SqliteDatabase(os.path.join(sys.path[0], config.get("Database", "db_name")), threadlocals = True)

class BaseModel(Model):
    class Meta:
        database = database

'''
A reddit submission which contains a link to content to copy
'''
class Post(BaseModel):
    id = CharField(primary_key = True)

'''
Reddit content copied by the bot
'''
class Content(BaseModel):
    permalink = CharField()
    created = IntegerField()
    edited = IntegerField(null = True)
    last_checked = IntegerField()
    update_interval = IntegerField()
    post = ForeignKeyField(Post, related_name = "content", null = True)

'''
A reply posted by the bot
'''
class Reply(BaseModel):
    permalink = CharField()
    latest_content = TextField()
    post = ForeignKeyField(Post, related_name = "replies")

'''
An edit made to a reply by the bot
'''
class Edit(BaseModel):
    content = TextField()
    edit_time = IntegerField()
    post = ForeignKeyField(Post, related_name = "edits")

class Database(object):

    def __init__(self):
        database.connect()

    def __del__(self):
        database.close()

    def create_tables(self):
        database.create_tables([Post, Content, Reply, Edit])

    '''
    Check if a given post exists in the database
    '''
    def is_post_in_db(self, post_id):
        return Post.select().where(Post.id == post_id).exists()

    '''
    Retrieve an interator of Posts which need to be checked for edits
    '''
    def get_posts_to_check_edits(self):
        now = datetime.utcnow().timestamp()
        cutoff = (datetime.utcnow() + timedelta(-7)).timestamp()
        posts = Post.select().join(Content).where(now > Content.last_checked + Content.update_interval and Content.created >= cutoff)
        return posts

    def get_reply_to_post(self, post_id):
        return Reply.select().join(Post).where(Post.id == post_id).first()

    def save_objects(self, objs):
        with database.transaction():
            for obj in objs:
                obj.save()


text:
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Beardcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_RPCCLIENT_H
#define BITCOIN_RPCCLIENT_H

#include "univalue/univalue.h"

UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams);
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)
 * as well as objects and arrays.
 */
UniValue ParseNonRFCJSONValue(const std::string& strVal);

#endif // BITCOIN_RPCCLIENT_H


text:
module Tr8n
  class BaseController < ApplicationController

    layout Tr8n::Config.site_info[:tr8n_layout]

    if Tr8n::Config.tr8n_helpers.any?
      helper *Tr8n::Config.tr8n_helpers
    end

    if Tr8n::Config.skip_before_filters.any?
      skip_before_filter *Tr8n::Config.skip_before_filters
    end

    if Tr8n::Config.before_filters.any?
      before_filter *Tr8n::Config.before_filters
    end

    if Tr8n::Config.after_filters.any?
      after_filter *Tr8n::Config.after_filters
    end

    before_filter :validate_tr8n_enabled, :except => [:translate]
    before_filter :validate_guest_user, :except => [:select, :switch, :translate, :table, :registration]
    before_filter :validate_current_translator, :except => [:select, :switch, :translate, :table, :registration]
    before_filter :validate_remote_application

    layout Tr8n::Config.site_info[:tr8n_layout]

  private

    def validate_remote_application
      return if params[:origin].blank?
      domain = Tr8n::TranslationDomain.find_or_create(params[:origin])
      Tr8n::Config.set_remote_application(domain.application)
    end

    def render_lightbox
      render(:layout => false)
    end

    def dismiss_lightbox
      redirect_to(:controller => "/tr8n/help", :action => "lb_done", :origin => params[:origin])
    end

    def tr8n_features_tabs
      @tabs ||= begin
        tabs = Tr8n::Config.features.clone
        unless Tr8n::Config.multiple_base_languages?
          tabs = tabs.select{|tab| tab[:default_language]} if tr8n_current_language.default?
        end

        unless tr8n_current_user_is_translator? and tr8n_current_translator.manager?
          tabs = tabs.select{|tab| !tab[:manager_only]}
        end

        if tr8n_current_language.dir == 'rtl'
          tabs = tabs.reverse
        end

        tabs
      end
    end
    helper_method :tr8n_features_tabs

    def redirect_to_source
      # Do not allow redirects to external websites
      escaped_origin_host = Regexp.escape("#{request.protocol}#{request.host}")
      if(!params[:source_url].blank? && params[:source_url] =~ /^#{escaped_origin_host}/)
        return redirect_to(params[:source_url])
      end
      return redirect_to(request.env['HTTP_REFERER']) unless request.env['HTTP_REFERER'].blank?
      redirect_to_site_default_url
    end

    def redirect_to_site_default_url
      redirect_to(Tr8n::Config.default_url)
    end

    def page
      params[:page] || 1
    end

    def per_page
      params[:per_page] || 30
    end

    def sanitize_label(label)
  #  do not double escape
  #  CGI::escapeHTML(label.strip)
     ERB::Util.html_escape(label.strip)
    end

    # handle disabled state for tr8n
    def validate_tr8n_enabled
      if Tr8n::Config.disabled?
        trfe("You don't have rights to access that section.")
        return redirect_to(Tr8n::Config.default_url)
      end
    end

    # guest users can still switch between languages outside of the site
    def validate_guest_user
      if tr8n_current_user_is_guest?
        trfe("You must be a registered user in order to access this section of the site.")
        return redirect_to(Tr8n::Config.default_url)
      end
    end

    # make sure that the current user is a translator
    def validate_current_translator
      if tr8n_current_user_is_translator? and tr8n_current_translator.blocked?
        trfe("Your translation privileges have been revoked. Please contact the site administrator for more details.")
        return redirect_to(Tr8n::Config.default_url)
      end

      return if Tr8n::Config.current_user_is_translator?

      redirect_to("/tr8n/translator/registration")
    end

    # make sure that the current user is a language manager
    def validate_language_management
      # admins can do everything
      return if tr8n_current_user_is_admin?

      if tr8n_current_language.default?
        trfe("Only administrators can modify this language")
        return redirect_to(tr8n_features_tabs.first[:link])
      end

      unless tr8n_current_user_is_translator? and tr8n_current_translator.manager?
        trfe("In order to manage a language you first must request to become a manager of that language.")
        return redirect_to(tr8n_features_tabs.first[:link])
      end
    end

    def validate_default_language
      return if Tr8n::Config.multiple_base_languages?
      redirect_to(tr8n_features_tabs.first[:link]) if tr8n_current_language.default?
    end

    def validate_language
      return unless params[:language]
      return if params[:language][:fallback_language_id].blank? # default

      fallback_language = Tr8n::Language.find(params[:language][:fallback_language_id])

      while fallback_language do
        if fallback_language == tr8n_current_language
          return "You are creating an infinite loop with fallback languages. Please ensure that languages do not fall back onto each other."
        end
        fallback_language = fallback_language.fallback_language
      end
    end

    def validate_admin
      unless tr8n_current_user_is_admin?
        trfe("You must be an admin in order to view this section of the site")
        redirect_to_site_default_url
      end
    end

  end
end


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0006_require_contenttypes_0002'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
                ('password', models.CharField(verbose_name='password', max_length=128)),
                ('last_login', models.DateTimeField(verbose_name='last login', blank=True, null=True)),
                ('is_superuser', models.BooleanField(verbose_name='superuser status', help_text='Designates that this user has all permissions without explicitly assigning them.', default=False)),
                ('usuario', models.CharField(unique=True, max_length=50)),
                ('email', models.EmailField(unique=True, max_length=50)),
                ('nombres', models.CharField(null=True, max_length=100)),
                ('apellidos', models.CharField(null=True, max_length=100)),
                ('dni', models.CharField(null=True, max_length=20)),
                ('telefono', models.IntegerField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(verbose_name='groups', help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', to='auth.Group', related_name='user_set', blank=True, related_query_name='user')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='modulos',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True)),
                ('descripcion', models.CharField(max_length=100)),
                ('padre', models.IntegerField()),
                ('url', models.CharField(max_length=150)),
                ('icon', models.CharField(max_length=150)),
            ],
        ),
        migrations.CreateModel(
            name='perfil',
            fields=[
                ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
                ('descripcion', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='permisos',
            fields=[
                ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
                ('ver', models.BooleanField(default=True)),
                ('buscar', models.BooleanField(default=True)),
                ('editar', models.BooleanField(default=True)),
                ('insertar', models.BooleanField(default=True)),
                ('eliminar', models.BooleanField(default=True)),
                ('imprimir', models.BooleanField(default=True)),
                ('idmodulo', models.ForeignKey(to='seguridad.modulos')),
                ('idperfil', models.ForeignKey(to='seguridad.perfil')),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='idperfil',
            field=models.ForeignKey(null=True, to='seguridad.perfil'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(verbose_name='user permissions', help_text='Specific permissions for this user.', to='auth.Permission', related_name='user_set', blank=True, related_query_name='user'),
        ),
    ]


text:
package com.sdl.odata.api.processor.datasource;

import com.sdl.odata.api.ODataErrorCode;
import com.sdl.odata.api.ODataServerException;

/**
 * This exception will be thrown when query processing error occurs,
 * for example this exception will be thrown when trying to retrieve
 * entity with primary key and found more than one entity.
 *
 */
public class ODataQueryProcessingException extends ODataServerException {

    public ODataQueryProcessingException(String message) {
        super(ODataErrorCode.QUERY_RETRIEVAL_ERROR, message);
    }

    public ODataQueryProcessingException(String message, String target) {
        super(ODataErrorCode.QUERY_RETRIEVAL_ERROR, message, target);
    }

    public ODataQueryProcessingException(String message, Throwable cause) {
        super(ODataErrorCode.QUERY_RETRIEVAL_ERROR, message, cause);
    }

    public ODataQueryProcessingException(String message, String target, Throwable cause) {
        super(ODataErrorCode.QUERY_RETRIEVAL_ERROR, message, target, cause);
    }
}


text:
package eu.tobiasheine.bitcoinwatcher.price_sync;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import javax.inject.Inject;

import eu.tobiasheine.bitcoinwatcher.BitcoinWatcherApplication;
import eu.tobiasheine.bitcoinwatcher.di.Dependencies;
import eu.tobiasheine.bitcoinwatcher.price_sync.notifications.IWearableNotifications;

public class SyncService extends Service{

    private static final Object syncServiceLock = new Object();

    @Inject
    ISynchronization synchronization;

    @Inject
    IWearableNotifications wearableNotifications;

    private SyncAdapter syncAdapter;

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        synchronization.syncNow();

        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        BitcoinWatcherApplication.getDependencies().inject(this);

        wearableNotifications.connect();

        synchronized (syncServiceLock) {

            if (syncAdapter == null) {
                syncAdapter = new SyncAdapter(getApplicationContext(), true);
            }
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        return syncAdapter.getSyncAdapterBinder();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        wearableNotifications.disconnect();
    }
}


text:
from __future__ import print_function

import os
import filecmp
import shutil

from stat import *

class Dispatch:
    ''' This class represents a synchronization object '''

    def __init__(self, name=''):
        self.name = name
        self.node_list = []
        self.file_copied_count = 0
        self.folder_copied_count = 0

    def add_node(self, node):
        self.node_list.append(node)

    def compare_nodes(self):
        ''' This method takes the nodes in the node_list and compares them '''
        # For each node in the list
        for node in self.node_list:
            # If the list has another item after it, compare them
            if self.node_list.index(node) < len(self.node_list) - 1:
                node2 = self.node_list[self.node_list.index(node) + 1]
                print('\nComparing Node ' + str(self.node_list.index(node)) + ' and Node ' + str(self.node_list.index(node) + 1) + ':')
                # Passes the two root directories of the nodes to the recursive _compare_directories.
                self._compare_directories(node.root_path, node2.root_path)

    def _compare_directories(self, left, right):
        ''' This method compares directories. If there is a common directory, the
            algorithm must compare what is inside of the directory by calling this
            recursively.
        '''
        comparison = filecmp.dircmp(left, right)
        if comparison.common_dirs:
            for d in comparison.common_dirs:
                self._compare_directories(os.path.join(left, d), os.path.join(right, d))
        if comparison.left_only:
            self._copy(comparison.left_only, left, right)
        if comparison.right_only:
            self._copy(comparison.right_only, right, left)
        left_newer = []
        right_newer = []
        if comparison.diff_files:
            for d in comparison.diff_files:
                l_modified = os.stat(os.path.join(left, d)).st_mtime
                r_modified = os.stat(os.path.join(right, d)).st_mtime
                if l_modified > r_modified:
                    left_newer.append(d)
                else:
                    right_newer.append(d)
        self._copy(left_newer, left, right)
        self._copy(right_newer, right, left)

    def _copy(self, file_list, src, dest):
        ''' This method copies a list of files from a source node to a destination node '''
        for f in file_list:
            srcpath = os.path.join(src, os.path.basename(f))
            if os.path.isdir(srcpath):
                shutil.copytree(srcpath, os.path.join(dest, os.path.basename(f)))
                self.folder_copied_count = self.folder_copied_count + 1
                print('Copied directory \"' + os.path.basename(srcpath) + '\" from \"' + os.path.dirname(srcpath) + '\" to \"' + dest + '\"')
            else:
                shutil.copy2(srcpath, dest)
                self.file_copied_count = self.file_copied_count + 1
                print('Copied \"' + os.path.basename(srcpath) + '\" from \"' + os.path.dirname(srcpath) + '\" to \"' + dest + '\"')

class Node:
    ''' This class represents a node in a dispatch synchronization '''
    def __init__(self, path, name=''):
        self.name = name
        self.root_path = os.path.abspath(path)
        self.file_list = os.listdir(self.root_path)

def syncFiles(src, dst):
    dispatch = Dispatch('dispatch')
    dispatch.add_node(Node(src, 'node1'))
    dispatch.add_node(Node(dst, 'node2'))
    dispatch.compare_nodes()


text:
These files are used to set up [Skeinforge] (http://reprap.org/wiki/Skeinforge) for Zim.

Check the [Wiki] (../../../../wiki) for details.


text:
package org.postgresql.xml;

import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXTransformerFactory;

public interface PGXmlFactoryFactory {
  DocumentBuilder newDocumentBuilder() throws ParserConfigurationException;

  TransformerFactory newTransformerFactory();

  SAXTransformerFactory newSAXTransformerFactory();

  XMLInputFactory newXMLInputFactory();

  XMLOutputFactory newXMLOutputFactory();

  XMLReader createXMLReader() throws SAXException;
}


text:
crog
====

Dead simple image cropping UI


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/default_padding">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/help_intro"
        android:text="@string/help_intro"
        android:layout_marginBottom="@dimen/default_margin" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:layout_marginBottom="@dimen/default_margin"
        android:text="@string/help_content" />

    <TextView
        android:id="@+id/more_help"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/help_more" />
</LinearLayout>


text:
<Alloy>
  <Label id="input" class="input" />

  <Popover id="popover" class="popover" platform="ios" formFactor="tablet">
    <ContentView>
      <Window id="win">
        <Toolbar id="toolbar">
          <Items>
            <Button onClick="onToggleClick" class="toggleBtn" />
            <FlexSpace />
          </Items>
        </Toolbar>
        <Widget src="nl.fokkezb.color" id="picker" class="picker" onChange="onColorChange" />
      </Window>
    </ContentView>
  </Popover>

</Alloy>


text:
<!DOCTYPE html>

        <title>text() and html() - Get content</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

text() and html() - Get content

This is some bold text in a paragraph.

        <button id="btn1">Show Text</button>
        <button id="btn2">Show HTML</button>


text:
/*
 * REVISION HISTORY:
 *
 * Date          Author(s)
 * CR            Headline
 * ============  ==============================================================
 * Abr 14, 2005  Luiz Felipe Guimaraes
 * 1			 Implement Meg TCK
 * ============  ==============================================================
 */
package org.osgi.test.cases.dmt.tc2.tbc.Plugin.ExecPlugin;

import org.osgi.service.dmt.DmtData;
import org.osgi.service.dmt.MetaNode;

public class TestMetaNode implements MetaNode {

	private boolean	 isLeaf;
	private boolean	 can;
    private int      format;

    // Interior nodes
    public TestMetaNode(boolean can) {
        this.isLeaf        = false;
        this.format        = DmtData.FORMAT_NODE;
        this.can 		   = can;
    }

    // Leaf nodes
	public TestMetaNode(int format,boolean can) {
        this.isLeaf        = true;
        this.format        = format;
        this.can 		   = can;
	}

	/* ---------------------------------------------------------------------- */

    @Override
	public boolean can(int operation) {
        return can;
    }

    @Override
	public boolean isLeaf() {
		return isLeaf;
	}

	@Override
	public int getScope() {
		return DYNAMIC;
	}

	@Override
	public String getDescription() {
		return "";
	}

	@Override
	public int getMaxOccurrence() {
		return Integer.MAX_VALUE;
	}

	@Override
	public boolean isZeroOccurrenceAllowed() {
		return true;
	}

	@Override
	public DmtData getDefault() {
		return new DmtData("test");
	}

	@Override
	public double getMax() {
		return Double.MAX_VALUE;
	}

	@Override
	public double getMin() {
		return Double.MIN_VALUE;
	}

    @Override
	public String[] getValidNames() {
        return null;
    }

	@Override
	public DmtData[] getValidValues() {
		return null;
	}

	@Override
	public int getFormat() {
		return format;
	}

    public String getNamePattern() {
        return null;
    }

	public String getPattern() {
		return null;
	}

	@Override
	public String[] getMimeTypes() {
		return null;
	}

	@Override
	public boolean isValidValue(DmtData value) {
		return true;
	}

	@Override
	public boolean isValidName(String name) {
		return true;
	}

	@Override
	public String[] getExtensionPropertyKeys() {
		return null;
	}

	@Override
	public Object getExtensionProperty(String key) {
		return "";
	}

	@Override
	public String[] getRawFormatNames() {
		return null;
	}
}


text:
namespace g{namespace Fuse{namespace Drawing{struct DynamicBrush;}}}

namespace g{
namespace Fuse{
namespace Drawing{

// public abstract class DynamicBrush :146
// {
::g::Fuse::Drawing::Brush_type* DynamicBrush_typeof();
void DynamicBrush__ctor_1_fn(DynamicBrush* __this);
void DynamicBrush__get_BlendMode_fn(DynamicBrush* __this, int* __retval);
void DynamicBrush__set_BlendMode_fn(DynamicBrush* __this, int* value);
void DynamicBrush__get_IsCompletelyTransparent_fn(DynamicBrush* __this, bool* __retval);
void DynamicBrush__OnShadingChanged_fn(DynamicBrush* __this);
void DynamicBrush__get_Opacity_fn(DynamicBrush* __this, float* __retval);
void DynamicBrush__set_Opacity_fn(DynamicBrush* __this, float* value);
void DynamicBrush__add_ShadingChanged_fn(DynamicBrush* __this, uDelegate* value);
void DynamicBrush__remove_ShadingChanged_fn(DynamicBrush* __this, uDelegate* value);

struct DynamicBrush : ::g::Fuse::Drawing::Brush
{
    int _blendMode;
    float _opacity;
    uStrong<uDelegate*> ShadingChanged1;

    void ctor_1();
    int BlendMode();
    void BlendMode(int value);
    void OnShadingChanged();
    float Opacity();
    void Opacity(float value);
    void add_ShadingChanged(uDelegate* value);
    void remove_ShadingChanged(uDelegate* value);
};
// }

}}} // ::g::Fuse::Drawing


text:
from kazoo.client import KazooClient

from msgr import settings

zk = KazooClient(hosts=settings.ZK['URL'])

def init():
    zk.start()


text:
"""This script calculates the precision score for a contact prediction
when compared against contacts extracted from a protein structure.

"""

__author__ = "Felix Simkovic"
__date__ = "21 Nov 2016"
__version__ = "0.1"

import argparse

import conkit.command_line
import conkit.io

logger = None

def main():
    parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument(
        '-c',
        dest='pdbchain',
        default=None,
        help='PDB chain to use [default: first in file]. '
        'Inter-molecular predictions use two letter '
        'convention, i.e AD for contacts between A and D.')
    parser.add_argument('-d', dest='dtn', default=5, type=int, help='Minimum sequence separation [default: 5]')
    parser.add_argument(
        '-f',
        dest='dfactor',
        default=1.0,
        type=float,
        help='number of contacts to include relative to sequence length [default: 1.0]')
    parser.add_argument('pdbfile')
    parser.add_argument('pdbformat')
    parser.add_argument('seqfile')
    parser.add_argument('seqformat')
    parser.add_argument('confile')
    parser.add_argument('conformat')
    args = parser.parse_args()

    global logger
    logger = conkit.command_line.setup_logging(level='info')

    if args.pdbchain:
        pdb = conkit.io.read(args.pdbfile, args.pdbformat)[args.pdbchain]
    else:
        pdb = conkit.io.read(args.pdbfile, args.pdbformat)[0]
    seq = conkit.io.read(args.seqfile, args.seqformat)[0]
    con = conkit.io.read(args.confile, args.conformat)[0]

    con.sequence = seq
    con.set_sequence_register()

    logger.info('Min sequence separation for contacting residues: %d', args.dtn)
    logger.info('Contact list cutoff factor: %f * L', args.dfactor)

    con.remove_neighbors(min_distance=args.dtn, inplace=True)
    ncontacts = int(seq.seq_len * args.dfactor)
    con.sort('raw_score', reverse=True, inplace=True)
    con_sliced = con[:ncontacts]

    con_matched = con_sliced.match(pdb)
    precision = con_matched.precision

    logger.info('Precision score: %f', precision)

if __name__ == "__main__":
    import sys
    import traceback
    try:
        main()
        sys.exit(0)
    except Exception as e:
        if not isinstance(e, SystemExit):
            msg = "".join(traceback.format_exception(*sys.exc_info()))
            logger.critical(msg)
        sys.exit(1)


text:
<title>Multiple 1D Real-To-Complex FFT (Complex-Hermitian Storage) - AMD Core Math Library (ACML) 5.3.1</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="AMD Core Math Library (ACML) 5.3.1">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Real-FFT-Routines.html#Real-FFT-Routines" title="Real FFT Routines">
<link rel="prev" href="1D-Complex_002dTo_002dReal-FFT-_0028Complex_002dHermitian-Storage_0029.html#g_t1D-Complex_002dTo_002dReal-FFT-_0028Complex_002dHermitian-Storage_0029" title="1D Complex-To-Real FFT (Complex-Hermitian Storage)">
<link rel="next" href="Multiple-1D-Complex_002dTo_002dReal-FFT-_0028Complex_002dHermitian-Storage_0029.html#Multiple-1D-Complex_002dTo_002dReal-FFT-_0028Complex_002dHermitian-Storage_0029" title="Multiple 1D Complex-To-Real FFT (Complex-Hermitian Storage)">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">

Next: Multiple 1D Complex-To-Real FFT (Complex-Hermitian Storage),
Previous: 1D Complex-To-Real FFT (Complex-Hermitian Storage),
Up: Real FFT Routines

5.3.7 Multiple 1D Real-To-Complex FFT (Complex-Hermitian Storage)

DZFFT1M:                       Multiple One-dimensional FFT on real data

SCFFT1M:                       Multiple One-dimensional FFT on single precision real data


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using Reactive.Bindings;
using Reactive.Bindings.Extensions;
using Reactive.Bindings.Helpers;

using Wifinian.Common;
using Wifinian.Models.Wlan;

namespace Wifinian.ViewModels
{
	public class ProfileItemViewModel : DisposableBase
	{
		private readonly MainController _controller;

		public string Name
		{
			get => _name;
			set
			{
				if ((_name != null) && !_controller.IsUsableProfileName(InterfaceId, value))
					return;

				SetPropertyValue(ref _name, value);
			}
		}
		private string _name;

		private Guid InterfaceId { get; }
		public string InterfaceDescription { get; }
		public string Authentication { get; }
		public string Encryption { get; }
		public bool CanSetOptions { get; }

		public ReactiveProperty<bool> IsAutoConnectEnabled { get; }
		public ReactiveProperty<bool> IsAutoSwitchEnabled { get; }

		public ReadOnlyReactivePropertySlim<int> Position { get; }
		public ReadOnlyReactivePropertySlim<int> PositionCount { get; }

		public ReadOnlyReactivePropertySlim<bool> IsRadioOn { get; }
		public ReadOnlyReactivePropertySlim<bool> IsConnected { get; }

		public ReadOnlyReactivePropertySlim<int> Signal { get; }
		public ReadOnlyReactivePropertySlim<float> Band { get; }
		public ReadOnlyReactivePropertySlim<int> Channel { get; }

		public ReadOnlyReactivePropertySlim<bool> IsAvailable { get; }

		public ReactiveProperty<bool> IsSelected { get; }

		public ReactiveCommand ConnectCommand { get; }
		public ReactiveCommand DisconnectCommand { get; }

		internal ProfileItemViewModel(MainController controller, ProfileItem profileItem)
		{
			this._controller = controller ?? throw new ArgumentNullException(nameof(controller));

			Name = profileItem.Name;
			InterfaceId = profileItem.InterfaceId;
			InterfaceDescription = profileItem.InterfaceDescription;
			Authentication = profileItem.Authentication.ToString().Replace("_", "-");
			Encryption = profileItem.Encryption.ToString();
			CanSetOptions = profileItem.CanSetOptions;

			this.ObserveProperty(x => x.Name, false)
				.Subscribe(async x => await _controller.RenameProfileAsync(profileItem, x))
				.AddTo(this.Subscription);

			IsAutoSwitchEnabled = profileItem
				.ToReactivePropertyAsSynchronized(x => x.IsAutoSwitchEnabled, ReactivePropertyMode.DistinctUntilChanged)
				.AddTo(this.Subscription);
			IsAutoConnectEnabled = profileItem
				.ToReactivePropertyAsSynchronized(x => x.IsAutoConnectEnabled, ReactivePropertyMode.DistinctUntilChanged)
				.AddTo(this.Subscription);
			IsAutoConnectEnabled
				.Where(x => !x)
				.Subscribe(_ => IsAutoSwitchEnabled.Value = false)
				.AddTo(this.Subscription);

			Observable.Merge(IsAutoConnectEnabled, IsAutoSwitchEnabled)
				.Subscribe(async _ => await _controller.ChangeProfileOptionAsync(profileItem))
				.AddTo(this.Subscription);

			Position = profileItem
				.ObserveProperty(x => x.Position)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			PositionCount = profileItem
				.ObserveProperty(x => x.PositionCount)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			IsRadioOn = profileItem
				.ObserveProperty(x => x.IsRadioOn)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			IsConnected = profileItem
				.ObserveProperty(x => x.IsConnected)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			Signal = profileItem
				.ObserveProperty(x => x.Signal)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			Band = profileItem
				.ObserveProperty(x => x.Band)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			Channel = profileItem
				.ObserveProperty(x => x.Channel)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			IsAvailable = Signal
				.Select(x => 0 < x)
				.ToReadOnlyReactivePropertySlim()
				.AddTo(this.Subscription);

			IsSelected = ReactiveProperty.FromObject(profileItem, x => x.IsTarget)
				.AddTo(this.Subscription);

			#region Work

			var isNotWorking = _controller.IsWorking
				.Inverse()
				.StartWith(true) // This is necessary to start combined sequence.
				.Publish();

			ConnectCommand = new[] { isNotWorking, IsAvailable, IsConnected.Inverse() }
				.CombineLatestValuesAreAllTrue()
				.ObserveOnUIDispatcher() // This is for thread access by ReactiveCommand.
				.ToReactiveCommand();
			ConnectCommand
				.Subscribe(async _ => await _controller.ConnectNetworkAsync(profileItem))
				.AddTo(this.Subscription);

			DisconnectCommand = new[] { isNotWorking.AsObservable(), IsConnected }
				.CombineLatestValuesAreAllTrue()
				.ObserveOnUIDispatcher() // This is for thread access by ReactiveCommand.
				.ToReactiveCommand();
			DisconnectCommand
				.Subscribe(async _ => await _controller.DisconnectNetworkAsync(profileItem))
				.AddTo(this.Subscription);

			isNotWorking.Connect().AddTo(this.Subscription);

			#endregion
		}
	}
}


text:
<?xml version='1.0' encoding='utf-8'?>
<resources>
    <string name="app_name">LaunchPad</string>
</resources>


text:
package com.riteshakya.domain.repository;

import com.riteshakya.domain.models.Subscription;
import com.riteshakya.domain.models.UserSubscription;
import com.riteshakya.domain.usecases.user_subscriptions.SubscribeToUserSubscriptionUpdates;
import com.riteshakya.domain.usecases.user_subscriptions.SubscriptionBreakdownUpdates;
import com.riteshakya.domain.usecases.user_subscriptions.SubscriptionExpenseUpdates;

import java.util.List;

import io.reactivex.Observable;

/**
 * Interface that represents a Repository for getting user {@link Subscription} related data.
 */
public interface IUserSubscriptionRepository {
    /**
     * Get an {@link Observable} which will emit a List of {@link Subscription}.
     */
    Observable<Void> subscriptions();

    Observable<SubscribeToUserSubscriptionUpdates.UserSubscriptionDto> subscribe(SubscribeToUserSubscriptionUpdates.Params params);

    Observable<Void> createOrUpdateSubscription(UserSubscription userSubscription);

    Observable<Void> deleteSubscription(String id);

    Observable<Integer> subscribeToCount();

    Observable<SubscriptionBreakdownUpdates.BreakdownDto> subscribeToBreakdown(
            SubscriptionBreakdownUpdates.Params params);

    Observable<Float> subscribeToExpenses(SubscriptionExpenseUpdates.Params params);

    Observable<List<UserSubscription>> getSubscriptionsForToday();
}


text:
from django.apps import AppConfig

class DisparityConfig(AppConfig):
    name = 'disparity.apps.core'


text:
#import "EC2IpPermission.h"
#import "EC2IpPermission.h"
#import "EC2Tag.h"

/**
 * Security Group
 *
 * \ingroup EC2
 */

@interface EC2SecurityGroup:NSObject

{
    NSString       *ownerId;
    NSString       *groupName;
    NSString       *groupId;
    NSString       *descriptionValue;
    NSMutableArray *ipPermissions;
    NSMutableArray *ipPermissionsEgress;
    NSString       *vpcId;
    NSMutableArray *tags;
}

/**
 * Default constructor for a new  object.  Callers should use the
 * property methods to initialize this object after creating it.
 */
-(id)init;

/**
 * The AWS Access Key ID of the owner of the security group.
 */
@property (nonatomic, retain) NSString *ownerId;

/**
 * The name of this security group.
 */
@property (nonatomic, retain) NSString *groupName;

/**
 * The value of the GroupId property for this object.
 */
@property (nonatomic, retain) NSString *groupId;

/**
 * The description of this security group.
 */
@property (nonatomic, retain) NSString *descriptionValue;

/**
 * The permissions enabled for this security group.
 */
@property (nonatomic, retain) NSMutableArray *ipPermissions;

/**
 * The value of the IpPermissionsEgress property for this object.
 */
@property (nonatomic, retain) NSMutableArray *ipPermissionsEgress;

/**
 * The value of the VpcId property for this object.
 */
@property (nonatomic, retain) NSString *vpcId;

/**
 * The value of the Tags property for this object.
 */
@property (nonatomic, retain) NSMutableArray *tags;

/**
 * Adds a single object to ipPermissions.
 * This function will alloc and init ipPermissions if not already done.
 */
-(void)addIpPermission:(EC2IpPermission *)ipPermissionObject;

/**
 * Adds a single object to ipPermissionsEgress.
 * This function will alloc and init ipPermissionsEgress if not already done.
 */
-(void)addIpPermissionsEgres:(EC2IpPermission *)ipPermissionsEgresObject;

/**
 * Adds a single object to tags.
 * This function will alloc and init tags if not already done.
 */
-(void)addTag:(EC2Tag *)tagObject;

/**
 * Returns a string representation of this object; useful for testing and
 * debugging.
 *
 * @return A string representation of this object.
 */
-(NSString *)description;

@end


text:
package org.usfirst.frc.team910.robot.Auton;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

import org.usfirst.frc.team910.robot.IO.Util;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class AutonFastArc extends AutonStep {

	private boolean blueAlliance;
	private double x;
	private double y;
	private double prevRight;
	private double prevLeft;
	private double POWER_PER_DEGREE = 0.0;
	private double[] turnPowerL;
	private double[] turnPowerR;
	private double[] turnAngle;
	private double[] xDistAxis;
	private double prevPwr = 0;
	private double PWR_FILT = 0.1;
	private double MAX_PWR = 0.5;
	private DriveComplete dc;

	private BufferedWriter fos;
	private static int fileCount = 1;

	private double l;
	private double r;

	private boolean flipAxis;
	private boolean flipSides;

	public AutonFastArc(boolean flipAxis, boolean flipSides, double pwr, double[] turnPowerL, double[] turnPowerR, double[] turnAngle, double[] xDistAxis, DriveComplete dc) {
		this.turnPowerL = turnPowerL;
		this.turnPowerR = turnPowerR;
		this.turnAngle = turnAngle;
		this.xDistAxis = xDistAxis;
		this.dc = dc;
		this.flipAxis = flipAxis;
		this.flipSides = flipSides;
		this.MAX_PWR = pwr;
		x = 0;
		y = 0;
		prevRight = 0;
		prevLeft = 0;
		l = 0;
		r = 0;

		/*
		try{
			fos = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File("/home/lvusr/out" + fileCount + ".txt"))));
			fileCount++;

			fos.write("l,r,x,y,inPwr,outPwr,setangle,lookup,botangle;");
		} catch(Exception e){
			e.getMessage();
		}
		*/
	}

	public void setup(boolean blueAlliance) {
		x = 0;
		y = 0;
		prevRight = drive.rightDriveEncoder;
		prevLeft = drive.leftDriveEncoder;
		this.blueAlliance = blueAlliance;
		prevPwr = 0;
		l = 0;
		r = 0;
	}

	public void run() {
		double leftEnc = drive.leftDriveEncoder;
		double rightEnc = drive.rightDriveEncoder;

		double deltaL = leftEnc - prevLeft;
		double deltaR = rightEnc - prevRight;

		double dist = (deltaL + deltaR) / 2;

		x += dist * Math.cos(Math.toRadians(sense.robotAngle.get()));
		y += dist * Math.sin(Math.toRadians(sense.robotAngle.get()));

		l += Math.abs(deltaL);
		r += Math.abs(deltaR);

		//flip lookup axis when we flip sides or switch directions
		double lookup;
		int flipCount = 0;
		if(blueAlliance && flipSides) flipCount++;
		if(flipAxis) flipCount++;

		if(flipCount == 1) {
			lookup = r;
		} else {
			lookup = l;
		}
		SmartDashboard.putNumber("lookup", lookup);

		double insidePower = Util.interpolate(xDistAxis, turnPowerL, lookup);
		double outsidePower = Util.interpolate(xDistAxis, turnPowerR, lookup);
		double targetAngle = Util.interpolate(xDistAxis, turnAngle, lookup);

		//if there is a positive angle, drive to it, otherwise ignore feedback
		if(targetAngle > 0){
			POWER_PER_DEGREE = 0.2;
		} else {
			POWER_PER_DEGREE = 0.0;
		}

		//flip angle when we flip sides
		if(!blueAlliance && flipSides){
			targetAngle = -targetAngle;
		}

		//feedback
		double anglePower = Math.max(Math.min(sense.robotAngle.subtract(targetAngle) * -POWER_PER_DEGREE, 0.5), -0.5);

		//flip angle when we flip sides
		if(blueAlliance && flipSides) anglePower = -anglePower;
		SmartDashboard.putNumber("anglePower", anglePower);
		insidePower += anglePower;

		//low pass filter
		prevPwr += (MAX_PWR - prevPwr) * PWR_FILT;

		//switch left and right powers when we are on the other side
		if (blueAlliance && flipSides) {
			drive.tankDrive(insidePower, outsidePower, prevPwr);
		} else {
			drive.tankDrive(outsidePower, insidePower, prevPwr);
		}

		prevLeft = leftEnc;
		prevRight = rightEnc;

		SmartDashboard.putNumber("l", l);
		SmartDashboard.putNumber("r", r);
		SmartDashboard.putNumber("x", x);
		SmartDashboard.putNumber("y", y);
		SmartDashboard.putNumber("botAngle", sense.robotAngle.get());
		SmartDashboard.putNumber("insidePower", insidePower);
		SmartDashboard.putNumber("outsidePower", outsidePower);
		SmartDashboard.putNumber("TargetAngle", targetAngle);

		/*
		//fos.write("l,r,x,y,lPwr,rPwr,setangle,lookup,botangle");
		try{
			fos.write(l + "," + r + "," + x + "," + y + "," + insidePower + "," + outsidePower + "," + targetAngle + "," + lookup + "," + sense.robotAngle.get() + ";");
		} catch(Exception e){
			e.getMessage();
		}
		*/
	}

	public boolean isDone() {
		//return (Math.abs(y) > 28);
		//return (Math.abs(x) < 28);
		//double l = drive.leftDriveEncoder - leftInit;
		//double r= drive.rightDriveEncoder - rightInit;
		if(dc.isDone(l,r,x, y, blueAlliance)){
			/*
			try{
				fos.flush();
				fos.close();
			} catch  (Exception e){
				e.getMessage();
			}
			*/
			return true;
		}
		return false;
	}
}


text:
/* $chaos: idt.c,v 1.3 2002/06/15 14:35:04 per Exp $ */
/* Abstract: IDT management. */
/* Authors: Per Lundberg <per@chaosdev.org>
            Henrik Hallin <hal@chaosdev.org> */

/* Copyright 2002 chaos development. */

#include <storm/ia32/debug.h>
#include <storm/ia32/defines.h>
#include <storm/ia32/descriptor.h>
#include <storm/ia32/idt.h>
#include <storm/ia32/memory.h>

descriptor_t idt[IDT_ENTRIES] __attribute__ ((section (".idt")));

/* Create a trap gate. Make sure to have interrupts disabled while
   running this one; a task switch in the middle could case very bad
   effects. */
void idt_setup_trap_gate (unsigned int number, unsigned int selector,
                          void *address, unsigned int privilege_level)
{
    gate_descriptor_t *gate_descriptor = (gate_descriptor_t *) &idt[number];

    // FIXME: Use macros.
    gate_descriptor->offset_lo = (uint32_t) address & 0xFFFF;
    gate_descriptor->offset_hi = ((uint32_t) address >> 16) & 0xFFFF;
    gate_descriptor->segment_selector = selector;
    gate_descriptor->params = 0;
    gate_descriptor->zero = 0;
    gate_descriptor->dpl = privilege_level;
    gate_descriptor->present = 1;
    gate_descriptor->segment_selector = selector;
    gate_descriptor->params = 0;
    gate_descriptor->zero = 0;
    gate_descriptor->dpl = privilege_level;
    gate_descriptor->present = 1;
    gate_descriptor->type = DESCRIPTOR_TYPE_TRAP_GATE_32;
}

/* Create an interrupt gate. Make sure to have interrupts disabled
   while running this one; a task switch in the middle could case very
   bad effects. */
void idt_setup_interrupt_gate (unsigned int number, unsigned int selector,
                               void *address, unsigned int privilege_level)
{
    gate_descriptor_t *gate_descriptor = (gate_descriptor_t *) &idt[number];

    // FIXME: Use macros.
    gate_descriptor->offset_lo = (uint32_t) address & 0xFFFF;
    gate_descriptor->offset_hi = ((uint32_t) address >> 16) & 0xFFFF;
    gate_descriptor->segment_selector = selector;
    gate_descriptor->params = 0;
    gate_descriptor->zero = 0;
    gate_descriptor->dpl = privilege_level;
    gate_descriptor->present = 1;
    gate_descriptor->segment_selector = selector;
    gate_descriptor->params = 0;
    gate_descriptor->zero = 0;
    gate_descriptor->dpl = privilege_level;
    gate_descriptor->present = 1;
    gate_descriptor->type = DESCRIPTOR_TYPE_INTERRUPT_GATE_32;
}


text:
package nogrowmap

import "math/rand"

// NoGrowMap simulates a map that can be iterated over and inserted into, but never has to grow
type NoGrowMap struct {
	Iterator chan struct{} // Iterator represents all the elements left to go until the end of the map
	Size     int           // Size represents the total size of the map
}

// NewNoGrowMap allocates a NoGrowMap with some initialSize
func NewNoGrowMap(initialSize int) *NoGrowMap {
	// make an iterator that has initialSize items left to go
	iterator := make(chan struct{}, initialSize)
	for i := 0; i < initialSize; i++ {
		iterator <- struct{}{}
	}
	return &NoGrowMap{
		Size:     initialSize,
		Iterator: iterator,
	}
}

// Insert simulates inserting into a NoGrowMap
func (m *NoGrowMap) Insert() {
	if rand.Intn(m.Size+1) > m.iteratorPos() {
		// Something got inserted infront of the iterator's position in the map
		m.Iterator <- struct{}{}
	}
	m.Size++

	if len(m.Iterator) == 0 {
		// We have reached the end!
		close(m.Iterator)
	}
}

// iteratorPos gives the iterators current position in the map's array layout
func (m *NoGrowMap) iteratorPos() int {
	return m.Size - len(m.Iterator)
}


text:
package ru.job4j.condition;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 *Class condition.
 *
 *@author i.sliusar
 *@version $Id$
 *@since 0.1
 *03.06.2017
 */
public class PointTest {
	/**
	 *Тест add.
	 */
    @Test
    public void whenIsFistArgTwoSecondArgTwoThenThrue() {
		Point point = new Point(2, 6);
		boolean result = point.is(2, 2);
		boolean expected = true;
        assertThat(result, is(expected));
    }
}


text:
using content::WebContents;

namespace printing {

// static
void TestPrintViewManagerForRequestPreview::CreateForWebContents(
    WebContents* web_contents) {
  web_contents->SetUserData(
      PrintViewManager::UserDataKey(),
      std::make_unique<TestPrintViewManagerForRequestPreview>(web_contents));
}

TestPrintViewManagerForRequestPreview::TestPrintViewManagerForRequestPreview(
    WebContents* web_contents)
    : PrintViewManager(web_contents) {}

TestPrintViewManagerForRequestPreview::
    ~TestPrintViewManagerForRequestPreview() = default;

// static
TestPrintViewManagerForRequestPreview*
TestPrintViewManagerForRequestPreview::FromWebContents(
    WebContents* web_contents) {
  return static_cast<TestPrintViewManagerForRequestPreview*>(
      PrintViewManager::FromWebContents(web_contents));
}

void TestPrintViewManagerForRequestPreview::set_quit_closure(
    base::OnceClosure quit_closure) {
  quit_closure_ = std::move(quit_closure);
}

void TestPrintViewManagerForRequestPreview::RequestPrintPreview(
    mojom::RequestPrintPreviewParamsPtr params) {
  base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
      FROM_HERE, std::move(quit_closure_));
  PrintViewManager::RequestPrintPreview(std::move(params));
}

}  // namespace printing


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Trans. Br. mycol. Soc. 89(3): 404 (1987)

#### Original name
Phomopsis micheliae Sankaran, Florence & J.K. Sharma

### Remarks
null


text:
   if (v > max) v = max; else if (v < min) v = min;

#define ENG_STATE_DD_NEW(str, typ) \
   _eng_state_descriptor_new(str, sizeof(typ))

#define ENG_STATE_DD_FREE(eed) \
   if (eed) { eet_data_descriptor_free(eed); (eed) = NULL; }

#define ENG_STATE_VAL(edd, type, member, dtype) \
   EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)

#define ENG_STATE_SUB(edd, type, member, eddtype) \
   EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)

#define ENG_STATE_LIST(edd, type, member, eddtype) \
   EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)

#define ENG_STATE_HASH(edd, type, member, eddtype) \
   EET_DATA_DESCRIPTOR_ADD_HASH(edd, type, #member, member, eddtype)

# define ENG_STATE_FILE_EPOCH 0x0003
# define ENG_STATE_FILE_GENERATION 0x000c
# define ENG_STATE_FILE_VERSION \
   ((ENG_STATE_FILE_EPOCH << 16) | ENG_STATE_FILE_GENERATION)

# define ENG_PROJECT_STATE_FILE_EPOCH 0x0001
# define ENG_PROJECT_STATE_FILE_GENERATION 0x0003
# define ENG_PROJECT_STATE_FILE_VERSION \
   ((ENG_PROJECT_STATE_FILE_EPOCH << 16) | ENG_PROJECT_STATE_FILE_GENERATION)

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _Eng_User_State        Eng_User_State;
typedef struct _Eng_Mime_State        Eng_Mime_State;
typedef struct _Eng_Project_State     Eng_Project_State;
typedef struct _Eng_Window_State      Eng_Window_State;
typedef struct _Eng_Tab_State         Eng_Tab_State;
typedef struct _Eng_Project_Tab_State Eng_Project_Tab_State;
typedef struct _Eng_Scene_Tab_State   Eng_Scene_Tab_State;

struct _Eng_User_State
{
   int        version;
   Eina_List *mime_assocs;
   Eina_List *windows;
   Eina_List *projects;
};

struct _Eng_Mime_State
{
   const char *id;
   const char *mime;
};

struct _Eng_Project_State
{
   int         version;
   Eina_Bool   open;
   const char *name;
   const char *path;
   Efl_Object *tab;
};

struct _Eng_Window_State
{
   char              *project;
   Eina_List         *tabs;

   Evas_Object       *widget;
   Efl_Object        *content;
   Efl_Object        *popup;
   Efl_Object        *toolbar;
   Elm_Object_Item   *scenetool;
   Elm_Object_Item   *materialtool;
   Elm_Object_Item   *modeltool;
   Engineer_Tabber   *tabber;
};

struct _Eng_Tab_State
{
   char *type;
   char *path;
};

typedef Eet_Data_Descriptor Eng_User_State_DD;
extern  Eng_User_State_DD *_eng_user_state_edd;
extern  Eng_User_State_DD *_eng_mime_state_edd;

typedef Eet_Data_Descriptor Eng_Project_State_DD;
extern  Eng_Project_State_DD *_eng_project_state_edd;

typedef Eet_Data_Descriptor Eng_Window_State_DD;
extern Eng_Window_State_DD *_eng_window_state_edd;

extern Eng_User_State *_eng_user_state;
extern int             ENG_EVENT_STATE_CHANGED;

Eet_Data_Descriptor *
_eng_state_descriptor_new(const char *name, int size);

// General configuration management
Eina_Bool
_eng_user_state_init(void);
Eina_Bool
_eng_user_state_shutdown(void);

// User state handling
void
_eng_user_state_load(void);
Eina_Bool
_eng_user_state_save(void);
void
_eng_user_state_free(void);

void
_eng_user_state_mime_add(const char *mime, const char* id);
const char*
_eng_user_state_mime_search(const char *mime);

#ifdef __cplusplus
}
#endif

#endif


text:
"""
Check that all of the certs on all service endpoints validate.
"""
import unittest

from tests.integration import ServiceCertVerificationTest

import boto.glacier

class GlacierCertVerificationTest(unittest.TestCase, ServiceCertVerificationTest):
    glacier = True
    regions = boto.glacier.regions()

    def sample_service_call(self, conn):
        conn.list_vaults()


text:
using System;
using System.Net.Http;
using System.Threading.Tasks;
using ModernHttpClient;
using System.Net;

namespace SharpThemes.Utilities
{
    public static class Http
    {
        public static async Task<string> DoGet(string url) {
            using (var client = new HttpClient(new NativeMessageHandler())) {
                try {
                    return WebUtility.UrlDecode(await client.GetStringAsync(url));
                } catch (Exception ex) {
                    throw ex;
                }
            }
        }
    }
}


text:
(function() {
  Number.prototype.between = function(min, max) {
    return this > min && this < max;
  };

  this.OnDemand = {
    watches: [],
    weight: 100,
    init: function(options) {
      var that;
      this.weight = options.weight || 100;
      that = this;
      return document.addEventListener("mousemove", function(event) {
        return that.onMouseMove(event);
      });
    },
    addScriptTag: function(src) {
      var body, script;
      script = document.createElement("script");
      script.type = "text/javascript";
      script.src = src;
      body = document.getElementsByTagName("body")[0];
      return body.appendChild(script);
    },
    onMouseMove: function(event) {
      var coords, watch, _i, _len, _ref, _results;
      _ref = this.watches;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        watch = _ref[_i];
        if (!watch.inserted) {
          coords = this.getElementCoords(watch.id);
          if (event.pageX.between(coords[0], coords[1]) && event.pageY.between(coords[2], coords[3])) {
            this.addScriptTag(watch.src);
            watch.inserted = true;
            _results.push(watch.onload());
          } else {
            _results.push(void 0);
          }
        } else {
          _results.push(void 0);
        }
      }
      return _results;
    },
    getElementCoords: function(id) {
      var element, x, xx, y, yy;
      element = document.getElementById(id);
      x = element.offsetLeft - this.weight;
      y = element.offsetTop - this.weight;
      xx = element.offsetLeft + element.offsetWidth + this.weight;
      yy = element.offsetTop + element.offsetHeight + this.weight;
      return [x, xx, y, yy];
    },
    addWatch: function(id, src, onload) {
      var newWatch;
      newWatch = {
        id: id,
        src: src,
        inserted: false
      };
      if (onload) {
        newWatch.onload = onload;
      }
      return this.watches.push(newWatch);
    }
  };

  window.OnDemand = this.OnDemand;

}).call(this);


text:
import {HTMLDivContainer} from './HTMLDivContainer';

export class WebSocketIndicator extends HTMLDivContainer
{
    private readonly defiCOMIndicator: HTMLDivElement;
    private readonly ssmCOMIndicator: HTMLDivElement;
    private readonly arduinoCOMIndicator: HTMLDivElement;
    private readonly elm327COMIndicator: HTMLDivElement;
    private readonly fueltripIndicator: HTMLDivElement;

    public setDefiIndicatorStatus(status : number) {this.changeIndicatorColor(this.defiCOMIndicator, status)};
    public setSSMIndicatorStatus(status : number) {this.changeIndicatorColor(this.ssmCOMIndicator, status)};
    public setArduinoIndicatorStatus(status : number) {this.changeIndicatorColor(this.arduinoCOMIndicator, status)};
    public setELM327IndicatorStatus(status : number) {this.changeIndicatorColor(this.elm327COMIndicator, status)};
    public setFUELTRIPIndicatorStatus(status : number) {this.changeIndicatorColor(this.fueltripIndicator, status)};

    public get IsDefiInidicatorEnabled() { return !this.defiCOMIndicator.hidden }
    public set IsDefiInidicatorEnabled(flag : boolean) { this.defiCOMIndicator.hidden = !flag }
    public get IsSSMInidicatorEnabled() { return !this.ssmCOMIndicator.hidden }
    public set IsSSMInidicatorEnabled(flag : boolean) { this.ssmCOMIndicator.hidden = !flag }
    public get IsArduinoInidicatorEnabled() { return !this.arduinoCOMIndicator.hidden }
    public set IsArduinoInidicatorEnabled(flag : boolean) { this.arduinoCOMIndicator.hidden = !flag }
    public get IsELM327InidicatorEnabled() { return !this.elm327COMIndicator.hidden }
    public set IsELM327InidicatorEnabled(flag : boolean) { this.elm327COMIndicator.hidden = !flag }
    public get IsFUELTRIPInidicatorEnabled() { return !this.fueltripIndicator.hidden }
    public set IsFUELTRIPInidicatorEnabled(flag : boolean) { this.fueltripIndicator.hidden = !flag }

    constructor()
    {
        super();

        const containerStyle = this.Container.style;
        containerStyle.position = "relative";
        containerStyle.width = "100%";
        containerStyle.color = "grey";
        containerStyle.fontSize = "16px";
        containerStyle.fontWeight = "bold";

        this.defiCOMIndicator = document.createElement('div');
        this.defiCOMIndicator.innerText = "Defi";
        this.ssmCOMIndicator = document.createElement('div');
        this.ssmCOMIndicator.innerText = "SSM";
        this.arduinoCOMIndicator = document.createElement('div');
        this.arduinoCOMIndicator.innerText = "Arduino";
        this.elm327COMIndicator = document.createElement('div');
        this.elm327COMIndicator.innerText = "ELM327";
        this.fueltripIndicator = document.createElement('div');
        this.fueltripIndicator.innerText = "FUELTRIP";

        const titleElem = document.createElement('div');
        titleElem.innerText = "Websocket Status";
        titleElem.style.color = "white";

        this.Container.appendChild(titleElem);
        this.Container.appendChild(this.defiCOMIndicator);
        this.Container.appendChild(this.ssmCOMIndicator);
        this.Container.appendChild(this.arduinoCOMIndicator);
        this.Container.appendChild(this.elm327COMIndicator);
        this.Container.appendChild(this.fueltripIndicator);

        this.IsDefiInidicatorEnabled = false;
        this.IsArduinoInidicatorEnabled = false;
        this.IsSSMInidicatorEnabled = false;
        this.IsELM327InidicatorEnabled = false;
        this.IsFUELTRIPInidicatorEnabled = false;
    }

    private changeIndicatorColor(indicator : HTMLDivElement, status : number)
    {
        const style = indicator.style;
        switch (status)
        {
            case WebSocket.CONNECTING://CONNECTING
                style.color = "blue";
                break;
            case WebSocket.OPEN://OPEN
                style.color = "green";
                break;
            case WebSocket.CLOSING://CLOSING
                style.color = "orange";
                break;
            case WebSocket.CLOSED://CLOSED
                style.color = "grey";
                break;
            default:
                // this never happens
                break;
        }
    }
}


text:
namespace meshproc_csg
{

#define __USE_EXACT_KERNEL__
#ifdef __USE_EXACT_KERNEL__
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
#else
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
#endif
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef Kernel::Vector_3 Vector_3;
typedef Kernel::Aff_transformation_3 Aff_transformation_3;

#if 0
typedef CGAL::Bounded_kernel<Kernel> Bounded_Kernel;
typedef CGAL::Nef_polyhedron_2<Bounded_Kernel> Nef_polygon;
typedef Nef_polygon::Point Point2D;
typedef Nef_polygon::Explorer Explorer;
typedef Explorer::Face_const_iterator Polygon_Face_const_iterator;
typedef Explorer::Hole_const_iterator Polygon_Hole_const_iterator;
typedef Explorer::Halfedge_around_face_const_circulator Polygon_Halfedge_around_face_const_circulator;
typedef Explorer::Vertex_const_handle Polygon_Vertex_const_handle;
#endif

}

#endif


text:
<?php

namespace Drupal\aggregator\Plugin\Validation\Constraint;

use Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldConstraint;

/**
 * Supports validating feed URLs.
 *
 * @Constraint(
 *   id = "FeedUrl",
 *   label = @Translation("Feed URL", context = "Validation")
 * )
 */
class FeedUrlConstraint extends UniqueFieldConstraint {

  public $message = 'A feed with this URL %value already exists. Enter a unique URL.';

}


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

//18.Write a program for extracting all email addresses from given text.
//   All substrings that match the format <identifier>@<host>…<domain>
//   should be recognized as emails.

class EmailExtractor
{
    static void Main()
    {
        Console.WriteLine("18.Original text:");
        string input =
@"Please contact us by phone (+359 222 222 222) or
by email at exa_mple@abv.bg or at baj.ivan@yahoo.co.uk
This is not email: test@test. This also: @telerik.com. Neither this: a@a.b.";
        Console.WriteLine(input);
        Console.WriteLine();
        string[] splitted = input.Split(' ');

        Console.WriteLine("Valid Emails:");
        for (int i = 0; i < splitted.Length; i++)
        {
            if (Regex.IsMatch(splitted[i], @"[\w., \-]{2,20}@[\w]{2,20}[.]{1}[\w.]{2,6}"))
            {
                Console.WriteLine(splitted[i]);
            }
        }
        Console.WriteLine();
    }
}


text:
<?php

namespace Indigo\Notify\Handler;

/**
 * Tests for Logger Handler
 *
 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
 *
 * @coversDefaultClass Indigo\Notify\Handler\LoggerHandler
 * @group              Notify
 * @group              Handler
 */
class LoggerHandlerTest extends AbstractHandlerTest
{
    public function _before()
    {
        $logger = \Mockery::mock('Psr\\Log\\LoggerInterface');

        $logger->shouldReceive('log')
            ->andReturn(true);

        $this->handler = new LoggerHandler($logger);
    }

    public function testConstruct()
    {
        $logger = \Mockery::mock('Psr\\Log\\LoggerInterface');

        $handler = new LoggerHandler($logger);

        $this->assertEquals('debug', $handler->getLevel());
    }

    /**
     * @covers ::getLevel
     * @covers ::setLevel
     */
    public function testLevel()
    {
        $this->assertSame($this->handler, $this->handler->setLevel('info'));
        $this->assertEquals('info', $this->handler->getLevel());
    }

    /**
     * @covers ::handle
     */
    public function testHandle()
    {
        $this->assertFalse($this->handler->handle($this->getNotificationMock()));

        $notification = \Mockery::mock('Indigo\\Notify\\Notification\\NotificationInterface', 'Indigo\\Notify\\Notification\\LoggerNotificationInterface');

        $notification->shouldReceive('getLevel')
            ->andReturn('notice');

        $notification->shouldReceive('getMessage')
            ->andReturn(null)
            ->byDefault();

        $notification->shouldReceive('getParameters')
            ->andReturn([])
            ->byDefault();

        $this->assertFalse($this->handler->handle($notification));
    }
}


text:
import React from 'react';
import ReactDOM from 'react-dom';

import Figure from './Figure';

it('renders without crashing', () => {
  const div = document.createElement('div');
  ReactDOM.render(
    <Figure caption="">
      Yes
    </Figure>,
    div
  );
});


text:
package app.recycler_view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import app.Item;
import butterknife.Bind;
import butterknife.ButterKnife;
import miguelbcr.okadapters.R;
import miguelbcr.ok_adapters.recycler_view.OkRecyclerViewAdapter;

public class ItemViewGroup extends FrameLayout implements OkRecyclerViewAdapter.Binder<Item> {

    public ItemViewGroup(Context context) {
        super(context);

        View view = LayoutInflater.from(getContext()).inflate(R.layout.item_view_group, this, true);
        ButterKnife.bind(this, view);
    }

    @Bind(R.id.tv_value) TextView tv_value;
    @Override public void bind(Item item, int position, int count) {
        tv_value.setText(item.toString());
    }
}


text:
Shindo.tests('Local | storage') do

  pending if Fog.mocking?

  before do
    @options = { :local_root => "~/.fog" }
  end

  tests('#endpoint') do
    tests('when no endpoint is provided').
      returns(nil) do
        Fog::Storage::Local.new(@options).endpoint
      end

    tests('when no host is provided').
      returns(nil) do
        @options[:scheme] = 'http'
        @options[:path] = '/files'
        @options[:port] = 80

        Fog::Storage::Local.new(@options).endpoint
      end

    tests('when endpoint is provided').
      returns('http://example.com/files') do
        @options[:endpoint] = 'http://example.com/files'

        Fog::Storage::Local.new(@options).endpoint
      end

    tests('when at least host option is provided').
      returns('http://example.com/files') do
        @options[:scheme] = 'http'
        @options[:host] = 'example.com'
        @options[:path] = '/files'

        Fog::Storage::Local.new(@options).endpoint
      end
  end
end


text:
<!DOCTYPE html>

	<title>

            Robocoder Corporation -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      Robocoder Corporation

Legal/Operating Name:

Robocoder Corporation

http://www.robocoder.com

info@robocoder.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   260-2639 Viking Way

                    RICHMOND,

                    British Columbia

                  V6V 3B7

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   260-2639 Viking Way

                    RICHMOND,

                    British Columbia

                  V6V 3B7

                         </address>

Tel.:
		      (604) 273-8086

Tel.:
			      (888) 662-8082

Fax:
		      (604) 278-0817

Logo

Company Profile

            Robocoder is a software company that started by building a software platform that can build and rebuild other software and itself. Since 2000 we have software products and services ranging from B2B that manages billions of dollars of assets to P2P platform that can bring financial independence to every household in the world. We embrace the philosophy of "late change no penalty" and most of our software changes can be changed on the fly on our software platform named Rintagi which stands for Rejuvenate with integrity and agility.

				Full profile

				Full profile

				Contact information

                Nelson
                Lin

                  Title:

                Chief Executive Officer

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (604) 273-8086

                    Email:

                  nelson.lin@robocoder.com

  top of page

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1999

            Exporting:

              Yes

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            511210 - Software Publishers

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Product Name:

                            Securitization Software - GSXchange

                            Using rules to systematize decision-making, GSXchange automates more than 95% of your business decisions. This is the only end-to-end software solution that integrates warehousing, pool selection, analysis, legal documentation, accounting, reconciliation and on-going pool monitoring into one complete application. Moreover, it allows for customized on-the-fly reporting that all authorized personnel have access to. The application and data can resident within your network or hosted in the cloud.

GSXchange can reduce labor costs and increase efficiency, accuracy and transparency. It can also provide new business to your operation by making small tranches profitable ($1-5M), due to its low cost per transaction.  For more information, visit www.gsxchange.com.

                              Product Name:

                            DotNet Code Generator - Rintagi

                            Rintagi™ is an renewable open software code generation platform that enable users and developers of business process management systems (BPMS) to make many late changes without incurring penalties. It is renewable because Rintagi™ is also generated by itself. See for yourself. Rintagi allows you to develop and change enterprise web apps faster, on a standard .Net architecture, without locking you into proprietary technology.

It is ideal for the development of mission critical line-of-business applications that require rapid changes with precision in response to business changes.

  top of page

					Market profile

                        Alliances:

Sales/Marketing

Technology

              Geographic markets:

                  Actively pursuing:

United States

  top of page

					Sector information

                Unique applications:

              Rintagi high productivity and high control application development platform is proven to quickly generate error-free sophisticated enterprise business process management (BPM) database applications and allow many changes on-the-fly. It is based on agile methodology and designed by seasoned SCRUM master and certified developers. Rintagi™ delivers applications that are not only multi-tenant, but also connecting their customers and vendors to share valuable data online and real time for effective and efficient communications.

Rintagi is generated from its own metadata, the same way it uses metadata to generate other applications. Using Rintagi, one can develop many custom BPM applications, in the cloud or on-premises, iteratively and incrementally, with many late changes on-the-fly and exceptionally low maintenance. Applications are often created from merely high level specifications. Most unique of all, it has the ability to keep its applications and itself "forever young".

                Key / Major clients:

              Securcor Securitization Group - www.securcor.com

Spartan Services Inc. - www.spartancompliance.com

Versa Bank - www.versabank.com

                Success stories:

              In 2015, without users' involvement, Rintagi platform has rejuvenated all applications built more than 13 years ago, including itself, to run like native apps on all mobile devices, by the press of a button. It is a clear demonstration that Robocoder possesses Time Independent technology.

                Testimonial:

              "The end product as we see it today, and in fact, as we have seen it for a number of years now, is, to the best of my knowledge, the best in the business"

"I have found Robocoder's development team to be very knowledgeable, dependable and an absolute pleasure to work with. They were able to quickly understand our market requirements and come up with great solutions to our customers' challenges. With the end user in mind, they have transformed often obscure mental concepts' into flexible and easy-to-use solutions."

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Nelson
                Lin

                  Title:

                Chief Executive Officer

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (604) 273-8086

                    Email:

                  nelson.lin@robocoder.com

				Description

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1999

            Exporting:

              Yes

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            511210 - Software Publishers

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Product Name:

                            Securitization Software - GSXchange

                            Using rules to systematize decision-making, GSXchange automates more than 95% of your business decisions. This is the only end-to-end software solution that integrates warehousing, pool selection, analysis, legal documentation, accounting, reconciliation and on-going pool monitoring into one complete application. Moreover, it allows for customized on-the-fly reporting that all authorized personnel have access to. The application and data can resident within your network or hosted in the cloud.

GSXchange can reduce labor costs and increase efficiency, accuracy and transparency. It can also provide new business to your operation by making small tranches profitable ($1-5M), due to its low cost per transaction.  For more information, visit www.gsxchange.com.

                              Product Name:

                            DotNet Code Generator - Rintagi

                            Rintagi™ is an renewable open software code generation platform that enable users and developers of business process management systems (BPMS) to make many late changes without incurring penalties. It is renewable because Rintagi™ is also generated by itself. See for yourself. Rintagi allows you to develop and change enterprise web apps faster, on a standard .Net architecture, without locking you into proprietary technology.

It is ideal for the development of mission critical line-of-business applications that require rapid changes with precision in response to business changes.

					Market

					Market profile

                        Alliances:

Sales/Marketing

Technology

              Geographic markets:

                  Actively pursuing:

United States

					Sector

					Sector information

                Unique applications:

              Rintagi high productivity and high control application development platform is proven to quickly generate error-free sophisticated enterprise business process management (BPM) database applications and allow many changes on-the-fly. It is based on agile methodology and designed by seasoned SCRUM master and certified developers. Rintagi™ delivers applications that are not only multi-tenant, but also connecting their customers and vendors to share valuable data online and real time for effective and efficient communications.

Rintagi is generated from its own metadata, the same way it uses metadata to generate other applications. Using Rintagi, one can develop many custom BPM applications, in the cloud or on-premises, iteratively and incrementally, with many late changes on-the-fly and exceptionally low maintenance. Applications are often created from merely high level specifications. Most unique of all, it has the ability to keep its applications and itself "forever young".

                Key / Major clients:

              Securcor Securitization Group - www.securcor.com

Spartan Services Inc. - www.spartancompliance.com

Versa Bank - www.versabank.com

                Success stories:

              In 2015, without users' involvement, Rintagi platform has rejuvenated all applications built more than 13 years ago, including itself, to run like native apps on all mobile devices, by the press of a button. It is a clear demonstration that Robocoder possesses Time Independent technology.

                Testimonial:

              "The end product as we see it today, and in fact, as we have seen it for a number of years now, is, to the best of my knowledge, the best in the business"

"I have found Robocoder's development team to be very knowledgeable, dependable and an absolute pleasure to work with. They were able to quickly understand our market requirements and come up with great solutions to our customers' challenges. With the end user in mind, they have transformed often obscure mental concepts' into flexible and easy-to-use solutions."

    Last Update Date 2016-10-31

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>