text:
"""
A  basic widget for showing the progress
being made in a task.

"""

from Tkinter import *

class ProgressBar:
    def __init__(self, master=None, orientation="horizontal",
                 min=0, max=100, width=100, height=18,
                 doLabel=1, appearance="sunken",
                 fillColor="blue", background="gray",
                 labelColor="yellow", labelFont="Verdana 12",
                 labelText="", labelFormat="%d%%",
                 value=0, bd=2):
        # preserve various values
        self.master=master
        self.orientation=orientation
        self.min=min
        self.max=max
        self.width=width
        self.height=height
        self.doLabel=doLabel
        self.fillColor=fillColor
        self.labelFont= labelFont
        self.labelColor=labelColor
        self.background=background
        self.labelText=labelText
        self.labelFormat=labelFormat
        self.value=value
        self.frame=Frame(master, relief=appearance, bd=bd)
        self.canvas=Canvas(self.frame, height=height, width=width, bd=0,
                           highlightthickness=0, background=background)
        self.scale=self.canvas.create_rectangle(0, 0, width, height,
                                                fill=fillColor)
        self.label=self.canvas.create_text(self.canvas.winfo_reqwidth()/ 2,
                                           height / 2, text=labelText,
                                           anchor="c", fill=labelColor,
                                           font=self.labelFont)
        self.update()
        self.canvas.pack(side='top', fill='x', expand='no')

    def updateProgress(self, newValue, newMax=None):
        if newMax:
            self.max = newMax
        self.value = newValue
        self.update()

    def update(self):
        # Trim the values to be between min and max
        value=self.value
        if value > self.max:
            value = self.max
        if value < self.min:
            value = self.min
        # Adjust the rectangle
        if self.orientation == "horizontal":
            self.canvas.coords(self.scale, 0, 0,
              float(value) / self.max * self.width, self.height)
        else:
            self.canvas.coords(self.scale, 0,
                               self.height - (float(value) /
                                              self.max*self.height),
                               self.width, self.height)
        # Now update the colors
        self.canvas.itemconfig(self.scale, fill=self.fillColor)
        self.canvas.itemconfig(self.label, fill=self.labelColor)
        # And update the label
        if self.doLabel:
            if value:
                if value >= 0:
                    pvalue = int((float(value) / float(self.max)) *
                                   100.0)
                else:
                    pvalue = 0
                self.canvas.itemconfig(self.label, text=self.labelFormat
                                         % pvalue)
            else:
                self.canvas.itemconfig(self.label, text='')
        else:
            self.canvas.itemconfig(self.label, text=self.labelFormat %
                                   self.labelText)
        self.canvas.update_idletasks()


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>VO808X: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

VO808X

Main Page

Related Pages

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

testing::internal::EachMatcherImpl< Container > Member List

This is the complete list of members for testing::internal::EachMatcherImpl< Container >, including all inherited members.

DescribeNegationTo(::std::ostream *os) const 	testing::internal::EachMatcherImpl< Container >	inlinevirtual

DescribeTo(::std::ostream *os) const 	testing::internal::EachMatcherImpl< Container >	inlinevirtual

EachMatcherImpl(InnerMatcher inner_matcher)	testing::internal::EachMatcherImpl< Container >	inlineexplicit

Element typedef	testing::internal::QuantifierMatcherImpl< Container >

testing::internal::QuantifierMatcherImpl::GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl)	testing::internal::QuantifierMatcherImpl< Container >	protected

GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer	testing::internal::QuantifierMatcherImpl< Container >

inner_matcher_	testing::internal::QuantifierMatcherImpl< Container >	protected

MatchAndExplain(Container container, MatchResultListener *listener) const 	testing::internal::EachMatcherImpl< Container >	inlinevirtual

MatchAndExplainImpl(bool all_elements_should_match, Container container, MatchResultListener *listener) const 	testing::internal::QuantifierMatcherImpl< Container >	inline

QuantifierMatcherImpl(InnerMatcher inner_matcher)	testing::internal::QuantifierMatcherImpl< Container >	inlineexplicit

StlContainer typedef	testing::internal::QuantifierMatcherImpl< Container >

StlContainerReference typedef	testing::internal::QuantifierMatcherImpl< Container >

View typedef	testing::internal::QuantifierMatcherImpl< Container >

~MatcherDescriberInterface()	testing::MatcherDescriberInterface	inlinevirtual

Generated by

     1.8.11

redpajama_set_name: RedPajamaGithub


text:
package testsupport.functions;

import com.jnape.palatable.lambda.functions.Fn2;

import static java.lang.String.format;

public class ExplainFold {

    public static Fn2<String, String, String> explainFold() {
        return (acc, x) -> format("(%s + %s)", acc, x);
    }
}


text:
using SharpData.Databases;
using SharpData.Tests.Integration.Data;

namespace SharpData.Tests.Integration.Oracle {
    public class OracleSpecificExceptionsTests : SpecificExceptionsTests {
        public OracleSpecificExceptionsTests() {
            _dataClient = DBBuilder.GetDataClient(DbProviderType.OracleOdp);
            _database = _dataClient.Database;
        }
    }
}


text:
angular.module('ngMap')
.controller('ngIdiom', ['$scope', 'config', '$window',
function ($scope, config, $window) {

    /**
     * Scope models
     */
    $scope.selected = config.idiomId;
    $scope.idioms = config.idioms;

    /**
     * Change page URL with idiom
     *
     * @returns {undefined}
     */
    $scope.changeIdiom = function () {
        $window.location.href = config.baseURL + '/idiom/' + $scope.selected;
    };

}]);


text:
serialization
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php

$ext = new ReflectionExtension("http");
foreach ($ext->getClasses() as $class) {
	if ($class->isInstantiable()) {
		#printf("%s\n", $class->getName());
		$instance = $class->newInstance();
		$serialized = serialize($instance);
		$unserialized = unserialize($serialized);

		foreach (array("toString", "toArray") as $m) {
			if ($class->hasMethod($m)) {
				#printf("%s#%s\n", $class->getName(), $m);
				$unserialized->$m();
			}
		}
	}
}
?>
DONE
--EXPECTF--
DONE


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import re
import sys

def main():
    for path in sys.argv[1:] or sys.stdin.read().splitlines():
        with open(path, 'rb') as path_fd:
            for line, text in enumerate(path_fd.readlines()):
                try:
                    text = text.decode('utf-8')
                except UnicodeDecodeError as ex:
                    print('%s:%d:%d: UnicodeDecodeError: %s' % (path, line + 1, ex.start + 1, ex))
                    continue

                match = re.search(u'([''""])', text)

                if match:
                    print('%s:%d:%d: use ASCII quotes `\'` and `"` instead of Unicode quotes' % (
                        path, line + 1, match.start(1) + 1))

if __name__ == '__main__':
    main()


text:
import _xson
import codecs
from cStringIO import StringIO

class ArrayContextManager(object):
    def __init__(self, reader):
        self.reader = reader

    def __enter__(self):
        self.reader.begin_array()

    def __exit__(self, type, value, tb):
        self.reader.end_array()

class ObjectContextManager(object):
    def __init__(self, reader):
        self.reader = reader

    def __enter__(self):
        self.reader.begin_object()

    def __exit__(self, type, value, tb):
        self.reader.end_object()

class Reader(object):
    def __init__(self, data):
        if type(data) is bytes:
            data = StringIO(data)
        elif type(data) is unicode:
            data = StringIO(data.encode('utf-8'))
        stream = _xson._stream_from_fileobj(data)
        self.reader = _xson._reader_from_stream(stream)

    def close(self):
        self.reader = None

    def array(self):
        return ArrayContextManager(self)

    def object(self):
        return ObjectContextManager(self)

    def begin_array(self):
        _xson._reader_begin_array(self.reader)

    def end_array (self):
        _xson._reader_end_array(self.reader)

    def begin_object(self):
        _xson._reader_begin_object(self.reader)

    def end_object(self):
        _xson._reader_end_object(self.reader)

    def name(self):
        return _xson._reader_name(self.reader)

    def str(self):
        return _xson._reader_string(self.reader)

    def null(self):
        _xson._reader_null(self.reader)

    def bool(self):
        return _xson._reader_bool(self.reader)

    def int(self):
        return _xson._reader_int(self.reader)

    def float(self):
        return _xson._reader_float(self.reader)

    def skip(self):
        _xson._reader_skip(self.reader)

    def value(self):
        return _xson._reader_value(self.reader)

    def has_next(self):
        return _xson._reader_has_next(self.reader)


text:
<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20190901211549 extends AbstractMigration
{
    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE translation_translation_route ADD property VARCHAR(255) NOT NULL, DROP type, DROP typeId, DROP path');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE translation_translation_route ADD type VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD typeId INT DEFAULT NULL, ADD path VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, DROP property');
    }
}


text:
/// <reference path="../../../shared/data-types.ts" />
/// <reference path="../../js/typings/angular/angular.d.ts" />

module Shared.Directives {

	/**
	 * <ff-content> intelligently displays raw user submitted content. It changes format based
	 * on the size of the box, condensing down to an icon if necessary.
	 */
	export function ffQuestion(): ng.IDirective {
		return {
			restrict: "E",
			scope: {
				content: "=",
				isReply: "="
			},
			replace: true,
			templateUrl: "public/directives/ff-question/template.html"
		}
	}
}


text:
<?php

defined('_JEXEC') or die;

JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php');

/**
 * View to edit a client.
 *
 * @package     Joomla.Administrator
 * @subpackage  com_banners
 * @since       1.5
 */
class BannersViewClient extends JViewLegacy
{
	protected $form;

	protected $item;

	protected $state;

	/**
	 * @var  JObject  Object containing permissions for the item
	 */
	protected $canDo;

	/**
	 * Display the view
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  void
	 */
	public function display($tpl = null)
	{
		$this->form		= $this->get('Form');
		$this->item		= $this->get('Item');
		$this->state	= $this->get('State');
		$this->canDo	= JHelperContent::getActions('com_banners');

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode("\n", $errors));

			return false;
		}

		$this->addToolbar();
		parent::display($tpl);
	}

	/**
	 * Add the page title and toolbar.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function addToolbar()
	{
		JFactory::getApplication()->input->set('hidemainmenu', true);

		$user		= JFactory::getUser();
		$isNew		= ($this->item->id == 0);
		$checkedOut	= !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
		$canDo		= $this->canDo;

		JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'bookmark banners-clients');

		// If not checked out, can save the item.
		if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create')))
		{
			JToolbarHelper::apply('client.apply');
			JToolbarHelper::save('client.save');
		}

		if (!$checkedOut && $canDo->get('core.create'))
		{
			JToolbarHelper::save2new('client.save2new');
		}
		// If an existing item, can save to a copy.
		if (!$isNew && $canDo->get('core.create'))
		{
			JToolbarHelper::save2copy('client.save2copy');
		}

		if (empty($this->item->id))
		{
			JToolbarHelper::cancel('client.cancel');
		}
		else
		{
			if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit'))
			{
				JToolbarHelper::versions('com_banners.client', $this->item->id);
			}

			JToolbarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE');
		}

		JToolbarHelper::divider();
		JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT');
	}
}


text:
package api.gateway.server.endpoint;

import api.gateway.server.EventContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter;
import reactor.bus.Event;
import reactor.bus.EventBus;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author chanwook
 */
