text:
{% assign title = "Initial Stop" %}
{% assign definition = site.data.trading_system.initial_stop %}
{% assign preposition = "the" %}
{% assign plural = "s" %}

{% if include.more == "yes" and include.heading == "more" %}
Click to learn more about {{ title | downcase }}{{plural}}

{% endif %}

{% if include.heading != "" and include.heading != "more" %}
{{include.heading}} {{title}}
{% endif %}

{% if include.icon != "no" %}

{% if include.table == "yes" and include.icon != "no" %}

{% endif %}

{% if include.table == "yes" and include.icon != "no" %}

{% endif %}

{% endif %}

{% if include.definition == "bold" %}
{{ definition }}
{% else %}
{% if include.definition != "no" %}
{{ definition }}
{% endif %}
{% endif %}

{% if include.table == "yes" and include.icon != "no" %}

{% endif %}

{% if include.more == "yes" and include.content == "more" and include.heading != "more" %}
Click to learn more about {{ title | downcase }}{{plural}}

{% endif %}

{% if include.content != "no" %}

Notice that the setting of the stop target has no relation to the execution of orders. The stop is a target, not an order to be placed. That is, the system does not place stop orders.

This is a design feature that allows you to keep your cards, not allowing anyone to anticipate what your strategy may be, not even the exchange. It is a known fact that some exchanges may attempt or allow to front-run stop orders.

Instead, the trading bot instance monitors the market, and only once the stop target has been hit does it place the corresponding order to close the trade.

The initial target is set in phase 0, that is, the departing point for the management of the trade to be handled in the manage stage.

{% endif %}

{% if include.more == "yes" and include.content != "more" and include.heading != "more" %}
Click to learn more about {{ title | downcase }}{{plural}}

{% endif %}

{% if include.adding != "" %}

{{include.adding}} Adding {{preposition}} {{title}} Node

To add an initial stop node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them.

{% endif %}

{% if include.configuring != "" %}

{{include.configuring}} Configuring the {{title}}

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

{% endif %}

{% if include.starting != "" %}

{{include.starting}} Starting {{preposition}} {{title}}

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

{% endif %}

{% if include.more == "yes" %}

{% endif %}

repository: Alex-Mishin/Superalgos

repo_name: Alex-Mishin/Superalgos


text:
# Dear ImGui for Unity

