text:
# Description

This project solves the problem of calculating how much rain will be trapped in a wall with different heights.

You can visit a working demo here: https://marinashe.github.io/rain_wall/

The basic algorithm can be found here: https://github.com/marinashe/rain_wall/blob/master/src/calculate_volume_water.js

# Instructions

![](/demo.png)

* Drag the grass left-right to change the length of the wall
* Drag the bricks or the grass up-down to build a higher wall
* Click on the cloud to make it rain
* Click the cloud again to go back to edit mode
* The text field can be used to build custom walls. But if the wall is too long/high, no animation will be displayed

# Local Deployment

1. Clone the repository
2. Run `yarn install`
3. Run `yarn start`
4. Visit http://localhost:3000

license: Unlicense

gha_license_id: Unlicense


text:
AI Engine Development

    See Vitis™ Development Environment on xilinx.com

    See Vitis™ AI Development Environment on xilinx.com

# AI Engine Graph Integration and Validation using a Custom Linux Platform

***Version: Vitis 2023.1***

In this tutorial, you will use the design sources that are used to run the system design on base platform in [Running system design on AI Engine, PS, and PL using base platform](../05-AI-engine-versal-integration/README.md). You will re-target the design to use the custom platform created in [Creating Custom Platfom based on VCK190 Evaluation board](../../../Getting_Started/Vitis_Platform/README.md).

