text:
# Git Runner

[![Code Climate](https://codeclimate.com/github/JamesBrooks/git-runner.png)](https://codeclimate.com/github/JamesBrooks/git-runner)
[![Gem Version](https://badge.fury.io/rb/git-runner.png)](http://badge.fury.io/rb/git-runner)
[![Dependency Status](https://gemnasium.com/JamesBrooks/git-runner.png)](https://gemnasium.com/JamesBrooks/git-runner)

Git Runner is a ruby framework to create and run tasks after commits are pushed to a git repository.

It works by having the git server-side post-update hook (`hooks/post-update`) invoke `git-runner`. Git Runner inspects all of the pushed branches (`refs/heads/*`) and looks for any Git Runner tasks (called instructions) to run. Such an instruction is `Deploy`, which allows for the application to be deployed after a push.

Git Runner instructions are distrubuted as separate gems, see **Available Instructions** below for what instructions are currently available for use.

Have a look at this short [demonstration video](http://ascii.io/a/1349) for what it looks like for a user pushing to a Git Runner enabled repository (using `git-runner-deploy`).

## Why?

#### Origins

Git Runner originated from a need to simplify the deployment process (capistrano) within my organisation for people who don't have their environments setup with ruby and the required gems. I wanted to make the process work for even those who are using GUI git clients.

#### Wouldn't a simple script do the job?

While you certainly could create a ruby script at `hooks/post-update` and have that run after a push with good results, Git Runner provides a robust framework for authoring re-usable tasks that you can share between all of your code repositories and run only when you need to run them.

You could do it all in a script of your own if you like, but Git Runner is there to help you out and make the process less error-prone and more maintainable.

## How

After pushing to a git repository various server-side hooks are ran, including a hook named `post-update`. `post-update` needs to run `git-runner` with it's arguments.

Git Runner looks for pushes to any branches (`refs/heads/*`). For each branch it greps the repository for one or more Git Runner instructions within a instruction file.

The instruction file and instruction markers are configurable (see **Configuration** below), by default the configuration file is `config/deploy.rb` and Git Runner instructions begin with `# GitRunner:`, e.g.

```
# GitRunner: Deploy
... rest of the file ...
```

*Instructions can be on any line within the instruction file and multiple instructions are present (instructions are ran in order).*

Any instructions that are found within the instruction file are then processed and ran if able, with any messages being displayed to the user currently pushing the repository.

Any errors encountered will also be displayed with all relevent details being written to a log on the server.

## Features

* Robust framework for running tasks (instructions) after updates are made to a repository.
* Have all of your tasks available to all of your repositories, only use the ones you need on a per repository basis.
* Activiation through instructions contained within the repository.
* Branch detection, behave differently for different branches if you like.
* Simple authoring of additional instructions.
* Error handling, notification and logging.

## Available Instructions

Name                                                       | Gem               | Description
---------------------------------------------------------- | ----------------- | ---------------------------------------
[Deploy](https://github.com/JamesBrooks/git-runner-deploy) | git-runner-deploy | Application deployment using capistrano

## Requirements

* git
* Ruby 1.9
	* Developed and "tested" using 1.9.3 (formal testing incoming soon).
	* It *might* work with 1.8.7 if `Object#tap` is patched in.

## Installation

This section needs a lot more fleshing out as installation overly trivial. The main thing to worry about is making sure that `hooks/post-update` in each of your repositories is able to run `git-runner` (and pass it's arguments on).

#### Install the git-runner

Install the gem and any other additional instruction gems that you need, for example if we want Git Runner with capistrano deploy support:

```
gem install git-runner
gem install git-runner-deploy
```

#### Hook up git-runner to fire on hooks/post-update

There are a few ways to accomplish this, such as directly symlinking `hooks/post-update` to the executable path for git-runner. Currently I prefer the following approach of creating a script that loads rubygems and git-runner + calls git runner. The following is the contents of my `hooks/post-update` file:

```
#!/usr/bin/env ruby

require 'rubygems'
require 'git-runner'

GitRunner::Base.new(ARGV).run
```

## Configuration

Configuration can be changed through a YAML file at either `/etc/git-runner.yml` or `$HOME/.git-runner.yml`. The default configuration settings are:

Option             | Default Value    | Description
------------------ | ---------------- | --------------------------------------------------------------------------
git_executable     | /usr/bin/env git | Location of the git executable to use
instruction_file   | config/deploy.rb | Where to look for Git Runner instructions within each repository
instruction_prefix | # GitRunner:     | What Git Runner instructions will be prefixed with in the instruction file
tmp_directory      | /tmp/git-runner  | Working directory for git-runner

## TODOs

* TESTS!
* Support to monitor a command (stdout and stderr) as the command is running, not just at the end.
* Instruction file path is globally set, make this overwritable on a per-repository basis?
* Instruction prefix is globally set, make this overwritable on a per-repository basis?
* Have core functionality fire useful hooks.
* Improve the output/text library, it can work better!
* Simplify Base#run (CodeClimate)

## Support

Check out [GitHub Issues](https://github.com/JamesBrooks/git-runner/issues) to see if anyone else has had the same problem you have, or create a new issue.

Also feel free to contact me directly (james at jamesbrooks dot net) for non-support comments or support of a more sensitive nature.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: csemrm/git-runner

repo_name: csemrm/git-runner


text:
# kicad_templates
Kicad templates that I use regularly
## checkout notes
This repository contains a few submodules, so after checking out do not forget to also check out the submodules.
```
git clone https://github.com/Squantor/LPC-breakout-boards.git
git submodule init
git submodule update
```
Submodules are my private kicad library that are used in my projects. I do try to use the kicad components as much as possible but for certain component types they are less then optimal or they do not exist.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# `spec-check` specification

This is a `spec-check` report which is also an executable specification for `spec-check`. The [test](https://github.com/concept-not-found/spec-check/blob/master/test/index.js) will:

-   strip this document of ``✅ `spec-check`ed``
-   strip this document of `❌ Error: ...`
-   run `spec-check --report specification-report.md add=test/add.js specification-input.md`
-   assert the result is identical to this document

## non js/javascript code blocks

### other code blocks are ignored

    this is not a javascript code block

## js/javascript code blocks ```` ```js```` or ```` ```javascript````

### lines with `>` that eval to subsequent lines are labeled with ✅

```js
> ['Hello', 'world'].join(' ')
'Hello world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### `>` can be continued with `...`

```js
> 'Hello ' +
..'world'
'Hello world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Continuations collapses all whitespace to a single newline

```js
> 'Hello ' +
..      'world'
'Hello world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### There can be multiple continuations

```js
> 'Hell' +
..'o ' +
..'world'
'Hello world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### A block starting with a continuation errors

```js
..42
42
```

❌ `Error: Continuation must be preceded input or expected output. Cannot start with a continuation.`

### Expected output can be continued with `...`

```js
> 'Hello world'
'Hello ' +
..'world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that resolve can be checked

```js
> Promise.resolve('Hello')
Resolve: 'Hello'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that resolve can be continued with `...`

```js
> Promise.resolve('Hello world')
Resolve: 'Hello ' +
..'world'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that reject a value can be checked

```js
> Promise.reject('oops')
Reject: 'oops'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that reject a value can be continued with `...`

```js
> Promise.reject('oops')
Reject: 'oops'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that are expected to resolve, but are rejected error

```js
> Promise.resolve('Hello')
Reject: 'Hello'
```

❌ `Error: Promise.resolve('Hello') => expected { Reject: 'Hello' }, but got { Resolve: 'Hello' }`

### Promise that are expected to reject, but are resolved error

```js
> Promise.reject('oops')
Resolve: 'oops'
```

❌ `Error: Promise.reject('oops') => expected { Resolve: 'oops' }, but got { Reject: 'oops' }`

### Promise that reject an error can be checked by error message

```js
> Promise.reject(new Error('oops'))
Reject error: oops
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### Promise that reject an error can be checked by error code

```js
> error = new Error('oops')
> error.code = 'ERROR_OOPS'
> Promise.reject(error)
Reject error code: ERROR_OOPS
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### requires such as `add=test/add.js` are in scope

```js
> add(1, 1)
2
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### lines that do not eval to subsequent lines are labeled with ❌

```js
> 'i hear you'
'i understand you'
```

❌ `Error: 'i hear you' => expected 'i understand you', but got 'i hear you'`

### input and output lines can be interleaved, all output lines will be checked

```js
> 'knock knock'
'knock knock'
> 'who\'s there'
'who\'s there'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### errors thrown by input lines can be checked by error message

```js
> throw new Error('oops')
Error: oops
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### errors thrown by input lines can be checked by error code

```js
> error = new Error('oops')
> error.code = 'ERROR_OOPS'
> throw error
Error code: ERROR_OOPS
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### errors thrown by output lines are rethrown

```js
> 'Everything is fine'
throw new Error('oops')
```

❌ ``Error: failed to eval output `throw new Error('oops')`: oops``

### multiple input lines can contribute to output

```js
> name = 'Bob'
> `Hi ${name}`
'Hi Bob'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### input errors fail first

```js
> throw new Error('first')
> throw new Error('second')
Error: first
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

### each block is not isolated from each other, be careful

```js
> name = 'Bob'
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

```js
> name
undefined
```

❌ `Error: name => expected undefined, but got 'Bob'`

### missing input throws an error

```js
42
```

❌ `Error: at least one input required`

### each block finishes before the next

```js
> count = 10
> Promise.resolve().then(() => count)
Resolve: 10
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

```js
> count = 100
> Promise.resolve().then(() => count)
Resolve: 100
```

✅ [`spec-check`](https://github.com/concept-not-found/spec-check)ed

license: ISC

repository: karlhorky/spec-check

repo_name: karlhorky/spec-check


text:
# **Traffic Sign Recognition Program**
[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

Overview
---
In this project, deep neural networks and convolutional neural networks are used to classify German traffic signs. Model is trained and validated to classify traffic sign images using the German Traffic Sign Dataset. After the model is trained, model is tested on images of German traffic signs found on the web.

Folder Structure
---
* Traffic Sign Classifier.ipynb - Code file (IPython notebook).
* Traffic Sign Classifier.html - HTML file of the notebook.
* Writeup.md - A brief writeup on the method used in the code.
* stats - Folder containing images of the statistics and analysis.
* test\_images - Folder containing new images from internet.

repository: chetansadhu/Traffic-Sign-Classifier

repo_name: chetansadhu/Traffic-Sign-Classifier


text:
# Functions and effects

## Exercises solutions

1. Consider the following __incomplete__ program. The program should display a diagnostic given the patient's temnperature (expressed in degrees Celsius).

    ```kotlin
    import kotlin.random.Random

    fun main() {
        val bodyTemperature = measurePatientTemperature()
        val diagnostic = getDiagnostic(bodyTemperature)
        println("Your temperature is ${bodyTemperature} --> ${diagnostic}")
        println(if (diagnostic == "you are ok") "Let's rock! 🤘" else "🤒")
    }
    ```
   1. Define the function (or is it an effect?) `measurePatientTemperature` so that it produces a random number in the interval `[31.0, 42.0[` each time it's evaluated. The returned value has, at most, one decimal place.

      __Answer:__

      ```kotlin
      fun measurePatientTemperature(): Double = (Random.nextDouble(31.0, 42.0) * 10).toInt() / 10.0
      ```

   2. Define the function (or is it an effect?) `getDiagnostic` so that it produces one of the following strings:
      * `"you are ok"`, if the received temperature is between `36.0` and `37.5`
      * `"you have a fever"`, if the received temperature is between `37.5` and `41.0`
      * `"you have hypothermia"`, if the received temperature is between `32.0` and `35.0`
      * `"get a doctor, now!"`, if the received temperature is over `41.0` or below `32.0`

      __Answer:__

      ```kotlin
      fun getDiagnostic(temperature: Double): String = when {
              temperature >= 36.0 && temperature < 37.5 -> "you are ok"
              temperature >= 37.5 && temperature < 41.0 -> "you have a fever"
              temperature >= 32.0 && temperature < 35.0 -> "you have hypothermia"
              else -> "get a doctor, now!"
      }
      ```

   3. How would you classify each of the following blocks of code? Function or effect?

      __Answer:__

      * `measurePatientTemperature` is an effect because it breaks the substitution principle
      * `getDiagnostic` is a function because it **does not** break the substitution principle

gha_language: Kotlin

gha_license_id: MIT


text:
# ion-grid

The grid is a powerful mobile-first flexbox system for building custom layouts.

It is composed of three units — a grid, [row(s)](../row) and [column(s)](../col). Columns will expand to fill the row, and will resize to fit additional columns. It is based on a 12 column layout with different breakpoints based on the screen size. The number of columns can be customized using CSS.

See the [Responsive Grid documentation](/docs/layout/grid) for more information.

repository: kkeeth/ionic-docs

repo_name: kkeeth/ionic-docs


text:
# MASK R-CNN for Object Detection on Icg Dataset
The dataset should have the following folder structure :-
icg_dataset/
	images/
		train/
		val/
	images_seg/

To modify configurationg of the model, check IcgConfig in icg.py

To run model training, use the following command
python3 icg.py train --dataset /path/to/icg_dataset --weights "coco" --logs logs/

To run model evaluation, use the following command
python3 icg.py val --dataset /path/to/icg_dataset --weights /path/to/weights --logs logs/

You may need to create weights and logs directory - create it within samples/icg directory

gha_license_id: NOASSERTION


text:
# Mirabilis linearis var. decipiens (Standl.) S.L. Welsh VARIETY

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Great Basin Naturalist 46:258. 1986

#### Original name
Allionia decipiens Standl.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Techmmunity - Compass

	<img<EMAIL_ADDRESS>alt="Downloads">

Compass is an [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping) based on [TypeORM syntax](https://github.com/typeorm/typeorm) and [ESLint plugable approach](https://eslint.org/). Our intention here is standardize the connection and implementation of **every database** with the best performance possible, and for this, we use an plugable approach, so more people can contribute and create their on integration. This package alone can't do anything besides typing, the plugins do all the "dirt work".

Currently it only works with TypeScript (and transpiled JavaScript), and we plan to keep this way.

[![Discord Badge](https://img.shields.io/badge/discord-7289DA?style=for-the-badge&labelColor=7289DA&logo=discord&logoColor=white)](https://discord.gg/5hPnJzzAe2)
[![Docs Badge](https://img.shields.io/badge/documentation-01d2ce?style=for-the-badge&labelColor=01d2ce)](https://compass.techmmunity.com.br)


text:
# Uinspector-Optional-Lottie

## Introduce

**Uinspector-Optional-Lottie** is an intergration library for [Uinspector](https://github.com/YvesCheung/UInspector) and [Lottie](https://github.com/airbnb/lottie-android).
Lottie is a mobile library that parses Adobe After Effects animations exported as json.
Uinspector-Optional-Lottie helps us to inspect the properties of `LottieAnimationView`!

## Get Started

1. Add dependencies to your `build.gradle` file

    ```groovy
    dependencies {
        //the framework of Uinspector
        debugImplementation 'com.huya.mobile:Uinspector:x.y.z'
        //the optional library to inspect properties of Lottie
        debugImplementation 'com.huya.mobile:Uinspector-optional-lottie:x.y.z'
    }
    ```

    > x.y.z replace with [![Download](https://api.bintray.com/packages/yvescheung/maven/UInspector/images/download.svg)](https://bintray.com/yvescheung/maven/UInspector/_latestVersion)

2. Run your app and turn on the Uinspector. Click the `LottieAnimationView`

    <img src="https://raw.githubusercontent.com/YvesCheung/UInspector/master/art/lottie.jpg" alt="Inspect Lottie" width="360">

    Now you can see the properties listed in the popupPanel:

    - `lottie fileName` : The json/zip file if exist
    - `lottie rawRes` : The resource id if exist
    - `lottie speed` : The speed of playing animation
    - `lottie duration` : How long the animation is
    - `lottie repeat mode` : The repeat mode of the animation
    - `lottie repeat count` : The repeat count of the animation

repository: solonzhang/UInspector

repo_name: solonzhang/UInspector


text:
# Bob

Bob is a lackadaisical teenager. In conversation, his responses are very limited.

Bob answers 'Sure.' if you ask him a question.

He answers 'Whoa, chill out!' if you yell at him.

He answers 'Calm down, I know what I'm doing!' if you yell a question at him.

He says 'Fine. Be that way!' if you address him without actually saying
anything.

He answers 'Whatever.' to anything else.

The Scala exercises assume an SBT project scheme. The exercise solution source
should be placed within the exercise directory/src/main/scala. The exercise
unit tests can be found within the exercise directory/src/test/scala.

To run the tests simply run the command `sbt test` in the exercise directory.

For more detailed info about the Scala track see the [help
page](http://exercism.io/languages/scala).

## Source

Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

repository: rajeshpg/scala

repo_name: rajeshpg/scala


text:
# BanglaEmotion
Bangla Emotion Detection

### ***Please do not use this code without proper citation (follow the ethics and be honest ^_^)***

#### Author: Md Ataur Rahman
Dept. of Language Science and Technology,
University of Saarland

Email: shaoncsecu[at]gmail[dot]com

#### *** INSTRUCTIONS ON HOW TO RUN ***

Run the Programs by executing the following command:

python SVM.py <training_set> <testing_set>

- Where trainig and testing set is the location of train.txt and test.txt files

### Citation Information

#### Paper
```ruby
@misc{rahman2019comparison,
    title={Comparison of Classical Machine Learning Approaches on Bangla Textual Emotion Analysis},
    author={Md. Ataur Rahman and Md. Hanif Seddiqui},
    year={2019},
    eprint={1907.07826},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
```

#### Dataset
```ruby
@misc{https://doi.org/10.17632/24xd7w7dhp.1,
    doi = {10.17632/24XD7W7DHP.1},
    url = {https://data.mendeley.com/datasets/24xd7w7dhp/1},
    author = {{Rahman, Md Ataur}},
    keywords = {Computational Linguistics, Natural Language Processing, Bangladesh, Emotion Representation, Textual Analysis, Sentiment Analysis},
    title = {BanglaEmotion: A Benchmark Dataset for Bangla Textual Emotion Analysis},
    publisher = {Mendeley},
    year = {2020}
}
```

repository: shaoncsecu/BanglaEmotion

repo_name: shaoncsecu/BanglaEmotion


text:
# datetime2-german
German Language Module for `datetime2` Package

Authors: Nicola L. C. Talbot (inactive), Sebastian Friedl

Licence: LPPL 1.3c

Required Packages: `datetime2`, `tracklang`

This module is maintained.
Current maintainer is Sebastian Friedl.

Thanks to Jürgen Spitzmüller for his valuable advice while developing Version 2.0 of this module.

## Installation

`latex datetime2-german.ins`

Move all `*.ldf` files to `TEXMF/tex/latex/datetime2-contrib/datetime2-german/`

Documentation:

    pdflatex datetime2-german.dtx
    makeindex -s gind.ist datetime2-german.idx
    makeindex -s gglo.ist -o datetime2-german.gls datetime2-german.glo
    pdflatex datetime2-german.dtx
    pdflatex datetime2-german.dtx

Move `datetime2-german.pdf` and `README` to `TEXMF/doc/latex/datetime2-contrib/datetime2-german/`

This material is subject to the LaTeX Project Public License. See [http://www.latex-project.org/lppl.txt](http://www.latex-project.org/lppl.txt "Show the current version of the LPPL") or `LICENSE.txt` for the details of that license.

gha_language: TeX


text:
---
breadcrumbs:
- - /teams
  - Teams
- - /teams/animations
  - Animations Team
- - /teams/animations/highlights-archive
  - Highlights Archive
page_name: june-2019-volume-ii
title: June 2019, Volume II
---

June 2019, Volume II

Chrome Animations Highlights

Archives: go/animations-team-highlights

Is there a poltergeist trapped inside Chromium? Not any more, thanks to<EMAIL_ADDRESS>
Gmail, possessed?

A spooky bug floated our way this sprint as users began reporting that their gmail and twitter pages were scrolling without any user input! After initial analysis from the input team (great work by bokan@!) identified it as a BlinkGenPropertyTrees-related Animations bug, Rob (flackr@) spent days teasing out first a reproduction, then a diagnosis (surprise, it was complicated), and finally landing a fix that took care of this ghostly occurrence. Who you gonna call? Rob Flack, apparently.

Animation Worklet - it's (more) official!

Animation Worklet took not one, but two big steps forward this sprint. We sent our official Intent to Ship to blink-dev@, reflecting our opinion that the first version of Animation Worklet has reached maturity and is ready for real users. Coincidentally - and nearly simultaneously - the spec was also promoted to First Public Working Draft during this sprint.

Congrats to all the people who have and continue to work on Animation Worklet!

ScrollTimeline prototype lands

Browser support for scroll-linked animations is a common request from web developers, as JS based solutions suffer badly when the page janks. We took one step closer to fulfilling such requests this sprint with Olga (<a href="mailto:gerchiko<EMAIL_ADDRESS>landing a (main-thread only) prototype of ScrollTimeline for Web Animations.

Interested developers can now run Chrome with --enable-blink-features=ScrollTimeline to play with the prototype - but be warned, this is still very early stage!

Exploring the Animations space

It can be easy when working in the browser space to lose sight of what our corner of the web platform is actually like for web developers. This sprint Gene (girard@) put together and published an overview of the tools and processes web developers are using to create and deliver animations on the web. This form of insight is vital to better understand what features we should be prioritizing, and to deliver a better web for everyone.
(Chart above uses data originally from https://trends.builtwith.com.)

PaintWorklet HiDPI bug squashing

When developing his PaintWorklet-based Lottie renderer last sprint, Rob discovered a few rendering bugs relating to PaintWorklet on Mac HiDPI devices - such as the unexpectedly cropped image above. Thankfully such bugs are no more, as Xida (xidachen@) spent time this sprint hunting down multiple zoom and HiDPI related PaintWorklet bugs and fixing them.

Do you understand this? Yeah, me neither. But kevers@ does!

Better Beziers

Sometimes, you just have to get down into the weeds to improve browser interop. This sprint Kevin (kevers@) did exactly that as he tackled the hairy problem of bezier curves - namely, why does Chromium's implementation produce different values than other browsers? Details of Kevin's explorations could probably fill a small maths textbook, but in the end he was able to land a new approach for Bezier estimation that took half the time of the old method, made Chromium pass almost 20 previously-failing WPT tests, fix two Chrome bugs (issues 591607 and 827560), and exposed a hole in the spec. We think Monsieur Bézier would have been proud.

Chrome Animations Highlights | June 2019, Volume II

go/animations-team

repository: iridium-browser/iridium-browser

repo_name: iridium-browser/iridium-browser


text:
# MSTS Project Proposal Sprint 1

## Author - Olivier S-M

1 Week Goal: Create the blogging component for the MSTS Site.

Features:

0. Project Setup

- Download and install necessary frameworks/technologies. Test that they are up and running. See list in main part of repository
- Learn Disqus System
- Run Hello World Setup

Total Time: 5 hours

1. Setup BlogAPI/Tables
        - Create tables for blog
        - Create REST API for altering blog components (Create, Update, Modify, Delete)
        - Setup REST API Authentication
        - Write Unit Tests for API

    Total Time: 5 hours

2. Create Front End Interface for editing blog
        - Flask-Markdown Editing
        - Add an Author, Position, Date Created, Date Modified
        - Use Journal template from bootstrap to create basic HTML templates. Integration design with SASS and JQuery.

    Total Time: 5 hours

3. Create Front End Interface for seeing blog Posts:

    - See all blog posts (ordered by most recent)
    - See blog posts by author
    - see blog posts by month
    - see blog posts by year
    - see blog post detail
    - Write comments and read comments using disqus system.

    Total Time: 5 hours


text:
# Summary

probability plugin is used for ensemble data to calculate the probability of any parameter using user given thresholds. Plugin also supports time-lagged ensemble.

# Required source parameters

Any single source parameter. For wind speed, plugin will automatically fetch U and V components.

# Output parameters

User defined output parameters, see per-plugin configuration options.

# Method of calculation

Plugin will check how many ensemble members forecast values larger or smaller than given threshold, missing values are excluded. The probability _direction_ of certain parameters is hard coded. For example if target parameter is PROB-TC-0, plugin will calculate the probability of temperature being _below_ zero.

# Per-plugin configuration options

name: what is the resulting parameter of calculation

    "name" : "PROB-TC-0"

ensemble_size: define the expected ensemble size.

    "ensemble_size" : "<number>"

max_missing_forecasts: define how many forecasts are allowed to be missing from the ensemble (default is 0)

    "max_missing_forecasts" : "<number>"

ensemble_type: define the type of ensemble. Currently supported is the traditional ensemble with multiple perturbed forecasts, and a time_ensemble where multiple different times produce an ensemble. Default value is the traditional ensemble.

    "ensemble_type" : "ensemble | time_ensemble"

input_param1: name of first input parameter

    "input_param1" : "T-K"

input_param2: name of second (optional) input parameter

    "input_param1" : "U-MS"
    "input_param2" : "V-MS"

threshold: threshold for given parameter, in parameter units.

    "threshold" : "273.15"

normalized_results: Define if plugin should scale the probability values to [0,1] (default: [0,100])

    "normalized_results" : "true"

lag: Define is plugins should use time-lagging for how many instances (default: 0)

    "lag" : "1"

lagged_steps: Define how many hours is one lagged forecast (the temporal distance between two consecutive forecast runs)

    "lagged_steps" : "12"

repository: jrintala/fmi-data

repo_name: jrintala/fmi-data


text:
---
layout: post
title: Charles Brindley's Art Class
description: This post is about Charles Brindley's Art Class
<!-- img: extremeperspective_sc12.jpeg -->
color: 212121
author: me
tags:
  - art
---

<!-- * some text
{: toc} -->
<!-- # Under construction:  -->

Back in 2005, a friend of mine recommended to attend the art class of [**Charles Brindley**](http://www.cbrindley.com/home.html). I was lucky to give it a try. Charles often says "You have to give yourself a break, because if you don't you'll get so frustrated that you'll quit painting altogether..." Painting was so hard for me at the beginning that I could not really enjoy it, so patience was the key. One of his other sayings is: "You cannot rush these things...", probably meaning that painting should be less result-oriented and more process-oriented. I agree.

gha_language: HTML


text:
---
title: "Reading Note: MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications"
category: ["Computer Vision"]
tag: "Reading Note"
---

**TITLE**:  MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

**AUTHOR**: Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam

**ASSOCIATION**: Google

**FROM**: [arXiv:1704.04861](https://arxiv.org/abs/1704.04861)

## CONTRIBUTIONS ##

1. A class of efficient models called MobileNets for mobile and embedded vision applications is proposed, which are based on a streamlined architecture that uses depthwise separable convolutions to build light weight deep neural networks
2. Two simple global hyper-parameters that efficiently trade off between latency and
accuracy are introduced.

## MobileNet Architecture ##

The core layer of MobileNet is depthwise separable filters, named as Depthwise Separable Convolution. The network structure is another factor to boost the performance. Finally, the width and resolution can be tuned to trade off between latency and accuracy.

### Depthwise Separable Convolution ###

Depthwise separable convolutions which is a form of factorized convolutions which factorize a standard convolution into a depthwise convolution and a $1 \times 1$ convolution called a pointwise convolution. In MobileNet, the depthwise convolution applies a single filter to each input channel. The pointwise convolution then applies a $ 1 \times 1 $ convolution to combine the outputs the depthwise convolution. The following figure illustrates the difference between standard convolution and depthwise separable convolution.

![Difference between Standard Convolution and Depthwise Separable Convolution](https://raw.githubusercontent.com/joshua19881228/my_blogs/master/Computer_Vision/Reading_Note/figures/Reading_Note_20170719_MobileNet_0.png "Difference between Standard Convolution and Depthwise Separable Convolution"){: .center-image .image-width-480}

The standard convolution has the computation cost of

$$ D_{k} \cdot D_{k} \cdot M \cdot N \cdot D_{F} \cdot D_{F} $$

Depthwise separable convolution costs

$$ D_{k} \cdot D_{k} \cdot M \cdot D_{F} \cdot D_{F} + M \cdot N \cdot D_{F} \cdot D_{F} $$

### MobileNet Structure ###

The following table shows the structure of MobileNet

![MobileNet Structure](https://raw.githubusercontent.com/joshua19881228/my_blogs/master/Computer_Vision/Reading_Note/figures/Reading_Note_20170719_MobileNet_1.png "MobileNet Structure"){: .center-image .image-width-480}

### Width and Resolution Multiplier ###

The Width Multiplier is used to reduce the number of the channels. The Resolution Multiplier is used to reduce the input image of the network.

## Comparison ##

![Comparison](https://raw.githubusercontent.com/joshua19881228/my_blogs/master/Computer_Vision/Reading_Note/figures/Reading_Note_20170719_MobileNet_2.png "Comparison"){: .center-image .image-width-480}


text:
---
title: Assembly Insight - Part 1
layout: post
---
Just came across [this Gem](https://www.youtube.com/watch?v=yOyaJXpAYZQ&t=0s&list=WL&index=48) when browsing cat videos on Youtube. After watching it I decided to run through the case by myself on my mac to see how a C program is working under the hood. I also want to be a bit geeky this time - just use Vim to write raw C program, and use command line to compile the program and also run the executable. Everything in the terminal.

# Compile and Run C Program

First, here is the C program for testing - the same as the testing case in the video. Save it as `fib.c`.

``` c
#include <stdio.h>
int main(void)
{
    int x, y, z;
    x = 0;
    y = 1;
    do
    {
        printf("%d\n", x);
        z = x + y;
        x = y;
        y = z;
    } while (x < 255);
}
```

Secondly, use `gcc` to compile the .c program - type command `gcc fib.c`. GCC is *GNU Compiler Collection, a compiler system produced by the GNU Project supporting various programming languages*. Also we can use `clang` - type command `clang fib.c`. Clang is *a compiler front end for the programming languages C, C++, Objective-C, Objective-C++, OpenMP, OpenCL, and CUDA, designed to act as a drop-in replacement for the GNU Compiler Collection.*

This will compile the program and generate `a.out` file. To run the executable we have to use command `./a.out`.

`a.out` is a file format used in older versions of Unix-like computer OS for executables, object code, and, in the later systems, shared libraries. This is an abbreviated form of *"assembler output"*. Also we can use `clang -o fib fib.c` to generate file `fib` instead of the default `a.out` :)

# Assembly Insight

Then use command `otool -tv fib` to observe the corresponding assembly code of our compiled C program. `otool` is *object file displaying tool*, `-t` is to print the text section and `-v` is to disassemble it to make it readable.

And we got:
``` bash
fib:
(__TEXT,__text) section
_main:
0000000100000f30        pushq   %rbp
0000000100000f31        movq    %rsp, %rbp
0000000100000f34        subq    $0x20, %rsp
0000000100000f38        movl    $0x0, -0x4(%rbp)

0000000100000f3f        movl    $0x0, -0x8(%rbp) # x = 0;
# movl (move long) moves value $0x0 into address offset in the memory -0x8 AKA x
# %rbp (stack base pointer)
0000000100000f46        movl    $0x1, -0xc(%rbp) # y = 1;

// start of loop
0000000100000f4d        leaq    0x5a(%rip), %rdi
0000000100000f54        movl    -0x8(%rbp), %esi
0000000100000f57        movb    $0x0, %al
0000000100000f59        callq   0x100000f8c # Call printf()

0000000100000f5e        movl    -0x8(%rbp), %esi
# x is moved into %esi register
0000000100000f61        addl    -0xc(%rbp), %esi
# y is added into %esi register
0000000100000f64        movl    %esi, -0x10(%rbp) # z = x + y;
# %esi is moved into z
0000000100000f67        movl    -0xc(%rbp), %esi
0000000100000f6a        movl    %esi, -0x8(%rbp) # x = y;
# y is moved into x
0000000100000f6d        movl    -0x10(%rbp), %esi
0000000100000f70        movl    %esi, -0xc(%rbp) # y = z;
# z is moved into y
0000000100000f73        movl    %eax, -0x14(%rbp)
# %eax contains the return value of the printf call
0000000100000f76        cmpl    $0xff, -0x8(%rbp) # while(x < 255);
# cmpl (compare long) compare x with 255($0xff)
0000000100000f7d        jl      0x100000f4d
# jump to address 0x100000f4d
0000000100000f83        movl    -0x4(%rbp), %eax
0000000100000f86        addq    $0x20, %rsp
0000000100000f8a        popq    %rbp
0000000100000f8b        retq
```

# Assembly Syntax Explanation

## movl vs movq

([Source](https://www.quora.com/What-is-the-difference-between-movq-and-movl-assembly-instruction)) When using [GAS(GNU Assembler)](https://en.wikipedia.org/wiki/GNU_Assembler) assembly language mnemonics for an Intel CPU, then:

* movq moves a quadword (64-bits) from source to destination.
* movl moves a long (32-bits) from source to destination.

Note that, in the Intel x86 world, a word is 16 bits, a doubleword is 32 bits (two 16-bit words), and a quadword is 64 bits (four 16-bit words).

GAS syntax uses these suffixes (e.g., q, l, b, etc.) on the instruction mnemonics to indicate how much data is being moved.

The Intel syntax doesn’t use suffixes, but instead uses the register name to deduce the amount of data, since each register has a known size. So, in Intel syntax, both instructions would use the same mnemonic: mov.

Also note that, in GAS syntax, the source operand appears first, and the destination operand appears second. This is the reverse order of the [Intel syntax](https://en.wikipedia.org/wiki/X86_assembly_language#Syntax), where the destination operand appears first, and the source operand appears second.

TBC


text:
# playground
just my playground for testing anything

Definition list

Is something people use sometimes.

Markdown in HTML

Does *not* work **very** well. Use HTML tags.

![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")

repository: ariutta/playground

repo_name: ariutta/playground


text:
@@@ index

* [Introduction](introduction.md)
* [Constructing Capabilities](construction.md)
* [Authorizing Capabilities](authorization.md)
* [Managing Capabilities](management.md)
* [Confining Capabilities](confinement.md)

@@@

# A Guide To Capabilities

This is a guide to capabilities written for the general programmer, using Scala.

@@@note

If you are looking for examples of using `ocaps`, please see  @ref:[the examples sections](../examples/index.md).

@@@

* @ref:[Introducing Capabilities](introduction.md)
* @ref:[Constructing Capabilities](construction.md)
* @ref:[Authorizing Capabilities](authorization.md)
* @ref:[Managing Capabilities](management.md)
* @ref:[Confining Capabilities](confinement.md)

## Further Reading

* [Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control](http://www.erights.org/talks/thesis/markm-thesis.pdf)
* [Bringing Object-orientation to Security Programming](http://soft.vub.ac.be/events/mobicrant_talks/talk2_OO_security.pdf)
* [Capability Myths Demolished](http://srl.cs.jhu.edu/pubs/SRL2003-02.pdf)
* [What are Capabilities](https://github.com/GravityNetwork/Gravity/wiki/What-are-Capabilities)
* [Capability Based Security](https://fsharpforfunandprofit.com/posts/capability-based-security/)
* [Capability Patterns](http://wiki.erights.org/wiki/Walnut/Secure_Distributed_Computing/Capability_Patterns)

repository: tersesystems/ocaps

gha_language: JavaScript

repo_name: tersesystems/ocaps


text:
# Instagramr
## Description
* Its basically a custom made instagram with fewer features compared to the official instagram application.
* Its simple and easy to use
## Author
Jackson kitsao
## Published
* 18/10/2020

## Application Functionality
As a registerd user you can:

1. Make your own profile and edit it theway you want
2. Post pictures for other registerd users to view, comment or like
3. Search for other registerd users and view their profiles
4. follow other users who can also follow you back

## Installations

1. Clone the repository with:
`git clone https://github.com/jkitsao/insta-clone-django`
2. You will then have to unzip the zipped format of the repo.

3. You will need to install all dependencies by running this command:
` pip3 install -r requirements.txt`

`config==0.3.9`
`dj-database-url==0.5.0`
`Django==1.11`
`django-bootstrap3==10.0.1`
`django-heroku==0.3.1`
`gunicorn==19.9.0`
`Pillow==5.2.0`
`psycopg2==2.7.5`
`python-decouple==3.1`
`pytz==2018.5`
`whitenoise==4.0`
`pip install -r requirements.txt`

* If not use this command:
`pip freeze > requirements.txt`

* Do not try to use django version above 1.11, it will result to errors due to compatibility
* For this cause, i recommend python 3.7 but specify `python3.7.8` in your `runtime.txt` file when deploying to heroku

4. To use the application locally you wil have to create a postgress database
follow these steps to get the app up and running:
* in your psql:
`CREATE DATABASE instagramr;`
* in your terminal migrate with:
`python3.7 manage.py migrate`
* Make a `.env` file to store your environmental variables

* serve the application with:
`python manage.py runserver`
* open the app on localhost:8000

## Technologies used
1. Django 1.11
2. Python3.7
3. HTML and Css
4. Production deployment to heroku
## License

[This project is licensed under the MIT Open Source license](License).

(c) Jackson kitsao

repository: jkitsao/insta-clone-django

repo_name: jkitsao/insta-clone-django


text:
# Coder Simulator

### TL;DR:
A small program that simulates code writing process by generating and spewing out random lines of code in a semi-structured manner.

---

This program simulates coder's work by writing code indefinitely at a certain speed (can be specified as an argument). The program follows some general set of Python rules, such as matching indentations for try/catch blocks, or not unindenting after an empty function definition statement, etc. The code is generated randomly, which includes randomly generated variable names, function names, statements, if/else blocks, try/catch blocks, function definition blocks, as well as some in-built functions.

The program supports two output modes: colored and monochromatic. Colored mode highlights syntax of the program, as some IDEs would. Monochromatic mode would just stick to the default colors of the terminal window, which is used for running the program.

## Screenshots

Colored:

![alt text](./img/colored.jpg "Colored")

Monochromatic:

![alt text](./img/mono.jpg "Monochromatic")

## Requirements
1. Python 3
1. colorama (required only for the colored output mode)

    `pip install colorama`

## How To Run
In the project root directory:

`python CoderSimulator.py`

## Terminal arguments:

| Short | Long | Function |
| --- |--- | --- |
| -m | --mono | Runs in monochromatic mode |
| -s 200 | --speed 200 | Sets the speed. Default: 200. Min: 10. Max 10000. |

# Why?

Just looks nice. 😁 Start four instances of it, and all of a sudden you look like the baddest coder out there.

repository: Goradux/CoderSimulator

repo_name: Goradux/CoderSimulator


text:
Sublime ProcessWire Snippets - Basic
==================================

A collection of [ProcessWire](http://www.processwire.com) Snippets for Sublime Text 2.  These are based on the [ProcessWire2+ Cheatsheet version 1.1](http://cheatsheet.processwire.com).  This collection includes all the snippets in the cheatsheet when viewed without advanced mode on.  If you'd like to add the snippets with the advanced setting on, you'll want to grab the [Advanced Snippet Collecton](https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced/)

## Installation
If you're using Git, the best method is to clone this repository to your ST Packages folder. (on Mac, it's here: /Users/your_username/Library/Application Support/Sublime Text 2/Packages/).

You can also [download the zip file](https://github.com/evanmcd/SublimeProcessWireSnippetsBasic/archive/master.zip) and unzip into the Packages folder.

Either way, I would recommend creating a ProcessWire subfolder as there are more than 100 files.

I'm looking into getting it into the excellent [Package Control](https://github.com/wbond/sublime_package_control) which would let you install right from ST.

## Usage notes
The best way to trigger the snippets is to just start typing a ProcessWire object, like $pages.  You'll see a list of the matches, like $pages->find() and $pages->get().  If you know what you want, you could keep typing the specific method like this $pagesfind - selecting the snippet will present you with the proper PW syntax.

For now, entering a command like this $pages-> doesn't work. I'm still figuring out how to work with the > character in snippets.

## Coming updates
I'm looking into the best way to add important bits of documentation for the less well known commands.  For now, there isn't any documentation in the snippets.

Hope this speeds up your already speedy site development with ProcessWire.  :)

I'm [evanmcd](https://twitter.com/evanmcd) on Twitter - best way to reach me is there if you have any questions or comments.

repository: evanmcd/SublimeProcessWireSnippetsBasic

repo_name: evanmcd/SublimeProcessWireSnippetsBasic


text:
# Modern Social Share Widget :heart_eyes:
This is a cool social sharing widget which you can add on your Website or Blog. Doesn't matter on which platform your blog/website is hosted on whether it is Wordpress or Blogger. You Can Use This Code.

1- You Need To Add FontAwesome And BootStrap In your Website's Header section (``` Between <Head></Head> ```)

2- Just **Open index.html and copy paste** the code ```between <body> and </body>```

repository: mdsaban/Modern-Social-Share-Widget

repo_name: mdsaban/Modern-Social-Share-Widget


text:
# TypeScript from JavaScript

This is a project you can walk through commit-by-commit to see the transformation of JavaScript code to TypeScript.

[@JeremyLikness](https://twitter.com/JeremyLikness)

Background notes:

* 1995: Mocha becomes LiveScript, written in 10 days
* 1996: JavaScript lives!
* 1997: ECMAScript 1 sets standards
* 1999: ECMAScript 3
* 2005: jQuery "Normalize the DOM"
* 2009: Node.js, ECMAScript 5
* 2012: TypeScript (and there was much rejoicing)
* 2015: ECMAScript 2015 ("Harmony")

## Intro

`git checkout d65aed6`

Currently, there is a small JavaScript "app" that you can run with the command:

`node index.js`

There are some defects and if you browse to JavaScript in your IDE, you may or may not get appropriate hints about what's wrong.

## Transform to TypeScript

`git checkout 08f09e3`

JavaScript is valid TypeScript (with a few exceptions) so we'll start by setting up TypeScript.

`npm install --save-dev typescript`

Add two build scripts to the `package.json` file for compiling and compiling on a watch:

```javascript
"scripts": {
    "build": "tsc",
    "build:w": "tsc -w"
}
```

To create a configuration file that TypeScript uses to compile source to JavaScript, run:

`./node_modules/typescript/bin/tsc --init`

Finally, rename `index.js` to `index.ts`.

> Ouch! There are a lot of errors. We'll address these in the next commit.

## Turn Off Strict Typing and Add a Spread Operator

`git checkout 1b9c8b1`

It's been said all valid JavaScript is valid TypeScript. That is only partly true. TypeScript enables configuration options and by default expects "strict typing" without implicitly allowing a variable to be any type. For now, turn off strict typing by setting it to false in the `tsconfig.json`:

```javascript
{ strict: "false" }
```

Next, you will find our first bug. `ContactList` is expecting an array but what's passed is technically two parameters. You *could* change the constructor call to pass an array like this:

```javascript
new ContactList([me, myWife])
```

A more flexible solution is to accept 1-to-many items passed in by using the spread operator. Change the function declaration for the `ContactList` to this:

```javascript
function ContactList(...contacts) {
```

Now compile and run the code.

```bash
npm run-script build
node index.js
```

That's better. There are still some bugs though. The contact type is printing as landline for both contacts, the phone number isn't showing, and the debug information prints "2" each time.

Before this is addressed, take a look at the compiled `index.js`. Compare to the source TypeScript. Notice it's only slightly different. Although modern JavaScript supports the the "spread operator", it's not supported in the older JavaScript version so TypeScript builds code to make it compatible for you! Later on you'll see the modern version of the compiled JavaScript. For now, let's refactor our function constructors to "real" classes.

## Refactor to "real" classes

`git checkout c39795a`

TypeScript supports a class definition. For older JavaScript, it will generate the appropriate code to "wrap" the class behavior. For newer JavaScript it will generate the native class keyword. The `Contact` and `ContactList` entities are refactored to a class. The constructor is the same as the original function call, with the difference that the parameters are declared `public` and given types. This implicitly creates the properties on the class and moves the constructor parameters to the properties. The generated JavaScript isn't available yet, because a bug has already been identified.

## Fix Two Bugs

`git checkout b3974e5`

The first bug is a naming issue. The class defines a property called `phoneNumber` but the print method references `contactNumber`. Change the property to `contactNumber` to be consistent with `contactType`.

Next, create a type called `Phone` that allows a value of either `mobile` or `home`. Change the `contactType` to be of type `Phone` and fix several more defects. Now when you compile and run it should print as expected, except for the debug information.

## Lambdas, let, and string interpolation

`git checkout 3be05fe`

Lambda expressions help by automatically preserving the reference to `this` and pass it to subsequent nested expressions so there are not unexpected side effects. The `let` keyword indicates a variable is indeed local, and TypeScript will generate additional code for it to behave properly in closure situations to preserve the intended scope. Finally, string interpolation makes it easier to read concatenated strings in the source. It is leveraged as a native feature in modern JavaScript and turned back to "string addition" for older JavaScript.

*** (Add a reference to `this.contacts` for more insight into the lambdas).

## Find

`git checkout 788d493`

Add a "find" function to search the contacts and return an example. The initial implementation fails to find anything. Paste this code, compile and run it:

```javascript
const find = (list, test) => {
    for (let idx = 0; idx < list.length; idx += 1) {
        if (test(list[idx])) {
            return list[idx];
        }
    }
    return null;
}

const found = find(rolodex, contact => contact.Name === "Doreen");

if (found) {
    console.log("\n\nFound something:");
    found.print();
}
else {
    console.log("\n\nNot found!");
}
```

## The Power of Generics

`git checkout 14769c5`

Generics help by creating a template for a type, then providing hints and type-checking for that type. To see this in action, refactor the `find` function to use generics. Immediately a bug is revealed.

```TypeScript
const find = <T>(list: T[], test: (item: T) => boolean) => {
    for (let idx = 0; idx < list.length; idx += 1) {
        if (test(list[idx])) {
            return list[idx];
        }
    }
    return null;
}
```

## Fix it

`git checkout b1aae76`

The generic function revealed another defect. Fixing that reveals yet another bug that can be fixed. Compile and run and the search should work.

## Simplify it

`git checkout 9ceda1c`

Create a type called "predicate" to simplify the definition of find. Note this doesn't change the compiled JavaScript at all.

## Interfaces and optional parameters

`git checkout c27d282`

Interfaces help describe types. Refactor to use interfaces. Add a `PrintRecursive` helper function with an optional parameter. Also make debugging easier with a delayDebug function.

```TypeScript
const PrintRecursive = <T extends ICanPrint>(parent: T, children?: (parent: T) => ICanPrint[]) => {
    delayDebug("Printing parent...");
    parent.print();
    if (children) {
        delayDebug("Printing children...");
        const printJobs = children(parent);
        for (let idx = 0; idx < printJobs.length; idx += 1) {
            delayDebug(`Printing child at index ${idx}`);
            PrintRecursive(printJobs[idx]);
        }
    }
}
```

## Formatting

`git checkout 7861a91`

Add a simple function to help with printing contact info so it can print in label: value fashion.

```TypeScript
const firstUpper = (inp: string) => `${inp.charAt(0).toLocaleUpperCase()}${inp.slice(1)}`;

const printProperty = (key, contact: IAmContact) => {
    console.log(`${firstUpper(key)}: ${contact[key]}`);
}

// on contact class print() function

print() {
    printProperty("Name", this);
    printProperty("age", this);
    if (this.contactType === "mobile") {
        console.log("Cell phone:");
    }
    else {
        console.log("Landline:");
    }
    printProperty("contactNumber", this);
}
```

A bug was purposefully introduced: name shows `undefined`. The next iteration will catch and fix that.

## Key types

`git checkout df156fc`

Create a type named `ContactProperty` that uses `keyof` to fix the `printProperty` function. The defect is immediately apparent and can be fixed.

## Type guards

`git checkout 733725b`

Type guards allow IntelliSense to operate on a code block based on logic that enforces a type within the block. Update the `printProperty` function to check for a numeric type and print it fixed (without the decimal).

## Bonus: Strict typing and decorators

`git checkout df156fc`

Decorators make it easier to write a behavior once and apply it multiple times. The following code blocks include a helper method to grab the name of a function, a decorate for a constructor, and a decorator to "debug" a method call. Apply them liberally to classes and methods to see the results. Just place `@logLifeCycle` on a class definition or `@debug` before a method definition. The support for experimental decorators and metadata must be set to `true` in `tsconfig.json`.

A static method is added to calculate approximate year born and called from the `print` method to demonstrate interception of arguments and return values.

Turn on strict typing and refactor a few methods that don't have explicit types.

```TypeScript
const getFnName = (fn: Function) => {
    let funcText = fn.toString();
    let trimmed = funcText.substr('function '.length);
    let name = trimmed.substr(0, trimmed.indexOf('('));
    return name.trim();
};

function logLifecycle<T extends {new(...args:any[]):{}}>(constructor:T) {
    class newCtor extends constructor {
        constructor(...args: any[]) {
            super(args);
            delay(() => console.log(`Constructed ${getFnName(constructor)} at ${new Date()}`));
            return constructor.apply(this, args);
        }
    }
    newCtor.prototype = constructor.prototype;
    return newCtor;
}

function debug(_target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) {
    let originalMethod = descriptor.value; // save a reference to the original method
    descriptor.value = function (...args: any[]) {
        delay(() => console.info(`The method args for ${propertyKey}() are: ${JSON.stringify(args)}`)); // pre
        var result = originalMethod.apply(this, args);               // run and store the result
        delay(() => console.info(`The return value for ${propertyKey}() is: ${result}`));               // post
        return result;                                               // return the result of the original method
    };
    return descriptor;
}
```

## PostScript

This version illustrates output using a more modern JavaScript version. The target was changed in `tsconfig.json` to `es2018`. Note that the constructor decorate had to also be modified to use the new `Proxy` object.


text:
# API Reference

Generally speaking, dubbo keeps its functionality no intrusive as much as possible, but for some particular features, there's no other way not only API can achieve. [^1]

These APIs are summarized here below:

## Configuration API

```
com.alibaba.dubbo.config.ServiceConfig
com.alibaba.dubbo.config.ReferenceConfig
com.alibaba.dubbo.config.ProtocolConfig
com.alibaba.dubbo.config.RegistryConfig
com.alibaba.dubbo.config.MonitorConfig
com.alibaba.dubbo.config.ApplicationConfig
com.alibaba.dubbo.config.ModuleConfig
com.alibaba.dubbo.config.ProviderConfig
com.alibaba.dubbo.config.ConsumerConfig
com.alibaba.dubbo.config.MethodConfig
com.alibaba.dubbo.config.ArgumentConfig
```

Pls. refer to [API Configuration](../configuration/api.md) for further information.

## Annotation API

```
com.alibaba.dubbo.config.annotation.Service
com.alibaba.dubbo.config.annotation.Reference
```

Pls. refer to [Annotation Configuration](../configuration/annotation.md) for further information.

## Model API

```
com.alibaba.dubbo.common.URL
com.alibaba.dubbo.rpc.RpcException
```

## Context API

```
com.alibaba.dubbo.rpc.RpcContext
```

Pls. refer to [context](../demos/context.md) & [pass parameter in attachment](../demos/attachment.md) & [asynchronous call](../demos/async-call.md) for further information.

## Service API

```
com.alibaba.dubbo.rpc.service.GenericService
com.alibaba.dubbo.rpc.service.GenericException
```

Pls. refer to [generic reference](../demos/generic-reference.md) & [generic service](../demos/generic-service.md) for further information.

```
com.alibaba.dubbo.rpc.service.EchoService
```
Pls. refer to [test via echo service](../demos/echo-service.md) for further details.

[^1]: Attention: do not rely on APIs other than what're mentioned here, otherwise your application may face the risk of incompatibility after upgrade dubbo.

branch_name: refs/heads/asf-site


text:
# Project 1 - movie-viewer

movie-viewer is a movies app using the [The Movie Database API](http://docs.themoviedb.apiary.io/#).

Time spent: 10 hours spent in total

## User Stories

The following **required** functionality is complete:

- [x] User can view a list of movies currently playing in theaters from The Movie Database.
- [x] Poster images are loaded using the UIImageView category in the AFNetworking library.
- [x] User sees a loading state while waiting for the movies API.
- [x] User can pull to refresh the movie list.

The following **optional** features are implemented:

- [ ] User sees an error message when there's a networking error.
- [x] Movies are displayed using a CollectionView instead of a TableView.
- [x] User can search for a movie.
- [ ] All images fade in as they are loading.
- [x] Customize the UI.

The following **additional** features are implemented:

- [ ] List anything else that you can get done to improve the app functionality!

Please list two areas of the assignment you'd like to **discuss further with your peers** during the next class (examples include better ways to implement something, how to extend your app in certain ways, etc):

1. How to remove gap between cells vertically
2. Discuss a good way to display movie ratings

## Video Walkthrough

Here's a walkthrough of implemented user stories:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Notes

Describe any challenges encountered while building the app.

## License

    Copyright 2017 Rodrigo Bell

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

# Project 2 - movie-viewer

movie-viewer is a movies app displaying box office and top rental DVDs using [The Movie Database API](http://docs.themoviedb.apiary.io/#).

Time spent: 25 hours spent in total

## User Stories

The following **required** functionality is completed:

- [x] User can view movie details by tapping on a cell.
- [x] User can select from a tab bar for either **Now Playing** or **Top Rated** movies.
- [x] Customize the selection effect of the cell. (n/a for collection view)

The following **optional** features are implemented:

- [ ] For the large poster, load the low resolution image first and then switch to the high resolution image when complete.
- [x] Customize the navigation bar.

The following **additional** features are implemented:

- [x] User can view movie trailers from Movie Details screen to a Web View that pulls up the Youtube page with a search query of the selected movie.
- [x] User can filter top rated films by genre.
    - [x] Selected genre is persisted using User Defaults.
    - [x] Table view cells update a to checkmark when selected.
    - [x] Scroll view scrolls back to top when genre is changed.
- [x] Infinite scrolling.
- [x] Customize the UI.
    - [x] Implemented search bar in navigation bar.
    - [x] Customized spacing between cells in collection view.
    - [x] Scroll effect in Movies Details screen with fixed poster background.
    - [x] Trailers screen UI matches that of rest of app.
    - [x] Added tab bar icons.

Please list two areas of the assignment you'd like to **discuss further with your peers** during the next class (examples include better ways to implement something, how to extend your app in certain ways, etc):

1. Filter table view cells strange behavior where accessoryType checkmark gets toggled randomly as you scroll throught the table view.
2. Infinite scrolling progress animation not working.

## Video Walkthrough

Here's a walkthrough of implemented user stories:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Notes

Describe any challenges encountered while building the app.

## License

    Copyright 2017 Rodrigo Bell

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: rodrigobell/movie-viewer

repo_name: rodrigobell/movie-viewer


text:
Cake

An object orientated math library, Built with power and simplicity!

    Cake is an object orientated math library based off Sympy and aims to be simple and easy to use. Its main advantages are easy of use, chaining and provides shortcuts to lengthy methods.

    License: MIT License (see the LICENSE file for details) covers all files in the cake repository unless stated otherwise.

Features

Generally is fast and provides simple solutions for complex problems

Simple to use and learn

Provides support for algebra and equation substitution

Installation

This library is currently in very early works! It does not have much to offer as of now, but we have a vision to make it full of features!

Stable

```sh
# Windows
pip install MathCake

# Linux/MacOS
pip3 install MathCake
```

Development

```sh
git clone https://github.com/Mecha-Karen/Cake
cd Cake
pip install .
```

Documentation

To compile the documentation, click [me](https://github.com/Mecha-Karen/Documentation#compiling-cake) for more information

If you wish to view the live version, click [me](https://docs.mechakaren.xyz/cake).

Quick Example

Quadratic Formula

Note: This is currently just a concept!

```py
from cake import Expression

expr = Expression("-b (+|-) sqrt((b ** 2) - 4(a)(c))")
# Top layer of the formula

# (+|-) will return 2 solutions as stated in the documentation
# Its one of the many ways of implements plus or minus

expr.wrap_all("/", "2(a)")
# Puts the entire current formula into brackets and divides by 2a

print(expr.substitute(a=10, b=-20, c=5))

# Results: (1.70711, 0.292893)
```

Solving Simultaneous Equations

```py
from cake import Expression
from cake.simultaneous import Circle

circle = Expression("x ** 2 + y ** 2") == 16
line = Expression("x + y") == 4

eq = Circle(circle, line)
eq.solve_by_sub()
# Result: ((4, 0), (0, 4))
```

Links

Documentation

Support Server

PyPi Page

repository: TheGenocides/Cake

branch_name: refs/heads/main

repo_name: TheGenocides/Cake


text:
eXNVerify (abbreviation from *eXon and SNV Verification*) includes Python-based tools for extraction of clinically important genome sequence regions and verification of their coverage quality. Prepared tools wrapped into ready-to-go ``Docker container`` allow presenting the results of analysis in an intuitive way for genetic diagnostician. Two independent executables take BED file as the whole genome/exome sequence coverage and:
1. ``geneCoverage.py`` performs detailed verfication of pathogenic germline and somatic single nucletide variants (SNV) for chosen gene(s) in a graphical from,
2. ``snvScore.py`` analyses the whole genome sequence coverage and evaluate all pathogenic germline and somatic SNV coverage quality.

Both tools prepare also the text report of the analysis which focus on calculation of the percentage of SNVs that are covered with a user-defined level.

## Dependencies & reference files

Both tools require decompressed BED file with the general coverage of wgs/wes sample. The actual implementation testing utilized BED output of the ``mosdepth`` that is a fast tool for BAM file analysis. Detailed description of mosdepth and generation of per-base BED file can be found in [mosdepth documentation](https://github.com/brentp/mosdepth).

Using ``geneCoverage`` or ``snvScore`` requires reference information about pathogenic germline and somatic SNVs (as Clinvar-generated table files), and exom reference (BED file format). In this repository, utilized exom reference BED file and all pathogenic germline and pathogenic somatic SNV tables are included. User may prepare their own references, however they needs to be prepared accordingly: ``snvScore`` would analyze all SNV positions included in reference files, but analysing coverage of particular gene with ``geneCoverage`` requires suitable gene-related SNV and gene-related exon positions.

## Installation

eXNVerify works with Python 3.8 and is estabilished in standalone and ready-to-go ``docker container``. It is prepared for Unix operating systems and it is available to pull from [this DockerHub repository](https://hub.docker.com/r/porebskis/exnverify):

`docker pull porebskis/exnverify:1.0`

## Usage

Repository contains two standalone Python executable codes:

### 1. geneCoverage.py
```
geneCoverage [-h]
                    SampleBED RefExomeBED SNVGermlineTXT SNVSomaticTXT
                    Threshold GeneName_s [GeneName_s ...]

positional arguments:
  SampleBED       Path to the mosdepth per-base BED output
  RefExomeBED     Path to the all exons BED file
  SNVGermlineTXT  Path to Clivar-generated table with pathogenic germline SNVs
  SNVSomaticTXT   Path to Clivar-generated table with pathogenic somatic SNVs
  Threshold       Coverage quality threshold
  GeneName_s      Gene name(s)

optional arguments:
  -h, --help      show this help message and exit
```

Exemplar ``docker run`` command with geneCoverage.py execution as follows:
```
docker run -it --rm -v ~/hostpath/:/input -v ~/hostpath/:/output porebskis/exnverify:1.0 \
           ./geneCoverage.py
           input/SampleBED \
           input/RefExomeBED \
           input/SNVGermlineTXT \
           input/SNVSomaticTXT \
           Threshold \
           GeneName_s
```
For the purpose of this project development, two ClinVar-generated tables are prepared separately for germline and somatic pathogenic SNVs. These tables can be easily generated from the ClinVar. In this repository, user may find examples of these tables. They contain all pathogenic SNV for all genes, however, they are limited (using ClinVar filters) to these records which are approved by expert panel or submitted by multiple sources to ClinVar. Thus, two SNV tables saved as TXT contain about 15k SNVs and user may feel free to utilize them in their samples analysis.

The main output of the ``geneCoverage.py`` is the PDF figure with chromosome region where all exones and SNV position occurs for given gene(s). The code execution prepares at least one PDF figure for each input gene. If exones related to the input gene are located in more than one chromosomee, suitable number of figures is generated. If the input gene is not listed in ``RefExomeBED`` file, analysis is not performed.

In this way, ``geneCoverage.py`` allows verifying the gene coverage in detail and support diagnostician to evaluate the wgs/wes sample for the purposes of further analysis and diagnosis process.

### 2. snvScore.py
```
snvScore [-h] SampleBED SNVGermlineTXT SNVSomaticTXT [Threshold]

positional arguments:
  SampleBED       Path to the mosdepth per-base BED output
  SNVGermlineTXT  Path to Clivar-generated table with pathogenic germline SNVs
  SNVSomaticTXT   Path to Clivar-generated table with pathogenic somatic SNVs
  Threshold       SNV coverage quality threshold (optional, positive)

optional arguments:
  -h, --help      show this help message and exit
```

The ``docker run`` command with ``snvScore.py``execution is as follows:
```
docker run -it --rm -v ~/hostpath/:/input -v ~/hostpath/:/output porebskis/exnverify:1.0 \
           ./snvScore.py \
           input/SampleBED \
           input/SNVGermlineTXT \
           input/SNVSomaticTXT \
           Threshold
```

The output of ``snvScore.py`` is the report TXT file with coverage information about all pathogenic SNVs (germline and somatic) in the input sample. User may use avaliable reference files of prepare their own collection of SNVs for the purpose of this analysis.

This repo contains exemplar outputs of long-read, short-read genome sequencing as well as short-read whole exome sequencing data. ``geneCoverage`` has been executed for analysis several genes higly relevant for medical genetics and cancer genomics: MSH6, TP53, ABCA4, PDGFRB, LEMD2, CFTR, HTT, DMD and one of the most popular gene in cancer diagnosis, BRCA1. Moreover, ``snvScore.py`` has beed utilized to evaluate samples and their coverage of all ClinVar-reported single nucleotide variants.

## Example outputs

### 1. geneCoverage

Below exemplar coverage diagram for BRCA1 gene in HG003 sample generated with LR whole genome sequencing using PacBio HiFi downloaded from [this repository](https://console.cloud.google.com/storage/browser/brain-genomics-public/research/sequencing/grch38/bam/pacbio_hifi) (below PDF converted to PNG is presented for the purpose of this markdown file -- click for full-size image):

![BRCA1 coverage](https://github.com/porebskis/eXNVerify/blob/717c3fb905cd3c3025b1c64945ecb05ee4dc8c10/readme_fig.PNG)

Since ``geneCoverage`` is prepared to analyse coverages of more than one genes, it generates suitable number of figures and save summary of SNV coverage quality in TXT report. Example report generated with ``geneCoverage`` is:

```
geneCoverage - HG003.hiseqx.pcr-free.20x.dedup.grch38.bam.per-base.bed

Input genes: ['MSH6', 'TP53', 'ABCA4', 'PDGFRB', 'LEMD2', 'CFTR', 'HTT', 'DMD']

Pathogenic (G - germline, S - somatic) SNV coverage:
- 'count' is the number of variants in a given region
- 'AT' is the percentage of SNV coverage above threshold (20x)

  gene    chr count(G)  median(G) std(G) min(G) max(G) AT(G) count(S)  median(S) std(S) min(S) max(S) AT(S)
-----------------------------------------------------------------------------------------------------------
  MSH6   chr2      118         25      5     14     39   90%        4         24      2     22     28  100%
  TP53  chr17       89         24      6     16     41   85%       68         23      6     17     41   87%
 ABCA4   chr1      166         25      6     13     44   89%        0          0      0      0      0    0%
PDGFRB   chr5        1         32      0     32     32  100%        1         32      0     32     32  100%
 LEMD2   chr6        0          0      0      0      0    0%        0          0      0      0      0    0%
  CFTR   chr7      192         24      5     16     38   85%        0          0      0      0      0    0%
   HTT   chr4        0          0      0      0      0    0%        0          0      0      0      0    0%
   DMD   chrX      144         12      4      4     21    2%        0          0      0      0      0    0%
-----------------------------------------------------------------------------------------------------------

```
Percentage values of above table are also sent to standard output if ``docker run`` is executed without `-d` option (then, container work in detached/background mode).

### 2. snvScore
Exemplar coverage report as the results of ``snvScore.py`` HG003 sample from pacbio-hifi (downloaded from Google Storage) is as follows:
```
SNV coverage report - HG003.pacbio-hifi.21x.haplotag.grch38.bam.per-base.bed

81% of all pathogenic germline SNVs and 91% of all pathogenic somatic SNVs are covered above threshold (15)

Whole genome coverage:
median mean  std 1st quartile 3rd quartile  min     max
    22   32  190           18           26    0   24444

Pathogenic (G - germline, S - somatic) SNV coverage:
('count' is the number of variants in a given region)

region count(G)  median(G) std(G) min(G) max(G) count(S)  median(S) std(S) min(S) max(S)
----------------------------------------------------------------------------------------
   ALL    14157         20      6      1     43      310         20      5      9     36
----------------------------------------------------------------------------------------
  chr1     1182         21      5      8     37       10         24      3     17     29
  chr2     1118         22      6      5     39       33         20      5     12     33
  chr3      774         20      5      8     37       40         21      6     10     33
  chr4      270         20      7      7     41        6         16      2     15     19
  chr5      538         21      5      5     36       10         18      4     15     29
  chr6      511         22      6      4     43        0          0      0      0      0
  chr7      717         22      5      6     43       13         26      4     21     34
  chr8      335         23      6      8     37        0          0      0      0      0
  chr9      479         20      6      2     37        1         27      0     27     27
 chr10      362         20      6      9     36       32         20      7      9     36
 chr11      966         19      6      6     36        9         14      6     11     27
 chr12      709         22      5     10     38       12         23      3     16     25
 chr13      910         17      5      9     37       26         22      5     11     29
 chr14      324         23      4      9     34        6         21      4     13     27
 chr15      533         21      5      8     35        4         17      1     17     20
 chr16      643         19      6      3     40        1         17      0     17     17
 chr17     1561         20      4      8     37       88         21      2     14     24
 chr18      154         20      6     11     35        4         25      2     25     30
 chr19      720         18      4      7     27       10         12      4      9     20
 chr20      146         18      5      8     35        0          0      0      0      0
 chr21      174         14      6      2     28        1         22      0     22     22
 chr22      181         16      5      1     29        2         18      6     12     24
  chrX      850         10      4      3     24        2         14      4      9     18
  chrY        0          0      0      0      0        0          0      0      0      0
----------------------------------------------------------------------------------------
```
The 3rd line of report file is also a summary log send to the standard output when ``snvScore`` is finished with success.

repository: porebskis/eXNVerify

gha_language: Python

repo_name: porebskis/eXNVerify


text:
# fibonacci-sum-map

Calculate the Nth digit of the Fibonacci Sequence

For example:

```shell
echo 1 | fibonacci-sum-map
#> 1

echo 7 | fibonacci-sum-map
#> 13
```

repository: GataKamsky/fibonacci-sum-map

repo_name: GataKamsky/fibonacci-sum-map


text:
# scatlight
Calculation of light scattering profile in the astronomical long-slit spectroscopic data.

This approach has been developed and tested for long-slit data taken with RSS spectrograph mounted at SALT telescope. See detailed description in the paper Katkov, Kniazev et al..
[Katkov, Kniazev, Kasparova, Sil'chenko, MNRAS 483, 2413 (2019)](https://ui.adsabs.harvard.edu/abs/2019MNRAS.483.2413K/abstract)

---
**NOTE**

To estimate scattering light profile one needs reference star spectrum and good knowledge of the PSF at the observation moment.

---

## Example

<img src="https://github.com/ivan-katkov/scatlight/blob/master/pic_example.png" width="30%" height="30%" alt="Example of scattered light calculation">

The top panel shows the light profile of a reference star along the slit (black colour) which was used for the scattered light component calculation.
The red line represents the result of the convolution of an atmospheric PSF (green lines) with the model of the instrumental PSF component fscat (blue lines).
Two different parameterizations for the atmospheric PSF have been used.
The Gaussian one is shown with a solid line and the Moffat one with a dashed line.
Both parameterizations provide a different estimation of an additive component of the instrumental scattering function fscat.
The middle panel shows the galaxy light profile of NGC 1380A including the night sky background along the slit at a wavelength 5096 Å.
The estimated scattered light component as shown by the blue lines corresponding
to both Gaussian and Moffat shapes of the atmospheric PSF.
The lower panel indicates the fraction of light scattered by the telescope and instrument with respect to the total light distribution.
See Section 2.3 in the [Paper](https://ui.adsabs.harvard.edu/abs/2019MNRAS.483.2413K/abstract) for a detailed description.

repository: ivan-katkov/scatlight

repo_name: ivan-katkov/scatlight


text:
[![Build Status](https://travis-ci.com/JuliaIO/LibSerialPort.jl.svg?branch=master)](https://travis-ci.com/JuliaIO/LibSerialPort.jl)

# LibSerialPort.jl

[libserialport](http://sigrok.org/wiki/Libserialport) is a small, well-documented C library for general-purpose serial port communication. This is a julia wrapper for the library.

Apart from a very few non-essential functions, the entire library API (about 75 functions) is wrapped using `ccall`. In addition, a higher-level interface is also provided that follows Julia's IO stream interface.

## Installation

    pkg> add LibSerialPort

## Usage

Try

    julia> using LibSerialPort
    julia> list_ports()  # or get_port_list() for an array of names

The examples/ directory contains a simple serial console for the command line. This may serve as a useful starting point for your application. The serial_example.ino sketch can be flashed to a microcontroller supported by the Arduino environment.

```julia
using LibSerialPort

# Modify these as needed
name = "/dev/ttyS0"
baudrate = 115200

# Snippet from examples/mwe.jl
LibSerialPort.open(portname, baudrate) do sp
	sleep(2)

	if bytesavailable(sp) > 0
    	println(String(read(sp)))
	end

    write(sp, "hello\n")
    sleep(0.1)
    println(readline(sp))
end
```

The tests are also worth looking at for demonstration of i/o and configuration. They can be run via `julia test/runtests.jl <address> <baudrate>`. Unless the address of your device matches that in runtests.jl, doing `pkg> test LibSerialPort` will fail. This problem would be addressed by [support for args](https://github.com/JuliaLang/Pkg.jl/issues/518) in the Pkg REPL.

Note that on Windows, returning an OS-level port handle is not yet supported.


text:
# webpack-sources

Contains multiple classes which represent a `Source`. A `Source` can be asked for source code, size, source map and hash.

## `Source`

Base class for all sources.

### Public methods

All methods should be considered as expensive as they may need to do computations.

#### `source`

``` js
Source.prototype.source() -> String | ArrayBuffer
```

Returns the represented source code as string.

#### `size`

``` js
Source.prototype.size() -> Number
```

Returns the size in chars of the represented source code.

#### `map`

``` js
Source.prototype.map(options: Object) -> Object | null
```

Returns the SourceMap of the represented source code as JSON. May return `null` if no SourceMap is available.

The `options` object can contain the following keys:

* `columns: Boolean` (default `true`): If set to false the implementation may omit mappings for columns.
* `module: Boolean` (default `true`): If set to false the implementation may omit inner mappings for modules.

#### `sourceAndMap`

``` js
Source.prototype.sourceAndMap(options: Object) -> {
	source: String,
	map: Object
}
```

Returns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). This method could have better performance than calling `source()` and `map()` separately.

See `map()` for `options`.

#### `updateHash`

``` js
Source.prototype.updateHash(hash: Hash) -> void
```

Updates the provided `Hash` object with the content of the represented source code. (`Hash` is an object with an `update` method, which is called with string values)

#### `node` (optional)

``` js
Source.prototype.node(options: Object) -> SourceNode
```

This is an optional method. It may be `null` if not implemented.

Returns a `SourceNode` (see source-map library) for the represented source code.

See `map()` for `options`.

#### `listNode` (optional)

``` js
Source.prototype.listNode(options: Object) -> SourceNode
```

This is an optional method. It may be `null` if not implemented.

Returns a `SourceListMap` (see source-list-map library) for the represented source code.

See `map()` for `options`.

## `RawSource`

Represents source code without SourceMap.

``` js
new RawSource(sourceCode: String)
```

## `OriginalSource`

Represents source code, which is a copy of the original file.

``` js
new OriginalSource(
	sourceCode: String,
	name: String
)
```

* `sourceCode`: The source code.
* `name`: The filename of the original source code.

OriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (`;`, `{`, `}`).

## `SourceMapSource`

Represents source code with SourceMap, optionally having an additional SourceMap for the original source.

``` js
new SourceMapSource(
	sourceCode: String,
	name: String,
	sourceMap: Object | String,
	originalSource?: String,
	innerSourceMap?: Object | String,
	removeOriginalSource?: boolean
)
```

* `sourceCode`: The source code.
* `name`: The filename of the original source code.
* `sourceMap`: The SourceMap for the source code.
* `originalSource`: The source code of the original file. Can be omitted if the `sourceMap` already contains the original source code.
* `innerSourceMap`: The SourceMap for the `originalSource`/`name`.
* `removeOriginalSource`: Removes the source code for `name` from the final map, keeping only the deeper mappings for that file.

The `SourceMapSource` supports "identity" mappings for the `innerSourceMap`.
When original source matches generated source for a mapping it's assumed to be mapped char by char allowing to keep finer mappings from `sourceMap`.

## `LineToLineMappedSource`

Represents source code, which is mapped line by line to the original file.

``` js
new LineToLineMappedSource(
	sourceCode: String,
	name: String,
	originalSource: String
)
```

* `sourceCode`: The source code.
* `name`: The filename of the original source code.
* `originalSource`: The original source code.

## `CachedSource`

Decorates a `Source` and caches returned results of `map`, `source`, `size` and `sourceAndMap` in memory. Every other operation is delegated to the wrapped `Source`.

``` js
new CachedSource(source: Source)
```

## `PrefixSource`

Prefix every line of the decorated `Source` with a provided string.

``` js
new PrefixSource(
	prefix: String,
	source: Source
)
```

## `ConcatSource`

Concatenate multiple `Source`s or strings to a single source.

``` js
new ConcatSource(
	...items?: Source | String
)
```

### Public methods

#### `add`

``` js
ConcatSource.prototype.add(item: Source | String)
```

Adds an item to the source.

## `ReplaceSource`

Decorates a `Source` with replacements and insertions of source code.

The `ReplaceSource` supports "identity" mappings for child source.
When original source matches generated source for a mapping it's assumed to be mapped char by char allowing to split mappings at replacements/insertions.

### Public methods

#### `replace`

``` js
ReplaceSource.prototype.replace(
	start: Number,
	end: Number,
	replacement: String
)
```

Replaces chars from `start` (0-indexed, inclusive) to `end` (0-indexed, inclusive) with `replacement`.

Locations represents locations in the original source and are not influenced by other replacements or insertions.

#### `insert`

``` js
ReplaceSource.prototype.insert(
	pos: Number,
	insertion: String
)
```

Inserts the `insertion` before char `pos` (0-indexed).

Location represents location in the original source and is not influenced by other replacements or insertions.

#### `original`

Get decorated `Source`.


text:
---
title : Law of Requisite Variety and two-way data sync
date: 2020-09-04
---
Data syncing is a problem that can be underestimated.
It seems very easy on the face of it.
If you have and control System A, it can be easy to ingest data into A from System B.
Then at some point a requirement to bi-directional sync A and B is presented.
The managers or executives think it should be easy as playing a Reverse Uno card!

It is not and the main issue is one of data constraints.
Going back to the controlling System A and integrating with System B.
In any two-way sync of systems, what should happen if System A does something that is 'invalid' in System B.
At that point they are out of sync and what happens after that?
Ignore that difference?
Alert the user?
Do the 'reasonable' thing?
If someone does it different is always unreasonable.

There is also the reverse case.
What if System B does something that System A(your system) does views as invalid?
The same questions apply but often the result is a hack to allow input into System A.

Then what happens if you have multiple modifications in A and B that don't sync across?
Which system is right at that point?
The last change is the easy answer but often you only have access to when the field was changed only the object.
A modified [Segal's law](https://en.wikipedia.org/wiki/Segal%27s_law) can apply here

> "A man with a system knows what is correct. A man with two systems is never sure"

This boils down to the [Law of Requisite Variety](http://requisitevariety.co.uk/what-is-requisite-variety/).
Basically you need to have System A have as many options, actions and constraints as System B.
For every 'action' of System B there need to be a reaction from System A.
In order words if you want to have "complete" two-way sync that is "seamless" what you are really saying is "I want to recreate System B on top of our System A"
Which can be a major undertaking but there are three ways to deal address this.

## Change Nothing
Actually implement a full bi-directional sync.
You become an expert at understanding System B.
You know everything it can and cannot do.

You subscribe to their changelogs and try to start a business partnership with them.

I think this would only work if it is a larger company.
There needs to be some buffer or a large enough revenue stream from other places to accomplish this.
I honestly think that just buying the other company would be a better solution then it because an issue of integration of two product to hopefully increase revenue.

## Restrictions
One answer is to restrictions.
Have a set of actions where the reaction is just 'not syncable'.

For example maybe System B had multiple, complex field types like Country.
The Country field has a list of valid options like "France" or "South Korea" and if you try an invalid option then System B will return an error code.
You can exclude Country field from the sync and only sync simple fields like a String or Number.
This way there is less complexity and less responses you have to go through and you are ignore and freeing your program from worrying about a set of reactions.

If you want to sync with something restrict the options.
Maybe only certain data rows or fields are synced.
Maybe you can only read certain field but not write them.

This is actually what most bi-directional and 'seamless' syncs do.
It is sort of seamless if you squint and ignore some gotchas.
It is mainly a marketing tactic which people take too literally.

## Open the APIs
This is really clever since it combines the above two options and offloads the cost to a third-party.
See the issue with Restrictions is that you have to decide what to and a customer might had make a different choice than you. You need good documentation and result code on for System A and they can require more features but only if it makes sense for what System A already does.

## Conclusion

You have three options with bi-directional syncs

- Implement it
- Add Constraints
- Open up APIs

These can be mixed around of course but it is painful when people assume it is an potential easy problem when it also might potential be very hard.
In any case you can use constraints and open apis to make the code simpler, delivery faster and the overall experiences within the company and for your customers better.


text:
# AstroHackWeek2016

Materials for the 2016 Astro Hack Week

[![Join the chat at https://gitter.im/astrohackweek/astrohackweek2016](https://badges.gitter.im/astrohackweek/astrohackweek2016.svg)](https://gitter.im/astrohackweek/astrohackweek2016?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Find out more about AstroHackWeek](https://img.shields.io/badge/Made%20at-%23AstroHackWeek-8063d5.svg?style=flat)](http://astrohackweek.org)


text:
# Movie_Recommendation_System

---

### In this project we build a recommendation system capable of recommending movies with the help of various holistic features like IMDB rating, Genre and others, using the MovieLens_20M_Dataset.

---

## Tools used:

- Numpy
- Pandas
- os
- sklearn
- Matplotib

The dataset used here is owned by their respective owner.


text:
# Event handling

In Qt you can respond to an external event like a key press via event handling. Events always are processed by the event loop. Alongside events Qt also has a concept of Signals/Slots. Signals and slots are used to primarily communicate between widgets (more precisely QObjects). So the most common way of interacting between Qt Widgets is done through signals/slots. (More details here: https://doc.qt.io/qt-5/signalsandslots.html). Hence we would be implementing support for both events and signals.

**Technicals:**

> An event is a message encapsulated in a class (QEvent) which is processed in an event loop and dispatched to a recipient that can either accept the message or pass it along to others to process. They are usually created in response to external system events like mouse clicks.
> Signals and Slots are a convenient way for QObjects to communicate with one another and are more similar to callback functions. In most circumstances, when a "signal" is emitted, any slot function connected to it is called directly. The exception is when signals and slots cross thread boundaries. In this case, the signal will essentially be converted into an event.

# Implementing Signal handling

In Qt signals and slots are used to communicate between different qt widgets. So they can be used to implement things like
onClick, onHover etc.

The way Qt Signals work is explained here:

https://doc.qt.io/qt-5/signalsandslots.html

The way you use them in Qt for a PushButton is explained here:
https://wiki.qt.io/How_to_Use_QPushButton#Signals

# Adding signal/event handling support to a NodeWidget

We will take the example of PushButton

**Javascript**

Steps:

The widget should inherit from `NodeWidget`. NodeWidget inherits from EventWidget internally. EventWidget constructor needs native object while initialising. So arrange your code such that native object gets initialised before calling `super(native)`.

EventWidget adds `addEventListener` method to the widget which can be called
like this:

```js
button.addEventListener('clicked', () => {
    console.log('clicked');
});
```

To help the user know what all signals/events are supported, export an enum like `QPushButtonEvents` as shown below.

So the user can then use it as below:

```js
button.addEventListener(QPushButtonEvents.clicked, () => {
    console.log('clicked');
});
```

Example:

```js
import addon from '../../core/addon';
import { QWidget } from '../../QtGui/QWidget';
import { BaseWidgetEvents } from '../../core/EventWidget';

export const QPushButtonEvents = Object.freeze({
    ...BaseWidgetEvents,
    clicked: 'clicked',
    pressed: 'pressed',
    released: 'released',
    toggled: 'toggled',
});

export class QPushButton extends QWidget {
    constructor(parent?: QWidget) {
        let native: NativeElement;
        if (parent) {
            native = new addon.QPushButton(parent.native);
        } else {
            native = new addon.QPushButton();
        }
        super(native);
        this.parent = parent;
    }

    setText(text: string | number) {
        this.native.setText(`${text}`);
    }
}
```

**C++**

Steps:

1. `NPushButton`

Inherit from both QPushButton and NodeWidget. Make sure you have added NODEWIDGET_IMPLEMENTATIONS macro. This adds a crucial method for events support. It will override `event(QEvent *)` method of QPushbutton so that nodejs can listen to the events of this widget. This makes sure we convert all the QEvent's of this widget to an event for the nodejs event emitter.

Also make sure to connect all the signals of the widgets to the event emitter instance from NodeJS. This way we kind of convert the signal to a simple nodejs event.

```cpp
#pragma once

#include <QPushButton>
#include "src/cpp/core/NodeWidget/nodewidget.h"
#include "napi.h"

class NPushButton: public QPushButton, public NodeWidget
{
    NODEWIDGET_IMPLEMENTATIONS(QPushButton)
public:
    using QPushButton::QPushButton; //inherit all constructors of QPushButton

    // override this method and implement all signals here
    void connectSignalsToEventEmitter() {
        // Qt Connects: Implement all signal connects here
        QObject::connect(this, &QPushButton::clicked, [=](bool checked) {
            Napi::Env env = this->emitOnNode.Env();
            Napi::HandleScope scope(env);
            this->emitOnNode.Call({  Napi::String::New(env, "clicked"), Napi::Value::From(env, checked) });
        });
        QObject::connect(this, &QPushButton::released, [=]() {
            Napi::Env env = this->emitOnNode.Env();
            Napi::HandleScope scope(env);
            this->emitOnNode.Call({  Napi::String::New(env, "released") });
        });
        QObject::connect(this, &QPushButton::pressed, [=]() {
            Napi::Env env = this->emitOnNode.Env();
            Napi::HandleScope scope(env);
            this->emitOnNode.Call({  Napi::String::New(env, "pressed") });
        });
        QObject::connect(this, &QPushButton::toggled, [=](bool checked) {
            Napi::Env env = this->emitOnNode.Env();
            Napi::HandleScope scope(env);
            this->emitOnNode.Call({  Napi::String::New(env, "toggled"), Napi::Value::From(env, checked) });
        });
    }
};

```

**Additional**

Make sure `npushbutton.h` is added to `config/moc.json`.
And run `npm run automoc` before running `npm run build:addon`

We need to run Qt's MOC (Meta Object Compiler) on the file whenever we use Q_OBJECT in a class or use QObject::connect. This is so that Qt can expand the macros and add necessary implementations to our class.

# How does it work ?

1. On JS side for each widget instance we create an instance of NodeJS's Event Emitter. This is done by the class `EventWidget` from which `NodeWidget` inherits
2. We send this event emitter's `emit` function to the C++ side by calling `initNodeEventEmitter` method and store a pointer to the event emitter's emit function using `emitOnNode`. initNodeEventEmitter function is added by a macro from EventWidget (c++). You can find the initNodeEventEmitter method with the event widget macros.
3. We setup Qt's connect method for all the signals that we want to listen to and call the emitOnNode (which is actually emit from Event emitter) whenever a signal arrives. This is done manually on every widget by overriding the method `connectSignalsToEventEmitter`. Check `npushbutton.h` for details. This takes care of all the signals of the widgets. Now to export all qt events of the widget, we had overriden the widgets `event(Event*)` method to listen to events received by the widget and send it to the event emitter. This is done inside the EVENTWIDGET_IMPLEMENTATIONS macro

repository: nodegui/nodegui

repo_name: nodegui/nodegui