text:
Gerrit-sh
=========

Gerrit in your command lines.

**This project has been abandoned in favour of the NodeJS version found at
http://github.com/shanesmith/gerrit-cli**

Installation
------------

1. Clone this repository

    ```
    git clone http://github.com/shanesmith/gerrit-sh.git
    ```

2. Run install.sh

    ```
    cd /path/to/cloned/gerrit-sh
    ./install.sh
    ```

3. Have a beer

_NOTE: The installer links to the gerrit-sh tool in the cloned repository, so don't delete it. If you'd rather the installer copy just run `./install.sh --copy`._

_NOTE for Windows: The installer always copies since it does not support linking._

Updating
--------

1. Pull the latest

    ```
    git pull
    ```

2. ???

3. Have another beer

_NOTE: If you decided to originally run the installer with the copy option or if you're on Windows you should re-run `./install.sh --copy` before having another beer._

Example Usage
-------------

First things first, gerrit-sh is a tool with subcommands, much like git. We can
view the available commands by invoking gerrit-sh without any arguments.

`$ gerrit`

    Usage:

      gerrit <command>

    Commands:

      config [<gerrit_name>|--all]
        Show the configured options for <gerrit_name>. If a configuration does not
        exist you will have the option to create one.

    ...

To get things started we need to let gerrit-sh know of the remote server we'll
be dealing with, so we'll use the command above we just learned.

`$ gerrit config labyrinth`

    I couldn't find a config for "labyrinth", would you like to create one? [Y/n]  y
    Setting up gerrit remote config for "labyrinth"
    Remote Gerrit Host: gerrit.labyrinth.com
    Remote Gerrit Username:  ssmith
    Remote Gerrit Port: 29418

    Success!

    ---------------
    Conf: labyrinth
    ---------------
    Host: gerrit.labyrinth.com
    User: ssmith
    Port: 29418

Now we can find out what gerrit projects are available for us to clone.

`$ gerrit projects labyrinth`

    icarus
    daedalus
    minos

Good, let's clone one of them. This will also install the often forgotten
commit-msg git hook fot the project.

`$ gerrit clone labyrinth icarus`

    Cloning project icarus from labyrinth into folder icarus...
    Cloning into 'icarus'...
    [...]
    Setting up commit-msg hook...
    Done!

Now we can start working. We create a topic branch and commit some code to it
like we would normally.

    $ git checkout -b feathers

    [hack, hack, hack...]

    (feathers) $ git commit -m "Gathered feathers"

Let's push that to gerrit.

`(feathers) $ gerrit push`

    Pushing to origin (refs/for/master/feathers)
    [...]
    To ssh://ssmith@gerrit.labyrinth.com:29418/icarus.git
    * [new branch]      HEAD -> refs/for/master/feathers

We'll also want to assign some reviewers to that patch.

`(feathers) $ gerrit assign ccanfield bbayles`

Done with our patch, now let's review someone else's. We'll start by taking a
look at what's out there assigned to us.

`(feathers) $ gerrit status`

    9736 [master] "wax" (Curt Canfield)
    9526 [master] "labyrinth" (Howard Higbee)
    9832 [master] "tower" (Bobby Bayles)

Let's grab the patch for "wax". We can specify either the
patch id or the topic name.

`(feathers) $ gerrit checkout 9736`

    Getting latest patchset...
    Refspec is refs/changes/36/9736/1
    From ssh://ssmith@gerrit.labyrinth.com:29418/icarus.git
    * branch            refs/changes/36/9736/1 -> FETCH_HEAD
    Switched to a new branch 'wax'

Now we review and we find that while it works alright we think the code could
be cleaned up some, so we submit out review.

`(wax) $ gerrit review`

    Verified: (-1 .. +1) 1
    Code Review: (-2 .. +2) -1
    Message: Not sure if wax is the right way to go

And there you have it. We've cloned a repository, submitted a patch and
reviewed someone else's all without leaving the comfort of our own shell.
Truth be told, in practice the web interface is still very useful, especially
for inline code review comments and for extra information, but I hope this tool
will save you a few window swaps.

Also note that the first few commands of config and clone are optional, most other
commands should work while inside a gerrit repo.

Commands
--------

```
Usage:

  gerrit <command>

Commands:

  config [<gerrit_name>|--all]
    Show the server configurations for <gerrit_name>, or all configurations, or
    if none specified the configuration of the current project. If a
    configuration does not exist for the specified name you will have the
    option to create one.

  projects <gerrit_name>
    Display the list of projects for which you have access on the <gerrit_name>
    remote.

  clone <gerrit_name> [<project_name> [<destination_folder>]]
    Clone <project_name> from <gerrit_name> into <destination_folder>. This
    will also download and install the often forgotten commit-msg hook for the
    project.

The current working directory must be in a git repository for the following
commands.

  status
    List the open patches for which you are assigned.
    ALIAS: st

  push [<base_branch>]
    Push the current topic branch to the remote based one <base_branch>. If the
    <base_branch> is not provided it is defaulted to master. Essentially the
    same as `git push origin HEAD:refs/for/<base_branch>/<current_branch>`.

  draft [<base_branch]
    Same as push, but as a draft
    (ie: refs/drafts/<base_branch>/<current_branch>)

  assign <reviewer> [<reviewer> ...]
    Assign reviewers by username to the current topic.

  checkout <change_id>|<topic> [<patchset_number>]
    Fetch the patch from remote and create a branch for it of the topic name.
    If the patchset number is not provided it will automatically fetch the
    latest.
    ALIAS: co

  recheckout
    Re-checkout the current topic at the latest patchset, useful when a new
    patchset has been uploaded.
    ALIAS: reco

  review [<verified_score> <code_review_score> [<message>]]
    Give a review of the current checked out patch.

  submit [<message>]
    Submit the patch for merging with verified = 1 and code-review = 2.

  abandon [<message>]
    Abandon the patch.

  pubmit
    Same as `gerrit push && gerrit submit "auto-submit"`
    ALIAS: ninja

  ssh [<gerrit_name>] <command>
    Run a custom gerrit server command, see
    https://review.openstack.org/Documentation/cmd-index.html#_server
```

Compatibility
-------------

Gerrit-sh has been tested with Bash on Ubuntu, Mac OS X and Windows (msysGit).

License
-------

This software is licensed under the MIT License as seen below.

Copyright (c) 2013 Shane Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


text:
package com.mao.imageloader.utils;

import java.util.Map;

import android.util.Log;

public class Debugger {

	public static final String TAG = "Debugger";

	public static void printStackTrace() {
		Map<Thread, StackTraceElement[]> elementsMap = Thread.getAllStackTraces();
		StackTraceElement[] elements = elementsMap.get(Thread.currentThread());
		for(StackTraceElement element : elements) {
			L.d(TAG, "" + element);
		}

	}
}

redpajama_set_name: RedPajamaGithub


