text:
# ThreadPool

A C++20 thread pool implementation. Creates a pool of threads that will execute tasks added to the queue. A task can be any callable object (eg. function, lambda, function object). The queue is a FIFO (First in, First Out), so tasks will be processed in the same order that they are added. When the ThreadPool is destroyed, it will block until all remaining tasks in the queue have finished processing.

## Installation

The entire library is contained within the `ThreadPool.h` file. On \*nix systems, run `make install` from the ThreadPool directory to install the header file to `/usr/local/include`. On other systems, you can manually install the header file to the necessary directory.
Then add the following to any code that needs to use the ThreadPool:

```c++
#include <ThreadPool.h>
```

## Examples

### Basic usage

The most basic usage is to create a ThreadPool object and send it a task to run. The destructor of the ThreadPool will ensure that the task is finished before the object is destroyed.

```c++
#include <iostream>
#include <ThreadPool.h>

int main(int argc, char *argv[]) {
   // Create a thread pool of 4 threads
   threadpool::ThreadPool tp(4);

   // Add a task to the queue
   tp.addJob([]() { std::cout << "Hello!" << std::endl; });
}
```

Output:

```
Hello!
```

### Multiple tasks

You can add any number of tasks to the queue.

```c++
#include <iostream>
#include <ThreadPool.h>

int main(int argc, char *argv[]) {
   threadpool::ThreadPool tp(3);

   for (int i = 0; i < 5; ++i) {
      tp.addJob([]() {
         std::cout << "Hello from " << std::this_thread::get_id() << std::endl;
      });
   }
}
```

Output:

```
Hello from 7fa71134f700
Hello from Hello from 7fa71134f700
7fa710b4e700
Hello from 7fa711b50700
Hello from 7fa71134f700
Hello from 7fa711b50700
```

While this example does work, it's probably not what we want. Remember to use something like a mutex to synchronise threads when necessary:

```c++
#include <iostream>
#include <mutex>
#include <ThreadPool.h>

int main(int argc, char *argv[]) {
   threadpool::ThreadPool tp(3);
   std::mutex             mtx;

   for (int i = 0; i < 5; ++i) {
      tp.addJob([&mtx]() {
         std::scoped_lock lk(mtx);
         std::cout << "Hello from " << std::this_thread::get_id() << std::endl;
      });
   }
}
```

Output:

```
Hello from<PHONE_NUMBER>89280
Hello from<PHONE_NUMBER>96576
Hello from<PHONE_NUMBER>81984
Hello from<PHONE_NUMBER>89280
Hello from<PHONE_NUMBER>96576
```

### Passing arguments

For tasks that require arguments, you can pass these to `addJob` as well:

```c++
#include <iostream>
#include <mutex>
#include <ThreadPool.h>

int main(int argc, char *argv[]) {
   threadpool::ThreadPool tp(3);
   std::mutex             mtx;

   auto fn = [&mtx](int val) {
      std::scoped_lock lk(mtx);
      std::cout << "You passed " << val << std::endl;
   };

   for (int i = 0; i < 5; ++i) {
      tp.addJob(fn, i);
   }
}
```

Output:

```
You passed 0
You passed 1
You passed 2
You passed 3
You passed 4
```

### Return value

If you want to access the return value of a task (or simply check if a task has finished), `addJob` will return a `std::future` that you can use for this purpose.

```c++
#include <iostream>
#include <ThreadPool.h>

int main(int argc, char *argv[]) {
   threadpool::ThreadPool tp(4);

   auto res = tp.addJob([](int val) { return val * 2; }, 12);

   std::cout << res.get() << std::endl;
}
```

Output:

```
24
```

### Callable

The ThreadPool can work with any callable type in C++.

```c++
#include <iostream>
#include <ThreadPool.h>

int increment(int a) { return a + 1; }

class MyClass {
  private:
   int val;

  public:
   MyClass(int val) : val(val) {}
   int operator()() const { return val / 2; }
   int multiply(int v) { return v * val; }
};

int main(int argc, char *argv[]) {
   threadpool::ThreadPool tp(4);

   // A free function
   auto res1 = tp.addJob(increment, 6);
   std::cout << res1.get() << std::endl;

   // A lambda
   auto res2 = tp.addJob([](int a) { return a - 1; }, 6);
   std::cout << res2.get() << std::endl;

   // A function object
   MyClass fo(6);
   auto    res3 = tp.addJob(fo);
   std::cout << res3.get() << std::endl;

   // A member function
   auto res4 = tp.addJob(&MyClass::multiply, &fo, 2);
   std::cout << res4.get() << std::endl;
}
```

Output:

```
7
5
3
12
```

repository: jbloggz/ThreadPool

repo_name: jbloggz/ThreadPool


text:
# locale-textdomain

Gettext-Runtime for JavaScript

