text:
## Hate_speech_analysis
This is a project on twitter sentiment analysis, specifically "hateful" and "offensive" emotions.
We have mainly classified data into two classes: "none" and "offense" (as a joke to "none" taken!!)

It has been made for submission in our semester course in ANLP (Advanced Natural Language Processing),
although we didn't do anything too advanced eh!

## Getting Started

The files are divided into thus:

* Hate_speech_analysis.ipynb - the main ipython notebook
* BoGClassfier.py - the python function file for implementation of SVM and Naive Bayes on Bag of Words.
* common_functions.py - the python function file for implementation of common functionalities through out the notebook.
* FINALtweets_withLabels.pkl - the pickled file containing the dataset
* HAL_RF_functions.py -  the python function file for implementation of Random Forest on a modified form of HAL.
* hate_library.py - the libraries necessary all in all.

## Prerequisites

All of the below libraries are necessary:

* pickle
* re
* numpy
* matplotlib
* nltk
* sklearn
* tweepy
* io
* json
* operator
* pandas
* sklearn
* time
* codecs
* pprint

## Running the tests
All one has to do is get the libraries installed, download the notebook and all the associated files and run the notebook.
#### PS: there are three live graphs for static data, to show the slow build-up, they can be stopped by interrupting the kernel and one can continue normal opration there on running the other parts of the notebook

## Contribution
Special thanks to Prof. Tatjana Scheffler  for guiding us.

## Authors
Made possible by the humble efforts of Dev Punjabi and Ankur Dutta.

## License
This project is licensed under the MIT License - see the LICENSE.md file for details


text:
---
title: "JavaZone: introducing Apache Wicket"
layout: "posts"
permalink: "/2011/09/javazone-introducing-apache-wicket.html"
uuid: "896052624377724457"
guid: "tag:blogger.com,1999:blog-7706585097329252419.post-896052624377724457"
date: "2011-09-16 13:30:00"
updated: "2011-09-16 13:33:45"
description:
blogger:
    siteid: "7706585097329252419"
    postid: "896052624377724457"
    comments: "0"
categories:
author:
    name: "Tommy"
    url: "http://www.blogger.com/profile/16604372255669213767?rel=author"
    image: "http://static.flickr.com/93/279356255_fb52db20a0_o.jpg"
---

Presentation from JavaZone 2011: http://javazone.no/incogito10/events/JavaZone%202011/sessions/Introducing%20Apache%20Wicket
Video posted to http://vimeo.com/28791557
Notes:

	* 7 years old framework, Wicket 1.5 just released
	* Component oriented, using just java+html
	* **Used by:** AdScale, WalMart, MeetMoi, fabulous40...
	* **Just html:** elements linked to wicket by attributes: <p wicket:id="foo">, no imperative markup in view.
	* **Just Java:** no logic in markup, Components are POJOs, No xml
	* **Components:** Manipulate markup, Render content, Receive events (onClick)
	* **Models:** data to / from Components, transform data
	* **Behaviors:** Decorator / Adapter for Component, manipulate markup of Component, can receive events (onClick), Add Ajax unctionality to Components
	* **Wicket projects:** Apache Wicket (core, integration to Spring...), Wicket stuff (components), Seam for Apache Wicket, WiQuery (jQuery), Leg before Wicket (archetypes), Apache Isis (DDD framework), Jolira Tools, Visural Wicket (components)...
	* **Quick start:** use Maven, http://wicket.apache.org/start/quickstart.html
	* **Some examples:** Hello World, click-counter, sign-up
	* **Navigation:** Overview and some detail on: External link, Bookmarkable link, Action
	* **Validators:** Overview, simple example and list of provided validators
	* **jQuery integration:** WiQuery overview and example
	* **JqZoom:** Example, zoom on image, how to integrate
	* **Development / Deployment mode:** List differences and show some features
	* **WicketTester:** Tests components, UI, Ajax, without starting server, runs in IDE, ant, maven
	* **New in 1.5:** Html5 input types, component event bus, some new components, improved internals, simpler request cycle, and more
	* **Component event bus:** pre/post example
	* **Wicket 6:** next version, preliminary list of features. Shorter release cycle.
	* **Q&A:** How do components handle history button? Do you endorse Wicket WebBeans for rapid development?

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Custom models