text:
namespace CodeConverter.Common
{
    public interface ISyntaxTreeVisitor
    {
        Node Visit(string code);
        Language Language { get; }
    }
}


text:
using System.Collections.Specialized;
using System.Threading.Tasks;
using AGO.Core.Model.Security;

namespace AGO.Core.Controllers.Security.OAuth
{
	/// <summary>
	/// Abstraction for OAuth providers, used for authentication in apinet system.
	/// Some or all of provider methods require http-interaction with provider server,
	/// so, all method follow a async/await scheme
	/// </summary>
	/// <remarks>First implementation will be contains providers for Facebook and Twitter</remarks>
	public interface IOAuthProvider
	{
		/// <summary>
		/// Provider type
		/// </summary>
		OAuthProvider Type { get; }

		/// <summary>
		/// Create data for storing needed info between requests (factory method)
		/// </summary>
		/// <returns>Empty instance of OAuthDataModel</returns>
		OAuthDataModel CreateData();

		/// <summary>
		/// Prepares for login. Do provider-specific preparation steps and return url for client redirecting
		/// to provider login form
		/// </summary>
		/// <returns>Url to provider login form</returns>
		Task<string> PrepareForLogin(OAuthDataModel data);

		/// <summary>
		/// Query provider and return provider user identifier
		/// </summary>
		/// <returns>Provider-specific user identifier</returns>
		Task<UserModel> QueryUserId(OAuthDataModel data, NameValueCollection parameters);

		/// <summary>
		/// Determine, if user cancel login process on provider side
		/// </summary>
		/// <returns>true, if user cancel login flow</returns>
		bool IsCancel(NameValueCollection parameters);
	}
}


text:
TODO: Write a description here

## Installation

TODO: Write installation instructions here

## Usage

TODO: Write usage instructions here

## Development

TODO: Write development instructions here

## Contributing

1. Fork it ( https://github.com/[your-github-name]/crystal-Intern-Exercise/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

## Contributors

- [[your-github-name]](https://github.com/[your-github-name]) upamune - creator, maintainer


text:
import sys, os
import zipfile
from optparse import OptionParser

# ==== CONFIGURATION ====
# Full path to python 2.2 binary, for Python files compilation.
python22 = 'C:\\Python22\\python.exe'
# =======================

__version__ = '1.00.0'

class Manifest(object):
    def __init__(self, filename=None):
        self.fields = {}
        if filename is not None:
            self.load(filename)

    def parse(self, data):
        lines = data.decode('utf8').splitlines()
        lines.reverse()
        self.fields = {}
        while True:
            try:
                ln = lines.pop()
            except IndexError:
                break
            try:
                p = ln.index(u':')
            except ValueError:
                raise ValueError('mangled manifest file')
            name = ln[:p].strip().title()
            value = []
            vln = ln[p+1:].strip()
            while vln.endswith(u'\\'):
                value.append(vln[:-1].strip())
                try:
                    ln = lines.pop()
                except IndexError:
                    break
                vln = ln.strip()
            else:
                value.append(vln)
            if name in self.fields:
                raise ValueError('manifest field defined twice')
            self.fields[name] = u'\r\n'.join(value)

    def dump(self):
        lines = []
        for name, value in self.fields.items():
            lines.append(u'%s: %s\r\n' % (name.title(), '\\\r\n'.join(value.split('\n'))))
        return (''.join(lines)).encode('utf8')

    def load(self, filename):
        f = open(filename, 'r')
        try:
            self.parse(f.read())
        finally:
            f.close()

    def save(self, filename):
        f = open(filename, 'w')
        try:
            f.write(self.dump())
        finally:
            f.close()

    def get(self, name, default=None):
        return self.fields.get(name.title(), default)

    def keys(self):
        return self.fields.keys()

    def items(self):
        return self.fields.items()

    def values(self):
        return self.fields.values()

    def clear(self):
        self.fields = {}

    def __getitem__(self, name):
        return self.fields[name.title()]

    def __setitem__(self, name, value):
        self.fields[name.title()] = value

    def __delitem__(self, name):
        del self.fields[name.title()]

    def __len__(self):
        return len(self.fields)

    def __contains__(self, name):
        return name.title() in self.fields

def is_best_py(path):
    # check if the given Python file path is the best one available
    base = os.path.splitext(path)[0]
    mtime = 0.0
    best = path
    for ext in ('.py', '.pyc', '.pyo'):
        p = base+ext
        if not os.path.exists(p):
            continue
        if os.path.getmtime(p) > mtime:
            mtime = os.path.getmtime(p)
            best = p
    return path.lower() == best.lower()

def archive(z, path, arcpath=None):
    if arcpath is None:
        arcpath = ''
    for name in os.listdir(path):
        if name == '.svn':
            # skip SVN directories
            continue
        fullname = os.path.join(path, name)
        arcfullname = os.path.join(arcpath, name)
        if os.path.isdir(fullname):
            archive(z, fullname, arcfullname)
        elif os.path.isfile(fullname):
            if os.path.splitext(name)[-1].lower().startswith('.py'): # *.py, *.pyc, *.pyo
                # choose best Python file
                if not is_best_py(fullname):
                    continue
                if arcfullname.lower().endswith('.pyo'):
                    arcfullname = arcfullname[:-1]+'c'
            z.write(fullname, arcfullname)

def main():
    parser = OptionParser(usage='%prog [options] plugin_dir ...',
        version='%%prog %s' % __version__)
    options, args = parser.parse_args()

    if not args:
        parser.error('specify plugin directory')

    for path in args:
        print 'Scanning "%s" directory...' % path

        try:
            manifest = Manifest(os.path.join(path, 'manifest.txt'))
        except IOError, err:
            sys.exit('could not load manifest: %s' % err)

        for field in ('Package', 'Name', 'Version', 'Ped-Version-Min', 'Ped-Version-Max'):
            if field not in manifest:
                sys.exit('manifest mandatory field missing: %s' % field)

        print 'Found "%s" plugin, version %s.' % (manifest['Name'], manifest['Version'])

        if python22:
            # compile all Python files in the plugin directory
            os.system('%s -O %s "%s"' % (python22,
                os.path.join(os.path.split(python22)[0], 'lib\\compileall.py'),
                path))

        name = 'ped_%s_%s.zip' % (manifest['Package'], manifest['Version'])

        try:
            z = zipfile.ZipFile(name, 'w', zipfile.ZIP_DEFLATED)
            archive(z, path)
            z.close()
        except Exception, err:
            sys.exit('could not archive: %s' % err)

        print 'Saved as "%s".' % name

if __name__ == '__main__':
    main()


text:
Scope, the current context of execution (MDN), is the context in which values and expressions can be referenced (MDN)

// Example: a function accessing the variable that is not
// within it's scope will throw an error.

  function foo() {
    var a = 2;
    function bar() {
      var b = 3;
      console.log(b);
      console.log(a);
    }
    bar();
  }
  foo(); // ReferenceError: b is not defined.

  function foo(a) {
    var b = a;
    function bar(){
      console.log(b);
  }
  bar()
}
foo(3) // 3

## what creates scope?
1. funcitons
2.  catch in try/catch
3. es6 (2015) block scope with the let keyword

Scope lookup bubbles up and stops with the first match found

Example:

    var a = 1;

    function addTwo() {
      var a = 2;
      var b = 0;
      console.log(a + b);
    }

  addTwo(); // 2

    var a = 1;

    function addTwo() {
      var b = 0;
      console.log(a + b);
    }
  addTwo(); // 1

block scope with let

const data = ["Thomas", "Haskell", "Curry"];

for(var i = 0 ; i < data.length; i++) {
    // do magic
    // ...
}
console.log(i); // 3

In the above example, i is available outside of the for loop.

In es5, or with the var keyword, the for loop does not create a new scope for variable i to be bounce.

for(let i = 0 ; i < data.length; i++) {
    // do magic
    // ...
}

console.log(i); // reference error

Lex Time

JS is compiled. This compilation happens just before run time.
Part of compiliation is lexing.

Lexing - or tokenizing -

Lexing:
** essentially

Lexical Scope:
** essentially scope that is defined during compilation.

Example

function fn1() {
  function fn2() {
    function fn3() {
    }
  }
}

Hoisting

Variable hosting


text:
package devices

// from /usr/include/linux/kdev_t.h

func getmajor(dev uint64) uint64 {
	return dev >> 8
}

func getminor(dev uint64) uint64 {
	return dev & 0xff
}

func makedev(major int, minor int) int {
	return ((major << 8) | minor)
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/pubsub/v1/pubsub.proto

package com.google.pubsub.v1;

public interface PullResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PullResponse)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Received Pub/Sub messages. The list will be empty if there are no more
   * messages available in the backlog. For JSON, the response can be entirely
   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
   * even if there are more messages available in the backlog.
   *

   *
   * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
   */
  java.util.List<com.google.pubsub.v1.ReceivedMessage> getReceivedMessagesList();
  /**
   *
   *
   *

   * Received Pub/Sub messages. The list will be empty if there are no more
   * messages available in the backlog. For JSON, the response can be entirely
   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
   * even if there are more messages available in the backlog.
   *

   *
   * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
   */
  com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index);
  /**
   *
   *
   *

   * Received Pub/Sub messages. The list will be empty if there are no more
   * messages available in the backlog. For JSON, the response can be entirely
   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
   * even if there are more messages available in the backlog.
   *

   *
   * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
   */
  int getReceivedMessagesCount();
  /**
   *
   *
   *

   * Received Pub/Sub messages. The list will be empty if there are no more
   * messages available in the backlog. For JSON, the response can be entirely
   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
   * even if there are more messages available in the backlog.
   *

   *
   * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
   */
  java.util.List<? extends com.google.pubsub.v1.ReceivedMessageOrBuilder>
      getReceivedMessagesOrBuilderList();
  /**
   *
   *
   *

   * Received Pub/Sub messages. The list will be empty if there are no more
   * messages available in the backlog. For JSON, the response can be entirely
   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
   * even if there are more messages available in the backlog.
   *

   *
   * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
   */
  com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index);
}