To read more about the AI Engine flow, see the *Versal ACAP AI Engine Programming Environment User Guide* ([UG1076](https://docs.xilinx.com/r/en-US/ug1076-ai-engine-environment)).

## Prerequisites

As described in [AI Engine A-to-Z Flow for Linux](README.md), two steps (tutorials) must be run before running this tutorial.

*   **Run system design targeting the base platform**. Follow the step-by-step procedure in [Running system design on AI Engine, PS, and PL using base platform](../05-AI-engine-versal-integration/README.md) to complete this step.

*  **Create a custom platform**. Follow the step-by-step procedure in [Creating Custom Platfom based on VCK190 Evaluation board](../../../Getting_Started/Vitis_Platform/README.md) to complete this step.

**IMPORTANT**: Before beginning the tutorial, make sure that you have read and followed the *Vitis Software Platform Release Notes* (v2023.1) for setting up software and installing the VCK190 base platform.

## Setting up the environment

First, set up the environment for integrating the subsystem with the custom platform and validating the design using the hardware emulation and hardware as follows:

1. Set up your `PLATFORM_REPO_PATHS` environment variable based upon where you created the custom platform during Step 2.
   For example, if the custom platform is created in the path `<vck190_custom_path>/export/vck190_custom/`, the `PLATFORM_REPO_PATHS `should be set accordingly.
2. Change the `BASE_PLATFORM` in the [Makefile](../05-AI-engine-versal-integration/Makefile) to point to the custom `.xpfm` file created in the `<vck190_custom_path>/export/vck190_custom/` directory.

   For example: `BASE_PLATFORM = ${PLATFORM_REPO_PATHS}/vck190_custom.xpfm`

3. Make sure your `ROOTFS` and `IMAGE` are still pointing to the `xilinx-versal-common-v2023.1` directory.

   **Note** : The `$PLATFORM_REPO_PATHS` now points to the custom platform and it does not contain the `rootfs.ext4` and `Image` files as pointed in the Makefile.

 Note that all other commands in the Makefile remain the same. Only the platform needs to be changed for re-targeting the design using custom platform.

 ## Re-compiling ADF graph

After making the necessary environment changes, re-compile the ADF graph targeting the custom platform using the command below:

 ```bash
 make aie TARGET=hw
 ```

or

```bash
aiecompiler --target=hw --platform $PLATFORM_REPO_PATHS/vck190_custom.xpfm -include="$XILINX_VITIS/aietools/include" -include="./aie" -include="./data" -include="./aie/kernels" -include="./" -workdir=./Work aie/graph.cpp`
```

## Re-compiling Programmable Logic (PL) kernels targeting the custom platform
Re-compile the PL kernets targeting the custom platform using the command below:

 ```bash
 make kernels TARGET=hw
 ```

or

```bash
v++ -c --platform $PLATFORM_REPO_PATHS/vck190_custom.xpfm --save-temps -g -k s2mm pl_kernels/s2mm.cpp -o s2mm.xo
v++ -c --platform $PLATFORM_REPO_PATHS/vck190_custom.xpfm --save-temps -g -k mm2s pl_kernels/mm2s.cpp -o mm2s.xo
```

## Hardware Emulation

Next, rrun the Hardware Emulation targeting the custom platform as follows:

1. Link AI Engine & PL kernels with platform.

   ```bash
   make xsa TARGET=hw_emu
   ```

   or

   ```bash
   v++ -l --platform $PLATFORM_REPO_PATHS/vck190_custom.xpfm s2mm.xo mm2s.xo libadf.a -t hw_emu --save-temps -g --config system.cfg -o tutorial.xsad
   ```

2. Compile the A72 Host Application.

   ```bash
   make host
   ```

   or

   ```bash
   cd ./sw

   aarch64-xilinx-linux-g++ -Wall -c -std=c++14 -Wno-int-to-pointer-cast --sysroot=$SDKTARGETSYSROOT -I$SDKTARGETSYSROOT/usr/include/xrt -I$SDKTARGETSYSROOT/usr/include -I./ -I../aie -I$XILINX_VITIS/aietools/include -I$XILINX_VITIS/include -o main.o .cpp

   aarch64-xilinx-linux-g++ main.o -lxrt_coreutil -L$SDKTARGETSYSROOT/usr/lib --sysroot=$SDKTARGETSYSROOT -L$XILINX_VITIS/aietools/lib/aarch64.o -o host.exe
   cd ..
   ```

3.  Run Hardware Emulation.

   ```bash
   make run_emu TARGET=hw_emu
   ```

   or

   ```bash
   cd ./sw
   ./launch_hw_emu.sh -aie-sim-options ../aiesimulator_output/aiesim_options.txt -add-env AIE_COMPILER_WORKDIR=../Work
   ```

5. Execute the following command when the emulated Linux prompt finally appears.

   ```bash
   cd /run/media/*1
   export XILINX_XRT=/usr
   dmesg -n 4 && echo "Hide DRM messages..."
   ```

6. Run the design using the following command.

   ```bash
   ./host.exe a.xclbin
   ```

7. You should see an output displaying TEST PASSED. When this is shown, run the keyboard command: `Ctrl+A x` to end the QEMU instance.

8. You can view the profiling and trace results of hardware emulation in an AMD Vitis™ Analyzer by running the following command:

**Note**: The Trace **Compare** feature is not available in the New Vitis IDE Analysis view. So, use the classic Vitis Analyzer for this.

```bash
vitis_analyzer --classic sw/sim/behav_waveform/default.aierun_summary
```

9. You can easily compare the results of the custom platform with the one generated using base platform. For example:

* Select **File > Open Summary** to open the summary file generated for the base platform target.
* Once the summary file opens, click **Trace**  to open the VCD data which gives information about kernels, tiles and nets within the AI Engine.
* Click the **Compare** option as shown in the following figure.

![hw_emu_trace_compare](./images/hw_emu_trace_comp1.PNG)

* From the drop down, select the trace output of other summary file as highlighted below.

![hw_emu_trace_compare2](./images/hw_emu_trace_comp2.PNG)

## Targeting Hardware

You can easily build for hardware by following the steps below.

**Note**: Because you already compiled the AI Engine graph and PL kernels for hardware emulation in the previous step, you do not need to re-compile them again for targeting the hardware. However, re-link and re-package for hardware run.

1. Link AI Engine and PL kernels with the platform:

   ```bash
   make xsa TARGET=hw
   ```

   or

   ```bash
   v++ -l --platform $PLATFORM_REPO_PATHS/vck190_custom.xpfm s2mm.xo mm2s.xo libadf.a -t hw --save-temps -g --config system.cfg -o   tutorial.xsa
   ```

2. Re-run the packaging step with:

   ```bash
   make package TARGET=hw
   ```

   or

   ```bash
   cd ./sw
   v++ --package -t hw \
      -f $PLATFORM_REPO_PATHS/vck190_custom.xpfm \
      --package.rootfs=$ROOTFS \
      --package.image_format=ext4 \
      --package.boot_mode=sd \
      --package.kernel_image=$IMAGE \
      --package.defer_aie_run \
      --package.sd_file host.exe ../tutorial.xsa ../libadf.a
   cd ..
   ```

   When you run on hardware, ensure that you have a supported SD card. Format the SD card with the `sw/sd_card.img` file. Then plug the SD card into the board and power it up.

3. When a Linux prompt appears, run the following commands:

   ```bash
   dmesg -n 4 && echo "Hide DRM messages..."
   cd /run/media/*1
   export XILINX_XRT=/usr
   ./host.exe a.xclbin
   ```

   You should see TEST PASSED. You have successfully run your design on hardware.

To read more about the AI Engine flow, see the *Versal ACAP AI Engine Programming Environment User Guide* ([UG1076](https://docs.xilinx.com/r/en-US/ug1076-ai-engine-environment)).

### Support

GitHub issues will be used for tracking requests and bugs. For questions go to [support.xilinx.com](https://support.xilinx.com/).

Copyright © 2020–2023 Advanced Micro Devices, Inc

Terms and Conditions

license: MIT

repository: Xilinx/Vitis-Tutorials

extension: md

gha_language: C

gha_license_id: MIT

license_type: permissive

repo_name: Xilinx/Vitis-Tutorials


text:
# IT looks so easy
My personal blog is a place where I will be able to describe in more detail the programs that I create.

## Getting Started
The current version of the website can be seen here: https://itlookssoeasy.com/

## Built With
* [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) - The Jekyll theme used

## Authors
* **Tomasz Strzoda** - [DrDEXT3R](https://github.com/DrDEXT3R)

branch_name: refs/heads/master

gha_language: JavaScript


text:
---
title: JavaScript Components
author: Michael Mayer
type: post
date: 2008-07-06T20:05:02+00:00
url: /2008/07/javascript-components/
categories:
  - 'JavaScript, HTML & CSS'
  - Open Source
tags:
  - 'JavaScript & Rich Client'
  - JavaScriptMVC
  - jQuery
  - Open Source

---
My blog was a calm place for a while now, because I’m terribly busy with writing code (like it should be…). With this posting, I want to present the prototype of JavaScript Components, which are comparable to [Swing Components][1] in Java. They make use of the [Composite Pattern][2]. That means every Component can act as a container for other Components. Together with Models, Views and a Controller (Event Dispatcher), they can form reusable widgets. Other projects did work on similar things (for example [jMaki Widgets][3]), but from what I see, they target different audiences. The suggested Components use a client-side only approach. They are tested with [JavaScriptMVC,][4] but may be useful for other frameworks as well. [jQuery][5] is required for DOM operations.

There already is a LayersComponent, which implements a content stack. Any component can be added as a new layer and only the respective top layer is visible.

Please check out the [demo application][6] ([download as ZIP][7]).

 [1]: http://java.sun.com/docs/books/tutorial/ui/features/components.html
 [2]: http://en.wikipedia.org/wiki/Composite_pattern
 [3]: https://ajax.dev.java.net/page-developer.html
 [4]: http://javascriptmvc.com/
 [5]: http://jquery.com/
 [6]: /downloads/jmvc/index.html
 [7]: /downloads/jmvc.zip

repository: lastzero/liquidbytes-blog

repo_name: lastzero/liquidbytes-blog


text:
# Quick Start

#### Run TiDB with Docker (Standalone mode)

You can quickly test TiDB with Docker, the source repository contains the Dockerfile which contains local tidb-server.

To install Docker on your system, you can read the document on https://docs.docker.com/

```
docker pull pingcap/tidb:latest
docker run --name tidb-server -d -p 4000:4000 pingcap/tidb:latest
```

`docker pull` may take a while to download images ~560M.

Then you can use official mysql client to connect to TiDB.

```
mysql -h <IP_ADDRESS> -P 4000 -u root -D test --prompt="tidb> "
```

Notice: OS X user may use `docker-machine ip` to connect it.

#### __Or run TiDB on TiKV cluster__

Read the documents for [Ansible deployment](https://github.com/pingcap/docs/blob/master/op-guide/ansible-deployment.md) or [docker deployment](https://github.com/pingcap/docs/blob/master/op-guide/docker-deployment.md).

#### __Pre-requirement__

Go environment. Currently a 64-bit version of go >= 1.9 is required.
```
git clone https://github.com/pingcap/tidb.git $GOPATH/src/github.com/pingcap/tidb
cd $GOPATH/src/github.com/pingcap/tidb
make
```

#### __Run as MySQL protocol server__

```
make
cd bin && ./tidb-server
```

In case you want to compile a specific location:

```
make server TARGET=$GOPATH/bin/tidb-server
```

The default server port is `4000` and can be changed by flag `-P <port>`.

Run `./tidb-server -h` to see more flag options.

After you started tidb-server, you can use official `mysql` client to connect to TiDB.

```
mysql -h <IP_ADDRESS> -P 4000 -u root -D test --prompt="tidb> "
```

repository: lucklove/tidb-wasm

gha_language: Go

repo_name: lucklove/tidb-wasm


text:
# Log Analysis (UDACITY FULL STACK WEB DEV)

![Icon](https://i.imgur.com/KfXf5jj.png)

## Purpose
A reporting tool (Python 2.x) that prints out reports (in plain text) based on a PostgreSQL database for a fictional news website.

The database includes three tables:
1. The articles table includes the articles themselves.
2. The authors table includes information about the authors of articles.
3. The log table includes one entry for each time a user has accessed the site.

The questions the reporting tool answers:
1. What are the most popular three articles of all time?
2. Who are the most popular article authors of all time?
3. On which days did more than 1% of requests lead to errors?

## Implementation
For the first and second question, create view that joins all three tables and projects article title, author name, and the number of views.
```sql
CREATE OR REPLACE VIEW log_view AS
  SELECT
    title AS article_title,
    name  AS author_name,
    views
  FROM articles, authors,
    (SELECT
       path,
       count(*) AS views
     FROM log
     GROUP BY log.path
    ) AS log
  WHERE articles.author = authors.id
        AND '/article/' || slug = path;
```

After view creation, group by article title and sum the number of views.
```sql
SELECT
  article_title,
  sum(views) AS views
FROM log_view
GROUP BY article_title
ORDER BY views DESC
LIMIT 3;
```

Likewise, the same can be done for author name.
```sql
SELECT
  author_name,
  sum(views) AS views
FROM log_view
GROUP BY author_name
ORDER BY views DESC;
```

For the third question, group by date and divide the number of failed HTTP requests by the total number of HTTP requests. The ```count(expression)``` function returns the number of input rows for which the value of expression is not null. The ```nullif(first value, second value)``` function returns a null value if the first value equals the second value; otherwise it returns the first value. By combining two aforementioned functions, we can obtain the number of input rows that does not equals a specified value, which in this case is "200 OK."

```sql
SELECT
  time :: DATE                                        AS date,
  count(nullif(status, '200 OK')) / count(*) :: FLOAT AS errors
FROM log
GROUP BY date
HAVING count(nullif(status, '200 OK')) / count(*) :: FLOAT > 0.01;
```

## Instructions
For Ubuntu or similar (e.g. Linux Mint).

### Install PostgresSQL
1. Open terminal
2. Update Repository:   ```sudo apt-get update```
3. Install PostgresSQL: ```sudo apt-get install postgresql postgresql-contrib```

### Configure PostgresSQL
1. Open terminal
2. PostgresSQL CLI: ```sudo -u postgres psql```
3. Create database: ```create database news;```
4. Create user:     ```create user vagrant password 'udacity';```
5. Quit CLI:        ```\q```

### Import Data
1. Open terminal and navigate to a working directory.
2. Download data: ```wget https://d17h27t6h515a5.cloudfront.net/topher/2016/August/57b5f748_newsdata/newsdata.zip```
3. Unpack data:   ```unzip newsdata.zip```
4. Import data:   ```sudo -u postgres psql -d news -f newsdata.sql```

### Create View
1. Open terminal and navigate to a working directory.
2. Download data: ```wget https://raw.githubusercontent.com/mr-rohankumar/LogAnalysis/master/src/create_view.sql```
3. Import data:   ```sudo -u postgres psql -d news -f create_view.sql```

### Run Reporting Tool
1. Open terminal and navigate to a working directory.
2. Download tool: ```wget https://raw.githubusercontent.com/mr-rohankumar/LogAnalysis/master/src/log_analysis.py```
3. Run tool:      ```python log_analysis.py```

## Output
```
(1) What are the most popular three articles of all time?
    * "Candidate is jerk, alleges rival" - 338647 views
    * "Bears love berries, alleges bear" - 253801 views
    * "Bad things gone, say good people" - 170098 views

(2) Who are the most popular article authors of all time?
    * Ursula La Multa - 507594 views
    * Rudolf von Treppenwitz - 423457 views
    * Anonymous Contributor - 170098 views
    * Markoff Chaney - 84557 views

(3) On which days did more than 1% of requests lead to errors?
    * July 17, 2016 - 2.3% errors
```

## License
```
MIT License

Copyright (c) 2017 Rohan Kumar

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: mr-rohankumar/LogAnalysis

repo_name: mr-rohankumar/LogAnalysis


text:
# FHIRClient
A simple PHP client for SMART on FHIR, the standard API for integrating applications with any modern healthcare system.

### Installation
```bash
$ composer require faulkj/fhirclient
```

## Basic Usage

### EMR Ebedded Mode

On initial load:
```php
//Assumining this is the URL loaded by the EMR:  https://my.website.com/launch/?iss=https://my.fhirserver.com/FHIRProxy/api/FHIR/R4&launch=abc123

use FaulkJ\FHIRClient;
session_start();

$iss = parse_url($_GET["iss"]);
$_SESSION["fhirParams"] = [
   "{$iss['scheme']}://{$iss['host']}",
   "1234-5678-9012-3456-7890",
   [
      "redirectURI" => "https://my.website.com"
   ]
];
$fhir = new FHIRClient(...$_SESSION["fhirParams"]);
$fhir->getConformance($_GET["iss"]);
$fhir->getAuthCode();
```

This will first get an Conformance Statement/SMART Configuration from _my.fhirserver.com/FHIRProxy/api/FHIR/R4_ to retrieve the authorization and token endpoints.  It will then request an authorization code from the authorization endpoint, triggering a redirect to _my.website.com_.

On _my.website.com_ when redirected:
```php
use FaulkJ\FHIRClient;
session_start();

$fc = new FHIRClient(...$_SESSION["fhirParams"]);
$fc->getAccessToken($_GET["code"]);

//You are now authenticated and may query the FHIR server
$obs = $fc->query("Observation?patient=12345678&code=12345-6");
if($obs->code == 200) echo $obs->body;
```

On subsequent page loads or AJAX calls, the FHIRClient will need to be reinstanciated before yoy can send a query:
```php
use FaulkJ\FHIRClient;
session_start();

$fc = new FHIRClient(...$_SESSION["fhirParams"]);
$pat = $fc->query("Patient/12345678");
if($pat->code == 200) echo $pat->body;
```

### Standalone Mode

On initial load:
```php
use FaulkJ\FHIRClient;
session_start();

$iss = parse_url($_GET["iss"]);
$_SESSION["fhirParams"] = [
   "https:/my.fhirserver.com",
   "1234-5678-9012-3456-7890",
   [
      "state"       => base64_encode(rand()),
      "redirectURI" => "https://my.website.com",
      "authURI"     => "FHIRProxy/oauth2/authorize",
      "tokenURI"    => "FHIRProxy/oauth2/token"
   ]
];
$fc = new FHIRClient(...$_SESSION["fhirParams"]);
$fc->getConformance($_GET["iss"]);
$fc->getAuthCode();
```
This example includes a randomly generated _state_ parameter and will request an authorization code from _my.fhirserver.com/FHIRProxy/oauth2/authorize_, triggering a redirect to _my.website.com_.

On _my.website.com_ when redirected:
```php
use FaulkJ\FHIRClient;
session_start();

$fc = new FHIRClient(...$_SESSION["fhirParams"]);
$fc->getAccessToken($_GET["code"]);

//You are now authenticated and may query the FHIR server
$obs = $fc->query("Observation?patient=12345678&code=12345-6");
if($obs->code == 200) echo $obs->body;
```

On subsequent page loads or AJAX calls, the FHIRClient will need to be reinstanciated before yoy can send a query:
```php
use FaulkJ\FHIRClient;
session_start();

$fc = new FHIRClient(...$_SESSION["fhirParams"]);
$pat = $fc->query("Patient/12345678");
if($pat->code == 200) echo $pat->body;
```

### Backend Mode

```php
use FaulkJ\FHIRClient;

$fc = (new FHIRClient(
   "https:/fhir.server.com",
   "1234-5678-9012-3456-7890",
   [
      "signingKey" => "D:\\privatekey.pem",
      "tokenURI"   => "FHIRProxy/oauth2/token"
   ]
))->debug(true);

$fc->getAccessToken();

$response = $fc->query("FHIRProxy/path/to/api/");
if($response->code == 200) echo $response->body;
```

repository: faulkj/FHIRClient

branch_name: refs/heads/main

repo_name: faulkj/FHIRClient


text:
KyogenRV(響玄RV):The Simple RISC-V for intel FPGA
=
## 日本語のREADMEは[こちら](README_J.md)
- Arch:RV32I
- Privilege : only M-mode
    - User-Level ISA Version 2.2
    - Privileged ISA Version 1.11
- Interrupt:External
- CPU Bus: Intel Avalon-MM Interface
- Pipelines: 5-stage(IF/ID/EX/MEM/WB)
- Written: in Chisel-lang v.3.4 + Makefile

## I.Usage
#### 0.using with intel FPGA

The standard environment assumption is using Cyclone10LP(10CL025YU256C8G).

##### Recommended development environment
- Cross development environment: Environment that satisfies all of the following conditions
  - An environment running Windows 10/WSL2
  - Running Quartus Prime Lite v.20.1.1 or higher
  - A scala/sbt environment must be available.
  - Pyhton 3.7 or higher is required.
- FPGA requirements: Devices that satisfied one of the following requirements
  - Cyclone 10LP (device with 10CL010 or more logic elements)
  - An intel FPGA with at least 1-block PLL, at least 7000 LEs of logic elements, and at least 1-KiB of On-Chip RAM
##### Preparing the riscv-toolchain
```
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=/opt/riscv --with-arch=rv32i
sudo make
```
##### Install KyogenRV and rebuild FPGA logic related
```
cd -
git clone http://github.com/panda5mt/KyogenRV
cd KyogenRV/
make sdk
```
##### Starting Quartus Prime
You can choose between GUI or CUI, the CUI method is useful when using a cloud or on-premises Windows PC.

###### Compiling with GUI
Run Quartus Prime and open the [fpga/kyogenrv_fpga_top.qpf](fpga/kyogenrv_fpga_top.qpf) project.
Menu -> Processing -> Start Compilation to start compilation.
###### Compiling with CUI
Open the build script [build_sdk.sh](build_sdk.sh) with an editor and set the Quartus Prime installation folder, KyogenRV directory, etc.
After confirming that everything PATH is correct, just run the following at the root of the project.
```
./build_sdk.sh
```
Regardless of which method CUI or GUI you use above, make sure that there are no build errors before modifying the project to fit your board environment using Pin Planner or Platform Designer.
The following files will be generated in the [fpga](fpga) folder.
- kyogenrv_fpga_top.sof

If you use CUI, the following file will also be generated.
- kyogenrv_fpga_top.svf
##### Modify the sample code(led.c as exam)
You may find it helpful to know how does this RISC-V CPU and its project works to modify [src/sw/main.c](src/sw/main.c).
If the code consists of multiple files or the file names are changed, please rewrite [src/sw/common2.mk](src/sw/common2.mk) to Makefile build all fixed and modified files.

##### Rebuild the project
###### Rebuild with GUI
After saving the file, run
```
make c_all
./mk_intel_hex.py
```
to compile project and re-generate the intel hex files.
If you are build all FPGA project, you can run,
```
make sdk
```
Start compiling by going to Menu -> Processing -> Start Compilation.
The generated *.sof file is used to configure the FPGA via Quartus Programmer.
###### Rebuild with CUI
Compared with GUI, the procedure is simple.
just run following to rebuild.
```
./build_sdk.sh
```
Configure the FPGA using *.sof or *.svf.
##
The following is the procedure for PC-based simulation; it is not necessary when using the FPGA hardware.
##
##
#### 1.Simulation
```
git clone http://github.com/panda5mt/KyogenRV
cd KyogenRV/
make clean
make test
```
to generate your *.hex files from your *.s,
put your *.s file to [src/sw/](src/sw) and then execute below
```
./build_asm.py        # generate *.hex file from *.s
./mk_intel_hex.py     # generate intel hex files
```

#### 2.Simulating with riscv-tests (need python 3.7 or later)
```
git clone http://github.com/panda5mt/KyogenRV
```
clone from riscv-tests
```
git clone https://github.com/riscv/riscv-tests
cd riscv-tests
git submodule update --init --recursive
```
then modify linker script
```
nano env/p/link.ld
```
change start address of '.text' section to start 0x00000000

```
SECTIONS
{
  . = 0x00000000;   # -> change this
  .text.init : { *(.text.init) }
  . = ALIGN(0x1000);
  .tohost : { *(.tohost) }
  . = ALIGN(0x1000);
  .text : { *(.text) }
  . = ALIGN(0x1000);
  .data : { *(.data) }
  .bss : { *(.bss) }
  _end = .;
}
```
save link.ld and make riscv-tests
```
autoconf
./configure --prefix=<your-kyogenRVs-root-dir>/tests/
make
make install
cd ../
```

```
cd KyogenRV/
make clean
make riscv-tests
```
#### 3.Generate Verilog
```
git clone http://github.com/panda5mt/KyogenRV
cd KyogenRV/
make clean
make hdl
```
##
## II.Basically Logic
##### The following instructions is written for who want to explore this "KyogenRV" RV32I design step by step. Otherwise, please clone the latest from GitHub.
#### 1.Instruction Fetch Stage(IF)
```
git clone http://github.com/panda5mt/KyogenRV -b 0.0.2 --depth 1
cd KyogenRV/
make test
```
#### 2.Instruction Decode Stage(ID) and Integer ALU
```
git clone http://github.com/panda5mt/KyogenRV -b 0.0.9 --depth 1
cd KyogenRV/
make test
```
#### 3.Branch (PC update)
```
git clone http://github.com/panda5mt/KyogenRV -b <IP_ADDRESS> --depth 1
cd KyogenRV/
```

write asm file and save to [src/sw/test.s](src/sw/test.s)
then build as follows

```
make asm
```
you'll get [src/sw/test.hex](src/sw/test.hex)
then build test module in chisel project as follows
```
make test
```

#### 4.Multi-staged pipeline (5-staged-pipeline)
```
git clone http://github.com/panda5mt/KyogenRV -b <IP_ADDRESS> --depth 1
cd KyogenRV/
```

write asm file and save to [src/sw/test.s](src/sw/test.s)
then build as follows

```
make clean
make asm
```
you'll get [src/sw/test.hex](src/sw/test.hex)
then build test module in chisel project as follows
```
make test
```
when you modified [src/sw/test.s](src/sw/test.s), just type as follows
```
make test
```
so makefile scan test.hex is changed and re-assemble then build chisel project.

#### 5. Added Stage-Stall and Stage-fowardings
```
git clone http://github.com/panda5mt/KyogenRV -b <IP_ADDRESS> --depth 1
cd KyogenRV/
```

write asm file and save to [src/sw/test.s](src/sw/test.s)
then build as follows

```
make clean
make asm
```
you'll get [src/sw/test.hex](src/sw/test.hex)
then build test module in chisel project as follows
```
make test
```
when you modified [src/sw/test.hex](src/sw/test.hex), just type as follows
```
make test
```
so makefile scan test.hex is changed and re-assemble then build chisel project.

#### 6. Added Exception and External Interrupt
please git clone latest one.

gha_language: Scala


text:
# CMDQuiz
A quiz game being made in native Batch script.

# Save files
The game's save file can be found at "%localappdata%\CMDQuiz". As of now, there is nothing else in said folder.

# Changelog
The changelog can be found in "Changelog.txt".

# To-do list

- [ ] ADD MORE LEVELS!
- [ ] Finish instruction & about sections
- [x] Add save files

repository: DigitalResistance/CMDQuiz

repo_name: DigitalResistance/CMDQuiz


text:
# saltstack-formula-ndenv
Testing salt formulas using [Kitchen](https://docs.chef.io/kitchen.html) and
[Testinfra](https://testinfra.readthedocs.io)

# Synopsis
Full test using Kitchen and Docker (used for CI)

```sh
$ gem install bundler
$ bundle install
$ kitchen test
```

You will find the above is slow, but that is because the test command combines
creating, coverging, verifying and destroying each test stuite. When testing it's
worth breaking each section up into individual commands.

```sh
$ kitchen create
$ kitchen converge
$ kitchen verify
$ kitchen destroy
```

Once you have run `kitchen converge` you will find you will only want to run the
`kitchen verify` command while you develop your `testinfra` tests. `verify` will
run the tests against a running `docker` container, so make sure your tests are
nullipotent.

# Description
If you're reading this, I'm assuming you're already familiar with SaltStack and
you understand the importance of testing salt recipes/formulas.

There are various ways of testing formulas that involve a lot of boilerplate,
but the canonical tool for testing salt recipes based on the
[Salt Stack Formulas](https://github.com/saltstack-formulas) github
organisation is [Chef](https://www.chef.io/chef/)'s
[Kitchen](https://docs.chef.io/kitchen.html).

`Kitchen` is great and very flexible. It allows you to use different
`verifiers`.

* [InSpec](http://inspec.io/)
* `Shell`
  * [Serverspec](http://serverspec.org/) (*ruby*)
  * [Testinfra](https://testinfra.readthedocs.io/) (*python*)

Verifiers can be in any language, and a lot of people seem to use `Serverspec`,
but as `SaltStack` is written in `Python`, I have opted to use `Testinfra` which
is also written in `Python`.

# References
* [Kitchen](https://docs.chef.io/kitchen.html)
* [Kitchen and testinfra](https://medium.com/@syndicut/testing-salt-formulas-with-test-kitchen-and-testinfra-d2b8642e6a39)
* [Saltstack, Docker and Testinfra](http://blog.xebia.com/testing-infrastructure-with-saltstack-docker-and-testinfra/)
* [Testinfra](https://testinfra.readthedocs.io)

repository: kwakwaversal/saltstack-formula-ndenv

gha_language: SaltStack

repo_name: kwakwaversal/saltstack-formula-ndenv


text:
---
changelog: 'You can export test results from any Step by using the Export test results
  to Test Reports add-on Step. Read about the Step and how to use it. '
last_modified_at: '2020-05-11T15:00:00.000+00:00'
tag:
- testing
- steps
- test-reports
title: Exporting to Test Reports from any Step
redirect_from: []
description: 'Test Reports allows you to view all your test results in a convenient
  way. By default, only four Steps support the Test Reports feature. However, you
  can export the test results of other Steps to Test Reports via custom Script Steps. '
summary: You can use the Export test results to the Test reports add-on Step to make
  sure your test results appear in the Test Reports add-on, even if you use Steps
  that don’t automatically export their results.
menu:
  testing-main:
    weight: 3

---
[Test Reports](/testing/test-reports/) allows you to view all your test results in a convenient way. By default, five [Steps](/steps-and-workflows/steps-and-workflows-index/) support the Test Reports add-on:

* **Xcode Test for iOS**
* **Android Unit Test**
* **iOS Device Testing**
* **Virtual Device Testing for Android**
* **Flutter Test**

To export the test results generated by any other Step to the **Deploy to Bitrise.io** Step, you have two options:

* We strongly recommend using our [**Export test results to the Test reports add-on** Step](https://www.bitrise.io/integrations/steps/custom-test-results-export): this Step locates the test results based on your inputs.
* You can configure your own custom **Script** Step that creates and exports the necessary files.

## Using the Export test results to the Test reports add-on Step

You can use the **Export test results to the Test reports add-on** Step to make sure your test results appear in the Test Reports add-on, even if you use Steps that don’t automatically export their results.

With the correct configuration, the Step finds the test results in your app’s repository, and puts them in the export directory.

1. Go to your app’s page on [bitrise.io](http://bitrise.io/).
2. Go to **Workflows** to open the Workflow Editor.
3. From the **WORKFLOW** menu, select the Workflow you use to run your tests.
4. Add the **Export test results to the Test reports add-on** Step AFTER the testing Step.
5. In the **The name of the test** input, set the name of the test.
   The test results will be under this name in the Test Reports add-on.
6. In the **Path where custom test results reside** input, set the path where your test results can be found.
   ![](/img/bitrise_workflow_editor-2.png)
   We recommend setting a folder here, though you can also set a specific filepath. The default value is the source directory of your app. Example patterns:
   * If your app’s root directory is app: `app/build/test-results/testDemoDebugUnitTest/`
   * If your test results are within an app folder but app is not the root directory: ./app/build/test-results/testDemoDebugUnitTest/
7. In the **Test result search pattern** input, set a pattern that matches your test result file.

   This search pattern is used to search every file and folder of the path that was set in the **Path where custom test results reside** input.
   If there is more than one match, the Step will export the first match with a warning in the logs. If you set a specific filepath in the previous input, just set * here.
   Example patterns:
   * Matching all files within the base path: `*`
   * Matching all files within a given directory of the base path: `*/build/test-results/testDemoDebugUnitTest/*`
8. In the **Step’s test result directory** input, make sure the path is correct.
   Do NOT modify this input’s value: this is the folder where the **Deploy to Bitrise.io** Step will look for the test results to export them. It should be set to the `$BITRISE_TEST_RESULT_DIR` Env Var.
9. Make sure you have a **Deploy to Bitrise.io** Step in your Workflow.

## Using custom scripts to export test results

You can use your own scripts in a **Script** Step to export your test results. You just need to make sure that:

* Your test results are in a JUnit XML format.
* You place the results in the $BITRISE_TEST_RESULT_DIR, which is an Environment Variable pointing to the correct path.
* You place a `test-info.json` file in each test result's sub-directory.

{% include message_box.html type="info" title="The `test-info.json` file" content="The `test-info.json` file must have the test name defined in it. Each test result should have its own `test-info.json` file. The value of test-name will appear as the name of the test run on the Test Reports page.

    // Test Name ...
    { \"test-name\":\"My first test\" }
 "%}

Here's an example script to export your test results:

```
#!/bin/env bash
set -ex

# Creating a sub-directory for the test run within the BITRISE_TEST_RESULT_DIR:

test_run_dir="$BITRISE_TEST_RESULT_DIR/result_dir_1"
mkdir "$test_run_dir"

# Exporting the JUnit XML test report:

cp "MY/TEST/REPORT/XML/FILE/PATH.xml" "$test_run_dir/UnitTest.xml"

# Creating the test-info.json file with the name of the test run defined:

echo '{"test-name":"MY TEST RUN NAME"}' >> "$test_run_dir/test-info.json"
```

If all goes well, you should be able to see your test results on the [Test Reports](/testing/test-reports/) page.

{% include banner.html banner_text="Export test results with Script Steps" url="https://app.bitrise.io/dashboard/builds" button_text="Go to your app" %}

repository: Vinkumaray/devcenter

repo_name: Vinkumaray/devcenter


text:
# banner-bundle

## Usage

Add this bundle to your AppKernel.php `new \Forci\Bundle\BannerBundle\ForciBannerBundle()`

Execute `app/console doctrine:schema:update --dump-sql` and after verifying what is being executed, execute again with --force.
Alternatively, use doctrine migrations via the DoctrineMigrations bundle.

Once this has been done, you can start using the bundle. Simply register it in your routing.yml in a protected area such as admin, like so:

```
forci_banner:
    resource<EMAIL_ADDRESS>    prefix: /banners
```

You can create a link to the builder using `{{ path('forci_banner_dashboard') }}`, or embed it into your admin UI via an iframe like so `<iframe src="{{ path('forci_banner_dashboard') }}" style="border: 0; width: 100%; height: 100%;"></iframe>`

The User Interface is pretty self-explanatory.
You create banners and positions.
Banners contain the JavaScript or HTML code.
This can also be used for tracking or anything external you would like to add to your website via a UI in your admin section without thinking too much about its implementation.
Positions are placed in your code on your pages, like this `{{ 'YourPositionName'|banner }}` (There is also a twig function)
You can also print a link to the same page you're at, but with positions in debug mode, but only if your user has the `ROLE_ADMIN` role using `{{ showBannerPositionsUrl() }}`
If a position is lacking a banner, is inactive, the banner is inactive, or any other error, if you have `ROLE_ADMIN`, you will get an error message

## Caching

If you need cache: Alias your own `Psr\Cache\CacheItemPoolInterface` to `forci_banner.cache`, for example:

`<service id="forci_banner.cache" alias="app.cache" />` where the `app.cache` service is an instance of `Psr\Cache\CacheItemPoolInterface`

# TODO

- Tests!

repository: forci/banner-bundle

repo_name: forci/banner-bundle


text:
# DIY Flashcards

There is a lot of terminology and knowledge in today's lessons. These aren't
skills that you can necessarily apply. However, the body of knowledge is
essential to understand how networking works both in ideal and practical senses.

Today, it's up to you to make your own flashcards for studying. You can make
then in your pair and share the Anki files. Use them to study because this will
likely be on your assessment and in some interviews.


text:
# Session 1 - Introduction

## What is Reinforcement Learning?

Reinforcement learning is a part of machine learning, which enables the model/machine to learn about its surroundings through its actions based on maximum reward mechanism. Reinforcement concept itself came from psychology, which is about conditioning based on rewards and punishments to get the desired results. This is quite different than the other machine learning domains, the supervised learning and unsupervised learning.

Supervised learning uses labels as the guidances for the model to learn. Meanwhile, the unsupervised learning learns from the intrinsic features from the data without the human-annotated labels. The most distinguished differences from reinforcement learning are the reinforcement mechanism itself and the exploration-exploitation process, which do not exist in supervised or unsupervised learning.

## The Elements of Reinforcement Learning

<EMAIL_ADDRESS>
*Figure from Donnie Prakoso Session 1 slide*

All the reinforcement learning has these basic elements:
- Agent:
    The virtual car (neural network model) in simulation or the physical device (OpenVino AWS DeepRacer car).
- Environment:
    The race track (coordinates in simulation) or the physical track.
- State:
    Agent's snapshot at the point of time from the environment. There are current state, previous state and future state. In here, it is the image that the camera takes.
- Action:
    The decision which the agent will choose. For example, the speed and the steering angle.
- Reward:
    The incentives for particular behaviors. This can be a positive reward or negative reward (punishment). We define the reward function for the agent.

As the main goal in reinforcement learning is to get the maximum rewards, there is a trade-off in reinforcement learning which is between the exploration and the exploitation. When the agent explores too much, it won't maximizes the reward as all actions might not give the maximum result. And when the agent exploits too much, it might not maximizes the right action. The agent should balances between exploration and exploitation.

<EMAIL_ADDRESS>
*Figure from Donnie Prakoso Session 1 slide*

In a bigger picture, the learning in reinforcement learning goes like this. The agent will choose an action upon the environment state, which returns the reward and then goes to next state. We will discuss this particular process in the Session 2 using Markov Decision Process.

### Scores
By using the reward function, we can give a score to each behavior. For example, we want to give a higher reward if the agent maintains a high speed and penalize with lower reward if the agent goes slow.

### Episode
If the agent reaches a stop state, where it reaches its destination or off-track, the rewards will be totaled/ summed. It is called an episode.

### Iteration
Learning in machine learning takes some iterations for the model to converge to its optimum points. This is the same in reinforcement learning where it takes some iterations to optimize those rewards that have been accumulated. In every n-th of the iteration, the model matrix will be updated accordingly.

## Reward function

It is important to tweak the reward function so the agent will maximize the behavior we want to enforce. There are several parameters that we can adjust.

<EMAIL_ADDRESS>
*[Figure from AWS DeepRacer tutorial](https://d2k9g1efyej86q.cloudfront.net/)*

More detailed explanation is available on the AWS DeepRacer documeentation. I will put a separate blog post regarding the params and my findings after this bootcamp is over.

## AWS DeepRacer League in 2020!
<EMAIL_ADDRESS>*Figure from Donnie Prakoso Session 1 slide*

I am participating in the online virtual circuit in the time trial race formats. I really enjoy training the DeepRacer agent, it is really fun to watch, you can see the simulation video stream of your agent struggling to maximize the rewards.

<EMAIL_ADDRESS>

gha_language: CSS


text:
---
layout: post
title: Add Stripe Keys to Config
lang: en
date: 2017-01-31 09:00:00
description: We are going to use the Stripe React JS SDK in our Create React App. To do so, we are going to store our Stripe Publishable API Key in our React app config. We also need to include Stripe.js in our HTML page.
ref: add-stripe-keys-to-config
comments_id: add-stripe-keys-to-config/185
---

Back in the [Setup a Stripe account]({% link _chapters/setup-a-stripe-account.md %}) chapter, we had two keys in the Stripe console. The **Secret key** that we used in the backend and the **Publishable key**. The **Publishable key** is meant to be used in the frontend.

{%change%} Add the following line below the `const config = {` line in your `src/config.js`.

``` txt
STRIPE_KEY: "YOUR_STRIPE_PUBLIC_KEY",
```

Make sure to replace, `YOUR_STRIPE_PUBLIC_KEY` with the **Publishable key** from the [Setup a Stripe account]({% link _chapters/setup-a-stripe-account.md %}) chapter.

Let's also include Stripe.js in our HTML.

{%change%} Append the following to the `<head>` block in our `public/index.html`.

``` html
<script src="https://js.stripe.com/v3/"></script>
```

And load the Stripe config in our settings page.

{%change%} Add the following at top of the `Settings` component in `src/containers/Settings.js` above the `billUser()` function.

``` javascript
const [stripe, setStripe] = useState(null);

useEffect(() => {
  setStripe(window.Stripe(config.STRIPE_KEY));
}, []);
```

This loads the Stripe object from Stripe.js with the Stripe key when our settings page loads. And saves it to the state.

Next, we'll build our billing form.


text:
---
layout: post
title: How to set timezone in MySQL?
description: 3 ways to configure timezone in MySQL
summary: 3 ways to configure timezone in MySQL
tags: mysql
minute: 1
---

There are 3 ways to set timezone in MySQL

* Using MySQL configuration file `my.cnf`
* Using `@@global.time_zone` variable
* Using `@@session.time_zone` variable

Let's get into each of them.

### 1. Set timezone using the file `my.cnf`

Go to your MySQL configuration fire `my.cnf`, usually found in `/etc/mysql/my.cnf`, you can see the `default-time-zone` variable in the `[mysqld]` section. Then set it to the timezone you want:

```
default-time-zone='timezone'
```

### 2. Set timezone using the `@@global.time_zone` variable

To see the current timezone value:

```
SELECT @@global.time_zone;
```

Set it to the timezone you want:

```
SET @@global.time_zone = 'timezone';
```

You can also use the following query:

```
SET GLOBAL time_zone = 'timezone';
```

### 3. Set timezone using the `@@session.time_zone` variable

It's quite similar to the `@@global.time_zone` variable.

To see the current timezone value:

```
SELECT @@session.time_zone;
```

Set it to the timezone you want:

```
SET @@session.time_zone = 'timezone';
```

You can also use the following query:

```
SET time_zone = 'timezone';
```

For more detailed information, please see the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html)

repository: ntvpz/sql

repo_name: ntvpz/sql


text:
---
title: 'About'
date: 2021-04-16T17:01:34+07:00
layout: page
bodyClass: page-about
---

We are a __National HRD Award__ winning one stop solution for all HR management related challenges and opportunities. Our team of management professionals are dedicated to the vision of evolving a total problem solution in the fields of _Strategy, HRD, OD, TQM & Executive coaching_, and in the process multiplying an organization’s _talent nucleus and human capital_, the two vital pillars in creating a globally competitive benchmark organization. The fact that in the last 25 years of its existence we have been invited to design and conduct organization wide HR, OD and training initiatives in over a hundred organizations covering 2.5 lac Shop-floor operatives, executives, managers and directors (including CEO’s in 10 of India's top corporates and MNCs) testifies to the honesty of our endeavor and the depth of our achievements.

As management strategists, the Synergy HR Consulting Group employs the _Psycho cybernetic_ approach to evolve pragmatic solutions that resonate to the essential human & organizational aspirations and trigger success spirals.

## Our Philosophy

Our philosophy and mission is based on two basic premises; one is that in the ultimate analysis the human being or an organization is an energy system and any true learning should result in unleashing the fullest human / organizational potential. The second premise is a realization that underneath the current complex & chaotic political & socio-economic scenario there is an evolutionary order. There is always a pattern lurking in the deeper layers of the constantly evolving organizations. The challenge is to explore these and uncover inner harmony and insights into the processes of creating empowered organizations which are cost and quality leaders globally.

## Our Track record
Synergy Group Managing Director and other professionals have been operating as mission critical management consultants over the last two decades to some of the leading Indian and multinationals based in India & South East Asia such as:
- Reliance Ltd
- L & T
- Vedanta
- City Bank
- ABB
- Crompton Greaves Limited
- Pfizer
- Aventis
- Asian Paints
- Ranbaxy
- Sun Pharma
- Agiv Group (Dubai)
- Quest Pharma (Nepal).

repository: terrinoculon/jekyll-serif-synergy

repo_name: terrinoculon/jekyll-serif-synergy


text:
# [Simple - Bootstrap Plus Plus HTML Template ](https://bootstrapplusplus.com/template/simple/)

It's a multi page portfolio template based on Dark Bootstrap Theme from Bootstrap Plus Plus, created by Araf Karim @ Bootstrap Plus Plus. This template has three pages - Home, Work (Portfolio), Contact.

## Preview

![Simple Preview](https://bootstrapplusplus.com/template/preview/simple.jpg)

**[Live Preview](https://bootstrapplusplus.com/template/simple/)** ~
**[License](https://github.com/arafkarim/Simple-BootstrapPlusPlus/blob/master/LICENSE)**

## Get in Touch

Newsletter - https://bootstrapplusplus.com/index.html#features

Contact Us - https://bootstrapPlusPlus.com/contact.html

Visit Us - https://bootstrapPlusPlus.com

## Copyright and License

Copyright 2018 Bootstrap Plus Plus. Code released under the [MIT license](https://github.com/arafkarim/Simple-BootstrapPlusPlus/blob/master/LICENSE).

repository: arafkarim/Simple-BootstrapPlusPlus

repo_name: arafkarim/Simple-BootstrapPlusPlus


text:
# LTM9057_demo
Software for reading and writing registers on the LTM9057

Control the program via the Arduino Serial Monitor or similar serial interface such as PuTTY,
with the baud rate set to 115200.

The main menu is printed out and the serial port monitored for input. The user enters the selection
number for a desired interaction with the LTM9057 device registers

Menus for reading or writing to FAULT1, FAULT2, ALERT1, ALERT2, CTRLA, CTRLB and reading
STATUS1 and STATUS2 registers have been provided, all other registers may be accessed by
selecting either "2-Read Single Register" or "3-Write Single Register" from the main menu
then entering the register's hex value address, i.e. 0x03 etc. (Refer to LTM9057 datasheet Table 3)

Bit values within specific registers may be written to by entering their position 0 to 7,
(Refer to LTM9057 datasheet Tables 4 - 16), using "4-Set Bit" or "Clear Bit"

Customized values for current sense resistance, ADIN scaling and device address may be changed
in the DC2819A-2_Linduino.ino file at lines 10 - 12

DISCLAIMER:

The DC2819A-2_Linduino.ino is derived from the DC2423A_Linduino.ino as its template.
Copyright (c) 2013, Linear Technology Corp.(LTC)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

This software is provided "as is" and any express or implied warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no
event shall the copyright owner or contributors be liable for any direct, indirect incidental, special,
exemplary, or consequential damages (including, but not limited to, procurement of substitute goods
or services; loss of use, data, or profits; or business interruption) however caused and on any theory
of liability, whether in contract, strict liability, or tort (including negligence or otherwise)
arising in any way out of the use of this software, even if advised of the possibility of such damage.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of Analog Devices Corp.

The Analog Devices Linduino is not affiliated with the official Arduino team.
However, the Linduino is only possible because of the Arduino team's commitment
to the open-source community.  Please, visit http://www.arduino.cc and
http://store.arduino.cc , and consider a purchase that will help fund their
ongoing work.


text:
---
title: Copy of Base defender 1
layout: post
author: john.nickless
permalink: /copy-of-base-defender-1/
source-id: 1bo9F4gyzk3dHPJWLg1Wmoenha-cqfJ5kzq7ALyhBCMU
published: true
---

    Title
    Game design 2
    Date
    23/1/18

    Starting point:
    Some code on base defender

    Target for this lesson?
    Continue coding

    Did I reach my target?
    Yes.

    How did you use your learning habits this week?

    Persevering
    My code went wrong but I kept on trying

    Questioning?
    I asked if I was allowed to add music

    Independence
    I continued coding by myself

    Reflecting
    I used my previous knowledge to fix the problems I faced

    Engagement
    I put forward some suggestions in class

    What changes do you need to make to improve your learning next time?

    n/a


text:
# Cici

Cici is a cryptocurrency trading bot written in Python and based on the GDAX API. Based on parameters in a config file it can trade using lots of different strategies based on up to four simple or weighted moving averages. Cici will send an SMS (via Twilio) when it makes a trade.

I wrote a blog post about my experiences [here](https://blog.madebywindmill.com/my-foray-into-algorithmic-crypto-trading-beac9113de36) that might help understand the project. You'll need a server to host it on.

### Obvious Disclaimer
This project is provided without warranty.  But if you do, I'm not responsible for the results. Unless you make a lot of dough. In that case you can buy me a beer.

### Running Cici

Requirements:
* A GDAX API key
* A Twilio API key
* Some mula in your GDAX account

To run Cici:

`python cici.py --configFile Example-config.json`

If you're not running it from `rc.local`, et al you might want to:

`nohup python cici.py --configFile Example-config.json &`

When Cici starts up, it asks GDAX for your account balance. If there's money in your USD account it assumes you want to buy and will buy when the strategy allows. If there's no USD but there is coin in the cryptocurrency specified in the config file, it will assume you want to sell and will do so, again when the strategy allows.

**Be careful: Cici uses all-or-nothing logic. If there's USD, it buys with all of it. If there's coin, it sells all of it.**

### The Config File

_productID_

The product that you want to trade on GDAX. E.g. "BTC-USD".

_logFile_

A path to a file that Cici will log to.

_phone_

The phone number that Cici will SMS when a trade happens.

_maPeriodHours_

The interval in hours of the moving average period.

_ma1Count, ma2Count, ma3Count, ma4Count_

Cici supports either two or four moving average period lengths. `ma1Count` and `ma2Count` are the period lengths for short term trends. `ma3Count` and `ma4Count` are period lengths for long term trands. If only `ma1Count` and `ma2Count` are provided, the bot will try to sell whenever `ma1Value > ma2Value` and buy when `ma1Value < ma2Value`. If `ma3Count` and `ma4Count` are specified, then the bot will only trade when `ma3Value > ma4Value`.

_maWeight_

Setting `maWeight` to positive values above 1.0 will emphasize prices closer to the end of the window. Setting `maWeight` to negative values will emphasize prices closer to the beginning of the window. Setting `maWeight` to 1.0 makes it a simple moving average.

_maRatio_

Setting `maRatio` to > 0.0 will keep Cici from making a trade unless the values of the two short term averages have a variance of more than this ratio. For example, if `maRatio` is 0.002, Cici is waiting to sell, and the ma1 value is 134.77 while the ma2 value is 134.55, Cici won't sell even though ma1 > ma2 because (134.77 - 134.55)/134.77 = 0.0016 which is less than `maRatio` of 0.002. Using a `maRatio` may help avoid "whipsaw trading".

### FAQ

**I'm confused. How do I get help?**

Sorry, this project is provided with NO support so please don't email me for help.

**How should I report a bug?**

I _do_ want to know about outright bugs so file an issue if you find one.

**What's the best strategy?**

I wish I knew. If you find it, please let me know.

**Is it possible to test the bot before running it "live"?**

GDAX used to offer a sandbox version of their API but I haven't been able to get it to work. Instead you can set `debug` to `True` in `cici.py`. When run in debug mode, the bot will simulate buying and selling but will not actually execute any trades.

**Why does Cici use market orders?**

Limit orders are great since there are often no fees, but there's also no guarantee that the order will actually get executed so instead I've opted to use market orders and eat the fees.

**Your Python code sucks.**

OK first off that's not really a question. But hey, I'm a Swift/Obj-C programmer by trade so yeah my Python skills aren't that great. But I'm always learning so feel free to suggest improvements.

repository: TheMetaphysicalCrook/cici

repo_name: TheMetaphysicalCrook/cici


text:
# Project Name

Password-Locker

## Author

[Chebet Eddah](https://batyrotich.github.com)

## Description

This is a project that enable clients to store and retrieve their credentials upon log-in and create new credentials or passwords and even generate random passwords for different accounts.

## Features

 - Create account for new user

 - Logging in

 - Option of computer generated password

 - Create new credential

 - Delete credential

 - Display existing credential
 s
 - Search credential by site name

 - Exit for leaving the site

## Behavior Driven Development

| Behaviour | Input | Output |
| :---------------- | :---------------: | ------------------: |
| Display codes for navigation | In terminal: $./run.py | Welcome, choose an option: ca-Create Account, li-Log In, ex-Exit |
| Display prompt for creating an account | Enter: ca | Enter your name, email and password |
| Display prompt for login in | Enter: li | Enter your account name and password |
| Display codes for navigation | Successful login | Choose an option: cc - Create Credential, dc - Display Credentials, fc - Find Credential,  del - Delete Credential, ex - exit |
| Display prompt for creating a credential | Enter: cc | Enter the site name, your username and password |
| Display a list of credentials | Enter: dc | Prints a list of saved credentials |
| Find a credential | Enter: fc | Prints the searched credential |
| Deletes a saved credential | Enter: del | Prints success |
| Exit application | Enter: ex | Exit the current navigation stage |

## Setup/Installation requirements

 1.Clone or download and unzip the repository from github https://github.com/batyrotich/Password-Locker.git

2.You can use this command (git clone https://github.com/batyrotich/Password-Locker.git ) to clone the project to your   machine if you have git .

3. cd into the project folder and open in text editor either code. or atom.

4. Then run chmod +x run.py on your project directory.

5. Run ./run.py to launch the program.

## Technologies Used

 - PYTHON

 - Git

 ## License
 Licensed unde MIT LICENSE

## Contact Information

 -email: chebet eddah

 -phone no. :<PHONE_NUMBER>

repository: batyrotich/Password-Locker

repo_name: batyrotich/Password-Locker


text:
---
title: "booked to speak in negative one day"
tags: [ "gbsw", "your speaking journey", "soness", "synchronicity" ]
author: Rob Nugen
date: 2018-05-09T14:38:30+09:00
---

## 14:38 Wednesday 09 May 2018 JST

I am not sure how all this works, but I plan to join
[Soness](http://soness.com/)'s
[Get Booked to Speak in a Week](https://courses.yourspeakingjourney.com/)
class starting tomorrow.  So that means between tomorrow and the week
after, I should get booked to speak.  Does it count if I get booked
today, before the class starts?

It's not really a *speaking* engagement, but come on out to Bar
GariGari on June 1st for [story telling night](https://www.meetup.com/Apocrypha/events/249933126/)

repository: thunderrabbit/gatsby-pandas-blog

repo_name: thunderrabbit/gatsby-pandas-blog


text:
---
layout: page
title: Machine Learning
date: 2016-06-08 22:22:22
permalink: machine-learning
---

This page is compilation of posts that explain various machine learning algorithms. The posts are organized by algorithms. This is a work in progress. I will add more posts as I go. I am now starting with simpler instance-based machine learning algorithms, and will build up to more complex algorithms.

#### Linear Methods
- [Linear regression using matrix derivatives](http://vxy10.github.io/2016/06/25/lin-reg-matrix/)
- [Linear classification - Support vector machines.](http://vxy10.github.io/2016/06/26/lin-svm/)

#### Instance Based Algorithms
- [Introduction to KNN](http://vxy10.github.io/2016/06/08/knn-post/)
- [Kernel Methods](http://vxy10.github.io/2016/06/23/kernel-post/)
- [KNN for image classification](http://vxy10.github.io/2016/06/24/knn-image/)


text:
# Basic Linux VM with Public ip

Linux VM with:

- Ubuntu 18.04
- SSH Authentication only
- Public ip
- Standard B1s SKU
- Automatic Updates (reboot 02:00)
- Microsoft signing key
- Azure CLI APT Repository
- Azure CLI
- Customizable cloud-init
- Zone support

## Usage

> Note: You are required to configure access to this virtual machine with an explicit NSG rule allowing SSH.

```terraform

module "vm" {
  source       = "github.com/rjfmachado/tf-basic-linuxvm-pip"
  name         = "vm"
  rg           = azurerm_resource_group.hub.name
  subnetid     = azurerm_subnet.hub.id
  size         = "Standard_B2s"
}

resource "azurerm_network_security_group" "vm" {
  name                = "vm"
  location            = azurerm_resource_group.hub.location
  resource_group_name = azurerm_resource_group.hub.name
}

resource "azurerm_subnet_network_security_group_association" "vm" {
  subnet_id                 = azurerm_subnet.hub.id
  network_security_group_id = azurerm_network_security_group.vm.id
}

resource "azurerm_network_security_rule" "allowssh" {
  name                        = "allowssh"
  priority                    = 100
  direction                   = "Inbound"
  access                      = "Allow"
  protocol                    = "Tcp"
  source_port_range           = "*"
  destination_port_range      = "22"
  source_address_prefix       = "Internet"
  destination_address_prefix  = module.vm.privateip
  resource_group_name         = azurerm_resource_group.hub.name
  network_security_group_name = azurerm_network_security_group.vm.name
}
```

repository: rjfmachado/tf-basic-linuxvm-pip

repo_name: rjfmachado/tf-basic-linuxvm-pip


text:
## Supported platforms
Ataraxia Linux has been ported to 14 different CPU architectures:
```
 * amd64        - for 64-bit x86 CPUs
 * i386         - for 32-bit x86 CPUs beginning with classic Intel Pentium
 * arm64        - for 64-bit ARM CPUs
 * armhf        - for 32-bit ARM CPUs beginning at ARMv7-a (hard-float)
 * armel        - for 32-bit ARM CPUs beginning at ARMv5   (soft-float)
 * mips64       - for 64-bit MIPS CPUs beginning at MIPS Release 1 (big-endian)
 * mips64el     - for 64-bit MIPS CPUs beginning at MIPS Release 1 (little-endian)
 * mips         - for 32-bit MIPS CPUs beginning at MIPS Release 1 (big-endian)
 * mipsel       - for 32-bit MIPS CPUs beginning at MIPS Release 1 (little-endian)
 * m68k         - for 32-bit Motorola 68000 CPUs beginning Motorola 68020
 * riscv64      - for 64-bit RISC V CPUs
 * riscv32      - for 32-bit RISC V CPUs
```

license: ISC

repository: byteman/ataraxia

repo_name: byteman/ataraxia


text:
## Redis query

The `redis.query` processor retrieves data from Redis.

See the test case configuration:
https://github.com/evanx/redex/blob/master/test/redisQuery/redex.yaml

In this case, we have chosen to configure all the processors' `configs` in a single YAML file:

```yaml
- processorName: redis.query.singleton
  namespace: redex:test:query
```

### Implementation

See the implementation of the `redis.query` processor:
https://github.com/evanx/redex/blob/master/processors/redis/query.js

```javascript
export default class Query {
   redis = new Redis({});
}
```

## Running

We run this configuration using the following script:
```shell
evans@boromir:~/redex$ cat test/redisQuery/run.sh
  nodejs index.js test/redisQuery/redex.yaml | bunyan -o short
```

Then try the following in your browser:
- [http://localhost:8880/redex](http://localhost:8880/redex)

Notes:
- the `/redex` route is configured to serve the state of the Redex instance

## Learn more

Other examples:
- https://github.com/evanx/redex/tree/master/test/cases/expressRouter/

detected_licenses: MIT ISC BSD-2-Clause


text:
# Revert Github dark color header to the original color
Revert github ugly dark theme header to light theme by purely overwrite CSS.

# How to use
Copy contents in the CSS file and paste to any web page styling plugin you are using (such as Stylish).
Feel free to open an issue if it broke.
Enjoy :)

repository: JimmyBenKlieve/revert-github-header

repo_name: JimmyBenKlieve/revert-github-header


text:
Usage of .factors files
=======================

The checking process involves creating Pocklington primality certificates,
which are stored in a `.factors` file.

The format of this file is a list of factorizations of the form
`factor(<x>): <factorization>`, where `<x>` is an integer and `<factorization>`
is a list of prime powers `p^m` separated by `*`.

It is possible to add factorizations manually, e.g. if a particular
factorization is too hard for Sage and needs to be done by external
factoring software. *describe-curve* will report factorizations that
are taking a long time.

If a `.factors` file is already present then it will be used to speed
up computations, but its contents will be checked. Please *do not*
assume that this checking is robust against adversarial input (even
though it is supposed to be). If in doubt, just delete the file and it
will be recreated.

repository: daira/describe-curve

repo_name: daira/describe-curve


text:
# audio_manager
[![pub package](https://img.shields.io/pub/v/audio_manager.svg)](https://pub.dartlang.org/packages/audio_manager)

A flutter plugin for music playback, including notification handling.
> This plugin is developed for iOS based on AVPlayer, while android is based on mediaplayer

## iOS
Add the following permissions in the `info.plist` file
```xml
	<key>UIBackgroundModes</key>
	<array>
		<string>audio</string>
	</array>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
```
- ⚠ Some methods are invalid in the simulator, please use the real machine

## Android
Since `Android9.0 (API 28)`, the application disables HTTP plaintext requests by default. To allow requests, add `android:usesCleartextTraffic="true"` in `AndroidManifest.xml`
```xml
<application
	...
	android:usesCleartextTraffic="true"
	...
>
```
- ⚠ Android minimum supported version 23 `(app/build.gradle -> minSdkVersion: 23)`
- ⚠ Android minimum supported Gradle version is 5.4.1 `(gradle-wrapper.properties -> gradle-5.4.1-all.zip)`

## How to use?
The `audio_manager` plugin is developed in singleton mode. You only need to get`AudioManager.instance` in the method to quickly start using it.

## Quick start
you can use local `assets`, `directory file` or `network` resources

```dart
// Initial playback. Preloaded playback information
AudioManager.instance
	.start(
		"assets/audio.mp3",
		// "network format resource"
		// "local resource (file://${file.path})"
		"title",
		desc: "desc",
		cover: "assets/ic_launcher.png",
		// cover: "network cover image resource")
	.then((err) {
	print(err);
});

// Play or pause; that is, pause if currently playing, otherwise play
AudioManager.instance.playOrPause()

// events callback
AudioManager.instance.onEvents((events, args) {
	print("$events, $args");
}
```


text:
# _{Portfolio Project}_

#### _{Friday, Mar 22, 2019}_

#### By _**{Katlin Anderson}**_

## Description

https://knbanderson.github.io/portfolio-project/
This is a practice portfolio I have created for the first Epicodus solo project.

## Getting Started

* _Clone this repository_

## Built With

* html
* css

## License

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

 Copyright (c) 2019 **_{Katlin Anderson}_**

repository: KNBAnderson/portfolio-project

repo_name: KNBAnderson/portfolio-project


text:
# Madzone

Madzone is a simplistic dungeon crawler game made with Unity.
Fight in randomly generated levels, upgrade your weapons and survive the deepest caves.

The game will be made downloadable with the Github Realease system.
If you want to build it yourself, you will need the Unity software installed. Simply
clone the repository, open it as a Unity project, and it'll be ready to build!

We do not own Unity or any related Unity technologies in any manner or sort.

repository: Penguinsuckers/madzone

repo_name: Penguinsuckers/madzone


text:
# Python Reference Web Application Template (for Bottle)

This is my reference application for building a Python web application based on the Bottle micro-framework.

## Features that this template will provide out of the box

1.  JSON File configuration
    Storage of static configuration in "app_config.json"

2.  Logging

3.  Skeleton CSS

4.  Jinja2 Templating

repository: ongzhixian/python-bottle-template

repo_name: ongzhixian/python-bottle-template


text:
# spring-metrics-aspects
Standardized Annotations and Aspects to add AOP metrics point cuts to services methods supporting metrics platform in spring boot

## Leveraging StatsD
This project includes the java-statsd-client to communicate with a standard StatsD server.

To incorporate the statsDClient and all the aspects import MetricsConfig.class in your main project configuration.

	@Import("MetricsConfig")

To configure the statsD host and metrics prefix information set the following properties:

	statsd.prefix=<your prefix>
	statsd.host=<statsD host name>

The statsD client will use the standard UDP port of 8125 by default. There is no method at this point to override that.

## Exporting Spring System Metrics to StatsD
By importing MetricsConfig you are also configuring the MetricsExportScheduler bean. This bean will fire every 30 seconds and retrieve all the System level metrics exposed by Spring Boot. These metrics will be sent as Gauges to StatsD using the prefix configured above.

## Using StatsD aspects
### Counters
To add a counter for a method using the @SuccessCounter or @FailureCounter annotation with the appropriate StatsD metric name as the value. The annotations both increment the value at this point. They are named this was to distinguish them from the Spring Boot Actuator Counter annotation.

Metric naming is key, a good guide can be found in Matt Aimonetti's well known blog post.

###Timer
To add a method timer using Spring AOP Around advice use the @MetricTimer annotation with the metric name as the value.

###Example

    @SuccessCounter("myservice.myendpoint")
    @MetricTimer("myservice.myendpoint")
    public MyObject getMyObject(.....);

##Capturing Docker Container ID
Docker Container runtime environments include the truncated ContainerID as a HOSTNAME environmental variable. This project leverages the Spring Environment to determine if the process environment variables exposes a HOSTNAME variable. If so it will be captured and added to the end of the StatsD prefix.

For example if the ContainerID is 5825f8bd516f the metric prefix based on the configuration above would be
your.prefix.5825f8bd516f.myservice.myendpoint .

This will allow for the use of * wildcard in graphite/grafana queries

stats.counters.your.prefix.*.myservice.myendpoint

and the display of metrics PER CONTAINER and allow for you use the aggregation/sum functions as well to get an overall view of the container environment.

repository: alexeytokar/spring-metrics-aspects

branch_name: refs/heads/develop

repo_name: alexeytokar/spring-metrics-aspects


text:
# Interfaces

An interface defines a set of operations (called _methods_). that can be used on a specific type.

```
enum Food {
	TASTY,
	NOT_SO_TASTY
}

interface Animal {
	def eat(food: Food) -> void
	def survive() -> void
	def die() -> void
}
```

Interfaces that have been defined can be used as types in functions or variable declarations.

Interfaces can extend other interfaces. For example, a Dog interface could extend Animal:

```
interface Dog : Animal {
	def bark() -> void
}
```

Then a type that implements `Dog` can do anything an animal can do, plus bark. An interface can extend as many interfaces as it wants.

## Builtin Interfaces

Orange defines builtin operations via a set of builtin interfaces. For example, these are some (but not all) of the builtin interfaces:

```
interface<T> Number {
	static def operator+(lhs: T, rhs: T) -> T
	static def operator-(lhs: T, rhs: T) -> T
	static def operator*(lhs: T, rhs: T) -> T
	static def operator/(lhs: T, rhs: T) -> T

	def operator+=(lhs: T&, rhs: T) -> T&
	def operator-=(lhs: T&, rhs: T) -> T&
	def operator*=(lhs: T&, rhs: T) -> T&
	def operator/=(lhs: T&, rhs: T) -> T&
}

interface<T> Ordered {
	static def operator<(lhs: T: rhs: T) -> bool
	static def operator>(lhs: T: rhs: T) -> bool
	static def operator<=(lhs: T: rhs: T) -> bool
	static def operator>=(lhs: T: rhs: T) -> bool
}

interface<T> Comparable {
	static def operator==(lhs: T, rhs: T) -> bool
	static def operator!=(lhs: T, rhs: T) -> bool
}
```

When we get to [Generic Types](generic_types.md) the `<T>` will become clear, and we will explain the `&` type in [Pointers and References](pointers_and_references.md).

## Automatically Generated Methods

Sometimes declaring a new construct creates an interface that's automatically generated. Every possible function type has a signature that looks like this:

```
extend ((args) -> retType) {
	def operator()(/* arguments */) -> retType

	def apply(argList)
}
```

Note the use of `extend`, which we'll talk about later.

For example, a function with the type signature `(int, int) -> int` automatically implements this interface:

```
extend ((int, int) -> int) {
	def operator()(argA: int, argB: int) -> int

	def apply() -> ((int, int) -> int)
	def apply(argA: int) -> ((int) -> int)
	def apply(argA: int, argB: int) -> (() -> int)
}
```

The `apply` method allows us to create a new functions with some arguments pre-applied. It allows for things like this:

```
def add(a: int, b: int): a + b