@RestController
public class ApiGatewayEndpoint {

    private final Logger logger = LoggerFactory.getLogger("api.gateway.endpoint");

    @Autowired
    EventBus eventBus;

    @RequestMapping(value = "/info/{apiName}/{apiVersion}/{apiUrl}")
    public String info(@PathVariable String apiName, @PathVariable String apiVersion,
                       @PathVariable String apiUrl) {

        return "API INFO: " + apiName + ";" + apiVersion + ";" + apiUrl;
    }

    @RequestMapping(value = "/{apiName}/{apiVersion}/{apiUrl}")
    public ResponseBodyEmitter handleRequest(HttpServletRequest request,
                                             HttpServletResponse response,
                                             @PathVariable String apiName,
                                             @PathVariable String apiVersion,
                                             @PathVariable String apiUrl) {

        final EventContext requestContext = new EventContext(apiName, apiVersion, apiUrl, request, response);
        final ResponseBodyEmitter emitter = new ResponseBodyEmitter();

        try {
            final Event<EventContext> event = Event.wrap(requestContext);

            this.eventBus.sendAndReceive("api.request", event,
                    (Event<EventContext> s) -> {
                        try {
                            final EventContext responseContext = s.getData();
                            emitter.send(responseContext.getResponse(), MediaType.APPLICATION_JSON);
                            emitter.complete();
                        } catch (IOException e) {
                            logger.error("Failed...", e);
                            emitter.completeWithError(e);
                        }
                    });

        } catch (Exception ex) {
            logger.error("Failed API executing", ex);
            emitter.completeWithError(ex);
        }
        return emitter;
    }
}


text:
To connect the device you need to get the device credentials first.
ThingsBoard support different device credentials. We recommend to use default auto-generated credentials which is access token for this guide.

{% include images-gallery.html imageCollection="step31" showListImageTitles="true" %}

Now you are ready to publish telemetry data on behalf of your device.
We will use simple commands to publish data over HTTP or MQTT in this example.

{% capture connectdevicetogglespec %}
HTTPLinux, macOS or Windows%,%http%,%templates/edge/getting-started/http.md%br%
MQTTLinux or macOS%,%mqtt-linux%,%templates/edge/getting-started/mqtt-linux.md%br%
MQTTWindows%,%mqtt-windows%,%templates/edge/getting-started/mqtt-windows.md%br%
CoAPLinux or macOS%,%coap%,%templates/edge/getting-started/coap.md%br%
Other ProtocolsModbus, SNMP, LoRaWAN, etc%,%other%,%templates/edge/getting-started/other.md{% endcapture %}
{% include content-toggle.html content-toggle-id="connectdevice" toggle-spec=connectdevicetogglespec %}

Once you have successfully published the "temperature" readings, you should immediately see them in the Device Telemetry Tab:

{% include images-gallery.html imageCollection="step32" showListImageTitles="true" %}


text:
layout: post
title: Week 4
---

This week in OOP we really focused on references, pointers, and pass by value. For me it is a pretty easy concept to think about, but
the exact details of the processes and some of the weird edge cases still manage to trip me up. The biggest things I've been struggling
with is where references can be returned to. For example, are the if a reference is a different data type from the thing it is an alias of,
can they both access the same fields? The trick is to really understand what's going on behind the scenes, and where everything
is being stored (Especially knowing the scopes), and then just think slowly through what's going on. With these weird corner cases, often
it seems like it a very complicated situation, but from what I've experienced the answer normally stems from something not
making sense with how the language operates.

As for the project, this one was definitely less smooth than the last one. My partner and I would consistently run into random mistakes,
and the test cases we wrote were very half-hearted and were not effective at all at identifying these potential bugs.

Tip of the week: Break down your functions into parts, and unit test each one. No matter how naive the solution, this method is SO much
easier to diagnose, improve, and modularize. Also be careful with makeshift solutions to bugs, because sometimes you will think it solves
the problem at the current time, but it will then reveal that all it did was make the wound worse by revealing other bugs and flaws with
the logic.


text:
'use strict';

var expect = require('chai').expect;
var modified_lru_cache = require('../');


text:
package com.example.rollbar.struts2.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.inject.Inject;
import com.rollbar.notifier.Rollbar;
import com.rollbar.struts.RollbarFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Struts2 action with Spring CDI.
 */
public class HelloRollbarAction extends ActionSupport {

  private static final AtomicInteger counter = new AtomicInteger(1);

  private final Rollbar rollbar;

  @Inject
  public HelloRollbarAction(RollbarFactory rollbarFactory) {
    this.rollbar = rollbarFactory.build();
  }

  public String index() {
   rollbar.info("Executing index action in HelloRollbarAction");

   return SUCCESS;
  }

  public String hello() {
    int current = counter.getAndAdd(1);
    if (current % 2 == 0) {
      throw new RuntimeException("Fatal error at hello rollbar action. Number: " + current);
    }
    return SUCCESS;
  }

}


text:
<resources>
    <string name="app_name">DEV3L-hello-world-android</string>

    <string name="hello_world">Hello world!\nThis is my first Android App.\n\nVist My GitHub!\nhttps://github.com/DEV3L</string>
    <string name="blog_text">Visit my Blog!\nhttps://softwaredev3loper.wordpress.com/</string>
    <string name="action_settings">Settings</string>
</resources>


text:
import ndarray = require('ndarray');

const data1 = new Int32Array(2 * 2 * 2 + 10);
const typedArr = ndarray(data1, [2, 2, 2], [1, 2, 4], 5);
console.log(typedArr.data === data1);
console.log(typedArr.data.buffer.byteLength);
console.log(typedArr.shape[0] === 2);
console.log(typedArr.shape[1] === 2);
console.log(typedArr.shape[2] === 2);
console.log(typedArr.stride[0] === 1);
console.log(typedArr.stride[1] === 2);
console.log(typedArr.stride[2] === 4);
console.log(typedArr.offset === 5);
console.log(typedArr.dtype === 'int32');
console.log(typedArr.size === 8);
console.log(typedArr.order[0] === 0);
console.log(typedArr.order[1] === 1);
console.log(typedArr.order[2] === 2);
console.log(typedArr.dimension === 3);
console.log(typedArr.set(0, 0, 0, 1) >= 1);
console.log(typedArr.get(0, 0, 0) >= 1);
console.log(typedArr.index(1, 1, 1) >= 12);

const typedView = typedArr.lo(0, 0, 0).hi(1, 1, 1).step(0, 1).transpose(0, 1).pick(null, null, 1);
console.log(typedView.data === data1);
console.log(typedView.data.buffer.byteLength);

const data2 = [0, 1, 2, 3];
const numArr = ndarray(data2);
console.log(numArr.data.concat([]).length);
console.log(numArr.shape[0] === 4);
console.log(numArr.data === data2);
console.log(numArr.get(0) >= 0);
console.log(numArr.lo(0).data === data2);

const data3 = [true, false];
const boolArr = ndarray(data3);
console.log(boolArr.data[0] ? 1 : 0);

function generic1<D extends ndarray.TypedArray>(data: D): ndarray.NdArray<D> {
    return ndarray(data);
}

const gen1 = generic1(Float32Array.from([0, 1]));
console.log(gen1.get(0) === 0);
console.log(gen1.data.buffer.byteLength);

function generic2<T>(...values: T[]): ndarray.NdArray<T[]> {
    return ndarray(values);
}

const gen2 = generic2<string | boolean>('test', 'blah', true);
const firstVal = gen2.get(0);
console.log(typeof firstVal === 'string' ? firstVal.length : firstVal.valueOf());

function getFirstValue(arr: ndarray.NdArray): number {
    return arr.get(0);
}


text:
  {% for deal in deals %}
    {% include "snippet_deal_thumbnail.html" with deal=deal action_url=action_url %}
  {% endfor %}


text:
<?php

namespace Puli\Discovery\Api\Validation;

use Puli\Discovery\Api\Binding\BindingType;

/**
 * Validates parameter values against the constraints defined by a binding type.
 *
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
interface ParameterValidator
{
    /**
     * Returns whether the given parameter values are valid.
     *
     * @param array       $parameterValues The parameter values to validate.
     * @param BindingType $type            The type to validate the values for.
     *
     * @return ConstraintViolation[] The found violations. If no violations were
     *                               found, an empty array is returned.
     */
    public function validate(array $parameterValues, BindingType $type);
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>VariableMapper (EL 3.0 API Documentation - Apache Tomcat 8.0.14)</title>
<meta name="date" content="2014-09-24">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Tree

Deprecated

Index

Help

EL 3.0 - Apache Tomcat 8.0.14

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

javax.el

Class VariableMapper

java.lang.Object

javax.el.VariableMapper

public abstract class VariableMapper
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

VariableMapper()

Method Summary

Methods

Modifier and Type
Method and Description

abstract ValueExpression
resolveVariable(java.lang.String variable)

abstract ValueExpression
setVariable(java.lang.String variable,
           ValueExpression expression)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

VariableMapper

public VariableMapper()

Method Detail

resolveVariable

public abstract ValueExpression resolveVariable(java.lang.String variable)

setVariable

public abstract ValueExpression setVariable(java.lang.String variable,
                          ValueExpression expression)

Package

Class

Tree

Deprecated

Index

Help

EL 3.0 - Apache Tomcat 8.0.14

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.


text:
<?php
require_once "recaptchalib.php";
?>
<!DOCTYPE html>

        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Somos Talentos">
        <meta name="author" content="Somos Talentos">
        <title>Somos Talentos</title>
        <link rel="stylesheet" href="<?= base_url() ?>public/css/font-awesome.min.css">
        <link rel="stylesheet" href="<?= base_url() ?>public/css/bootstrap.min.css">
        <link rel="stylesheet" href="<?= base_url() ?>public/css/style.css">

        <link rel="icon" type="image/png" href="<?= base_url() ?>/favicon.ico" />

        <link href='https://fonts.googleapis.com/css?family=Open+Sans:600italic,400,800,700,300' rel='stylesheet' type='text/css'>

                            <img src="<?= base_url() ?>public/img/logotipo_somostalentos.jpg" alt="" class="logo" width="80" height="65">

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

                                    </button>

Inicio

                                            Nosotros

Quiénes somos

Misión y Visión

Filosofía

Objetivos

Diferencias

Comparativo

Ventajas

                                            Servicios

Servicios

Costos

Pago

Contacto

                                            Ayuda registro

Talento

Cazatalento

                                            FAQ