text:
package com.sparta.is.tileentity;

import com.sparta.is.core.tileentity.CustomEnergyStorage;
import com.sparta.is.core.tileentity.TileEntityInventoryBase;
import com.sparta.is.core.utils.ItemStackUtils;
import com.sparta.is.core.utils.interfaces.IDisplayStandItem;
import com.sparta.is.core.utils.interfaces.IEnergyDisplay;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.IEnergyStorage;

public class TileEntityItemDisplay extends TileEntityInventoryBase implements IEnergyDisplay
{
    public final CustomEnergyStorage storage = new CustomEnergyStorage(80000, 1000, 0);
    private int oldEnergy;

    public TileEntityItemDisplay()
    {
        super(1, "itemDisplay");
    }

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

        if(!this.world.isRemote)
        {
            if( ItemStackUtils.isValid(this.slots.getStackInSlot(0)) && !this.isRedstonePowered)
            {
                IDisplayStandItem item = this.convertToDisplayStandItem(this.slots.getStackInSlot(0).getItem());
                if(item != null)
                {
                    int energy = item.getUsePerTick(this.slots.getStackInSlot(0), this, this.ticksElapsed);
                    if(this.storage.getEnergyStored() >= energy)
                    {
                        if(item.update(this.slots.getStackInSlot(0), this, this.ticksElapsed))
                        {
                            this.storage.extractEnergyInternal(energy, false);
                        }
                    }
                }
            }

            if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval())
            {
                this.oldEnergy = this.storage.getEnergyStored();
            }
        }
    }

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

    @Override
    public boolean isItemValidForSlot(int index, ItemStack stack){
        return true;
    }

    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound compound)
    {
        compound = super.writeToNBT(compound);

        NBTTagList tagList = new NBTTagList();

        for(ItemStack itemStack : this.slots.getItems())
        {
            NBTTagCompound tagCompound = new NBTTagCompound();

            if(!itemStack.isEmpty())
            {
                itemStack.writeToNBT(tagCompound);
            }

            tagList.appendTag(tagCompound);
        }

        compound.setTag("DisplayItem", tagList);

        return compound;
    }

    @Override
    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);

        if(compound.hasKey("DisplayItem", 9))
        {
            NBTTagList tagList = compound.getTagList("DisplayItem", 10);
            this.slots.insertItem(0, new ItemStack(tagList.getCompoundTagAt(0)), false);
        }
    }

    @Override
    public void writeSyncableNBT(NBTTagCompound compound, NBTType type)
    {
        super.writeSyncableNBT(compound, type);
        this.storage.writeToNBT(compound);
    }

    @Override
    public void readSyncableNBT(NBTTagCompound compound, NBTType type)
    {
        super.readSyncableNBT(compound, type);
        this.storage.readFromNBT(compound);
    }

    private IDisplayStandItem convertToDisplayStandItem(Item item)
    {
        if(item instanceof IDisplayStandItem)
        {
            return (IDisplayStandItem)item;
        }
        else if(item instanceof ItemBlock )
        {
            Block block = Block.getBlockFromItem(item);
            if(block instanceof IDisplayStandItem)
            {
                return (IDisplayStandItem)block;
            }
        }
        return null;
    }

    @Override
    public boolean canExtractItem(int index, ItemStack stack){
        return true;
    }

    @Override
    public CustomEnergyStorage getEnergyStorage(){
        return this.storage;
    }

    @Override
    public boolean needsHoldShift(){
        return false;
    }

    @Override
    public int getMaxStackSizePerSlot(int slot){
        return 1;
    }

    @Override
    public IEnergyStorage getEnergyStorage(EnumFacing facing){
        return this.storage;
    }

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


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>LABTRANSP - Laboratório de Transparência Pública</title>

    <link href="http://www.transparencia.pub/css/bootstrap.min.css" rel="stylesheet">

    <link href="http://www.transparencia.pub/css/freelancer.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

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

                </button>
                labTransp.pub