var add5 = add.apply(5)
add5(52) == 57
```

repository: orange-lang/orange-docs

repo_name: orange-lang/orange-docs


text:
---
layout: default
title:  "Load Testing"
excerpt: "Learn how to use the BELLATRIX API library to load test your API methods."
date:   2021-06-23 06:50:17 +0200
parent: api-automation
permalink: /api-automation/load-testing/
anchors:
  example: Example
  explanations: Explanations
  configuration: Configuration
---
Example
-------
```csharp
[TestFixture]
public class ApiLoadTests : APITest
{
    private ApiClientService _apiClientService;

    public override void TestInit()
    {
        FixtureFactory.Create();
        _apiClientService = App.GetApiClientService();
    }

    [Test]
    public void LoadTest_ExecuteForTime()
    {
        var request = new RestRequest("api/Albums");

        App.LoadTestService.ExecuteForTime(
            numberOfProcesses: 10,
            pauseBetweenStartSeconds: 1,
            secondsToBeExecuted: 30,
            testBody: () =>
        {
            var response = _apiClientService.Get(request);

            response.AssertSuccessStatusCode();
            response.AssertExecutionTimeUnder(1);
        });
    }

    [Test]
    public void LoadTest_ExecuteNumberOfTimes()
    {
        var request = new RestRequest("api/Albums");

        App.LoadTestService.ExecuteNumberOfTimes(5, 1, 5, () =>
        {
            var response = _apiClientService.Get(request);

            response.AssertSuccessStatusCode();
            response.AssertExecutionTimeUnder(1);
        });
    }
}
```

Explanations
------------
BELLATRIX offers a module for making load tests.
```csharp
App.LoadTestService.ExecuteForTime(
    numberOfProcesses: 10,
    pauseBetweenStartSeconds: 1,
    secondsToBeExecuted: 30,
    testBody: () =>
{
    var response = _apiClientService.Get(request);

    response.AssertSuccessStatusCode();
    response.AssertExecutionTimeUnder(1);
});
```
The first type of load tests is time-based. 10 parallel processes will run for 30 seconds, and the engine makes a pause of 1 sec between requests. As an anonymous method or existing method you can specify the code to be executed in each thread.
```csharp
App.LoadTestService.ExecuteNumberOfTimes(5, 1, 5, () =>
{
    var response = _apiClientService.Get(request);

    response.AssertSuccessStatusCode();
    response.AssertExecutionTimeUnder(1);
});
```
The second type of load tests is number-of-times-based. Your code executes the specified number of times between the specified number of processes.


text:
# HiFiMAN HE560 2014
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

### Parametric EQs
In case of using parametric equalizer, apply preamp of **-4.2dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-4.3dB**.

| Type    | Fc      |    Q | Gain    |
|:--------|:--------|:-----|:--------|
| Peaking | 38 Hz   | 0.7  | 3.3 dB  |
| Peaking | 1952 Hz | 3.11 | 3.4 dB  |
| Peaking | 2448 Hz | 4.09 | 1.5 dB  |
| Peaking | 4329 Hz | 4.59 | -4.2 dB |
| Peaking | 8749 Hz | 5.86 | -3.4 dB |
| Peaking | 441 Hz  | 1.22 | -2.3 dB |
| Peaking | 575 Hz  | 2.84 | 3.8 dB  |
| Peaking | 3396 Hz | 6.06 | -0.9 dB |
| Peaking | 5473 Hz | 8.39 | 2.6 dB  |
| Peaking | 6511 Hz | 8.04 | -1.7 dB |

### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-4.0dB**
(if available) and set gains manually with these parameters.

| Type    | Fc       |    Q | Gain    |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz    | 1.41 | 3.0 dB  |
| Peaking | 62 Hz    | 1.41 | 2.3 dB  |
| Peaking | 125 Hz   | 1.41 | 0.2 dB  |
| Peaking | 250 Hz   | 1.41 | -1.3 dB |
| Peaking | 500 Hz   | 1.41 | 0.6 dB  |
| Peaking | 1000 Hz  | 1.41 | -0.4 dB |
| Peaking | 2000 Hz  | 1.41 | 3.6 dB  |
| Peaking | 4000 Hz  | 1.41 | -2.4 dB |
| Peaking | 8000 Hz  | 1.41 | -1.0 dB |
| Peaking | 16000 Hz | 1.41 | 0.2 dB  |

### Graphs
![](https://raw.githubusercontent.com/jaakkopasanen/AutoEq/master/results/innerfidelity/sbaf-serious/HiFiMAN%20HE560%202014/HiFiMAN%20HE560%202014.png)


text:
# tensorflow-classifier-mqtt

![PEP8](https://github.com/rsaikali/tensorflow-classifier-mqtt/workflows/PEP8/badge.svg)

## Personal note

First of all I'm pretty new to this Tensorflow and machine learning concepts, so my Keras settings, model and layers will maybe look horrible to experts.

It will obviously need optimizations and changes, but it works as it is for my use case so I decided to share it with you here. Don't hesitate to open comments and issues on how to improve things.

## Inspirations and sources

- https://www.tensorflow.org/tutorials/keras/classification
- https://github.com/dracoboros/Cats-Or-Dogs/blob/master/src/CatsOrDogs.ipynb

## Presentation

`tensorflow-classifier-mqtt` is a set of Python script to classify a webcam capture into labels with Tensorflow and publish results to a MQTT (message queue) broker.

Training part will use Tensorflow 2, but classifying part will only use Tensorflow lite (lightweight Tensorflow interpreter, to be embedded in a RaspberryPi).

In my personal use case, it classifies a webcam view of my garage door, to predict if the door is `opened` or `closed`.

## How to use it?

### Preparing your datasets

Tensorflow will need datasets to learn labels.

Organized into 'labeled' directories (`closed`/`opened` in my case) the `dataset` directory will need to contain all your training images, and need to be organized as the following:

```sh
dataset/
├── train
│   ├── closed
│   │   ├── closed.1.jpg
│   │   ├── closed.2.jpg
│   │   ├── closed.3.jpg
│   │   └── ...
│   └── opened
│       ├── opened.1.jpg
│       ├── opened.2.jpg
│       ├── opened.3.jpg
│       └── ...
└── validation
    ├── closed
    │   ├── closed.val.1.jpg
    │   ├── closed.val.2.jpg
    │   ├── closed.val.3.jpg
    │   └── ...
    └── opened
        ├── opened.val.1.jpg
        ├── opened.val.2.jpg
        ├── opened.val.3.jpg
        └── ...