Talentos

Cazatalentos

No Discriminación

El sitio para encontrar talentos...NO CURRÍCULUMS

                        <button onclick="document.getElementById('login').scrollIntoView()">LOGIN</button>

LOGIN

                            <img src="<?= base_url() ?>public/img/acceso.png" alt="Login" width="150" height="150"/>

Inicia tu sesión

                            Si ya estás registrado, ingresa con tu correo/usuario.

                            <img id="registro" src="<?= base_url() ?>public/img/registro.png" alt="Registro" width="150" height="150"/>

Registro

                            Regístrate, o bien, registra tu empresa para encontrar al talento que necesitas.  Talento
                                 Cazatalento

                        <video width="400" autoplay>
                           <source src="https://somostalentos.com/public/videos/somostal.mp4" type="video/mp4"/>
                        </video>

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

Quiénes somos

                            Somos un grupo de profesionales mexicanos con amplia y reconocida experiencia
                            en el ámbito de los recursos humanos, el desarrollo organizacional, la asesoría
                            empresarial, la capacitación especializada y el desarrollo humano, con el objetivo
                            de implementar alternativas innovadoras de búsqueda de talentos, adicionales a
                            las que ya existen en el mercado.

                            Tenemos la firme convicción de que el área de recursos humanos debe continuar
                            evolucionando y ofrecer nuevas alternativas tecnológicas y humanas a las personas
                            en busca de oportunidades laborales y, al mismo tiempo, otorgar un servicio profesional
                            a las empresas para encontrar personas que poseen el talento adecuado a sus necesidades
                            organizacionales.

Cambiamos la forma de reclutar

Sin currículums.

Sin publicar vacantes.

                            En la actualidad se necesitan nuevos métodos de búsqueda de talentos más
                            eficaces, menos costosos y que se invierta poco tiempo, éste sitio ofrece
                            todas esas ventajas, es un sitio de interacción entre reclutadores y candidatos.

Valores

IGUALDAD

Todos por igual merecemos las mismas oportunidades, sin discriminación.

INNOVACIÓN

Transformar el proceso de atraer y elegir a una persona, a través de
                                establecer un enfoque diferente sobre el talento de un candidato.

COLABORACIÓN

Ayudar a las empresas a conseguir los mejores talentos y apoyar a las personas a
                                encontrar las mejores oportunidades de desarrollo laboral y profesional.

CONFIANZA

Confiar en el talento de las personas.

TECNOLOGÍA

Usar la tecnología actual en favor de las empresas para facilitar y eficientar
                                diversas tareas de Recursos Humanos y para proporcionar una alternativa innovadora a las
                                personas en su búsqueda de oportunidades de desarrollo laboral.

MISIÓN

                        Somos un medio tecnológico y humano de enlace efectivo, ágil, interactivo y
                        confiable, entre empresas y personas,
 para generar oportunidades laborales,
                        eliminando diversas barreras para detectar talentos.

VISIÓN

                        Ser un medio tecnológico y humano que ayude a más personas a obtener el puesto de trabajo acorde

a su talento y habilidades, y a las empresas a conseguir a los candidatos con más capacidades.

Filosofía

                            Promover la igualdad de oportunidades de trabajo, sin importar la edad, el sexo, la religión,
                            el estado civil, los rasgos físicos y apariencia, las capacidades diferentes, el lugar de procedencia
                            o la preferencia sexual. Sólo importa inicialmente el talento para ser elegidos. Buscamos modificar
                            la percepción de los reclutadores, para que no desperdicien el talento de una persona y consideren que no
                            cumplen un perfil al 100% con la sola lectura de un Currículum Vitae. Promovemos la selección de personal
                            primero por su talento y después por otros factores.

Objetivos

Proveer a los reclutadores del mejor talento para cubrir sus vacantes, con acceso a una base de datos
                                de candidatos de todo tipo de perfiles personales y laborales: básicos, especiales, técnicos o profesionales.

Que los reclutadores conozcan a los candidatos por su perfil como personas y por sus talentos,
                                en vez de la simple lectura de su Currículum Vitae.

Romper paradigmas en la selección de personal.

DIFERENCIAS

Bolsas de trabajo

El reclutador publica una vacante y espera a que los candidatos la consulten y se postulen.

El candidato elige si le interesa o no la oferta, y se pierde la oportunidad de reclutar un talento
                                o se postulan candidatos sin los requisitos básicos.

El reclutador publica

El candidato consulta

                            <img class="img-responsive" src="<?= base_url() ?>public/img/otros.jpg" alt="">

RESULTADO

Es necesario leer muchos currículums.

Menor número de candidatos para elegir.

Somos Talentos

El candidato publica su perfil.

El reclutador consulta y elige a sus candidatos.

El candidato publica

El reclutador consulta

                            <img class="img-responsive" src="<?= base_url() ?>public/img/bolsadetrabajo.jpg" alt="">

RESULTADO

Se realiza un filtro de candidatos por puesto.

Mayor número de candidatos para elegir.

Comparativo

Comparativo de procesos para el reclutamiento y selección del personal

                        <img class="img-responsive" src="<?= base_url() ?>public/img/Comparativo.jpg" alt="Comparativo SomosTalentos">

                        <img class="img-responsive" src="<?= base_url() ?>public/img/Comparativo_2.jpg" alt="Comparativo SomosTalentos">

Ventajas

 Se descubren talentos.

 El servicio es gratuito para candidatos.

 El costo para las empresas es muy accesible
                                y se puede cancelar en cualquier momento.

                                 El reclutador invierte menos tiempo en buscar candidatos.

                                 Los reclutadores pueden elegir las preguntas
                                para la entrevista virtual en tiempo real, de nuestra
                                base de datos con preguntas pensadas para ayudarlos
                                a descubrir talentos o bien, hacer sus propias
                                preguntas.

                                 Las entrevistas virtuales hacen más ágil el proceso
                                de selección, citando únicamente a los candidatos
                                más adecuados.

                                 No se maneja información confidencial del candidato
                                ni de la empresa durante el proceso en el sitio,
                                únicamente los datos básicos.

                                 Se pueden conocer muestras del trabajo de los candidatos
                                o sus logros incluso antes de contactarlos.

 Facilitamos el trabajo al área de Recursos Humanos,
                                a los Head-Hunters y a cualquier tipo de empresa,
                                negocio o institución que requiera personas con el
                                talento adecuado a sus perfiles laborales.

SERVICIOS

!Innovamos el proceso de atraer y elegir al talento humano!

Existen miles de formas de redactar un currículum y por esta razón, pensamos
                        que no existe una forma correcta, sin embargo, si existe una forma incorrecta
                        de redactar un currículum, con información incompleta o información no necesaria
                        o que simplemente no refleja el verdadero potencial de una persona y que al final
                        provoca que el reclutador pre-juzgue a un candidato formándose una imagen probablemente
                        falsa, sin ni siquiera darse la oportunidad conocer al candidato y obtener la información
                        más real y por supuesto más útil para poder elegir mejor.

                            <img class="img-responsive" src="<?= base_url() ?>public/img/platicas.jpg" alt="">

                            <img class="img-responsive" src="<?= base_url() ?>public/img/platicas2.jpg" alt="">

 Nuestro servicio se basa en ayudar a personas que
                            buscan una oportunidad laboral, pero que son rechazados
                            por reclutadores que solamente se basan en una hoja de vida
                            para seleccionar candidatos y a empresas que desean probar
                            nuevas alternativas en la forma de pre-seleccionar candidatos.

 No se publican vacantes, se eligen candidatos de nuestra base
                            de datos, para encontrar talentos en espera de un llamado y una
                            oportunidad.

 Los candidatos no necesitan capturar un Currículum, simplemente
                            explicar sus talentos y que un reclutador cazatalentos se interese
                            por conocerlos.

CAZATALENTOS

                             Búsqueda de candidatos.- Podrás consultar entre muchos
                            candidatos que buscan el puesto que tú necesitas cubrir y están esperando a que los entrevistes.

                             Entrevista en electrónica por correo.-  Si prefieres, puedes generar una entrevista  por
                            escrito y enviarla al candidato para que la conteste y decidir si es el talento que necesitas.
                            Dependiendo del plan que contrates, podrás crear tus propias entrevistas y guardarlas para aplicarlas las veces que
                            necesites, o bien, editarlas en función de tus necesidades y lo que necesites conocer.

                             Evaluación psicométrica en línea.-  Podrás aplicar exámenes
                            psicométricos al candidato vía internet, recibiendo el resultado en tu correo electrónico y posteriormente lleves
                            a cabo la interpretación respectiva, éste servicio te facilitará el proceso de selección, ya que tendrás un acceso para
                            aplicar hasta 3 exámenes por candidato, evaluando factores tales como: Inteligencia, valores, habilidades de supervisión
                            y aptitudes para las ventas, de acuerdo a lo requerido en tu perfil de puesto.

                            Tendrás la opción de asistir a nuestros cursos realizados en la Cd. de México sobre el tema de evaluaciones psicométricas
                            y/o el proceso efectivo de atracción de talento humano, de acuerdo al calendario mensual propuesto, a costos preferenciales
                            al contar con tu registro de "Cazatalentos".

                             Generación de reporte de entrevistas realizadas.-  Podrás solicitar
                            un reporte mensual del número de entrevistas que realizaste en el mes.

TALENTOS

                             Registro en una base de datos para ser encontrado.-
                            Te registras sin costo y estarás visible para todos los reclutadores.

                             Entrevista electrónica por correo.-
                            Tendrás la oportunidad de describir tu talento al contestar las preguntas que recibirás por correo,
                            como entrevista previa y con la que obtendrás mayores oportunidades de ser tomado en cuenta.

                             Espacio de galería para muestras de documentos o tus creaciones.-
                            Si lo deseas, podrás contratar un espacio para que publiques lo que quieras mostrar a los reclutadores, diseños,
                            fotografías, escritos, diplomas, reconocimientos, etc., a un costo muy accesible.

Planes y Costos

Talentos

                                    MEMBRESÍA
                                    GENERAL

                                    Registro en la base de datos*
                                    Sin costo

                                    Galeria
                                    $ 50 MN (Pago Mensual)

*Vigencia de 3 meses, con opción de renovar.

                        <button class="boton" onclick="document.getElementById('login').scrollIntoView()">CONTRATAR</button>

Publicidad

                                    MEMBRESÍA
                                    GENERAL

                                    Publicidad estática siempre visible*
                                    $ 300 MN

*Vigencia de 3 meses, con opción de renovar.

Consultar condiciones para el uso del servicio de publicidad.

                        <button class="boton" onclick="document.getElementById('login').scrollIntoView()">CONTRATAR</button>

Pago de Servicios

                                Depósito o transferencia electrónica

                                BANCO:     Santander

                                CUENTA:   60591035519

                                CLABE:       014180605910355198

                                Una vez realizado el pago por el servicio, si eres un talento, desde la galeria,
                                enviar la referencia bancaria, después se le habilitará el servicio contratado, en caso de
                                que seas un cazatalento o empresa, desde el menú pago de tu panel de control.