Resumo

Tema: Relação Governo-Sociedade: Transparência, Accountability e Participação

Análise do Nível de Transparência dos Gastos Com Pessoal dos Tribunais Atuantes Na Paraíba

A transparência dos atos da administração pública ganhou status de grande relevância face ao seu impacto social que traz em sua essência, ao passo que vem ganhando maior visibilidade no Brasil desde o surgimento de dispositivos normativos voltados para a transparência da gestão pública. Com a advento desses novos dispositivos, o gestor público deve prestar contas na forma da lei, dando transparência aos atos de gestão, informando e oferecendo à população condições de participação e fiscalização.

O gestor público deve prestar contas na forma da lei, dando transparência aos atos de gestão, informando e oferecendo à população condições de participação e fiscalização. Desta forma, esta pesquisa objetiva analisar o nível de evidenciação das informações relacionadas ao pagamento de servidores, dos quatro tribunais atuantes no estado da Paraíba, disponibilizadas nos portais eletrônicos destes.

A preocupação com a geração de informações sobre o real custo das atividades exercidas pelo governo ganhou força no bojo das demandas por melhoria da performance e da eficiência do setor público, e da concomitante pressão por mudanças na contabilidade pública, para que decisões sobre o uso dos recursos orçamentários tenham por foco os resultados a ser obtidos com os recursos extraídos da população por meio dos impostos (REZENDE, CUNHA, BEVILACQUA, 2010).

Através de uma pesquisa documental, este trabalho analisou as informações disponibilizadas pelo Tribunal de Contas do Estado da Paraíba, Tribunal de Justiça do Estado Paraíba, Tribunal Regional Eleitoral na Paraíba e Tribunal Regional do Trabalho da 13a Região. Para tanto foi adaptado o modelo adotado pelo ÍNDICE DE TRANSPARENCIA DE LOS AYUNTAMIENTOS ( ITA, 2012). Foram analisadas as despesa com salários dos referidos tribunais, sendo estas classificadas como: nula, baixa, média ou alta.

Constatou-se que os quatro tribunais da amostra em um único grupo, os de portais com Alto Nível de Transparência. O portal do TCE/PB foi o que apresentou menor número de informações em seu portal. Já o TRT/PB foi considerado o mais completo, alcançando o nível de transparência mais elevado, pois o mesmo apresenta as informações necessárias relevantes com clareza, facilitando assim a compreensão por parte da sociedade e auxiliando no controle social.

        Baixar Artigo completo

                    Copyright © labtransp.pub


text:
/*
 * This file is part of the genetic-sudoku-solver.
 *
 * (c) Marcel Moosbrugger
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

package sudoku;

import java.util.Iterator;
import java.util.Set;

/**
 * Represents a value grid
 */
public interface Grid {

    /**
     * Writes a number into the grid
     * @param x the x value to write in
     * @param y the y value to write in
     * @param number the number to write into the (x,y)-position
     */
    void write(int x, int y, int number);

    /**
     * Writes a number into the grid
     * @param index the index starting from left to right and top-down
     * @param number the number to write
     */
    void write(int index, int number);

    /**
     * @param index the index to read from
     * @return returns the number in the grid for a given index
     */
    int read(int index);

    /**
     * @return The number of conflicts within the whole grid (row, column and blocks get added together)
     */
    int getConflicts();

    /**
     * @return a set with the indexes of the empty fields. The indexes go from left to right and top-down
     */
    Set<Integer> getEmptyFields();

    /**
     * @return the size of a block in a grid
     */
    int getBlockSize();

    /**
     * @return the length of one side of the grid
     */
    int getSideLength();

    /**
     * @return the minimum valid value
     */
    int getValidMin();

    /**
     * @return the maximum valid value
     */
    int getValidMax();

    /**
     * @param row the index of the row
     * @param position the position in the row
     * @return the grid index by a given row and the position in that row
     */
    int getIndexByRow(int row, int position);

    /**
     * @param column the index of the column
     * @param position the position in the column
     * @return the grid index by a given column and the position in that column
     */
    int getIndexByColumn(int column, int position);

    /**
     * @param block the index of the block
     * @param position the position in the block
     * @return the grid index by a given block and the position in that block
     */
    int getIndexByBlock(int block, int position);

    /**
     * @param index the index which is contained in the returned row
     * @return the number of the row which contains a given index
     */
    int getRowByIndex(int index);

    /**
     * @param index the index which is contained in the returned column
     * @return the number of the column which contains a given index
     */
    int getColumnByIndex(int index);

    /**
     * @param index the index which is contained in the returned block
     * @return the number of the block which contains a given index
     */
    int getBlockByIndex(int index);

    /**
     * @param index the index to return the row for
     * @return an array of grid indices which are all in the same row as a given index
     */
    int[] getRowForIndex(int index);

    /**
     * @param index the index to return the column for
     * @return an array of grid indices which are all in the same column as a given index
     */
    int[] getColumnForIndex(int index);

    /**
     * @param index the index to return the block for
     * @return an array of grid indices which are all in the same block as a given index
     */
    int[] getBlockForIndex(int index);
}


text:
var myModule = require('..');
var myPackage = require('../package.json');

var debug = require('debug')(myPackage.name);

var program = require('commander');

program
	.version('0.0.1')
	.option('-s, --source [endpoint]', 'Source Endpoint', 'tcp://127.0.0.1:55000')
	.option('-ss, --sourceservice [service]', 'Source Service', '/foo')
	.option('-d, --destination [endpoint]', 'Destination Endpoint',
		'tcp://127.0.0.1:55000')
	.option('-ds, --destinationservice [service]',
		'Destination Service [sourceservice]')
	.parse(process.argv)

var conf = {
	heartbeat: 30,
	proxy: {
		remote: program.destination,
		service: { in : program.sourceservice,
				out: program.destinationservice || program.sourceservice
		}
	}
};

myModule(program.source, conf, function(err) {
	debug('did start, err is %s', err);
});


text:
<?php

namespace Eyewitness\Eye\Notifications\Messages\Queue;

use Eyewitness\Eye\Notifications\Messages\BaseMessage;

class Online extends BaseMessage
{
    /**
     * Is this message an error notification.
     *
     * @return bool
     */
    public function isError()
    {
        return false;
    }

    /**
     * The title of the notification.
     *
     * @return string
     */
    public function title()
    {
        return 'Your '.e($this->meta['queue']->connection).' ('.e($this->meta['queue']->tube).') is online again';
    }

    /**
     * A plain description of the message.
     *
     * @return string
     */
    public function plainDescription()
    {
        return 'Your queue is processing jobs again.';
    }