```

### Train the model

First install requirements, only Tensorflow2 is needed here:

```sh
pip install tensorflow
```

Then launch the training process:

```sh
python train.py

################################################################################
Training model...
Train for 500 steps
Epoch 1/5
500/500 [==============================] - 111s 223ms/step - loss: 0.8497 - sparse_categorical_accuracy: 0.9520
Epoch 2/5
500/500 [==============================] - 102s 205ms/step - loss: 0.0192 - sparse_categorical_accuracy: 0.9964
Epoch 3/5
357/500 [====================>.........] - ETA: 28s - loss: 0.4557 - sparse_categorical_accuracy: 0.9486
(...)
```

And finaly convert the Tensorflow model to a Tensorflow lite model:

```sh
tflite_convert --output_file=./model/model.tflite --saved_model_dir=./model
```

You should end up with `model.tflite` and `model.labels` files, those will be used in the classification step:

```sh
ls -lah model/

total 37032
drwxr-xr-x   7 rsaikali  staff   224B  2 mar 10:55 .
drwxr-xr-x  15 rsaikali  staff   480B  2 mar 11:04 ..
drwxr-xr-x   2 rsaikali  staff    64B  2 mar 10:55 assets
-rw-r--r--   1 rsaikali  staff    13B  2 mar 10:55 model.labels
-rw-r--r--   1 rsaikali  staff    18M  2 mar 10:55 model.tflite
-rw-r--r--   1 rsaikali  staff    73K  2 mar 10:55 saved_model.pb
drwxr-xr-x   4 rsaikali  staff   128B  2 mar 10:55 variables
```

### Classify images

First install requirements, Tensorflow lite for RaspberryPi will be used here, but you can find the correct version for your platform here: https://www.tensorflow.org/lite/guide/python

```sh
pip install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl
pip install opencv-python paho-mqtt
```

Then you'll need a few environment variables to setup and configure the observed webcam and the MQTT broker information:

```sh
export WEBCAM_URL=http://webcam.local:8080
export WEBCAM_CHECK_EVERY=1