CONTACTO

Para cualquier asunto relacionado con el sitio, por favor comuníquese con nosotros
                            vía correo electrónico o al teléfono (04455) 34 56 53 91

                        <?php
                        echo form_open();
                        $dataNombre = array(
                            'id' => 'nombre',
                            'name' => 'nombre',
                            'class' => 'name form-input',
                            'type' => 'text',
                            'placeholder' => 'NOMBRE',
                            'style' => 'text-transform: uppercase;',
                            'required' => 'required'
                        );
                        $dataEmail = array(
                            'id' => 'email',
                            'name' => 'email',
                            'class' => 'email form-input',
                            'type' => 'email',
                            'placeholder' => 'EMAIL',
                            'required' => 'required'
                        );
                        $dataMensaje = array(
                            'id' => 'mensaje',
                            'name' => 'mensaje',
                            'class' => 'message form-input',
                            'type' => 'text',
                            'placeholder' => 'MENSAJE',
                            'style' => 'text-transform: uppercase;',
                            'required' => 'required'
                        );
                        $dataBoton = array(
                            'class' => 'submit-btn',
                            'type' => 'submit',
                            'value' => 'Enviar',
                            'name' => 'enviar'
                        );
                        echo form_input($dataNombre, set_value('nombre'));
                        echo form_input($dataEmail, set_value('email'));
                        echo form_input($dataMensaje, set_value('mensaje'));
                        echo '

';
                        echo form_submit($dataBoton);
                        echo form_close();
                        ?>
                            <?php if (isset($captchamsn)): ?>

<?php echo $captchamsn; ?>

                        <?php endif; ?>
<?php if (isset($captchaexito)): ?>

<?php echo $captchaexito; ?>

<?php endif; ?>

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

Ayuda

Derechos Reservados | <a href="<?= base_url() ?>public/docs/Terminos_de_Uso.pdf" target="_blank">Términos de uso y Políticas | <a href="<?= base_url() ?>public/docs/Aviso_de_Privacidad.pdf" target="_blank">Aviso de Privacidad | Asistencia


text:
import React from "react";
import { Formik, Form, Field, ErrorMessage } from "formik";
import cn from "classnames";

const CompanyForm = ({
  isSubmitting,
  onSubmit,
  initialValues,
  submitBtnText,
}) => (
  <Formik
    initialValues={initialValues}
    validate={(values) => {
      const errors = {};
      if (!values.name) {
        errors.name = "Your company name is required.";
      }

      if (values.name.length > 65) {
        errors.name = "Please enter a name that is 65 characters or less.";
      }

      if (!values.short_description) {
        errors.short_description =
          "Please enter a short description of your company.";
      }

      if (values.short_description.length > 200) {
        errors.short_description =
          "Please enter a short description that is 200 characters or less.";
      }

      if (!values.description) {
        errors.description =
          "Please enter a detailed description of your company.";
      }
      if (!values.location) {
        errors.location = "Please the location of your company headquarters.";
      }

      if (!values.size) {
        errors.size =
          "Please describe the number of people your company employs.";
      }

      if (!Number.isInteger(values.size) || values.size > 3000000) {
        errors.size =
          "Please enter a valid size. (No Decimals/Smaller than 3 million)";
      }
      return errors;
    }}
    onSubmit={onSubmit}
  >
    {({ isSubmitting, errors }) => (
      <Form>
        <fieldset>
          <legend>Company Details</legend>

              Company Name

              <Field
                type="text"
                name="name"
                id="name"
                className={cn({
                  input: true,
                  "is-danger": errors.name,
                })}
              />

            <ErrorMessage
              name="name"
              component="p"
              className="help is-danger"
            />

              Short Description

              <Field
                id="short_description"
                name="short_description"
                component="textarea"
                className={cn({
                  textarea: true,
                  "is-danger": errors.short_description,
                })}
              />

            <ErrorMessage
              name="short_description"
              component="p"
              className="help is-danger"
            />

              Company Details

              <Field
                id="description"
                name="description"
                component="textarea"
                className={cn({
                  textarea: true,
                  "is-danger": errors.description,
                })}
              />

              Hint: You can use{" "}

                Markdown

            <ErrorMessage
              name="description"
              component="p"
              className="help is-danger"
            />

              Location:{" "}

              <Field
                type="text"
                id="location"
                name="location"
                className={cn({
                  input: true,
                  "is-danger": errors.location,
                })}
              />

            <ErrorMessage
              name="location"
              component="p"
              className="help is-danger"
            />

              Company size

              <Field
                type="number"
                id="size"
                name="size"
                className={cn({
                  input: true,
                  "is-danger": errors.size,
                })}
              />

            <ErrorMessage
              name="size"
              component="p"
              className="help is-danger"
            />

        </fieldset>
        <fieldset>
          <legend>Profile</legend>

              Twitter

              <Field
                type="text"
                id="size"
                name="twitter"
                className={cn({
                  input: true,
                  "is-danger": errors.twitter,
                })}
              />

            <ErrorMessage
              name="twitter"
              component="p"
              className="help is-danger"
            />

              Facebook

              <Field
                type="text"
                id="size"
                name="facebook"
                className={cn({
                  input: true,
                  "is-danger": errors.facebook,
                })}
              />

            <ErrorMessage
              name="facebook"
              component="p"
              className="help is-danger"
            />

              Github

              <Field
                type="text"
                id="size"
                name="github"
                className={cn({
                  input: true,
                  "is-danger": errors.github,
                })}
              />

            <ErrorMessage
              name="github"
              component="p"
              className="help is-danger"
            />

              Linkedin

              <Field
                type="text"
                id="size"
                name="linkedin"
                className={cn({
                  input: true,
                  "is-danger": errors.linkedin,
                })}
              />

            <ErrorMessage
              name="linkedin"
              component="p"
              className="help is-danger"
            />

        </fieldset>
        <fieldset>

              <button
                className="button is-link"
                disabled={isSubmitting}
                type="submit"
              >
                {submitBtnText}
              </button>

              <button className="button is-text" type="reset">
                Reset
              </button>

        </fieldset>
      </Form>
    )}
  </Formik>
);

export default CompanyForm;


text:
package edu.umass.cs.jfoley.coop;

import ciir.jfoley.chai.collections.Pair;
import ciir.jfoley.chai.collections.list.IntList;
import ciir.jfoley.chai.collections.util.MapFns;
import ciir.jfoley.chai.io.Directory;
import ciir.jfoley.chai.io.IO;
import ciir.jfoley.chai.io.ShardedTextWriter;
import ciir.jfoley.chai.io.archive.ZipArchive;
import ciir.jfoley.chai.io.archive.ZipArchiveEntry;
import ciir.jfoley.chai.string.StrUtil;
import ciir.jfoley.chai.time.Debouncer;
import edu.umass.cs.jfoley.coop.coders.KryoCoder;
import edu.umass.cs.jfoley.coop.document.CoopDoc;
import edu.umass.cs.jfoley.coop.document.CoopToken;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

/**
 * @author jfoley
 */
public class TagLearning {

  Set<String> allObjects = new HashSet<>();
  Set<String> allProps = new HashSet<>();
  Set<String> allTags = new HashSet<>();
  Set<String> allFeatures = new TreeSet<>();
  Map<Pair<String,String>, Integer> classFreqs = new HashMap<>();

  public static void main(String[] args) throws IOException {
    TagLearning dataCollector = new TagLearning();

    Directory output = new Directory("offline-learning-2");
    List<File> inputZips = new ArrayList<>();
    List<File> candidates = Directory.Read(".").children();
    for (File candidate : candidates) {
      if(candidate.getName().startsWith("clue_schemax")) {
        inputZips.add(candidate);
      }
    }
    KryoCoder<CoopDoc> coder = new KryoCoder<>(CoopDoc.class);

    Debouncer msg = new Debouncer(1000);

    long startTime = System.currentTimeMillis();
    for (File inputZip : inputZips) {
      try (ZipArchive zip = ZipArchive.open(inputZip)) {
        List<ZipArchiveEntry> listEntries = zip.listEntries();
        for (int i = 0; i < listEntries.size(); i++) {
          ZipArchiveEntry entry = listEntries.get(i);
          CoopDoc doc = coder.read(entry.getInputStream());
          if(msg.ready()) {
            System.err.println(i + "/" + listEntries.size() + " " + doc.getName());
            System.err.println("# "+msg.estimate(i, listEntries.size()));
          }
          dataCollector.handleDocument(doc);
        }
      }
    }
    long endParsingTime = System.currentTimeMillis();
    System.out.println("Total parsing time: "+(endParsingTime - startTime)+"ms.");

    System.out.println("NumClasses: "+dataCollector.allTags.size());
    System.out.println("NumObjClasses: "+dataCollector.allObjects.size());
    System.out.println("NumPropClasses: "+dataCollector.allProps.size());
    System.out.println("NumFeatures: "+dataCollector.allFeatures.size());
    System.out.println("Classes:"+ StrUtil.join(new ArrayList<>(dataCollector.allTags), "\n"));
    System.out.println("ClassFreqs:"+dataCollector.classFreqs);
    System.out.println("null.near:"+dataCollector.classFreqs.get(Pair.of("null", "near")));
    System.out.println("null.far:"+dataCollector.classFreqs.get(Pair.of("null", "far")));

    ArrayList<String> ids = new ArrayList<>();
    try (PrintWriter pw = IO.openPrintWriter(output.childPath("features"))) {
      for (String feature : dataCollector.allFeatures) {
        ids.add(feature);
        pw.println(feature);
      }
    }

    Map<Pair<String,String>, ShardedTextWriter> featureWriters = new HashMap<>();
    Map<Pair<String,String>,Integer> classIds = new HashMap<>();
    try (PrintWriter pw = IO.openPrintWriter(output.childPath("classes"))) {
      int idx = 1;
      for (Pair<String,String> classes : dataCollector.classFreqs.keySet()) {
        // skip low-freq classes:
        if(dataCollector.classFreqs.get(classes) < 1000) continue;

        int curIdx = idx++;
        classIds.put(classes, curIdx);
        pw.printf("%s\t%s\t%d\n", classes.left, classes.right, curIdx);
        Directory dir = output.childDir(classes.left);
        featureWriters.put(classes, new ShardedTextWriter(dir, classes.right, "svm",
        20000));
      }
    }

    // second pass, actually save features:
    msg = new Debouncer(1000);
    long startTime2 = System.currentTimeMillis();
    for (File inputZip : inputZips) {
      try (ZipArchive zip = ZipArchive.open(inputZip)) {
        List<ZipArchiveEntry> listEntries = zip.listEntries();
        for (int i = 0; i < listEntries.size(); i++) {
          ZipArchiveEntry entry = listEntries.get(i);
          CoopDoc doc = coder.read(entry.getInputStream());
          if(msg.ready()) {
            System.err.println(i + "/" + listEntries.size() + " " + doc.getName());
            System.err.println("# "+msg.estimate(i, listEntries.size()));
          }
          for (List<CoopToken> coopTokens : doc.getSentences()) {
            boolean sentencePositive = false;
            for (CoopToken coopToken : coopTokens) {
              if (!coopToken.getTags().isEmpty()) {
                sentencePositive = true;
              }
            }

            for (CoopToken coopToken : coopTokens) {
              StringBuilder svmF = new StringBuilder();

              Map<Pair<String,String>, Integer> classNums = new HashMap<>();
              List<Pair<String,String>> classes = getClassNames(coopToken);
              for (Pair<String, String> className : classes) {
                Integer classId = classIds.get(className);
                if(classId == null) continue;
                classNums.put(className, classId);
              }
              if(classNums.isEmpty()) {
                Pair<String,String> name = Pair.of("null", sentencePositive ? "near" : "far");
                classNums.put(name, 0);
              }

              Set<Integer> fset = new HashSet<>();
              for (String fname : coopToken.getIndicators()) {
                int id = Collections.binarySearch(ids, fname.toLowerCase());
                if(id < 0) continue;
                fset.add(id);
              }

              IntList features = new IntList(fset);
              features.sort();
              for (int id : features) {
                svmF.append(' ').append(id).append(":").append(1);
              }

              for (Map.Entry<Pair<String, String>, Integer> kv : classNums.entrySet()) {
                Integer classId = kv.getValue();
                if(classId == null) continue;
                featureWriters.get(kv.getKey()).println(classId+svmF.toString());
              }
            }
          }
        }
      }
    }

    for (ShardedTextWriter shardedTextWriter : featureWriters.values()) {
      shardedTextWriter.close();
    }
    long endParsingTime2 = System.currentTimeMillis();
    System.out.println("Total parsing time2: "+(endParsingTime2 - startTime2)+"ms.");
  }