    /**
     * Any meta information for the message.
     *
     * @return array
     */
    public function meta()
    {
        return [
            'Connection' => e($this->meta['queue']->connection),
            'Queue' => e($this->meta['queue']->tube),
            'Driver' => e($this->meta['queue']->driver),
            'Your threshold' => e($this->meta['queue']->alert_heartbeat_greater_than).'s',
            'Last heartbeat' => e($this->meta['queue']->last_heartbeat),
        ];
    }

    /**
     * The notification typee.
     *
     * @return string
     */
    public function type()
    {
        return 'Queue';
    }

    /**
     * The seveirty level for this message.
     *
     * @return string
     */
    public function severity()
    {
        return $this->getSeverity('high');
    }
}


text:
{-# LANGUAGE TemplateHaskell, CPP #-}

import Data.KdMap.Static as KDM

import Control.Monad
import Data.List
import Data.Ord
import Data.Point2d
import System.Exit
import Test.QuickCheck

#if MIN_VERSION_QuickCheck(2,7,0)
#else
import Test.QuickCheck.All
#endif

testElements :: [p] -> [(p, Int)]
testElements ps = zip ps [0 ..]

prop_validTree :: Property
prop_validTree =
  forAll (listOf1 arbitrary) $ isValid . build pointAsList2d . testElements

checkElements :: (Ord p, Real a) => PointAsListFn a p -> [p] -> Bool
checkElements pointAsList ps =
  let kdt = build pointAsList $ testElements ps
  in  sort (assocs kdt) == sort (testElements ps)

prop_sameElements :: Property
prop_sameElements = forAll (listOf1 arbitrary) $ checkElements pointAsList2d

checkNumElements :: Real a => PointAsListFn a p -> [p] -> Bool
checkNumElements pointAsList ps =
  let kdm = build pointAsList $ testElements ps
  in  size kdm == length ps

prop_validNumElements :: Property
prop_validNumElements = forAll (listOf1 arbitrary) $ checkNumElements pointAsList2d

nearestLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> (p, v)
nearestLinear pointAsList xs query =
  minimumBy (comparing (KDM.defaultSqrDist pointAsList query . fst)) xs

checkNearestEqualToLinear :: (Eq p, Real a) => KDM.PointAsListFn a p -> ([p], p) -> Bool
checkNearestEqualToLinear pointAsList (ps, query) =
  let kdt = build pointAsList $ testElements ps
  in  nearest kdt query == nearestLinear pointAsList (testElements ps) query

prop_nearestEqualToLinear :: Point2d -> Property
prop_nearestEqualToLinear query =
  forAll (listOf1 arbitrary) $ \xs ->
    checkNearestEqualToLinear pointAsList2d (xs, query)

inRadiusLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> a -> [(p, v)]
inRadiusLinear pointAsList xs query radius =
  filter ((<= radius * radius) . defaultSqrDist pointAsList query . fst) xs

checkInRadiusEqualToLinear :: (Ord p, Real a) => KDM.PointAsListFn a p -> a -> ([p], p) -> Bool
checkInRadiusEqualToLinear pointAsList radius (ps, query) =
  let kdt = build pointAsList $ testElements ps
      kdtNear = inRadius kdt radius query
      linearNear = inRadiusLinear pointAsList (testElements ps) query radius
  in  sort kdtNear == sort linearNear

prop_inRadiusEqualToLinear :: Point2d -> Property
prop_inRadiusEqualToLinear query =
  forAll (listOf1 arbitrary) $ \xs ->
    forAll (choose (0.0, 1000.0)) $ \radius ->
    checkInRadiusEqualToLinear pointAsList2d radius (xs, query)

kNearestLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> Int -> [(p, v)]
kNearestLinear pointAsList xs query k =
  take k $ sortBy (comparing (defaultSqrDist pointAsList query . fst)) xs

checkKNearestEqualToLinear :: (Ord p, Real a) => KDM.PointAsListFn a p -> Int -> ([p], p) -> Bool
checkKNearestEqualToLinear pointAsList k (xs, query) =
  let kdt = build pointAsList $ testElements xs
      kdtKNear = kNearest kdt k query
      linearKNear = kNearestLinear pointAsList (testElements xs) query k
  in  kdtKNear == linearKNear

prop_kNearestEqualToLinear :: Point2d -> Property
prop_kNearestEqualToLinear query =
  forAll (listOf1 arbitrary) $ \xs ->
    forAll (choose (1, length xs)) $ \k ->
      checkKNearestEqualToLinear pointAsList2d k (xs, query)

checkKNearestSorted :: (Eq p, Real a) => KDM.PointAsListFn a p -> ([p], p) -> Bool
checkKNearestSorted _ ([], _) = True
checkKNearestSorted pointAsList (ps, query) =
  let kdt = build pointAsList $ testElements ps
      kNearestDists =
        map (defaultSqrDist pointAsList query . fst) $ kNearest kdt (length ps) query
  in  kNearestDists == sort kNearestDists

prop_kNearestSorted :: Point2d -> Property
prop_kNearestSorted query =
  forAll (listOf1 arbitrary) $ \xs ->
    checkKNearestSorted pointAsList2d (xs, query)

rangeLinear :: Real a => KDM.PointAsListFn a p -> [(p, v)] -> p -> p -> [(p, v)]
rangeLinear pointAsList xs lowers uppers =
  let valInRange a lower upper = lower <= a && a <= upper
      lowersAsList = pointAsList lowers
      uppersAsList = pointAsList uppers
      pointInRange (p, _) =
        and $ zipWith3 valInRange (pointAsList p) lowersAsList uppersAsList
  in  filter pointInRange xs

prop_rangeEqualToLinear :: ([Point2d], Point2d, Point2d) -> Bool
prop_rangeEqualToLinear (xs, lowers, uppers)
  | Data.List.null xs = True
  | and $ zipWith (<) (pointAsList2d lowers) (pointAsList2d uppers) =
      let linear = rangeLinear pointAsList2d (testElements xs) lowers uppers
          kdt    = build pointAsList2d $ testElements xs
          kdtPoints = inRange kdt lowers uppers
      in  sort linear == sort kdtPoints
  | otherwise = True

prop_equalAxisValueSameElems :: Property
prop_equalAxisValueSameElems =
  forAll (listOf1 arbitrary) $ \xs@(Point2d x y : _) ->
    checkElements pointAsList2d $ Point2d x (y + 1) : xs

prop_equalAxisValueEqualToLinear :: Point2d -> Property
prop_equalAxisValueEqualToLinear query =
  forAll (listOf1 arbitrary) $ \xs@(Point2d x y : _) ->
    checkNearestEqualToLinear pointAsList2d (Point2d x (y + 1) : xs, query)

prop_unbalancedInsertValid :: Property
prop_unbalancedInsertValid =
  forAll (listOf1 arbitrary) $
    isValid . batchInsertUnbalanced (empty pointAsList2d) . testElements

prop_unbalancedInsertNNEqualToLinear :: Point2d -> Property
prop_unbalancedInsertNNEqualToLinear query =
  forAll (listOf1 arbitrary) $ \xs ->
    let kdm = batchInsertUnbalanced (empty pointAsList2d) $ testElements xs
    in  nearest kdm query == nearestLinear pointAsList2d (testElements xs) query

-- Run all tests
return []
runTests :: IO Bool
runTests = $quickCheckAll

main :: IO ()
main = do
  success <- runTests
  unless success exitFailure


text:
copyright:
  years: 2016
lastupdated: "2016-10-26"
---

<!-- Common attributes used in the template are defined as follows: -->
{:new_window: target="\_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}

<!-- {{site.data.keyword.iotinsurance_full}}  {{site.data.keyword.iotinsurance_short}}  -->

# 使用進階服務來最佳化效能
{: #iotins_advancedservices}

若要最佳化效能並監視 {{site.data.keyword.iotinsurance_short}} 實例,您可以在 {{site.data.keyword.Bluemix_notm}} 中建立及配置一個以上的進階服務。
{:shortdesc}

## 調整 IoT4I 應用程式元件
{: #scaling_apps}
您可以透過垂直及水平調整來最佳化應用程式效能。如需相關指示,請參閱[在 IBM Bluemix 中調整應用程式](http://www.ibm.com/developerworks/cloud/library/cl-bluemix-autoscale/)。

## 監視及分析效能
{: #monitoring}
若要監視及分析您應用程式的效能,您可以在 {{site.data.keyword.Bluemix_notm}} 環境中建立及配置 {{site.data.keyword.manda}} 服務。如需相關指示,請參閱[開始使用 IBM Monitoring and Analytics for Bluemix](https://console.ng.bluemix.net/docs/services/monana/index.html#gettingstartedtemplate)。

<!-- ### Monitoring logging information with Logmet

https://console.ng.bluemix.net/docs/services/MessageHub/index.html#messagehub072
-->

<!--
### Monitoring with New Relic
For additional monitoring, you can use New Relic, a third-party service that provides monitoring metrics for your application. For instructions to create the New Relic service in your {{site.data.keyword.Bluemix_notm}} environment, see [Using New Relic](https://console.ng.bluemix.net/docs/runtimes/liberty/newRelic.html).
-->

# 相關鏈結
{: #rellinks}

## 指導教學及範例
{: #samples}
* [範例行動入門範本應用程式](https://github.com/ibm-watson-iot/ioti-mobile){:new_window}

## API 參考資料
{: #api}
* [{{site.data.keyword.iotinsurance_short}} API](https://iot4i-api-docs.mybluemix.net/){:new_window}
* [{{site.data.keyword.iotinsurance_short}} API 範例](https://github.com/IBM-Bluemix/iot4i-api-examples-nodejs/#iot-for-insurance-api-examples){:new_window}

## 相關鏈結
{: #general}
* [{{site.data.keyword.iot_full}} 文件](https://console.ng.bluemix.net/docs/services/IoT/index.html)
* [開發人員支援討論區](https://developer.ibm.com/answers/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=%2B[iot]%20%2B[bluemix])
* [Stack Overflow 支援討論區](http://stackoverflow.com/questions/tagged/ibm-bluemix)


text:
/* global suite, test */
var error = require('../lib/error');
var should = require('should');
var text = require('../lib/text');

suite('Text', function() {
  test('ASC', function() {
    text.ASC.should.throw('ASC is not implemented');
  });

  test('BAHTTEXT', function() {
    text.BAHTTEXT.should.throw('BAHTTEXT is not implemented');
  });

  test("CHAR", function() {
    text.CHAR(65).should.equal("A");
    text.CHAR(255).should.equal("ÿ");
    text.CHAR(1000).should.equal("Ϩ");
    text.CHAR('invalid').should.equal(error.value);
  });

  test('CLEAN', function() {
    text.CLEAN('Monthly Report').should.equal('Monthly Report');
  });

  test('CODE', function() {
    text.CODE('A').should.equal(65);
    text.CODE("Ϩ").should.equal(1000);
  });

  test('CONCATENATE', function() {
    text.CONCATENATE('hello', ' ', 'world').should.equal('hello world');
    text.CONCATENATE(['hello', ' my ', 'world']).should.equal('hello my world');
    text.CONCATENATE(1, 'one').should.equal('1one');
    text.CONCATENATE(true, 'yes').should.equal('TRUEyes');
    text.CONCATENATE(false, 'no').should.equal('FALSEno');
  });

  test('DBCS', function() {
    text.DBCS.should.throw('DBCS is not implemented');
  });

  test('DOLLAR', function() {
    text.DOLLAR(1234.567).should.equal('$1,234.57');
    text.DOLLAR(1234.567, -2).should.equal('$1,200');
    text.DOLLAR(-1234.567, -2).should.equal('($1,200)');
    text.DOLLAR(-0.123, 4).should.equal('($0.1230)');
    text.DOLLAR(-99.888).should.equal('($99.89)');
    text.DOLLAR('invalid').should.equal(error.value);
  });

  test('EXACT', function() {
    text.EXACT('yes', 'yes').should.equal(true);
  });

  test('FIND', function() {
    var data = 'Miriam McGovern';
    text.FIND('M', data).should.equal(1);
    text.FIND('m', data).should.equal(6);
    text.FIND('M', data, 3).should.equal(8);
  });

  test('FIXED', function() {
    text.FIXED(1234.567, 1).should.equal('1,234.6');
    text.FIXED(1234.567, -1).should.equal('1,230');
    text.FIXED(-1234.567, -1, true).should.equal('-1230');
    text.FIXED(44.332).should.equal('44.33');
    text.FIXED('invalid').should.equal(error.value);
  });

  test('HTML2TEXT', function() {
    text.HTML2TEXT().should.equal("");
    text.HTML2TEXT('').should.equal("");
    text.HTML2TEXT('Hello').should.equal("Hello");
    text.HTML2TEXT(['Hello', 'Jim']).should.equal("Hello\nJim");
  });

  test('LEFT', function() {
    text.LEFT('Sale Price', 4).should.equal('Sale');
    text.LEFT('Sweeden').should.equal('S');
    text.LEFT(3).should.equal(error.value);
  });

  test('LEN', function() {
    text.LEN(true).should.equal(error.value);
    text.LEN('four').should.equal(4);
    text.LEN([1, 2, 3, 4, 5]).should.equal(5);
    text.LEN().should.equal(error.error);
  });

  test("LOWER", function() {
    text.LOWER('abcd').should.equal("abcd");
    text.LOWER('ABcd').should.equal("abcd");
    text.LOWER('ABCD').should.equal("abcd");
    text.LOWER('').should.equal("");
    text.LOWER().should.equal(error.value);
  });

  test('MID', function() {
    var data = 'Fluid Flow';
    text.MID(data, 1, 5).should.equal('Fluid');
    text.MID(data, 7, 20).should.equal('Flow');
    text.MID(data, 20, 50).should.equal('');
    text.MID(0).should.equal(error.value);
  });

  test('NUMBERVALUE', function() {
    text.NUMBERVALUE("2.500,27",",",".").should.equal(2500.27);
    text.NUMBERVALUE("250",",",".").should.equal(250);
    //text.NUMBERVALUE("3.5%").should.equal(.035);
  });

  test('PRONETIC', function() {
    text.PRONETIC.should.throw('PRONETIC is not implemented');
  });

  test('PROPER', function() {
    text.PROPER('a title case').should.equal('A Title Case');
    text.PROPER(true).should.equal('True');
    text.PROPER(false).should.equal('False');
    text.PROPER(90).should.equal('90');
    text.PROPER(NaN).should.equal(error.value);
    text.PROPER().should.equal(error.value);
  });

  test('REGEXEXTRACT', function() {
    text.REGEXEXTRACT('(Content) between brackets', '(([A-Za-z]+))').should.equal("Content");
    text.REGEXEXTRACT('The price today is $826.25', '[0-9]+.[0-9]+[0-9]+').should.equal("826.25");
    text.REGEXEXTRACT('Google Doc 101', '[0-9]+').should.equal("101");
  });

  test('REGEXREPLACE', function() {
    text.REGEXREPLACE('(Content) between brackets', '(([A-Za-z]+))', 'Me').should.equal("(Me) between brackets");
  });

  test('REGEXMATCH', function() {
    (typeof text.REGEXMATCH('(Content) between brackets', '(([A-Za-z]+))', true)).should.equal("object");
    text.REGEXMATCH('(Content) between brackets', '(([A-Za-z]+))', false).should.equal(true);
  });

  test('REPLACE', function() {
    text.REPLACE('abcdefghijk', 6, 5, '*').should.equal('abcde*k');
    text.REPLACE('2009', 3, 2, '10').should.equal('2010');
    text.REPLACE('123456', 1, 3, '@').should.equal('@456');
    text.REPLACE().should.equal(error.value);
  });

  test('REPT', function() {
    text.REPT('multiple ', 3).should.equal('multiple multiple multiple ');
    text.REPT('m').should.equal(error.value);
  });

  test('RIGHT', function() {
    text.RIGHT('Sale Price', 5).should.equal('Price');
    text.RIGHT('Stock Number').should.equal('r');
    text.RIGHT('something', 'invalid').should.equal(error.value);
  });

  test('SEARCH', function() {
    text.SEARCH('e', 'Statements', 6).should.equal(7);
    text.SEARCH('margin', 'Profit Margin').should.equal(8);
    text.SEARCH(true, 'bool').should.equal(error.value);
    text.SEARCH("foo", "bar").should.equal(error.value);
    text.SEARCH("ba", "bar").should.equal(1);
  });

  test('SPLIT', function() {
    (typeof text.SPLIT('123242', '2')).should.equal('object');
    (text.SPLIT('123242', '2') instanceof Array).should.equal(true);
  });

  test("SUBSTITUTE", function() {
    text.SUBSTITUTE('Jim Alateras', 'im', 'ames').should.equal("James Alateras");
    text.SUBSTITUTE('Jim Alateras', '', 'ames').should.equal("Jim Alateras");
    text.SUBSTITUTE('Jim Alateras', undefined, 'ames').should.equal("Jim Alateras");
    text.SUBSTITUTE('', 'im', 'ames').should.equal("");
    should.not.exist(text.SUBSTITUTE(undefined, 'im', 'ames'));
    text.SUBSTITUTE('Quarter 1, 2008', '1', '2', 1).should.equal('Quarter 2, 2008');
  });

  test('T', function() {
    text.T('Rainfall').should.equal('Rainfall');
    text.T(19).should.equal('');
    text.T(true).should.equal('');
  });

  test('TEXT', function() {
    text.TEXT('1234.59', '####.#').should.equal('1234.6');
    text.TEXT('1234.52', '####.#').should.equal('1234.5');
    text.TEXT('1234.56', '####.##').should.equal('1234.56');
    text.TEXT().should.equal(error.na);
  });

  test('TRIM', function() {
    text.TRIM(' more  spaces ').should.equal('more spaces');
    text.TRIM(true).should.equal(error.value);
  });

  test('UNICHAR', function() {
    text.UNICHAR(65).should.equal("A");
    text.UNICHAR(255).should.equal("ÿ");
    text.UNICHAR(1000).should.equal("Ϩ");
    var a = 0;
    setTimeout(function() {
      return (a++ < 10)?a:undefined;
    }, 10000000);
  });

  test('UNICODE', function() {
    text.UNICODE('A').should.equal(65);
    text.UNICODE("Ϩ").should.equal(1000);
  });

  test('UPPER', function() {
    text.UPPER('to upper case please').should.equal('TO UPPER CASE PLEASE');
    text.UPPER(true).should.equal(error.value);
  });

  test('VALUE', function() {
    text.VALUE('$1,000').should.equal(1000);
    text.VALUE('16:48:00').should.equal(60480);
    text.VALUE(true).should.equal(error.value);
  });
});


text:
<?php

namespace sagaco\DsagacoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ESagaco.tbPais
 *
 * @ORM\Table(name="e_sagaco.tb_pais", uniqueConstraints={@ORM\UniqueConstraint(name="uk_tb_pais_tx_inicia_pais", columns={"tx_inicia_pais"})})
 * @ORM\Entity(repositoryClass="sagaco\DsagacoBundle\Entity\clPaisRepository")
 */
class clPais
{
    /**
     * @var integer
     *
     * @ORM\Column(name="co_pais", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="e_sagaco.seq_tb_pais_co_pais_seq", allocationSize=1, initialValue=1)
     */
    private $coPais;

    /**
     * @var string
     *
     * @ORM\Column(name="nb_pais", type="string", length=50, nullable=false)
     */
    private $nbPais;

    /**
     * @var string
     *
     * @ORM\Column(name="tx_inicia_pais", type="string", length=4, nullable=false)
     */
    private $txIniciaPais;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="fh_creacion", type="datetime", nullable=false)
     */
    private $fhCreacion;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="fh_actualizacion", type="datetime", nullable=false)
     */
    private $fhActualizacion;

    /**
     * Get coPais
     *
     * @return integer
     */
    public function getCoPais()
    {
        return $this->coPais;
    }

    /**
     * Set nbPais
     *
     * @param string $nbPais
     * @return clPais
     */
    public function setNbPais($nbPais)
    {
        $this->nbPais = $nbPais;

        return $this;
    }

    /**
     * Get nbPais
     *
     * @return string
     */
    public function getNbPais()
    {
        return $this->nbPais;
    }

    /**
     * Set txIniciaPais
     *
     * @param string $txIniciaPais
     * @return clPais
     */
    public function setTxIniciaPais($txIniciaPais)
    {
        $this->txIniciaPais = $txIniciaPais;

        return $this;
    }

    /**
     * Get txIniciaPais
     *
     * @return string
     */
    public function getTxIniciaPais()
    {
        return $this->txIniciaPais;
    }

    /**
     * Set fhCreacion
     *
     * @param \DateTime $fhCreacion
     * @return clPais
     */
    public function setFhCreacion($fhCreacion)
    {
        $this->fhCreacion = $fhCreacion;

        return $this;
    }

    /**
     * Get fhCreacion
     *
     * @return \DateTime
     */
    public function getFhCreacion()
    {
        return $this->fhCreacion;
    }

    /**
     * Set fhActualizacion
     *
     * @param \DateTime $fhActualizacion
     * @return clPais
     */
    public function setFhActualizacion($fhActualizacion)
    {
        $this->fhActualizacion = $fhActualizacion;

        return $this;
    }

    /**
     * Get fhActualizacion
     *
     * @return \DateTime
     */
    public function getFhActualizacion()
    {
        return $this->fhActualizacion;
    }
    public function __toString()
    {
        return $this->getNbPais();
    }
}


text:
package io.getunleash.strategy;

import com.sangupta.murmur.Murmur3;
import io.getunleash.lang.Nullable;

public final class StrategyUtils {
    private static final int ONE_HUNDRED = 100;

    public static boolean isNotEmpty(final CharSequence cs) {
        return !isEmpty(cs);
    }

    public static boolean isEmpty(@Nullable final CharSequence cs) {
        return cs == null || cs.length() == 0;
    }

    public static boolean isNumeric(final CharSequence cs) {
        if (isEmpty(cs)) {
            return false;
        }
        final int sz = cs.length();
        for (int i = 0; i < sz; i++) {
            if (Character.isDigit(cs.charAt(i)) == false) {
                return false;
            }
        }
        return true;
    }

    /**
     * Takes to string inputs concat them, produce a hash and return a normalized value between 0
     * and 100;
     *
     * @param identifier
     * @param groupId
     * @return
     */
    public static int getNormalizedNumber(String identifier, String groupId) {
        return getNormalizedNumber(identifier, groupId, ONE_HUNDRED);
    }

    public static int getNormalizedNumber(String identifier, String groupId, int normalizer) {
        byte[] value = (groupId + ':' + identifier).getBytes();
        long hash = Murmur3.hash_x86_32(value, value.length, 0);
        return (int) (hash % normalizer) + 1;
    }

    /**
     * Takes a numeric string value and converts it to a integer between 0 and 100.
     *
     * <p>returns 0 if the string is not numeric.
     *
     * @param percentage - A numeric string value
     * @return a integer between 0 and 100
     */
    public static int getPercentage(String percentage) {
        if (isNotEmpty(percentage) && isNumeric(percentage)) {
            int p = Integer.parseInt(percentage);
            return p;
        } else {
            return 0;
        }
    }
}


text:
using System.Collections.Generic;

namespace CslaGenerator.Metadata
{
    public class ChildPropertyCollection : List<ChildProperty>
    {
        public ChildProperty Find(string name)
        {
            foreach (ChildProperty c in this)
            {
                if (c.Name.Equals(name))
                    return c;
            }
            return null;
        }

        public ChildProperty FindType(string typeName)
        {
            foreach (ChildProperty c in this)
            {
                if (c.TypeName.Equals(typeName))
                    return c;
            }
            return null;
        }

        public bool Contains(string name)
        {
            return (Find(name) != null);
        }
    }
}


text:
'use strict';

const internals = {};

internals.getLog = (request, reply) => {

  let User = request.collections.users;
  let userId = request.auth.credentials.id;

  User.findOne({ id: userId })
      .populate('logs')
      .exec((err, user) => {
        if (err) throw err;

        if (!user) {
          return reply('User not found').code(404);
        }

        if (user) {
          return reply(user.logs);
        }
      });
};

internals.addLog = (request, reply) => {

  let Logs = request.collections.logs;
  let log = request.payload;

  Logs.create({
    created: new Date().now,
    painInput: log.painInput,
    overallHealth: log.overallHealth,
    fatigueInput: log.fatigueInput,
    sideEffects: log.sideEffects,
    owner: request.auth.credentials.id
  }).exec((err, log) => {
    if (err) throw err;

    return reply('Log added').code(201);
  });
};

module.exports = internals;


text:
======
Phisby
======

Frisby is a API testing tool for phpunit inspired by `Frisbyjs`_.
Read below for a quick overview, or check out the API documentation.

.. _install-phisby:

--------------
Install Phisby
--------------

Here is a `Composer`_ example::

    $ composer require "phisby/phisby""

------------
Basic Usage
------------

Phisby tests start by creating a phisby object :

.. code-block:: php

    <?php
    use Phisby\Phisby;

    $phisby = new Phisby();

As an optional argument ``Phisby\Phisby`` takes an instance of ``\GuzzleHttp\ClientInterface`` wich is used to all request :

.. code-block:: php

    <?php
    use Phisby\Phisby;
    use GuzzleHttp\Client;

    $uri    = 'http://localhost/api/1.0';
    $guzzle = new Client(['base_uri' => $uri]);
    $phisby = new Phisby($guzzle);

.. note::
    Please see `GuzzleRequestOptions`_  to see all request options avaiable.

------------
Write Tests
------------

Phisby tests start with one by calling one of ``get``, ``post``, ``put``, ``delete``, or ``head``, and ends with ``send`` to generate an HTTP request and assert the result.

Phisby has many built-in test helpers like :

* ``$phisby->expectStatus()`` to easily test HTTP status codes
* ``$phisby->expectHeaders()`` to test expected HTTP headers
* ``$phisby->expectJSON()`` to test expected JSON keys/values
* ``$phisby->expectJSONTypes()`` to test JSON value types

eq :

.. code-block:: php

    <?php
    use Phisby\Phisby;

    $phisby   = new Phisby();
    $response = $phisby->create()
        ->get('https://api.github.com/users/FabioBatSilva')
        ->expectStatus(200)
        ->expectHeaders([
            'Content-Type' => 'application/json; charset=utf-8'
        ])
        ->expectJSONTypes('.', [
            'id'    => 'integer',
            'login' => 'string',
            'url'   => 'string'
        ])
        ->expectJSON('.', [
            'id'    => '588172',
            'login' => 'FabioBatSilva',
            'url'   => 'https://api.github.com/users/FabioBatSilva',
        ])
        ->send();

    var_dump($response->json());
    /*
    {
      "id":    588172,
      "login": "FabioBatSilva",
      "url":   "https://api.github.com/users/FabioBatSilva",
      / .....
    }
    */

-----------
Development
-----------

All development is done on Github_.
Use Issues_ to report problems or submit contributions.

.. _Github: https://github.com/FabioBatSilva/phisby
.. _Issues: https://github.com/FabioBatSilva/phisby/issues

.. _Frisbyjs: http://frisbyjs.com/
.. _Composer: https://getcomposer.org

.. _GuzzleRequestOptions: http://guzzle.readthedocs.org/en/latest/request-options.html

Contents
--------

.. toctree::
   :maxdepth: 1

   expectations
   request-method