text:
# Coronavirus Timeseries Predictor and Data Crawler
Timeseries analyzer for coronavirus with stacked recurrent neural network and data crawler project. For further, you can
read corresponding sections below.

## Prediction with RNN
For model, [Keras](https://keras.io/) library is used, and model structured as stacked recurrent neural network. In my implementation, there
are three LSTM layers, and each of them has their own dropout layer for regularization. At the end, there is a single
dense layer which is used for obtaining regression result.

For the feature vector, I decided to use **previous days' data with specific day interval**. In other words, the created
RNN model maps occurred total death counts to next day's total death count. Size of feature vector can be configurable
in implementation. You can change target directory i.e. target of training by configuring it in predictor file. I output
crawler data so that it can be easily changed.

**Note:** Still there are few data we obtained around the world. The size of data may not be applicable for training of
such a large network. I played layer counts, neuron counts of layers, activation functions and other hyper parameters;
however, expected numbers could deviate unexpectedly. But at least, I thought that having initial implementation for
such a case can be helpful for other curious people.

**Note:** Because of the above concern, I do not choose to train my models on particular country (because of lack of
necessary data count). I choose to train my model with all data available for all countries so that maybe I can catch
some point of direction increase in the virus spread speed collectively for all countries.

Several figures are placed here:

![Total Death in Turkey](resources/Figures/turkey_total_death.png)

![Total Death in Japan](resources/Figures/japan_total_death.png)

![Total Death in United Kingdom](resources/Figures/uk_total_death.png)

## Crawler
The project not just include predictor/analysis part for coronavirus, but also creation of
dataset for the training. The main source for dataset is [Worldometer](https://www.worldometers.info/)
web page Coronovirus section.

Crawling is done with the following procedure:
* Firstly, all the available counties are fetched and filtered from the table.
* Then, web scrapping procedure starts for each fetched country.
* Each country's detail page parsed and daily data is obtained from graphs included in the
detail page of particular country.

Under crawler package, one could find the following files.

### Synchronous Crawler
Synchronous scrapper class where HTTP requests are forwarded via *urllib* module of python.
For parsing, [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) module is used.

### Asynchronous Crawler
Pretty similar to synchronous counterpart with just [aiohttp](https://docs.aiohttp.org/en/stable/)
take place of synchronous network access and main loop of *asyncio* controls the flow.

### Dataset Output
Output of obtained data is written into **CSV** formatted files under **resources** directory which
can be found at the same level with **src** directory. Current version of CSV files have two columns
of data where the first column includes date information and the second one consists corresponding
values for particular information (ex: *Active Cases* or *Daily Deaths*).

File structure will be as follows.

```shell
$ ls
LICENSE  README.md  resources  src
$ ls resources/
'Active Cases'  'Daily Deaths'  'Daily New Cases'  'New Cases vs.  To build and use the project, you need to follow following steps.

```shell
$ # You may want to activate your favorite virtual environment before doing installation
$ git clone git@github.com:yakuza8/coronavirus-timeseries-predictor.git
$ cd coronavirus-timeseries-predictor
$ pip install -r requirements.txt
$ pip install -e .
```

## Running
There are several executable scripts that you may want to run. Let's give some examples of them.

```shell
$ # Navigate to crawler directory under src
$ cd src/crawler
$ python3.6 async_crawler.py                    # To get data under resources directory
$ cd ../predictor
$ python3.6 rnn_predictor.py                    # To train model
```


text:
---
title: scm-scheduler-plugin
date: 2013-01-03T17:06:14+00:00
author: Sebastian Sdorra
slug: /plugins/scm-scheduler-plugin/
categories:
  - plugins
  - library-plugins

---
The [scm-scheduler-plugin](https://bitbucket.org/sdorra/scm-scheduler-plugin) provides an api for other plugins to execute scheduled
jobs. The plugin is based on the quartz project.

**Wiki:** <a href="https://bitbucket.org/sdorra/scm-manager/wiki/scheduler-plugin" target="_blank" rel="noopener noreferrer">https://bitbucket.org/sdorra/scm-manager/wiki/scheduler-plugin

license: MIT

repository: dhuchthausen/website

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: dhuchthausen/website


text:
# ProscriptLS SDK
## Software Development Kit for ProscriptLS
### Javascript implementation of Prolog
#### (version 1.5.9, June 2020)

This SDK contains all of the ProscriptLS libraries and support files needed to create
web pages using ProscriptLS as the scripting language instead of Javascript.

The documentation is in index.html: run 'node simple_server.js' from the command line
with the working directory set to the SDK directory.
Use any browser to go to localhost:9615/index.html.

The documentation for the current master branch of the ProscriptLS project is viewable at
http://lindseyspratt.github.io/proscriptls/index.html.

The GIT project for ProscriptLS is at
http://github.com/lindseyspratt/proscriptls

repository: lindseyspratt/mosaic-pls

gha_language: HTML

repo_name: lindseyspratt/mosaic-pls


text:
---
layout: post
section-type: post
title: Journey Into Javascript Algorithms - Stacks
categories: ['programming']
tags: [ 'javascript','algorithms']
---

# Javascript

![Javascript](/img/js.png)

## Javascript Algorithms - Stacks

-- Stacks are a LIFO, Last In First Out list type data structure.
Think of a stack of books in terms of accessing the first book in a stack of 10 books, you would need to remove the last 9 to get to the first book.

### Stacks:

##### Using Stacks

The two most common methods for basic stack operations are push and pop.

Push is used to insert an element into the stack.
Pop is used to extract an element form the stack.

Keeping track of the top most element is important, when we push an element the top is updated to reflect the most recent element added, likewise when we pop an element the top is also updated to reflect the next most recently added element.

```javascript
function stackOfBooks{
    this.top = -1; //Initialised to -1 to indicate no elements
    this.value = []; //Initialised as an empty array.
}

//not using the native array push function yet
stackOfBooks.prototype.push = function(book){
    this.top++;
    this.value[this.top] = book;
}

//not using the native array pop function yet
stackOfBooks.prototype.pop = function(){
    if (this.top < 0){
        return null;
    }
    var topBook = this.value[this.top];
    this.top--;

    this.value.length--;

    return topBook;
}

//Having a look at which is the top book
stackOfBooks.prototype.look = function(){
    if (this.top < 0){
        return null;
    }
    return this.value[this.top];
}

//testing the above functions
var stack = new stackOfBooks();

for (var i = 0; i <= 20; i++){
    console.log('Push ', i);
    stackOfBooks.push(i);
}

//Looking looking looking...
console.log('Last book is ', stack.look());

//Poping last book added
console.log('Pop last book', stack.pop());

//Looking looking looking...
console.log('Last book is ', stack.look());

//Poping last book added
console.log('Pop last book', stack.pop());

//Looking looking looking...
console.log('Last book is ', stack.look());

//pushing another book
console.log('New book is 100 ');
stack.push(100);

//Looking looking looking...
console.log('Last book is now ', stack.look());

```
Next we will look at Javascript queues


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

Second Hand Auto Market

    View Demo
    ·
    Report Bug
    ·
    Request Feature

## Table of Contents

* [About the Project](#about-the-project)
  * [Built With](#built-with)
* [Getting Started](#getting-started)
  * [Prerequisites](#prerequisites)
  * [Installation](#installation)
* [Contributing](#contributing)
* [License](#license)
* [Contact](#contact)
* [Acknowledgements](#acknowledgements)

## About The Project

[![Product Name Screen Shot][product-screenshot]](https://example.com)
* This project is a small mock-up for second hand auto market.
* When you start the project, it fetches all the cars and show it on the homepage.
* You can scroll down and see other pages by using pagination buttons.
* Also you can filter cars by manufacturer and color.
* You can check the details of car after you click the view details button.
* HashRouter has been used for letting Github refresh on details page.

### Built With
* [React](https://reactjs.org/)
* [Create-React-App](https://create-react-app.dev/)
* [Redux-Toolkit](https://redux-toolkit.js.org/)

## Getting Started

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.
* npm
```sh
npm install npm@latest -g
```

### Installation

1. Clone the repo
```sh
git clone https://github.com/firattale/car-market.git
cd auto
```
2. Install NPM packages
```sh
npm install
```
3. Start the project
```sh
npm start
```

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Your Name - [@firattale](https://twitter.com/firattale) -<EMAIL_ADDRESS>
Project Link: [https://firattale.github.io/car-market/](https://github.com/firattale/car-market)

## Acknowledgements
* [Axios](https://github.com/axios/axios)
* [Material UI](https://material-ui.com/)
* [React-Bootstrap](https://react-bootstrap.github.io/)
* [Formik](https://formik.org/)
* [Classnames](https://www.npmjs.com/package/classnames)

[contributors-shield]: https://img.shields.io/github/contributors/firattale/car-market.svg?style=flat-square
[contributors-url]: https://github.com/firattale/car-market/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/firattale/car-market.svg?style=flat-square
[forks-url]: https://github.com/firattale/car-market/network/members
[stars-shield]: https://img.shields.io/github/stars/firattale/car-market.svg?style=flat-square
[stars-url]: https://github.com/firattale/car-market/stargazers
[issues-shield]: https://img.shields.io/github/issues/firattale/car-market.svg?style=flat-square
[issues-url]: https://github.com/firattale/car-market/issues
[license-shield]: https://img.shields.io/github/license/firattale/car-market.svg?style=flat-square
[license-url]: https://github.com/firattale/car-market/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/firat-tale
[product-screenshot]: public/ss.png

repository: meghna-saxena/car-market

branch_name: refs/heads/main

repo_name: meghna-saxena/car-market


text:
# Custom Virtual Server Name

This section demonstrates the option to configure virtual server name. This is optional to use.
CRD allows the user to create a custom name for the virtual servers on BIG-IP.

Option which can be used to configure is :
    virtualServerName

## cusotm-virtual-name.yml

By deploying this yaml file in your cluster, CIS will create a Virtual Server on BIG-IP as
"<virtual server name>_<virtual server port>"
Ex. "cafe_virtual_server_80"

This is optional to use. Default name for virtual server created on BIG-IP as
"crd_<virtual IP address>_<virtual server port>"
Ex. "crd_172_16_3_4_80"

gha_language: Go


text:
---
layout: home
title: Feature - Coupons
sidebar: features
lang: en
subnav: features_coupons_index
---

# What about giving your customer a way to get discounts ?

A coupon is

* An [effect](/documentation/features/coupon/effects.html), what your customer would earn if he enters his coupon (ex: discount -10€ on your customer total checkout)
* A [rule](/documentation/features/coupon/rules.html), whether your customer is eligible for this Coupon (ex: only if the customer total cart price > 400€)

We designed this feature in order to let you build the Coupon you wish. Whether it is usual or whether it is very specific to your business model.
By default numerous Coupons are available but any developer will be able to implement your demands pretty easily.

Here are some unusual demands your customers could met :

* A coupon available only if you are a woman
* A coupon available only if the customer browser is not Internet Explorer
* A coupon linked to a customer and usable only once
* A Coupon giving a discount to another customer on behalf of the first customer

As you can see you have a wide variety of application field.


text:
### [CVE-2021-0513](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-0513)
![](https://img.shields.io/static/v1?label=Product&message=Android&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Elevation%20of%20privilege&color=brighgreen)

### Description

In deleteNotificationChannel and related functions of NotificationManagerService.java, there is a possible permission bypass due to improper state validation. This could lead to local escalation of privilege via hidden services with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android-9 Android-10 Android-11 Android-8.1Android ID: A-156090809

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/SYRTI/POC_to_review
- https://github.com/WhooAmii/POC_to_review
- https://github.com/manas3c/CVE-POC
- https://github.com/nanopathi/framework_base_AOSP10_r33_CVE-2021-0513
- https://github.com/nomi-sec/PoC-in-GitHub
- https://github.com/trhacknon/Pocingit

repository: trickest/cve

repo_name: trickest/cve


text:
Developer: Georg Oeltzschner, Mark Mikkelsen
Name of the software: MRS DeIdentification Tools
Abstract: MATLAB tools to remove protected health information (PHI) from magnetic resonance spectroscopy data.
Languages: MATLAB
Credit: Please credit the use of MRS DeIdentification Tools by citing https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>4207v1
Contact: goel-tzs1-(-a)-jh-mi.edu (remove all dashes)

repository: schorschinho/MRSDeIdentificationTools

gha_language: MATLAB

repo_name: schorschinho/MRSDeIdentificationTools


text:
# Ansible Role: Docker

[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-docker.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-docker)

An Ansible Role that installs [Docker](https://www.docker.com) on Debian/Ubuntu.

## Requirements

None.

## Role Variables

Available variables are listed below, along with default values (see `defaults/main.yml`):

    TODO.

TODO.

## Dependencies

None.

## Example Playbook

    - hosts: all
      roles:
        - geerlingguy.docker

## License

MIT / BSD

## Author Information

This role was created in 2017 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

repository: numenshane/devops-demo

repo_name: numenshane/devops-demo


text:
# POSIX Benchmarks

## Getting Started

You need to configure your machine before running the benchmarks.

**Disable TurboBoost.**

```
sudo ./scripts/turbo-boost.sh
```

**Disable CPU power saving mode:**

```
sudo cpupower --cpu all frequency-set --governor performance
```

**Configure huge pages:**

```
sudo ./scripts/hugepages.sh
```

**Kill background processes and services.**

### Benchmarking

**Prerequisites:**

* matplotlib
* pandas

```
make build
make bench
```

repository: penberg/posixbench

repo_name: penberg/posixbench


text:
---
layout: post
title: "The truth about good design"
description: ""
category:
tags: []
---
{% include JB/setup %}

When it comes to design, and particularly web design, I really think I can classify the entire world into three kinds of people:

Those who can design well. They know what a good design is made up of, and they've the skills to put one up. They are the kind of people who, by defintion, deserve to be called *designers*.

And then there are those who don't design, but they can definitely tell a good one from a bad one. They recognize well designed work, and they recognize poor design. They don't necessarily believe that everything has to be pixel perfect, but bad design certainly hurts them. If you show them a bad design, they can immediately point out to you that it's bad! But if you ask what should be done to improve it, they won't tell you anything. They are kind of common man. I really feel these are the kind of people who add to the positive energy of the world.

And then, the third kind is the most dangerous: they don't have a design sense! They call good design as bad, and bad design as good. If given control, they'll come up the poorest designs in the world, and the worst part is, they'll believe that they've made really good stuff. Remember the people from old days who'd put **marquee** and **blink** tags on their website, and feel good about it? Yes. These are the kind of people who must be avoided at all costs. And if you got one in place of your manager or client, I already start to feel pity for you.

Given that I don't really design, I feel I belong to the second category. What do you think?


text:
# Discord-Phore-Tips
[Phore Discord](https://discord.gg/7sv6ErF)

These files are intended to function as a multi-functional tipbot for Phore Currency

# Requirements
* discord.py installed
* Python 3.6+
* A MySQL database
* The Phore wallet w/ RPC enabled.

# Functions
* Display general wallet information
* Display individual user balances
* Store user balance information in database
* Generate new deposit addresses for users
* Automatically add users to database
* Allow users to withdraw coins from the wallet with respect to how many coins they have in the DB

We ❤ Pull Requests!

repository: liray-unendlich/Phore-Discord-Tips

repo_name: liray-unendlich/Phore-Discord-Tips


text:
# Rspec-its

Excess typing can hasten the eventual heat death of the universe.

Rspec-its lets your examples be shorter, thus preventing excess typing, and the eventual heat death of the universe.

its(:thingy) { should whatever }

I've been using it for some time... but wondered what to do when I wanted to match on something that wasn't just a parameterless method call on the subject.

When all else fails... RTFM.

And there I immediately found the syntax I desired.

https://github.com/rspec/rspec-its

## Nested attributes.

You can check properties of a child object by using "foo.bar" syntax.  Since symbols don't allow dots, quote the expression:

its("user.username") { should be == 'fred' }

This can be chained out as far as you like.

## Hash values

When your subject is a hash, using bare symbols as the argument to its() doesn't do hash lookups - it calls hash methods,
like .size or .empty?.  To do a has lookup, place the desired key (string, symbol, whatever) as the first element of
an array:

```
its( [:thingy] ) { should whatever }  #  invokes subject[:thingy]
its( ['thingy'] ) { should whatever }  #  invokes subject['thingy']
```

## Hashes within hashes.

A longer array does lookups within nested hashes.

```ruby
subject { { name: 'fred', address: { city: 'Chicago', state: 'IL'} } }
its( [:name] ) { should be == 'fred' }
its( [:address] ) { should be_kind_of Hash }
its( [:address, :city] ) { should be == 'Chicago' }   # subject[:address][:city]
```

repository: matthucke/til

repo_name: matthucke/til


text:
---
layout: post
title: "A slice of a slice of a slice"
date: "2019-07-24"
categories: ["Web strategy"]
---

When you analyze website data, you're dealing with a sample of the whole data set. When you make _decisions_ based on website data, you're applying them to the entire population.

Understanding that you're looking at slices will help prevent knee-jerk, data-poor decisions.

### A slice of total visitors

If you're using Google Analytics (or similar), your data set consists of All Visitors ... _minus_ some visitors. Such as:

- Visitors who opt out via AdBlock or a browser extension (maybe 10% ?)
- Visitors with JavaScript disabled (1-2% ?)

If your site has enough traffic, you may also be looking at a [sample of total traffic](https://support.google.com/analytics/answer/2637192?hl=en) in the reports you generate.

Unless you're reading server logs, you'll never see data for _all_ your visitors.

### A slice of all time

You're probably looking at data for a week, or a month, or a few months at a time. Maybe you're comparing this month to the same month last year.

These snapshots are easier to reason about, and more recent data is more relevant. 3 weeks' worth of heatmap data can be illuminating, and you should definitely keep using it to learn what you can. But it's not the whole story - it's a slice of time.

### A slice of all activity

This one hurts. You're tracking pageviews, conversions, and a handful of fancy custom events. You know device, browser, operating system, time of day, and (maybe) location.

You don't know how anybody felt while they were on your site. (Or if you do, it's a micro-slice from a survey.)

You don't know whether visitors who bounced on mobile did so with delight and a commitment to return later on desktop to complete their transaction ... or in disgust, vowing to put you on blast all over social media.

You don't know who screenshotted your site and shared it in a snarky email about ugly widgets, or who excitedly DM'd a link to a coworker on Slack. (And when that coworker lands on the site, they get categorized as 'Direct' - not 'Link shared by coworker via Slack.')

### A slice of the slice

When you experiment on, or just segment, this imperfect data, that's another slice. A 5-way A/B/n test on desktop visitors might leave you drawing conclusions based on 1/5th of trackable desktop visitors, who are only half of total trackable visitors, who are only 88% of total visitors.

* * *

This isn't all to say your data is junk and should go in the dumpster. It simply means we should be looking for striking trends, large effects, big opportunities.

If we see a drastic drop in conversions for mobile visitors starting last month, we need to investigate - quick. But if we saw a minor dip in conversions for Firefox on Android visitors last Thursday afternoon, we're allowed to ignore it and move on with life.

If an experiment shows a "slight lift" in a single metric across a narrow audience segment ... go ahead and call it "interesting" if you must. But don't be surprised when that slight lift gets lost in the crowd.


text:
# @deck.gl/extensions

Layer extensions are bonus features that you can optionally add to the core deck.gl layers. These features are not included in the layers by default because one or more of the following reasons:

- They do not work consistently for all layers, but still valuable for some;
- While they optimize for specific use cases, there is an unnecessary performance overhead for users who don't need them;
- Once separated from the core layer code, they can be tree shaken. Applications can have smaller bundle sizes by only including the features they need.

This module contains the following extensions:

- [BrushingExtension](/docs/api-reference/extensions/brushing-extension.md)
- [DataFilterExtension](/docs/api-reference/extensions/data-filter-extension.md)
- [Fp64Extension](/docs/api-reference/extensions/fp64-extension.md)
- [PathStyleExtension](/docs/api-reference/extensions/path-style-extension.md)
- [ClipExtension](/docs/api-reference/extensions/clip-extension.md)

For instructions on authoring your own layer extensions, visit [developer guide](/docs/developer-guide/custom-layers/layer-extensions.md).

## Installation

### Install from NPM

```bash
npm install deck.gl
# or
npm install @deck.gl/core @deck.gl/layers @deck.gl/extensions
```

```js
import {DataFilterExtension} from<EMAIL_ADDRESS>new DataFilterExtension({});
```

### Include the Standalone Bundle

```html
<script<EMAIL_ADDRESS><!-- or -->
<script src="https://unpkg.com/<EMAIL_ADDRESS><script src="https://unpkg.com/<EMAIL_ADDRESS><script src="https://unpkg.com/<EMAIL_ADDRESS>```

```js
new deck.DataFilterExtension({});
```

gha_language: JavaScript


text:
# flutter_redux

[![Build Status](https://travis-ci.org/brianegan/flutter_redux.svg?branch=master)](https://travis-ci.org/brianegan/flutter_redux)  [![codecov](https://codecov.io/gh/brianegan/flutter_redux/branch/master/graph/badge.svg)](https://codecov.io/gh/brianegan/flutter_redux)

A set of utilities that allow you to easily consume a
[Redux](https://pub.dartlang.org/packages/redux) Store to build Flutter Widgets.

This package supports null-safety and is built to work with
[Redux.dart](https://pub.dartlang.org/packages/redux) 5.0.0+ and Flutter 3+.

## Redux Widgets

  * `StoreProvider` - The base Widget. It will pass the given Redux Store to all descendants that request it.
  * `StoreBuilder` - A descendant Widget that gets the Store from a `StoreProvider` and passes it to a Widget `builder` function.
  * `StoreConnector` - A descendant Widget that gets the Store from the nearest `StoreProvider` ancestor, converts the `Store` into a `ViewModel` with the given `converter` function, and passes the `ViewModel` to a `builder` function. Any time the Store emits a change event, the Widget will automatically be rebuilt. No need to manage subscriptions!

## Examples

  * [Simple example](https://github.com/brianegan/flutter_redux/tree/master/example/counter) - a port of the standard "Counter Button" example from Flutter
  * [Github Search](https://github.com/brianegan/flutter_redux/tree/master/example/github_search) - an example of how to search as a user types, demonstrating both the Middleware and Epic approaches.
  * [Todo app](https://github.com/brianegan/flutter_architecture_samples/tree/master/redux) - a more complete example, with persistence, routing, and nested state.
  * [Timy Messenger](https://github.com/janoodleFTW/timy-messenger) - large open source app that uses flutter_redux together with Firebase Firestore.

### Companion Libraries
  * [flipperkit_redux_middleware](https://pub.dartlang.org/packages/flipperkit_redux_middleware) - Redux Inspector (use [Flutter Debugger](https://github.com/blankapp/flutter-debugger)) for Flutter Redux apps
  * [flutter_redux_dev_tools](https://pub.dartlang.org/packages/flutter_redux_dev_tools) - Time Travel Dev Tools for Flutter Redux apps
  * [redux_persist](https://github.com/Cretezy/redux_persist) - Persist Redux State
  * [flutter_redux_navigation](https://github.com/flutterings/flutter_redux_navigation) - Use redux events for navigation
  * [flutter_redux_gen](https://marketplace.visualstudio.com/items?itemName=BalaDhruv.flutter-redux-gen) - VS Code Extension to generate redux code.

## Usage

Let's demo the basic usage with the all-time favorite: A counter example!

Note: This example requires flutter_redux 0.4.0+ and Dart 2! If you're using
Dart 1, [see the old
example](https://github.com/brianegan/flutter_redux/blob/eb4289795a5a70517686ccd1d161abdb8cc08af5/example/lib/main.dart).

```dart
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';

// One simple action: Increment
enum Actions { Increment }

// The reducer, which takes the previous count and increments it in response
// to an Increment action.
int counterReducer(int state, dynamic action) {
  return action == Actions.Increment ? state + 1 : state;
}

void main() {
  // Create your store as a final variable in the main function or inside a
  // State object. This works better with Hot Reload than creating it directly
  // in the `build` function.
  final store = Store<int>(counterReducer, initialState: 0);

  runApp(FlutterReduxApp(
    title: 'Flutter Redux Demo',
    store: store,
  ));
}

class FlutterReduxApp extends StatelessWidget {
  final Store<int> store;
  final String title;

  FlutterReduxApp({Key key, this.store, this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // The StoreProvider should wrap your MaterialApp or WidgetsApp. This will
    // ensure all routes have access to the store.
    return StoreProvider<int>(
      // Pass the store to the StoreProvider. Any ancestor `StoreConnector`
      // Widgets will find and use this value as the `Store`.
      store: store,
      child: MaterialApp(
        theme: ThemeData.dark(),
        title: title,
        home: Scaffold(
          appBar: AppBar(title: Text(title)),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                // Connect the Store to a Text Widget that renders the current
                // count.
                //
                // We'll wrap the Text Widget in a `StoreConnector` Widget. The
                // `StoreConnector` will find the `Store` from the nearest
                // `StoreProvider` ancestor, convert it into a String of the
                // latest count, and pass that String  to the `builder` function
                // as the `count`.
                //
                // Every time the button is tapped, an action is dispatched and
                // run through the reducer. After the reducer updates the state,
                // the Widget will be automatically rebuilt with the latest
                // count. No need to manually manage subscriptions or Streams!
                StoreConnector<int, String>(
                  converter: (store) => store.state.toString(),
                  builder: (context, count) {
                    return Text(
                      'The button has been pushed this many times: $count',
                      style: Theme.of(context).textTheme.display1,
                    );
                  },
                )
              ],
            ),
          ),
          // Connect the Store to a FloatingActionButton. In this case, we'll
          // use the Store to build a callback that will dispatch an Increment
          // Action.
          //
          // Then, we'll pass this callback to the button's `onPressed` handler.
          floatingActionButton: StoreConnector<int, VoidCallback>(
            converter: (store) {
              // Return a `VoidCallback`, which is a fancy name for a function
              // with no parameters and no return value.
              // It only dispatches an Increment action.
              return () => store.dispatch(Actions.Increment);
            },
            builder: (context, callback) {
              return FloatingActionButton(
                // Attach the `callback` to the `onPressed` attribute
                onPressed: callback,
                tooltip: 'Increment',
                child: Icon(Icons.add),
              );
            },
          ),
        ),
      ),
    );
  }
}
```

## Purpose

One question that [reasonable people might
ask](https://www.reddit.com/r/FlutterDev/comments/6vscdy/a_set_of_utilities_that_allow_you_to_easily/dm3ll7d/):
Why do you need all of this if `StatefulWidget` exists?

My advice is the same as the original Redux.JS author: If you've got a simple
app, use the most straightforward thing possible. In Flutter, `StatefulWidget` is perfect
for a simple counter app.

However, say you have the more complex app, such as an E-commerce app with a
Shopping Cart. The Shopping Cart should appear on multiple screens in your app
and should be updated by many different types of Widgets on those different
screens (An "Add Item to Cart" Widget on all your Product Screens, "Remove Item
from Cart" Widget on the Shopping Cart Screen, "Change quantity" Widgets, etc.).

Additionally, you want to test this logic, as it's the core business
logic to your app!

Now, in this case, you could create a Testable `ShoppingCart` class as a
Singleton or Create a Root `StatefulWidget` that passes the `ShoppingCart `*Down
Down Down* through your widget hierarchy to the "add to cart" or "remove from
cart" Widgets.

Singletons can be problematic for testing, and Flutter doesn't have a great
Dependency Injection library (such as Dagger2) just yet, so I'd prefer to avoid
those.

	Yet passing the ShoppingCart all over the place can get messy. It also means
it's way harder to move that "Add to Item" button to a new location b/c you'd
need up update the Widgets throughout your app that passes the state down.

Furthermore, you'd need a way to Observe when the `ShoppingCart` Changes so you
could rebuild your Widgets when it does (from an "Add" button to an "Added"
button, as an example).

One way to handle it would be to simply `setState` every time the `ShoppingCart`
changes in your Root Widget, but then your whole app below the RootWidget would
be required to rebuild as well! Flutter is fast, but we should be thoughtful about
what we ask Flutter to rebuild!

Therefore, `redux` & `redux_flutter` was born for more complex stories like this
one. It gives you a set of tools that allow your Widgets to `dispatch` actions
in a naive way, then writes the business logic in another place that will take
those actions and update the `ShoppingCart` in a safe, testable way.

Even more, once the `ShoppingCart` has been updated in the `Store`, the `Store`
will emit an `onChange` event. This lets you listen to `Store` updates and
rebuild your UI in the right places when it changes!

Similar patterns in Android are the MVP Pattern or using Rx Observables to
manage a View's State.

`flutter_redux` handles passing your `Store` down to all of your
descendant `StoreConnector` Widgets. If your State emits a change event, only
the `StoreConnector` Widgets and their descendants will be automatically rebuilt
with the latest State of the `Store`!

This allows you to focus on what your app should look like and how it should
work without thinking about all the glue code to hook everything together!

### Contributors

  * [Brian Egan](https://github.com/brianegan)
  * [Chris Bird](https://github.com/chrisabird)

gha_language: Dart


text:
# LeaflyApiWrapper

TODO: Write a gem description
A simple API wrapper for leafly.com API

## Installation

Add this line to your application's Gemfile:

    gem 'leafly_api_wrapper'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install leafly_api_wrapper

## Usage

### Configure

  ``` ruby
  # This could go on a rails initializer
  LeaflyApiWrapper.configure do |config|
    config.api_key = 'MY_API_KEY'
    config.api_id  = 'MY_API_ID'
  end
  ```

### Locations

The Location.near method allows you to search locations near a latitude and
longitude, it also allows you to send an additional parameter with options to
refine your search. Available options are:

 take               Number of results per page (MAX 50)
 page               The page of the results, 0 by default
 storefront		      Only return results with physical locations
 delivery		        Only return delivery services
 retail		          Only return retail locations (for CO & WA)
 medical		        Only return medical dispensaries
 creditcards		    Return locations that accept credit cards on site
 hasclones		      Only locations with clones available
 hasconcentrates		Only locations with concentrates on the menu
 hasedibles		      Only locations with edibles on the menu
 veterandiscount		Only locations that offer a discount for veterans

See more info at leafly api documentation at ( https://developer.leafly.com/docs )

  ```ruby
  response = LeaflyApiWrapper::Location.near(33.749, -117.874, take: 10)
  ```
Or you can get an specific result with Location.get method

  ```ruby
  response = LeaflyApiWrapper::Location.get('dispensary-slug')
  ```

## Contributing

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


text:
# Background Image Plugin

We also can setup a `plugin` for the `background images`, cos they also could use all the optimisations. In order to do that we need to install the `gatsby-background-image` plugin first - `npm install --save gatsby-background-image`. And restart the server.

Well, we would like to customise the image we use, so to use it in different pages and in different sizes and styling. Now let's create a new `component` named "StyledHero.js". For this `component` we first import `styled components` and `background image` plugin.

**StyledHero.js**

```jsx
import React from 'react'
import styled from 'styled-components'
import BackgroundImage from 'gatsby-background-image'

const StyledHero = () => {
  <div>

  </div>
}

export default StyledHero;
```

Well, we would like to reuse this `component` all thoughout the pages of our project. The way we gonna do that - we'll setup a bunch of `props` for the `component` - cos we also would like to change the `image` of this `component` depending on the page we are locaked at.
Props will be: `img` - the image that will be rendered, `className` , `children` - cos we wanna render our `banner` on the `image`, `home` - this prop will be responsible for two things: whether the `image` will gonna have the `linear gradient` as well as the size of the image, if there will be no `home prop` then the image will be smaller and there will not be `linear gradient`.

And we would like to return in the `component` the - `BackgroundImage`.

**StyledHero.js**

```jsx
import React from 'react'
import styled from 'styled-components'
import BackgroundImage from 'gatsby-background-image'

const StyledHero = ({img, className, children, home}) => {
  <BackgroundImage>

  </BackgroundImage>
}

export default StyledHero;
```

The reason why we add a `className` as a prop -  cos we will be exporting the `component` setup as `styled component`. If in the `styled componnets` we pass the actual `react component` then we do need to use the `className` prop. And before we work on our `css` we will render the `children` - they will be rendered within the `BackgroundImage` component.

**StyledHero.js**

```jsx
import React from 'react'
import styled from 'styled-components'
import BackgroundImage from 'gatsby-background-image'

const StyledHero = ({img, className, children, home}) => {
  <BackgroundImage className={className}>
    {children}
  </BackgroundImage>
}

export default styled(StyledHero);
```

What we are doing with the `img` prop? Our `BackgroundImage` component will be looking for this prop (whether fluid or fixed) and the `value` of this prop will be the `data` we are getting from the `query`. But in our case we are not gonna setup the `query` inside the `component` - in fact for each and every page we gonna pass the `img prop`. And we also pass `home prop`.

**StyledHero.js**

```jsx
import React from 'react'
import styled from 'styled-components'
import BackgroundImage from 'gatsby-background-image'

const StyledHero = ({img, className, children, home}) => {
  <BackgroundImage className={className} fluid={img} home={home}>
  {children}
  </BackgroundImage>
}

export default styled(StyledHero)`

`
```

 Now, let's work on the styling: background position, size, opacity, display...
 Concerning the `home prop` - when we are dealing with `styled components` we have an option when we can do `conditional rendering`, cos `styled components` within the tagged template function, we can use interpolations and we have few options: use regular `string` or use the `props`.
First let's deal with `linear gradient`, first we'll add `background` and setup a conditional rendering with the `ternary operator`. The same we'll do with the `height`.

**StyledHero.js**

```jsx
import React from 'react'
import styled from 'styled-components'
import BackgroundImage from 'gatsby-background-image'

const StyledHero = ({img, className, children, home}) => {
  <BackgroundImage className={className} fluid={img} home={home}>
  {children}
  </BackgroundImage>
}

export default styled(StyledHero)`
 min-height: ${props => props.home ? "calc(100vh - 62px)" : "50vh"}
 background: ${props => props.home ? "linear-gradient(rgba(63, 208, 212, 0.7), rgba(0, 0, 0, 0.7))" : "none"};
 background-position: center;
 background-size: cover;
 opacity: 1 !important;
 display: flex;
 justify-content: center;
 align-items: center;
`
```

repository: anmud/learntocode

repo_name: anmud/learntocode


text:
Tip Calculator

Visit online:
https://vtchris.github.io/tipCalculator/

Technology

JavaScript

HTML/CSS

Font Awesome was used for the purposes of adding icons.

Joke API courtesy of: Max Berkelmans / LemmoTresto https://rapidapi.com/LemmoTresto/api/joke3

The goal of this coding challenge was to build a tip calculator using vanilla javaScript based on the criteria below. In addition to these requirements, I wanted a calculator that could round up the tip or the grand total to the nearest dollar. I also decided to save the rounding preferences and tip % to localStorage so the preferred settings would be saved for the next use. Last, I wanted to include a joke using an API as I thought this could be a fun way to end an evening out! Thank you for checking out my tip calculator!

![](assets/images/demo/tipCalculator.jpg)

The requirements for this application include the following:

Take in the value of the bill

Take in the desired tip percentage

Include the option to split the bill/tip by the people at the table

The application should then calculate the amount of tip per table (or per person if the split option is chosen) and return the value to the user.

Code should be clean and readable. Don't neglect the comments!

You must push your code in a git repository and submit git repository URL to the challenge email.

Commit early, commit often; we will look at the progression of your code throughout application development. Consider your commits valuable.

You shouldn't need any external libraries to complete this application... BUT if you do, you need to document it in your readme and let us know why it was a better choice.

The bill value must be a positive float but your application must handle user input that might be a negative or 0 dollar amount (i.e. error handling).

The user input percentage for the tip must be a positive float.

The returned value must be a float rounded to two decimal points (i.e. accurate dollars and cents).

repository: vtchris/tipCalculator

repo_name: vtchris/tipCalculator


text:
![](https://img.shields.io/badge/Microverse-blueviolet)
# Project NYT-Page-clone
A Microverse HTML and CSS Project
- This project is centered on understanding of HTML & CSS(positioning and float).
- The project is mainly to practice how to position and float elements with both languages.

![ScreenShot](assets/images/week1-project.PNG)

## Built With

- HTML
- CSS

## Linters Used:

- Lighthouse
- Weblint
- Stylelint

## Live Demo

- Project [Live Demo Link](https://dansam5k.github.io/project-nyt-page/)

## Getting Started

- To get a local copy up and running follow these simple example steps.

### Prerequisites

- Have a compatible web browser that supports HTML5 and CSS3 in order to correctly display the website.
- A text editor in order to view and edit code. Popular text editors include VSCode and Notepad++.

### Set-up

- Create a folder you wish to clone the repository
- From your terminal  run `$ git clone https://github.com/DanSam5K/project-nyt-page.git_` to clone
- You can navigate into the clone project
- Most Operative Systems have the .html file extension associated to open with your default web browser.

> In order to review the code, you may use your web browser inspect element option or open directly with a text editor.

- In the cloned folder open
    `index.html`

## 👤 Daniel Samuel

- GitHub: [DanSam5K](https://github.com/DanSam5K)
- Twitter: [@_dan_sam](https://twitter.com/_dan_sam)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/dansamuel/)

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](https://github.com/DanSam5K/project-nyt-page/issues).

## Show your support

Give a ⭐ if you like this project!

## Acknowledgments

- Project inspired by Microverse Program

## 📝 License

This project is [MIT](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt) licensed.


text:
# Readings : Forms and JS Events

Below you will find some reading material, code samples, and some additional resources that support today's topic and the upcoming lecture.

Review the Submission Instructions for guidance on completing and submitting this assignment.

## Reading

Here are the chapters to read/skim before class:

From the Duckett HTML book:

- Chapter 7: “Forms” (p.144-175)
- Chapter 14: “Lists, Tables & Forms” (pp.330-357)

From the Duckett JS book:

- Chapter 6: “Events” (pp.243-292)

<!--
## Additional Resources

### Videos

### Bookmark/Skim
 -->


text:
---
title: SQL Optimization Process
summary: Learn about the logical and physical optimization of SQL in TiDB.
aliases: ['/docs/dev/sql-optimization-concepts/','/docs/dev/reference/performance/sql-optimizer-overview/']
---

# SQL Optimization Process

In TiDB, the process from inputting a query to getting the execution result according to the final execution plan is illustrated as follows:

![SQL Optimization Process](/media/sql-optimization.png)

After parsing the original query text by `parser` and some simple validity checks, TiDB first makes some logically equivalent changes to the query. For detailed changes, see [SQL Logical Optimization](/sql-logical-optimization.md).

Through these equivalent changes, this query becomes easier to handle in the logical execution plan. After the equivalent change is done, TiDB obtains a query plan structure equivalent to the original query, and then obtains a final execution plan based on the data distribution and the specific execution cost of an operator. For details, see [SQL Physical Optimization](/sql-physical-optimization.md).

At the same time, when TiDB executes the [`PREPARE`](/sql-statements/sql-statement-prepare.md) statement, you can choose to enable caching to reduce the cost of generating the execution plan in TiDB. For details, see [Execution Plan Cache](/sql-prepared-plan-cache.md).

gha_language: Python


text:
---
layout: default
---

# 1997-10-27 - $4370.00 a month for LIFE!!!!

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 99647b236a4b3089cba502017022d8737685e61d7e1a696ff44f3d7a227226c9

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-10-27 00:11:19 UTC

Raw Date: Sun, 26 Oct 1997 16:11:19 -0800 (PST)

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sun, 26 Oct 1997 16:11:19 -0800 (PST)
To<EMAIL_ADDRESS>Subject: $4370.00 a month for LIFE!!!!
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

To be removed from our list HIT REPLY and type "remove" in the subject.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HOW TO EARN A MONTHLY INCOME OF $4,370.00 or MORE FOR LIFE
JUST BY GIVING AWAY FREE CALLING CARDS!
 WE NEED YOU!)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And we are willing to pay you handsomely for your help.
Listen, I know your time is valuable, so I'll cut right
to the chase... We need enterprising people like you who
are interested in earning a RESIDUAL MONTHLY INCOME just
for giving away something of real value.

This is truly a great opportunity.
SKYCOM has made it easy for anyone to make money.
****THE INSIDE EDGE LETTER****

Thats right! WE WILL PAY YOU  very well simply for helping
us give away our FREE calling cards.  And you will earn a great commission every single time the cards are used --
weeks, months , even years after you give them away! Of
 course the obvious question you must have now is....
How am I going to make money giving away something for free?
Well that is a very good question, Fortunately, we have
a very good answer.

Actually, the answer is very simple...

<HTML><PRE>CLICK HERE TO CONTINUE!!! </PRE></HTML>
    (allow approx.10 seconds to load)

OR Simply point your Web Browser to:
http://www.mega-money.com/skycom2.htm

{% endraw %}
```

## Thread

+ Return to [October 1997](/archive/1997/10)

+ Return to "[highxt@juno.com](/authors/highxt_at_juno_com)"

+ 1997-10-27 (Sun, 26 Oct 1997 16:11:19 -0800 (PST)) - $4370.00 a month for LIFE!!!! -<EMAIL_ADDRESS>


text:
---
layout: page
title: Team
permalink: /team/
---

+ Current Time
{{ site.time }}

+ site.collections
{{ site.collections }}

{% highlight ruby %}
def show
  @widget = Widget(params[:id])
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @widget }
  end
end
{% endhighlight %}

{% highlight perl linenos %}
  use strict;

  while (<>)
  {
     chomp;
     my @fields = split "\t";
  }
{% endhighlight %}

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/)

You can find the source code for the Jekyll new theme at:
{% include icon-github.html username="jglovier" %} /
[jekyll-new](https://github.com/jglovier/jekyll-new)

You can find the source code for Jekyll at
{% include icon-github.html username="jekyll" %} /
[jekyll](https://github.com/jekyll/jekyll)


text:
# react-redux-reaction
React-redux basic chat app with emoji reactions (using pubnub)

## Concepts
- **Pub/Sub** is a pattern that enables communication in a network based on publishing messages to channels, and subscribing to those messages.

- **React context** is a way to share data between many components, without having to manually pass objects down through props.

- **The Context Provider Component** uses a value property to provide data to any nested component through its context field.

- The **Redux devtools** is an extension that allows you to examine the redux store state, and see actions being dispatched in real time.

## Tools

[Redux DevTools Extension](https://github.com/zalmoxisus/redux-devtools-extension)

repository: brentwhittaker/react-redux-reaction

repo_name: brentwhittaker/react-redux-reaction


text:
---
title: "socket.gethostbyaddr"
draft: false
weight: 12
katex: true
---

### `socket.gethostbyaddr(ip_address)`
- The functions translates an ip address into `(hostname, aliaslist, ipaddrlist)`
- `Hostname` is the primary host name responding to the given `ip_address`
- `Aliaslist` is a list of alternative host names for the same address
- `Ipaddrlist` is a list of IPv4/v6 addresss for the same interface on the same host

### Example of `gethostbyaddr`

```python
>>> import socket
>>> socket.gethostbyaddr('<IP_ADDRESS>')
('43-8.any.icann.org', ['<IP_ADDRESS>.in-addr.arpa'],
 ['<IP_ADDRESS>'])
```

### References
- [Python Essential Reference](http://index-of.co.uk/Python/Python%20Essential%20Reference,%20Fourth%20Edition.pdf)
- [Documentation for socket API](https://docs.python.org/3/library/socket.html)


text:
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0] - 2021-06-24

This is the first version of the project, it include all basic project configuration and the implementation of login, home and celebrity detail views.

#### Added

- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/1)
  Add main configuration.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/5)
  Add layout homepage view.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/6)
  Add login view.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/7)
  Add login with email, facebook and google methods.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/12)
  Add mobile homepage view.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/13)
  Add celebrity detail view.
- [CELEBRITY-WIKI-FRONT](https://github.com/ithzavg/celebrity-wiki-front/issues/15)
  Add search bar component.

repository: ithzavg/celebrity-wiki-front

repo_name: ithzavg/celebrity-wiki-front


text:
---
title: Managing my healthcare costs
permalink: /government-services/stay-healthy/subsidies-assistance/
published: false
---

## Managing my healthcare costs

### Healthcare Schemes and Subsidies

**CPF Schemes for Healthcare**

In Singapore, there are a few schemes you (as a CPF member) could tap on when you have a heavy medical bill to pay for.

- MediSave: a personal medical savings account-as a monthly contribution from our income (if you are an employed worker)

- MediShield Life:a nation-wide basic healthcare insurance plan to help offset some of the costs from large hospital bills and selected outpatient treatments

If you are sick or injured, you can check how much you can claim by using this calculator

See Also: Integrated Shield plans

**Medical subsidies**

Since 1 Nov 2019, all Singapore citizens are now eligible to apply for the Community Health Assist Scheme (CHAS) - which offers you to get medical subsidies for medical and/or dental care at selected GP clinics.

Apply for your CHAS card for you and your household if you have yet to do so.

For details, see Information on CHAS subsidies.

Related: More information on other Healthcare Schemes and Subsidies

### Caring for someone with a condition

You could get support if you are caring for someone with an injury/illness.

Here's a 1-minute tool to check your eligibility for the financial assistance schemes available.

You can also apply for the Caregivers Training Grant (CTG) to learn how to help your loved ones better in daily care.

### Other Related Links:

- How to apply Medical Fee Exemption Card for a loved one staying in nursing homes

- Apply for Home Caregiving Grant

**Back to [I Want to Stay Healthy](/government-services/stay-healthy/)**


text:
---
date: 2020-02-18
title: How to Update a Chromebook
description:
published: true
type: Document
categories:
  - "quick fixes"
---
Posted by Edward Jacques on February 18, 2020

Another article in a recurring series of _common problems_ we see in the IT Department.

### Symptoms

The chromebook does not seem to be "behaving" correctly.

### Possible Cause

With regular use, Chromebooks require very little maintenance.  However, if a device has been offline for an extended period of time (either physically powered off or disconnected from the network) it may no longer autoupdate and behave erratically.

Thankfully, if this is the case, solving the problem is often as simple as running a manual ChromeOS update.

### Possible Resolution - Running a Manual ChromeOS Update

Any agawamed.org user can do this!

- Log in to the chromebook
- Open the Chrome web browser
- Type in **chrome://help** in the address bar.
- Click **Check for Updates**

You can continue to work as the update downloads in the background.  Simply be sure to **shut down** the chromebook when you are done working and the update will install the next time you boot up your chromebook!


text:
<!---
# This file is part of the pl.wrzasq.lambda.
#
# @license http://mit-license.org/ The MIT license
# @copyright 2019 © by Rafał Wrzeszcz - Wrzasq.pl.
-->

# Using in CloudFormation

This resource handler manages organizational units of the organization.

**Note:** To simplify the naming of project packages the Lambda (and it's package) is called `organization unit`, but
actual AWS resource type which it manages is called `organizational unit` (different is the _organization**al**_ word).

# Required permissions

`lambda-cform-organization-unit` Lambda needs following permissions:

-   `organizations:CreateOrganizationalUnit`,
-   `organizations:DeleteOrganizationalUnit`,
-   `organizations:DescribeOrganizationalUnit`,
-   `organizations:ListParents`.

Additionally you may want to add following policies to it's role:

-   `arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole` (if you want to see **CloudWatch** logs of
resource handler execution);
-   `arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess` (if you want more detailed tracing, package is built with
**X-Ray** instrumentor).

# Properties

## `name` (required) - string

Name of the OU.

## `parentId` (required) - string

ID of the parent node in the organization structure (root or another OU).

**Note:** Changing parent effectively removes the OU and creates new one in new tree location.

# Output values

Deploy handler exposes entire
[OrganizationalUnit](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/organizations/model/OrganizationalUnit.html)
object.

**Note:** Custom resource physical ID is set as created organizational unit ID.

# Example

```yaml
    OrganizationUnitManagerRole:
        Type: "AWS::IAM::Role"
        Properties:
            AssumeRolePolicyDocument:
                Statement:
                    -
                        Action: "sts:AssumeRole"
                        Effect: "Allow"
                        Principal:
                            Service:
                                - "lambda.amazonaws.com"
            ManagedPolicyArns:
                - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
            Policies:
                -
                    PolicyName: "AllowManagingOrganizations"
                    PolicyDocument:
                        Version: "2012-10-17"
                        Statement:
                            -
                                Action:
                                    - "organizations:CreateOrganizationalUnit"
                                    - "organizations:DeleteOrganizationalUnit"
                                    - "organizations:DescribeOrganizationalUnit"
                                    - "organizations:ListParents"
                                Effect: "Allow"
                                Resource:
                                    - "*"

    OrganizationUnitManager:
        Type: "AWS::Lambda::Function"
        Properties:
            Runtime: "java11"
            Code:
                # put your source bucket
                S3Bucket: "your-bucket"
                S3Key: "lambda-cform-organization-unit-1.0.3-standalone.jar"
            Handler: "pl.wrzasq.lambda.cform.organization.unit.Handler::handle"
            MemorySize: 256
            Description: "AWS Organizational Unit manager deployment."
            Timeout: 300
            TracingConfig:
                Mode: "Active"
            Role: !GetAtt "OrganizationUnitManagerRole.Arn"

    OrganizationUnit:
        Type: "AWS::CloudFormation::CustomResource"
        Properties:
            # reference to deploy function
            ServiceToken: !GetAtt "OrganizationUnitManager.Arn"
            name: "internal services"
            # assume Organization is a resource created by lambda-cform-organization handler
            parentId: !GetAtt "Organization.RootId"
```


text:
I represent the connection between the user that is currently logged in (a GrUser) and the repositories/reviews that are locally open. All operations on these reviews will be done by the agent represented by the user.

I am used to access the local reviews and repositories, and can also be asked for all repositories which is a merged collection of the local and non-local repositories.

Public API and Key Messages

- allRepositories returns a merged collection of the local and non-local repositories.
- localRepositories returns just the repositories active in this context.
- Send withLoggedInUser: with a GrUser as parameter to instantiate me.

Internal Representation and Key Implementation Points.

    Instance Variables
	localRepositories:		an OrderedCollection of GrRepositories
	loggedInUser:		a GrUser that is seen as "logged in".

repository: Balletie/Griotte

repo_name: Balletie/Griotte


text:
# go-whosonfirst-hash

Go package for working with hashes in Who's On First documents

## Install

You will need to have both `Go` (specifically a version of Go more recent than 1.6 so let's just assume you need [Go 1.8](https://golang.org/dl/) or higher) and the `make` programs installed on your computer. Assuming you do just type:

```
make bin
```

All of this package's dependencies are bundled with the code in the `vendor` directory.

## Important

This is almost certainly not a general purpose package. It is shaped like the day-to-day needs of Who's On First in mid-2017...


text:
![](https://github.com/waldronlab/AnVILWorkshop/workflows/.github/workflows/basic_checks.yaml/badge.svg)

# Introduction to the Terra/AnVIL Cloud-based Genomics Platform

## Instructor names and contact information
Sehyun Oh*<EMAIL_ADDRESS>[1]
Levi Waldron*<EMAIL_ADDRESS>[1]
Jennifer Wokaty<EMAIL_ADDRESS>[1]
Lori Shepherd<EMAIL_ADDRESS>[2]
Kayla Interdonato<EMAIL_ADDRESS>[2]
Marcel Ramos<EMAIL_ADDRESS>[2]
Martin Morgan<EMAIL_ADDRESS>[2]
Nitesh Turaga<EMAIL_ADDRESS>[3]
BJ Stubbs<EMAIL_ADDRESS>[3]
Vince Carey<EMAIL_ADDRESS>[3]

[1] CUNY Graduate School of Public Health and Health Policy and Institute for Implementation Science in Population Health, New York, 10027, USA
[2] Roswell Park Comprehensive Cancer Center, Buffalo, New York, 14203, USA
[3] Channing Division of Network Medicine, Harvard Medical School, Boston, Massachusetts, 02115, USA

## Workshop Description

The rapidly growing size of genomic datasets introduces
challenges of data transfer, storage, access, sharing, and computing. In this workshop,
we introduce cloud-based genomics platform [Terra](https://anvil.terra.bio/)
as a potential solution. Terra hosts large-scale genomic and genomic-related data
sets and provide secure remote access to them and to individually uploaded data resources. Terra
also provides on-demand computational capacity through Google Cloud Platform, and
interactive analysis interfaces such as Jupyter notebook and RStudio. Users can
run best practice tools and pipelines already implemented or upload their own
data or analysis methods to workspaces. Workshop participants will learn how to
use Terra through the use-case examples, instructor-led live demonstration, and the
Bioconductor AnVIL package.

This workshop is supported by the [NHGRI Genomic Data Science Analysis, Visualization and Informatics Lab-space (AnVIL)](https://anvilproject.org/)

## Pre-requisites

* Basic knowledge of R syntax
* [Optional] Terra account setup
1. Visit https://anvil.terra.bio/#
2. Select the ‘HAMBURGER’ menu in the top left corner
3. Choose ‘Sign in with Google’

<img src="https://raw.githubusercontent.com/waldronlab/AnVILWorkshop/master/vignettes/images/signin.png" alt="Sign-in" style="width:140px;height:200px;">

## Workshop Participation

Participants will have the opportunity to access a pre-populated Terra workspace and run examples.

## _R_ / _Bioconductor_ packages used

* [AnVIL](https://bioconductor.org/packages/release/bioc/html/AnVIL.html)
* [AnVILPublish](https://bioconductor.org/packages/release/bioc/html/AnVILPublish.html)

## Time outline

| Activity                                              | Time |
|-------------------------------------------------------|------|
| Account Setup                                         | 10m  |
| Overview                                              | 15m  |
| Use Cases                                             | 15m  |
| Live Demo                                             | 20m  |
| Hands-on Session                                      | 30m  |

## Learning Goals

* Gain familiarity with cloud-based genomics platforms
* Learn how to access data sets and tools provided through Terra
* Learn how to use interactive analysis apps, including group sharing of a workspace and billing
* Understand the benefit and shortcoming of Terra

## Specific objectives

* Setup Terra account
* Clone a public/sharable workspace
* Create a new workspace and import datasets/ workflows/ notebooks
* Use Jupyter notebook and RStudio in Terra
* Use AnVIL package to access Terra and R/Bioconductor resource

## Acknowledgement
#### Funding
NHGRI supports AnVIL through [cooperative agreement awards](https://www.genome.gov/Funded-Programs-Projects/Computational-Genomics-and-Data-Science-Program/Genomic-Analysis-Visualization-Informatics-Lab-space-AnVIL#awards) to the [Broad Institute](https://projectreporter.nih.gov/project_info_description.cfm?aid=9788512&icde=46222930&ddparam=&ddvalue=&ddsub=&cr=1&csb=default&cs=ASC&pball=) (#5U24HG010262) and [Johns Hopkins University](https://projectreporter.nih.gov/project_info_description.cfm?aid=9789931&icde=46222940&ddparam=&ddvalue=&ddsub=&cr=2&csb=default&cs=ASC&pball=) (#5U24HG010263).

#### Links
Bioconductor AnVIL: https://anvil.bioconductor.org/
AnVIL project website: https://anvilproject.org/
AnVIL Terra: https://anvil.terra.bio/
Dockstore: https://dockstore.org/
GEN3: https://gen3.org/

repository: waldronlab/AnVILWorkshop

gha_language: Dockerfile

gha_license_id: NOASSERTION

repo_name: waldronlab/AnVILWorkshop


text:
---
title: Random Sampling on SO(3)
key: 20201016
tags:
- math
- robotics
- three.js
- visualization
mathjax: true
---

This post introduces random sampling on the 3D rotation group SO(3), which can be useful in robotics or other applications, but is also error-prone. Visualization and explanation of two correct methods and two wrong ones are included.

## Before you read

If you just want to find a correct and elegant algorithm and save some time, directly jump to [this section](#quaternion) or [this link](http://planning.cs.uiuc.edu/node198.html).

## Introduction

Random sampling on $\mathrm{SO}(2)$ is easy. For example,

$$R = \begin{bmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{bmatrix} \in \mathrm{SO}(2)$$

with $\theta \sim \mathcal{U}(0, 2\pi)$ works. This easiness, in my opinion, comes from this concept: uniform random angles yield uniform random 2D rotations. Unfortunately, this concept only works for 2D. For higher dimensions, the [Haar measure](https://en.wikipedia.org/wiki/Haar_measure) should be used for randomness.

In this post, I will show two typical wrong methods for random sampling on $\mathrm{SO}(3)$, and also introduce two correct ones. The following sections are organized based on various representations. You can probably see the pattern that when angles appear in the representation, people tend to make mistakes. Actually, I've seen similar mistakes in many open source repositories, and this is one of the reasons why I want to write this post.

By the way, it is still possible to correct the wrong methods, but that requires sampling angles in a specific distribution, which is harder to implement and not encouraged.

## Demo

Try different methods and the number of points in the control panel.

Numerically testing the randomness is actually even harder than implementing the algorithms. An alternative is to apply random 3D rotations to a 3D vector, and see if the resulting points are uniformly distributed on a sphere. Here in the demo I visualize all the points coming from the vector $[1, 0, 0]^T$, which is at least sufficient to show that the "Euler" and "AxisAngle" methods are incorrect.

## Sampling methods

### Euler angles

A common but wrong method with the Euler angles:

$$R(\alpha, \beta, \gamma) = R_z(\alpha) R_y(\beta) R_x(\gamma) \in \mathrm{SO}(3)$$

where $\alpha \sim \mathcal{U}(-\pi, \pi)$, $\beta \sim \mathcal{U}(-\pi/2, \pi/2)$ and $\gamma \sim \mathcal{U}(-\pi, \pi)$ (i.i.d.). To intuitively understand why this method does not generate uniform random 3D rotations, consider the singularities: if the pitch angle $\beta$ is close to $\pm\pi/2$, then $\alpha$ and $\gamma$ will have almost the same contribution to $R$, resulting in many redundant samples around the singularities. You can verify in the demo that the blue and yellow (close to the blue $z$-axis) points are denser.

{% highlight javascript %}
case "Euler":
  var yaw = rand(-PI, PI);
  var pitch = rand(-PI / 2, PI / 2);
  var roll = rand(-PI, PI);
  var euler = new THREE.Euler(yaw, pitch, roll, "ZYX");
  return new THREE.Quaternion().setFromEuler(euler);
{% endhighlight %}

### Axis-angle

A less common but also wrong method with axis-angle representation:

$$R(\mathbf{v}, \theta) \in \mathrm{SO}(3)$$

where we pick a uniform random axis $\mathbf{v} \in \mathbb{S}^2$ and an angle $\theta \sim \mathcal{U}(-\pi, \pi)$. Again, consider the singularities: if the angle $\theta$ is close to zero, then $R$ is almost the same regardless of $\mathbf{v}$; if the angle $\theta$ is close to $\pm\pi$, then $R$ can be drastically different depending on $\mathbf{v}$. Therefore, the red points (close to the red $x$-axis) are denser.

{% highlight javascript %}
case "AxisAngle":
  var axis = new THREE.Vector3(randn(), randn(), randn()).normalize();
  var angle = rand(-PI, PI);
  return new THREE.Quaternion().setFromAxisAngle(axis, angle);
{% endhighlight %}

PS: Random sampling on $\mathbb{S}^2$ can be done in this way:

$$\mathbf{v} = \frac{1}{\sqrt{v_1^2 + v_2^2 + v_3^2}} \begin{bmatrix}v_1 \\ v_2 \\ v_3\end{bmatrix}$$

where $v_1, v_2, v_3 \sim \mathcal{N}(0, 1)$ (i.i.d.). This method can be extended to higher dimensions.

PPS: It seems that there is no existing `randn()` function in JavaScript's built-in math library and [math.js](https://mathjs.org/), so I implement it using the [Box-Muller transform](https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform):

$$z_0 = \sqrt{-2\ln u_1} \cos (2\pi u_2),\quad z_1 = \sqrt{-2\ln u_1} \sin (2\pi u_2) \sim \mathcal{N}(0, 1)$$

where $u_1, u_2 \sim \mathcal{U}(0, 1)$ (i.i.d.).

### Rotation matrix

This method using rotation matrix is very classical and easy to understand. Recall how we did random sampling on $\mathbb{S}^2$ in the previous section. This time we start with a 3-by-3 matrix whose entries are all independent standard normal random variables. Then we use the [Gram-Schmidt process](https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process) to orthonormalize three column vectors. Equivalently, we can apply the [QR decomposition](https://en.wikipedia.org/wiki/QR_decomposition) to get the orthogonal matrix. (Here the common notation $A = QR$ can be a little confusing because $Q$ is orthogonal and $R$ is upper triangular.) The spatial symmetry can guarantee the uniform randomness of the resulting matrix.

However, this algorithm has two problems:

1. This is actually sampling on $\mathrm{O}(3)$ instead of $\mathrm{SO}(3)$. To fix this, flip the sign when the matrix determinant is $-1$.
2. The QR decomposition is not unique. For example, $A = QR = (-Q)(-R)$. The actual implementation of this decomposition may prefer some kind of orthogonal matrices and make your results not uniformly distributed. I had this issue when using MATLAB (but math.js seems ok). To fix this, make sure the diagonal elements of the upper triangular matrix are all positive (see line 10).

{% highlight javascript linenos %}
case "RotationMatrix":
  var a = math.matrix([
    [randn(), randn(), randn()],
    [randn(), randn(), randn()],
    [randn(), randn(), randn()],
  ]);
  var qr = math.qr(a);
  var q = qr.Q;
  var r = qr.R;
  q = math.multiply(q, math.diag(math.sign(math.diag(r))));
  if (math.det(q) < 0) {
    q = math.multiply(q, -1);
  }
  q.resize([4, 4]);
  var rot = new THREE.Matrix4().fromArray(q.valueOf().flat());
  return new THREE.Quaternion().setFromRotationMatrix(rot);
{% endhighlight %}

### Quaternion

The quaternion

$$h = (\sqrt{1-u_1}\sin(2\pi u_2), \sqrt{1-u_1}\cos(2\pi u_2), \sqrt{u_1}\sin(2\pi u_3), \sqrt{u_1}\cos(2\pi u_3))$$

with $u_1, u_2, u_3 \in \mathcal{U}(0, 1)$ (i.i.d.) generates uniform random elements in $\mathrm{SO}(3)$. This algorithm is my favorite one. Only three random variables, only uniform distribution involved, and directly in quaternion form.

{% highlight javascript %}
case "Quaternion":
  var u1 = rand(0, 1);
  var u2 = rand(0, 1);
  var u3 = rand(0, 1);
  var x = Math.sqrt(1 - u1) * Math.sin(2 * PI * u2);
  var y = Math.sqrt(1 - u1) * Math.cos(2 * PI * u2);
  var z = Math.sqrt(u1) * Math.sin(2 * PI * u3);
  var w = Math.sqrt(u1) * Math.cos(2 * PI * u3);
  return new THREE.Quaternion(x, y, z, w);
{% endhighlight %}

An intuitive explanation can be found [here](http://planning.cs.uiuc.edu/node198.html) and a comprehensive one can be found [here](https://doc.lagout.org/Others/Game%20Development/Programming/Graphics%20Gems%203.pdf#page=156) (this is probably where it was proposed). I will not go through the derivation step by step here, but I would like to talk about its origin: [the subgroup algorithm](https://statweb.stanford.edu/~cgates/PERSI/papers/subgroup-rand-var.pdf). Essentially, the "quaternion" method is the subroup algorithm with brilliant simplification for the case of $\mathrm{SO}(3)$.

The subgroup algorithm itself can handle $\mathrm{SO}(n)$ with higher dimensions and even other compact groups. A rough analogy is how you would do random sampling in a unit cube: pick a random $x$ in a unit segment, then a random $y$ to get $(x, y)$ in a unit square, then a random $z$ to get $(x, y, z)$ in a unit cube. Using fancy language, the idea is to go through a nested subgroup chain by choosing a random coset representative at every step. In the case of going from $\mathrm{SO}(2)$ to $\mathrm{SO}(3)$, imagine you first do a random rotation about $z$-axis (a random element in $\mathrm{SO}(2)$), and then rotate the $z$-axis to a random direction (a random coset representative). The latter rotation can be done by a [Householder transformation](https://en.wikipedia.org/wiki/Householder_transformation) followed by a negation to flip the determinant from $-1$ to $+1$.

PS: It is also possible to use uniform random elements of $\mathbb{S}^3$ as quaternions. This is easier to understand, but only works for $\mathrm{SO}(3)$.

## More details

This post is more about the visualization and intuitive explanation rather than rigorous derivation. Please refer to the links above and the reference [here](https://en.wikipedia.org/wiki/Rotation_matrix#Uniform_random_rotation_matrices) for further reading on group structures, the Haar measure, etc. In implementation, it would be also good to consider numerical issues. For example, discard $u_1=0$ in the Box-Muller transform. (I ignored most of these due to my laziness...)

<link rel="stylesheet" href="/assets/share/style.css">


text:
Upgrade instructions
====================

Pre-Release Notes
-----------------

- Since v0.6, the dependency management was changed from plain `requirements.txt` files to be [Pipenv](https://github.com/pypa/pipenv) managed.
  The old `requirements.txt` based method will be supported until v0.8.

Upgrading 0.5 to 0.6
--------------------

Release 0.6 changed the application configuration to be largely based on environment variables instead of the operator
providing a custom `settings.py` file.

Most settings which previously had to be defined can now be given as environment variables but with an `IT_` prefix.
See [the README](https://github.com/bit-bots/imagetagger#configuration) on more details.

If desired, a custom configuration file can still be supplied. This is explained in the README as well.

Upgrading 0.4 to 0.5
--------------------

Release 0.5 introduces a custom user model and changes the settings layout.
Therefore, additional steps are required for an upgrade from pre-0.5.

### Custom User Model

The following steps should be taken with commit 362a36a868a68fd0623cc549edee3d4105d9e0c8 checked out (i.e., the commit that initially introduced the user model).

Make sure that your settings contain the following (after returning to master, that configuration value can be removed again as it is contained in the new settings_base):

    AUTH_USER_MODEL = 'users.User'

Then, open a database shell (e.g., ./manage.py dbshell):

    TRUNCATE django_migrations;
    ALTER TABLE auth_user RENAME TO users_user;
    ALTER SEQUENCE auth_user_id_seq RENAME TO users_user_id_seq;
    ALTER TABLE auth_user_groups RENAME TO users_user_groups;
    ALTER SEQUENCE auth_user_groups_id_seq RENAME TO users_user_groups_id_seq;
    ALTER TABLE auth_user_user_permissions RENAME TO users_user_user_permissions;
    ALTER SEQUENCE auth_user_user_permissions_id_seq RENAME TO users_user_user_permission_id_seq;

Populate the migrations table again:

    ./manage.py migrate --fake

Afterwards, the user model should be usable. You can check out the most recent commit of the release and run normal migrations up to there:

    ./manage.py migrate

### Configuration

Make sure that your settings contain the following line at the top:

    from .settings_base import *

The configuration layout was changed to allow simpler updates to the configs in the future. All generic settings
are in the settings_base.py file now, which is loaded by the settings.py file. This way, the settings.py contains only the
settings the admin needs to change. For some of them, defaults are defined in the settings_base.

To migrate it would be best to apply your changes to the new settings.py.example template as then new settings with
defaults can be introduced without braking your deployment.

### Calculating points

If you have existing data after updating from 0.4, the points (which are incremented and decremented by a database trigger will be wrong. To recalculate them, run:

    ./manage.py updatepoints

repository: bit-bots/imagetagger

repo_name: bit-bots/imagetagger


text:
# Opt-in requirements

* **Type**: Design proposal
* **Authors**: Alexander Udalov, Mikhail Glukhikh
* **Previously known as**: Experimental API support
* **Discussion and feedback**: [KEEP-95](https://github.com/Kotlin/KEEP/issues/95)

This proposal describes a mechanism that will allow library authors to provide API that requires explicit opt-in from their clients. The proposed mechanism makes it possible to declare that the API requires opt-in, and to opt in to that API at the call site. Without such explicit consent from the user, a warning or an error is reported on usages.

An example use case is experimental API which, although publicly released as a part of the library, may break at any moment and its usages will need to be recompiled. The ultimate goal is to allow library authors to release APIs earlier and more frequently without fear of the necessity to support an incorrectly designed API for a long time because of source and/or binary compatibility.

## Use cases

* **In the Kotlin standard library**
  * Annotations for type inference (`@Exact`, `@OnlyInputTypes`, etc.): we'd like to publish them, but don't want to commit to never changing semantics (see   [KT-13138](https://youtrack.jetbrains.com/issue/KT-13138), [KT-13198](https://youtrack.jetbrains.com/issue/KT-13198))
  * Bitwise operations for small integer types.
  * Certain features for kotlin-reflect, that we're not sure about (see [KT-15987](https://youtrack.jetbrains.com/issue/KT-15987), [KT-15992](https://youtrack.jetbrains.com/issue/KT-15992))
  * New functions that get added to the standard library (`@ExperimentalStdlibApi`) for public preview.
* **Other libraries**
  * Experimental declarations for public preview.
  * Internal declarations that should not be used outside of the library, but are `public` for some other reason.
  * Fragile or delicate APIs that need a lot of expertise to use and thus require an explicit opt-in.

## Goals

* Clear **opt-in** required for all users whose code may be broken by changes to the API.
* **Granularity**: one should be able to mark a small part of an API so that only the users of that part are required to opt in.
* **Smooth graduation**: if the API doesn't need to be changed as soon as it *graduates* (i.e. no longer requires opt-in), just unmark it, and all clients remain binary compatible.
* **Garbage collection upon graduation**: when the API graduates, the opt-in flags/markers are highlighted as warnings (and subsequently, errors) so that clients know to remove them.

## Initial observations

* One solution for the experimental API use case would be to use whole packages for experimental declarations, e.g. `kotlin.experimental`, `kotlin.jvm.experimental`, ... However, this is not granular enough and smooth graduation is not possible, because even if the API was completely fine from the start, it's going to be moved to a non-experimental package eventually, which will break binary clients.

> This solution was originally used for coroutines, originally placing them into `kotlin.coroutines.experimental` package and is still used
> for some bitwise operators in `kotlin.experimental` package.

* A more natural solution would involve some explicit binary-retained annotation on each declaration. This way, the compiler can check each call and each class usage, and report a warning/error if that symbol requires opt-in but no consent to using it has been given by the user. However, just one annotation isn't enough, because we'd like to force the user to opt in to each API (= group of declarations) separately. This is why we propose a design below where each API declares its own marker annotation, which must be used at call sites.
    * We've explored the possibility of using a “string tag” argument instead of custom marker annotations (e.g. `@RequiresOptIn(“kotlin.ExperimentalTypeInference”) ...`) but discarded it because it's not as clean, involves more typing and reading, requires not to make typos, and complicates the implementation, especially in the IDE.
* There's a number of ways to express the opt-in to use an API, but a source-retained annotation (“local” opt-in) and a command line argument (“global” opt-in) would seem the most natural choices.

## Proposal

We propose to add the following declarations to the standard Kotlin library:

```kotlin
package kotlin

@Target(ANNOTATION_CLASS)
@Retention(BINARY)
annotation class RequiresOptIn(
    val message: String = "",
    val level: Level = Level.ERROR
) {
    enum class Level { WARNING, ERROR }
}

@Target(CLASS, PROPERTY, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION,
        PROPERTY_GETTER, PROPERTY_SETTER, EXPRESSION, FILE, TYPEALIAS)
@Retention(SOURCE)
annotation class OptIn(
    vararg val markerClass: KClass<out Annotation>
)
```

The `RequiresOptIn` annotation is applied to an annotation class, and it makes that class an **opt-in requirement marker**. There are two sets of use cases where markers are used:

1. If a declaration is annotated with the marker, it requires opt-in to that marker and can use other API *with that same marker* in its body.
2. If a declaration or an expression is annotated with `@OptIn(Marker::class)`, it can use other declarations that use the selected marker, but it does not require opt-in itself (its clients will not *have* to opt in).

The first option of usage of opt-in requirement markers is called a **propagating opt-in** (the annotation effectively causes propagation of the requirement), and the second — a **non-propagating opt-in**. The user is free to choose whichever option is preferable in each scenario.

Example:

```kotlin
// Library code:

@RequiresOptIn
annotation class ShinyNewAPI

// Class Foo requires opt-in with marker ShinyNewAPI
@ShinyNewAPI
class Foo { ... }

// Function bar requires opt-in with marker ShinyNewAPI
@ShinyNewAPI
fun Foo.bar() = ...

// Usage:

// Function shinyNewFeature() uses API marked with ShinyNewAPI
// and thus is also, conceptually, a part of ShinyNewAPI and so it is marked as such.
@ShinyNewAPI
fun shinyNewFeature() = Foo().bar()

// Function doSomething uses API marked with ShinyNewAPI and is also
// required to use the OptIn marker annotation.
// Here, we choose a non-propagating opt-in, because the
// API is used in the function body and it should not concern our clients
@OptIn(ShinyNewAPI::class)
fun doSomething() {
    val foo = Foo()
    foo.bar()
}
```

Note that by opting into the API with the propagating opt-in, `shinyNewFeature` effectively requires opt-in itself (with the same marker annotation).
In theory, we could distinguish initial introduction of the API and its propagating usages, but it would complicate the proposal a bit and there doesn't seem to be much value in doing that.

Both opt-in mechanisms allow to use the API for the selected markers anywhere in the parse tree lexically under the annotated element.

Using `OptIn` with annotations that are *not* opt-in requirement markers has no effect and yields a compilation warning. (Note that this must not be an error because user code should not break once an annotation is no longer an opt-in requirement marker.) Using `OptIn` with no arguments has no effect and yields a warning as well.

## Opt-in requirement message

When using an API that requires opt-in without the said opt-in, the compiler reports a warning or an error depending on the specified level. It's possible to specify a custom message in `RequiresOptIn`, that will be reported by the compiler. If no message is given (i.e. if `message` is empty), the compiler will report that the API is *experimental*:

```
test.kt:22:9: error: this declaration requires an explicit opt-in annotation marker to be used. Please read and understand the caveats in the documentation of `ShinyNewAPI` first.
If you are willing to use it, mark the usage with '@ShinyNewAPI' to propagate opt-in marker requirement to further users or with '@OptIn(ShinyNewAPI::class)' to hide this usage as an implementation detail.'
    foo.bar()
        ^
```

## Opt-in for whole modules

Annotating every usage of some API might quickly become annoying, especially for application modules, where the developer does not care about the clients of the code simply because application modules have no clients. In such cases, it'd be useful to have a module-wide switch to opt in to the API.

We introduce a new CLI argument to kotlinc, `-opt-in=org.foo.Ann`, where `org.foo.Ann` is a fully qualified name of the opt-in requirement marker, which enables the corresponding API for the module. It's as if the *whole module* was annotated with `@OptIn(org.foo.Ann::class)`.

The compiler will check the value of `-opt-in` in the same way it checks the argument of the `@OptIn` annotation. In particular, if any of the annotations mentioned in the `-opt-in` are deprecated, the compiler is going to report a warning or error, depending on the deprecation level.

In a previous version of this proposal, we discussed the possibility of introducing another argument, `-Xexperimental=org.foo.Ann`, to use the propagating opt-in on the whole module (i.e. mark the whole module as "experimental" in terms of that proposal). The implementation of that feature turned out to be unexpectedly complicated, and it wasn't widely used, so we've decided not to add it at this point.

## Opt-in requirement of RequiresOptIn/OptIn themselves

Annotations `RequiresOptIn` and `OptIn` are proposed to be added to the Kotlin standard library. Since we're not yet sure that this design is optimal, we would like to test it first, and see if we can finalize it. Therefore, we would like to keep this whole feature experimental itself, in the sense that we may change something incompatibly, and the client code must be aware of it.

Therefore, we will **require** each user of `RequiresOptIn` to provide at least one `-opt-in` compiler argument, which would mean that the user understands the risks of using this experimental functionality. It can be either `-opt-in=...` with any opt-in requirement marker, or the magic predefined argument `-opt-in=kotlin.RequiresOptIn` which doesn't allow using any API by itself, yet merely allows using `RequiresOptIn` and `OptIn` in the source code. Unless one of these arguments is provided, the compiler will report a warning on each usage of `RequiresOptIn` or `OptIn` (but not on usages of the markers!).

Besides, we will also prohibit any usages of `RequiresOptIn`, `OptIn` and markers that do not aim to make use of the functionality declared in this proposal. The goal is to minimize the number of binary compatibility problems of user-compiled code if we decide to change something incompatibly. For example, you won't be able to use these classes as types:

```kotlin
// Error! RequiresOptIn cannot be used as a type
fun get(e: RequiresOptIn) = ...
```

In particular, this means that:

1. `RequiresOptIn` and `OptIn` may only be used as annotations (but not as arguments to other annotations), as references in the import statement, or as qualifiers (to be able to access nested classes, e.g. `RequiresOptIn.Level`)
2. Markers may only be used as annotations, as references in the import statement, or as a left-hand side to `::class` literal in `OptIn` or `WasExperimental` (see below) arguments

## RequiresOptIn, experimental declarations in the standard library and SinceKotlin

For declarations in the standard library, as soon as a declaration is released, it'll have to be annotated with `@SinceKotlin(X)`, where X is the earliest version, since which there have been no incompatible changes to the declaration. However, the `-api-version` compatibility argument will have no knowledge of how that declaration looked before it was released, i.e. the declaration will not be visible with `-api-version Y` for `Y < X`, even if it was present in the version Y and the opt-in was given by the user.

We don't intend to solve this problem completely because this would require us to know how the declaration looked in each release before it finally graduated (remember that experimental declarations can undergo binary-incompatible changes). To fix this at least partially, we'll add an **internal** standard library annotation `WasExperimental`:

```kotlin
package kotlin

@Target(CLASS, PROPERTY, CONSTRUCTOR, FUNCTION, TYPEALIAS)
@Retention(BINARY)
internal annotation class WasExperimental(
    vararg val markerClass: KClass<out Annotation>
)
```

Usages of declarations annotated with `WasExperimental` are allowed even if the API version requirement is not satisfied, provided that the opt-in to all mentioned markers is given.

This feature allows us to release new standard library API in patch releases, further graduating it in a minor release. For example, suppose a function `foo` appears in the standard library as experimental in Kotlin 1.4.30. Since it's not yet graduated, it's **not** annotated with `SinceKotlin`:

```kotlin
// kotlin-stdlib 1.4.30

@ExperimentalStdlibAPI
fun foo(s: String) {}
```

where [`ExperimentalStdlibAPI`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-experimental-stdlib-api/index.html) is an opt-in requirement marker for experimental API in the standard library, introduced in Kotlin 1.3.40:

```kotlin
@RequiresOptIn
annotation class ExperimentalStdlibAPI
```

In Kotlin 1.5, the function is graduated (hence `SinceKotlin(“1.5”)`) and therefore is no longer annotated with `ExperimentalStdlibAPI`. To allow users to opt in to it on 1.4.30 however, we also annotate it with `WasExperimental` so that for example the CLI argument `-opt-in=ExperimentalStdlibAPI` would work. (Of course, it also makes it possible to use it on 1.4.0...1.4.29, where there was no such function and linkage errors would arise, but we explicitly decide not to solve this problem.)

```kotlin
// kotlin-stdlib 1.5

@WasExperimental(ExperimentalStdlibAPI::class)
@SinceKotlin("1.5")
fun foo(s: String) {}
```

## OptIn markers and overridden declarations

As a general rule, marker annotation should present either at base and overridden declarations together,
or at an overridden declaration only, or at none of them.
Using marker on base declaration only provokes error or warning on overridden declaration, depending on marker `RequiresOptIn.level`.

```kotlin
open class Base {
    @ShinyNewAPI
    open fun foo() {}

    @ShinyNewAPI
    open fun foooo() {}

    @ShinyNewAPI
    open fun baz() {}
}

class Derived {
    @ShinyNewAPI
    override fun foo() {} // OK!

    @OptIn(ShinyNewAPI::class)
    override fun foooo() {} // OK!

    // Overriding experimental declaration
    override fun baz() {} // ERROR/WARNING (depending on ShinyNewAPI level)
}
```

## OptIn marker contagiousness (type usages)

In Kotlin 1.5.30 we introduced contagiousness rules based on type usages.
As a rule of thumb, all places which break if some experimental type disappear
from a library should receive opt-in usage warning/error,
even if this experimental type is used implicitly.

Some class-based type is considered "requiring opt-in annotation marker" if its class requires opt-in marker,
and/or any of its type arguments requires opt-in marker.
For example, using `MyClass<MyArg>` requires opt-in marker if either `MyClass` or `MyArg` require this marker.
So class with opt-in marker annotation makes all types using it "requiring opt-in marker",
as well as all types using its nested/inner classes.

Consider the following example

```Kotlin
@ShinyNewAPI
class Shiny

@OptIn(ShinyNewAPI::class)
fun foo(): Shiny = Shiny()

@OptIn(ShinyNewAPI::class)
fun bar(arg: Shiny = Shiny()) {}

@OptIn(ShinyNewAPI::class)
fun Shiny?.baz() {}

fun use() {
    // Three implicit usages of 'Shiny' type
    val s = foo()
    bar()
    null.baz()
}
```

All three calls `foo()`, `bar()` and `baz()` inside `fun use()` use `Shiny` type implicitly,
thus all three should receive opt-in usage warning/error. We can negate it using either `@ShinyNewAPI`
or `@OptIn(ShinyNewAPI::class)` at `fun use()` itself.
Pay attention that `@OptIn(ShinyNewAPI::class)` at `foo`, `bar`, `baz` declarations does not help here.
To understand this better, rewrite your code like
```Kotlin
fun use() {
    val s: Shiny = foo()
    bar(Shiny())
    (null as Shiny?).baz()
}
```

## OptIn marker contagiousness (lexical scopes)

In Kotlin 1.6.20 we also introduced contagiousness rules based on lexical scopes.
The basic rule of thumb remains the same: all places which break if some experimental type disappear
from a library should receive opt-in usage warning/error.
Here we consider the same rule for type usage in dispatch receiver position.

To obey this rule, OptIn marker is considered contagious in lexical scope,
so in the example below both `fun foo` and `class Nested` are counted as part of `ShinyNewAPI`.

```kotlin
@ShinyNewAPI
class Base {
   // Effectively 'fun foo' has the marker
   fun foo() {}
   // Effectively 'class Nested' also has the marker
   class Nested
}

fun useBase(
  // requires opt-in
  base: Base
) {
  // also requires opt-in
  base.foo()
  // also requires opt-in
  Nested()
}
```

When `foo` is in use, the real dispatch receiver type is taken into account.
If `foo` is called on a derived class without marker, the call does not require opt-in.

```kotlin
@OptIn(ShinyNewAPI::class)
class Derived : Base()

fun useDerived(derived: Derived) {
    // Ok: dispatch receiver is 'Derived' (not 'Base'!) and it has OptIn
    derived.foo()
}
```

## Limitations for marker annotations

* Targets `EXPRESSION`, `FILE` and `TYPE` are not possible for marker annotations, because these annotations operate on the declaration level, and these targets aren't declarations in Kotlin. The compiler will report an error on the marker annotation if it declares one of these targets.
* Target `TYPE_PARAMETER` is also forbidden for marker annotations. Type parameter can be used only in scope of owner class/function/property, so it makes no sense to declare it experimental.
* Although targets `VALUE_PARAMETER`, `LOCAL_VARIABLE` and `FIELD` aren't forbidden directly when a marker annotation is declared, they are forbidden at use-sites. Marker annotation can't be applied to local variable or value parameter because they can be used in local scope only. Also they can't be applied to property fields or getters, please apply them to owner property instead. However, property setter can be annotated separately to point out that writing to (but not reading from) this property requires opt-in.
* Marker annotations must have `BINARY` or `RUNTIME` retention, otherwise the compiler will report an error. `SOURCE` retention is not enough because it wouldn't allow the compiler to read annotations from compiled code, and `RUNTIME` retention is not necessary because the fact that a declaration requires opt-in should not have any effect on how that declaration is visible at runtime through reflection.
* As mentioned earlier, marker annotations must have no parameters, otherwise the compiler will report an error.

## Known issues

* Once the API has been released, its call sites are still using the marker annotation, which means that the annotation class will need to go through the deprecation cycle, which is somewhat inconvenient.

repository: Kotlin/KEEP

gha_language: Markdown

repo_name: Kotlin/KEEP


text:
Shows how to control material nodes at run-time.
Press 1, 2, 3 to change parameters.

- Enable `Parameter` property in `Logic Node Editor - Properties - Armory Material Node`
- RGB, Value and Image Texture nodes are supported
- See `MyTrait` script to set material parameters using Haxe
- See `NodeTree` to set material parameters using logic nodes

https://github.com/armory3d/armory/wiki/materials#material-parameters

license: Zlib

gha_language: Haxe

gha_license_id: Zlib


text:
# Basic-Data-Visualization-with-Pandas-Dataframes

This is a notebook that gives you the ability to visually interogate your data and evaluate the independent variables against the dependent variable using a simple classification dataset--the Wisconsin Breast Cancer dataset (https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data).

We'll start by looking at the data correlation and skew. Then we will roll into looking at the data through visualization.

Univariate
* Histograms
* Density
* Box-plots
* Scatter charts

Multivariate
* Correlation matrix
* Scatter matrix

Not all of these techniques work for this dataset, but it's worth showing why or why not.


text:
# Lines Package [![Build Status](https://travis-ci.org/xpol/atom-lines.svg?branch=master)](https://travis-ci.org/xpol/atom-lines)

An Atom package add extra operations to lines:

* Sort (case sensitive or not)
* Reverse
* Unique
* Shuffle

This package was forked and modified from [sort-lines](https://atom.io/packages/sort-lines).