  public static List<Pair<String,String>> getClassNames(CoopToken tok) {
    List<Pair<String,String>> output = new ArrayList<>();

    for (String tag : tok.getTags()) {
      String usefulTag = StrUtil.takeAfter(StrUtil.takeAfter(tag, "<m>:").toLowerCase(), "/");
      if(usefulTag.contains("/")) {
        System.err.println(usefulTag);
        continue;
      }

      String obj = usefulTag;
      String prop = null;
      if(usefulTag.contains(":")) {
        obj = StrUtil.takeBefore(usefulTag, ":");
        prop = StrUtil.takeAfter(usefulTag, ":");
      }

      output.add(Pair.of("label", usefulTag));
      if(prop != null) {
        output.add(Pair.of("prop", prop));
      } else {
        output.add(Pair.of("obj", obj));
      }
    }

    return output;
  }

  private void handleDocument(CoopDoc doc) {
    for (List<CoopToken> coopTokens : doc.getSentences()) {
      handleSentence(coopTokens);
    }
  }

  private void handleSentence(List<CoopToken> coopTokens) {
    HashSet<String> sentenceFeatures = new HashSet<>();

    List<Set<String>> nullFeatures = new ArrayList<>();
    boolean keep = false;
    for (CoopToken coopToken : coopTokens) {
      for (String feature : coopToken.getIndicators()) {
        sentenceFeatures.add(feature.toLowerCase());
      }

      List<Pair<String, String>> classNames = getClassNames(coopToken);
      if(!classNames.isEmpty()) {
        for (Pair<String, String> kv : classNames) {
          pushFeatures(kv.left, kv.right, coopToken.getIndicators());
          switch (kv.left) {
            case "prop": allProps.add(kv.right); break;
            case "obj": allObjects.add(kv.right); break;
            case "label": allTags.add(kv.right); break;
          }
          keep = true;
        }
      } else {
        nullFeatures.add(coopToken.getIndicators());
      }
    }

    allFeatures.addAll(sentenceFeatures);
    if(keep) {
      for (Set<String> nullFeature : nullFeatures) {
        pushFeatures("null", "near", nullFeature);
      }
    } else {
      for (Set<String> nullFeature : nullFeatures) {
        pushFeatures("null", "far", nullFeature);
      }
    }
  }

  private void pushFeatures(String kind, String name, Set<String> features) {
    MapFns.addOrIncrement(classFreqs, Pair.of(kind, name), 1);
  }
}


text:
using UnityEngine;

namespace ClumsyBat.DataManagement
{
    public class UserSettings
    {
        public void ToggleMusic()
        {
            MusicOn = !MusicOn;
            if (!GameStatics.GameManager.IsInLevel) return;

            if (MusicOn)
            {
                if (GameStatics.LevelManager.IsBossLevel)
                {
                    // TODO check if crystal level first, then
                    // TODO determine if boss fight has already started
                    GameStatics.Audio.Music.StartBossEntranceMusic();
                }
                else
                {
                    GameStatics.Audio.Music.StartLevelMusic();
                }
            }
            else
            {
                GameStatics.Audio.Music.Stop();
            }
        }
        public void ToggleSFX() { SfxOn = !SfxOn; }

        public void ToggleTooltips() { TooltipsOn = !TooltipsOn; }

        public bool MusicOn { get; private set; }
        public bool SfxOn { get; private set; }
        public bool TooltipsOn { get; private set; }

        public UserSettings()
        {
            MusicOn = true;
            SfxOn = true;
            TooltipsOn = true;
        }

        public void LoadUserSettings()
        {
            if (PlayerPrefs.GetInt("SettingsStored") != 1)
            {
                MusicOn = true;
                SfxOn = true;
                TooltipsOn = true;
                SaveUserSettings();
            }
            else
            {
                MusicOn = PlayerPrefs.GetInt("MusicON") == 1;
                SfxOn = PlayerPrefs.GetInt("SFXON") == 1;
                TooltipsOn = PlayerPrefs.GetInt("TooltipsON") == 1;
            }
        }

        public void SaveUserSettings()
        {
            PlayerPrefs.SetInt("MusicON", MusicOn ? 1 : 0);
            PlayerPrefs.SetInt("SFXON", SfxOn ? 1 : 0);
            PlayerPrefs.SetInt("TooltipsON", TooltipsOn ? 1 : 0);
            PlayerPrefs.SetInt("SettingsStored", 1);
        }
    }

}


text:
"""
    This script will check if the environment setup is correct for the workshop.

    To run, please execute the following command from the command prompt
               >>> python check_env.py

    The output will indicate if any of the libraries are missing or need to be updated.

    This script is inspired from https://github.com/fonnesbeck/scipy2015_tutorial/blob/master/check_env.py
"""

from __future__ import print_function

try:
    import curses
    curses.setupterm()
    assert curses.tigetnum("colors") > 2
    OK = "\x1b[1;%dm[ OK ]\x1b[0m" % (30 + curses.COLOR_GREEN)
    FAIL = "\x1b[1;%dm[FAIL]\x1b[0m" % (30 + curses.COLOR_RED)
except:
    OK = '[ OK ]'
    FAIL = '[FAIL]'

import sys
try:
    import importlib
except ImportError:
    print(FAIL, "Python version 2.7 is required, but %s is installed." % sys.version)
from distutils.version import LooseVersion as Version

def import_version(pkg, min_ver, fail_msg=""):
    mod = None
    try:
        mod = importlib.import_module(pkg)
        if((pkg=="spacy" or pkg=="wordcloud") and (mod > 0)):
            print(OK, '%s ' % (pkg))
        else:
        #else:
            version = getattr(mod, "__version__", 0) or getattr(mod, "VERSION", 0)
            if Version(version) < min_ver:
                print(FAIL, "%s version %s or higher required, but %s installed."
                    % (lib, min_ver, version))
            else:
               print(OK, '%s version %s' % (pkg, version))
    except ImportError:
        print(FAIL, '%s not installed. %s' % (pkg, fail_msg))
    return mod

# first check the python version
print('Using python in', sys.prefix)
print(sys.version)
pyversion = Version(sys.version)
if pyversion < "3":
    print(FAIL, "Python version 3 is required, but %s is installed." % sys.version)
elif pyversion >= "2":
    if pyversion == "2.7":
        print(FAIL, "Python version 2.7 is installed. Please upgrade to version 3." )
else:
    print(FAIL, "Unknown Python version: %s" % sys.version)

print()
requirements = {
    'gensim'     :'0.12.4',
    'IPython'    : '4.0.3',
    'jupyter'    :'1.0.0',
    'lda'        : '1.0.3',
    'networkx'   : '1.11',
    'nltk'       : '3.1',
    'matplotlib' :'1.5.0',
    'nltk'       : '3.1',
    'numpy'      : '1.10.4',
    'pandas'     : '0.17.1',
    'PIL'        : '1.1.7',
    'scipy'      : '0.17.0',
    'sklearn'    : '0.17',
    'seaborn'    :'0.6.0',
    'spacy'      :'0.100.6',
    'statsmodels':'0.6.1',
    'wordcloud'  :'0.1',
    'xgboost'    :'0.4'

}

# now the dependencies
for lib, required_version in list(requirements.items()):
    import_version(lib, required_version)


text:
//
//  CILuaRuntime.h
//  LuaBridge
//
//  Created by xie.pingjia
//  Copyright (c) 2015 Baidu. All rights reserved.
//

#ifndef __CICore__CILuaRuntime__
#define __CICore__CILuaRuntime__

#include <iostream>
#include "CILuaState.h"

class CILuaRuntime
{
private:
    bool isOpen_;
    lua_State *state_; // lua State Object

    // forbid method aboud sharedInstance
    CILuaRuntime(const CILuaRuntime &);
    CILuaRuntime &operator = (const CILuaRuntime &);
    // Alloc
    CILuaRuntime();
public:
    // Dealloc
    ~CILuaRuntime();
    // instance method
    static CILuaRuntime &instance();

    // functions of runtime
    int open();
    void close();
    bool isOpen();
    void loadLibs();
    lua_State* state();
};
#endif /* defined(__CICore__CILuaRuntime__) */


text: all file slim framework of us build


text:
layout: default
title: "Hywel Williams"
house: commons

---

        {% include members/hywel-williams.html %}

What is Hywel Williams interested in?

Social Affairs

Social Security

Social Work

Language Issues

Kurdish Issues

International Development

Place

Hywel Williams is the MP for Arfon.

What is a constituency?

Party

Hywel Williams is an MP in the Plaid Cymru party.

What is a party?


text:
package executor