export MQTT_SERVICE_HOST=mosquitto.local
export MQTT_SERVICE_PORT=1883
export MQTT_SERVICE_TOPIC=home/garage/door
```

So you can launch classification:

```sh
rsaikali$ python classify.py
2020-03-02 11:26:29,702 [tensorflow-classifier-mqtt-service]    DEBUG ################################################################################
2020-03-02 11:26:29,702 [tensorflow-classifier-mqtt-service]    DEBUG # WEBCAM_URL=http://webcam.local:8080
2020-03-02 11:26:29,702 [tensorflow-classifier-mqtt-service]    DEBUG # WEBCAM_CHECK_EVERY=1.0
2020-03-02 11:26:29,702 [tensorflow-classifier-mqtt-service]    DEBUG # MQTT_SERVICE_HOST=mosquitto.local
2020-03-02 11:26:29,702 [tensorflow-classifier-mqtt-service]    DEBUG # MQTT_SERVICE_PORT=1883
2020-03-02 11:26:29,703 [tensorflow-classifier-mqtt-service]    DEBUG # MQTT_SERVICE_TOPIC=home/garage/door
2020-03-02 11:26:29,703 [tensorflow-classifier-mqtt-service]    DEBUG # MQTT_CLIENT_ID=tensorflow-classifier-mqtt-service
2020-03-02 11:26:29,703 [tensorflow-classifier-mqtt-service]    DEBUG ################################################################################
2020-03-02 11:26:29,703 [tensorflow-classifier-mqtt-service]     INFO Found labels:  closed | opened
2020-03-02 11:26:29,703 [tensorflow-classifier-mqtt-service]     INFO Opening model: model/model.tflite
2020-03-02 11:26:29,728 [tensorflow-classifier-mqtt-service]     INFO Opening video: http://webcam.local:8080
2020-03-02 11:26:29,792 [tensorflow-classifier-mqtt-service]     INFO Entering main loop...
2020-03-02 11:26:29,801 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=closed] [score=100.0000%] [time=8.51ms] output=[1.0000000e+00 1.9425804e-14]
2020-03-02 11:26:30,814 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=closed] [score=100.0000%] [time=8.13ms] output=[1.0000000e+00 2.5105892e-14]
2020-03-02 11:26:31,825 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=closed] [score=100.0000%] [time=7.50ms] output=[1.0000000e+00 4.6465178e-14]
#
# ...opening garage door...
#
2020-03-02 11:28:14,126 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=opened] [score=99.9999%] [time=9.92ms] output=[9.5709743e-07 9.9999905e-01]
2020-03-02 11:28:15,137 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=opened] [score=100.0000%] [time=9.16ms] output=[6.0946927e-16 1.0000000e+00]
2020-03-02 11:28:16,151 [tensorflow-classifier-mqtt-service]     INFO [predicted_label=opened] [score=100.0000%] [time=7.98ms] output=[7.190952e-16 1.000000e+00]
```

Looks like `predicted_label` switched form `closed` to `opened`... as expected!

### Use as Docker container

#### Use Docker hub image

An image is available on Docker Hub: [rsaikali/tensorflow-classifier-mqtt](https://hub.docker.com/r/rsaikali/tensorflow-classifier-mqtt)

Needed environment is obviously the same as the standalone script mechanism, described in the Dockerfile:

```sh
docker run --name tensorflow-classifier-mqtt \
           --restart=always \
           --net=host \
           -tid \
           -e WEBCAM_URL=http://webcam.local:8080 \
           -e WEBCAM_CHECK_EVERY=1 \
           -e MQTT_SERVICE_HOST=mosquitto.local \
           -e MQTT_SERVICE_PORT=1883 \
           -e MQTT_SERVICE_TOPIC=home/garage/door \
           -e MQTT_CLIENT_ID=tensorflow-classifier-mqtt-service \
           rsaikali/tensorflow-classifier-mqtt
