text:
# v{version}

This is the {version} release of Open Match.

Check the [official website](https://open-match.dev) for details on features, installation and usage.

Release Notes
-------------

**Feature Highlights**
{ highlight here the most notable changes and themes at a high level}

**Breaking Changes**
{ detail any behaviors or API surfaces which worked in a previous version which will no longer work correctly }

> Future releases towards 1.0.0 may still have breaking changes.

**Security Fixes**
{ list any changes which fix vulnerabilities in open match }

**Enhancements**
{ go into details on improvements and changes }

Usage Requirements
-------------
* Tested against Kubernetes Version { a list of k8s versions}
* Golang Version = v{ required golang version }

Images
------

```bash
# Servers
docker pull gcr.io/open-match-public-images/openmatch-backend:{version}
docker pull gcr.io/open-match-public-images/openmatch-frontend:{version}
docker pull gcr.io/open-match-public-images/openmatch-query:{version}
docker pull gcr.io/open-match-public-images/openmatch-synchronizer:{version}

# Evaluators
docker pull gcr.io/open-match-public-images/openmatch-evaluator-go-simple:{version}

# Sample Match Making Functions
docker pull gcr.io/open-match-public-images/openmatch-mmf-go-soloduel:{version}
docker pull gcr.io/open-match-public-images/openmatch-mmf-go-pool:{version}

# Test Clients
docker pull gcr.io/open-match-public-images/openmatch-demo-first-match:{version}
```

_This software is currently alpha, and subject to change. Not to be used in production systems._

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

* Follow [Open Match Installation Guide](https://open-match.dev/site/docs/installation/) to setup Open Match in your cluster.

API Definitions
------------

- gRPC API Definitions are available in [API references](https://open-match.dev/site/docs/reference/api/) - _Preferred_
- HTTP API Definitions are available in [SwaggerUI](https://open-match.dev/site/swaggerui/index.html)

repository: googleforgames/open-match

gha_language: Go

repo_name: googleforgames/open-match


text:
# Node.js  Package Maintenance Team Meeting 2021-01-12

## Links

* **Recording**:  https://youtu.be/EnFGbUWeM3U
* **GitHub Issue**: https://github.com/nodejs/package-maintenance/issues/442

## Present

* Dominykas Blyžė (@dominykas)
* Glenn Hinks @ghinks
* Wes Todd (@wesleytodd)
* Michael Dawson (@mhdawson)
* Rick Markins (@rxmarbles)
* Christopher Hiller (@boneskull)
* Jordan Harband (@ljharb)
* Beth Griggs (@BethGriggs)
* Owen Buckley (@thescientist13)
* Darcy Clarke (@darcyclarke)

## Agenda

## Announcements

*Extracted from **package-maintenance-agenda** labelled issues and pull requests from the **nodejs org** prior to the meeting.

* No announcements this week.

### nodejs/package-maintenance

* Confirm/re-evaluate meeting times/schedule? [#438](https://github.com/nodejs/package-maintenance/issues/438)
  * Discussed notes in the issue with a few specific suggestions.

* Suggested list of modules to help get support info into [#413](https://github.com/nodejs/package-maintenance/issues/413)
  * The PR to add to node-addon-api landed.
  * Its been added to the modules in github/nodeshift.

* Building `create-pkg` [#404](https://github.com/nodejs/package-maintenance/issues/404)
  * Wes has pushed what he had
  * Chris Hiller talked to Wes and is starting to work on it.
  * Next steps:
   * Moving some other packages involved into the org?
    * Michael, adding generation of support info in the list? Wes ->yes but need more formal list, discussion around moving the list over.
     * currently filling in more fields

* Suggest ignoring a vulnerability by the package maintainer [#386](https://github.com/nodejs/package-maintenance/issues/386)
  * Darcy has submitting the collaboration space
  * https://hackmd.io/KDDITAKATBmGMnC6a1of6w, for people to comment in next couple hours

* Next steps on Support levels in Package.json [#192](https://github.com/nodejs/package-maintenance/issues/192)
  * promote adoption
  * adding to create-pkg
  * Michael, open discussion issue in npm for showing “badge like info”
    * https://github.com/npm/feedback/discussions/127
  * Discussed adding command to the support module to create basic info.

## Project Board Review (maybe, if time permits).

Ask participants about the state of [Project Board](https://github.com/nodejs/package-maintenance/projects/1) and necessary changes if time permits.

## Q&A, Other

## Upcoming Meetings

* **Node.js Foundation Calendar**: https://nodejs.org/calendar

Click `+GoogleCalendar` at the bottom right to add to your own Google calendar.

license: MIT

repository: nodejs/package-maintenance

branch_name: refs/heads/main

extension: md

gha_license_id: NOASSERTION

license_type: permissive

repo_name: nodejs/package-maintenance


text:
# LECTURE_02_06

# Annoucements

* Exam 1 week from today
* Fair Game:
    * H00-H06, IC00, IC01
    * Lectures through 02/08
    * lab00, lab01, lab02, proj00
    * Readings in book that go with homework and ic00

# Intellij

* Commercial IDE for Java
* Community edition is Free and Open Source
* UCSB CMPSC56 students encouraged to install on personal Mac, Win, Linux systems
* Possibly available on CSIL at this link
    * This is a fresh "guerrila" install, not an official one
    * It is inadequately tested, but it might work.  Give it a try.
    * It will work best if you are physically at a CSIL or Phelps 3526 terminal--doing this over remote X11 access will probably be painful, or not work at all
    * The command to type: `/cs/faculty/pconrad/intellij/bin/idea.sh`

# Guest Lecture Dillon Kearns

## Legacy Code Refactoring Exercise

See the legacy refactoring exercise we did today executed by two experienced software craftsmen on youtube: [Practical Refactoring: how to clean code in many small steps](https://www.youtube.com/watch?v=aWiwDdx_rdo).
Also download the [code from the exercise](https://github.com/tonytvo/coderetreat/tree/c89ebf3e92fff5a95fdc80d37e3a4a66cf877931/refactoring/chartsmart) or check out [more legacy code refactoring exercises in Java and other languages](https://github.com/legacycoderocks/awesome-legacy-code).

## Experiences with bad code

* bad variable names
* shadowed parameters
* classes were named `Class1`, `Class2`, etc.
* many others...

When editing bad code, you have an uneasy feeling about changing it.

# Four concepts from Dillon Kearns

* Self-documenting code
    * You don't need comments to tell you what it does
    * That's because of good choices of variables names, method names, structure
    * Comments are "lies waiting to happen"
        * Your code will break if you make changes
        * But comments stay, even if they are untrue
    * Learn more about the process of naming from this article: [Good naming is a process, not a single step](http://arlobelshee.com/good-naming-is-a-process-not-a-single-step/)

* Microcommits
    * Not being afraid to put something into version control

* Safe Refactoring
    * Especially if you have an IDE
    * The IDE can help you do refactoring in a way that is guaranteed to be safe
        * E.g. renaming `Class1, Class2, Class3` to `User, Student, Instructor` the IDE can help you do that without introducing any changes.

* Incremental improvement
    * Really important in refactoring; some student were afraid to make a change because they didn't know what the perfect change was
    * Give yourself permission to make a change that makes it better, even if it doesn't make it perfect.
    * Don't let perfect be enemy of the good (or better)

# Why do we refactor?

# Mobbing/Pairing

Download Mobster, the mob/pair timer app we used, at [mobster.cc](http://mobster.cc).

## Strong Style Pairing

* <http://llewellynfalco.blogspot.com/2014/06/llewellyns-strong-style-pairing.html>

# Short cut keys for refactoring in Intellij

* `Alt-Enter` gives you a quick hint (or click the light bulb)
    * Example of a safe-refactor: convert a `switch` statement to an equivalent `if/else`
    * Doesn't need to be tested (unless you are paranoid)---you are relying on the IDE's guarantee that the `switch` and `if/else` are semantically equivalent.
* `Control-T` for "refactor this"
    * Context specific menu of various ways of refactoring the code.
* `Control-R` for run all tests

# The approach

* We do NOT try to understand the WHOLE THING, and then do a PERFECT refactor of the whole thing.
* We do the opposite
* We make small incremental changes a little bit at a time.
* We only try to understand a small piece at a time.
* Eventually, the big picture good grand design reveals itself.

branch_name: refs/heads/master


text:
# DocnmockGithub

This is a very simple example of how to use
[Docnmock](https://github.com/antonio/docnmock) to describe an API.

To see how a client application can benefit of using `docnmock`, please see [the
client example](https://github.com/antonio/github-user-info).

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/antonio/docnmock_github/trend.png)](https://bitdeli.com/free "Bitdeli Badge")


text:
# SolidFrame Releases

## Backlog

* solid_frame_mpipc: SOCKS5
* solid_frame_mpipc: test with thousands of connections
* DOCUMENTAION: API
* solid_serialization: test agaist ProtoBuf and FlatBuffers

## Version 2.1
* (DONE) solid_frame_aio_openssl: Improved OpenSSL/BoringSSL support
* (DONE) solid_frame_mpipc: Pluggable (header only) support for SSL
* (DONE) BUILD: Android support - https://github.com/vipalade/bubbles
* (DONE) solid_serialization: Support for std::bitset, std::vector<bool> and std::set
* (DONE) solid_serialization: Test suported stl containers.
* (DONE) BUILD: Support for CMake extern command for find_package(SolidFrame)
* (DONE) solid_frame_mpipc: Basic, pluggable compression support using [Snappy](https://google.github.io/snappy/)
* (DONE) TUTORIAL: mpipc_request_ssl

## Version 2.0
* Fix utility memoryfile examples
* pushCall instead of pushReinit
* Finalizing the MPIPC library.
* Cross-platform support:
	* Linux
	* FreeBSD
	* Darwin/OSX (starting with XCode 8 for thread_local)
* Add "make install" support.
* Documentation.

repository: zodsoft/solidframe

repo_name: zodsoft/solidframe


text:
---
path: "/projects/how-to-sleep"
date: "2019-06-01"
title: "How To Sleep"
tags: ["js", "netlify", "illustration", "design"]
excerpt: "A website which informs people on how to get a better night of sleep."
featuredImage: "/howtosleep.png"
projectLink: "https://howtosleep.bailouni.com"
templateKey: project-page
---

This project was built in response to a brief which required us to build a 'how-to' guide - with the medium and content being upto us.

I had just listened to the [Matthew Walker & Joe Rogan Podcast](https://www.youtube.com/watch?v=pwaWilO_Pig) (which I highly recommend!) so I was inspired to share some knowledge I gained from this podcast.
This was my first time using a wacom tablet to make illustrations and it was a fun little process. I think the hand drawn illustrations add a nice effect and the animations elevate it to that next level.
I also played around with parallax scrolling effects on images, which was a new experience for me.

I hope people will find this guide resourceful, because it was great fun to make! You can see it live at <https://howtosleep.bailouni.com>

gha_language: JavaScript

gha_license_id: MIT


text:
---
title: "Security"
---

ACCESS complies with the [REFEDS Security Incident Response Trust Framework for Federated Identity](https://refeds.org/sirtfi).

If you suspect a security incident or if your account has been compromised please contact the ACCESS Help Desk immediately via <https://support.access-ci.org/open-a-ticket>.

repository: cilogon/access-identity

gha_language: HTML

repo_name: cilogon/access-identity


text:
# SerialQueue
Lightweight C# implementation of FIFO serial queues from ObjC, which are often much better to use for synchronization rather than locks - they don't block caller's thread, and rather than creating new threads - they use thread pool.

    readonly SerialQueue queue = new SerialQueue();

    async Task SomeAsyncMethod()
    {
        // C# 5+
        var result = await queue.Enqueue(WorkForSerialQueue);

        // Old approach
        queue.Enqueue(WorkForSerialQueue).ContinueWith(t => {
            var result = t.Result;
        });
    }

repository: rihadavid/SerialQueue

repo_name: rihadavid/SerialQueue


text:
# ProgrammableServer

(This will be upgraded to the version in develop Very Soon Now. See the README.md for an overview of what's coming.)

If you are a Python programmer wanting to set up a server for your
own application,  if you don't need a high volume, general purpose
server and are put off by the complexities of Apache and
BaseHTTPServer, then ProgrammableServer may be for you.  It is easy
to setup and, if necessary, reconfigure.

With ProgrammableServer, you can create a simple or complex
application whose demands on a web server are few.  You do this by
writing one or more *expanders* each of which handles a single kind
of request.  Writing an expander is made easier because you have a
choice of mixins to include.  An expander mixin consists of a few
functions that provide an environment customized to your needs.

Web servers send browser requests to handlers for processing.  The
ProgrammableServer's handler expects each expander to look over
a request and then to do one of three things:

- handle the request
- report an error
- pass the request on to the next expander

In the first two cases, a response is sent and expanders further
down in your list of expanders are ignored.

If the expander list is exhausted without handling the request, then
what happens will depend on whether it is a GET or POST request.  If a
GET request then Python's SimpleHTTPRequestHandler takes over to
serve a file from the directory tree determined in the configuration
file `config.py`.  If a POST request then a "not found" message is
sent.

The `config.py` file is also used to set up separate expander lists
for GET and POST requests.

You can set up the ProgrammableServer and run the example expander
applications this way

1. install Python 2.7
2. download and unzip this application
3. run serve.py

If your computer is set to run Python 2.7 on `.py` files, you can
just click on `serve.py`.  By default it will run with `localServe` set to
`True` and so will only serve browsers on the same computer.

The sample applications are

**shutdown** (localhost/shutdown)

> Shuts the server down (only works when `localServe` is `True`)

**echo** (localhost/echo)

> An example whose source code shows how to set up
> Ajax/JSON communication with the server.

**uploadPic** (localhost/uploadPic)

> An example which uploads jpg files;  the target directory is
> controllable through `config.py`.  The default sets it  to the
> `uploads` subdirectory of the directory containing `serve.py`

> As with all these sample expanders, the real value to you from
this example comes
> from reading the source code so you will know how to make your
> own.

**showRequestParameters** (localhost/showRequestParameters...)

> An investigating application that shows the request path, a table of HTTP declarations, and a table
> of query string declarations.  You can expand the URL however you
> like, for example:

> `localhost/showRequestParameters/onward?id=myself`

There are two other sample expanders in the GET list, `send_js_css` and
`countSimpleServes`, but if you try to get them with your browser you
will be told "File not Found".   This is because they do their thing
without actually handling the request and sending something to the
browser.

The `send_js_css` expander should appear in the GET list before any
expander you create.  What it does is serve up your Javascript and
css pages.  This is necessary because when your expander serves up a
page, SimpleHTTPRequestHandler will be skipped.  Thus some other
way to serve Javascript and css files for that page is needed.

The `countSimpleServes` expander is an example of how information
can be saved in the server state.  Saving information in the server
state enables information to be saved from one request to another.
The information saved by `countSimpleServes` is the number of times
SimpleHTTPRequestHandler has been used to serve a static page since
the server was started.  This
information is printed to the console window that pops up when
`serve.py` runs.

There are only two expanders in the POST list.  One talks to the `echo`
page with Ajax/JSON.  The other saves uploaded pictures.

When an expander executes, a `using` function is installed into its global
space.  What `using` does is to allow mixins to be installed
into local spaces.  The mixins are located in the
`expander_mixins` directory and are well commented.  You can write
your own as well.

I am planning a 3 volume set of short, inexpensive ebooks about this software.
Volume I will be about writing expanders.  Volume II will be about
writing expander mixins.  Volume III will explain three nontrivial
applications.  They will be published by Bonsai Reads and they will
be available
through Amazon, Apple, Barnes & Noble, and others.

### Rant

Once upon a time there was a flurry of research into what consituted a good software module and how good software modules should interface with each other.

Then along came object-orientation with promises of encapsulation and inheritance that seemed to make that research obsolete.

The result has not been pretty. An object definition may describe methods for these purposes

- Object creation
- Object's external interface
- Object's internal methods
- Object's abstract internal methods to be defined in subclasses
- Object's defined abstract methods establishing superclass behavior.
- Object's redefined methods changing superclass behavior.
- Callback methods received as parameters.

Other lists of purposes could be compiled but this one makes the point.

The software community's response to this complexity has been to turn to the study of patterns. This has been helpful because a pattern is like a map that helps us understand complex terrain.

However a map does not simplify the terrain.  A pattern can simplify
the coding process but it does not necessarily simplify the code.  That only
happens when one takes the time to think about the design.

Python's SimpleHTTPRequestHandler is an example of a class with disparate methods from the class and its superclass. Extending it by subclassing would merely boil this mess over the container of the average mind.

The ProgrammableServer relies on a ProgrammableRequestHandler class
which is a subclass of SimpleHTTPRequestHandler that hides rather
than augments its complexity.

[J Adrian Zimmer](http://www.jazimmer.net)

repository: J-Adrian-Zimmer/ProgrammableServer

repo_name: J-Adrian-Zimmer/ProgrammableServer


text:
# 3 этап - нагрузочное тестирование

## Инструменты

Для нагрузки был использован wrk, скрипты для генерации нагрузки лежат в папке load.

Профилирование было осуществлено с помощью jvisualvm.

## ТЕСТИРОВАНИЕ ДО ОПТИМИЗАЦИЙ

### PUT без перезаписи с replicas=2/3

#### 2 threads and 4 connections:
```sh
wrk --latency -c4 -d2m -s putReplicasTwoThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.57ms    3.34ms 176.13ms   93.89%
    Req/Sec    49.48      6.72    60.00     55.68%
  Latency Distribution
     50%   38.07ms
     75%   38.72ms
     90%   39.96ms
     99%   42.95ms
  11865 requests in 2.00m, 1.06MB read
Requests/sec:     98.80
Transfer/sec:      9.07KB
```

---

#### 4 threads and 4 connections:
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasTwoThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.56ms    2.47ms 146.56ms   90.87%
    Req/Sec    24.74      5.01    30.00     53.36%
  Latency Distribution
     50%   38.10ms
     75%   38.66ms
     90%   40.20ms
     99%   42.94ms
  11868 requests in 2.00m, 1.06MB read
Requests/sec:     98.83
Transfer/sec:      9.07KB
```
---

### PUT без перезаписи с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasThreeThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.63ms    3.63ms 157.69ms   93.06%
    Req/Sec    47.15      7.93    60.00     77.57%
  Latency Distribution
     50%   39.32ms
     75%   42.04ms
     90%   42.92ms
     99%   50.64ms
  11306 requests in 2.00m, 1.01MB read
Requests/sec:     94.19
Transfer/sec:      8.65KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    41.04ms    3.91ms 174.11ms   91.31%
    Req/Sec    23.41      4.82    30.00     65.00%
  Latency Distribution
     50%   41.35ms
     75%   42.36ms
     90%   43.41ms
     99%   50.83ms
  11232 requests in 2.00m, 1.01MB read
Requests/sec:     93.54
Transfer/sec:      8.59KB
```
---

### На имеющихся данных GET без повторов с replicas=2/3:

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasTwoThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.73ms    3.13ms 167.26ms   88.22%
    Req/Sec    49.09      7.70    60.00     41.49%
  Latency Distribution
     50%   39.94ms
     75%   40.02ms
     90%   43.90ms
     99%   48.01ms
  11769 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11769
Requests/sec:     98.06
Transfer/sec:      9.20KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasTwoThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.72ms    3.09ms 161.36ms   86.99%
    Req/Sec    24.55      5.03    30.00     53.92%
  Latency Distribution
     50%   39.93ms
     75%   40.02ms
     90%   43.90ms
     99%   48.06ms
  11772 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11772
Requests/sec:     98.08
Transfer/sec:      9.20KB
```

---

### На имеющихся данных GET без повторов с replicas=3/3:

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasThreeThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.54ms    2.85ms 159.68ms   88.11%
    Req/Sec    49.32      6.86    60.00     53.76%
  Latency Distribution
     50%   39.92ms
     75%   39.99ms
     90%   43.83ms
     99%   47.92ms
  11822 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11822
Requests/sec:     98.48
Transfer/sec:      9.24KB
```

---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasThreeThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.67ms    3.00ms 159.21ms   86.15%
    Req/Sec    24.58      5.03    30.00     53.59%
  Latency Distribution
     50%   39.93ms
     75%   40.01ms
     90%   43.88ms
     99%   48.00ms
  11788 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11788
Requests/sec:     98.20
Transfer/sec:      9.21KB
```
---

### PUT c перезаписью с replicas=2/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasRepeatTwoThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.88ms    2.60ms 141.57ms   89.55%
    Req/Sec    49.31      6.84    60.00     53.19%
  Latency Distribution
     50%   38.46ms
     75%   38.84ms
     90%   41.69ms
     99%   43.34ms
  11823 requests in 2.00m, 1.06MB read
Requests/sec:     98.47
Transfer/sec:      9.04KB
```
---
#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.99ms    3.68ms 192.10ms   96.57%
    Req/Sec    24.66      5.02    30.00     53.69%
  Latency Distribution
     50%   38.53ms
     75%   38.84ms
     90%   41.86ms
     99%   42.94ms
  11828 requests in 2.00m, 1.06MB read
Requests/sec:     98.51
Transfer/sec:      9.05KB
```
---

### PUT c перезаписью с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasRepeatThreeThree.lua http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.91ms    3.36ms 139.93ms   91.12%
    Req/Sec    46.92      7.22    60.00     83.80%
  Latency Distribution
     50%   40.78ms
     75%   42.44ms
     90%   43.56ms
     99%   50.43ms
  11252 requests in 2.00m, 1.01MB read
Requests/sec:     93.69
Transfer/sec:      8.60KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    41.37ms    5.48ms 243.49ms   96.93%
    Req/Sec    23.29      4.80    30.00     65.99%
  Latency Distribution
     50%   41.50ms
     75%   42.53ms
     90%   45.34ms
     99%   54.19ms
  11174 requests in 2.00m, 1.00MB read
Requests/sec:     93.04
Transfer/sec:      8.54KB
```
---

### GET c перезаписью с replicas=2/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.96ms    3.55ms 182.40ms   96.88%
    Req/Sec    48.83      6.94    60.00     52.00%
  Latency Distribution
     50%   39.94ms
     75%   40.06ms
     90%   43.93ms
     99%   50.43ms
  11707 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11707
Requests/sec:     97.54
Transfer/sec:      9.15KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.91ms    3.55ms 180.64ms   96.99%
    Req/Sec    24.44      5.01    30.00     54.86%
  Latency Distribution
     50%   39.94ms
     75%   40.05ms
     90%   43.93ms
     99%   48.07ms
  11721 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11721
Requests/sec:     97.65
Transfer/sec:      9.16KB
```
---

### GET c перезаписью с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.82ms    3.19ms 170.29ms   95.57%
    Req/Sec    48.98      7.19    60.00     48.25%
  Latency Distribution
     50%   39.94ms
     75%   40.04ms
     90%   43.92ms
     99%   48.00ms
  11741 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11741
Requests/sec:     97.83
Transfer/sec:      9.17KB
```
---
#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    41.16ms    3.92ms 190.14ms   95.59%
    Req/Sec    24.29      5.01    30.00     55.93%
  Latency Distribution
     50%   39.95ms
     75%   40.13ms
     90%   43.96ms
     99%   51.98ms
  11654 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11654
Requests/sec:     97.06
Transfer/sec:      9.10KB
```

## ТЕСТИРОВАНИЕ ПОСЛЕ ОПТИМИЗАЦИЙ

### PUT без перезаписи с replicas=2/3

#### 2 threads and 4 connections:
```sh
wrk --latency -c4 -d2m -s putReplicasTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.68ms    3.91ms 185.91ms   97.89%
    Req/Sec    49.28      6.50    60.00     58.79%
  Latency Distribution
     50%   38.06ms
     75%   38.61ms
     90%   41.48ms
     99%   42.98ms
  11813 requests in 2.00m, 1.06MB read
Requests/sec:     98.39
Transfer/sec:      9.03KB
```
---

#### 4 threads and 4 connections:
```sh
wrk --latency -c4 -d2m -s putReplicasTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.70ms    2.75ms 147.37ms   89.43%
    Req/Sec    49.22      7.00    60.00     51.21%
  Latency Distribution
     50%   38.09ms
     75%   38.66ms
     90%   41.54ms
     99%   44.15ms
  11805 requests in 2.00m, 1.06MB read
Requests/sec:     98.30
Transfer/sec:      9.03KB
```
---

### PUT без перезаписи с replicas=3/3:

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    41.40ms    5.37ms 229.78ms   97.27%
    Req/Sec    45.89      8.09    60.00     79.73%
  Latency Distribution
     50%   41.40ms
     75%   42.22ms
     90%   44.47ms
     99%   50.54ms
  10999 requests in 2.00m, 0.99MB read
Requests/sec:     91.62
Transfer/sec:      8.41KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    41.41ms    3.69ms 158.71ms   88.83%
    Req/Sec    23.11      4.68    30.00     68.19%
  Latency Distribution
     50%   41.46ms
     75%   42.34ms
     90%   45.23ms
     99%   50.69ms
  11090 requests in 2.00m, 0.99MB read
Requests/sec:     92.35
Transfer/sec:      8.48KB
```
---

### На имеющихся данных GET без повторов с replicas=2/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.97ms    3.38ms 165.94ms   96.71%
    Req/Sec    48.83      6.99    60.00     51.42%
  Latency Distribution
     50%   39.94ms
     75%   40.07ms
     90%   43.94ms
     99%   49.12ms
  11707 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11707
Requests/sec:     97.49
Transfer/sec:      9.14KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.87ms    3.23ms 153.86ms   96.51%
    Req/Sec    24.46      5.01    30.00     54.97%
  Latency Distribution
     50%   39.94ms
     75%   40.05ms
     90%   43.92ms
     99%   50.24ms
  11735 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11735
Requests/sec:     97.72
Transfer/sec:      9.16KB
```

---

### На имеющихся данных GET без повторов с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.95ms    3.42ms 171.79ms   96.44%
    Req/Sec    48.84      6.85    60.00     53.17%
  Latency Distribution
     50%   39.94ms
     75%   40.06ms
     90%   43.93ms
     99%   51.87ms
  11710 requests in 2.00m, 1.07MB read
  Non-2xx or 3xx responses: 11710
Requests/sec:     97.52
Transfer/sec:      9.15KB
```
---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.56ms    1.89ms 109.43ms   85.13%
    Req/Sec    24.62      4.99    30.00     53.45%
  Latency Distribution
     50%   39.94ms
     75%   40.03ms
     90%   43.87ms
     99%   47.04ms
  11811 requests in 2.00m, 1.08MB read
  Non-2xx or 3xx responses: 11811
Requests/sec:     98.38
Transfer/sec:      9.23KB
```
---

### PUT c перезаписью с replicas=2/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.90ms    6.48ms 275.64ms   99.36%
    Req/Sec    49.20      6.98    60.00     52.84%
  Latency Distribution
     50%   38.09ms
     75%   38.71ms
     90%   41.70ms
     99%   43.58ms
  11790 requests in 2.00m, 1.06MB read
Requests/sec:     98.18
Transfer/sec:      9.02KB
```

---

#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.56ms    1.77ms 115.19ms   87.48%
    Req/Sec    24.68      4.99    30.00     53.73%
  Latency Distribution
     50%   38.09ms
     75%   38.56ms
     90%   41.44ms
     99%   42.83ms
  11848 requests in 2.00m, 1.06MB read
Requests/sec:     98.68
Transfer/sec:      9.06KB
```
---

### PUT c перезаписью с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s putReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.53ms    1.89ms 119.32ms   86.40%
    Req/Sec    49.26      6.81    60.00     53.21%
  Latency Distribution
     50%   38.03ms
     75%   38.46ms
     90%   41.48ms
     99%   42.96ms
  11818 requests in 2.00m, 1.06MB read
Requests/sec:     98.44
Transfer/sec:      9.04KB
```
---
#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s putReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.55ms    1.81ms 113.00ms   86.94%
    Req/Sec    24.66      4.98    30.00     54.04%
  Latency Distribution
     50%   38.06ms
     75%   38.54ms
     90%   41.46ms
     99%   42.98ms
  11837 requests in 2.00m, 1.06MB read
Requests/sec:     98.58
Transfer/sec:      9.05KB
```
---

### GET c перезаписью с replicas=2/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasRepeatTwoThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.33ms    1.36ms  51.85ms   88.08%
    Req/Sec    49.54      7.84    60.00     38.36%
  Latency Distribution
     50%   39.92ms
     75%   40.00ms
     90%   43.56ms
     99%   44.09ms
  11877 requests in 2.00m, 4.97MB read
  Non-2xx or 3xx responses: 7882
Requests/sec:     98.94
Transfer/sec:     42.36KB
```
---
#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasRepeatTwoThree.lua http://localhost:8080
 http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.37ms    1.74ms  92.07ms   87.55%
    Req/Sec    24.74      5.00    30.00     52.48%
  Latency Distribution
     50%   39.93ms
     75%   40.00ms
     90%   43.81ms
     99%   44.08ms
  11866 requests in 2.00m, 12.47MB read
Requests/sec:     98.84
Transfer/sec:    106.38KB
```
---

### GET c перезаписью с replicas=3/3

#### 2 threads and 4 connections
```sh
wrk --latency -c4 -d2m -s getReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  2 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.29ms    1.46ms  62.53ms   88.63%
    Req/Sec    49.58      7.48    60.00     44.03%
  Latency Distribution
     50%   39.92ms
     75%   39.99ms
     90%   42.86ms
     99%   44.04ms
  11887 requests in 2.00m, 12.49MB read
Requests/sec:     99.03
Transfer/sec:    106.57KB
```
---
#### 4 threads and 4 connections
```sh
wrk --latency -t4 -c4 -d2m -s getReplicasRepeatThreeThree.lua http://localhost:8080
http://localhost:8080
Running 2m test @ http://localhost:8080
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    40.37ms    1.79ms 113.89ms   86.99%
    Req/Sec    24.73      5.01    30.00     51.90%
  Latency Distribution
     50%   39.93ms
     75%   40.00ms
     90%   43.82ms
     99%   44.06ms
  11870 requests in 2.00m, 12.48MB read
Requests/sec:     98.84
Transfer/sec:    106.38KB
```

### ИТОГИ
К основным оптимизацям можно отнести добавление кеширования часто используемых объектов и работу над DAO. В результате имеет место повышение количества обработанных запросов и RPS в целом. Каждый тест проводился в течение 2 минут.


text:
# About

Nodejs cli that helps to create a new plugin for flextool. Bootstrap a new project from a template.

NOTE: Template contain filenames that may be invalid on Windows, so use tools like Docker under Windows.

## Usage

Install NodeJs and npm: https://nodejs.org/en/download/

```bash
# Tested with NodeJs v10.18.1
node -v

# TypeScript Installation
npm install -g typescript
```

Install requirements:

```bash
# `--no-audit` because no need in security audit for project generator.
npm install --no-audit
```

Build:

```bash
npm run build
```

Run:

```bash
node ./dist/index.js \
  --name my_plugin_name \
  --copyright my_plugin_copyright \
  --template external_plugin

# open generated folder based on `--name`
cd my_plugin_name
```

## Standing on the Shoulders of Giants

Project inspired by articles:
- https://dev.to/duwainevandriel/build-your-own-project-template-generator-59k4
- https://medium.com/@pongsatt/how-to-build-your-own-project-templates-using-node-cli-c976d3109129

## How add new cli options (like desired project name)

1. edit `TemplateData` in `src/utils/template.ts`
2. `QUESTIONS` and `CliOptions` in `src/index.ts`
3. Map `answers` to `CliOptions` like so:
   ```js
   const projectName = answers['name'];
   ```
4. Pass new option into `template.render` like so:
   ```js
   template.render(contents, { projectName });
   ```

## How to run template engine on desired files

Use in contents of desired files ejs template syntax i.e. `<%= projectName %>`

Use in filenames of desired files ejs template syntax i.e. `<%= projectName %>`


text:
ember-scaffold
==============

Starter scaffolding for an ember app built using bower, grunt, coffescript, ember.js, and jasmine.js

Simply clone and run

    $bower install --save
    $grunt install --save-dev
    $grunt compile
    $grunt watch

and you are up and running!

The app directory contains the ember app in uncompiled coffescript and emberscript templates. With grunt watch running, it will automatically compile and concatenate the coffescript into app.js in the dist/assets directory and the emblem into templates.js in the dist/assets directory.

The dist directory contains the index.html and most recent compiled copy of the app.js, temp.js, and lib.min.js which contains the basic associated dependencies. Running $grunt concat will concat the dependencies installed by bower and place them in lib.min.js in the dist/assets directory.

The specs directory contains the jasmine.js files, with the src file containing coffeescript versions. The coffeescript will autocompile with grunt watch and changes to the .js files will trigger the test suite.

src contains the Gruntfile.coffee file. The _lib sub-directory is where bower will install it's dependancies, while the js folder is where the grunt copy task copies the needed dependency files.

styles contains the uncompiled scss and the vendor folder is where the grunt copy function copies the scss bootstrap files. Running '$grunt scss' will compile app.scss and place it in dist/assets.

the tasks folder contains all of the grunt task config files which have been separated out from the gruntfile into js modules. The src directory contains coffeescript versions.

repository: CNDW/statictrash

repo_name: CNDW/statictrash


text:
# Tutorial - Binary classification of chest X-rays
> In this tutorial we will build a classifier that distinguishes between chest X-rays with pneumothorax and chest X-rays without pneumothorax. The image data is loaded directly from the DICOM source files, so no prior DICOM data handling is needed.

```python
from fastai.basics import *
from fastai.callback.all import *
from fastai.vision.all import *
from fastai.medical.imaging import *

import pydicom

import pandas as pd
```

To use `fastai.medical.imaging` you'll need to:

```bash
conda install pyarrow
pip install pydicom kornia opencv-python scikit-image
```

## Download and import of X-ray DICOM files

First, we will use the [`untar_data`](/data.external.html#untar_data) function to download the _siim_small_ folder containing a subset (250 DICOM files, \~30MB) of the [SIIM-ACR Pneumothorax Segmentation](https://doi.org/10.1007/s10278-019-00299-9) \[1\] dataset.
The downloaded _siim_small_ folder will be stored in your _\~/.fastai/data/_ directory. The variable `pneumothorax-source` will store the absolute path to the _siim_small_ folder as soon as the download is complete.

```python
pneumothorax_source = untar_data(URLs.SIIM_SMALL)
```

The _siim_small_ folder has the following directory/file structure:

![siim_folder_structure.jpg](/images/siim_folder_structure.jpeg)

### Plotting the DICOM data

To analyze our dataset, we load the paths to the DICOM files with the [`get_dicom_files`](/medical.imaging.html#get_dicom_files) function. When calling the function, we append _train/_ to the `pneumothorax_source` path to choose the folder where the DICOM files are located. We store the path to each DICOM file in the `items` list.

```python
items = get_dicom_files(pneumothorax_source/f"train/")
```

Next, we split the `items` list into a train `trn` and validation `val` list using the [`RandomSplitter`](/data.transforms.html#RandomSplitter) function:

```python
trn,val = RandomSplitter()(items)
```

To plot an X-ray, we can select an entry in the `items` list and load the DICOM file with `dcmread`. Then, we can plot it with the function `show`.

```python
patient = 3
xray_sample = dcmread(items[patient])
xray_sample.show()
```

![png](output_14_0.png)

Next, we need to load the labels for the dataset. We import the _labels.csv_ file using pandas and print the first five entries. The **file** column shows the relative path to the _.dcm_ file and the **label** column indicates whether the chest x-ray has a pneumothorax or not.

```python
df = pd.read_csv(pneumothorax_source/f"labels.csv")
df.head()
```

      file
      label

      0
      train/No Pneumothorax/000000.dcm
      No Pneumothorax

      1
      train/Pneumothorax/000001.dcm
      Pneumothorax

      2
      train/No Pneumothorax/000002.dcm
      No Pneumothorax

      3
      train/Pneumothorax/000003.dcm
      Pneumothorax

      4
      train/Pneumothorax/000004.dcm
      Pneumothorax

Now, we use the [`DataBlock`](/data.block.html#DataBlock) class to prepare the DICOM data for training.

```python
pneumothorax = DataBlock(blocks=(ImageBlock(cls=PILDicom), CategoryBlock),
                   get_x=lambda x:pneumothorax_source/f"{x[0]}",
                   get_y=lambda x:x[1],
                   batch_tfms=aug_transforms(size=224))
```

Additionally, we plot a first batch with the specified transformations:

```python
dls = pneumothorax.dataloaders(df.values)
dls.show_batch(max_n=16)
```

![png](output_20_0.png)

## Training

We can then use the [`cnn_learner`](/vision.learner.html#cnn_learner) function and initiate the training.

```python
learn = cnn_learner(dls, resnet34, metrics=accuracy)
learn.fit_one_cycle(1)
```

      epoch
      train_loss
      valid_loss
      accuracy
      time

      0
      1.250138
      1.026524
      0.560000
      00:03

```python
learn.predict(pneumothorax_source/f"train/Pneumothorax/000004.dcm")
```

    ('Pneumothorax', tensor(1), tensor([0.2858, 0.7142]))

```python
tta = learn.tta(use_max=True)
```

  <progress value='4' class='' max='4', style='width:300px; height:20px; vertical-align: middle;'></progress>
  100.00% [4/4 00:02<00:00]

  <progress value='1' class='' max='1', style='width:300px; height:20px; vertical-align: middle;'></progress>
  100.00% [1/1 00:00<00:00]

```python
learn.show_results(max_n=16)
```

![png](output_26_1.png)

```python
interp = Interpretation.from_learner(learn)
```

```python
interp.plot_top_losses(2)
```

![png](output_28_0.png)

_**Citations:**_

\[1\] _Filice R et al. Crowdsourcing pneumothorax annotations using machine learning annotations on the NIH chest X-ray dataset.  J Digit Imaging (2019). https://doi.org/10.1007/s10278-019-00299-9_

repository: iyaja/fastai

repo_name: iyaja/fastai


text:
# OS.js on Arduino

OS.js runs on Arduino with an official build: https://github.com/arduino-org/Arduino-OS

A ready built package is available via official `opkg` repository named **arduinoos**.

This build uses **Lua** which was spesifially made to use `uhttpd` (openwrt).

## Make your own image

Make sure to use the `arduino` branch for this

```
./bin/build-opkg.sh osjs 2.0.0-VERSION ar71xx arduino
```


text:
# Architecture #

This file documents the architecture of the source-ir-fitter tool. For
the javadoc documentation, run `./gradlew javadoc` in the top-level
directory of this repository.

This tool takes as input a Java/Kotlin/Groovy program, in both source
and IR (bytecode/dex) format.

## Pipeline #

The following is a high-level view of the processing pipeline:

1. The IR is parsed and an appropriate IR model is constructed
   (classes in package `org.clyze.source.irfitter.ir.model`). This
   model represents as much of the IR as needed to aid source-element
   resolution. In particular, types are fully resolved
   (fully-qualified).

2. The source is parsed and an appropriate source model is constructed
   (classes in package `org.clyze.source.irfitter.source.model`).
   * As in the previous step, the tool records that some elements may be
   nested under other elements.
   * On the other hand, elements such as types may not be fully-qualified
     (i.e. `String` instead of `java.lang.String`).
   * Element usages (such as annotation usages or class constants) are
     also recorded.

3. Type matching is performed, per source file (class `SourceFile`):
   each source type is compared with the IR types, until a match
   happens. Unqualified source type resolution uses source code
   imports to match against the IR types.

4. For every source-IR type match, their nested source-IR members
   (fields/methods) are also matched. Fields match by name while
   methods may match by name, number of arguments, or full signature.

5. For every source-IR method match, method invocation instructions
   are also matched between the source and the IR.

6. For every source-IR method match, `new T()` instructions ("heap
   allocations") are also matched between the source and the IR.

7. When all elements have been resolved, element usages are resolved.

## JSON mode ##

In JSON output mode, every source code element generates its
[metadata-model](https://github.com/clyze/metadata-model)-equivalent
object.

## Doop mode ##

In Doop analysis mapping mode, the Doop results are read back via
Doop's "code-processor" library. These results are then rewritten to
reference source elements instead of IR elements. The result is
written out in SARIF format.

## Parsers

* Java: [JavaParser](https://javaparser.org/)
* Groovy: [Parrot parser](https://github.com/danielsun1106/groovy-parser)
* Kotlin: [kotlin-formal](https://github.com/antlr/grammars-v4/tree/master/kotlin/kotlin-formal)

repository: happinessyeah/source-ir-fitter

repo_name: happinessyeah/source-ir-fitter


text:
# fast_cnn_mnist

Meant to be a speed test for a new GPU. ~8s/Epoch on RTX 2080

Shallow CNN gives 98% accuracy after one epoch on the MNIST dataset.

Single convolutional layer, and the prediction layer.

Inspired by the keras' team post here: https://github.com/keras-team/keras/blob/master/examples/mnist_cnn.py


text:
A simple e-commcerce as SPA
===========================

Getting started
---------------
Make sure you have installed the latest version of nodejs together with its default package manager: "npm" and do:

        $ npm install
        $ npm run build
        $ http-server dist -c -1

And go to"http://localhost:8080/".

repository: idleman/ecommerce

repo_name: idleman/ecommerce


text:
# LifeVoiceServer

## 1 - Setup

- Clone this repo
- Download **dotnet** from the Microsoft [website](https://dotnet.microsoft.com/download).
*Please install this precise version: 3.1.403*
- Check the installation with the command : `dotnet --version`. You should obtain this output result : `3.1.403`.

## 2 - Launch the LiveVoice server

- Move into the `serverLV` directory.
- Run the command `dotnet run`. You should obtain this output :
`Starting server ... Server started on Port X.`

## 3 - Lauch the client

TODO: move this to the client repo Markdown ?

repository: matchollet/LifeVoiceServer

repo_name: matchollet/LifeVoiceServer


text:
# ViraTrace - HE

Implementation of [ViraTrace](https://github.com/ViraTrace/InfectionModel) approach of distributed contact tracing
and infection risk estimation using homomorphic encryption, implemented using [Microsoft SEAL](https://github.com/microsoft/SEAL).

This approach enhances the privacy of the nodes in the network.

## Contents

- [Setup](#setup)
- [ViraTrace Summary](#viratrace-summary)
- [Homomorphic Encryption](#homomorphic-encryption)
- [Advantages](#advantages)
- [Performance](#performance)

## Setup

Adapt the steps from the Dockerfile for your platform, or build the container and use the shell of a running instance.

## ViraTrace Summary

ViraTrace is a simulation based approach for ranking risk (i.e. probability of being infected) in a network. In the
paper, it is demonstrated that this approach elegantly accounts for the degree of contact and network topology,
while being free of the paradoxes of some of the alternative approaches.

### State

1. A node's state is modelled as a vector of booleans.
1. The count of values that are `true` is interpreted as the risk score.
1. The length of the vector is interpreted as the number of simulations being run in parallel.
1. A node with a confirmed diagnosis has a risk score equal to the simulation size, while one who has no possibility of
the disease has a risk score of zero.

### Infectivity

1. The infectivity (i.e. probability of transmission) of a node is modelled as a vector of booleans. The values may be
interpreted as iid draws from a latent Bernoulli variable.
1. The function that gives success probability of the latent bernoulli variable sampled to get the infectivity vector is
isomorphic to the one that gives the _true_ infectivity, but is transformed to give a usable distribution of risk scores for
a _reasonable_ simulation size.

### Transmission

1. A node's transmission likelihood is the logical conjunction of a its state and its infectivity.
1. A node's posterior risk score is the logical disjunction of its state and the transmission likelihood of the other node.

### Example

As an example, say Alice and Bob meet with their prior state vectors given by:

```
alice_prior = [0, 1, 1, 1, 0, 0, 0, 1, 1, 0]
bob_prior   = [1, 1, 0, 1, 0, 0, 0, 0, 0, 1]
```

The probabilty of Alice transmitting the infection to Bob is 0.3 (calculated using her current state, duration of contact,
distance etc.). The infectivity and likelihood vectors for Alice, and the posterior risk score for Bob are given by:

```
alice_infectivity = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0] // can vary between runs
alice_likelihood  = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
bob_posterior     = [1, 1, 1, 1, 0, 0, 0, 0, 0, 1]
```

## Homomorphic Encryption

The private data held by each node is its state vector and the tranmission likelihood for the interaction. Considering
Alice and Bob, there are two ways to propogate risk through the network:

1. Alice shares her state with Bob, who computes the disjunction with his transmission likelihood and returns the posterior risk score.
1. Bob shares his transmission likelihood with Alice, who then updates her state.

This project takes the first approach. Concretely,

1. Alice homomorphically encrypts her state and sends the cipher text to Bob.
1. Bob computes the logical disjunction on the encrypted ciphertext and returns the transformed ciphertext.
1. Alice decrypts the cipher text and sets her state to the disjunction of her state with the decrypted ciphertext.

#### Implementation

1. The state vectors are mapped to integers, with `true` mapped to `0` and `false` mapped to `1`. With this mapping,
logical disjunction is equivalent to multiplication.
1. The state vector (of Alice) is encrypted using the BFV scheme, and multiplied (by Bob) with a plain text encoding
of the transmission likelihood.
1. Alice decrypts the ciphertext and inverse maps the integers to booleans. Her state is set to its disjunction with the
decrypted vector.

## Advantages

Without homomorphic encryption, privacy conscious implementations would take the second approach, i.e. share the transmission
likelihood using public key encryption. With the approach described above, only the marginal transmission likelihood,
i.e. excess risk due to the interaction, is exchanged. The advantages are:

1. Privacy is increased without sacrificing efficacy.
1. The lost privacy is concordant with the magnitude of the externality.

To understand the implications of the second point, consider the case of a highly contagious Alice interacting with a healthy Bob. In this case, Alice poses a much higher risk to Bob than Bob poses to Alice. Alice's posterior state vector will be
nearly the same as her prior (since it was mostly `true`), therefore the information she gains about Bob's infectivity is
minimal. On the other hand, Bob's posterior will be significantly different from his prior (since it was mostly `false`),
and he gains a lot of information about Alice's infectivity. Without homomorphic encryption, both would have learnt the
same amount of information about the other.

## Performance


text:
---
layout: post
title: Click the Subscribe Button to Observe
---

You're 10 years old, and you can't get enough of your favorite YouTuber. You never want to miss a video, and look forward with avid intensity to each new drop.   Subscribe, of course!

![](https://media1.tenor.com/images/030643feae2c2c4bef5429d45f9605b7/tenor.gif)

In Java, objects sometimes need to be alerted when something they contain or are connected to is modified. The **Observer** design pattern is the framework we can use to keep track of changes on our objects.  In Bootcamp, we're using the robust Spring framework as our Observer on the Text Action Game (TAG) project.

The behavior protocol for Observer described in the Gang of Four's famous book on Design Patterns states: define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

**Subscibe Now!**

So, *how* are the dependents notified and updated about the change? Like the avid YouTube fan, dependants get notifications from their **subscription**. This subscription allows all the objects affected by the change to get update information automatically every time something is changed in the object to which the dependants are subscribed.

**Structure**

I found this flowchart from Refactoring Guru very helpful in picturing the different interactions between elements of the Observer pattern.
![](https://refactoring.guru/images/patterns/diagrams/observer/structure-indexed-2x.png)

In it, you can see the Observer pattern described in 6 parts:

    Name
    Role in the Observer Pattern

    Publisher
    Sends events to other objects. Events happen when the publisher is changed or does something.

    Subscription List
    When a new event happens, the publisher uses a notification method to notify all subscribers on the list

    Subscriber
    The subscriber implements the notification interface, so it can get all the event details every time there is an update

    Concrete Subscribers
    These special subscribers do someting in response to getting a notification

    Updates
    Contain special context information so that the subscibers know what to do with the update

    Clients
    Creates the publisher and subscriber objects and signs the subscribers up for updates

For a more expert and in depth description of the Observer pattern, checkout  this excellent post from Refactoring Guru. It describes the Observer pattern in easy to understand language and includes some more great infographics and illustrations to help make envisioning the Observer pattern easy.

Click here for a table of Design Patterns that inclues some class notes on the topic.


text:
# λογίζομαι.

<!-- Status: S3=Needs2ndReview -->
<!-- Lexica used for edits: BDAG, FFM, LN, A-S -->

## Word data

* Strongs: G30490.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 41.

* All Scriptures cited: Yes.

## Etymology:

[λόγος](../G35880/01.md)): a word, a saying, a reckoning, an account.

* LXX/Hebrew glosses:

compare Hebrew [נֶחֱשׁב לְ](//en-uhal/H2803).

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses:

### Sense  1.0:

#### Definition:

to keep a record for an account

#### Glosses:

to count, to number, to credit, to reckon, calculate

#### Explanation:

Used of numerical counting for keeping record of the debts and credits in a person's account. In the New Testament this sense can be used with a spiritual meaning

#### Citations:

[Mark 15:28](mrk 15:28), [Luke 22:37](luk 22:37),

; ἐλογίσθη [αὐτῷ](../G08460/01.md) [εἰς](../G15190/01.md) [δικαιοσύνην](../G13430/01.md)
; "it was counted to him as righteousness," (ULT): [Rom 4:3](rom 4:3)

### Sense  2.0:

#### Definition:

to think intently or carefully about something

#### Glosses:

think, to consider, to reason

#### Explanation:

to think logically, without reference to numbers, by a reckoning of characteristics or reasons

#### Citations:

; [ταῦτα](../G37780/01.md) λογίζεσθε
; "think about these things," (ULT):
[Phil 4:8](php 4:8),

; [οὐδὲ](../G37610/01.md) λογίζεσθε, [ὅτι](../G37540/01.md) [συμφέρει](../G48510/01.md) [ὑμῖν](../G47710/01.md)
; "You do not consider that it is better for you," (ULT): [John 11:50](jhn 11:50),

[Heb 11:19](heb 11:19)

### Sense  3.0:

#### Definition:

To have an opinion or view about something

#### Glosses:

to suppose, to think, to conclude, to consider, to regard, to judge

#### Explanation:

to judge, to deem, to consider as, to regard (compare 1 Pet 5:12), to hold a view, think, suppose, believe, to reason (compare 1 Cor 13:11)

#### Citations:

[2Cor 10:11](2co 10:11),

; λογίζεσθε [ἑαυτοὺς](../G14380/01.md) [εἶναι](../G15100/01.md) [νεκροὺς](../G34980/01.md) [μὲν](../G33030/01.md) [τῇ](../G35880/01.md) [ἁμαρτίᾳ](../G02660/01.md)
; "consider yourselves to be dead to sin," (ULT): [6:11](rom 6:11),

; [οὕτως](../G37790/01.md) [ἡμᾶς](../G14730/01.md) λογιζέσθω [ἄνθρωπος](../G04440/01.md)
; "This is how a person should regard us," (ULT): [1Cor 4:1](1co 4:1),

[1Pet 5:12](1pe 5:12),

; ἐλογίσθημεν [ὡς](../G56130/01.md) [πρόβατα](../G42630/01.md)  [σφαγῆς](../G49670/01.md)
; "We were considered as sheep for the slaughter," (ULT): [8:36](rom 8:36),

; λογίσασθαί [τι](../G51000/01.md) [ὡς](../G56130/01.md) [ἐξ](../G15370/01.md) [ἑαυτῶν](../G14380/01.md)
; "to consider anything as coming from ourselves," (ULT): [2Cor 3:5](2co 3:5),

; [μή](../G33610/01.md) [τις](../G51000/01.md) [εἰς](../G15190/01.md) [ἐμὲ](../G14730/01.md) λογίσηται [ὑπὲρ](../G52280/01.md) [ὃ](../G37390/01.md) [βλέπει](../G09910/01.md) [με](../G14730/01.md)
; "so that no one will think more of me than what he sees in me," (ULT): [12:6](2co 12:6),

[Rom 8:18](rom 8:18), [2:3](rom 2:3), [2Cor 10:7](2co 10:7),

; λογίζομαι [γὰρ](../G10630/01.md) [μηδὲν](../G33670/01.md) [ὑστερηκέναι](../G53020/01.md)
; "For I think that I am not at all inferior," (ULT): [2Cor 11:5](2co 11:5),

; λογιζόμεθα [γὰρ](../G10630/01.md) [δικαιοῦσθαι](../G13440/01.md) [πίστει](../G41020/01.md) [ἄνθρωπον](../G04440/01.md); "We conclude then that a person is justified by faith" (ULT): [Rom 3:28](rom 3:28),

[Rom 14:14](rom 14:14), [Phl 3:13](php 3:13),

; λογιζομένους [ἡμᾶς](../G14730/01.md), [ὡς](../G56130/01.md)  [κατὰ](../G25960/01.md) [σάρκα](../G45610/01.md) [περιπατοῦντας](../G40430/01.md)
; "those who regard us as walking according to the flesh,"(ULT):
[2Cor 10:2](2co 10:2){2 instances, one for this Sense}

### Sense  4.0:

#### Definition:

to keep a record of something in one's mind in order to act on it in the future

#### Glosses:

to reckon, to ponder

#### Explanation:

to bear in mind, to consider, to take into account

#### Citations:

[1Cor 13:5](1co 13:5)

### Sense  5.0:

#### Definition:

to decide ahead of time to do something

#### Glosses:

to purpose, plan, to decide

#### Explanation:

#### Citations:

; [ᾗ](../G37390/01.md) λογίζομαι, [τολμῆσαι](../G51110/01.md)
; "with which I plan to be courageous" (ULT):
[2Cor 10:2](2co 10:2){2 instances, one for this Sense}.

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
# React - Node - SPA - API Boilerplate

## Includes

- React for rendering views
- Example React view
- Node backend for API requests
- Example response
- Example request from front-end
- Redux for state management
- Redux Saga for async requests
- Logging
- React Router
- Webpack dev server with hot reloading
- SASS/CSS imports and auto-prefixing
- ESLint with AirBNB config
- Deploys to Heroku out of the box

## Does Not Include

- Database integration
- Anything else, I don't think

repository: code-for-coffee/react-node-boilerplate

repo_name: code-for-coffee/react-node-boilerplate


text:
# FML
This command returns a random FML story from [fmylife.com](http://www.fmylife.com).

> [!WARNING]
>There is currently a bug within this command, we are aware of the issue and a fix is underway.

## Usage
`fml`

## Aliases
*There are currently no aliases*

## Examples
- `fml` This will return a random FML story board.

## Permissions
For this command to work, you don't require any extra permissions within the server.

----

**Last updated: {docsify-updated}**


text:
# OTT maintainer's guide

* [How to update sources and issue a new release](new-release.md)
* [Finding and fixing errors](errors.md)
* [Patch system](patch.md)
* [Addressing feedback issues](feedback.md)
* [Adding a new taxonomic source](new-source.md)
* [How the OTT build system works](build-system.md) (diagram [here](ott-management-design.svg))
* [GBIF 2016 update case study](gbif-2016-case-study.md)

For information on the taxonomy and on how smasher works, please see:

* [Automated assembly of a reference taxonomy for phylogenetic data synthesis](https://doi.org/10.1101/116418) (preprint; article accepted to Biodiversity Data Journal)

repository: OpenTreeOfLife/reference-taxonomy

gha_language: Python

repo_name: OpenTreeOfLife/reference-taxonomy


text:
# Running as Root in a Container

The purpose of this example is to show,
if you mount the filesystem into a container running as root,
the container will have root privileges on the filesystem.

This example runs well in a Google Cloud Shell.

## As a basic user

1. show the current user

    ```shell
    $ id
    uid=1000(ng) gid=1000(ng) groups=1000(ng),4(adm),27(sudo),999(docker)
    ```

1. create a file and show the owner/permissions

    ```shell
    $ touch file1.txt
    $ ls -la
    total 16
    drwxr-xr-x 2 ng   ng   4096 Sep 23 15:50 .
    drwxr-xr-x 7 ng   ng   4096 Sep 23 15:40 ..
    -rw-r--r-- 1 ng   ng      0 Sep 23 15:50 file1.txt
    ```

> `file1.txt` is has
>
> - `user:group` set to your user e.g. `ng:ng`
> - permissions `-rw-r--r--`, where the first
>   - `rw-` is `read, write` for `user`, the next
>   - `r--` is `read` for `group`, and the last
>   - `r--` is `read` for `other`. So,
> - ng (`user`) can `read` and `write` to the file,
> - users in the ng (`group`) can `read`, and
> - everyone on the linux system (`other`) can `read` the file.

## In the same folder

1. start a privileged container that mounts in the current folder

    ```shell
    $ docker run --rm -it -v $(pwd):/mnt/host alpine
    / #
    ```

1. show the current user (we have `uid=0` and are `root`)

    ```shell
    # id
    uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
    ```

1. show the files and permissions in the `/mnt/host` folder
    (we see the file we created before)

    ```shell
    / # cd /mnt/host/
    /mnt/host # ls -la
    total 16
    drwxr-xr-x    2 1000     1000          4096 Sep 23 13:53 .
    drwxr-xr-x    1 root     root          4096 Sep 23 13:42 ..
    -rw-r--r--    1 1000     1000             0 Sep 23 13:50 file1.txt
    ```

1. create a file with some secret content and show the permissions

    ```shell
    /mnt/host # echo "secret" > file2.txt
    /mnt/host # ls -la
    total 12
    drwxr-xr-x    2 1000     1000          4096 Sep 23 14:18 .
    drwxr-xr-x    1 root     root          4096 Sep 23 13:42 ..
    -rw-r--r--    1 1000     1000             0 Sep 23 13:50 file1.txt
    -rw-r--r--    1 root     root             7 Sep 23 14:18 file2.txt
    ```

1. delete the `read` permission for `other` on the file

    ```shell
    /mnt/host # chmod o-r file2.txt
    /mnt/host # ls -la
    total 12
    drwxr-xr-x    2 1000     1000          4096 Sep 23 14:18 .
    drwxr-xr-x    1 root     root          4096 Sep 23 13:42 ..
    -rw-r--r--    1 1000     1000             0 Sep 23 13:50 file1.txt
    -rw-r-----    1 root     root             7 Sep 23 14:18 file2.txt
    /mnt/host #
    ```

1. exit the privileged container, and try viewing the permissions on the files
    (`file2.txt` is owned by `root:root`)

    ```shell
    /mnt/host # exit
    $ ls -la
    total 12
    drwxr-xr-x 2 ng   ng   4096 Sep 23 16:21 .
    drwxr-xr-x 7 ng   ng   4096 Sep 23 15:40 ..
    -rw-r--r-- 1 ng   ng      0 Sep 23 15:50 file1.txt
    -rw-r----- 1 root root    7 Sep 23 16:18 file2.txt
    ```

1. try viewing the contents of the file
    (we can't since `other` doesn't have any permissons on the file)

   ```shell
    $ cat file2.txt
    cat: file2.txt: Permission denied
    ```

1. Use the root user to view the contents of the file

    ```shell
    $ sudo cat file2.txt
    secret
    ```

## Conclusion

Use great caution when mounting the filesystem into a container,
and pay attention to the privileges that a container is running with.

Greatly inspired by the
[Keynote: Running with Scissors - Liz Rice, Technology Evangelist, Aqua Security](https://www.youtube.com/watch?v=ltrV-Qmh3oY) at KubeCon 2018

repository: xperjon/docker-exercises

gha_language: Dockerfile

repo_name: xperjon/docker-exercises


text:
# Linear Algebra Guide

## Table of Contents

- [Definitions](#Definitions)
- [Objects](#Objects)
- [Equations](#Equations)
- [Operations](#Operations)
- [Properties](#Properties)
- [Methods](#Methods)
- [Proofs](#Proofs)

## Definitions

### Linear

*Arranged in or extending along a straight or nearly straight line.*

### Slope
*Denotes how steep a line is an is canoically represented with the letter m in equations.*

### Intercept
*The point at which 2 lines intersect.*

### Point-Slope Form of Linear Equation

*Equation of a line in canonical form.*\

### Two-point from of Linear Equation

*Equation of a line in form where you can find equation of line from 2 points.*\

### Scalar

*A quantity having only magnitude, not direction.*\

### Vector

*A quantity having direction as well as magnitude, especially as determining the position of one point in space relative to another.*\

### Matrix

*A rectangular array of quantities or expressions in rows and columns that is treated as a single entity and manipulated according to particular rules.*\

### Vector Space

*A space consisting of vectors, together with the associative and commutative operation of addition of vectors, and the associative and distributive operation of multiplication of vectors by scalars.*

### Linear Equation

*An equation between two variables that gives a straight line when plotted on a graph.*\

### System of Linear Equations

*In mathematics, a system of linear equations (or linear system) is a collection of one or more linear equations involving the same set of variables.*\
*Formal Definition:*\

*For Example:*\

### Solutions to Linear Equations

*A System of Linear Equations can have 3 possible solutions:*
-Unique Solution
-No Solution
-Infinitely Many Solutions

### Reduced Row Echelon Form

*The first non-zero number in the first row (the leading entry) is the number 1. The second row also starts with the number 1, which is further to the right than the leading entry in the first row. For every subsequent row, the number 1 must be further to the right.*

*For Example:*\

### Partitioned Matrix

*A partitioned matrix, or a block matrix, is a matrix, M, that has been constructed from other smaller matrices. These smaller matrices are called blocks or sub-matrices of M*

### Identity Matrix

*A Square Matrix with nothing but 1 on the diagonals*

## Objects

- Vector
- Matrix
- Vector Space

## Equations

- Linear Equation
- System of Linear Equations

## Operations

### Elementary Operators
*These operators are your standard operators taught in elementary school.*\

### Summation Operator
*This operator sums up all the values given by the expression in the range of var=num to limit.*\

## Properties
**Associativity**
*In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result.*\

*Applies to:*
- Addition
- Multiplication

## Methods
**Gaussian elimination**
*Gaussian elimination, also known as row reduction, is an algorithm in linear algebra for solving a system of linear equations. It is usually understood as a sequence of operations performed on the corresponding matrix of coefficients.*

## Proofs


text:
# All-by-Pythonself (ABP)

Practice basic offensive security techniques all by Pythonself.

## Snippets (for in-class exercises)

* arpspoof.py - ARP cache poisoning
* crack.py - Password cracking
* dictionary.py - Dictionary attacks
* icmpredirect.py - ICMP redirect attacks
* portscan.py - SYN scanning
* smurf.py - The Smurf attacks
* synflood.py - SYN flooding
* tcpreset.py - TCP reset attacks

## Assisgnments (for homework)
* arpspoof.py
* crack.py
* portscan.py
* synflood.py

## Setups (to make the system vulnerable)
* smurf.setup.py - To accept ICMP echo broadcasts
* synflood.setup.py - To disable SYN cookies

## Example

```
python arpspoof.py
```

## Contributors (Alphabetical)

* **Seongyong Choi** - President of CUHA - [yyyy7246](https://github.com/yyyy7246)
* **Tae Hyeng Kim** - Vice President of CUHA - [kingjaewon2000](https://github.com/kingjaewon2000)
* **Hae Young Lee** - Assistant Professor at [Cheongju University](https://www.cju.ac.kr) - [haelee](https://github.com/haelee)
* **Yoonsu Lim** - Member of CIFRAR - [Limyoonsu](https://github.com/Limyoonsu)
* **Do Kyu Park** - Member of CUHA - [GGHF1](https://github.com/GGHF1)

## License

The project is licensed under the MIT License.


text:
---
title: 6.12 - Entry
navPrev: 6.11-dit-structure-rule.html
navPrevText: 6.11 - DITStructureRule
navUp: 6-ldap-data-structures.html
navUpText: 6 - LDAP data structures
navNext: 6.13-expr-node.html
navNextText: 6.13 - ExprNode
---

# 6.12 - Entry

The _Entry_ class is one of the most important ones in the _API_. It describes the base element stored into a *LDAP* server, and it associates a _Dn_ and some _Attributes_.

We have two kinds of _Entry_ in the _API_, depending on the presence of a _SchemaManager_ in the _Entry_, or not.

We also provide a few extended classes, like the _ImmutableEntry_, an immutable version of the _Entry_.

## What an entry?

An entry is an object containing a _Dn_ and some _Attributes_. The following schema shows what's inside an _entry_:

![entry](images/entry.png)

## Creating an Entry

We have many ways to create an _Entry_. Basically, an _Entry_ has a _Dn_ and some _Attributes_. It can be schema aware, or not. We provide constructors to allow a user to create the kind of _Entry_ wanted.

The simplest way to create an _Entry_ is to call the default constructor. The created entry will have no attributes, and no _Dn_. We can also make it schema aware by passing a _SchemaManager_. Here is an example:

```Java
    Entry entry = new DefaultEntry();

    // Now set the DN and some attributes
    Entry entry = new DefaultEntry();

    entry.setDn( "dc=example, dc=com" );
    entry.add( "objectClass", "top", "domain" );
    entry.add( "dc", "example" );

    // Schema aware entry
    Entry entry2 = new DefaultEntry( schemaManager);

    entry2.add( "objectClass", "top", "domain" );
    entry2.add( "dc", "example" );
```

You can also create an _Entry_ passing a _Dn_, but no attribute. We can create schema aware entries this way too, passing a _SchemaManager_.

```Java
    Dn dn = new Dn( schemaManager, "DomainComponent=example, dc=COM" );
    Entry entry = new DefaultEntry( "dc=example, dc=com" );

    entry.add( "objectClass", "top", "domain" );
    entry.add( "dc", "example" );

    Entry entry2 = new DefaultEntry( schemaManager, "dc=example, dc=com" );

    entry2.add( "objectClass", "top", "domain" );
    entry2.add( "dc", "example" );
    ...
```

We can also create an entry by copying an existing entry. The created _Entry_ must be schema aware. Here is an example:

```Java
    Entry entry = new DefaultEntry( schemaManager, "dc=example, dc=com" );

    entry2.add( "objectClass", "top", "domain" );
    entry2.add( "dc", "example" );

    Entry entry2 = new DefaultEntry( schemaManager, entry );

    assertEquals( entry.getDn(), entry2.getDn() );

    entry.clear();
```

Last, but not least, it's possible to create an _Entry_ using a list of LDIF formated attributes. An example worth ten lines of documentation, so let's see what it means.

First, we will create a schema agnostic entry:

```Java
    Entry entry = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: domain",
        "dc: example"
        );
```

We can also provide a complete LDIF file (except that we can't add the _dn_):

```Java
    String ldif =
        "objectClass: top\n" +           // The \n is mandatory.
        "objectClass: domain\n" +
        "dc: example";

    Entry entry = new DefaultEntry( "dc=example, dc=com", ldif );
```

One can also combine LDIF and variables like in this example (note that if you use a variable, the attribute must not be followed by the *':'* char):

```Java
    String domain = "example";

    Entry entry = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: domain",
        "cc", domain             // No ':'
        );
```

All in all, the following constructors are available :

* DefaultEntry() : Default constructor
* DefaultEntry(SchemaManager) : Default constructor for a schema aware entry
* DefaultEntry(String) : Creates an entry with a DN as a String
* DefaultEntry(SchemaManager, String) : Creates a schema aware entry with a DN as a String
* DefaultEntry(Dn) : Creates an entry with a DN
* DefaultEntry(SchemaManager, Dn) : Creates a schema aware entry with a DN as a String
* DefaultEntry(Dn, Object...) : Creates an entry with a DN and some attributes
* DefaultEntry(SchemaManager, String, Object...) : Creates a schema aware entry with a DN as a String, and some attributes
* DefaultEntry(SchemaManager, Dn, Object...) : Creates a schema aware entry with a DN and some attributes
* DefaultEntry(SchemaManager, Entry) : Creates an entry using a copy of another entry

## Modifying an Entry

We have six methods available that modify the _Entry_ content : _add_, _clear_, _put_, _remove_, _removeAttribute_ and _setDn_. We will review six four methods in the following paragraphs.

### Adding Attributes

Two methods can be used to add attribute into an _Entry_. The first one will add a completed _Attribute_, the second one will add some values into an existing _Attribute_.

In any case, we can add either an empty attribute, or an attribute with some values. Those values can be _Strings_, _byte[]_ or _Values_. The added attributes can be schema aware, and we can also provide a user provided name for the attribute type.

##### add() methods

The first method makes it possible to add some existing _Attribute_ to an _Entry_. Let's see how it works:

```Java
    Attribute cn = new DefaultAttribute( "cn", "test" );
    Attribute cn2 = new DefaultAttribute( "cn", "test2" );

    Entry entry = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test" );

    // Add the new attribute
    entry.add( cn );

    // Try to add a second value
    entry.add( cn2 );
```

Otherwise, we can add a new attribute and values into the _Entry_ by passing both parameters. We can also pass an _AttributeType_ to the _add()_ method, making the added attribute schema aware. Note that if the _Entry_ itself is already schema aware, this is not necessary.

Here are some examples, the first one with a schema aware _Entry_, the second one with a schema agnostic _Entry_:

For a schema aware entry :

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test" );

    // Add the new attribute
    entry.add( "cn", "test" );

    // Try to add a second value
    entry.add( "cn", "A  second test   " );

    // We can also add a value to an existing Attribute
    entry.add( "sn", "Another SN" );

    // And even add many values in one shot
    entry.add( "cn", "value1", "value2" );
```

For a schema agnostic entry :

```Java
    Entry entry = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test" );

    // Add the new attribute
    entry.add( "cn", "test" );

    // Try to add a second value
    entry.add( "cn", "A  second  test" );
```

As you can see, there is no real difference between those two methods, except that we pass the _schemaManager_ into the first one.

##### put() methods

The big difference with the _add_ method is that the attribute is not added, it will replace an existing one. let's see with an example :

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test" );

    // Add the new attribute
    entry.put( "cn", "test" );

    // Try to add a second value : the 'cn' attribute will now contain only 'test2'
    entry.put( "cn", "test2" );
```

### Removing Attributes

We can remove either an attribute having a specific value, or an entire attribute. In order to remove a complete attribute, you just have to provide the attribute's name, and use the _removeAttributes_ method.

Here are examples for both usages :

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    // Remove the "test2" value
    entry.remove( "cn", "test2" );

    // Try to remove the full attribute
    entry.removeAttributes( "cn" );
```

### Storing a Dn

It's also possible to store a new _Dn_ into the Entry, using the _setDn() method. It will replace an existing _Dn_ This method takes either a _Dn_ instance, or a _String_ representing a valid _Dn_.

### Clearing the Entry

You can remove all the _Attribute_s from the entry, using the _clear()_ method :

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    // Remove all the attributes
    entry.clear();
```

The _Dn_ will still be around though.

## Attribute data access methods

The *API* provides convenient methods to access the _Entry_ content, and to check if it contains some attributes or some values. We will show these methods in the paragraphs that follow.

### Contains method

The _contains_ and _containsAttributes_ methods check that the _Entry_ contains _Attributes_ and _values_.

One can check for the existence of a specific value for a given attribute, or even for multiple values for a specific attribute. Let's see the _contains_ method in action:

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    // Check that the entry contains the 'cn' and 'sn' Attributes
    boolean contains = entry.containsAttribute( "cn", "sn" );

    // Check that the entry contains 3 given values of the 'cn' Attribute
    contains = entry.contains( "cn", "test1", "test2", "test3" );
```

Note that if one value does not exist, the _contains()_ method will return false.

### getAttributes() and get() methods

Returns the _Attribute_ having the given name if it exists. The following test demonstrates its usage:

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    // Get the 'cn' Attribute
    Attribute cn = entry.get( "cn" );

    // Get all the Attributes
    Collection<Attribute> attributes = entry.getAttributes();
```

### getDn()

This method returns the _Entry_'s _Dn_.

### hasObjectClass methods

The _hasObjectClass()_ methods are used to discover if an _Entry_ has a specific _ObjectClass_. This is a convenient method, as it's possible to do the same thing with a _contains()_ call, but with one less parameter (you don't have to provide the _"ObjectClass"_ as a first parameter).

Here is an example using the two existing methods:

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "cn=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "cn: example",
        "sn: test"
        );

    // Test the presence
    boolean isPresent = entry.hasObjectClass( "person", " TOP " );
```

As for the _contains()_ method, it will return true if and only if all the ObjectClasses are present in the _entry_.

Obviously, dealing with a schema agnostic _Entry_, those methods are more strict. You have to use the exact ObjectClasses case sensitive trimmed names (in the previous example, we can use upper cased names, even with spaces around the names).

Also note that the _hasObjectClass_ method used with _AttributeType_ does not work on a schema agnostic entry.

## Miscellaneous methods

We also have some other methods which can be used on an _Entry_. Here is a list of those methods.

#### clone()

Creates a copy of the current _Entry_. All the _Attributes_ are also cloned.

#### iterator()

Allows an iteration over all the _Attributes_. The following examples shows how this can be used:

```Java
    @Test
    Entry entry = new DefaultEntry(
        "cn=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "cn: example",
        "sn: test"
        );

    for ( Attribute attribute : entry )
    {
        System.out.println( "Attribute : \n" + attribute.toString() );
    }
```

This produces the following output:

```Text
    Attribute :
        sn: test

    Attribute :
        cn: example

    Attribute :
        objectclass: top
        objectclass: person
```

Note that the _Attribute_ order is not guaranteed.

#### isSchemaAware()

Tells if the ¨_Entry_ has an associated _SchemaManager_.

#### size()

Returns the number of _Attribute_ stored in the _Entry_.

#### equals(Object)

Check if two *Entries* are equal or not. It's important to understand that depending on whether the entry is schema aware or not, the comparison will be processed differently. Typically, the attribute's name must be equivilent after being trimmed and set to lowercase.  If the entry is not schema aware, and we can't compare an attribute named 'cn' with another one named '<IP_ADDRESS>' in this case (the _Entry_ must be schema aware to allow such comparison). More important, the values *must* be identical (same casing, same spaces) in this case.
The attribute's values order is irrelevant.

Here are one example with a schema agnostic _Entry_:

```Java
    Entry entry = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    Entry entry2 = new DefaultEntry(
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test2",
        "CN: test1",
        "cn: test3" );

    // Will return true
    boolean result = entry.equals( entry2 );
```

and another example with a schema aware _Entry_:

```Java
    Entry entry = new DefaultEntry(
        schemaManager,
        "dc=example, dc=com",
        "objectClass: top",
        "objectClass: person",
        "sn: test",
        "cn: test1",
        "cn: test2",
        "cn: test3" );

    Entry entry2 = new DefaultEntry(
        schemaManager,
        "dc=example,dc=com",
        "objectClass: TOP",
        "objectClass: person",
        "sn: Test",
        "cn: Test2",
        "<IP_ADDRESS>: test1",
        "CommonName: test3" );

    // Will return true
    boolean result = entry.equals( entry2 );
```


text:
---
layout: docs
title: "Docker SWARM"
description: ""
group: deploy-your-containers
redirect_from:
  - /docs/docker-swarm
toc: true
---

## Getting Started

Download [Docker](https://www.docker.com/products/overview). If you are on Mac or Windows, [Docker Compose](https://docs.docker.com/compose) will be automatically installed. On Linux, make sure you have the latest version of [Compose](https://docs.docker.com/compose/install/).

{{site.data.callout.callout_info}}
##### Try this example

{% raw %}
Just head over to the example [__repository__](https://github.com/codefreshdemo/example-voting-app){:target="_blank"} in Github.
{% endraw %}
{{site.data.callout.end}}

Run in this directory:

{% highlight bash %}
{% raw %}

docker-compose up

{% endraw %}
{% endhighlight %}

The app will be running at [http://localhost:5000](http://localhost:5000), and the results will be at [http://localhost:5001](http://localhost:5001).

Alternately, if you want to run it on a [Docker Swarm](https://docs.docker.com/engine/swarm/), first make sure you have a swarm. If you don't, run:

{% highlight bash %}
{% raw %}

docker swarm init

{% endraw %}
{% endhighlight %}

Once you have your swarm, in this directory run:

{% highlight bash %}
{% raw %}

docker stack deploy --compose-file docker-stack.yml vote

{% endraw %}
{% endhighlight %}

{{site.data.callout.callout_warning}}
The swarm master must have Python installed.
{{site.data.callout.end}}

## Deploy to Remote Swarm with codefresh.yml

  `codefresh.yml`
{% highlight yaml %}
{% raw %}

deploy_to_swarm:
    image: codefresh/remote-docker
    working_directory: ${{main_clone}}
    commands:
      - rdocker ${{RDOCKER_HOST}} docker stack deploy --compose-file docker-stack.yml ${{STACK_NAME}}
    environment:
      - SSH_KEY=${{SSH_KEY}}
    when:
      branch:
        only:
          - master

{% endraw %}
{% endhighlight %}

{: .table .table-bordered .table-hover}
| `RDOCKER_HOST`       | remote Docker swarm master machine, accessible over SSH (for example, ubuntu@ec2-public-ip)                    |
| `STACK_NAME`         | is new Docker stack name (use \"vote\", for example)                                                           |
| `SSH_KEY`            | private SSH key, used to access Docker swarm master machine                                                    |
| `SPLIT_CHAR`         | split character, you've used to replace `newline` in SSH key. Recommendation: use `,` (`comma` character).     |

{{site.data.callout.callout_warning}}
##### Passing SSH key through ENV variable

Currently in order to pass SSH key through Codefresh UI, you need to convert it to single line string (replacing `newline` with `comma`), like this:

{% highlight bash %}
{% raw %}
SSH_KEY=$(cat ~/.ssh/my_ssh_key_file | tr '\n' ',')
{% endraw %}
{% endhighlight %}

{{site.data.callout.end}}

## Deploy to Remote Swarm using the pipeline's UI deploy step

{:start="1"}
1. Select **Codefresh's Deploy Images** in the pipeline's and select `codefresh/remote-docker:latest`.

{:start="2"}
2. As a deploy command use <br>
   {% raw %}`rdocker ${{RDOCKER_HOST}} docker stack deploy --compose-file docker-stack.yml ${{STACK_NAME}}`{% endraw %}.

{:start="3"}
3.  Make sure you define the following variables in the pipeline as defined in the previous part:
     * `STACK_NAME`
     * `RDOCKER_HOST`
     * `SSH_KEY`
     * `SPLIT_CHAR`

{% include
image.html
lightbox="true"
file="/images/0a66a41-image3.png"
url="/images/0a66a41-image3.png"
alt="image3.png"
max-width="40%"
%}

**Notice:** The UI deploy step will run on any build. Make sure that your automated builds run only on a specific branch trigger.

{{site.data.callout.callout_warning}}
##### Syntax for environment variables

Remote Docker Swarm (sometimes called \"Docker Stack\") requires a specific syntax for passing variables from Codefresh:

{% highlight yaml %}
{% raw %}
SOME_VAR: ${SOME_VAR}
{% endraw %}
{% endhighlight %}

{{site.data.callout.end}}


text:
---
layout: post
title: Movie Recommender System in Python
excerpt: "Recommendation System - Mixed Machine Learning"
modified: 06/05/2018, 1:55
tags: [Python, Flask, NLP, Recommendation System]
comments: true
category: blog
---

## Overview
A  recommendation system using content-based & collaborative filtering methods.
Here is a workflow overview about the demo:
![workflow](/images/Recommender/workflow.png)

**What it can do:**
* recommend movies based on movie's **plot** or **cast**(director & main actors and actresses)
* recommend movies based on **personal taste**

**methods:**
* content-based: NLTK, scikit-learn, TFIDF
* collaborative filtering: surprise, pyspark(final demo)

demo: flask(finished), mySQL(finished), Spark(final demo)

Current demo:

[Data Source](https://www.kaggle.com/rounakbanik/the-movies-dataset/data)

>Explore the dataset using Tableau:

For better user experience, you can go to the [original dashboard](https://public.tableau.com/views/Viz_44/MovieOverview) in Tableau public

>Snapshot for flask demo pages:

Home page:
![home page](/images/Recommender/HomePage.png)
About page:
![about](/images/Recommender/about.png)
Recommendation example:
Request Page:
![Request Page](/images/Recommender/RecommendRequest.png)
Recommendation Result Page:
![RecommendResult1](/images/Recommender/RecommendResult1.png)
![RecommendResult2](/images/Recommender/RecommendResult2.png)
Best movie genres:
![ExploreRequest](/images/Recommender/ExploreRequest.png)
![ExploreResult](/images/Recommender/ExploreResult.png)

TODO list:
* [x] Build local host demo website(flask)
* [x] Connect mySQL with flask
* [ ] Save similarity matrix in mySQL database
* [ ] Using pyspark library to do collaborative filtering instead of surprise.SVD


text:
# Gosl. img. Image and machine learning algorithms for images

[![GoDoc](https://godoc.org/github.com/cpmech/gosl/img?status.svg)](https://godoc.org/github.com/cpmech/gosl/img)

More information is available in **[the documentation of this package](https://godoc.org/github.com/cpmech/gosl/img).**

The `img` subpackage implements functions to manipulate images and perform analyses.

This package also uses [OpenCV](http://opencv.org) to perform highly efficient and complex
computations in computer vision and machine learning.


text:
# Contributing

Thank you for taking the time to help us develop the ClinchPad library!

We do all our work on GitHub. If you'd like to help, you can create a
[free GitHub account here](https://github.com/join).

## Reporting an issue

For bug reports or feature requests, please [create a new issue](https://github.com/thinkshout/clinchpad-api-php/issues).

If reporting a bug, please:

* Let us know what steps we can take to reproduce the bug
* Include any error messages you received

## Submitting changes

The best way to submit a bug fix or improvement is through a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).

* [Fork](https://guides.github.com/activities/forking/), then clone the repository:

`git clone git@github.com:YOUR-GITHUB-USERNAME/clinchpad-api-php.git`

* Install the library's dependencies using [Composer](https://getcomposer.org/):

```shell
cd clinchpad-api-php
composer install
```

* If you are adding new functionality, please add a corresponding test.
  See [Testing](#testing) for more information.

* After making your changes, ensure all tests pass.

* Commit and push your changes to your fork of the repository.

* [Submit a pull request](https://github.com/oberonamsterdam/clinchpad-api-php/pulls).

## Testing

This library includes a [PHPUnit](https://phpunit.de/) test suite. Keeping these
tests up to date helps us ensure the library is reliable.

### Running PHPUnit tests

Add Composer's vendor directory to your PATH by adding the following line to
your profile. This is dependent on your system, but on a Linux or Mac OSX system
using Bash, you'll typically find the file at *~/.bash_profile*.

`export PATH="./vendor/bin:$PATH"`

Bash example:

```shell
echo 'export PATH="./vendor/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
```

Then run PHPUnit:

`phpunit`

### Creating new tests

Tests are located in the *tests* directory and are grouped into PHP files named
after the library component they are testing. For example,
*ClinchPadCampaignsTest.php* contains tests for ClinchPad Campaigns.

New tests should contain at least the functionality in this simple test:

```php
public function testGetContacts() {
  $mc = new ClinchPadContacts();
  $mc->getContacts();

  $this->assertEquals('GET', $mc->getClient()->method);
  $this->assertEquals($mc->getEndpoint() . '/contacts', $mc->getClient()->uri);
}
```

This test checks the request type and request URI are both correct.

More advanced examples can be found in the *tests* directory.

## Additional resources

* [ClinchPad API documentation](https://clinchpad.com/api/docs/)
* [Oberon](https://www.oberon.nl/), the library maintainer.

## Want to help build this and other open source projects?

We're hiring software engineers! Check out our [careers page](https://www.oberon.nl/vacatures/).

repository: oberonamsterdam/clinchpad-api-php

repo_name: oberonamsterdam/clinchpad-api-php


text:
# Optimization examples

## Setup

The repo contains code for Python as well as C++. See below for language-specific setup instructions.

## Python setup

Install Anaconda Python 3.6 using pre-built installers at
- Linux: https://www.anaconda.com/download/#linux
- Windows: https://www.anaconda.com/download/

Install numba using
```
conda install numba
```

## C++ setup

Install gcc and optionally Intel MKL. This code uses C++11. Use appropriate sections of Makefile that build the MKL/non-MKL versions. This is controlled by the macro `HAVE_MKL`. GCC versions 4.8, 5.5, 6.4, 7.3 and 8.1 have been tested with Ubuntu 18.04 and GCC versions 4.9, 5.5 and 6.4 have been tested with Ubuntu 16.04. MKL version used was 2018/update 3.

## Benchmarking

Benchmarks were taken on an Intel Xeon E5 processor (Windows 10). This processor has SSE/AVX instructions but not AVX2/AVX-512.

## Turbo Boost
`Turbo Boost` was disabled by following instructions [here](https://www.tautvidas.com/blog/2011/04/disabling-intel-turbo-boost/). With `Turbo Boost` enabled, which is the default, timings are not consistent because the CPU clock frequency changes (as per temperature of the machine).
Anaconda uses Intel MKL and I have not tested this on an ARM processor. All timings were taken in Ubuntu 18.04 (Windows Subsystem for Linux).
To verify that Turbo Boost is off, you may find it useful to download Intel Extreme tuning utility and check that the `Max Core Frequency` stays roughly constant when running benchmarks.