import (
	"sync"
	"sync/atomic"

	"github.com/juju/errors"
	"github.com/pingcap/tidb/ast"
	"github.com/pingcap/tidb/context"
	"github.com/pingcap/tidb/expression"
	"github.com/pingcap/tidb/infoschema"
	"github.com/pingcap/tidb/inspectkv"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/model"
	"github.com/pingcap/tidb/mysql"
	"github.com/pingcap/tidb/plan"
	"github.com/pingcap/tidb/table"
	"github.com/pingcap/tidb/tablecodec"
	"github.com/pingcap/tidb/terror"
	"github.com/pingcap/tidb/util/ranger"
	"github.com/pingcap/tidb/util/types"
)

var (
	_ Executor = &CheckTableExec{}
	_ Executor = &DummyScanExec{}
	_ Executor = &ExistsExec{}
	_ Executor = &HashAggExec{}
	_ Executor = &LimitExec{}
	_ Executor = &MaxOneRowExec{}
	_ Executor = &ProjectionExec{}
	_ Executor = &SelectionExec{}
	_ Executor = &SelectLockExec{}
	_ Executor = &ShowDDLExec{}
	_ Executor = &SortExec{}
	_ Executor = &StreamAggExec{}
	_ Executor = &TableDualExec{}
	_ Executor = &TableScanExec{}
	_ Executor = &TopnExec{}
	_ Executor = &UnionExec{}
)

// Error instances.
var (
	ErrUnknownPlan          = terror.ClassExecutor.New(codeUnknownPlan, "Unknown plan")
	ErrPrepareMulti         = terror.ClassExecutor.New(codePrepareMulti, "Can not prepare multiple statements")
	ErrStmtNotFound         = terror.ClassExecutor.New(codeStmtNotFound, "Prepared statement not found")
	ErrSchemaChanged        = terror.ClassExecutor.New(codeSchemaChanged, "Schema has changed")
	ErrWrongParamCount      = terror.ClassExecutor.New(codeWrongParamCount, "Wrong parameter count")
	ErrRowKeyCount          = terror.ClassExecutor.New(codeRowKeyCount, "Wrong row key entry count")
	ErrPrepareDDL           = terror.ClassExecutor.New(codePrepareDDL, "Can not prepare DDL statements")
	ErrPasswordNoMatch      = terror.ClassExecutor.New(CodePasswordNoMatch, "Can't find any matching row in the user table")
	ErrResultIsEmpty        = terror.ClassExecutor.New(codeResultIsEmpty, "result is empty")
	ErrBuildExecutor        = terror.ClassExecutor.New(codeErrBuildExec, "Failed to build executor")
	ErrBatchInsertFail      = terror.ClassExecutor.New(codeBatchInsertFail, "Batch insert failed, please clean the table and try again.")
	ErrWrongValueCountOnRow = terror.ClassExecutor.New(codeWrongValueCountOnRow, "Column count doesn't match value count at row %d")
)

// Error codes.
const (
	codeUnknownPlan          terror.ErrCode = 1
	codePrepareMulti         terror.ErrCode = 2
	codeStmtNotFound         terror.ErrCode = 3
	codeSchemaChanged        terror.ErrCode = 4
	codeWrongParamCount      terror.ErrCode = 5
	codeRowKeyCount          terror.ErrCode = 6
	codePrepareDDL           terror.ErrCode = 7
	codeResultIsEmpty        terror.ErrCode = 8
	codeErrBuildExec         terror.ErrCode = 9
	codeBatchInsertFail      terror.ErrCode = 10
	CodePasswordNoMatch      terror.ErrCode = 1133 // MySQL error code
	CodeCannotUser           terror.ErrCode = 1396 // MySQL error code
	codeWrongValueCountOnRow terror.ErrCode = 1136 // MySQL error code
)

// Row represents a result set row, it may be returned from a table, a join, or a projection.
type Row struct {
	// Data is the output record data for current Plan.
	Data []types.Datum
	// RowKeys contains all table row keys in the row.
	RowKeys []*RowKeyEntry
}

// RowKeyEntry represents a row key read from a table.
type RowKeyEntry struct {
	// Tbl is the table which this row come from.
	Tbl table.Table
	// Handle is Row key.
	Handle int64
	// TableName is table alias name.
	TableName string
}

type baseExecutor struct {
	children []Executor
	ctx      context.Context
	schema   *expression.Schema
}

