text:
linker
======

Create a hard link for files in a specified predefined location (invoked by just passing the file path as argument).

In _directory mode_ (can be invoked with --dir DIRECTORY as arguments) it will deduplicate files in .NET packages folder by creating hardlinks for duplicate (based on filename, size and md5) files.

[![Build status](https://ci.appveyor.com/api/projects/status/ggyyf34sneg9q2ci?svg=true)](https://ci.appveyor.com/project/SteveHansen/linker)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstevehansen%2Flinker.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstevehansen%2Flinker?ref=badge_shield)

**Samples**

    linker C:\Downloads\2014\Document.txt
Will create a hard link in **C:\\\_New_\Document.txt**.

    linker --dir C:\Code\
Will check all sub directories starting in **C:\Code\** and deduplicate all files in packages directories.

Version history
===============
- v1.1
 - Made format configurable
 - Added ability to create hard links for .NET packages folder
- v1.0
 - Initial version, creates a hard link to \_New_\FileName

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstevehansen%2Flinker.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstevehansen%2Flinker?ref=badge_large)

repository: stevehansen/linker

gha_language: C#

repo_name: stevehansen/linker


text:
# pcg.js

[![NPM](https://img.shields.io/npm/v/pcg.svg)](https://www.npmjs.com/package/pcg)
[![Travis CI](https://img.shields.io/travis/kripod/pcg.js/master.svg)](https://travis-ci.org/kripod/pcg.js)
[![Codecov](https://img.shields.io/codecov/c/github/kripod/pcg.js.svg)](https://codecov.io/gh/kripod/pcg.js)

A functional implementation of the [PCG family random number generators](), written in JavaScript.

[PCG family random number generators]: http://pcg-random.org

## Getting started

To achieve frictionless reproducibility of random output results, immutable objects are used throughout the project.

Firstly, create a random number engine:

```js
import { createPcg32 } from 'pcg';

const advancedOptions = {};
const initState = 42;
const initStreamId = 54;
const pcg = createPcg32(advancedOptions, initState, initStreamId);
```

After that, random outputs can be generated by calling appropriate functions as shown below:

```js
import { nextState, prevState, randomInt, randomList } from 'pcg';

const randomUint32 = randomInt(0, (2 ** 32) - 1);
let [value, nextPcg] = randomUint32(pcg);

const listLength = 6;
const listItemRng = randomUint32;
[value, nextPcg] = randomList(listLength, listItemRng, pcg);
```

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
<img src="https://github.com/adityaas26/Dr-Posture/blob/master/assets/img/good-posture.svg" alt="drawing" width="250"/>

# Dr-Posture

## Introduction
Dr. Posture detects body posture using your web camera and classifies your posture to be **correct** or **incorrect**.

It is based on the open source library, [posenet](https://github.com/tensorflow/tfjs-models/tree/master/posenet) to help detect body postures in real time.

It uses **ml5.js**, build on top of **tensorflow.js** to apply machine learning classification algorithms to classify the detected pose into **Correct** or **Incorrect** seating posture.

It uses **p5.js** to plot realtime keypoints in the body and remder it in HTML canvas element.

## License

[MIT](https://github.com/adityaas26/Dr-Posture/blob/master/LICENSE)

Copyright (c) 2019-present, The MAD Corp.

repository: BetaPundit/Dr-Posture

repo_name: BetaPundit/Dr-Posture


text:
# Scope

![Weave Scope Screenshot](http://weave.works/scope/assets/img/feature-1.png)

## Overview

Weave Scope automatically generates a map of your containers, enabling you to
intuitively understand, monitor, and control your applications.

Please note that the code, and especially the building and running story, is in
a **pre-alpha** state. Please take a look, but don't be surprised if you hit
bugs or missing pieces.

## Building

### In-place

To build the binaries in-place,

```
make build
```

Note that this doesn't build or include the latest version of the user
interface. The UI is decoupled, living in `client` and following a node/gulp
workflow. To build that and include it in the application binary,

```
make client
make static
make build
```

Or, as a shortcut,

```
make dist
```

### Docker container

To build a Docker container,

```
make docker
```

## Running

### Manually

1. Launch a probe process on each physical host you intend to monitor, via `sudo probe`
2. Launch an app process, and configure it to talk to probes, via `app -probes="probe-host-1:4030,probe-host-2:4030"`.
3. Load the user interface, via **http://app-host:4040**

### As a Docker container

TODO


text:
# Selection of Graph Database software for SKOS taxonomy management

* Status: accepted
* Deciders: [@garyttierney](https://github.com/garyttierney), [@danielgrant](https://github.com/danielgrant), [@robmarch2](https://github.com/robmarch2)
* Date: 2019-05-23

Technical Story: DTM-34

## Context and Problem Statement

Persistence and retrieval of SKOS taxonomies require a storage layer that supports storing rich, free-form linked data.
Such a data model could be represented in a traditional RDBMS, however, doing so would require a specialized serialization and deserialization implementation whereas graph databases can typically store RDF natively.

## Decision Drivers <!-- optional -->

* High availability/Fault tolerance
* Learning curve
* Maintenance overhead
* Vendor lock-in

## Considered Options

* Apache TinkerPop
* Apache Jena Fuseki
* PostgreSQL

## Decision Outcome

Chosen option: Apache Jena with underlying PostgreSQL persistence store and a custom persistence layer, because it provides a highly available database persistence that is widely available as a managed service. We opted against using Apache Jena's SDB to achieve this as it has been in a state of "maintenance only" since June 2013.

### Positive Consequences

* PostgreSQL can be clustered, making it highly available
* PostgreSQL is broadly available as a managed service
* We can utilise the same PostgreSQL database for storing additional data (e.g. users, roles, etc)

### Negative Consequences

* We have to design our own schema and code for interacting with the PostgreSQL database

## Pros and Cons of the Options

### Apache TinkerPop

TinkerPop is less of a graph database implementation and more of an abstraction layer over various graph database backends.
It presents a frontend consisting of a query language named "Gremlin", that uses a method chaining style of syntax to build graph queries.

Some of the backends TinkerPop supports are listed below:

* Azure CosmosDB
* Amazon Neptune
* Neo4J

#### Query example (TinkerPop: Gremlin)

```gremlin
g.V().has('id', 'http://example.com/skos-concept').out('skos:broaderConcept').values('skos:preferredLabel')
```

#### Persistence example (TinkerPop: Gremlin)

```gremlin
g.addV('skos:concept').property('id', 'http://example.com/skos-concept').property('skos:preferredLabel', 'value')
```

[Query language reference documentation](http://tinkerpop.apache.org/docs/current/reference)

* Good, because it supports various graph database backends.
* Good, because it relies on a standardized query language, making the persistence implementation almost graph database agnostic.
* Bad, because the query language is not designed for simple CRUD operations, and instead for determining relationships across graph edges.
* Bad, because it's an extremely heavyweight generalized solution for data fitting a very specific model.
* Bad, because there is an extremely high learning curve associated with the Gremlin query language compared to something like SPARQL or SQL.
* Bad, because it's built for Groovy first and the JVM second.

### Apache Jena Fuseki

Fuseki is a hosted backend for the Apache Jena SPARQL engine.
It allows storage of RDF data by first serializing it to turtles and querying it back using the Jena API, or by executing SPARQL queries.

#### Query example (Jena: SPARQL)

```sparql
PREFIX skos: <http://www.w3.org/2004/02/skos/core/>
SELECT ?broader
{
  <http://example.com/skos-concept> skos:broaderConcept ?broader
}
```

#### Persistence example (Jena: API)

```java
RDFConnectionFactory connection = /* ... */;
connection.load("<http://example.com/skos-concept> <http://www.w3.org/2004/02/skos/core#broaderConcept> <http://example.com/skos-broader-concept>");
```

* Good, because it can store SKOS in its native representation (RDF)
* Good, because it has an extensive Java API available.
* Good, because the query and persistence options are intuitive and easy to use.
* Bad, because it is the only maintained open source SPARQL server available.
* Bad, because it is self-hosted and would require maintenance (as well as deployment of a new unfamiliar technology).

repository: digirati-co-uk/taxonomy-manager

gha_language: Java

repo_name: digirati-co-uk/taxonomy-manager


text:
### Flag

![](https://upload.wikimedia.org/wikipedia/commons/9/9b/Flag_of_Nepal.svg)

---

![](https://upload.wikimedia.org/wikipedia/commons/d/d4/Nepal_%28orthographic_projection%29.svg)

---

## Nepal

-   Capital: Kathmandu
-   29 million people
-   Mostly Hindu with 325 unreached people groups
-   Fast growing church despite new restrictions

---

![](https://f000.backblazeb2.com/file/ccw-prayer/nepal.mp4)

repository: ccwaterkloof/prayer

repo_name: ccwaterkloof/prayer


text:
**Ansible Modules for Dell EMC PowerFlex**
=========================================
### Release Notes 1.0

>   © 2021 Dell Inc. or its subsidiaries. All rights reserved. Dell
>   EMC, and other trademarks are trademarks of Dell Inc. or its
>   subsidiaries. Other trademarks may be trademarks of their respective
>   owners.

Contents
-------
These release notes contain supplemental information about Ansible
Modules for Dell EMC PowerFlex.

-   Product Description
-   New Features
-   Known issues
-   Limitations
-   Distribution
-   Documentation

Product Description
-------------------

The Ansible Modules for Dell EMC PowerFlex are used for managing volumes,
storage pools, SDCs, and snapshots for PowerFlex storage devices.
The modules use playbooks to list, show, create, delete, and modify
each of the entities.

The Ansible Modules for Dell EMC PowerFlex supports the following
features:

-   Create volumes, storage pools and snapshots.
-   Modify volumes, storage pools, SDCs and snapshots.
-   Delete volumes and snapshots.
-   Get details of a volumes, snapshots, SDCs and storage pool.
-   Get entities of the PowerFlex storage device.

New Features
---------------------------

The Ansible Modules for Dell EMC PowerFlex release 1.0 supports the
following features:

- The following are the features of the gatherfacts module:
   - Get the API details of a PowerFlex storage device.
   - Get the list of SDCs.
   - Get the list of SDSs.
   - Get the list of volumes.
   - Get the list of snapshots.
   - Get the list of storage pools.
   - Get list of protection domains.
   - Get list of snapshot policies.

- The following are the features of the volume module:
   - Get the details of a volume.
   - Create a volume.
   - Modify details of a volume.
   - Delete a volume.

- The following are the features of the snapshot module:
   - Get the details of a snapshot.
   - Create a snapshot.
   - Modify details of a snapshot.
   - Delete a snapshot.

- The following are the features of the storage pools module:
   - Get the details of a storage pool.
   - Create a storage pool.
   - Modify details of a storage pool.

- The following are the features of the SDCs module:
   - Get the details of the SDC.
   - Rename a SDC.

Known issues
------------
There are no known issues.

Limitations
-----------
There are no known limitations.

Distribution
------------
The software package is available for download from the [Ansible Modules
for PowerFlex GitHub](https://github.com/dell/ansible-powerflex) page.

Documentation
-------------
The documentation is available on [Ansible Modules for PowerFlex GitHub](https://github.com/dell/ansible-powerflex)
page. It includes the following:

   - README
   - Release Notes (this document)
   - Product Guide

repository: strikingraghu/ansible-powerflex

path: /docs/Release Notes.md

branch_name: refs/heads/main

filename: Release Notes.md

repo_name: strikingraghu/ansible-powerflex


text:
# MongoPopulator

MongoPopulator populates a MongoDB database with placeholder data. It is based on [Populator](https://github.com/ryanb/populator) by Ryan Bates, but it works with the [official Mongo gem](http://api.mongodb.org/ruby/current/file.TUTORIAL.html) in standalone scripts, and therefore is not tied to any particular framework.

## Installation

    gem install mongo_populator

## Usage

This gem adds a `#populate` method to Mongo's `Mongo::Collection` class. Pass the number of documents you want to create along with a block. In the block you can set the field values for each document.

    require 'rubygems'
    require 'mongo_populator'

    db = Mongo::Connection.new("localhost", 27017).db("test-db")

    article_collection = db.collection('articles')
    article_collection.populate(100) do |article|
      article.title       = MongoPopulator.words(4..6).capitalize
      article.slug        = article.title.downcase.tr(' ','-')
      article.published   = true
      article.created_at  = (Time.now - 604800)..Time.now
      article.body        = MongoPopulator.paragraphs(5..7)
    end

### Relationships

Unlike the original Populator, we are letting MongoDB set each ObjectId. This makes setting up relationships only slightly more laborious.

    article_collection = db.collection('articles')
    article_collection.populate(100) do |article|
      ...
    end

    # create array of article _ids to select from
    article_ids = db.collection('article').distinct('_id')

    comment_collection = db.collection('comments')
    comment_collection.populate(1000) do |comment|
      ...
      comment.article = article_ids
    end

That will create an average of 10 related comments for each article.

### Shuffle through set of values

Passing a range or array of values will randomly select one.

    ...
    californian.zone_preference = ['northern', 'southern'] # you must choose one.
    ...

### Fake values

If you need to generate fake data, there are a few methods to do this.

    MongoPopulator.words(3) # generates 3 random words separated by spaces
    MongoPopulator.words(10..20) # generates between 10 and 20 random words
    MongoPopulator.sentences(5) # generates 5 sentences
    MongoPopulator.paragraphs(3) # generates 3 paragraphs

For fancier data generation, try the [Faker gem](http://faker.rubyforge.org).

### Mongo-specific values

Setting an attribute with the `#skip` method prevents that attribute being set. This is useful when you only want a field to appear in *some* documents

    ...
    address.state = MongoPopulator.skip if address.country != "United States"
    ...

So, to support conditional setting of an attribute, pass it an array with one or more MongoPopulator.skip as elements.

    ...
    user.creds = ['M.D.', 'J.D.', 'N.D.', MongoPopulator.skip, MongoPopulator.skip]
    ...

~40% of users will not have the "cred" field.

If you actually want a field in your document to be set to NULL, pass `nil` as the value.

   ...
   user.style = nil
   ...

To persist arrays in your documents, use either `#items` to save a certain number of items randomly selected from a set, or `#array` to save a specific array.

    MongoPopulator.items(1..5, %w(ape bear cat dog elephant firefox)) # populates array with provided terms
    MongoPopulator.items(10..20) # populates array with random words
    MongoPopulator.array('red', 'green', 'blue') # saves `['red', 'green', 'blue']` exactly

Note that you cannot pass `#skip` in `#items`, `#dictionary`, or `#array`. Doing so will result in an error.

    user.fruit = MongoPopulator.items(3, ['apple', 'banana', 'kiwi', MongoPopulator.skip]) #=> Error

To persist a static dictionary to your document, use `#dictionary`.

    MongoPopulator.dictionary(:name => "Mongo", :type => "db")

#### Embedded Documents

To embed documents, use `#embed`. It takes a dictionary template, which accepts any of the Populator constructs. See note below in "Known Issues."

    @collection.populate(1) do |parent|
      parent.name = "Bunny Sr."
      parent.kids = MongoPopulator.embed(10..20, {:name => ["Bunny Jr.","Fluffy","Other Fluffy"], :age => (1..20), :tattoos => ["butterfly", "banjo frog", MongoPopulator.skip]})
    end

The above code generates a record with 10 to 20 embedded documents, roughly one-third of which have a 'tattoo' field.

## Known issues

* Data generation methods like `#words` or Faker methods will not return varying data within a set when used in embedded document templates. Instead a random value will be picked the first time, and used for the entire set.

## Development

Problems or questions? Add an [issue on GitHub](https://github.com/bak/mongo_populator/issues) or fork the project and send a pull request.

## Special Thanks

MongoPopulator is based on the work of Ryan Bates [via Populator](https://github.com/ryanb/populator/). Thanks, Ryan.


text:
# ITProjektManagement
SS2016, PAP

To launch this program you will first need to install:
 1) Python version 3.4.7 or higher (https://www.python.org/)
 2) Some python IDE is also recommended, for example Pycharm (https://www.jetbrains.com/pycharm/)
 3) plotly library (https://plot.ly/python/)
 4) some other missing libraries if there are any

Adjust the server settings and then just execute the program

The program reads all the data from the csv files in the /resources/csv folder and structures it and records everything
in the objects. Then the recorded users are shown in the console. Then the calculations are made and the graphs are
generated and saved in the /resources/img folder. Then the html emails are generated and sent for each user in the
customer_data table.

repository: StanislavLohtin/ITProjektManagement

repo_name: StanislavLohtin/ITProjektManagement


text:
## Godot Action Binding

To test, simply download and run in Godot

![demo gif](demo.gif)

### About

This repo makes input/control/key/action rebinding a simple drag+drop into Godot C# projects (with some optional configuration).

### Features

- Rebind actions to a new inputs
- Mappings are saved to custom file automatically, no need to clutter your save files!
- Reset Mappings to their defaults with a button click
- Display the multiple default inputs on mapping button

#### To Do

- Enable rebinding to multiple inputs
- Improve display/wording of gamepad inputs

### How to use

1. Drag the ActionBinding folder into your project
2. Place the ActionBindingMenu.tscn scene into one of your scenes
3. Add your actions+bindings to your project setting's InputMap (through the Godot Editor)
4. In ActionBindingMenu.cs, edit the ReassignableActions dictionary to only include the actions you want the user to be able to re-assign. Edit the save file path too if you like
5. IMPORTANT: In ControlRebindingInput.cs, edit the RES_PATH to match where you dropped ControlRebindingInput.tscn into your project
6. IMPORTANT: This repo relies on the Newtonsoft.Json nuget package. If you are missing Newtonsoft.Json in your Godot project, install it via `dotnet add package Newtonsoft.Json --version 12.0.3`
7. Run!
8. Update `EventSimpleText(InputEvent e)` in ActionBindingMenu.cs to change the control's text output

#### License

MIT

repository: LuizAntonioPereira/GodotActionBinding

repo_name: LuizAntonioPereira/GodotActionBinding


text:
# SDG.Unturned.Player

> This page is incomplete, please help finish it by contributing.

The integration of all game features into the player.

```csharp
public class Player : MonoBehaviour
```

### Universal Properties:

Name | Description
------------ | -------------
[animator](scripting/sdg/unturned/player/animator) | Gets the PlayerAnimator object attached to this player
[clothing] | Gets the PlayerClothing object attached to this player
[inventory] | Gets the PlayerInventory object attached to this player
[equipment] | Gets the PlayerEquipment object attached to this player
[life](scripting/sdg/unturned/player/life) | Gets the life object attached to this player
[crafting] | Gets the PlayerCrafting object attached to this player
[skills] | Gets the PlayerSkills object attached to this player
[movement] | Gets the PlayerMovement object attached to this player
[look] | Gets the PlayerLook object attached to this player
[input] | Gets the PlayerInput object attached to this player
[voice] | Gets the PlayerVoice object attached to this player
[iteract] | Gets the PlayerInteract object attached to this player

repository: Dolphinchik/UnturnedDocs

gha_license_id: MIT

repo_name: Dolphinchik/UnturnedDocs


text:
---
layout: default
---

# 1998-09-29 - No Subject

## Header Data

From: "Jean-Francois Avon"<EMAIL_ADDRESS>To: "Sporting Shooters Association of Australia"<EMAIL_ADDRESS>Message Hash: 67e43f489a340073a1417f381fa66c18d284c72ed4dc24385fd6ca4f41835caa

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1998-09-29 09:29:46 UTC

Raw Date: Tue, 29 Sep 1998 17:29:46 +0800

## Raw message

```
{% raw  %}From: "Jean-Francois Avon"<EMAIL_ADDRESS>Date: Tue, 29 Sep 1998 17:29:46 +0800
To: "Sporting Shooters Association of Australia"<EMAIL_ADDRESS>Subject: No Subject
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Excerpt from the Canadian Firearms Digest, V2 #612

================ begin forwarded opinion ===============
Date: Mon, 28 Sep 1998 13:40:01 -0600
From<EMAIL_ADDRESS>Subject: RCMP now have .50 cal. BMG's

I have just learned from a highly reliable confidential source
that in addition to the .50 cal  McMillian sniper rifles and
the untalked about Barrett Light .50's, the RCMP  have now added
to  their arsenal a number of .50 cal. Browning Machine Guns.

Staff from the RCMP are headed to Belgium to be trained in
the armoring of these military heavy  machine guns. Machine
guns may at some point be used against the Canadian public,
possibly to  quell a native disturbance or other civil unrest.
If we were attacked by outside forces the military  would be
the pressed into service, as this is not the role of the RCMP.

This leads one to ask what use the RCMP, who are a police force
not an army in occupation,  would have for such heavy armament
...... or is it possible that I have it wrong, possibly they
are  now an army in occupation. Is it possible that the RCMP
are now the political policing arm of the  Government.

The lethality of this weapon makes pepper spray look like a
Sunday shower. Maybe this is the  next weapon demonstrators
will be facing at the orders of the PM's office.
================ end forwarded opinion ================

Ciao all.

Definition:  FASCISM: n.:  a political and economic movement, strongly nationalistic, magnifying the rights of the state as opposed to those of the individual, in which industry, though remaining largely under private ownership, and all administrative
political units, are controlled by a strong central government.
        -------------------------------------------------
"One of the ordinary modes by which tyrants accomplish their purpose, without resistance, is by disarming the people and making it an offense to keep arms".  - Joseph Story, U.S. Supreme Court Justice.
        -------------------------------------------------
the German gun control laws were enacted by the "liberal" Weimar Republic government that preceded Hitler, and were a strong aid to his coming to power -- because they disarmed Hitler's opponents, and Hitler's adherents ignored them -- as criminals have always ignored gun control laws.

Disarming the public is a frequent first step toward dictatorships and genocides.  Once the disarming is complete, the public is helpless against those who have the guns.        -------------------------------------------------

PGP keys: http://bs.mit.edu:8001/pks-toplev.html
PGP ID:C58ADD0D:529645E8205A8A5E F87CC86FAEFEF891
PGP ID:5B51964D:152ACCBCD4A481B0<PHONE_NUMBER>37822C

{% endraw %}
```

## Thread

+ Return to [September 1998](/archive/1998/09)

+ Return to "["Jean-Francois Avon" <jf_avon@citenet.net>](/authors/jeanfrancois_avon_jf_avon_at_citenet_net_)"

+ 1998-09-29 (Tue, 29 Sep 1998 17:29:46 +0800) - No Subject - _"Jean-Francois Avon"<EMAIL_ADDRESS>


text:
---
title: "Openstack Kolla"
date: 2019-02-03T12:31:27+11:00
---

I recently posted about running Openstack at home, and how I used the RDO project. Well things changed.

<!--more-->
I color-coded my networks to make it easier to look at, and I added a forth node, this one has 16GB RAM in it and is slightly larger running an i7 5500U processor. Seems to be fine.

I also discovered the `Kolla-Ansible` project, and wow. It is much nicer to use and has way more configuration options than packstack.

I started with re-installing each of my nodes with CentOS 7, and configuring their networks. Making sure to have a `bond0` and `bond1` on each node, this makes thing easier later on where `bond0` will be the management/tunnel/storage etc. and `bond1` will be for external networks

# Setup
## Configuration
Using [this](https://docs.openstack.org/kolla-ansible/rocky/user/quickstart.html) guide to get the nodes ready, the next steps involved configuring the `globals.yml` file.
```
yum install epel-release
yum install python-pip
pip install -U pip
yum install python-devel libffi-devel gcc openssl-devel libselinux-python
yum install ansible
pip install kolla-ansible
cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
cp /usr/share/kolla-ansible/ansible/inventory/* .
```
Once done, I created a new inventory file based off the multinode deployment `cp multinode stampyhome` only modifying these hosts
```
[control]
control1.stampyhome.com
[network]
control1.stampyhome.com
[inner-compute]
[external-compute]
node1.stampyhome.com
node2.stampyhome.com
node3.stampyhome.com
node4.stampyhome.com
[compute:children]
inner-compute
external-compute
[monitoring]
control1.stampyhome.com
[storage]
control1.stampyhome.com
```

Make the neccessary adjustments as below to suit my environment
```
---
openstack_service_workers: 2
barbican_worker_image: shreddedbacon/barbican-worker
barbican_keystone_listener_image: shreddedbacon/barbican-keystone-listener
barbican_api_image: shreddedbacon/barbican-api
kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "rocky"
kolla_internal_vip_address: "<external_vip>"
network_interface: "bond0"
neutron_external_interface: "bond1"
neutron_tenant_network_types: "vxlan,vlan"
enable_barbican: "yes"
enable_chrony: "yes"
enable_cinder: "yes"
enable_cinder_backup: "yes"
enable_cinder_backend_nfs: "yes"
enable_fluentd: "yes"
enable_haproxy: "yes"
enable_heat: "no"
enable_horizon: "yes"
enable_horizon_neutron_lbaas: "no"
enable_horizon_octavia: "{{ enable_octavia | bool }}"
enable_neutron_dvr: "yes"
enable_neutron_lbaas: "yes"
enable_nova_ssh: "yes"
enable_octavia: "yes"
glance_enable_rolling_upgrade: "no"
barbican_crypto_plugin: "simple_crypto"
barbican_library_path: "/usr/lib/libCryptoki2_64.so"
ironic_dnsmasq_dhcp_range:
tempest_image_id:
tempest_flavor_ref_id:
tempest_public_network_id:
tempest_floating_network_name:
#octavia_loadbalancer_topology: "ACTIVE_STANDBY"
#octavia_amp_boot_network_list: <octavia_external_network>
#octavia_amp_secgroup_list: <octavia_security_group>
#octavia_amp_flavor_id: octavia
```

As you can see, I am using custom images for barbican, this is because the ones that are in the repository are broken. `python-pyasn` is not new enough. Some dockerfiles, and new builds solves this.
```
#cat barbican-api/Dockerfile
FROM kolla/centos-binary-barbican-api:rocky
USER root
COPY python2-pyasn1-0.3.2-2.fc27.noarch.rpm .
RUN rpm -U python2-pyasn1-0.3.2-2.fc27.noarch.rpm
USER barbican
```
```
#cat barbican-worker/Dockerfile
FROM kolla/centos-binary-barbican-worker:rocky
USER root
COPY python2-pyasn1-0.3.2-2.fc27.noarch.rpm .
RUN rpm -U python2-pyasn1-0.3.2-2.fc27.noarch.rpm
USER barbican
```
```
#cat barbican-keystone-listener/Dockerfile
FROM kolla/centos-binary-barbican-keystone-listener:rocky
USER root
COPY python2-pyasn1-0.3.2-2.fc27.noarch.rpm .
RUN rpm -U python2-pyasn1-0.3.2-2.fc27.noarch.rpm
USER barbican
```
```
docker build -t shreddedbacon/barbican-keystone-listener:rocky barbican-keystone-listener/.
docker build -t shreddedbacon/barbican-worker:rocky barbican-worker/.
docker build -t shreddedbacon/barbican-api:rocky barbican-api/.
```

The sections for Octavia at the bottom need to be commented out on the initial deployment as the items used by them aren't available on an initial deployment.

We also need to generate a bunch of passwords for our deployment
```
kolla-genpwd
```
This will create `/etc/kolla/passwords.yml`, don't lose it!

## Cinder
I am using NFS as my cinder backend, configuration needs to be made to allow this to work.
```
cat < etc/kolla/config/nfs_shares >> EOF
<nfs_server>:/volume1/openstack
EOF
```

## Networking
Since I am using VLAN provider networks, I need to inform neutron about this
```
cat /etc/kolla/config/neutron/ml2_conf.ini
[ml2_type_vlan]
network_vlan_ranges = physnet1:100:500
```

## Octavia
Since we are using Octavia, we also need certificates for the amphora to use. I found [this](https://www.lijiawang.org/posts/kolla-octavia.html) guide really useful for this section

Clone the octavia repository, modify the certifate generation script with the octavia ca password, generate the certificates and put them into the configuration directory. If you don't do this step, prechecks and deploy will fail.
```
git clone https://review.openstack.org/p/openstack/octavia
cd octavia
grep octavia_ca /etc/kolla/passwords.yml
#octavia_ca_password: asdgsdgsdg8sdgsdg88asdg8sadg
sed -i 's/foobar/asdgsdgsdg8sdgsdg88asdg8sadg/g' bin/create_certificates.sh
./bin/create_certificates.sh cert $(pwd)/etc/certificates/openssl.cnf
mkdir -p /etc/kolla/config/octavia
cp cert/{private/cakey.pem,ca_01.pem,client.pem} /etc/kolla/config/octavia/
ls -al /etc/kolla/config/octavia/
```
# Deploy
Once that is all done, run `bootstrap-servers`, `prechecks` and then finaly `deploy`
```
kolla-ansible -i stampyhome bootstrap-servers
kolla-ansible -i stampyhome prechecks
kolla-ansible -i stampyhome deploy
```
After some time, you will have a running Openstack.

## Post Deploy
After deploying, there are some tasks that need to be done

```
pip install python-openstackclient python-glanceclient \
	python-neutronclient python-octaviaclient python-barbicanclient
## Create the admin envars and source them
kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh
```
### Octavia
Octavia will not be working after the first deploy, as we need some things for it to work
```
openstack flavor create --id octavia --disk 20 \
	--private --ram 512 --vcpus 1 octavia
openstack --os-username octavia \
	--os-password <octavia_keystone_password> \
	keypair create --public-key /root/.ssh/id_rsa.pub octavia_ssh_key
openstack security group create \
	--description 'used by Octavia amphora instance' octavia
openstack security group rule create \
	--protocol icmp 188b91d4-8bc9-4a31-83c4-c37a2ec400ff
openstack security group rule create \
	--protocol tcp --dst-port 5555 \
	--egress 188b91d4-8bc9-4a31-83c4-c37a2ec400ff
openstack security group rule create \
	--protocol tcp --dst-port 9443 \
	--ingress 188b91d4-8bc9-4a31-83c4-c37a2ec400ff
```
### Amphora Image
Some additional things are required to get amphora to build

```
pip install diskimage-builder
cd octavia
./diskimage-create/diskimage-create.sh -i centos -s 5
openstack image create --container-format bare \
	--disk-format qcow2 \
	--private --file /root/octavia/amphora-x64-haproxy.qcow2 \
	--tag amphora amphora
```
### Octavia External Network
Since I am using VLAN provider networks, I picked one that is designed for the openstack network in general
```
openstack network create --external \
	--provider-physical-network physnet1 \
	--provider-segment 400 --provider-network-type vlan extnet4
openstack subnet create --no-dhcp \
	--allocation-pool start=<IP_ADDRESS>,end=<IP_ADDRESS> \
	--network extnet4 --subnet-range <IP_ADDRESS>/24 \
	--gateway <IP_ADDRESS> extnet4-subnet
```
With all of these, I need to take the network ID, and the security group ID and populate the `octavia_amp_boot_network_list` and `octavia_amp_secgroup_list`, uncomment the 4 octavia items and run a deploy for just Octavia.
```
kolla-ansible -i stampyhome deploy --tags octavia
```
Again, after some time, octavia will be done and you can deploy load balancers.

# Issues
## Octavia / Barbican
I can't create `TERMINATED_HTTPS` load balancers from the dashboard, either this is still an in-development feature, or its genuinely broken.
I was sort of able to get one to work via the CLI tools, but this was cumbersome as it required using secrets, acls and secret containers and I gave up trying for a bit.

I'll give HTTPS pass through a go at some stage though.

repository: shreddedbacon/blog

repo_name: shreddedbacon/blog


text:
## Notes from IRC

```
12:08 E<edw> vyzo: Right now my biggest Gerbil itch is the absence of a comprehensive index of all names. Such a think could form the basis of something like the Clojure Grimoire, but even if it were a simple list of module-qualified names and an indication of whether something's a value/macro/proc, that would be a good start.
12:09 E<edw> vyzo: Such a thing should be generated from a single source of truth i.e. the source. If you could give me some pointers on how I could do that, I'd be willing to write a tool to do it.
12:32 V<vyzo> yeah, that would be awesome and indeed very interesting
12:32 V<vyzo> you can use the expander api
12:32 V<vyzo> look at import-module in gerbil/expander/module.ss
12:32 V<vyzo> you basically import the module you want
12:32 V<vyzo> and you can get the export set
12:33 V<vyzo> module-context-export gives you the export set
12:33 V<vyzo> and you can list those names for the module
12:33 V<vyzo> you can also look at the export binding
12:33 V<vyzo> to see whether it is a macro or a runtime symbol
12:34 V<vyzo> if you want to see it as a procedure, you can eval and possibly disassemble it
12:34 V<vyzo> for example code, look at src/misc/scripts/docsyms.ss
12:35 V<vyzo> edw: ^^^
12:35 V<vyzo> https://github.com/vyzo/gerbil/blob/master/src/misc/scripts/docsyms.ss
12:35 V<vyzo> given a module, it lists the exported names
12:36 V<vyzo> that could be a useful starting point
12:36 E<edw> vyzo: Thanks. Is there a way to get a list of all currently-available modules?
12:36 V<vyzo> imported or the ones sitting in the file system?
12:36 V<vyzo> you can get the library path
12:37 V<vyzo> and you can iterate the directories listed there
12:37 V<vyzo> try (expander-load-path)
12:37 V<vyzo> this gives you the list of paths that are the roots
12:38 V<vyzo> you can walk these directories looking for .ssi files
12:38 V<vyzo> which you can import
12:38 V<vyzo> and dump their symbols
12:41 V<vyzo> for already imported ones, try (gx#current-module-registry)
12:41 V<vyzo> errr (gx#current-expander-module-registry)
12:42 V<vyzo> this will give you a hash table of module id or path -> module object
12:42 V<vyzo> which you can get the export symbols in the same way
12:43 E<edw> vyzo: Thanks! I've recorded for posterity and my future reference: <https://github.com/thunknyc/gerbil-names-index/>.
12:52 E<edw> How would you like module-qualified names to be referred to?  I'm sure this will all make more sense as I dig into it.
20:38 E<edw> vyzo: Is there a way I can eval X in the context of a module Y? so like, evaluate `'printf` in the context of `':std/format`, regardless of whether I have done an `(import :std/format)` at top level *if* that module has been loaded indirectly as part of another import?
22:31 E<edw> Also, what are the `e` elements accessible via `syntax-binding-e`, `alias-binding-e`, `import-binding-e`?
23:25 V<vyzo> yes, you can set the current-expander-context
23:25 V<vyzo> it's a paramemter
23:25 V<vyzo> you can set this to an arbitrary module context
23:25 V<vyzo> and eval in the context
23:26 V<vyzo> the -e elements depend on the binding
23:26 V<vyzo> so look at the implementation of enter!
23:26 V<vyzo> https://github.com/vyzo/gerbil/blob/master/src/gerbil/interactive/init.ss#L43
08:18 E<edw> vyzo: Perfect! Thanks.
11:17 E<edw> vyzo: If a module export is an import binding, how can I resolve it to its underlying module binding?
11:18 V<vyzo> core-resolve-export should still resolve it
11:18 V<vyzo> core-resolve-module-export
11:20 V<vyzo> you can also try resolve-identifier on the import-binding-e if that doesn't work
11:22 E<edw> Cool. I'll try those. I hope to have a toy version of Clojure-Grimoire-like thing by end of day.
11:24 O<ober> nice
11:24 V<vyzo> excellent
11:28 E<edw> What is the `e` element of this binding objects? What does `e` mean?
11:28 V<vyzo> e means element
11:29 V<vyzo> it's the expander value
11:29 V<vyzo> for syntax bindings it's the actual macro object
11:29 V<vyzo> for other objects it can be a syntax object or just a symbol
11:31 E<edw> Ah. So it's possible that the import-binding-e is another import-binding, and I should then recursively descend until I get a non-import-binding?
11:31 E<edw> …because that's what I'm seeing.
11:32 V<vyzo> yes
11:32 V<vyzo> look at resolve-identifier in gerbil/expander/core
11:32 V<vyzo> you should also be aware of alias-bindings
11:34 E<edw> I check for them but just flag them as aliases atm. Can they be resolved using c-r-m-e as well?
11:36 V<vyzo> they should resolve
11:36 V<vyzo> but again, i don't remember :)
11:36 V<vyzo> use resolve-identifier when in doubt
11:37 E<edw> Haha. Will do.
```

repository: thunknyc/gerbil-apropos

gha_language: Scheme

repo_name: thunknyc/gerbil-apropos


text:
# react-native-arrow

Wanna scalable arrow but not woth of importing the whole react native vector icons? try this. 100% React Native only code to draw arrow.

This is the preview of the arrow:
<img width="100" alt="Screenshot 2023-01-29 at 8 06 07 AM" src="https://user-images.githubusercontent.com/24792201/215297807-3ccde801-1920-4262-b07b-3f69dcf41dc0.png">

Installation:

```npm i -S react-native-arrow```

Usage :

```import Arrow from 'react-native-arrow'```

```<Arrow size={15} color={'white'} />```

repository: fattahmuhyiddeen/react-native-arrow

repo_name: fattahmuhyiddeen/react-native-arrow


text:
# MRS Manager Operation Guide

-   **[MRS Manager Introduction](mrs-manager-introduction.md)**

-   **[Accessing MRS Manager](accessing-mrs-manager.md)**

-   **[Accessing MRS Manager Supporting Kerberos Authentication](accessing-mrs-manager-supporting-kerberos-authentication.md)**

-   **[Viewing Running Tasks in a Cluster](viewing-running-tasks-in-a-cluster.md)**

-   **[Monitoring Management](monitoring-management.md)**

-   **[Alarm Management](alarm-management.md)**

-   **[Alarm Reference](alarm-reference.md)**

-   **[Object Management](object-management.md)**

-   **[Log Management](log-management.md)**

-   **[Health Check Management](health-check-management.md)**

-   **[Static Service Pool Management](static-service-pool-management.md)**

-   **[Tenant Management](tenant-management.md)**

-   **[Backup and Restoration](backup-and-restoration.md)**

-   **[Security Management](security-management.md)**

-   **[Patch Operation Guide](patch-operation-guide.md)**

-   **[Restoring Patches for the Isolated Hosts](restoring-patches-for-the-isolated-hosts.md)**

-   **[Performing Rolling Restart](performing-rolling-restart.md)**

repository: Polina-Gubina/docs

repo_name: Polina-Gubina/docs


text:
---
layout: post
title: JavaScript Promises
categories:
- javascript
---

* TOC
{:toc}

These are some notes on JavaScript promises according to Jake Archibald and Kyle Simpson.

# The Problem
Classic ajax calls use callbacks to deal with a returning request.
This has the following issues:

1. Control of your application has been inverted. A callback function is provided which is called by the request handling code. You pass control over and trust that the request handling code does the right thing, i.e.
     * invoke your callback
     * invoke it only once
     * etc.
2.  If these actions in turn require a further ajax call, you create a series of nested callbacks.

# Promises

Here is how you create one

``` javascript
var promise = new Promise(function(resolve, reject) {
  // do a thing, possibly async, then…

  if (/* everything turned out fine */) {
    resolve("Stuff worked!");
  }
  else {
    reject(Error("It broke"));
  }
});
```

Here is how you use the above promise

``` javascript
promise.then(function(result) {
  console.log(result); // "Stuff worked!"
}, function(err) {
  console.log(err); // Error: "It broke"
});
```

# Converting jQuery Deferreds into Standard Promises
Fortunately, the javascript promise API will play nicely with other promise libraries. If an object has a `then` method on it, it will be treated like a standard promise.

In the case of jQuery Deferred, we can use the following:

``` javascript
var jsPromise = Promise.resolve($.ajax('/whatever.json'));
```

NB: be aware that standard promises will return only one argument. In libraries, such as jQuery where multiple arguments are returned, only the first argument will be available.

NB: jQuery will not return an error object into rejection callbacks.

# Chaining
Chaining is done by chaining multiple `then`s after each other to transform results or perform additional async actions.

Transforming

``` javascript
get('story.json').then(function(response) {
  return JSON.parse(response);
}).then(function(response) {
  console.log("Yey JSON!", response);
});
```

# Multiple Async Actions in Sequence
If your `then` method returns a value, that value is passed into the scope of the subsequent `then` method.
If your `then` method returns a promise, the next `then` method will wait for that promise to settle.

This is some cool example code

``` javascript
var storyPromise;

function getChapter(i) {
  storyPromise = storyPromise || getJSON('story.json');

  return storyPromise.then(function(story) {
    return getJSON(story.chapterUrls[i]);
  })
}

// and using it is simple:
getChapter(0).then(function(chapter) {
  console.log(chapter);
  return getChapter(1);
}).then(function(chapter) {
  console.log(chapter);
});
```

`story.json` is downloaded only once. However the promise that is returned can be `then`'d multiple times after the fact.

# When There are Errors
There are 2 usable forms

``` javascript
// example 1
get('story.json').then(function(response) {
  console.log("Success!", response);
}, function(error) {
  console.log("Failed!", error);
});

//example 2
get('story.json').then(function(response) {
  console.log("Success!", response);
}).catch(function(error) {
  console.log("Failed!", error);
});
```

NB: `.catch` is equivilant to `.then(undefined, function(error) { ...`

It is important to note, that a promise will only call the `fulfilled` or `rejected` function, never both.
If no `rejection` method is present, then control will skip forward to the next `then` in the chain with a rejection callback.

# JavaScript Exceptions
When javascript exceptions occur inside a promise constructor, the promise implicitly rejects.

This gives the added benefit of additional error handling, so it pays to do promise related work inside the promise constructor callback.

This is also the case for exceptions that occur inside `then` methods.

# Thinking about things in a sequence

``` javascript
// Start off with a promise that always resolves
var sequence = Promise.resolve();

// Loop through our chapter urls
story.chapterUrls.forEach(function(chapterUrl) {
  // Add these actions to the end of the sequence
  sequence = sequence.then(function() {
    return getJSON(chapterUrl);
  }).then(function(chapter) {
    addHtmlToPage(chapter.html);
  });
});
```

In this case, we start with a `resolved` promise. We can then chain `then`s in order the iterate an array sequentially.

A tidier way of doing the above is to use Array.prototype.reduce function. We just pass it a `resolve`d promise as the initial value.

``` javascript
// Loop through our chapter urls
story.chapterUrls.reduce(function(sequence, chapterUrl) {
  // Add these actions to the end of the sequence
  return sequence.then(function() {
    return getJSON(chapterUrl);
  }).then(function(chapter) {
    addHtmlToPage(chapter.html);
  });
}, Promise.resolve());
```

# Multiple async calls concurrently
Rather than calling async methods sequentially, one after the other, we can make all our async calls simultaneously and then process then sequentially when the last one has arrived.

``` javascript
Promise.all(arrayOfPromises).then(function(arrayOfResults) {
  //...
});
```

This example maps an array of promises and then reduces them to chain promises together in order to process then in order.

``` javascript
getJSON('story.json').then(function(story) {
  addHtmlToPage(story.heading);

  // Map our array of chapter urls to
  // an array of chapter json promises.
  // This makes sure they all download parallel.
  return story.chapterUrls.map(getJSON)
    .reduce(function(sequence, chapterPromise) {
      // Use reduce to chain the promises together,
      // adding content to the page for each chapter
      return sequence.then(function() {
        // Wait for everything in the sequence so far,
        // then wait for this chapter to arrive.
        return chapterPromise;
      }).then(function(chapter) {
        addHtmlToPage(chapter.html);
      });
    }, Promise.resolve());
}).then(function() {
  addTextToPage("All done");
}).catch(function(err) {
  // catch any error that happened along the way
  addTextToPage("Argh, broken: " + err.message);
}).then(function() {
  document.querySelector('.spinner').style.display = 'none';
});
```

# Promise API

**Promise.resolve(promise);**
Returns promise (only if promise.constructor == Promise)

**Promise.resolve(thenable);**
Make a new promise from the thenable. A thenable is promise-like in as far as it has a "then" method.

**Promise.resolve(obj);**
Make a promise that fulfills to obj. in this situation.

**Promise.reject(obj);**
Make a promise that rejects to obj. For consistency and debugging (e.g. stack traces), obj should be an instanceof Error.

**Promise.all(array);**
Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. Each array item is passed to Promise.resolve, so the array can be a mixture of promise-like objects and other objects. The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.

**Promise.race(array);**
Make a Promise that fulfills as soon as any item fulfills, or rejects as soon as any item rejects, whichever happens first.

# References
[](https://blog.getify.com/promises-part-1)
[JavaScript Promises](http://www.html5rocks.com/en/tutorials/es6/promises/)
[ECMA Script Language Definition](https://tc39.github.io/ecma262/#sec-promise-objects)


text:
Hack Oregon Urban Data API
# Portland Datasets

This application exposes a set of micro-services; APIs that can be used for building data visualization mashups.

Each [REST style API](https://en.wikipedia.org/wiki/Representational_state_transfer) is designed to expose a single dataset that covers the area of the City of Portland.

The following datasets are currently available:

- [Building Permits](/services/permits)
- [Neighborhood Boundaries](/services/neighborhoods)
- [Crimes](/services/crimes)
<!-- - [Taxlots](/services/taxlots)
- [Census](/services/census) -->
- [Demolitions](/services/demolitions)

It is assumed that these APIs are called from JavaScript via Ajax calls.

repository: hackoregon/urbandev-backend

gha_language: Python

repo_name: hackoregon/urbandev-backend


text:
# Systolic Blood Pressure
`Dificulty  level: easy`

Is it possible to find any correlation between age, weight and the systolic blood pressure (SBD)?

That's the question we are looking forward to answer with the following [data set](http://college.cengage.com/mathematics/brase/understandable_statistics/7e/students/datasets/mlr/frames/frame.html).

Each row has three values `(X1, X2, X3)`.

* `X1` Systolic blood pressure
* `X2` Age in years
* `X3` Weight in pounds

### Usage

```python
lr = LinearRegression()
s = SystolicBloodProblem(lr)
s.fit()
```
### Expected result

It might differ between values and iterations
```
--- Result for Gradient Decedent ---
Weights:
X2      0.224582
X3      0.696740
bias    0.003557
dtype: float64
R-squared:  0.9543378747364191
----------------------------
```

Plus some graphics with the input, the predicted and target SBD and the cost (error) function for each iteration.


text:
---
layout: page
title: The Microservices Community
---

We are an international community interested in the software paradigm of [Microservices](https://en.wikipedia.org/wiki/Microservices). Our overarching aims are the sharing of knowledge and the fostering of collaborations about microservices. We have a broad composition, including people from research institutions, private companies, universities, and public organisations (like municipalities). We strongly believe in the importance of discussing open issues and solutions from different points of view, to create foundations for both innovation and basic research.

The microservices community was born during the first edition of the [International Conference on Microservices](http://conf-micro.services).

[Fabrizio Montesi](https://www.fabriziomontesi.com/) is the coordinator of the Microservices Community until the finalisation of the Microservices Community Steering Committee. The formation of the steering committee will be discussed at the upcoming [Microservices Conference 2019](https://conf-micro.services).

Come and join us!

---

# Join us and discuss

Discussions happen through our [mailing list](https://groups.google.com/forum/#!forum/microservices-community). Everybody is welcome to join, by requesting an invitation here: https://groups.google.com/forum/#!forum/microservices-community.

Many organisations already joined the Microservices Community as [members](#members). If you also want your organisation to become a member or just want more information about the Microservices Community and its activities, please write to microservices[at]lists.sdu.dk.

---

# Events

Upcoming Events

      April 8th-12th, 2019
      Microservices, DevOps, and Service-Oriented Architecture @ SAC
      MiDOS, continuation of the historic SOAP track.

      February 19th-21st, 2019
      International Conference on Microservices 2019, Second Edition
      Co-located with the second edition of the Meeting on Microservices.

Past Events

International Workshop on Microservices: Agile and DevOps Experience, Second Edition - May 21st, 2018

International Conference on Microservices 2017, First Edition - October 25th-26th, 2017

Meeting on Microservices 2016, First Edition - December 20th, 2016

---

# Social Media

Latests Tweets from the Microservices Community

---

# Activities

The main activities of the Microservices Community currently include, but are not limited to, the following.

- Organise the International Conference on Microservices once a year ([http://conf-micro.services](http://conf-micro.services)), which acts also as a recurring opportunity for the physical gathering of the community.

- Support the organisation of focused events on microservices. Examples include: technical workshops on industrial technologies, national meetings (like the [Italian Meeting on Microservices](http://www.italianasoftware.com/mom2016_eng.html)), and academic forums.

- Provide funding opportunities for travelling and the organisation of events in general.

- Publish open access material on microservices, either through the website as informal publications (white papers), or through more formal channels (like edited books with chapters from multiple authors, or journals).

- Provide resources for the digital platform of the community, including this website.

Microservices Community Collaboration Badge

From June 2018, the activities and events organised in collaboration with the Microservices Community are recognisable from the Microservices Community Collaboration Badge (shown on the left) present in their website.

---

# Members

  {% include_relative include_md.html file="subpages/logo_matrix.md" %}


text:
---
title: Introduction
date: 15th April, 2020 02:00:00
parent: /toc/section-one/
tags:
 - matz
description: Introduction of Ruby Language
permalink: /toc/section-one/intro/
prev_link: /toc/section-one/getting-started
next_link: /toc/section-one/history
---

# Introduction

Ruby is an `interpreted`, `high-level`, and `general-purpose programming` language.
It was designed and developed in the mid-1990s by `Yukihiro "Matz" Matsumoto` in Japan.

Ruby is dynamically typed and garbage-collected. It supports multiple programming paradigms, including procedural,
object-oriented, and functional programming.

Its creator, Yukihiro “Matz” Matsumoto has often said that he is _"trying to make Ruby natural, not simple,"_ in a
way that mirrors life.

>> Yukihiro Matsumoto (Matsumoto Yukihiro, born 14 April 1965), also known as Matz, is a Japanese
>> computer scientist and software programmer best known as the chief designer of the Ruby programming language
>> and its reference implementation, Matz's Ruby Interpreter (MRI). His demeanor has brought about a motto in the
>> Ruby community: "Matz is nice and so we are nice," commonly abbreviated as MINASWAN.
[(source)](https://en.wikipedia.org/wiki/Yukihiro_Matsumoto){:target="_blank"}

Let’s understand above important keywords in brief.

### Interpreted

An interpreted language is a type of programming language for which most of its implementations execute
instructions directly and freely, without previously compiling a program into machine-language instructions. The
interpreter executes the program directly, translating each statement into a sequence of one or more subroutines,
and then into another language (often machine code).

### High Level

High-level language refers to the higher level of abstraction from machine language. Rather than dealing with
registers, memory addresses and call stacks, high-level languages deal with variables, arrays, objects, complex
arithmetic or boolean expressions, subroutines and functions, loops, threads, locks, and other abstract computer
science concepts, with a focus on usability over optimal program efficiency.

### General Purpose

Designed to be used for writing software in the widest variety of application domains. Conversely, a
domain-specific programming language is one designed to be used within a specific application domain.

### Dynamically Typed

The type is associated with run-time values, and not named variables/fields etc. This means that a programmer can
write a need not have to specify types every time. Conversely, type of a variable is known at compile time for a
Statically Typed.

```ruby
name = 'Ruby'
# variable name is given datatype as String by Ruby Interpreter

name = 100
# variable name datatype is changed to Integer by Ruby Interpreter
```

In above example, you can easily understand how datatype of variable `name` can be switched easily
since during compile time dataype is not checked.

#### Garbage Collected

In computer science, garbage collection (GC) is a form of automatic memory management. The garbage collector, or
just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the
program.

Check [this article](https://ruby-hacking-guide.github.io/gc.html){:target="_blank"} to understand the whole
concept, design, type and process of garbage collection in Ruby in details.

The strategies of Garbage collection has evolved from Mark & Sweep to Incremental Sweep in Ruby 2.2. More can be
found [here](https://blog.heroku.com/incremental-gc).

## Philosophy of Ruby

In an interview Matz discuss about the _Philosophy of Ruby_ where he described about why he designed Ruby.
[Click here for full interview.](https://www.artima.com/intv/ruby.html){:target="_blank"}

### No Perfect Language

Instead of emphasizing the what, I want to emphasize the how part: how we feel while programming. That's Ruby's
main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby. I
didn't work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be
perfect for everyone. I tried to make Ruby perfect for me, but maybe it's not perfect for you.

### Freedom and Comfort

Ruby inherited the Perl philosophy of having more than one way to do the same thing. I want to make Ruby users
free. I want to give them the freedom to choose. People are different. People choose different criteria. But if
there is a better way among many alternatives, I want to encourage that way by making it comfortable.

### The Joy of Ruby

You want to enjoy life, don't you? If you get your job done quickly and your job is fun, that's good isn't it?
That's the purpose of life, partly. Your life is better.
I want to solve problems I meet in the daily life by using computers, so I need to write programs.

### The Human Factor

Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will
run faster. By doing this, the machine will run more effectively. By doing this, the machine will something
something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care
about doing programming or operating the application of the machines. We are the masters. They are the slaves.

### Principle of Least Surprise

The principle of least surprise means principle of least my surprise. And it means the principle of least surprise
after you learn Ruby very well. For example, I was a C++ programmer before I started designing Ruby. I programmed
in C++ exclusively for two or three years. And after two years of C++ programming, it still surprised me.

repository: coolbrg/rubyguru

repo_name: coolbrg/rubyguru


text:
# Policy: governance_best_practices
Ingress host name should be a valid organization name. Invalid host names can cause problems with access to the API.

__This policy helps to enforce the following best practices:__
* [Ensure Ingress only uses approved domain names for hostnames](#ensure-ingress-only-uses-approved-domain-names-for-hostnames)

## Ensure Ingress only uses approved domain names for hostnames
### When this rule is failing?
If `host` is missing:
```
apiVersion: networking.k8s.io/v1
kind: Ingress
spec:
  rules:
    - http:
        paths:
          - pathType: ImplementationSpecific
            path: /
            backend:
              service:
                name: nginx
                port:
                  number: 80
```

__OR__ the value of `host` is not a valid organization name (*.example.com):

```
apiVersion: networking.k8s.io/v1
kind: Ingress
spec:
  rules:
    - host: test.com
      http:
        paths:
          - pathType: ImplementationSpecific
            path: /
            backend:
              service:
                name: nginx
                port:
                  number: 80

```

`--ignore-missing-schemas` will have to be used to ignore the missing schema.

## Policy author
Brijesh Shah \\ [brijeshshah13](https://github.com/brijeshshah13)

repository: datreeio/datree

gha_language: Go

repo_name: datreeio/datree


text:
## How to test new packages for Cerebral

### Install Cerebral
`npm install cerebral@next`

### Models
`npm install cerebral-model` (state-tree)
- new mutable state tree which handles references

`npm install cerebral-model-immutable` (baobab)
- same as before, but emits a "flush" event with changed paths

### Views
`npm install cerebral-view-react@next`
- Optimized rendering and reports rendering to debugger

`npm install cerebral-view-snabbdom@next`
- Optimized rendering and reports rendering to debugger
- No more "use a key to optimize", works out of the box

### Devtools
`npm install cerebral-module-devtools@next`
- Make sure you have latest debugger version, 0.46
- Has a new "components" tab

### Devtools
`npm install cerebral-module-recorder@next`

repository: dineshvgp/cerebral

gha_language: JavaScript

repo_name: dineshvgp/cerebral


text:
# Deep Learning for Crystal

[![GitHub Release](https://img.shields.io/github/release/toddsundsted/mxnet.cr.svg)](https://github.com/toddsundsted/mxnet.cr/releases)
[![Build Status](https://github.com/toddsundsted/mxnet.cr/actions/workflows/ci.yml/badge.svg)](https://github.com/toddsundsted/mxnet.cr/actions)
[![Documentation](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://toddsundsted.github.io/mxnet.cr/)

[MXNet.cr](https://github.com/toddsundsted/mxnet.cr)
provides [MXNet](https://mxnet.incubator.apache.org/)
bindings for the [Crystal](https://crystal-lang.org/) programming
language. MXNet is a framework for machine learning and deep learning
written in C++, supporting distributed training across multiple
machines and multiple GPUs (if available).

MXNet.cr follows the design of the Python bindings, albeit with
Crystal syntax. The following code:

```crystal
require "mxnet"
a = MXNet::NDArray.array([[1, 2], [3, 4]])
b = MXNet::NDArray.array([1, 0])
puts a * b
```

outputs:

```
[[1, 0], [3, 0]]
<NDArray 2x2 int32 cpu(0)>
```

# Examples

If you want to see what MXNet.cr can do, check out
[toddsundsted/deep-learning](https://github.com/toddsundsted/deep-learning).
It is a collection of problems and solutions from [Deep Learning - The
Straight Dope](https://gluon.mxnet.io/), a set of notebooks teaching
deep learning using MXNet.

# Installation

MXNet.cr requires MXNet.

Build MXNet from source (including Python language bindings) or
install the library from prebuilt packages using the Python package
manager *pip*, per the MXNet installation instructions:

https://mxnet.incubator.apache.org/install/index.html

And add the following to your application's *shard.yml*:

```yaml
dependencies:
  mxnet:
    github: toddsundsted/mxnet.cr
```

## Troubleshooting

MXNet.cr relies on the Python library to find the installed MXNet
shared library ("libmxnet.so"). You can verify MXNet is installed with
the following Python code:

```python
import mxnet as mx
a = mx.ndarray.array([[1, 2], [3, 4]])
b = mx.ndarray.array([1, 0])
print(a * b)
```

which outputs:

```
[[1. 0.]
 [3. 0.]]
<NDArray 2x2 @cpu(0)>
```

## OSX

On OSX, you may need to give your program a hint about the location of
the MXNet shared library (*libmxnet.so*). If you build and run your
program and see an error message like the following:

```
dyld: Library not loaded: lib/libmxnet.so
  Referenced from: /Users/homedirectory/.cache/crystal/crystal-run-eval.tmp
  Reason: image not found
```

you need to either: 1) explicitly set the `DYLD_FALLBACK_LIBRARY_PATH`
environment variable to point to the directory containing *libmxnet.so*,
or 2) move or copy *libmxnet.so* into a well-known location (such as
the project's own *lib* directory).

Alternatively, and more permanently, you can modify the *libmxnet.so*
shared library so that it knows where it's located at runtime (you
will modify the library's LC\_ID\_DYLIB information):

```
LIBMXNET=/Users/homedirectory/mxnet-1.5.1/lib/python3.6/site-packages/mxnet/libmxnet.so # the full path
install_name_tool -id $LIBMXNET $LIBMXNET
```

# Status

MXNet.cr currently implements a subset of
[Gluon](https://gluon.mxnet.io/), and supports a rich set of
operations on arrays and symbols (arithmetic, trigonometric,
hyperbolic, exponents and logarithms, powers, comparison, logical,
rounding, sorting, searching, reduction and indexing) with automatic
differentiation built in.

Implemented classes:
* MXNet
  * Autograd
  * Context
  * Executor
  * Optimizer
  * NDArray
  * Symbol
  * Gluon
    * Block
    * HybridBlock
    * Sequential
    * HybridSequential
    * SymbolBlock
    * Dense
    * Pooling
    * Conv1D
    * Conv2D
    * Conv3D
    * MaxPool1D
    * MaxPool2D
    * MaxPool3D
    * Flatten
    * L1Loss
    * L2Loss
    * SoftmaxCrossEntropyLoss
    * Activation
    * Trainer
    * Parameter
    * Constant


text:
# Result

`Result` is intended to be a replacement for exceptions and `out` parameters to use as the return value for methods in .NET. Although exceptions are usually the most common mechanism used to indicate when a method cannot deliver a suitable result, it is sometimes convenient to use a more transparent means through the return value of a method. While the .NET Framework encourages the use of `TryGet...` methods that return a boolean and use `out` parameters for the meaningful results, it is possible (and easy) to misuse these by failing to check the return value and continuing to use the result (which was likely default-initialized).

This project provides 2 abstract classes that can be used as the return type of methods:

- `Result`: Used to indicate success or failure without providing a return value. This is equivalent to a `void` method that throws an exception on failure.
- `Result<T>`: Used to indicate success or failure while also providing a return value on success. This is equivalent to a method with a return value that throws an exception on failure or a `TryGet...` method with an `out` parameter.

`Result` has the following three properties:

- `IsSuccess` is `true` if the method returned successfully and `false` otherwise.
- `IsFail` is `true` if the method returned an error and `false` otherwise.
- `Error` contains an `IError` object with additional details about the error that occurred when `IsFail` is `true` (and `IsSuccess` is `false`). Attempting to access this property when `IsFail` is `false` (and `IsSuccess` is `true`) will result in an exception being thrown.

Both `IsSuccess` and `IsFail` are provided, even though they are redundant, in order to allow the most meaningful semantics within the caller of this method. For example, if the caller wants to exit early after receiving a successful result, it makes more sense to use `if (result.IsSuccess) { ... }`. On the other hand, if the caller wants to exit early after receiving a failure, it makes more sense to use `if (result.IsFail) { ... }`.

`Result<T>` has the same properties as `Result` with the same behaviors, along with the following additional property:

- `Value` contains the return value of the method when `IsSuccess` is `true` (and `IsFail` is `false`). Attempting to access this property when `IsSuccess` is `false` (and `IsFail` is `true`) will result in an exception being thrown.

Each of these have helper classes to provide the desired behavior: `Success` and `Fail` for `Result` and `Success<T>` and `Fail<T>` for `Result<T>`. However, generally, these classes won't be used directly. `Result` provides static helper methods to generate them:

- `Result.Success()` returns a `Success` object (actually a singleton `Success` object, since there is no unique state within this class).
- `Result.Success(T value)` returns a `Success<T>` object that wraps the given value.
- `Result.Fail()` returns a `Fail` object (again, actually a singleton `Fail` object, since there is no unique state within this class).
- `Result.Fail(string message)` returns a `Fail` object containing the given error message.
- `Result.Fail(Exception exception)` returns a `Fail` object containing the given exception.

For convenience, an implicit conversion is provided to convert a `Fail` object to a `Result<T>` for any `T`. This allows the type of the return value to be ignored when indicating an error.

## Example Usage of `Result`

	static Result IsPositive(double value)
	{
		if (value < 0.0)
			return Result.Fail();

		return Result.Success();
	}

## Example Usage of `Result<T>`

	static Result<double> Sqrt(double value)
	{
		if (value < 0.0)
			return Result.Fail("Value cannot be negative.");

		return Result.Success(Math.Sqrt(value));
	}

Note that the type parameter for the `Success<T>` object is automatically inferred from the argument provided to the `Result.Success` call. `Result.Fail` returns a `Fail` object, which is implicitly converted to a `Result<double>` object so it can be returned by the method.

## License

Result is distributed under the terms of the MIT license.

See LICENSE.md for details.


text:
# Operating System Algorithms

This contains implementation of Operating System Algorithms.

These implementations outputs the computed result. These implementations does not
contain visualization of these algorithms. To easily and interactively learn how these
work see [this](visualization-library-todo).

For advanced system algorithms or papers implementation see [this](https://github.com/tapasweni-pathak/Systems-Readings-Implementations/tree/master/AOS/Conferences). Feel free to PR an implementation in OS section,
the directories has info about how a new algorithm can be implemented extending the
exisiting code and structure.

1. System Structures
   * Implement a system call in Linux Kernel

2. Process Concept
   * Interprocess Communication
     * Shared Memory
     * Message Passing
   * Synchronization
     * Blocking send
     * Nonblocking send
     * Blocking receive
     * Nonblocking receive
   * Buffering
     * Zero capacity
     * Bounded capacity
     * Unbounded capacity
   * Pipes (Windows only)
     * Named pipes
     * Anonymous pipes

3. Mulithreaded Programming
   * Pthreads Libary usage

4. Process Scheduling
   * CPU Scheduling Algorithms
     * First Come First Serve
     * Shortest Job First
     * Priority Based
     * Round Robin
     * Highest Response Ratio Next
     * Multilevel Feedback Queue
     * Find visualization implementation of these algorithms [here](https://github.com/tapasweni-pathak/Visualization-of-CPU-Scheduling-Algorithms) using C graphics library.

5. Synchronization
   * Peterson's Solution
   * Mutual exclusion with test and set()
   * Bounded Buffer (Producer Consumer)
   * Readers-Writers
   * Dining Philisopher (find [here]())
   * mutex but using PThread library

6. Deadlocks
   * Drawing resource allocation graph
   * Banker's Algorithm
   * Resource Request Algorithm

7. Memory Management Strategies & Virtual Memory Management
   * Get page number and offset from virtual address
   * Page Replacement Algorithms
     * First in First out
     * Optimal Page Replacement
     * Least Recently Used
     * Least Frequently Used
     * Most Frequently Used
     * Not Recently Used Page Replacement
     * Second-Chance Page Replacement
     * Clock Page Replacement
     * Working Set Page Replacement

8. Secondary Storage
   * Disk Scheduling
     * First Come First Serve
     * Shortest Seek Time First
     * SCAN
     * C-SCAN
     * LOOK
     * C-LOOK

9. Distributed Operating Systems
   * Distributed Synchronization
     * Token Passing
     * Two Phase Commit
     * Ring Alogrithm
     * The Bully Algorithm

Please open an issue for a Operating Systems based algorithm missing in this repository.

If you want to learn about any of the algorithms from above, the books I like are

1. Operating Systems: Design and Implementation, Textbook by Andrew S. Tanenbaum.
2. Operating System Concepts 8 Edition  (Silberschatz, Galvin, Gagne)
3. Operating Systems: Internals and Design Principles, by William Stallings.
4. Modern Operating Systems Book by Andrew S. Tanenbaum

There are books on implementation in Linux, Windows and OSX. The above listed books
also have case studies of implementation details in Linux Kernel, OSX, Windows, MINIX,
UNIX.


text:
## Example project using chart core packages and webpack

in this sample project, we use webpack to bundle as a bundler and the most important part is we use the core nebula.js packages and install the other peer dependedncies along side with it, in order to have a bit more control in our final bundle size.

So here is the folder structure of the project:

    .
    ├── dist                         # Compiled files
    ├── src                          # Source files
    │   ├── chartConfigs             # char config objects exported from this folder
    │   │   ├── barChart.js          # bar chart configuration
    │   │   ├── lineChart.js         # line chart configuration
    │   │   ├── scatterPlot.js       # scatter plot configuration
    │   │   └── index.js             # a simple barrel file to export all configurations
    │   ├── configure.js             # registeration file for core packages
    │   ├── connect.js               # main connection file for loggin in to your qlik app
    │   ├── index.js                 # app initializer
    │   ├── index.html               # main html file
    │   └── styles.css               # main css file
    ├── .gitignore                   # ignore files for git
    ├── package.json                 # packages list
    ├── webpack.config.js            # webpack config file
    └── README.md

Here is some usefull commands:

- **`build:dev`:** for running project in dev mode with `webpack-dev-server`
- **`build:prod`:** compile project to the `/dist` folder
- **`serve:prod`:** serve the final project with `serve` package

for starting project you need to install dependencies first and then run `build:dev` for serving the project with dev mode enabled. it will open two new tabs in your browser, `localhost:1234` and `localhost:1235`. first one will show the app for you and the second one is for bundle analayzer.


text:
# Changelog

## 25 September 2018

| Package | Version | Type | Changes |
| --- | --- | --- | --- |
| refract-redux-callbag
refract-redux-most
refract-redux-rxjs
refract-redux-xstream | 1.1.0 | Bug | [(#75)](https://github.com/fanduel-oss/refract/pull/75) initialise Redux selector observers with their initial value |

gha_language: TypeScript


text:
## Continual Learning Data Former

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9273eb0f97b946308248b0007e054e54)](https://app.codacy.com/app/TLESORT/Continual_Learning_Data_Former?utm_source=github.com&utm_medium=referral&utm_content=TLESORT/Continual_Learning_Data_Former&utm_campaign=Badge_Grade_Dashboard)

This repositery proprose several script to create sequence of tasks for continual learning. The spirit is the following :
Instead of managing the sequence of tasks while learning, we create the sequence of tasks first and then we load tasks
one by one while learning.

It makes programming easier and code cleaner.

### Task sequences possibilities

-   **Disjoint tasks** : each task propose new classes
-   **Rotations tasks** : each tasks propose same data but with different rotations of datata point
-   **Permutations tasks** : each tasks propose same data but with different permutations of pixels
-   **Mnist Fellowship task** : each task is a new mnist like dataset (this sequence of task is an original contribution of this repository)

### Datasets

-   Mnist
-   fashion-Mnist
-   kmnist
-   cifar10
-   mnishion : concatenation of Mnist and Fashion-Mnist
-   core50 (in developpment)

### Some supplementary option are possible:
-   The number of tasks can be choosed (1, 3, 5 and 10 have been tested normally)
-   Classes order can be shuffled for disjoint tasks
-   We can choose the magnitude of rotation for rotations mnist

### Few possible commands

-   Disjoint tasks

```bash
#MNIST with 10 tasks of one class
python main.py --dataset MNIST --task disjoint --n_tasks 10 --dir ./Archives
```
-   Rotations tasks

```bash
#MNIST with 5 tasks with various rotations
python main.py --dataset MNIST --task rotations --n_tasks 5 --min_rot 0 --max_rot 90 --dir ./Archives
```

-   Permutations tasks

```bash
#MNIST with 10 tasks of one class
python main.py --dataset MNIST --task permutations --n_tasks 5 --dir ./Archives
```

-   Dijsoint_classes_permutations tasks

```bash
#MNIST with 10 tasks of one class
python main.py --dataset MNIST --task dijsoint_classes_permutations --n_tasks 10 --index_permutation 2 --dir ./Archives
```

### Example of use

First we create the sequence of tasks and save it
```bash
#MNIST with 10 tasks of one class
python main.py --dataset MNIST --task disjoint --n_tasks 10 --dir ./Archives
```

Then we can use the saved sequence in another program for continual learning
```python
#MNIST with 10 tasks of one class
from data_loader import DatasetLoader
import os
import torch
from torch.utils import data

# Path to the task sequence
path = "./Archives/Data/Tasks/MNIST/disjoint_10_train.pt"
# load the file
Data = torch.load(path)
# create a dataset loader
data_set = DatasetLoader(Data, current_task=0, transform=None, load_images=False, path=None)

# We can visualize samples from the sequence of tasks
for i in range(10):
    data_set.set_task(i)

    folder = "./Samples/disjoint_10_tasks/"

    if not os.path.exists(folder):
        os.makedirs(folder)

    path_samples = os.path.join(folder, "MNIST_task_{}.png".format(i))
    data_set.visualize_sample(path_samples , number=100, shape=[28,28,1])

# use the dataset with pytorch dataloader for training an algo

# create pytorch dataloader
train_loader = data.DataLoader(data_set, batch_size=64, shuffle=True, num_workers=6)

#set the task on 0 for example with the data_set
data_set.set_task(0)

# iterate on task 0
for t, (data, target) in enumerate(train_loader):
    print(target)

#change the task to 2 for example
data_set.set_task(2)

# iterate on task 2
for t, (data, target) in enumerate(train_loader):
    print(target)

```

### Citing the Project

```Array.<string>
@misc{continual-learning-data-former,
  author = {Lesort, Timothée},
  title = {Continual Learning Data Former},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/TLESORT/Continual_Learning_Data_Former}},
}

```


text:
# ImoBot
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Imorate/ImoBot/blob/master/LICENSE)

A Spring-boot based Telegram weather bot.
![ImoBot](https://i.imgur.com/tPuXRS6.png?1 "ImoBot v1.0.0")

## Getting Started
Navigate to `application.properties` and add your bot `username`, `api token` and `Openweathermap.org api` then build the project.

## Screenshot
![Screenshot](https://i.imgur.com/Vta5QZE.png?1 "Imobot v1.0.0 Screenshot")

## Built With
* [Spring-boot](https://spring.io/projects/spring-boot) - Spring boot framework
* [Maven](https://maven.apache.org) - Dependency Management
* [TelegramBots](https://github.com/rubenlagus/TelegramBots) - TelegramBots repository
* [Unirest](http://unirest.io) - Lightweight HTTP Request Client Libraries
* [Emoji-Java](https://github.com/vdurmont/emoji-java) - Lightweight java library for emojies

## Versioning
I use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Imorate/ImoBot/tags).

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Powered by Intellij idea
![Intellij idea](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/IntelliJ_IDEA_Logo.svg/75px-IntelliJ_IDEA_Logo.svg.png "ImoBot v1.0.0")

repository: Imorate/ImoBot

repo_name: Imorate/ImoBot


text:
# UniColorPicker

## Overview
Simple Color Picker For Unity. It works on uGUI and supports mobile platforms.

## Demo
![Demo](https://github.com/sanukin39/UniColorPicker/blob/master/Demo/colorpickerdemo.gif)

## Requirement
Unity 2017 or higher

## Usage
### Add color picker to scene
Add UniColorPicker/UniColorPicker.prefab into canvas at scene.

### How to get/set color
```csharp
using UniColorPicker;
using UnityEngine;

public class ColorPickerExample : MonoBehaviour
{
    [SerializeField] ColorPicker _colorPicker = null;

    void Example()
    {
        // Set Color To Picker
        var initialColor = Color.red;
        _colorPicker.Color = initialColor;

        // Get Color From Picker
        var editedColor = _colorPicker.Color;
    }
}
```

## Install
use unitypackage at [release](https://github.com/sanukin39/UniColorPicker/releases/) page

## Licence
[MIT](https://github.com/sanukin39/UniColorPicker/blob/master/LICENSE)

## Author
[sanukin39](https://github.com/sanukin39)


text:
---
layout: post
title: How to make a 3rd person controller shoot game using Unity 3D (6-6)
date: 2016-12-5
categories: article unity game shooter tutorial
---
<!--more-->

## 6 Make it complete

- Find source project in [Shooter](https://github.com/hanhonglei/Shooter)

### Optimize game framework

Use inherit of `C#` class to manage characters and items in the game scene. `Enemy` and `Player` are all inherited from `Actor`. `Actor` can have weapons, fire, be damaged, die. `Bullet` and `Weapon` are all inherited from `Item`. `Item` can be picked up or used, initialized randomly, used by enemy or the player.

Use a game manager to handle global staff.
- Drop item system
- Record some game information
- Notify UI to display particular information

Set a `text UI` to display game information.

### Item generate system

When a item drop order is triggered
- When an enemy dies

There is a particular probability to drop an item
- It has a drop probability parameter

The Manager takes over the generate process.

It use a strategy to decide which level item should be generated.

Then use item collection in this level to finally generate a random item inside it.

### Item drop system

Write a script named EnemyDropItemProc that would be grabbed into an enemy or other item-droppable objects

There are some adjustable parameters in this class:

- **Enemy Level** The enemies can be divided into several levels, there are 5 levels in the Shooter Example. It more likes that the enemy will drop the same level items when they killed by the player. Particular level means special.
- **Level Manager** The pointer to the level manager in the scene. It will handle all item drop functions.
- **Drop Item Per** The probability of the enemy to drop items when is killed.

**EnemyDropItemProc**
{% highlight csharp %}
public ItemLevel enemyLevel = ItemLevel.Level1;
    public LevelManager levelManager = null;
    public float dropItemPer = 0.1f;
	// Use this for initialization
	void Start () {
        if (!levelManager)
        {
            levelManager = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<LevelManager>();
        }
	}
    public Item DropItem()
    {
        if (Random.Range(0f, 1f) < dropItemPer)
        {
            Debug.Log("Drop an item");
            return levelManager.GenerateRandomItem(transform);
        }
        return null;
}
{% endhighlight %}

Function `DropItem` will be called when the enemy is killed by the player

It would be called in `Die` function of `Enemy` script like this:

{% highlight csharp %}
protected override void Die()
    {
        SendMessage("DropItem");
        lm.killEnemyNum++;
        GameObject.Destroy(gameObject);
    }
{% endhighlight %}

In script `LevelManager`, the function `GenerateRandomItem`, that will handle all random generate items process

It can generate random items based on the enemy item percentage and level

All droppable items would be managed in a script named `ItemsCollection`, it can return a random, use function `GenerateRandomLevelItem`, item from a particular item level list

![]({{site.url}}/Images/shooter/image28.png){:height="300px"}

This is the end of this tutorial.

More details, please visit the project [here](https://github.com/hanhonglei/Shooter)

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-85986843-1', 'auto');
  ga('send', 'pageview');

</script>

extension: markdown

gha_language: HTML

gha_license_id: NOASSERTION


text:
I am default context of requests. They created with my single instance
	SeamlessRequestContext default
I skip any returned result from requests because I have no idea about their senders.
So my return method is just stub which is doing nothing.
I am always transfered by value between peers.

I helps to implement return method  from sync requests.  For this SeamlessMessageSendRequest is sent to sender peer to perform #return: message on sender context.
But as any message send this request will try to return "#return: message result" back to sender peer (receiver of original message).
To stop this communication "return request" is sent with default context (which is me). So any returned result on sender will be skipped.

This approach allows reuse SeamlessMessageSendRequest to implement request return. Instead some kind of ReturnMessageResultRequest will be needed

repository: pavel-krivanek/Seamless

repo_name: pavel-krivanek/Seamless