UPM package for the immediate mode GUI library, Dear ImGui (https://github.com/ocornut/imgui).

This is a fork of this repo: https://github.com/realgamessoftware/dear-imgui-unity

### Usage

For a more detailed usage, imgui_demo.cpp.txt is available at the root of the repo

- [Add package](https://docs.unity3d.com/Manual/upm-ui-giturl.html) from git URL: https://github.com/touky/dear-imgui-unity.git .
- Add a `DearImGui` component to one of the objects in the scene.
- When using the Universal Render Pipeline, add a `Render Im Gui Feature` render feature to the renderer asset. Assign it to the `render feature` field of the DearImGui component.
- Subscribe to the `ImGuiUn.Layout` event and use ImGui functions.
- Example script:
  ```cs
  using UnityEngine;
  using ImGuiNET;

  public class DearImGuiDemo : MonoBehaviour
  {
      void OnEnable()
      {
          ImGuiUn.Layout += OnLayout;
      }

      void OnDisable()
      {
          ImGuiUn.Layout -= OnLayout;
      }

      void OnLayout()
      {
          ImGui.ShowDemoWindow();
      }
  }
  ```

### See Also

This package uses Dear ImGui C bindings by [cimgui](https://github.com/cimgui/cimgui) and the C# wrapper by [ImGui.NET](https://github.com/mellinoe/ImGui.NET).

The development project for the package can be found at https://github.com/realgamessoftware/dear-imgui-unity-dev .

license: MIT

repository: touky/dear-imgui-unity

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: touky/dear-imgui-unity


text:
---
layout:     post
title:      Apereo CAS - Dockerized Deployments
summary:    Review a number of strategies that allow to create Docker images for your CAS deployment and run Docker containers with ease.
tags:       ["CAS 6.2.x", "Docker"]
---

CAS [embraced Docker](https://github.com/apereo/cas-webapp-docker) a while ago by providing a sample `Dockerfile` template to kickstart the builds. Since then, both configuration and technology have evolved greatly to simplify Docker-based deployments of CAS in much easier and hassle-free ways. This tutorial begins to review strategies that exist today to allow a CAS adopter to create Docker images for a CAS deployment and run containers with ease.

{% include googlead1.html  %}

 Our starting position is based on the following:

- CAS `6.2.x`
- Java 11
- [CAS Overlay](https://github.com/apereo/cas-overlay-template) (The `master` branch specifically)
- [Docker](https://www.docker.com/get-started)

## Jib

[Jib](https://github.com/GoogleContainerTools/jib) is an open-source Java containerizer from Google. It is a container image builder that handles all the steps of packaging the CAS web application into a container image. It does not require you to write a Dockerfile or have Docker installed, and it is directly integrated into CAS WAR overlay.

Once you have cloned the CAS WAR overlay, you can examine the relevant task via:

```bash
./gradlew tasks

Jib tasks
---------
jib - Builds a container image to a registry.
jibBuildTar - Builds a container image to a tarball.
jibDockerBuild - Builds a container image to a Docker daemon.
```

{% include googlead1.html  %}

You can build Docker image direcly with jib using:

```bash
./gradlew jibDockerBuild

Setting image creation time to current time; your image may not be reproducible.

Containerizing application to Docker daemon as org.apereo.cas/cas:v6.2.0-SNAPSHOT...
Base image 'adoptopenjdk/openjdk11:alpine-jre' does not use a
specific image digest - build may not be reproducible
The base image requires auth. Trying again for adoptopenjdk/openjdk11:alpine-jre...
The credential helper (docker-credential-desktop) has
nothing for server URL: registry-1.docker.io

Got output:

credentials not found in native keychain

The credential helper (docker-credential-desktop)
has nothing for server URL: registry.hub.docker.com

Got output:

credentials not found in native keychain

Using base image with digest: sha256:5c87145a62b49a7620

Container entrypoint set to [docker/entrypoint.sh]

Built image to Docker daemon as org.apereo.cas/cas:v6.2.0-SNAPSHOT
Executing tasks:
[==============================] 100.0% complete
```

Next, you can exmaine your available Docker images:

```bash
$ docker images
REPOSITORY                       TAG                                IMAGE ID            CREATED              SIZE
org.apereo.cas/cas               v6.2.0-SNAPSHOT                    7e9c1d4b3ce0        About a minute ago   358MB
```

{% include googlead1.html  %}

Certain configuration elements about the Docker images, such as the base image can be controlled via the `gradle.propeties` file. For more
details, please review `gradle/dockerjib.gradle` file.

## Docker

If you prefer a more traditional approach via a native `Dockerfile`, there is one provided for you in the Overlay that can be built via:

{% include googlead1.html  %}

```bash
./docker-build.sh

...
Successfully built 83c945802e31
Successfully tagged apereo/cas:v6.2.0-SNAPSHOT
Built CAS image successfully tagged as apereo/cas:v6.2.0-SNAPSHOT
REPOSITORY                  TAG                 IMAGE ID            CREATED                  SIZE
org.apereo.cas/cas          v6.2.0-SNAPSHOT     83c945802e31        Less than a second ago   249MB
```

## Docker Compose

For convenience, an additional `docker-compose.yml` is also provided to orchestrate the build, as modest as it may be:

{% include googlead1.html  %}

```bash
docker-compose build

Successfully built a8b5b2d1b90e
Successfully tagged org.apereo.cas/cas:v6.2.0-SNAPSHOT
Built CAS image successfully tagged as org.apereo.cas/cas:v6.2.0-SNAPSHOT
REPOSITORY           TAG                 IMAGE ID            CREATED                  SIZE
org.apereo.cas/cas   v6.2.0-SNAPSHOT     a8b5b2d1b90e        Less than a second ago   249MB
```

# Need Help?

If you have questions about the contents and the topic of this blog post, or if you need additional guidance and support, feel free to [send us a note ](/#contact-section-header) and ask about consulting and support services.

## Finale

I hope this review was of some help to you and I am sure that both this post as well as the functionality it attempts to explain can be improved in any number of ways. Please feel free to [engage and contribute](https://apereo.github.io/cas/developer/Contributor-Guidelines.html) as best as you can.

[Misagh Moayyed](https://fawnoos.com)


text:
# Transactions for Amazon DynamoDB

**_[IMPORTANT]_ Since November 2018, DynamoDB offers transactional APIs, simplifying the developer experience of making coordinated, all-or-nothing changes to multiple items both within and across tables. DynamoDB Transactions provide atomicity, consistency, isolation, and durability (ACID) in DynamoDB, enabling you to maintain data correctness in your applications more easily. We strongly recommend all developers to use DynamoDB’s built-in, servers-side transactions instead of this client-side library. To learn more about DynamoDB Transactions, see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transactions.html.**

**Amazon DynamoDB Client-Side Transactions** enables Java developers to easily perform atomic writes and isolated reads across multiple items and tables when building high scale applications on [Amazon DynamoDB][dynamodb]. You can get started in minutes using ***Maven***.

* [Transactions Details & Design][design]
* [DynamoDB Forum][sdk-forum]
* [Transactions Library Issues][sdk-issues]

The **Amazon DynamoDB Client-Side Transactions** library is built on top of the low-level Amazon DynamoDB client in the AWS SDK for Java.  For support in using and installing the AWS SDK for Java, see:

* [API Docs][docs-api]
* [SDK Developer Guide][docs-guide]
* [AWS SDK Forum][sdk-forum]
* [SDK Homepage][sdk-website]
* [Java Development AWS Blog][sdk-blog]

## Features

* **Atomic writes:** Write operations to multiple items are either all go through, or none go through.
* **Isolated reads:** Read operations to multiple items are not interfered with by other transactions.
* **Sweepers:** In-flight transaction state is stored in a separate table, and convenience methods are provided to "sweep" this table for "stuck" transactions.
* **Easy to use:** Mimics the Amazon DynamoDB API by using the request and response objects from the low-level APIs, including PutItem, UpdateItem, DeleteItem, and GetItem.
* **Table helpers:** Includes useful methods for creating tables such as and waiting for them to become ACTIVE.

## Getting Started

1. **Sign up for AWS** - Before you begin, you need an AWS account. Please see the [AWS Account and Credentials][docs-signup] section of the developer guide for information about how to create an AWS account and retrieve your AWS credentials.
1. **Minimum requirements** - To run the SDK you will need **Java 1.6+**. For more information about the requirements and optimum settings for the SDK, please see the [Java Development Environment][docs-signup] section of the developer guide.
1. **Install the Amazon DynamoDB Transactions Library** - Using ***Maven*** is the recommended way to install the Amazon DynamoDB Transactions Library and its dependencies, including the AWS SDK for Java.  To download the code from GitHub, simply clone the repository by typing: `git clone https://github.com/awslabs/dynamodb-transactions`, and run the Maven command described below in "Building From Source".
1. **Run the examples** - The included *TransactionExamples* automatically creates the necessary transactions tables, an example table for data and executes several operations with transactions.  You can run the examples using Maven by:
  1.  Ensure you have already built the library using Maven (see "Building From Source" below)
  2.  Change into the *examples* directory of the project
  2.  Add your AWS Credentials to the file: *src/main/resources/com/amazonaws/services/dynamodbv2/transactions/examples/AwsCredentials.properties*
  3.  Compile the subproject by typing: `mvn clean install`
  4.  Run the examples by typing: `mvn exec:java -Dexec.mainClass="com.amazonaws.services.dynamodbv2.transactions.examples.TransactionExamples"`

## Building From Source

Once you check out the code from GitHub, you can build it using Maven.  To disable the GPG-signing in the build, use: `mvn clean install -Dgpg.skip=true`

[design]: https://github.com/awslabs/dynamodb-transactions/blob/master/DESIGN.md
[sdk-install-jar]: http://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip
[aws]: http://aws.amazon.com/
[dynamodb]: http://aws.amazon.com/dynamodb
[dynamodb-forum]: https://forums.aws.amazon.com/forum.jspa?forumID=131
[sdk-website]: http://aws.amazon.com/sdkforjava
[sdk-forum]: http://developer.amazonwebservices.com/connect/forum.jspa?forumID=70
[sdk-blog]: https://java.awsblog.com/
[sdk-issues]: https://github.com/awslabs/dynamodb-transactions/issues
[sdk-license]: http://www.apache.org/licenses/LICENSE-2.0
[docs-api]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html
[docs-dynamodb-api]: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/Welcome.html
[docs-dynamodb]: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide
[docs-signup]: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-setup.html
[aws-iam-credentials]: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-roles.html
[docs-guide]: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/welcome.html

branch_name: refs/heads/main


text:
# type: wifi

These inspectors expose the WiFi adapters available on an endpoint.

# encryption of <wifi> : string

Returns a string of the encryption type of the WiFi connection. eg: "WEP", "WPA2-PSK"

# name of <wifi> : string

No documentation exists.

# secured of <wifi> : boolean

Returns a boolean that is true if the WiFi connection is secured.

# ssid of <wifi> : string

Returns a string of the SSID of the WiFi connection


text:
# CarND-Controls-MPC
Self-Driving Car Engineer Nanodegree Program

___

## Introduction
In this project you'll implement Model Predictive Control to drive the car around the track. This time however you're not given the cross track error, you'll have to calculate that yourself! Additionally, there's a 100 millisecond latency between actuations commands on top of the connection latency.

## Simulator
1. The simulator downloadalble from https://github.com/udacity/self-driving-car-sim/releases.

2. The simulator returns x and y waypoints (`ptsx`and `ptsy`), the vehicle orientation `psi` in radians, the vhicles' global position `x`and `y` in meter, the steering angle `steering_angle` in radians, the throttle position `throttle` and the vehicle's speed `speed`in mph. The `ptsx` and `ptsy` are map coordinates,should be changed to vhicles coordinates, the code in main.cpp:
    ```cpp
    unsigned long len = ptsx.size();
    Eigen::VectorXd target_waypoints_x(len);
    Eigen::VectorXd target_waypoints_y(len);

    for (unsigned long i = 0; i < len; ++i) {
      double dx = ptsx[i] - px;
      double dy = ptsy[i] - py;
      target_waypoints_x[i] = dx * cos(psi) + dy * sin(psi);
      target_waypoints_y[i] = dy * cos(psi) - dx * sin(psi);
    }
    ```
3. The yellow line represents the waypoints returned by the simulator and the green lane the polynomial fitted reference path of the MPC.

___

## Model Predictive Controller (MPC)

### State Vector
* The state vector is defined as followed {px, py, psi, v, cte, epsi}.

  | State |Description| Unit |
  |:-|:-|:-:|
  |px| Vehicle position x in vhicles coordinates |m|
  |py| Vehicle position y in vhicles coordinates |m|
  |psi| Vehicle orientation |radians|
  |v| Velocity |mph|
  |cte| The Cross Track Error is the delta between the predicted distance of the vehicle and the trajectory. |m|
  |epsi| Psi error is the delta between the predicted vehicle orientation and the trajectory orientation.|radians|

* The predict state before latency should be {0, 0, 0, v, cte, epsi}
* To compensate the latency of 100 ms the state vector [px, py, pis v] and the errors `cte` and `epsi` are predicted by a kinematic model 100 ms ahead (see code below) before the MPC solve function is called.
  * Latency Compensation
    * The predict state after latency was implemented in code:
      ```cpp
      double pred_px = 0 + v * dt;
      double pred_py = 0;
      double pred_psi = 0 + v * -delta / Lf * dt;
      double pred_v = v + a * dt;
      double pred_cte = cte + v * sin(epsi) * dt;
      double pred_epsi = epsi + v * -delta / Lf * dt;

      Eigen::VectorXd state(6);
      state << pred_px, pred_py, pred_psi, pred_v, pred_cte, pred_epsi;
      ```

### Actuator Vector
* The simulator provides two actuator attributes. The steering angle `psi` and the throttle and break in a single attribute `a`. A negative value decelerates and a positive value accelerates the vehicle.

### The Vehicle Model
* The vehicle model used in this project is a kinematic bicycle model. It neglects all dynamical effects such as inertia, friction and torque. The model takes changes of heading direction into account and is thus non-linear. The model used consists of the following equations (Notice, In the simulator, a positive value implies a right turn and a negative value implies a left turn, so the `psi` and the `epsi` is diffent from the equations in the class.)
    ```cpp
    x_[t+1] = x[t] + v[t] * cos(psi[t]) * dt
    y_[t+1] = y[t] + v[t] * sin(psi[t]) * dt
    psi_[t+1] = psi[t] - v[t] / Lf * delta[t] * dt
    v_[t+1] = v[t] + a[t] * dt
    cte[t+1] = f(x[t]) - y[t] + v[t] * sin(epsi[t]) * dt
    epsi[t+1] = psi[t] - psides[t] - v[t] * delta[t] / Lf * dt
    ```
### Cost Function Parameters
* In order to weight the individual costs I applied the following weights.
  ```cpp
  // cost weight
  #define cte_weight 2000
  #define epsi_weight 2000
  #define v_weight 1
  #define delta_weight 5
  #define a_weight 5
  #define delta_dot_weight 200
  #define a_dot_weight 10
  ```
### Timestep Length and Elapsed Duration (N & dt)
* The time T = N * dt defines the prediction horizon.
* Short prediction horizons lead to more responsive controlers, but are less accurate and can suffer from instabilities when chosen too short.
* Long prediction horizons generally lead to smoother controls.
* For a given prediction horizon shorter time steps dt imply more accurate controls but also require a larger NMPC problem to be solved, thus increasing latency.
* Finally, I decided to use `N = 10` and `dt = 0.1` which leads to a total look ahead time of 1 second. This is a good compromise between processing time and lookahead distance for the chosen target speed of 100 mph.

---

## Dependencies

* cmake >= 3.5
 * All OSes: [click here for installation instructions](https://cmake.org/install/)
* make >= 4.1(mac, linux), 3.81(Windows)
  * Linux: make is installed by default on most Linux distros
  * Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
  * Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
* gcc/g++ >= 5.4
  * Linux: gcc / g++ is installed by default on most Linux distros
  * Mac: same deal as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
  * Windows: recommend using [MinGW](http://www.mingw.org/)
* [uWebSockets](https://github.com/uWebSockets/uWebSockets)
  * Run either `install-mac.sh` or `install-ubuntu.sh`.
  * If you install from source, checkout to commit `e94b6e1`, i.e.
    ```
    git clone https://github.com/uWebSockets/uWebSockets
    cd uWebSockets
    git checkout e94b6e1
    ```
    Some function signatures have changed in v0.14.x. See [this PR](https://github.com/udacity/CarND-MPC-Project/pull/3) for more details.

* **Ipopt and CppAD:** Please refer to [this document](https://github.com/udacity/CarND-MPC-Project/blob/master/install_Ipopt_CppAD.md) for installation instructions.
* [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). This is already part of the repo so you shouldn't have to worry about it.
* Simulator. You can download these from the [releases tab](https://github.com/udacity/self-driving-car-sim/releases).
* Not a dependency but read the [DATA.md](./DATA.md) for a description of the data sent back from the simulator.

## Basic Build Instructions

1. Clone this repo.
2. Make a build directory: `mkdir build && cd build`
3. Compile: `cmake .. && make`
4. Run it: `./mpc`.

## Tips

1. It's recommended to test the MPC on basic examples to see if your implementation behaves as desired. One possible example
is the vehicle starting offset of a straight line (reference). If the MPC implementation is correct, after some number of timesteps
(not too many) it should find and track the reference line.
2. The `lake_track_waypoints.csv` file has the waypoints of the lake track. You could use this to fit polynomials and points and see of how well your model tracks curve. NOTE: This file might be not completely in sync with the simulator so your solution should NOT depend on it.
3. For visualization this C++ [matplotlib wrapper](https://github.com/lava/matplotlib-cpp) could be helpful.)
4.  Tips for setting up your environment are available [here](https://classroom.udacity.com/nanodegrees/nd013/parts/40f38239-66b6-46ec-ae68-03afd8a601c8/modules/0949fca6-b379-42af-a919-ee50aa304e6a/lessons/f758c44c-5e40-4e01-93b5-1a82aa4e044f/concepts/23d376c7-0195-4276-bdf0-e02f1f3c665d)
5. **VM Latency:** Some students have reported differences in behavior using VM's ostensibly a result of latency.  Please let us know if issues arise as a result of a VM environment.

## Editor Settings

We've purposefully kept editor configuration files out of this repo in order to
keep it as simple and environment agnostic as possible. However, we recommend
using the following settings:

* indent using spaces
* set tab width to 2 spaces (keeps the matrices in source code aligned)

## Code Style

Please (do your best to) stick to [Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).

## Project Instructions and Rubric

Note: regardless of the changes you make, your project must be buildable using
cmake and make!

More information is only accessible by people who are already enrolled in Term 2
of CarND. If you are enrolled, see [the project page](https://classroom.udacity.com/nanodegrees/nd013/parts/40f38239-66b6-46ec-ae68-03afd8a601c8/modules/f1820894-8322-4bb3-81aa-b26b3c6dcbaf/lessons/b1ff3be0-c904-438e-aad3-2b5379f0e0c3/concepts/1a2255a0-e23c-44cf-8d41-39b8a3c8264a)
for instructions and the project rubric.

## Hints!

* You don't have to follow this directory structure, but if you do, your work
  will span all of the .cpp files here. Keep an eye out for TODOs.

## Call for IDE Profiles Pull Requests

Help your fellow students!

We decided to create Makefiles with cmake to keep this project as platform
agnostic as possible. Similarly, we omitted IDE profiles in order to we ensure
that students don't feel pressured to use one IDE or another.

However! I'd love to help people get up and running with their IDEs of choice.
If you've created a profile for an IDE that you think other students would
appreciate, we'd love to have you add the requisite profile files and
instructions to ide_profiles/. For example if you wanted to add a VS Code
profile, you'd add:

* /ide_profiles/vscode/.vscode
* /ide_profiles/vscode/README.md

The README should explain what the profile does, how to take advantage of it,
and how to install it.

Frankly, I've never been involved in a project with multiple IDE profiles
before. I believe the best way to handle this would be to keep them out of the
repo root to avoid clutter. My expectation is that most profiles will include
instructions to copy files to a new location to get picked up by the IDE, but
that's just a guess.

One last note here: regardless of the IDE used, every submitted project must
still be compilable with cmake and make./

## How to write a README
A well written README file can enhance your project and portfolio.  Develop your abilities to create professional README files by completing [this free course](https://www.udacity.com/course/writing-readmes--ud777).

repository: foxliu/CarND-MPC-Project

repo_name: foxliu/CarND-MPC-Project


text:
---
layout: post
title: Profiling .NET Code with PerfView and visualizing it with speedscope.app
excerpt_separator: <!--more-->
---

# speedscope.app

According to the [official web page](https://github.com/jlfwong/speedscope), [speedscope.app](https://www.speedscope.app/) is "a fast, interactive web-based viewer for performance profiles". But I believe it's more than that! In my opinion, it's one of the best visualization tools for performance profiles ever!

Some time ago I have implemented [SpeedScopeExporter](https://github.com/Microsoft/perfview/pull/842) which allows exporting any .NET Trace file to a speedscope json file format. It was released as part of `2.0.34` [TraceEvent](https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/) library a few months ago, but so far it was not available for the end users from PerfView GUI/command line level.

Yesterday, a new version of PerfView got [released](https://github.com/Microsoft/perfview/releases/tag/P2.0.39) with the new possibility to export to speed scope file format. So now the PerfView users can use [speedscope.app](https://www.speedscope.app/) to view their performance profiles and take advantage of all the goodness it offers!

{: .center}
![Demo](https://user-images.githubusercontent.com/150329/40900669-86eced80-6781-11e8-92c1-dc667b651e72.gif)

<!--more-->

## The Story

Vance Morrison, the .NET Performance Architect has emailed me and asked if I would like to implement web-based flame graphs for our non-Windows user story as I was the guy who [implemented](https://github.com/Microsoft/perfview/pull/502) it for PerfView a while back.

I knew that the app which does exactly what we needed have already existed. I did not remember the name but I remembered that I retweeted something about it, so I have opened the list of my retweeted posts and found it quickly.

I made sure that the app does not upload the data anywhere, has an MIT license, is actively maintained, has a self-contained version and can handle non-trivial files.

To my surprise, convincing Vance to use it was easy ;)

I did not want to introduce another file format so I decided to export the data to a very simple speedscope JSON-based file format ([spec](https://github.com/jlfwong/speedscope/blob/master/src/lib/file-format-spec.ts)).

I read the file format specification, wrote the tests first and made it work. Handling all edge cases was a lot of fun!

## How it works

[speedscope.app](https://www.speedscope.app/) is a single page application that works with any modern web browser. It supports plenty of file formats, including [perf](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)), [pprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go)), [chrome](https://github.com/jlfwong/speedscope/wiki/Importing-from-Chrome) and [firefox](https://github.com/jlfwong/speedscope/wiki/Importing-from-Firefox). The profiles are not uploaded anywhere!

Every Trace File contains a huge amount of samples. A sample is more or less a call stack captured by the profiler. The job of [SpeedScopeExporter](https://github.com/Microsoft/perfview/blob/master/src/TraceEvent/Stacks/SpeedScopeStackSourceWriter.cs) is to group the samples by Threads, make sure they don't overlap in time, translate the frame ids to method names and save it in a format and order expected by the speedscope.

## How to use it?

If you want to export a trace file from PerfView, you need to open it, load the symbols, filter and from the "File" menu choose "Save View As" and then select "Speed Scope Format" from the combo box.

{: .center}
![SaveAs](./../images/speedscope/saveas.png)

If you want to export a .NET Trace File to speedscope file format without using PerfView you either have to use TraceEven library yourself or wait until the dotnet collect diagnostic tool [merges](https://github.com/dotnet/diagnostics/pull/114) the support for it.

Once you have the `.speedscope.json` file you just need to open it with [speedscope.app](https://www.speedscope.app/). You can also download a self-contained version from [https://github.com/jlfwong/speedscope/releases](https://github.com/jlfwong/speedscope/releases).

{: .center}
![Open](./../images/speedscope/open.gif)

## Demo

I have profiled the following C# app with PerfView and exported the trace file to `.speedscope.json` file. For brevity, I am going to skip the PerfView introduction here. You can find the JSON file [here](https://gist.github.com/adamsitnik/1b34626c20b86b48e0aca593567023f5).

```cs
class Program
{
    static void Main(string[] args)
    {
        A(); B(); A(); B(); A(); B(); A(); B(); A();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static void A()
    {
        for (int i = 0; i < 500_000_000; i++) { }
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static void B()
    {
        for (int i = 0; i < 500_000_000; i++) { }
    }
}
```

### Time Order View

{: .center}
![TimeOrder](./../images/speedscope/TimeOrder.png)

In the "Time Order" view, call stacks are ordered in chronological order. This is very unique compared to Flame Graphs because it allows us to understand the behavior of an application over time.

### Left Heavy

{: .center}
![LeftHeavy](./../images/speedscope/LeftHeavy.png)

The "Left Heavy" is a reverse Flame Graph. The data is aggregated, not over time.

### Sandwitch

{: .center}
![Sandwitch](./../images/speedscope/Sandwitch.png)

The Sandwich view is a table view with all methods from the profile and their associated times. You can sort by self time (exclusive time) or total time (inclusive time).

When you click on one of the methods, you can see all the callers and callees of it. The app is so intuitive that it almost does not need any docs!

## Limitations

It's not possible to show data from multiple threads running at the same time on a single view, so every Thread has it's own "tab" and you can switch between the threads using the arrows:

{: .center}
![Threads](./../images/speedscope/Threads.png)

Moreover, the app normalizes the relative time for every Thread. If we export a profile for Thread A that did some work between 0-200 ms and Thread B that did some work between 100-110ms the app will show the start time as 0ms for both of them and Thread B activity will be represented as between 0ms and 10ms (not 100-110ms). I was thinking about generating a 1e-10 ms long event at time 0ms for every Thread, but then the app would not scale the UI so nice.

{: .center}
![Finalizer](./../images/speedscope/Finalizer.png)

If we don't have any profile information for a given period of time, we have nothing to show in the "Time Order View". It's important to remember that tracing in .NET captures only the call stacks of active Threads, so any blocking IO will be represented as a blank space. In the future, I might use the data from OS/.NET Runtime events to fill this space.

{: .center}
![Empty](./../images/speedscope/Empty.png)

## Sample usage - .NET Core Process Startup Time

Using the new tool we can find out how long does it take to start a .NET Core process and see what exactly happens in what order during the startup.

To do that, we need to create a "Hello World" .NET Core app first.

```cmd
dotnet new console
```

Then tell the PerfView to Run following command:

```cmd
dotnet run -c Release
```

{: .center}
![Empty](./../images/speedscope/Run.png)

Disable grouping and folding, load all the symbols (see my [previous blog post](https://adamsitnik.com/Sample-Perf-Investigation/#analysing-the-trace-file) to learn how to do it) and export to speedscope format:

What is the cost of "Hello World" compared to the .NET VM Startup?

{: .center}
![HelloWorld](./../images/speedscope/HelloWorld.png)

What took so long? Let's zoom it and find out!

{: .center}
![Startup](./../images/speedscope/Startup.gif)

### Kudos

[Jamie Wong](https://github.com/jlfwong) is the author of [speedscope.app](https://www.speedscope.app/) who deserves all the credit! I just wrote a simple exporter which allows us to use his awesome tool!

gha_language: SCSS

gha_license_id: MIT


text:
# Frog

```text
fontawesome-6/Solid/Frog
```

```text
include('fontawesome-6/Solid/Frog')
```

| Illustration | Frog |
| :---: | :---: |
| ![illustration for Illustration](../../fontawesome-6/Solid/Frog.png) | ![illustration for Frog](../../fontawesome-6/Solid/Frog.Local.png) |

## Sprites
The item provides the following sriptes:

- `<$FrogXs>`
- `<$FrogSm>`
- `<$FrogMd>`
- `<$FrogLg>`

## Frog

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element Frog
include('fontawesome-6/Solid/Frog')

' renders the element
Frog('Frog', 'Frog', 'an optional tech label', 'an optional description')
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element Frog
include('fontawesome-6/Solid/Frog')

' renders the element
Frog('Frog', 'Frog', 'an optional tech label', 'an optional description')
@enduml
```

repository: tmorin/plantuml-libs

gha_language: TypeScript

repo_name: tmorin/plantuml-libs


text:
# Bits.sass utilities

A collection of low-level utility classes for common CSS tasks.
See [detailed info](https://github.com/bits-sass/docs/utilities.md).

__All of these classes should be modified with great care.__

Read more about [Bits.sass toolkit](https://github.com/bits-sass/bits.sass).

Check out other [Bits.sass packages](https://github.com/bits-sass).

## Installation

__Bower:__ `bower install --save bits-sass-utils`

This command installs all subpackages. See the list below.

## Packages

* [bits-sass-utils-dimension](https://github.com/bits-sass/utils-dimension) - intrinsic and proportional widths
* [bits-sass-utils-display](https://github.com/bits-sass/utils-display) - display property
* [bits-sass-utils-image](https://github.com/bits-sass/utils-image) - image replacement
* [bits-sass-utils-layout](https://github.com/bits-sass/utils-layout) - clearfix, floats, vertical align, ...
* [bits-sass-utils-link](https://github.com/bits-sass/utils-link) - clean, block-level, complex, ...
* [bits-sass-utils-offset](https://github.com/bits-sass/utils-offset) - before and after proportional offsets
* [bits-sass-utils-space](https://github.com/bits-sass/utils-space) - margin and padding
* [bits-sass-utils-state](https://github.com/bits-sass/utils-state) - visually hidden, hidden, draggable, disabled, ...
* [bits-sass-utils-text](https://github.com/bits-sass/utils-text) - truncate, word break, align, ...

## Requirements

* Sass 3.2+

## Browser support

* Google Chrome (latest)
* Opera (latest)
* Firefox 4+
* Safari 5+
* Internet Explorer 8+

repository: bits-sass/utils

repo_name: bits-sass/utils


text:
# Point Final
### Bootstrap template used: "Grayscale"

[Grayscale](http://startbootstrap.com/template-overviews/grayscale/) is a multipurpose, one page HTML theme for [Bootstrap](http://getbootstrap.com/) created by [Start Bootstrap](http://startbootstrap.com/).

### Website for nightclub in Ghent

repository: KilianHoefman/PointFinal

repo_name: KilianHoefman/PointFinal


text:
---
hrs_structure:
  division: '1'
  volume: '5'
  title: '15'
  chapter: 271G
  section: 271G-9
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0271G-0009
    parent: HRS0271G
    name: >-
      271G-9 Copies of schedules, tariffs, contracts, etc., kept as public
      records; evidence
weight: 26050
title: >-
  Copies of schedules, tariffs, contracts, etc., kept as public records;
  evidence
full_title: >-
  271G-9 Copies of schedules, tariffs, contracts, etc., kept as public records;
  evidence
---
**[§271G-9] Copies of schedules, tariffs, contracts, etc.,** **kept as public records; evidence.** The copies of schedules and classifications and tariffs or rates, fares, and charges, and all contracts, agreements and arrangements between water carriers filed with the public utilities commission as herein provided, and any reports filed with the commission as required under this chapter shall be preserved as public records. [L 1974, c 94, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# *De novo* assembly and annotation of bacterial metatranscriptomes

This document describes how to perform an annotation of a (mostly) bacterial metatranscriptome
starting with a *de novo* assembly.

It depends on library makefiles from
[biomakefiles](https://github.com/erikrikarddaniel/biomakefiles) and the following programs:

- Cutadapt

- Sickle

- Bowtie2

- Samtools

- MegaHIT

All are installed as modules at UPPMAX clusters, all named as you expect but with only small
letters. Choose the newest version.

## Biomakefiles

See [Make and `biomakefiles`](detail-docs/biomakefiles.md) for a, so far, short introduction.

# Workflow

The overall workflow runs like this:

1. Remove sequencing adapters and quality trim reads

2. Remove stable RNA (e.g. rRNA, tRNA)

3. Assemble reads with MegaHIT

4. Map reads back to assembly to allow quantification

5. Call ORFs

6. Annotate, functionally and taxonomically, ORFs

(This documentation is not finished yet for all the steps.)

## Preparing your sequence files

First, you need to run [quality trimming and cut adapters](detail-docs/quality_trim_and_cutadapt.md).

## Remove stable RNA

TO BE DOCUMENTED.

## Assembly with MegaHIT

See [Assembly of metaG or metaT sequences with MegaHIT](detail-docs/metaG_and_metaT_assembly_with_megahit.md).

## Map back reads to the assembly

Mapping reads back to the assembly is useful for at least two purposes. First of all, it allows us
to quantify how much of our data (the reads) were incorporated in the assembly. If a large
proportion of reads do not map back to the assembly, the assembly is not very representative.
Secondly, after calling ORFs (genes) one can use the mapping results to quantify the ORFs, leading
to the tables with genes, samples and counts that we need for the biological analysis.

Mapping in general will be described in [mapping reads to
sequences](detail-docs/mapping_reads_to_sequences.md), so here I'm only giving
a short description of how to map metaT reads to a MegaHIT assembly.

Create a subdirectory to the `all.megahit_out` directory created by the assembly process described
above, and place symbolic links to the read files plus the output from the assembly there:

```
cd all.megahit_out
mkdir bowtie2
cd bowtie2
ln -s ../../*.r?.fastq.gz .
ln -s ../final.contigs.fa my_metaT_assembly.fna
```

Write a `Makefile` that looks something like this (the paths to where `makefile.bowtie2` and
`makefile.samtools` are located are likely to be different for you):

```{make}
include ../../../biomakefiles/lib/make/makefile.bowtie2
include ../../../biomakefiles/lib/make/makefile.samtools

# Set this to the number of cores you have (20 for rackham, 16 for snowy)
BOWTIE_ALIGN_OPTS = -p 20

BOWTIE_INDEX = my_metaT_assembly
```

Before you can map, you need to create the database that Bowtie2 reads. This is done with `make
my_metaT_assembly.bowtie2index` (do a "dry run" with `make -n` like above):

```
# Load the required modules
module load bowtie2
module load samtools
# Send the command to the queue
sbatch -A $uproject -J $prefix:megahit -p core -n 4 --wrap "make my_metaT_assembly.bowtie2index" --mail-user=$email --mail-type=ALL -t 10-00:00:00
```

When the above job finishes, you can start the mapping:

```
sbatch -A $uproject -J $prefix:megahit -p node -N 1 --wrap "make all_pe_sorted_bams" --mail-user=$email --mail-type=ALL -t 10-00:00:00
```

repository: LNUc-EEMiS/workflow-docs

repo_name: LNUc-EEMiS/workflow-docs


text:
# ELEC498Capstone
Currently uses 2 models:
  - YOLO - Extracting bird subimages
  - Custom Tensorflow model - Classify `goose` and `not goose`
## Instructions
  - Download the weights from https://pjreddie.com/media/files/yolov3.weights
  - Move the file (`yolov3.weights`) to `config/`
  - Run `model.ipynb` using Jupyter.
## Dependancies
  - Matplotlib
  - OpenCV
  - Tensorflow (GPU is preferred)
##### YOLO Bounding box detection on goose.
![YOLO Bounding box detection on goose](https://i.imgur.com/4f4BXGA.jpg)


text:
---
id: 5900f4691000cf542c50ff7b
title: "Problem 252: Convex Holes"
challengeType: 5
forumTopicId: 301900
dashedName: problem-252-convex-holes
---

# --description--

Given a set of points on a plane, we define a convex hole to be a convex polygon having as vertices any of the given points and not containing any of the given points in its interior (in addition to the vertices, other given points may lie on the perimeter of the polygon).

As an example, the image below shows a set of twenty points and a few such convex holes. The convex hole shown as a red heptagon has an area equal to 1049694.5 square units, which is the highest possible area for a convex hole on the given set of points.

For our example, we used the first 20 points (T2k−1, T2k), for k = 1,2,…,20, produced with the pseudo-random number generator:

S0 = 290797 Sn+1 = Sn2 mod 50515093 Tn = ( Sn mod 2000 ) − 1000

i.e. (527, 144), (−488, 732), (−454, −947), …

What is the maximum area for a convex hole on the set containing the first 500 points in the pseudo-random sequence? Specify your answer including one digit after the decimal point.

# --hints--

`euler252()` should return 104924.

```js
assert.strictEqual(euler252(), 104924);
```

# --seed--

## --seed-contents--

```js
function euler252() {
  return true;
}

euler252();
```

# --solutions--

```js
// solution required
```


text:
![toolkit logo](assets/images/toolkit.png)

# Toolkit Electron

 Utility from tray menu.

The documentation can be found in our [JSDocs](https://github.com/JeanBarbosa/toolkit/)

## Description

## How to use

First, install it:

```bash
yarn add toolkit
```

Or using npm:

```bash
npm install toolkit
```

toolkit.me's JavaScript library can be used in three ways:

## Building

To build the library, use `npm start`.

* Node.js build is produced inside the `dist` directory.
* Browser build is produced inside the `browser` directory.

## Testing

To run the library tests, use `npm test`.

>To run tests, you need to export `API_KEY` environment variable with your
API key. When submitting a PR, Travis will already have it exported.

## License

```
The MIT License (MIT)
```

repository: JeanBarbosa/toolkit

gha_language: JavaScript

repo_name: JeanBarbosa/toolkit


text:
---
layout: post
title: About Me
tags: [about, tommy, treb, python, mongo, mongodb, react, reactjs, firebase, node, nodejs]
---

My name is Tommy Treb and I am a software developer. I love thinking up new ideas and bringing them to life with code. I also have the same love (and sometimes hate) for the game of billiards. It is just too fun.

![My movie poster]({{ "/assets/img/movie-poster.png" | absolute_url }})

This image is me shooting a shot at a state tournament. The poster is a birthday gift from my girlfriend Jeanna Diedrich. A friend of ours designed it, and I can't think of a cooler gift! The full image can be viewed [here][movie-poster-full] where all of the text is readable, if you're interested.

I am a pretty laid back dude.  Currently Playerunknown's Battlegrounds has been my go-to.

My interests when it comes to programming include Python, NodeJS, ReactJS, KnockoutJS, and MongoDB. These are what I've been dipping my toes into for the past 2 years and I've loved it! I've got a few projects you can take a look at on my [projects][projects] page that use these technologies.

I enjoy doing back-end development the most, just because sometimes front-end can be stubborn when dealing with the UI. I have however been improving my skills in this area and it is making a difference in my enjoyment (with html at least).

[movie-poster-full]:/assets/img/movie-poster-full.png
[projects]:/projects


text:
# Confluence Repository Connector

* Overview
	1. Connects to Confluence, and indexes the artifact.
	2. Internally documents are parsed and meta data are extracted using Tika
	3. Support Locale - English US ( Currently common_en_US.properties, available, looking for support from some to do the translation for the keys)

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

repository: kuhajeyan/ksource

repo_name: kuhajeyan/ksource


text:
# iCharts

## Running

### iOS

First, meet the [requirements](http://facebook.github.io/react-native/docs/getting-started.html#requirements) on the getting started guide.

Then, check out the repository and run the following inside it:

`$ npm install`

Open `iCharts/ios/iCharts.xcodeproj`, follow these [instructions](https://github.com/react-native-community/react-native-linear-gradient) to add react-native-linear-gradient to the project, and hit run.

If you have errors compiling due to linking errors, removing the derived data may help. Quit Xcode, delete `/Users/{you}/Library/Developer/Xcode/DerivedData`, and re-open Xcode.

## Style Guide

### Code

#### General

* **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.
* Add trailing commas,
* 2 spaces for indentation (no tabs)
* "Attractive"

#### JavaScript

* Use semicolons;
* `'use strict';`
* Prefer `'` over `"`
* Do not use the optional parameters of `setTimeout` and `setInterval`
* 80 character line length

#### JSX

* Prefer `"` over `'` for string literal props
* When wrapping opening tags over multiple lines, place one prop per line
* `{}` of props should hug their values (no spaces)
* Place the closing `>` of opening tags on the same line as the last prop
* Place the closing `/>` of self-closing tags on their own line and left-align them with the opening `<`

#### Objective-C

* Space after `@property` declarations
* Brackets on *every* `if`, on the *same* line
* `- method`, `@interface`, and `@implementation` brackets on the following line
* *Try* to keep it around 80 characters line length (sometimes it's just not possible...)
* `*` operator goes with the variable name (e.g. `NSObject *variableName;`)

repository: jrvanderveen/iCharts

repo_name: jrvanderveen/iCharts


text:
---
layout: post
title: Mean Field Approximation
header-img: "images/math.png"
comments: true
---

When facing a clustering problem we often have statistical dependencies between the assignments of different objects. This means to evaluate the cost function we need to check the whole space of possible assignments of cardinality $$ k^N $$.

To avoid this computationally infeasible method we approximate the assignment distribution by restricting its space to the space of factorial distributions.

$$ \mathcal{Q} = \{ Q \in P: Q(c, \Theta^0) = \prod_{i\leq n} q_i(c(i)) , q_i(\nu) \in [0,1] \} $$

Remark: The notion $$q_i(\nu)$$ denotes the probability of assigning object $$ i$$ to cluster $$\nu$$. The function $$ c(i)$$ is the mapping from the objects to the clusters.

With the defined distribution we try to approximate the true underlying clustering distribution i.e. the Gibbs-Distributions for our cost function $$ R(c)$$.

$$p^{Gibbs}(c,\Theta) = \frac{e^{-\beta R(c)}}{Z} = e^{-\beta (R(c) - \mathcal{F})} $$

To quantify the closeness of our approximated, factorial distribution to the Gibbs distribution we use the Kullback-Leibler-Divergence between them. And we say to have the best approximation if we minimize this divergence.

$$ \arg \min_{\Theta^0} D^{KL}[Q(c, \Theta^0) || p^{Gibbs}(c,\Theta))] $$

## Meanfield Upper Bound

Because of the non-negativity property of the Kullback-Leibler-Divergence we can derive an upper bound for the free energy $$ \mathcal{F}$$.

$$\begin{aligned} 0 &\leq \sum_{c \in \mathcal{C}}Q(c, \Theta^0) \log \frac{Q(c, \Theta^0)}{e^{-\beta (R(c) - \mathcal{F})}} \\ &=\sum_{c \in \mathcal{C}}Q(c, \Theta^0) [ \sum_{i \leq n} \log q_i(c(i)) + \beta(R(c) - \mathcal{F})] \\ &= \sum_{i \leq n}\sum_{c \in \mathcal{C}}Q(c, \Theta^0) \log q_i(c(i)) + \beta (\mathbb{E}_Q[R] - \mathcal{F}) \\ &=\sum_{i \leq n} \sum_{\nu \leq K} q_i(\nu) \log q_i(\nu) +\beta \mathbb{E}_Q[R] - \beta  \mathcal{F}\end{aligned} $$

which leads us to the upper bound of the free energy, denoted with $$ \mathcal{B}$$.

$$ \begin{aligned} \mathcal{F} \leq \underbrace{\frac{1}{\beta}}_\text{temperature scale}\underbrace{\sum_{i \leq n} \sum_{\nu \leq K} q_i(\nu) \log q_i(\nu)}_\text{negative entropy of assignments} + \underbrace{\mathbb{E}_Q[R]}_\text{Expected costs}  &= \mathcal{B} \end{aligned} $$

In the next step we are going to minimize the upper bound $latex \mathcal{B}$ with respect to our probabilistic assignment variable $$ q_u(\alpha)$$ (that's the likelihood of assigning object $$ u$$ to cluster $$ \alpha$$). In order to do this we construct the following lagrangian and set it to zero:

$$ \begin{aligned}  \frac{\partial}{\partial q_u(\alpha)} [ \mathcal{B} + \sum_{i \leq n} \lambda _i (\sum_{\nu \leq k} q_i(\nu) - 1)] =  0 \end{aligned} $$

The second part of the lagrangian is due to the constraint that we want the assignment for each object to be a probability distribution over the space of possible clusters. This means that the probabilities for the different clusters for one object needs to sum up to one ($$ \sum_{\nu \leq k} q_i(\nu) = 1 \quad \forall i  $$). Evaluating the given expression leads us directly to the desired Meanfield Equations.

$$ \begin{aligned} 0 = \sum_{c \in \mathcal{C}} \prod_{\substack{i \leq n \\ i \neq u}} q_i(c(i)) \mathbf{1}_{\{ c(u) = \alpha \}} R(c) + \frac{1}{\beta} (\log q_u(\alpha) + 1) + \lambda_u \end{aligned}$$

Solving the equation for $$ q_u(\alpha)$$ and using the above introduced constraint $$ \sum_{\nu \leq k} q_i(\nu) = 1 \quad \forall i  $$ we get the Meanfield Equations.

$$ \begin{aligned} q_u{\alpha} = \frac{e^{-\beta h_{u,\alpha}}}{\sum_{\nu \leq k} e^{-\beta h_{u,\nu}}} \qquad  h_{u,\alpha} = \mathbb{E}_{Q_{u \rightarrow \alpha}} [R(c)] \end{aligned} $$

## The Algorithm

Now that we know how to derive the Meanfield Equations we want to know how we can actually apply this to real world data. Since the equations are based on the the expected cost of assigning object $$u$$ to cluster $$ \alpha$$  ($$ (\mathbb{E}_{Q_{u \rightarrow \alpha}} [R(c)]$$), we need to be able to decompose our cost function into contributions of object $$ u$$ and costs that are not affected by $$ u$$. The algorithm then follows an iterative EM style approach.

1. Initialize $$ q_i(1), \dots , q_i(k) = \frac{1}{k} \quad \forall i $$
2. Repeat
	1. Choose a site $$ u$$ randomly from your objects
	2. E-Step:  calculate $$h_{u,\alpha} = \mathbb{E}_{Q_{u \rightarrow \alpha}} [R(c)]$$ for given $$ q_u(1), \dots , q_u(k)$$
	3. M-Step: calculate $$q_u(\alpha) = \frac{e^{-\beta h_{u,\alpha}}}{\sum_{\nu \leq k} e^{-\beta h_{u,\nu}}} \quad \forall \alpha$$ for given $$h_{u,1}, \dots , h_{u,k}$$


text:
---
sidebar: manual
---

# Migration from v1.9.x to v2.1.x
You can follow the same instructions as listed for for
[v1.9.x to v2.0.x](/win-acme/manual/upgrading/to-v2.0.0)
with some notable exceptions.

Releases `2.1.4` and above will also ensure that there is an account for the
ACMEv2 server, so that an initial manual renewal is no longer required.
For fully unattended upgrades, you will therefor have to specify
`--import --emailaddress<EMAIL_ADDRESS>--accepttos` on the command line so
that the account can be created without additional user input.

# Migration from v2.0.x to v2.1.0
Version 2.1.0 is an xcopy update for "standard" users, but those who customized the program to fit their
needs with `settings.config`, custom plugins or custom Serilog configuration will have to re-apply some of
these modifications.

- Custom plugins will have to be modified to conform to the new async interfaces of this version of win-acme.
Also they will have to be targeted to build for .NET Core 3.1. Note that this does not affect installation or
DNS scripts, only additional `.dll`s.
- settings.config has been replaced with [settings.json](/win-acme/reference/settings). The format is more
readable and nicely structured, but if you have some custom settings, you will have to re-apply them.
- If you are using custom settings for Serilog, you will have to migrate them to a new file called
`serilog.json`. More details are available [here](/win-acme/manual/advanced-use/custom-logging).

repository: suhail-sullad/win-acme

repo_name: suhail-sullad/win-acme


text:
# A PHP package to work with percentages

A clean interface to calculate percentages in PHP: changes between values, percentage increases, partial values, extensions, ...

Think of it as a _very_ lightweight math library for the basic stuff. Aimed to make your code more readable and easier to understand.

## Installation

You can install the package via composer:

```bash
composer require mattiasgeniar/php-percentages
```

## Usage

```php
<?php
use Mattiasgeniar\Percentage\Percentage;

// What's the percentage increase from 100 to 120?
Percentage::differenceBetween(100, 120);            // 20%

// What's the absolute percentage change from 100 to 80?
// (uses the abs() function)
Percentage::absoluteDifferenceBetween(100, 80);     // 20%, not -20%

// How much is 120 compared to 100?
Percentage::calculate(120, 100);                    // 120%

// How much is 50 compared to 100?
Percentage::calculate(50, 100);                     // 50%

// What is 20% of 200?
Percentage::of(20, 200);                            // 40

// What is the 140% extension from 3 to 2?
Percentage::extension(140, 3, 2);                   // 1.6

// What is the 140% extension from 1 to 2?
Percentage::extension(140, 1, 2);                   // 2.4
```

## Helper functions

The above expressions can also be used through a variety of helper functions:

- `percentage()`
- `percentage_between()`
- `percentage_abs_between()`
- `percentage_of()`
- `percentage_extension()`

## Testing

``` bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## Credits

- [Mattias Geniar](https://github.com/mattiasgeniar)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: mattiasgeniar/php-percentages

gha_language: PHP

repo_name: mattiasgeniar/php-percentages


text:
My talk for the CS Tools Tips and Tricks Seminar: https://www.cs.mcgill.ca/events/251/

## Title: Looking at your data with Jupyter and Pandas

Prerequisite: https://docs.python.org/3/tutorial/

Install Jupyter: https://jupyter.org/install

Install JupyterLab: https://github.com/jupyterlab/jupyterlab#installation

#### Overview: This will be an introduction to using Jupyter Notebooks(/Lab) and [Pandas](https://pandas.pydata.org/pandas-docs/stable/) to do some data analysis. We will also explore some tips and tricks for fitting these tools into a research workflow.

#### Goals:

- To introduce you to some tools you might want to know if you're looking for a job that requires you to work with data.

- To provide some tools that make you a more productive researcher when making illustrations, tables and artifacts, and why it makes sense to put this in Jupyter.

#### Some material I used to learn:

- https://github.com/jvns/pandas-cookbook

- https://www.coursera.org/learn/python-data-analysis/

#### Agenda:

- Introduction to Jupyter Notebooks.
	- What is Jupyter?
	- Some code examples in Jupyter

- Quick Introduction to Pandas
	- What is Pandas?
	- Some pandas examples

- Some thoughts on when to use Jupyter and Pandas

- The actual CS Tools and Tricks, see `Tips.ipynb`

- Demo of JupyterLab on CalculQuebec infrastructure

- An example data analysis

Some things I haven't found a good solution to yet (suggestions welcome):

- Version controlling notebooks

- Writing tests in notebooks

#### Additional References:

- I don't like notebooks.- Joel Grus (Allen Institute for Artificial Intelligence): https://www.youtube.com/watch?v=7jiPeIFXb6U

- JupyterLab page (click "try on binder" for a demo) https://jupyterlab.readthedocs.io/en/stable/

- JupyterHub https://wiki.calculquebec.ca/w/JupyterHub

- Google Colab: https://colab.research.google.com

- FiveThirtyEight Datasets: https://github.com/fivethirtyeight/data

- SQuAD2.0: https://rajpurkar.github.io/SQuAD-explorer/

#### Things that came up during the discussion:

- ReviewNB: https://www.reviewnb.com/

- Removed note about `.where()`

- Added sizing reference with `.tight_layout()`

- Talked about flattening columns with `.ravel()`: https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ravel.html

repository: ANich/research-data-analysis-tutorial

repo_name: ANich/research-data-analysis-tutorial


text:
TKGI k8s Automation Pipeline
---

## Motivation

This project was created to aid k8s cluster creation and management. The pipeline currently is based on [Tanzu Kubernetes Grid Integrated (TKGI)](https://network.pivotal.io/products/pivotal-container-service/).

This pipeline creates TKGI clusters based on the entires in `clusters/clusters.yaml`

```
.
├── LICENSE
├── README.md
├── environments
│   └── homelab
│       ├── clusters
│       │   ├── clusters.yaml
│       │   ├── k8s1
│       │   │   └── cluster.yaml
│       │   ├── k8s2
│       │   │   └── cluster.yaml
│       │   └── k8s3
│       │       └── cluster.yaml
│       ├── kubernetes-profiles
│       │   └── etcd-k8s-profile.json
│       └── network-profiles
│           ├── dedicated-network-profile.json
│           └── default-network-profile.json
├── pipelines
│   ├── params.yml
│   └── pipeline.yml
└── tasks
    ├── create-cluster
    │   ├── task.sh
    │   └── task.yml
    ├── create-namespaces
    │   ├── task.sh
    │   └── task.yml
    ├── create-profiles
    │   ├── task.sh
    │   └── task.yml
    ├── delete-cluster
    │   ├── task.sh
    │   └── task.yml
    └── delete-namespaces
        ├── task.sh
        └── task.yml
```

Place the k8s cluster details in their respective folders.

Currently the pipeline does the following:
- Creates kubernetes profiles _(if defined)_
- Creates network profiles _(if defined)_
- Creates kubernetes clusters
- Deletes unmanaged clusters
- Creates namespaces
- Deletes unmanaged namespaces

Feel free to extend this pipeline to suit your needs.


text:
# Bank Kata

Create a simple bank application with the following features:

- Deposit into Account
- Withdraw from an Account
- Print a bank statement to the console.

The entry point should be the following interface, which you can not change. Don't worry about introducing abstractions on Money or Date as this is not the point of the exercise.

```
public class BankAccount {
	public void deposit(int amount);
	public void withdraw(int amount);
	public void printStatement();
}
```

Statement should have the following format:

```
	DATE       | AMOUNT  | BALANCE
	10/04/2014 | 500.00  | 1400.00
	02/04/2014 | -100.00 | 900.00
	01/04/2014 | 1000.00 | 1000.00
```

repository: luis-moral/kata-bank

repo_name: luis-moral/kata-bank


text:
# Prometheus publisher
![since v0.5.0](https://img.shields.io/badge/since-v0.5.0-brightgreen)

In order to use the library add the dependency to your `project.clj`

``` clojure
;; Leiningen project
[com.brunobonacci/mulog-prometheus "x.x.x"]

;; deps.edn format
{:deps { com.brunobonacci/mulog-prometheus {:mvn/version "x.x.x"}}}
```
Current version: [![Clojars Project](https://img.shields.io/clojars/v/com.brunobonacci/mulog-prometheus.svg)](https://clojars.org/com.brunobonacci/mulog-prometheus)

The available configuration options:

``` clojure
{
   ;; You can supply your own registry which will be used for all
   ;; events.  If you do not specify a registry, the default registry
   ;; is used.  The default registry is the static
   ;; `CollectorRegistry.defaultRegistry`
   ;; :registry   (CollectorRegistry/defaultRegistry)

   ;; You can setup the prometheus-publisher to push to a prometheus
   ;; PushGateway.  When to use the pushgateway:
   ;; https://prometheus.io/docs/practices/pushing/
   ;;
   ;; `:job` is a string identification used within the Promethues
   ;; PushGateway and it is always required. The pushgateway adds this
   ;; to the `job` label.  Typically a unique job/application name is
   ;; used. You can read more here:
   ;; https://github.com/prometheus/pushgateway#about-the-job-and-instance-labels
   ;;
   ;; `:gateway` is a `io.prometheus.client.exporter.PushGateway` you
   ;; can provide an existing one that your application/job uses. If
   ;; one is not provided a new one is created with the `endpoint`
   ;; configuration.
   ;;
   ;; `:endpoint` is the address which the PushGateway client should
   ;; push to.  e.g `"http://localhost:9091"`
   ;;
   ;; `:push-interval-ms` is how often (in millis) the metrics needs
   ;; to be published to the PushGateway (if configured) by default
   ;; will be every `10000` (`10s`)
   ;;
   ;;
   ;; For example:
   ;;  * endpoint configuration:
   ;;    ```
   ;;    :push-gateway {:job      "my-awesome-job"
   ;;                   :endpoint "http://localhost:9091"}
   ;;    ```
   ;;
   ;;  * existing pushgateway:
   ;;    ```
   ;;    :push-gateway {:job      "my-awesome-job"
   ;;                   :gateway  ^PushGateway existing-prometheus-pushgateway}
   ;;    ```
   ;; Notice in either configuration `job` is required.
   ;;

   ;; A function to apply to the sequence of events before publishing.
   ;; This transformation function can be used to filter, transform,
   ;; anonymise events before they are published to a external system.
   ;; by default there is no transformation.  (since v0.1.8)
   :transform         identity

   ;; A function to apply to the sequence of metrics before converting
   ;; into a collection.  This tranformation function can be used to
   ;; (alter/add/remove) metric types, (alter/add/remove) labels or
   ;; add more detailed descriptions of what the metric does.
   ;;
   ;;
   ;; For the `:histogram` metric type. You can supply `:buckets`
   ;; which will be used instead of the defaults.
   ;;
   ;; default: `[0.005 0.01 0.025 0.05 0.075 0.1 0.25 0.5 0.75 1 2.5 5 7.5 10]``
   ;;
   ;;
   ;; For the `:summary` metric type. You can suppy the following to
   ;; be used instead of the defaults.
   ;;
   ;; `:quantiles` - quantiles to be used over the sliding window of time.
   ;; default: `[[0.5 0.001][0.9 0.001][0.95 0.001][0.99 0.001][0.999 0.001]]`
   ;;
   ;; `:max-age-seconds` - duration of the time window.
   ;; default: `600`
   ;;
   ;; `:age-buckets` - buckets used to implement sliding window.
   ;; default: `5`
   ;;
   ;; by default there is no transformation.
   :transform-metrics identity}
```

How to use it:

* Example with PushGateway:

``` clojure
(μ/start-publisher!
  {:type :prometheus
   :push-gateway {:job "mulog-demo"
                  :endpoint "http://localhost:9091"}})
```

* Usage example with *Prometheus endpoint* scraping:

To expose the metrics such that they will be scraped by Prometheus,
***μ/log*** exposes the registry and offers a facility to expose the
metrics in a Ring (or Compojure) application.

``` clojure
(require '[com.brunobonacci.mulog.publishers.prometheus :as prom])
;; create your publisher
(def pub (prom/prometheus-publisher {:type :prometheus}))
;; start the publisher
(def px (μ/start-publisher! {:type :inline :publisher pub}))

;; now it is possible to access the registry
(prom/registry pub)  ;; => registry
(prom/write-str pub) ;; formatted string with metrics in scrape format
```

In order to expose these metrics you need a standard Ring handler,
here an example:

``` clojure
;; ring handler to export metrics
(fn [_]
  {:status  200
   :headers {"Content-Type" "text/plain; version=0.0.4"}
   :body    (prom/write-str pub)})
```

Or if you are using Compojure then:

``` clojure
(def my-routes
    (routes
      ;; your existing routes
      (GET "/hello" [] "Hello World!")
      ;; here you can expose the metrics to Prometheus scraping process.
      (GET "/metrics" []
        {:status  200
         :headers {"Content-Type" "text/plain; version=0.0.4"}
         :body    (prom/write-str pub)})
      (route/not-found "<h1>Page not found</h1>")))
```

## Controlling which metrics are published

In some cases you might want to have fine control over which metrics are published
and the names used. For this purpose you can provide a custom transformation function
to the publisher configuration via the option `:transform-metrics`.

This transformation is applied after the publisher inferred which metrics will
be published given the set of events produced.

This function receives a sequence of metrics must return a sequence of metrics.

Here is an example of how the input looks like:

``` clojure
[

{:metric/type        :counter ;; or :summary  or :gauge
 :metric/value       1.0
 :metric/name        "metric_name"
 :metric/description "descriptions"
 :metric/labels      {"label_key1" "label_value1",
                      "label_key2" "label_value2"}}
]
```

repository: BrunoBonacci/mulog

gha_language: Clojure

repo_name: BrunoBonacci/mulog


text:
# Agaricus subericaeus Fr., 1884 SPECIES

#### Status
SYNONYM

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

#### Published in
Ges. naturf. Freunde, Berlin 2: 36 (1884)

#### Original name
Agaricus subericaeus Fr., 1884

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Strophariaceae/Psilocybe/Hypholoma subericaeum/ Syn. Agaricus subericaeus/README.md

repo_name: mdoering/backbone


text:
---
layout: default
active: notes
title: Research Notes

---
{% include mathjax.html %}

**NOTE: This has been removed from the website. It is kept only for a record of the tag list functions.**

Welcome to my online research notebook. I intend to store a set of notes here useful for my own research and student mentoring.

The notes are organized by tags. **Click on a tag to jump down to a sorted list of relevant pages.**

{% for tag in site.tags %}
  {% assign t=tag|first %}

{{ t | downcase}}

{% endfor %}

---

## Complete Notebook
Otherwise, here is **a complete list of all notes, sorted by date**. Since notes are continuously updated, the dates reflect the most recent modification.

{% for post in site.posts %}

    {{ post.date | date: "%Y-%m-%d"  }}
    {{ post.title }} -- {% for itag in post.tags %} {{ itag | downcase}} {% endfor %}

{% endfor %}

---

## Notes by Tag

{% for tag in site.tags %}
  {% assign t = tag | first %}
  {% assign posts = tag | last %}

{{ t | downcase }}

{% for post in posts %}
  {% if post.tags contains t %}

    {{ post.date | date: "%Y-%m-%d"  }}
    {{ post.title }} -- {% for itag in post.tags %} {{ itag | downcase}} {% endfor %}

  {% endif %}
{% endfor %}

---

{% endfor %}

gha_language: HTML


text:
---
layout: post
title: Redirecting Nohup Output to File
---

If I want to run a command using `nohup` and redirect the output to a file other than
the default `nohup.out` I can use the following syntax to redirect stdout and stderr into the
same file:

{% highlight sh %}

nohup [Command here] > filename.out 2>&1 &

{% endhighlight %}

The first `>` redirects stdout to `filename.out`, `2>` corresponds to the stderr which is redirected
into the same place as stdout `&1` and the final `&` returns you to the terminal immediately, ready for the next
command.

gha_language: CSS


text:
# Latent Space Visualization
Visualize the Latent Space of an Autoencoder using matplotlib

## What’s the Latent Space ?

An Autoencoder is made of two components: an Encoder & a Decoder. The Encoder brings the input data from a high dimensional representation to a bottleneck layer, where the number of neurons is the smallest. Then, the decoder takes this Encoded Input and converts it back to the original Input shape. The latent space is the space in which the data lies in the bottleneck layer.

The Latent Space contains a compressed representation of the image, which is the only information the decoder is allowed to use to try to reconstruct the input as fully as possible. To perform well, the network has to learn to extract the most relevant features in the bottleneck.

Once the Latent Space is plotted on a 2D space images can be generated by sampling from any point in that space.

## Requirements:
* Python 3.6.2 (https://www.python.org/downloads/release/python-362/)
* Numpy (https://pypi.org/project/numpy/)
* Tensorflow (https://pypi.org/project/tensorflow/)
* Keras (https://pypi.org/project/Keras/)
* Matplotlib (https://pypi.org/project/matplotlib/)
* Pillow (https://pypi.org/project/Pillow/)
* OpenCV (https://pypi.org/project/opencv-python/)

## Usage:

* Firstly, collect the required dataset of images to visualize (A datset of pokemon sprites is already provided). Once collected, the images need to be converted to RGB and then resized to 64x64 to fit the Autoencoder using RGBA2RGB.py & resize.py.
```
python RGBA2RGB.py --help

usage: RGBA2RGB.py [-h] --input INPUT --output OUTPUT

Convert RGBA to RGB

optional arguments:
  -h, --help       show this help message and exit
  --input INPUT    Directory containing images to resize. eg: ./resized
  --output OUTPUT  Directory to save resized images. eg: ./RGB_data
```

```
python resize.py --help

usage: resize.py [-h] --input INPUT --output OUTPUT

Resize Input Images

optional arguments:
  -h, --help       show this help message and exit
  --input INPUT    Directory containing images to resize. eg: ./data
  --output OUTPUT  Directory to save resized images. eg: ./resized
```

* Once the dataset is prepared, run LS_visualize in training mode to train the autoencoder.
```
python LS_visualize.py --help
usage: LS_visualize.py [-h] --input INPUT --name NAME [--epoch EPOCH] --mode MODE

Autoencoder Latent Space Visualization

optional arguments:
  -h, --help     show this help message and exit
  --input INPUT  Directory containing images eg: data/
  --name NAME    Model Name
  --epoch EPOCH  No of training iterations
  --mode MODE    Mode: train or plot
```
Once trained the latent space can be plotted by setting the mode to plot.

## Example:

Hovering over any region in the 2D space gives a reconstructed image. Images at points give perfect reconstruction, while in the white space a mix of different images is visible.

# G00D LUCK

For doubts email me at:
<EMAIL_ADDRESS>

repository: honsa/Latent-Space-Visualization

repo_name: honsa/Latent-Space-Visualization


text:
Using the telegram bot api for retrieve your ip address, every time it
has changed, being able to know your external ip address through a simple
telegram chat (useful when you are out of pc/home if you have a dynamic ip)

# apis used here

[telegram bot api](https://core.telegram.org/bots/api)

[httpbin api](http://httpbin.org/)

# to get your external ip address

    node httpbin

# how to use

# 1.setup

    you need a telegram bot api token (which can be get with /newbot command
        to @BotFather)
    after that, just run

        node setup

# 2.start

    and every time you need your bot to be running (to reply messages)
    run

        node start


text:
# Changlog

## Version 0.7

* Unpined google requirement versions
* Added option to remove MAX_LIMIT_ mode
* Added Badge (THX @zrosenbauer)

## Version 0.6.2

* Fixed parse_requirements for new pip version

## Version 0.6.1

* Fixed Engine Creation for multi threaded use

## Version 0.6

* New Configuration
* Restoring Config State from Database
* alpha REST Client
* Faster Access on last values for timeseries

## Version 0.5

* Config Storage
* Async Client
* Thread Pooling
* Plugable Engines
* SQLite Engine
* Small Improvements and Refactoring

## Version 0.4

* Removed python 2 support
* Using google-cloud-bigtable==1.2.0
* Using google-cloud-core==1.1.0
* New Build System for C Extension

repository: wuttem/cattledb

gha_language: Python

repo_name: wuttem/cattledb


text:
---
layout: pattern
title: Game Loop
folder:  game-loop
permalink: /patterns/game-loop/
categories: Behavioral
tags:
 - Game programming
---

## Intent
A game loop runs continuously during gameplay. Each turn of the loop, it processes user input without blocking, updates the game state, and renders the game. It tracks the passage of time to control the rate of gameplay.

This pattern decouple the progression of game time from user input and processor speed.

## Applicability
This pattern is used in every game engine.

## Explanation
Game loop is the main process of all the game rendering threads. It drives input process, internal status update, rendering, AI and all the other processes.

There are a lot of implementations of game loop:

- Frame-based game loop

Frame-based game loop is the easiest implementation. The loop always keeps spinning for the following three processes: processInput, update and render. The problem with it is you have no control over how fast the game runs. On a fast machine, that loop will spin so fast users won’t be able to see what’s going on. On a slow machine, the game will crawl. If you have a part of the game that’s content-heavy or does more AI or physics, the game will actually play slower there.

- Variable-step game loop

The variable-step game loop chooses a time step to advance based on how much real time passed since the last frame. The longer the frame takes, the bigger steps the game takes. It always keeps up with real time because it will take bigger and bigger steps to get there.

- Fixed-step game loop

For fixed-step game loop, a certain amount of real time has elapsed since the last turn of the game loop. This is how much game time need to be simulated for the game’s “now” to catch up with the player’s.

## Class diagram
![alt text](./etc/game-loop.urm.png "Game Loop pattern class diagram")

## Credits

* [Game Programming Patterns - Game Loop](http://gameprogrammingpatterns.com/game-loop.html)

repository: wsbhacker/java-design-patterns

gha_language: Java

repo_name: wsbhacker/java-design-patterns


text:
Default Spigot Project Builder
==========

Description
------------
This project offers a default generation for spigot plugin builds.

This program works with schematics and builds a project folder hierarchy in the output folder.

It automatically creates it with the needed spigot API dependency and maven groupID/artifactID

Made with javax.swing (will be changed to javaFX later)

Download

TODO
------

Add gradle schematic integration

Add default filesystem schematic integration

Move to javafx

Document methods/classes

Looking for someone to make a more in-depth readme or small tutorial for how to use it.

Author/Contact
-----------------

I go by Null or Nullbyte, previously known as ExoticCode

Discord: NullByte#5513

Spigot: NullBytes

GUI Preview:
---------------
A few important GUIs ->

![Image Not Found](https://i.imgur.com/AnBp53k.png)
![Image Not Found](https://i.imgur.com/Vwi8L5Y.png)
![Image Not Found](https://i.imgur.com/SMlZB56.png)
![Image Not Found](https://i.imgur.com/Htc5k3i.png)

repository: Corey-Null/SpigotProjectBuilder

repo_name: Corey-Null/SpigotProjectBuilder


text:
# Easy-to-use StyleGAN implementation

This implementation can either be used via command line or via Python API for easy use from Jupyter Notebooks or Python applications. The focus is on a good user experience with the most important parameters to tweak. More finegrained tuning options will be added over time, but always putting a good user experience first.

Usage is similar for command line and high-level Python API.

# Quickstart

Starting a project is as easy as:

1. Create a new project:
```sh
$ python main.py init /path/to/project
```

2. Edit your config (e.g. where's your training data?):
```sh
$ editor /path/to/project/config.yml
```

3. Start (or resume) training:
```sh
$ python main.py train /path/to/project
```

If training is interrupted, you can simply start training again. Training will resume at the latest checkpoint:
```sh
$ python main.py train /path/to/project
```

# Structure of a training project

```
/path/to/dataset
/path/to/results
  |- config.yml    // All configuration to run, resume and reproduce this project
  |- samples/
  |    |- fake-0000000.png
  |    |- fake-0001040.png
  |    \    ...
  |- checkpoints/
  |    |- snapshot-001040.pkl
  |    |- snapshot-004120.pkl
  |    \    ...
  |- training.log
  |- events.tfevents
  \    ...
```


text:
## IoC - Inversion of Control (old examples)

See new examples in following repos:
- [DI / Dependency Injection](https://github.com/HowProgrammingWorks/DependencyInjection)
- Component [sandboxing](https://github.com/HowProgrammingWorks/Sandboxes)

[![Инверсия управления и внедрение зависимостей](https://img.youtube.com/vi/Fz86Fdjz-LM/0.jpg)](https://www.youtube.com/watch?v=Fz86Fdjz-LM)

repository: HowProgrammingWorks/InversionOfControl

repo_name: HowProgrammingWorks/InversionOfControl


text:
# lita-oftlog

[![Build Status](https://travis-ci.org/hickey/lita-oftlog.png?branch=master)](https://travis-ci.org/hickey/lita-oftlog)
[![Code Climate](https://codeclimate.com/github/hickey/lita-oftlog.png)](https://codeclimate.com/github/hickey/lita-oftlog)
[![Coverage Status](https://coveralls.io/repos/hickey/lita-oftlog/badge.svg?branch=master)](https://coveralls.io/r/hickey/lita-oftlog?branch=master)

This is a Lita handler that will search Google for images based on the phrase "oh for the love of god". I had a manager that would use this phrase all the time, so of course it had to be immortialized with a Lita plugin.

## Installation

Add lita-oftlog to your Lita instance's Gemfile:

``` ruby
gem "lita-oftlog"
```

## Configuration

Optional attributes

* safe_search (String, Symbol) - The safe search setting to use when querying for images. Possible values are :active, :moderate, and :off. Default: :active.

Example

```
Lita.configure do |config|
  config.handlers.oftlog.safe_search = :off
end
```

* searches (Array) - An array of strings used to search Google for images.  As long as they appear in the message text, the plugin should activate.

## License

[MIT](http://opensource.org/licenses/MIT)

Shamelessly copied and extended from Jimmy Cuadra's [lita-google-images](https://github.com/jimmycuadra/lita-google-images)

repository: hickey/lita-oftlog

repo_name: hickey/lita-oftlog


text:
---
layout: post
title: "technology and alternate publishing"
date: 2013-06-24 12:20
comments: true
categories: [scholarly communication, documentation, lis-history]
---

Notes on Farkas-Conn's [From Documentation to Information
Science][1], chapter 3.

[1]: http://www.citeulike.org/user/seancsb/article/12345903

_Old themes, old promises_:

The returning question: are there technological solutions to
various problems in scholarly communication? In the 1930s, Davis
thought that microfilm technology would "'unlock the written
literature'" and "break the log jam of scholarly publications" (p.
48). There's no doubt that technology, then and now, has unlocked
the written literature and much more, but has it broken the log
jam? Hardly. That log jam is the result of various other issues --
few of which have anything to do with scholarly communication or
with technology -- and more to do with social, economic, and
pyschological factors.

> In the summer of 1935, Davis explored the concept of publishing
> scientific journals on microfilm with Thomas Midgley, Jr.,
> chairman of the board of the American Chemical Society (ACS).
> The idea appealed to Midgley. He had been disturbed that journal
> editors were bringing "pressure on authors for brevity" to
> reduce publication costs, allowing less and less space for
> theorizing and speculation, which, in turn, would bring about
> the stagnation of science. He thought that a periodical such as
> the *Journal of Physical Chemistry* published on microfilm could
> provide an arena for specialists to exchange "speculative
> thought" (pp. 44 - 45).

The above passage indicates an additional, important note on why
bibliometricians and others often look at article length, or why
it should be examined under certain types of inquiries.

---

Relevance to today: the role that non-standard formal and informal
scholarly publication formats and media (e.g., blogs, data
repositories, institutional / subject repositories, etc.) can
play. In a sense, these passages provide historic warrant for
other outlets.

_Auxiliary Publication Service_:

The service "was a central depository of manuscripts that were too
voluminous, highly specialized, 'or not of sufficient general
interest ... to be published under existing publishing conditions"
(p. 49).

_Reception by journal editors_:

> Science editors liked the idea: some were enthusiastic. Within a
> few months after the service was started, forty-three editors
> indicated their willingness to cooperate with auxiliary
> publications. *Chemical Abstracts* was the first abstracting
> service to participate (p. 49).

On the other hand, since the auxiliary service was not meant to
provide material that would be widely read (unlike some of the
examples mentioned above), perhaps the historical warrant needs
further inquiry:

> In his [Davis] view, careful editing was justified for journals
> of large circulation serving many readers, but the highly
> technical and detailed material likely to be submitted for
> auxiliary publication would be read by very few people and thus
> did not warrant rigorous editing or even perfect typing" (p.
> 50).

In fact, the above passage indicates that the auxiliary service is
wholly unlike today's alternative, informal modes of publication
--- because some of these modes (e.g., blogs) have the probability
of being highly disseminated and read because of their
accessibility. The question then, as Davis was concerned with (see
next paragraph after above quoted passage), is what *validity* do
alternate modes of publication have in the scientific community?
*Only* if the scientific community assumes them to be valid,
should they be measured with respect to that scientific
community's values. Otherwise, they may be measured for other
reasons, e.g., the dissemination of scientific findings to the
public.

Note: a test for scientific validity in the *altmetrics* community
seems to be based on the dissemination, as can be measured, of a
piece of work and not strictly on the value the scientific
community places on the work, as assessed and regulated in the
usual manners. It is yet clear how dissemination is a measure of
scientific validity (here I'm reminded of work related to impact
that is negative, e.g., Nicolaisen's [The J-Shaped Distribution of
Citedness][2]). This identifies the *altmetric* assumption: that
worth is based on dissemination. Here library and information
science (and not one or the other but both jointly), with respect
to their role in the knowledge of dissemination, have played
important roles in identifying the things (variables, qualities)
that hinder dissemination. But the identification of those
*things* has served a purpose -- to promote dissemination in
regulated ways. An important question: does (or has) regulating
the description of information maximize its dissemination?

[2]: http://www.citeulike.org/user/seancsb/article/6602311

repository: cseanburns/research-notebook

extension: markdown

repo_name: cseanburns/research-notebook


text:
# Peewee ORM Demo

This repo is the result of an [article](http://blog.adnansiddiqi.me/develop-data-driven-applications-in-python-with-peewee/) I wrote for my blog about [Peewee ORM](http://docs.peewee-orm.com/en/latest/)


text:
---
layout: default
---

### Final Look

- Is our system scalable?
  - Yes. As every component is scalable.
  - When load increases, we just add more load balancers, more FrontEnd hosts, more Metadata service cache shards, more backend clusters and hosts.
- Is our system highly available?
  - Yes. As there is no a single point of failure, each component is deployed across several data centers. Individual hosts may die, network partitions may happen, but with this redundancy in place our system will continue to operate.
- Is our system highly performant?
  - It's actually very well depends on the implementation, hardware and network setup.
  - Each individual microservice needs to be fast.
  - And we need to run our software in high-performance data centers.
- Is our system durable?
  - Sure. We replicate data while storing and ensure messages are not lost during the transfer from a producer and to a consumer.

[Prev - Monitoring](system-design-interview-distributed-message-queue-monitoring)

[Next - Index](system-design-interview-distributed-message-queue)


text:
# Password Recovery

  **FR**

  - [x] The user should be able to retrieve his password by informing his email.
  - [x] The user should not be able to retrieve his password by informing a non-existent email.
  - [x] The user should receive an email with instructions to retrieve his password.
    - [x] Should generate a user token for password recovery
  - [x] The user should be able to reset his password.
    - [x] Should hash the user's new password.
    - [x] Should not be able to reset the user's password after the token is expired.

  **NFR**

  - [x] Use Mailtrap for email testing during the development phase.
  - [x] Use Amazon SES for email testing during the production phase.
  - [ ] Send emails in the background
  NOTE: Background jobs

  **Business Requirement**

  - [x] The email link sent through the user's email to reset a password should expire in two hours.
  - [x] The user can only reset his own password.
  - [x] The user needs to confirm his new password after resetting his previous password.

  # Update Profile

  **FR**
  - [x] The user should be able to update his name, email and password.

  **BR**

  - [x] The user cannot change his email to an email that is already being used by another user.
  - [x] To update a password the user needs to inform his current password.
  - [x] To update a password the user cannot inform his current password incorrectly.
  - [x] To update a password the user needs to confirm his new password.

  # Provider Panel

  **FR**

  - [x] The provider should be able to list all of his appointments in a given day.
  - [x] The provider should receive a notification whenever a user creates a new appointment with him.
  - [ ] The provider should be able to visualize his unread notifications.

  **NFR**

  - [ ] The provider's appointment in a given day should be stored in cache.
  - [x] The provider's notifications should be stored in MongoDB.

  # Business Requirement

  - [x] The notification should have the unread and read states that can be toggled by the provider.

  # Schedule Service Appointments

  **FR**

  - [x] 1. The user should be able to list all registered service providers.
  - [x] 2. The user should be able to list all days, that have at least one available time slot, from a given month for a given service provider.
  - [x] 3. The user should be able to list all available time slots in a given day for a given service provider.
  - [x] 4. The user should be able to make a new appointment with a service provider.

  **NFR**

  - [ ] The provider list should be stored in cache.

  **BR**

  - [x] Should exclude the logged user from the list of providers. (This is for FR #1)
  - [x] All available time slots should be comprised of 1 hour.
  - [x] The available time slots should be between 8:00 AM and 6:00 PM
  NOTE: The 1st time slot is at 8:00 AM and the last time slot is at 5:00 PM.
  - [x] The user cannot schedule a new appointment with a provider if the time slot is already occupied.
  - [x] The user cannot schedule a new appointment in a time slot that is in the past.
  - [x] The user cannot schedule a new appointment with himself as a provider.


text:
---
layout: post
title: "++career"
---

Like a (publicly undisclosed) number of others around the globe, I left ITG on
Tuesday as the company took measures ["to reduce operating
costs](http://investor.itg.com/phoenix.zhtml?c=100516&p=RssLanding&cat=news&id=1764371)".

My rather sudden departure came as a surprise to many (it seems) and I've
received many messages of astonishment and encouragement. I have responded to
many of these messages privately to thank the senders for their kind words but I
found myself repeating a lot of words. During my time at ITG I worked hard to
reduce inefficiencies and waste and improve communications. It seems like an
obvious step, therefore, to reduce duplication and to write publicly as much as
I can about my departure, my current situation and whatever comes next.

I didn't _know_ that my time at ITG was going to end when it did but I was sure
that a "reduction in force" was coming and that my position would be a
candidate for redundancy. I was prepared for this and wasn't surprised when I
got the proverbial tap on the shoulder.

Without going into any details, I had been unhappy with a number of aspects
about my last project that were outside of my control. They were outside of my
superiors' control, too, which made my situation very frustrating. I hung in
there, doing the best I could under the circumstances, out of respect and
admiration for those around me who were also doing their best. When I was told
that my position was made redundant, it came as a huge relief. I feel for those
who are left behind who will inevitably be asked to do more with less, at least
in the short-term.

In my time at ITG I worked with many of the best professionals I have known. The
leadership team in Asia Pacific is superb; I want them to know that I respect
their decision and wish them well for the time ahead. I shall miss working with
everybody in the Melbourne office but am sure the friendships we've formed will
last well into the future.

When I called Kirsty to give her the news, she was delighted! It's going to be
good for her to have her old husband back. I am looking forward to starting the
Summer (for that's what this time of year is called in Australia) with Kirsty
and with Eamonn and just being a husband and a father for a while. It's going to
be a good Christmas and we've a couple of trips away already planned for
January.

What's next for me career-wise? I don't know for sure. I'm going to use this
new-found spare time to tinker with some new (to me) technologies and see what's
out there for me to play with. I want to contribute to some worthwhile
open-source projects like [OpenMRS](http://openmrs.org/). I may revive this
sadly-neglected blog and write about my experiences as I play. I hope that this
will help me form a clearer picture of what I want out of a job so that I can
dust off my [résumé](http://careers.stackoverflow.com/johnsyweb)
(or CV, if you prefer) and go out there and either find it or make it. It's an
exciting time!


text:
# input_pipeline > Gestures > Motion Recognizer

Reviewed-on: 2022-07-20

# Purpose

The motion recognizer detects 1 finger motion on the touchpad, and converts all related
touchpad events to mouse motion events.

A motion occurs when the user places 1 finger on the touchpad surface. And the finger move
more than the threshold.

# State machine

The motion recognizer implements the state machine below.

![recognizer state machine](motion_state_machine.png)

The state machine is also available in other formats:

- [state machine as graphviz source](motion_state_machine.dot)
- [state machine as SVG](motion_state_machine.svg)

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# ScalaDB

[![Build Status](https://travis-ci.org/scalahub/ScalaDB.svg?branch=master)](https://travis-ci.org/scalahub/ScalaDB)

ScalaDB is a Scala library for connecting to and querying relational databases. It is created on top of JDBC.

## Supported Databases

ScalaDB is extensively tested on H2. It should work with MySQL and PostGreSQL as well, although not heavily tested on those databases.

## Examples

Columns can be defined as:

>      val STR = VARCHAR(255)
>      val name = Col("NAME", STR)
>      val age = Col("AGE", INT)
>      val sal = Col("SAL", LONG)

Tables can be defined as:
>      val users = Tab.withName("USERS").withCols(name, age, sal).withPriKey(name, age)

Tables can be queried as:
>      users.select(name, age).where(sal >= 2000).as(User(_))
and

>      users.aggregate(age.avg).where(sal >= 200).asLong

More examples [here](https://github.com/scalahub/ScalaDB/tree/master/src/test/scala/org/sh/db).

license: Unlicense

repository: scalahub/ScalaDB

gha_language: Scala

repo_name: scalahub/ScalaDB