// Open implements the Executor Open interface.
func (e *baseExecutor) Open() error {
	for _, child := range e.children {
		err := child.Open()
		if err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}

// Close implements the Executor Close interface.
func (e *baseExecutor) Close() error {
	for _, child := range e.children {
		err := child.Close()
		if err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}

// Schema implements the Executor Schema interface.
func (e *baseExecutor) Schema() *expression.Schema {
	if e.schema == nil {
		return expression.NewSchema()
	}
	return e.schema
}

func newBaseExecutor(schema *expression.Schema, ctx context.Context, children ...Executor) baseExecutor {
	return baseExecutor{
		children: children,
		ctx:      ctx,
		schema:   schema,
	}
}

// Executor executes a query.
type Executor interface {
	Next() (*Row, error)
	Close() error
	Open() error
	Schema() *expression.Schema
}

// ShowDDLExec represents a show DDL executor.
type ShowDDLExec struct {
	baseExecutor

	schema  *expression.Schema
	ddlInfo *inspectkv.DDLInfo
	bgInfo  *inspectkv.DDLInfo
	done    bool
}

// Next implements the Executor Next interface.
func (e *ShowDDLExec) Next() (*Row, error) {
	if e.done {
		return nil, nil
	}
	var ddlOwner, ddlJob string
	if e.ddlInfo.Owner != nil {
		ddlOwner = e.ddlInfo.Owner.String()
	}
	if e.ddlInfo.Job != nil {
		ddlJob = e.ddlInfo.Job.String()
	}

	var bgOwner, bgJob string
	if e.bgInfo.Owner != nil {
		bgOwner = e.bgInfo.Owner.String()
	}
	if e.bgInfo.Job != nil {
		bgJob = e.bgInfo.Job.String()
	}

	row := &Row{}
	row.Data = types.MakeDatums(
		e.ddlInfo.SchemaVer,
		ddlOwner,
		ddlJob,
		e.bgInfo.SchemaVer,
		bgOwner,
		bgJob,
	)
	e.done = true

	return row, nil
}

// CheckTableExec represents a check table executor.
// It is built from the "admin check table" statement, and it checks if the
// index matches the records in the table.
type CheckTableExec struct {
	baseExecutor

	tables []*ast.TableName
	ctx    context.Context
	done   bool
	is     infoschema.InfoSchema
}

// Next implements the Executor Next interface.
func (e *CheckTableExec) Next() (*Row, error) {
	if e.done {
		return nil, nil
	}

	dbName := model.NewCIStr(e.ctx.GetSessionVars().CurrentDB)

	for _, t := range e.tables {
		tb, err := e.is.TableByName(dbName, t.Name)
		if err != nil {
			return nil, errors.Trace(err)
		}
		for _, idx := range tb.Indices() {
			txn := e.ctx.Txn()
			err = inspectkv.CompareIndexData(txn, tb, idx)
			if err != nil {
				return nil, errors.Errorf("%v err:%v", t.Name, err)
			}
		}
	}
	e.done = true

	return nil, nil
}

// Close implements plan.Plan Close interface.
func (e *CheckTableExec) Close() error {
	return nil
}

// SelectLockExec represents a select lock executor.
// It is built from the "SELECT .. FOR UPDATE" or the "SELECT .. LOCK IN SHARE MODE" statement.
// For "SELECT .. FOR UPDATE" statement, it locks every row key from source Executor.
// After the execution, the keys are buffered in transaction, and will be sent to KV
// when doing commit. If there is any key already locked by another transaction,
// the transaction will rollback and retry.
type SelectLockExec struct {
	baseExecutor

	Lock ast.SelectLockType
}

// Next implements the Executor Next interface.
func (e *SelectLockExec) Next() (*Row, error) {
	row, err := e.children[0].Next()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if row == nil {
		return nil, nil
	}
	if len(row.RowKeys) != 0 && e.Lock == ast.SelectLockForUpdate {
		e.ctx.GetSessionVars().TxnCtx.ForUpdate = true
		txn := e.ctx.Txn()
		for _, k := range row.RowKeys {
			lockKey := tablecodec.EncodeRowKeyWithHandle(k.Tbl.Meta().ID, k.Handle)
			err = txn.LockKeys(lockKey)
			if err != nil {
				return nil, errors.Trace(err)
			}
		}
	}
	return row, nil
}

// LimitExec represents limit executor
// It ignores 'Offset' rows from src, then returns 'Count' rows at maximum.
type LimitExec struct {
	baseExecutor

	Offset uint64
	Count  uint64
	Idx    uint64
}

// Next implements the Executor Next interface.
func (e *LimitExec) Next() (*Row, error) {
	for e.Idx < e.Offset {
		srcRow, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if srcRow == nil {
			return nil, nil
		}
		e.Idx++
	}
	if e.Idx >= e.Count+e.Offset {
		return nil, nil
	}
	srcRow, err := e.children[0].Next()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if srcRow == nil {
		return nil, nil
	}
	e.Idx++
	return srcRow, nil
}

// Open implements the Executor Open interface.
func (e *LimitExec) Open() error {
	e.Idx = 0
	return errors.Trace(e.children[0].Open())
}

func init() {
	// While doing optimization in the plan package, we need to execute uncorrelated subquery,
	// but the plan package cannot import the executor package because of the dependency cycle.
	// So we assign a function implemented in the executor package to the plan package to avoid the dependency cycle.
	plan.EvalSubquery = func(p plan.PhysicalPlan, is infoschema.InfoSchema, ctx context.Context) (rows [][]types.Datum, err error) {
		err = ctx.ActivePendingTxn()
		if err != nil {
			return rows, errors.Trace(err)
		}
		e := &executorBuilder{is: is, ctx: ctx}
		exec := e.build(p)
		if e.err != nil {
			return rows, errors.Trace(err)
		}
		err = exec.Open()
		if err != nil {
			return rows, errors.Trace(err)
		}
		for {
			row, err := exec.Next()
			if err != nil {
				return rows, errors.Trace(err)
			}
			if row == nil {
				return rows, errors.Trace(exec.Close())
			}
			rows = append(rows, row.Data)
		}
	}
	tableMySQLErrCodes := map[terror.ErrCode]uint16{
		CodeCannotUser:           mysql.ErrCannotUser,
		CodePasswordNoMatch:      mysql.ErrPasswordNoMatch,
		codeWrongValueCountOnRow: mysql.ErrWrongValueCountOnRow,
	}
	terror.ErrClassToMySQLCodes[terror.ClassExecutor] = tableMySQLErrCodes
}

// ProjectionExec represents a select fields executor.
type ProjectionExec struct {
	baseExecutor

	exprs []expression.Expression
}

// Next implements the Executor Next interface.
func (e *ProjectionExec) Next() (retRow *Row, err error) {
	srcRow, err := e.children[0].Next()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if srcRow == nil {
		return nil, nil
	}
	row := &Row{
		RowKeys: srcRow.RowKeys,
		Data:    make([]types.Datum, 0, len(e.exprs)),
	}
	for _, expr := range e.exprs {
		val, err := expr.Eval(srcRow.Data)
		if err != nil {
			return nil, errors.Trace(err)
		}
		row.Data = append(row.Data, val)
	}
	return row, nil
}

// TableDualExec represents a dual table executor.
type TableDualExec struct {
	baseExecutor

	rowCount  int
	returnCnt int
}

// Open implements the Executor Open interface.
func (e *TableDualExec) Open() error {
	e.returnCnt = 0
	return nil
}

// Next implements the Executor Next interface.
func (e *TableDualExec) Next() (*Row, error) {
	if e.returnCnt >= e.rowCount {
		return nil, nil
	}
	e.returnCnt++
	return &Row{}, nil
}

// SelectionExec represents a filter executor.
type SelectionExec struct {
	baseExecutor

	// scanController will tell whether this selection need to
	// control the condition of below scan executor.
	scanController bool
	controllerInit bool
	Conditions     []expression.Expression
}

// initController will init the conditions of the below scan executor.
// It will first substitute the correlated column to constant, then build range and filter by new conditions.
func (e *SelectionExec) initController() error {
	sc := e.ctx.GetSessionVars().StmtCtx
	client := e.ctx.GetClient()
	newConds := make([]expression.Expression, 0, len(e.Conditions))
	for _, cond := range e.Conditions {
		newCond, err := expression.SubstituteCorCol2Constant(cond.Clone())
		if err != nil {
			return errors.Trace(err)
		}
		newConds = append(newConds, newCond)
	}

	switch x := e.children[0].(type) {
	case *XSelectTableExec:
		accessCondition, restCondtion := ranger.DetachTableScanConditions(newConds, x.tableInfo.GetPkName())
		x.where, _, _ = expression.ExpressionsToPB(sc, restCondtion, client)
		ranges, err := ranger.BuildTableRange(accessCondition, sc)
		if err != nil {
			return errors.Trace(err)
		}
		x.ranges = ranges
	case *XSelectIndexExec:
		accessCondition, newConds, _, accessInAndEqCount := ranger.DetachIndexScanConditions(newConds, x.index)
		idxConds, tblConds := ranger.DetachIndexFilterConditions(newConds, x.index.Columns, x.tableInfo)
		x.indexConditionPBExpr, _, _ = expression.ExpressionsToPB(sc, idxConds, client)
		tableConditionPBExpr, _, _ := expression.ExpressionsToPB(sc, tblConds, client)
		var err error
		x.ranges, err = ranger.BuildIndexRange(sc, x.tableInfo, x.index, accessInAndEqCount, accessCondition)
		if err != nil {
			return errors.Trace(err)
		}
		x.where = tableConditionPBExpr
	default:
		return errors.Errorf("Error type of Executor: %T", x)
	}
	return nil
}

// Next implements the Executor Next interface.
func (e *SelectionExec) Next() (*Row, error) {
	if e.scanController && !e.controllerInit {
		err := e.initController()
		if err != nil {
			return nil, errors.Trace(err)
		}
		e.controllerInit = true
	}
	for {
		srcRow, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if srcRow == nil {
			return nil, nil
		}
		match, err := expression.EvalBool(e.Conditions, srcRow.Data, e.ctx)
		if err != nil {
			return nil, errors.Trace(err)
		}
		if match {
			return srcRow, nil
		}
	}
}

// Open implements the Executor Open interface.
func (e *SelectionExec) Open() error {
	if e.scanController {
		e.controllerInit = false
	}
	return e.children[0].Open()
}

// TableScanExec is a table scan executor without result fields.
type TableScanExec struct {
	baseExecutor

	t          table.Table
	asName     *model.CIStr
	ctx        context.Context
	ranges     []types.IntColumnRange
	seekHandle int64
	iter       kv.Iterator
	cursor     int
	schema     *expression.Schema
	columns    []*model.ColumnInfo

	isInfoSchema     bool
	infoSchemaRows   [][]types.Datum
	infoSchemaCursor int
}

// Schema implements the Executor Schema interface.
func (e *TableScanExec) Schema() *expression.Schema {
	return e.schema
}

// Next implements the Executor interface.
func (e *TableScanExec) Next() (*Row, error) {
	if e.isInfoSchema {
		return e.nextForInfoSchema()
	}
	for {
		if e.cursor >= len(e.ranges) {
			return nil, nil
		}
		ran := e.ranges[e.cursor]
		if e.seekHandle < ran.LowVal {
			e.seekHandle = ran.LowVal
		}
		if e.seekHandle > ran.HighVal {
			e.cursor++
			continue
		}
		handle, found, err := e.t.Seek(e.ctx, e.seekHandle)
		if err != nil {
			return nil, errors.Trace(err)
		}
		if !found {
			return nil, nil
		}
		if handle > ran.HighVal {
			// The handle is out of the current range, but may be in following ranges.
			// We seek to the range that may contains the handle, so we
			// don't need to seek key again.
			inRange := e.seekRange(handle)
			if !inRange {
				// The handle may be less than the current range low value, can not
				// return directly.
				continue
			}
		}
		row, err := e.getRow(handle)
		if err != nil {
			return nil, errors.Trace(err)
		}
		e.seekHandle = handle + 1
		return row, nil
	}
}

func (e *TableScanExec) nextForInfoSchema() (*Row, error) {
	if e.infoSchemaRows == nil {
		columns := make([]*table.Column, e.schema.Len())
		for i, v := range e.columns {
			columns[i] = table.ToColumn(v)
		}
		err := e.t.IterRecords(e.ctx, nil, columns, func(h int64, rec []types.Datum, cols []*table.Column) (bool, error) {
			e.infoSchemaRows = append(e.infoSchemaRows, rec)
			return true, nil
		})
		if err != nil {
			return nil, errors.Trace(err)
		}
	}
	if e.infoSchemaCursor >= len(e.infoSchemaRows) {
		return nil, nil
	}
	row := &Row{Data: e.infoSchemaRows[e.infoSchemaCursor]}
	e.infoSchemaCursor++
	return row, nil
}

// seekRange increments the range cursor to the range
// with high value greater or equal to handle.
func (e *TableScanExec) seekRange(handle int64) (inRange bool) {
	for {
		e.cursor++
		if e.cursor >= len(e.ranges) {
			return false
		}
		ran := e.ranges[e.cursor]
		if handle < ran.LowVal {
			return false
		}
		if handle > ran.HighVal {
			continue
		}
		return true
	}
}

func (e *TableScanExec) getRow(handle int64) (*Row, error) {
	row := &Row{}
	var err error

	columns := make([]*table.Column, e.schema.Len())
	for i, v := range e.columns {
		columns[i] = table.ToColumn(v)
	}
	row.Data, err = e.t.RowWithCols(e.ctx, handle, columns)
	if err != nil {
		return nil, errors.Trace(err)
	}

	// Put rowKey to the tail of record row.
	rke := &RowKeyEntry{
		Tbl:    e.t,
		Handle: handle,
	}
	if e.asName != nil && e.asName.L != "" {
		rke.TableName = e.asName.L
	} else {
		rke.TableName = e.t.Meta().Name.L
	}
	row.RowKeys = append(row.RowKeys, rke)
	return row, nil
}

// Open implements the Executor Open interface.
func (e *TableScanExec) Open() error {
	e.iter = nil
	e.cursor = 0
	return nil
}

// ExistsExec represents exists executor.
type ExistsExec struct {
	baseExecutor

	evaluated bool
}

// Open implements the Executor Open interface.
func (e *ExistsExec) Open() error {
	e.evaluated = false
	return errors.Trace(e.children[0].Open())
}

// Next implements the Executor Next interface.
// We always return one row with one column which has true or false value.
func (e *ExistsExec) Next() (*Row, error) {
	if !e.evaluated {
		e.evaluated = true
		srcRow, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		return &Row{Data: []types.Datum{types.NewDatum(srcRow != nil)}}, nil
	}
	return nil, nil
}

// MaxOneRowExec checks if the number of rows that a query returns is at maximum one.
// It's built from subquery expression.
type MaxOneRowExec struct {
	baseExecutor

	evaluated bool
}

// Open implements the Executor Open interface.
func (e *MaxOneRowExec) Open() error {
	e.evaluated = false
	return errors.Trace(e.children[0].Open())
}

// Next implements the Executor Next interface.
func (e *MaxOneRowExec) Next() (*Row, error) {
	if !e.evaluated {
		e.evaluated = true
		srcRow, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if srcRow == nil {
			return &Row{Data: make([]types.Datum, e.schema.Len())}, nil
		}
		srcRow1, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if srcRow1 != nil {
			return nil, errors.New("subquery returns more than 1 row")
		}
		return srcRow, nil
	}
	return nil, nil
}

// UnionExec represents union executor.
// UnionExec has multiple source Executors, it executes them sequentially, and do conversion to the same type
// as source Executors may has different field type, we need to do conversion.
type UnionExec struct {
	baseExecutor

	finished atomic.Value
	resultCh chan *execResult
	rows     []*Row
	cursor   int
	wg       sync.WaitGroup
	closedCh chan struct{}
}

type execResult struct {
	rows []*Row
	err  error
}

// Schema implements the Executor Schema interface.
func (e *UnionExec) Schema() *expression.Schema {
	return e.schema
}

func (e *UnionExec) waitAllFinished() {
	e.wg.Wait()
	close(e.resultCh)
	close(e.closedCh)
}

func (e *UnionExec) fetchData(idx int) {
	defer e.wg.Done()
	for {
		result := &execResult{
			rows: make([]*Row, 0, batchSize),
			err:  nil,
		}
		for i := 0; i < batchSize; i++ {
			if e.finished.Load().(bool) {
				return
			}
			row, err := e.children[idx].Next()
			if err != nil {
				e.finished.Store(true)
				result.err = err
				e.resultCh <- result
				return
			}
			if row == nil {
				if len(result.rows) > 0 {
					e.resultCh <- result
				}
				return
			}
			// TODO: Add cast function in plan building phase.
			for j := range row.Data {
				col := e.schema.Columns[j]
				val, err := row.Data[j].ConvertTo(e.ctx.GetSessionVars().StmtCtx, col.RetType)
				if err != nil {
					e.finished.Store(true)
					result.err = err
					e.resultCh <- result
					return
				}
				row.Data[j] = val
			}
			result.rows = append(result.rows, row)
		}
		e.resultCh <- result
	}
}

// Open implements the Executor Open interface.
func (e *UnionExec) Open() error {
	e.finished.Store(false)
	e.resultCh = make(chan *execResult, len(e.children))
	e.closedCh = make(chan struct{})
	e.cursor = 0
	var err error
	for i, child := range e.children {
		err = child.Open()
		if err != nil {
			break
		}
		e.wg.Add(1)
		go e.fetchData(i)
	}
	go e.waitAllFinished()
	return errors.Trace(err)
}

// Next implements the Executor Next interface.
func (e *UnionExec) Next() (*Row, error) {
	if e.cursor >= len(e.rows) {
		result, ok := <-e.resultCh
		if !ok {
			return nil, nil
		}
		if result.err != nil {
			return nil, errors.Trace(result.err)
		}
		if len(result.rows) == 0 {
			return nil, nil
		}
		e.rows = result.rows
		e.cursor = 0
	}
	row := e.rows[e.cursor]
	e.cursor++
	return row, nil
}

// Close implements the Executor Close interface.
func (e *UnionExec) Close() error {
	e.finished.Store(true)
	<-e.closedCh
	e.rows = nil
	return errors.Trace(e.baseExecutor.Close())
}

// DummyScanExec returns zero results, when some where condition never match, there won't be any
// rows to return, so DummyScan is used to avoid real scan on KV.
type DummyScanExec struct {
	baseExecutor
}

// Next implements the Executor Next interface.
func (e *DummyScanExec) Next() (*Row, error) {
	return nil, nil
}

// CacheExec represents Cache executor.
// it stores the return values of the executor of its child node.
type CacheExec struct {
	baseExecutor

	storedRows  []*Row
	cursor      int
	srcFinished bool
}

// Open implements the Executor Open interface.
func (e *CacheExec) Open() error {
	e.cursor = 0
	return errors.Trace(e.children[0].Open())
}

// Next implements the Executor Next interface.
func (e *CacheExec) Next() (*Row, error) {
	if e.srcFinished && e.cursor >= len(e.storedRows) {
		return nil, nil
	}
	if !e.srcFinished {
		row, err := e.children[0].Next()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if row == nil {
			e.srcFinished = true
			err := e.children[0].Close()
			if err != nil {
				return nil, errors.Trace(err)
			}
		}
		e.storedRows = append(e.storedRows, row)
	}
	row := e.storedRows[e.cursor]
	e.cursor++
	return row, nil
}


text:
> A simple CLI, KISS, and completely keyboard-driven file manager written in C

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/clifm.png)

CliFM is a completely text-based file manager able to perform all the basic operations you may expect from any other FM. Besides these common operations, such as copy, move, remove, etc, CLiFM most distinctive features are:

* Bookmarks: Let's suppose you constantly need to access `/media/data/misc/iso_images`. With CLiFM bookmarks function, to access this location could be as easy as this: `bm`, to call the bookmarks function, and then `1`, provided `/media/data/misc/iso_images` is your first bookmark.

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/bookmarks.png)

