text:
# BiocChallenges

Challenges for the Bioconductor community.

# Adding a challenge

New challenges are welcome, and can be submitted as pull requests.

- Copy one of the existing files named `challenge_*.Rmd` to a new Rmd file with a name that starts with `challenge_`.
  This is key, so that it is picked up when building the page that lists all challenges.
- Edit the YAML header as needed.
  + `topic` should be a concise description of the challenge, in one sentence.
  + `difficulty` must be one of `novice`, `intermediate`, or `advanced`.
  + `leaders` must be one or more entries in the format `github_username: "Full Name"`
  + `tags` must be a list of valid tags listed in [tags.Rmd](tags.Rmd).
    New tags are welcome, and can be submitted as part of the same pull request.
  + `duration` must be a free-form string indicating the minimum amount of time recommended to tackle the challenge.
- Edit the `Notes` section.
  Free-form markdown is accepted, but concise bullet points are encouraged.

repository: kevinrue/BiocChallenges-deprecated

repo_name: kevinrue/BiocChallenges-deprecated


text:
# Compile

<PageHeader />

| Compiling jBASE Programs                                                                                | Description                             |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| [Introduction](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup42_COMPILATION.htm) | Introduction to the compilation process |
| [Keywords](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup12_KEYWORDS.htm)        | Compiler reserved words                 |
| [BASIC](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup42_BASIC.htm)              | The BASIC command                       |
| [JBC](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup42_JBC.htm)                  | The jBC command                         |
| [CATALOG](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup42_CATALOG.htm)          | The CATALOG command                     |
| [DECATALOG](https://static.zumasys.com/jbase/r99/knowledgebase/manuals/3.0/30manpages/man/sup42_DECATALOG.htm)      | The DECATALOG command                   |

[Back to Articles](./../README.md)

<PageFooter />

license: MIT

repository: josepheshaw/docs

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: josepheshaw/docs


text:
# IAM

## Create custom IAM role
1. Go to IAM & Admin > Roles
2. Select a role (Compute Instance Admin)
3. Create a role from a role
  - title
  - ID
  - role launch (alpha)
  - select permissions

## Create a custom service account
By default, using a service API (Compute Engine) for the first time initialize a google-managed service account.
New resources are suggested to be created with default service account and scope.
It is possible to change the scope of a vm but it has to be shut down.

1. Create a vm with default service account and scope granting read-only access to storage
2. Display the service account used by the vm
gcloud config list
3. List the content of the bucket
gsutil ls gs://methyl-bucket-lab-serviceaccount
4. Copy the content of the bucket
gsutil cp gs://methyl-bucket-lab-serviceaccount/* .
5. Create a test.txt file on the vm
vim test.txt
6. Try to upload the test.txt file in the bucket
gsutil cp test.txt gs://methyl-bucket-lab-serviceaccount
7.  Change the VM scope for storage from read-only to read write
9. Execute again the gsutil copy command to the bucket

repository: Geekverma/learn-gcp

repo_name: Geekverma/learn-gcp


text:
# Swim Team
This project will save the world!

Have you ever found yourself running a swim team and not had the correct tools to properly manage your team roster?! Fear not! This tool gives you everything you need to help you keep track of little Timmy's age and what Sally's favorite swimming stroke is. There is even a discrete area for admins to create, update, and delete swimmers from the team!

### Prerequisites
Web browser with ES6 compatibility
Examples: Chrome, Safari
* npm
* bower

### Installing

If you dont want to install to your local machine, you don't have to! I have deployed the app live at:

https://swim-team-6a663.firebaseapp.com/

These instructions have been verified to work on MacOS.
There are a few terminal commands you will need to run to get the app to launch locally on your machine. First though, you will need to clone this repository to your machine and navigate to its folder in your terminal. You will also have to add a file and obtain a firebase API key.

Obtaining your own firebase key is free and easy!
Go to https://www.firebase.com sign in or join. First you will need to create a project. Once its created you will need to edit the rules for the database.

The rules should look like this:

```json
{
  "rules": {
    ".read": true,
    ".write": true
  }
}
```

Next you will need to get the firebase API keys wich will look something like the following code snippit. The easiest way to find the keys are by going to the project overview and clicking "Add firebase to your web app".

With your keys in hand, make a file in the repository you cloned to your machine and place the keys in the file structured like the following:

`/src/app/api-keys.ts`

```javascript
export const masterFirebaseConfig = {
  apiKey: "AIzaSyCqxHZXXXXXXXX",
  authDomain: "swim-XXXXXXXX.firebaseapp.com",
  databaseURL: "https://swim-XXXXXXXX.firebaseio.com",
  projectId: "swim-XXXXXXXX",
  storageBucket: "swim-XXXXXXXX.appspot.com",
  messagingSenderId: "2419XXXXXXXX"
};
```

Almost done!

Navigate to the root directory, and run the following commands:

* bower install
* npm install
* ng serve

The required packages may take a few minutes to download and install due to the speed of your machine and your Internet connection. The last command should launch the app in your browser! If it doesn't there is likely something incorrect with the keys file so make sure it is in the right place, with the correct file name, and the code in the file follows the correct naming conventions.

## Built With
* Angular CLI
* HTML
* CSS/SASS
* Bootstrap https://getbootstrap.com/
* ES6
* Node
* Bower

## Authors
* Spencer Alan

## License
MIT License
Copyright (c) 2017 Spencer Alan

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: spenceralan/angular-team

repo_name: spenceralan/angular-team


text:
# Hello Substrate

`pallets/hello-substrate`
[
	![Try on playground](https://img.shields.io/badge/Playground-Try%20it!-brightgreen?logo=Parity%20Substrate)
](https://playground-staging.substrate.dev/?deploy=recipes&files=%2Fhome%2Fsubstrate%2Fworkspace%2Fpallets%2Fhello-substrate%2Fsrc%2Flib.rs)
[
	![View on GitHub](https://img.shields.io/badge/Github-View%20Code-brightgreen?logo=github)
](https://github.com/substrate-developer-hub/recipes/tree/master/pallets/hello-substrate/src/lib.rs)

The first pallet we'll explore is a simple "hello world" example. This pallet will have one
dispatchable call that prints a message to the node's output. Because this is our first pallet,
we'll also explore the structure that every pallet has. This code lives in
`pallets/hello-substrate/src/lib.rs`.

## No Std

The very first line of code tells the rust compiler that this crate should not use rust's standard
library except when explicitly told to. This is useful because Substrate runtimes compile to Web
Assembly where the standard library is not available.

```rust
#![cfg_attr(not(feature = "std"), no_std)]
```

## Imports

Next, you'll find imports that come from various parts of the Substrate framework. All pallets will
import from a few common crates including
[`frame-support`](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/index.html), and
[`frame-system`](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_system/index.html). Complex pallets will have many
imports as we'll see later. The `hello-substrate` pallet uses these imports.

```rust
use frame_support::{ decl_module, dispatch::DispatchResult, debug };
use frame_system::{ self as system, ensure_signed };
use sp_runtime::print;
```

## Tests

Next we see a reference to the tests module. This pallet has tests written in a separate file called
`tests.rs`. We will not discuss the tests further at this point, but they are covered in the
[Testing section](../3-entrees/testing/index.md) of the book.

## Configuration Trait

Next, each pallet has a configuration trait which is called `Trait`. The configuration trait can be
used to access features from other pallets, or [constants](../3-entrees/constants.md) that affect
the pallet's behavior. This pallet is simple enough that our configuration trait can remain empty,
although it must still exist.

```rust
pub trait Trait: system::Trait {}
```

## Dispatchable Calls

A Dispatchable call is a function that a blockchain user can call as part of an Extrinsic.
"Extrinsic" is Substrate jargon meaning a call from outside of the chain. Most of the time they are
transactions, and for now it is fine to think of them as transactions. Dispatchable calls are
defined in the
[`decl_module!` macro](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/macro.decl_module.html).

```rust
decl_module! {
	pub struct Module<T: Trait> for enum Call where origin: T::Origin {

		/// A function that says hello to the user by printing messages to the node log
		#[weight = 10_000]
		pub fn say_hello(origin) -> DispatchResult {
			// --snip--
		}

		// More dispatchable calls could go here
	}
}
```

As you can see, our `hello-substrate` pallet has a dispatchable call that takes a single argument,
called `origin` which we'll investigate shortly. The call returns a
[`DispatchResult`](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/dispatch/type.DispatchResult.html) which
can be either `Ok(())` indicating that the call succeeded, or an `Err` which we'll investigate in
the [appetizer about errors](./3-errors.md).

### Weight Annotations

Right before the `hello-substrate` function, we see the line `#[weight = 10_000]`. This line
attaches a default weight to the call. Ultimately weights affect the fees a user will have to pay to
call the function. Weights are a very interesting aspect of developing with Substrate, but they too
shall be covered later in the section on [Weights](../3-entrees/weights.md). For now, and for may of
the recipes pallets, we will simply use the default weight as we have done here.

## Inside a Dispatchable Call

Let's take a closer look at our dispatchable call.

```rust
pub fn say_hello(origin) -> DispatchResult {
	// Ensure that the caller is a regular keypair account
	let caller = ensure_signed(origin)?;

	// Print a message
	print("Hello World");
	// Inspecting variables
	debug::info!("Request sent by: {:?}", caller);

	// Indicate that this call succeeded
	Ok(())
}
```

This function essentially does three things. First, it uses the
[`ensure_signed` function](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_system/fn.ensure_signed.html) to ensure
that the caller of the function was a regular user who owns a private key. This function also
returns who that caller was. We store the caller's identity in the `caller` variable.

Second, it prints a message and logs the caller. Notice that we aren't using Rust's normal
`println!` macro, but rather a special
[`print` function](https://substrate.dev/rustdocs/v2.0.0-rc4/sp_runtime/fn.print.html) and
[`debug::info!` macro](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/debug/macro.info.html). The reason for
this is explained in the next section.

Finally, the call returns `Ok(())` to indicate that the call has succeeded. At a glance it seems
that there is no way for this call to fail, but this is not quite true. The `ensure_signed`
function, used at the beginning, can return an error if the call was not from a signed origin. This
is the first time we're seeing the important paradigm "**Verify first, write last**". In Substrate
development, it is important that you always ensure preconditions are met and return errors at the
beginning. After these checks have completed, then you may begin the function's computation.

## Printing from the Runtime

Printing to the terminal from a Rust program is typically very simple using the `println!` macro.
However, Substrate runtimes are compiled to both Web Assembly and a regular native binary, and do
not have access to rust's standard library. That means we cannot use the regular `println!`. I
encourage you to modify the code to try using `println!` and confirm that it will not compile.
Nonetheless, printing a message from the runtime is useful both for logging information, and also
for debugging.

![Substrate Architecture Diagram](../img/substrate-architecture.png)

At the top of our pallet, we imported `sp_runtime`'s
[`print` function](https://substrate.dev/rustdocs/v2.0.0-rc4/sp_runtime/fn.print.html). This special function allows
the runtime to pass a message for printing to the outer part of the node which is not compiled to
Wasm and does have access to the standard library and can perform regular IO. This function is only
able to print items that implement the
[`Printable` trait](https://substrate.dev/rustdocs/v2.0.0-rc4/sp_runtime/traits/trait.Printable.html). Luckily all
the primitive types already implement this trait, and you can implement the trait for your own
datatypes too.

**Print function note:** To actually see the printed messages, we need to use the flag
`-lruntime=debug` when running the kitchen node. So, for the kitchen node, the command would become
`./target/release/kitchen-node --dev -lruntime=debug`.

The next line demonstrates using `debug::info!` macro to log to the screen and also inspecting the
variable's content. The syntax inside the macro is very similar to what regular rust macro
`println!` takes.

**Runtime logger note:** When we execute the runtime in native, `debug::info!` messages are printed.
However, if we execute the runtime in Wasm, then an additional step to initialise
[RuntimeLogger](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/debug/struct.RuntimeLogger.html) is required.

## Installing the Pallet in a Runtime

In order to actually use a pallet, it must be installed in a Substrate runtime. This particular
pallet is installed in the `super-runtime` which you built as part of the kitchen node. To install a
pallet in a runtime, you must do three things.

### Depend on the Pallet

First we must include the pallet in our runtime's `Cargo.toml` file. In the case of the
super-runtime, this file is at `runtimes/super-runtime/Cargo.toml`.

```toml
[dependencies]
# --snip--
hello-substrate = { path = "../../pallets/hello-substrate", default-features = false }
```

Because the runtime is compiled to both native and Wasm, we must ensure that our pallet is built to
the correct target as well. At the bottom of the `Cargo.toml` file, we see this.

```toml
[features]
default = ["std"]
std = [
	# --snip--
	"hello-substrate/std",
]
```

### Implement its Configuration Trait

Next we must implement the pallet's configuration trait. This happens in the runtime's main `lib.rs`
file. In the case of the super-runtime, this file is at `runtimes/super-runtime/src/lib.rs`. Because
this pallet's configuration trait is trivial, so is implementing it.

```rust ignore
impl hello_substrate::Trait for Runtime {}
```

You can see the other pallets' trait implementations in the surrounding lines. Most of them are more
complex.

### Add it to `construct_runtime!`

Finally, we add our pallet to the
[`construct_runtime!` macro](https://substrate.dev/rustdocs/v2.0.0-rc4/frame_support/macro.construct_runtime.html).

```rust
construct_runtime!(
	pub enum Runtime where
		Block = Block,
		NodeBlock = opaque::Block,
		UncheckedExtrinsic = UncheckedExtrinsic
	{
		// --snip--
		HelloSubstrate: hello_substrate::{Module, Call},
	}
);
```

This macro does the heavy lifting of composing each individual pallet into a single usable runtime.
Let's explain the syntax for each line. Each Pallet listed in the macro needs several pieces of
information.

First is a convenient name to give to this pallet. We've chosen `HelloSubstrate`. It is common to
choose the same name as the pallet itself except when there is
[more than one instance](../3-entrees/instantiable.md). Next is the name of the crate that the
pallet lives in. And finally there is a list of features the pallet provides. All pallets require
`Module`. Our pallet also provides dispatchable calls, so it requires `Call`.

## Try it Out

If you haven't already, try interacting with the pallet using the Apps UI. You should see your
message printed to the log of your node. Remember to run the kitchen node with the correct flags:
`./target/release/kitchen-node --dev -lruntime=debug`

You're now well on your way to becoming a blockchain chef. Let's continue to build our skills with
another appetizer.


text:
---
layout: post
title: Block device and BIO(block I/O) Architecture
subtitle: Information of data structure associated with block dievice and layer
category: SSD (Solid State Drives)
tags: [block layer, block device driver]
permalink: /2016/09/08/Block_Device/
---

First of all, I refer to [this site(blkdevarch)](https://yannik520.github.io/blkdevarch.html)

and basic concept block device(Lecture 4 - Storage Systems in the_Kernel)

here is the above [file(Lecture 4 - Storage Systems in the_Kernel)](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/Lecture_4_-_Storage_Systems_in_the_Kernel.pdf)

## Introducntion of Block device.

 Block device provides storage for a large amount of data.

 the kernel tries to make maximum performance with caching the data in memory, Because The I/O operations are costly.

 every actual I/O operation is performed by the deive drivers, The kernel provides various function and data structure for device drivers to register their handlers.

 Another requirement of the block driver layer is to hide the property of specific hardware and provide a general API to access the devices.

 in hard disk, the sequence of request affects performance of device I/O, So The kernel Collect I/O requests and sorts them in block layer before calling device driver to precess I/O request.

 So In block layer, kernel tries to improve performance of I/O operations with grouping the contiguous sertors and sorting  I/O requests.

 And this algorithm that sorting and grouping I/O requests is called elevator algorithm.

## access to block device from user space.

 Block device are access as using the regular fiile.

 Block device is verified with **major and minor number**, major number link file to device driver. And You can check partition inside block device with minor number.

 In other words, kernel only notices the device with major and minor number combination.

 managing the device file under /dev folder is convention.

## Basically data structure.

 I will explain you these data structure as based on kernel version 4.5.3

 The data from the block device is accessed as blocks defined by [the structure buffer_head](http://lxr.linux.no/#linux+v4.5.3/include/linux/buffer_head.h#L51).

 For example, when a file is read from the device, the file system handler for the read operation converts the file offset into a block number and issues a request to load that particular block.

 So there are registration mechanism for the device driver to register their handlers.

 After that registration, The kernel calls the registered handler to perform the actual operation.

 The kernel als uses elevator algorithm to sort the **I/O requests** in the request queue.

 So The kernel give you different types of elevator algorithms.

 from now on. I will introduce you data structure of kernel used by the block device drive layer.

### First, gendisk

   gendis has informations about a disk, The important fields are queue, part and fops in a gendisk.

struct gendisk {
 .....
 struct hd_struct  ** part; // partition information - this point is an array of the pointer to
 hd_struct indicating a partition.
 struct block_device_operations *fops; //block device operations table.
 request_queue_t * queue // to store request queue.
 .....
 };

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/Gendisk_structure.png)

 block device operation

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/block device operation.png)

### Second, hd_struct

   hd_struct is information about partition on a disk.

 struct hd_struct {
 sector_t start_sector;
   sector_t nr_sects;
   int partno;
   ......
 };

### Third, block_device

  each of disks is represented by **struct block_deivce** and **struct gendisk**.

  This is used to represent a block device in the kernel. This can represent the whole disk or a particular partition.

  when the structure represents a partition, the **bd_contains** field points to the device object which contains the partition.

  The **bd_part** field points to the partition structure of the device. this **bd_part** is structure representing the device.

  The field **bd_disk** points to the **gendisk structure** of the device.

  This structure is created only when the device is opened.(??? **fopen function** of file system).

  In here, Key point is the device driver still creates the **gendisk structure** and allocates **the request queue** and registers the structures into kernel. But until The device is actually opened for reading through the device file or mounting it. this structure will not be created.

  The field **bd_inode** points to the inode in the bdev file system.

  In other words, When the device file of block device is opened for the first time, the kernel allocates the block_device structure and fills structures in block_device structure.

  the Actual allocating function is **[bdev_alloc_inode](http://lxr.linux.no/#linux+v4.5.3/fs/block_dev.c#L500)**

struct block_device {
    dev_t bd_bdev;
    struct inode *bd_inode;
    struct list_head bd_inodes;
    struct block_device *bd_contains;
    struct hd_struct *bd_part;
    struct gendisk *bd_disk;
    struct list_head bd_list;
    }

 block device structure

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/structure of block device.png)

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/block_device_structure.png)

### Fourth, buffer_head.

 The sector size is physical property of block device. this sector is the funndamental unit of all block device.

 device cannot address or operation on the sector unit smaller than the sector,

 Software has different view, however and therefore imposes its own smallest logically addressable unit, which is block size.

 here is the above's [reference(makelinux)](http://www.makelinux.net/books/lkd2/ch13lev1sec1)

 The buffer serves as the object that represents a disk block in memory.

 The block is comprised of one or more sectors. but no more than a page in size. therefore a single page hold one or more blocks in memory.

 Because The kernel requires some associated control information to accompany the data ( such as from which block device and which specific block the buffer is), each buffer is associated with a descriptor. The descriptor is called a buffer head and is of type [struct buffer_head](http://lxr.linux.no/#linux+v4.5.3/include/linux/buffer_head.h#L51).

 this struct buffer_head holds all the information that the kernel needs to manipulate buffers.

struct buffer_head {
        unsigned long        b_state;          /* buffer state flags */
        atomic_t             b_count;          /* buffer usage counter */
        struct buffer_head   *b_this_page;     /* buffers using this page */
        struct page          *b_page;          /* page storing this buffer */
        sector_t             b_blocknr;        /* logical block number */
        u32                  b_size;           /* block size (in bytes) */
        char                 *b_data;          /* buffer in the page */
        struct block_device  *b_bdev;          /* device where block resides */
        bh_end_io_t          *b_end_io;        /* I/O completion method */
        void                 *b_private;       /* data for completion method */
        struct list_head     b_assoc_buffers;  /* list of associated mappings */
 }

 The above struture's reference is [here(makelinux)](http://www.makelinux.net/books/lkd2/ch13lev1sec2)

 The **b_state** field specifies the state of this particular buffer. It can be one or more of the flage.

 The purpose of a buffer head is to describe this mapping between the on-disk block and the physical in memory buffer (which is a sequence of bytes on a specific page). Acting as a descriptor of this buffer-to-block mapping is the data structure's only role in the kernel.

### Fifth, bio

 **bio structur** is born due to inefficiency of struct buffer_head..

 This structure is used to represent an ongoing block I/O operation.

 The buffer_head structure allocates **a bio** structure, and fill the structure and submit to block layer.

 I recommend you [this site(makelinux)](http://www.makelinux.net/books/lkd2/ch13lev1sec3) about bio

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/bi_io_vecs.png)

 If you want more, I recommend [this URL(lwn)](https://lwn.net/Articles/26404/)

### sixth request.

 a request is comprise of more than one bio.

 This is used to represent a pending I/O request. these are stored as a list (doubly linked List) to the request queue.

 And this is sorted by the elevator algorithm.

 ! When a bio is submitted to block layer, it tried to see if it can be added to an existing request in the request queue.

 at this time, bi_next field of the bio structure is used to store the next bio in the list.

 struct request_list{
    mempool_t *rq_pool;
 }

 struct request {
    struct list_head            queuelist;
    struct list_head            donelist;
    struct bio                  *bio;
    struct bio                  *biotail;
    void                       *elevator_private;
    struct gendisk             *rq_gendisk;
    request_queue_t            *q;
    request_list               *rl;
    .....
 }

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/request_doubly_Linked_list.png)

 - sectore < block <= Segment <= Page.

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/bio.PNG)

### seventh request_queue

 simply, after [reference](http://www.makelinux.net/books/lkd2/ch13lev1sec4), you can see the elevator alorithm type.

 The request queue contains a doubly linked list of requests and associated control information

 This data structure stores information about the pending requests and other information required to manag the request queue like the elevator algorithm.

 The request_fn field is the most important handler from the device driver point of view. this is the handler that is called when the actual I/O has to be performed i.e.,

 When a request object has to be processed.

 struct request_queue {
    struct list_head            queue_head;
    struct request             *lastmerge;
    elevator_t                 *elevator;
    struct request_list         rq;
    request_fn_proc            *request_fn;
    merge_request_fn           *back_merge_fn;
    merge_request_fn           *front_merge_fn;
    merge_requests_fn          *merge_requests_fn;
    make_request_fn            *make_request_fn;
    prep_rq_fn                 *prep_rq_fn;
    unplug_fn                  *unplug_fn;
    ...
 }

 be careful, in the above structure, you have to be interested in both __*request_fn__ and __*make_request_fn__

  ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Devicee/reqeust_queue_structure.png)

 if you want to know more about request, reqeust_queue, bio, click [this site(URL)](http://www.makelinux.net/ldd3/chp-16-sect-3)

## Linux IO Path

 ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/Linux_IO_Path.png)

 the reference related is [this URL](http://users.suse.com/~sjayaraman/talks/IO_Journey_osidays.pdf)

 this is [file](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/IO_Journey_osidays.pdf
)

## registeration of a block device driver.

 when you register block device driver, driver need to allocated gendisk for each disk and assign a request queue for each gendisk. the gendisk.

## [concept of plug on block device](https://lwn.net/Articles/438256/)

  this is not plugging.

  ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/kernel plug image.jpg)

  this is plugging

  ![](/img/Image/SSD-Solid_State_Drives/2016-09-08-Block_Device/kernel plug image2.jpg)

  [korean site 1](http://egloos.zum.com/nimhaplz/v/5598614) and [korean site 2](http://egloos.zum.com/studyfoss/v/5585801) about plug and block device

## multi-queue block device layer and block device

 If you want to know more about multi-queue, I recommend you [this site(URL)](http://ari-ava.blogspot.com/2014/07/opw-linux-block-io-layer-part-3-make.html)

# Reference

  - [driver book](http://www.oreilly.com/openbook/linuxdrive3/book/)

  - [blkdevarch](https://yannik520.github.io/blkdevarch.html)

gha_language: Jupyter Notebook


text:
---
layout: shows/episode
title: "Polymer and Progressive Web Apps: Building on the modern web - Google I/O 2016"
youtubeID: "fFF2Yup2dMM"
youtubeThumbnail: "https://i.ytimg.com/vi/fFF2Yup2dMM/maxresdefault.jpg"
published_on: 2016-05-20
updated_on: 2016-05-20
---

Taylor Savage on Polymer and Progressive Web Apps: Building on the modern web

The Polymer library, re-written from the ground up with its 1.0 release last year, helps you build composable, interoperable components to use in your web applications. We'll go over the latest features of the library, show how to use some powerful newly-released components, show how Polymer is used in practice, dive into the cutting-edge tools for shipping component-based applications, reveal a brand-new way to get started building Progressive Web Applications with Polymer, and a take sneak peek into the future of the project.

Watch more Chrome talks at I/O 2016 here: https://goo.gl/JoMLpB
See all the talks from Google I/O 2016 here: https://goo.gl/olw6kV
Subscribe to the Chrome Developers channel at http://goo.gl/LLLNvf

#io16 #GoogleIO #GoogleIO2016

repository: JcChimjj/WebFundamentals

extension: markdown

gha_language: HTML

repo_name: JcChimjj/WebFundamentals


text:
This is an example with [express](http://expressjs.com/).

```sh
npm install

# build client JavaScript codes.
npm run build

# run server
npm run serve

# call api in client side.
open http://localhost:3000 # then app.hello1(), app.hello2() in dev console.

# call api in server side.
open http://localhost:3000/hello/world
```

repository: s-shin/isoproxy

repo_name: s-shin/isoproxy


text:
# Data
All related data for "Analyzing Twitter Data to Evaluate the People’s Attitudes to Public Health Policies and Events in the Era of COVID-19"

Tweet IDs for all collected data 01-Mar to 14-Jun 2020

Models&Training Data


text:
# cfdi-iva-snippet
Script for process all CFDI xml files on a given path, computing total amount of "IVA"

## Installation

Just Run
```shell
pip install -r requirements.txt

```

## Usage

For total amount just run
```Shell
# As python script
python total_iva_amount.py -d /home/cfdi/2020/01 --verbose

```

For CFDI Directory info
```Shell
# As python script
python cfdi_directory.py -d /home/cfdi/2020/01 -v  -e

```

### Run tests

Just run
```Shell
# Using pytest
pytest tests --verbose

```


text:
---
layout: post
rel_link:  "8_0_33"
title:  "CMSSW_8_0_33"
date:   2019-04-18 07:57:06
categories: cmssw
relmajor: 8
relminor: 0
relsubminor: 33
---

# CMSSW_8_0_33
#### Changes since CMSSW_8_0_32:
[compare to previous](https://github.com/cms-sw/cmssw/compare/CMSSW_8_0_32...CMSSW_8_0_33)

1. [26422](http://github.com/cms-sw/cmssw/pull/26422){:target="_blank"}  from **@srimanob**: (Backport) Provide forward compatibility to HepMC::GenEvent reading `generators`  created: 2019-04-10 12:05:40 merged: 2019-04-11 16:11:14

2. [26239](http://github.com/cms-sw/cmssw/pull/26239){:target="_blank"}  from **@srimanob**: backport CSCCLCTPreTriggerDigi for ULHLT `simulation`  created: 2019-03-24 15:26:57 merged: 2019-04-04 15:03:05

3. [26149](http://github.com/cms-sw/cmssw/pull/26149){:target="_blank"}  from **@srimanob**: [80X] bypassVersionCheck should not apply to DQMRootSource `operations`  created: 2019-03-11 21:38:24 merged: 2019-03-13 10:06:51

4. [26129](http://github.com/cms-sw/cmssw/pull/26129){:target="_blank"}  from **@srimanob**: bug fix on Merge.py for 80X `operations`  created: 2019-03-08 21:37:34 merged: 2019-03-09 18:51:46

5. [26044](http://github.com/cms-sw/cmssw/pull/26044){:target="_blank"}  from **@srimanob**: backport bypassVersionCheck in Merge step to 80X `operations`  created: 2019-03-02 00:15:44 merged: 2019-03-05 17:50:09

6. [26039](http://github.com/cms-sw/cmssw/pull/26039){:target="_blank"}  from **@srimanob**: Backports all needs for runTheMatrix to 80X `pdmv`  `upgrade`  created: 2019-03-01 12:00:50 merged: 2019-03-11 08:15:24

#### CMSDIST Changes between Tags REL/CMSSW_8_0_32/slc6_amd64_gcc530 and REL/CMSSW_8_0_33/slc6_amd64_gcc530:
[compare to previous](https://github.com/cms-sw/cmsdist/compare/REL/CMSSW_8_0_32/slc6_amd64_gcc530...REL/CMSSW_8_0_33/slc6_amd64_gcc530)

repository: cms-sw/ReleaseNotes

repo_name: cms-sw/ReleaseNotes


text:
---
title: Custom E-Commerce
subtitle: Facilitating innovation with unique features and automation.
video_name: custom_ecommerce

caption:
  title: Custom E-Commerce
  subtitle: Facilitating Innovation
---

**A custom e-commerce platform, tailored to your business, can incorporate many
innovative features that give you an edge over the competition. In this project
we built a custom platform for SwimTrek, an adventure travel company with
innovation at its heart.**

In 2015 when SwimTrek contracted us to replace their website, they were already
the world's leading provider of open-water swimming holidays, with a thriving
business and a loyal following of returning customers. However, they had
outgrown the capabilities of the off-the-shelf travel software they were using,
with staff having to use time-consuming, offline workarounds (often spreadsheet
based) to implement many of the novel business functions that had won SwimTrek
it's market-leading position.

We engaged in a comprehensive review process with senior staff, determining what
customer-facing and backend features the new site would need in order to
automate SwimTrek's most important business functions, including:

- **social features** for participants travelling on the same departure (guide
  and guest profiles, group discussions, private messaging, shared photo
  gallery, etc.)
- **an invite system** that enables a booking's lead customer to invite their
  other guests to sign up, enter their own social, travel and contact details,
  and participate in the trip's social features
- **a booking system** that can automatically manage room inventory, offering
  solo-travellers single supplements, or automatic roommate matching, or
  allowing additional non-swimming guests, only if remaining room inventory can
  support it
- **a self-serve checkout** that doubles up as an edit interface, allowing
  customers to update or cancel their own booking, with a card refund (or an
  account credit) issued automatically based on their trip's refund policy
- **staggered payments**, with automatic reminder emails
- **a loyalty point system**: "SwimTrek Miles"
- **a fully-featured CRM system** allowing staff to control the content of
  customer-facing pages
- **a media asset library** with image/video upload, editing and optimisation
- **a comprehensive admin system** allowing staff to manage packages,
  departures, bookings, payments, etc.
- and much more...

The main application is built using **Ruby on Rails**, backed by a **Postgres**
database. We built it over the course of eight months, with regular face-to-face
meetings with SwimTrek in order to review progress and plan the next phase of
the build. The platform we built is now the main tool that SwimTrek staff use to
operate the business, and we have continued to engage with SwimTrek over the
years, adding new features and additional automation as their business continues
to grow.

---

{:.list-inline}
- **Date**: August 2015
- **Client**: SwimTrek


text:
# checkpoint配置转换

## StreamExecutionEnvironment配置

### Checkpoint从StreamNode传递到JobGraph

```
-->StreamExecutionEnvironment#enableCheckpointing
	-->PipelineExecutor#execute
		-->FlinkPipelineTranslationUtil#getJobGraph
			-->StreamGraphTranslator#translateToJobGraph
				-->StreamGraph#getJobGraph
					-->StreamingJobGraphGenerator#createJobGraph
						-->StreamingJobGraphGenerator#configureCheckpointing
```

* 最终将streamGraph的CheckpointConfig转换为`jobGraph`的`SnapshotSettings(JobCheckpointingSettings)`

### Checkpoint从JobGraph传递到ExecutionGraph

```
-->ExecutionGraphBuilder#buildGraph
	-->ExecutionGraph#enableCheckpointing
```

# Checkpoint机制

## 恢复状态流程

* 生成`ExecutionGraph`时会尝试恢复历史状态

```java
private ExecutionGraph createAndRestoreExecutionGraph(
		JobManagerJobMetricGroup currentJobManagerJobMetricGroup,
		ShuffleMaster<?> shuffleMaster,
		JobMasterPartitionTracker partitionTracker,
		ExecutionDeploymentTracker executionDeploymentTracker) throws Exception {

		ExecutionGraph newExecutionGraph = createExecutionGraph(currentJobManagerJobMetricGroup, shuffleMaster, partitionTracker, executionDeploymentTracker);

		final CheckpointCoordinator checkpointCoordinator = newExecutionGraph.getCheckpointCoordinator();

		// 恢复checkpoint状态
		if (checkpointCoordinator != null) {
			// check whether we find a valid checkpoint
			if (!checkpointCoordinator.restoreLatestCheckpointedStateToAll(
				new HashSet<>(newExecutionGraph.getAllVertices().values()),
				false)) {

				// check whether we can restore from a savepoint
				// 检查恢复状态
				tryRestoreExecutionGraphFromSavepoint(newExecutionGraph, jobGraph.getSavepointRestoreSettings());
			}
		}

		return newExecutionGraph;
	}

// 恢复savepoint
private void tryRestoreExecutionGraphFromSavepoint(ExecutionGraph executionGraphToRestore, SavepointRestoreSettings savepointRestoreSettings) throws Exception {
		if (savepointRestoreSettings.restoreSavepoint()) {
			final CheckpointCoordinator checkpointCoordinator = executionGraphToRestore.getCheckpointCoordinator();
			if (checkpointCoordinator != null) {
				// 恢复savepoint
				checkpointCoordinator.restoreSavepoint(
					savepointRestoreSettings.getRestorePath(),
					savepointRestoreSettings.allowNonRestoredState(),
					executionGraphToRestore.getAllVertices(),
					userCodeLoader);
			}
		}
	}
```

* 恢复savepoint

```java
public boolean restoreSavepoint(
			String savepointPointer,
			boolean allowNonRestored,
			Map<JobVertexID, ExecutionJobVertex> tasks,
			ClassLoader userClassLoader) throws Exception {

		Preconditions.checkNotNull(savepointPointer, "The savepoint path cannot be null.");

		LOG.info("Starting job {} from savepoint {} ({})",
				job, savepointPointer, (allowNonRestored ? "allowing non restored state" : ""));

		// 解析checkpoint path
		final CompletedCheckpointStorageLocation checkpointLocation = checkpointStorage.resolveCheckpoint(savepointPointer);

		// Load the savepoint as a checkpoint into the system
		// 加载校验checkpoint
		CompletedCheckpoint savepoint = Checkpoints.loadAndValidateCheckpoint(
				job, tasks, checkpointLocation, userClassLoader, allowNonRestored);

		// 添加到完成的checkpoint存储，底层存储为双端队列
		completedCheckpointStore.addCheckpoint(savepoint);

		// Reset the checkpoint ID counter
		long nextCheckpointId = savepoint.getCheckpointID() + 1;
		// 设置下次checkpointid
		checkpointIdCounter.setCount(nextCheckpointId);

		LOG.info("Reset the checkpoint ID of job {} to {}.", job, nextCheckpointId);

		// 恢复最后checkpoint状态
		return restoreLatestCheckpointedStateInternal(new HashSet<>(tasks.values()), true, true, allowNonRestored);
	}
```

* 恢复最新的checkpoint状态

```java
private boolean restoreLatestCheckpointedStateInternal(
		final Set<ExecutionJobVertex> tasks,
		final boolean restoreCoordinators,
		final boolean errorIfNoCheckpoint,
		final boolean allowNonRestoredState) throws Exception {

		synchronized (lock) {
			if (shutdown) {
				throw new IllegalStateException("CheckpointCoordinator is shut down");
			}

			// We create a new shared state registry object, so that all pending async disposal requests from previous
			// runs will go against the old object (were they can do no harm).
			// This must happen under the checkpoint lock.
			sharedStateRegistry.close();
			sharedStateRegistry = sharedStateRegistryFactory.create(executor);

			// Recover the checkpoints, TODO this could be done only when there is a new leader, not on each recovery
			// 恢复checkpoint
			completedCheckpointStore.recover();

			// Now, we re-register all (shared) states from the checkpoint store with the new registry
			for (CompletedCheckpoint completedCheckpoint : completedCheckpointStore.getAllCheckpoints()) {
				// 注册共享状态之后恢复
				completedCheckpoint.registerSharedStatesAfterRestored(sharedStateRegistry);
			}

			LOG.debug("Status of the shared state registry of job {} after restore: {}.", job, sharedStateRegistry);

			// Restore from the latest checkpoint
			// 获取最后的checkpoint
			CompletedCheckpoint latest = completedCheckpointStore.getLatestCheckpoint(isPreferCheckpointForRecovery);

			if (latest == null) {
				if (errorIfNoCheckpoint) {
					throw new IllegalStateException("No completed checkpoint available");
				} else {
					LOG.debug("Resetting the master hooks.");
					MasterHooks.reset(masterHooks.values(), LOG);

					return false;
				}
			}

			LOG.info("Restoring job {} from latest valid checkpoint: {}.", job, latest);

			// re-assign the task states
			final Map<OperatorID, OperatorState> operatorStates = latest.getOperatorStates();

			// 用于恢复savepoint和恢复checkpoint
			StateAssignmentOperation stateAssignmentOperation =
					new StateAssignmentOperation(latest.getCheckpointID(), tasks, operatorStates, allowNonRestoredState);

			// 分配状态
			stateAssignmentOperation.assignStates();

			// call master hooks for restore. we currently call them also on "regional restore" because
			// there is no other failure notification mechanism in the master hooks
			// ultimately these should get removed anyways in favor of the operator coordinators

			MasterHooks.restoreMasterHooks(
					masterHooks,
					latest.getMasterHookStates(),
					latest.getCheckpointID(),
					allowNonRestoredState,
					LOG);

			if (restoreCoordinators) {
				restoreStateToCoordinators(operatorStates);
			}

			// update metrics

			if (statsTracker != null) {
				long restoreTimestamp = System.currentTimeMillis();
				RestoredCheckpointStats restored = new RestoredCheckpointStats(
					latest.getCheckpointID(),
					latest.getProperties(),
					restoreTimestamp,
					latest.getExternalPointer());

				statsTracker.reportRestoredCheckpoint(restored);
			}

			return true;
		}
	}
```

## Checkpoint机制


text:
# Druber

### Concept for a drone uber service

## Table of Contents

1. [Overview](#overview)
2. [Functionality](#functionality)
	- [Search](#search)
	- [MapView](#mapview)
	- [Bundles](#bundles)
	- [Overview](#overview)
	- [Navigation](#navigation)

## Overview

This is a concept for a uber-like service using drones for passenger transportation implemented in ```UIKit```. The user can summon a drone and after enteing the desired location, choose between different bundles.

Except for the UI and the settings, there is not much functionality here.

## Functionality

### Search

When searching for a destination, the user will be shown the current weather situation.

### Bundles

A bundle can be choosen.

### MapView

After confirming a bundle, the price will be shown on a map.

### Pay with ApplePay

The user will be prompted with a cost overview. The order will be placed when paying.

### Navigation

Not implemented. Shows the current location while in the vehicle.

repository: qnotna/druber-ios

branch_name: refs/heads/main

repo_name: qnotna/druber-ios


text:
---
layout: default
---

# 1994-07-29 - Re: XSplit & N/M alternatives

## Header Data

From<EMAIL_ADDRESS>(Arsen Ray Arachelian)

To<EMAIL_ADDRESS>(Alan Westrope)

Message Hash: 1df1c258e36f2fc8206362156fbe037ff6348759e8f395142d81e3664c2d0ad8

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-07-29 05:53:32 UTC

Raw Date: Thu, 28 Jul 94 22:53:32 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Arsen Ray Arachelian)
Date: Thu, 28 Jul 94 22:53:32 PDT
To<EMAIL_ADDRESS>(Alan Westrope)
Subject: Re: XSplit & N/M alternatives
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

Re: forcing text only...

Welp, you can simply modify the sources for it yourself to do this.

First, check to see if the character you've read is a control.  If it is
leave it alone and don't encrypt it.  Then if it's an alphanumeric character,
take the random number you've just read and do a binary AND operation on it
with a number less than 31.  Say 31 should suffice.

This should do the trick for what you want...

The best solution is to first ZIP up the file you want to XSPLIT, then use
XSPLIT on it, and feed the outputs of XSPLIT to something like UUENCODE...

{% endraw %}
```

## Thread

+ Return to [July 1994](/archive/1994/07)

+ Return to "[Adam Shostack <adam@bwh.harvard.edu>](/authors/adam_shostack_adam_at_bwh_harvard_edu_)"
+ Return to<EMAIL_ADDRESS>(Alan Westrope)](/authors/adwestro_at_ouray_denver_colorado_edu_alan_westrope_)"
+ Return to "[Berzerk <berzerk@xmission.xmission.com>](/authors/berzerk_berzerk_at_xmission_xmission_com_)"
+ Return to<EMAIL_ADDRESS>(Arsen Ray Arachelian)](/authors/rarachel_at_prism_poly_edu_arsen_ray_arachelian_)"

+ 1994-07-27 (Tue, 26 Jul 94 17:09:55 PDT) - [XSPLIT now own ftp.wimsey.bc.ca](/archive/1994/07/166aa49d8ccec611a8b047c48539006da9fb9ccff226746a4e3cf9ff3b0f9990) -<EMAIL_ADDRESS>(Arsen Ray Arachelian)_
  + 1994-07-27 (Tue, 26 Jul 94 19:07:34 PDT) - [Re: XSPLIT now own ftp.wimsey.bc.ca](/archive/1994/07/49c905fbb4d7ed96455a43a067050675d3151ad18048a3a42a835fb148a86270) - _Berzerk<EMAIL_ADDRESS>    + 1994-07-27 (Tue, 26 Jul 94 20:11:25 PDT) - [XSplit & N/M alternatives](/archive/1994/07/ce35e9e8246b5e564a90a66544fb51276cb5ecaf8770707b3d4a55e971eb2ac6) - _Adam Shostack<EMAIL_ADDRESS>      + 1994-07-27 (Wed, 27 Jul 94 06:03:22 PDT) - [Re: XSplit & N/M alternatives](/archive/1994/07/24ec27143fba78e7beb35bb32ac1b7d59223ec0ebedf73ede73204679cd8bba4) -<EMAIL_ADDRESS>(Arsen Ray Arachelian)_
        + 1994-07-27 (Wed, 27 Jul 94 08:24:55 PDT) - [Re: XSplit & N/M alternatives](/archive/1994/07/691e5cc6d618202a6690bc60387b962d33ad86090da22d11b4a9b758384a6dd5) -<EMAIL_ADDRESS>(Alan Westrope)_
          + 1994-07-29 (Thu, 28 Jul 94 22:53:32 PDT) - Re: XSplit & N/M alternatives -<EMAIL_ADDRESS>(Arsen Ray Arachelian)_
    + 1994-07-27 (Wed, 27 Jul 94 05:59:17 PDT) - [Re: XSPLIT now own ftp.wimsey.bc.ca](/archive/1994/07/e12fad9e81cc68a18fff20d4d442853fdda175b04540bd3aa9c5c8c8a9b8c2ae) -<EMAIL_ADDRESS>(Arsen Ray Arachelian)_


text:
# Cap-EC2 changelog

## 0.0.9

* Handle no configured regions, (or specifically nil).

## 0.0.8

* Made `config/ec2.yml` optional, set all options by Capistrano variable. [@rjocoleman](https://github.com/rjocoleman)
* Remove requirement for default region to be set. [@rjocoleman](https://github.com/rjocoleman)

## 0.0.7

* Removed monkey patching of `Capistrano::TaskEnhancements` [@rjocoleman](https://github.com/rjocoleman)
* Instances don't always have a name tag, would cause `ec2:status` to blow up [@rjocoleman](https://github.com/rjocoleman)

## 0.0.6

* Unbreak listing instances

## 0.0.5

* Don't return terminated instances when looking up instances from EC2
* Fix documentation to refer to correct tag for Stages [@shaneog](https://github.com/shaneog)

## 0.0.4

* If you modified any of the tag names, the `ec2:status` table would blow up
* Fixed a bug with stages

## 0.0.3

* Rename the default tag name used for determining to 'Stages' from 'Stage'

## 0.0.2

* Allow servers to be in multiple stages

## 0.0.1

* Initial release


text:
# נְכֹחָה

<!-- Status: S2="NeedsEdits" -->
<!-- Lexica used for edits:   -->

## Word data

* Strongs: H5229

* TWOT: 1365a

* BDB Reference: [נְכֹחָה](rc://en/bdb/dict/n.dl.ac)

* BDB Root: [נכח](rc://en/bdb/dict/n.dl.aa)

* Alternate spellings:

* Principal Parts:

* Part of Speech:

Adjective

* Instances in Scripture: TBS

## Etymology:

* Related Language glosses:

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses

### Sense 1.0:

#### Definition:

#### Glosses:

straight; right; straightness;

#### Explanation:

#### Citations:

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
Accelerate TypeLits
===================

[![Build Status](https://travis-ci.org/epsilonhalbe/accelerate-typelits.svg?branch=master)](https://travis-ci.org/epsilonhalbe/accelerate-typelits)
Synopsis
--------

This library provides a high level interface to `accelerate` for matrix
computations.

Installation
------------

The simplest way to install this library is using `cabal` or `cabal-sandbox`

```
> cabal install accelerate-typelits
```

If you want to have the most recent version, the project is on github so you can
checkout the project.

```
> git clone https://github.com/epsilonhalbe/accelerate-typelits.git
> cd accelerate-typelits
> cabal install
```

---

```
> git clone https://github.com/epsilonhalbe/accelerate-typelits.git
> cd accelerate-typelits
> cabal sandbox init
> cabal install
```

There is also a `stack.yaml` file included, so one can also use [stack][1] in
order to compile this library.

```
> git clone https://github.com/epsilonhalbe/accelerate-typelits.git
> cd accelerate-typelits
> stack --stack-yaml stack-7.10.yaml build
```

---

The operators have been designed to give a visual hint of the respective
parameters.

- `#` for matrices
- `^` for vectors
- `.` for scalars

So for example `#*^` represents the multiplication of a matrix with a vector,
analogously `^*#` works the other way around. Other examples would be `#*#` for
matrix-matrix multiplication and `.*^` scalar multiplication of a vector.

Operator precedence is usually the same as the numeric equivalence.

Credits
-------

The matrix-vector and matrix-matrix products have been inspired by Henning
Thielemann's [`accelerate-arithmetic`][2] library

[1]: https://haskellstack.com
[2]: https://hackage.haskell.org/package/accelerate-arithmetic

license: ISC

repository: epsilonhalbe/accelerate-typelits

gha_language: Haskell

gha_license_id: ISC

repo_name: epsilonhalbe/accelerate-typelits


text:
---
layout: default
---

Welcome! If you are a programmer in Python and want to learn about more advanced concepts that will make you a better programmer, then Welcome!

This website is intended for people who have a basic knowledge in Python and want to further their knowledge on Python constructs.

Here are the list of topics covered:

1. PEP-8 Coding Guide
2. [Generators](./concepts/generators.html)
3. Decorators
 - Overview
 - ClassMethod
 - StaticMethod
 - Property
 - Meta decorators
4. Asynchronous Functions
5. Dunder methods


text:
---
layout: post
title: 795. Number of Subarrays with Bounded Maximum
subtitle:
author: Bin Li
tags: [Coding]
image:
comments: true
published: true
---

## Description
We are given an array A of positive integers, and two positive integers L and R (L <= R).

Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least L and at most R.

```python
Example :
Input:
A = [2, 1, 4, 3]
L = 2
R = 3
Output: 3

Explanation: There are three subarrays that meet the requirements: [2], [2, 1], [3].
```
Note:
```
L, R  and A[i] will be an integer in the range [0, 10^9].
The length of A will be in the range of [1, 50000].
```

## Solutions
　　这个解法没看懂……：
```python
class Solution(object):
    def numSubarrayBoundedMax(self, A, L, R):
        """
        :type A: List[int]
        :type L: int
        :type R: int
        :rtype: int
        """
        res = 0
        left = right = -1
        for i in range(len(A)):
            if A[i] >= L:
                right = i
            if A[i] > R:
                left = i
            res += (right - left)
        return res
# Runtime: 304 ms, faster than 81.41% of Python online submissions for Number of Subarrays with Bounded Maximum.
# Memory Usage: 14.1 MB, less than 45.45% of Python online submissions for Number of Subarrays with Bounded Maximum.
```

动规似乎好懂一些：

```python
class Solution(object):
    def numSubarrayBoundedMax(self, A, L, R):
        """
        :type A: List[int]
        :type L: int
        :type R: int
        :rtype: int
        """
        res, dp = 0, 0
        prev = -1
        for i in range(len(A)):
            if A[i] < L:
                res += dp
            if A[i] > R:
                dp = 0
                prev = i
            if L <= A[i] <= R:
                dp = i - prev
                res += dp
        return res
# Runtime: 304 ms, faster than 81.41% of Python online submissions for Number of Subarrays with Bounded Maximum.
# Memory Usage: 14.4 MB, less than 18.18% of Python online submissions for Number of Subarrays with Bounded Maximum.
```
## References
1. [795. Number of Subarrays with Bounded Maximum](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/)


text:
---
title: 2019.04.11
type: docs
---
# 2019-04-11

# Volunteers wanted

- seeking help on resolving ["[firefox] error: relocation refers to local symbol "" [12], which is defined in a discarded section"](https://github.com/rust-lang/rust/issues/59652)

- seeking help on resolving ["Compiler panic with generic-typed nested closures"](https://github.com/rust-lang/rust/issues/59494)

# Backport decisions

- No backport decisions were made at this meeting because there were no PRs nominated for backport.

# Working group sync

## [wg-mir-opt](../../../working-groups/mir-opt/)

- The current goal is to make the MIR `Place` data structure non-recursive ([Issue #52708](https://github.com/rust-lang/rust/issues/52708)).
This should use less memory, be easier to work with, and probably faster as well.

- After that is completed, there are a number of other `Place` related refactorings and other ideas from the All-Hands meeting that can be worked on.

- [Link to full discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/weekly.20meeting.202019-04-11.20.2354818/near/163105192)

## [wg-pipelining](../../../working-groups/pipelining/)

- The goal is to allow Cargo to invoke rustc sooner letting downstream crates start compiling while upstream crates do LLVM work ([Issue #58465](https://github.com/rust-lang/rust/issues/58465))

- This working group is just getting started and had its initial meeting on 4/5.

- [Link to full discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/weekly.20meeting.202019-04-11.20.2354818/near/163106257)

repository: rust-lang/compiler-team

repo_name: rust-lang/compiler-team


text:
Configuration Notices for Bolt
==============================

Friendly helpers for your Bolt installation. This extension comes bundled with
the packaged distribution version of Bolt (commonly known as "The `tar` or `zip`
version"). This extension provides helpful tips to prevent common pitfalls, in a
range of different situations.

To install this extension in your custom bootstrapped version of Bolt, run the
following in the root folder with your main `composer.json`:

```
composer require bolt/configuration-notices
```

![7e22d8c8-bbdd-11e6-9668-48a1ec86ba04](https://cloud.githubusercontent.com/assets/1833361/21287029/3f4d8cf4-c463-11e6-8cd1-69583e7fa2ba.png)

You can influence a few of the checks through the configuration. How meta!

```yaml
debug_local_domains: [ '.localhost' ]

configuration_notices:
    log_threshold: 1000
```

 - `local_domains` can be set to contain (parts of) domain names, and is used
   in the check to determine if the current installation is considered to be
   "local" or "production".
 - `log_threshold` is used to determine what is considered 'a lot of rows' in
   the checks for the Change log and System log, to give a suggestion to trim
   the database tables.


text:
# "Search files for Front-End"

This plugin adds a few functions for searching files used in Front-End web development.

To use it, add `sfffe` to the plugins array in your zshrc file:
```zsh
plugins=(... sfffe)
```

**Requires:** `ack`

## Functions

- `ajs`: look for string in `.js` files.
- `acss`: look for string in `.css` files.
- `fjs`: search for `.js` files under the current working directory.
- `fcss`: search for `.css` files under the current working directory.

repository: ohmyzsh/ohmyzsh

gha_language: Shell

repo_name: ohmyzsh/ohmyzsh


text:
---
layout: post
title:  "David Bowie currency"
author: seif
categories: []
image: assets/images/posts/2.jpg
featured: false
---

On currency notes, we used to see politicians, military leaders, queens and kings such as George Washington, Mustafa Kemal Ataturk, Al-Khomeini, Mao-zedong and David Bowie. Yes David Bowie. [The oddity](https://www.youtube.com/watch?v=9_M3uw29U1U) of such a thing led me to dig into this currency.

David Jones, spent his years in the southwest of London, district of Brixton which is known by its social instability, violent riots and [rebel](https://www.youtube.com/watch?v=U16Xg_rQZkA) positions.
Today the community is rapidly renovating and improving and the [Brixton Pound](http://brixtonpound.org/) is one of its more interesting socioeconomic experiments.

The Birxton pound is a local-alternative currency. The most important purpose of this designed currency is to boost local economy by incentivising people to spend money within their local community and businesses and to tackle their local challenges.

The essor of alternative currencies started following  the 2008 Recession to respond to the existing financial system which is not founded on the basis of circular economy and sustainability. That’s why initiatives [outside](https://www.youtube.com/watch?v=k43Ssf9BJMw) the system are born to :
+  Increase economic stability.
+ Encourage localisation of trade and relationships.
+ Enhance the use of under-used resources.
+ Recognise the informal economy

### Let me give you an illustrative and concrete example

*If a person spend local currency at a local shop, the owner of this shop can buy supplies from another local business. The other business can buy vegetables from a local farmer. And the farmer can pay an engineer to renvoate and develop his activity. And the chain goes forward circulating locally to benefit local independent business areas.*

*If the person had spent his currency at a supermarket chain instead, their money would have left the area almost immediately for shareholders who are not related directly to the local community. Therefore, the use of a local currency increases cash flow between businesses that use the currency and stimulates local economic development. In fact, internal exchange through the use of complementary currencies is a resilient strategy which reduces the risk as well as the drawbacks of national economic crises.*

To sum up, let’s create more of David Bowie currency and less of Mao Zedong and George Washington currencies.

gha_language: JavaScript


text:
##Overview
This iOS sample application demonstrates the use of OAuth2 access token retrieving, using and storing with the Apigee SDK.

##Running the App
In order to compile and run this application, you must first add ApigeeiOSSDK.framework to this application.

Also, please configure the ORG_ID, APP_ID, as well as other values as appropriate in Constants.m.

Also, please see the related documentation located at http://apigee.com/docs/api-services/content/understanding-default-oauth-20-configuration to configure your Apigee OAuth2 api proxy.

repository: developerdave/apigee-ios-sdk

gha_language: Objective-C

repo_name: developerdave/apigee-ios-sdk


text:
### Milestone Title [TITLE OF THE MILESTONE]
### Leader
[NAME: TITLE]
### Date(s)
01/01/1970
### Category
- [ ] Infrastructure
- [ ] Protocol/Blockchain Dev
- [ ] App Solutions
- [ ] Quality Assurance
### Contract
- [ ] This process follows the Milestone Framework as discussed in the Pocket Network Corporation's `Organization Handbook`
- [ ] This process `DOES NOT` follow the Milestone Framework as discussed in the Pocket Network Corporation's `Organization Handbook`

If `DOES NOT` follow the Handbook's Milestone Framework, please describe in detail why below:
## Original Proposal
[Link to Original Proposal Documentation]
### Detailed Summary of Proposal
[Summarize the proposal in fine detail]
### Milestone Goals
- Goal 1
- Goal 2
### Proposal Estimated Timeline
[X Units of Time]
### How to test functionality?
[Detailed description on how to test the milestone]
## Rank Vote
[Link to Rank Vote Documentation]
### Contract
- [ ] This Milestone `IS` signaled priority by the Rank Vote system
- [ ] This Milestone `IS NOT` signaled priority by PNI's Rank Vote system

If `IS NOT` signaled priority by PNI's Rank Vote system, describe in detail why this milestone is being executed:
[Details of why the milestone is being executed against the signaling of the Rank Vote]
## Milestone
### Plan
#### Estimated Timeline
[X Units of Time]

- [ ] Timeline is `THE SAME` as the Original Proposal Estimated Timeline
- [ ] Timeline is `NOT THE SAME` as the Original Proposal Estimated Timeline

If is `NOT THE SAME` as the Original Proposal Estimated Timeline, please describe in detail the change in timeline below:
[Detailed Description of Timeline Change]
#### Projects
**List**

- Project 1
- Project 2
- Project 3

##### [PROJECT 1 TITLE]
**Summary**

[DETAILED SUMMARY OF PROJECT]

**Leader**

[NAME:TITLE]

**Project Plan Documentation**

[LINK TO PROJECT DOCS]

**Project Notes**

[Any notes on project 1]

##### [PROJECT 2 TITLE]
**Summary**

[DETAILED SUMMARY OF PROJECT]

**Leader**

[NAME:TITLE]

**Project Plan Documentation**

[LINK TO PROJECT DOCS]

**Project Notes**

[Any notes on project 1]

### Finalize
#### Detailed Changelog
[LINK TO CHANGELOG TEMPLATE]

#### Contributors List
- Contributor 1
    - Contribution Details
    - Link to Documentation
- Contributor 2
      - Contribution Details
      - Link to Documentation

#### Auxillary Documentation
[Links if applicable]

#### QA Documentation

**QA Strategy Document**

[Outlines The Original Strategy Project Level Integration Assurance]

**QA Execution Document**

[Outlines Project Level Integration Assurance]

- [ ] The QA execution `DOES` follow the original QA Strategy document
- [ ] The QA execution `DOES NOT` follow the original QA Strategy document

If QA execution `DOES NOT` follow the original QA Strategy document, please explain why in fine detail:

[Explain the QA change in fine detail]

**QA Contract**

- [ ] The QA completed for this Milestone `DOES` ensure delivery of the Milestone purpose

**Justification Statement**

[Provide a detailed statement of satisfaction of the QA Organization Level QA requirements]

#### Certification Documentation
[Link to Certification Documentation]

#### Communication Announcement
[Link to Required Comms]

#### Delivery Date
01/01/1970
### General Notes
[Any notes]
### Editorial Notes
[Opinion piece]
### External Links
[If Applicable]

repository: jacklaing/organization

repo_name: jacklaing/organization


text:
[toc]

**Notes on Godel, Escher, Bach**

# meta

- *strange loop* = paradox - self-referential
- zen enlightenment
  - goal: transcend **dualism** = division into concepts (perception, words do this)
  - words give you some truth but always fail to describe some parts of the truth

# music

- **canons** - repeat w/ subtle changes (e.g. pitch shift)
- **fugue** - repeat w/ more substantial changes

# ai

- essential abilities - **can we do these things unsupervised?**
  - to recognize the relative importance of different elements of a situation
  - to find similarities between situations despite differences which may separate them;
  - to draw distinctions between situations despite similarities which may link them
  - to synthesize new concepts by taking old concepts and putting them together in new ways
- intelligence consists of rules at different levels
  - "just plain" rules - like reflexes which respond to stereotyped situations
  - metarules - when situations are mixtures of steretoyped situations, requires rules for deciding which "just plain" rules to apply
  - rules for inventing new rules - when situations can't be classified
    - rules may have to change themselves
- messages - comparison of DNA to a jukebox
  - where is info stored? records? buttons? smashed buttons?
  - what could constitute a Rosetta stone for DNA codes?
  - 3 parts
    - frame - tells you that this is a message
    - outer - tells you how to read a message (e.g. language, style)
    - inner - actual content
  - if decoding is universal, we might call the outer message (e.g. the trigger) the message
- memory - same bits can be used for different things - part of each message specifies the instruction type

# math / logic

- **decision procedure** - decides whether something is a theorem - must terminate
- we can think of theorems as strings in a formal system
- **interpretation** - correspondence between symbols and words
  - ideally, these are meaningful isomorphisms between codes and reality
  - not all interpretations imply meaningful (or valid) corresponding codes
  - there might be multiple, equally valid interpretations
  - consistency depends on interpretation:
  - **consistency** - when every theorem, upon interpretation, comes out true (in some imaginable world)
  - **completeness** - when all statements which are true (in some imageinable world), and which can be expressed as well-formed strings of the system, are theorems
- slightly different axioms lead to elliptical/hyperbolic geometry instead of Euclidean geometry
- godel numbering - can replace all symbols w/ numbers and all typographic rules w/ arithmetic rules


text:
# Microsoft Azure IoT SDK for Node.js modules-preview branch for Microsoft Edge modules.

This branch of the Azure IoT SDK for Node.js contains code to use the Mqtt protocol to act as a Microsoft Azure IoT Edge module and talk to a Microsoft Azure IoT Edge hub instance.

## Important note
This code is not currently published on NPM.  In order to use these modules, you need to use the versions in this branch.  Instructions for working with this code outside of the NPM repository can be found [here](./doc/node-devbox-setup.md)

## Current functionality.

### Recent updates:
* It is no longer to extract the connection string from an existing module.
* It is now possible to run and debug your module code inside of a docker container.
* You no longer need to edit mqtt_base.ts to change the value of `reject_unauthorized`
* Module methods are supported

### Module inputs

A module can receive inputs by registering for the inputMessage event.

```
client.on('inputMessage', function(inputName, msg) {
  // inputName is a string that contains the name of the input, and msg is a Message object
});
```

### Module outputs

A module can send a Message to an output by using the sendOutputEvent function

```
client.sendOutputEvent(outputName, msg);
// outputName is a string that contains the name of the output and msg is a Message object.
```

### Module twin

A module can act as a twin using the existing twin API.  The only difference between a device twin and a module twin is the connection string used to connect.

### Module methods

A module can also support methods using the existing method API.

## Sample Code.

Some sample code can be found in the [device/samples](./device/samples/) directory:
* simple_sample_module.js has an example of on('inputMessage') and sendOutputEvent functionality.
* simple_sample_module_twin.js has an example of module twin functionality.
* simple_sample_module_method.js has an example of module method functionality.

[tutorial-simulate-device-windows]: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-simulate-device-windows
[tutorial-simulate-device-linux]: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-simulate-device-linux
[deploy-a-module]: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-simulate-device-linux#deploy-a-module

repository: Azure/azure-iot-sdk-node

gha_license_id: NOASSERTION

repo_name: Azure/azure-iot-sdk-node


text:
# CoolSchool

> This project is a comand line program to test your ability on math subjects.
> It uses probability notions such as [distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) to choose questions according to the propabilities given by the user.

## Prerequisites

>  **Python 3.6** and **Pip3**
## Dev Usage
### Execute script
Execute the corresponding script.
The script will make sure that you download the required librairies if they are not already installed.

> ### Linux and Mac Os
```console
foo@bar:~$ ./CoolSchool_linux.sh
```

> ### Windows

```
C:\CoolSchool> CoolSchool_win.bat
```

### Create an executable

> From Windows, Linux, MacOSX
```console
foo@bar:~$  pyinstaller CoolSchool.py
```

## Math Subjects
Find below the supported mathematics themes with examples.

### Second degree equation

> Solve :

![equation](https://latex.codecogs.com/gif.latex?%24%24%20f%28x%29%20%3D%20ax%5E2%20+%20bx%20+%20x%20%24%24%20%24%24%20f%28x%29%20%3D%200%20%24%24)

### Integral: Power functions

> Solve :

![equation](https://latex.codecogs.com/gif.latex?%24%24%20%5Cint_a%5Eb%20%28cx%20-%20d%29%5E%5Calpha%20dx.%20%24%24%20%24%24%20%5Cint_a%5Eb%20%5Cfrac%7B1%7D%7B%28x-c%29%7D%20dx.%20%24%24)

### Integral: trigonometric functions

> Solve :

![equation](https://latex.codecogs.com/gif.latex?%24%24%20%5Cint_a%5Eb%20cos%28cx%29%20dx.%20%24%24%20%24%24%20%5Cint_a%5Eb%20sin%28cx%29%20dx.%20%24%24%20%24%24%20%5Cint_a%5Eb%20tan%28cx%29%20dx.%20%24%24)

### Integral: logarithmic functions

> Solve :

![equation](https://latex.codecogs.com/gif.latex?%24%24%20%5Cint_a%5Eb%20ln%28cx%29%20dx.%20%24%24)

_____________

Authors
:  [Geoffrey Delval](https://github.com/GeoffreyDlvl)
:  [Antoine Escobar](https://github.com/SpaceAzur)
:  [Remi Guijarro Espinosa](https://github.com/Remi-Guijarro)

repository: Remi-Guijarro/CoolSchool

repo_name: Remi-Guijarro/CoolSchool


text:
Here are some things that might not work. You can also check our [issues](https://github.com/evandisoft/RedOnion/issues) page on github.

## Script Won't work:
Make sure that if you are trying to execute Lua code, the Lua engine is selected. Click the "Lua" button to select that engine.
If you are trying to execute ROS code, ensure RedOnionScript engine is selected. Click the "ROS" button to select that engine.

The Repl will use whatever engine is currently selected. The currently selected engine is shown by a label `Engine: EngineName` above the `ROS` and `Lua` buttons.

The editor will run the engine associated with a particular script name extension. If your script ends with ".lua" it will run the Lua engine, and if your script ends with ".ros" it will run the ros engine.

## How do I run a script?
Click the `Run` button when a script is in the editor, or enter some code into the repl input area.

## Example programs don't run
We bundle our example programs in Scripts.zip and they are only used if you do not also have a program of the same name in the Scripts folder. If you modify any of the example programs and save them, you will not overwrite a bundled file in Scripts.zip, but will create a new file of the same name in the Scripts folder.

So, if you modified any of the exaple files, you won't see the newer versions when you update to a new version of RedOnion. Just delete any scripts in the Scripts folder that are also found in Scripts.zip.

## For anything else
Make an issue [here on github](https://github.com/evandisoft/RedOnion/issues), or ask in [this thread](https://forum.kerbalspaceprogram.com/index.php?/topic/189983-18x-redonion-unrestricted-in-game-scripting-v-040/)

repository: evandisoft/RedOnion

gha_language: C#

repo_name: evandisoft/RedOnion


text:
---
layout: default
---

# 1996-01-24 - Re: Who would sign Lucky Green's key?

## Header Data

From: Kevin L Prigge<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Lucky Green)

Message Hash: f5c4add177a6e372990d6642fe1bdc64e46b9c0d7f912e38d0611ce447c02507

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-01-24 18:20:21 UTC

Raw Date: Thu, 25 Jan 1996 02:20:21 +0800

## Raw message

```
{% raw  %}From: Kevin L Prigge<EMAIL_ADDRESS>Date: Thu, 25 Jan 1996 02:20:21 +0800
To<EMAIL_ADDRESS>(Lucky Green)
Subject: Re: Who would sign Lucky Green's key?
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: application/pgp

PGP message

{% endraw %}
```

## Thread

+ Return to [January 1996](/archive/1996/01)

+ Return to "[Kevin L Prigge <Kevin.L.Prigge-2@cis.umn.edu>](/authors/kevin_l_prigge_kevin_l_prigge2_at_cis_umn_edu_)"
+ Return to<EMAIL_ADDRESS>(Lucky Green)](/authors/shamrock_at_netcom_com_lucky_green_)"

+ 1996-01-24 (Wed, 24 Jan 1996 15:54:03 +0800) - [Who would sign Lucky Green's key?](/archive/1996/01/650fa8506c384eba947d108301bc63aa625158b5845791ef621c31b059ecfdc6) -<EMAIL_ADDRESS>(Lucky Green)_
  + 1996-01-24 (Thu, 25 Jan 1996 02:20:21 +0800) - Re: Who would sign Lucky Green's key? - _Kevin L Prigge<EMAIL_ADDRESS>


text:
# Speech to text - Virtual IoT device

In this part of the lesson, you will write code to convert speech captured from your microphone to text using the speech service.

## Convert speech to text

On Windows, Linux, and macOS, the speech services Python SDK can be used to listen to your microphone and convert any speech that is detected to text. It will listen continuously, detecting the audio levels and sending the speech for conversion to text when the audio level drops, such as at the end of a block of speech.

### Task - convert speech to text

1. Create a new Python app on your computer in a folder called `smart-timer` with a single file called `app.py` and a Python virtual environment.

1. Install the Pip package for the speech services. Make sure you are installing this from a terminal with the virtual environment activated.

    ```sh
    pip install azure-cognitiveservices-speech
    ```

    > ⚠ If you get the following error:
    >
    > ```output
    > ERROR: Could not find a version that satisfies the requirement azure-cognitiveservices-speech (from versions: none)
    > ERROR: No matching distribution found for azure-cognitiveservices-speech
    > ```
    >
    > You will need to update Pip. Do this with the following command, then try to install the package again
    >
    > ```sh
    > pip install --upgrade pip
    > ```

1. Add the following imports to the `app.py` file:

    ```python
    import requests
    import time
    from azure.cognitiveservices.speech import SpeechConfig, SpeechRecognizer
    ```

    This imports some classes used to recognize speech.

1. Add the following code to declare some configuration:

    ```python
    speech_api_key = '<key>'
    location = '<location>'
    language = '<language>'

    recognizer_config = SpeechConfig(subscription=speech_api_key,
                                     region=location,
                                     speech_recognition_language=language)
    ```

    Replace `<key>` with the API key for your speech service. Replace `<location>` with the location you used when you created the speech service resource.

    Replace `<language>` with the locale name for language you will be speaking in, for example `en-GB` for English, or `zn-HK` for Cantonese. You can find a list of the supported languages and their locale names in the [Language and voice support documentation on Microsoft docs](https://docs.microsoft.com/azure/cognitive-services/speech-service/language-support?WT.mc_id=academic-17441-jabenn#speech-to-text).

    This configuration is then used to create a `SpeechConfig` object that will be used to configure the speech services.

1. Add the following code to create a speech recognizer:

    ```python
    recognizer = SpeechRecognizer(speech_config=recognizer_config)
    ```

1. The speech recognizer runs on a background thread, listening for audio and converting any speech in it to text. You can get the text using a callback function - a function you define and pass to the recognizer. Every time speech is detected, the callback is called. Add the following code to define a callback, and pass this callback to the recognizer, as well as defining a function to process the text, writing it to the consoled:

    ```python
    def process_text(text):
        print(text)

    def recognized(args):
        process_text(args.result.text)

    recognizer.recognized.connect(recognized)
    ```

1. The recognizer only starts listening when you explicitly start it. Add the following code to start the recognition. This runs in the background, so your application will also need an infinite loop that sleeps to keep the application running.

    ```python
    recognizer.start_continuous_recognition()

    while True:
        time.sleep(1)
    ```

1. Run this app. Speak into your microphone and the audio converted to text will be output to the console.

    ```output
    (.venv) ➜  smart-timer python3 app.py
    Hello world.
    Welcome to IoT for beginners.
    ```

    Try different types of sentences, along with sentences where words sound the same but have different meanings. For example, if you are speaking in English, say 'I want to buy two bananas and an apple too', and notice how it will use the correct to, two and too based on the context of the word, not just it's sound.

> 💁 You can find this code in the [code-speech-to-text/virtual-iot-device](code-speech-to-text/virtual-iot-device) folder.

😀 Your speech to text program was a success!

repository: ChungZH/IoT-For-Beginners

repo_name: ChungZH/IoT-For-Beginners


text:
# kube-universe

![kube universe logo](images/logo_small.png)

---

![demo](images/demo.png)

## Overview

Kube-Universe renders a Kubernetes cluster into a dynamic 3D graph. An example landscape visualization can be found [here](images/universe.png).

A __Live Demo Version__ is available [here](https://afritzler.github.io/kube-universe/web/demo/)

## Features

* 3D cluster overview
* Identify pods with errors

## Installation and Usage

Before you start you need to install `statik` to vendor the web content into executable

```bash
go get -u github.com/rakyll/statik
```

Get the `kube-universe` binary

```bash
go get github.com/afritzler/kube-universe
```

Start `kube-universe` locally

```bash
kube-universe serve --kubeconfig=PATH_TO_MY_KUBECONFIG
```

or just

```bash
kube-universe serve
```

if you are using minikube or have the `KUBECONFIG` environment variable pointing to a corresponding cluster.

The web UI can be accessed via http://localhost:3000 and the rendered graph under http://localhost:3000/graph.
With the `--port` flag you can also specify under which port the kube universe server should be exposed (default is 3000).

## Development

To build and run `kube-universe` from source

```bash
git clone https://github.com/afritzler/kube-universe $GOPATH/src/github.com/afritzler/kube-universe
cd $GOPATH/src/github.com/afritzler/kube-universe
go run *.go serve --kubeconfig=PATH_TO_MY_KUBECONFIG
```

or to build and run it using the executable

```bash
make
./kube-universe serve --kubeconfig=PATH_TO_MY_KUBECONFIG
```

To build the Docker image

```bash
cd $GOPATH/src/github.com/afritzler/kube-universe
make docker-build
```

## Acknowledgements

Kube universe is using [3d-force-graph](https://github.com/vasturiano/3d-force-graph) for rendering.

repository: afritzler/kube-universe

gha_language: Go

repo_name: afritzler/kube-universe


text:
# Cl [![Build Status](https://travis-ci.org/svenfuchs/cl.svg?branch=master)](https://travis-ci.org/svenfuchs/cl) [![Code Climate](https://api.codeclimate.com/v1/badges/870e448eb8162d3e1ed7/maintainability)](https://codeclimate.com/github/svenfuchs/cl) [![Code Coverage](https://coveralls.io/repos/github/svenfuchs/cl/badge.svg?branch=master)](https://coveralls.io/github/svenfuchs/cl?branch=master) [![Gem Version](https://img.shields.io/gem/v/cl?cache=2019-08-10)](http://rubygems.org/gems/cl) [![Rubydocs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/svenfuchs/cl)

OptionParser based CLI support for rapid CLI development in an object-oriented
context.

This library wraps Ruby's OptionParser for parsing your options under the hood,
so you get all the goodness that the Ruby standard library provides.

On top of that it adds a rich and powerful DSL for defining, validating, and
normalizing options, as well as automatic and gorgeous help output (modeled
after `gem --help`).

Further documentation is available on [rubydoc.info](https://www.rubydoc.info/github/svenfuchs/cl)

Examples in this README are included from [examples/readme](https://github.com/svenfuchs/cl/tree/master/examples/readme).
More examples can be found in [examples](https://github.com/svenfuchs/cl/tree/master/examples).
All examples are guaranteed to be up to date by the way of being [verified](https://github.com/svenfuchs/cl/blob/master/.travis.yml#L14)
on CI.

## Table of Contents

* [Basic Usage](#basic-usage)
* [Command Registry](#command-registry)
* [Runners](#runners)
* [Command DSL](#command-dsl)
  * [Commands](#commands)
    * [Description, Summary, Examples](#description-summary-examples)
    * [Abstract](#abstract)
  * [Arguments](#arguments)
    * [Types](#types)
    * [Splat](#splat)
  * [Options](#options)
    * [Aliases](#aliases)
    * [Defaults](#defaults)
    * [Deprecations](#deprecations)
    * [Downcase](#downcase)
    * [Enum](#enum)
    * [Example](#example)
    * [Format](#format)
    * [Internal](#internal)
    * [Min and Max](#min-and-max)
    * [Negations](#negations)
    * [Note](#note)
    * [Secret](#secret)
    * [See Also](#see-also)
    * [Types](#types)
    * [Required Options](#required-options)
* [Config Files](#config-files)
* [Environment Variables](#environment-variables)

## Basic Usage

```ruby
<%= example('readme/basic') %>
```

### Command Registry

Commands are Ruby classes that extend the class `Cl::Cmd`.

They register to a [Ruby class registry](https://github.com/svenfuchs/registry) in order
to decouple looking up command classes from their Ruby namespace.

For example:

```ruby
<%= example('readme/registry') %>
```

Commands can be registered like so:

```ruby
module One
  class Cmd < Cl::Cmd
    register :'cmd:one'
  end
end
```

By default commands auto register themselves with the underscored name of the
last part of their class name (as seen in the example above). It is possible to
turn this off using:

```ruby
Cl::Cmd.auto_register = false
```

Command auto-registration can cause name clashes when namespaced commands have
the same demodulized class name. For example:

```ruby
class Git < Cl::Cmd
  # auto-registers as :git
end

module Heroku
  class Git < Cl::Cmd
    # also auto-registers as :git
  end
end
```

It is recommended to turn auto-registration off when using such module
structures.

### Runners

Runners lookup the command to execute from the registry, by checking the
arguments given by the user for registered command keys.

With the two command classes `One` and `Two` from the example above (and
assuming that the executable that calls `Cl` is `bin/run`) the default runner
would recognize and run the following commands:

```
$ bin/run one something else
# instantiates One, passing the args array `["something", "else"]`, and calls the instance method `run`

$ bin/run two
# instantiates Two, passing an empty args arry `[]`, and calls the instance method `run`
```

The default runner also supports nested namespaces, and checks for command classes
with keys separated by colons. For instance:

```ruby
<%= example('readme/runner') %>
```

Runners are registered on the module `Cl::Runner`. It is possible to register custom
runners, and use them by passing the option `runner` to `Cl.new`:

```ruby
<%= example('readme/runner') %>
```

See `Cl::Runner::Default` for more details.

There also is an experimental runner `:multi`, which supports rake-style
execution of multiple commands at once, like so:

```
bin/rake db:drop production -f db:create db:migrate production -v 1
```

See the example [rakeish](blob/master/examples/rakeish) for more details.

## Command DSL

The DSL is defined on the class body.

### Commands

Commands are classes that are derived from the base class `Cl::Cmd`.

#### Description, Summary, Examples

The description, summary, and examples are used in the help output.

```ruby
<%= example('readme/description') %>
```

#### Abstract

Command base classes can be declared abstract in order to prevent them from
being identified as a runnable command and to  omit them from help output.

This is only relevant if a command base class is registered. See [Command
Registry](#command-registry) for details.

```ruby
<%= example('readme/abstract') %>
```

### Arguments

Arguments can be declared like so:

```ruby
arg :arg_name, description: 'arg description', type: :[array|string|integer|float|boolean]
```

This will define an `attr_accessor` on the `Cmd` class. I.e. in the following
example the method `ownsers` will be available on the `Cmd` instance:

```ruby
<%= example('readme/arg') %>
```

#### Types

Arguments can have a type. Known types are: `:array`, `:string`, `:integer`,
`:float`, `:boolean`.

The type `:array` makes sure the argument accessible on the `Cmd` instance is a
Ruby Array. (This currently only supports arrays of strings).

If the option `sep` is given on the argument, then the argument value is split
using this separator.

```ruby
<%= example('readme/arg_array') %>
```

Other types cast the given argument to the expected Ruby type.

```ruby
<%= example('readme/arg_type') %>
```

#### Splat

Array arguments support splats, modeled after Ruby argument splats.

For example:

```ruby
<%= example('readme/args_splat') %>
```

### Options

Declaring options can be done by calling the method `opt` on the class body.

This will add the option, if given by the user, to the hash `opts` on the `Cmd` instance.
It also defines a reader method that returns the respective value from the `opts` hash,
and a predicate that will be true if the option has been given.

For example:

```ruby
<%= example('readme/opts') %>
```

Options optionally accept a block in case custom normalization is needed.

Depending on the block's arity the following arguments are passed to the block:
option value, option name, option type, collection of all options defined on
the command.

```ruby
<%= example('readme/opts_block') %>
```

#### Aliases

Options can have one or many alias names, given as a Symbol or Array of Symbols:

```ruby
<%= example('readme/alias') %>
```

#### Defaults

Options can have a default value.

I.e. this value is going to be used if the user does not provide the option:

```ruby
<%= example('readme/default') %>
```

#### Deprecations

Options, and option alias name can be deprecated.

For a deprecated option:

```ruby
<%= example('readme/deprecated') %>
```

For a deprecated option alias name:

```ruby
<%= example('readme/deprecated_alias') %>
```

#### Downcase

Options can be declared to be downcased.

For example:

```ruby
<%= example('readme/downcase') %>
```

#### Enum

Options can be enums (i.e. have known values).

If an unknown values is given by the user the parser will reject the option,
and print the help output for this command.

For example:

```ruby
<%= example('readme/enum') %>
```

#### Example

Options can have examples that will be printed in the help output.

```ruby
<%= example('readme/example') %>
```

#### Format

Options can have a required format.

If a value is given by the user that does not match the format then the parser
will reject the option, and print the help output for this command.

For example:

```ruby
<%= example('readme/format') %>
```

#### Internal

Options can be declared to be internal, hiding the option from the help output.

For example:

```ruby
<%= example('readme/internal') %>
```

#### Min and Max

Options can have mininum and/or maximum values.

If a value is given by the user that does not match the required min and/or max
values then the parser will reject the option, and print the help output for
this command.

For example:

```ruby
<%= example('readme/range') %>
```

#### Negations

Flags (boolean options) automatically allow negation using `--no-*` and
`--no_*` using OptionParser's support for these. However, sometimes it can be
convenient to allow other terms for negating an option. Flags therefore accept
an option `negate` like so:

```ruby
<%= example('readme/negate') %>
```

#### Note

Options can have a note that will be printed in the help output.

```ruby
<%= example('readme/note') %>
```

#### Secret

Options can be declared as secret.

This makes it possible for client code to inspect if a given option is secret.
Also, option values given by the user will be tainted, so client code can rely
on this in order to, for example, obfuscate values from log output.

```ruby
<%= example('readme/secret') %>
```

#### See Also

Options can refer to documentation using the `see` option. This will be printed
in the help output.

For example:

```ruby
<%= example('readme/see') %>
```

#### Types

Options can have a type. Known types are: `:array`, `:string`, `:integer`,
`:float`, `:boolean`.

The type `:array` allows an option to be given multiple times, and makes sure
the value accessible on the `Cmd` instance is a Ruby Array. (This currently
only supports arrays of strings).

```ruby
<%= example('readme/array') %>
```

Other types cast the given value to the expected Ruby type.

```ruby
<%= example('readme/type') %>
```

#### Required Options

There are three ways options can be required:

* using `required: true` on the option: the option itself is required to be given
* using `requires: :other`on the option: the option requires another option to be given
* using `required :one, [:two, :three]` on the class: either `one` or both `two` and `three` must be given

For example, this simply requires the option `--to`:

```ruby
<%= example('readme/required') %>
```

This will make the option `--retries` depend on the option `--to`:

```ruby
<%= example('readme/requires') %>
```

This requires either the option `--api_key` or both options `--username` and
`--password` to be given:

```ruby
<%= example('readme/requireds') %>
```

### Config Files

Cl automatically reads config files that match the given executable name (inspired by
[gem-release](https://github.com/svenfuchs/gem-release)), stored either in the
user directory or the current working directory.

For example:

```ruby
module Api
  class Login < Cl::Cmd
    opt '--username USER'
    opt '--password PASS'
  end
end

# bin/api
CL.new('api').run(ARGV)

# ~/api.yml
login:
  username: 'someone'
  password: 'password'

# ./api.yml
login:
  username: 'someone else'
```

then running

```
$ bin/api login
```

instantiates `Api::Login`, and passes the hash

```ruby
{ username: 'someone else', password: 'password' }
```

as `opts`.

Options passed by the user take precedence over defaults defined in config
files.

### Environment Variables

Cl automatically defaults options to environment variables that are prefixed
with the given executable name (inspired by [gem-release](https://github.com/svenfuchs/gem-release)).

```ruby
module Api
  class Login < Cl::Cmd
    opt '--username USER'
    opt '--password PASS'
  end
end

# bin/api
CL.new('api').run(ARGV)
```

then running

```
$ API_USERNAME=someone API_PASSWORD=password bin/api login
```

instantiates `Api::Login`, and passes the hash

```ruby
{ username: 'someone', password: 'password' }
```

Options passed by the user take precedence over defaults given as environment
variables, and environment variables take precedence over defaults defined in
config files.

repository: svenfuchs/cl

gha_language: Ruby

repo_name: svenfuchs/cl


text:
# Rough Benchmarks 20/2/2020

As requested I've had a look at the likely cost of a server for this, but not got all that far. As I've mentioned the model code isn't finished yet, and in any case I've no idea how often the model will be run, so it's hard to get any kind of sensible benchmarks for how much memory/CPU time we'll need. From some time poking about on Azure and Amazon, and also talking to my own server provider, the best I can give you is rough lower/upper bounds of £25-£90 per month - so £300-1,080 pa. One possibility I'm exploring is to have something big and fast for 1 month per year - so the week before week 28 to 2 weeks after, say, and something scaled back the rest of the time: Azure certainly offer that.

<pre>

  memory estimate:  776.54 MiB
  allocs estimate:  28164012

10x calculations
  --------------
  minimum time:     1.355 s (17.14% GC)
  median time:      1.468 s (19.17% GC)
  mean time:        1.509 s (20.51% GC)
  maximum time:     2.119 s (15.48% GC)
  --------------

  samples:          80
  evals/sample:     1

100x calculations

   memory estimate:  3.81 GiB
  allocs estimate:  118177692
  --------------
  minimum time:     4.860 s (19.19% GC)
  median time:      5.115 s (19.83% GC)
  mean time:        5.179 s (20.04% GC)
  maximum time:     5.713 s (20.78% GC)
  --------------
  samples:          10
  evals/sample:     1

  single CPU

model name      : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
cpu MHz         : 4319.218
bogomips        : 7995.30

</pre>


text:
# Matrix Terminal
### A Program for Generating "Matrix Rain" in a Linux Terminal

### Requirements:
- C++ Standard >= 17
- NCURSES >= 6.2
- CMAKE >= 3.16.3

### Folder Structure:
```
matrix-terminal/
    include/
        matrix.h
    src/
        main.cpp
        matrix.cpp
    CMakeLists.txt
    LICENSE
    README.md
```

### Program Structure:
#### matrix.h
Declares and defines the CharSet enum and Drop struct. Declares the Matrix class.
#### matrix.cpp
Defines the Matrix class.
#### main.cpp
Initializes NCURSES and instantiates a Matrix object to manage the output to terminal.

### Build Instructions:
1. Make sure you are in the 'matrix-terminal' parent directory.
2. Use 'mkdir build && cd build' to create and enter the build directory.
3. Use 'cmake ..' to allow CMake to generate the necessary files to compile the project.
4. Use 'make' to compile the project and create an executable.
5. Run the program with './matrix'.

### Operation:
Upon running the program it will begin generating the "Matrix Rain" effect in the terminal where you run the program.
- Press the 'q' key to quit the program at any time.
- Press the 'c' key to toggle the character set between ASCII and binary.

## Udacity Rubric
### Capstone Option 1

### Loops, Functions, I/O
- A variety of control structures are used in the project.
- The project code is clearly organized into functions.
- The project accepts input from a user as part of the necessary operation of the program.

### Object Oriented Programming
- The project code is organized into classes with class attributes to hold the data, and class methods to perform tasks.
- All class data members are explicitly specified as public, protected, or private.
- All class member functions document their effects, either through function names, comments, or formal documentation. Member functions do not change program state in undocumented ways.
- Appropriate data and functions are grouped into classes. Member data that is subject to an invariant is hidden from the user. State is accessed via member functions.

### Memory Management
- At least two variables are defined as references, or two functions use pass-by-reference in the project code.
- The project uses at least one smart pointer: unique_ptr, shared_ptr, or weak_ptr. The project does not use raw pointers.

### Concurrency
- The project uses multiple threads in the execution.
- A mutex or lock (e.g. std::lock_guard or `std::unique_lock) is used to protect data that is shared across multiple threads in the project code.

repository: Munkyfoot/matrix-terminal

repo_name: Munkyfoot/matrix-terminal


text:
#### SerializeMessageWrapperWith

Messages are wrapped in a transport specific structure containing message metadata. By default, Azure Storage Queues Transport uses the same serializer for the message wrapper as configured for the contained message. It is possible to configure a different serializer for the wrapper using the `SerializeMessageWrapperWith` option

snippet: SerializerAndMessageWrapperSerializer

Note: All endpoints in the same system must use the same serializer for the message wrapper. This can be achieved by using the same serializer or the above `SerializeMessageWrapperWith` API.