```

#### Build your own Docker image

To build an `linux/arm/v7` docker image from another architecture, you'll need a special (experimental) Docker multi-architecture build functionality detailled here: [Building Multi-Arch Images for Arm and x86 with Docker Desktop](https://www.docker.com/blog/multi-arch-images/)

You'll basically need to activate experimental features and use `buildx`.

```sh
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx create --use --name build --node build --driver-opt network=host
docker buildx build --platform linux/arm/v7 -t <your-repo>/tensorflow-classifier-mqtt --push .
```

**Note: build step will take a while to run as numpy is really long to install.**

Docker image will embed the Tensorflow lite model and labels files.

repository: rsaikali/tensorflow-classifier-mqtt

repo_name: rsaikali/tensorflow-classifier-mqtt


text:
---
description: How we set up a SpringType project in no time.
---

# B. Starting a new project

We're programmers and that means, we want our work to not be repetitive :-\)

So, let's lay back and let the SpringType scaffolding tool [**`st-create`**](https://github.com/springtype-org/st-create)set up a project for you:

`$ st-run st-create`

{% hint style="success" %}
**You don't know** [**`st-run`**](https://github.com/springtype-org/st-run) **yet?** It's a chaining, fast `npx` alternative and сross-platform command executor 🚀.

If you face something like `st-run: Command not found`, make sure to run: `yarn global add st-run`
{% endhint %}

{% hint style="warning" %}
**Not working?**

You're probably missing `yarn` on your system. [Just install yarn and try again.](https://classic.yarnpkg.com/en/docs/install/)
{% endhint %}

{% hint style="danger" %}
**Still not working?**

Most probably, you're missing Node.js and `npm` on your system. [Just install Node.js and try again.](https://nodejs.org/en/)
{% endhint %}

If everything goes well, you should see this beautiful screen:

![Using st-create to generate a new project](../.gitbook/assets/st-create%20%281%29.png)

Let's start with choosing `project` with the  `guide` template. You can chose an arbitrary name for this project. It's just to learn about SpringType.

When the scaffolding finishes, the SpringType build system `st-start` will start on: `http://localhost:4444` assuming that the environment is `development`. You can always restart the DevServer by running `yarn start`.

