text:
---
title: Chainlink
description:
published: true
date: 2021-05-07T05:04:08.374Z
tags: ethereum, chainlink
editor: markdown
dateCreated: 2021-03-15T22:11:29.840Z
---

![Chainlink](https://txstreet.com/static/img/singles/house_logos/chainlink.png)

## Summary{#summary}

[Chainlink](https://chain.link/) is a decentralized network of oracles (data providers) based on the Ethereum blockchain that provides reliable tamper-proof inputs and outputs for smart contracts on any blockchain.

## Config{#config}

Below is a json config file used by TxStreet, including a list of contracts.
[chainlink.json](/ethereum/houses/chainlink.json)


text:
# countdown-lite

This plugin counts how much time is left until the date you set.

## Install

Use [NPM](https://www.npmjs.com/package/countdown-lite) to download latest version of a plugin and install it directly in your project.

```sh
$ npm install countdown-lite
```

## Usage

In order to use this plugin you don't need to install jQuery or another library! You just need to:

1. Add the latest countdown-lite.js file or minified countdown-lite.min.js.

```html
<script src="/your-path/countdown-lite/countdown-lite.js"></script>
```

2. Set the following classes:

```html
<div class="countdown">
  <div class="any class">
    <span class="countdown__days">00</span>
    <span class="countdown__days-text">Days</span>
  </div>

  <div class="any class">
    <span class="countdown__hours">00</span>
    <span class="countdown__hours-text">Hours</span>
  </div>

  <div class="any class">
    <span class="countdown__minutes">00</span>
    <span class="countdown__minutes-text">Minutes</span>
  </div>

  <div class="any class">
    <span class="countdown__seconds">00</span>
    <span class="countdown__seconds-text">Seconds</span>
  </div>
</div>
```

3. Set the "data-time" attribute to div with class="countdown". Write the date in this format: "Month" 'space' "day" 'space' "year" 'comma' "24-hour time format with UTC".

```html
<div class="countdown" data-time="October 1 2021, 00:00 UTC">.......</div>
```

If you live in UTC+1,... UTC+2,... UTC-5,... and you want the countdown-lite to work based on your time, you should write this in the "data-time".

```html
<div class="countdown" data-time="October 1 2021, 00:00 UTC-4">.......</div>
```

4. Write this to the end of your js file:

```js
var countdown = countdownLite();
```

## Settings

1. If you want the plugin to count only hours, minutes and seconds, you need to:

   1.1 Add another js file (countdown-lite-hours.js or minified countdown-lite-hours.min.js) instead of the previous one.

   ```html
   <script src="/your-path/countdown-lite/countdown-lite-hours.js"></script>
   ```

   1.2. Remove the span with class="countdown**days" and span with class="countdown**days-text":

   ```html
   <div class="countdown">
     <div class="any class">
       <span class="countdown__hours">00</span>
       <span class="countdown__hours-text">Hours</span>
     </div>

     <div class="any class">
       <span class="countdown__minutes">00</span>
       <span class="countdown__minutes-text">Minutes</span>
     </div>

     <div class="any class">
       <span class="countdown__seconds">00</span>
       <span class="countdown__seconds-text">Seconds</span>
     </div>
   </div>
   ```

2. If you want to disable the plugin when the screen width is decreasing (e.g. starting at 768 pixels):

Replace it

```js
var countdown = countdownLite();
```

with it

```js
if (window.innerWidth > 769) {
  var countdown = countdownLite();
}
```

## History

1. I took this script from the open source codepen.io: https://codepen.io/mosmain/pen/MWazJPO. The author gave me permission.
2. Translated the comments and some words in functions into English.
3. Made a separate js file.
4. Created another file that only counts hours, minutes and seconds.
5. Write it right now:)

## License

[MIT](https://github.com/mountain-climber/countdown-lite/blob/main/LICENSE.md)

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Nesty Chat!

Realtime chat with support for multiple lobbies and a bot that receives commands to query stock quotes.
eg: /stock=aapl.us

## Tech-stack:
  * NestJs
  * Angular(8)
  * RabbitMq

## How to run:

### Clone:
  ``` git clone https://github.com/bnapky/nesty-chat.git ```

### Requirements:
  * Node version > 9
  * RabbitMQ server running on default ports.

#### Run backend:
  1. cd nesty-chat
  2. npm i
  3. npm start

#### Run stocky-bot:
  0. Install and setup RabbitMQ server.
  1. cd stocky-bot
  2. npm i
  3. node main.js

#### run front-end
  1. cd nesty-chat-client
  2. npm i
  3. npm start
  4. navigate to http://localhost:4200/

### Features

* Jwt Authentication on rest API endpoints and web socket connections.
* Local strategy to login and register.
* User encrypted password and strength validation
* Multiple Lobbies
* Angular(8) Material Front-end quickly put together that looks horrible :D
* In-memory database for a development environment.

* Linting and running tests on pre-commit
* VsCode debugger support

* Example spec files (jest)
  * UserService
  * AuthService
  * ChatGateway

* Example mocking of services and repositories
  * UserMockService
  * AuthMockService

### Query stock quotes with a command
Login and input command /stock={stock_code} to query stock quotes from https://stooq.com
eg: /stock=aapl.us

### Stay in touch

- Author - [Brandon Napky](https://www.linkedin.com/in/brandon-napky-747826b8/)

### License
  This project is [MIT licensed](https://en.wikipedia.org/wiki/MIT_License).

repository: bnapky/nesty-chat

branch_name: refs/heads/master

gha_language: TypeScript

repo_name: bnapky/nesty-chat


text:
# Setting Up Go

This tutorial targets MacOS, and summarizes the [official guide][1].

Please verify that this command produces a valid path, and that the path exists:

```shell
go env GOPATH
```

## Checking Out Projects

Go expects projects to be namespaced within `$GOPATH`.
See [Import Paths in the official guide][2].

To check out this project, you'd do like so:

```shell
mkdir -p ${GOPATH}/src/github.com/samsung-cnct/
cd ${GOPATH}/src/github.com/samsung-cnct/
git clone git@github.com:samsung-cnct/technical-on-boarding.git ./technical-on-boarding
```

[1]: https://golang.org/doc/code.html
[2]: https://golang.org/doc/code.html#ImportPaths

gha_language: Go


text:
Browser Extension Scaffolding

## Development installation
For development you need a [node.js](https://nodejs.org).

To launch the development environment, follow these steps:

1.  open console from the project root
2.  run the command `npm install`
3.  run the command `npm run start`
4.  enjoy the development.

## Production version installation
For making build you need a [node.js](https://nodejs.org).

To get production bundle, follow these steps:

1.  open console from the project root
2.  run the command `npm install`
3.  run the command `npm run build`
4.  in project root will be created 'build' folder with UI bundle, witch can be used on production server.

## All npm commands

`npm run start` - launch the development environment

`npm run build` - build the product version in the `build` folder

`npm run test` - run tests when changing files

`npm run lint` - run eslint

`npm run typecheck` - run TypeScript typechecing

## Technology

Used technology stack: [TypeScript](https://www.typescriptlang.org/) [React](https://reactjs.org/)

repository: pavyarov/extension-scaffolding

gha_language: JavaScript

repo_name: pavyarov/extension-scaffolding


text:
---
layout: til
title: "Materialize the Query Result for Performance"
date: 2019-05-12
author: Lei Ma
comments: true
category:
- data
tag:
- Data Warehouse
- Big Query
excerpt: Materialize the query result for multistage queries to make your query faster and lower the costs.
---

Write the results to a table for multistage query it is costing to much data.

In many operations such as row_number it will cost a lot more data than the selected columns. Writing to a destination table would save some data.


text:
# ie-console-patch

Protection against any stray console.log causing JavaScript errors in older browsers.
Borrowed from [html5-boilerplate](https://github.com/h5bp/html5-boilerplate)

## Installation

With [npm](http://npmjs.org) do:

```bash
$ npm install ie-console-patch --save
```

Install with [component(1)](http://component.io):

```bash
$ component install nk-components/ie-console-patch
```

## License

MIT

repository: nk-components/ie-console-patch

repo_name: nk-components/ie-console-patch


text:
# _General Start_
**`1: the beginning`**
```
We start by importing the libraries that we need and then some internalisation work, then we jump to check the version
of the used python if it's 2.7 or higher.
```
**`2: creating helper classes`**
```
We create an Error class to handle thrown exceptions, and in it, are 2 classes: one for Unix and one for Windows. Each
one initializes itself by importing more required libraries. We also have other methods in case it is linux. Then we
initialize one object from this class, in order to get characters from standard input.
```
**`3: doing the work`**
```
Now we define the main, and in it we start by listening to the ctrl-c, in case the user wants to cancel submission. Then
we get and parse the command line args and we put it all in a args object by using the argparse.ArgumentParser(). We
check to see if the user wants more detailes about the submision process by checking the verbose in args if it existes.
Now we sumbit the slug and exit with exit code 0.
```
# _Submission process_
**`1: checking connection and git version (414->434)`**
```
Check to see if git is installed, is a working version, then throw error if not to quit. Now we show the user that we
connecting to git, by calling the progress("Connecting"). Here we comunicate with the git api and we gete the headers.
We also set the current time and format it, then save it as a string.
```
**`2: get list of files to handel and ensure that the branch is valid (434->447)`**
```
We ensure that the slug exists in the branch from the submit50 repo, and if yes, then we get the list of files to upload
, and the list of files to exclude. If the slug is invalid, then we throw an exeption, and catch it in the catch section
, to tell the user to chech the slug, if s/he mistyped.
```
**`3: check for missing files and authenticating the connection with github (447->494)`**
```
We check if somthing is missing from the list that we recived from before, and if something is missing, we alert the
user by printing the name of the missing files names, and throw an error to end the submmision process.
If all is good, we start authenticating the user to the github repo to uploead the requiered files. The authentication
process can be via SSH, and if this failes, we use HTTPS, then we tell the user that we are preparing to upload the files.
```
**`4: clone repo, update and cache credentials, and check files (494->590)`**
```
We clone the repository, and if that fails, we tell the user why, and then we throw and exeption and stop the submmision.
We update the user's credentials that are stored in the config file localy. Get the list of files that we want to submit
and the list of files to ignore, then we unescape them and also hide the .gitattributes file from output. We also check
for large files to exclude from submmision. If any file is too huge to be submited, we raise an error and quit. If we
encounter large files, we install ilf from git and re-add the files to submission by force.
```
**`5: confirmation and uploading process (590->630)`**
```
Display files that will/will not be submitted, then ask the user to cinfirm submisstion. If yes, we display uploading to
him/her and commit to the branch, then we push. In the end we say successful submission, and we stop all.
```

repository: fozatkardouh/submit-and-check-for-RC

repo_name: fozatkardouh/submit-and-check-for-RC


text:
# optimal_balancer

A simple tool for calculating the optimal number of shares to buy to maintain a proportional portfolio.

The tool takes into account the current price of each fund, the number of shares of each fund already in the portfolio, and the desired target proportion of each fund. From that information, it calculates the optimal number of shares of each fund to buy to get closest to the desired target proportion for the portfolio, using a "buy only" strategy.

## Installation

```sh
$ cargo install --git https://github.com/bcongdon/optimal_balancer --branch main
```

## Usage

```
optimal_balancer 1.0

USAGE:
    optimal_balancer [FLAGS] [OPTIONS] --config <config>

FLAGS:
    -d, --download-current-prices
    -h, --help                       Prints help information
    -V, --version                    Prints version information

OPTIONS:
    -c, --config <config>
    -t, --target-buy <target-buy>
```

### Examples

```sh
$ optimal_balancer --config path/to/config

# Download the current price for ticker symbols at runtime.
$ optimal_balancer --config path/to/config --download-current-prices
```

### Config File Format

```toml
# The desired total purchase price of new shares. ($)
target_buy = 6000.0

# A list of funds in the portfolio.
[[funds]]
symbol = "BND"              # The fund's ticker symbol.
shares = 100                # The number of shares already owned.
price = 85.40               # The current share price.
target_proportion = 0.15    # The desired fund allocation in the portfolio.

[[funds]]
symbol = "VTI"
shares =  200
price = 216.3
target_proportion = 0.70

[[funds]]
symbol = "VXUS"
shares =  100
price = 65.66
target_proportion = 0.15
```

**Notes:**

- You can omit including the `price` for each fund, and pass the `-d` flag to have price be downloaded at runtime (uses yahoo-finance data).
- The sum of `target_proportion`s for all funds in the config should be 1.

## Attribution

Uses the excellent [z3](https://docs.rs/crate/z3/) crate for calculating the optimal strategy.


text:
Guide: Test Mode

#### Since:

* `v2.2.0`

## Introduction

In test mode, SugarCube will wrap all macros, and some non-macro markup—e.g., link & image markup—within additional HTML elements, called "debug views" ("views" for short).  Views make their associated code visible, thus providing onscreen feedback—they may also be hovered over which, generally, exposes additional information about the underlying code.

**WARNING:** Because of the additional HTML elements added by the debug views, some nested markup and selectors may be broken.  This only affects test mode.

In versions of SugarCube ≥v2.23.0, the debugging interface offers additional tools, namely variable watches and arbitrary history navigation.

## Enabling Test Mode

### Automatically

#### In Tweego

To enable test mode, use the testing option (`-t, --test`).

#### In Twine 2 (≥v2.2)

To enable test mode from the *Stories* screen, click on the story's gear menu and select the *Test Story* menu item.

To enable test mode from the story editor/map screen, click on the *Test* menu item (right side of the bottom bar).

To enable test mode from the story editor/map screen while starting at a specific passage, hover over a passage and select the ** menu item.

#### In Twine 2 (<v2.2)

To enable test mode from the *Stories* screen, click on the story's gear menu and select the *Test Play* menu item.

To enable test mode from the story editor/map screen, click on the *Test* menu item (right side of the bottom bar).

To enable test mode from the story editor/map screen while starting at a specific passage, hover over a passage and select the ** menu item.

#### In Twine 1

To enable test mode while starting at a specific passage, right-click on a passage and select the *Test Play From Here* context menu item.

**NOTE:** Unfortunately, due to limitations in the current release of Twine 1, the *Build* menu's *Test Play* menu item is not able to trigger test mode.  You may, however, simply use the *Test Play From Here* context menu item on the `Start` passage to achieve the same result.

### Manually

You may forcibly enable test mode manually by setting the `Config` object's `debug` property to `true`.  For example:

```
Config.debug = true; // forcibly enable test mode
```

See [`Config.debug`](#config-api-property-debug) for more information.

## Debug Bar (≥v2.23.0)

The debug bar (bottom right corner of the page) allows you to: watch the values of story and temporary variables, toggle the debug views, and jump to any moment/turn within the history.

The variable watch panel may be toggled via the *Watch * button.  To add a watch for a variable, type its name into the *Add* field and then either press enter/return or click the ** button—n.b. depending on the age of your browser, you may also see a list of all current variables when interacting with the *Add* field.  To delete a watch, click the ** button next to its name in the watch panel.  To add watches for all current variables, click the ** button.  To delete all current watches, click the ** button.

The debug views may be toggled via the *Views * button.

To jump to any moment/turn within the available history, select the moment/turn from the *Turn* select field.

## Debug Views (≤v2.22.0)

The debug views themselves may be toggled on and off (default: on) via the *Debug View* button (top of the UI bar).

If you've removed/hidden the UI bar, a construct like the following will allow you to toggle the views on and off:

```
<<button "Toggle Debug Views">><<script>>DebugView.toggle()<</script>><</button>>
```

**NOTE:** That only toggles the views, test mode must still be enabled first.


text:
# angularx-qrcode sample app
Angular6 demo app with a working implementation of angularx-qrcode.

angularx-qrcode is an Angular4/5/6/6.1 QRCode generator Component library for QR Codes (Quick Response) with AOT support.

angularx-qrcode Repository: https://github.com/Cordobo/angularx-qrcode

## Installation

0. Install angular globally: `npm install -g @angular/cli`
1. Clone the "angularx-qrcode-sample-app" repository. The "master" repository contains the Angular 6.1 demo app,
use the branch "angular5" or "angular6" for a demo app with Angular 5 or Angular 6 support
2. Run `npm install` to install all dev dependencies.
3. Run `ng serve --open`
4. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## License
(MIT License)

Copyright (c) 2018, [Andreas Jacob (Cordobo.com)](http://cordobo.com/)

gha_license_id: MIT


text:
# Placeholder
[![](https://jitpack.io/v/Tlaster/Placeholder.svg)](https://jitpack.io/#Tlaster/Placeholder)

Let you have `Placeholder` in Jetpack Compose

<img src="image/image.gif" height=400>

# Usage
Add Jitpack
```
maven { url 'https://jitpack.io' }
```
Add the dependency
```
implementation "com.github.Tlaster:Placeholder:$version_Placeholder"
```
Example
```kotlin
ListItem(
    icon = {
        Placeholder(
            modifier = Modifier
                .size(32.dp)
                .clip(CircleShape),
            delayMillis = 100,
        )
    },
    text = {
        TextPlaceHolder(
            length = 50,
            delayMillis = 100,
        )
    },
)
```

# License
```
MIT License

Copyright (c) 2021 Tlaster

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

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

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

repository: Tlaster/Placeholder

repo_name: Tlaster/Placeholder


text:
I like Lua. I don't like how Lua handles globals. If you forget to use "local" or you misspell something when assigning, you've just made a new global. You can quarantine stuff with "require" but if the "require" assigns any globals, it stomps your namespace. Annoying. Fortunately Lua has such powerful metaprogramming you can add namespace support to the language in pure Lua. So I did.

# How to use

This repo consists of one file, [namespace.lua](namespace.lua). To use it, copy namespace.lua into your Lua project. Then put this at the top of your entry point file:

    namespace = require "namespace"

After this, at the top of each file you require, declare the namespace name:

    namespace "WHATEVER"

Every file with the same namespace key will have the same globals. Simple.

**namespace.lua only works with Lua 5.1.**

This repo has a simple [example](example). To run it, run `lua example/example.lua` from the root.

# Features

The functions in namespace.lua are documented in the file itself (it's short). However, here's an overview of some things it can do:

## Inheritance

If you say `namespace("namespace1", "namespace2")` at the top of your file, you are specifying you want "namespace1" to inherit from "namespace2". If this is the first time "namespace1" has been used, it will be created by copying all the variables out of "namespace2". The copying only happens once, variables added to "namespace1" afterward will not be visible in "namespace2".

## Single-use namespaces

If you say just `namespace()` at the top of your file, the file will get a single-use namespace not shared by any other file. If you say `namespace(nil, "namespace2")` your single-use namespace will inherit from "namespace2".

## Access namespaces as tables

Saying `local namespace1 = namespace.space("namespace1")` will store the globals table for "namespace1" as a table. You can inherit a namespace when you do this, with `namespace.space("ns1", "ns2")`.

## Prepared setup

Maybe you know which namespace a particular other namespace should inherit from, or you have some symbols you want to preload into the namespace. But: you don't know what order your files will be required in, or aren't sure if files will get required at all.

You can set the inheritance for a namespace ahead of time, by saying `namespace.prepare("namespace1", "namespace2")`. Then, later, you can just say `namespace "namespace1"` and it will already know "namespace1" should inherit from "namespace2".

Alternately, you can say

    namespace.prepare("namespace1", nil, function(ns1) -- No inherit
    	ns1.aglobal = 5
    end)

This doesn't create "namespace1", but it prepares the function so that it will be called (and assign the global variable "aglobal" into namespace1) the first time "namespace1" is used.

## Safe require

Maybe you need to require a lua file you did not write, and you're afraid it might set some globals. If you let namespace.lua do the requiring for you, with `namespace.require("something")`, then something.lua will be required but something.lua (and any new files something.lua requires) will be executed in a new, quarantined single-use namespace.

You can also specify a namespace for your required file to run in, and an inherit namespace as well, with `namespace.require("something", "namespace1", "namespace2")`

# Advanced features

That should be all you need! But if you want to get fancy...

## Changing the origin

If you create a namespace, but don't specify a namespace to inherit from, the new namespace will inherit from the Lua "default environment"-- that is, [getfenv(0)](http://lua-users.org/wiki/EnvironmentsTutorial), the globals table which is set by default at the start of each file (before you call `namespace()`).

This can be a problem because if you've been using `require()` instead of `namespace.require()`, those files could be polluting the default environment with global symbols you don't want. If however you call:

    namespace.origin()

It will set an "origin" table which namespace() will inherit-by-default from instead of the Lua default environment. If you call `namespace.origin()` without any arguments, it will set the origin by making a **copy** of the current default environment; you can also pass in a string name to set a particular namespace as the origin.

The way I recommend using namespace.lua is setting up all your namespaces in your entry point file before you do anything else. But if you don't do it that way, it's a good idea to call `namespace.origin()` right after saying `namespace = require "namespace"` so when you start creating namespaces later, they don't pick up symbols you don't expect.

## "Unpolluting" the default environment

Let's say, after setting the origin, you call vanilla require() a bunch and it pollutes the default environment. If you call:

    namespace.unpollute()

It will replace the default environment with a copy of the origin.

I don't think there's actually a good use for this feature. If you have been using `namespace()` and `namespace.require()`, you should never need it.

## Raw tables

In situations where you pass in a namespace name-- for example, the "inherit" argument on any function, or the argument to `namespace.origin()`-- you can pass in a table, and that raw table will be used. I do not recommend doing this unless you're already familiar with `setfenv()` and you really known what you're doing. If you do this clumsily you can do things like create a namespace where `print` and `require` don't exist.

# Changelog

**Version 1.1:** Allow a prepare() namespace to inherit from another prepare() namespace; fixes to error messages
**Version 1.0:** Initial release

# License

namespace.lua was written by Andi McClure<EMAIL_ADDRESS>It is available to you under the zlib license, which I interpret to mean that if you redistribute namespace.lua as source code you must include a credit to me, but if you package it into some kind of executable binary with source inaccessible you are not bound by this requirement.

	Copyright (c) 2019 Andi McClure

	This software is provided 'as-is', without any express or implied
	warranty. In no event will the authors be held liable for any damages
	arising from the use of this software.

	Permission is granted to anyone to use this software for any purpose,
	including commercial applications, and to alter it and redistribute it
	freely, subject to the following restrictions:

	1. The origin of this software must not be misrepresented; you must not
	   claim that you wrote the original software. If you use this software
	   in a product, an acknowledgment in the product documentation would be
	   appreciated but is not required.
	2. Altered source versions must be plainly marked as such, and must not be
	   misrepresented as being the original software.
	3. This notice may not be removed or altered from any source distribution.

If this license does not work for you for some reason, you may at your option use namespace.lua under the MIT license, or like... email me, or something, I don't know.

license: MIT,Zlib

repository: mcclure/bitbucket-backup

branch_name: refs/heads/archive

detected_licenses: MIT Zlib

gha_language: C

repo_name: mcclure/bitbucket-backup


text:
Users can input their transactions and the app will calculate their current funds.

Link to the deployed application: https://budget-trapper-keeper.herokuapp.com/

## Table of Contents
* [Installation](#installation)
* [Technologies](#technologies)
* [Usage](#usage)
* [Testing](#testing)
* [License](#license)
* [Questions](#questions)
## Installation
Run the following command to install any necessary packages.
```
npm i
```
## Technologies
The following technologies were used in creating this application:
* HTML, CSS
* JavaScript
* Compression
* dotenv
* MongoDB
* Mongoose
* Express
* Morgan
* webmanifest, service-worker
## Usage
Navigate to the live site and begin entering your transactions. Try switching to offline to enter a transaction, and notice that the app is still functional and the data persists.
## Testing
There are no tests for this application, but feel free to try it out for yourself using the link above.
## License
This project is licensed under the terms of the MIT license.
## Questions
If you have any questions or run into any issues with this application, please feel free to find me, past0073, on GitHub at github.com/past0073. You can also reach out to me via email at<EMAIL_ADDRESS>
## Screenshots

![image](https://user-images.githubusercontent.com/74335621/115974033-6612a800-a51f-11eb-8acb-36c7ff5f7682.png)


text:
+++
# Experience widget.
widget = "experience"  # See https://sourcethemes.com/academic/docs/page-builder/
headless = true  # This file represents a page section.
active = true  # Activate this widget? true/false
weight = 40  # Order that this section will appear.

title = "Experience"
subtitle = ""

# Date format for experience
#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
date_format = "Jan 2006"

# Experiences.
#   Add/remove as many `[[experience]]` blocks below as you like.
#   Required fields are `title`, `company`, and `date_start`.
#   Leave `date_end` empty if it's your current employer.
#   Begin/end multi-line descriptions with 3 quotes `"""`.
# [[experience]]
#   title = "Intern Algorithm Researcher"
#   company = "VIPKID"
#   company_url = "https://www.vipkidteachers.com"
#   location = "Beijing, China"
#   date_start = "2019-07-15"
#   date_end = "2019-12-01"
#   description = """
#   Responsibilities include:
#
#   * Optimized the acoustic model in speech recognition
#   * Developed the dynamic captioning function
#   * Developed the text normalization tool
#   """

[[experience]]
  title = "Software Engineer"
  company = "Baidu, Inc"
  company_url = "https://home.baidu.com/"
  location = "Beijing, China"
  date_start = "2021-07-07"
  date_end = "2022-06-28"
  description = """Optimizing the strategies in the crawler system."""

[[experience]]
  title = "Research Assistant"
  company = "University of Pittsburgh"
  company_url = "https://www.pitt.edu/"
  location = "Remote"
  date_start = "2020-09-01"
  date_end = "2021-10-01"
  description = """Doing research on quantum circuit simulation using GPUs. Advised by [Prof. Xulong Tang](http://xzt102.github.io/) and [Prof. Jun Yang](https://sites.pitt.edu/~juy9/)"""

[[experience]]
  title = "Master student"
  company = "Beijing University of Posts and Telecommunications"
  company_url = "https://english.bupt.edu.cn/"
  location = "Beijing, China"
  date_start = "2018-09-01"
  date_end = "2021-06-30"
  description = """Doing research on digital signal processing and machine learning. Advised by [Prof. Zhenming Yu](https://see.bupt.edu.cn/info/1051/1260.htm) and [Prof. Kun Xu](https://www.bupt.edu.cn/info/1075/84950.htm)"""

# [[experience]]
#   title = "Intern Research Assistant"
#   company = "Peking University"
#   location = "Beijing, China"
#   date_start = "2019-01-01"
#   date_end = "2019-06-01"
#   description = """Researched the application scenario of polar code in B5G communication system"""

# [[experience]]
#   title = "Intern Software Engineer"
#   company = "Shenzhen Excelsecu Data Technology Co., Ltd"
#   location = "Beijing, China"
#   date_start = "2018-07-01"
#   date_end = "2018-09-01"
#   description = """Developed the middleware of encryption hardware (USB key)"""

+++

repository: Zhaoyilunnn/academic-kickstart

repo_name: Zhaoyilunnn/academic-kickstart


text:
---
layout: default
---

# 1995-12-11 - *fnord* Addition info *fnord*

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 3107f34f833188a4fca53e9410237b6e1d6cd6c5a0d5950205375cc87b48b6be

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-12-11 06:40:19 UTC

Raw Date: Sun, 10 Dec 95 22:40:19 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sun, 10 Dec 95 22:40:19 PST
To<EMAIL_ADDRESS>Subject: *fnord* Addition info *fnord*
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

From<EMAIL_ADDRESS>(Paul C. Kocher)
Subject: Announce: Timing cryptanalysis of RSA, DH, DSS
Message-ID<EMAIL_ADDRESS>Organization: NETCOM On-line Communication Services<PHONE_NUMBER> guest)
Date: Mon, 11 Dec 1995 01:33:17 GMT
Lines: 67
Sender<EMAIL_ADDRESS>
I've just released details of an attack many of you will find
interesting since quite a few existing cryptography products and
systems are potentially at risk.  The general idea of the attack is
that secret keys can be found by measuring the amount of time used to
to process messages.  The paper describes attacks against RSA, fixed-
exponent Diffie-Hellman, and DSS, and the techniques can work with
many other systems as well.

My research on the subject is still in progress and the current paper
does not include many of my findings.  I will eventually publish a full
paper, but am releasing a preliminary draft now to alert the community
as quickly as possible.  A copy of the abstract is attached at the end
of this message and the full text can be downloaded in PostScript
format from:

  ftp://ftp.cryptography.com/pub/kocher_timing_attack.ps
  ftp://ftp.cryptography.com/pub/kocher_timing_attack.ps.gz

I've also made an HTML version which is accessible at:

  http://www.cryptography.com

(The HTML uses subscripts and superscripts which aren't supported
in older web browsers.  The PostScript version is the "official"
one and looks nicer.)

The results have already been seen by Matt Blaze, Martin Hellman, Ron
Rivest, Bruce Schneier, and many others.  While the full significance
of the attack is not yet known, I think everyone who has seen it
considers it important (including Netscape who awarded me a $1000
bugs bounty prize).

    ABSTRACT.  Cryptosystems often take slightly different
    amounts of time to process different messages. With network-
    based cryptosystems, cryptographic tokens, and many other
    applications, attackers can measure the amount of time used
    to complete cryptographic operations.  This abstract shows
    that timing channels can, and often do, leak key material.
    The attacks are particularly alarming because they often
    require only known ciphertext, work even if timing
    measurements are somewhat inaccurate, are computationally
    easy, and are difficult to detect.  This preliminary draft
    outlines attacks that can find secret exponents in Diffie-
    Hellman key exchange, factor RSA keys, and find DSS secret
    parameters.  Other symmetric and asymmetric cryptographic
    functions are also at risk. A complete description of the
    attack will be presented in a full paper, to be released
    later. I conclude by noting that closing timing channels
    is often more difficult than might be expected.

Cheers,
Paul Kocher

*********************************************************************
VERY IMPORTANT: If you send me e-mail, please understand that I
probably won't have time to respond to all who write.  Please keep
messages SHORT and send them to<EMAIL_ADDRESS>(**not** my
netcom address -- misdirected messages will be ignored).  PGP when
used for e-mail is not vulnerable to the attack.  Please state in
your note whether you would like a reply.
********************************************************************

__________________________________________________________________________
Paul C. Kocher           Independent cryptography/data security consultant
E-mail<EMAIL_ADDRESS>(please see above before replying)

========
Xref: news2.new-york.net sci.crypt:5320
Path: news2.new-york.net!spcuna!uunet!in1.uu.net!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netnews
From<EMAIL_ADDRESS>(Joel M. Rubin)
Newsgroups: sci.crypt
Subject: Re: Announce: Timing cryptanalysis of RSA, DH, DSS
Date: 11 Dec 1995 04:35:47 GMT
Organization: Union of anti-organizationalists
Lines: 11
Message-ID<EMAIL_ADDRESS>References<EMAIL_ADDRESS>NNTP-Posting-Host: ix-sf17-18.ix.netcom.com
X-NETCOM-Date: Sun Dec 10  8:35:47 PM PST 1995
X-Newsreader: WinVN 0.99.7

I just saw a small article with your name on page 1 of the N.Y. Times
Fax 8-page Internet Edition. (Monday, December 11, 1995)

They change the edition at about 10:30-11 P.M. Eastern Standard Time
(0330-0400 the next GMT day) so if you read this before then, you might
want to download http://nytimesfax.com/times.pdf.

It is in Adobe Acrobat format.

Of course, there is probably a larger article in the paper edition.

========
From<EMAIL_ADDRESS>(Joel M. Rubin)
Newsgroups: sci.crypt
Subject: Re: Announce: Timing cryptanalysis of RSA, DH, DSS
Date: 11 Dec 1995 04:38:58 GMT
Organization: Union of anti-organizationalists
Lines: 7
Message-ID<EMAIL_ADDRESS>References<EMAIL_ADDRESS>NNTP-Posting-Host: ix-sf17-18.ix.netcom.com
X-NETCOM-Date: Sun Dec 10  8:38:58 PM PST 1995
X-Newsreader: WinVN 0.99.7

In case you don't already know, there is an article about your work in
Monday's N.Y. Times. I just read a very small version of it in
http://nytimesfax.com/times.pdf. (Adobe Acrobat-format 8-page edition)

The N.Y. Times Fax on the web changes edition about 10:30 or 11 P.M. New
York time so if you want it, get it before then.

{% endraw %}
```

## Thread

+ Return to [December 1995](/archive/1995/12)

+ Return to "[anonymous-remailer@shell.portal.com](/authors/anonymousremailer_at_shell_portal_com)"

+ 1995-12-11 (Sun, 10 Dec 95 22:40:19 PST) - *fnord* Addition info *fnord* -<EMAIL_ADDRESS>


text:
Context-Aware Configuration Training: AEM
=========================================
[![Build](https://github.com/wcm-io-training/training-caconfig-exercise-aem/workflows/Build/badge.svg?branch=master)](https://github.com/wcm-io-training/training-caconfig-exercise-aem/actions?query=workflow%3ABuild+branch%3Amaster)

This training projects targets the following training modules:
* [DATM-55 wcm.io Context-Aware Configuration](https://training.wcm.io/caconfig/DATM-55-wcm.io-Context-Aware-Configuration.html)

Requirements
------------

* AEMaaCS SDK author instance running on port 4502

Deploy sample project
---------------------

You can use this script for a full deployment (application, sample content, configuration) into a local AEM instance running at http://localhost:4502:

```
build-deploy.sh
```

This script also cleans and builds all maven projects and generates eclipse project files.

For the exercise you will work in the `bundles/base` and `bundles/editorial` bundles. Example to redeploy only one of these bundles:

```
cd bundles/editorial
mvn cq:install
```

Configure File System Resource Provider
---------------------------------------

You can mount the files system of your eclipse project to directly see changes in Sightly HTML, JSON oder other files in your running AEM application without having to redeploy the OSGi bundles. Deploying the OSGi bundle is only required if you change Java code.

To setup the files system synchronization go to the folder of the bundle project below `bundles/` and execute on it:

```
mvn sling:fsmount
```

Exercises
---------

See [DATM-56 Context-Aware Configuration exercises](https://training.wcm.io/caconfig/DATM-56-Context-Aware-Configuration-exercises.html)

Maven Settings
--------------

To build the project you have to configure additional [Maven Repositories](http://wcm.io/maven.html) in your settings.xml.

Alternatively you can build the project by specifying:

```
mvn --settings .maven-settings.xml clean install
```


text:
---
title: Facebook Messenger Bot
categories:
- Programming
tags:
- facebook
- bot
# https://www.iconfinder.com/icons/6214509/facebook_logo_messenger_icon
thumbnail: thumbnail.svg
---

My shameless Facebook Messenger bot that sends YouTube videos and GIFs if a message received matches a [TWICE](https://twitter.com/JYPETWICE) song.

<!-- more -->

Twice have a lot of (amazing) songs for a girl group that's only debuted 2 years ago. I wanted to promote them to friends in our group chat whenever possible, however possible. We occasionally talk about Table Tennis (TT for short) and also occasionally do 'Knock Knock' jokes on one another. So guess what...Twice have a song called [TT](https://www.youtube.com/watch?v=ePpPVE-GGJw) and another titled [Knock Knock](https://www.youtube.com/watch?v=8A2t_tAjMz8).

<iframe src="https://www.youtube.com/embed/8A2t_tAjMz8" allowfullscreen width="1280" height="720"></iframe>

You can find the bot on my GitHub here - [https://github.com/calvinbui/twice-bot-fbmessenger](https://github.com/calvinbui/twice-bot-fbmessenger). The bot is written in Node.js and is already setup to run inside a Docker container. All the instructions are provided in the README.md file.

Whenever a message is received, the bot will examine a message for a regular-expression match defined in the `database.json` file. When a match is found, it will send at random, a link to a video or GIF associated with that song. It will also (shamelessly) give the message that triggered it a heart-eyes reaction :heart_eyes:

gha_language: SCSS


text:
# Pipeline and code for Alvarez-Benayas, Katsarou and Trasanidis *et al* #

This pipeline is created in the ruffus (http://www.ruffus.org.uk/) and cgatcore (https://cgat-core.readthedocs.io/en/latest/) frameworks. See there documentation to understand how pipeline script files.

The script `pipeline_atacseq.py` contains the pipeline logic.

The module `pipelineAtacseq.py` contains various work functions that are executed by the pipeline.

The directory `scripts` contains several ancillary scripts (mostly in R).

The directory `Notebooks` contains Rmarkdown and jupyter notebooks containing interpretive analysis and plotting code.

## Dependency installation ##
Dependencies are listed in `environment.yml`. This can be used to build a conda environment. We recommend using `mamba` to do this, as it is significantly faster than `conda`.

```
$ mamba env create [-p PATH_TO_STORE_ENV|-n NAME_FOR_ENV] -f environment.yml
```

Next you will need to install `cgat-flow`, which is not yet available on conda. This can be achieved by cloning the github repository and installing it into your environment.

```
$ conda activate ENV_NAME_OR_PATH
$ git clone https://github.com/cgat-developers/cgat-flow.git
$ cd cgat-flow
$ python setup.py develop
```

## Configuring the pipeline ##

1. To set up the pipeline create a folder and run `python PATH/TO/REPO/pipeline_atac.py config`
2. Edit the configuration file. In particular set the location of the geneset, a samtools indexed copy of version 38 of the human genome, and the ENCODE 3. black list and low mappability regions bed files.
3. Copy into the directory the sample annotation file in this rep `samples.tsv`.
4. Put all the ATAC seq mapped BAM (mapped with bowtie2) files in the root of the directory.
5. Put both fastq files and bam files (HiSat mapped) into a folder called `input_rna.dir`

## Running the pipeline ##

You will need to configure the cgatcore frame work to work with your cluster. Do this by creating a `.cgat.yml` file in your home directory. An example is provided below

    jobs_limit_db: 1
    shared_tmpdir: /fastdata/mb1ims/tmp
    tmpdir: /scratch

    cluster:
        queue_manager: sge
        queue: NONE
        parallel_environment: smp
        memory_resource: rmem
        options: -P gen2reg

You can now run show the tasks to be run with `python PATH/TO/REPO/pipeline_atacseq.py show full` or run it with `python PATH/TO/REPO/pipeline_atacseq.py make full`.

On our cluster, a complete run takes around 2.5 days (node availability is never limiting).


text:
---
layout: post
title: "Install mysql on linux"
description: "Install mysql on linux"
category: [mysql]
tags: [mysql, linux]
---

---------------------------------------

####Ubuntu
**Install**
1.

````apt-get install mysql-server````

**Config for remote access**

1.vim /etc/my.cnf

Comment this line：bind-address=<IP_ADDRESS> ==> #bind-address=<IP_ADDRESS>

2.Login

````mysql -u root -p"youpassword"````

3.Authorize

````GRANT ALL PRIVILEGES ON *.* TO<EMAIL_ADDRESS>IDENTIFIED BY "youpassword" WITH GRANT OPTION;````

4.Reload authorization table

````FLUSH PRIVILEGES;````

5.exit mysql

````exit````

###Error case sensitive

Log in as root: in /etc/my.cnf or /etc/myql/my.cnf, After [mysqld], append

````lower_case_table_names=1````

eg: vi /etc/my.cnf

6.Open linux port!


text:
---
title: "Why I'm Fascinated With Reproducible Code"
author: "chipoglesby"
date: '2017-01-07'
excerpt: I'm not the only one who hates typing the same thing repeatedly, right?
layout: post
published: true
slug:
categories:

- Coding

tags:

- R

---

In my [last post](2017/01/reproducible-template/) I shared a template that I use
for all of my work. I realized there was a section that I didn't go into that
that could be very important for someone in the future.

Take my job for example. I use to create reports for people on a weekly basis.
It could be about company performance or web metrics, advertising reports, etc.
A lot of it could be viewed as 'grunt work' because just about anyone can do it.

In essence you're looking at a table of data and reporting that numbers either
increased or decreased. Granted there's a lot more to it than that and we would
spend the majority of our time answering the "Why did this happen?" question.

I only wrote reports for a while before I began thinking about how I could
automate something like this.

For example, you might see a sentence like "Revenue for the week of 2017-01-01
was 500,000. It increased by 25% from the previous year."

There are parts of that sentence that can easily be written to change
automatically, let's take a look: "Revenue for the week of **w**
was **x**. It **y** by **z**% from the previous year." We could easily write the
code to replace the values "w, x, y, z."

````
dataPercent <- round(
  (sum(data$revenue) - sum(dataPrior$revenue))
  /sum(dataPrior$revenue) * 100, 2)

  dataResult <- if (dataPercent > 0){
    paste(
      "increased by ", round(dataPercent),
      "% from the previous year.", sep="")
  } else {
    paste(
      "decreased by ", -round(dataPercent),
      "% from the previous year.", sep="")
  }

print(paste("Revenue for the week of ", min(data$date),
" was $", sum(data$revenue), "It ", dataResult, ", sep = ""))
````
Can you see how easy that is??
We're not even really doing something complicated yet! So far:

1. We're calculating the percent change from one time period to the next
2. We've created an `if` statement for the revenue change. If it increases,
print this, `else` print something different.
3. We've also calculated the minimum date using the `min()` function.
4. We've also calculated revenue using the `sum` feature.

Now, whenever we run this report, we will get a familiar result with all of the
proper data without having to rewrite half of our analysis. There is
**so much more** that you can do, so I encourage you to go out and explore and
share what you come up with.

I should mention that this isn't a new idea. Web developers have been doing this
with code for a long time, but in the world of analysis, this is kind of a new
way of thinking for some.


text:
Frontend usage
=============

## Requirements
* Have postgreSQL 9.x with postgis extension installed locally
* Python 2.7.\* && virtualenv && pip installed

## Process
1. Create a virtualenv

        $ virtualenv .venv

2. Activate the created virtualenv

        $ source .venv/bin/activate

3. Install dependencies

        $ pip install -r requirements.txt

5. Create DATABASE_URL environment variable to connect to the DB created in the backend

        ```
        export DATABASE_URL='postgresql://user:pass@localhost:5432/dbname'
        ```

4. Run gunicorn locally

        $ gunicorn dondevoto:app

5. Patience and happy geocoding!!

## Implementation notes

* It's always a good practice to create a DB backup periodically so that you have something to hold on to if someone messes things up badly. For example with cron

        ```
        0 8 * * 1 pg_dump -O dbname | bzip2 > /home/user/db_backup/dbname.$(/bin/date +\%Y\%m\%d).sql.bz2
        ```

repository: jjelosua/dondevoto

repo_name: jjelosua/dondevoto


text:
# Pydebootstrap

## Description

Python debootstrap wrapper. Creates and manages chroot environments in a systemd-machined compatible way.
Users running this script must have r/w access to /var/lib/machines.

## Functions

#### Create
pydebootstrap.create() requires a configuration profile like this one:

```
conf:
  id: 'Ubuntu1804'
  os: 'bionic'
  source: 'http://archive.ubuntu.com/ubuntu'
  arch: 'amd64'
  include: 'build-essential,python3,curl,wget,systemd,git,net-tools,systemd-sysv,dbus,vim'
  exclude:
  components: 'main,universe'
  no-resolve-deps:
  variant: 'buildd'
  keyring:
  foreign:
  second-stage:
  second-stage-target:
```

In the above example, an Ubuntu 1804 instance will be created in /var/lib/machines named Ubuntu1804.
The machine that the profile describes does not have to match the OS of the Parent Machine.

In the profile conf, any values left blank are omitted from the command, the config should be expandable to
support most if not all debootstrap arguments.

#### Release and List

pydebootstrap.release() requires only the name of the virtual machine that you wish to terminate

pydebootstrap.list() will print the names of each of the directories in /var/lib/mahines

gha_language: Python


text:
# PiThermServerZero

PiThermServer running on the Raspberry Pi Zero

## Installing PiThermServer

Follow [these](https://github.com/talltom/PiThermServer) instructions to deploy PiThermServer in your home directory.

## Autorunning PiThermServer

1. In your home directory, create a script called `start_temp_server.sh` with the following content:
```sh
#!/bin/sh

# time synchro
sudo /etc/init.d/ntp stop
sudo ntpd -q -g
sudo /etc/init.d/ntp start

sleep 10

# server start
cd /home/pi/PiThermServer
./build_database.sh
node server.js &
cd -
```

2. Open your `rc.local` file for edition:
```
$ sudo nano /etc/rc.local
```

3. Add the following line before the `exit 0` ending line:
```sh
sh /home/pi/start_temp_server.sh
```

repository: blackccpie/PiThermServerZero

repo_name: blackccpie/PiThermServerZero


text:
# Draft

A commandline tool that generate **H**igh **L**evel microservice & serverless **A**rchitecture diagrams using a declarative syntax defined in a YAML file.

- Works on [linux, macOS, windows](https://github.com/lucasepe/draft/releases/latest)
- Just a [single portable binary file](https://github.com/lucasepe/draft/releases/latest)
- Input data in flat YAML text files
- Usable with shell scripts

# Why?

I prefer to think in terms of capabilities rather than specific vendor services.

- _"do we need a DNS?"_ instead of _"do we need Route 53?"_
- _"do we need a CDN?"_ instead of _"do we need Cloudfront?"_
- _"do we need a database? if yes? what type? Relational? No SQL"_ instead of "do we need Google Cloud Datastore?"_
- _"do we need some serverless function?"_ instead of _"do we need an Azure Function"_

...and so on.

# How `draft` works?

`draft` takes in input a declarative YAML file and generates a [`dot`](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) script for [Graphviz](https://www.graphviz.org/)

```bash
draft backend-for-frontend.yml | dot -Tpng -Gdpi=200 > backend-for-frontend.png
```

Piping the `draft` output to [GraphViz](http://www.graphviz.org/doc/info/output.html/) `dot` you can generate different output formats:

| format       | command                                                        |
|:-------------|:---------------------------------------------------------------|
| PNG          | draft input.yml | dot -Tpng > output.png     |
| JPEG         | draft input.yml | dot -Tjpg > output.jpg     |
| PostScript   | draft input.yml | dot -Tps > output.ps       |
| SVG          | draft input.yml | dot -Tsvg > output.svg     |

To install GraphViz to your favorite OS, please, follow this link [https://graphviz.gitlab.io/download/](https://graphviz.gitlab.io/download/).

# Installation Steps

To build the binaries by yourself, assuming that you have `Go` installed, here the steps:

Clone the repo,
```psh
git clone https://github.com/lucasepe/draft.git
```

Move to the 'cmd' directory:
```psh
cd draft/cmd
```

Generate the static assets
```psh
go generate ../...
```

Build the binary tool
```psh
go build -o draft
```

# Components

The basic unit of each _draft_ design is the `component`, has these attributes:

| Name      | Required | Scope                         | Notes                                                   |
|:----------|:--------:|:------------------------------|---------------------------------------------------------|
| id        | no       | used for the connecttions     | autogenerated if omitted (read more for details...)     |
| kind      | yes      | identify the component type   | see [all available kinds](#list-of-all-available-kinds) |
| provider  | no       | get the specific provider icon| see [using custom icons](#using-custom-icons)           |
| label     | no       | text below the component icon | can contain basic HTML tags                             |
| outline   | no       | tag to group components       |                                                         |
| impl      | no       | text above the icon           | can use this to specify the provider implementation     |
| fontColor | no       | the label text color          | hex color code - supports transparency too              |

### Notes about a component `id`

- you can define your component `id` explicitly (i.e. _id: MY_SERVICE_A_)
- or you can omit the component `id` attribute and it will be autogenerated

### How is auto-generated a component `id`?

An auto-generated component `id` has a prefix and a sequential number

- the prefix is related to the component `kind`
  - examples _waf1, ..., wafN_ or _ser1, ..., serN_ etc.

# List of all available kinds

Draft uses a set of symbols independent from the different providers (AWS, Microsoft Azure, GCP).

Below is a list of all the components currently implemented.

## Clients

Sample YAML file [examples/clients.yml](./examples/clients.yml).

```bash
draft -impl -verbose examples/clients.yml | dot -Gdpi=110 -Tpng > examples/clients.png
```

![Clients](examples/clients.png)

## Networking

Sample YAML file [examples/networking.yml](./examples/networking.yml).

```bash
draft -impl -verbose examples/networking.yml | dot -Gdpi=110 -Tpng > examples/networking.png
```

![Networking](examples/networking.png)

## Compute

Sample YAML file [examples/compute.yml](./examples/compute.yml).

```bash
draft -impl -verbose examples/compute.yml | dot -Gdpi=110 -Tpng > examples/compute.png
```

![Compute](examples/compute.png)

## Database

Sample YAML file [examples/database.yml](./examples/database.yml).

```bash
draft -impl -verbose examples/database.yml | dot -Gdpi=110 -Tpng > examples/database.png
```

![Database](examples/database.png)

## Storage

Sample YAML file [examples/storage.yml](./examples/storage.yml).

```bash
draft -impl -verbose examples/storage.yml | dot -Gdpi=110 -Tpng > examples/storage.png
```

![Storage](examples/storage.png)

## Security

Sample YAML file [examples/security.yml](./examples/security.yml).

```bash
draft -impl -verbose examples/security.yml | dot -Gdpi=110 -Tpng > examples/security.png
```

![Security](examples/security.png)

# Using custom icons

Here how to render components with specific _aws_, _google_ and _azure_ icons.

1. Download the PNG icons of your cloud provider [AWS](https://aws.amazon.com/it/architecture/icons/), [GCP](https://cloud.google.com/icons), [Azure](https://www.microsoft.com/en-us/download/details.aspx?id=41937)

2. Take only the icons related to the [components supported](#list-of-all-available-kinds) by [draft](https://github.com/lucasepe/draft/releases/latest)

3. Make a directory with the provider name (i.e. `/draft/icons/aws`, `/draft/icons/google`, `/draft/icons/azure`)

4. Rename each icon as [draft](https://github.com/lucasepe/draft/releases/latest) components `kind` (i.e. `dns.png`, `cdn.png` and so on...)

5. Run [draft](https://github.com/lucasepe/draft/releases/latest) specifyng the icons folder using the environment variable `DRAFT_ICONS_PATH`
  - example: `DRAFT_ICONS_PATH=/draft/icons draft my-file.yml | dot > ark-aws.png`

👉 I have already done all the work for points 1 to 4. So you can avoid it by copying the directory [icons](./icons) 👈

# Connections

The arrows that join the components.

To connect an _origin_ component with one or more _targets_ component you need to specify at least each `id`.

A _connection_ has the following properties:

| Attribute | Type     | Required | What is it?                    |
|:----------|:--------:|:--------:|--------------------------------|
| origin    | string   | yes      | id of the starting component   |
| targets   | object   | yes      | one or more destinations       |

Each _target_ has the following properties:

| Attribute      | Type     | Required | What is it?                                       |
|:---------------|:--------:|:--------:|---------------------------------------------------|
| id             | string   | yes      | target component id                               |
| label          | string   | no       | text on the connection                            |
| labeldistance  | float    | no       | distance of the label from the connection tail    |
| labelangle     | float    | no       | determine the label position relative to the tail |
| minlen         | float    | no       | sets the minimum connection length                |
| num            | int      | no       | usefult to track an order path on your graph      |
| color          | string   | no       | label color (hex color string)                    |
| dashed         | bool     | no       | if true the connection line will be dashed        |
| dir            | string   | no       | arrows direction (forward, back, both, none)      |
| highlight      | bool     | no       | if true makes the arrow thicker                   |

Sample YAML file [examples/connections.yml](./examples/connections.yml).

```bash
draft examples/connections.yml | dot -Gdpi=110 -Tpng > examples/connections.png
```

![Connections](examples/connections.png)

[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)

---

## Changelog

👉 [Record of all notable changes made to a project](./CHANGELOG.md)

---

## Examples

👉 [Collection of draft architecture descriptor YAML files](./examples/README.md)

---

(c) 2020 Luca Sepe http://lucasepe.it. MIT License

repository: thevpatel/draft

repo_name: thevpatel/draft


text:
This clamps the values of your color in case they're too high or low for their types, in case you go negative or too use values that are too high, like anything >1.0 in the case of ofFloatColor.

```cpp
ofFloatColor c( 1, 0, 0 );
c.g = 2; // g now has 2: this is usually invalid!
c.clamp(); // c.g has now been clamped so its value is 1.
```


text:
# pytorch-ssd

by Sheng Tao, Qijie Zhao. (VDIG，PKU)

#### Reproduced the proposed results.

#### Besides, our proposed upgraded model will be opened soon!(Note that we are not developed from pure SSD)
- VOC2007

model | mAP
---|---
ssd300 | 77.27%
ssd512 | 79.89%
Ours300 | 80.5%
Ours512 | 82.1%

- KITTI

model&Input | mAP
---|---
ssd300,TBA | TBA
ssd512,TBA | TBA
Ours300 | 80.2%
Ours512 | 82.6%
Ours800 | 86.7%

- MS COCO

model&Input | mAP(0.5:0.95)
---|---
Ours300|30.1%(TBA)
Ours512|34.8%(TBA)

**Still being under fixing**.

repository: AlphaGoMK/pytorch-ssd

repo_name: AlphaGoMK/pytorch-ssd


text:
# API

The kissmms api provides programmatic access to the kissmms database.  The only remote clients of the API is supposed to be the proxy or an MMS.

## GET CUID by a single IUID
```
GET <api_basepath>/master-accounts/by-account-id/<iuid>
```
Queries the database for a single IUID value.

*Return value*: **CUID** in plain text or an empty string

repository: mheder/kissmms

repo_name: mheder/kissmms


text:
[![DOI](https://zenodo.org/badge/250293006.svg)](https://zenodo.org/badge/latestdoi/250293006)

# oil_off

Force a passive tracer field using output from an [online simulation](https://github.com/kthyng/oil_03) input as climatology files.

## How to run an offline simulation

1. Run an online simulation with a special version of COAWST/ROMS: https://github.com/kthyng/COAWST-ROMS-OIL
2. Run your offline sim:
  - You can compile your code with `python build-coawst.py --clean --mpi  oil_offline`
  - Start from `Include/oil_offline.h` to choose your preprocessor flags. Good choices are already selected there.
    - Use OUT_DOUBLE for best results
    - AKSCLIMATOLOGY to force Aks from the online simulation
    - OFFLINE and OFFLINE_TPASSIVE
    - MPDATA for tracer advection gives best results (as compared with TS_U3HADVECTION and TS_C4VADVECTION together)
  - Use `External/ocean_oil_offline.in` as a template.
    - Set output from online simulation as clm input
    - if forcing with an avg file from online simulation, need to place a file containing the initial conditions first
    - choose offline simulation time step: time step needs to factor into online output evenly
    - can't have time step larger than online output
    - There should be no forcing in the offline simulation since it all comes in through the online output as climatology
      - Boundaries should all be closed except for dye_01 since all boundary information is encoded in the online output
      - Turn off river forcing
      - Do not force winds, bulk fluxes, etc
      - No nudging to climatology
      - do include clm for zeta, m2, m3
      - only output dye_01 and zeta since otherwise best to use online output (w for example is not calculated correctly in offline sim)
      - VARNAME points to a special offline simulation version of varinfo.dat, which should be redirected to wherever your version of this [ROMS/COAWST](https://github.com/kthyng/COAWST-ROMS-OIL) is.
  - `sbatch sub/run_oil.slurm`: example file for slurm clusters to run simulation


text:
# Day 52: _Project 10: CupcakeCorner_ (Part Four)

_Follow along at https://www.hackingwithswift.com/100/swiftui/52_.

# 📒 Field Notes

This day covers Part Four of _`Project 10: CupcakeCorner`_ in the [100 Days of SwiftUI Challenge](https://www.hackingwithswift.com/100/swiftui/52). (Project 10 files can be found in the [directory for Part One](../day-049/).)

In addition to recapping the material covered during the project's other days, Day 52 focuses on extending the project according to a set of challenges.

# 🥅 Challenges

## Challenge 1

> Our address fields are currently considered valid if they contain anything, even if it’s just only whitespace. Improve the validation to make sure a string of pure whitespace is invalid.

- 🔗 [Commit](https://github.com/CypherPoet/100-days-of-swiftui/commit/3c41fd816510350a9f94de352294d5e93854014e)

## Challenge 2

> If our call to `placeOrder()` fails – for example if there is no internet connection – show an informative alert for the user. To test this, just disable WiFi on your Mac so the simulator has no connection either.

- (Already covered 🙂)

## Challenge 3

> For a more challenging task, see if you can convert our data model from a class to a struct, then create an `ObservableObject` class wrapper around it that gets passed around. This will result in your class having one `@Published` property, which is the data struct inside it, and should make supporting Codable on the struct much easier.

- Sort of already covered 🙂. I commented on the approach I took with this in [Day 49](../day-049/README.md))

# 📸 Screenshots

license: Unlicense


text:
# fabrik8

Provision and deploy cluster specifications from a single API.

[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Version npm][version-image]][version-url]
[![npm Downloads][downloads-image]][downloads-url]
[![Dependencies][dependencies-image]][dependencies-url]

### What It's For

`fabrik8` was designed to handle initialization of Kubernetes clusters with an initial, known-set of software using a [`mcgonagall`](https://github.com/npm-wharf/mcgonagall) specification.

It works well in environments where you might want ephemeral clusters, clusters on demand (think single tenancy), or think about things like automation and disaster recovery a lot.

### What It's **Not** For

`fabrik8` is not a CD solution (at least not presently). It is not meant to be run continuously against the same target (it cannot guarantee 100% idempotence, but makes a best effort to be). Running `fabrik8` multiple times _may_ yield unexpected results. For CD solutions, see [`hikaru`](https://github.com/npm-wharf/hikaru).

## Approach

fabrik8 uses [`kubeform`](https://github.com/npm-wharf/kubeform), [`mcgonagall`](https://github.com/npm-wharf/mcgonagall), and [`hikaru`](https://github.com/npm-wharf/hikaru) to provision clusters, transform specifications, and deploy them to the newly created cluster.

## Environment Variables

As noted in `kubeform`, many of the environment variables are cloud provider specific and will only be necessary when using a specific provider.

| Variable | Description | Default |
|:-:|---|---|
| `KUBE_SERVICE` | The backing service to use for the request | `'GKE'` |
| `GOOGLE_APPLICATION_CREDENTIALS` | Path to Google API credentials file | `''` |
| `GOOGLE_ORGANIZATION_ID` | Google Organization Id to create projects under | `''` |
| `GOOGLE_BILLING_ID` | Google Billing Account Id to associate with project | `''` |

## API

### `initialize(cluster, specification, data|onData)`

The `initialize` call requires three arguments and returns a promise.

#### `cluster`

This will be the same as the `kubeform` cluster specification (not repeated here).

#### `specification`

The specification argument must either be a file path to the spec or a URL to the GitHub repo where the [mcgonagall](https://github.com/npm-wharf/mcgonagall) specification is located.

#### `data|onData`

The third argument can either be a hash of data required to satisfy tokens present in the specification, or a function that is passed a list of tokens required by the specification. If a function is provided, the result expected is a promise providing a hash of data.

```js
function getTokens (tokenList) {
  // return token hash as a promise
  return Promise.resolve({
    tokenName: tokenValue
  })
}
```

To control how cluster data will be merged with the mcgonagall specification data, the hash should include a function named `onCluster`. It will be passed the cluster information returned from `kubeform` and the data. The signature is:

```js
function onCluster (data, clusterInfo) {
  // assign new properties to data from clusterInfo as needed
  data.someValue = clusterInfo.someSourceValue
}
```

Without passing this function, all cluster details will be set as children of a `.cluster` property.

#### Return

Returns the cluster information from `kubeform` and the data used to satisfy the specification (under the property `specData`).

The expectation is that this information will be stored for future retrieval when interacting with the cluster. `fabrik8` does not do anything beyond coordinate calls between libraries in order to simplify creation of fully functional

It is recommended that sensitive data (like the Kubernetes admin password) is stored separately in Vault or encrypted before storage.

## CLI

A CLI is also provided for `fabrik8` that allows you to invoke the API from the command line:

### `fabrik8 create [--name name] [--url url] --spec ./path/to/spec`

Creates a full cluster, reading defaults and existing configuration securely from centralized cluster-info.  The only options that are required are configuration for cluster-info, a name or cluster url, and the path to a McGonagall specification.  If re-running, only a name is required -- options will be re-read from cluster-info.

* `--url`, `-u` the url of the cluster you wish to create, e.g. `mycluster.npme.io`
* `--name`, `-n` the name of the cluster.  Can be inferred from the url
* `--domain` the domain of the cluster.  Can be inferred from the url.  Defaults to whatever is specified in the cluster-info defaults, if only a name is provided.
* `--projectId` the name of the gke project to use.  Can be inferred from the cluster name
* `--environment` the environment of the cluster, e.g. development, production
* `--specification`, `-m`, `--spec` the path or URL to the mcgonagall specification
* `--verbose` output verbose logging (status check output for hikaru)
* `--vaultHost` the host of the vault server containing sensitive cluster information, auth data, and defaults. Can also be set through the `VAULT_HOST` environment variable
* `--vaultToken` an auth token for the vault server. Can also be set through the `VAULT_TOKEN` environment variable
* `--provider` the cloud provider to use, defaults to `KUBE_SERVICE` environment variable or `GKE`
* `--output`, `-o` file to write cluster-info to, for debugging

Values from the defaults can also be overridden as command line args, by prefixing the key with `--arg-`, e.g. `--arg-cluster.worker.memory 26GB`, or `--arg-common.zones eu-central1-a`.  Look at the cluster-info defaults for a list of values that can be overridden.

Command line arguments take precedence over saved cluster-info, which take precedence over default cluster-info.

license: ISC

gha_license_id: ISC


text:
# command-line-cheat-sheet
A place to quickly lookup commands ( bash, Vim, git, AWS, Docker, Terraform, Ansible, kubectl)

- [x] [Bash](/bash.sh)
- [x] [Vim](vim.sh)
- [x] [Git](/git.sh) (Includes Pull Request and Forked Repo Syncing steps)
- [x] [AWS](/aws.sh)
- [x] [Docker](/docker.sh)
- [x] [Terraform](/terraform.sh)
- [x] [Ansible](/ansible.sh)
- [x] [Kubernetes](/kubectl.sh) (Includes steps for running a simple container)
- [ ] Chaos Experiments (Litmus)
- [x] [Hacking tool cheat sheet from compass security](https://blog.compass-security.com/2019/10/hacking-tools-cheat-sheet/)

## Additional Resources
  - [Bash Scripting](https://devhints.io/bash)
  - [Python Scripting]()
  - [Docker File Configuration](https://devhints.io/dockerfile)
  - [Python Quick Reference](https://gist.github.com/ari-hacks/a98d0388c2cc6f356b93e8ebaade1127)
  - [AWS CLI main repo](https://github.com/aws/aws-cli/tree/develop/awscli/examples)

repository: laxmansmr-us/command-line-cheat-sheet

repo_name: laxmansmr-us/command-line-cheat-sheet


text:
# learn

Deep learning and basic training of neural networks with the speed and efficiency of Crystal.

## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
  learn:
    github: nilq/learn
```

## Usage

```crystal
require "learn"
```

## Contributing

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

## Contributors

- [nilq](https://github.com/[your-github-name]) Lord Niels N. Horn - creator, maintainer

repository: nilq/learn

repo_name: nilq/learn


text:
---
title: "Projects for advanced courses"
date: 2018-05-30T12:37:46+02:00
draft: false
tags: ["Physics"]
categories: ["Projects"]
# Link to a background image
background: "/img/partitore.jpg"
subtitle: ""
summary: "List of advanced courses' projects that I supervise"
---
## Quantum Mechanics course

Analogously to atoms, nuclei also have a shell structure. This relates to their bound states and determine the magicity and stability of elements. However most systems in nature are not isolated but live in an open environment. For example, the size of the nucleus was determined by Rutherford by shooting alpha particles on a gold foil and measuring their scattering directions.
To describe this type of nuclear reactions, one has to represent the quantum system in connection not only with bound states, but with state in the continuum, that are able to fly away to infinity. This is a derivation of the familiar plane wave obtained with the Schroedinger equation of a free particle, but now acting on a potential.

What happens then, when a proton impinges on a nucleus? How did Rutherford from the scattering of alpha particles discovered the size of the nucleus? We will answer these questions through analytical derivations and computing exercises.

## Mathematical methods for quantum mechanics

Calculate nanostructures dissociation energy using solutions of different potentials. This project can be executed either analitically or numerically.

[Project's PDF (In Swedish)](http://www.matfys.lth.se/education/FMFF15/Projects/Kvantprickar.pdf)

[Course webpage](http://www.matfys.lth.se/education/FMFF15/)

repository: Scienza/SitoAndreaIdini

filename: course projects.md

gha_language: HTML

repo_name: Scienza/SitoAndreaIdini


text:
# icepap-ipassign

Remotely configure IcePAP network settings.

IPAssign is a tool developed within ESRF's DEG (Detector and Electronics Group).
Its aim is to provide an easy way to set-up network settings over UDP multicast,
without the need for a complete DaNCE suite.

![alt text](ipa_gui/action_shot.png "Action shot")

## Installing

This package requires Python 3.7+, and is available on pypi:

    pip install icepap-ipassign

## Usage

ipassign is a graphical application.
Launch it so:

    $ ipassign

In the main window, you will be given a list of discovered devices. Clicking on one
will show its configuration window.

The most common operation is the setting of the hostname, and a simple window will
pop up.
For further network settings, hit `Advanced`.

The gui is further documented in [ipa_gui/gui.md](ipa_gui/gui.md)

## Protocol

### Messaging

ipassign uses UDP multicast on `<IP_ADDRESS>` port `12345`.

There are three types of message: discovery, configurations, and acknowledgements.

Discovery messages are sent by ipassing to list all devices on the network.

Configurations messages are either devices sending their configurations, or
ipassing sending a new configuration to a device.

Acknowledgements are sent by a device upon applying a new configuration.
These are not sent if the device was requested to reboot.

A typical exchange of information has the following format:

    [ipassign] who's there? discovery packet
    [icepap 1] me, my mac address is 00:... and my configuration is ...
    [icepap 2] me, my mac address is 01:... and my configuration is ...
    [ipassign] device with mac 01:... , please apply the following configuration: ...
               and reboot/apply now dynamically/write to flash.
    [icepap 2] okay, here's an ack message, with my status code following your request.
    [ipassign] who's there? discovery packet

For demonstration purposes, a simple listener is available in `utils/listener.py` and can be invoked so:

```bash
$ ipassign-listener

Waiting for messages...
```

Messages seen in the multicast group will then be displayed in human readable format.

### Packet Format

An IPAssign packet has the following structure:

    [header]      # 14 bytes
    [destination] # 6 bytes, 6 x uint8
    [payload]     # variable length, 0 to 1024 bytes
    [checksum]    # 4 bytes, uint32, little endian

- `[destination]` is the mac address of the target device. When broadcasting,
                  this address is set to a single byte with value 0x00.
- `[payload]` is the data sent to the target device.
- `[checksum]` the crc32 of `[header][destination][payload]`, encoded in little
               endian, then appended to the packet.
- `[header]` has the following structure:

        [source]        # 6 bytes, 6 x uint8
        [target count]  # 2 byte, uint16
        [packet number] # 2 bytes, uint16
        [command]       # 2 bytes, uint16
        [payload size]  # 2 bytes, uint16

  - `[source]` is the mac address of the device emitting the packet.
  - `[target count]` is set to 0 when broadcasting to the whole group,
                     or 1 when targeting a specific device.
  - `[packet number]` is the packet count sent by this device.
  - `[command]` is one of the predefined commands, eg. set hostname, see
                `ipassign.commands` for available commands.
  - `[payload size]` describes the quantity of bytes in the payload to read.

---

`target count` is called so, to maintain consistency with other legacy code.
It was originally envisioned that several devices could be targeted by a single
message, hence its uint16 format.
In practice, however, it is effectively used as a boolean: it should be
understood as `is_not_broadcasting`.

---

### Discovery Messages

Here is the anatomy of a discovery message:

    0x78 0x45 0xC4 0xF7 0x8F 0x48   # mac
    0x00 0x00                       # target count (broadcast to group)
    0x00 0x01                       # packet number
    0x00 0x02                       # command (request for parameters)
    0x00 0x00                       # payload length
    0x00                            # destination mac, truncated to 1 byte.
    0x31 0x8F 0x64 0x48             # checksum

Incidentally, for its lack of payload, it is the smallest message that can be sent.

### Configuration Payload

A configuration is either a device's current network configuration, or one it should apply.
The payload has the following structure:

    [icepap id]    # 6 bytes, 6 x uint8
    [ip address]   # 4 bytes, uint32, little endian
    [broadcast]    # ditto
    [netmask]      # ditto
    [gateway]      # ditto
    [mac address]  # 6 bytes, 6 x uint8
    [flags]        # 2 bytes, uint32
    [hostname]     # variable length, 24 bytes max, ascii string

- `[icepap id]` is the mac address of the device providing or applying the config.
- `[ip address]` is this configuration's address.
- `[broadcast]` is this configuration's broadcast address.
- `[netmask]` is this configuration's netmask.
- `[gateway]` is this configuration's gateway address.
- `[mac address]` is this configuration's mac address.
- `[flags]` are the actions the device should do upon applying a new configuration.
- `[hostname]` is this configuration's hostname.

The device can be asked to perform one of three actions upon applying a new
configuration.
These are set in the `[flags]` field and are:

- reboot (first bit set);
- dynamically apply the changes (second bit set);
- write them to flash (third bit set).

Here is a configuration payload:

    0x00 0x0C 0xC6 0x69 0x13 0x2D                 # icepap id, a mac address
    0xAC 0x18 0x9B 0xDE 0xAC                      # IP address, <IP_ADDRESS>
    0xAC 0x18 0x9B 0xDE 0xFF                      # broadcast, <IP_ADDRESS>
    0xFF 0xFF 0xFF 0xFF 0x00                      # netmask, <IP_ADDRESS>
    0xAC 0x18 0x9B 0xDE 0x63                      # gateway, <IP_ADDRESS>
    0x00 0x0C 0xC6 0x69 0x13 0x2D                 # reprogrammable mac address
    0x00 0x00                                     # flags, none
    0X74 0X68 0X78 0X63 0X6F 0X72 0X6F 0X6E 0X61  # hostname

This message will be deserialised as follows:

```python
from ipassign import Message
msg  = b'\x00\x0c\xc6\x69\x13\x2d\x01\x00\x00\x00\x03\x00\x38\x00\x00\x22\x19\x06\xbf\x58\x00\x0c\xc6\x69\x13\x2d\xac\x18\x9b\xde\xac\x18\x9b\xff\xff\xff\xff\x00\xac\x18\x9b\x63\x00\x0c\xc6\x69\x13\x2d\x00\x00\x00\x00\x69\x63\x65\x65\x75\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb3\x57\x23\x0d'

m = Message.from_bytes(msg)

print(m)
[header]
    [source]      = 00:0c:c6:69:13:2d
    [target id]   = 1
    [packet no]   = 0
    [command]     = SEND_CONFIG [0x3]
    [payload len] = 56
[destination] = 00:22:19:06:bf:58
[payload] = [configuration]
                [target id]   = 00:0c:c6:69:13:2d
                [ip address]  = <IP_ADDRESS>
                [broadcast]   = <IP_ADDRESS>
                [netmask]     = <IP_ADDRESS>
                [gateway]     = <IP_ADDRESS>
                [mac address] = 00:0c:c6:69:13:2d
                [flags]       =
                [hostname]    = iceeu4
[checksum] = 0xd2357b3
```

### Acknowledgment Payload

Whilst a device will send an acknowledgement after applying a new configuration,
if not told to reboot, it is up to the creator of said configuration to
validate it.

An acknowledgment payload has the following structure:

    [packet number] # 2 bytes, uint16
    [error code]    # 2 bytes, uint16

- `[packet number]` is the packet number referring to the acknowledge packet.
                    If a configuration packet was sent with packet number 5,
                    it is then possible to check that the settings match the ones
                    in the packet of that packet.
- `[error code]` is a status code of having applied the received settings.

Here is an acknowledgement payload:
```python
from ipassign import acknowledgements, Acknowledgement

payload = Acknowledgement(packno=5,
                          code=acknowledgements.OK)
```

This message would have the following hex representation:

    0x05 0x00  # Reply to the configuration received in sender's packet no. 5
    0x00 0x00  # Ok

This message would be represented as:

    [acknowledgement]
        [packet number] = 5
        [code]          = OK [0x0]

Error codes are defined in `ipassign.acknowledgements`.

## Testing and Development

Clone and download this repository, and install it with `pip`:

    pip install -e .

Testing this library done with `pytest`:

    pytest -vv

For development, a mock IcePAP server can be found in `utils/mock_icepap`.
This mock server behaves like real hardware, and will send the appropriate
replies:

```bash
$ python ipa_utils/mock_icepap
Working with e3:cd:77:a0:18:30 and dvepklrlyq, no ack: False
```

The script also accepts a mac address as argument:

```bash
$ python ipa_utils/mock_icepap 00:0B:AD:C0:FF:EE
Working with 00:0b:ad:c0:ff:ee and kqifwchhiz, no ack: False
```

It's also possible to make the script not send acknowledgements:

```bash
$ python ipa_utils/mock_icepap --nack
Working with 53:2e:d2:f9:7b:af and kvdkkleuqc, no ack: True
```

## Embedded IcePAP Considerations

The `listener` process embedded in IcePAP devices expects well-formatted
packets, and does not do any error handling.
As such, it is up to the sender to ensure that the packet is correct.

Any malformed message or nonsense bytes sent to an IcePAP will make
the `listener` crash.

To restart it, telnet as `root` in the IcePAP device, and execute
`/usr/sbin/icepap_startup_local restart`:

```bash
$ telnet icepap
icepap login: root
Password:

root@icepap > /usr/sbin/icepap_startup_local restart
Stopping ipassign listener......done
Stopping icepap communication...done
Removing icepap driver..........done
Removing blisspipe driver.......done
Loading  icepap driver..........done
Loading  blisspipe driver.......done
Starting icepap communication...done
Starting ipassign listener......done
```

The device will then appear in `ipassign` upon doing a `Refresh`.

Sending a configuration without any command flags will do nothing.
For a configuration to take effect, it should be applied dynamically and/or
written to flash.

repository: cydanil/alfie

gha_license_id: Unlicense

repo_name: cydanil/alfie


text:
---
sort: 1
---

# Cassandra

## Cassandra Architecture
### Keyspace, Replication, Table

* Partition Key: Cassandra tables use two additional kinds of keys. A partition key is used to determine which node in the cluster to store a row in.
* Keyspace: It is like a schema in RDBMS and has tables, indexes and other data structures. It also defines replication strategy.

### Replication Strategy
* Simple Replication Strategy - It is used to sets a number of replicas when all nodes will be in a single data center.
* Netwrk Topology Replication - It is used to set a numberof replicas when nodes will be distributes in multiple data centers.
Both of strategies take a number of replicas as a parameter - `replication_factor`.

### Keyspace definition example
```sql
CREATE KEYSPACE
  perfmonitor
WITH
  replication = { 'class': SimpleStrategy',
                  'replication_factor': 3};
```

### Table definition example
```sql
CREATE TABLE app_instance (
  id uuid,
  app_name text,
  proc_id text,
  host_id text,
  os_priority int,
  cpu_time int,
  num_io_ops int,
  PRIMARY KEY (id))
```

### Basic types

* Int
* Text
* Float
* Timestamp
* Date
* Blob
* UUID

### Collection data types

* List - a collection of one or more elements
* Map - a group of key-value pairs
* Set - a collection of one or more elements with no duplicates

### Table with Collections example
```sql
CREATE TABLE app_instance (
  id uuid,
  app_name text,
  proc_id text,
  host_id text,
  os_priority map<text, int>,
  cpu_time int,
  num_io_ops int,
  PRIMARY KEY (id))
```

### Table with primary key
We assume that the process ID and host ID uniquely identify an application instance.
First attribute (host ID) in the primary key is used asthe partion key, which determines how data is ordered on the disk. It is needed to choose a primary key carefully because it is used to retrieve data using select statements.
```sql
CREATE TABLE app_instance (
  id uuid,
  app_name text,
  proc_id text,
  host_id text,
  os_priority map<text, int>,
  cpu_time int,
  num_io_ops int,
  PRIMARY KEY (host_id, proc_id))
```

### Clustering order
This option is used to change the default sort order of rows on the disk, wwhen wecreate tables.
Cassandra does not provide a mechanism to srt query results at query time, so we have to consider sort order when creating a table.
```sql
CREATE TABLE app_instance (
  id uuid,
  app_name text,
  proc_id text,
  host_id text,
  os_priority map<text, int>,
  cpu_time int,
  num_io_ops int,
  PRIMARY KEY (host_id, proc_id))
  WITH CLUSTERING ORDER BY (proc_id DESC)
```

```plantuml
@startuml
Bob -> Alice : hello
@enduml
```


text:
# OpenJS Foundation Cross Project Council Meeting 2019-08-27

## Links

* **Recording**:  https://www.youtube.com/watch?v=Mh9tYA3-dwE
* **GitHub Issue**: https://github.com/openjs-foundation/cross-project-council/issues/311

## Present
* Even Stensberg (@evenstensberg)
* Joe Sepi (@joesepi)
* Christian Bromann (@bromann)
* Michael Dawson (@mhdawson)
* Emily Platzer (@craftninja)
* Jory Burson (@jorydotcom)
* Kris Borchers (@kborchers)
* Matteo Collina (@mcolina)
* Rachel Romoff (@rromoff)
* Myles Borins (@MylesBorins)
* Tobie Langel (@tobie)
* Brian Warner (@brianwarner)

* OpenJS Foundation Cross Project Council
* OpenJS Foundation Project Maintainers
* OpenJS Foundation Board of Directors

## Agenda

### Announcements

*Extracted from **cross-project-council-agenda** labeled issues and pull requests from the **openjs-foundation org** prior to the meeting.

* There’s a standards wg meeting today at 18:00 UTC (see /standards repo)

* See issue [#307](https://github.com/openjs-foundation/cross-project-council/issues/307) for follow-up from #infra wg meeting if you weren’t able to make it yesterday

### openjs-foundation/cross-project-council

#### Old Business

* charter: s/maintainers/governing body [#305](https://github.com/openjs-foundation/cross-project-council/pull/305) (related issue: [#289](https://github.com/openjs-foundation/cross-project-council/issues/289))
Last week’s AI: Need to get Board ok, then once 14 days has passed, should be ready to land.

This one was discussed at the board. Needs the 14 days or an approval by a quorum of voting members. Board agreed to do that via email instead of waiting for next meeting. This needs to be approved by the CPC first but will be approved in short order by the board when that is done.

AI: CPC voting members need to vote to approve or there are 7(?) Days remaining on this PR
AI, unrelated: examine issues related to getting voting members in for quorum

* doc: add governance for adding regular members [#297](https://github.com/openjs-foundation/cross-project-council/pull/297) (related issue: [#263](https://github.com/openjs-foundation/cross-project-council/issues/263)
Last week’s AI: none

There was a comment about making this more explicit. This PR clarifies this process and documentation. So far we have 2 approvals and no outstanding issues. Would like to have more approvals but otherwise there are 3 more days left before it can be merged.

AI: remove agenda tag and close after 14 days is up (3 more days)

* Duplicate onboarding checklist [#288](https://github.com/openjs-foundation/cross-project-council/issues/288) (related PR:  [#304](https://github.com/openjs-foundation/cross-project-council/pull/304)
Last week’s AI: continued discussion on pr 304

Discussion continued on the PR. Documentation is in line - already saw that there is some discrepancy between the copies. Looking for more sign-offs or +1s. Group doesn’t necessarily want to spend too much time on this but does want to make sure there is a canonical source of truth.

AI: Myles will make an update and more comment / sign off is requested.

* adds a draft charter template [#279](https://github.com/openjs-foundation/cross-project-council/pull/279)
 Last week’s AI: Jory to update PR & Send to legal for review

AI: none - still waiting on review from legal (has been sent off)

* Collaborator Summit at Node+JS Interactive / new repo [#242](https://github.com/openjs-foundation/cross-project-council/issues/242) (related issue: [#287](https://github.com/openjs-foundation/cross-project-council/issues/287) )
Last week’s AI: Wait a few days, Manil to let us know when it’s OK to initiate repo transfer.

AI: someone needs to start the transfer from the node/summit to openjs
AI, related: #190 (on /summit) improving discoverability of the summit

#### New Business

* doc: incubating projects must have a champion [#309](https://github.com/openjs-foundation/cross-project-council/pull/309)

Myles opened PR. doesn’t add much copy but does include the identification of a champion during the silent phase. Signals fitness and possible friction if we can’t get a supporter/champion.

AI: Myles, Jory Tobie will find time to better differentiate roles/intent of the champion

* doc: rename acceptance criteria to graduation criteria [#294](https://github.com/openjs-foundation/cross-project-council/pull/294)

Generic question - does project progression qualify as governance? Gut reply is yes. This should fall under the governance rules so this has an additional 3 day period to wait before landing.

AI: waiting 3 more days to land. Consider clarifying what falls under ‘governance’ to meet the 14 day wait period.

AD HOC Board update
Held last week. Some gov. Changes approved others are good but waiting for process
On the front of looking for venues for looking at venues for node + js 2020, late spring early summer is the timeframe they are looking for, also looking at Oct.
Link to the public board meeting: https://www.youtube.com/watch?v=krND7nWRUqE

#### Recurring Work

* Post-Bootstrap work to be managed by CPC [#115](https://github.com/openjs-foundation/cross-project-council/issues/115)

## Q&A, Other

## Upcoming Meetings

* **Calendar**: https://nodejs.org/calendar

Click `+GoogleCalendar` at the bottom right to add to your own Google calendar.

repository: openjs-foundation/cross-project-council

repo_name: openjs-foundation/cross-project-council