These are some of the models I implemented in [Stan](https://mc-stan.org/),
partly for easy reference, and partly to share models that I have developed or
extended.

Feel free to ask me questions or make pull requests.

## Models currently implemented

### Regression

* [Fast piecewise linear function (similar to first-degree splines)](https://github.com/davidmpinho/custom-models/blob/main/regression/piecewise_linear.stan). When using many knots, it's faster
than [Kharratzadeh's](https://mc-stan.org/users/documentation/case-studies/splines_in_stan.html) spline implementation. It is also
particularly advantageous when setting priors since there is a more intuitive
relationship between the local and global flexibilities of the function, and I've made the priors
(mostly) invariant to changes in the number of knots, such that, e.g., sigma=0.5 is equal to a change of 0.5 in Y for every 1 standard deviation change in X.
Interpolation to values outside the range of observed data is not possible (but that's a tricky subject for every model anyways).
It also doesn't work very well with exponential relationships because the piecewise slopes have (on average) a constant 'rate of change', and that causes
overfitting in the ranges of values where Y is relatively closer to zero. You can fix that by just exponentiating phi if Y > 0. I tried to find a more
general solution, one that would work when Y has negative values: the flexibility of the spline is allowed to change over the range of X in an exponential way
([fast_1d_splines_exp.stan](https://github.com/davidmpinho/custom-models/blob/main/regression/piecewise_linear_exp.stan)). Seems
to take ~50% longer to fit on toy data sets. But I haven't really tested this, so proceed with caution (always!).

* [Hierarchical models and splines with missing data](https://github.com/davidmpinho/custom-models/blob/main/regression/auto_hierarchical_splines.stan).
Most simple regression problems have a mixture of continuous and discrete data with a lot of missingness -- this model addresses that. The missingness
is addressed in a way that may invalidate it from having a causal meaning.

### Time series

* [Autoregressive Conditional Poisson/Negative-Binomial (ARCP/ARCNG)](https://github.com/davidmpinho/custom-models/blob/main/time_series/autoregressive_conditional.stan),
 which works similarly to GARCH models, but for counts instead of squared
observations).  The advantage of this model over structural time series is that
it only needs 2-4 parameters to model the 'residual' component of a time series
-- the component that is (ideally) stationary and cannot be explained away by
other covariates.  This model was originally developed by
[Heinen's (2003)](http://dx.doi.org/10.2139/ssrn.1117187) article. I added the
following changes and extensions:
    - Allow for complex multiplicative seasonality and external predictors
      (i.e., exogenous terms).
    - Reparameterization of many variables to make the model easier to
      estimate, which makes the use of variational inference more viable.
      (The reparameterizations can also be applied to GARCH models.)

* [Bayesian structural time series](https://github.com/davidmpinho/custom-models/blob/main/time_series/bayes_state_space.stan). I base this on the code of
[Phalen](https://peterphalen.github.io/ceasefire/bsts). I
optimized it and simplified it. The model struggles with larger samples (>>2000) when using
HMC, but tends to be more robust when doing inference in general problems -- there are no strong assumptions
about how the latent state should evolve.

## Reparameterizations

* [Student-t](https://github.com/davidmpinho/custom-models/blob/main/reparameterization/student_t_repar.stan): this is different from the reparameterization from the
[Stan User's guide](Reparameterization). In my case, one parameter sets
the standard deviation of the whole distribution, while the other one
sets (what would be) the standard deviation of a standard student-t,
which maps directly to the parameter nu.
With this, the problematic posterior is (mostly) gone, though you tend to see
one of the parameters being a bit more long-tailed.
* [Beta and alpha parameters in GARCH/ARCP models](https://github.com/davidmpinho/custom-models/blob/main/reparameterization/garch_arc_repar.stan): this is the one I
mentioned in the previous section. Here I eliminate all the unrelated code.

## Future goals

* Hierarchical splines. The  splines and
allow deviations from them with a hierarchical structure. Check the work
of Dr. Gavin Simpson on this.

* For the ARCP/ARCNG model:
    - Let the unconditional mean ("omega") vary through time to allow for
      trends. Currently, the sum of alpha and beta parameters is always too high
      when modeling non-stationary time series. The plan is to use splines to
      model omega, although they cannot be too flexible. Something similar to the
      [C-GARCH](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5848) can also
      work, although that is bad for extrapolating -- the process always reverts
      to a long-run mean.
    - Experiment with "time before/after event" factors. These are only useful for
      events with some irregularity (like sales before/after Easter) instead of
      events (like Christmas). I need a mixture of the functions "additive_trend"
      and "additive_factor".
    - Support for multiple time series. To be complete, this requires two
      things: allow for a multivariate residual component, and hierarchical
      relationships between seasonality and trends. This last one is done in the
      following way (for yearly seasonality as an example): instead of estimating one
      yearly trend for every time series, first estimate the average trend, and then
      allow for hierarchically-structured deviations from that mean; only after that
      do you use indexing in the code. This could be applied to splines in a similar
      way, I think, but it is less straightforward in that case.
    - Allow missing data.

* For time series more generally, apply what I learned with ARC model to ARMA
models. The motivation is to have something like
[Prophet](https://facebook.github.io/prophet/), but with better performance and
without all the tacky choices that they have -- like having to specify bounds,
no support for count variables or hierarchical/multivariate relationships,
modeling seasonality with Fourier series, or having two 'trends'.  So the
objective is to have a middle term between conventional ARMA-type models (which
work well enough in most cases but are very limiting) and black-box models like
neural networks or tree-based models (which do not even work that well most of
the time).

* See what can be done with factor models for factor analysis.

repository: davidmpinho/custom-models

branch_name: refs/heads/main

repo_name: davidmpinho/custom-models


text:
---
title: 'The Inflector Module – Another Reason to Love Rails'
author: Justin Ball
layout: post
permalink: /2008/01/11/the-inflector-module-another-reason-to-love-rails/
tags:
  - Programming
  - Ruby On Rails
  - Ruby On Rails
---

I love how when you need something in Rails the solution is usually already in place.  For instance in the indulgenc.es application I have the need to create a rank with 1st, 2nd, 3rd etc.  In most frameworks you would have to write this functionality yourself or if you are very lucky you might find something on the Internet.  In Rails you do this:

number.ordinalize

Then 1 becomes 1st, 2 becomes 2nd, 1233 becomes 1233rd etc.

I am still smiling

license: MIT


text:
Preparation of Vagrant images:

Create a file `Vagrantfile`:

```
Vagrant.configure("2") do |config|
    config.vm.box = "centos/7"
    config.vm.provision "shell" do |s|
      ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
      s.inline = <<-SHELL
        echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
        mkdir /root/.ssh
        echo #{ssh_pub_key} >> /root/.ssh/authorized_keys
        chmod 0700 /root/.ssh
        chmod -R 0600 /root/.ssh/*
      SHELL
    end
    config.vm.network "private_network", ip: "<IP_ADDRESS>"
    config.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh"
    config.vm.network "forwarded_port", guest: 80, host: 10080
end
```

Attention to configure you ssh key necessary to login in SSH server of vagrant machine

Now, you can up the machine:

```
vagrant up
```

You can use these port maps:

2222 -> 22
10080 -> 80

On the Ansible, you can set a file of hosts as show bellow:

```
[centreon-web]
centreon-server ansible_port=2222 ansible_host=<IP_ADDRESS>

[centreon-poller]
poller ansible_port=2223 ansible_host=<IP_ADDRESS>

[webserver]
nginx-server ansible_port=2224 ansible_host=<IP_ADDRESS>
```

repository: piellick/centreon-iac-ansible

repo_name: piellick/centreon-iac-ansible


text:
---
date: 2020-11-03T01:50:00.000Z
layout: post
title: Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations
subtitle: Let's go beyond the negative transfer and seesaw phenomenon!
description: Let's go beyond the negative transfer and seesaw phenomenon!
image: https://res.cloudinary.com/dthouk4zq/image/upload/v1604336284/mtl_wjb5ii.jpg
optimized_image: https://res.cloudinary.com/dthouk4zq/image/upload/c_scale,w_380/v1604336284/mtl_wjb5ii.png
category: MTL
tags:
  - Multi-Task Learning
  - Deep Learning
  - Machine Learning
  - Recommender System
author: Kyuyong-Shin
---

### Video
<iframe width="560" height="315" src="https://www.youtube.com/embed/WFDpbp71v7M" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Real-world recommender systems are often loosely correlated or even conflicted, which may lead to performance deterioration known as negative transfer (1: single task, 2: below single task).

When task correlation is complex and sometimes sample dependent, i.e., multiple tasks could not be improved simultaneously compared to the corresponding single-task model, which is called seesaw phenomenon (1: above single task, 2: below single task) in this paper.

gha_language: HTML

gha_license_id: NOASSERTION


text:
## LeetCode

[https://LeetCode.com](https://LeetCode.com)

## Problem - 0146

`Question` 146. **LRU Cache**

URL: [https://leetcode.com/problems/lru-cache/](https://leetcode.com/problems/lru-cache/)

## Description

Design and implement a data structure for [Least Recently Used (LRU) cache](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU). It should support the following operations: `get` and `put`.

`get(key)` - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
`put(key, value)` - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.

**Follow up:**

Could you do both operations in O(1) time complexity?

## Subscribe

[Subscribe](https://leetcode.com/subscribe/) to see which companies asked this question.

    Total Accepted: 82292
    Total Submissions: 519691
    Difficulty: Hard

(The deadline is 2016/08/15)

    Total Accepted: 124153
    Total Submissions: 721655
    Difficulty: Hard
    Contributor: LeetCode

(The deadline is 2017/06/14)

## Example:

```cpp
    LRUCache cache = new LRUCache( 2 /* capacity */ );

    cache.put(1, 1);
    cache.put(2, 2);
    cache.get(1);       // returns 1
    cache.put(3, 3);    // evicts key 2
    cache.get(2);       // returns -1 (not found)
    cache.put(4, 4);    // evicts key 1
    cache.get(1);       // returns -1 (not found)
    cache.get(3);       // returns 3
    cache.get(4);       // returns 4
```

## C++:

```cpp
class LRUCache {
public:
    LRUCache(int capacity) {

    }

    int get(int key) {

    }

    void put(int key, int value) {

    }
};

/**
 * Your LRUCache object will be instantiated and called as such:
 * LRUCache obj = new LRUCache(capacity);
 * int param_1 = obj.get(key);
 * obj.put(key,value);
 */
```

## C:

```c
typedef struct {

} LRUCache;

LRUCache * lRUCacheCreate(int capacity) {

}

int lRUCacheGet(LRUCache * obj, int key) {

}

void lRUCachePut(LRUCache * obj, int key, int value) {

}

void lRUCacheFree(LRUCache * obj) {

}

/**
 * Your LRUCache struct will be instantiated and called as such:
 * struct LRUCache * obj = lRUCacheCreate(capacity);
 * int param_1 = lRUCacheGet(obj, key);
 * lRUCachePut(obj, key, value);
 * lRUCacheFree(obj);
 */
```

## Go:

```go
type LRUCache struct {

}

func Constructor(capacity int) LRUCache {

}

func (this *LRUCache) Get(key int) int {

}

func (this *LRUCache) Put(key int, value int)  {

}

/**
 * Your LRUCache object will be instantiated and called as such:
 * obj := Constructor(capacity);
 * param_1 := obj.Get(key);
 * obj.Put(key,value);
 */
```

## Testcase

```
["LRUCache","put","put","get","put","get","put","get","get","get"]
[[2],[1,1],[2,2],[1],[3,3],[2],[4,4],[1],[3],[4]]
```


text:
---
title: Starting Up
author: Justin Ball
layout: post
permalink: /2008/03/14/starting-up/
tags:
  - business
  - business
  - start ups
---

I am not a serious entrepreneur, but I have started up a few companies over the years. One I sold.

[I ran across this article with startup tips][2]. My favorite tip is 'outsource to middle America'. I would have to say there are a lot of smart people that choose to not live in the startup hot beds because life is cheaper elsewhere. The only disadvantage of living out of the mainstream is that your non-virtual interactions are limited - user group meetings and presentations are harder. Technology is changing that as communities come online. I and my partner rarely meet at all anymore. We do everything over IM. It forces us to focus on what needs to be done rather than spend time shooting the bull.

 [2]: http://www.calacanis.com/2008/03/07/how-to-save-money-running-a-startup-17-really-good-tips/


text:
# Elixir
![Elixir](/elixir.png)

## Usage

1. Create an account at [Formik](https://formik.com/?utm_source=smakosh)
2. Install [Yarn](https://yarnpkg.com/en/)
3. Grab a Google recaptcha key from [Google Recaptcha](https://www.google.com/recaptcha/admin)
4. Run `cp .env.development.template .env.development`
5. Run `yarn && yarn start`

> You could run `vercel env pull` to get your env variables from Vercel.

### Deploying locally to Vercel

We highly recommend that you push to GitHub/GitLab and deploy your repository to Vercel instead or just hit the Deploy button.

### Clean the cache

This removes the `.cache/` & `public/` folders

```bash
yarn reset
```

## Built with

- Adobe XD
- Gatsby
- React & GraphQL
- Formik
- Google recaptcha
- VSCode
- And these useful of JavaScript libraries & Gatsby plugins [package.json](package.json)

repository: RonLek/Elixir

repo_name: RonLek/Elixir


text:
# Photomosaic Front End

The UI for the services you set up [here](https://github.com/rjvanvoorhis/photomosaic_open_faas)

## Installation
Make sure you have node and yarn installed

```bash
# node
sudo apt-get update && sudo apt-get install nodejs

#yarn
sudo apt-get update && sudo apt-get install yarn
```
or with brew on Mac

```bash
# install homebrew if you don't have it already
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install node
brew install yarn
```

## Usage
Now `cd` into the project directory and start up the the dev server with `yarn start`

You should see this
```bash
yarn run v1.12.3
$ python setup.py && webpack-dev-server --host <IP_ADDRESS> --port 8081
Looking for apiUrl at http://<IP_ADDRESS>:5000/api/v1/photomosaic
Project is running at http://<IP_ADDRESS>:8081/
ℹ ｢wdm｣: webpack output is served from /
ℹ ｢wdm｣: 404s will fallback to /index.html
ℹ ｢wdm｣: Hash: 5587bd268dd4f03202a8
Version: webpack 4.29.0
```
Then a bunch of output before finally
```
ℹ ｢wdm｣: Compiled successfully.

```

Now you can go to the site at `http://localhost:8081/`

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


text:
# Vehicle Analysis Pipeline Demo {#ovms_demo_vehicle_analysis_pipeline}
This document demonstrates how to create complex pipelines using object detection and object recognition models from OpenVINO Model Zoo. As an example, we will use [vehicle-detection-0202](https://github.com/openvinotoolkit/open_model_zoo/blob/2022.1.0/models/intel/vehicle-detection-0202/README.md) to detect multiple vehicles on the image. Then, for each detected vehicle we will crop it using [model_zoo_intel_object_detection](https://github.com/openvinotoolkit/model_server/tree/releases/2023/0/src/custom_nodes/model_zoo_intel_object_detection) example custom node. Finally, each vehicle image will be forwarded to [vehicle-attributes-recognition-barrier-0042](https://github.com/openvinotoolkit/open_model_zoo/blob/2022.1.0/models/intel/vehicle-attributes-recognition-barrier-0042/README.md) model.

![Vehicles analysis visualization](vehicles_analysis.png)

Using such pipeline, a single request to OVMS can perform a complex set of operations to determine all vehicles and their properties.

## Pipeline Configuration Graph

Below is depicted graph implementing vehicles analysis pipeline execution.

![Vehicles Analysis Pipeline Graph](vehicles_analysis_graph.svg)

It includes the following Nodes:
- Model `vehicle_detection` - deep learning model which takes user image as input. Its outputs contain information about vehicle coordinates and confidence levels.
- Custom node `model_zoo_intel_object_detection` - it includes C++ implementation of common object detection models results processing. By analysing the output it produces cropped vehicle images based on the configurable score level threshold. Custom node also resizes them to the target resolution and combines into a single output of a dynamic batch size. The output batch size is determined by the number of detected
boxes according to the configured criteria. All operations on the images employ OpenCV libraries which are preinstalled in the OVMS. Learn more about the [model_zoo_intel_object_detection custom node](https://github.com/openvinotoolkit/model_server/tree/releases/2023/0/src/custom_nodes/model_zoo_intel_object_detection).
- demultiplexer - outputs from the custom node model_zoo_intel_object_detection have variable batch size. In order to match it with the sequential recognition models, data is split into individual images with each batch size equal to 1.
Such smaller requests can be submitted for inference in parallel to the next Model Nodes. Learn more about the [demultiplexing](../../../docs/demultiplexing.md).
- Model `vehicle_attributes_recognition` - this model recognizes type and color for given vehicle image
- Response - the output of the whole pipeline combines the recognized vehicle images with their metadata: coordinates, type, color, and detection confidence level.

## Prepare workspace to run the demo

To successfully deploy face analysis pipeline you need to have a workspace that contains:
- Deep learning models for inference
- Custom node for image processing
- Configuration file

Clone the repository and enter vehicle_analysis_pipeline directory
```bash
git clone https://github.com/openvinotoolkit/model_server.git
cd model_server/demos/vehicle_analysis_pipeline/python
```

You can prepare the workspace that contains all the above by just running `make` command.
Since custom node used in this demo is included in OpenVINO Model Server image you can either use the custom node from the image, or build one.

If you just want to quickly run this demo and use already compiled custom node, run:

```bash
make
```

#### Directory structure (without custom node)

Once the `make` procedure is finished, you should have `workspace` directory ready with the following content.

```bash
workspace
├── config.json
├── vehicle-attributes-recognition-barrier-0042
│   └── 1
│       ├── vehicle-attributes-recognition-barrier-0042.bin
│       └── vehicle-attributes-recognition-barrier-0042.xml
└── vehicle-detection-0202
    └── 1
        ├── vehicle-detection-0202.bin
        └── vehicle-detection-0202.xml

```

If you modified the custom node or for some other reason, you want to have it compiled and then attached to the container, run:

```bash
make BUILD_CUSTOM_NODE=true BASE_OS=ubuntu
```

#### Directory structure (with custom node)

Once the `make` procedure is finished, you should have `workspace` directory ready with the following content.
```bash
workspace
├── config.json
├── lib
│   └── libcustom_node_model_zoo_intel_object_detection.so
├── vehicle-attributes-recognition-barrier-0042
│   └── 1
│       ├── vehicle-attributes-recognition-barrier-0042.bin
│       └── vehicle-attributes-recognition-barrier-0042.xml
└── vehicle-detection-0202
    └── 1
        ├── vehicle-detection-0202.bin
        └── vehicle-detection-0202.xml
```

## Deploying OVMS

Deploy OVMS with vehicles analysis pipeline using the following command:

```bash
docker run -p 9000:9000 -d -v ${PWD}/workspace:/workspace openvino/model_server --config_path /workspace/config.json --port 9000
```

## Requesting the Service

Install python dependencies:
```bash
pip3 install -r requirements.txt
```

Now you can create a directory for text images and run the client:
```bash
mkdir results
```
```bash
python3 vehicles_analysis_pipeline.py --pipeline_name multiple_vehicle_recognition --grpc_port 9000 --image_input_path ../../common/static/images/cars/road1.jpg --vehicle_images_output_name vehicle_images --vehicle_images_save_path ./results --image_width 512 --image_height 512 --input_image_layout NHWC
Output: name[types]
    numpy => shape[(37, 1, 4)] data[float32]
Output: name[vehicle_coordinates]
    numpy => shape[(37, 1, 4)] data[float32]
Output: name[colors]
    numpy => shape[(37, 1, 7)] data[float32]
Output: name[confidence_levels]
    numpy => shape[(37, 1, 1)] data[float32]
Output: name[vehicle_images]
    numpy => shape[(37, 1, 72, 72, 3)] data[float32]

Found 37 vehicles:
0 Type: van Color: gray
1 Type: car Color: gray
2 Type: car Color: black
3 Type: car Color: white
4 Type: car Color: black
5 Type: truck Color: red
6 Type: truck Color: gray
7 Type: car Color: white
8 Type: car Color: blue
9 Type: car Color: red
10 Type: car Color: yellow
11 Type: car Color: gray
12 Type: van Color: gray
13 Type: car Color: gray
14 Type: car Color: red
15 Type: truck Color: gray
16 Type: truck Color: red
17 Type: car Color: red
18 Type: car Color: gray
19 Type: car Color: black
20 Type: truck Color: gray
21 Type: car Color: red
22 Type: truck Color: blue
23 Type: truck Color: red
24 Type: car Color: gray
25 Type: truck Color: red
26 Type: car Color: black
27 Type: truck Color: gray
28 Type: truck Color: blue
29 Type: truck Color: gray
30 Type: car Color: gray
31 Type: car Color: white
32 Type: car Color: yellow
33 Type: car Color: red
34 Type: truck Color: gray
35 Type: truck Color: gray
36 Type: car Color: red
```

With additional parameter `--vehicle_images_save_path`, the client script saves all detected vehicle images to jpeg files into directory path to confirm
if the image was analyzed correctly.


text:
原文 url:	https://data-artisans.com/blog/kafka-flink-a-practical-how-to

# Kafka + Flink: A Practical, How-To Guide

[September 2, 2015](https://data-artisans.com/blog/2015/09/02) - [Flink Features](https://data-artisans.com/blog/category/flink-features) , [Resources](https://data-artisans.com/blog/category/resources)
[Robert Metzger](https://data-artisans.com/blog/author/robert)
A very common use case for Apache Flink™ is stream data movement and analytics. More often than not, the data streams are ingested from Apache Kafka, a system that provides durability and pub/sub functionality for data streams. Typical installations of Flink and Kafka start with event streams being pushed to Kafka, which are then consumed by Flink jobs. These jobs range from simple transformations for data import/export, to more complex applications that aggregate data in windows or implement CEP functionality. The results of these jobs may be actually fed back to Kafka for consumption by other services, written out to HDFS, other systems like Elasticsearch or user-facing web frontends.
![Kafka Flink Pipeline](./pics/1-kafka-flink-pipeline.png)
In such pipelines, Kafka provides data durability, and Flink provides consistent data movement and computation. data Artisans and the Flink community have put a lot of work into integrating Flink with Kafka in a way that (1) guarantees exactly-once delivery of events, (2) does not create problems due to backpressure, (3) has high throughput, and (4) is easy to use for application developers.
In this blog post, we provide a hands-on guide for developing your first Flink application using the Kafka consumer and producers bundled with Flink.

## A 5-minute Introduction to Kafka

In order to understand how Flink is interacting with Kafka, let us first introduce the main concepts behind Kafka. Apache Kafka is a distributed, high-throughput message queuing system designed for making streaming data available to multiple data consumers. Kafka makes the streaming data durable by persisting incoming messages on disk using a log data structure. This allows various downstream consumers to read the stream at different positions and different speeds and also read messages from the past, i.e., “replaying history”.

 ![Topics and Partitions](./pics/2-topics-and-partitions.png)

The most important abstraction in Kafka is the
*topic*
. A topic is a handle to a logical stream of data, consisting of many partitions. Partitions are subsets of the data served by the topic that reside in different physical nodes. Services that put data into a topic are called
*producers*
. For example, Kafka comes bundled with a “console producer” which puts the strings from standard input into a topic.
The opposite of a producer, i.e., a service that reads data from a topic is called a
*consumer*
. The individual partitions of a topic are managed by a Kafka
*broker*
, a service that is installed on the node that contains the partition and allows consumers and producers to access the data of a topic. When a partition is replicated (for durability), many brokers might be managing the same partition. Then, one of these brokers is designated as the “leader”, and the rest are “followers”.
Kafka is assigning each message within a partition a unique id, the so-called “message offset”, which represents a unique, increasing logical timestamp within a partition. This offset allows consumers to request messages from a certain offset onwards, essentially consuming data from a given past logical time.

![Partitions](./pics/3-offsets.png)
To enable this model for multiple consumers, there is a concept of “consumer groups”. For each consumer group, messages are guaranteed to be consumed at least once.
*all*
![Partitions](./pics/4-consumer-groups.png)

## Hands-on: Use Kafka topics with Flink

Let us now see how we can use Kafka and Flink together in practice. The code for the examples in this blog post is available
[here](https://github.com/dataArtisans/kafka-example)
, and a screencast is available below.

### **Preparation: Get Kafka and start it locally**

The easiest way to get started with Flink and Kafka is in a local, standalone installation. We later cover issues for moving this into a bare metal or YARN cluster. First, download, install and start a Kafka broker locally. For a more detailed description of these steps, check out the
[quick start section in the Kafka documentation](http://kafka.apache.org/documentation.html#quickstart)
.
```
#get kafka wget http://mirror.softaculous.com/apache/kafka/<IP_ADDRESS>/kafka_2.10-<IP_ADDRESS>.tgz
```

```
# unpack tar xf kafka_2.10-<IP_ADDRESS>.tgz cd kafka_2.10-<IP_ADDRESS>
```

```
# start zookeeper server ./bin/zookeeper-server-start.sh ./config/zookeeper.properties
```

```
# start broker ./bin/kafka-server-start.sh ./config/server.properties
```

```
# create topic “test” ./bin/kafka-topics.sh --create --topic test --zookeeper localhost:2181 --partitions 1 --replication-factor 1
```

```
# consume from the topic using the console producer ./bin/kafka-console-consumer.sh --topic test --zookeeper localhost:2181
```

```
# produce something into the topic (write something and hit enter) ./bin/kafka-console-producer.sh --topic test --broker-list localhost:9092
```

### **Consume data using Flink**

The next step is to subscribe to the topic using Flink’s consumer. This will allow you to transform and analyze any data from a Kafka stream with Flink.
Flink ships a maven module called “flink-connector-kafka”, which you can add as a dependency to your project to use Flink’s Kafka connector:
```
<dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-connector-kafka</artifactId> <version>0.9.1</version> </dependency>
```

First, we look at how to consume data from Kafka using Flink. We will read strings from a topic, do a simple modification, and print them to the standard output. We will use the console producer that is bundled with Kafka. The end result is a program that writes to standard output the content of the standard input.
Here is how you can create a Flink DataStream out of a Kafka topic. Note that both the DataStream and topics are distributed, and Flink maps topic partitions to DataStream partitions (here, we are reading the required Kafka parameters from the command line):
```
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); ParameterTool parameterTool = ParameterTool.fromArgs(args); DataStream < String > messageStream = env.addSource(new FlinkKafkaConsumer082 < > (parameterTool.getRequired("topic"), new SimpleStringSchema(), parameterTool.getProperties()));
```

Once a DataStream is created, you can transform it as you like. For example, let us pad every word with a fixed prefix, and print to stdout:
```
messageStream .rebalance() .map ( s -> “Kafka and Flink says: ” + s) .print();
```

The call to rebalance() causes data to be re-partitioned so that all machines receive messages (for example, when the number of Kafka partitions is fewer than the number of Flink parallel instances). The full code can be found
[here](https://github.com/dataArtisans/kafka-example/)
.
The command-line arguments to pass to this Flink program in order to read from the Kafka topic “test” that we have created before are the following:
```
--topic test --bootstrap.servers localhost:9092 --zookeeper.connect localhost:2181 --group.id myGroup
```

Since we are reading from the console producer, and printing to the standard output, the program will simply print the strings you write in the console. These strings should appear almost instantly.

### **Produce data using Flink**

Let us now look on how you can write into a Kafka topic using Flink. We will, as before create a StreamExecutionEnvironment, and a Flink DataStream using a simple String generator.

```
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStream < String > ; messageStream = env.addSource(new SimpleStringGenerator());
```

Then we will put this DataStream into a Kafka topic. As before, we read the relevant Kafka parameters as command line arguments:
```
ParameterTool parameterTool = ParameterTool.fromArgs(args); messageStream.addSink(new KafkaSink < > (parameterTool.getRequired("bootstrap.servers"), parameterTool.getRequired("topic"), new SimpleStringSchema()));
```

The command line arguments to pass to the program in order to write the strings to the Kafka console topic we created above are the following;
```
--topic test --bootstrap.servers localhost:9092
```

Check out a [screencast of running the examples of this section](https://www.youtube.com/watch?v=7RPQUsy4qOM&feature=youtu.be) .
**Running the example in a cluster**
Of course, the Flink code we saw also works in a cluster. To run this code in a cluster, first install Kafka by either using your favorite distribution or follow [Kafka’s documentation](http://kafka.apache.org/documentation.html#quickstart) for setting up multiple brokers
. Make sure that you use the Flink consumer that corresponds to your Kafka version (currently 0.8.1 and 0.8.2 are available).
When creating a new topic in a cluster, it is advised to set an appropriate number of partitions so that all parallel instances of Flink receive data. To achieve that, the number of partitions has to be at least equal to the number of Flink instances.

## Frequently Asked Questions

### **How are Kafka partitions assigned to Flink workers?**

When creating a Kafka topic, the user has to specify the number of partitions. Partitions are assigned to Flink’s parallel task instances.
When there are more Flink tasks than Kafka partitions, some of the Flink consumers will just idle, not reading any data:

 ![Fewer Partitions](./pics/4-less-partitions.png)

When there are more Kafka partitions than Flink tasks , Flink consumer instances will subscribe to multiple partitions at the same time:

 ![More Partitions](./pics/5-more-partitions.png)

Flink maintains assignment of partitions to Flink instances also after failures, keeping the partitioning deterministic, which is essential for exactly-once delivery.

### **How does Flink retain the order of messages in Kafka partitions?**

Since Kafka partitions are ordered, it is useful for some applications to retain this order both within and across Flink jobs.
Inside a Flink job, all record-at-a-time transformations (e.g., map, flatMap, filter, etc) retain the order of their input. Partitioning and grouping transformations change the order since they re-partition the stream.
When writing to Kafka from Flink, a custom partitioner can be used to specify exactly which partition an event should end up to. When no partitioner is used, Flink will use a direct mapping from parallel Flink instances to Kafka partitions. This means that multiple Flink jobs that use Kafka as an intermediate pipe retain the order within partitions:

 ![Order](./pics/6-order.png)

**How does Flink guarantee exactly-once processing with Kafka?**
Flink’s Kafka consumer integrates deeply with Flink’s
[checkpointing mechanism](https://data-artisans.com/high-throughput-low-latency-and-exactly-once-stream-processing-with-apache-flink/)
to make sure that records read from Kafka update Flink state exactly once. Flink’s Kafka consumer participates in Flink’s checkpointing mechanism as a stateful operator whose state is Kafka offsets.
Flink periodically checkpoints user state using an adaption of the Chandy-Lamport algorithm for distributed snapshots.

 Checkpointing is triggered by barriers, which start from the sources and travel through the topology together with the data, separating data records that belong to different checkpoints. Part of the checkpoint metadata are the offsets for each partition that the Kafka consumer has read so far. Offsets are committed only when a checkpoint has been completed. This means, that the offsets that are part of the checkpoint are consistent with the state backups generated by the same checkpoint, which results in exactly-once state update guarantees when restarting from failures.
On completion of a checkpoint, the Kafka consumer also commits the offsets to Zookeeper. From the offset in Zookeeper, users can still use tools such as Kafka’s
[Offset Checker](https://cwiki.apache.org/confluence/display/KAFKA/System+Tools#SystemTools-ConsumerOffsetChecker)
.
This [Slideshare presentation](https://www.slideshare.net/robertmetzger1/clickthrough-example-for-flinks-kafkaconsumer-checkpointing) shows a step-by-step example of the checkpointing with the Kafka consumer.

### **How does Flink handle backpressure when reading from Kafka topics?**

Streaming systems like Flink need to be able to slow down upstream operators (for example the Kafka consumer) if downstream operators operators (like sinks) are not able to process all incoming data at the same speed. This is called backpressure handling (you can read more about Flink’s backpressure handling
[here](https://data-artisans.com/how-flink-handles-backpressure/)
).
Flink’s Kafka consumer handles backpressure naturally: As soon as later operators are unable to keep up with the incoming Kafka messages, Flink will slow down the consumption of messages from Kafka, leading to fewer requests from the broker.
Since brokers persist all messages to disk, they are able to also serve messages from the past.
As soon as the operators speed up again, Flink will consume the build up messages at full speed. This behavior makes Kafka a perfect fit as a buffer between streaming sources and Flink, as it provides a durable buffer for events at load spikes

**Want to learn more? Here are some next steps:**

- Check out the source code for the examples in the blog post [here](https://github.com/dataArtisans/kafka-example) .
- Read [here](https://data-artisans.com/flink-at-bouygues-html/) on how people have successfully put Kafka and Flink to work in the real world.
- If you are interested in trying out Flink and Kafka yourself, visit the [Flink documentation](https://ci.apache.org/projects/flink/flink-docs-master/apis/streaming_guide.html#apache-kafka) for more details.


text:
# Urho Embedded Diagnostic
Embedded diagnostics server for Urho3D. Defaults to port 80 and can be accessed with `localhost`.

It is not designed to be a substitution for an editor or other tools, but an additional swiss army knife to fulfill multiple duties at runtime without requiring setting up additional GUI. Paired with the script-console it should provide enough for most basic tweaks and understanding what/why things are happening in your project.

Depending on local network and firewall settings you can also access the diagnostics from your phone while the game remains running, negating any need to run in windowed mode or gamble with alt-tab driver  hell.

Currently none of CivetWeb's security features are used, and I cannot see how they could be secure when the executable is shipped (short of deferring authentication to a master server somehwere) so it assumed that the DevServer will only be enabled in internal builds and not release builds.

I would not recommend leaving the server live in a public build.

---

To activate:

```C++
    DevServer::RegisterObject(context_);
    context_->RegisterSubsystem<DevServer>();
```

---

Publish a text or image dump:

```c++
    img->SetSize(64, 64, 3);
	img->Clear(Color::MAGENTA);
	context_->GetSubsystem<DevServer>()->Publish("ImageTest", img);
	context_->GetSubsystem<DevServer>()->Publish("Text", "Here's some simple text!");
```

Text and image dumps are particularly useful when you want to emit information about the result of an operation that is not easily walked through in the debugger or logs, such as a trace through a collection of procedural generation routines.

---

Register a scene for inspection:

`GetContext()->GetSubsystem<DevServer>()->AddScene(scene_);`

Register a lambda command:

```c++
context_->GetSubsystem<DevServer>()->RegisterCommand("Regenerate Map", "Regenerates ALL of the map", [](Context* ctx) {
		URHO3D_LOGINFO("Command executed");
	});
```

![Scene inspection](img_inspect.png)

![Commands](img_commands.png)

## TODO

- Consistently handle spaces in URIs
  - Currently some of the code assumes browser will still make requests on URIs with spaces
  - Could not find anything in the specs that actually forbids spaces, from what I read all indication is that spaces were just *assumed* to not be used without a formal forbiddance of them
    - Could have missed something though, better to change everything to assume they are forbidden
- Not all attributes in the inspector can currently be edited
  - It is debatable how many attribute types *should* be editable given the *micro* focus of the utility
- Data handlers for resources
  - Texture2D
  - XMLFile
  - JSONFile
- Script console
- Render-target support as image dumps

repository: JSandusky/UrhoEmbeddedDiagnostic

repo_name: JSandusky/UrhoEmbeddedDiagnostic


text:
# Foundations to Investing

## Definitions

- _stock_: A type of security that signifies proportionate ownership in the issuing corporation. Also known as "shares" or "equity".

- _IPO (initial public offering)_: The process of offering shares of a private corporation to the public in a new stock issuance.

- _New Issues Market_: Primary capital market, when a company publicly sells new stocks and bonds for the first time, often through an IPO.

- _Secondary Market_: The stock market, The New York Stock Exchange (NYSE), London Stock Exchange, and Nasdaq, etc. Where securities are traded after the company has sold its offering on the primary market.

## Stocks

**The key to trading stocks is to be able to recognize undervalued and overvalued companies.**

repository: thezimmee/os-zimmee

repo_name: thezimmee/os-zimmee


text:
---
layout: page
title: Products
permalink: /products/
---

## Get your App Done

This offer is for startups and small businesses.

We conceptualize, develop, deploy and build a roadmap for your idea in 30 days at a fixed price so you can get the data you desire or convince your favourite investors in no time.

You will receive a fully functional [Minimum Viable Product]({{ "minimum-viable-product/" | absolute_url }}).

This includes:

- A working and deployed minimal product covering your USP
- A development roadmap for scaling your MVP into a product

Starting at 3000Eur.

[Schedule a Call](https://calendly.com/viper){:.c-btn}

## Get your App Done

Looking for more or are a larger business?

Please contact us for an individual offer.

[Schedule a Call](https://calendly.com/viper){:.c-btn}

extension: markdown


text:
---
title: Templates
page_title: Upload Templates
description: Discover the Blazor Upload component templates that enable you to customize the rendered button. Through these templates, you to change the text and add custom content.
slug: upload-templates
tags: telerik,blazor,upload,templates
published: True
position: 30
---

# Upload Templates

The `SelectFilesButtonTemplate` allows you to modify the **Select Files...** button. It lets you change the default text of the button and include custom content like an [icon](/blazor-ui/common-features/icons) or image.

>caption Using Upload SelectFilesButtonTemplate

```HTML
<div>
    <TelerikUpload>
        <SelectFilesButtonTemplate>
            <TelerikFontIcon<EMAIL_ADDRESS>/>
            Click to Select Files for Upload
        </SelectFilesButtonTemplate>
    </TelerikUpload>
</div>

```

## See Also

* [Upload API](/blazor-ui/api/Telerik.Blazor.Components.TelerikUpload)
* [Upload Overview]({%slug upload-overview%})
* [Upload Validation]({%slug upload-validation%})
* [Upload Events]({%slug upload-events%})

repository: telerik/blazor-docs

gha_language: JavaScript

repo_name: telerik/blazor-docs


text:
# Component Demo
This project is a test/demo of the built-in Magnium components provided with the Magnium framework.
These are optional and only added to the project if required.

it uses:

* androidheader
* androidpdfviewer
* buttonbar
* loadingindicator
* stacknavigator

see config.json for component use.

All components have a standard theme built in, so this project also uses a global theme to override the standard components (see /themes/default.js)

## Running the demo
You need to have the [Magnium CLI module](https://www.npmjs.com/package/magnium) installed first along with an already set up Magnium workspace. Then just clone/copy this project into the projects directory of the workspace (if the projects directory does not exist create it first).

```
{workspacedir}/projects/componentdemo
```

Then build the Magnium project and run t up in a simulator.

```
magnium-build --name componentdemo
```
Run in an iOS simulator

```
ti build -p ios --log-level info -d titanium
```

or for Android

```
ti build -p android --log-level info -d titanium
```

repository: magnatronus/componentdemo

repo_name: magnatronus/componentdemo


text:
---
title: What is needed for Ethereum to go mass-market
date: '2020-02-19'
---

By the term _mass market_ I mean being adopted and used on a wide scale for
building apps. I mean having [Ethereum](http://ethereum.org/) Dapps that are
used by millions of users. We haven't got this level of usage yet (putting aside for
now that the Eth 1.0 network wouldn't be able to handle such a transaction
load). I'm interested in figuring out the factors that matter and the path
forward towards mass-market usability.

People within the crypto space typically focus on 3 requirements for Ethereum
(or any smart-contract blockchain) to be able to hit the mass-market:

* Price stability
* Scalability
* Usability

### Price stability

Cryptocurrency prices fluctuate and vary wildly, on a frequent basis. For
someone to have confidence in dealing with crypto and in partcular, storing
their funds in crypto, they need to know that the price is generally going to be
stable.

With the advent of [DAI](https://makerdao.com/),
[USDC](https://www.circle.com/en-gb/usdc) and other such _stablecoins_ this
problem has by-and-large been solved. We know how to do stablecoins and we know
how to ensure they maintain a stable value over time.

### Scalability

Scalability mostly refers to how many transactions can be executed per second on
a blockchain. For Ethereum it currently hovers around ~20. The goal of Eth 2.0
is to get this to becomes many 1000's per second. There are numerous competitors
([Solana](https://solana.com/), [NEAR](https://nearprotocol.com/),
[Elrond](http://elrond.com/), etc) also working on this problem. Most of them
(including Ethereum) plan to use sharding as a means of achieving scalability.
And this isn't to mention so-called _Layer 2_ scaling solutions
([zkRollups](https://keen-noyce-c29dfa.netlify.com/#0),
[Plasma](https://www.learnplasma.org/en/learn/mvp.html), [Lightning
networks](https://lightning.network/), etc) which already exist and can equally
be applied to a sharded network to further boost scalabiilty.

Given the great progress that is being made in this area I'm confident that
scalability will be solved.

### Usability

Usability is the final piece of the puzzle that is being tackled.

There are numerous solutions being worked on to make user onboarding easier -
[Torus](https://tor.us/), [Authereum](https://authereum.com/), [Universal
Login](https://unilogin.io/), etc. Most of these solutions focus on minimizing
the need to already own crypto prior to using a Dapp. They also preclude the
need to even have an Ethereum account in the first place. These are great for
onboarding users more, but there are still  fundamental usability issues
with Ethereum (and blockchains in general) that still aren't being addressed
adequately. These issues are what I will focus on for the remainder of this article.

## The fundamental usability issues

I see two fundamental issues regarding usability. Specifically, I'm referring to getting
non-crypto/non-technical users to use an Ethereum Dapp:

* They don't understand crypto/blockchain and it's hard to explain
* It's easy to move from fiat (i.e. $, £, etc) to crypto, but hard to move back the other way

Let's consider each of these in turn.

### They don't understand crypto/blockchain and it's hard to explain

Many of my non-crypto/non-technical friends ask me how they can invest in crypto
since they'd like to get in on the crypto market speculation action. I always
point them to [Coinbase](https://www.coinbase.com/) since I think that's
probably the easiest way to buy in, has a simple enough UI, and is a regulated,
well-established entity. But even then my friends have trouble understanding
what's going on.

They still don't fundamentally understand what it is that they're buying. They
don't understand that the ETH they've bought is owned by a private-public
keypair and that it can be transferred to a _wallet_ that only they control.
They relate their ETH-buying experience to buying shares in the stock market.
And you know what, if they're just in it to make money then actually that's all
they need to know in a way.

But they'll still ask me...

* _"Who creates ETH? Is it the same as Bitcoin?"_
* _"Why does the price change?"_
* _"What is mining?"_
* ...and so on

I try to explain Proof-of-work and mining, Proof-of-stake, public-private
keypairs, etc. But for someone who's knowledge of computers stops at their
mobile apps and websites I'm really just feeding them gobbledy-gook. Moreover,
they remark to me that the whole thing seems a bit complicated compared to
their existing internet stuff (banking, social media, etc) and that that's why they were
hesitant to buy crypto in the first place. I can certainly sympathize!

Now, if I was to say to my friend, _"Hey, you can withdraw your ETH from
Coinbase to your [Ledger Nano](https://www.ledger.com/) and head over to
[Kickback](https://kickback.events/) and RSVP for an event"_ and get them to go
through with that, I know they'll come back to me with even more questions:

* _"Why can't I just transfer from Coinbase?"_
* _"Why is Ledger safer?"_
* _"What is Metamask?"_
* _"What is gas? Is that like a fee?"_
* _"It's saying I need DAI? What is that? How do I get it?"_
* ...and so on

All this just to RSVP to an event - something that they're already able to do on
sites like [Meetup](https://meetup.com) without any pain.

I'm not trying to criticize Kickback (after all, I'm a cofounder) and suggest
that it's their fault. My point is that getting people to use a crypto product
requires getting them to climb steep hill of education, most of which they'll forget very quickly.

Now, some of you might say that you have friends who were able to pick these
things up by themselves and learn quickly. Well those people probably fall into
the "tech adopters" category and this article doesn't really apply to them.

UX onboarding solutions such as Universal Login are great in that they take away
that initial sign up pain. And indeed, Kickback has integrated many of these methods. I
can onboard a user without them even needing to know about crypto. The problem
comes once they're onboarded. I'm giving them tokens. I'm informing them of
their DAI balance. Even if they didn't have to understand crypto when signing up
to my Dapp they certainly must do so afterwards in order to make sense of anything.

And by the way, continual use of a Dapp will require gas payments to be made -
at some point the phenomenon of gas is going have to explained to the user, or some clever way is going to be needed
to hide it.

### It's easy to move from Fiat to Crypto, but hard to move back the other way

Until recently, purchasing crypto using fiat required you to first go through
Know-Your-Client (KYC) approval processes. But thanks to companies like
[Wyre](https://www.sendwyre.com/), this is no longer necessary for small
quantities.

Now we can onboard a non-technical user onto our Dapp by creating them a secure
contract wallet on-the-fly in the background, and if they need to buy ETH we can
let them do so instantly using their credit/debit card.

The return route is the problem...

Let's say we onboard someone onto Kickback directly from fiat using Universal
Login + Wyre. After they've attended the event and are due a payout we need to
give them their payout in fiat. But we can't - at best we can give them back a
stablecoin such as DAI or USDC. At this point they again need to understand
crypto to understand how they can then convert those stablecoins back into cold,
hard fiat cash.

There doesn't exist an API that allows us to convert crypto to fiat and have it
sent to a bank account. I think this is mainly due to legal and regulatory hurdles.

For instance, in the UK you have to calculate and pay Capital Gains Tax when you
sell your crypto. Even crypto debit cards such as [Monolith](https://monolith.xyz/) - which are at
present the easiest way to cash out -  have to account for this in their
product.

## Where the solution lies

Given the present state of the tech I think there are two possible ways of
building something mass-market on Ethereum today:

* Hiding the blockchain from the user
* Building for enterprise

### Hiding the blockchain from the user

**Axiom: a user shouldn't have to understand a blockchain in order to benefit
from the blockchain.**

Expecting someone non-technical to pick up and understand blockchain concepts is a
no-go. Expecting them to care about the philosophical rationale for blockchains
(i.e. decentralization vs centralization) is sadly also a no-go. As much as we
developers want the non-developer world to care about this stuff, for the most
part it will consistently choose convenience over autonomy. Having said that,
that doesn't stop us from using blockchains and associated tech to provide
decentralized, privacy-preserving services to our users.

Given that cashing out is the hard part, it makes sense to focus on Dapps which
don't require that.

For example, take a document signing service. A user would pay a montly
subscription or perhaps a per-signature fee to sign a document, and a record of
this action gets placed on the blockchain. The fee the user pays would cover gas
costs of interacting with the blockchain. The frontend would not expose the
blockchain mechanics in an way, i.e. the user would access the Dapp using an
email and password and their private key would be derived from their
credentials. At the same time, The Dapp could give the user a link to
their on-chain data (e.g. on Etherscan) to allow them to independently verify
the blockchain side of things.

[DFinity's](https://dfinity.org/) approach of calling itself the "Internet
Computer" and pretty much abstracting away all the blockchain details (as far as I can tell) is good thinking, though I don't know for sure if they've done that for the same
reasons as I've outlined.

### Building for enterprise

**Axiom: a user who will make money from integrating with a blockchain will be
more willing to pay to use the blockchain.**

The above axiom doesn't necessarily just apply to enterprise use-cases, but
enterprises are an obvious candidate.

If, for example, a supply-chain logistics
company can improve its business by integrating with Ethereum then it will be
more willing to pay (in terms of money as well as time invested for integration)
to use Ethereum. The company would also be willing to obtain DAI or whatever
other token it needs to. It sees the blockchain as a supplier of sorts and
itself as the customer.

The [Enterprise Ethereum Alliance](https://entethalliance.org/) suddenly makes
so much sense.

## Factors which may yet shake things up

### A global stablecoin

I think the [Libra](https://libra.org/en-US/) project is an example of something
which can solve the cashing-out problem. If their billions of users (most of
whom are non-crypto/non-technical) got into the habit of dealing with Libra
coins and transferring them back and forth, then Libra would become a de-facto
fiat-like stablecoin that people trust, understand and are comfortable using.
Dapps could then cash you out into Libra. Perhaps they could even onboard you
from Libra instead of from fiat.

This shows that we actually need something like Libra. Unfortunately such a
commonly-accepted stablecoin can only exist with the blessing of governments and
regulatory agencies (hence why Libra itself has already hit roadblocks) and so
it's upto the crypto community to engage with national and international
agencies in working towards a central bank condoned digital currency. By all
indications it [looks like China may get there
first](https://smallcaps.com.au/china-plan-introduce-central-bank-digital-currency-benefit-bitcoin/).
And if so I expect Dapps for the Chinese market to immediately jump on board
this opportunity.

### Integrated wallets

If crypto wallets and corresponding fiat <-> crypto
bridges get integrated into the foundational infrastructure of our lives (e.g. our
mobile phones) then there's a chance that over time we become educated and
knowledgeable enough of the tech to utilise it better. Initiatives like the
[Cryptophone](https://www.htcexodus.com/eu/cryptophone/) and
[Opera](https://www.opera.com/crypto) are a step in this direction. I think the
jury is still out on these developments though. Besides, what would the
equivalent desktop solution would be? or would these solutions be mobile-only?

--

Both of these factors will help educate people as to the benefits of decentralized
currencies and computing platforms and why they're increasingly important.

gha_license_id: MIT


text:
# Connection throttling

With the PassThrough transport and HTTP NIO transport, you can enable
connection throttling to restrict the number of simultaneous open
connections. To enable connection throttling, edit the
`         <EI_HOME>/conf/nhttp.properties        ` (for the HTTP NIO
transport) or `         <EI_HOME>/conf/passthru-http.properties        `
(for the PassThrough transport), and add the following line:

`         max_open_connections = 2        `

This will restrict simultaneous open incoming connections to 2. To
disable throttling, delete the `         max_open_connections        `
setting or set it to -1.

!!! Info
    Connection throttling is never exact. For example, setting this property to 2 will result in roughly two simultaneous open connections at any given time.

repository: AnuGayan/docs-ei

repo_name: AnuGayan/docs-ei


text:
# Bedrock
My implementation of algorithms for Coursera's Data Structures and Algorithms Specialization

#### 1. A Plus B
Adds two numbers and returns the result (Max time used: 0.01/1.00, max memory used: 9580544/536870912)

#### 2. Maximum Pairwise Product
Returns the product of the two largest integers in an array (Max time used: 0.08/1.00, max memory used: 22851584/536870912.)

#### 3. Fibonacci
Returns the nth Fibonacci number (Max time used: 0.00/1.00, max memory used: 9629696/536870912.)

#### 4. Fibonacci Last Digit
Returns the last digit of the nth fibonacci number (Max time used: 0.00/1.00, max memory used: 9588736/536870912.)

#### 5. Greatest Common Divisor (gcd)
Returns the gcd of any two numbers (Max time used: 0.01/1.00, max memory used: 9895936/536870912.)

#### 6. Least Common Multiple (lcm)
Returns the lcm of any two numbers (Max time used: 0.05/1.00, max memory used: 9928704/536870912.)

#### 7. Fibonacci Huge
Return Fn mod m where Fn is the nth Fibonacci number. n can be as large as 10^18 and m is at most 10^3. (Max time used: 0.02/1.00, max memory used: 9912320/536870912.)

#### 8. Last Digit of Sum of Fibonacci Numbers
Return the last digit of sum of fibonacci numbers up to any n, where n can be as large as 10^18. (Max time used: 0.00/1.00, max memory used: 9609216/536870912.)

#### 9. Last digit of the Partial Sum of Fibonacci Numbers
Return the last digit of a partial sum of fibonacci numbers from m to n, where both can be as large as 10^18 (Max time used: 0.01/1.00, max memory used: 9609216/536870912.)

#### 10. Last digit of the sum of squares of fibonacci numbers
Returnt the last digit of the sum of squares of fibonacci number n, where n can be as large as 10^18 (Max time used: 0.00/1.00, max memory used: 9605120/536870912.)

repository: mehtarit/bedrock

repo_name: mehtarit/bedrock


text:
# Hamorigami Developer Guide

This guide is for internal use only and is directed at developers of this game.

## Assets

Please put assets into the following directories:

| Directory        | Purpose           | Naming conventions  |
| ------------- |:-------------:| -----:|
| [assets/font](assets/font) | True Type (.ttf) fonts | fontname.ttf |
| [assets/i18n](assets/i18n) | translation strings | translations_XX.properties where XX is an official [locale code](https://www.viralpatel.net/java-locale-list-tutorial/) |
| [assets/music](assets/music) | music in .ogg format | *.ogg |
| [assets/sound](assets/sound) |sound in .ogg format | *.ogg |
| [assets/particles](assets/particles) | 2D particle effects | name.p |
| [assets/texture](assets/texture) | various textures | *.jpg, *.gif, *.png |
| [assets/game.play](assets/game.play) | The gameplay file | *.play |

## Gameplay file

The gameplay file `assets/game.play` contains instructions in how the story mode is supposed to be played:

```
# this is a comment and it won't get parsed

command arg1 input 1 arg2 input2
command input
```
Each line starts with a so called **command**. Additionally, a command can have zero or more arguments. Each argument has a corresponding input, for example:
```
spawn kodama at tree
```
`spawn` is the command, `kodama` is an input, `at` is an argument and `tree` is another input.

The following section describes various concepts in gameplay files, including syntax and examples:

### Starting a new day

```
day x
````
*`x` is the number of the day*

### Defining cutscenes

Cutscenes are a way to let things happen in the game **outside** of gameplay. The idea is that you can for example spawn spirits, let them talk and move and disappear again.

> **PLEASE NOTE! Cutscenes are currently only supported at the start and at the end of a day (both is optional)**

A cutscene block is defined like this:

```
begin cutscene
# cutscene instructions go here
end cutscene
```
The following explains various cutscene instructions you can use in order to define a cutscene.

#### The player and despawning

The cutscene editor treats kodama slightly different from other entities, whereas the other spirits are referred to as their natural name.

The reason is that spawning a player during a morning cutscene **will not** despawn it at the end of a cutscene. Instead, once the gameplay starts, kodama can be controlled directly by the player. All other entities spawned within cutscenes will automatically disappear once a cutscene is over!

#### Spawning spirits (in a cutscene!)

```
spawn entity at anchorName aligned direction offset x,y
```
*`entity` is the type of spirit to spawn*

*`anchorName` the anchor to spawn the entity at*

*`aligned` the direction to align. Can be north,west,east,south,center or a combination of each*

*`offset` the offset of pixels from the point of alignment*

The following spirit entities are currently supported:

* ame
* hi
* kodama

Available anchors:

* tree
* floor

Available directions:

* south
* west
* north
* east
* center

#### Examples
```
# spawn kodama on the bottom right of the tree,
# 10 pixels to the right from that position
spawn kodama aligned south,east at tree offset 10,0

# spawn kodama on the top center of the tree
spawn kodama at tree aligned top,center

# spawn kodama at position 100,100
spawn kodama offset 100,100
```

#### Waiting

A very important concept is waiting. This allows certain things to happen before the cutscene continues.

> **PLEASE NOTE! By default, all cutscene steps are played at once, unless you specify waiting!**

```
wait x seconds
```
*`x` is the amount of seconds*

#### Fading in

When a spirit spawns, it directly appears. In order to control a fade effect, do the following right after the spawn instruction:
```
fadeIn entity for x seconds
```
*`entity` is the type of spirit to fade in*

*`x` the number of seconds to fade in*

#### Movement

Entities can be moved during cutscenes. Currently, it is only possible to move entities relatively to their current position:
```
move entity by x,y for 3 seconds looped
```
*`entity` is the type of spirit to move*

*`x` the amount of pixels to move left or right (can be negative)*

*`y` the amount of pixels to move up or down (can be negative)*

*`looped` is completely optional and lets the entity move back and forth between the old and new position*

#### Speech

Entities can talk:
```
say key on entity
```
*`entity` is the type of spirit that should say something*

*`key` is the sentence the entity should say. Must be a translation key*

##### Translations

Define sentences within the `assets/i18n` folder.

For example within: `assets/i18n/translations.properties`
```
cutscene.day1.kodama.01=This is a dialog
```
and within: `assets/i18n/translations_DE.properties` you could define a German translation:
```
cutscene.day1.kodama.01=Das ist ein Dialog
```
Within the cutscene instruction, you then can automatically let the entity say the translated sentence:
```
kodama says cutscene.day1.kodama.01
```
Depending on the language configured on the operating system of the player, the language gets automatically loaded (English is default).

Please choose a name for the sentence that makes sense and is easy to remember. Some bad examples:
```
# very bad - when does he say this? What if I want to add another sentence for a particular day?
cutscene.ame.01=hey
# oops even worse!
sentence1=you
```
Instead, we should have the concept of specific and general sentences per spirit. For example, there might be things certain spirits always say like certain catchphrases etc. while for story, some things are only said once:
```
# general sentences
cutscene.ame.yawn=Yaaaaawn

# day 1
cutscene.day1.ame.01=Oh hey!
cutscene.day1.ame.02=nice to see you
cutscene.day1.hi.01=wow hey
cutscene.day1.hi.02=mhhh

# day 2
cutscene.day2.ame.01=another day, another life
cutscene.day2.ame.02=why? I wanna be friends with you...
cutscene.day2.hi.01=stop talking to me
cutscene.day2.hi.02=mhhh...
```

##### Multiple sentences
A player can say multiple sentences at once:
```
say cutscene.day4.ame.01 on ame
say cutscene.day4.ame.02 on ame
```
It is quite impossible for someone to say two things at the same time, so those sentences get shown after another.

#### Emotes

Entities can emote:
```
emote availableEmote on entity
```
*`entity` is the type of spirit that should emote something*

*`availableEmote` the kind of emote an entity should perform*

Currently supported emotes:

* `smile`
* `confusion`
* `sadness`
* `disagree`
* `agree`

#### Screen shake

You can shake the screen for a given amount of time with a given intensity:
```
shake with intensity a for b seconds
```
*`a` the intensity. Must be greater than 0*

*`b` the number of seconds to shake the screen*

#### Toggling states on entities

It is possible to enable or disable certain properties/states on entities, for example to make them do something very specific like a custom animation or effect.

```
# sets the property on the entity
start activity on entity
# removes the property from the entity
stop activity on entity
```
Currently supported:

* `swiping` (kodama only) kodama starts to brush around

#### Resetting an entity

During a cutscene, you might wanna stop any behavior or movement on a certain entity:
```
reset entity
```
*`entity` is the type of spirit that should be resetted*

### Spawning spirits

Once a day has been defined, it is possible to spawn spirits in various ways.

> **PLEASE NOTE! You cannot define spawning before a morning cutscene or after an evening cutscene!**

The following spirit types are currently supported:

* `ame`
* `hi`
* `kodama`

#### Spawning at a given point in time

```
at x seconds spawn type times amount
```
*`type` is the type of spirit to spawn*

*`x` is the amount of seconds*
*`amount` is the number of entities*

#### Spawning at a progress of the day

```
at x% spawn type times amount
```
*`type` is the type of spirit to spawn*

*`x` is the percentage of how much the day has already passed*

#### Spawning at a given chronological rate

```
every x seconds spawn type
```
*`type` is the type of spirit to spawn*

*`x` is the interval in seconds*

#### Spawning at a given progress rate

```
every x% spawn type
```
*`type` is the type of spirit to spawn*

*`x` is the percentage of the day as an interval*

#### Examples
```
# spawns 4x hi at the middle of the day
at 50% spawn hi 4 times
# spawns 2x ame every 10 seconds
every 10 seconds spawn ame 2 times
```

repository: bitbrain/hamorigami

gha_language: Java

repo_name: bitbrain/hamorigami


text:
# Traffic Light Detection and Classification for Simulator
##### Team Member - Muhamed Kuric
##### Email -<EMAIL_ADDRESS>
# Traffic Light Detection Node

* This part followed mostly the Detection Walkthrough by Stephen and Aaron.

* This node takes in data from the `/image_color`, `/current_pose`, and `/base_waypoints` topics and publishes the locations to stop for red traffic lights to the `/traffic_waypoint` topic.

![Detector](writeup_imgs/tl-detector-ros-graph.png)

* The topic `/current_pose` receives information about the current pose of the vehicle (i.e., localization data), while the topic `/base_waypoints` receives the waypoints that the vehicle should follow (\i.e., planning). The `/image_color` topic receives the raw image from the front-looking camera sensor mounted to the vehicle. The world locations of all traffic lights in the map are also loaded from a configuration file into a lookup table.

* Based on the current pose of the vehicle and the traffic light lookup, we find if a traffic light is visible in front of the vehicle. If so, then we run a classifier that classifies the state of the traffic light (i.e., red vs non-red). If the traffic light was red we send the waypoint index of where this traffic light is located on the path via the `/traffic_waypoint` output topic. Otherwise, we publish a default message which means that there is no red traffic light in front of us, and that the vehicle can continue following its path.

## Traffic Light Classification for Simulator

* In order to train the classifier, we have logged the images from the `/image_color` during a successful automated simulation drive that used groundtruth traffic light state data that is also provided by the simulator. These training images can be found at [training-data](ros/src/tl_detector/sim-training-data/).

* The simulator ensures perfect repeatability of the input images, thus our strategy was to train a simple CNN-based classifier in Keras that overfits to these images. Training and prediction test scripts can be found at [learning](ros/src/tl_detector/train.py) [prediction](ros/src/tl_detector/test_prediction.py).

* The following NN architecture was used with full size camera images as input:
```
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
conv2d_1 (Conv2D)            (None, 586, 786, 8)       5408
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 293, 393, 8)       0
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 281, 381, 16)      21648
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 140, 190, 16)      0
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 130, 180, 24)      46488
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 65, 90, 24)        0
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 57, 82, 32)        62240
_________________________________________________________________
max_pooling2d_4 (MaxPooling2 (None, 28, 41, 32)        0
_________________________________________________________________
conv2d_5 (Conv2D)            (None, 22, 35, 40)        62760
_________________________________________________________________
max_pooling2d_5 (MaxPooling2 (None, 11, 17, 40)        0
_________________________________________________________________
conv2d_6 (Conv2D)            (None, 7, 13, 48)         48048
_________________________________________________________________
max_pooling2d_6 (MaxPooling2 (None, 3, 6, 48)          0
_________________________________________________________________
flatten_1 (Flatten)          (None, 864)               0
_________________________________________________________________
dense_1 (Dense)              (None, 32)                27680
_________________________________________________________________
dropout_1 (Dropout)          (None, 32)                0
_________________________________________________________________
dense_2 (Dense)              (None, 24)                792
_________________________________________________________________
dropout_2 (Dropout)          (None, 24)                0
_________________________________________________________________
dense_3 (Dense)              (None, 2)                 50
=================================================================
Total params: 275,114
Trainable params: 275,114
Non-trainable params: 0
_________________________________________________________________
```

repository: JohnMansell/CarND-Capstone

repo_name: JohnMansell/CarND-Capstone


text:
---
layout: default
---

# 1993-08-19 - Anon: remailer list

## Header Data

From<EMAIL_ADDRESS>(M. Stirner)

To<EMAIL_ADDRESS>Message Hash: be9b2af41a8e64ba06afc28f177133e7104b9a33afe3887a2602fccecc623343

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-08-19 03:20:44 UTC

Raw Date: Wed, 18 Aug 93 20:20:44 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(M. Stirner)
Date: Wed, 18 Aug 93 20:20:44 PDT
To<EMAIL_ADDRESS>Subject: Anon: remailer list
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

 * Reply to msg originally in CYPHERPUNKS

 Uu> Q1: What cypherpunk remailers exist?

 Uu> 1<EMAIL_ADDRESS> Uu> 2<EMAIL_ADDRESS> Uu> 3<EMAIL_ADDRESS> Uu> 4<EMAIL_ADDRESS> Uu> 5<EMAIL_ADDRESS> Uu> 6<EMAIL_ADDRESS> Uu> 7<EMAIL_ADDRESS> Uu> 8<EMAIL_ADDRESS> Uu> 9<EMAIL_ADDRESS> Uu> 10<EMAIL_ADDRESS> Uu> 11<EMAIL_ADDRESS> Uu> 12<EMAIL_ADDRESS> Uu> 13<EMAIL_ADDRESS> Uu> 14<EMAIL_ADDRESS> Uu> 15<EMAIL_ADDRESS>
OK.  It seems that<EMAIL_ADDRESS>(#15) is down.  This is a
shame, as it was the _only_ remailer that would function as an anonymous
remailer for me.  It worked beautifully while it was up.  Its apparent
demise has been reported by other users as well,
.   Several of the remailers listed (2,3,4,5) have _never_ worked using
standard cypherpunks syntax:

::
Request-Remailing-To:

.   All other cypherpunks remailers, reliable or not, retain the footer
addresses automagically inserted by the host box here & are therefore
not in any way anonymous for my purposes.  There was a discussion of a
"cut line" syntax before I temporarily lost access to cypherpunks, but
as far as I know there was never any agreement or implementation (I
shall be pleased to be corrected if this is not the case).
.   Penet.fi will no longer work for me since the forced-password
implementation due to an apparent header conflict with the
X-Anon-Password: line & local host/gate software.
.   Why am I depressed?
.   ~
.   M.

*********************************************************************
*<EMAIL_ADDRESS>- PGP Key D30909 via servers *
* > What country can preserve its liberties if its rulers are not  <*
* > warned from time to time that their people preserve the spirit <*
* > of resistance?  Let them take arms!" - Thomas Jefferson, 1787  <*
*********************************************************************

... Organization: Concerned Norwegians Against Lutefisk, S.F., CA
___ Blue Wave/QWK v2.12
--
M. Stirner - via FidoNet node 1:125/1
UUCP: ...!uunet!kumr!shelter!28!M..Stirner
INTERNET<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [August 1993](/archive/1993/08)

+ Return to "[Johan Helsingius <julf@penet.FI>](/authors/johan_helsingius_julf_at_penet_fi_)"
+ Return to<EMAIL_ADDRESS>(M. Stirner)](/authors/m_stirner_at_f28_n125_z1_fidonet_org_m_stirner_)"

+ 1993-08-19 (Wed, 18 Aug 93 20:20:44 PDT) - Anon: remailer list -<EMAIL_ADDRESS>(M. Stirner)_
  + 1993-08-19 (Wed, 18 Aug 93 23:40:45 PDT) - [Re: Anon: remailer list](/archive/1993/08/fddc526447cf096847fdb1a4d39d09e81368ae5dc6069c76947e032e3805d333) - _Johan Helsingius<EMAIL_ADDRESS>


text:
# upload-js

Upload multiple with javascript...

## Get Started
### Copy this script 'upload.js' for DEVELOPMENT into your HTML
```
<script src="src/upload.js"></script>
```
### OR use this CDN for PRODUCTION
```
<script src="https://www.cdn.lamhotsimamora.com/upload-js/"></script>
```

### Put the input file into your HTML, for example id = "file_1" and name = "file_1" (id and name of INPUT file must be SAME)
```
<input type="file" id="file_1" name="file_1">
<input type="file" id="file_2" name="file_2">
<input type="file" id="file_3 name="file_3">
<input type="file" id="file_4" name="file_4">
```

### Use this code for uploading multiple files to server
```
_upload = new Upload({
		// Array
		el    : ['file_1','file_2','file_3','file_4'],
		// String
		url   : 'server-side/upload.php',
		// String
		data  :  {
                    id: 1
                },
		// String
		token : 'abcde12345'
	}).start(($response)=>{
		  console.log($response);
	});
```

### For example i use PHP as server side, so create file 'upload.php' and write code like this
```
<?php

// Try to receive files...

if (isset($_FILES))
{
	var_dump($_FILES);
}else{
	echo 'Nothing...';
}
```

repository: lamhotsimamora/upload-js

repo_name: lamhotsimamora/upload-js


text:
# Minimal (off TF grid) test setup

### Step 1: Get yourself a private overlay network

Zerotier is a technology that provides overlay networking capabilities. In the current version of the TF Grid, we use Zerotier networking technology to connect nodes on a grid and provide the necessary connectivity.  The next version of Zero-OS will use ipv6 natively to provide node connectivity.

### Step 2: Setup a private zerotier network.

Getting an overlaid network is essential - all connectivity requirements are currently delivered by zero tier technology
- Go to: https://my.zerotier.com/login
- Create an account
- Log in to account
- Create a specific - test setup network: https://my.zerotier.com/network

![](zerotier_creata_network.png)

Download the zero tier network client one or more controlling PC’s.  Choose the right version for the OS: https://www.zerotier.com/download/

![](download_client.png)

Further instructions on how to create, install and get the private overlay network installed can be found on the zero tier web site.

Now we should be able to ping all devices connected to the zero tier networks regardless of where these devices are located.  It is an overlay network working behind NAT and FW’ed connections.

### Step 3: Get the Zero-OS bootloader

Take the zero tier network ID and go to http://bootstrap.grid.tf

Choose the master branch of the Zero-OS and input the zero tier network ID

![](step1_2.png)

Enable the development flag:  This disables a lot of the security features on the Zero-OS and allows you to connect to the Zero-OS without being authenticated.

![](step3.png)

Choose which bootloader method you want to use and download the correct image/script that belongs to that method

![](select_bootloader.png)

Depending on the use case (virtual/physical) make a physical boot of the device using the selected method for the Virtualisation technology.
In this case - configure Virtualbox to boot the iso image
After a while of will be booted completely (depending on your network speed)

![](zero_os_booting.png)

And you can see the zero tier address of your private (zero tier) network, and the assumed private IP addresses. In your zero tier management portal there is a section with private overlay members.  Your booted Zero-OS should show up as a new member and you need to authorize it to become part of the secured overlay network.

At this point, you should have been able to get the following items done.  These need to be finished otherwise you will not be able to connect to your private, off-grid, unsecured Zero-OS machine.

1. Create a zero tier account and an overlay network
2. Download, install and configure the zero tier client for your laptop to connect with
3. Configure and Download the Zero-OS bootloader in the preferred format for your specific setup:  USB, ISO, PXE script.
4. Accept the booted Zero-OS node in your private overlay network.  This network should now have two nodes as a minimum:  Your laptop and your Zero-OS machine.

###  Step 4: Download and install the Zero-OS container manager

The Zero-OS container manager has been designed and created to hide a lot of complexity for simple testing of the effectiveness of the operating system and containers running on it.  It provides a simple interface for experimenting with a private setup.  The software is opensource and can be found here: https://github.com/threefoldtech/zos

The specific instructions to build the zos client on your operating systems are [here](https://github.com/threefoldtech/zos/blob/development/doc/building.md).  You have successsfully installed the zos client you should be able to run it (depending on where you have put the binary) as follows:

![](zos_commandline.png)

### Step 5: Launch and stop containers.

Here we assume that the IP address of the booted Zero-OS machine is `<IP_ADDRESS>`.  We add the machine to the zos configuration file:

```
zos configure --name="github-demo" --address=<IP_ADDRESS>
zos setdefault github-demo
```

After doing this the zos client is set to use the "GitHub-demo" machine as a default target and this can be tested by doing the following test-ping: `

```
zos ping
"PONG Version: master @Revision: b1a1a737352fce69fd71de5f8cf1ae175f4bdcab"
```

The zos container management app has a rich set of commands to launch, configure and stop containers.

```
Weynands-MacBook-Pro:testnetv0.1 weynandkuijpers$ zos
Usage:
  zos init --name=<zosmachine> [--disksize=<disksize>] [--memory=<memorysize>] [--redisport=<redisport>] [--reset]
  zos configure --name=<zosmachine> [--address=<address>] [--port=<port>] [--setdefault] [--vbox]
  zos remove --name=<zosmachine>
  zos forgetvm --name=<zosmachine>
  zos ping
  zos showconfig
  zos setdefault <zosmachine>
  zos showactiveconfig
  zos showactive
  zos cmd <zoscommand> [--jsonargs=<args>]
  zos exec <command>
  zos container new [--name=<name>] [--root=<rootflist>] [--hostname=<hostname>] [--ports=<ports>] [--env=<envvars>] [--sshkey=<sshkey>] [--privileged] [--ssh]
  zos container inspect
  zos container info [--json]
  zos container list [--json]
  zos container <id> inspect
  zos container <id> info
  zos container <id> delete
  zos container <id> zerotierinfo
  zos container <id> zerotierlist
  zos container zerotierinfo
  zos container zerotierlist
  zos container <id> zosexec <command>
  zos container zosexec <command>
  zos container <id> sshenable
  zos container <id> sshinfo
  zos container <id> shell
  zos container <id> exec <command>
  zos container <id> js9 <command>
  zos container js9 <command>
  zos container <id> mount <src> <dest>
  zos container mount <src> <dest>
  zos container sshenable
  zos container sshinfo
  zos container shell
  zos container exec <command>
  zos container <id> upload <file> <dest>
  zos container <id> download <file> <dest>
  zos container upload <file> <dest>
  zos container download <file> <dest>
  zos help <cmdname>
  zos --version
```

To list the running containers on the Zero-OS you enter the following command:

```
zos container list
+----+-----------+---------------+---------------------------------------------------------------+
| ID | Name      | Ports         | Root                                                          |
+----+-----------+---------------+---------------------------------------------------------------+
| 1  | zrobot    | zt*:6600:6600 | tf-official-apps/threefoldtech-0-robot-autostart-latest.flist |
+----+-----------+---------------+---------------------------------------------------------------+
```

To launch a new container you can get the required flist (file list, software can be found [here](https://github.com/threefoldtech/0-flist)) from the central hub on which these flists are collected and made avaiable to TESTNET users.  The principle of an flist is that the binaries needed to run the containerised applications are stored in a central hub (which can be many - the TESTNET one is one we installed bu you can create your own based on the software presented [here](https://github.com/threefoldtech/0-hub).

![](hub_splash.png)

Let's take an example flist to showcase the simple structure of commands to launch a container: mongoDB

![](mongo_flist.png)

In order to launch the container we need to URL that point to the flist and parse it to the process manager on the Zero-OS.  The URL pointer to the flist is:
```
https://hub.grid.tf/weynand/mongo-latest.flist
```

Launching a container is done as follows:

```
Weynands-MacBook-Pro:~ weynandkuijpers$ zos container new --name="mongodb" --root=https://hub.grid.tf/weynand/mongo-latest.flist
INFO preparing container
INFO sending instructions to host
INFO container 3 is created.
INFO creating portforward from 1024 to 22
INFO waiting for private network connectivity
container private address: <IP_ADDRESS>
Weynands-MacBook-Pro:~ weynandkuijpers$ zos container list
+----+---------+---------------+---------------------------------------------------------------+
| ID | Name    | Ports         | Root                                                          |
+----+---------+---------------+---------------------------------------------------------------+
| 1  | zrobot  | zt*:6600:6600 | tf-official-apps/threefoldtech-0-robot-autostart-latest.flist |
| 3  | mongodb | 1024:22       | weynand/mongo-latest.flist                                    |
+----+---------+---------------+---------------------------------------------------------------+
```

So we have a mongoDB running.  In order to inspect it the zos client has a built in feature to start an openssh daemon to provider remote access.  This will not be available in the production version of the Zero-OS but come in very handy for testnet.

```
Weynands-MacBook-Pro:~ weynandkuijpers$ zos container 3 sshenable
INFO adding SSH support to your container
INFO SSH support enabled
INFO waiting for private network connectivity

 * sshd is running

INFO waiting for private network connectivity
<EMAIL_ADDRESS>-p 1024
Weynands-MacBook-Pro:~ weynandkuijpers$ ssh<EMAIL_ADDRESS>-p 1024
^C
Weynands-MacBook-Pro:~ weynandkuijpers$ zos container 3 zerotierlist
[
  {
    "allowDefault": false,
    "allowGlobal": false,
    "allowManaged": true,
    "assignedAddresses": [
      "fc2e:9ff1:749b:f647:5a1c:0000:0000:0001/40",
      "<IP_ADDRESS>/16"
    ],
    "bridge": false,
    "broadcastEnabled": true,
    "dhcp": false,
    "id": "9bee8941b5717835",
    "mac": "36:e3:87:f2:1b:95",
    "mtu": 2800,
    "name": "tfgrid_public",
    "netconfRevision": 3,
    "nwid": "9bee8941b5717835",
    "portDeviceName": "zt3jn7qoma",
    "portError": 0,
    "routes": [
      {
        "flags": 0,
        "metric": 0,
        "target": "<IP_ADDRESS>/16",
        "via": null
      }
    ],
    "status": "OK",
    "type": "PUBLIC"
  }
]
```

From this `zerotierlist` command we can deduct which private IPv4 address is associated with the mongoDB container and have enabled the openssh deamon allowing us to access the container through ssh:
```
Weynands-MacBook-Pro:~ weynandkuijpers$ ssh<EMAIL_ADDRESS>Warning: Permanently added '<IP_ADDRESS>' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.14.82-Zero-OS x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

root@mongodb:~# ps
  PID TTY          TIME CMD
   83 pts/0    00:00:00 bash
   94 pts/0    00:00:00 ps
root@mongodb:~# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 11:32 ?        00:00:00 /coreX -hostname mongodb -unprivileged
zerotie+     9     1  0 11:32 ?        00:00:01 mongod --bind_ip_all
root        60     1  0 11:34 ?        00:00:00 /usr/sbin/sshd
root        69    60  0 11:35 ?        00:00:00 sshd: root@pts/0
root        83    69  0 11:35 pts/0    00:00:00 -bash
root        95    83  0 11:35 pts/0    00:00:00 ps -ef
root@mongodb:~#
```


text:
# swift-coding

![Bitrise Build Badge](https://app.bitrise.io/app/e6e8163c7f141139.svg?token=aVhm-ktqKllsLkhHQ_JrvQ)

A protocol witness-oriented library for creating functional encoding and decodings, built on top of Codable.

[NSScreencasts series on Codable witnesses](https://nsscreencast.com/series/54-codable-witnesses)

repository: lukeredpath/swift-coding

gha_language: Swift

repo_name: lukeredpath/swift-coding


text:
# Block package for MotorBit

### micro:bit Pin Assignment

* ``P0`` -- Analog Input 0 for Buzzer
* ``P13`` -- Digital Input/Output and AnalogWrite/Servo1
* ``P14`` -- Digital Input/Output and AnalogWrite/Servo2
* ``P8`` -- DigitalWrite Pin for DC motor control direction 1
* ``P1`` -- AnalogWrite Pin for DC motor speed control 1
* ``P12`` -- DigitalWrite Pin for DC motor control direction 2
* ``P2`` -- AnalogWrite Pin for DC motor speed control 2

### Motor control Block

Use motor block to drives motor forward and backward. The speed motor is adjustable between 0 to 100.

* The dirrection must be select either `Forward` or `Backward`
* Speed is an integer value between `0 - 100`

```blocks
iBIT.Motor(motor.Forward, 100)

iBIT.Motor(motor.Backward, 100)
```

### Spin Block

Spin block is used to control both motors separately. For example, choose one motor spin with forward direction another one spin with backward direction.

* The Spin select direction must be either `Left` or `Right`
* Speed is an integer value between `0 - 100`

```blocks
iBIT.Spin(spin.Left, 100)

iBIT.Spin(spin.Right, 100)
```

### Turn Block

The Turn block is used to to control the robot movment by turning. The one motor will stop, another one is moving. The vipot point is a center of the robot body.

* The Turn select direction must be either `Left` or `Right`
* Speed is an integer value between `0 - 100`

```blocks
iBIT.Turn(turn.Left, 100)

iBIT.Turn(turn.Right, 100)
```

### Motor Stop Block

The Motor Stop block is used to stop both motors. The speed is set to `0` automatic.

```blocks
iBIT.MotorStop()
```

### Servo Block

Use this block for control the servo's moving degree from 0 to 180

* Degree is an integer value between `0 - 180`

```blocks
iBIT.Servo(servo.SV1, 90)
```

### ReadAD Block

This block is used to read the analog input data from the I2C-based ADC integrated circuit, ADS7828. The resolution of conversion is 12-bit. Data will be 0 to 4095. iBIT have 8-ch analog inputs. The pinout voltage range is 0 to +3.3V

* Analog sensor port are `ADC0 - ADC7`
* Select analog channel from `ADC0 - ADC7` for reading the analog sensor.
* Get the analog value to set the conditions for the robot's mission.

```block
iBIT.ReadADC(readADC.ADC0)
```

### Example

* Read the analog input 0 and display the conversion data on micro:bit. User can change the analog channel any time.

```blocks
basic.showNumber(iBIT.ReadADC(readADC.ADC0))
```

* Drive the motors with Forward and Backward by counting speed `0 - 100`

```blocks
let speed = 0
basic.forever(() => {
    for (let speed = 0; speed <= 100; speed++) {
        iBIT.Motor(motor.Forward, speed)
        basic.pause(50)
    }
    for (let speed = 0; speed <= 100; speed++) {
        iBIT.Motor(motor.Backward, speed)
        basic.pause(50)
    }
})
```

* Drive the motors by pressing button `A` and `B`. Turn Left by speed 50 when pressed button `A` and Turn Right by speed 50 when pressed button `B`.

```blocks
input.onButtonPressed(Button.A, () => {
    iBIT.Turn(turn.Left, 50)
})
input.onButtonPressed(Button.B, () => {
    iBIT.Turn(turn.Right, 50)
})
```

* Spin the motors by pressing button `A` and `B`. Spin Left by speed 50 when pressed button `A` and Spin Right by speed 50 when pressed button `B`.

```blocks
input.onButtonPressed(Button.A, () => {
    iBIT.Spin(spin.Left, 50)
})
input.onButtonPressed(Button.B, () => {
    iBIT.Spin(spin.Right, 50)
})
```

* Example for Servo, drive the servo motor's movement angle at Servo output 1 and 2 from `0 - 180` and back to 0 to restart again.

```blocks
basic.forever(() => {
    for (let Degree = 0; Degree <= 180; Degree++) {
        iBIT.Servo(servo.SV1, Degree)
        iBIT.Servo(servo.SV2, Degree)
        basic.pause(10)
        while (Degree == 180) {
            Degree = 0
        }
    }
})
```

repository: RobotStem/MotorBit

repo_name: RobotStem/MotorBit