* `npm run build` - produces production version of your library under the `lib` folder
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test` - well ... it runs the tests :)
* `npm run test:watch` - same as above but in a watch mode

# Status

Defunct. Replaced by [esgettext](https://github.com/gflohr/esgettext).

license: MIT

repository: gflohr/locale-textdomain

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: gflohr/locale-textdomain


text:
# Today I Learned

> TIL is an open-source project by the team at
> [Hashrocket](https://hashrocket.com/) that catalogues the sharing &
> accumulation of knowledge as it happens day-to-day. Posts have a 200-word
> limit, and posting is open to any Rocketeer as well as select friends of the
> team. We hope you enjoy learning along with us.

This site was open-sourced as a window into our development process, as well as
to allow people to experiment with the site on their own and contribute to the
project.

### Installation

If you are creating your own version of the site,
[fork](https://help.github.com/articles/fork-a-repo/) the repository.

Then install the [Phoenix
Dependencies](http://www.phoenixframework.org/docs/installation) as well as
PostgreSQL.

Next, follow these setup steps:

```
$ git clone https://github.com/hashrocket/today_i_learned
$ cd today_i_learned
$ mix deps.get
$ mix ecto.create
$ mkdir priv/repo/migrations
$ mix ecto.migrate
$ npm install
$ mix phoenix.server
```

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

### Testing

Install and start Chromedriver:

```
$ brew install chromedriver
$ chromedriver
```

Run the tests with:

```
$ mix text
```

### Contributing

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

Bug reports and pull requests are welcome on GitHub at
https://github.com/hashrocket/today_i_learned. This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

### License

Today I Learned is released under the [MIT License](http://www.opensource.org/licenses/MIT).

---

### About

[![Hashrocket logo](https://hashrocket.com/hashrocket_logo.svg)](https://hashrocket.com)

Today I Learned is supported by the team at [Hashrocket, a
multidisciplinary design and development consultancy](https://hashrocket.com). If you'd like to [work with
us](https://hashrocket.com/contact-us/hire-us) or [join our
team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.

gha_language: Elixir


text:
---
layout: page
permalink: /logistics/
title: Logistics
---

* (The list will be replaced with the table of contents.)
{:toc}

***

### Textbooks and Readings

The lectures in this course were compiled from different sources and naturally there is no single textbook that covers all of the topics we will discuss in this course. The following textbooks are recommended for the course subjects:

- **Introduction to Statistical Machine Learning** by Masashi Sugiyama, 2016.
- **Pattern Recognition and Machine Learning** by Christopher M. Bishop, 2006.
- **Reinforcement Learning: An Introduction** by  R. S. Sutton, A. Barto, 2020.
- **Deep Learning** by Ian Goodfellow, 2016: [Available online](https://www.deeplearningbook.org/)

***

### Prerequisites

- Familiarity with the basic **linear algebra**.
- Familiarity with the basic **probability theory**.
- **asic computer programming** skills and scientific computing.

***

### Assignments

Most of the assignments in this course involve writing computer programs. In a typical assignment, you will implement a machine learning technique from the lecture and use it to solve a sample problem. You will be graded on how well your computer program works. Therefore you should carefully implement, test and debug each program. Remember, just because the compiler gives no error messages, does not mean the program works as it should. In addition to submitting your code, you will typically be required to annotate and comment your program. To make programming, reporting, commenting, plotting and submitting your program easier, we will use **iPython notebooks (Jupyter Notebooks)**. All assignments will be in **Python**.

For longer assignments, you will be given two weeks. You should take advantage of this by spreading out the effort uniformly. It is unlikely that you will be able to complete the assignment the night before it is due.

***

### Python Programming

We will use the Python programming language for all assignments in this course. Python is a great general-purpose programming language on its own, but with the help of a few popular libraries (numpy, scipy, matplotlib) it becomes a powerful environment for scientific computing.

***

### Recitations

Since many of you may not have familiarity with Python and its libraries, we have designed weekly recitations to cover your needs for python knowledge, programming and its integration with machine learning. Some of recitations are designed to teach you how to implement algorithms and theoretical machine learning into programs. We highly recommend you participate in the recitations.

***

### Grading

Course grades will be  **based 50% on homeworks, 20% on the midterm, and 30% on the major term project**. As mentioned earlier, up to  **5% extra credit** will be given for the pop-up quizzes during the course.

#### Grading Scale

90%-100% = A
80%-90%	= B
70%-80%	= C
60%-70%	= D
0%-60%	= R

***

### Submission Procedures

- Submission procedure is explained for each assignment on its first page. If you want to take photos of your assignment, just make sure that combine all the jpg into a single pdf file and make it clear.  Unorganized and illegible submissions will be penalized. Take care in arranging your illustrations, written solutions, photos.
- Only submit the required files that you edit. All other files, including the ones we provide as supporting functionality, are unnecessary because we already have copies of them. Unless we tell you otherwise, make sure that you only submit the file you edited/changed.
- Do not scan the your hand-written solutions in the highest resolution. Downloading 200MB worth of scanned files from Canvas is utterly unnecessary and counterproductive. Exercise good judgment. You can set the resolution when scanning. Make sure your submission zip file is less than 20MB. That's enough for all the assignments.
- Name your files logically and clearly. Add a readme.txt with your submissions. It's hard to open each ill-named file one by one and find your solution.
- A failure to comply with these procedures will result in grade penalties that will be proportional to the severity of your non-compliance.

***

### Late Submission Policy

Assignments are expected to be completed by due date. Assignments submitted 4 days after the due date will not be accepted.  each student will have a total of **seven free late (calendar) days** to use as s/he sees fit. Once these late days are exhausted, any homework turned in late will be **penalized 20% per late day**. However, no homework will be accepted more than four days after its due date, and late days cannot be used for the final project writeup. **Each 24 hours or part thereof that a homework is late uses up one full late day**.

***

### Final Project

The project can be related to your research area (if you have one). However, do not submit anything you have completed prior to attending the course. You also should not submit a project that is largely a collaborative effort with people outside the course. For example, if your research involves other people in a larger project, you could propose to address a slightly different question in the same area (still related to your research) but one that you are pursuing alone or in collaboration with other students taking the course.

You can and are encouraged to collaborate with other students. If you do, we ask that you outline the role of each person in the project. Projects involving more than one person have to scale in 'size' with the number of people.

#### Proposal

For the final project, each group or student need to submit a proposal. The project proposal should be one paragraph (200-400 words). If you work on your own project, your proposal should contain:

*What is the problem that you will be investigating? Why is it interesting? What method or algorithm are you proposing? If there are existing implementations, will you use them and how? How do you plan to improve or modify such implementations? What data will you use? If you are collecting new datasets, how do you plan to collect them? What reading will you examine to provide context and background? How will you evaluate your results? Qualitatively, what kind of results do you expect (e.g. plots or figures)? Quantitatively, what kind of analysis will you use to evaluate and/or compare your results (e.g. what performance metrics or statistical tests)?*

#### Poster

Each student or group required to present their final project in a poster form. A public poster session will be held at the end of semester and students will present their works. TAs will evaluate the quality, novelty and the size of the project and its presentation quality.

#### Final Report

Your final write-up is required to be between 6 - 8 pages using the provided template (We will provide the template via Canvas). Please use this template so we can fairly judge all student projects without worrying about altered font sizes, margins, etc. Submit your final submission through Canvas.

***

### Course Logistics

- We will be using **Canvas** for the **announcements, assignments, lecture notes, recitation files, and grading**.
- Students should use **Piazza** for **posting queries and finding team members for projects**.
- You are encouraged to resolve your doubts and queries in the **Office hours**.
- You are encouraged to check the Announcement section in Canvas periodically to avoid missing out.
- Office hours are spread across the week to better accommodate different schedules of all enrolled students, but let us know if you have any issues with the timings.
- Polls will be taken on a regular basis to collect class feedback on lectures and recitations.

***

### Accommodations for Students with Disabilities

If you have a disability and are registered with the Office of Disability Resources, I encourage you to use their online system to notify me of your accommodations and discuss your needs with me as early in the semester as possible. I will work with you to ensure that accommodations are provided as appropriate. If you suspect that you may have a disability and would benefit from accommodations but are not yet registered with the Office of Disability Resources, I encourage you to contact them at [access@andrew.cmu.edu](mailto:access@andrew.cmu.edu).

***

### Statement of Support for Students’ Health and Well-being

Take care of yourself. Do your best to maintain a healthy lifestyle this semester by eating well, exercising, avoiding drugs and alcohol, getting enough sleep and taking some time to relax. This will help you achieve your goals and cope with stress.

If you or anyone you know experiences any academic stress, difficult life events, or feelings like anxiety or depression, we strongly encourage you to seek support. Counseling and Psychological Services (CaPS) is here to help: **call<PHONE_NUMBER>** and visit [http://www.cmu.edu/counseling/](http://www.cmu.edu/counseling/). Consider reaching out to a friend, faculty or family member you trust for help getting connected to the support that can help.

***


text:
# Roost

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
[![Maintainability](https://api.codeclimate.com/v1/badges/d27492e9817263c1e9b3/maintainability)](https://codeclimate.com/github/Flockingbird/roost/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/d27492e9817263c1e9b3/test_coverage)](https://codeclimate.com/github/Flockingbird/roost/test_coverage)

[Flockingbird](https://flockingbird.social) is a professional social network,
where you manage your business network. Decentralised, and privacy friendly.

*Roost* is the Proof of Concept server and webapp for Flockingbird.

More information:

* [Landing page](https://flockingbird.social) to be expanded homepage
* [Blog](https://fediverse.blog/~/Flockingbird/) updates with progress, concepts and explanations
* [Mastodon](https://fosstodon.org/@flockingbird) updates with newsflashes and feedback

## Contribute

If you want to help, the easiest and most effective thing to do is tell
others about us: spread the word!

Other than that, any help is welcome. From giving unsolicited advice,
via designing mockups, via improving this README, to writing code.

### Designs and Mockups

We are moving the designs from [our Figma](https://www.figma.com/file/CgDIaLgjwVLPzw1ggmrZzy/Flockingbird) to
the Open Source alternative [Penpot](https://penpot.app/). Please drop us an
email at<EMAIL_ADDRESS>if you want to be added as team member
on the Flockingbird team in penpot.

Anyone can [view the designs (WIP) on penpot](https://design.penpot.app/#/view/f0afd050-8431-11eb-9126-57893f4da933/f0aff760-8431-11eb-9126-57893f4da933?token=TJpT2QZ1wODw6KLDzLLUKw&index=0)

### Ideas

Ideas are most welcome! Either add a [new
RFC](https://github.com/Flockingbird/roost/issues/new?assignees=&labels=rfc&template=rfc.md&title=RFC+%5Bdescription%5D)
or drop us a mail at hi@flockingbird or a toot at<EMAIL_ADDRESS>
### Tasks and code

We are creating a list of tasks for various interests, and skills in
our issues (helping with this list is most welcome too!)

Use the labels to find something that fits for you. For example [tasks for frontend developers](https://github.com/Flockingbird/roost/issues?q=is%3Aissue+is%3Aopen+label%3Afrontend).

## Get started

Ensure you have Postgres and Ruby 2.3 or higher installed, then run the setup script:

```sh
make install
```

## Using the Application

Start the web server and processors (reactors and projectors):

```sh
make run
```

## Develop

We use [envent_sourcery](https://github.com/envato/event_sourcery) by
Envato. If unsure "where something goes", just ask, or read up on event
sourcing starting at event_sourcery README.

Make sure to add tests for any feature or bugfix.

Test with
```sh
make
```

This also enforces some code style guidelines once the tests pass.

repository: Flockingbird/roost

branch_name: refs/heads/develop

gha_language: Ruby

gha_license_id: MIT

repo_name: Flockingbird/roost


text:
---
layout: default
---

# 1997-11-22 - The Subliminal Algebra-Seinfield Conspiracy

## Header Data

From: TruthMonger<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: a966ea69cb7e5f648d82652ac0d0912dc5782578b307b9703692c11c2d89bd12

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-11-22 05:52:55 UTC

Raw Date: Sat, 22 Nov 1997 13:52:55 +0800

## Raw message

```
{% raw  %}From: TruthMonger<EMAIL_ADDRESS>Date: Sat, 22 Nov 1997 13:52:55 +0800
To<EMAIL_ADDRESS>Subject: The Subliminal Algebra-Seinfield Conspiracy
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Is it a mere coincidence that algebra.com went down and proceeded to
send out all received messages in reverse order on the _same_day_
that the Seinfield TV show featured a reverse-order-plot show?

Picking up a little corporate spare-change, Igor?

JerryMonger

