text:
---
layout: post
title: The Java 7 EE Tutorial - free eBook!
excerpt: The Java EE 7 Documentation page has been recently refreshed ...
---

The [Java EE 7 Documentation](http://docs.oracle.com/javaee/7/) page has been recently refreshed with an improved and cleaner layout. It should now be easier to locate, browse and read the Java EE API documentation, the Java EE SDK documentation and the Java EE Tutorials.

It is sometime useful to remind about the availability of useful resources such the _[Java EE Tutorial](https://docs.oracle.com/javaee/7/tutorial/index.html)_… even more when those resources a free!  The Java EE Tutorial is one of those gems that is sometime overlooked.  It covers Java EE 7 and is an invaluable set of resources for anyone wanting to learn Java EE but also for people already familiar with Java EE as it also covers some of the less known part of the Java EE platform such as JCA.

For new comers, there is _[Your First Cup: An Introduction to the Java EE Platform](https://docs.oracle.com/javaee/7/firstcup/index.html)_, a crisp introduction to the platform.

The _[Java EE Tutorial](https://docs.oracle.com/javaee/7/tutorial/index.html)_ is available for free (online and PDF format). In addition, the it is now also available in ePub and Mobi formats so you can download and read it on your preferred eBook reader. Just check the top right corner. And again, those resources are free!

Finally if you are more old school, the _Java EE 7 Tutorial_ is also available, for a fee, as a [dead-tree version](http://www.amazon.com/Java-EE-Tutorial-5th/dp/0321994922/).

*Originaly posted on [The Aquarium](https://blogs.oracle.com/theaquarium/the-java-7-ee-tutorial-free-ebook) blog.*

gha_language: CSS


text:
# MEAN Chat Demo

A simple Socket.IO chat application built on a MEAN stack with help from the Yeoman [Angular Fullstack](https://github.com/DaftMonk/generator-angular-fullstack) Generator.

## Live demo

[http://mean-chat.herokuapp.com/](http://mean-chat.herokuapp.com/)

## Setup

Run `npm install`, followed by `bower install` to grab the dependencies.

## Running the app

Run `grunt:serve` to start the app in development mode, or run `grunt server:dist` to run it in production mode.

## License

MIT

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# MacOSX
- Confirm java path
```shell
$ which java
/usr/bin/java

$ ls -l /usr/bin/java
lrwxr-xr-x  1 root  wheel  74 Oct 31  2013 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java*
-rwxr-xr-x  1 root  wheel  54624 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
-rwxr-xr-x  1 root  wheel  68224 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
-rwxr-xr-x  1 root  wheel  54624 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
-rwxr-xr-x  1 root  wheel  54640 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javadoc
-rwxr-xr-x  1 root  wheel  54624 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javah
-rwxr-xr-x  1 root  wheel  54624 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javap
-rwxr-xr-x  1 root  wheel  49584 Oct 31  2013 /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws
```

- [Install java 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)

- Set Java 1.8
```
$ sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/ /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0

# .bashrc etc
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.8.0"
```
- Confirm the setting

```shell
# Expected

$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
```

repository: mttrs/tips

repo_name: mttrs/tips


text:
# Carl bot

This is a bot to be used on [Codewars](http://www.codewars.be/game).

Currently it just goes to the nearest powerup and gets stuck against walls sometimes.
It also can get stuck at random, continuously going into one direction and the opposite over and over again.

repository: GXGOW/codewars-carl-bot

repo_name: GXGOW/codewars-carl-bot


text:
---
title: "Random git tips"
---

This is going to be a small cheatsheet for random `git` commands that I find myself using *most* of the time. I am not going to get into the detail of any of the commands, if you would like to know more about any of them I would recommend going through [git](http://git-scm.com/docs/) [docs](https://www.kernel.org/pub/software/scm/git/docs/).

## Saving the credentials

Sometimes you might get offended by the git prompting for the credentials again and again i.e. whenever you are `pull`ing or `push`ing to the repository.

You can make `git` to stop asking for the credentials by either of the two ways (are there more?!) stated below

- You may [add an SSH key](https://help.github.com/articles/generating-ssh-keys/) so that *`git`* will trust your PC and won't ask for the credentials.
- Use git credential helper:

```
git config credential.helper store
```

By using this command, it would *cache* the credentials and you won't have to type them again. However, there might be some security concerns involved as this method stores them in plain text form. Have a look at this [stackoverflow question](http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-github) for `cache`, `wincred` or `osxkeychain` and some alternative ways to use this or visit [any of](http://git-scm.com/docs/gitcredentials) [these](http://git-scm.com/docs/technical/api-credentials.html)

## Rebasing the commits

`git rebase` is [really powerful](http://git-scm.com/docs/git-rebase) however I mostly find myself using it to rebase the commits in order to have a clean history. Here is how you rebase the commits i.e. merge the minor commits into one meaningful commit.

```
git rebase -i xxxxx
```

Where `xxxxx` is the hash of the commit immediately below the commit message till which you want to rebase the commits.

## Renaming a branch

You can do the following to rename a branch

```
git branch -m old_branch_name new_branch_name
```

Also, if you want to rename the branch which you are currently on, you can do the following

```
git branch -m new_branch_name
```

## Detached head problem

Sometimes you might get the problem of detached head. Most common cause for this to occur is, you checkout some specific commit and you start getting this detached head warning since you are not any branch. So how do you solve this?! You simply checkout the branch you were on. For example if you were doing some work upon the `develop` branch, when you started getting this warning, do

```
git checkout develop
```

If you forget about the branch you were on, you may simply `checkout` some (any) branch and the problem will be solved.

## Checking the log

This one is pretty straight forward. You simply do:

```
git log
```

This will give you the detailed versoin. However, if you just want to have a look at the commit messages (and hashes), simply do the following:

```
git log --oneline
```

## Resetting the changes

If you want to get all the staged changes back i.e. revert the `git add .`, you can do the following

```
git reset HEAD
```

If you want to revert all the changes since the last commit do the following

```
git reset --hard HEAD
```

followed by `git clean -fd` which will remove all the untracked files.

## That SSL Verification Error

Sometimes, you might get SSL certificate error when cloning, pulling or pushing. The simplest way to make it go away is turn off the SSL verification i.e.

```
git config --global http.sslVerify false
```

## Ignore the mode changes

Sometimes, for some odd reason, you might want to have different file modes on your local repository while having different file modes on the online version. Or you might have accidentally done `chmod -R 777`, like I did, which you do not want to push over to the server, you can simply ask git to ignore any kind of file mode changes:

```
git config core.fileMode false
```

## Get the last commit with message regex

If you want to find some commit having a specific message you may use the `git show :/regex` command where `regex` is the regular expression of the message. For example, if you want to find the containing the word `functionality`, you may try the following:

```
git show :/fix
```

That's about it. There is alot more to tell and there are many that I must have missed but stated are the ones that I find myself using most of the time. Do you have any of your own? feel free to share them by using the comments section below.

repository: iYoginth/Blog

repo_name: iYoginth/Blog


text:
---
page_type: sample
languages:
- ruby
products:
- azure
description: "This sample explains how to manage your resources and resource groups in Azure Stack using the Azure Ruby SDK."
urlFragment: Hybrid-Resource-Manager-Ruby-Resources-And-Groups
---

# Hybrid-Resource-Manager-Ruby-Resources-And-Groups

This sample explains how to manage your
[resources and resource groups in Azure Stack](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-key-features#resource-groups)
using the Azure Ruby SDK.

**On this page**

- [Run this sample](#run)
- [What is example.rb doing?](#example)
    - [List resource groups](#list-groups)
    - [Create a resource group](#create-group)
    - [Update a resource group](#update-group)
    - [Create a key vault in the resource group](#create-resource)
    - [List resources within the group](#list-resources)
    - [Export the resource group template](#export)
    - [Delete a resource group](#delete-group)

## Run this sample

1. If you don't already have it, [install Ruby and the Ruby DevKit](https://www.ruby-lang.org/en/documentation/installation/).

1. If you don't have bundler, install it.

    ```
    gem install bundler
    ```

1. Clone the repository.

    ```
    git clone https://github.com/Azure-Samples/Hybrid-Resource-Manager-Ruby-Resources-And-Groups.git
    ```

1. Install the dependencies using bundle.

    ```
    cd Hybrid-Resource-Manager-Ruby-Resources-And-Groups
    bundle install
    ```

1. 	If not available,
    [create a subscription](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-subscribe-plan-provision-vm)
    and save the subscription ID to be used later.

1. Create a [service principal](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-create-service-principals) to work against AzureStack. Make sure your service principal has [contributor/owner role](https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-create-service-principals#assign-role-to-service-principal) on your subscription.

1. Set the following environment variables using the information from the service principal that you created.

    ```
    export AZURE_TENANT_ID={your tenant id}
    export AZURE_CLIENT_ID={your client id}
    export AZURE_CLIENT_SECRET={your client secret}
    export AZURE_SUBSCRIPTION_ID={your subscription id}
    export ARM_ENDPOINT={your AzureStack Resource manager url}
    ```

    > [AZURE.NOTE] On Windows, use `set` instead of `export`.

1. To target Azure Stack environment, API-Version Profile V2017_03_09 or V2018_03_01 should be used to create the resource client.

    Example:
    ```ruby
    client = Azure::Resources::Profiles::V2018_03_01::Mgmt::Client.new(options)
    ```

1. To authenticate the Service Principal against Azure Stack environment, the endpoints should be defined using ```get_active_directory_settings()```. This method uses the ARM_Endpoint environment variable that was set using step 7.

    ```ruby
    # Get Authentication endpoints using Arm Metadata Endpoints
    def get_active_directory_settings(armEndpoint)
        settings = MsRestAzure::ActiveDirectoryServiceSettings.new
        response = Net::HTTP.get_response(URI("#{armEndpoint}/metadata/endpoints?api-version=1.0"))
        status_code = response.code
        response_content = response.body
        unless status_code == "200"
            error_model = JSON.load(response_content)
            fail MsRestAzure::AzureOperationError.new("Getting Azure Stack Metadata Endpoints", response, error_model)
        end

        result = JSON.load(response_content)
        settings.authentication_endpoint = result['authentication']['loginEndpoint'] unless result['authentication']['loginEndpoint'].nil?
        settings.token_audience = result['authentication']['audiences'][0] unless result['authentication']['audiences'][0].nil?
        settings
    end
    ```

1. Run the sample.

    ```
    bundle exec ruby example.rb
    ```

## What is example.rb doing?

The sample walks you through several resource and resource group management operations.
It starts by setting up a ResourceManagementClient object using your subscription and credentials.

```ruby
subscription_id = ENV['AZURE_SUBSCRIPTION_ID'] || '11111111-1111-1111-1111-111111111111'

# This parameter is only required for AzureStack or other soverign clouds. Pulic Azure already has these settings by default.
active_directory_settings = get_active_directory_settings(ENV['ARM_ENDPOINT'])

provider = MsRestAzure::ApplicationTokenProvider.new(
	ENV['AZURE_TENANT_ID'],
	ENV['AZURE_CLIENT_ID'],
	ENV['AZURE_CLIENT_SECRET'],
	active_directory_settings
)

credentials = MsRest::TokenCredentials.new(provider)
options = {
	credentials: credentials,
	subscription_id: subscription_id,
	active_directory_settings: active_directory_settings,
	base_url: ENV['ARM_ENDPOINT']
}

client = Azure::Resources::Profiles::V2018_03_01::Mgmt::Client.new(options)

```

It also sets up a ResourceGroup object (resource_group_params) to be used as a parameter in some of the API calls.

```ruby
resource_group_params = Azure::ARM::Resources::Models::ResourceGroup.new.tap do |rg|
    rg.location = `local`
end
```

There are a couple of supporting functions (`print_item` and `print_properties`) that print a resource group and it's properties.
With that set up, the sample lists all resource groups for your subscription, it performs these operations.

### List resource groups

List the resource groups in your subscription.

```ruby
 client.resource_groups.list.value.each{ |group| print_item(group) }
```

### Create a resource group

```ruby
client.resource_groups.create_or_update('azure-sample-group', resource_group_params)
```

### Update a resource group

The sample adds a tag to the resource group.

```ruby
resource_group_params.tags = { hello: 'world' }
client.resource_groups.create_or_update('azure-sample-group', resource_group_params)
```

### Create a key vault in the resource group

```ruby
key_vault_params = Azure::ARM::Resources::Models::GenericResource.new.tap do |rg|
    rg.location = WEST_US
    rg.properties = {
        sku: { family: 'A', name: 'standard' },
        tenantId: ENV['AZURE_TENANT_ID'],
        accessPolicies: [],
        enabledForDeployment: true,
        enabledForTemplateDeployment: true,
        enabledForDiskEncryption: true
    }
  end
  client.resources.create_or_update(GROUP_NAME,
                                    'Microsoft.KeyVault',
                                    '',
                                    'vaults',
                                    'azureSampleVault',
                                    '2015-06-01',
                                    key_vault_params)
```

### List resources within the group

```ruby
client.resource_groups.list_resources(GROUP_NAME).value.each{ |resource| print_item(resource) }
```

### Export the resource group template

You can export the resource group as a template and then use that
to [deploy your resources to Azure](https://azure.microsoft.com/documentation/samples/resource-manager-ruby-template-deployment/).

```ruby
export_params = Azure::ARM::Resources::Models::ExportTemplateRequest.new.tap do |rg|
    rg.resources = ['*']
end
client.resource_groups.export_template(GROUP_NAME, export_params)
```

### Delete a resource group

```ruby
client.resource_groups.delete('azure-sample-group')
```


text:
# BrawlStars API

A PHP library to conveniently access and query the BrawlStars API.
It includes a pre-defined set of classes that initialise themselves dynamically from API responses.

This package uses the official BrawlStars API. For more information, please visit
[https://developer.brawlstars.com/](https://developer.brawlstars.com/)

To read the brawlstars-php documentation please vist
[https://ahsan112.gitbook.io/brawlstars-php/](https://ahsan112.gitbook.io/brawlstars-php/)

## Requirements
To use this package, you need to obtain an API key at [https://developer.brawlstars.com/](https://developer.brawlstars.com/)

## Installation
### Using Composer
```
composer require ahsan112/brawlstars-php
```

## Usage
When instantiating the BrawlStarsClient, you have to provide your API key:

```php
$client = new BrawlStarsClient('key');
```

## Players
Refers to `/players` endpoint from the official docs.

### Retrieve a player
```php
$player = $client->getPlayer('tag');
```

A Player object is returned
```php
$player->soloVictories()
$player->highestTrophies()
$player->brawlers();
$player->brawlers()->brawler('leon');
$player->brawlers()->brawler('leon')->power();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

### Retrieve a player's battle log

```php
$battleLog = client->getPlayerBattleLog('tag');

$battleLog->all() // retrives all battles as BattleLogList Object
$battleLog->latest() // retrives the most recent battle by the player
$battleLog->latest()->result();
$battleLog->latest()->teams();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

## Clubs
Refers to `/clubs/{clubTag}` endpoint from the official docs.

```php
$club = $client->getClub('club tag'); // returns Club object

$club->name();
$club->description();
$club->members(); // ClubMembersList Object
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

### Getting club president, vice-presidents, seniors
```php
$president = $club->president();
$president->name();
$president->trophies();

$vicePresidents = $club->vicePresidents();
$seniors = $club->seniors();

```

## Rankings

### Season ranking
Refers to `/rankings{countryCode}/seasons/{seasonId}` endpoint from the official docs.

```php
$seasonRanking = $client->getSeasonRanking(); // default is ('global', 'latest')
$seasonRanking = $client->getSeasonRanking('gb', '56');

$seasonRanking->topTen();
$seasonRanking->first()->name();
$seasonRanking->first()->trophies();
```

### Clubs Ranking
Refers to `/rankings{countryCode}/clubs` endpoint from the official docs.

```php
$clubRanking = $client->getClubsRanking(); // default is ('global')
$clubRanking = $client->getClubsRanking('gb');

$clubRanking->topTen();
$clubRanking->first()->name();
$clubRanking->first()->trophies();
$clubRanking->first()->memberCount();
```

### Brawler Ranking
Refers to `/rankings{countryCode}/brawlers/{brawlerId}` endpoint from the official docs.

```php
$brawlerRanking = $client->getBrawlerRanking('brawler id');

$brawlerRanking->topTen();
$brawlerRanking->first()->name();
$brawlerRanking->first()->trophies();
$brawlerRanking->first()->club();
```

### Player Ranking
Refers to `/rankings/{countryCode}/players` endpoint from the official docs.

```php
$playerRanking = $client->getPlayerRanking('tag');

$playerRanking->topTen();
$playerRanking->first()->name();
$playerRanking->first()->trophies();
$playerRanking->first()->club();
```

For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

## Events
Refers to `/events/rotation` endpoint from the official docs.

```php
$events = $client->getEvents();

$events->all();
$events->first()->startTime();
$events->first()->endTime();
$events->first()->map();
```
For more methods read the brawlstars-php [documentation](https://ahsan112.gitbook.io/brawlstars-php/).

repository: ahsxn/brawl-stars-php

repo_name: ahsxn/brawl-stars-php


text:
# j2p2j
Websocket Javascript/Python framework, Copyright (c) 2015, Michael Scott Cuthbert and cuthbertLab

What is it?
===========
A way of working with Javascript and Python together for the best parts of both.

Use it to make a great UI for a Python project in the web browser.

Use it to add some amazing Python tools to a Javascript project.

What do I do?
==============
Subclass the `j2p2j.Application` and `j2p2j.Client` objects.

In `j2p2j.Client` define methods that you'd like to be available from Javascript

Create a UI in an index.html file.

Call your application with:

    a = MyApplication('index.html', MyClientClass)
    a.run()

Tada!  See the demos directory for two demos...

Built off of Tornado web server

repository: cuthbertLab/stamr

repo_name: cuthbertLab/stamr


text:
### Install via:

```
sudo apt-get update
sudo apt-get install -y build-essential git libatlas-base-dev libopencv-dev

git clone --recursive https://github.com/dmlc/mxnet

make -j12 USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda
cd python; python setup.py install
cd ../../
```

### Run benchmarks

```
CUDA_VISIBLE_DEVICES=2 MXNET_GPU_WORKER_NTHREADS=2 MXNET_EXEC_NUM_TEMP=1 python alexnet.py | tee out_alexnet.log

```

### Notes from antinucleon

We choose to block the dynamic thread engine to get fair result, definitely there will be some costs,
and I do think it is not worth for these microseconds but the most important thing is learn spirit
from each tools.
The first epoch will make some delay for lazy allocation, but we think it is not a problem.
Also there is a magic number of 4GB threshold for dynamic memory recycle,
we didn't change it although dynamic memory recycle will hurt performance too much.

One import thing about MXNet is chose parallelism level.
Basically, less parallelism, fewer memory cost.
For example, on Titan X with 12 GB memory, train on GoogLeNet v1,

```MXNET_GPU_WORKER_NTHREADS=2 MXNET_EXEC_NUM_TEMP=1 python3 gnet.py``` allows training in batch of 256,

but

```MXNET_GPU_WORKER_NTHREADS=4 MXNET_EXEC_NUM_TEMP=4 python3 gnet.py```

will be oom for batch of 256 (guess still saving a little more than other library but not tested)

Various of setting can be found at: https://mxnet.readthedocs.org/en/latest/env_var.html

In my feeling because currently hardware is bottleneck, dynamic data flow engine and
multi-execution doesn't show its advantage on single card, but in multi-gpu
and distributed case, it makes problem much easier.

BTW. Do you have plan to benchmark multi-gpu or distributed convolution net?
We have collected some result already.

https://github.com/dmlc/mxnet/tree/master/example/distributed-training

gha_license_id: MIT


text:
# Dagger_2_Component_Problem
This is a poorly created two project repository to show a problem I have with googles dagger 2.

## How to run
I use gradle 2.3.10 and java 8 in cygwin under windows 8.

Clone this repository and execute a 'gradle clean compileJava' inside the 'DaggerUsingProject'.
Afterwards check 'build/generated/source/apt/main/di' for a generate Dagger component

## Where is the problem?
When a second AnnotationProcessor builds sources, those are not completely detected/processed by dagger. Dagger will create some files for them, but not all.

In the state the project is checked in, after compile there is no Dagger component generated from 'di.ProjectComponent'. But there was no error during compilation although dagger picked up the file generated by the custom AnnotationProcessor, because there are MembersInjector and Factory classes generated for it.

When the 'di.RandomInterfaceModule' method 'RandomInterface provideRandomInterface' uses 'CopiedFromOtherProcessor' instead of 'GeneratedByOtherProcessor' as argument (which is a copy from the generated file, except the classname) then the project still compiles without error AND it will generate the Dagger component file correctly.

Dagger 2 issue created about this: https://github.com/google/dagger/issues/269


text:
# GameAP File Manager

## Docs

* [Installation](./installation.md)
* [Configuration](./configuration.md)
* [Integration](./integration.md)
* [Customization](./customization.md)

## Requirements
 * PHP >= 5.6.4
 * Laravel 5.4 or higher
 * GD Library or Imagick for [intervention/image](https://github.com/Intervention/image)
 * requires [intervention/image](https://github.com/Intervention/image) and [intervention/imagecache](https://github.com/Intervention/imagecache)
 * Bootstrap 4 and Font Awesome 5

repository: gameap/gameap-file-manager

repo_name: gameap/gameap-file-manager


text:
# More about Models

There is **\LeanOrm\CachingModel** class that is meant to cache method return values across
all instances of **\LeanOrm\CachingModel** and its sub-classes (on each invocation of a php script
via command line or a webserver) where possible to improve performance. You can use it instead of
**\LeanOrm\Model** in your applications. The cached results do not persist between different
execution of your php script(s).

As at of the writing of this documentation, there are only two protected methods whose results
are being cached:
* **fetchTableListFromDB(): array**
* **fetchTableColsFromDB(string $table_name): array**

Other methods that could gain performance improvements will be added and documented as time goes on.

repository: rotexsoft/leanorm

gha_language: PHP

repo_name: rotexsoft/leanorm


text:
### Introduction

Merging can be thought of as a complementary process to the selection that we read last time.

One of the most impressive property of merge sort is that it can sort a file in $N\log N$ , independent of input. ( Heapsort also does this)

Prime disadvantage of mergesort is that it requires extra space proportional to $N$.

A guaranteed $N\log N$ running time can be a liability. For e.g. we know we can sort special cases in linear time in some other sorting schemes. That is it become significant when there is already a order in the file.

Mergesort is stable sort. Quicksort and Heapsort are not stable.

Mergesort is a method of choice for sorting Linked Lists ( why ?) {

Linked list is a linear structure and merge sort access the structure in a linear fashion.

}

url: https://raw.githubusercontent.com/mightyjoe781/Markdown-Notes/4d8afdbfed75dc2a9f474579b49c9948dd3b4978/Algorithms and Data Structures/Part 3 - Sorting/8-Merging and Mergesort/0-Introduction.md


text:
Contributing to Tensorflow-stubs
==================================

The preferred workflow for contributing to Tensorflow-stubs is to fork the
main repository on GitHub, clone, and develop on a branch. Steps:

1. Fork the [project repository](https://github.com/persephone-tools/tensorflow-stubs/)
   by clicking on the 'Fork' button near the top right of the page. This creates
   a copy of the code under your GitHub user account.

2. Clone your fork of the Tensorflow-stubs repository from your GitHub account to your local disk:

   ```bash
   $ git clone git@github.com:Your-Username/tensorflow-stubs.git
   $ cd tensorflow-stubs
   ```

3. Create a ``feature`` or ``bugfix`` or ``types`` branch to hold your development changes:

   ```bash
   $ git checkout -b my-feature
   ```

   Always use a branch. It's good practice to never work on the ``master`` branch!
   You don't need to worry about the history, changes can be rebased or squashed as needed.

4. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:

   ```bash
   $ git add modified_files
   $ git commit
   ```

   to record your changes in Git, then push the changes to your GitHub account with:

   ```bash
   $ git push -u origin my-feature
   ```

5. Go to the GitHub web page of your fork of the Tensorflow-stubs repo.  Click the
'Pull request' button to send your changes to the project's maintainers for
review. This will send an
email to the maintainers.

(If you are unfamiliar with Git, please look up the
[Git documentation](https://git-scm.com/documentation) on the web, or ask a friend or another contributor for help.)

Pull Request Checklist
----------------------

Please follow the following rules before you submit a pull request:

-  If your pull request addresses an issue, please use the pull request title
   to describe the issue and mention the issue number in the pull request description.
   This will make sure a link back to the original issue is created.

-  All public functions and methods should ideally have informative docstrings.

-  Please prefix the title of your pull request with `[MRG]` (Ready for
   Merge), if the contribution is complete and ready for a detailed review.
   Incomplete contributions should be prefixed `[WIP]` (to indicate a work
   in progress) and changed to `[MRG]` when it matures. WIPs may be useful
   to: indicate you are working on something to avoid duplicated work,
   request broad review of functionality or API, or seek collaborators.
   WIPs often benefit from the inclusion of a
   [task list](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
   in the pull request description.

You can also check for common programming errors with the following tools:

-  Code lint, check with:

  ```bash
  $ pip install pylint
  $ pylint path/to/code
  ```

Pylint errors are indicative of critical issues.

Filing bugs
-----------
We use Github issues to track all bugs and feature requests; feel free to
open an issue if you have found a bug or wish to see a feature implemented.

It is recommended to check that your issue complies with the
following rules before submitting:

-  Verify that your issue is not being currently addressed by other
   [issues](https://github.com/persephone-tools/tensorflow-stubs/issues?q=)
   or [pull requests](https://github.com/persephone-tools/tensorflow-stubs/pulls?q=).

-  Please ensure all code snippets and error messages are formatted in
   appropriate code blocks.
   See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks).

-  If the bug is system specific please include your operating system type and version number,
   as well as your Python versions. This information
   can be found by running the following code snippet:

  ```python
  import platform; print(platform.platform())
  import sys; print("Python", sys.version)
  ```

repository: acvander/tensorflow-stubs

repo_name: acvander/tensorflow-stubs


text:
---
title: "macOS"
linkTitle: "macOS"
weight: 2
---

### Prerequisites

* macOS 10.12 (Sierra)
* A hypervisor such as Hyperkit, Parallels, VirtualBox, or VMware Fusion

### Installation

{{% tabs %}}
{{% tab "Brew" %}}

If you have the [Brew Package Manager](https://brew.sh/) installed, this will download and install minikube to /usr/local/bin:

```shell
brew install minikube
```

{{% /tab %}}
{{% tab "Direct" %}}

Download and install minikube to /usr/local/bin:

```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \
  && sudo install minikube-darwin-amd64 /usr/local/bin/minikube
```
{{% /tab %}}

{{% /tabs %}}

## Hypervisor Setup

{{% tabs %}}
{{% tab "VirtualBox" %}}
{{% readfile file="/docs/Getting started/_virtualbox.md" %}}
{{% /tab %}}
{{% tab "Hyperkit" %}}

The easiest way to install hyperkit is using the [Brew Package Manager](https://brew.sh/):

```shell
brew install hyperkit
```

To use minikube and hyperkit reliably, please download and install our improved fork of the driver:

```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
  && sudo install docker-machine-driver-hyperkit /usr/local/bin/
```

This driver requires root privileges to create and destroy network interfaces:

```shell
sudo chown root:wheel /usr/local/bin
docker-machine-driver-hyperkit \
&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
```

### Using the hyperkit driver

```shell
minikube start --vm-driver=hyperkit
```

To make hyperkit the default for future invocations:

```shell
minikube config set vm-driver hyperkit
```

{{% /tab %}}

{{% tab "Parallels" %}}

Start minikube with Parallels support using:

```shell
minikube start --vm-driver=parallels
```

To make parallels the default for future invocations:

```shell
minikube config set vm-driver parallels
```
{{% /tab %}}

{{% tab "VMware Fusion" %}}

Start minikube with VMware Fusion support using:

```shell
minikube start --vm-driver=vmwarefusion
```

To make vmwarefusion the default for future invocations:

```shell
minikube config set vm-driver vmwarefusion
```
{{% /tab %}}

{{% /tabs %}}

{{% readfile file="/docs/Getting started/_post_install.md" %}}


text:
# Todo List Web App

![](https://img.shields.io/badge/Microverse-blueviolet)
![](https://img.shields.io/badge/Academic-blue)
![](https://img.shields.io/badge/HTML-red)
![](https://img.shields.io/badge/JavaScript-yellow)
![](https://img.shields.io/badge/SCSS-green)

Application development for academic purposes.

## Screenshot

![](https://i.imgur.com/hJ7LrFb.jpg)

## Live Demo

[Live Demo 🙂](https://jolly-wing-fd7a03.netlify.app/)

## Getting Started
**Install**

- `git clone https://github.com/D4nielJ/todo-list.git`
- `npm install`
- `npm run start`

**Test the project**

Test the project with Jest

- `npm run test`

## Authors

👤 **D4nielJ**

- GitHub: [@D4nielJ](https://github.com/D4nielJ)
- LinkedIn: [Daniel J](https://www.linkedin.com/in/daniel-djm/)

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check and add issues to the [issues page](../../issues/).

## Show your support

Give a ⭐ if you like this project!

## License

This project is licensed under [the terms of the MIT license](./LICENSE).

branch_name: refs/heads/main

gha_language: JavaScript


text:
# ExtractDocInfo
A set of Python Scripts to Convert Java API Documentation into a more readable Natural Language Format. These related to w.r.t _Domain Adapation_ Component
w.r.t Paper ["APIBot: Question Answering Bot for API Documentation"](https://dl.acm.org/citation.cfm?id=3155585)

# Requirements
```
python>=3.5.2 (Tested on Python 3.5.2 and Ubuntu 16.04 LTS)
Ubuntu==16.04 LTS
html2text==2018.1.9
nltk==3.2.1
beautifulsoup4==4.6.0
lxml==4.2.1
```

# Usage

### Download the whole project and then
1. Delete the _.keep_ files in all subdirectories of folder [Data](https://github.com/abhishek9sharma/apibot/tree/master/Data/).
2. Download the Java SE Documentaion from the official [link](http://www.oracle.com/technetwork/java/javase/documentation/jdk8-doc-downloads-2133158.html).
3. Unzip the .zip file extracted in previous step to folder [Data](https://github.com/abhishek9sharma/apibot/tree/master/Data/). You should see a _docs_ folder.
4.  Go the the folder  [ExtractDocInfo](https://github.com/abhishek9sharma/apibot/tree/master/ExtractDocInfo/) and run [IterateOverAPIDocs.py](https://github.com/abhishek9sharma/apibot/tree/master/ExtractDocInfo/IterateOverAPIDocs.py).
5. You should see the converted documents in the folder [FACTS](https://github.com/abhishek9sharma/apibot/tree/master/Data/FACTS).

#### Misc:
*   In case you delete the folders in  [Data](https://github.com/abhishek9sharma/apibot/tree/master/Data) you may run the .\setup.sh file present in the same folder.

# References
* ["APIBot: Question Answering Bot for API Documentation"](https://dl.acm.org/citation.cfm?id=3155585)

## Bibtex Citation
```
@inproceedings{
  tian2017apibot,
  title={APIBot: Question answering bot for API documentation},
  author={Tian, Yuan and Thung, Ferdian and Sharma, Abhishek and Lo, David},
  booktitle={Automated Software Engineering (ASE), 2017 32nd IEEE/ACM International Conference on},
  pages={153--158},
  year={2017},
  organization={IEEE}
}
```

###### Tested on Python 3.5.2 and Ubuntu 16.04 LTS


text:
---
title: Relaxing in Rhodes
date: '2019-10-13'
heroImage: './images/P1190428-PANO.jpg'
heroImagePosition: 'center center'
thumbnail: './images/MVIMG_20191016_095938_1~2.jpg'
featured: true
country: Greece
region: Rhodes
---

It's a common opinion that 'moons' are getting a bit excessive. But as someone who enjoyed both a minimoon and a honeymoon, surely it was only right to score the hat-trick and go for the babymoon?

In all seriousness, a final holiday, just the two of us, before a new family member was due to take up all of our time, money and energy... a no-brainer.

![Rhodes](./images/2019-10-18 02.37.03 1.jpg)

We stayed at [Casa Cook Rhodes](https://casacook.com/casa-cook-rhodes), an adults-only hotel in Kolymbia, Rhodes. Touted as a 'lifestyle boutique' hotel, we were keen to rest, recuperate and relax in the late October sun.

|                                               |                                             |
| --------------------------------------------- | ------------------------------------------- |
| ![Rhodes](./images/2019-10-16 11.00.51 1.jpg) | ![Rhodes](./images/IMG_20191013_090000.jpg) |

Almost all of the rooms have their own terraces, with sunbeds jutting out onto a shared pool. The cool water was the perfect tonic for when the 30 degree heat got a little too much. And at 26 weeks pregnant? There were a lot of pool dips!

|                                             |                                             |
| ------------------------------------------- | ------------------------------------------- |
| ![Rhodes](./images/IMG_20191017_084937.jpg) | ![Rhodes](./images/IMG_20191017_092736.jpg) |

Now if you know me, you'll know that while I do love sunbathing, I'm also not the best at sitting still for extended periods of time. So a few days into our trip, we (I use the word 'we' very loosely here) decided to go for a walk (hike?). I think I can still hear the echoes of Aidan's groans now...

But first? A breakfast of champions.

|                                                                           |                                                                           |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| ![Rhodes](./images/00100dPORTRAIT_00100_BURST20191014084136243_COVER.jpg) | ![Rhodes](./images/00100dPORTRAIT_00100_BURST20191017091223289_COVER.jpg) |

I'd googled a walk that serendipitously commenced at the edge of the hotel garden, so we found the start, and up we climbed. I'd advertised the walk as an easy 30 minute stroll... I'd lied. We were aiming for Tsambika Monastery and a view point across the local beaches. And for views? You need the height!

![Rhodes](./images/PANO_20191013_160113.vr.jpg)

![Rhodes](./images/IMG_20191013_160702~2.jpg)

Even Aidan reluctantly agreed though - the views were worth the exertion!

|                                             |                                               |
| ------------------------------------------- | --------------------------------------------- |
| ![Rhodes](./images/IMG_20191013_161236.jpg) | ![Rhodes](./images/MVIMG_20191013_164017.jpg) |

![Rhodes](./images/P1190428-PANO.jpg)

Such a stunning view of Tsambika beach - a long, sandy beach that we added to our to do list for the following days.

![Rhodes](./images/2019-10-23 10.08.01 1.jpg)

|                                  |                                  |
| -------------------------------- | -------------------------------- |
| ![Rhodes](./images/P1190434.jpg) | ![Rhodes](./images/P1190438.jpg) |

With such a beautiful backdrop, we took the chance to take the first photo of our family of three: me, Aidan, and his most impressive holiday beard!

![Rhodes](./images/DSC_2772.jpg)

And last but not least - after all that physical extertion, a final swim of the day was much deserved. A wonderful day, with a wonderful man at my side.

|                                               |                                             |
| --------------------------------------------- | ------------------------------------------- |
| ![Rhodes](./images/2019-10-18 11.11.35 1.jpg) | ![Rhodes](./images/IMG_20191017_104002.jpg) |

###The useful bits:###

- Check out [Casa Cook Rhodes](https://casacook.com/casa-cook-rhodes) if you're keen for a slice of luxury. After our initial booking fell through, we rebooked with [loveholidays.co.uk](loveholidays.co.uk).
- The walk to Tsambika Monastery is ever so simple: go through gate, walk up. That said, there are some more detailed instructions on [Trip Advisor](https://www.tripadvisor.co.uk/ShowUserReviews-g635615-d4946226-r532696327-Monastery_Tsambika-Kolimbia_Rhodes_Dodecanese_South_Aegean.html).


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.7] - 2021-09-04
- eslint delinter to fix javascript styling in code.  Using Github standard.
- [@Sineos](https://github.com/Sineos) added new options: Flex Getter, Expert,
  and Toggle duplicate messages.

## [0.1.6] - 2020-08-18
- [@deisterhold](https://github.com/deisterhold) added device selection configuration
- Bug fix @Id405 fix call to a previously renamed function

## [0.1.5] - 2020-08-06
- De-duplicate multiple messages a refactored contribution from [@Id405](https://github.com/Id405)

## [0.1.4] - 2020-08-04
- Added [@ondras](https://github.com/ondras) option to specify additional rtl_433 protocols (the -R option).
- @ondras also separated individual config items into proper rows for better UI formatting.

## [0.1.3] - 2020-07-28
- Added [@isramos](https://github.com/isramos) frequency option
- Added note about running `rpi-update` to README
- Color flair for `rtl_433` installer helper

## [0.1.2] - 2020-03-01
- Improved and rename the `install-rtl_433-app`. Fixed links in README to the
  script
- Cleaned up package description

## [0.1.1] - 2020-02-19
- Added 'node-red' to `package.js` keywords section to allow this to be discoverable on https://flows.nodered.org
- Cleaned up README and added install instructions for the `rtl_433` tool stack.
- Added `rpi-setup.sh` script to help bootstrap a system into a usable `rtl_433` environment.

## [0.1.0] - 2020-02-17
### Initial Release
- Core functionality for a `rtl_433` node that produces json payload outputs
  from a spawned `rtl_433`.  Restarting & redeploying works as expcted.
- Basic info documentation for node written.
- Ready for testing by others.

gha_license_id: NOASSERTION


text:
AptioFix
========

[![Build Status](https://travis-ci.org/acidanthera/AptioFixPkg.svg?branch=master)](https://travis-ci.org/acidanthera/AptioFixPkg) [![Scan Status](https://scan.coverity.com/projects/16009/badge.svg?flat=1)](https://scan.coverity.com/projects/16009)

AptioFixPkg drivers fixing certain UEFI APTIO Firmware issues relevant to booting macOS.

**WARNING**: The code in this repository should be considered to be a proof of concept draft quality, and is only intended to be used as a software implementation guide. Due to the lack of time, this codebase may contain partially understood reverse-engineering samples, almost no documentation, hacks, and absolute ignorance of EDK2 codestyle.

## AptioInputFix

Reference driver to shim AMI APTIO proprietary mouse & keyboard protocols for File Vault 2 GUI input support.
Generally [modified UsbKbDxe](https://github.com/acidanthera/AppleSupportPkg/tree/master/Platform/AppleUsbKbDxe) works better on APTIO V, but for Z77, Z87, and similar AptioInputFix may be the only solution.

#### Features
- Sends pressed keys to APPLE_KEY_MAP_DATABASE_PROTOCOL
- Fixes mouse movement via EFI_SIMPLE_POINTER_PROTOCOL

## AptioMemoryFix

Fork of the original [OsxAptioFix2](https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/OsxAptioFixDrv/) driver with a cleaner (yet still terrible) codebase and improved stability and functionality.

**Important Notes**:
To debug boot.efi errors on 10.13, aside the usual verbose (-v) boot-arg, you may need a boot.efi [patch](http://www.insanelymac.com/forum/topic/331381-aptiomemoryfix/page-7#entry2572595) or an nvram preference. Either is necessary to get sensible error messages instead of 'does printf work??', but the patch may help in case you have issues when reading nvram.

Before using AptioMemoryFix please ensure that you have:
- Most up-to-date UEFI BIOS firmware (check your motherboard vendor website).
- Fast Boot and Hardware Fast Boot disabled in BIOS if present.
- Above 4G Decoding or similar enabled in BIOS if present.
**WARNING**: On some motherboards (notably ASUS WS-X299-PRO) this option causes adverse effects, and must be disabled. While no other motherboards with the same issue are known, consider this option to be first to check if you have erratic boot failures.
- VT-d disabled in BIOS if present (you could also drop ACPI DMAR table with a bootloader).
- _No_ `slide` boot argument present in NVRAM or anywhere else (it is not necessary unless you cannot boot at all or see `No slide values are usable! Use custom slide!` message from AptioMemoryFix).
- CFG Lock (MSR 0xE2 write protection) disabled in BIOS if present (consider [patching it](https://github.com/LongSoft/UEFITool/blob/master/UEFIPatch/patches.txt) otherwise if you have enough skills). See VerifyMsrE2 section for more details.
- CSM disabled in BIOS if present (you may need to flash GOP ROM on NVIDIA 6xx/AMD 2xx or older, using [GopUpdate](https://www.win-raid.com/t892f16-AMD-and-Nvidia-GOP-update-No-requests-DIY.html#msg15730) or [AMD UEFI GOP MAKER](http://www.insanelymac.com/forum/topic/299614-asus-eah6450-video-bios-uefi-gop-upgrade-and-gop-uefi-binary-in-efi-for-many-ati-cards/page-1#entry2042163) could simplify things).
- EHCI/XHCI Hand-off enabled in BIOS *only* if boot stalls unless USB devices are disconnected.
- VT-x, Hyper Threading, Execute Disable Bit enabled in BIOS if present.
- While it may not be required, sometimes you have to disable Thunderbolt support, Intel SGX, and Intel Platform Trust in BIOS if present.
When debugging sleep issues you may want to (temporarily) disable Power Nap and automatic power off, which appear to sometimes cause wake to black screen or bootloop issues on older platforms. The particular issues may vary, but in general you should check ACPI tables first. Here is an example of a bug found in some [Z68 motherboards](http://www.insanelymac.com/forum/topic/329624-need-cmos-reset-after-sleep-only-after-login/#entry2534645). To turn Power Nap and the others off run the following commands in Terminal:
    - `sudo pmset autopoweroff 0`
    - `sudo pmset powernap 0`
    - `sudo pmset standby 0`

    Note, that these settings may reset at hardware change and in certain other circumstances. To view their current values run `pmset -g`.

Note, if you see a lot of Start/End lines in verbose mode you must ensure you do not have `bootercfg` variable stored in NVRAM. See [this post](https://www.insanelymac.com/forum/topic/331381-aptiomemoryfix/?page=6&tab=comments#comment-2572819) for details. If it still does not help you could use the following command in Terminal (either with System Integrity Protection disabled or from Recovery HD):
```
sudo nvram bootercfg="log=0 debug=0"
```

#### Features (compared to the original)
- Automatically finds the available memory region for boot.efi to use
- Implements KASLR support for systems where certain slides cannot be used
- Adds Safe Mode support on systems with used lower addresses
- Ensures no slide argument leak to the operating system
- Attempts to more properly handle the memory mappings
- Implements read-only and write-only RT variables beneficial to Lilu plugins
- Works around missing gUnicodeCollation and `PlatformLang` on several firmwares
- Fixes broken legacy hash services protocol (only MD5, SHA-1, SHA-256 are supported)
- Ensures that GetTime does not report unspecified timezone
- Supports boot.efi chainloading (e.g. via `sudo nvram recovery-boot-mode=open`)
- Implements new mapping code when waking from hibernation (still not stable enough)

### CleanNvram

Erases several NVRAM variables that may affect your boot.

## VerifyMsrE2

Certain firmwares fail to properly initialize 0xE2 MSR register (`MSR_BROADWELL_PKG_CST_CONFIG_CONTROL`) across all the cores. This application prints 0xE2 values of all the cores and reports 0xE2 status. The notable example of desyncrhonised 0xE2 MSR registers are several GIGABYTE UEFI firmwares for Intel 100 Series and Intel 200 Series chipsets.

CFG Lock option is available on most APTIO V firmwares, although it may be hidden from the GUI. If VerifyMsrE2 reports that your 0xE2 register is consistently locked, you may try to unlock this option directly.

1. Download [UEFITool](https://github.com/LongSoft/UEFITool/releases) and [IFR-Extractor](https://github.com/LongSoft/Universal-IFR-Extractor/releases).
2. Open your firmware image in UEFITool and find `CFG Lock` unicode string. If it is not present, your firmware does not support this and you should stop.
3. Extract the Setup.bin PE32 Image Section that UEFITool found via Extract Body.
4. Run IFR-Extractor on the extracted file (e.g. `./ifrextract Setup.bin Setup.txt`).
5. Find `CFG Lock, VarStoreInfo (VarOffset/VarName):` in `Setup.txt` and remember the offset right after it (e.g. `0x123`).
6. Download and run a [modified GRUB Shell](http://brains.by/posts/bootx64.7z), thx to [brainsucker](https://geektimes.com/post/258090/) for the binary. A more up to date version may be found in [grub-mod-setup_var](https://github.com/datasone/grub-mod-setup_var) repo.
7. Enter `setup_var 0x123 0x00` command, where `0x123` should be replaced by your actual offset and reboot.

**WARNING**: variable offsets are unique not only to each motherboard but even to its firmware version. Never ever try to use an offset without checking.

#### Credits
- [Apple](https://www.apple.com) for macOS
- [AMI](https://ami.com) for APTIO firmware
- [dmazar](https://sourceforge.net/u/dmazar/profile/), [apianti](https://sourceforge.net/u/apianti/), [CodeRush](https://github.com/NikolajSchlej), [night199uk](https://github.com/night199uk), [Slice](https://sourceforge.net/u/slice2009/) for developing the original OsxAptioFix driver
- [Download-Fritz](https://github.com/Download-Fritz) for implimenting some of this code and invaluable suggestions
- [vit9696](https://github.com/vit9696) for all the mess
- Big thanks go to all the contributors and researchers involved in AMI APTIO exploration!
- Additional thanks go to people on [AppleLife](http://applelife.ru) and [InsanelyMac](http://insanelymac.com) who helped to test things!

repository: cecekpawon/AptioFixPkg

repo_name: cecekpawon/AptioFixPkg


text:
DragHelper
----------

[![Build Status](https://api.travis-ci.org/ppamorim/DragHelper.svg?branch=master)](https://travis-ci.org/ppamorim/DragHelper)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DragHelper-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1673)
[![JitPack](https://img.shields.io/github/release/ppamorim/DragHelper.svg?label=JitPack%20Maven)](https://jitpack.io/#ppamorim/DragHelper)

This library should work on API 10 (but not tested [yet][1337]).

TODO
----

* Add outscreen offset
* Add auto smooth drag
* Add support of multi touch

Contributors
------------

* [Pedro Paulo de Amorim][3]

Thanks for [Pedro Vicente Gómez Sánchez][4]!

Developed By
------------

* Pedro Paulo de Amorim -<EMAIL_ADDRESS>

Libraries used on the sample project
------------------------------------

* [Butterknife][5]

License
-------

    Copyright 2015 Pedro Paulo de Amorim

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

[1]: http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/
[2]: http://blog.denevell.org/android-viewdraghelper-example-tutorial.html
[3]: https://github.com/ppamorim/
[4]: https://github.com/pedrovgs/
[5]: https://github.com/JakeWharton/butterknife
[6]: https://github.com/JakeWharton/NineOldAndroids/
[7]: https://github.com/square/picasso
[10]: ./art/dragger_new.png
[11]: https://github.com/ppamorim/Dragger/blob/master/art/app_sample_uncompressed.gif?raw=true
[12]: https://github.com/Falkirks
[13]: https://github.com/ksoichiro/Android-ObservableScrollView
[14]: https://github.com/facebook/rebound
[1337]: https://www.youtube.com/watch?v=eQyjP2O1S40

repository: ppamorim/DragHelper

repo_name: ppamorim/DragHelper


text:
---
title: 'How to change your Vuukle avatar'
date: 2017-05-01T22:12:03.284Z
category: 'FAQ'
tags:
  - profile
  - how to
  - avatar

path: '/how-to-change-vuukle-avatar/'
shortDescription: 'On your profile page, you can manage your avatar and personal information.'
---

If you are logging in using social networks like Google or Facebook we will automatically fetch your avatar.

![Comment widget socials](/img/how-to-change-vuukle-avatar-img_01.png)

To edit your Vuukle avatar you need to Log into your personal page http://vuukle.com/user/login

If you don’t have a password and don’t know where to get it, [Click here](https://vuukle.com/user/forgot-password)

On the Profile page go to "Profile Settings"

![Settings profile](/img/how-to-change-vuukle-avatar-img_2.png)

There you can set image link for the desired avatar.

![profile settings](/img/how-to-change-vuukle-avatar-img_3.png)

To remove your avatar leave the "Avatar URL" field empty.

repository: homearanya/testing-site

repo_name: homearanya/testing-site


text:
## Multipluck

[![Build Status](https://travis-ci.org/jzaleski/multipluck.svg)](https://travis-ci.org/jzaleski/multipluck)
[![Dependency Status](https://gemnasium.com/jzaleski/multipluck.png)](https://gemnasium.com/jzaleski/multipluck)

A Ruby gem for Rails that enhances the `pluck` function to select multiple columns

## Usage

```ruby
# Fetch all user ids and names using var-args
User.pluck(:id, :name)
# => [[1, "Bob"], [2, "Simone"], ...]

# Fetch all user ids and names using an `Array` (legacy)
User.pluck([:id, :name])
# => [[1, "Bob"], [2, "Simone"], ...]
```

## Contributing

1. Fork it ( http://github.com/jzaleski/multipluck/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 new Pull Request

repository: jzaleski/multipluck

gha_language: Ruby

repo_name: jzaleski/multipluck


text:
## Description
You have been paired up with a UI engineer to build out a racing-simulation web app.
The UI is done, but the back-end is non-existent. Your job is to build it!

This exercise will teach you how to manage cookies and sessions.

## Comprehension Task (Cookies)

Under the directory `exhibit-a` you will find the implementation of a server
that manipulates cookies. Explain what each line of code does.

Also fire up a browser and try hitting the different routes. See what happens
when you hit `peek` before `poke`.

```go
exhibit-a/server.go
-------------------

package main

import (
	"fmt"
	"net/http"
	"time"
)

func inOneYear() time.Time {
	return time.Now().AddDate(1, 0, 0)
}

func poke(w http.ResponseWriter, r *http.Request) {
	cookie := http.Cookie{Name: "username", Value: "gopher", Expires: inOneYear()}
	http.SetCookie(w, &cookie)
	fmt.Fprintf(w, "Just set cookie named 'username' set to 'gopher'")
}

func peek(w http.ResponseWriter, r *http.Request) {
	username, err := r.Cookie("username")
	if err != nil {
		fmt.Fprintf(w, "Could not find cookie named 'username'")
		return
	}
	fmt.Fprintf(w, "You have a cookie named 'username' set to '%s'", username)
}

func hide(w http.ResponseWriter, r *http.Request) {
	cookie := http.Cookie{Name: "username", MaxAge: -1}
	http.SetCookie(w, &cookie)
	fmt.Fprintf(w, "The cookie named 'username' should be gone!")
}

func main() {
	http.HandleFunc("/poke", poke)
	http.HandleFunc("/peek", peek)
	http.HandleFunc("/hide", hide)
	http.ListenAndServe(":8080", nil)
}
```

## Engineering Task

In the `templates` directory you will find two views `join.html` and `play.html`.
The `join` view asks the user to enter a _username_. Your application should store
this value in a cookie named `username` in the user's browser. The user should then
be directed to `play` where they can add vehicles to their simulation.

On the simulation page (i.e. `play.html`) the user can add different types of vehicles
to their racing simulation.

One of the challenges here is that your application will have to keep track of
the user's list of vehicles. Each time the user clicks `add`, the application must
add the vehicle to the list and then present that same list back to the view.

The template `play.html` assumes that the following data parameter `View` is presented:

```go
type Vehicle struct {
	Name  string
	Count int
}

type Vehicles struct {
	List []*Vehicle
}

type View struct {
	Username string
	Vehicles Vehicles
}
```

Your server should therefore make sure an instance of `View` is populated and then
executed by the template.

As in the previous exercise, this task does not require data to be persisted
after shutdown.

repository: crajcan/saigo

repo_name: crajcan/saigo


text:
# BTC Tracker

What this generally does is track a given crypto using the coinbase API and reports back each hour/day/week with the percentage increase/decrease. If the currency falls below a set percentage it will send a push notification to your phone.

## Installation

First we should start with setting up the mobile side of work. First download Push Notification API ~Push notification Simple~. Its a simple app that allows us to send a alert to our phone to get these updates on thresholds broken. If you want to use another form for alerting it can be easily edited within the sendNotif() function.

```Standard Installation
npm install
```

## Further Preparation

```javascript
let currencyCheck = `Your set currency i.e USD, AUD, and so on....`;
let popUpNotifKey = `Key from the app`;
```

Ensure you have set these fields before starting as it is a vital step. Your work should look similar to this =>

```javascript
let currencyCheck = `USD`;
let popUpNotifKey = `k-12345352fg`;
```

## Finale
Now that we are done all that is needed is to run `node .` to start the script.

##Support my projects!

If you appreciate the work i release as open source consider donating to me <3 It would be appreciated and motivate me to release more open source work!
BTC Address : `3Aii7THv6cqRTivdEJEWTgxrGAL6KgcZmH`

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: KazzyAPI/btc-tracker

repo_name: KazzyAPI/btc-tracker


text:
# [Learn Design 🖌](https://my.mindnode.com/UfyzJtYHJtarpQg5YVXVz7vwYjQvn5FQt4g3pq4C)

# [design 🌐](http://www.wikiwand.com/en/Design)

# basics

- if you think this can be improved in any way
	- please say 💙

- [1. design fundamentals 🖋](https://medium.freecodecamp.com/before-you-can-master-design-you-must-first-master-the-fundamentals-1981a2af1fda)

- [2. design of everyday things 📕](https://www.goodreads.com/book/show/840.The_Design_of_Everyday_Things)

# [graphic design 🌐](http://www.wikiwand.com/en/Graphic_design)

# [industrial design 🗺](https://my.mindnode.com/sG3PrxZ5rtpFSBEWewrbfGkSiaXduHMZxEWRRewi)

# [typography 🗺](https://my.mindnode.com/Dpe6usjyhYStxvMwwrGB2oste4DsnbGdQxL8h1eU)

# [typesetting 🗺](https://my.mindnode.com/LeQxPkzeiLpvf6XWZphKb5yc69qB7papcxy4XN1S)


text:
# Changelog

### 3.3.3
* Signs are now editable in the nether
* Anvils properly check for amethyst in second slot
* Copper rail color adjusted to match copper ingots more closely (Coranthes)
* Fixes to custom village structure processors (TelepathicGrunt)

### 3.3.2
* Change debug early loading to fix compatibility (e.g. Ferritecore)

### 3.3.1
* Disable extract enchantments when grindenchantments mod is present. svenhjol/Charm#630
* Disable grindable horse armor when grindenchantments mod is present.  svenhjol/Charm#630
* Don't translate advancements on client side. svenhjol/Charm#629
* Fix incorrect dungeon build name.  svenhjol/Charm#615
* Fix for bat bucket glowing effect duration, probably
* Tweaked server side translation of charm items and advancements

### 3.3.0
* Reworked module loader. **Some minor configuration keys have changed**
* Reworked recipe and advancement filtering
* Fix Potion of Hogsbane working intermittently
* Fix advancement titles not working on server side
* Fix cooking pot renderer tick speed and item icon problems
* Simplified Music Improvements feature
* Updated colored bundle graphics
* Changing enchantment color on an anvil has now had its XP cost increased from 0 to 1 level
* Added hunger and saturation icons to mixed stew tooltips
* Added recipe for snowballs from snow blocks
* Added ModMenu and Cloth Config support
* Added BundleSorting, use scrollwheel while hovering to rotate the order of contents
* Added preliminary API for non-Charm-based mods

### 3.2.3
* Restored missing planks tag. svenhjol/Charm#606
* Translation update provided by <https://github.com/SiongSng>.  svenhjol/Charm#607
* Add compatibility tags for copper and nether nuggets. svenhjol/Charm#608
* Minor reduction of spawn chance of bookcases and storage blocks in custom structures

### 3.2.2
* Fix door check crash.  svenhjol/Charm#603

### 3.2.1
* Fix broken anvil enchantments.  svenhjol/Charm#601
* Fix neighboring door not detecting powered state.  svenhjol/Charm#602
* Netherite bars, chains and lanterns are now explosion resistant

### 3.2.0
* Fix superflat structure registration error.  svenhjol/Charm#593
* Fix incorrect totem spawn height when mounted.  svenhjol/Charm#599
* Fix missing items when spawning multiple totems.  svenhjol/Charm#600
* Added Potion of Piercing Vision
* Added Open Double Doors

### 3.1.7
* Storage crates should not accept same item with different metadata.  svenhjol/Charm#597
* Fix broken anvil repair recipes.  svenhjol/Charm#587
* Fix lanterns effective tool.  svenhjol/Charm#595
* Fix EnderBundle item creative check sided crash
* Fix EnderBundle item tooltip overlapping with normal tooltip
* Fix Storage crate hitboxes
* Slow down client storage crate effects.  svenhjol/Charm#584
* Rework how mixed stew item tooltips render.  svenhjol/Charm#585
* Rework raid horn model.  svenhjol/Charm#572
* Convert a variant chest/bookshelf/barrel to a vanilla version on a crafting table

### 3.1.6
* Fix bookshelves not providing enchantment power on dedicated server. svenhjol/Charm#586
* Fix typo in snowy village builds causing log spam
* Removed DirtToPath feature as it's now in vanilla
* Mineshafts no longer spawn raw ore or emerald ore
* Mineshaft central rooms may now have moss blocks and moss carpet
* Magma and lava blocks now provide cooking pot heat

### 3.1.5
* Fix coral squid hitbox, renderer and model.  svenhjol/Charm#583 svenhjol/Charm#582

### 3.1.4
* Fix casks not accepting potions
* Casks now preserve their contents when broken (configurable)
* Casks with only water now return water bottles

### 3.1.3
* Fix server-side crash with invalid client class access.  svenhjol/Charm#580
* Casks no longer accept instant potions.  svenhjol/Charm#579
* Added feature Lava Bucket Destroys Items

### 3.1.2
* Fix sign material registry issue, causing crash with expanded-storage.  svenhjol/Charm#576
* Cooking pot now updates capacity after taking bowl.  svenhjol/Charm#577
* Kiln advancement now possible by clicking output slot.  svenhjol/Charm#578
* Updated wording of cooking pot advancements

### 3.1.1
* Added missing woodcutter recipes for stripped wood types
* Temporary fix for raid horn model textures in 3rd person

### 3.1.0 (beta)
* Change villager registration.  **Existing lumberjacks and beekeepers will lose their trades.**

### 3.0.7 (beta)
* Fix accessor and loot table issues when mixins are disabled
* Fix fuel and flammability for charm wood blocks and items
* Move accessor out of the way so it doesn't conflict at AoF startup
* Cooking pot no longer consumes water if creative mode
* Configurable cask and cooking pot capacity

### 3.0.6 (beta)
* Fix issue that prevented advancements from loading conditionally
* Restored oak bookshelf, craft a vanilla bookshelf using mixed wood planks
* Azalea and ebony wood and logs can now be stripped

### 3.0.5 (beta)
* Fixed issue with extra recipe config not being applied properly
* Equipping armor from hand no longer returns it back to your hand
* Axes are now optimal tool for variant barrels, bookcases, bookshelves, chests and trapped chests

### 3.0.4 (beta)
* Fix Totem of Preserving advancement using wrong trigger
* Fix cooking pot having wrong breaking particle colors
* Mineshafts now have hanging lanterns on chains in corridors
* Pickaxes are now optimal tool for cooking pots and all metal variant things
* Axes are now optimal tool for storage crates
* Added more wood blocks as fuel source. svenhjol/Charm#549
* New candidate method for handling items mined with Collection/Acquisition.  svenhjol/Charm#566

### 3.0.3 (beta)
* Fix infinite loop when reloading textures
* Axes are the optimal tool to break casks
* Bed parts no longer rotatable by the quadrant

### 3.0.2 (beta)
* Ladders should display in decorations tab.  svenhjol/Charm#521
* Rewrite the classloader for Windows again

### 3.0.1 (beta)
* Fix classloader failure in Windows

### 3.0.0 (beta)
* Internal release

repository: SonarBeserk/Charm

repo_name: SonarBeserk/Charm


text:
# FBOSS System Tests

This code runs system level testing for the FBOSS agent and associated tools.
Yes, it uses the python 'unittest' framework, but it tests the entire binary, not
just specific units.

# Testing Methodology

These tests assume that you have a hardware switch that you would like to test
and have some number of hosts physically, directly connected to it.  We then
run the TestServer daemon on each host to act as a programatic traffic generator
and run the switch through various permutations of:

* Configure switch
* Send some packets
* Verify the switch did the right thing

Some tests will require more hosts than others and the best tests are written
to work with a variable number of hosts.  Almost all meaningful tests require
at least two hosts connected to the switch.

# Running tests

Once the switch is running the FBOSS agent and the hosts are running the TestServer
binary, you simply need to populate a FBOSSTestBaseConfig() python object and
run `./system_tests.py --config your_config.py`.  For example, look at
./test_topologies/example_topology.py for an example static test config.

This same testing framework is also optionally customizable for
dynamic/programatic/automatic test configuration.  For example, you
can write something like this:

  #!/usr/bin/python
  import system_tests
  import testutils.test_topology

  if __name__ == '__main__':
     argparse = system_tests.generate_default_test_argparse()
     # add custom command-line arguments here
     # ...
     options = argparse.parse_args()
     options.test_topology = your_custom_topology_generator()
     system_tests.run_test(options)

# Test Results

Test results are logged to two places: the console and a per-test logfile
(by default "results/result-TESTNAME.log").  There are commandline
flags to control the verbosity of what is logged to each location
(--console_log_level, --file_log_level ) as well as the default output
directory (--log_dir).  The idea is that the console should serve as
an uncluttered, terse summary of what passed and failed, where the logs
should be a detailed, permanent log suitable for debugging.

# New Development

All new tests should :
* inherit from 'FbossBaseSystemTest' found in system_tests.py
  ** If you think you are smarter than the defaults, minimally inherit from 'unittest.TestCase'
* live in system_tests/tests/
* match '*test*.py' to be autodiscovered by the test discovery algorithm

# Facebook Internal
* If you work at Facebook, look in the ./facebook directory for additonal automation
magic.

# Longer term goals

All of the test logic is independent of physical hardware and the goal
is to run the same tests inside a software SDK simulator.  That work is in progress.

repository: dhtech/fboss

branch_name: refs/heads/dhtech

repo_name: dhtech/fboss


text:
# Gridy

[![Build Status](https://travis-ci.org/darosh/gridy.svg?branch=master)](https://travis-ci.org/darosh/gridy)
[![Maintainability](https://api.codeclimate.com/v1/badges/de4219ef64ecd6a39039/maintainability)](https://codeclimate.com/github/darosh/gridy/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/de4219ef64ecd6a39039/test_coverage)](https://codeclimate.com/github/darosh/gridy/test_coverage)

> TypeScript grid library for server and browser

![](https://darosh.github.io/gridy/examples/output/demo1.svg)![](https://darosh.github.io/gridy/examples/output/demo2.svg)![](https://darosh.github.io/gridy/examples/output/demo3.svg)

Based on [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/)  and [Amit’s Thoughts on Grids](http://www-cs-students.stanford.edu/~amitp/game-programming/grids/) articles.

Used in [gridy-games](https://github.com/darosh/gridy-games) and [gridy-games-lib](https://github.com/darosh/gridy-games-lib)

Current version has unstable API and unfinished implementation of features.

## Demo

Sandbox, examples and usage: [./examples/index.html](//darosh.github.io/gridy/examples/index.html)

## Documentation

[./doc/index.html](//darosh.github.io/gridy/doc/index.html)

### Grids

|[Rectangular](https://darosh.github.io/gridy/doc/classes/rectangulargrid.html)|[Brick](https://darosh.github.io/gridy/doc/classes/brickgrid.html)|[Hexagonal](https://darosh.github.io/gridy/doc/classes/hexagonalgrid.html)|[Triangular](https://darosh.github.io/gridy/doc/classes/triangulargrid.html)|
|-|-|-|-|
|![](https://darosh.github.io/gridy/examples/output/rectangular-grid.svg)|![](https://darosh.github.io/gridy/examples/output/brick-grid.svg)|![](https://darosh.github.io/gridy/examples/output/hexagonal-grid.svg)|![](https://darosh.github.io/gridy/examples/output/triangular-grid.svg)|

repository: darosh/gridys

gha_language: TypeScript

repo_name: darosh/gridys


text:
## Lets create CocoaPod
Open terminal and follow steps:

###### Update your system with latest ruby gems
`sudo gem update --system
`

###### Install CocoaPods
`sudo gem install cocoapods
`
###### Create Project for CocoaPod
**pod lib create** command helps you to create directory structure for pod

*For Example:*

` pod lib create AJLabelAppearance
`
and will ask following questions:

Before you can create a new library we need to setup your git credentials.

> 1) What is your name?

> 2) What is your email?

> 3)  What language do you want to use?? [ Swift / ObjC ]

> 4) Would you like to include a demo application with your library? [ Yes / No ]

> 5) Which testing frameworks will you use? [ Specta / Kiwi / None ]

> 6) Would you like to do view based testing? [ Yes / No ]

> 7) What is your class prefix?

###### Updating your pod spec
`pod lib lint`

command is used to validate pod spec file

*For Example:*

` pod lib lint AJLabelAppearance.podspec
`

It will display warnings and errors, so we have to update podspec file with main points are *summary, description, homepage, source*.

#### Note
```
For the GitHub link upload the project on GitHub by using command line tools or by using the GitHub desktop.

Create a repository / Commit and Push the project to GitHub.
```

*Validate again with command 'pod lib lint' and it will display output like:*

`
-> AJLabelAppearance (0.1.0)
`

###### Add code to project
Lets add some functionality to the pod:

1. Go to Pods folder there is file available with project i.e **ReplaceMe.m** and it will be an empty file.

2. Delete this file and add yours NSObject file (.h | .m ) and add your own code.

3. And access methods in actual Project, if any issues related with file not found from the pod then use **pod install** and close the project and open it again.

4. If you want to access this right now in any of other project, use

`pod 'AJLabelAppearance', :git => '{GITHUB_LINK}'
`

###### Its time to make your Pod Available
Push code to GitHub

Tagging

```
git tag 0.1.0
git push origin 0.1.0
```

This step indicates that you are marking this commit as a specific release of your pod. The name of the tag should match *s.version* in your **.podspec** file.

### Push to Cocoapods repository
`
pod trunk push {YOUR_POD_NAME
`

It will be used for push specs to cocoapod repo.

###### To register for Cocoapods
`pod trunk register {YOUR_EMAIL_ID AUTHOR_NAME} --description='{YOUR_DESC}'
`

1) It will ask to verify the session by clicking the verification email that has been sent to your mail.

2) Again try after registration

`pod trunk push {YOUR_.podspec} --verbose`

Now Pod is published and you can use it in your project.

### How to use this Pod

Step 1: `pod init`

Step 2: Add pod to Podfile e.g. `pod AJLabelAppearance` under your project target in Podfile.

Step 3: `pod install`

Cheers!!

repository: ajabble/LabelAppearance

repo_name: ajabble/LabelAppearance


text:
---
layout: post
title: It's Time to breath some fresh air
subtitle: ... time for a break inbetween so much ReactJS, Node and coding
tags: [coding, whistler, biking]
---

In the last 3 days I've spent possibly 8 hours in front of my laptop screen. This is generally not easy for someone active like me but it is now extremely understandable due to the rain outside during those days and also to the fact that I've been coding on Javascript and creating react components for my ski-blisters app. I don't really have a confirmed name for this app but for now sounds good to me. Feet blisters, who wouldn't agree that blisters are the physical representation of a well earned adventure in the mountains? Another cool name I visualized in my mind was "Nidip" as in "Knee Deep" refering to the cool phenomena of descending a mountain in multiple orgasmic turns of awe.
It's crazy how the mind can transform your spirit in a very passionate one when the ideas are clever enough to push the boundaries of your mind towards reality in the form of little incremental efforts towards that new reality that we, as incredible creatures, can visualize.

Here is a nice Screenshoot of what I have so far.
[image-ski-blisters](/../assets/img/ski-blisters.png){:class="img-responsive"}

I'm stoked to share and tell you guys more about this app I'm coding.

Time to go for a lap on my bike! need inspiration!

repository: santiagourrutiam/myblog

repo_name: santiagourrutiam/myblog


text:
# Game of Thrones API
This Full-Stack Application saves your favorite Game of Thrones Characters if you log in. Users are able to enter a character from the show and retreive the real actor that plays that character and the location where they're from in the show. I am using an API to fetch the actor names based on the character the user inputs all in the server side.

![Screenshot](gotLogin.png)

               [Click Here to go to the website!](https://game-of-thronesapi.herokuapp.com/)
## How Its Made
**Languages used:** Html, CSS, Javascript, Node.js , MongoDB , Express
# What I Learned
I learned how to use an API with the server and use user input data to fetch an object from that API. I learned new useful Modules to use in the future.
### My Other Projects
Check out some of my other work using the DOM!
* [Check out my Demo day project!](https://github.com/BrianMelaraDev/demoday)

repository: BrianMelaraDev/game-of-thrones-api

repo_name: BrianMelaraDev/game-of-thrones-api


text:
#  Instrument

[![Latest Version](https://img.shields.io/packagist/v/tuupola/instrument.svg?style=flat-square)](https://packagist.org/packages/tuupola/instrument)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/github/workflow/status/tuupola/instrument/Tests/master?style=flat-square)](https://github.com/tuupola/instrument/actions)
[![Coverage](https://img.shields.io/codecov/c/github/tuupola/instrument.svg?style=flat-square)](https://codecov.io/github/tuupola/instrument)

With Instrument you can monitor and measure your PHP application performance. It can collect and store metrics such as script execution time and memory usage or time spent in database.

![Instrument](https://appelsiini.net/img/instrument-headline-1400.png)

## Usage

Install using [composer](https://getcomposer.org/).

``` bash
$ composer require tuupola/instrument
```

You also must have access to [InfluxDB](https://influxdata.com/) database to store the data. After installing connect to your database and start sending metrics.

``` php
require __DIR__ . "/vendor/autoload.php";

$influxdb = InfluxDB\Client::fromDSN("http+influxdb://user:pass@localhost:8086/instrument");
$instrument = new Instrument\Instrument([
    "adapter" => new Instrument\Adapter\InfluxDB($influxdb),
    "transformer" => new Instrument\Transformer\InfluxDB
]);

$instrument->count("users", 100);

$instrument->send();
```

Optionally if you want to use the [gauge](https://github.com/tuupola/instrument#gauge) datatype you need the [shmop extension](http://php.net/manual/en/book.shmop.php) and  [klaussilveira/simple-shm](https://github.com/klaussilveira/SimpleSHM/) library.

```bash
composer require klaussilveira/simple-shm
```

There is also a [companion middleware](https://github.com/tuupola/instrument-middleware) which can automate basic instrumenting of application code if you are using PSR-7 based framework.

## Demo

Example [Grafana](http://grafana.org/) dashboard is included. To see Instrument in action start the Vagrant demo server and make some example requests.

``` bash
$ cd demo
$ vagrant up
$ while sleep 1; do curl http://<IP_ADDRESS>/random; done
```

The above commands start the server and inserts random Instrument data every second.
You can now access the provided [demo dashboard](http://<IP_ADDRESS>:3000/dashboard/db/instrument) (admin:admin) to see this happening live.

![Grafana](http://www.appelsiini.net/img/instrument-grafana-1400-2.png)

## Writing data

Documentation assumes you have working knowledge of [InfluxDB data structures](https://docs.influxdata.com/influxdb/v1.0/concepts/key_concepts/). Each measurement must have a `name`. Measurements should contain either one `value` or several value `fields` or both. Optionally measurement can have one or more `tags`.

For example to create a new `count` measurement with name `users` with one value of `100` use either of the following.

``` php
$instrument->count("users", 100);
$instrument->count("users")->set(100);
$instrument->send();
```

```
> SELECT * FROM users
name: users
---------
time                  value
1457067288109133121    100
```

To log several values and additionally tag the measurement.

``` php
$instrument
    ->count("users")
    ->set("total", 100)
    ->set("active", 27)
    ->tags(["host" => "localhost"]);

$instrument->send();
```

```
> SELECT * FROM users
name: users
---------
time                  total   active  host
1457067288109134122   100     27      localhost
```

The event datatype does not contain numerical measurements.

``` php
$instrument
    ->event("deploy", "New version deployed")
    ->tags(["host" => "localhost"]);

$instrument->send();
```

```
> SELECT * FROM events;
name: events
------------
time                  title    description           host
1464277178854200406   deploy   New version deployed  localhost
```

## Datatypes
### Count

Count is the simplest datatype. In addition to setting the value you can also increment and decrement it.

```php
$requests = $instrument->count("requests", 50); /* 50 */
$requests->increase(); /* 51 */
$requests->decrease(); /* 50 */
$requests->increase(5); /* 55 */

$instrument->send();
```

Or if you prefer fluent interfaces you can also do the following.

```php
$instrument
  ->count("users")
  ->set("active", 27) /* 27 */
  ->increase("active", 5) /* 32 */
  ->decrease("active", 2); /* 30 */

$instrument->send();
```

### Timing

With timing you can measure execution time in milliseconds. You can either pass the value yourself or use the provided helpers to measure code execution time.

```php
$instrument->timing("roundtrip")->set("firstbyte", 28);
$instrument->timing("roundtrip")->set("lastbyte", 40);

$instrument->timing("roundtrip")->set("processing", function () {
    /* Code to be measured */
});

$instrument->timing("roundtrip")->start("fetching");
/* Code to be measured */
$instrument->timing("roundtrip")->stop("fetching");

$instrument->send();
```

Since timing internally uses [symfony/stopwatch](https://github.com/symfony/stopwatch) you can get PHP memory usage as a bonus. It is not automatically included in the measurement data, but you can include it manually.

```php
$memory = $instrument->timing("roundtrip")->memory()
$instrument->timing("roundtrip")->set("memory", $memory);

$instrument->send();
```

### Gauge

Gauge is same as count. However it remembers the value between requests. Gauge values are zeroed when server restarts. You need the [shmop extension](http://php.net/manual/en/book.shmop.php) and [klaussilveira/simple-shm](https://github.com/klaussilveira/SimpleSHM/) to be able to use gauges.

```php
$errors = $instrument->gauge("errors");
$errors->increase("fatal"); /* 1 */
$errors->increase("critical"); /* 1 */

unset($errors);

$errors = $instrument->gauge("errors");
$errors->increase("fatal"); /* 2 */
$errors->increase("critical", 4); /* 5 */

$instrument->send();
```

Single value can be deleted from shared memory with `delete()` method. All values of the named gauge can be deleted at once with `clear()` method.

```php
$errors = $instrument->gauge("errors");
$errors->delete("fatal"); /* null */
$errors->clear();
```

### Event

Events can be used to display [annotations](http://docs.grafana.org/reference/annotations/) in your dashboard. By default they do not contain numerical measurements. Instead it contains `title` and `description` fields. These should contain a short name and longer description for the event.

``` php
$instrument
    ->event("deploy", "Version 0.9.0 deployed")
    ->tags(["host" => "localhost"]);

$instrument
    ->event("deploy", "Version 0.9.1 deployed")
    ->tags(["host" => "localhost"]);

$instrument->send();
```

```
> SELECT * FROM events;
name: events
------------
time                  title    description             host
1464277178854200406   deploy   Version 0.9.0 deployed  localhost
1464277178854201240   deploy   Version 0.9.1 deployed  localhost
```

If you are using Grafana you can use above data by using `SELECT * FROM events WHERE $timeFilter` as the annotation query. Also set the column mappings as shown below.

![Grafana](http://www.appelsiini.net/img/instrument-grafana-event-1400.png)

## Testing

You can run tests either manually...

``` bash
$ composer test
```

... or automatically on every code change. This requires [entr](http://entrproject.org/) to work.

``` bash
$ composer watch
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: tuupola/instrument

repo_name: tuupola/instrument