* Files selection: the ability to select (and deselect) files from here and there, even in different instances of the program, and then operate on them as you whish via the Selection Box. Example: `sel 1 4 56 33` will send the files corresponding to these element list numbers to the Selection Box. Then, by typing `sb` you can check the contents of the Selection Box. Let's suppose you want to copy a couple of files from you home directory to some distant path, say `/media/data/misc`. Instead of copying all these files individually, you just select the files and then tell the `paste` command where to paste them:

`sel 1 2 3 6` (or `sel 1-3 6`) and then `paste /media/data/misc`

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/sel_box.png)

 * Open files without the need to specify any program. Via `xdg-open`, if no program was specified, CLiFM will open the file with the deafult program associated to that kind of files. To open a file may be as simple as this: `o 12`, or `o 12 &` if you want it
running in the background.
* The use of list numbers instead of file names. So, instead of:

      $ mv file1 dir1

you can just type:

      $ mv 12 1

* Quick search: type `/string` and CliFM will list of the files containing `string` in its name. This function also support wildcards. Example: `/*.png` will list all the .png files.

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/quick_search.png)

* Just as the `ls` command, CLiFM uses color codes to identify file types. However, and unlike `ls`, CLiFM is also able to distinguish between empty and non-empty files. Once in CliFM, type `colors` to see the entire list of color codes.

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/colors.png)

* It also displays the amount of files contained by listed directories.

![alt_tag](https://github.com/leo-arch/clifm/blob/master/images/dirs.png)

Because half file manager and half terminal emulator, CLiFM also offers the following features:

* Auto-completion
* History function
* The ability to run any command just as if you were using your preferred terminal emulator (which makes it a basic shell)
* Aliases
* Logs
* Prompt and profile commands

Finally, all CLiFM options could be handled directly by command line, by passing parameters to the program, or via plain
text configuration files, located in `~/.config/clifm/`.

Insofar as it is heavily inspired in Arch Linux and its KISS principle, CLiFM is fundamentally aimed to be lightweight, fast, and simple. Weighing approximately 5 MB (!), it is the most lightweight and fastest file manager out there.
On Arch's notion of simplcity see: https://wiki.archlinux.org/index.php/Arch_Linux#Simplicity

## Compiling and Running CliFM:

1. Use `gcc` to compile the program. Don't forget to link the readline and cap libraries:

       $ gcc -O2 -march=native -lcap -lreadline -o clifm clifm.c

2. Run the binary file produced by `gcc`:

       $ ./clifm`

Of course, you can copy this binary to `/usr/bin` or `/usr/local/bin` and then run the program as follows:

       $ clifm

Just try it and run the `help` command to learn more about CliFM. Once in the CliFM prompt, which looks like any terminal prompt, type `help` or `?`:

      [user@hostname:S] ~/ $ help

I you find some bug, and you will, try to fix it. It basically works, howerver; I myself use it as my main, and indeed only, file manager; it couldn't be so bad, isn't it?


text:
package org.apache.activemq.artemis.tests.integration.mqtt5.spec;

import java.util.EnumSet;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport;
import org.eclipse.paho.mqttv5.client.MqttClient;
import org.eclipse.paho.mqttv5.common.MqttMessage;
import org.junit.Test;

/**
 * Fulfilled by client or Netty codec (i.e. not tested here):
 *
 * [MQTT-4.7.0-1] The wildcard characters can be used in Topic Filters, but MUST NOT be used within a Topic Name.
 * [MQTT-4.7.1-1] The multi-level wildcard character MUST be specified either on its own or following a topic level separator. In either case it MUST be the last character specified in the Topic Filter.
 * [MQTT-4.7.1-2] The single-level wildcard can be used at any level in the Topic Filter, including first and last levels. Where it is used, it MUST occupy an entire level of the filter.
 * [MQTT-4.7.3-1] All Topic Names and Topic Filters MUST be at least one character long.
 * [MQTT-4.7.3-2] Topic Names and Topic Filters MUST NOT include the null character (Unicode U+0000).
 * [MQTT-4.7.3-3] Topic Names and Topic Filters are UTF-8 Encoded Strings; they MUST NOT encode to more than 65,535 bytes.
 *
 *
 * I'm not sure how to test this since it's a negative:
 *
 * [MQTT-4.7.3-4] When it performs subscription matching the Server MUST NOT perform any normalization of Topic Names or Topic Filters, or any modification or substitution of unrecognized characters.
 */

public class TopicNameAndFilterTests extends MQTT5TestSupport {

   public TopicNameAndFilterTests(String protocol) {
      super(protocol);
   }

   /*
    * [MQTT-4.7.2-1] The Server MUST NOT match Topic Filters starting with a wildcard character (# or +) with Topic
    * Names beginning with a $ character.
    */
   @Test(timeout = DEFAULT_TIMEOUT)
   public void testMatchingHash() throws Exception {
      testMatchingWildcard("#");
   }

   /*
    * [MQTT-4.7.2-1] The Server MUST NOT match Topic Filters starting with a wildcard character (# or +) with Topic
    * Names beginning with a $ character.
    */
   @Test(timeout = DEFAULT_TIMEOUT)
   public void testMatchingPlus() throws Exception {
      testMatchingWildcard("+");
   }

   private void testMatchingWildcard(String wildcard) throws Exception {
      final CountDownLatch latch = new CountDownLatch(1);

      MqttClient consumer = createPahoClient("consumer");
      consumer.connect();
      consumer.setCallback(new DefaultMqttCallback() {
         @Override
         public void messageArrived(String incomingTopic, MqttMessage message) throws Exception {
            latch.countDown();
         }
      });
      consumer.subscribe(wildcard, 0);

      final SimpleString DOLLAR_TOPIC = SimpleString.toSimpleString("$foo");
      ServerLocator locator = ActiveMQClient.createServerLocator("vm://0");
      ClientSessionFactory csf = locator.createSessionFactory();
      ClientSession s = csf.createSession();
      s.createAddress(DOLLAR_TOPIC, EnumSet.allOf(RoutingType.class), false);
      s.createProducer(DOLLAR_TOPIC).send(s.createMessage(true));

      assertFalse(latch.await(2, TimeUnit.SECONDS));
   }
}


text:
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerAncient < Test::Unit::TestCase
  def setup
    @tester = Faker::Ancient
  end

  def test_god
    assert @tester.god.match(/\w+/)
  end

  def test_primordial
    assert @tester.primordial.match(/\w+/)
  end

  def test_titan
    assert @tester.titan.match(/\w+/)
  end

  def test_hero
    assert @tester.hero.match(/\w+/)
  end

end


text:
title: Big Omega Notation
localeTitle: Большая Омега Нотация
---
## Большая Омега Нотация

Это заглушка. [Помогите нашему сообществу расширить его](https://github.com/freecodecamp/guides/tree/master/src/pages/computer-science/notation/big-omega-notation/index.md) .

[Это руководство по быстрому стилю поможет вам принять ваш запрос на тягу](https://github.com/freecodecamp/guides/blob/master/README.md) .

Подобно [большой](https://guide.freecodecamp.org/computer-science/notation/big-o-notation) нотации [O](https://guide.freecodecamp.org/computer-science/notation/big-o-notation) , большая функция Omega (Ω) используется в информатике для описания производительности или сложности алгоритма.

Если время работы Ω (f (n)), то при достаточно большом n время работы не меньше k⋅f (n) для некоторой константы k. Вот как думать о времени работы, которое равно Ω (f (n)):
![функция большой омеги](https://s3.amazonaws.com/ka-cs-algorithms/Omega_fn.png)
Мы говорим, что время работы «большое-Ω функции f (n)». Мы используем обозначение большой Ω для **асимптотических нижних границ** , так как оно ограничивает рост времени работы снизу при достаточно больших входных размерах.

### Разница между Big O и Big Ω

Различие между нотами Big O и Big Ω означает, что Big O используется для описания наихудшего времени работы алгоритма. Но, с другой стороны, обозначение Big Ω используется для описания наилучшего времени работы для данного алгоритма.

#### Дополнительная информация:

*   [Обозначение Big-Ω (Big-Omega)](https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/big-big-omega-notation)
*   [!["MYCODSCHOOL](http://img.youtube.com/vi/OpebHLAf99Y/0.jpg)](http://www.youtube.com/watch?feature=player_embedded&v=OpebHLAf99Y
    )
[](http://www.youtube.com/watch?feature=player_embedded&v=OpebHLAf99Y
)