{% endraw %}
```

## Thread

+ Return to [November 1997](/archive/1997/11)

+ Return to<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)](/authors/dlv_at_bwalk_dm_com_dr_dimitri_vulis_kotm_)"
+ Return to "[TruthMonger <tm@dev.null>](/authors/truthmonger_tm_at_dev_null_)"

+ 1997-11-22 (Sat, 22 Nov 1997 13:52:55 +0800) - The Subliminal Algebra-Seinfield Conspiracy - _TruthMonger<EMAIL_ADDRESS>  + 1997-11-22 (Sun, 23 Nov 1997 01:56:14 +0800) - [Re: The Subliminal Algebra-Seinfield Conspiracy](/archive/1997/11/421989736e753236ec0220cd4b1db6f7dbf30474662bcc200e1fe13343a3afd0) -<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)_


text:
Awesome LaTeX drawing
============

[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![repo size](https://img.shields.io/github/repo-size/xinychen/awesome-latex-drawing.svg)](https://github.com/xinychen/awesome-latex-drawing/archive/master.zip)
[![GitHub stars](https://img.shields.io/github/stars/xinychen/awesome-latex-drawing.svg?logo=github&label=Stars&logoColor=white)](https://github.com/xinychen/awesome-latex-drawing)

Made by Xinyu Chen • :globe_with_meridians: https://xinychen.github.io

**awesome-latex-drawing** is a collection of **20+** academic drawing examples for using LaTeX, including Bayesian networks, function plotting, graphical models, tensor structure, and technical frameworks. [[**Blog post** on Medium](https://medium.com/p/e07916b2c860)]

## Description

LaTeX is a high-quality typesetting system, and it is available as a free software. In recent years, it is very popular for creating and drawing academic graphics via LaTeX. This is because that LaTeX is able to draw many complicated graphics containing special symbols and math equations. It is really good for using LaTeX to draw certain graphics in your research.This project introduces some graphics that created by using LaTeX. It would be easy to follow the examples with a popular online LaTeX system - Overleaf. If you are interested, welcome to use Overleaf and reproduce our examples. The Overleaf is available at [overleaf.com](https://www.overleaf.com/), please feel free to try it.

## Contents

### Table of Examples

- **Bayesian networks**
  - [x] [Bayesian network of Bayesian CP factorization (BCPF)](https://github.com/xinychen/awesome-latex-drawing#example-1)
  - [x] [Bayesian network of Bayesian Gaussian CP (BGCP) factorization](https://github.com/xinychen/awesome-latex-drawing#example-2)
  - [x] [Bayesian network of Bayesian augmented tensor factorization (BATF)](https://github.com/xinychen/awesome-latex-drawing#example-3)
  - [x] [Bayesian network of Bayesian temporal matrix factorization (BTMF)](https://github.com/xinychen/awesome-latex-drawing#example-4)

- **Graphical models**
  - [x] [Partially observed time series matrix and tensor](https://github.com/xinychen/awesome-latex-drawing#example-5)
  - [x] [Matrix and tensor time series prediction in the presence of missing values](https://github.com/xinychen/awesome-latex-drawing#example-6)
  - [x] [Undirected and circulant graphs on the relational data samples with certain degrees](https://github.com/xinychen/awesome-latex-drawing#example-7)
  - [x] [Laplacian convolutional time series modeling](https://github.com/xinychen/awesome-latex-drawing#example-8)

- **`pgfplots` function plotting**
  - [x] [PDF and CDF functions of Erlang distribution](https://github.com/xinychen/awesome-latex-drawing#example-9)
  - [x] [PDF of normal distribution with different means and variances](https://github.com/xinychen/awesome-latex-drawing#example-10)
  - [x] [(Joint) PDF functions of Lognormal distributions](https://github.com/xinychen/awesome-latex-drawing#example-11)
  - [x] [Iterative process of conjugate gradient for solving a system of linear equations](https://github.com/xinychen/awesome-latex-drawing#example-12)
  - [x] [Random and non-random missing patterns](https://github.com/xinychen/awesome-latex-drawing#example-13)
  - [x] [Sine and Cosine functions](https://github.com/xinychen/awesome-latex-drawing#example-14)
  - [x] [Mechanism of time series forecasting](https://github.com/xinychen/awesome-latex-drawing#example-15)

- **`tikz` for matrix structure**
  - [x] [Graphical illustration of the multivariate time series forecasting problem](https://github.com/xinychen/awesome-latex-drawing#example-16)
  - [x] [Graphical illustration of the temporal matrix factorization](https://github.com/xinychen/awesome-latex-drawing#example-17)
  - [x] [Graphical illustration of the rolling time series forecasting with temporal matrix factorization](https://github.com/xinychen/awesome-latex-drawing#example-18)

- **`tikz-3dplot` for tensor structure**
  - [x] [Graphical illustration for the (origin, destination, time slot) tensor](https://github.com/xinychen/awesome-latex-drawing#example-19)
  - [x] [Graphical illustration of the classical CP tensor factorization on a third-order tensor](https://github.com/xinychen/awesome-latex-drawing#example-20)
  - [x] [Graphical illustration of augmented tensor factorization (AuTF) model](https://github.com/xinychen/awesome-latex-drawing#example-21)
  - [x] [Graphical illustration of tensor completion task and its framework](https://github.com/xinychen/awesome-latex-drawing#example-22)
  - [x] [Graphical illustration of low-rank autoregressive tensor completion model](https://github.com/xinychen/awesome-latex-drawing#example-23)
  - [x] [Graphical illustration of singular value thresholding process of the tensor data with unitary transform](https://github.com/xinychen/awesome-latex-drawing#example-24)
  - [x] [Graphical illustration of low-rank tensor completion model](https://github.com/xinychen/awesome-latex-drawing#example-25)
  - [x] [Graphical illustration of low-rank tensor regression model](https://github.com/xinychen/awesome-latex-drawing#example-26)

Usage
--------------

Open [**overleaf.com**](https://www.overleaf.com/) in your Chrome.

> It is not necessary to open each file in this repository because you can just follow this readme document.

## Gallery

Looking for some good LaTeX drawing examples? Here are 30+ graphics for showing how to draw in LaTaX.

### Bayesian Networks

LaTeX provides some powerful domain-specific packages and tools like `tikz` to enable flexible graphical models. Bayesian networks represent a family of graphical models consisting of variables (usually denoted by nodes) and dependency relationships (usually denoted by arrows). Fortunately, `tikz` has a specific library for drawing Bayesian networks and directed factor graphs.

> Another toolbox in Python: [https://docs.daft-pgm.org/en/latest/](https://docs.daft-pgm.org/en/latest/)

#### Bayesian Tensor Factorization

##### [Example 1]

This example is from the following paper:

> - Qibin Zhao, Liqing Zhang, Andrzej Cichocki (2015). [Bayesian CP factorization of incomplete tensors with automatic rank determination](https://doi.org/10.1109/TPAMI.2015.2392756). IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(9): 1751-1763.

which shows the Bayesian network of Bayesian CP factorization (BCPF) model. To draw this Bayesian network example, there are some preliminaries to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`, e.g., `\documentclass[border = 0.1cm]{standalone}` with 0.1cm border,
  2. use the package `tikz`, i.e., `\usepackage{tikz}`, and use `tikz` library like `\usetikzlibrary{bayesnet}` which is an important tool for drawing Bayesian networks and directed factor graphs,
  3. set the `tikz` style by using the `\tikzstyle{}` command,
  4. use math equation environments including `\usepackage{amsfonts, amsmath, amssymb}`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the Bayesian network,
  3. use `\path` to define arrows in the Bayesian network,
  4. use `\plate` to define plates in the Bayesian network.

> Please click on the image and check out the source code.

- Open [BGCP.tex](https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/BGCP.tex) in your overleaf project, then you will see the following pictures about BGCP (Bayesian Gaussian CP decomposition) model as a Bayesian network and a directed factor graph:

##### [Example 2]

This example is from the following paper:

