text:
# dlvot

## Installation

1. Download the latest version of
   [dlvot](https://raw.githubusercontent.com/brobeson/dlvot/1.0.0/dlvot)
1. Install the *requests* and *wget* packages for Python:
   ```
   $ pip install requests wget
   ```

## Usage

At its most basic, just tell dlvot which data sets to download. This example
will download the 2017 and 2018 VOT data sets:

```
$ dlvot 2017 2018
```

On Windows:

```
C:\Users\you> py dlvot 2017 2018
```

Run `dlvot --help` for complete information.

### Note for Windows Users

On Windows, you must run dlvot with elevated privileges. Otherwise, you will get
an `OSError` exception when the application tries to create a symlink.

## How dlvot Works

VOT reuses sequences, just updating the tags and ground truth data. dlvot takes
advantage of this to save space on your system. Only one copy of the frame data
is kept. Symlinks mimic the directory structure typically expected by the VOT
toolkit.

The root download directory is *~/Videos/vot/*. Within this directory is a
*sequences/color/* subdirectory. At this time, color is the only supported
channel. Also in the root directory is a subdirectory for each data set year.
So, the directory structure looks like this:

```
~/Videos/vot/
  sequences/color
    bicycle/
      00000001.jpg
      00000002.jpg
      <rest of the images>
  2013/
    bicycle/
      color -> ~/Videos/vot/sequences/color/bicycle
      groundtruth.txt
      <tag files>
  2014
    bicycle/
      color -> ~/Videos/vot/sequences/color/bicycle
      groundtruth.txt
      <tag files>
```

dlvot creates any necessary directories, downloads the archives from VOT,
unpacks the archives, creates the symlinks, and deletes the archives.

repository: brobeson/dlvot

repo_name: brobeson/dlvot


text:
Course: CS 30
Period: 1
Date created: 2020/03/01
Date last modified: 2020/03/02
Name: William Powers
Description: Pseudocode

BEGIN Finish_Line Game:
    BEGIN Menu
    END Menu

**MENU CODE**

-Opening menu that gives you options to start game, end game, or get
instructions

BEGIN Menu:
    PRINT Begin Menu
    Input "What would you like to do?"
    CASEWHERE:
        1: "Start",  BEGIN Movement
        2: "Instructions", BEGIN HelpMe
        3: "Exit", END Menu
    END CASEWHERE
END Menu

**Story line**

-Prints an explanation of the game.

BEGIN StoryLine:
    PRINT Explanation

**MOVEMENT CODE**

-Code that gives you options to move, use items, get help, or show inventory.
-Used for every move the player makes

BEGIN Movement:
    INPUT "What would you like to do?"

END Movement

**HelpMe Code**

-Basic instructions for the game as well as the story line.

BEGIN HelpMe
    PRINT Game Commands
    INPUT "Continue?"
END HelpMe

**Use Code**

-Code for using items in your inventory

BEGIN Use:
    PRINT Inv
    INPUT the item you want to use
    IF item is available
        Use Item

    ELSE:
        PRINT "Item is not in Inventory
END Use

**Inv Code**

-Prints the items in your inventory which you have picked up during the game.

BEGIN Inv:
    PRINT Inv
END Inv

**Show XP Code**

-Prints your XP that you have earned throughout the game.

BEGIN Show XP:
    PRINT XP
END Show XP

license: Unlicense

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# SwiftPM Package Template

[![swift-version](https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat)](swift.org)
[![spm](https://img.shields.io/badge/spm-v1.0.0-blue.svg)](https://github.com/apple/swift-package-manager)
[![CocoaPods](https://img.shields.io/cocoapods/v/SwiftSerialport.svg)](https://cocoapods.org/pods/SwiftSerialport)
[![Build Status](https://travis-ci.org/ladislas/SwiftSerialport.svg)](https://travis-ci.org/ladislas/SwiftSerialport)
[![SonarCloud](https://sonarcloud.io/api/project_badges/measure?project=ladislas_SwiftSerialport&metric=alert_status)](https://sonarcloud.io/dashboard?id=ladislas_SwiftSerialport)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ladislas_SwiftSerialport&metric=coverage)](https://sonarcloud.io/dashboard?id=ladislas_SwiftSerialport)
[![SwiftSerialport](https://img.shields.io/badge/license-Apache--2.0-lightgrey.svg)](https://github.com/ladislas/SwiftSerialport/blob/master/LICENSE)

## About

Simple to use

### Features

> Describe the main features. <!--{change_me}-->

- [x] - it does this
- [x] - and also this
- [ ] - but not that

## Installation

### Swift Package Manager

With SPM, add the following to the dependencies of your `Package.swift`

```swift
.package(url: "https://github.com/{change_me}/{change_me}}", from: "1.0.0")
```

### Cocoapods <!--{change_me}-->

You want to add pod 'MyPackage', '~> 1.0' similar to the following to your Podfile:

```ruby
target 'MyApp' do
  pod 'MyPackage', '~> 1.0'
end
```

Then run a `pod install` inside your terminal.

### Manually

Just copy the [Sources](./Sources) files into your project.

## Usage

> Describe a simple usage <!--{change_me}-->

See [docs](./docs), [Examples](./Examples) & [Tests](./Tests) for more information.

```swift
import MyPackage

let myObj = MyClass()
...
```

## Authors

Made with ❤ by:

- **{change_me}** - [ladislas](https://github.com/ladislas)

## Contributing

> Explain how people can contribute to your project <!--{change_me}-->

We welcome contributions, and request you follow these guidelines.

Please raise any bug reports on the issue tracker. Be sure to search the list to see if your issue has already been raised.

A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.

## License

Apache 2.0 @ Ladislas de Toldi <!--{change_me}-->

repository: ladislas/SwiftSerialport

repo_name: ladislas/SwiftSerialport


text:
# Kuehneola spondiadis Hosag., 1986 SPECIES

#### Status
ACCEPTED

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

#### Published in
Indian Phytopath. 38(2): 279 (1985)

#### Original name
Kuehneola spondiadis Hosag., 1986

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Event Study

This repo aims to simplify a routine in finance research/practice - calculating abnormal returns for specific events for
a given stock. A [Event Study](https://en.wikipedia.org/wiki/Event_study) is a statistical method to measure the impact
of an event on the pricing/value of financial assets. This package aims to simplify this process and let finance
researchers or practitioners focus on their empirical ideas.

The package is built upon the [pandas-datareader](https://github.com/pydata/pandas-datareader), an awesome package to
get access to data from different sources for free. In this package, the stock price data is by default derived from
Yahoo Finance API.

## How to use
First, prepare an excel file containing the necessary information for event study. The excel file should have the
following columns:
- 'date'. The date of the event.
- 'ticker'. The ticker of the stock.

For a small example, you can use the 'example.xlsx'. In the Terminal, type the following command:

$ python study.py example.xlsx

To change the parameters for the event study, type the following command to see what can be set:

$ python study.py -h

You can change the following parameters:
- -stock_index. The market index for the asset pricing model.
- -window_size. The window size for the event study, e.g., window_size=10 means the event study will be conducted for 10
days before and the event (day zero, defined as the event date, is also included).
- -window_distance. The distance between the event date and the estimation period.
- -estimation_period. How long is the estimation period. For a statistically meaningful regression of a market model,
the estimation_period should be at least 30.

After executing the **python study.py example.xlsx** command, a new excel file containing the results will be generated.
In this excel file, you are expected to see the normal and abnormal returns for all the events during the window period.
You can take a look at the file 'example_result.xlsx'.

license: MIT

repository: zrxbeijing/EventStudy

repo_name: zrxbeijing/EventStudy


text:
---
title: Nushell 0.22
author: The Nu Authors
author_site: https://twitter.com/nu_shell
author_image: https://www.nushell.sh/blog/images/nu_logo.png
excerpt: Today, we're releasing 0.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements.
---

# Nushell 0.22

Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.

Today, we're releasing 0.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements.

<!-- more -->

# Where to get it

Nu 0.22 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.22.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`.

If you want all the goodies, you can install `cargo install nu --features=extra`.

As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`.

# What's New

## New functionality

### The `flatten` command (andrasio)

![animation of using the flatten command](../assets/images/0_22_flatten.gif)

_New flatten command_

There's now a flatten command that can take tables nested inside of the main table and flatten their contents into the main table.

### More `math` commands (morbatex, gillespiecd, fdncred)

You can now use rounding in math operations:

```
> echo [1.5 2.3 -3.1] | math ceil
───┬────
 0 │  2
 1 │  3
 2 │ -3
───┴────

> echo [1.5 2.3 -3.1] | math floor
───┬────
 0 │  1
 1 │  2
 2 │ -4
───┴────

> echo [1.5 2.3 -3.1] | math round
───┬────
 0 │  2
 1 │  2
 2 │ -3
───┴────
```

## Breaking changes

### Remove it-expansion (jonathandturner)

Previously, we treated the `$it` variable as a special variable that caused a command to iterate over each element in the row, for example `ls | echo $it.name` would expand to `ls | each { echo $it.name }`.

While this was handy in small examples, in the general case it became confusing to remember when and how it-expansion would happen.

In this release, we're trying an experiment of removing it-expansion.

Previously:

```
ls | echo $it.name
```

Now:

```
ls | each { echo $it.name }
```

Or, you can switch to other forms, like:

```
ls | get name
```

We're working towards a simpler mental model, where blocks can have parameters, and `$it` is the name of the parameter if it's not specified.

Please try it out and let us know what you think.

## Improvements

- **New** - a `seq` command for working with sequences (fdncred)
- bson and sqlite support added to the WiX (fdncred)
- `to md` now has a pretty flag (JosephTLyons)
- `ls` can now support other number formatting (lucassmmg)
- Filesize formats can now be changed via `config` (fdncred)
- Tables can now have heavy or no borders (fdncred)
- `math eval` now supports tau (rjboas)
- `char` now has simpler weather emoji (gillespiecd, fdncred)
- `str to-int` now takes an optional radix for conversion (gillespiecd)
- `char` can now print any unicode character (fdncred)
- `alias` now has optional type inference based on the recently accepted RFC (LhKipp)
- `ls` will also list inode in `-l` mode on Unix (gillespiecd)

## Internal improvements (andrasio, jonathandturner, LhKipp, EverlastingBugstopper, JosephTLyons, fdncred, jjshanks)

It's now easier to create column-paths inside of the Nu source, `alias` got some bugfixes, the parser got some bugfixes, fixed typo in the build message, filesize labels for bytes wasn't showing up (now fixed), internally there are now more helpers for creating the core Value type, bumped the required Rust version, bugfix for `;` endings, and remove unneeded comments.

# Looking forward

We're continuing to work to simplify the internal representation, improve the parser, and work to add support for features like block parameters, variables, and, in the future, custom commands.

If you'd like to help out, come by the [discord](https://discord.gg/NtAbbGn) and say hello!

branch_name: refs/heads/main

gha_language: Nushell

gha_license_id: MIT


text:
---
layout:     post
title:      "Free"
subtitle:   " \"自由\""
date:       2017-01-28 12:00:00
author:     "罗小布"
header-img: "img/in-post/bourdieu1.jpg"
tags:
    - 对话布尔迪厄
---

Mr. Bourdieu,

I only discovered your name in Terminale, at which time I was still deeply in a spirit of pure contradiction to everything I did not understand and all authority. So it was a good part of my year that I spent to denigrate you as much as philosophy and dear young professor in charge to make us discover some bases.

Thus he presented us the documentary "Sociology is a combat sport" that frankly did not convince me of the truth of your work, or at least of the seriousness on which it was based. Still, I put it in context, in my mind of "pure contradiction". Today, although still very young, I have learned from this that I was able to discover through my teacher and you a good producer of documentaries, namely "Pierre Carles", of which I practically saw all the documentaries, Without having understood everything.

I promise you to take a closer interest in your writings, and as objectively as possible, for a simple "Ah Bourdieu? Yeah it's the ****, "pass me the expression, is no longer enough in our days to hold a conversation. And I will ask you questions later on any question that deserves your insight.

Thank you in advance.

**Lucas Christmann **

---

I have only two brief suggestions to make. The first is to preserve your taste for protest, for it is in him that you will find the energy indispensable to those who wish to work continuously to disentangle the truth from the false. The second is to control as much as possible your tendency to contradict others by turning against your own thinking the weapons you like to use with regard to the thoughts of others. Good luck!

**Pierre Bourdieu**

extension: markdown


text:
---
layout: writeup
title: Apprenticeship Patterns
full_title: "Apprenticeship Patterns: Guidance for Aspiring Software Craftsman"
author: "Dave Hoover, Adewale Oshineye"
isbn:<PHONE_NUMBER>
image: apprenticeship-patterns.png
categories:
- writeup
favorite: true
---

**What's the point?**
The books aims to provide solutions to common problems that inexperienced developers run into -- both technical and
professional.  The over-arching theme is the road to software craftsmanship and how to advance yourself from apprentice
 to journeyman to master.

**How was it?**
I thought this book was awesome.  It follows the established "patterns" approach and gives context, problem, solution
and action items for each section.  So many of the sections have proved really valuable to me already.  The book is new
enough that all of the suggested action items seemed relevant (things like "write a blog post" or "look at the source
code on GitHub").

**Who should read it?**
I think the book is aimed towards newer developers, but there is also some value in the book for engineers at any
stage in their career.  The parts about making your own career roadmap are very helpful and since the path to becoming
 a master is long and winding, I think that most people would get something out of the book.  It is a pretty short
 (under 200 pages) so you could easily tackle it in a weekend.

---
Notes: I read this entirely on my Kindle and there were no issues.  This book is also available online on [O'Reilly Chimera Labs](http://chimera.labs.oreilly.com/books/1234000001813/index.html).

gha_language: JavaScript


text:
It may be safely removed.
Description-md5: 1353f8c1d079348417c2180319bdde09
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
```

## Check dependencies for specific packages

```bash
apt-cache showpkg vsftpd

Package: vsftpd
Versions:
2.3.5-3ubuntu1 (/var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages)
 Description Language:
                 File: /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages
                  MD5: 81386f72ac91a5ea48f8db0b023f3f9b
 Description Language: en
                 File: /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation-en
                  MD5: 81386f72ac91a5ea48f8db0b023f3f9b

Reverse Depends:
  ubumirror,vsftpd
  harden-servers,vsftpd
Dependencies:
2.3.5-3ubuntu1 - debconf (18 0.5) debconf-2.0 (0 (null)) upstart-job (0 (null)) libc6 (2 2.15) libcap2 (2 2.10) libpam0g (2 <IP_ADDRESS>) libssl1.0.0 (2 1.0.0) libwrap0 (2 7.6-4~) adduser (0 (null)) libpam-modules (0 (null)) netbase (0 (null)) logrotate (0 (null)) ftp-server (0 (null)) ftp-server (0 (null))
Provides:
2.3.5-3ubuntu1 - ftp-server
Reverse Provides:
```

## Check statistics of cache

```bash
apt-cache stats

Total package names: 51868 (1,037 k)
Total package structures: 51868 (2,490 k)
  Normal packages: 39505
  Pure virtual packages: 602
  Single virtual packages: 3819
  Mixed virtual packages: 1052
  Missing: 6890
Total distinct versions: 43015 (2,753 k)
Total distinct descriptions: 81048 (1,945 k)
Total dependencies: 252299 (7,064 k)
Total ver/file relations: 45567 (729 k)
Total Desc/File relations: 81048 (1,297 k)
Total Provides mappings: 8228 (165 k)
Total globbed strings: 286 (3,518 )
Total dependency version space: 1,145 k
Total slack space: 62.6 k
Total space accounted for: 13.3 M
```

## Update system package

```bash
sudo apt-get update

[sudo] password for tecmint:
Ign http://security.ubuntu.com quantal-security InRelease
Get:1 http://security.ubuntu.com quantal-security Release.gpg [933 B]
Get:2 http://security.ubuntu.com quantal-security Release [49.6 kB]
Ign http://in.archive.ubuntu.com quantal InRelease
Ign http://in.archive.ubuntu.com quantal-updates InRelease
Get:3 http://repo.varnish-cache.org precise InRelease [13.7 kB]
Ign http://in.archive.ubuntu.com quantal-backports InRelease
Hit http://in.archive.ubuntu.com quantal Release.gpg
Get:4 http://security.ubuntu.com quantal-security/main Sources [34.8 kB]
Get:5 http://in.archive.ubuntu.com quantal-updates Release.gpg [933 B]
...
```

## Upgrade software packages

```bash
sudo apt-get upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  linux-headers-generic linux-image-generic wine1.5 wine1.5-i386
The following packages will be upgraded:
  activity-log-manager-common activity-log-manager-control-center adium-theme-ubuntu alacarte
  alsa-base app-install-data-partner appmenu-gtk appmenu-gtk3 apport apport-gtk apt
  apt-transport-https apt-utils aptdaemon aptdaemon-data at-spi2-core bamfdaemon base-files bind9-host
   ...
```

## Install or upgrade sepcific packages

```bash
sudo apt-get install netcat

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  netcat-traditional
The following NEW packages will be installed:
  netcat netcat-traditional
0 upgraded, 2 newly installed, 0 to remove and 328 not upgraded.
Need to get 67.1 kB of archives.
After this operation, 186 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/universe netcat-traditional i386 1.10-40 [63.8 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/universe netcat all 1.10-40 [3,340 B]
Fetched 67.1 kB in 1s (37.5 kB/s)
Selecting previously unselected package netcat-traditional.
(Reading database ... 216118 files and directories currently installed.)
Unpacking netcat-traditional (from .../netcat-traditional_1.10-40_i386.deb) ...
Selecting previously unselected package netcat.
Unpacking netcat (from .../netcat_1.10-40_all.deb) ...
Processing triggers for man-db ...
Setting up netcat-traditional (1.10-40) ...
Setting up netcat (1.10-40) ...
```

## Install multiple packages

```bash
sudo apt-get install nethogs goaccess

Reading package lists... Done
Building dependency tree
Reading state information... Done
goaccess is already the newest version.
nethogs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
```

## Install several packages using wildcard

```bash
sudo apt-get install '*name*'
```

## Install packages without upgrading

```bash
sudo apt-get install packageName --no-upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping vsftpd, it is already installed and upgrade is not set.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
```

## Upgrade only specific packages

```bash
sudo apt-get install packgeName --only-upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
vsftpd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
```

## Install specific package version

```bash
sudo apt-get install vsftpd=2.3.5-3ubuntu1

Reading package lists... Done
Building dependency tree
Reading state information... Done
vsftpd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
```

## Remove packages without configuration

```bash
sudo apt-get remove vsftpd

[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  vsftpd
0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 364 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 216156 files and directories currently installed.)
Removing vsftpd ...
vsftpd stop/waiting
Processing triggers for ureadahead ...
Processing triggers for man-db ...
```

## Completely remove packages

```bash
sudo apt-get purge vsftpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  vsftpd*
0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 216107 files and directories currently installed.)
Removing vsftpd ...
Purging configuration files for vsftpd ...
Processing triggers for ureadahead ...
```

## Clean up disk space

```bash
sudo apt-get clean
```

## Download only source code of package

```bash
sudo apt-get --download-only source vsftpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 220 kB of source archives.
Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]
Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]
Fetched 220 kB in 4s (49.1 kB/s)
Download complete and in download only mode
```

## Download and unpack a package

```bash
sudo apt-get source vsftpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 220 kB of source archives.
Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]
Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]
Fetched 220 kB in 1s (112 kB/s)
gpgv: Signature made Thursday 24 May 2012 02:35:09 AM IST using RSA key ID 2C48EE4E
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./vsftpd_2.3.5-3ubuntu1.dsc
dpkg-source: info: extracting vsftpd in vsftpd-2.3.5
dpkg-source: info: unpacking vsftpd_2.3.5.orig.tar.gz
dpkg-source: info: unpacking vsftpd_2.3.5-3ubuntu1.debian.tar.gz
dpkg-source: info: applying 01-builddefs.patch
dpkg-source: info: applying 02-config.patch
dpkg-source: info: applying 03-db-doc.patch
dpkg-source: info: applying 04-link-local.patch
dpkg-source: info: applying 05-whitespaces.patch
dpkg-source: info: applying 06-greedy.patch
dpkg-source: info: applying 07-utf8.patch
dpkg-source: info: applying 08-manpage.patch
dpkg-source: info: applying 09-s390.patch
dpkg-source: info: applying 10-remote-dos.patch
dpkg-source: info: applying 11-alpha.patch
dpkg-source: info: applying 09-disable-anonymous.patch
dpkg-source: info: applying 12-ubuntu-use-snakeoil-ssl.patch
```

## Download, unpack and compile a package

```bash
sudo apt-get --complie source goaccess

[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 130 kB of source archives.
Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (dsc) [1,120 B]
Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (tar) [127 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (diff) [2,075 B]
Fetched 130 kB in 1s (68.0 kB/s)
gpgv: Signature made Tuesday 26 June 2012 09:38:24 AM IST using DSA key ID A9FD4821
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./goaccess_0.5-1.dsc
dpkg-source: info: extracting goaccess in goaccess-0.5
dpkg-source: info: unpacking goaccess_0.5.orig.tar.gz
dpkg-source: info: unpacking goaccess_0.5-1.debian.tar.gz
dpkg-buildpackage: source package goaccess
dpkg-buildpackage: source version 1:0.5-1
dpkg-buildpackage: source changed by Chris Taylor<EMAIL_ADDRESS>dpkg-buildpackage: host architecture i386
 dpkg-source --before-build goaccess-0.5
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 9) autotools-dev libncurses5-dev libglib2.0-dev libgeoip-dev autoconf
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
...
```

## Download a package without installing

```bash
sudo apt-get download nethogs

Get:1 Downloading nethogs 0.8.0-1 [27.1 kB]
Fetched 27.1 kB in 3s (7,506 B/s)
```

## Check change log of a package

```bash
sudo apt-get changelog csftpd

vsftpd (2.3.5-3ubuntu1) quantal; urgency=low

  * Merge from Debian testing (LP: #1003644).  Remaining changes:
    + debian/vsftpd.upstart: migrate vsftpd to upstart.
    + Add apport hook (LP: #513978):
      - debian/vsftpd.apport: Added.
      - debian/control: Build-depends on dh-apport.
      - debian/rules: Add --with apport.
    + Add debian/watch file.
    + debian/patches/09-disable-anonymous.patch: Disable anonymous login
      by default. (LP: #528860)
  * debian/patches/12-ubuntu-us-snakeoil-ssl.patch: Use snakeoil SSL
    certificates and key.

 -- Andres Rodriguez<EMAIL_ADDRESS>Wed, 23 May 2012 16:59:36 -0400
...
``

## Check broken dependencies

```bash
sudo apt-get check

[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
```

## Search and build dependencies

```bash
sudo apt-get build-dep netcat

The following NEW packages will be installed:
  debhelper dh-apparmor html2text po-debconf quilt
0 upgraded, 5 newly installed, 0 to remove and 328 not upgraded.
Need to get 1,219 kB of archives.
After this operation, 2,592 kB of additional disk space will be used.
 Done
Building dependency tree
Reading state information... Done
```

## Auto remove installed packages

```bash
sudo apt-get autoremove vsftpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'vsftpd' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
```

## References

- [https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/](https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/)

gha_language: HTML


text:
#Installation#

##deb package##

There is a debian package available. It can be installed using the following command:

    sudo dpkg -i jdrivesync_0.4.2_all.deb

Please note that jdrivesync requires openjdk-8-jre. How to install openjdk in version 8 for Ubuntu <14.10 is explained
[here](http://askubuntu.com/questions/464755/how-to-install-openjdk-8-on-14-04-lts).

After successful installation you can start jdrivesync with:

    /opt/jdrivesync/jdrivesync.sh

repository: brettbatie/jdrivesync

repo_name: brettbatie/jdrivesync


text:
---
title: BPMN 2
author: sajiv-francis
subtitle: Business Process Management
layout: post
modal-id: 6
date: 2019-05-07
tags:
- BPMN
- Modeling Best Practices
- Naming Conventions
- Gateway
- Data
- Artifact
imgURL: https://www.youtube.com/embed/H73KQyMtJ2w
thumbnail: bpmn2-thumbnail.png
alt: image-alt
description: BPMN - Part 2

---
The Business Process Modeling Notation (BPMN) is visual modeling language for business analysis applications and specifying enterprise process workflows, which is an open standard notation for graphical flowcharts that is used to define business process workflows. It is popular and intuitive graphic that can be easily understand by all business stakeholders, including business users, business analysts, software developers, and data architects.

[![Watch the video](https://sajivfrancis.github.io/img/portfolio/bpmn2-thumbnail.png)](https://www.youtube.com/embed/H73KQyMtJ2w)

Quick guide to BPMN:

BPMN Guide

gha_language: CSS


text:
# ChickenDoor

![SCREENLOGO](https://github.com/Pidow/ChickenDoor/blob/master/1.first%20WITH%20DIGISPARK/1.Connection%20&%20photos/definition.png?raw=true)![SCREENLOGO](https://github.com/Pidow/ChickenDoor/blob/master/1.first%20WITH%20DIGISPARK/1.Connection%20&%20photos/ouvert.png?raw=true)

TARGET:
Move the chicken house doors 2 times per day.
Estimate battery lifetime: 8 month with AAA battery(x8).

## SECOND VERSION DIGISPARK PRO VERSION cost: less 15€
![SECOND VERSION](https://github.com/Pidow/ChickenDoor/blob/master/2.Rebuild%20with%20DIGISPARK%20PRO/1.Assy%20view/0.Definition.jpg?raw=true)
![SCREENLOGO](https://github.com/Pidow/ChickenDoor/blob/master/2.Rebuild%20with%20DIGISPARK%20PRO/1.Assy%20view/3.Date%20and%20time%20before%20action.png?raw=true)
![SCREENLOGO](https://github.com/Pidow/ChickenDoor/blob/master/2.Rebuild%20with%20DIGISPARK%20PRO/1.Assy%20view/1.Setup.png?raw=true)
*   ATTiny167 Digispark Pro
*   RTC DS3231 (Real Time clock)
*   Relay for Servomotor
*   Servomotor MG995
*   Battery holder 4 battery 1,5 v (x2)
*   Oled screen 128x64 I2C SPI serial.

## CONNECTION
![FIRSTVERSION](https://github.com/Pidow/ChickenDoor/blob/master/2.Rebuild%20with%20DIGISPARK%20PRO/1.Assy%20view/digispark%20pro.png?raw=true)
![FIRSTVERSION](https://github.com/Pidow/ChickenDoor/blob/master/2.Rebuild%20with%20DIGISPARK%20PRO/1.Assy%20view/digispark%20pro%20connections&.jpg?raw=true)

```
How it's work:
Push software to Digispark, connect all component following instructions.
The system is ready !

Note:
If the RTC have power lost, software update it time automaticaly.
Oled screen & RTC use the same SDA and SCL connection to DIGISPARK.
RTC DS3231 allow to have Temp information.
I have put an relay to avoid battery consuming to maintain the servomotor position.
FYI Servomotor have only 180° angle, i have create a 3D print wheel to open the door.
```

> I'm available if any question.
>
> Have fun !
>
>    ARNAUD TOCABENS.

repository: Pidow/ChickenDoor

path: /2.Rebuild with DIGISPARK PRO/README.md

repo_name: Pidow/ChickenDoor


text:
# Complan

A Complexity Analyzer Tool which computes software complexity for a Javascript project hosted on Github.

* [How it works](#how-it-works)
* [Installation](#installation)
* [Usage](#usage)
    * [Command-line options](#command-line-options)
* [License](#license)

## How it works

```Complan``` is a node.js based
command-line wrapper around [complexity-report] (https://www.npmjs.com/package/complexity-report) which computes code complexity for a Javascript project hosted on Github.

## Installation

Assuming you've nodejs installed,

For a project-based ~~install:~~

```
npm install complan
```

For global installation:

```
sudo npm install -g complan
```

## Usage

```
complan -g <git url>
```
```
e.g
complan -g https://github.com/pranavparikh/complan
or
complan -g git@github.com:pranavparikh/complan.git
```
The above command will generate complexity report (JSON and HTML files) under a directory named ```pranavparikh/complan``` in your current directory.

The tool will locally clone the repository from git (Git has to be installed as a pre-requisite) , compute complexity and output it in a form of JSON & HTML reports.

### Command-line options

```
-h, --help                            output usage information
-g, --gitUrl <path>                   specify the http url or the git url of the repository
-c, --gitCheckout                     Branch / tag / checkout of the git project (Defaults to master)
```
## License

[MIT]

repository: pranavparikh/complan

repo_name: pranavparikh/complan


text:
---
title: "Sketch - Needlepoint"
author: Manohar Vanga
image: http://sighack.com/public/images/generative-sketch-needlepoint/final-small.png
description: A generative sketch - Needlepoint
gpgc_disabled: true
---

Click the image below to see a high-resolution version.

<a href="/public/images/generative-sketch-needlepoint/needlepoint-highres.png" target="_blank">
![](/public/images/generative-sketch-needlepoint/needlepoint-lowres.png)
</a>

![](/public/images/generative-sketch-needlepoint/detail1.png)

![](/public/images/generative-sketch-needlepoint/detail2.png)

Unfortunately, during the creation of this sketch I didn't end up saving any
intermediate images. Oh well!


text:
# Responsive-Portfolio
Second part of css-bootstrap homework as part of UMN Web Dev Bootcamp

This uses a base of code provided by UMN Web Dev Bootcamp.
I have added responsiveness features, as well as personalized content
and links to projects and homework I've completed in class.

https://jmeuwissen.github.io/Responsive-Portfolio/

repository: jmeuwissen/professional-portfolio

repo_name: jmeuwissen/professional-portfolio


text:
# 1.
The model will consist of species and reactions for which
thermodynamic properties and rate coefficients, respectively,
are already known from the literature.
It is an exercise in setting up T3 for a system for which
**no** quantum mechanical (QM) calculations are executed.

When using the API, the first directive is to import the main T3 object
(this is not needed when using an input file):

```Python hl_lines="1"
from t3 import T3

rmg_args = {'database': {'thermo_libraries': ['primaryThermoLibrary',
                                              'BurkeH2O2'],
                         'kinetics_libraries': ['BurkeH2O2inN2']},
            'species': [{'label': 'H2',
                         'smiles': '[H][H]',
                         'concentration': 0.67},
                        {'label': 'O2',
                         'smiles': '[O][O]',
                         'concentration': 0.33}],
            'reactors': [{'type': 'gas batch constant T P',
                          'T': 1000,
                          'P': 1,
                          'termination_conversion': {'H2': 0.9},
                          'termination_time': [5, 's']}],
            'model': {'core_tolerance': [0.01, 0.001]}}

t3_object = T3(project='T3_tutorial_1',
               rmg=rmg_args)

t3_object.execute()
```
*(This script is complete, it should run "as is")*

Next we'll define arguments related to RMG. This argument is a Python dictionary which
will be passed to the ``rmg`` argument of the ``T3`` object imported above.
You can name this argument with any legal Python name, here we use ``rmg_args``.
This is the only required primary argument -- this simple example does not
make use of the additional primary arguments, ``t3`` and ``qm``.

```Python hl_lines="3 4 5 6 7 8 9 10 11 12 13 14 15 16 17"
from t3 import T3

rmg_args = {'database': {'thermo_libraries': ['primaryThermoLibrary',
                                              'BurkeH2O2'],
                         'kinetics_libraries': ['BurkeH2O2inN2']},
            'species': [{'label': 'H2',
                         'smiles': '[H][H]',
                         'concentration': 0.67},
                        {'label': 'O2',
                         'smiles': '[O][O]',
                         'concentration': 0.33}],
            'reactors': [{'type': 'gas batch constant T P',
                          'T': 1000,
                          'P': 1,
                          'termination_conversion': {'H2': 0.9},
                          'termination_time': [5, 's']}],
            'model': {'core_tolerance': [0.01, 0.001]}}

t3_object = T3(project='T3_tutorial_1',
               rmg=rmg_args)

t3_object.execute()
```

Here, the ``rmg_args`` argument defines the database libraries to be used by RMG,
the chemical species with respective structure and concentration, the reactor
type, conditions and termination criteria, and the RMG core tolerances to be used
throughout the different T3 iterations.

!!! Note
    The RMG arguments in T3 *generally* correspond to arguments used by the legacy RMG input file.
    Users should refer to the

    RMG documentation for detailed explanations of all possible arguments.
    This tutorial, though, manages to capture all major syntax differences users should be aware of
    when defining the RMG arguments in T3:

    1. RMG arguments are currently in camelCase style (e.g., ``thermoLibraries``), whereas the respective
       arguments in T3 are in lower_case_underscore style (e.g., ``thermo_libraries``).
    2. Species definitions in T3 are more flexible, see the
       [how-to guides](how_to.md) for more details.
    3. Reactor types were re-named for clarity, see the
       [how-to guides](how_to.md) for more details.
    4. ``core_tolerance`` is a list of the RMG ``toleranceMoveToCore`` argument to use per T3 iteration.
       If the number of iterations is larger than the length of ``core_tolerance``, the last entry will be used.
       The `core_tolerance`` argument can also be given as flot, in which case it will be treated as a onc-entry list.
    5. Minor: RMG uses the notation ``reactionLibraries`` while T3 uses ``kinetics_libraries``.

Next, we create the ``T3`` object with all desired arguments.
Here, only the two required arguments, ``project`` and ``rmg`` are given.

```Python hl_lines="19 20"
from t3 import T3

rmg_args = {'database': {'thermo_libraries': ['primaryThermoLibrary',
                                              'BurkeH2O2'],
                         'kinetics_libraries': ['BurkeH2O2inN2']},
            'species': [{'label': 'H2',
                         'smiles': '[H][H]',
                         'concentration': 0.67},
                        {'label': 'O2',
                         'smiles': '[O][O]',
                         'concentration': 0.33}],
            'reactors': [{'type': 'gas batch constant T P',
                          'T': 1000,
                          'P': 1,
                          'termination_conversion': {'H2': 0.9},
                          'termination_time': [5, 's']}],
            'model': {'core_tolerance': [0.01, 0.001]}}

t3_object = T3(project='T3_tutorial_1',
               rmg=rmg_args)

t3_object.execute()
```

Finally, we call the ``execute()`` method of ``T3``.

```Python hl_lines="22"
from t3 import T3

rmg_args = {'database': {'thermo_libraries': ['primaryThermoLibrary',
                                              'BurkeH2O2'],
                         'kinetics_libraries': ['BurkeH2O2inN2']},
            'species': [{'label': 'H2',
                         'smiles': '[H][H]',
                         'concentration': 0.67},
                        {'label': 'O2',
                         'smiles': '[O][O]',
                         'concentration': 0.33}],
            'reactors': [{'type': 'gas batch constant T P',
                          'T': 1000,
                          'P': 1,
                          'termination_conversion': {'H2': 0.9},
                          'termination_time': [5, 's']}],
            'model': {'core_tolerance': [0.01, 0.001]}}

t3_object = T3(project='T3_tutorial_1',
               rmg=rmg_args)

t3_object.execute()
```

Note that the corresponding YAML input file for this tutorial would be:

```YAML
project: T3_tutorial_1
rmg:
  database:
    kinetics_libraries:
    - BurkeH2O2inN2
    thermo_libraries:
    - primaryThermoLibrary
    - BurkeH2O2
  model:
    core_tolerance:
    - 0.01
    - 0.001
  reactors:
  - P: 1.0
    T: 1000.0
    termination_conversion:
      H2: 0.9
    termination_time:
    - 5
    - 's'
    type: gas batch constant T P
  species:
  - concentration: 0.67
    label: H2
    smiles: '[H][H]'
  - concentration: 0.33
    label: O2
    smiles: '[O][O]'
```

gha_language: Python


text:
---
title: Additional Demographics Event Message Bundle
keywords:  messaging, bundles
tags: [fhir,messaging]
sidebar: foundations_sidebar
permalink: explore_additional_demographics.html
summary: "The FHIR profiles used for the Additional Demographics Event Message Bundle"
---

## FHIR Profiles ##

The following FHIR profiles are used to form the Additional Demographics Event Message Bundle:

- [Bundle](http://hl7.org/fhir/STU3/StructureDefinition/Bundle)
- [Event-MessageHeader-1](https://fhir.nhs.uk/STU3/StructureDefinition/Event-MessageHeader-1) - where the coding and display elements for the 'event' type are fixed to 'additional-demographics-1 \| Additional Demographics'
- [CareConnect-Organization-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Organization-1)
- [CareConnect-HealthcareService-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-HealthcareService-1)
- [CareConnect-Patient-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Patient-1)
- [CareConnect-Encounter-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1)
- [CareConnect-Location-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Location-1)

## Bundle Structure

Specifies mandatory referencing within the Event Message Bundle.

	Additional Demographics (open in new TAB)

## Additional Demographics Event data item mapping to FHIR profiles ##

This Mapping table defines the FHIR elements that SHALL be used to encode the Healthy Child Event Specification data items for each DCH Event Message payload.
Some common data item mappings, such as patient, publisher or Date/Time of event information, are defined within the [Header mapping table](explore_event_header_design.html) and SHALL be considered in parallel with the payload mapping.

The Child Health Event data items are fulfilled by elements within the FHIR resources listed below:

| DCH Data Item            | FHIR resource element                                 | Mandatory/Required/Optional |
|--------------------------|-------------------------------------------------------|-----------------------------|
| Local Patient Identifier | CareConnect-Patient-1.identifier (localIdentifier) | Mandatory                   |
| Local Patient Identifier assigning Organisation| CareConnect-Patient-1.identifier(localIdentifier).assigner | Required                   |
| Town of Birth            | CareConnect-Patient-1.birthPlace                  | Required                    |
| Country of Birth         | CareConnect-Patient-1.birthPlace                  | Required                    |
| Patient email address    | CareConnect-Patient-1.telecom.value               | Required                    |
| Ethnicity
 see table below             | CareConnect-Patient-1.ethnicCategory              | Required                    |
| Religion                 | CareConnect-Patient-1.religiousAffiliation        | Required                    |
| Date and Time            | CareConnect-Encounter-1.period.start              | Required                    |

### Ethnic categories mapping table ###

Ethnicity recording in Digital Child Health is requested to use the reduced 16+1 Ethnic Category list.
However, CareConnect-Patient-1 has a required binding to the [CareConnect-EthnicCategory-1 valueset](https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-EthnicCategory-1).
The following mapping SHOULD be used to map the ethnicCategory value to the reduced valueset.

16+1 valueSet	Mapping to PDS valueSet

A - British, Mixed British	A - British, Mixed British

B - Irish	B - Irish

C - Any Other White Background	C - Any other White background
C2 - Northern Irish
C3 - Other white, white unspecified
CA - English
CB - Scottish
CC - Welsh
CD - Cornish
CE - Cypriot(part not stated)
CF - Greek
CG - Greek Cypriot
CH - Turkish
CJ - Turkish Cypriot
CK - Italian
CL - Irish Traveller
CM - Traveller
CN - Gypsy/Romany
CP -Polish
CQ - All republics which made up the former USSR
CR - Kosovan
CS - Albanian
CT - Bosnian
CU - Croatian
CV - Serbian
CW - Other republics which madeup the former Yugoslavia
CX - Mixed white
CY - Other white European, European unspecified, European mixed

D - White & Black Caribbean	D - White & Black Caribbean

E - White & Black African	E - White & Black African

F - White & Asian	F - White & Asian

G - Any Other Mixed Background	G - Any other mixed background
GA - Black and Asian
GB - Black and Chinese
GC - Black and White
GD - Chinese and White
GE - Asian and Chinese
GF - Other Mixed, Mixed Unspecified

H - Indian	H - Indian

J - Pakistani	J - Pakistani

K - Bangladeshi	K - Bangladeshi

L - Any Other Asian Background	LA - Mixed Asian
LB - Punjabi
LC - Kashmiri
LD - East African Asian
LE - Sri Lanka
LF - Tamil
LG - Sinhalese
LH - British Asian
LJ - Caribbean Asian
LK - Other Asian, Asian unspecified

M - Caribbean	M - Caribbean

N - African	N - African

P - Any Other Black Background	P - Any other Black background
PA - Somali
PB - Mixed Black
PC - Nigerian
PD - Black British
PE - Other Black, Black unspecified

R - Chinese	R - Chinese

S - Any Other Ethnic Group	S - Any other ethnic group
SA - Vietnamese
SB - Japanese
SC - Filipino
SD - Malaysian
SE - Any Other Group

Z - Not Stated	Z - Not Stated

## Resource Population Requirements and Guidance ##

The following requirements and resource population guidance should be followed in addition to the requirements and guidance outlined in the data item mapping above and in the [Event Header](https://developer.nhs.uk/apis/ems-beta/explore_event_header_information.html) requirements page.

### [Bundle](http://hl7.org/fhir/STU3/StructureDefinition/Bundle)

| Resource Cardinality | 1..1 |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| type | 1..1 | Fixed value: message |

### [Event-MessageHeader-1](https://fhir.nhs.uk/STU3/StructureDefinition/Event-MessageHeader-1)

The Event-MessageHeader-1 resource included as part of the event message SHALL conform to the [Event-MessageHeader-1](https://fhir.nhs.uk/STU3/StructureDefinition/Event-MessageHeader-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 1..1 |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| extension(messageEventType) | 1..1 |  |
| event | 1..1 | Fixed Value: additional-demographics-1 (Additional Demographics) |
| responsible | 1..1 | This will reference the responsible Organization resource |
| focus | 1..1 | This will reference the CareConnect-Encounter-1 resource which contains information relating to the event message. |

### [CareConnect-Organization-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Organization-1)

The CareConnect-Organization-1 resource included as part of the event message SHALL conform to the [CareConnect-Organization-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Organization-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 1..* |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| identifier.system | 1..1 | Fixed value: https://fhir.nhs.uk/Id/ods-organization-code |
| identifier.value | 1..1 | Organisation’s ODS Organization Code |
| name | 1..1 | Organisation’s Name |

### [CareConnect-HealthcareService-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-HealthcareService-1)

The CareConnect-HealthcareService-1 resource included as part of the event message SHALL conform to the [CareConnect-HealthcareService-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-HealthcareService-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 1..1 |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| providedBy | 1..1 | This will reference the ‘sender’ organization of the event message. |
| type | 1..1 | This will represent the type of service responsible for the event message. This will have a fixed value from the ValueSet [CareConnect-CareSettingType-1](https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-CareSettingType-1) |
| specialty | 1..1 | HealthcareService.specialty SHALL use a value from https://fhir.nhs.uk/STU3/ValueSet/DCH-Specialty-1 |

### [CareConnect-Patient-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Patient-1)

The CareConnect-Patient-1 resource included as part of the event message SHALL conform to the [CareConnect-Patient-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Patient-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 1..1 |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| identifier(localIdentifier) | 1..1 | Local Patient Identifier SHALL be included within the localIdentifier identifier slice |
| identifier(localIdentifier),assigner | 1..1 | This will reference the Local Patient Identifier assigning Organisation |
| identifier | 1..1 | Patient NHS Number SHALL be included within the nhsNumber identifier slice |
| name (official) | 1..1 | Patients name as registered on PDS, included within the resource as the official name element slice |
| birthDate | 1..1 | The patient birth date shall be included in the patient resource |

### [CareConnect-Encounter-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1)

The CareConnect-Encounter-1 resource included as part of the event message SHALL conform to the [CareConnect-Encounter-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 1..1 |

| Element | Cardinality | Additional Guidance |
| --- | --- | --- |
| Encounter.type.coding(childHealthEncounterType) | 1..1 | Encounter.type.coding(childHealthEncounterType) SHALL use a value from https://fhir.nhs.uk/STU3/ValueSet/DCH-ChildHealthEncounterType-1 |
| Encounter.reason.coding(snomedCT) | 1..1 | Encounter.reason.coding(snomedCT) SHALL use a value from https://fhir.nhs.uk/STU3/ValueSet/DCH-AdmissionReason-1 |
| serviceProvider | 1..1 | This will reference the Organisation resource hosting the Encounter |
| location | 1..1 | This will reference the Encounter's Location |
| subject | 1..1 | This will reference the patient resource representing the subject of this event |

### [CareConnect-Location-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Location-1)

The CareConnect-Location-1 resource included as part of the event message SHALL conform to the [CareConnect-Location-1](https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Location-1) constrained FHIR profile and the additional population guidance as per the table below:

| Resource Cardinality | 0..1 |

## DCH Additional Demographics Example ##

## Profile Change Mappings for Additional Demographics ##

Profiles used in [Demographics Update Event Messages 1.2.1-Release Candidate](https://developer.nhs.uk/apis/demographicupdates-120-rc/index.html) are replaced with:

| Demographic-Event-Messages | Demographic-Event-Messages-CareConnect |
|----------------------------|----------------------------------------|
| DCH-Bundle-1  | Bundle |
| DCH-MessageHeader-1  | Event-MessageHeader-1 |
| CareConnect-Organization-1 | CareConnect-Organization-1 |
| DCH-HealthcareService-1 | CareConnect-HealthcareService-1 |
| CareConnect-DCH-Patient-1 | CareConnect-Patient-1 |
| CareConnect-DCH-Encounter-1 | CareConnect-Encounter-1 |
| CareConnect-Location-1 | CareConnect-Location-1 |

branch_name: refs/heads/gh-pages


text:
EventEng
========
Usage
-----
###Installation
In your project:
```
cd vendor/engines
git clone https://github.com/gustavolobo/EventEng.git
cd ../..
```
In your Gemfile:
```ruby
gem 'event_eng', :path => "vendor/engines"
```
Run:
```
bundle install
rake event_eng:install:migrations
rake db:migrate
```
In your routes file:
```ruby
mount EventEng::Engine, :at => "/event_eng"
```

Contributing
------------
If you found a bug or if you think that should be done an improvement in the project, I'll appreciate any contact.

repository: gustavolobo/EventEng

repo_name: gustavolobo/EventEng


text:
---
layout: post
title: Implementation of Cholesky decomposition
---

## Intro

In implementing the particle algorithm based on the Ellipsoidal Statistical Fokker-Planck model, a key step is to find a matrix L that satisfies the following relationship:
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/a498ef3255cff22b477793f47cd18b5e80b7418a)
For this problem, the most intuitive method is obviously to open the matrix A, which needs to calculate the eigenvalue of A. In the advancement algorithm, it takes a lot of calculation time at each time step.

A possible alternative is the Cholesky decomposition, which is based on the decomposition of a positive definite Hermite matrix into a product of a lower triangular matrix and its conjugate transpose. This method of decomposition was originally invented by André-Louis Cholesky.

## Algorithm principle

The implementation of Cholesky decomposition can be based on the Cholesky-Crout algorithm.
For a matrix that needs to be solved, it can be written in the following form:
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/15da0fc67622d164be459628c34b9fb6bae59bd3)
The corresponding formula for the matrix L element is as follows,
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/3c66080a03434674c342609693f813f946e98eb9)

## Numerical implementation

A subroutine based on Fortran90 is given below.
Details can be found on [Github](https://github.com/vavrines/cholesky "Title").

<pre>

!-----------------------------------------------------------------------------
! cholesky.f90
! Calculate Cholesky decomposition based on Cholesky-Crout algorithm
! Author: Tianbai Xiao
! Licence: GPLv3
! > A is a n by n positive definite real symmetric matrix
! > A = L L^T, where L is a lower triangular matrix and L^T is transpose of L.
!-----------------------------------------------------------------------------

subroutine calc_cholesky(n, A, L)

implicit none
integer, intent(in) :: n
real(kind=8), intent(in) :: A(n,n)
real(kind=8), intent(out) :: L(n,n)
integer :: i,j

! check of positive definite
do i = 1, n
   if (A(i,i).le.0.0d0) then
      return
   end if
end do

! Cholesky-Crout algorithm
L(:,:) = 0.d0
do j = 1, n
   L(j,j) = sqrt( A(j,j) - dot_product(L(j,1:j-1),L(j,1:j-1)) )
   do i = j+1, n
      L(i,j)  = ( A(i,j) - dot_product(L(i,1:j-1),L(j,1:j-1)) ) / L(j,j)
   end do
end do

end subroutine calc_cholesky

</pre>

repository: tbxiao/blogarchive

repo_name: tbxiao/blogarchive


text:
---
layout: post
title: Llama Architecture(GPT)
published: true
---

# tl;dr
1. The architecture is described in [Llama: Open and Efficient Foundation Language Models](http://arxiv.org/pdf/2302.13971.pdf)
2. The code is ported from PyTorch to TensorFlow 2.x using various references. (e.g) https://nn.labml.ai/transformers/rope/index.html
   TensorFlow is very verbose and sometimes it poses difficulties as every line of PyTorch has to be ported.
4. In very few cases the code can be directly ported with minimal changes. But this situation isn't common.
5. The math supporting the algorithm is only partially understood. There are several research papers to read.
6. The RoPE embeddings and attention need more insight and explanation.In fact each section will need multiple
   diagrams and descriptions.

# Batches

{% highlight python %}
def random_sample(text,block_size):
    rand = tf.random.uniform(shape=(batch_size,), minval=1, maxval=length - (block_size + 1),dtype=tf.int32)
    return [tf.strings.substr(text,i, block_size, unit='BYTE') for i in rand]

def draw_random_sample_batches(block_size):
        sample = random_sample(input,block_size)
        tf.map_fn(map_fn,tf.strings.bytes_split(sample))
        global samplelist
        X = tf.stack([inp[  : -1] for inp in samplelist])
        y = tf.stack([inp[ 1 :  ] for inp in samplelist])
        samplelist = []
        return X,y

{% endhighlight %}

# RMSNorm

{% highlight python %}

import numpy as np
import tensorflow as tf

class RMSNorm(tf.keras.Model):

    def __init__(self, layer_shape):
        super(RMSNorm, self).__init__()
        self.scale = tf.Variable(initial_value=np.ones(layer_shape), trainable=True,dtype=tf.float32)

    def call(self, x):
        normalized_mat, norm = tf.linalg.normalize(x, axis=(1, 2))
        # print(f'Normalize {norm}')
        rms = tf.multiply(norm ,
                             tf.pow(tf.cast(tf.size(x[0]),tf.float32),-0.5))
        r = tf.divide(x , rms )
        return tf.multiply(self.scale[:tf.shape(x)[1], :] , r)

{% endhighlight %}

## TensorFlow Tests

Simple tests like these are supported by TensorFlow. I have learnt to use the Python console from within PyCharm
as the tests are sometimes not recognized by the IDE.

{% highlight python %}

/opt/anaconda3/envs/tensorflow2/bin/python3 "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py" --mode=client --port=51221
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/anu/PycharmProjects/illama'])
Python 3.7.10 (default, Feb 26 2021, 10:16:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 7.24.1
Python 3.7.10 (default, Feb 26 2021, 10:16:00)
[Clang 10.0.0 ] on darwin
runfile('/Users/anu/PycharmProjects/illama/testRotaryEmbedding.py', wdir='/Users/anu/PycharmProjects/illama')
Running tests under Python 3.7.10: /opt/anaconda3/envs/tensorflow2/bin/python3
[ RUN      ] testRotaryEmbedding.test_RotaryEmbedding
2023-08-25 12:29:24.820540: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
16
tf.Tensor([32 32], shape=(2,), dtype=int32)
tf.Tensor([ 1 32], shape=(2,), dtype=int32)
INFO:tensorflow:time(__main__.testRotaryEmbedding.test_RotaryEmbedding): 1.01s
I0825 12:29:25.825525<PHONE_NUMBER> test_util.py:2309] time(__main__.testRotaryEmbedding.test_RotaryEmbedding): 1.01s
[       OK ] testRotaryEmbedding.test_RotaryEmbedding
[ RUN      ] testRotaryEmbedding.test_session
[  SKIPPED ] testRotaryEmbedding.test_session
----------------------------------------------------------------------
Ran 2 tests in 1.008s
OK (skipped=1)
Process finished with exit code 0
{% endhighlight %}

{% highlight python %}

import tensorflow as tf

from Parameters import batch_size, block_size, n_embd

class testRMSNorm(tf.test.TestCase):

    def setUp(self):
        super(testRMSNorm, self).setUp()
        self.batch = tf.random.normal((batch_size, block_size, n_embd))

    def test_RMSNormTest(self):
        normalized_mat, norm = tf.linalg.normalize(self.batch, axis=(1, 2))
        ff_rms = tf.multiply(norm,
                             tf.pow(tf.cast(tf.size(self.batch[0]), tf.float32), -0.5))
        ffx = tf.Variable(tf.zeros_like(self.batch))
        print(tf.shape(ffx))
        for i in range(self.batch.shape[0]):
            ffx[i, :, : ].assign(tf.divide(self.batch[i] , ff_rms[i]))
        normalized_mat, norm = tf.linalg.normalize(self.batch, axis=(1, 2))
        print(tf.pow(norm,2))

        # The values are close to 1024 but not close enough for default
        # tolerance levels to pass the test. So it will fail unless
        # I pass a different tolerance level. I believe this is a temporary
        # fix until I understand the issue.
        self.assertAllClose(tf.pow(norm,2),
                            tf.reshape(
                                tf.repeat([tf.constant(1024,tf.float32)], repeats=[4], axis=0),
                                (4,1,1)),50,50)

tf.test.main()

{% endhighlight %}

There is one other issue that I don't understand fully.

The test failed as the values are not close enough as per the tolerance.

My questions are these.

1. Is the RMSNorm algorithm correct ? Should I read any material/code to improve it if it is wrong ?
2. Can I use different tolerance levels to pass the test ? The API _ self.assertAllClose_ takes tolerance levels as
   parameters.And if I pass 50( for example ) for the upper and lower limit the test passes.

I can also ignore the failure as the values seem to be close.

{% highlight python %}

AssertionError:
Not equal to tolerance rtol=1e-09, atol=0.0001
Mismatched value: a is different from b.
not close where = (array([0, 1, 2, 3]), array([0, 0, 0, 0]), array([0, 0, 0, 0]))
not close lhs = [1019.3864 1056.9813 1021.6669 1046.128 ]
not close rhs = [1024. 1024. 1024. 1024.]
not close dif = [ 4.6135864 32.981323   2.33313   22.128052 ]
not close tol = [0.00010102 0.00010102 0.00010102 0.00010102]
dtype = float32, shape = (4, 1, 1)
Mismatched elements: 4 / 4 (100%)
Max absolute difference: 32.981323
Max relative difference: 0.03220832

{% endhighlight %}

# Rotary Positional Embeddings( RoPE)

Code used to test _RoPE_ embeddings

{% highlight python %}

from matplotlib import pyplot as plt
import tensorflow as tf
from Parameters import n_embd
from RotaryPositionalEmbeddings import RotaryPositionalEmbeddings

def rotaryPositionalEmbeddingsTest():
    K = 3
    rotary_emb = RotaryPositionalEmbeddings()
    R = rotary_emb.rotary_matrix(tf.pow(K,2),n_embd)
    fig, ax = plt.subplots(K, K, figsize=(K * 3, K * 4))

    for i in range(K):
        for j in range(K):
            ax[i, j].imshow(R[i * K + j, :, :])
            ax[i, j].set_title(f'rotation at {i * K + j}')
    # plt.show()
    plt.savefig("rotraryembeddings.png")

if __name__ == "__main__":
    rotaryPositionalEmbeddingsTest()

{% endhighlight %}

# RoPE

{% highlight python %}

import tensorflow as tf
import numpy as np

class RotaryPositionalEmbeddings(tf.keras.Model):

    def __init__(self):
        super(RotaryPositionalEmbeddings, self).__init__()

    def rotary_matrix( self,block_size, embedding_dim):
        R = tf.Variable(tf.zeros((block_size, embedding_dim, embedding_dim)))
        i = tf.constant(0)
        p_i = tf.constant(0)
        neg_2 = tf.constant(-2)
        emb = lambda i, d: tf.less(i, int(tf.divide(embedding_dim , 2) - 1))
        p = lambda p_i, d: tf.less(p_i, block_size )
        print(int(tf.divide(embedding_dim , 2)))
        def position(p_i, p_idx):
            def embedding(i, idx):
                theta = tf.pow(10000. , tf.divide(tf.multiply(neg_2 , tf.subtract(i , 1)) , embedding_dim))
                m_theta = tf.multiply(tf.cast(p_i,tf.float32) , tf.cast(theta,tf.float32))
                R[p_i, tf.multiply(2, i),tf.multiply(2, i)].assign(tf.cos(m_theta))
                # print(i, p_i, tf.multiply(2, i), tf.multiply(2, tf.add(i , 1)))
                R[p_i, tf.multiply(2, i), tf.multiply(2, tf.add(i , 1))].assign(- tf.sin(m_theta))
                R[p_i, tf.multiply(2, tf.add(i , 1)), tf.multiply(2, i)].assign(tf.sin(m_theta))
                R[p_i, tf.multiply(2, tf.add(i , 1)), tf.multiply(2, tf.add(i , 1))].assign(tf.cos(m_theta))

                return tf.add(i, 1), idx

            _, idx = tf.while_loop(emb, embedding, loop_vars=[i, embedding_dim])
            return tf.add(p_i, 1), p_idx

        _, idx = tf.while_loop(p, position, loop_vars=[p_i, block_size])
        return R
{% endhighlight %}

![image-title-here](../images/rotaryembeddings.png){:class="img-responsive"}

# RoPE Attention

This is one section that exemplifies the lack of diagrams and descriptions. This can be added as more intuition
is gained. But for now the code is [here](https://github.com/mohanr/Llama)

This visualization of attention weights seems to be different from the PyTorch code I was using as reference.
The difference is in terms of the shape of the attention weights. But by slightly changing the indexing mechanism
we can still visualize it. I need to revise this later.

![image-title-here](../images/RoPEAttention.png){:class="img-responsive"}

# Masked RoPE Attention

At this stage one loses count of the shapes and sizes of matrices. It is hard to keep track
of the _ranks_ and _shapes_ as it is not possible to visually inspect them.

But based on the concept of upper and lower triangular matrices we can mask so that data from
newer time steps is not visible because the model is supposed to predict it.

I use _block_size(tf.shape(x)[1]_ for this as the shape of the data is (batch_size, block_size, embedding_dim)

{% highlight python %}

        activations, attn_weights = self.multihead(query=q_out,
                                                   value=v_out,
                                                   key=k_out,
                                                   return_attention_scores=True,
                                                   attention_mask = (1 - tf.linalg.band_part(tf.ones((tf.shape(x)[1],
                                                                                tf.shape(x)[1])), -1, 0)) * -1e9
{% endhighlight %}

Even though the mask seems to work I couldn't debug too deeply.

![image-title-here](../images/maskedRoPEAttention.png){:class="img-responsive"}

The loss after all this effort is shown here.

![image-title-here](../images/illama_loss.png){:class="img-responsive"}

# Stacking multiple blocks

In this final part we segragate these blocks and stack them in the mode.

{% highlight python %}

class Block(tf.keras.Model):
    def __init__(self):
        super().__init__()

        self.rms = RMSNorm([block_size, n_embd])
        self.rope_attention = MaskedRoPEAttention()

        self.net = tf.keras.Sequential(
            layers=[
                tf.keras.layers.Dense(n_embd, input_shape=(None,n_embd), activation=None, use_bias=False),
                # tf.keras.layers.ReLU(),
                SwiGLU(n_embd),
            ]
        )

    def call(self, x):
        x = self.rms(x) # rms pre-normalization
        x = x + self.rope_attention(x)

        x = self.rms(x) # rms pre-normalization
        x = x + self.net(x)
        return x

{% endhighlight %}

There are now 4 of them stacked like this.

{% highlight python %}

    def __init__(self):
        super().__init__()
        self.token_embedding_table = Embedding(vocab_size,n_embd)
        layers = [Block() for _ in range(num_layers)]
        self.llama_blocks = tf.keras.Sequential(
            layers
        )
        self.net = tf.keras.Sequential(
            layers=[
                tf.keras.layers.Dense(n_embd, input_shape=(None,n_embd), activation=None, use_bias=False),
                # tf.keras.layers.ReLU(),
                SwiGLU(n_embd),
                tf.keras.layers.Dense(vocab_size, input_shape=(n_embd,), activation=None, use_bias=False),
            ]
        )

    def call(self,idx,targets=None):
        x = self.token_embedding_table(idx)

        x = self.llama_blocks(x)
        logits = self.net(x)

{% endhighlight %}

# Hyper-parameter tuning

This is a separate task that is pending. We need GPUs and more training epochs But the Llama Transformer architecture itself works now.

The final losses are worse than before. Moreover the test generated after this minimal training is gibberish and is not even as good as
the text from a general GPT model with a similar architecture.

![image-title-here](../images/illama_finalloss.png){:class="img-responsive"}

_References_

1. https://blog.briankitano.com/llama-from-scratch/
2. https://nn.labml.ai/transformers/rope/index.html


text:
Timelines of Museums' African Collections and the Trans-Atlantic Slave Trade
============================================================================
> Visualizing the correlation between museums' African collections and the Trans-Atlantic Slave Trade

![A screenshot of the visualization. The top half is a bar graph showing the volume of enslaved people that were removed from the African continent by year. The bottom half shows the years object were created that are from the African collections of 5 different art museums.](/african-coll-tast.jpg)

What's the correlation between the Trans-Atlantic Slave Trade and the
items in museums' African collections? This is a visualization putting
these two pieces of data together, using publicly available museums
data from a handful of museums.

All museum data has been aggregated and anonymized in [`data/collection.csv`](data/collection.csv).
Trans-Atlantic Slave Trade data provided by [slavevoyages.org](http://www.slavevoyages.org/voyage/download)

## Getting Started

All the anonymized musuem data is in a single CSV in [`data/collection.csv`](data/collection.csv). It's a two column file in the format:

| Year | Number of object |
|------|------------------|
| -100 | 5                |
| 15   | 5                |
| 1993 | 5                |

To use your own museum's data, create a CSV formatted the same way and replace this file with yours. The visualization will render showing your data in the bottom half.

## About

Prepared for a demonstration at Museums and the Web 2016


text:
# Prerequisites
This document describes the prerequisites for a Gitpod installation. Upon completing the steps described herein,
you will have everything in place to successfully finish the installation.

## Kubernetes
Gitpod runs on Kubernetes where Gitpod workspaces are Kubernetes pods. Gitpod is installed on Kubernetes using Helm.
Gitpod requires **Kubernetes 1.13** or newer.

## Domain
Gitpod requires a domain resolvable by some nameserver (typically a public domain name, e.g. `your-domain.com`).
As Gitpod launches services and workspaces on additional subdomains it also needs two wildcard domains.
For example:

    your-domain.com
    *.your-domain.com
    *.ws.your-domain.com

Installing Gitpod on a subdomain works as well. For example:

    gitpod.your-domain.com
    *.gitpod.your-domain.com
    *.gitpod.ws.your-domain.com`

## User Authorization and Git Integration
Gitpod does not implement user authentication itself, but integrates with other auth provider using [OAuth2](https://oauth.net/2/).
Usually your Git hosting solution (e.g. GitHub or GitLab) acts as OAuth auth provider. This way we control access to Gitpod while at
the same time making sure every user has proper access to their Git repository.

Gitpod supports the following authentication providers:
* github.com
* GitHub Enterprise in version 2.16.x and higher
* gitlab.com
* GitLab Community Edition in version 11.7.x and higher
* GitLab Enterprise Edition in version 11.7.x and higher
* Bitbucket — coming soon
* Custom Auth Provider – Inquiry TypeFox for a quote

## HTTPS certificates (Optional)
While we highly recommend operating Gitpod using HTTPS, Gitpod is able to run on insecure HTTP.
The caveat of using HTTP is that the builtin Docker registry will not function as Docker/containerd do not pull from insecure registries by default.
You can either resort to using an [external registry](#docker-registry-optional) or use HTTPS. For running Gitpod on insecure HTTP, no HTTPS certificates are needed and you can skip this section.

The most accessible means of obtaining HTTPS certificates is using [Let's Encrypt](https://letsencrypt.org/) which provides free certificats to anybody who can prove ownership of a domain.
Gitpod requires [wildcard certificates](https://en.wikipedia.org/wiki/Wildcard_certificate) (e.g. `*.ws.your-domain.com`) which [can be obtained via Let's Encrypt](https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578) but require [proof of ownership via DNS](https://letsencrypt.org/docs/challenge-types/#dns-01-challenge).
There is a [plethora of tutorials](https://www.google.com/search?q=letsencrypt+wildcard) how to [generate wildcard certificates](https://medium.com/@saurabh6790/generate-wildcard-ssl-certificate-using-lets-encrypt-certbot-273e432794d7) using Let's Encrypt.
Things get considerably easier when your domain is registered with a service for which a [Certbot DNS plugin exists](https://certbot.eff.org/docs/using.html#dns-plugins).

See [here](../https-certs/) for more details on how the certificates are used during installation.

## MySQL Database (Optional)
Gitpod uses a MySQL database to store user data. By default Gitpod ships with a MySQL database built-in. If you operate your own MySQL database (which we'd recommend in a production setting) you can use that one. You have the following options:

* Integrated database: If not disabled, this MySQL database is installed in a Kubernetes pod as a part of Gitpod’s Helm chart.
The database uses a Kubernetes PersistentVolume. We do not recommend using this option fo a production setting.

* Own MySQL database: Gitpod requires MySQL in version 5.7 or newer.

## Docker Registry (Optional)
Gitpod builds Docker images during workspace startup. This enables custom Dockerfiles as part of your workspace config, but is also required for Gitpod itself to function.
To this end, Gitpod requires a container registry where it can push the images it builds.

By default Gitpod ships with a built-in Docker registry. If you operate your own Docker registry (which we'd recommend in a production setting) you can use that one. You have the following options:

* Integrated docker registry: If not disabled, this docker registry is installed in a Kubernetes Pod as a dependency of Gitpod’s Helm chart.
  The docker registry requires a Kubernetes PersistentVolume. This registry is not recommended to be used for production.
* Own docker registry: Gitpod can connect to your own docker registry. Compared to its built-in counterpart this enables performance gains and access to otherwise private images.

## Bucket Storage (Optional)
Gitpod uses bucket storage to persist the contents of workspaces. Each workspace tarballed into a single archive file which is then uploaded to the bucket.

By default Gitpod ships with [MinIO](https://min.io/) as built-in bucket storage. If you operate your own MinIO instance, or have access to Google Cloud Bucket storage you can use that one. You have the following options:

* Integrated MinIO: If not disabled, Gitpod installs MinIO in Kubernetes as a dependency of Gitpod’s helm charts.
  MinIO itself can serve as [gateway](https://github.com/minio/minio/tree/master/docs/gateway) to other storage providers.
  When storing the data itself, MinIO relies on a [persistent volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) which in turn supports a [wide range of storage backends](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes).
* Own storage buckets: Gitpod can be configured to connect to your own installation of MinIO or Google Cloud Storage compatible storage solution.

repository: myrelk/website

repo_name: myrelk/website


text:
# CSS Code Review 3

####By: Lorenzo Ferrario

##Description

CSS-Code review 2 is a fully responsive website entirely made using only HTML and CSS.

I made a blog to demonstrate proficiency with Sass.

[Original Assignment](https://www.learnhowtoprogram.com/css/sass/sass-code-review)

##Installation
1. Clone this repository or download it in a .zip file
2. Open index.html in a browser of you choice
3. A live version is available [here](http://spawner999.github.io/CSS-Blog/)

## Technologies Used
* HTML
* CSS
* Sass

## Credits
* Milan Night Blog

##License
MIT License. Copyright (c) 2016 Lorenzo Ferrario


text:
score-language (Slang)
==============

Slang is a YAML based language for writing human-readable workflows for score. This project includes the CLI to trigger flows.

[![Build Status](https://travis-ci.org/openscore/score-language.svg)](https://travis-ci.org/openscore/score-language)

#### Getting started:

###### Pre-Requisite: Java JRE >= 7

1. Download the slang zip from [here](https://github.com/openscore/score-language/releases/download/slang-CLI-v0.2.1/score-lang-cli.zip).
2. Unzip it.
3. Go to the folder /slang/appassembler/bin/
4. Run the executable :
  - For Windows : slang.bat
  - For Linux : bash slang
5. Run the Docker example flow:  run --f ../content/org/openscore/slang/docker/containers/demo_dev_ops.sl  --cp ../content/  --inputs dockerHost=[*dockerHost*],dockerUsername=[*dockerHostUser*],dockerPassword=[*dockerHostPasword*],emailHost=[*emailHost*],emailPort=[*Emailport*],emailSender=[*EmailSender*],emailRecipient=[*EmailRecipient*]

#### Documentation :

All documentation is available on the [openscore website](http://www.openscore.io/#/docs).

#### Get Involved

Contact us at [here](mailto:support@openscore.io).

#### Building and Testing from Source

###### Pre-Requisites:

1. maven version >= 3.0.3
2. Java JDK version >= 7

###### Steps:

1. ```git clone``` the source code
2. ```mvn clean install```
3. Run the CLI executable from score-lang-cli\target\slang\bin

### Another way of getting the score command line interface.
###### score-cli
> The score command line interface.

Install this globally and you'll have access to the `score` command anywhere on your system.

```shell
npm install -g score-cli
```

Now you can just use the `score` command anywhere
```shell
score
```

Refer to [openscore](http://openscore.io) website for more information.

###### Pre-Requisites:
Node.js & Java installed.

score-cli page in the [NPM repository](https://www.npmjs.com/package/score-cli).

repository: dorsha/score-language

gha_language: Java

repo_name: dorsha/score-language


text:
Universal Module Definition
===========================

Using a universal module definition (UMD) with your JavaScript lets you write a library or module that can be used in every environment.  You might be thinking of writing something that is only usable in the browser, but because you used UMD now a node.js developer can use your code as well.  UMD also eliminates the need for global variables that point to other libraries because they are passed into your code.

This library uses a pattern to define a module for multiple systems with the same source file.  In general, it looks like this:

    Header
	Code to make the object
	Footer

Until now, a developer would have to write their own module loading code.  They would copy and paste, then tweak the top few lines of their JavaScript by hand or else just gear their code to a single module system.  Now, those pains are gone.

You should use a tool to create the header and footer.  This same tool should also allow you to update the headers and footers in case you have additional dependencies that are required or maybe allow supporting yet another module system when the tool is updated.  Less work for the developer, more happiness because your tool is more universal.

The project is based off of examples from [UMDjs], which provided a great base and fallback code for testing multiple module systems.  It was revised with the content from this [StackOverflow Post], which showed a concise way to test if objects do what you would expect.

[![Build Status](https://secure.travis-ci.org/fidian/fid-umd.png)](http://travis-ci.org/fidian/fid-umd)

Supported Module Systems
------------------------

* CommonJS - Used by [Node](http://nodejs.org/) (aka node.js), [Narwhal](https://github.com/tlrobinson/narwhal), [Montage](http://montagejs.org/), [curl.js](http://github.com/unscriptable/curl) and more.
* AMD - [RequireJS](http://requirejs.org/), [curl.js](http://github.com/uncriptable/curl) and more.
* YUI - Yahoo! has their own [module loader](http://yuilibrary.com/).
* Globals - Adds to `window` in web browsers.  Adds to the global object for [Rhino](https://developer.mozilla.org/en-US/docs/Rhino).  No dependency resolution, so keep the order correct.

My goal is not to get in the way and to support your choice of module systems.  If another person wants to use your library in their system, you'd ideally have to make no changes to support it.  The world will be a better place.

How Does It Work?
-----------------

What this does is change your existing code ...

    // *** Your JavaScript is here ***

... into a UMD wrapped version.

    // fid-umd {"name":"Unknown"}
    (function (n, r, f) {
        try { module.exports = f(); return; } catch (a) {}
        try { exports[n] = f(); return; } catch (b) {}
        try { return define.amd && define(n, [], f); } catch (c) {}
        try { YUI.add(n, function (Y) { Y[n] = f();}); } catch (d) {}
        try { r[n] = f(); } catch (e) {}
        throw new Error("Unable to export " + n);
    }("Unknown", this, function () {
        // fid-umd end
        // *** Your JavaScript is here ***
        // fid-umd post
    }));
    // fid-umd post-end

Your module is probably not called "Unknown" so let's change that and make it called Awesome.  Also, let's pretend your code needs some other libraries: FakeLibrary and TestingModule.  Change just the first "fid-umd" line to match what you see here ...

    // fid-umd {"name":"Awesome","depends":["FakeLibrary","TestingModule"]}

When you run it again the header will change to look like this.

    // fid-umd {"name":"Awesome","depends":["FakeLibrary","TestingModule"]}
    (function (n, r, f) {
        try { module.exports = f(require("FakeLibrary"), require("TestingModule")); return; } catch (a) {}
        try { exports[n] = f(require("FakeLibrary"), require("TestingModule")); return; } catch (b) {}
        try { return define.amd && define(n, ["FakeLibrary","TestingModule"], f); } catch (c) {}
        try { return YUI.add(n, function (Y) { Y[n] = f(FakeLibrary, TestingModule); }, "", { requires: ["FakeLibrary","TestingModule"] }); } catch (d) {}
        try { r[n] = f(r.FakeLibrary, r.TestingModule); } catch (e) {}
        throw new Error("Unable to export " + n);
    }("Awesome", this, function (FakeLibrary, TestingModule) {
        // fid-umd end

Boy, that gets complicated in a hurry.  Inside your code you will have access to FakeLibrary and TestingModule.  Adding and changing dependencies can be a chore and this tool eliminates the tedium, letting you focus on writing good code.

Configuration Object
--------------------

The configuration object, on the first line of the header, is where your library's name and dependencies are listed.  It can take the following properties, with only `name` being required.  Other properties are shrunk down to consume less space when JSON encoded, so don't be surprised to notice the removal empty `depends` arrays.

### name (string, required)

The `name` property is the only required property and it defines the name of the module you are creating and exporting.  If not set, this defaults to "Undefined", which is a terrible name.  I strongly hope you change it to match what you are really trying to write.

### debug (boolean)

If enabled, a lot of additional `console.log` calls are made to help diagnose why things are not working.  I strongly only enabling this until you fix a dependency problem or do whatever is needed to get the app to load properly, then turn it off and regenerate the UMD header.

### depends (array)

Here is where you specify the modules your code relies upon.  The simplest form is a string, which will use the same name for a module in every environment.

    "depends":["FidUmd"]

For more complex situations, where you may have different ways to include the module depending on the loading system, you might need to use the object form.  The above single string example is identical to this longer form.  During updates, the longer form here will get condensed to the single string version above.

    "depends":[{"commonjs":"FidUmd","name":"FidUmd","requirejs":"FidUmd","root":"FidUmd","yui":"FidUmd"}]

The object form has the following properties.  This next example is exploded and commented JSON.  It won't work as-is in the `fid-umd` heading.

    "depends":[{
        "commonjs":"./fid-umd",  // Filename, perhaps for node.js
        "name":"FidUmd",  // Variable name passed into your code
        "requirejs":"lib/fid-umd",  // Different location for RequireJS
        "root":"asyncLoader('fidUmd')",  // Web browser and Rhino
        "yui":"FidUmdLibrary"  // Example of a weird export for YUI
    }]

Any property that is the same as `name` does not need to be specified.  On updates, those properties are removed because duplication makes the heading line longer.

When there are no dependencies, this property is removed during updates.  Otherwise the values in the array are either shrunk down to the single strings or object versions as described above.

### jslint (boolean)

When enabled (via `true` or `1`), this generates some extra markup so the header and footer will pass validation with the node implementation of [jslint](https://github.com/reid/node-jslint) or [jslint.com](http://jslint.com).  This option condenses down to either the number 1 (enabled) or the property is removed (disabled) during updates.

### global (boolean)

When enabled (via `true` or `1`), this will run the factory function in the global object's context.  This will let you access `window` in browsers without having to use global variables or violating "use strict".  More separation from the global object is better, so this option's default is `false`.

Using the Command Line Version
------------------------------

First, use `npm install -g fid-umd` to install the program on your system.  You may need to run `sudo` to grant root privileges or remove the `-g` flag to install it locally.

From here, just point the program at your JavaScript files.  It's the same command to add it the first time and to update an existing header.

    fid-umd my-javascript-file.js

You can pass multiple files on the command line and they all will get processed.

Using the Library Directly
--------------------------

The FidUmd object is really intended to be called through a single `.update()` method.

    umd = new FidUmd();
    myCode = '// Your JavaScript is here';

    try {
        newCode = umd.update();
    } catch (ex) {
        // Happens when the config is not valid JSON
        console.log('error updating code: ' + ex.toString());
    }

Adding to package.json
----------------------

This repository will run `fid-umd` against itself by using the command `npm run-script umd`.  You can have that happen for your project as well.  First, add the `devDependencies` and then add a `script` entry to your `package.json` config file.

    "devDependencies": {
		... other dependencies ...
		"fid-umd": *
		... more dependencies ...
	},
	"scripts": {
		... your scripts for things ...
		"umd": "grep -rl '// fid-umd' lib/ --include \\*.js | xargs fid-umd"
		... other scripts here ...
	}

Running Tests
-------------

FidUmd is tested with [Travis CI](http://travis-ci.org/fidian/fid-umd) automatically.  You can run them yourselves using `npm test` to run them once or `npm run-script auto` to have the tests run automatically when any files change.  Tests are important!

Additional Reading
------------------

* [Demystifying CommonJS](http://dailyjs.com/2010/10/18/modules/) - Covers common misconceptions and some discussion around CommonJS.
* [Why AMD](http://requirejs.org/docs/whyamd.html) - Explains how CommonJS wasn't geared toward the browser and how RequireJS addresses those limitations.
* [AMD is Better For The Web](http://blog.millermedeiros.com/amd-is-better-for-the-web-than-commonjs-modules/) - Key differences between AMD and CommonJS as module systems.
* [Writing Module JS](http://addyosmani.com/writing-modular-js/) - Great in-depth discussion about module formats and how to load them.
* [AMD is Not the Answer](http://tomdale.net/2012/01/amd-is-not-the-answer/) - Counter argument against AMD.
* [UMDjs] - Static examples of UMD variations.
* [JS Module Boilerplate](https://gist.github.com/wilmoore/3880415) - Another UMD template that shows what loading systems work with it.
* [uRequire](http://urequire.org/) - Remove the UMD boilerplate but add a build step where you target your module for a specific system.

[StackOverflow Post]: http://stackoverflow.com/questions/415160/best-method-of-instantiating-an-xmlhttprequest-object
[UMDjs]: https://github.com/umdjs/umd

repository: jkap/fid-umd

repo_name: jkap/fid-umd


text:
---
layout: post
title: PCA and Face Recognition - Eigen Face
description: "The basics of PCA and its usage in face recognition"
tags: [Computer Vision, Machine Learning, Face Recognition]
categories: [Computer Vision, Machine Learning,Research&Study]
---

 PCA (**Principal component analysis**), just as its name shows, it computes the data set's internal structure, its "principal components".

Considering a set of 2 dimensional data, for one data point, it has 2 dimensions $$x_1$$ and $$x_2$$ . Now we get **n** such data points . What is the relationship between the first dimension $$x_1$$ and the second dimension $$x_2$$ ? We compute the so called **covariance**:

$$
cov(x_1,x_2)=\frac{\displaystyle \sum_{i=1}^n{(x_1^i-\overline{x_1})(x_2^i-\overline{x_2})} }{n-1}
$$

the covariance shows how strong is the relationship between  $$x_1$$ and $$x_2$$. Its logic is the same as **Chebyshev's sum inequality**:

<!-- more -->
$$
a_1>a_2>. . . >a_n   \\
and\\
b_1>b_2>. . . >b_n   \\
then\\
\frac{1}{n}\displaystyle \sum_{k=1}^n{a_k\cdot b_k}\geq(\frac{1}{n}\displaystyle \sum_{k=1}^na_k)(\frac{1}{n}\displaystyle \sum_{k=1}^nb_k)
$$

Which tells us a truth:

**big with big, small with small can result big value;big with small, small with big can result small value.**

So on the other way around, $$cov(x_1,x_2)$$ measures how the data points' $$x_1$$ and $$x_2$$ are related to each other, let's say data point $$P:(x_1^p,x_2^p)$$ , if $$x_1^p-\overline{x_1}$$ is relatively big compared to the other $$x_1s$$ and the same for $$x_2^p$$, then $$(x_1^p-\overline{x_1})(x_2^p-\overline{x_2})$$ will be big, which will be added to the final $$cov$$ value, if $$x_1$$ and $$x_2$$ changes in the same direction, which means when $$x_1$$ gets big, $$x_2$$ also gets big, the $$cov$$ value will be very big. The changing direction of both dimensions are more different to each other, the smaller is the final $$cov$$ value.

We compute $$cov(x_1,x_2)$$,$$cov(x_1,x_1)$$ and $$cov(x_2,x_2)$$, obviously $$cov(x_2,x_1)$$ will be the same as $$cov(x_1,x_2)$$. These 3 values will form a matrix, the so called covariance matrix:

 ![eigen]({{ site.url }}\images\computer_vision\pca\eigen.png)

the dots in the upper right chart means one data point $$(x_1^i,x_2^i)$$

The C matrix is the covariance matrix, lower are its eigen vector and eigen value.

**As we can see from the eigen vector's visualization, if the point dots can form a ellipse, the eigen vectors will be its long and short axis. The corresponding eigen values are their lengths.**

#### Use PCA to recognize faces

Our input:the image of a face

Our training set: face images of different people

Out output: who is this input face?

We consider a face image is a point in high-dimensional space.

The training set of face images will be our point set, just as one dot in the upper chart. **Remember, this face image data set only contains the face images of one person.**

**Training:**

The training process will be calculating this data set's covariance matrix and its eigen vectors and eigen values.For this task we use SVD, assume that we have the data matrix X, after the SVD we get:

$$
X=U\Sigma V^*
$$

What we want is the eigenvalues and eigenvectors of X's covariance matrix:$$XX^T$$

According to the properties of SVD, we get:

$$
XX^T=U\Sigma^2U^T\\
$$

As we know that $$U$$ is an orthogonal matrix, which means $$U^T=U^{-1}$$ , so we get:

$$
XX^TU=U\Sigma^2
$$

Obviously, The vectors in U are the eigenvectors of $$XX^T$$ and the square of the values in $$\Sigma$$ are its eigenvalues.

Practically:

For a image of 100x100, we get a data point in a 10000 dimensional space. Then we can calculate a 10000x10000 covariance matrix. From this matrix we get a 10000 dimensional eigen vector whose eigen value is the biggest of all eigen values.

This 10000 eigen vector is of course also a face image, it is the so called eigen face or basis face. **Eigen face is the computed face image which contains the most important features of this person.**

**Matching/Recognition:**

![recognition]({{ site.url }}\images\computer_vision\pca\recognition.png)


text:
Welcome to [Fitak](http://www.fitak.cz)
=======================================

Fitak is a archiver of Facebook groups. It consits of 2 parts:

- `Back-end`: Fitak saves topics, comments and likes from selected Facebook groups.
- `Front-end`: Fitak is also a search engine. You can search by keywords, author and
	groups. It supports a tagging of topics. If original topic from the Facebook contains [tag1][tag2]...
	in the start, Fitak saves these tags seperatly. After that it is possible to use macro "tag: tag1, tag2"
	in the search query for a filtering. Moreover Fitak generates a tag cloud.

This project has started because students from my college (FIT CTU in Prague) use a lot of Facebook
groups for communication and it was very difficult to follow all the information effectively.

However this project is under [New BSD License](http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22New_BSD_License.22_or_.22Modified_BSD_License.22.29), so feel free to use it for your own website!

Requirements
------------
PHP 5.3 or later and MySQL. It's based on the [Nette Framework](https://github.com/nette/nette).

Installation
------------
- `git clone https://github.com/fitak/fitak.git`
- Create `log` and `tmp` dirs (make them writeable) in the project root folder
- Install Composer and call `composer install` in the project root folder
- Create a database from /sql-structure.sql
- Rename `/app/config/devel_example.neon` to `devel.neon` and edit parameters for your devel DB
- Rename `/app/config/product_example.neon` to `product.neon` and edit parameters for your product DB
- You need a developer account on the Facebook.
- Create a new Facebook application `https://developers.facebook.com/apps`.
- Rename `/app/config/fbparams_example.neon` to `fbparams.neon` and edit Facebook App parametrs. The
	email isn't connected with the Facebook. It's just for warnings if something goes wrong.
- Add some new groups to DB table `groups` (just the first column is mandatory = ID of the Facebook group)
- Data from the selected Facebook groups are downloaded via one active user token. This user must have a
	access to the all selected groups. That should be probably you. You have to generate the new token
	and allow permissions to your Facebook App. Just open URL: `http://YOURURL/crawler/` - It should write
	something like "This is a private party!". That is for a protection. Just you can add the new token.
	Before that you have to add your IP address to DB table `ip`. Refresh `http://YOURURL/crawler/`. It should
	be working now.
- Be aware that this token goes inactive after some time. You must visit this URL repeatedly. If the token
	becomes invalid, it should send you a email automaticly.
- Now open `http://YOURURL/crawler/` again. It should start downloading and processing data from the Facebook.
- You should add this URL to your Cron. :)
- Good Luck!

repository: webservsol/fitak

repo_name: webservsol/fitak


text:
+++
title = "Cross-Origin-Opener-Policy"
description = ""
date = "2020-10-01"
category = [
    "Defense",
]
menu = "main"
+++

Getting access to a website's `window` object is a common prerequisite for different XS-Leak techniques. [Framing Protections]({{< ref "xfo.md" >}}) can ensure that an attacker cannot use iframes to access the `window` object, but this does not stop an attacker from accessing the `window` object from an opened window through `window.open(url)` or `window.opener` references.

Exploiting XS-Leaks with `window.open` is generally seen as the least appealing option for an attacker because the user can see it happen in the open browser window. However, it's usually the right technique when:

- A page sets [Framing Protections]({{< ref "xfo.md" >}}).
- A page sets [Same-Site Cookies with `Lax` Mode]({{< ref "same-site-cookies.md" >}}) (in contrast to the `Strict` mode, navigating a top-level window is allowed by the `Lax` mode).

To prevent other websites from gaining arbitrary window references to a page, applications can deploy Cross-Origin-Opener-Policy (COOP) [^1] [^2].

There are three possible values for the COOP header:

* `unsafe-none` – This is the default value and is how websites behave if no value is set.
* `same-origin` – This is the strictest value. If you set `same-origin`, then cross-origin websites cannot get access to your `window` object through opening new windows. If your application relies on using `window.open` to open another website and communicate with it, this will be blocked by `same-origin`. If this is an issue, set `same-origin-allow-popups` instead.
* `same-origin-allow-popups` – This value allows your website to use `window.open`, but does not allow other websites to use `window.open` against your application.

If possible, it is recommended to set `same-origin`. If you set `same-origin-allow-popups`, be sure to review what websites you open with `window.open` and ensure that they are trusted.

## Considerations

Since COOP is an opt-in mechanism and a very recent one, it can easily be overlooked by developers and security engineers. Nonetheless, it’s important to highlight the importance of this defense mechanism as it is the only way to prevent attackers from exploiting XS-Leaks which make use of window references returned by APIs like `window.open` (unless SameSite Cookies in the `Strict` mode can be widely deployed).

## Deployment

Check out this [web.dev](https://web.dev/why-coop-coep/) article to learn more about the advantages of this protection and how to deploy it.

## References

[^1]: Cross-Origin-Opener-Policy response header (also known as COOP), [link](https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e)
[^2]: Cross-Origin-Opener-Policy, [link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)

repository: Brasco/wiki

repo_name: Brasco/wiki