text:
# Project governance

The tldr-pages project strives to have an **open**, **welcoming**,
and [**non-hierarchical**](https://en.wikipedia.org/wiki/Flat_organization)
governance structure.

To that end, this document describes the principles
that guide the self-management of the project.
By having them written down explicitly, and open to scrutiny,
the entire community can read, apply, improve and adapt them as needed,
with no central authority.

## I. Participation and community interactions

- **All contributions are welcome**,
  [no matter how small](https://github.com/kentcdodds/all-contributors).
  The tldr-pages project is a
  [do-ocracy](https://communitywiki.org/wiki/DoOcracy),
  so don't hesitate to get involved
  — we're happy to welcome you into the community!
  Please take a look at [CONTRIBUTING.md](CONTRIBUTING.md)
  to get started.

- **All discussions should be respectful and cordial**.
  Avoid making assumptions about the others' intentions,
  and make your own intentions clear.
  When in doubt, provide additional context, or ask for clarification.
  Remember, it's very hard to convey meaning on a purely written medium,
  especially between people from different cultures, technical backgrounds,
  English proficiency levels, etc.

- **All communications are public**.
  There are no permanent private channels
  where maintainers discuss "internal" matters.
  Occasional private chat or email messages may be exchanged,
  e.g. when setting up services that require passwords,
  but otherwise all communications that impact the project
  will either happen in issue and PR discussions,
  or in the [Gitter chat room](https://gitter.im/tldr-pages/tldr)
  (which is open to all, and publicly logged).

- **All decisions are made by community consensus**.
  This does not mean there has to be unanimity,
  nor that decisions result from vote counts.
  What it means is that
  every interested member of the community is welcome to voice their thoughts,
  and incompatible positions are ideally resolved with involved participants
  either agreeing with the final decision, or voluntarily
  [consenting](https://en.wikipedia.org/wiki/Sociocracy#Consent_vs._consensus)
  to it as "good enough for now, safe enough to try".

## II. Role transitions

The following guidelines aim to keep the project vibrant and responsive,
by ensuring a **smooth transition flow between community roles** —
from newcomer, to occasional contributor, to regular contributor, to maintainer.
This way, the project should be able to adapt dynamically and flexibly
to the natural variations in availability and interest of its contributors,
improving long-term resilience, reducing the risk of burnout, and avoiding
[single points of failure](https://en.wikipedia.org/wiki/Bus_factor).

To this end, rather than _assigning_ roles and tasks to people,
these guidelines aim to **recognize the work that people already do**.
Everyone is therefore encouraged to get involved
and contribute to the project in whatever way they prefer,
and we will strive to **get barriers out of the way** of these contributions.

To ensure that these role transitioning processes are
straightforward, transparent, predictable, and impartial,
the metrics used are objective, easy to check, and explicitly described below.
(That's not to say they're hard-set rules:
exceptions can always be considered, via open community discussion.)

- **Regular contributors should be added as collaborators in the repository.**
  Specifically: once a contributor has had _5 non-trivial pull requests merged_
  on a repository under the tldr-pages organization,
  they should be invited to become
  a **collaborator** in that repository.
  This means they will be able to push commits to that repository,
  as well as merge PRs, label and close issues, among other things.

- **Collaborators who perform maintenance tasks should be made org members.**
  (Maintenance work is understood as facilitating contributions by other people,
  which in this project consists primarily of reviewing and/or merging PRs.)
  Specifically: once a repository collaborator has _merged at least 10 PRs_
  and submitted at least _5 non-trivial reviews to PRs_
  (either the same or different ones)
  they should be invited to become a
  [**member**](https://github.com/orgs/tldr-pages/people)
  of the tldr-pages organization.
  This means they will be able to
  push commits to all of the organization's repositories,
  merge PRs, label and close issues, among other things.
  _Note_: All members of the tldr-pages organization
  must make their membership public.

- **Maintainers who have been helping out for a while should become org owners.**
  Specifically: members of the tldr-pages organization
  who remain _active for at least 6 months_
  should be invited to become an
  [**owner**](https://help.github.com/articles/permission-levels-for-an-organization/)
  of the tldr-pages organization.
  This means they will be able to add people to the organization,
  manage all the organization's repositories, configure integrations, etc.
  They should also be added to the list of current maintainers
  in the [MAINTAINERS.md](MAINTAINERS.md) file.

- **These roles are temporary, and that's OK.**
  People's interests and availability naturally change over time,
  so the project should regularly update the list of people in each role,
  in order to accurately reflect the active team managing the project
  (and to avoid conveying an undue sense of obligation
  on people whose priorities have shifted.)
  Specifically: If an organization member becomes _inactive for over 6 months_,
  their membership status should be equally deactivated
  and their name added to the list of former maintainers
  in the MAINTAINERS.md file.
  (They should nevertheless remain as collaborators
  in the repositories on which they have been active in the past.)
  Again, this is and merely a reflection
  of their actual involvement with the project,
  not a demotion or punishment.
  Indeed, if they return to active participation in the project,
  they should be added back to the organization, to reflect that fact.

repository: pgonzalezalv/tldr

repo_name: pgonzalezalv/tldr


text:
# NLP Homework2 Report

過程所使用不同的參數對準確率所帶來的影響

validation_split:
#### 第１次
原始参数：
epochs = 100, validation_split = 0.2, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.70226
#### 2
epochs = 100, validation_split = 0.2, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.72168
#### 3
epochs = 100, validation_split = 0.5, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.69902
#### 4
epochs = 100, validation_split = 0.35, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.71521
#### 5
epochs = 100, validation_split = 0.425, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.68284
#### 6
epochs = 100, validation_split = 0.275, batch_size = 10, verbose = 1
batch_size=10, verbose=0
**0.72491**
#### 7
epochs = 100, validation_split = 0.33, batch_size = 10, verbose = 1
batch_size=10, verbose=0
0.68284

## batch_size
#### 1
epochs = 100, validation_split = 0.275, batch_size = 5, verbose = 1
batch_size=5, verbose=0
0.73139

#### 2
epochs = 100, validation_split = 0.275, batch_size = 2, verbose = 1
batch_size=2, verbose=0
0.68932

#### 3
epochs = 100, validation_split = 0.275, batch_size = 4, verbose = 1
batch_size=4, verbose=0
0.68284

#### 4
epochs = 500, validation_split = 0.275, batch_size = 5, verbose = 1
batch_size=5, verbose=0
0.68932

#### 5
epochs = 500, validation_split = 0.2, batch_size = 2, verbose = 1
batch_size=2, verbose=0
0.68608

#### 6
epochs = 500, validation_split = 0.05, batch_size = 2, verbose = 1
batch_size=2, verbose=0
0.71844

#### 7
epochs = 500, validation_split = 0.05, batch_size = 2, verbose = 1
batch_size=2, verbose=0
if value[0] > 0.7:
0.72815

#### 8
epochs = 500, validation_split = 0.05, batch_size = 2, verbose = 1
batch_size=2, verbose=0
if value[0] > 0.4:
0.67637

#### 9
model.fit(x = train_result, y = train_label, epochs = 200, validation_split = 0.1, batch_size = 4, verbose = 1)
scores = model.evaluate(x = train_result, y = train_label, batch_size=2)
print(scores)
res = model.predict(test_feature, batch_size=1, verbose=0)
 0.72168

 model.fit(x = train_result, y = train_label, epochs = 200, validation_split = 0.275, batch_size = 5, verbose = 1)
 scores = model.evaluate(x = train_result, y = train_label, batch_size=5)
 print(scores)
 res = model.predict(test_feature, batch_size=5, verbose=0)
 'male': 50

## 第2次
epochs = 100, validation_split = 0.2, batch_size = 2, verbose = 1
batch_size=2, verbose=0
0.70550

## 3
epochs = 200, validation_split = 0.2, batch_size = 2, verbose = 1
batch_size=5, verbose=0
0.70550

epochs = 200, validation_split = 0.1, batch_size = 2, verbose = 1
batch_size=2, verbose=0
0.70550

license: MIT

repository: hutengdai/NLP-for-DP

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: hutengdai/NLP-for-DP


text:
# @remirror/preset-core

> The core preset providing the functionality you need and want.

[![Version][version]][npm] [![Weekly Downloads][downloads-badge]][npm] [![Bundled size][size-badge]][size] [![Typed Codebase][typescript]](#) [![MIT License][license]](#)

[version]: https://flat.badgen.net/npm/v/@remirror/preset-core
[npm]: https://npmjs.com/package/@remirror/preset-core
[license]: https://flat.badgen.net/badge/license/MIT/purple
[size]: https://bundlephobia.com/result?p=@remirror/preset-core
[size-badge]: https://flat.badgen.net/bundlephobia/minzip/@remirror/preset-core
[typescript]: https://flat.badgen.net/badge/icon/TypeScript?icon=typescript&label
[downloads-badge]: https://badgen.net/npm/dw/@remirror/preset-core/red?icon=npm

## Installation

```bash
yarn add @remirror/preset-core # yarn
pnpm add @remirror/preset-core # pnpm
npm install @remirror/preset-core # npm
```

This package is available via `remirror/presets` when you install `remirror`.

## Usage

When added to your editor it will provide the required nodes, marks to your editor.

```ts
import { corePreset, RemirrorManager } from 'remirror';

// Create the Editor Manager with the required preset.
const manager = RemirrorManager.create([...corePreset({ rootContent: 'block*' })]);
```

repository: remirror/remirror

branch_name: refs/heads/main

gha_language: TypeScript

gha_license_id: MIT

repo_name: remirror/remirror


text:
## Respeaker LED Controller

This repository demonstrates how to control Respeaker Pixel Ring via MQTT.

### Installation

```shell script
git clone https://github.com/sskorol/respeaker-led.git && cd respeaker-led
./dependencies.sh
pip3 install -r requirements.txt
```

### Configuration

Adjust **config.json** with missing MQTT settings:
```json
{
  "mqttAddress": "<IP_ADDRESS>",
  "mqttUser": "",
  "mqttPassword": ""
}
```

### Running

```shell script
python3 runner.py
```

Now you can test different LED options by sending MQTT commands to the following topics:

- **respeaker/led/wake**: activates Pixel Ring with provided DOA. You have to provide a direction as int value in a payload.
- **respeaker/led/sleep**: deactivates Pixel Ring.
- **respeaker/led/think**: activates "thinking" pattern.
- **respeaker/led/speak**: activates "speaking" pattern.
- **respeaker/led/listen**: activates "listening" pattern.

Use any MQTT client for testing:
```shell script
mosquitto_pub -h ip -u username -P password -t respeaker/led/wake -m 140
```

### Respeaker Integration

You can use this project with [respeaker-websockets](https://github.com/sskorol/respeaker-websockets) which is already configured to control LEDs when hotword is detected and transcribe is received.

repository: sskorol/respeaker-led

repo_name: sskorol/respeaker-led


text:
# Steady Logistics

A simple web application for freight brokerage :truck: made with educational purposes,
as my graduation project for the SoftUni ASP.NET Core Web Development course August 2021 :dart:

## © SteadyLogistics™ Logo
![](https://i.imgur.com/qsH3Lq1.jpg)

## :hammer_and_pick: **Built With**

- MS Visual Studio 2019
- MS SQL Server Management Studio 2017
- ASP.NET Core 5.0
- Entity Framework (EF) Core 5.0
- Microsoft SQL Server Express
- ASP.NET Identity System
- MVC Areas with Multiple Layouts
- Razor Pages, Sections, Partial Views
- Dependency Injection
- Sorting, Filtering, and Paging with EF Core
- Data Validation, both Client-side and Server-side
- In-Memory Cache
- Bootstrap Responsive Design
- HTML5
- CSS
- Google API
- Newtonsoft Json

## :gear: **Application Configurations**

### 1. The Connection string
is in `appsettings.json`. If you don't use SQLEXPRESS, you should replace `Server=.\\SQLEXPRESS;` with `Server=.;`

### 2. Seeding sample data
would happen once you run the application, including Test Account:
  - Admin<EMAIL_ADDRESS>/ password: admin123
  - 2 CargoSizes: "Full Load" and "Groupage"
  - 7 Trailer Types : "Box", "Flatbed", "Jumbo", "Mega", "Refrigerator", "Tank", "Tautliner" },
  - 46 Europe countries easily accessible by land for the needs of Road Transportation alongside their Alpha-2 code

## :floppy_disk: **Database Diagram**
![](https://imgur.com/799QcIq.jpg)

## **Backend**
The web project contains:
* 4 different areas: Identity, Admin, Manager, Member
* 4 Roles: Admin, Manager, Premium User, Regular Member
* 11 custom services with 60+ service methods
* 6 controllers
* 29+ views

## **Screenshots**
**SteadyLogistics - Login**
![SteadyLogistics - Login](https://imgur.com/O0aheqE.jpg)

**SteadyLogistics - Register**
![SteadyLogistics - Register](https://imgur.com/MBSyyjG.jpg)

**SteadyLogistics - Message Details**
![SteadyLogistics - Message Details](https://imgur.com/P6GeLTR.jpg)

**SteadyLogistics - News**
![SteadyLogistics - News](https://imgur.com/mO0tdYc.jpg)

**SteadyLogistics - Add an Article**
![SteadyLogistics - Add an Article](https://imgur.com/XtAuphu.jpg)

**SteadyLogistics - Contacts**
![SteadyLogistics - Contacts](https://imgur.com/ER6iIWD.jpg)

**SteadyLogistics - All Freights**
![SteadyLogistics - All Freights](https://imgur.com/8jiQ1l3.jpg)

**SteadyLogistics - Freight Detail**
![SteadyLogistics - Freight Details](https://imgur.com/qyiGnQI.jpg)

**SteadyLogistics - Add Freight**
![SteadyLogistics - Add Freight](https://imgur.com/2BanUGn.jpg)

**SteadyLogistics - User Details**
![SteadyLogistics - User Details](https://imgur.com/TLfoyVP.jpg)

## :v: **Show your opinion**

Give a :star: if you like this project

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

repository: StefanDeliivanov/SteadyLogistic

repo_name: StefanDeliivanov/SteadyLogistic


text:
# RegisteredRoute.getId field

```csharp
public readonly Func<object, string> getId;
```

## See Also

* class [RegisteredRoute](../RegisteredRoute.md)
* namespace [Butterfly.Core.Channel](../../Butterfly.Core.md)

<!-- DO NOT EDIT: generated by xmldocmd for Butterfly.Core.dll -->


text:
# Akamai G2O in LUA

Signature Header Authentication (aka G2O) is a mechanism that allows the backend infrastructure to ensure that requests are coming from a trusted source, the Akamai Platfom specifically.

This is extract from the documentation:

> This feature configures edge servers to include two special headers in requests to the origin server. One of these headers contains basic information about the specific request. The second header contains similar information encrypted with a shared secret. This allows the origin server to perform several levels of authentication to ensure that the request is coming directly from an edge server without tampering.

# Why LUA?

G2O validation can generally be implemented in two places:

* Web Application
* Web Server / Load Balancer like HAProxy or NGINX

Excellent example of the intergration within Web Application was done by @ynohat (<https://github.com/ynohat/akamai-g2o>).
I didn't find much implementations for Web Servers and Load Balancers, and all of the existing solution require to compile the code which can generate some maintenance overhead.
Some servers just do not support dynamic modules at all (i.e. HAProxy) which requires to patch and build from source. Definitely not making the life easier.

However, top open-source servers like HAProxy, NGINX, Apache and Varnish - do support LUA language.
LUA is a very popular lightweight embeddable scripting language, and what is great - single codebase can be used across multiple vendors.

# Components

Project consist of a single library responsible for G2O validation, and connectors for multiple vendors.
The library is pretty generic and has external dependency on *libossl* (<https://github.com/wahern/luaossl>).
The connectors are vendor specific and their responsibility is to ease the library integration.

# How to install

## Prerequisites

G2O validation requires **luaossl** library which can be installed with *luarocks*.
Please refer to your distribution documentation regarding installation steps.

### Ubuntu 18.04

```bash
apt install luarocks libssl-dev
luarocks install luaossl
```

### CentOS

Add `epel` repository and install lua packages:

```bash
yum install epel-release
yum install luarocks openssl-devel lua-devel gcc
luarocks install luaossl
```

## HAProxy

`akamai-g2o-haproxy-wrapper.lua` registers two functions:

* `g2o_validation_fetch` - which is referred from haproxy frontend section
* `g2o_failure_service` - which is used from haproxy backend when validation fails. It serves 400 response with "Unauthorized Access" response body

*Note: It is assumed that the configuration file and all G2O related files are stored in `/etc/haproxy` path.*

In `/etc/haproxy/haproxy.cfg` within global section add the following line:

```
    lua-load /etc/haproxy/akamai-g2o-haproxy-wrapper.lua
```

add g2o validation to your frontend settings:

```
frontend g2o-example
   bind             :80
   mode             http
   use_backend      %[lua.g2o_validation_fetch(5,"s3cr3tk3y",30,"g2o-failure-backend","g2o-success-backend")]
   default_backend  g2o-failure-backend
   log              <IP_ADDRESS> local1 debug
```

Parameters for `g2o_validation_fetch` are as follows:

* version of G2O
* secret key (same like in Akamai configuration file)
* time delta - acceptable time margin for timestamp validation
* failure backend - which backend to go when G2O validation failed
* success backend - which backend to go when G2O validation succeeds

Now let's define the backends:

```
backend g2o-success-backend
   balance  roundrobin
   server   web1 X.X.X.X:80
   log      <IP_ADDRESS> local1 debug

backend g2o-failure-backend
   http-request use-service lua.g2o_failure_service
   log          <IP_ADDRESS> local1 debug
```

It is possible to enable G2O validation is soft-mode, so requests with invalid G2O signature will not be rejected, however proper warning will be logged. This can be done by using the same backend for failure and success actions:

```
   use_backend      %[lua.g2o_validation_fetch(5,"s3cr3tk3y",30,"g2o-success-backend","g2o-success-backend")]
```

## NGINX

Download g2o wrapper and library to `/etc/nginx/lua` folder:

```bash
mkdir /etc/nginx/lua
wget -P /etc/nginx/lua https://raw.githubusercontent.com/lukaszczerpak/akamai-g2o-lua/master/akamai-g2o-nginx-wrapper.lua
wget -P /etc/nginx/lua https://raw.githubusercontent.com/lukaszczerpak/akamai-g2o-lua/master/akamai-g2o.lua
```

Enable lua module in `/etc/nginx/nginx.conf` first:

```
load_module modules/ngx_http_lua_module.so;
```

and initialize the connector in `server` section:

```
http {
    ...

    lua_package_path "/etc/nginx/lua/?.lua;;";
    init_by_lua_block { require "akamai-g2o-nginx-wrapper" }
}
```

G2O can be enabled for certain paths or entire site in the following way:

```
  location / {
     access_by_lua_block { akamai_g2o_validate_nginx(5, "s3cr3tk3y", 30) }
  }
```

Parameters for `akamai_g2o_validate_nginx()` are as follows:

* version of G2O
* secret key (same like in Akamai configuration file)
* time delta - acceptable time margin for timestamp validation

## Apache (CentOS)

Download g2o wrapper and library to `/etc/httpd/lua` folder:

```bash
mkdir /etc/httpd/lua
wget -P /etc/httpd/lua https://raw.githubusercontent.com/lukaszczerpak/akamai-g2o-lua/master/akamai-g2o-apache-wrapper.lua
wget -P /etc/httpd/lua https://raw.githubusercontent.com/lukaszczerpak/akamai-g2o-lua/master/akamai-g2o.lua
```

Ensure `mod_lua` is enabled in Apache (it is by default):

```
LoadModule lua_module modules/mod_lua.so
```

In the apache configuration, you need to declare the following:

- default location of lua scripts
- authz provider
- paths to be validated against g2o

Sample configuration snippet:

```
LuaRoot /etc/httpd/lua
LuaAuthzProvider akamai_g2o akamai-g2o-apache-wrapper.lua akamai_g2o_validate_apache
<Location "/">
  Require akamai_g2o 5 "s3cr3tk3y" 30
</Location>
```

# Contribution

If your server is not listed and supports LUA then you are more than welcome to contribute and implement the connector :)

# Testing

The G2O validation has unit tests which can be run with the following command (<https://olivinelabs.com/busted/>):

```sh
❯❯❯ busted akamai-g2o_spec.lua
●●●●●●●●●
9 successes / 0 failures / 0 errors / 0 pending : 0.057342 seconds
```


text:
## Methods ## {#methods}

### Pointers vs. Values ### {#pointers_vs_values}

As we saw with `ByteSize`, methods can be defined for any named type (except a pointer or an interface); the receiver does not have to be a struct.

In the discussion of slices above, we wrote an `Append` function. We can define it as a method on slices instead. To do this, we first declare a named type to which we can bind the method, and then make the receiver for the method a value of that type.

``` go
type ByteSlice []byte

func (slice ByteSlice) Append(data []byte) []byte {
    // Body exactly the same as the Append function defined above.
}
```

This still requires the method to return the updated slice. We can eliminate that clumsiness by redefining the method to take a _pointer_ to a `ByteSlice` as its receiver, so the method can overwrite the caller's slice.

``` go
func (p *ByteSlice) Append(data []byte) {
    slice := *p
    // Body as above, without the return.
    *p = slice
}
```

In fact, we can do even better. If we modify our function so it looks like a standard `Write` method, like this,

``` go
func (p *ByteSlice) Write(data []byte) (n int, err error) {
    slice := *p
    // Again as above.
    *p = slice
    return len(data), nil
}
```

then the type `*ByteSlice` satisfies the standard interface `io.Writer`, which is handy. For instance, we can print into one.

``` go
var b ByteSlice
fmt.Fprintf(&b, "This hour has %d days\n", 7)
```

We pass the address of a `ByteSlice` because only `*ByteSlice` satisfies `io.Writer`. The rule about pointers vs. values for receivers is that value methods can be invoked on pointers and values, but pointer methods can only be invoked on pointers.

This rule arises because pointer methods can modify the receiver; invoking them on a value would cause the method to receive a copy of the value, so any modifications would be discarded. The language therefore disallows this mistake. There is a handy exception, though. When the value is addressable, the language takes care of the common case of invoking a pointer method on a value by inserting the address operator automatically. In our example, the variable `b` is addressable, so we can call its `Write` method with just `b.Write`. The compiler will rewrite that to `(&b).Write` for us.

By the way, the idea of using `Write` on a slice of bytes is central to the implementation of `bytes.Buffer`.

gha_language: Go


text:
---
title: 'How to enable transliteration?'
date: 2017-05-01T22:12:03.284Z
category: 'FAQ'
tags:
  - how to
  - enable
  - transliteration

path: '/how-to-enable-transliteration/'
shortDescription: 'At any moment, you can enable transliteration using WordPress or JS'
---

At any moment, you can enable transliteration using WordPress or JS.

## How to enable transliteration using WordPress

To enable transliteration just follow this few steps:

1.  After scroll down to the 'Language(Google Transliterate)' settings and click on languages drop-down list to choose a needed language

   ![enable transliteration with wp 02](/img/how-to-enable-transliteration-img-2.png)

3. Scroll to the bottom of the page and click on the Save Settings

   ![enable transliteration with wp 03](/img/how-to-enable-transliteration-img-3.png)

   There are two ways how it would be working on article pages: The chosen language may be by default and by switching from English to chosen language.

   For using needed language by default just make sure that the 'Default Language' setting set to Yes.

   ![enable transliteration with wp 04](/img/how-to-enable-transliteration-img-4.png)

   And in the case to use English with the possibility to switch to the needed language chose No for 'Default Language' setting.

   ![enable transliteration with wp 05](/img/how-to-enable-transliteration-img-5.png)

   When all settings set right scroll to the bottom and click on Save Settings.

## How to enable transliteration using JS

To enable transliteration using JS please paste following code to the Vuukle config:

```html
comments: { transliteration:{ language: "en", enabledByDefault: true, },
```

Languages abbreviation list:

English - en;

Amharic - am;

Arabic - ar;

Bengali - bn;

Chinese - zh;

Creek - el;

Gujarati - gu;

Hindi - hi;

Kannada - kn;

Malayalam - ml;

Marathi - mr;

Nepali - ne;

Oriya - or;

Persian - fa;

Punjabi - pa;

Russian - ru;

Sanskrit - sa;

Sinhalese - si;

Serbian - sr;

Tamil - ta;

Telugu - te;

Tigrinya - ti;

Urdu - ur.

![enable transliteration with js 06](/img/how-to-enable-transliteration-img-6.png)

repository: homearanya/testing-site

gha_language: JavaScript

repo_name: homearanya/testing-site


text:
# Observing Eve's CPU and Memory Consumption via Telegraf in QEMU

In this tutorial we go through the step-by-step process of observing
an EVE device's CPU and Memory consumption in our previously generated
__QEMU Image on our Host__

## Prerequisites

Before going into this tutorial make sure to go through
`00-Eve-Eden-Local-QEMU` post. We need to have the same setup as mentioned
in the post. In this post, we try to replace the `nginx` pod deployed as
an example with something that can provide some form of usage observability
of our EVE device, albiet in an emulated environment.

## System Architecture Design

We will use [InfluxData's InfluxDB v2](https://docs.influxdata.com/influxdb/v2.0/)
as a Time-Series Database (TSDB) to store metrics from our emulated EVE device.

Since we are in an emulated state at the moment and haven't deployed any
EVE devices (e.g. Raspberry Pis) in our network, we will consider our
host machine as a system where:

1. Our TSDB runs and accepts information from EVE devices in the network
2. Provides a User Interface to observe the metrics

We will deploy
[InfluxData's Telegraf Monitoring Agent](https://docs.influxdata.com/telegraf/v1.19/)
as a pod on our emulated EVE device and set some configuration that will
provide us CPU usage metrics as well as memory consumption metrics.

These metrics are sent back to our TSDB where a user can observe them on a
Dashboard and query these metrics for further analyses.

## Deployment

> __NOTE__: We will not be doing a complete secure (TLS/SSL) setup here

### InfluxDB v2.0

1. Since we already have `docker` on our host machine, let us setup the TSDB on it.

    ```bash
        $ docker run --name=influxdbV2 -p 8086:8086 influxdb:2.0.7
    ```

    This should be able to run InfluxDB v2.0.7 on the host machine and the port `8086`
    should be available for the TSDB to ingest any incoming metrics sent to it.

2. Open a browser and visit http://localhost:8086 which will provide you the UI for
    InfluxDB v2. Click on __Get Started__

3. Let's setup our InfluxDB v2 with the following information:

    _Username_: `eden`
    _Password_: `influxdb`
    _Organization_: `LF-EDGE`
    _Bucket Name_: `eve`

    ![InfluxDB v2 Initial Configuration UI](./assets/01-QEMU-InfluxDBV2-setup.png)
    Click __Continue__

4. Click on __Configure Later__ for the next step.
    We have now configured our InfluxDB v2 with a user `eden` under the Organization
   `LF-EDGE` and a _bucket_ called `eve` to store any metrics dedicated for it.

### Telegraf

`telegraf` requires a configuration file in TOML to be able to acquire and push
information to our TSDB. It provides a wide range of plugins but for this tutorial
we will focus on the easiest ones.

The `eden/data/telegraf/telegraf.conf` file for our case looks like the following:

```toml
[agent]
    interval = "2s"
    round_interval = true
    metric_batch_size = 1000
    metric_buffer_limit = 10000
    collection_jitter = "0s"
    flush_interval = "10s"
    flush_jitter = "0s"
    precision = ""
    debug = true
    quiet = false
    hostname = "EVE-QEMU-1" # change according to your needs
    omit_hostname = false

### INPUT PLUGINS ###
[[inputs.cpu]]

[[inputs.mem]]

### OUTPUT PLUGINS ###

[[outputs.influxdb_v2]]

  # REMEMBER TO CHANGE INPUTS HERE BEFORE DEPLOYMENT

  urls = ["http://YOUR_IP_ADDRESS:8086"]

  token = "YOUR_INFLUXDBV2_GENERATED_TOKEN_HERE"

  organization = "LF-EDGE"
  bucket = "eve"
```

Adapt the Configuration file where the `urls` should point to the host's IP Address.

For an InfluxDB v2 Token we do the following:

1. Head to __Data__ in our InfluxDB UI on the left-side column

2. We click on the __Tokens__ Header in the UI where you will see the following:

    ![Generated Token for user eden in InfluxDBV2 UI](./assets/01-QEMU-InfluxDBV2-generated-token.png)

3. Click on `eden's Token` and copy the token into the configuration file for the
   output plugin

We are done with `telegraf` configuration! we will let `eden` download `telegraf`'s
docker image from Docker Hub for us.

### Eden Setup

In our `eden` repository's root directory:

1. Source our environment variables for `eden`

    ```bash
    $ source ~/.eden/activate.sh
    ```

2. Start `eden`

    ```bash
    $ ./eden start
    ```

3. Let's check if our EVE device is connected to `eden` using:

    ```bash
    $ ./eden status
    ```

This should be able to provide all the necessary status checks between `eden` and `eve`

### Application Deployment

Like we previously deployed our `nginx` pod we will deploy our `telegraf` pod using:

```bash
$ ./eden pod deploy --name=eve_telegraf docker://telegraf --mount=src=./data/telegraf,dst=/etc/telegraf/
```

This should be able to start downloading the telegraf pod and begin with the deployment process:

```
INFO[0003] deploy pod eve_telegraf with docker://telegraf request sent
```

You check that status of your pods using

```bash
$ ./eden pod ps
NAME		IMAGE			UUID					INTERNAL	EXTERNALMEMORY	STATE(ADAM)	LAST_STATE(EVE)
eve_telegraf	library/telegraf:latest	af903ac5-c464-470d-adfc-1ee75b467d03	-		-	0 B/0 B	IN_CONFIG	DOWNLOAD_STARTED (19%)
```

After a few minutes the Status should `RUNNING`

```bash
$ ./eden pod ps
NAME		IMAGE			UUID					INTERNAL	EXTERNAL	MEMORY		STATE(ADAM)	LAST_STATE(EVE)
eve_telegraf	library/telegraf:latest	af903ac5-c464-470d-adfc-1ee75b467d03	<IP_ADDRESS>	-		0 B/1.6 GB	IN_CONFIG	RUNNING
```

### Debugging and Logs

To check the logs of running pod, here `eve_telegraf` we can do the following:

```bash
$ ./eden pod logs eve_telegraf
```

If you need the logs in a different format use:

```bash
$ ./eden pod logs eve_telegraf --format=json
```

This should be able to provide you a detailed log of deployed pod's behavior

## Dashboard

Head to the InfluxDB UI and click on __Explore__ on the left-side column where you will be able to
see `eve` bucket

Click on the `eve` bucket and select the measurements accordingly.

### Outputs

CPU Utilization of the emulated EVE device

![InfluxDB UI Data Exploration for CPU Usage](./assets/01-QEMU-CPU-Dashboard.png)

Memory Usage of the emulated EVE device

![InfluxDB UI Data Exploration for Memory Usage](./assets/01-QEMU-Memory-Dashboard.png)

## Clean Up

1. You can stop the pod using the name of the pod

    ```bash
    $ ./eden pod stop eve_telegraf
    ```

2. You can delete the pod after stopping it as follows:

    ```bash
    $ ./eden pod delete eve_telegraf
    ```

3. Stop `eden` using:

    ```bash
    $ ./eden stop
    ```

repository: msardara/EVE-OS-tutorials

repo_name: msardara/EVE-OS-tutorials


text:
YANG model for Optical Impairment aware Topology weekly call (November 16,2021)

****Attendees****
- [x] Dieter Beller
- [x] Aihua Guo
- [] Esther Lerouzic
- [X] Julien Meuric
- [x] Italo Busi
- [] Gert Grammel
- [x] Gabriele Galimberti
- [] Yuji Tochio
- []Enrico Griseri
- [x] Sergio Belotti
- [] Victor Lopez
- [] Haomian Zheng
- [] Igor Bryskin
- [] Brent Foster
- [] Jiang Sun (CMCC)

## Discussion

### Yang bug fixing PR#96 https://github.com/ietf-ccamp-wg/draft-ietf-ccamp-optical-impairment-topology-yang/pull/96

Fixing few bugs in YANG:

* use of deref(): fix deref() YANG syntax usage as XPATH function #84 --> we can consider closed the issue since both reading RFC 7950 and looking at example
of the usage of deref() in other modules it seems clear that deref() cannot be used in xpath but just in comparison like must or when.

* otsi-ref within an MCG should a leaf-list
* description of incoming-otsi

* the llc-transceiver list moved under TTP LLC entry from default TTP LLC

### issue #92 https://github.com/ietf-ccamp-wg/draft-ietf-ccamp-optical-impairment-topology-yang/issues/92

Aihua: the relationship between a TE topology entity and the device model can be defined in a separate model.
Dieter: we do not have device model. You may not have device model also in the future.
Aihua: from this model prospective there is no need to put that as mandatory
Julien: I agree that the attribute shall be mandatory but not necessarily for having a glue with the device model.
Julien: I can leave with keeping it optional

Most people believe it could be left as optional.

Park the issue waiting for Esther before closing it.

### issue #88 https://github.com/ietf-ccamp-wg/draft-ietf-ccamp-optical-impairment-topology-yang/issues/88

Italo: OTSiG is just management construct is providing nothing about optical impairments.

Aihua: OTSiG is the result of the connection setup.
When you have setup a tunnel you need to configure at the endpoint the same OTSiG, and so you would need the information about OTSiG.
Italo: this is configuration aspect that has nothing to do with path computation.

Italo: Knowing which OTSiGs are in the network does not influence the setup of a new OTSiG (you need to know the OTSis as previosly discussed).
Do you need to know that some OTSi belonging to the same OTSiG?

Gabriele:The OTSiG does not have any optical impairment parameter but it is only an OTSi groomimg. So OTSiG size will be function of number and kind of OTSi it contains.
For optical feasibility calculation is then fundamental to know the OTSi type.

Julien: identification purpose. Global unique identifier for OTSiG as prefix to OTSi identification.
Dieter: OTSiG identifier can be used as prefix while OTSi id could be an index related to that
Italo: There are two options for global unique identification of an OTSi:
-have a flat list of OTSis, with a structure OTSi identifier,
which includes the OTSiG global unique identifier and the OTSi local identifier (within the group), or
-have the list of OTSiG (with OTSiG global unique identifier, which is also structured) and a list of OTSi with the local identifier (uint16).

The latter option is the current model. From a functional perspective the two options are equivalent.

Dieter: will try to put some text to clarify the point.
Dieter is volunteer to make a proposal for the text

### layer0-types-ext

We discussed the outcomes from CCAMP session of IETF-112 regarding the relatioship of this draft with RFC9093. The alternatives proposed during the meeting were:
* publish the draft as a new RFC making RFC9093 obsolete that means to replace the obsolete RFC and the new draft can be used alone.
* publish that as an update and in this case should reference to the old one

Italo: the difference is that in case you obsolete the original one it is needed to put the former text inside. Instead for update you need anyway to put all the model (old and the update)but no all the text.

Discussion on how to proceed is just started and is adjurned to the next meeting.

## next meeting: November 23

gha_language: Python


text:
### RayTracing implemented with OpenCL-OpenGL interop

Early implementation of realtime GPU raytracing. See the newer project [raytracing-opengl](https://github.com/engilas/raytracing-opengl)

#### Render scenario:

- OpenCL memory object is created from the OpenGL texture.
- For every frame, the OpenCL memory object is acquired, then updated with an OpenCL kernel, and finally released to provide the updated texture data back to OpenGL.
- For every frame, OpenGL renders textured Screen-Quad to display the results

Scene setup in rt.cpp file, create_scene function.

#### Controls:
Rotate camera with mouse

Movement:
- WASD
- Space - up
- Ctrl - down
- Shift (hold) - boost

#### Requirements

* CMake (>= 3.0.2)
* OpenCL Libraries (should be located by CMake automatically if they are installed using package
  managers)
* GLFW, Both should be automatically found by CMake.

repository: engilas/raytracing-openCL

repo_name: engilas/raytracing-openCL


text:
# Intended Use
Use for local, non-secured Jupyter Lab work.

# Why use this?
This container-based project avoids the cumbersome setup of python, virtual environment, dependencies.
It has a clean project structure, and is easily version-controlled.

# Usage
Run with `docker-compose up`. Open your browser to [https://localhost:8888](https://localhost:8888).

# Configuration
Just modify the default [docker-compose.yml](docker-compose.yml) file or create a new compose file if required.

The default compose file:
  - uses the `jupyter/minimal-notebook` image.
  - uses port `8888` by default.
  - disables the default token-based authentication for convenience of local non-production use.
  - mounts the working directory, [notebooks](notebooks), into the container in `rw` (read-write) mode.
    - File updates are live between the container and host filesystems. Filesystem changes persist
      on the host filesystem after the container is stopped.

repository: jagsgill/Skeleton-JupyterLab-Project

repo_name: jagsgill/Skeleton-JupyterLab-Project


text:
---
title: He loves us
date: 2013-05-03T10:48:00+00:00
layout: post
permalink: /2013/05/03/he-loves-us/
categories:
  - Daily Life
  - Faith
---

  This is Stella.

  I adopted her Wednesday night from a local animal shelter. She’s five years old and has had at least two homes before coming to live with me, and her last family gave her up because she “needed too much attention.” After that she spent three months in a cage in the shelter.

  She’s rather chubby — we think one set of owners must have just kept feeding her to keep her quiet. Her first night with me, she cried all night. Last night, her second night, she slept on my bed by my feet.

  She’s very skittish as she’s slowly being exposed to different parts of the house. She heard the toilet flush, and she won’t set paw in that room again. Unfortunately, that’s where I planned to keep her cat box and food tray. I’ll put a couple of cat treats on the floor in there when I go to work and see what happens.

  Often, Stella is content to roam around exploring (as long as she’s in the same room as I am),  but every now and then, she needs reassurance. She begins crying and won’t stop unless I’m touching her. At those times, I sit down on the floor next to her and just rub her with both hands, keeping up a steady stream of gentle conversation.

  “I love you, Stella. I’m right here, because I love you. I’ll go away for a couple of hours, but then I’ll come back, because I love you. You’ll be fine. You can go explore, and I’ll still be here. Because I love you.”

  As I rubbed her head, and kept up the steady stream of reassuring words, I realized how familiar they sounded. That’s what our Abba is whispering down to us in our total panic moments. He will always be with us – because He loves us.

  Hold tightly to that promise as you explore today.

  He loves you!


text:
# monarch-py

## Introduction

**monarch-py** is a Python library for interacting with and querying the
Monarch knowledge graph, with implementations for Solr and SQLite backends.

This means the same API methods can be used regardless of the implementation.

This library provides a collection of interfaces for graph operations such as retrieving entities and browsing associations.

## Installation

Requires Python 3.8 or higher

This library is available via pip or pipx:
```bash
pip|pipx install monarch-py
```

A [FastAPI server](./FastAPI/index.md) is also available as an extra:
```bash
pip|pipx install monarch-py[api]

# The API server gets its own terminal command:
monarch-api
```

## Usage

Full usage instructions [here](./Usage/index.md)
### Basic Example - CLI

```bash
$ monarch sql entity MONDO:0012933
{
    "id": "MONDO:0012933",
    "category": [
        "biolink:Disease"
    ],
    "name": "breast-ovarian cancer, familial, susceptibility to, 2",
    "description": "Any hereditary breast ovarian cancer syndrome in which the cause of the disease is a mutation in the BRCA2 gene.",
    "xref": [],
    "provided_by": "phenio_nodes",
    "in_taxon": null,
    "source": null,
    "symbol": null,
    "type": null,
    "synonym": []
}
$ monarch associations --subject MONDO:0012933 --limit 5
{
    "limit": 5,
    "offset": 0,
    "total": 5,
    "associations": [
        ... # List of Associations
    ]
}
```

### Basic Example - As a Module

```python
>>> from monarch_py.implementations.solr.solr_implentation import SolrImplementation
>>> si = SolrImplementation()
>>> entity = si.get_entity("MONDO:0007947")
>>> print(entity.name)
"Marfan syndrome"

>>> response = si.get_associations(predicate="biolink:has_phenotype")
>>> print(response.total > 600000)
True
>>> print("biolink:has_phenotype" in response.associations[0].predicate)
True
```

repository: monarch-initiative/monarch-app

repo_name: monarch-initiative/monarch-app


text:
---
repo: wq.app
date: 2016-09-01
---

# wq.app 1.0 beta

**wq.app 1.0 beta** brings a number of new features and bug fixes to **wq.app 1.0 alpha 2**.

##<EMAIL_ADDRESS>
### Plugin API
- Added two additional asynchronous plugin hooks.  Returning a `Promise` from either hook will cause further processing to wait until the `Promise` is resolved.
  - `[plugin].context(currentContext, routeInfo)` is called just before rendering a page template.  This makes it possible to perform arbitrary asynchronous data lookups before navigating to a new page (#30).  Think Django's context processors, but on the client and asynchronous.
  - `[plugin].onsave(outboxItem, serverResponse)` is called just after a successful outbox submission (344e776).  This makes it possible to perform additional work (e.g. custom model updates) before continuing.
- Made all plugin attributes optional, so you can register anonymous plugins - though they won't be configurable (#59).

### Router / Template Modes
- Added support for arbitrary route modes beyond the default `list`, `detail`, and `edit` (de578f4).  Custom modes have URLs of the form `/items/123/custommode` and will be rendered with templates named e.g. `item_custommode.html`.  Modes should be specified as part of the page configuration, e.g.:

  ``` javascript
  {
      "name": "item",
      "url": "items",
      "list": "true",

     // Client+server modes
      "modes": ["list", "detail", "edit", "custommode"],

      // Server-only modes
      "server_modes": ["servercustommode"]
  }
  ```

  Both client+server and server-only modes can be specified.  Client+server modes will be rendered on the client once `wq/app.js` initializes.  Server-only modes are always rendered on the server, but can still take advantage of the plugin infrastructure (`[plugin].run()`).  Since wq/app.js automatically loads URLs it doesn't recognize from the server, it is not necessary to register server-only modes if they don't require plugins.
- New `wq/patterns.js` plugin to support the common case of attaching multiple nested records to a single parent form (ee0b6a2).
- `[parent]_label` context variable for foreign keys (2a40fc7).

### Other Improvements
- Added `app.nav(url, changePageOptions)` and `app.refresh()` to facilitate common page navigation tasks (ee0b6a2).
- Option to render `postsave` URLs as templates (a2b31d4)

##<EMAIL_ADDRESS>- Support multiple maps on the same page (34664cd).
- Switch default basemaps from MapQuest to Stamen, one of the few remaining free providers that doesn't require an API key (#68).
- Simplify integration of Esri basemaps via `wq/mapserv.js` (a2e4249).

##<EMAIL_ADDRESS>- Allow specifying the store backing the model as a string name (16a7b42).  This makes it possible to configure custom model stores via JSON, and initialize them in JavaScript elsewhere.
- Deep-copy items retrieved from indexes to ensure modification doesn't have unexpected side effects (c4b7c34).

## Other Fixes
- Ensure `bar-shadow: false` actually disables text shadows in SCSS themes (5bee3ba).
- Code style improvements

repository: wq/wq

repo_name: wq/wq


text:
# kopf-introduction
An introduction to kopf - python kubernetes operator framework https://kopf.readthedocs.io/en/latest/, inspired by and totally copied a lot from the awesome examples in https://github.com/zalando-incubator/kopf

## About this introduction

In this short introduction into the kopf framework, we'll be implementing a simple loadtesting tool for applications running inside of Kubernetes. This will give us the possibility to learn what an operator in the context of Kubernetes is and we'll get to know kopf step-by-step along the way.

## What is an operator?

An operator in the context of Kubernetes is an application that implements the controller pattern on a custom resource. So in the end it could be described as an infinit loop watching a custom defined resource in the Kubernetes API and then reconciling, meaning matching the state in the "real world" with the state described in the custom resource.

## Building the simplest operator with kopf

### Installing kopf

```bash
pip install kopf
```

### The SimpleDeployment CRD

A CustomResourceDefinition is a Kubernetes object that defines a custom extension of the Kubernetes API. In addition to the following example a CRD can be defined with an OpenAPIv3 schema which will lead to all resources of that type be validated by Kubernetes automatically (for more info have a look [here](https://kubernetes.io/blog/2019/06/20/crd-structural-schema/)).

```yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: simple.example.org
spec:
  scope: Namespaced
  group: example.org
  versions:
    - name: v1
      served: true
      storage: true
  names:
    kind: SimpleDeployment
    plural: simpledeployments
    singular: simpledeployment
    shortNames:
      - simdep
      - sd
  additionalPrinterColumns:
    - name: Children
      type: string
      priority: 0
      JSONPath: .status.child
      description: The child pod created by the operator.
```

```bash
kubectl apply -f simpledeployment-crd.yaml
```

### The SimpleDeployment operator

Now let's implement a very useful operator that will start exactly on pod for every SimpleDeployment.

```python
import yaml
import kopf
import kubernetes.client

@kopf.on.create('example.org', 'v1', 'simpledeployments')
def create_function(body, spec, **kwargs):
    # The pod definition launched by our SimpleDeployment
    simple_pod = yaml.safe_load(f"""
        apiVersion: v1
        kind: Pod
        spec:
          containers:
          - name: simple
            image: busybox
            command: ["sh", "-x", "-c"]
            args:
            - |
              echo "I'm so very useful!"
              sleep {spec.get('sleepytime', 0)}
    """)

    # Make the pod a child of our custom resource object by adding namespace, labels etc to the pod definition
    kopf.adopt(simple_pod, owner=body)

    # Create the pod in kubernetes
    api = kubernetes.client.CoreV1Api()
    pod = api.create_namespaced_pod(namespace=simplepod['metadata']['namespace'], body=simplepod)

    # Now "register" the pod with our SimpleDeployment
    return {'children': [pod.metadata.uid]}
```

Start the operator by executing `kopf run simpledeployment/operator.py --verbose`

Now let's see if it works:

```yaml
apiVersion: example.org/v1
kind: SimpleDeployment
metadata:
  name: example-01
  labels:
    app: simple-app
spec:
  sleepytime: "120"
```

In another shell just execute `kubectl apply -f example-01.yaml`

## Creating our CustomResourceDefinition LoadTest

```yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: load.example.org
spec:
  scope: Namespaced
  group: example.org
  versions:
    - name: v1
      served: true
      storage: true
  names:
    kind: LoadTest
    plural: loadtests
    singular: loadtest
    shortNames:
      - ld
  additionalPrinterColumns:
    - name: Children
      type: string
      priority: 0
      JSONPath: .status.children
      description: The children pods created by the operator.
    - name: State
      type: string
      priority: 0
      JSONPath: .status.state
      description: The state of the loadtest can be pending, executing, failed or finished.
```

A sample loadtest object would look like this:
```yaml
apiVersion: example.org/v1
kind: LoadTest
metadata:
  name: example-02
  labels:
    app: loadtest
spec:
  # how many replicas should be spawned
  replicas: 5
  test:
    method: "GET"
    serviceName: "nginx"
    path: "/"
    repeat: 10

```

## Implementing the distributed loadtesting operator - DiLO

So what we'll expect our operator to do:
- when a LoadTest object is created:
  - set `.status.state` to `pending`
  - start `${spec.replicas}` pods
  - set `.status.state` to `executing`
- wait for children pods finishing
  - if there is an error, set `.status.state` to `failed`
  - when pods are finished set `.status.state` to `finished`
- when a LoadTest object is deleted:
  - delete all children pods
- when a LoadTest object is updated:
  - delete all children pods
  - see: when a LoadTest object is created

repository: ManuStoessel/kopf-introduction

repo_name: ManuStoessel/kopf-introduction


text:
# traffic_sign_teller

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application .

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

A web version of this app is also present.
If you wanna check this out, You can go to this Link: - [Traffic Sign Teller](http://trafficapp.chiragsaini.works/)

repository: ChiragSaini/Traffic-Sign-Teller-App

repo_name: ChiragSaini/Traffic-Sign-Teller-App


text:
# Getting started

## Prerequisites

These are the prerequisites for a project that follows the 3 Musketeers:

- [Docker][linkDocker]
- [Compose][linkCompose]
- Make

## Hello, World!

Create the two following files in an empty directory:

```yaml
# file: docker-compose.yml
version: '3'
services:
  alpine:
    image: alpine
```

```makefile
# file: Makefile

# echo calls Compose to run the command "echo 'Hello, World!'" in a Docker container
echo:
	docker-compose run --rm alpine echo 'Hello, World!'
```

Then simply echo "Hello, World!" with the following command:

```bash
$ make echo
```

[linkDocker]: https://docs.docker.com/engine/installation/
[linkCompose]: https://docs.docker.com/compose/install/

gha_language: Makefile


text:
---
title: Revision
author: Kerim
layout: post
permalink: /archives/2003/09/23/revision/
categories:
  - Language
  - Politics
---
This is amazing. There have been lots of lists of lies told by the Bush administration, but Sam Smith has actually edited together all these lies into a coherent narrative about the war. (Albeit a completely deceptive and false narrative.) Here is a sample:

>   The United States approached its postwar work with a two-part resolve: a commitment to stay and a commitment to leave. The United States had no intention of determining the precise form of Iraq’s new government. That choice belonged to the Iraqi people. We have never been a colonial power. We do not leave behind occupying armies. We leave behind constitutions and parliaments. We don’t take our force and go around the world and try to take other people’s real estate or other people’s resources, their oil. We never have and we never will.

I’m just waiting for someone to update the text and make it all hyper-text with links to the actual quotes …

repository: kerim/keywords

repo_name: kerim/keywords


text:
![Lamb](https://github.com/scalar-labs/kelpie-lamb/workflows/Lamb/badge.svg)

# Kelpie Lamb
Kelpie Lamb is a Kelpie extension for benchmarking of Scalar DL contracts.

## Build if needed
```console
$ ./gradlew shadowJar
```

## Prerequisite
You first have to set up your Scalar DL environment before benchmarking.
You can set up the environment with [scalar-terraform](https://github.com/scalar-labs/scalar-terraform) easily.

## How to run a test
1. Make Lamb configuration file. See [lamb_config.toml](./lamb_config.toml) as a sample.
2. Make a contract configuration file to specify your contract
    - Refer to [Contract configuration](#Contract-configuration)
    - [sample_contract_config.json](./sample_contract_config.json) is a sample configuration
3. Make a variable configuration file to configure variables defined in the contract configuration file
    - Refer to [Variable configuration](#Variable-configuration)
    - [sample_variable_config.json](./sample_variable_config.json_config.json) is a sample configuration
4. Run a test with Kelpie
    ```console
    $ ${KELPIE}/bin/kelpie --config <LAMB_CONFIG>
    ```

### With docker
#### Build if needed
```console
$ docker build . -t ghcr.io/scalar-labs/kelpie-lamb
```

#### Pull from the GitHub Container Registry
```console
$ docker pull ghcr.io/scalar-labs/kelpie-lamb
```

#### Run a test
```console
$ ./docker_run.sh -l <LAMB_CONFIG> -c <CONTRACT_CONFIG> -v <VARIABLE_CONFIG> -p <POPULATION_CONTRACT> -t <TARGET_CONTRACT>
```
- Your contract classpaths in the contract configuration file should be under `/lamb` directory because the script places your contracts to `/lamb` directory on docker, as seen below, for example.
    ```json
    "sample_contract.Balance": {
      "class_file": "/lamb/Balance.class",
      "properties": {},
      "arguments": {
        "asset_id": "_id_"
      }
    }
    ```
- You don't have to change the paths of the contract configuration file and the variable configuration file in the default [lamb_config.toml](./lamb_config.toml)

## Benchmark configuration
You can configure a benchmark job by a toml file just like usual Kelpie applications.
As you can see in the sample configuration file [lamb_config.toml](./lamb_config.toml), it must specify pre-defined `LambPreparer`, `LambProcessor`, and `LambReporter` modules to make benchmarking Lamb-based. You can refer to Kelpie's [README](https://github.com/scalar-labs/kelpie) about `[modules]`, `[common]` and `[stats]` table.

### [benchmark_config]
A population contract, a target contract and your contract information are specified in this table. They are used for executing contracts in your benchmark.
- `contract_config`: A file for the contract configuration
- `variable_config`: A file for the contracts' variables
- `population_contract`: The name of a contract that populates initial assets before benchmarking
- `target_contract`: The name of a contract which you want to benchmark
- `populateion_concurrency`: The number of concurrencies to execute the population contract. The default value is 1.
- `num_populateions`: The number of times to execute the population contract per thread. The number of total execution times is the product of `population_concurrency` and `num_populations`. The default value is 1.

### [client_config]
They are information for your Scalar DL server.
- `dl_server`: The address of Scalar DL server
- `certificate`: A certificate file that will be registered to the server to register and execute contracts
- `private_key`: The corresponding private key with the certificate to handle your contracts

## Contract configuration
The contract configuration file configures your contracts by the class file location, properties and arguments.

- `class_file`: The contract class file
- `properties`: The properties of the contract which are set when the contract is registered. You don't use a variable for the properties.
- `arguments`: The arguments for the contracts. If the name of a value is a "variable" like `_var_`, the value can be dynamically set by Lamb.

## Variable configuration
If the name of a value starts with and ends with '_' in the contract configuration file, the value is a variable. Lamb set a value for each contract execution.

The variable configuration file configures the variables. Each variable can be configured independently. It is specified by the contract name and the variable name. The following parameters can be set for each variable.

- `type`: The type of a value. `INT`, `BIGINT`, `DOUBLE`, `BOOLEAN`, `STRING` are supported.
- `pattern`: The pattern of a value to choose the specific values. `SEQUENTIAL`, `RANDOM` or `TIMESTAMP` can be set.
    - `SEQUENTIAL` chooses a value from a defined list in order or increments/decrements a value from the start value to the end
    - `RANDOM` chooses a value from a defined list randomly or chooses a value between the start value and the end
    - `TIMESTAMP` sets the current time to a value
- `list`: A value is chosen from the list when `SEQUENTIAL` and `RANDOM` pattern
- `start`: This specifies the start of the range for `SEQUENTIAL` and `RANDOM` pattern. It should be a number. (Inclusive)
- `end`: This specifies the end of the range for `SEQUENTIAL` and `RANDOM` pattern. It should be a number. (Exclusive)
- `length`: The length of a random string. This is used when the type is `STRING` and the pattern is `RANDOM`.

The following JSON is an example of a variable configuration in the case where your contract name is `my.contract.Transfer` and your variable name `amount`, and you want to give a random integer value from 100 to 1000  when the contract execution.
```json
"my.contract.Transfer": {
  "amount": {
    "type": "INT",
    "pattern": "RANDOM",
    "start": 100,
    "end": 1000
  }
}
```

repository: scalar-labs/kelpie-lamb

gha_language: Java

repo_name: scalar-labs/kelpie-lamb


text:
---
layout: post
title: "[CC150v5] 9.10 Stack up the Boxes "
comments: true
category: CC150v5
tags: [ src ]
---

### Question

> You have a stack of n boxes, with widths w., heights h, and depths d. The boxes can only be stacked on top of one another if each box is strictly larger than the box above it in width, height, and depth.

> Implement a method to build the tallest stack possible, where the height of a stack is the sum of the heights of each box.

### Solution

This is appearantly a DP question. I did it in the normal way, and the solution turns out to be very good:

	DP solution is        2638ms
	Recursive solution is 1322ms
	My solution is         370ms

I could not understand the 2 solutions given in the book. Sorry.

The coding is a bit lengthy, and we keeps 2 DP arrays. __Not an easy question of course__, but the solution is actually standard.

### Code

	public static ArrayList<Box> createStack(Box[] boxes) {
		ArrayList<Box> ans = new ArrayList<Box>();
		int len = boxes.length;
		int[] heights = new int[len];
		int[] preMap = new int[len];
		int maxIndex = 0;

		// start DP
		for (int i = 0; i < len; i++) {
			heights[i] = boxes[i].height;
			preMap[i] = -1;
			for (int j = 0; j < i; j++) {
				if (boxes[j].canBeAbove(boxes[i])) {
					int newHeight = heights[j] + boxes[i].height;
					if (newHeight > heights[i]) {
						heights[i] = newHeight;
						preMap[i] = j;
					}
				}
			}
			// now updated maxIndex
			if (heights[i] > heights[maxIndex]) {
				maxIndex = i;
			}
		}

		// print from maxIndex all the way backwards
		while (maxIndex != -1) {
			ans.add(boxes[maxIndex]);
			// the print order is reversed, so...
			maxIndex = preMap[maxIndex];
		}
		return ans;
	}

branch_name: refs/heads/source

gha_language: HTML


text:
These are the instructions for setting up a Voice developer environment.

### Prerequisites

* Ubuntu 16.04 (Xenial Xerus), or a Linux distribution with a Ubuntu 16.04 codebase (to verify Ubuntu version: `lsb_release -a`)
* Amazon Web Services account for using AWS Polly
* `git` version 2.7.4 or later

### Install source
Fork the [sc-voice repository](https://github.com/sc-voice/sc-voice) and clone the forked repository.
The HTTPS way is easiest.
The SSH way is simpler in the long term because it requires less typing of credentials.

Example:
```bash
git clone git@github.com:sc-aminah/sc-voice.git
cd sc-voice
npm install
./scripts/init.sh
```

### Configure AWS Command-Line Interface (CLI)
The `init.sh` script you ran with the initial installation installed the
[AWS SDK for Javascript](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/welcome.html).
To use it, you will need to:
- [Configure your AWS SDK](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html) (reading the documentation in full is recommended).
   - _Set region (given in step below)_
   - [Get AWS credentials](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html)
     - Create a new user in the [IAM console](https://console.aws.amazon.com/iam/home?#home)
     - Attach the AmazonEC2FullAccess and AmazonPollyFullAccess policies to the user (or their group). _(🚩 Review best practice)_
     - Retrieve Access key ID and Secret access key.
   - [Set your credentials in Node.js](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html)

      If running on Amazon EC2 [load from AWS IAM](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-iam.html), otherwise [load from the shared credentials file](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html).

- Install AWS Command Line Interface: `./scripts/install-aws.sh`
- Set [region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html) and output type (json recommended): `aws configure`
- `npm run build`

Once you have set up your Node.js credentials for AWS, you should be able to do the following to list your AWS EC2 server instances:

- `aws ec2 describe-instances`

Even if you have no EC2 instances, the command should be successful and return:

```json
{
    "Reservations": []
}
```
(Note: if you encounter an `AWSHTTPSConnection' object has no attribute 'server_hostname'` error, see [here](https://stackoverflow.com/questions/54346551/fatal-error-awshttpsconnection-object-has-no-attribute-server-hostname) and try installing via the curl method in **`/usr/bin/aws`** not `/usr/local/bin/aws`)

### Install sutta content

```bash
rm -rf local/suttas
./scripts/update-latest
```

### Test source
Once the software is completely installed and configured, the unit tests should complete successfully.

- `npm test`

### Launch Voice

- `npm start`

This launches the primary web server which calls AWS. It is for working on for caching, searching suttas, TTS, etc.
Changes made to UI files after the server starts will not be shown.
Note the HTTP port for testing (normally it is 80).

### Develop Voice UI
If only client UI changes are being made, it is possible to launch the Vue development web server:

- `npm run dev`

This launches the secondary web server which is only useful for developing HTML code for the browser; all the UI Vue and Vuetify stuff.
Changes made to UI files will be shown almost instantly in the browser.
Note the HTTP port for testing (normally it is 8080).

Have fun! :grinning:

repository: sc-voice/sc-voice

repo_name: sc-voice/sc-voice


text:
# Concurrent Priority Queue Design

Here is a list of popular concurrent priority queue implementations. Mentioned proposals are selectively detailed to introduce the data structure used in Crowd Discrete Event Simulation based on reviews from [Practical Concurrent Priority Queues](./pdf/2015.Practical_Concurrent_Priority_Queues.pdf).

Complete set of papers can be found at `./pdf`.

## Skiplist-Based Concurrent Priority Queues, 2000 ([pdf](./pdf/2000.Skiplist-Based_Concurrent_Priority_Queues.pdf))

### Operation Design

* Insert

Bottom-to-top approach.

Determine the new node height by random generator. Then for each level find the insert node, lock and modify forward pointer.

* Delete

Top-to-bottom approach.

Find the supposedly deleted node. For each level, lock both current node and preceding node. Preceding point to next node THEN current node point to PREDECIND node, which ensures the current reader of this node will continue on the right track.

* Delete-min

Add delete flag and insert timestamp to each logical node.

For requesting thread, use CAS on delete flag to find and set the minimum node that is not deleted AND is inserted before this request. Then stick to common routine for deleting.

### Comment

* Fined-grained locking

* No rebalance overhead

* Large amont of CAS operations on flag cacheline

* No ordering mechanism for request, may cause starvation

## A Skiplist-Based Concurrent Priority Queue with Minimal Memory Contention, 2013 ([pdf](./pdf/2013.A_Skiplist-Based_Concurrent_Priority_Queue_with_Minimal_Memory_Contention.pdf))

### Operation Design

* Delete

Logically delete by CAS set deletion flag. If the requester finds out logically deleted prefix exceeds boundary, use CAS on list head to physically delete.

Boundary of buffered stale node is determined through benchmarks. Suggested value 128 for 32 threads workload.

* Insert

Insert after logically deleted node, maintaining the prefix of deleted nodes.

### Comment

* Reduce CAS operation count by buffering deleted data

* Fix bugs at DeleteMin, and patch null pointer protect.

repository: tabokie/Crowd

repo_name: tabokie/Crowd


text:
# 🛠 fix-a-bug

## Setup

Clone this repo.

```bash
git clone https://github.com/datamade/fix-a-bug.git && cd fix-a-bug
```

Install the requirements. (Feel free to use a virtual environment!)

```bash
pip install -r requirements.txt
```

Run the tests.

```bash
pytest -sv
```

## Challenge

The code in `fix_me.py` contains four errors that are preventing the test from
passing. Debug and correct each error. As you identify the errors, fill out
a description of the problem and an explanation of the root cause and your fix
in the section below.

### Error 1

**Description:**
The `get_previous()` method does not return zero when there is no previous value.

**Explanation:**
The only situation in which there wouldn't be a previous value is when the method is trying to find the previous value of the first value in the list -- by definition, it doesn't have a previous value. To fix it, I set up a conditional where, if the index of the value is 0, the method should just return 0.

### Error 2

**Description:**
The test throws an error about an index value being out of range.

**Explanation:**
When using `enumerate()`, the first variable made available is the index. The variables were misnamed, which I was able to verify by printing the variables with a message identifying them. To solve this, I flipped the names so that the variables within this method would be defined semantically.

### Error 3

**Description:**
The tests throw an error: "TypeError: 'int' object is not iterable" in line 32.

**Explanation:**
The `sum()` method in Python requires the first argument to be iterable, like a list or tuple. Since in this line, we are just trying to add one number to another, it makes more sense to use the addition operator.

### Error 4

**Description:**
The test is failing because the output is not what is expected.

**Explanation:**
The subclass `Transformer` was being defined as an extention of both `ParentA` and `ParentB`. `Transformer` should only have one parent class.

Also, based on the output of the test, it looks like `Transformer` was being treated as a child of the `ParentA` superclass. Since this was not producing the desired output, I tried making `ParentB` the superclass. This made `Transformer` pass the test.


text:
# GitHub App Token Generator
Generate a GitHub App integration access token to use for subsequent steps

## Inputs
### `app`
**Required** - App name or ID
### `key`
**Required** - Base64 encoded private key of the GitHub App
### `owner`
**Optional** - owner name for which the integration token will be requested (defaults to current)

## Outputs
### `token`
**Masked** - An installation access token for the GitHub App on the requested organization

## Example usage
```yml
jobs:
  job:
    runs-on: ubuntu-latest
    steps:
      - name: Generate Token
        id: generate_token
        uses<EMAIL_ADDRESS>        with:
          app: ${{ secrets.GH_APP_NAME }}
          key: ${{ secrets.GH_APP_KEY }}
          # Optional (defaults to the current owner)
          # owner: jarylc
      - name: Use Token
        env:
          TOKEN: ${{ steps.generate_token.outputs.token }}
        run: |
          echo "The generated token is masked: ${TOKEN}"
```

repository: jarylc/github-app-token

repo_name: jarylc/github-app-token


text:
---
title: "The Four: The Hidden DNA of Amazon, Apple, Facebook, and Google"
description: "The Four: The Hidden DNA of Amazon, Apple, Facebook, and Google"
date: 2020-07-06
tags:
  - philosophy
layout: layouts/post.njk
---

I’ve finished reading this book, and don’t even know whom to suggest it to) Perhaps, to the readers who see large IT corporations through rose-tinted glasses. Just as I did before reading it. I am now arriving at an understanding that these giants should be decomposed into smaller companies.

“The Four” is a ruthless criticism and a micro-chronicle of the FAAG. The author does a great job of showing all the components making the business models of Amazon, Apple, Facebook, and Google successful, however, the book lacks a deeper dive into the DNA/culture itself. As an example, the topics of Amazon’s “obsession with the client”, Google’s engineering culture, or Apple’s designer culture are neglected completely.

The main value of the book is an effort to describe the macro trends the four is standing on, their business models, and narratives. This, Scott has managed really well. It is full of interesting facts, jokes, and legends of when the author himself was present at the board meetings.

At the end of the book, there’s almost a word for word part of his Algebra of Happiness, which, at the end of the day, is more applicable.
Scott Galloway is an epic person, successful entrepreneur, and lecturer at NYU. A bit of a troll and an eccentric individual. He is a capitalist, dubbed a socialist by the republicans. He does yearly IT industry forecasts, which mostly come true, highly recommend his blog "No Mercy / No Malice"

(Original post)[https://www.facebook.com/dmytriy.voloshyn/posts/10219390566649154]


text:
# omnis-themes
A collection of themes for the Omnis Studio environment.

## Requirements
* Omnis Studio 10.2 or later

## Installation
### Omnis Studio 10.2.x
This version of Omnis Studio does support multiple custom themes. The following steps describe how to install a theme.

### Omnis Studio 10.2.x

1. Open the **Omnis Studio Browser**
1. Click in the tree at the left on **Hub**, *Options**, tab **Themes**
1. Click on the button **Import Themes** if you want to import all the themes in this repository. Or click **Import Single Theme** to import one theme.
1. The **Open File** dialog is shown. Select the theme and click on **Open**.
1. Omnis Studio confirms the import with a dialog. Click **OK**.
1. Select the theme in de list under **Custom Themes** and click **Apply Custom Theme**.

## Contributing
Please feel free to fork this repository and create your own themes. The [Omnis Studio Programming Guide](http://www.omnis.net/documentation/programming/index.jsp?detail=01omnistools.html#color-themes-and-appearance) has a chapter how to get started.

If you want you can ask for a pull-request to incorporate them in this repository. To get the pull-request apporved you have to provide the .json theme file along with a screenshot of how the theme looks like in the method editor containing some sample code.

## TODO
* Contributing guide
* Creating your own theme guide

license: Unlicense

repository: Frogli/omnis-themes

repo_name: Frogli/omnis-themes


text:
# Simulate.jl

A new⭐ Julia package for **discrete event simulation**.

[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://pbayer.github.io/Simulate.jl/v0.2.0/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://pbayer.github.io/Simulate.jl/dev)
[![Build Status](https://travis-ci.com/pbayer/Simulate.jl.svg?branch=master)](https://travis-ci.com/pbayer/Simulate.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/p5trstrte9il7rm1/branch/master?svg=true)](https://ci.appveyor.com/project/pbayer/simulate-jl-ueug1/branch/master)
[![codecov](https://codecov.io/gh/pbayer/Simulate.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/pbayer/Simulate.jl)
[![Coverage Status](https://coveralls.io/repos/github/pbayer/Simulate.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/pbayer/Simulate.jl?branch=master)

`Simulate.jl` provides *three schemes* for modeling and simulating discrete event systems (DES): 1) event scheduling, 2) interacting processes and 3) continuous sampling. It introduces a *clock* and allows to schedule arbitrary Julia functions or expressions as *events*, *processes* or *sampling* operations on the clock's timeline. Thus it provides simplicity and flexibility in building models and performance in simulation.

## A first example

A server takes something from its input and puts it out modified after some time. We implement that in a function, create input and output channels and some "foo" and "bar" processes operating reciprocally on the channels:

```julia
using Simulate, Printf, Random

function simple(c::Clock, input::Channel, output::Channel, name, id, op)
    token = take!(input)         # take something from the input
    now!(c, SF(println, @sprintf("%5.2f: %s %d took token %d", tau(c), name, id, token)))
    d = delay!(c, rand())        # after a delay
    put!(output, op(token, id))  # put it out with some op applied
end

clk = Clock()      # create a clock
Random.seed!(123)  # seed the random number generator

ch1 = Channel(32)  # create two channels
ch2 = Channel(32)

for i in 1:2:8     # create and register 8 SimProcesses SP
    process!(clk, SP(i, simple, ch1, ch2, "foo", i, +))
    process!(clk, SP(i+1, simple, ch2, ch1, "bar", i+1, *))
end

put!(ch1, 1)       # put first token into channel 1
yield()            # let the first task take it
run!(clk, 10)      # and run for 10 time units
```

If we source this program, it runs a simulation:

```julia
julia> include("docs/examples/channels.jl")
 0.00: foo 1 took token 1
 0.77: bar 2 took token 2
 1.71: foo 3 took token 4
 2.38: bar 4 took token 7
 2.78: foo 5 took token 28
 3.09: bar 6 took token 33
 ...
 ...
 7.64: foo 1 took token 631016
 7.91: bar 2 took token 631017
 8.36: foo 3 took token 1262034
 8.94: bar 4 took token 1262037
 9.20: foo 5 took token 5048148
 9.91: bar 6 took token 5048153
"run! finished with 43 clock events, 0 sample steps, simulation time: 10.0"
```

For further examples see the [documentation](https://pbayer.github.io/Simulate.jl/dev),  [notebooks](https://github.com/pbayer/Simulate.jl/tree/master/docs/notebooks) or [example programs](https://github.com/pbayer/Simulate.jl/tree/master/docs/examples).

## Installation

The development (and sometimes not so stable) version can be installed with:

```julia
pkg> add("https://github.com/pbayer/Simulate.jl")
```

The stable, registered version is installed with:

```julia
pkg> add Simulate
```

Please use, test and help to develop `Simulate.jl`! 😄

**Author:** Paul Bayer