> Xinyu Chen, Zhaocheng He, Lijun Sun (2019). [A Bayesian tensor decomposition approach for spatiotemporal traffic data imputation](https://doi.org/10.1016/j.trc.2018.11.003). Transportation Research Part C: Emerging Technologies, 98: 73-84.

which shows the Bayesian network of Bayesian Gaussian CP factorization (BGCP) model. To draw this Bayesian network example, there are some preliminaries to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`, e.g., `\documentclass[border = 0.1cm]{standalone}` with 0.1cm border,
  2. use the package `tikz`, i.e., `\usepackage{tikz}`, and use `tikz` library like `\usetikzlibrary{bayesnet}` which is an important tool for drawing Bayesian networks and directed factor graph,
  3. set the `tikz` style by using the `\tikzstyle{}` command,
  4. use math equation environments including `\usepackage{amsmath, amsfonts, amssymb}`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the Bayesian network,
  3. use `\path` to define arrows in the Bayesian network,
  4. use `\plate` to define plates in the Bayesian network.

> Please click on the image and check out the source code. If you are interested in the original [Bayesian network of BGCP](BayesNet/BGCP.png) in the paper, please check out [BGCP.tex](https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/BGCP.tex).

##### [Example 3]

This example is from the following paper:

> Xinyu Chen, Zhaocheng He, Yixian Chen, Yuhuan Lu, Jiawei Wang (2019). [Missing traffic data imputation and pattern discovery with a Bayesian augmented tensor factorization model](https://doi.org/10.1016/j.trc.2019.03.003). Transportation Research Part C: Emerging Technologies, 104: 66-77.

which shows the Bayesian network of Bayesian augmented tensor factorization (BATF) model. To draw this Bayesian network example, there are some preliminaries to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`, e.g., `\documentclass[border = 0.1cm]{standalone}` with 0.1cm border,
  2. use the package `tikz`, i.e., `\usepackage{tikz}`, and use `tikz` library like `\usetikzlibrary{bayesnet}` which is an important tool for drawing Bayesian networks and directed factor graph,
  3. set the `tikz` style by using the `\tikzstyle{}` command,
  4. use math equation environments including `\usepackage{amsmath, amsfonts, amssymb}`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the Bayesian network,
  3. use `\path` to define arrows in the Bayesian network,
  4. use `\plate` to define plates in the Bayesian network.

> Please click on the image and check out the source code.

##### [Example 4]

This example is from the following paper:

> Xinyu Chen, Lijun Sun (2021). [Bayesian temporal factorization for multidimensional time series prediction](https://doi.org/10.1109/TPAMI.2021.3066551). IEEE Transactions on Pattern Analysis and Machine Intelligence, 44 (9): 4659-4673.

which shows the Bayesian network of Bayesian temporal matrix factorization (BTMF) model. To draw this Bayesian network example, there are some preliminaries to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`, e.g., `\documentclass[border = 0.1cm]{standalone}` with 0.1cm border,
  2. use the package `tikz`, i.e., `\usepackage{tikz}`, and use `tikz` library like `\usetikzlibrary{bayesnet}` which is an important tool for drawing Bayesian networks and directed factor graph,
  3. set the `tikz` style by using the `\tikzstyle{}` command,
  4. use math equation environments including `\usepackage{amsmath, amsfonts, amssymb}`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the Bayesian network,
  3. use `\path` to define arrows in the Bayesian network,
  4. use `\plate` to define plates in the Bayesian network.

> Please click on the image and check out the source code. Instead of multivariate vector autoregressive process on temporal factors, we can also use univariate autoregressive process to rebuild BTMF. The Beyasian network is available at [btmf_net.png](BayesNet/btmf_net.png), you can also check out the source code [btmf_net.tex](https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/btmf_net.tex).

### Graphical Models

##### [Example 5]

These two examples show the partially observed time series matrix and tensor, respectively. To draw both two examples, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.

- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the graphical model,
  3. use `\path` to define arrows in the graphical model.

##### [Example 6]

These two examples show the time series prediction in the presence of missing values. To draw both two examples, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.

- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes and text boxes in the graphical model,
  3. use `\path` to define arrows in the graphical model.

##### [Example 7]

These two examples show the undirected and circulant graphs on the relational data samples with certain degrees. To draw both two examples, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.

- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\node` to define nodes,
  3. use `\path` to define arrows.

##### [Example 8]

This example is from the following paper:

> Xinyu Chen, Zhanhong Cheng, Nicolas Saunier, Lijun Sun (2022). [Laplacian convolutional representation for traffic time series imputation](https://arxiv.org/abs/2212.01529). arXiv preprint arXiv: 2212.01529.

which gives a graphical illustration of the Laplacian convolutional model for time series imputation. To draw the example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\begin{axis} \end{axis}` and `\addplot` to draw coordinates,
  3. use `\node` and `\path` to draw nodes and arrows.

### `pgfplots` Function Plotting

##### [Example 9]

These two examples show the probability density function (PDF) and cumulative density function (CDF) of Erlang distribution, respectively. To draw the example, there are few steps to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `pgfplots`,
  3. set font style and adjust `\pgfplotsset{}` as you prefer.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\begin{axis} \end{axis}` to draw the function,
  3. use `\addplot` to define the function for drawing.

##### [Example 10]

This example shows the PDF of normal distribution with different means and variances. To draw this example, there are few step to follow:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `pgfplots`,
  3. set font style and adjust `\pgfplotsset{}` as you prefer.
- **`body` codes**:
  1. use `\pgfmathdeclarefunction` to define the PDF function of normal (Gaussian) distribution,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\begin{axis} \end{axis}` to draw the function,
  4. use `\addplot` to define the function for drawing.
- **More posts**:
  1. [Plotting Normal distribution in pgfplots](https://tex.stackexchange.com/questions/100022)
  2. [number format in pgfplots axis](https://tex.stackexchange.com/questions/31276)
  3. [Remove the scientific notation which is unreasonable](https://tex.stackexchange.com/questions/119887)

##### [Example 11]

These two examples show the PDF and joint PDF of Lognormal distributions, respectively. There are some recommended material to follow the examples:

- **More posts**:
  1. [Draw a bivariate normal distribution in TikZ](https://tex.stackexchange.com/questions/31708)
  2. [How can two bivariate normal distributions be plotted in one plot?](https://tex.stackexchange.com/questions/198741)
  3. [Plotting a Bivariate Normal Distribution in Tikz](https://tex.stackexchange.com/questions/236721)
  4. [Split curve with addplot3](https://tex.stackexchange.com/questions/629567)

##### [Example 12]

These two examples show the iterative process of conjugate gradient for solving a system of linear equations.

##### [Example 13]

These two examples show the random and non-random missing patterns. To draw both two examples, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `pgfplots` packages,
  3. use `\begin{filecontents} \end{filecontents}` to contain the data.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\begin{axis} \end{axis}` to draw the function,
  3. use `\addplot` to draw the data.

##### [Example 14]

This example shows four sequences consisting of Sine and Cosine functions. When regarding these sequences as time series, then we can see two kinds of temporal dynamics, that is, one is from Sine function, while another is from Cosine function. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `pgfplots`,
  3. set font style and adjust `\pgfplotsset{}` as you prefer.
- **`body` codes**:
  1. use `\pgfmathdeclarefunction` to define the PDF function of normal (Gaussian) distribution,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\begin{axis} \end{axis}` to draw the function,
  4. use `\addplot` to define the function for drawing.

##### [Example 15]

This example illustrates the mechanism of time series forecasting on streaming data in our [tracebase](https://github.com/xinychen/tracebase) project. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `pgfplots` packages,
  3. set font style and adjust `\pgfplotsset{}` as you prefer.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\begin{axis} \end{axis}` to define the graphic,
  3. use `addplot` to define the marks at some coordinates and specify the color of these marks.

### `tikz` for Matrix Structure

##### [Example 16]

This example gives a graphical illustration of the multivariate time series forecasting problem with missing values. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\draw`, `\filldraw`, and `\node` commands to define rectangles and nodes.

##### [Example 17]

This example gives a graphical illustration of the temporal matrix factorization. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\draw` and `\filldraw` to set nodes and rectangles.

##### [Example 18]

This example gives a graphical illustration of the rolling time series forecasting with temporal matrix factorization. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\draw` and `\filldraw` to set nodes and rectangles.

### `tikz-3dplot` for Tensor Structure

##### [Example 19]

This example gives a graphical illustration of a third-order tensor. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. define the coordinates of the tensor edges,
  4. use `\draw` command to define nodes.

##### [Example 20]

This example gives a graphical illustration of classical CP tensor factorization on a third-order tensor. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. define the coordinates of the tensor edges,
  4. use `\draw` command to define nodes.

##### [Example 21]

This example gives a graphical illustration of augmented tensor factorization model. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. define the coordinates of the tensor edges,
  4. use `\draw` command to define nodes.

##### [Example 22]

This example gives a graphical illustration of tensor completion task and its framework including data organization and tensor completion, in which traffic measurements are partially observed. To draw this example, we can follow these steps:

- **Request**:
  1. upload [curve1.pdf](https://github.com/xinychen/awesome-latex-drawing/blob/master/Framework/curve1.pdf),
  2. upload [curve2.pdf](https://github.com/xinychen/awesome-latex-drawing/blob/master/Framework/curve2.pdf).
- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. define the coordinates of the tensor edges,
  4. use `\draw` command to define nodes.

##### [Example 23]

This example gives a graphical illustration of low-rank autoregressive tensor completion model. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\node`, `\path`, `\plate` commands to define nodes, arrows, and plates,
  4. define the coordinates of the tensor edges,
  5. use `\draw` command to define nodes.

##### [Example 24]

This example gives a graphical illustration of singular value thresholding process of the tensor data with unitary transform. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\node` command to define nodes,
  4. define the coordinates of the tensor edges,
  5. use `\draw` command to define nodes,
  6. use `\filldraw` command to define colors of rectangles.

##### [Example 25]

This example gives a graphical illustration of low-rank tensor completion model. To draw this example, we can follow these steps:

- **Request**:
  1. upload [input_tensor.pdf](https://github.com/xinychen/awesome-latex-drawing/blob/master/Framework/input_tensor.pdf),
  2. upload [output_tensor.pdf](https://github.com/xinychen/awesome-latex-drawing/blob/master/Framework/output_tensor.pdf).
- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages,
  3. use the `algorithm2e` package,
  4. use `\usetikzlibrary{positioning, matrix, fit, calc}`.
- **`body` codes**:
  1. use `\begin{algorithm} \end{algorithm}` environment to define algorithm,
  2. use `\matrix` command to position the components,
  3. use `\begin{scope} \end{scope}` to contain the layers.

##### [Example 26]

This example gives a graphical illustration of low-rank tensor regression model. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use both `tikz` and `tikz-3dplot` packages.
- **`body` codes**:
  1. set `\Depth`, `\Width`, and `\Height` parameters by using `\newcommand`,
  2. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  3. use `\draw` command to define nodes.

### Data Visualization

##### [Example 27]

This example shows the imputation accuracy of some matrix and tensor models. To draw this example, we can follow these steps:

- **`preamble` codes**:
  1. define the `documentclass` as `standalone`,
  2. use the package `tikz`.
- **`body` codes**:
  1. use `\begin{tikzpicture} \end{tikzpicture}` to start drawing,
  2. use `\draw` command to define nodes,
  3. use `\pgfuseimage` command to import images.

Related Projects
--------------

- [tikz-bayesnet](https://github.com/jluttine/tikz-bayesnet)
- [awesome-tikz](https://github.com/xiaohanyu/awesome-tikz)
- [transdim](https://github.com/xinychen/transdim)

Publications
--------------

 Most of these examples are from our papers:

- Xinyu Chen, Zhanhong Cheng, Nicolas Saunier, Lijun Sun (2022). **Laplacian convolutional representation for traffic time series imputation**. arXiv preprint arXiv: 2212.01529. [[Preprint](https://arxiv.org/abs/2212.01529)] [[Python code (univariate imputation)](https://github.com/xinychen/transdim/tree/master/univariate-models)] [[Python code (multivariate imputation)](https://github.com/xinychen/transdim/tree/master/multiviarate-models)]

- Xinyu Chen, Lijun Sun (2022). **Bayesian temporal factorization for multidimensional time series prediction**. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44 (9): 4659-4673. [[Preprint](https://arxiv.org/abs/1910.06366v2)] [[DOI](https://doi.org/10.1109/TPAMI.2021.3066551)] [[Slides](https://doi.org/10.5281/zenodo.4693404)] [[Data & Python code](https://github.com/xinychen/transdim)]

- Xinyu Chen, Mengying Lei, Nicolas Saunier, Lijun Sun (2022). **Low-rank autoregressive tensor completion for spatiotemporal traffic data imputation**. IEEE Transactions on Intelligent Transportation Systems, 23 (8): 12301-12310. [[Preprint](https://arxiv.org/abs/2104.14936)] [[DOI](https://doi.org/10.1109/TITS.2021.3113608)] [[Data & Python code](https://github.com/xinychen/transdim)] (Also accepted in part to [MiLeTS Workshop of KDD 2021](https://kdd-milets.github.io/milets2021/), see [workshop paper](https://kdd-milets.github.io/milets2021/papers/MiLeTS2021_paper_23.pdf))

- Xinyu Chen, Yixian Chen, Nicolas Saunier, Lijun Sun (2021). **Scalable low-rank tensor learning for spatiotemporal traffic data imputation**. Transportation Research Part C: Emerging Technologies, 129: 103226. [[Preprint](https://arxiv.org/abs/2008.03194)] [[DOI](https://doi.org/10.1016/j.trc.2021.103226)] [[Data](https://doi.org/10.5281/zenodo.3939792)] [[Python code](https://github.com/xinychen/transdim/tree/master/large-imputer)]

- Xinyu Chen, Lijun Sun (2020). **Low-rank autoregressive tensor completion for multivariate time series forecasting**. arXiv preprint arXiv: 2006.10436. [[Preprint](https://arxiv.org/abs/2006.10436)] [[Data & Python code](https://github.com/xinychen/tensor-learning)]

- Xinyu Chen, Jinming Yang, Lijun Sun (2020). **A nonconvex low-rank tensor completion model for spatiotemporal traffic data imputation**. Transportation Research Part C: Emerging Technologies, 117: 102673. [[Preprint](https://arxiv.org/abs/2003.10271v2)] [[DOI](https://doi.org/10.1016/j.trc.2020.102673)] [[Data & Python code](https://github.com/xinychen/transdim)]

- Xinyu Chen, Zhaocheng He, Yixian Chen, Yuhuan Lu, Jiawei Wang (2019). **Missing traffic data imputation and pattern discovery with a Bayesian augmented tensor factorization model**. Transportation Research Part C: Emerging Technologies, 104: 66-77. [[DOI](https://doi.org/10.1016/j.trc.2019.03.003)] [[Slides](https://doi.org/10.5281/zenodo.2632552)] [[Data](http://doi.org/10.5281/zenodo.1205229)] [[Matlab code](https://github.com/sysuits/BATF)] [[Python code](https://github.com/xinychen/transdim/blob/master/imputer/BATF.ipynb)]

- Xinyu Chen, Zhaocheng He, Lijun Sun (2019). **A Bayesian tensor decomposition approach for spatiotemporal traffic data imputation**. Transportation Research Part C: Emerging Technologies, 98: 73-84. [[Preprint](https://www.researchgate.net/publication/329177786_A_Bayesian_tensor_decomposition_approach_for_spatiotemporal_traffic_data_imputation)] [[DOI](https://doi.org/10.1016/j.trc.2018.11.003)] [[Data](http://doi.org/10.5281/zenodo.1205229)] [[Matlab code](https://github.com/lijunsun/bgcp_imputation)] [[Python code](https://github.com/xinychen/transdim/blob/master/experiments/Imputation-BGCP.ipynb)]

repository: xinychen/awesome-latex-drawing

repo_name: xinychen/awesome-latex-drawing


text:
# developer-environment
*Docker Containers for Developing*

 * gitlab
 * jenkins
 * nginx

## Quick Start

Clone repository
	`git clone https://github.com/FalseCAM/developer-environment`

Change into source directory
	`cd developer-environment`

Edit compose for your needs
	`vim docker-compose.yml`

Build docker compose
	`docker-compose build`

Run docker compose
	`docker-compose up -d`

Stop docker compose
	`docker-compose stop`

## Tipps

To test locally change `<IP_ADDRESS>	localhost jenkins.localhost lam.localhost gitlab.localhost`
in your /etc/hosts file.

## lam (ldap account manager)

Open ldap account manager in browser: http://lam.localhost

## Jenkins

Open Jenkins in browser: http://jenkins.localhost

Paste password you get by this command in the console:
`docker exec -it developerenvironment_jenkins_1 cat /var/jenkins_home/secrets/initialAdminPassword && echo ''`

## Gitlab

Open Gitlab in browser: http://gitlab.localhost

repository: FalseCAM/developer-environment

repo_name: FalseCAM/developer-environment


text:
## [3.9.1](https://github.com/gabyvs/ng2-ue-utils/compare/3.9.0...3.9.1) (2017-04-17)

### Features

* **Client:** Adding X-Apigee-App-Version header to all client calls to identify SPA version that is making the call.
* **GTMService:** Adding webapp.version to GTM context to identify SPA version that is setting GTM events
* **IAppConfig:** Adding optional appVersion to the AppConfig interface. This version is the version that will be used in the previously mentioned features.
See an example of the full AppConfig object on `src/services/context/app-config.mock.ts` file

**Note:** although IAppConfig.appVersion property is optional now, it might be enforced in future releases.

### Dependency Changes

* **PhantomJS:** Removing PhantomJS dependency. Now all tests are run against Chrome browser.

## [3.9.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.8.1...3.9.0) (2017-04-07)

### Features

* **Client:** Adding X-Apigee-App-Id header to all client calls to identify SPA that is making the call.

### Breaking changes for tests and development environment configuration

* **ApiRoutes:** Use `organization` query param in permissions call

The change on the ApiRoutes will break any of your application tests that are mocking permissions response.
If your application is using a local router (like Nezaldi), depending on the configuration of your routes
you probably would need to change the route for the permissions call there as well.

## [3.8.1](https://github.com/gabyvs/ng2-ue-utils/compare/3.8.0...3.8.1) (2017-03-29)

### Features

* **GTMService:** Adding specific method for Google Analytics timing events
* **Notifications:** Logging user visible errors to Google Analytics now includes the current location pathName
* **Client:** Better error parsing, logging malformed errors to Google Analytics

## [3.8.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.7.0...3.8.0) (2017-03-24)

### Features

* **ListHeaders:** Adding support for table markup

### Bug Fixes
* **Storage:** Fix case where filtering on pattern and field skips falsey values

## [3.7.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.6.1...3.7.0) (2017-03-17)

### Features

* **ContextHelper:** Reading user context from cookie, supporting jwt for local development.
* **Client:** Adding X-Requested-With header to all client calls. Tracking all client calls response times to GTM.
* **Notification:** Tracking all user visible errors to GTM.
* **ObservableClient:** Reading user permissions from user calls instead of roles calls.
* **Router:** Exposing new route for user permissions

## [3.6.1](https://github.com/gabyvs/ng2-ue-utils/compare/3.6.0...3.6.1) (2017-03-07)

### Features

* **Filtering:** Exposing missing interface for its event emitter.
* **Pagination:** Exposing missing interface for its event emitter.
* **ListHeaders:** Exposing missing interface for its event emitter.

## [3.6.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.5.0...3.6.0) (2017-03-07)

### Features

* **GTM:** Adding a service and interfaces to track virtual page views and events to Google Analytics.

### Breaking changes

* **Client:** Adding dependency on GTMService, import `GTMService` from `ng2-ue-utils` and add to the `providers` field of your app.module

## [3.5.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.4.0...3.5.0) (2017-02-28)

### Features

* **ContextHelper:** Context helper service is now public. You can use this to get context information of the logged in user.

## [3.4.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.3.1...3.4.0) (2017-02-27)

### Features

* **ClientObserver:** New reset method.
* **ModalBase:** More flexible modal.

## [3.3.1](https://github.com/gabyvs/ng2-ue-utils/compare/3.3.0...3.3.1) (2017-02-22)

### Changes

* **BaseModal:** Removed hard-coded DOM from base modal header to make it more flexible.  Implemented instead in the **Modal** component.

## [3.3.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.2.0...3.3.0) (2017-02-21)

### Features

* **BaseModal:** A more flexible modal which allows consumers to define contents via transcludes and emits when the modal closes.
* **Modal:** Refactored Modal to use the new BaseModal.  Added optional input `cancelLabel` for defining the text content of the cancel button.

## [3.2.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.1.2...3.2.0) (2017-02-17)

### Features

* **ClientObserver:** Now accepts a path returns the path to the reported events as part of the interface IClientEvent.
* **IClientEvent:** Now includes path for all HTTP call events. In case of an HTTP error it also includes the original error object.

## [3.1.2](https://github.com/gabyvs/ng2-ue-utils/compare/3.1.1...3.1.2) (2017-02-15)

### Bug Fixes

* **Tooltip:** Added missing styles.  Tooltip component content now has `overflow-wrap: break-word;` in order to handle very long content with no line breaks.

## [3.1.1](https://github.com/gabyvs/ng2-ue-utils/compare/3.1.0...3.1.1) (2017-02-15)

### Bug Fixes

* **Tooltip:** Added missing styles.  Tooltip component content now has `z-index` of 10 and initializes to `top: 0; left: 0;`.

## [3.1.0](https://github.com/gabyvs/ng2-ue-utils/compare/3.0.0...3.1.0) (2017-02-03)

### Changes
* **Ng2-Bootstrap:** This peer dependency has been removed.  You may continue to use it in your applications, but it is no longer required.

### Features
* **Dropdown** Added a dropdown directives which can be used in the same way as the ones in ng2-bootstrap, which has been removed as a required dependency.
* **Tooltip** Added tooltip attribute directive, along with component and service.  See source files for usage documentation.  Now using new tooltip in value-handler component.

## [3.0.0](https://github.com/gabyvs/ng2-ue-utils/compare/2.1.2...3.0.0) (2016-12-05)

### Breaking Changes
* **ClientObserver** Removed `observe()` method and made this class injectable so components can directly access its new `clientEvents` stream. Checkout the example in the comments of the file clientObserver.ts
* **Repository** Removed `observe()` method. Since`ClientObserver` is now injectable, users should inject it and access its publicly exposed `clientEvents` stream.
* **ObservableClient** Removed `observe()` method. Since`ClientObserver` is now injectable, users should inject it and access its publicly exposed `clientEvents` stream.
* **ClientMock** Now get/post/put/delete methods run asynchronously. If you had tests that used the mock and were relying on it being synchronous, they will break.

### Features
* **ObservableClient** Dependency on `ClientObserver` now optional.  If provided, will provide event stream to spy on network calls
* **ObservableClientBase** Split base functionality of `ObservableClient` into a base class which has no dependency on `ContextService` (via `ApiRoutes`).  This is useful if you want to use the `ClientObserver`, but will not be using `Repository` (it requires `ObservableClient`) or `ApiRoutes`.
* **Progress/ProgressService** By default, progress bar does not restart on each ajax call.
* **Progress/ProgressService** Added optional `restartOnAjax` attribute which, when passed, restarts the progress bar on each spied call.  This affords you complete control over the progress bar by filtering the client events which are sent to the `ProgressService` in your app.
* **ContextService** Added public `userEmail` getter.

### Bug Fixes
* **Client** Fix bug where an empty string as response body would cause JS error.

## [2.1.2](https://github.com/gabyvs/ng2-ue-utils/compare/2.1.1...2.1.2) (2017-01-26)

### Bug Fixes

* **HintScroll:** Some browsers where showing scrolls even when they were not needed.

## [2.1.1](https://github.com/gabyvs/ng2-ue-utils/compare/2.1.0...2.1.1) (2016-12-06)

### Improvements

* **datepicker:** Improves accessibility by adding new styles to datepicker and datepicker wrapper.

## [2.1.0](https://github.com/gabyvs/ng2-ue-utils/compare/2.0.0...2.1.0) (2016-12-05)

### Improvements

* **datepicker:** Now contains new date/range picker component.

## [2.0.0](https://github.com/gabyvs/ng2-ue-utils/compare/1.10.1...2.0.0) (2016-10-31)

### Breaking Changes

* **All:** Now components library only works with Angular 2.1.2

## [1.10.1](https://github.com/gabyvs/ng2-ue-utils/compare/1.10.0...1.10.1) (2016-10-20)

### Bug Fixes

* **Context Service:** Forcing redirection to no-org.

## [1.10.0](https://github.com/gabyvs/ng2-ue-utils/compare/1.9.0...1.10.0) (2016-10-20)

### Changes

* **Context Service:** This service has changed its redirection logic.

Previously context service looked for the organization in the URL, then in Local Storage, and finally in the organizations that the user had access to.
Now if the organization is not in the URL nor in Local Storage, it will redirect to the new no-organization page `/no-org`.

## [1.9.0](https://github.com/gabyvs/ng2-ue-utils/compare/1.8.0...1.9.0) (2016-10-14)

### Features

* **pagination:** directive now does not show semi empty string when there are no elements to paginate over. It also accepts parameter `emptyMessage` that let users configure a message for empty collection.

### Breaking Changes

* **notification:** Position on the window has been removed from component styles.
* **progress:** Position on the window has been removed from component styles.

Previously these components included their position fixed in the window (top 56px).
Now the position must be provided by the consumer if it's different than the position of the parent element,
otherwise it will take position top 0 from the parent element.

## [1.8.0](https://github.com/gabyvs/ng2-ue-utils/compare/1.7.1...1.8.0) (2016-10-13)

### Features

* **toogle-on-hover:** directive now accepts parameter `showToggle` with values `style` or `class` that let users select how the directive will hide/show sub elements.

* **notification:** A class icon prefix can be used. This allows to use _Fontawesome_ instead of _glyphicons_.

### Bug Fixes

* **notification:** Coming soon message was removed.

## [1.7.1](https://github.com/gabyvs/ng2-ue-utils/compare/1.7.0...1.7.1) (2016-10-06)

### Bug Fixes

* **value-handler:** Listening to escape keyup event to cancel changes on the input field.


text:
# caddy reverse proxy in docker sample

This is sample container image that achieve:

* Run [caddy](https://caddyserver.com/) as revserse proxy to the app
* The app is the normal HTTP server implmeneted in Go
* caddy handles all TLS connection at its edge
* TLS should be handled by caddy's auto certification renewal feature (TODO)

## Prerequisites

In order to run this proof of concept sample, you need:

* docker
* [mkcert](https://github.com/FiloSottile/mkcert) [^cert]

[^cert]: Though you can generate self signed certificate with any tools, mkcert let you have your own CA that Chrome/Chromium can trust.

## How to run

0. `$ mkcert -install` (In the case you run `mkcert` for the first time)
1. `$ mkcert localhost`
2. `$ docker build -t caddy-test .`
3. `$ docker run -p 9000:9000 --rm -it caddy-test:latest`
4. From another terminal: `$ curl -X GET https://localhost:9000/`

On executing #4, you'll see the following message:

> hello test server

repository: ymotongpoo/caddy-docker

repo_name: ymotongpoo/caddy-docker


text:
Goldencoin development tree

Goldencoin - Crypto currency is based on PoW / PoS.
===========================

Algorithm: scrypt

Total coin supply:4500000

Pre-mine:300000 GLDN ~ 6%

Coinbase maturity:120 Blocks

Confirmations:10 Blocks

PoW reward: 3 coins reward per block

after block 100800 reward: 1.5 coins per block

After block 201600 reward: 0.75 conins per block

(Started on 1-st block
Transition to PoS after the next 10080 PoS blocks)

PoS interest:100%
During phase PoW - PoS turns off
(Transition to PoW after 10080 PoS blocks)

Minimum age of coin: 6 hours

RPC port: 2881

P2P port: 12881

ADDNODE = <IP_ADDRESS>
ADDNODE = <IP_ADDRESS>
ADDNODE = <IP_ADDRESS>

repository: goldencoin-master/goldencoin

repo_name: goldencoin-master/goldencoin


text:
#### Godmin [![Gem Version](http://img.shields.io/gem/v/godmin.svg)](https://rubygems.org/gems/godmin)

# Godmin Material

This is a fork of the Godmin admin framework with the purpose of implementing Material Design through the Angular Material framework in Godmin without disrupting the automatic view generation. Angular is only used to bootstrap and include Angular Material. We include the libraries via CDN now but this will hopefully be changed to use a package manager such as npm in the future.

## Installation

- Include Godmin-Material in your Gemfile: `gem "godmin", github: "inserve/godmin-material", branch: "master"`
- If you haven't already, change your `application.css` to `application.scss`
  - Add these two lines to your `application.scss`:

    ```
      @import "godmin/variables";
      @import "godmin/index";
    ```
- Run `bundle`
- Start your Rails app and try out your fresh materialistic admin interface!

---

## Configuration

### Dependecy overrides

The default dependencies can be overriden by creating a `dependencies.js` file in your `~/yourapp/app/assets/javascripts/` folder.
An example dependency array looks like this:

```
angular.module('dependencies', ['ngMaterial', 'md.data.table', 'ngFileUpload', 'ngSanitize', 'luegg.directives', 'ngQuill'])
```

this is also the current default in [app/assets/javascripts/godmin/dependencies.js](https://github.com/inserve/godmin-material/tree/master/app/assets/javascripts/godmin/dependencies.js)

You might also need/want to change the default CDN dependencies. This can be done by creating a `_dependencies.html.erb` partial in `~/yourapp/app/views/layouts/godmin/` (note the underscore in front of the name, it's important to declare the file as a partial).

### Angular Material color overrides

The default Angular Material theme can be found in
[app/assets/javascripts/godmin/theme.js](https://github.com/inserve/godmin-material/tree/master/app/assets/javascripts/godmin/theme.js)

If you haven't already, create a controller in `~/yourapp/app/assets/javascripts/example-controller.js`. Copy the contents from the above source and
override the `rgba()` values with your own colors. It also supports hex values (#FFFFFF).

### SASS color overrides

All the SASS variables can be found in [app/assets/stylesheets/godmin/variables.scss](https://github.com/inserve/godmin-material/tree/master/app/assets/stylesheets/godmin/variables.scss)

and you can override them like so:

- Create or copy the Godmin-Material variables.scss inside /yourapp/app/assets/stylesheets/

```
  ~/yourapp/app/assets/stylesheets/application.scss
  @import 'variables';
  @import 'godmin/index';
```

You can now override any of the given variables in your own local `variables.scss` and refresh the admin interface to see the reflected changes.

Notes:
- if your application.scss file is a .css simply rename it to .scss
- if you already have `*= require godmin` at the top in your application.scss remove it now, we include it via SASS to have control of the order it gets loaded

---

## Components

### Async search to set related ID

This component requires a custom written `PUT` action in your backend alongside the related data being presented via your `@resource` into the view you're searching in.
Documentation for examples of this is pending.

In your view add this markup

```
  <div ng-app="godmin">
    <search
      url="/path/to/api/put-request"
      default-query="<%= @resource.related_resource ? @resource.related_resource.name : '' %>"
      hidden-name="account[contact_id]"
      first-key="firstname"
      second-key="lastname" />
  </div>
```

| Attribute name  | Value specification                                                                                |
|---------------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------  |
| url             | string, url to the api get route                                                                                |
| default-query   | This can be anything from a default value to, prefferably and as the example here shows, the value from the @resource provided via the resource service                   |
| hidden-name     | the name for the hidden input, this should be resource_name[column_name], see example above                                                                                |
| first-key       | the first key for the related resource to show, for example first-key='firstname' would result in the displayed value in the results will be related_resource.firstname   |
| second-key      | see first-key, never use this without first setting the above

### Dialog

If you require dialogs (modals) in your custom CRUD views you can write a Dialog Component:

```
  <div style="visibility: hidden">
    <div class="md-dialog-container" id="myDialogID">
      <md-dialog layout-padding>
        <md-dialog-content>
          <!-- Dialog body -->
        </md-dialog-content>
        <md-dialog-actions>
          <!-- hide() hides the currently open Dialog (same as clicking outside) -->
          <md-button ng-click="hide()">
            Close
          </md-button>
        </md-dialog-actions>
      </md-dialog>
    </div>
  </div>
```

To have a trigger for the dialog simply place a button wherever you want it with this markup:

```
  <md-button ng-click="showDialog($event, '#myDialogID')">
    Open Dialog
  </md-button>
```

---

#### for further help check [Godmins' official documentation](https://github.com/varvet/godmin)

repository: inserve/godmin-material

repo_name: inserve/godmin-material


text:
---
type: rule
archivedreason:
title: Search Results - Do you always give more information when searching doesn’t find anything?
guid: a7866344-f0b1-4467-b433-41735616d259
uri: search-results-do-you-always-give-more-information-when-searching-doesnt-find-anything
created: 2014-12-22T12:15:42.0000000Z
authors:
- title: Adam Cogan
  url: https://ssw.com.au/people/adam-cogan
related: []
redirects:
- search-results-do-you-always-give-more-information-when-searching-doesn’t-find-anything

---

When you ring up a company and ask “do you sell boxes?” it is not expected to hear them say “no” and hang up. They should answer the question and suggestion something, for example: “No, but we sell plastic containers, would you like that instead?”

Websites should do the same by giving more information instead of just say “404 – page not found” or “your search did not match anything”. It can be a simple “Try one of these instead” giving a number of links.

<!--endintro-->

::: good
![Figure: Good example - If you don’t match anything on Amazon, it gives you some other choices to click on](amazon-search.jpg)
:::

branch_name: refs/heads/main


text:
---
title: Lesson Evaluation 3 Football badges on Fuze
layout: post
author: ravi.sisodiya
permalink: /lesson-evaluation-3-football-badges-on-fuze/
source-id: 1ATdCWgNaHOUSysQ959IJwjL2NUOxy2G-biDWRcYnlKc
published: true
---

    Title
    Football badges on Fuze
    Date
    31/01/18

    Starting point:
    Adequate basic knowledge of Fuze workings

    Target for this lesson?
    To start creating a football badge on Fuze

    Did I reach my target?
(add details to "Lesson Review")
    Yes, we did start creating our badge.

    Lesson Review

    How did I learn? What strategies were effective?

    When we were stuck and unsure how to continue we consulted other pairs that had managed to get their badge working. This allowed us to move past our problems easily and quickly. Working together well was very important - when coding something long or confusing one of our pair read out the useful code and the other actually put it into the Fuze box.

    What limited my learning? Which habits do I need to work on?

    Not reading all the necessary sections before the part we were told to look at hindered our learning as we didn't properly understand how to start creating our own badge. We understood some of what we were supposed to do but not all of it. Also, there was a problem with the plug sharing between our group and another pair meaning we had to keep switching plugs in and out and this slowed down our work.

    What will I change for next time? How will I improve my learning?

    In the future I will remember to read all the necessary sections before moving on, even if we aren’t told to. Also we should better manage our workspace, specifically power sources, in the future. We should also remember to work efficiently as a pair by one reading and one coding.


text:
# V2beta1RecurringRun

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**recurring_run_id** | **str** | Output. Unique run ID generated by API server. | [optional]
**display_name** | **str** | Required input field. Recurring run name provided by user. Not unique. | [optional]
**description** | **str** | Optional input field. Describes the purpose of the recurring run. | [optional]
**pipeline_version_id** | **str** | The ID of the pipeline version used for creating runs. | [optional]
**pipeline_spec** | [**object**](.md) | The pipeline spec. | [optional]
**pipeline_version_reference** | [**V2beta1PipelineVersionReference**](V2beta1PipelineVersionReference.md) |  | [optional]
**runtime_config** | [**V2beta1RuntimeConfig**](V2beta1RuntimeConfig.md) |  | [optional]
**service_account** | **str** | Optional input field. Specifies which Kubernetes service account this recurring run uses. | [optional]
**max_concurrency** | **str** | Required input field. Specifies how many runs can be executed concurrently. Range [1-10]. | [optional]
**trigger** | [**V2beta1Trigger**](V2beta1Trigger.md) |  | [optional]
**mode** | [**RecurringRunMode**](RecurringRunMode.md) |  | [optional]
**created_at** | **datetime** | Output. The time this recurring run was created. | [optional]
**updated_at** | **datetime** | Output. The last time this recurring run was updated. | [optional]
**status** | [**V2beta1RecurringRunStatus**](V2beta1RecurringRunStatus.md) |  | [optional]
**error** | [**GooglerpcStatus**](GooglerpcStatus.md) |  | [optional]
**no_catchup** | **bool** | Optional input field. Whether the recurring run should catch up if behind schedule. If true, the recurring run will only schedule the latest interval if behind schedule. If false, the recurring run will catch up on each past interval. | [optional]
**namespace** | **str** | TODO (gkclat): consider removing this field if it can be obtained from the parent experiment. Output only. Namespace this recurring run belongs to. Derived from the parent experiment. | [optional] [readonly]
**experiment_id** | **str** | ID of the parent experiment this recurring run belongs to. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: kubeflow/pipelines

gha_language: Python

repo_name: kubeflow/pipelines


text:
[GraphQL-IO](https://github.com/rse/graphql-io)  |
[GraphQL-IO-Client](https://github.com/rse/graphql-io-client)  |
[GraphQL-IO-Server](https://github.com/rse/graphql-io-server)

GraphQL-IO-Server
=================

GraphQL Network Communication Framework (Server)

About
-----

This is a [GraphQL](http://graphql.org/) network communication framework for
JavaScript servers, running under Node.js.
It is based on the GraphQL engine [GraphQL.js](http://graphql.org/graphql-js/),
the GraphQL schema execution library [GraphQL-Tools](http://dev.apollodata.com/tools/graphql-tools/),
the GraphQL type definition library [GraphQL-Tools-Types](https://github.com/rse/graphql-tools-types),
the GraphQL subscription management library [GraphQL-Tools-Subscribe](https://github.com/rse/graphql-tools-subscribe),
the network communication framework [HAPI](https://hapijs.com),
the WebSocket integration plugin [HAPI-Plugin-WebSocket](https://github.com/rse/hapi-plugin-websocket)
and the GraphiQL integration plugin [HAPI-Plugin-GraphiQL](https://github.com/rse/hapi-plugin-graphiql).
It has be used with the corresponding [GraphQL-IO-Client](https://github.com/rse/graphql-io-client)
network communication framework on the JavaScript client side.

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

```shell
$ npm install graphql-io-server
```

Usage
-----

```js
/*  all-in-one  */
import { Server } from "graphql-io"

/*  client-side only  */
import { Server } from "graphql-io-server"
```

See the [TypeScript type definition of the GraphQL-IO-Server API](src/graphql-io.d.ts) for details.

Sample
------

```js
/*  Hello World Server  */
const { Server } = require("graphql-io-server")
const server = new Server({ url: "http://<IP_ADDRESS>:12345/api" })
server.at("graphql-resolver", () => ({
    Root: { hello: [ "hello: String", () => "world" ] }
}))
await server.start()
```

For more elaborate samples, check out the [Samples](https://github.com/rse/graphql-io/tree/master/sample/) folder.

License
-------

Copyright (c) 2016-2019 Dr. Ralf S. Engelschall (http://engelschall.com/)

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

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

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

repository: rse/graphql-io-server

gha_language: JavaScript

repo_name: rse/graphql-io-server


text:
# switcheroo
Tile puzzle game w/ a retro-theme. Have fun.

### Dev setup

Manually create `uploads/` and `chunks` directories at the root of the project.

Run dev server: `$ npm run start`

repository: theomarkkuspaul/switcheroo

repo_name: theomarkkuspaul/switcheroo


text:
---
layout: default
---

# 1995-09-01 - Re: SSL search attack

## Header Data

From<EMAIL_ADDRESS>(Mike McNally)

To<EMAIL_ADDRESS>Message Hash: d986abb3fd5319477537b55a6d42d8fbb28ad208c6e1d71fcbd179c4305757a6

Message ID: \<9509011648.AA07795@alpha\>

Reply To<EMAIL_ADDRESS>UTC Datetime: 1995-09-01 16:49:10 UTC

Raw Date: Fri, 1 Sep 95 09:49:10 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Mike McNally)
Date: Fri, 1 Sep 95 09:49:10 PDT
To<EMAIL_ADDRESS>Subject: Re: SSL search attack
In-Reply-To<EMAIL_ADDRESS>Message-ID: <9509011648.AA07795@alpha>
MIME-Version: 1.0
Content-Type: text/plain

 > > > ACK ACK
 > > ACK
 > > > ACK
 > ACK

I've just kinda been watching this debate for a while, so I may well
have missed some of the more interesting details; if so, I apologize
for my noise in advance.

I work on a lot of commercial software under constraints of
scalability much like the SSL "attack server" being discussed here.
My instincts tell me that in this situation the whole process would be
*much* simpler if the basic idea of keeping the central server (or
the family of distributed servers in those models) completely
"informed" by all the attacking clients were abandoned.

Tim May's "random attack" idea was extremely attractive, I thought.
However, I think that it'd be possible to take advantage of the fact
that the keyspace itself is basically constant (until the keysize is
increased in the protocol under attack, of course).  I mean, 40 bits
is 40 bits.  Similarly, the capacity of most clients will be fairly
consistent.  (I have access (in theory, of course; don't mention this
to my management) (hi todd) to a hundred or so CPU's here, and that
doesn't really change too often.)

Rather than apportion the search space out dynamically on each attack,
why not simply allow attack clients to "subscribe" on a semi-permanent
basis?  All the server would have to do is make batches of ciphertext
available for cracking.  When a request comes in from a subscriber for
a copy of some ciphertext, the server knows (or at least can
legitimately suspect) that that subscriber's already-known keyspace
will be searched.

As far as getting acknowledgements of search completion, again the
server can by inference assume that (based on the prior establishment
of client capabilities) after a pre-determined period of time the key
sub-space will have been searched.  It might be appropriate for
clients to send back NACK messages, in case for example somebody shuts
down the client's network unexpectedly.  Assuming this goes pretty
smoothly one would hope that the number of failures would be
considerably smaller than the number of successs.

Again, ignore me if I'm blind to something obvious.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Nobody's going to listen to you if you just | Mike McNally<EMAIL_ADDRESS>|
| stand there and flap your arms like a fish. | Tivoli Systems, Austin TX    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

{% endraw %}
```

## Thread

+ Return to [September 1995](/archive/1995/09)

+ Return to<EMAIL_ADDRESS>(Daniel R. Oelke)](/authors/droelke_at_rdxsunhost_aud_alcatel_com_daniel_r_oelke_)"
+ Return to<EMAIL_ADDRESS>(Mike McNally)](/authors/m5_at_dev_tivoli_com_mike_mcnally_)"
+ Return to "[Piete Brooks <Piete.Brooks@cl.cam.ac.uk>](/authors/piete_brooks_piete_brooks_at_cl_cam_ac_uk_)"

+ 1995-09-01 (Fri, 1 Sep 95 06:27:10 PDT) - [Re: SSL search attack](/archive/1995/09/f5fa9c299f25e06fc02744a71a7a9e8d6b10d8a8abd8508f6924cb3d53917634) -<EMAIL_ADDRESS>(Daniel R. Oelke)_
  + 1995-09-01 (Fri, 1 Sep 95 08:50:47 PDT) - [Re: SSL search attack](/archive/1995/09/1de777585226dff46681282be65a731870ab68ad588fa0d48c5cfbadff7fa1de) - _Piete Brooks<EMAIL_ADDRESS>  + 1995-09-01 (Fri, 1 Sep 95 09:49:10 PDT) - Re: SSL search attack -<EMAIL_ADDRESS>(Mike McNally)_
    + 1995-09-01 (Fri, 1 Sep 95 10:22:29 PDT) - [Re: SSL search attack](/archive/1995/09/725c4e448cc0b98a408f81bcb7734d289eba17b4d635e90a96c7c907a5315568) -<EMAIL_ADDRESS>(Mike McNally)_


text:
# TransferBuddy
REST Sequence Data Transfer

```
pip install eve
pip install requests
```

To start producer:

```$ python tbuddy.py --producer```

To run a subscriber:

```$ python tbuddy.py --subscriber```

repository: WhiteLab/TransferBuddy

repo_name: WhiteLab/TransferBuddy


text:
# Introduction
  A extension plugin based on xgplayer, it can support play dash video

# How to use
### install

```shell
$ npm istall xgplayer@alpha
$ npm istall xgplayer-dash@alpha
```
### Usage
html
```html
  <div id="vs"></div>
```
js
```javascript
import Player from 'xgplayer'
import 'xgplayer/dist/xgplayer.min.css'
import DashPlugin from 'xgplayer-dash'

const player = new Player({
        id: 'vs',
        url: '../xgplayer-demo.hls',
        plugins: [DashPlugin],
        DashPlugin: {} // config for plugin DashPlugin
        // If use CDN loading,you can Get the plugin through window.DashPlugin
    })
```

repository: bytedance/xgplayer

repo_name: bytedance/xgplayer


text:
# Merostictis betulicola (Fuckel) Svrcek, 1985 SPECIES

#### Status
SYNONYM

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

#### Published in
Ceská Mykol. 39(4): 207 (1985)

#### Original name
Pyrenopeziza betulicola Fuckel, 1870

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Dermateaceae/Pyrenopeziza/Pyrenopeziza betulicola/ Syn. Merostictis betulicola/README.md

repo_name: mdoering/backbone


text:
# SSDS 2017  - 2nd Int'l Summer School on Data Science

## Center of Research Excellence for Data Science and Advanced Cooperative Systems, Research Unit for Data Science

Hands-on sessions for [2nd International Summer School on Data Science](https://sites.google.com/site/ssdatascience2017/) organized by the Center of Research Excellence for Data Science and Advanced Cooperative Systems, [Research Unit for Data Science](http://across-datascience.zci.hr/zci/istrazivanje/znanost_o_podatcima), from September 25-29, 2017 in Split, Croatia.

## Table Of Contents

* [Day 1 - Introduction to Tensorflow](https://github.com/SSDS-Croatia/SSDS-2017/tree/master/Day-1)
* [Day 2 - Convolutional Neural Networks for Image Classification](https://github.com/SSDS-Croatia/SSDS-2017/tree/master/Day-2)
* [Day 3 - Character-wise Language Modeling with LSTMs](https://github.com/SSDS-Croatia/SSDS-2017/tree/master/Day-3)
* [Day 4 - Image Segmentation and Object Detection](https://github.com/SSDS-Croatia/SSDS-2017/tree/master/Day-4)
* [Day 5 - Generative Adversarial Networks](https://github.com/SSDS-Croatia/SSDS-2017/tree/master/Day-5)

## Installation instructions

The hands-on sessions are organized as Jupyter notebooks, which you can run on your local computer.
They were tested on Windows, Linux and Mac OS X within [Anaconda](https://www.anaconda.com) (Python 3.6) environment (Version 4.4.0) with [TensorFlow](https://www.tensorflow.org) (Version 1.3). It is adequate and recommended to have installed TensorFlow with CPU-support only, since it is much easier to install.

Please follow below the specific instructions for your OS (Windows, Linux, Mac OS X) to:
* Download & install Anaconda (from [https://www.anaconda.com/download/](https://www.anaconda.com/download/))
* Create conda environment with Python 3.6 and standard Anaconda Python packages (see [conda-cheatsheet](https://conda.io/docs/_downloads/conda-cheatsheet.pdf))
* Install TensorFlow 1.3 with CPU-support only by using pip (follow [https://www.tensorflow.org/install/](https://www.tensorflow.org/install/))

### Windows
TensorFlow installation was tested on 64-bit Windows 7 and Windows 10 (there is currently no support for TensorFlow on 32-bit systems). We recommend to install TensorFlow in an Anaconda environment. Download Anaconda (Python 3.6) for Windows from [https://www.anaconda.com/download/](https://www.anaconda.com/download/) and install it by running setup in **Administrator mode**.

Afterwards, run Anaconda Command Prompt in **Administrator mode** and
* Create conda environment named `ssds`:
  ```
  conda create --name ssds python=3.6 anaconda
  ```
* Activate `ssds` with:
  ```
  activate ssds
  ```
* Install Tensorflow within `ssds`:
  ```
  pip install --ignore-installed --upgrade tensorflow
  ```

For more more details on how to install TensorFlow on Windows go to [https://www.tensorflow.org/install/install_windows](https://www.tensorflow.org/install/install_windows). If you already have older version of Anaconda installed where Python 3.6 is not available by default you can still follow the procedure above. It will install Python 3.6 and make it available in the `ssds` environment.

### Linux/Mac OS X
Similarly as for Windows, the most convenient way for TensorFlow installation on Linux or Mac OS X is to install TensorFlow with 'CPU-support only within Anaconda environment' following the similar procedure to the above-described steps. For detailed instructions:

* for Linux go to [https://www.tensorflow.org/install/install_linux#installing_with_anaconda](https://www.tensorflow.org/install/install_linux#installing_with_anaconda)

* or for Mac OS X go to [https://www.tensorflow.org/install/install_mac#installing_with_anaconda](https://www.tensorflow.org/install/install_mac#installing_with_anaconda)

## Clone the repository

First make sure you have git versioning software, you can download and install it from [https://git-scm.com/downloads](https://git-scm.com/downloads). Using the command line (i.e. [Anaconda] Command Prompt on Windows or Terminal on Linux/Mac OS X) position to the directory of your choice and then clone the git repository with command:
  ```
  git clone https://github.com/SSDS-Croatia/SSDS-2017.git
  ```

As an alternative, you can just download the zip file from [https://github.com/SSDS-Croatia/SSDS-2017/archive/master.zip](https://github.com/SSDS-Croatia/SSDS-2017/archive/master.zip), but then you will have to do it all over again if there are any changes in the meantime!

## Using hands-on sessions Jupyter notebooks:
All the hands-on sessions are run as Jupyter notebooks. To view and edit notebooks, in the command line (i.e. using Anaconda Command Prompt on Windows or Terminal on Linux/Mac OS X), run the following:

* activate `ssds` conda environment (consult [conda-cheatsheet](https://conda.io/docs/_downloads/conda-cheatsheet.pdf)):

  - Windows: `activate ssds`

  - Linux/Mac OS X: `source activate ssds`

* within `ssds` start Jupyter Notebook server (for [details](https://jupyter.readthedocs.io/en/latest/running.html#running)):
  ```
  jupyter notebook --notebook-dir=PATH-TO-REPOSITORY --port=NUMBER-OF-UNUSED-PORT
  ```
  This will open your default web browser at `http://localhost:[NUMBER-OF-UNUSED-PORT]` and
  you will be able to navigate the repository file structure and use notebooks for the hands-on sessions.


text:
# Mature Microservices and How to Operate Them

* It's hard to operate microservices
    * Microservices allow for any tech choice
        * Knowledge requirements much higher across estate
        * How do you backup *this* database??
    * Lots of microservices across lots of teams
        * Where is a given problem happening?
        * Who can fix it?
    * Your next legacy systems will likely be Microservices!
* Why bother with microservices?
    * FT.com - organisation needs to be abe to experiment with new revenue models
    * Most experiments end up as prod because of the sunk cost fallacy
        * So experiments must be cheap!
        * CD, DevOps, Microservices enable this.
* Optimising for speed
    * Delivery Lead Time
        * less than 1h
    * Delivery Frequency
        * *"If it hurts, do it more frequently, and bring the pain forward"*
    * CD
        * Automated build and release pipeline
        * Automated testing integrated into the pipeline
    * CI
        * Even with CD you should be getting changes out straight away
        * No point having CD and releasing once per week
    * Architecture
        * Some architecture does not allow for zero-downtime deployments etc
        * Sequential deployments
        * Schemaless databases
    * Test and deploy changes independently
    * Systems and teams need to be loosely coupled
        * No need to release services in a group
        * Microservices make it easier to remain uncoupled so they help with this
        * Coordinating between teams slows you down
    * Process Theatre needs to be eliminated
    * Usually fix and roll forward rather than roll back
* Operating Microservice
    * Transaction and data consistency problems
    * DevOps practices
        * The team that builds the system *has* to operate it too.
        * You can't afford the cost of coordination
        * High performing teams get to make their own decisions about tools + tech
            * You don't want to have to wait for an architecture team to make decisions
            * This makes it hard for any central teams to coordinate anything
        * Make *everything* someone else's problem (use SaaS, Cloud services etc)
            * Buy rather than build unless it is *critical to your business*
    * Accept that you will generally be in a state of "grey failure"
        * Expect transient things to happen
        * Backoff and retry
        * Be willing to Mitigate Now, Fix Tomorrow
    * How do you know something's wrong?
        * Concentrate on the business capabilites
            * Monitor based on this: e.g. "can we publish the news?"
                * Synthetic monitoring: e.g. publish an old article and ensure that it's published
                * Means we always expect articles to be published: can alert if nothing is.
                * What does it mean for a publish to be "successful"?
                    * On publish, notification goes to Publish Monitor
                    * Publish monitor checks that the article is published everywhere
    * Build observability into the system
        * Infer what's going on in the system by observing its outputs
            * Log the stuff that's interesting
            * Tie logs together via unique ID
                * Transaciton ID added to header
                * Must be passed on to every service
                * Zipkin
        * Metrics
            * Concentrate on the layer that's closest to the customer
                * Request rate
                * Error rate
                * Duration
        * You'll always be concentrating on *something*
            * Doing things 150 times over is slow and painful
            * Things like deployment pipelines need to be templated
            * Use a service mesh
                * Discovery
                * Routing
                * Fialure / Recovery
                * You can concentrate on the Business Logic
* When people move on
    * Every system must be owned by a team!
        * Team might not overtly adopt immediately
        * If you won't invest enough to keep it running properly, shut it down
        * Assume that there is an amount of work on every system that exists: include it in TCO.
    * Keeping docs up to date is a challenge
        * Much harder for microservices
            * More services
            * Lots of duplication
        * A graph works well
            * E.g. when someone changes role, just change it in one place.
            * Visualise relationships
            * Understand costs related to decommissioned systems etc
        * A unique system code for every system!!!
            * Can identify the system everywhere
        * Give people something in return
            * Centralised monitoring
            * Multiple systems -> Prometheus
            * Automatically provide dashboards based on the data generated by the system
            * Keep runbooks as `RUNBOOK.md` in the repo
                * Hook it into a change API
            * System operability score
                * Teams get a score: gamifies improvement!
                * Final manual review required
            * Auto technology risk dashboarding
    * Practice
        * Failover weekly for practice
        * Chaos engineering
            * Understand your steady state
            * Look at what you can change - minimise the blast radius
            * Work out what you expect to see happen
            * Run the experiment and see if you were right.
* Building and opeating microservices is hard work.
    * You have to maintain knowledge of live services
    * Plan now for future legacy microservices
    * Only worth the pain if you are moving fast
* Book
    * Accelerate - The Science of DevOps
    * Continuous Delivery
    * medium.com/wardelymaps

* Transient issues
    * Dashboards aren't watched.
    * How do you decide when to proactively alert? Signal vs noise?


text:
---
layout: post
title: "Problem 2 - Even Fibonacci numbers"
date: 2015-07-22 18:22
mathjax: true
number: 2
---

## Question

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

<p align="center">
    1, 2, 3, 5, 8, 13, 21, 34, 55, 89
</p>

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

## Answer

Like before, we can go through the Fibonacci numbers, generating them and checking them as we go.

```python
a = 1
b = 1
s = 0
while b <= 4000000:
    if b % 2 == 0:
        s += b
    temp = a + b
    a = b
    b = temp
print(s)
```

Running this results in an output of,

```
4613732
0.00011090000000002487 seconds.
```

### Bonus

However, we can also solve this analytically. Notice the Fibonacci sequence above with an extra 1 at the beginning. If we assume $$F_1$$ and $$F_2$$ correspond to the first two ones, then it turns out that every 3rd Fibonacci number is even. Why? The number 1 is odd, Now, an odd integer plus another odd integer is an **even** integer. However, an odd integer plus an even integer gives an **odd** integer. There are no instances where we have two even integers, because it starts with two odd numbers. Therefore, we need to add every 3rd Fibonacci number. Recall that there is also a closed-form formula utilizing the golden ratio: $$F_n = \frac{\Phi^n - (1-\Phi)^{n}}{\sqrt{5}}$$. Now we need to find the index of the largest Fibonacci number less than 4 million. From the [Wikipedia article](https://en.wikipedia.org/wiki/Fibonacci_number#Computation_by_rounding), the formula to find the closest index (rounded down) of a Fibonacci number is

$$
n(F) = \lfloor\log_\Phi\left(F\sqrt(5) + \frac{1}{2}\right)\rfloor
\\
n(4000000) = 33
$$

Recall that the sum of a finite geometric series is $$a_1\frac{1-r^n}{1-r}$$ where $$a_1$$ is the first term, $$r$$ is the common ratio, and $$n$$ is the number of terms of the sequence. Now we can write our summation like so:

$$
\begin{aligned}
	S &= \sum_{k=1}^{11}F_{3k}
	\\ &=
	\sum_{k=1}^{11}\frac{\Phi^{3k} - (1-\Phi)^{3k}}{\sqrt{5}}
	\\ &=
	\frac{1}{\sqrt{5}}\left(\sum_{k=1}^{11}\Phi^{3k} - \sum_{k=1}^{11}(1-\Phi)^{3k}\right)
	\\ &=
	\frac{1}{\sqrt{5}}\left(\Phi^3\frac{1-(\Phi^3)^{11}}{1-\Phi^3} -
		(1-\Phi)^3\frac{1-((1-\Phi)^3)^{11}}{1-(1-\Phi)^3}\right)
	\\ &=
	\boxed{4613732}
\end{aligned}
$$

repository: MughilM/ProjectEuler

repo_name: MughilM/ProjectEuler