text:
RoaringBitmap [![Build Status](https://travis-ci.org/tgruben/roaring.png)](https://travis-ci.org/tgruben/roaring)[![GoDoc](https://godoc.org/github.com/tgruben/roaring?status.svg)](https://godoc.org/github.com/tgruben/roaring)
=============

This is a go port of the Roaring bitmap data structure.

Roaring is  used by Apache Spark (https://spark.apache.org/), Apache Kylin (http://kylin.io),
Druid.io (http://druid.io/) and  Apache Lucene (http://lucene.apache.org/) (as well as supporting systems
such as Solr and Elastic).

The original java version can be found at https://github.com/lemire/RoaringBitmap

The Java and Go version are meant to be binary compatible: you can save bitmaps
from a Java program and load them back in Go, and vice versa.

This code is licensed under Apache License, Version 2.0 (ASL2.0).

Contributors: Todd Gruben (@tgruben), Daniel Lemire (@lemire), Elliot Murphy (@statik), Bob Potter (@bpot), Tyson Maly (@tvmaly), Will Glynn (@willglynn)

### Reference

Samy Chambi, Daniel Lemire, Owen Kaser, Robert Godin, Better bitmap performance with Roaring bitmaps, Software: Practice and Experience (to appear) http://arxiv.org/abs/1402.6407

### Dependencies

  - go get github.com/smartystreets/goconvey/convey
  - go get github.com/willf/bitset

Naturally, you also need to grab the roaring code itself:
  - go get github.com/tgruben/roaring

### Example

Here is a simplified but complete example:

```go
package main

import (
    "fmt"
    "github.com/tgruben/roaring"
    "bytes"
)

func main() {
    // example inspired by https://github.com/fzandona/goroar
    fmt.Println("==roaring==")
    rb1 := roaring.BitmapOf(1, 2, 3, 4, 5, 100, 1000)
    fmt.Println(rb1.String())

    rb2 := roaring.BitmapOf(3, 4, 1000)
    fmt.Println(rb2.String())

    rb3 := roaring.NewRoaringBitmap()
    fmt.Println(rb3.String())

    fmt.Println("Cardinality: ", rb1.GetCardinality())

    fmt.Println("Contains 3? ", rb1.Contains(3))

    rb1.And(rb2)

    rb3.Add(1)
    rb3.Add(5)

    rb3.Or(rb1)

    // prints 1, 3, 4, 5, 1000
    i := rb3.Iterator()
    for i.HasNext() {
        fmt.Println(i.Next())
    }
    fmt.Println()

    // next we include an example of serialization
    buf := new(bytes.Buffer)
    rb1.WriteTo(buf) // we omit error handling
    newrb:= roaring.NewRoaringBitmap()
    newrb.ReadFrom(buf)
    if rb1.Equals(newrb) {
    	fmt.Println("I wrote the content to a byte stream and read it back.")
    }
}
```

If you wish to use serialization and handle errors, you might want to
consider the following sample of code:

```go
	rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000)
	buf := new(bytes.Buffer)
	size,err:=rb.WriteTo(buf)
	if err != nil {
		t.Errorf("Failed writing")
	}
	newrb:= NewRoaringBitmap()
	size,err=newrb.ReadFrom(buf)
	if err != nil {
		t.Errorf("Failed reading")
	}
	if ! rb.Equals(newrb) {
		t.Errorf("Cannot retrieve serialized version")
	}
```

### Documentation

Current documentation is available at http://godoc.org/github.com/tgruben/roaring

### Benchmark

Type

         go test -bench Benchmark -run -

### Alternative

For an alternative implementation in Go, see https://github.com/fzandona/goroar
The two versions were written independently.

repository: nyxwulf/roaring

repo_name: nyxwulf/roaring


text:
# DOCKER COMPOSE

## Copy/Save the folder with all package to /tmp/pool and create a tar bool

docker cp -L  debian-repository:/var/www/html/debtoox/pool /tmp/pool ;
tar -cvf pool.tar  /tmp/pool;

## Replace all packages from a saved operation

docker exec  debian-repository  /bin/bash  -c "rm -fr /var/www/html/debtoox/pool"
docker cp -L  /tmp/pool debian-repository:/var/www/html/debtoox/pool

license: MIT

repository: ulfhaga/debian-repository-distributor

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: ulfhaga/debian-repository-distributor


text:
### Intro to APIs:
- HTTP Methods
    - GET : GET request, when you are getting something from a server, "can i get all of this information?"
    - POST : post request, posting it up, when someone is adding something to server, when a comment is added to a website
    - PUT/PATCH : patch up the problem, make a update
    - DELETE: can something on the server be deleted

### HTTP Status Codes
- 1XX
- 2XX - 200 ok, all good
- 3XX -
- [4XX](https://http.cat) - 404 not sure what the client is requesting
- 5XX - 500 its not you, its me

### API
Ability to go to someone else's source of data because they might be offering a good source (only using my personal data when I am able to)

#### Cons to API
- you do not have much control over the API
- ex. if
- database structure that a company is giving you access to you to use their data


text:
Flappy Bird (Progressive Web App)
=========
Progressive Web App Flappy Bird GDG DevFest '17 (See my presentation [here](https://drive.google.com/file/d/17Gkp-GqjhiU0VLYdiuex6CtssBL-tfj8/view?usp=sharing))

This is a step-by-step progress of PWA each steps can be seen in the commit per branch.

Click here for [demo](https://floppy-bird-pwa.web.app/)

![Screenshot-1](/screenshots/screenshot-2.png)

repository: ponnex/PWA-Flappy-Bird

gha_language: JavaScript

repo_name: ponnex/PWA-Flappy-Bird


text:
# ShortRent
Practical training 2's project. An Airbnb kind website for short renting houses without online payment.

### Usage:
pip install -r requirements.txt

python manage.py runserver

### Preview
![1](./images/Image1.png)
![2](./images/Image2.png)
![3](./images/Image3.png)
![4](./images/Image4.png)
![5](./images/Image5.png)


text:
---
layout: post
title: Review of the European reference framework for sustainable cities
---

[Amanda Winter](https://www.nottingham.ac.uk/sociology/people/amanda.winter) has written a policy review for the International Journal of Community Well-Being.

Abstract:
>*This review examines the European Reference Framework for Sustainable Cities, an online framework for use by urban practitioners to evaluate and visualize the sustainability profile and priorities of an urban sustainability plan, policy, or initiative. This review presents recognized benefits and challenges from a testing phase of the framework, how it fits into the European Urban Agenda, and more broadly how indicator frameworks connect to the global urban sustainability context.

Journal link:
[https://doi.org/10.1007/s42413-018-0007-z](https://doi.org/10.1007/s42413-018-0007-z)

gha_language: CSS


text:
---
# Display name
name: Xiangming Ka

# Username (this should match the folder name)
authors:
- admin

# Is this the primary user of the site?
superuser: true

# Role/position
role: Vice-Principal of Unreal Studio at UESTC

# Organizations/Affiliations
organizations:
- name: University of Electronic Science and Technology of China
  url: ""

# Short bio (displayed in user profile at end of posts)
bio: My research areas include Computer Graphics (Rendering), Game Development, Computer Vision, and Machine Learning.

interests:
- Computer Graphics (hard-core Rendering)
- Game Development
- Virtual Reality/Augmented Reality
- Machine Learning

education:
  courses:
  - course: BE in Software Engineering (Digital Animation)
    institution: University of Electronic Science and Technology of China
    year: 2016.9-2020.6
  - course: Exchange Program
    institution: University of California, Santa Barbara
    year: 2019.4-2019.6

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
social:

- icon: github
  icon_pack: fab
  link: https://github.com/XiangmingKA
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
- icon: cv
  icon_pack: ai
  link: files/cv.pdf

- icon: envelope
  icon_pack: fas
  link<EMAIL_ADDRESS># Enter email to display Gravatar (if Gravatar enabled in Config)
email<EMAIL_ADDRESS>
# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
user_groups:
- Researchers
- Visitors
---

Welcome to Xiangming Ka's homepage!

I am a senior student who is majoring in Software Engineering at the University of Electronic Science and Technology of China (UESTC). Also, I am the vice-principle of the [Unreal Game Studio](http://www.ss.uestc.edu.cn/studio.do?id=491) at UESTC. My research fields include Computer Graphics (Rendering), Game Development, VR/AR, and Machine Learning. Besides the technological aspects, I am also interested in the artistic aspects of Visual Arts--Game Design, Game Culture, Filmmaking, and Photography.

repository: XiangmingKA/academic-kickstart

gha_license_id: MIT

repo_name: XiangmingKA/academic-kickstart


text:
# Galerina phlegmacioides Singer SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nova Hedwigia, Beih. 29: 313 (1969)

#### Original name
Galerina phlegmacioides Singer

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Boost-CMake-Ubuntu-Linux
This repository demonstrates how to set up a boost library in a Ubuntu machine and use CMake as a build system generator.

# This repository demonstrates how to include and link boost library from cmake.

Prerequisite:
I assume that you have already installed the latest boost library in your machine correctly.
if not,
1. download the latest boost library from : https://www.boost.org/users/history/version_1_67_0.html
2. extract the boost library to the the desired location using: tar --bzip2 -xf /path/to/boost_1_67_0.tar.bz2
3. go to the extracted directory: cd /path/to/boost_1_67_0
4. ./bootstrap.sh --prefix=/usr/local
5. sudo ./b2 install

After these steps boost library headers will be installed on /usr/local/include and compiled libraries will be installed on /usr/local/lib directory.

# Example
This project shows two examples using boost library. The first one, header_only.cpp needs header only boost library and the second one, boost_program_option.cpp needs a pre-compiled libboost_program_options library to be linked.

# Out-of-source build

```
create a directory called build in projects's root directory: mkdir build
navigate to the build directory : cd build
Turn ON ENABLE_EXAMPLES: ccmake ..
Make the project: make
```

repository: MrPoudel/Boost-CMake-Ubuntu-Linux

repo_name: MrPoudel/Boost-CMake-Ubuntu-Linux


text:
---
type: conference
speakers: -alexandre-salome
track: '1'
date: '2023-09-21'
start: '11:20'
end: '12:00'
short: Discover the time-saving benefits of API Platform for your web projects
tag: good-practices
---

# Developing an API without API Platform (🇺🇸)

Sure, API Platform is great, but have you ever tried developing an API without it? In this conference, I will show you how you can start from a Symfony application and, with a few dozen lines, mimic the top features of API Platform. I will show you how to start with a simple solution for your API needings.

As we will progress through the implementation and enrich our software, **we will see and understand the interest in using API Platform**, as it will move out of our codebase the boilerplate code and standardize the way of developing your APIs.

repository: api-platform/website

branch_name: refs/heads/main

gha_language: TypeScript

repo_name: api-platform/website


text:
# JBC_ENDRESTART

<PageHeader />

## Description

Enables the Break/End Restart feature.

## Values

Restart program name.

## Default

Break/End Restart feature disabled.

## Setting

On UNIX or on Windows, the JBC\_ENDRESTART environment variable should be set before any jBASE program is run. The environment variable should contain the command string to execute when the the debugger is exited.

To later enable the feature, use the [BITSET](./../../jbc/bitset/README.md)(-3). To later disable the feature, use the [BITRESET](./../../jbc/bitreset/README.md)(-3).

Back to [Environment Variables](./../README.md)

<PageFooter />

repository: patpog/docs

repo_name: patpog/docs


text:
# flask-blog-app

## Features
- multiple user ( admin, user )
- bulk delete for blogs, images, user
- bulk promote users to admin
- admin cant see email users
- wysiwyg editor with ckeditor
- basic rest api
- reset password
- cursor pagination
- validate email and password ( avoid duplicate )

## Installations
```sh
apt-get install python3 git
git clone https://github.com/gibran-abdillah/flask-blog-app.git
cd flask-blog-app
pip install -r requirements.txt
```

## set up and run your script!
```
export FLASK_APP=server.py
export FLASK_ENV=development
flask run
```

## Before you deploy this app
before you start deploy, change your smtp information in config.py so that the reset password function can be useful and if you want to use environment to production, change with your mysql database in config.py

### Demo
http://gatau-ini.herokuapp.com

## to do
- improv on the frontend
- create migration database
- create a search feature on the blog
- track bugs and fix them
- whats next?


text:
# Documentation and Source Code for Tasks

#### Submitting your code

In this course I distinguish between your development machine (typically your laptop) and your production machine (the Google Cloud Virtual Machine (VM)). I am glossing over some nuances here but you should never, ever, develop code on you Google Cloud instance. You develop code on your laptop. I probably am repeated this point in about 5 different places in the material but some people somehow mess this up.

Anyway, tasks are to be done on your laptop. You clone the provided files, add your code, and test, debug, test. When you finished, you push your code to your github repository and notify me by [filling our this form](https://forms.gle/Wymwd7ZoTvMs3vYL7).

Again, you don't need to get any of these running on Google Cloud.

Task | Lesson
----: | :---
1 | [Getting started with PostgreSQL](task1/readme.md)
2 | [Getting started with JavaScript](task2/readme.md)
3 | [Your first node server](task3/readme.md)
4 | [NodeJS and PostgreSQL](task4/readme.md)
5 | [NextJS](task5/readme.md)
6| [Cookies and Hashing](task6/README.md)
7| [Getting serious with SQL](task7/readme.md)
8| [intro to Elasticsearch](task8/readme.md)


text:
---
schema: pacelf
title: Strategic Plan 2003-2005  challenges of scaling up Global Programme for the Elimination of Lymphatic Filariasis
organization: World Health Organization
notes: Overview  The goal of the Global Programme to Eliminate Lymphatic Filariasis (GPELF) is defined as “the elimination of lymphatic filariasis as a public health problem by 2020”. The Strategic Plan of 199  sic  identified four major elements of the GPELF and two aims  the interruption of transmission and the prevention of disability. This Strategic Plan for 2003–2005 for scaling up is exclusively programmatic and assumes the availability of adequate funding for GPELF. Detailed planning for the acquisition of funding is being done by the Alliance Task Force on Advocacy and Fundraising.
access: Freely available from publisher website

resources:
- name: Strategic Plan 2003-2005  challenges of scaling up Global Programme for the Elimination of Lymphatic Filariasis
  url: '/docs/MULTICOUNTRY_GlobalPacELF_2739.pdf'
  format: Electronic
  access: Freely available from publisher website
  pages: 26

category: Action/Strategic Plans
access: Freely available from publisher website
journal: N/A
publisher: World Health Organization
language: English
hardcopy_location: WHO Geneva
work_location: Multicountry Global
year: 2004
decade: 2000
PacELF_ID: 2739
---

repository: DanielBaird/jkan

repo_name: DanielBaird/jkan


text:
Gluish
======

[![Build Status](http://img.shields.io/travis/miku/gluish.svg?style=flat)](https://travis-ci.org/miku/gluish)
[![pypi version](http://img.shields.io/pypi/v/gluish.svg?style=flat)](https://pypi.python.org/pypi/gluish)
[![pypi downloads](https://img.shields.io/pypi/dm/gluish.svg)](https://pypi.python.org/pypi/gluish)

Some glue around [luigi](https://github.com/spotify/luigi).

Provides a base class, that autogenerates its output filenames based on
* some base path,
* a tag,
* the task id (the classname and the significant parameters)

Additionally, this package provides a few smaller utilities, like a TSV format,
a benchmarking decorator and some task templates.

A basic task that knows its place
---------------------------------

`gluish.task.BaseTask` is intended to be used as a supertask.

```python
from gluish.task import BaseTask
import datetime
import luigi
import tempfile

class DefaultTask(BaseTask):
    """ Some default abstract task for your tasks. BASE and TAG determine
    the paths, where the artefacts will be stored. """
    BASE = tempfile.gettempdir()
    TAG = 'just-a-test'

class RealTask(DefaultTask):
    """ Note that this task has a `self.path()`, that figures out the full
    path for this class' output. """
    date = luigi.DateParameter(default=datetime.date(1970, 1, 1))
    def run(self):
        with self.output().open('w') as output:
            output.write('Hello World!')

    def output(self):
        return luigi.LocalTarget(path=self.path())
```

When instantiating a `RealTask` instance, it will automatically be assigned a
structured output path, consisting of `BASE`, `TAG`, task name and a slugified
version of the significant parameters.

```python

task = RealTask()
task.output().path
# would be something like this on OS X:
# /var/folders/jy/g_b2kpwx0850/T/just-a-test/RealTask/date-1970-01-01.tsv

```

A TSV format
------------

Was started on the
[mailing list](https://groups.google.com/forum/#!searchin/luigi-user/TSV/luigi-user/F813st16xqw/xErC6pXR8zEJ).
Continuing  the example from above, lets create a task, that generates TSV
files, named `TabularSource`.

```python

from gluish.format import TSV

class TabularSource(DefaultTask):
    date = luigi.DateParameter(default=datetime.date(1970, 1, 1))
    def run(self):
        with self.output().open('w') as output:
            for i in range(10):
                output.write_tsv(i, 'Hello', 'World')

    def output(self):
        return luigi.LocalTarget(path=self.path(), format=TSV)
```

Another class, `TabularConsumer` can use `iter_tsv` on the handle obtained
by opening the file. The `row` will be a tuple, or - if `cols` is specified -
a `collections.namedtuple`.

```python
class TabularConsumer(DefaultTask):
    date = luigi.DateParameter(default=datetime.date(1970, 1, 1))
    def requires(self):
        return TabularSource()

    def run(self):
        with self.input().open() as handle:
            for row in handle.iter_tsv(cols=('id', 'greeting', 'greetee'))
                print('{0} {1}!'.format(row.greeting, row.greetee))

    def complete(self):
        return False
```

A benchmark decorator
---------------------

Log some running times. Mostly useful in interactive mode.

```python
from gluish.benchmark import timed

class SomeWork(luigi.Task):
    @timed
    def run(self):
        pass

    def complete(self):
        return False
```

Elasticsearch template task
---------------------------

Modeled after [luigi.contrib.CopyToTable](https://github.com/spotify/luigi/blob/01514d4559901ec62432cd13c48d9431b02433be/luigi/contrib/rdbms.py#L13).

```python
from gluish.esindex import CopyToIndex
import luigi

class ExampleIndex(CopyToIndex):
    host = 'localhost'
    port = 9200
    index = 'example'
    doc_type = 'default'
    purge_existing_index = True

    def docs(self):
        return [{'_id': 1, 'title': 'An example document.'}]

if __name__ == '__main__':
    task = ExampleIndex()
    luigi.build([task], local_scheduler=True)
```

Elasticsearch support has been added to luigi as [luigi.contrib.esindex](https://github.com/spotify/luigi/pull/364).

FTP mirroring task
------------------

Mirroring FTP shares. This example reuses the [`DefaultTask`](https://github.com/miku/gluish#a-basic-task-that-knows-its-place) from above. Uses the sophisticated [lftp](http://lftp.yar.ru/) program under the hood, so it needs to be available on your system.

```python
from gluish.common import FTPMirror
from gluish.utils import random_string
import luigi

class MirrorTask(DefaultTask):
    """ Indicator makes this task run on each call. """
    indicator = luigi.Parameter(default=random_string())

    def requires(self):
        return FTPMirror(host='ftp.cs.brown.edu',
            username='anonymous', password='anonymous',
            pattern='*pdf', base='/pub/techreports/00')

    def run(self):
        with self.input().open() as handle:
            # FTPMirror output is in TSV
            for row in handle.iter_tsv(cols=('path',)):
                # do some useful things with the files here ...

    def output(self):
        return luigi.LocalTarget(path=self.path())
```

The output of `FTPMirror` is a **single file**, that contains the paths to all mirrored files, one per line.

A short self contained example can be found in [this gist](https://gist.github.com/miku/4d7e9589e63182f88509).

To copy a single file from an FTP server, there is an `FTPFile` template task.

Easy shell calls
----------------

Leverage command line tools with [`gluish.utils.shellout`](https://github.com/miku/gluish/blob/943993d29fe88d352d110620a717303b19897577/gluish/utils.py#L199). `shellout` will
take a string argument and will format it according to the keyword arguments.
The `{output}` placeholder is special, since it will be automatically assigned
a path to a temporary file, if it is not specified as a keyword argument.

The return value of `shellout` is the path to the `{output}` file.

Spaces in the given string are normalized, unless `preserve_whitespace=True` is
passed. A literal curly brace can be inserted by `{{` and `}}` respectively.

An exception is raised, whenever the commands exit with a non-zero return value.

Note: If you want to make sure an executable is available on you system before the task runs,
you *can* use a [`gluish.common.Executable`](https://github.com/miku/gluish/blob/943993d29fe88d352d110620a717303b19897577/gluish/common.py#L106) task as requirement.

```python
from gluish.common import Executable
from gluish.utils import shellout
import luigi

class GIFScreencast(DefaultTask):
    """ Given a path to a screencast .mov, generate a GIF
        which is funnier by definition. """
    filename = luigi.Parameter(description='Path to a .mov screencast')
    delay = luigi.IntParameter(default=3)

    def requires(self):
        return [Executable(name='ffmpg'),
                Executable(name='gifsicle', message='http://www.lcdf.org/gifsicle/')]

    def run(self):
        output = shellout("""ffmpeg -i {infile} -s 600x400
                                    -pix_fmt rgb24 -r 10 -f gif - |
                             gifsicle --optimize=3 --delay={delay} > {output} """,
                             infile=self.filename, delay=self.delay)
        luigi.File(output).move(self.output().path)

    def output(self):
        return luigi.LocalTarget(path=self.path())
```

Dynamic date parameter
----------------------

Sometimes the *effective* date for a task needs to be determined dynamically.

Consider for example a workflow involving an FTP server.

A data source is fetched from FTP, but it is not known, when updates are
supplied. So the FTP server needs to be checked in regular intervals.
Dependent tasks do not need to be updated as long as there is nothing new
on the FTP server.

To map an arbitrary date to the *closest* date in the past, where an update
occured, you can use a `gluish.parameter.ClosestDateParameter`, which is just an ordinary
`DateParameter` but will invoke `task.closest()` behind the scene, to
figure out the *effective date*.

```python

from gluish.parameter import ClosestDateParameter
import datetime
import luigi

class SimpleTask(DefaultTask):
    """ Reuse DefaultTask from above """
    date = ClosestDateParameter(default=datetime.date.today())

    def closest(self):
        # invoke dynamic checks here ...
        # for simplicity, map this task to the last monday
        return self.date - datetime.timedelta(days=self.date.weekday())

    def run(self):
        with self.output().open('w') as output:
            output.write("It's just another manic Monday!")

    def output(self):
        return luigi.LocalTarget(path=self.path())

```

A short, self contained example can be found in [this gist](https://gist.github.com/miku/e72628ee54fce9f06a34).

If `task.closest` is a relatively expensive operation (FTP mirror, rsync)
and the workflow uses a lot of `ClosestDateParameter` type of parameters, it is
convenient to memoize the result of `task.closest()`. A `@memoize` decorator
makes caching the result simple:

```python
from gluish.utils import memoize
    ...

    @memoize
    def closest(self):
        return self.date - datetime.timedelta(days=self.date.weekday())

```

----

Development
-----------

System package dependencies:

* Ubuntu: libmysqlclient-dev
* CentOS: mysql-devel

Setup:

    $ git clone git@github.com:miku/gluish.git
    $ cd gluish
    $ mkvirtualenv gluish
    $ pip install -r requirements.txt
    $ nosetests

Coverage status
---------------

As of [4a7ec26ae6680d880ae20bebd514aba70d801687](https://github.com/miku/gluish/tree/4a7ec26ae6680d880ae20bebd514aba70d801687).

    $ nosetests --verbose --with-coverage --cover-package gluish
    Name               Stmts   Miss  Cover   Missing
    ------------------------------------------------
    gluish                 4      0   100%
    gluish.benchmark      32      3    91%   59-62
    gluish.colors         14      4    71%   12, 20, 24, 32
    gluish.common        103     18    83%   68, 72, 80-81, 83, 86, ...
    gluish.database       50     18    64%   12, 69-76, 79-88, 91-94
    gluish.esindex       105     71    32%   40-43, 62-66, 70-71, 77-86, ...
    gluish.format         27      2    93%   69, 72
    gluish.intervals      16      0   100%
    gluish.oai            58     14    76%   83-99
    gluish.parameter       5      0   100%
    gluish.path           82     14    83%   25, 39-48, 101-102, 165
    gluish.task           45      2    96%   95, 114
    gluish.utils          80      3    96%   35, 127, 166
    ------------------------------------------------
    TOTAL                621    149    76%
    ----------------------------------------------------------------------
    Ran 33 tests in 0.269s

Pylint hook
-----------

    $ pip install git-pylint-commit-hook
    $ touch .git/hooks/pre-commit
    $ chmod +x .git/hooks/pre-commit
    $ echo '
    #!/usr/bin/env bash
    git-pylint-commit-hook
    ' > .git/hooks/pre-commit

repository: tsolakidis/gluish

repo_name: tsolakidis/gluish


text:
---
Module Name: PnP.PowerShell
title: Set-PnPSiteGroup
schema: 2.0.0
applicable: SharePoint Online
external help file: PnP.PowerShell.dll-Help.xml
online version: https://pnp.github.io/powershell/cmdlets/Set-PnPSiteGroup.html
---

# Set-PnPSiteGroup

## SYNOPSIS

Updates the SharePoint Online owner and permission levels on a group inside a site collection.

## SYNTAX

```powershell
Set-PnPSiteGroup -Identity <String> [-Name <String>] [-Owner <String>] [-PermissionLevelsToAdd <String[]>]
    [-PermissionLevelsToRemove <String[]>] [-Site <PipeBind>]
```

## DESCRIPTION

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at [Intro to SharePoint Online Management Shell](https://learn.microsoft.com/powershell/sharepoint/sharepoint-online/introduction-sharepoint-online-management-shell?view=sharepoint-ps).

## EXAMPLES

### EXAMPLE 1

```powershell
Set-PnPSiteGroup -Site "https://contoso.sharepoint.com/sites/siteA" -Identity "ProjectViewers" -PermissionLevelsToRemove "Full Control" -PermissionLevelsToAdd "View Only"
```

Example 1 changes permission level of the ProjectViewers group inside site collection https://contoso.sharepoint.com/sites/siteA from Full Control to View Only.

### EXAMPLE 2

```powershell
Set-PnPSiteGroup -Site "https://contoso.sharepoint.com" -Identity "ProjectViewers" -Owner<EMAIL_ADDRESS>```

Example 2 sets<EMAIL_ADDRESS>as the owner of the ProjectViewers group.

## PARAMETERS

### -Identity

Specifies the name of the group.

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name

Specifies the new name of the group.

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Owner

Specifies the owner (individual or a security group) of the group to be created.

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PermissionLevelsToAdd

Specifies the permission levels to grant to the group.

> [!NOTE]
> Permission levels are defined by SharePoint Online administrators from SharePoint Online Administration Center.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PermissionLevelsToRemove

Specifies the permission levels to remove from the group.

> [!NOTE]
> Permission levels are defined by SharePoint Online administrators from SharePoint Online Administration Center.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Site

Specifies the site collection the group belongs to. If not defined, the currently connected site will be used.

```yaml
Type: SitePipeBind
Parameter Sets: (All)
Aliases:
Applicable: SharePoint Online
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

repository: radityoardi/PnP-PowerShell

branch_name: refs/heads/dev

gha_license_id: NOASSERTION

repo_name: radityoardi/PnP-PowerShell


text:
---
layout: page
title: Muhammad Iqbal Bin Imran's Project Portfolio
---

## Project: fitNUS

### Overview

This portfolio page highlights some of my contributions to fitNUS - a Software Engineering Project developed in my third
year of undergraduate studies in the National University of Singapore (NUS).

### About the Team

We are a group of 5 Computer Science undergraduates from Year 2 and Year 3 reading CS2103T: Software Engineering.

#### About the Project

fitNUS represents a culmination of our team's efforts in morphing an existing [Address Book Level 3 (AB3) project](https://github.com/se-edu/addressbook-level3)
into a new product via Brownfield software development. fitNUS is a personal fitness tracker assistant which allows
users to create customised workout routines, by having the flexibility to add exercises to the routines they have
created. To facilitate workouts around their busy schedules, users have an added option of slotting lessons and routines
to their timetable.

The team has come up with a vast number of user-centric features to make fitNUS well-suited in order to provide both
convenience and utility in the long-run. Aimed at NUS students who are keen on improving their fitness levels, fitNUS is
the perfect solution in which the Graphical User Interface is integrated with Command Line Interface to provide a
wholesome user experience.

## Summary of Contributions

* **New Feature**: Added the ability to undo/redo previous commands.
  * What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
  * Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
  * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
  * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*

* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.

* **Code contributed**: You can view my code contributions to fitNUS [here](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=iqbxl&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other).

* **Project management**:
  * Managed releases `v1.1` - `v1.4` (4 releases) on GitHub

* **Enhancements to existing features**:
  * Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
  * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]())

## Contribution to the User Guide:
    Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

[../UserGuide.md](https://github.com/AY2021S1-CS2103T-T09-2/tp/blob/master/docs/UserGuide.md#46-calorie) (Added documentation for the features `calorie_add` and `calorie_minus`)

[../UserGuide.md](https://github.com/AY2021S1-CS2103T-T09-2/tp/blob/master/docs/UserGuide.md#471-help-help) (Added documentation for the feature `help`)

[../UserGuide.md](https://github.com/AY2021S1-CS2103T-T09-2/tp/blob/master/docs/UserGuide.md#2-additional-information) (Added documentation for the section Additional Information)

[../UserGuide.md](https://github.com/AY2021S1-CS2103T-T09-2/tp/blob/master/docs/UserGuide.md#3-quick-start) (Did cosmetic tweaks to existing documentation: Quick Start section)

## Contributions to the Developer Guide:
    Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation.

[../DeveloperGuide.md](https://github.com/AY2021S1-CS2103T-T09-2/tp/blob/master/docs/DeveloperGuide.md#delete-lesson) (Added implementation details of the `lesson_delete` feature)

* **Community**:
  * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
  * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
  * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
  * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())

* _{you can add/remove categories in the list above}_


text:
To pull down a container image to work with, run:

```execute
docker pull python:3.8
```

This image will be pulled from Docker Hub. Other image registries can be specified if required. If using a private image registry you would need to login to the image registry first.


text:
# Gestalt Principles

- Human visual system is optimized to see structure and relationships

1. Common fate

2. Figure / Ground

3. Similarity

![image](../../media/Gestalt-Principles-image1.jpg)

4. Pragnanz

![image](../../media/Gestalt-Principles-image2.jpg)

5. Proximity

![image](../../media/Gestalt-Principles-image3.jpg)

6. Continuity

![image](../../media/Gestalt-Principles-image4.jpg)

7. Closure

![image](../../media/Gestalt-Principles-image5.jpg)

<https://www.khanacademy.org/science/health-and-medicine/nervous-system-and-sensory-infor/sensory-perception-topic/v/gestalt-principles>

## Stages of human visual processing

- Stage one: processing inside the retina
  - High resolution and intense color in the fovea
  - Lower resolution and less intense color elsewhere
  - Tuning to detect edges
- Stage two: "preattentive" processing
  - Less than 1/4 second
  - Unconscious
  - Information from retina assembled into shapes and groups
- Stage three: "Attentive" processing
  - Stores of experience used to interpret the output of state two

## Gestalt principles come from stage two

- The visual system is predisposed to interpret edges, shapes, and groups in certain ways
- Again, this is unconscious, and takes place before conscious interpretation
  - Conscious interpretation can override the perceptions from stage two, but it takes cognitive work

## Design principle: Gestalt proximity

- The visual system assumes that things grouped together are related
- The initial grouping is automatic and unconscious
  - Happens in less than 1/4 second


text:
### Organize Group Buys Faster

**Group Buy Organizer** is a web application that helps manage wholesale group buys.  Remove a lot of the overhead
involved in coordinating purchases with users.

**User Features**
+ **Fast and flexible group buy system:**  No more back and forth between participants and the organizer.  Want to
change your order?  Just log in and make the changes.  They will instantly change the order for the organizer.
+ **Streamlined case-split system:** Splitting a case with others just got a lot easier.  Pledge how many items in the
case you'd like to order, and other users can make pledges as well.  Once all of the items in the case gets accounted
for, only then it gets locked into the order.
+ **Multiple order views:**  Three different views of event orders are available for users.  The user overview view is
a customized list showing the cases and items you've ordered, its subtotal as well as the event total.  The event
summary view is a concise list for the organizer of how many cases to order.  The user breakdown view steps through one
item at a time, showing all of the users who bought cases of it, as well as all of the case splits for that item.
+ **Export to PDF:** All order pages include a button to export the list as a PDF to be downloaded.  Pages are stripped down and optimized, removing the navigation bar, forms, etc.  Only black and white is used on exported pages.

**Administrative Features**
+ **Complete control of the application:**  Expanded functionality added to edit virtually all aspects of group buys.
Change and remove items, add item categories, remove users from an event, promote others to admin rank, and more.
+ **Optional restriction of event information:** Prevent users from seeing the orders of others, as an optional feature.
+ **Decide who has access to your application:**  User registration can be disabled, and any users can be removed from
the application with a single click of the mouse.

### Using Group Buy Organizer

**Initial Setup**
After the application is properly installed and running, create a user account.  The first account to register will be
given "root" access in the application, all other registrations will be "user" tier.  From there, all there is left to
do is to setup categories, and to create an event.  Click the admin button on the top right, and click "Category
Settings."  Create whatever product categories that will be used in your group buy.  From there, go to home and create
an event.  Thats it!

**General Use**
In order to use Group Buy Organizer you must register an account.  Once thats done, go ahead and log in.

This is the general flow of the program:  Using your price sheet/case list from the wholesaler you'll be purchasing
from, if the items already haven't been added by someone else, add them to the event using the form at the top of the
page.  Once items are added, anyone is free to interact with them, whether you want to buy cases for yourself, or split
a case with some other people.  While the event is open, any user is free to add as many items, and to buy as many cases
or involve themselves in as many case splits as they want.

As the event comes to a close, an administrator will lock it (Event Settings).  This will lock in all transactions, and
no user can add, remove, or change their order.  Things become finalized at this point, and you can check out the totals
using any of the available event total buttons on the event screen or on the home screen.

### Installation:

Installation is simple.  You can either download the repository from this Github page, or via PyPI: `pip install
group-buy-organizer`

In order for the PDF functionality to work, you must download a binary that the program will use to convert pages to
PDF:
https://wkhtmltopdf.org/

Download and install on your server.  Go to "Application Settings" in the admin menu, and follow the instructions from
there as to how to properly link it.  The whole process only takes a couple minutes.

Once thats done, everything is good to go.

Libraries used:
- `flask`
- `flask-bcrypt`
- `flask-login`
- `flask-sqlalchemy`
- `flask-wtf`
- `pdfkit`

### License

MIT License

Copyright (c) 2019 - ∞ Mark Michon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

repository: dustykline/Group-Buy-Organizer

repo_name: dustykline/Group-Buy-Organizer


text:
---
goal_meta_link: http://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-5.pdf
goal_meta_link_text: United Nations Sustainable Development Goals Metadata (pdf 634kB)
graph_type: line
graph_title: Proportion of countries where the legal framework guarantees women equal rights to land ownership and/or control
indicator_number: 5.a.2
indicator_name: "Proportion of countries where the legal framework (including customary\
  \ law) guarantees women\u2019s equal rights to land ownership and/or control"
target_name: Undertake reforms to give women equal rights to economic resources, as well
  as access to ownership and control over land and other forms of property, financial
  services, inheritance and natural resources, in accordance with national laws
target_id: 5.a
title: "Proportion of countries where the legal framework (including customary law)\
  \ guarantees women\u2019s equal rights to land ownership and/or control"
un_custodian_agency: FAO,World Bank, UN Women
un_designated_tier: '2'
data_non_statistical: true
---
**Non-statistical indicator**

As it was published by the Ministry of Gender and Family Promotion (MIGEPROF), [Law N° 43/2013 of 16/06/2013](https://www.migeprof.gov.rw/fileadmin/user_upload/Migeprof/Laws/Law_No_43-2013_of_16-06-2013_Governing_land_in_Rwanda.pdf) governing land in Rwanda, guarantees women equal rights with men on land access, ownership and utilization.


text:
# RSMatcher

RSMatcher is a custom application written for a non-profit educational program that matches volunteer reading coaches with children in need of reading assistance.
The coaches meet and read with each student for 30 minutes each week.
There may be hundreds of coaches and over one thousand students.
RSMatcher is an implementation of an algorithm to find a near-optimal scheduling solution.
An optimal solution matches as many students as coaches are willing to take while also meeting the scheduling restrictions of the coaches and schools.
The problem space is first converted to a graph in which finding all cycles identifies possible schedule additions.
Heuristic sorting is used to prioritize more efficient additions (e.g. a coach meets with multiple students at the same school back-to-back).
At multiple points, shuffling and round-robin interleaving is used to remove bias.
Then a branch and bound traversal of the solution tree is used to converge on a near-optimal solution while also culling solutions with relatively poor scores.

repository: msiner/RSMatcher

repo_name: msiner/RSMatcher


text:
---
layout: tutorialpage
title: Strategy
permalink: /tutorials/design-patterns/Strategy/
path: /tutorials/design-patterns/
repo: https://github.com/dstar55/100-words-design-patterns-java
tags: Strategy
---

* [Story](#Story)
* [Image](#Image)
* [UML](#UML)
* [Implementation](#Implementation)
* [Usage](#Usage)

###  Story

Select an algorithm at runtime.

Payment options in a Shopping Cart is an example of Strategy.
User can choose various payment options like Master Card, Amex or PayPal.
Any of these payment options will pay items in Shopping Cart, and they can be used interchangeably.
The user must choose the Strategy based on his possibilities, preferences.

###  Image

![alt text](http://www.design-patterns-stories.com/assets/img/image/strategy.jpg "Credit Card")
###### Credit Card (CC BY 2.0) by ThomasKohler

###  UML
[![](http://www.design-patterns-stories.com/assets/img/uml/strategy.png)](http://www.design-patterns-stories.com/assets/img/uml/strategy.png)

###  Implementation

#### *Strategy.java*
```java
package com.hundredwordsgof.strategy;

/**
 * Declares an interface common to all supported algorithms. Context uses this
 * interface to call the algorithm defined by a ConcreteStrategy.
 *
 */
public interface Strategy {

  String algorithmInterface();
}
```

#### *ConcreteStrategyA.java*
```java
package com.hundredwordsgof.strategy;

/**
 * Implements the algorithm defined in Strategy interface.
 *
 */
public class ConcreteStrategyA implements Strategy {

  public String algorithmInterface() {
    return "Go to airport with ConcreteStrategyA, take a taxi";
  }
}
```

#### *ConcreteStrategyB.java*
```java
package com.hundredwordsgof.strategy;

/**
 * Implements the algorithm defined in Strategy interface.
 *
 */
public class ConcreteStrategyB implements Strategy {

  public String algorithmInterface() {
    return "Go to airport with ConcreteStrategyB, take a bus";
  }
}
```

#### *ConcreteStrategyC.java*
```java
package com.hundredwordsgof.strategy;

/**
 * Implements the algorithm defined in Strategy interface.
 *
 */
public class ConcreteStrategyC implements Strategy {

  public String algorithmInterface() {
    return "Go to airport with ConcreteStrategyC, take a metro";
  }
}
```

#### *Context.java*
```java
package com.hundredwordsgof.strategy;

/**
 * Maintains a reference to a Strategy object. Invokes algorithm implemented in
 * ConcreteStrategy.
 *
 */
public class Context {

  private Strategy strategy;

  public Context(Strategy strategy) {
    this.strategy = strategy;
  }

  protected String contextInterface() {
    return this.strategy.algorithmInterface();
  }
}
```

###  Usage

#### *StrategyTest.java*
```java
package com.hundredwordsgof.strategy;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 * Test implementation of the Strategy pattern.
 */
public class StrategyTest {

  @Test
  public void testStrategy() {

    Context context = new Context(new ConcreteStrategyA());
    assertEquals("Go to airport with ConcreteStrategyA, take a taxi",
        context.contextInterface());

    context = new Context(new ConcreteStrategyB());
    assertEquals("Go to airport with ConcreteStrategyB, take a bus",
        context.contextInterface());

    context = new Context(new ConcreteStrategyC());
    assertEquals("Go to airport with ConcreteStrategyC, take a metro",
        context.contextInterface());
  }
}
```


text:
# Sockets
[Intro to Express](https://github.com/Cynicollision/express-demo) > Part 7: Sockets

## Real-time Bidirectional Event-based Communication
A basic chat application that demonstrates real-time communication between clients using [Socket.IO](https://socket.io).

### Installation
```
npm install socket.io
````

### Configuration/Usage
```javascript
var server = app.listen(3000, () => {
  console.log('Listening on port 3000');
});

var io = require('socket.io')(server);

io.on('connection', function (socket) {
  console.log('somebody connected');

  socket.on('send', function (data) {
    io.emit('receive', data);
  });
});
```

repository: Cynicollision/express-demo

repo_name: Cynicollision/express-demo


text:
Longest Path

Challenge Description:

    You are given a 2D N×N matrix. Each element of the matrix is a letter: from ‘a’ to ‘z’. Your task is to find
    the length L of the longest path in which not a single letter is repeated. The path can start at any cell,
    the transfer to the next element can be vertical or horizontal.

    Example of a 5×5 matrix, where L=15:

Input sample:

    The first argument is a file with test cases. Each line contains a serialized N×N matrix .

    For example:

qttiwkajeerhdgpikkeaaabwl
vavprkykiloeizzt
skwajgaaxqpfcxmadpwaraksnkbgcaukbgli
kaja
bjzanjikh

Output sample:

    Print to stdout the length of the longest path of unique elements for each test case, one per line.

    For example:

15
11
16
3
7

Constraints:

N is in a range from 2 to 6.

The number of test cases is 20.


text:
## The number chip
## DAY TWENTY SIX
## Challenge Master - Deekshita Verma
## Platform at which this question was asked : Codechef

PROBLEM STATEMENT
The game of number chips.

EXPLANATION
Let’s play a little game (read the rules carefully).
You will be provided with a tower of N number chips (a1 , a2 , a3 … aN) aN being on the top.
In the input you’ll be provided with 2 kinds of queries:-
1.	1 L followed by number chips s1,s2 … sL
	Place L number chips on the tower sL being on the top
2.	2 R
	Remove R chips from the top
Also, thanks to gravity the tower will have to fall right so you need to keep removing the repeated number chips from the tower!

INPUT REQUIREMENTS
•	The first-line will contain T, the number of test cases. Then the test case follows.
•	Each test case contains a 2 single spaced numbers N & Q.
•	Next line contains N equal spaced numbers
•	Next Q line contains queries as discussed above
o	1 L s1 s2 ... sL
o	2 R

OUTPUT FORMAT
Print the content of the tower from top to bottom

EXAMPLE INPUT
2
5 3
1 2 3 4 5
1 3 6 7 8
2 3
1 2 0 8
5 3
3 4 3 4 3
2 1
1 2 4 4
2 1

EXAMPLE OUTPUT
8 0 5 4 3 2 1
3

repository: pooja-gera/TheWireUsChallenge

repo_name: pooja-gera/TheWireUsChallenge


text:
# LaTeXpkges
This is a LaTeX package cleanup utility. Use it to find packages that are included in your LaTeX document but are not actually used.

**NEW:** You may now run it directly against your original sources! The utility **will not changes** the sources while working.

## How it Works
The utility follows the following algorithm:

1. Find all package imports in the LaTeX document
2. Exclude them one by one
3. Rebuild the project
4. Check whether the PDF changes

The idea is that if after you excluded the package, the PDF did not change, then it is safe to remove that package. In the end, the utility suggests a list of packages that it deems safe to remove.

PDFs are compared using MD5 hash after being stripped of ID's and dates. XDV files are compared with diff.

## General Assumptions
This utility runs on Linux and Windows platforms.

You may use any of the LaTeX engines: `latex`, `pdflatex`,`xelatex` or `lualatex` as a processor and either `bibtex` or `biber` for bibliography.

## Usage
To use the utility, go to the location of your LaTeX project. Assuming your main `.tex` file is `main.tex` and it is in that folder, run the script from the command line:

    LaTeXpkges.py --latex pdflatex --bibtex biber  main.tex

Let it finish, and in the end it will inform you what packages it considers as unused in your project. The flag `--visual` will convert the files (DVX or PDF) into images and compare them, the flag `--debug` will leave behind all temporary files use in the process.

You may run `LaTeXpkges -h` or `LaTeXpkges --help` for more info.

## Development
This program was initially developed by Vasily Sidorov (@Bazzilic) and the development now continues under Taras Kuzyo with the support of Books in Bytes, Inc.

The program intentionaly handles ONLY packages that are inserted at top level, that is, that are inserted inside the main project
 file and not by file called via ...

   \input
   \usepackage{}
   \RequirePackage

The reasons for this are:

A- The programming may not be so simple, the logic would be quite messy and it will make the program harder for people to contrib
ute to the project!

B- Potential for creating a messy directory with many copies of many files spread in many subdirectories ...

C- Confusing logic (to the user) because we definitely do not want the program to follow a

    \RequirePackage{amsmath}

and start editing "amsmath" for exclusion of any of its subpackages, even if the user is able to edit it.

repository: michaelmhoffman/LaTeXpkges

repo_name: michaelmhoffman/LaTeXpkges


text:
---
title: PRML Formula - 9 Mixture Model and EM
mathjax: true
date: 2021-02-26
tags:
- Probability
- "Machine Learning"
comment: true
excerpt_separator: <!--more-->

---

This blog collects detailed deduction of formulas in Bishop's *Pattern Recognition and
Machine Learning*, Chapter 9.

<!--more-->

## Section 9.3.3

When $$\mathbf{x}_n$$ is generated from $$\boldsymbol{\mu}_k$$, each element of $$\mathbf{x}_n$$ follows independent Bernulli distribution with parameter $$\mu_{ki}$$, which jointly has the following likelihood,

$$P(\mathbf{x}_n \mid \boldsymbol{\mu}_k) = \prod_{i=1}^D \mu_{ki}^{x_{ni}}(1-\mu_{ki})^{1-x_{ni}}

\tag{9.48}$$

If $$\mathbf{x}_n$$ is generated from a mixture of $$\boldsymbol{\mu}_k,k=1,2,\cdots, K$$, each weighted by $$\boldsymbol{\pi}=(\pi_1, \pi_2, \cdots, \pi_K)$$, that is,

$$P(\mathbf{x}_n \mid \boldsymbol{\mu}_k, \boldsymbol{\pi}) = \sum_{k=1}^K \pi_kP(\mathbf{x}_n \mid \boldsymbol{\mu}_k) \tag{9.47}$$

By introducing latent variable $\mathbf{z}=(z_1, z_2,\cdots, z_K)\prime$,

$$P(\mathbf{x}_n \mid \boldsymbol{\mathbf{z}_n, \mu}_k) = \prod_{k=1}^K P(\mathbf{x}_n \mid \boldsymbol{\mu}_k)^{z_{nk}} \tag{9.52}$$

$\mathbf{z}_n$ follows categorical distribution which has a conjugate prior following Dirichlet distribution, with probability density,

$$P(\mathbf{z}_n \mid \boldsymbol{\pi}) = \prod_{k=1}^K\pi_k^{z_{nk}} \tag{9.53}$$

and notice each $\mathbf{z}_n$ is an instantiation from distribution with $\boldsymbol{\pi}$.

From $(9.48)$ and $(9.52)$ the likelihood of single datum $\mathbf{x}_n$ is given by,

$$
\begin{aligned}
P(\mathbf{x}_n\mid \mathbf{z}_n,  \boldsymbol{\mu}_k) &= \prod_{k=1}^KP(\mathbf{x}_n\mid \boldsymbol{\mu}_k)^{z_{nk}} \\
&= \prod_{k=1}^K\left(\prod_{i=1}^D\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}} \\
&= \prod_{k=1}^K\prod_{i=1}^D \left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}}
\end{aligned}
$$

therefore, the likelihood of $N$ data $$\{\mathbf{x}_n\}_{n=1}^N$$ is that,

$$P(\mathbf{X}\mid \mathbf{Z}, \boldsymbol{\mu}) = \prod_{n=1}^N\prod_{k=1}^K\prod_{i=1}^D \left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}} \tag{*}
$$

Because $$\{\mathbf{z}_n\}_{n=1}^N$$ is generated independently and identically from $P(\mathbf{z}_n\mid \boldsymbol{\pi})$, the joint likelihood of $\mathbf{Z}$ is given by,

$$\begin{aligned}
P(\mathbf{Z}\mid \boldsymbol{\pi}) &= \prod_{n=1}^NP(\mathbf{z}_n\mid \boldsymbol{\pi}) \\
&= \prod_{n=1}^N \prod_{k=1}^K \pi_k^{z_{nk}}
\end{aligned} \tag{**}$$

Thus, the complete-data likelihood can be derived from $$(*)$$ and $$(**)$$,

$$\begin{aligned}
P(\mathbf{X}, \mathbf{Z}\mid \boldsymbol{\mu}, \boldsymbol{\pi}) &= P(\mathbf{X}\mid \mathbf{Z}, \boldsymbol{\mu})\times P(\mathbf{Z}\mid \boldsymbol{\pi}) \\
&= \prod_{n=1}^N\prod_{k=1}^K\prod_{i=1}^D \left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}}
\times \prod_{n=1}^N \prod_{k=1}^K \pi_k^{z_{nk}} \\
&= \prod_{n=1}^N\prod_{k=1}^K\left(\pi_k^{z_{nk}}\prod_{i=1}^D\left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}}\right)
\end{aligned}$$

Finially, the complete-data likelihood is then,

$$\begin{aligned}
\ln P(\mathbf{X}, \mathbf{Z} \mid \boldsymbol{\mu},\boldsymbol{\pi}) &= \ln \left(\prod_{n=1}^N\prod_{k=1}^K\left(\pi_k^{z_{nk}}\prod_{i=1}^D\left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}}\right) \right)\\
&= \sum_{n=1}^N \sum_{k=1}^K\ln\left(\pi_k^{z_{nk}}\prod_{i=1}^D\left(\mu_{ki}^{x_{ni}}(1-\mu_{ki}^{1-x_{ni}})\right)^{z_{nk}}\right) \\
&= \sum_{n=1}^N \sum_{k=1}^K\left(z_{nk} \ln \pi_k + \sum_{i=1}^D z_{nk} \left(x_{ni}\ln\mu_{ki} + (1-x_{ni})\ln(1-\mu_{ki}))\right)\right) \\
&= \sum_{n=1}^N \sum_{k=1}^K z_{nk}\left( \ln \pi_k + \sum_{i=1}^D \left(x_{ni}\ln\mu_{ki} + (1-x_{ni})\ln(1-\mu_{ki}))\right)\right)
\end{aligned} \tag{9.54}
$$

If take expectation of $(9.54)$ with respect to $\mathbf{z}$, that is, treating $\mathbf{x}$ as given, thus all components in the bigger brackets are constant therefore, the complete-data log likelihood with respect to posterior distribution of latant variable $\mathbf{Z}$ is simply,

$$\mathbb{E}_{\mathbf{z}}(\ln p(\mathbf{X}, \mathbf{Z} \mid \boldsymbol{\mu}, \boldsymbol{\pi})) = \sum_{n=1}^N \sum_{k=1}^K \gamma(z_{nk})\left( \ln \pi_k + \sum_{i=1}^D \left(x_{ni}\ln\mu_{ki} + (1-x_{ni})\ln(1-\mu_{ki}))\right)\right) $$

where $$\gamma(z_{nk}) = \mathbb{E}(z_{nk}\mid \mathbf{x}_n) = P(z_{nk}=1\mid \mathbf{x}_n)$$, which is the posterior probability of sample being generated from component $k$ after seeing sample $$\mathbf{x}_n$$, which, in **E step**, is calculated by,

$$\begin{aligned}
\gamma(z_{nk}) &= \mathbb{E}(z_{nk}\mid \mathbf{x}_n) = P(z_{nk}=1\mid \mathbf{x}_n) \\
&= \frac{P(z_{nk}=1)P(\mathbf{x}_n\mid z_{nk}=1)}{P(\mathbf{x}_n)} \\
&= \frac{\pi_k P(\mathbf{x}_n\mid z_{nk}=1)}{\sum_{j=1}^K \pi_j P(\mathbf{x}_n\mid z_{nj=1})} \\
&= \frac{\pi_kP(\mathbf{x}_n\mid \boldsymbol{\mu}_k)}{\sum_{j=1}^K \pi_jP(\mathbf{x}_n\mid \boldsymbol{\mu}_j)}
\end{aligned} \tag{9.56} $$

## Section 9.4

$$\begin{aligned}
\ln P(\mathbf{X}\mid \boldsymbol{\theta}) &= \sum_{\mathbf{z}}q(\mathbf{Z})\ln P(\mathbf{X}\mid \boldsymbol{\theta}) \\
&= \sum_{\mathbf{z}}q(\mathbf{Z})\ln \left( \frac{P(\mathbf{X}, \mathbf{Z} \mid \boldsymbol{\theta})}{P(\mathbf{Z}\mid \boldsymbol{\mathbf{X},\theta})} \right) \\
&= \sum_{\mathbf{z}} q(\mathbf{Z}) \ln\left( \frac{\frac{P(\mathbf{X}, \mathbf{Z}\mid \boldsymbol{\theta})}{P(\mathbf{Z})} }{\frac{P(\mathbf{Z}\mid \mathbf{X},\boldsymbol{\theta})}{P(\mathbf{Z})}} \right) \\
&= \sum_{\mathbf{z}} q(\mathbf{Z}) \left( \ln\left(\frac{P(\mathbf{X}, \mathbf{Z}\mid \boldsymbol{\theta})}{P(\mathbf{Z})}\right) - \ln \left(\frac{P(\mathbf{Z}\mid \mathbf{X},\boldsymbol{\theta})}{P(\mathbf{Z})}\right)  \right) \\
&= \sum_{\mathbf{z}}q(\mathbf{Z})\ln \left(\frac{P(\mathbf{X}, \mathbf{Z} \mid \boldsymbol{\theta})}{P(\mathbf{Z})}\right)
- \sum_{\mathbf{z}}q(\mathbf{Z})\ln \left( \frac{P(\mathbf{Z} \mid \mathbf{X},\boldsymbol{\theta})}{P(\mathbf{Z})} \right)\\
&= \mathcal{L}(q,\boldsymbol{\theta}) + \text{KL}(q||p)
\end{aligned} \tag{9.70}$$

where,

$$\mathcal{L}(q,\boldsymbol{\theta}) = \sum_{\mathbf{z}}q(\mathbf{z})\ln\left(\frac{P(\mathbf{X},\mathbf{Z}\mid \boldsymbol{\theta})}{P(\mathbf{Z})}\right) \tag{9.71}$$

$$\text{KL}(q||p) = -\sum_{\mathbf{z}}q(\mathbf{z})\ln\left(\frac{P(\mathbf{Z}\mid \mathbf{X},\boldsymbol{\theta})}{P(\mathbf{Z})}\right) \tag{9.72}$$


text:
# seccomp Sandbox Crash Dumping

Currently, Breakpad relies on facilities that are disallowed inside the Linux
seccomp sandbox.  Specifically, it sets a signal handler to catch faults
(currently disallowed), forks a new process, and uses ptrace() (also disallowed)
to read the memory of the faulted process.

## Options

There are three ways we could do crash dumping of seccomp-sandboxed processes:

*   Find a way to permit signal handling safely inside the sandbox (see below).
*   Allow the kernel's core dumper to kick in and write a core file.
    *   This seems risky because this code tends not to be well-tested.
    *   This will not work if the process is chrooted, so it would not work if
        the seccomp sandbox is stacked with the SUID sandbox.
*   Have an unsandboxed helper process which `ptrace()`s the sandboxed process
    to catch faults.

## Signal handling in the seccomp sandbox

In case a trusted thread faults with a SIGSEGV, we must make sure that an
untrusted thread cannot register a signal handler that will run in the context
of the trusted thread.

Here are some mechanisms that could make this safe:

*   `sigaltstack()` is per-thread. If we opt not to set a signal stack for
    trusted threads, and set %esp/%rsp to an invalid address, trusted threads
    will die safely if they fault.
    *   This means the trusted thread cannot set a signal stack on behalf of the
        untrusted thread once the latter has switched to seccomp mode. The
        signal stack would have to be set up when the thread is created and not
        subsequently changed.
*   `clone()` has a `CLONE_SIGHAND` flag. By omitting this flag, trusted and
    untrusted threads can have different sets of signal handlers. This means we
    can opt not to set signal handlers for trusted threads.
    *   Again, per-thread signal handler sets would mean the trusted thread
        cannot change signal handlers on behalf of untrusted threads.
*   `sigprocmask()/pthread_sigmask()`: These can be used to block signal
    handling in trusted threads.

## See also

*   [LinuxCrashDumping](linux/crash_dumping.md)
*   [Issue 37728](https://crbug.com/37728)

repository: chromium/chromium

repo_name: chromium/chromium


text:
#CartoDB data tables used in Forced Migration

**This file contains the queries used to generate each of the derived tables used by the application.** We call these tables "materialized", even though they are not technically [Materialized Views](http://www.postgresql.org/docs/9.3/static/sql-creatematerializedview.html) in the PostgreSQL sense. They are simply copies.

**Why do we do this?**
1. Using these copied tables is more efficient, because the query doesn't have to be run every time a new user loads the application.
2. They allow us to make the derived table public (so the application does not require API keys) while keeping the source data private.
3. They make the application more resilient in case the source data tables are undergoing modification or development. Using materialized tables means that the application will always be using a version of the data that is known to work.

**How to use these queries:**

1. Create a new empty table in the CartoDB web interface. This table will be used only temporarily, from which to create our materialized table.
2. Paste the SQL into the CartoDB "Custom SQL query" panel. Click "Apply query".
3. Select "Dataset from query" in the "Edit" menu.
4. Click on the name of the new table to change the name from `untitled_table_NN_copy` to `site_tablename_materialized`.
5. Select "Change privacy" in the "Edit" menu, so that the table is accessible to anyone "With link".
6. (optional) You can now delete the empty table you created in step 1.

The following sections list the names of each of the tables used by the application. The "Tables" section is a list of the source tables used by the query. The "SQL" section documents the query used to generate the derived table.

####site_countybubbles_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT area_sqmi, estimate, inmigrations, name, nhgis_join, population, prev_population, state_terr, year FROM ???
```

####site_counties_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT the_geom, county_name, key, nhgis_join, state_terr FROM ???
```

####site_countynames_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT area_sqmi, name, nhgis_join, state_terr FROM ???
```

####site_crops_materialized
**Tables:**
`crop_data`, `counties`

**SQL**
TODO: verify this

```sql
SELECT ST_Union(the_geom_webmercator) as the_geom_webmercator, a.cartodb_id, a.crop, a.year FROM (
SELECT 1 as cartodb_id, 'cotton' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator,  ((crop_data.count)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1859 AND crop_data.crop_category_id = 87 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
UNION
SELECT 2 as cartodb_id, 'cotton' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator,  ((crop_data.count)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1849 AND crop_data.crop_category_id = 87 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
UNION
SELECT 3 as cartodb_id, 'cotton' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator, ((crop_data.count/400)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1839 AND crop_data.crop_category_id = 26 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
UNION
SELECT 4 as cartodb_id, 'sugar' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator, ((crop_data.count)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1859 AND crop_data.crop_category_id = 89 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
UNION
SELECT 5 as cartodb_id, 'sugar' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator,  ((crop_data.count)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1849 AND crop_data.crop_category_id = 89 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
UNION
SELECT 6 as cartodb_id, 'sugar' AS crop, ST_Transform(counties.the_geom_webmercator,2163) as the_geom_webmercator, ((crop_data.count/400)/counties.area_sqmi) AS crop_density, crop_data.year FROM counties JOIN crop_data ON counties.nhgis_join = crop_data.nhgis_join WHERE area_sqmi > 0 AND crop_data.year = 1839 AND crop_data.crop_category_id = 29 AND crop_data.year * 10000 + 0101 >= start_n AND crop_data.year * 10000 + 0101 < end_n
) a WHERE crop_density > 10 group by a.cartodb_id, a.crop, a.year
```

####site_cropdetails_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT cartodb_id, count, crop_category_id, nhgis_join, year FROM ???
```

####site_hexbins_materialized
**Tables:**
`hexbin_forced_migration` (which itself needs to be documented)

**SQL**
TODO
```sql
SELECT *, ST_X(ST_Centroid(ST_Transform(ST_SetSRID(ST_Transform(the_geom,2163),3857),4326))) as long, ST_Y(ST_Centroid(ST_Transform(ST_SetSRID(ST_Transform(the_geom,2163),3857),4326))) as lat, ST_X(ST_Centroid(the_geom)) as longMerc, ST_Y(ST_Centroid(the_geom)) as latMerc
FROM hexbin_forced_migration
WHERE pop_1860 > 0
```

####site_inmigration_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT cartodb_id, estimate, inmigrations, nhgis_join, population, prev_population, year FROM ???
```

####site_narratives_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT cartodb_id, the_geom, description, location, name, narrative_id, year FROM ???
```

####site_statelabels_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT cartodb_id, the_geom, statenam FROM ???
```

####site_states_materialized
**Tables:**
TODO

**SQL**
TODO
```sql
SELECT cartodb_id, the_geom, key, statenam, year FROM ???
```

license: ISC


text:
# TrafficCounting
 Using YOLO-Keras v3 imlementation with Kalman Filter.

 This program can count the number of the vihcle pass by.
 Some extracted pictures of the program:
 ![alt text](https://github.com/vietdelta/TrafficCounting/blob/master/1.jpg?raw=true)

 ![alt text](https://github.com/vietdelta/TrafficCounting/blob/master/2.jpg?raw=true)

 ![alt text](https://github.com/vietdelta/TrafficCounting/blob/master/3.jpg?raw=true)

repository: IotStage/TrafficCounting

repo_name: IotStage/TrafficCounting


text:
# Thermostat

A thermostat application made in made with Javascript and tested with Jasmine.

The application is optimised for mobile devices first and foremost. So if you're viewing this application in chrome, make sure to turn on responsive design within the dev toolbars.

run the specrunner.html in your browser is all you need to run the tests.

This application makes a call to the openweathermap API to get real temperature data from different cities.

You will need to go to

www.openweathermap.org

Sign up and copy your free API key.

in the root of your project, create a folder called APIKEY

within the APIKEY folder create a file called data.js

Within data.js type the followoing and type your api key in strings where YOUR_API_KEY_HERE is:

```
const APIKEY = YOUR_API_KEY_HERE;
```

Enjoy the thermostat :)


text:
# Contributing to Civic

Hello! Whether you have met with the Hack Oregon organization or not, you are welcome to contribute to the Civic Platform!
Bear in mind that this repo only encompasses the front-end web assets. There are many backend repos as well where data
is cleaned, analyzed, converted into databases, and made available through APIs.

We use React and Redux as the backbone of our front-end technologies, but there are also many smaller libraries that any
contributor may want to learn more about. Here's a list of resources:

1. [React](https://reactjs.org/)
2. [Redux](https://redux.js.org/) (along with [Thunk](https://github.com/gaearon/redux-thunk))
3. [React Router](https://github.com/ReactTraining/react-router/tree/v3/docs)
4. [Emotion](https://emotion.sh/)
5. [Victory Charts](https://formidable.com/open-source/victory/docs/victory-chart/)
6. [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/)
7. [Storybook](https://storybook.js.org/)

Our testing tools are:

1. [Mocha](https://mochajs.org/)
2. [Chai](https://www.chaijs.com/)
3. [Enzyme](https://airbnb.io/enzyme/)
4. [JSDom](https://github.com/jsdom/jsdom)

We use the following tools to ensure code quality and consistency:

1. [Prettier](https://prettier.io)
2. [ESLint](https://eslint.org/)

A couple other libraries in use in the background are:

1. [Lerna](https://lernajs.io/)
2. [Webpack](https://webpack.js.org/)
3. [Webpack Blocks](https://github.com/andywer/webpack-blocks)
4. [Babel](https://babeljs.io/)

These libraries in the background aren't necessary to really understand, but knowing that the tools
are in use and how they work can help when debugging issues. Read more in our [Architecture guide](ARCHITECTURE.md).

## Code style and linting

We use automated tools to ensure code quality. You don't need to install anything, but you can configure your editor to make working with these automated tools easier.

We use [Prettier](https://prettier.io), an opinionated code formatter, to format our code consistently across the project. This repository is configured to run Prettier automatically before files are committed. You can [configure your editor to run Prettier](https://prettier.io/docs/en/editors.html) on your files as you code.

In addition, we use [ESLint](https://eslint.org/) to avoid problems with our code. ESLint can be [configured in your editor](https://eslint.org/docs/user-guide/integrations).

## Adding components

At the heart of Civic is a [library of components](https://master--5f55eec3d7d83100229d47fe.chromatic.com). We showcase them all in a Storybook
to help designers plan Story Cards and project narratives. This showcase also aids developers when implementing Story Cards as
well as components. Creating a Storybook story for every component helps ensure a component can stand on its own and work
as imagined under a variety of inputs.

### What all is required from a component?

We strive for [stateless](https://code.tutsplus.com/tutorials/stateful-vs-stateless-functional-components-in-react--cms-29541),
reusable components that have been tested under a variety of conditions. These components are best for using as building blocks.

### New Components

Run `yarn component` from the project root to generate a component in the package of your choosing.

A component directory will be generated in `packages/<package>/<component>/` with the following files:

1. `<component>.js`: The implementation of the component
2. `<component>.test.js`: Unit tests for the component
3. `<component>.stories.js`: Storybook stories that describe all of the interesting states of the component
   Additionally, the component will be re-exported from `packages/<package>/src/index.js` to make the component accessible to anyone using the package via npm.

### Implementation

When writing the JS implementation of a component, there aren't any hard and fast rules, but there are some strong suggestions:

1. Prefer a stateless, function component over a stateful, class component
2. Use [React Hooks](https://reactjs.org/docs/hooks-intro.html) when possible
3. Specify the [`PropTypes`](https://reactjs.org/docs/typechecking-with-proptypes.html) for the component
4. Use [JSDoc](https://jsdoc.app/about-getting-started.html) comments to add a description for each `PropType`
5. When styles are necessary, use [Emotion](https://emotion.sh)
6. Choose composition over inheritance
7. Don't be afraid to break a large component down into smaller components that compose
8. Expect a variety of prop inputs
9. Expect a variety of layout usages
10. Don't forget about mobile styles as well as mobile interactions

With these suggestions along with code review, you're sure to make something that will be useful for years to come!

### Testing

Good unit tests will help you be confident your component works the way you think it does. Arguably even more important:
it will help future developers be confident that their broad changes or upgrades don't break your hard work.

A component that will stand the test of time should adhere to the Robustness Principle.

> Be conservative in what you do, be liberal in what you accept from others

Tests are a great way to ensure a component is in fact robust. Write unit tests that provide a wide range of prop values
for a component. When the component takes a number, test `0`, `1`, large numbers, and negative numbers. No matter how surprising
the inputs may be, the output should not surprise.

### Storybook

Testing helps us make sure how code works. Stories make sure our designs works. They are useful for testing the user
experience of interactions as well as the end result of a variety of inputs. Varying input is especially important in
data visualization design. Even if any given chart type doesn't lend itself favorably for every data configuration,
keep the Robustness Principle in mind.

A single story file can include many different scenarios. Use this to your advantage to showcase a component under a
variety of conditions.

### Rebuilding the Component Packages

Build with `yarn build` while in the `packages/<package>` directory (or run `yarn build-packages` from the project root). This will generate changes in the `es` and `dist` directories. These build directories are not committed to source control.

You can also use the `yarn watch` command at the project root to automatically rebuild any changed packages.

## Creating Story Cards

Story Cards a special kind of component that is reusable but is not composable. In a nutshell, a Story Card is a self-contained reusable asset
that tells a story with data. Story Cards come out of Hack Oregon's project work but are boxed up as Story Cards so they can be embedded in
other contexts.

To make a Story Card, start by making a new component in the appropriate project package. Then, make a React component that wraps around the
`StoryCard` component from the Component Library.

Story Cards can often be rather complex. When implementing a Story Card, make sure to think about all the UI elements that go into the card's design.
Make sure not to reinvent components that are already in the Component Library. Likewise, when the necessary UI elements aren't in the component
library, ask yourself if the element is reusable. If it is, it should probably be implemented alone in the component library, then imported and placed
in the story card.

## Creating Stories

Stories are scrolling narratives that tie multiple story cards together to tell the full story of a project. These are implemented as the `App` component
in each project package. It is crucial to use the `App` component for the Story as this component is imported by the respective Year package for the
project.

Stories have a fair amount of detail to them. They are responsible for page layout as well API actions.

## Making Changes to the Platform

The Platform refers to the packages in this repo that _are not_ project packages, year packages, or component packages. These are the packages that
enforce consistency, eliminate duplication, and allow the majority of development to be focused on components and stories. However, the platform
should never be considered done!

When making changes to platform packages, make sure to test changes against project packages, year packages, and Storybook.

## Submitting a Pull Request

Once a change has been implemented and tested, [open a Pull Request](https://help.github.com/articles/about-pull-requests/) on Github. Explain what
the change is and why it was made. Include screenshots when relevant, and never merge without first getting a design review and a code review!

To keep your PR up to date automatically, apply the `automerge` label. [Kodiak](https://kodiakhq.com/) will automatically keep your branches up to date and merge at the appropriate time.

Finishing a task and getting it merged is incredibly rewarding, and every contribution, no matter how small, assists in Hack Oregon's mission to
build civic data projects!

repository: hackoregon/civic

repo_name: hackoregon/civic


text:
# draft.sx

Painlessly share your markdown documents.

## Running locally

Note: If you know a better (i.e. easier) way of running a Flask app (with it's dependencies) locally, then please let me know :)

Install the following dependencies:

* pip
* pyenv
* virtualenv
* redis

If you don't have the required python version, install it (see `.python-version`). After that, in the draft.sx root run

    virtualenv venv

After that you can start the application by running `start.sh`. Note that you might need to adjust the way in which redis is started in `Procfile.dev`!


text:
# kafka-highlevel-consumer
An implementation of the high level kafka consumer

### Run with:
```
mvn package && java -cp target/highlevelconsumer.jar com.zanox.kafka.highlevelconsumer.App {zookeeper} {group-id} {topic} {num-of-threads}
```

**{zookeeper}** - zookeeper host (without the port number), e.g. localhost
**{group-id}** - consumer group id
**{topic}** - name of the topic
**{num-of-threads}** - number of threads to use for the consumer. If you specify more threads than the number of Kafka partitions, some of the threads won't be doing anything because Kafka never allow a single partition to be consumed from more than one thread.

### Test it:
A good way to verify all threads work as expected, try to use the following kafka cmd tool

```
watch {path-to-kafka}/bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --topic {topic} --zookeeper {zookeeper} --group {group-id}
```

repository: richardhe-awin/kafka-highlevel-consumer

repo_name: richardhe-awin/kafka-highlevel-consumer


text:
# bunyan-stackdriver

**Bunyan stream for StackDriver (Google Cloud Logging API) integration**

## Installation

Install bunyan and bunyan-stackdriver...

```bash
npm install bunyan bunyan-stackdriver
```

## Setup

1. Enable [Google Cloud Logging API](https://console.cloud.google.com/apis/api/logging.googleapis.com/overview)
in your Google Developer Console.
1. Start using `bunyan-stackdriver` to create log your messages

## Basic usage

```javascript
var bunyan  = require("bunyan"),
    BunyanStackDriver = require("bunyan-stackdriver"),
    log;

log = bunyan.createLogger({
    name: "myApp",
    streams: [{
      type: "raw", // faster; makes Bunyan send objects instead of stringifying messages
      stream: new BunyanStackDriver({
        projectId: "your_project_id"
      })
    }],
    level: "error"
});

log.error("hello bunyan user");
```

## Full options

```javascript
new BunyanStackDriver({
  // The path to your key file:
  keyFilename: "/path/to/keyfile.json",
  // Or the contents of the key file:
  credentials: require('./path/to/keyfile.json'),
  logName: "logname",
  projectId: "project-id",
  writeInterval: 500, // ms
  resource: {
    type: "resource_type",
    labels: {key1: value1}
  }
}, function errorCallback(err) { console.log(err); });
```

* If you are running on Google Cloud Platform, authentication will be taken
care of automatically. If you're running elsewhere, or wish to provide
alternative authentication, you can specify the `keyFilename` pointing to a
service account JSON key.

* logName. Must be less than 512 characters and include only alphanumeric
characters, forward-slash, underscore, hyphen and period.

* projectId. The id of the project. This can be omitted if the environment
variable "GCLOUD_PROJECT" is set.

* writeInterval. Specifies the maximum write frequency. Messages will be
batched between writes to avoid exceeding API rate limits. (The default GCP
limit is 20 RPS. The default setting for BunyanStackDriver is 500 ms.)

* resource. See https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/MonitoredResource.

* errorCallback. Will report errors during the logging process itself.

## Stackdriver Error Reporting

When errors with stack traces are logged - `bunyan.error(new Error('message'))` - these can automatically be captured by the [Error Reporting](https://cloud.google.com/error-reporting/) interface in Google Cloud Platform. To do so some additional configuration is required as per [Stackdriver Formatting Error Messages](https://cloud.google.com/error-reporting/docs/formatting-error-messages)

When logging, a _service context_ is required. This can be added on a per log basis or configured for all logs during logger creation like so:

```
const logger = bunyan.createLogger({
    name: 'Example',
    serializers: ...
    streams: ...,
    serviceContext: {
        service: 'example',
        version: 'x.x.x'
    }
});
```

## Links

[Stackdriver Logging - Method entries.write](https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/entries/write)

## License

MIT License

Copyright (C) 2016 Martin Lazarov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: mlazarov/bunyan-stackdriver

repo_name: mlazarov/bunyan-stackdriver


text:
# Radulodon casearius (Morgan) Ryvarden, 1972 SPECIES

#### Status
ACCEPTED

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

#### Published in
Can. J. Bot. 50: 207 (1972)

#### Original name
Hydnum casearium Morgan, 1887

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
title: vmfex
authors: apuimedo, dyasny
wiki_title: VDSM-Hooks/vmfex
wiki_revision_count: 6
wiki_last_updated: 2014-05-05
wiki_conversion_fallback: true
wiki_warnings: conversion-fallback
---

# vmfex

**NOTE: There is a new hook with better integration to vNic profile management** [UCS Integration](/develop/release-management/features/network/ucs-integration/)****

This hook enables the use of Cisco VM Fabric Extender (VM-FEX) in oVirt.

The hook receives a VM's virtual NIC's MAC adress as it is defined in the engine and a FEX Port Profile name, and reattaches that NIC to the FEX Port instead of the logical network it is assigned to in the Engine. This way the NIC MACs can be controlled in the Engine, but the NIC is actually running on FEX.

Since the only unique parameter passed from the engine to the VM is the MAC, a dictionary-like mapping of MAC to port profile will be used Sample:

     vmfex={'00:11:22:33:44:55:66':'Profile1',
           '00:11:22:33:44:55:67':'Profile2',...} (one line)

Will add 2 virtual nics attached to profile1 and profile2 using the vnic MAC addresses specified, replacing the actual NICs assigned to the VM.

A VM NIC with a MAC that is not mentioned in this dictionary will not be altered, and will remain attached to the bridge/logical network defined for it in the engine.

Libvirt internals (what the hook will do): Replace the existing interface xml:

with the following interface xml:

Note how <mac></mac> is preserved

The hook also defines a dynamic pool of VM-FEX dynamic NICs on every host. Libvirt internals: dynamic network with libvirt (define a NIC pool, so libvirt can assign VMs to NICs dynamically):

          <network>
            <name>direct-pool</name>
            <forward mode="passthrough">
              <interface dev="eth3"></interface>
              <interface dev="eth4"></interface>
              <interface dev="eth5"></interface>
              <interface dev="eth6"></interface>
              <interface dev="eth7"></interface>
              <interface dev="eth8"></interface>
              <interface dev="eth9"></interface>
              <interface dev="eth10"></interface>
              <interface dev="eth11"></interface>
            </forward>
          </network>

Using libvirt, the network is defined like this (the hook uses libvirt python API for the same purpose, and does this automatically):

       virsh net-define /tmp/direct-pool.xml
       virsh net-start direct-pool
       virsh net-autostart direct-pool

(where /tmp/direct-pool.xml contains the xml above)

Note that these interface definitions are completely static - you never need to modify them due to migration, or starting up/shutting down the guest.

Download link: <http://ovirt.org/releases/nightly/rpm/EL/6/hooks/vdsm-hook-vmfex-4.10.0-0.395.gite6d01e8.el7.noarch.rpm>

repository: igoihman/ovirt-site

gha_language: HTML

repo_name: igoihman/ovirt-site


text:
# EdgeCrossingEdgeCheck

#### Description

The purpose of this check is to identify Edges intersecting another Edge(s) that do not share the same Node (meaning they are not well-connected) nor have proper layer tagging on one of these Edge(s) (meaning there should be a _layer_ Tag for one of the Edges).

#### Live Examples

1. Line [id:245574716](https://www.openstreetmap.org/way/245574716) and [id:245574709](https://www.openstreetmap.org/way/245574709) do not share a node of intersection.
2. Line [id:400798431](https://www.openstreetmap.org/way/400798431) and [id:386147030](https://www.openstreetmap.org/way/386147030) cross invalidly.
3. Line [id:313458620](https://www.openstreetmap.org/way/313458620) and [id:554507231](https://www.openstreetmap.org/way/554507231) are overlapping duplicates.
4. Line [id:486493202](https://www.openstreetmap.org/way/486493202) and [id:172811290](https://www.openstreetmap.org/way/172811290) are duplicates that intersect at [id:172811276](https://www.openstreetmap.org/way/172811276).

#### Code Review

The check ensures that the Atlas object being evaluated is a car-navigable Edge. The check flags Edges that cross each other if they do not share the same node of intersection, or if none of the Edges have a _layer_ Tag. In addition, this check flags all Edges that cross the "candidate edge" Edge that is currently inspected by the check). The check inspects every Edge, creating duplicated flags when there are multiple Edges invalidly crossing each other.

To learn more about the code, please look at the comments in the source code for the check.
[EdgeCrossingEdgeCheck.java](../../src/main/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheck.java)

gha_language: Java


text:
---
title: "Flowchart"
metaTitle: "Flowchart"
metaDescription: "Flowchart"
---

Flow chart is a pictorial representation of an algorithm. Sequential steps in an algorithm can be represented as a flowchart using standard symbols.
## Flowchart Symbols
![Algorithm](img/flowchart.png)

## Guidelines
- In drawing a proper flowchart, all necessary requirements should be listed in logical order.
- The flowchart should be clear, neat and easy to follow.
- Ensure that the flowchart has a logical start and finish.
- The usual direction of the flow of a procedure or system is from left to right or top to bottom.
- Only one flow line should come out from a process symbol.
- The Decision symbol has two exit points; these can be on the sides or the bottom and one side.
- All boxes of the flowchart are connected with Arrows. (Not lines)
- Flowchart symbols have an entry point on the top of the symbol with no other entry points. The exit point for all flowchart symbols is on the bottom except for the Decision symbol.
- All flowcharts start and end with terminal.
## Youtube

[![Flowchart](http://img.youtube.com/vi/o9LLl4-TsDU/0.jpg)](http://www.youtube.com/watch?v=o9LLl4-TsDU "Flowchart")

Web Reference:
http://naveenkandwal.blogspot.com/2014/01/flowchart_18.html


text:
---

copyright:

  years: 2016

lastupdated: "2016-10-14"

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}

# Private network peering plug-in for Bluemix CLI
{: #private_network_cli}

Use the private network peering command line interface (CLI) to configure and manage private network peering between two {{site.data.keyword.Bluemix}} spaces. Private network peering is supported for IBM Containers (docker containers). The Bluemix spaces can be located in different availability zones in the same region or can be located in the different regions. The private network peering CLI plug-in is available for use with the Bluemix CLI plug-in.

The private network peering CLI plug-in is available for Windows, MAC, and Linux operating systems. Ensure that you use the plug-in that is applicable to you.

Before you begin, create Bluemix spaces. Ensure that each container in a space has an IP address from a different network. For details, see [Using your own private IP address](https://www.{DomainName}/docs/containers/container_security_network.html#container_cli_ips_byoip)

**Note:** After you use the private network peering with a Bluemix space, if you need to delete the space, first delete the private network peering connections in that space.

To get started, install the IBM Bluemix CLI. See
[Bluemix CLI](http://clis.ng.bluemix.net/ui/home.html) for details.

## Install the private network peering CLI plug-in

**Note**: If you have a previous version of the plug-in that is installed, you need to uninstall it. Use the following command to uninstall the plug-in:

```
bluemix plugin uninstall private-network-peering
```
### Install locally
Download the private network peering plug-in for your platform from [IBM Bluemix CLI plug-in repository](http://plugins.ng.bluemix.net/ui/repository.html#bluemix-plugins).

Install the private network peering plug-in by using the following command:

**Note**: Either switch to the location of the plug-in or specify the path to the plug-in location.

* For Microsoft Windows OS:

```
bluemix plugin install private-network-peering-windows-amd64.exe
```

* For Apple MAC OS:

```
bluemix plugin install private-network-peering-darwin-amd64
```

* For Linux OS:

```
bluemix plugin install private-network-peering-linux-amd64
```

**Note**: While you are installing the plug-in for Linux OS, if you see an error message that shows permission is denied, then run the following command and change the permissions:

```
chmod a+x ./private-network-peering-linux-amd64
```

### Install from Bluemix repository

Follow these steps to install the plug-in from the Bluemix repository:

1. Add the Bluemix plug-in registry endpoint:
	```
	bluemix plugin repo-add bluemix-bx http://plugins.ng.bluemix.net
	```

2. Run the following command:

	```
	bluemix plugin install private-network-peering -r bluemix-bx
	```

## List of private network peering commands
The following four commands are supported. Use the `bluemix network` command to see the list of available commands:

| Command     | Description                                    |
|-------------|------------------------------------------------|
| pnp-routers | Lists all available routers for peering        |
| pnp-create  | Creates a private network peering connection   |
| pnp-delete  | Deletes a private network peering connection   |
| pnp-show    | Lists all private network peering connections  |

### Command usage
To view help information for the commands, run: `bluemix network [command] -h`.

#### List all available routers for peering
```
bluemix network pnp-routers [--verbose (or -v)]
```

#####Optional parameters
{: #op1}

* **--verbose (or -v)** (flag): View detailed network information about each router.

######Command example
{: #ex1}

To view network information about all routers:

	$ bluemix network pnp-routers
	Listing available routers ...
	OK

	IP              NAME            COMPUTE    REGION          ORGANIZATION    SPACE
	<IP_ADDRESS>  default-router  Container  US-South<EMAIL_ADDRESS>demo1
	<IP_ADDRESS>  default-router  Container  US-South<EMAIL_ADDRESS>demo2
	<IP_ADDRESS>  default-router  Container  United-Kingdom<EMAIL_ADDRESS>demo3

To view detailed network information about all routers:

	$ bluemix network pnp-routers -v
	Listing available routers ...
	OK

	Router 'bce1aa25-bad0-4cf1-a831-d53c16463d06':
	FIELD          VALUE
	IP             <IP_ADDRESS>
	Name           default-router
	Compute        Container
	Region         US-South
	Organization<EMAIL_ADDRESS>	Space          demo1
	Networks       <IP_ADDRESS>/16

	Router '9ea160f2-1a30-44cd-bd25-794d441b274b':
	FIELD          VALUE
	IP             <IP_ADDRESS>
	Name           default-router
	Compute        Container
	Region         US-South
	Organization<EMAIL_ADDRESS>	Space          demo2
	Networks       <IP_ADDRESS>/16

	...

#### Create a private network peering connection by using the IP addresses
```
bluemix network pnp-create <router_ip> <router_ip> <name>
```

#####Parameters
{: #p1}

* **router_ip**: IP addresses of the two routers that you want to connect. You can find the IP addresses by using the command: `bluemix network pnp-routers`
* **name**: Name of the private network peering connection.

######Command example
{: #ex2}

	$ bluemix network pnp-create <IP_ADDRESS> <IP_ADDRESS> demo
	Creating private network peering connection 'demo' ...
	Connecting 'default-router(<IP_ADDRESS>)' and 'default-router(<IP_ADDRESS>)' ...
	OK

	Private network peering connection 'demo' created.

####Create a private network peering connection by using the connection name

```
bluemix network pnp-create -i <name>
```

#####Parameters
{: #p2}

* **--interactive (-i)** (flag): Interactive mode to select routers.
* **name**: Name of the private network peering connection.

######Command example
{: #ex3}

	$ bluemix network pnp-create -i demo
	Creating private network peering connection 'demo' ...
	List of available routers (select TWO for peering):

	#  ROUTER                          COMPUTE    REGION          ORGANIZATION    SPACE
	1  default-router(<IP_ADDRESS>)  Container  US-South<EMAIL_ADDRESS>demo1
	2  default-router(<IP_ADDRESS>)  Container  US-South<EMAIL_ADDRESS>demo2
	3  default-router(<IP_ADDRESS>)  Container  United-Kingdom<EMAIL_ADDRESS>demo3

	Select first router for peering> 1
	Select second router for peering> 2

	Connecting 'default-router(<IP_ADDRESS>)' and 'default-router(<IP_ADDRESS>)' ...
	OK

	Private network peering connection 'demo' created.

#### List all private network peering connections
```
bluemix network pnp-show [--verbose (or -v)]
```

#####Optional parameters
{: #op2}

* **--verbose (or -v)** (flag): View detailed network information about each router.

######Command example
{: #ex4}

View basic information:

	$ bluemix network pnp-show
	Listing private network peering connections ...
	OK

	ID                                    NAME  STATUS  ROUTER1                         ROUTER2
	17b1c3c7-d614-4fc5-9afe-961e38ee79f8  demo  Active  default-router(<IP_ADDRESS>)  default-router(<IP_ADDRESS>)

View detailed information:

	$ bluemix network pnp-show -v
	Listing private network peering connections ...
	OK

	Connection 'bedbc077-8040-41cc-a4aa-d9ce09a2e8ec':
	FIELD              VALUE
	Name               demo
	Status             Active
	Router1 Name       default-router
	Router1 IP         <IP_ADDRESS>
	Router1 Networks   <IP_ADDRESS>/16
	Router2 Name       default-router
	Router2 IP         <IP_ADDRESS>
	Router2 Networks   <IP_ADDRESS>/16

#### Delete a private network peering connection
```
bluemix network pnp-delete [--force (or -f)] <connection_id>
```
#####Parameters
{: #p3}
* **connection_id**: One or more connection IDs separated by a comma.

#####Optional parameters
{: #op3}

* **--force (or -f)** (flag): Deletes the connection without prompting for a confirmation.

######Command example:
{: #ex5}

Delete a connection:

	$ bluemix network pnp-delete 17b1c3c7-d614-4fc5-9afe-961e38ee79f8
	Warning: deleted connections cannot be restored.
	Are you sure you want to delete the connection? (yes/no)> yes

	Deleting private network peering connection '17b1c3c7-d614-4fc5-9afe-961e38ee79f8' ...
	OK

	Private network peering connection '17b1c3c7-d614-4fc5-9afe-961e38ee79f8' deleted.

Delete multiple connections:

```
bluemix network pnp-delete [-f] <connection_id>,<connection_id>,<connection_id>
```

repository: kKronstainBrown/docs

repo_name: kKronstainBrown/docs