Open a browser and point it to [`http://localhost:4444`](http://localhost:4444).
You should see the SpringType guide showing up.

{% hint style="info" %}
**HMR \(Hot Module Replacement\)** makes sure that each time you change source files or assets, the website will be reloaded.
{% endhint %}

{% hint style="warning" %}
**Oh, snap!** The directory matters. When `st-create` generates a project for you and you exit from yarn start \(`st-start`\), you'll return to the parent directory of your project. Make sure to run yarn start in the project directory, where you'll find the file`package.json`.
{% endhint %}

### Production builds

To create an optimized production build, just run:

```text
yarn start:prod
```

You'll find the production build files: `./dist`.

{% hint style="info" %}
Only with production builds you'll see **Code Split** working the way it's designed.
{% endhint %}

### Advanced build system configuration

There is much more to learn about the SpringType build system. In fact, we've made sure that every nifty detail of the build, environment configuration and additional tasks that might be required to run in your project, are configurable.

To set custom build config settings, create a file called `st.config.ts` in the root directory. For the guide project, it will already be there. This file and its contents will be further discussed in the last section of [Anatomy of a project](c.-anatomy-of-a-project.md).

{% hint style="success" %}
**Still wondering about a thing?** Get in touch with us! [![](../.gitbook/assets/gitter.svg)](https://gitter.im/springtype-official/springtype?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)[💬](https://emojipedia.org/speech-balloon/)[🤓](https://emojipedia.org/nerd-face/)
{% endhint %}

{% hint style="danger" %}
**Found a bug or misleading information?** [Please report an issue.](https://github.com/springtype-org/springtype/issues)
{% endhint %}

repository: springtype-org/gitbook-guide

repo_name: springtype-org/gitbook-guide


text:
# prettify-markdown [![NPM version](https://badge.fury.io/js/prettify-markdown.svg)](http://badge.fury.io/js/prettify-markdown)

> Prettify, format or beautify your markdown. Whatever you want to call it, this does that. Used on hundreds of projects by verb.

## Install with [npm](npmjs.org)

```bash
npm i prettify-markdown --save
```

Currently this does very basic, naive formatting focusing on headings and whitespace control.

This was just externalized from [verb], where this case was used on hundreds of projects to format API documentation. As basic as it is, this has gotten the job done pretty consistently.

## Usage

```js
var prettify = require('prettify-markdown');

// pass a string of markdown
var result = prettify(str);
```

## Related projects

* [markdown-toc](https://github.com/jonschlinkert/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable.
* [remarkable](https://github.com/jonschlinkert/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable)

## Running tests

Install dev dependencies:

```bash
npm i -d && npm test
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/prettify-markdown/issues)

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 26, 2015._

<!-- reflinks generated by verb-reflinks plugin -->

[assemble]: http://assemble.io
[template]: https://github.com/jonschlinkert/template
[verb]: https://github.com/assemble/verb

repository: jonschlinkert/prettify-markdown

repo_name: jonschlinkert/prettify-markdown


text:
## Generate API Client (Golang)

### Summary

This tutorial will explain how to generate an API client in golang using an API definition.

!!! info
    Prerequisite [**Environment Setup**](setup.md)

!!! tip
    - `${PWD}` works on Linux, MacOS, and Windows (via Powershell)
    - `%cd%` works on Windows (via cmd)
    - `$(cygpath -m -a "$(pwd)")` works on Windows (via Cygwin)

### Validate API Definition

```bash
docker run --rm -v ${PWD}:/local -w /local quay.io/goswagger/swagger validate task-tracker-api.yaml
```

### Generate Client

Update the GOPATH environment variable within the container by appending the base directory; e.g. `/tracker`.
Mount the project root directory to base directory `/tracker/src/<import path>` where the `<import path>`
is how you import a golang package.

```bash
docker run --rm \
    -e GOPATH='/go:/tracker' \
    -v ${PWD}:/tracker/src/github.com/myorg/go-trackerclient \
    -w /tracker/src/github.com/myorg/go-trackerclient \
    quay.io/goswagger/swagger generate client \
        -A TrackerApi \
        -f task-tracker-api.yaml
```

Output:
```
2017/10/06 01:55:25 building a plan for generation
2017/10/06 01:55:25 planning definitions
2017/10/06 01:55:25 planning operations
2017/10/06 01:55:25 grouping operations into packages
2017/10/06 01:55:25 planning meta data and facades
2017/10/06 01:55:25 rendering 1 templates for model User
2017/10/06 01:55:25 name field User
2017/10/06 01:55:25 package field models
2017/10/06 01:55:25 creating "user.go" in "models" as definition
2017/10/06 01:55:25 rendering 1 templates for model listTasksOKBody
2017/10/06 01:55:25 name field listTasksOKBody
2017/10/06 01:55:25 package field models
2017/10/06 01:55:25 creating "list_tasks_o_k_body.go" in "models" as definition
2017/10/06 01:55:25 rendering 1 templates for model Task
2017/10/06 01:55:25 name field Task
2017/10/06 01:55:25 package field models
2017/10/06 01:55:25 creating "task.go" in "models" as definition
2017/10/06 01:55:25 rendering 2 templates for operation
2017/10/06 01:55:25 name field createTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "create_task_parameters.go" in "client/operations" as parameters
2017/10/06 01:55:25 name field createTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "create_task_responses.go" in "client/operations" as responses
2017/10/06 01:55:25 rendering 2 templates for operation
2017/10/06 01:55:25 name field listTasks
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "list_tasks_parameters.go" in "client/operations" as parameters
2017/10/06 01:55:25 name field listTasks
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "list_tasks_responses.go" in "client/operations" as responses
2017/10/06 01:55:25 rendering 2 templates for operation
2017/10/06 01:55:25 name field updateTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "update_task_parameters.go" in "client/operations" as parameters
2017/10/06 01:55:25 name field updateTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "update_task_responses.go" in "client/operations" as responses
2017/10/06 01:55:25 rendering 2 templates for operation
2017/10/06 01:55:25 name field viewTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "view_task_parameters.go" in "client/operations" as parameters
2017/10/06 01:55:25 name field viewTask
2017/10/06 01:55:25 package field operations
2017/10/06 01:55:25 creating "view_task_responses.go" in "client/operations" as responses
2017/10/06 01:55:25 rendering 1 templates for operation group
2017/10/06 01:55:25 name field operations
2017/10/06 01:55:25 creating "operations_client.go" in "client/operations" as client
2017/10/06 01:55:25 rendering 1 templates for application Tracker
2017/10/06 01:55:25 name field Tracker
2017/10/06 01:55:25 package field client
2017/10/06 01:55:25 creating "tracker_client.go" in "client" as facade
Generation completed!

For this generation to compile you need to have some packages in your GOPATH:

  * github.com/go-openapi/runtime
  * golang.org/x/net/context
  * golang.org/x/net/context/ctxhttp

You can get these now with: go get -u -f ./...
```

Files:
```
./client
./client/operations
./client/operations/create_task_parameters.go
./client/operations/create_task_responses.go
./client/operations/list_tasks_parameters.go
./client/operations/list_tasks_responses.go
./client/operations/operations_client.go
./client/operations/update_task_parameters.go
./client/operations/update_task_responses.go
./client/operations/view_task_parameters.go
./client/operations/view_task_responses.go
./client/tracker_client.go
./models
./models/list_tasks_o_k_body.go
./models/task.go
./models/user.go
./task-tracker-api.yaml
```

repository: kenjones-cisco/building-openapis

repo_name: kenjones-cisco/building-openapis


text:
# Decentralized Membership Management

Block Hack Global 2020 Project

## Objectives

The project will try to implement decoupled system of independent sides, negotiating with each other via signals, saved to BCH blockchain. Such system does not have a central site and some URL when the software to be installed. Instead there will be many independent parts as:

* Media files (job descriptions, resumes, video, etc.) saved to IPFS
* Single Page Applications (HTML and JavaScript), deployed also to IPFS
* Signals - searching, offers, acceptance etc. saved to BCH blockchain. Used by the SPAs above to communicate with each other
* Non-fingable tokens (NFT) - used to indicate the agreement or membership - job hiring, offer acceptance etc.

For the time of the hackatron all parts implementations will be in the current repository,
but because parts should be independent, the plans are to have independent repositories for every part, so they can be used separately.

## Used libraries and services

* [bch-js](https://github.com/Permissionless-Software-Foundation/bch-js) - all BCH related operations
* [bch-js-ext](https://github.com/zh/bch-js-ext) - working with NFT
* [FullStack.cash](https://fullstack.cash/) - REST API to BCH blockchain
* [SLPDB](https://slpdb.fountainhead.cash/explorer) - SLP-related queries
* [BitDB](http://bitdb.bch.sx/explorer) - BCH blockchain queries

## Work progress

The first week of the work on the project was dedicated for developing and implementing "Negotiation protocol" (*NegoProt*) - BCH transactions with a specific format, accepted by all parts, used for communication

See more information about the protocol specification and usage see the [NegoProt repository](./negoprot/README.md).

I will try to apply for the all three of the SLP foundation bountes, so the  next steps are implementing some real world applications scenarios, based on the protocol above, related the the bounties goals:

- Economic Freedom Bounty - Disptibuted job searching/applying or VIP fan club membership
- Techological Freedom Bounty - encrypted messaging
- Collaborative Freedom Bounty - AAA meeting; lawful peaceful protest information/member gatering


text:
---
title: Partial Typescript Types
keywords: ["typescript"]
description: Creating partials of Typescript types
---

You can use [Partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) to make all the properties of a type optional.

```ts
interface Foo {
    bar: string;
}

type FooPartial = Partial<Foo>;

const foo: FooPartial = {};
```