text:
# serve-machine-learning-data
A simple heroku app to serve your machine learning data to Meeshkan.

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/meeshkan/serve-machine-learning-data)

## How to use this
Assuming that you call your app `resonant-dunes`, you can populate the dataset by sending `POST` requests to `http://resonant-dunes.herokuapp.com/i/MEESHKAN_KEY` with your data.  Split your data into whatever chunks you would like.  `MEESHKAN_KEY` is, as you might guess, your Meeshkan key.  See our note below about how to retrieve your key. The data should be formated as a group of rows, each of which is a pair of X (feature) and Y (target) values. For example, assuming that you are learning housing prices based on square meters and proximity to a beach in kilometers, and your data looked like this:

| m2        | beach km      | price       |
| --------- |:-------------:| -----------:|
| 70        | 4             | 270 000 €   |
| 80        | 3             | 510 000 €   |
| 90        | 2             | 980 000 €   |
| 100       | 1             | 1 350 000 € |

You would post this:

```
[[[70, 4], [270000]], [[80, 3], [510000]]]
```

and later, when you have more data or if you are splitting the data up into reasonably-sized chunks...

```
[[[90, 2], [980000]], [[100, 1], [1350000]]]
```

To get the data back, just ping `https://resonant-dunes.herokuapp.com/o?n=3&o=0` where `n` is the number of rows you want and `o` is the offset in the dataset.

Meeshkan makes no assumption about the dimensions of your features and targets.  Make sure that you serve data with the correct dimensions for your model.

## After deployment
When you deploy your Heroku app, you'll see that it will autogenerate a `MEESHKAN_KEY` config variable on startup.  To get the content of this variable so that you can make a POST request, click on `Manage App` after deploymnet succeeds and then on `Settings > Config Variables > Reveal Config Vars`.  You'll see the value of `MEESHKAN_KEY`.  If you ever change this value, make sure to reboot your app for the change to take effect!

For larger Machine Learning jobs, you will want to pay for a bigger storage plan.  Heroku's free tier for Postgre SQL allows for 10,000 rows.

If you want to deploy this to AWS Elastic Beanstalk, you can follow [this guide](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html). To see a working example that uses the MNIST dataset, try `curl "https://mnist.meeshkan.io/o?n=22&o=101"`.

## Full API

| Path                     | Method               | Description                                                      |
| :----------------------- |:---------------------| :----------------------------------------------------------------|
| `/o?n=5&o=3`             | `GET`                | Gets `5` rows with an offset of `3` in the dataset               |
| `/o?n=4&o=8&tag=true`    | `GET`                | Gets `4` rows with an offset of `8` in the dataset, returns tags |
| `/o/FOO?n=100&o=0`       | `GET`                | Gets `100` rows with an offset of `0` for rows tagget `FOO`      |
| `/i/MEESHKAN_KEY`        | `POST`               | Posts data                                                       |
| `/i/MEESHKAN_KEY/FOO`    | `POST`               | Posts data and taggs it `FOO`                                    |
| `/i/MEESHKAN_KEY`        | `DELETE`             | Deletes all data                                                 |
| `/i/MEESHKAN_KEY/FOO`    | `DELETE`             | Deletes all data with tag `FOO`                                  |
| `/i/MEESHKAN_KEY/FOO/5`  | `DELETE`             | Deletes all data with tag `FOO` and id `5`                       |

repository: sarahesham/serve-machine-learning-data

repo_name: sarahesham/serve-machine-learning-data


text:
# [VSON.org](https://VSON.org)

Start of an offical VSON parser for .NET. **VSON** (Very Simple Object Notation) is a lightweight data-interchange format.

## Project Status: Alpha Inactive

This is not currently being maintained. This project is in an early alpha state and is likely to have bugs.

license: Unlicense

repository: VSON/dotnetVSON

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: VSON/dotnetVSON


text:
# Optimal ORF Finder (OOF)

## What does OOF do?
OOF takes in a fasta file containing one or more sequences and identifies all nested Open Reading Frames (ORFs) found within each sequence.

## Why was OOF created?

### Gene splicing
Genes often undergo gene splicing, a post-transcriptional modification that permits a single gene to code for multiple proteins. Gene splicing events occur through differential inclusion or exclusion of regions of pre-mRNA, producing protein isoforms that are often structurally and functionally distinct. But what about the stuff that gets spliced out? When splicing gets carried out in some genes, nested ORFs become available for translation - potentially producing short peptide products with unknown functions!

### RNA cleavage
Much like splicing, RNA cleavage in the cytosol can lead to new, accessible ORFs. It is important to note, however, that the fragments possessing the new ORF(s) won't be capped.

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Requirements](#requirements)
- [Support](#support)
 - [Help](#configuration-issueshelp)
 - [Bugs](#bugs--issues)
 - [Feature Requests](#feature-requests)
 - [Pull Requests](#pull-requests)
- [Authors](#authors)

## Installation
OOF is entirely written in Python, meaning that all modules can be used once Python and all packages listed in the requirements are installed.

## Usage

```python OOF.py -f <fasta> -o <outName> [optional: -t]```
- OOF outputs two multifasta files containing: (i) all nested ORFs per header in input fasta, and (ii) the longest nested ORF per header in input fasta. Use -t flag to translate ORFs. Yup, it's that simple.

## Requirements
* **Languages**
  * Python 2.7 or Python 3+ : https://www.python.org/
    * Packages : BioPython
 * **If on Windows**
   * Linux shell emulator : https://www.cygwin.com/
   * GNU Packages : http://gnuwin32.sourceforge.net/

## Support

### Configuration issues/help
If you need any help please contact one of the [authors](#authors) via email.

### [Bugs / Issues](https://github.com/CharlesSanfiorenzo/Bioinformatics/issues)
If you discover a bug in the script, please [create a new issue](https://github.com/CharlesSanfiorenzo/Bioinformatics/issues/new).

### [Feature Requests](https://github.com/CharlesSanfiorenzo/Bioinformatics/labels/Feature%20Request)
If you have a feature you would like added, please [create a new request](https://github.com/CharlesSanfiorenzo/Bioinformatics/issues/new).

### [Pull Requests]()
If you'd like to make your own changes ensure your PR is made against the ['dev']() branch.

## Authors
- [Charles Sanfiorenzo Cruz](https://github.com/CharlesSanfiorenzo/) -<EMAIL_ADDRESS>|<EMAIL_ADDRESS>
## Citation
Sanfiorenzo C. (2017). Optimal ORF Finder (OOF) [Computer Software]. Massachusetts Institute of Technology. Retrieved from: https://github.com/CharlesSanfiorenzo/Bioinformatics.git

license: MIT

repository: CharlesSanfiorenzo/Bioinformatics

repo_name: CharlesSanfiorenzo/Bioinformatics


text:
# Structuring your application

Wow, almost done with this chapter! The last thing we need to discuss before wrapping things up is where to put what functions. You may have noticed that the width and height of your window does not change, therefore neither does your projection matrix. Is there any reason to re-calculate it every frame? Not really. So where should this calculation take place?

You only need to set the viewport, and the projection matrix when the window is created or resized. Further-more so long as you set the matrix mode to modelview every time after setting the projection matrix you will not need to select a matrix mode in your render function.

The view matrix by definition needs to be re-calulated each frame. And so does the model matrix. Let's take a look at how all of this fits into your application.

The first thing to do is to add a ```Resize``` function to your __Game.cs__ class. This will be where we set our projection:

```
namespace GameApplication {
    class Game {
        public virtual void Initialize() {

        }
        public virtual void Update(float dTime) {

        }
        public virtual void Render() {

        }
        public virtual void Shutdown() {

        }
        public virtual void Resize(int width, int height) {

        }
    }
}
```

Make sure to call the function in __Program.cs__, like so

```
protected override void OnResize(EventArgs e) {
    base.OnResize(e);
    Rectangle drawingArea = ClientRectangle;
    TheGame.Resize(drawingArea.Width, drawingArea.Height);
}
```

We want to make sure that a default projection matrix is set as soon as the window appears, so we need to change the main function in __Program.cs__ to manually call resize as soon as the game is created.

```
[STAThread]
public static void Main(string[] args) {
    //create new window
    Window = new MainGameWindow();
    Axiis = new Grid();
    TheGame = new MrRoboto();
    // ----------------------------------------
    // v This is new
    TheGame.Resize(Window.Width, Window.Height);
    // ^ This is new
    // ----------------------------------------
    Window.Load += new EventHandler<EventArgs>(Initialize);
    Window.UpdateFrame += new EventHandler<FrameEventArgs>(Update);
    Window.RenderFrame += new EventHandler<FrameEventArgs>(Render);
    Window.Unload += new EventHandler<EventArgs>(Shutdown);

    Window.Title = "Game Name";
    Window.ClientSize = new System.Drawing.Size(800, 600);
    Window.VSync = VSyncMode.On;
    //run 60fps
    Window.Run(60.0f);

    //Dispose at end
    Window.Dispose();
}
```

And that's all the infrastructure support we need. From now on, when you make a new demo scene, structure it like this:

```
using OpenTK.Graphics.OpenGL;

namespace GameApplication {
    class SimpleScene : Game {
        public override void Resize(int width, int height) {
            GL.MatrixMode(MatrixMode.Projection);
            GL.Viewport(0, 0, width, height);
            // TODO: Set projection matrix
            GL.MatrixMode(MatrixMode.Modelview);
        }

        public override void Initialize() {

        }

        public override void Update(float dTime) {

        }

        public override void Render() {
            // TODO: Set view matrix
            GL.PushMatrix();
            // TODO: Render Scene
            GL.PopMatrix();
        }

        public override void Shutdown() {

        }
    }
}
```

repository: TenYearsADream/LegacyOpenGL

repo_name: TenYearsADream/LegacyOpenGL


text:
# line_tracker

Attention!!! Different folders for different versions of of IDEs. For Arduino IDE, all the needed libraries is included inside. There is no need to install.

### Component used:

Controller Board: Arduino Romeo V2.2 (You might need to change the Motor.h if you are using a different motor driver)

IR Sensor: Pololu Analog IR Sensor (Apply for other analog IR sensors as well, you can tweak parameters in the IR sessions inside Config.h)

LDR(Optional)

LED Strip(Optional): Adafruit Neopixel 8 LED strip.

### Basic Tuning Concept:

PD controller: I is programed, but not used.

Basics: You can refer to the Wikipedia introduction [link](https://en.wikipedia.org/wiki/PID_controller).

### Advanced Tuning Concept [Optional]:

Manually smoothen the motion base on the history of the angular command.

### Tuning:

If you are using similar setup, you only need to tune by changing parameters inside Config.h file.

If your setup is very different, you might also want to alter some codes inside Motor.h and .ino file.

Email<EMAIL_ADDRESS>
Special thanks to Ultragriffy, bharatkareti, KavNair, Teresawidjaja & asilentsilver


text:
---
layout: post
title: Modern C++ Bitmask types
date: 2020-06-19 14:38
author: Chuck Walbourn
comments: true
categories: [general]
---

Bitmask flags are a ubiquitous pattern in C & C++ code. In the 'old days', they were typically defined as:

```cpp
#define FLAGS_NONE             0x0
#define FLAGS_DO_A_THING       0x1
#define FLAGS_DISABLE_A_THING  0x2
#define FLAGS_OPTIONAL_FEATURE 0x4

HRESULT MyFunction(int flags);
```

Since C/C++ preprocessor defines tend to have a lot of potential hazards, over time developers have moved to using ``enum``:

```cpp
enum FLAGS_FOR_MYFUNCTION
{
    FLAGS_NONE             = 0x0,
    FLAGS_DO_A_THING       = 0x1,
    FLAGS_DISABLE_A_THING  = 0x2,
    FLAGS_OPTIONAL_FEATURE = 0x4
};

HRESULT MyFunction(int flags);
```

With C++11 you can also provide an underlying type of the ``enum`` so you can use ``unsigned long`` instead of ``int`` without any signed/unsigned mismatch warnings:

```cpp
enum FLAGS_FOR_MYFUNCTION : unsigned long
{
    FLAGS_NONE             = 0x0,
    FLAGS_DO_A_THING       = 0x1,
    FLAGS_DISABLE_A_THING  = 0x2,
    FLAGS_OPTIONAL_FEATURE = 0x4
};

HRESULT MyFunction(unsigned long flags);
```

This still leaves the use of flags 'loosely typed' since if you had a second set of (possibly unrelated) flags you can easily write:

```cpp
HRESULT MyFunction(FLAGS_DO_A_THING | UNRELATED_FLAGS_FEATURE);
```

Modern C++ recommends solving this with Bitmask flags per the [standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3485.pdf) (section <IP_ADDRESS>.3). DirectX 11 used the older loosely typed ``DWORD`` (a.k.a ``unsigned long``) plus ``enum`` flags, but DirectX 12 adopts this new *typed bitmask flags* pattern. Therefore, I've updated my GitHub libraries to use the pattern as well, and this does have some implications for existing code.
<!--more-->

The Modern C++ recommendation is to change our example as follows:

```cpp
enum FLAGS_FOR_MYFUNCTION
{
    FLAGS_NONE             = 0x0,
    FLAGS_DO_A_THING       = 0x1,
    FLAGS_DISABLE_A_THING  = 0x2,
    FLAGS_OPTIONAL_FEATURE = 0x4
};

constexpr inline T operator~ (T a) { return static_cast<T>( ~static_cast<std::underlying_type<T>::type>(a) ); }
constexpr inline T operator| (T a, T b) { return static_cast<T>( static_cast<std::underlying_type<T>::type>(a) | static_cast<std::underlying_type<T>::type>(b) ); }
constexpr inline T operator& (T a, T b) { return static_cast<T>( static_cast<std::underlying_type<T>::type>(a) & static_cast<std::underlying_type<T>::type>(b) ); }
constexpr inline T operator^ (T a, T b) { return static_cast<T>( static_cast<std::underlying_type<T>::type>(a) ^ static_cast<std::underlying_type<T>::type>(b) ); }
constexpr inline T& operator|= (T& a, T b) { return reinterpret_cast<T&>( reinterpret_cast<std::underlying_type<T>::type&>(a) |= static_cast<std::underlying_type<T>::type>(b) ); }
constexpr inline T& operator&= (T& a, T b) { return reinterpret_cast<T&>( reinterpret_cast<std::underlying_type<T>::type&>(a) &= static_cast<std::underlying_type<T>::type>(b) ); }
constexpr inline T& operator^= (T& a, T b) { return reinterpret_cast<T&>( reinterpret_cast<std::underlying_type<T>::type&>(a) ^= static_cast<std::underlying_type<T>::type>(b) ); }

HRESULT MyFunction(FLAGS_FOR_MYFUNCTION flags);
```

This provides the various bit-wise operators so you can call:

```cpp
hr = MyFunction(FLAGS_DISABLE_A_THING | FLAGS_DO_A_THING);
```

C++11 introduced the idea of *strongly typed enumerations* in the form of [enum class](https://en.cppreference.com/w/cpp/language/enum) which prevents the implicit conversion of an ``enum`` to it's underlying type as well as scoping the ``enum`` members to it's namespace. While you can use it for these Bitmask types, it does make bit-testing them a little less intuitive:

```cpp
// This compiles if you used enum, but not if you use enum class
if (flags & FLAGS_DISABLE_A_THING)
    ...

// For an enum class, you have to use:
if ((flags & FLAGS_FOR_MYFUNCTION::FLAGS_DISABLE_A_THING) == FLAGS_FOR_MYFUNCTION::FLAGS_DISABLE_A_THING)
    ...
```

In DirectX 12, DirectX Tool Kit for [DX11](https://github.com/microsoft/DirectXTK) / [DX12](https://github.com/microsoft/DirectXTK12), [DirectXTex](https://github.com/microsoft/DirectXTex), and [DirectMesh](https://github.com/microsoft/DirectXMesh) they all make use of a macro from ``winnt.h`` that defines the operators for a given type:

```cpp
enum FLAGS_FOR_MYFUNCTION
{
    FLAGS_NONE             = 0x0,
    FLAGS_DO_A_THING       = 0x1,
    FLAGS_DISABLE_A_THING  = 0x2,
    FLAGS_OPTIONAL_FEATURE = 0x4
};

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
#endif

DEFINE_ENUM_FLAG_OPERATORS(FLAGS_FOR_MYFUNCTION)

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
#endif

HRESULT MyFunction(FLAGS_FOR_MYFUNCTION flags);
```

> Prior to Windows 10 SDK (14393), the ``DEFINE_ENUM_FLAG_OPERATORS`` macro did not make use of ``constexpr``, meaning that the resulting flags couldn't be used in ``constexpr`` expressions. This issue should only impact legacy Xbox One XDK code at this point.

> With the Windows 10 SDK (19041) and clang v10, there are some conformance issues with ``DEFINE_ENUM_FLAG_OPERATORS`` that generates ``-Wdeprecated-dynamic-exception-spec`` so I suppress those in my libraries when using this macro.

# Client code impact

What does this all actually mean for a developer using the libraries?

Well, for one thing the literal ``0`` is not a valid flags value.

```cpp
// This won't build with the June 2020 release or later of DirectXTex
hr = DirectX::LoadFromDDSFile("texture.dds", 0, nullptr, image);

// Instead you must use the default enum value:
hr = DirectX::LoadFromDDSFile("texture.dds", DDS_FLAGS_NONE, nullptr, image);
```

Also, anywhere you 'build-up' a flags setting, you need to use the correct type instead of ``DWORD``.

```cpp
// This used to build but now does not.
DWORD flags = DDS_FLAGS_NONE;
if (somesetting)
    flags |= DDS_FLAGS_FORCE_RGB;

// The modern C++ way to write it is:
DDS_FLAGS flags = DDS_FLAGS_NONE;
if (somesetting)
    flags |= DDS_FLAGS_FORCE_RGB;
```

DirectXTex in particular has numerous sets of flags, so this improves type-safety so you can't use the incorrect flags for a particular context:

```cpp
// This used to build and didn't do what you expected...
// It now results in a compile-time error.
hr = DirectX::LoadFromDDSFile("texture.dds", WIC_FLAGS_ALLOW_MONO, nullptr, image);
```

That said, there are a few specific cases where I was a little 'too clever' in my overlapping of loosely typed flags. For example, the ``TEX_FILTER_POINT``, ``TEX_FILTER_LINEAR``, ``TEX_FILTER_CUBIC``, and ``TEX_FILTER_FANT`` flags were designed to exactly match ``WIC_FLAGS_FILTER_POINT``, ``WIC_FLAGS_FILTER_LINEAR``, ``WIC_FLAGS_FILTER_CUBIC``, and ``WIC_FLAGS_FILTER_FANT``. Therefore there are a few specific ``operator|`` overloads defined to handle these cases.

```cpp
// This used to build and work before
DWORD filterFlags = TEX_FILTER_CUBIC;
hr = DirectX::LoadFromWICFile("texture.dds", filterFlags, nullptr, image);

// As of DirectXTex June 2020 or later, it needs to be:
TEX_FILTER filterFlags = TEX_FILTER_CUBIC;
hr = DirectX::LoadFromWICFile("texture.dds", WIC_FLAGS_NONE | filterFlags, nullptr, image);
```

> Note that I don't define every possible permutation of the ``operator|`` for these cross-type cases. The 'destination' type must be the first flag type. IOW: ``filterFlags | WIC_FLAGS_NONE`` will not compile. I also don't define all the other bit-wise operators for these combo cases, even though each flag type does support them.

branch_name: refs/heads/main

gha_language: HTML


text:
Overview of BioCreAtIvE: critical assessment of information extraction for biology
==================================================================================

  [@wikidata:Q21093643]

# Highlights

 BioCreAtIvE focused on two tasks. The first dealt with extraction of gene or protein
names from text, and their mapping into standardized gene identifiers for three model organism
databases (fly, mouse, yeast). The second task addressed issues of functional annotation, requiring
systems to identify specific text passages that supported Gene Ontology annotations for specific
proteins, given full text articles

With BioCreAtIvE,
our goal was to assemble a suite of tasks that would:
• Attract researchers from both natural language processing and bioinformatics;
• Address problems of importance to the biology and bioinformatics community
• Create legacy training and test data suites that could be used for development and benchmarking of future
applications.
• Permit the assessment of the state of the art on real biological tasks.

In general, there is
an additional requirement that the papers contain "curatable" information – experimental findings on a particular
gene or gene product. This document retrieval task was the
inspiration for the KDD 2002 Challenge Cup Task 1 [24];
it also inspired the categorization task in TREC Genomics
2004 [28]

# Comments

## Tags
1.1.1

# Links

 * [Scholia Profile](https://scholia.toolforge.org/work/Q21093643)
 * [Wikidata](https://www.wikidata.org/wiki/Q21093643)
 * [TABernacle](https://tabernacle.toolforge.org/?#/tab/manual/Q21093643/P921%3BP4510)

gha_license_id: NOASSERTION


text:
# HighTechU Summer Academy 2020

**HighTechU Summer Academy 2020 - Course Material - Day 5 - Pitch & Demo Day**

#### Navigation | [Home](https://hightechu.github.io/e2-accelerator) | [Day 1](https://hightechu.github.io/e2-accelerator/modules/day1/) | [Day 2](https://hightechu.github.io/e2-accelerator/modules/day2/) | [Day 3](https://hightechu.github.io/e2-accelerator/modules/day3/) | [Day 4](https://hightechu.github.io/e2-accelerator/modules/day4/) | [Day 5](https://hightechu.github.io/e2-accelerator/modules/day5/) |

## Slides

* [Link to Slides](Link)

## Learning Outcomes
By the end of today's session, students should be able to...
* Pitch their Project Idea to an Audience.
* Demonstrate their Proejct Idea to an Audience.

---

## Class Outline

|Time|Activity|
|:---|:---|
|10:00-10:30|The ExperienCE|
|10:30-12:30|Pitch/Demo Prep|
|**12:30-1:00**|**Lunch**|
|1:00-2:00|Pitch/Demo Prep|
|02:00-02:15|`Screen Break`|
|02:15-03:15|Pitch & Demo|
|03:15-03:45|Valedictory Ceremony|
|03:45-04:00| Informal hangout|

### Activity Details

#### The ExperienCE (feat. Erik)
```
Erik Bedard will share his experiences of the ECE program on campus.
```

#### Pitch/Demo Prep
```
- Student teams plan for their final demonstration & product pitch using lean canvas model.
```
#### Pitch & Demo
```
Pitching & Demonstrating Product (10+5 mins)
```

#### Valedictory Ceremony
```
- Addresses by a couple of guest speakers
- A few students sharing their experiences
- Vote of Thanks
```

---

## Daily Feedback Form

* [Google Form](https://forms.gle/6QYUvJgdpayUTzVF9)

## Important Links

* [Academy Slack Workspace](https://hightechuacademy.slack.com/)
* [Academy Zoom Room](https://uvic.zoom.us/j/96555007331?pwd=L0luTWY5ckprWTY4SDR5NHJrNk5XZz09)
* [Academy MURAL Workspace](https://app.mural.co/t/hightechu8022)
* [HighTechU TinkerCAD Class](https://www.tinkercad.com/joinclass/LMX28FG7ZT7Q)
* [HighTechU GitHub](https://github.com/hightechu/hightechu-summer2020)

## Resources


text:
OPS-PASSWD-SRV
=====

##Contents
- [High level design of Password Server](#high-level-design-of-password-server)
- [Responsibilities](#responsibilities)
- [Design choices](#design-choices)
- [Relationships to external OpenSwitch entities](#relationships-to-external-openswitch-entities)
- [Internal structure](#internal-structure)
- [Message format] (#message format)
- [Opcode]  (#operation-code)
- [Error code format] (#error-code-format)
- [Location of socket/pub key] (#socket-descriptor-and-public-key-location)

##High level design of password server

This document describes the design of the password server.

Password server is a daemon that runs as root which serves as the entry point to change
the /etc/shadow file upon receiving a request to update password.

Password server uses a UNIX domain socket as IPC and public/private keys to encrypt
a message required to update the password. The format of the message is
username, old-password, and new-password.

The password is encrypted on the client-side using a public key.  The password server
decrypts the cipher-text using a private key. Both private/public keys are
created during the initialization of password server.

When the message is being encrypted/decrypted, RSA_PKCS1_OAEP_PADDING is used to
provide the padding while a server/client is performing the message encryption
or decryption.

##Responsibilities

The main responsibilities of the Password Server are:

* Update user password in the /etc/shadow file
* Create private/public keys for the password encryption/decryption
* Create and maintain socket to connect with clients
* Provide password validation

##Design choices

IPC is done via UNIX domain socket.  A stream socket is used to initiate
the connection-oriented socket between client and password server.

To securely transmit the password from the client to the password server ,
public/private keys are used to send user information.

During password server initialization, public/private keys are generated using
the openssl library.  The public key is stored in the file system which used
by the client to encrypt the conversation.

The password hashing is done by a crypto function.  The password server selects
the encryption method from the system's login.defs file to be consistent with
other programs used to create hashed passwords - i.e. useradd and passwd.

##Relationships to external OpenSwitch entities

There is no media which allows external openswitch entities to interact with
the password server directly.  Only internal programs can interact with
the password server using a UNIX domain socket.

##Internal structure

Upon start of the password server, it
- generates private/public keys
  - The key generation happens at the ops-passwd-srv daemon startup. After
    daemonize_complete() is done, the password server creates and listens on
    the socket.  Key generation must happen prior to the socket operation.
- stores a public key in the filesystem
   - The location of public key is defined in a YAML file specified in
     the section 'Location of socket/pub key'
   - a public key is stored as an immutable file which only root user can
     delete or move after a immutable bit is unset
- stores a private key within the password server memory
  - no other program needs to access a private key. it is decided to store
     a private key in the password server
- creates the socket and starts to listen on the socket for incoming connections
   - The location of socket decriptor is defined in public header as
     PASSWD_SRV_SOCK_FD.
- read '/etc/ops-passwd-srv/ops-passwd-srv.yaml' to know the file path
   - YAML file contains socket descriptor and public key location
   - both the public key storage and socket descriptor location are retrieved
   		during password server boot-time

Below describes the client to password server conversation:
1. Client daemon gets user information
   - the information contains {username, old password, new password}
2. Retrieve the public key and encrypt user information
3. Create the socket and connect to the password server
4. Send cipher text via socket
5. Wait for the status of password update from the server
6. Upon receiving the status, notify user

Below depicts how the password server handles password update requests:
1. Upon successful connection with the client, retrieve the message sent by the client
2. Using private key, decrypt cipher text message
3. Validate the client and old-password
   - ensure connected client via unix socket has privilege
     - ovsdb_client group is allowed to update the password
     - ops_admin group is allowed to add or remove user
   - validate user using the old-password provided
4. Create a salt and the hashed password
5. Update the user password in /etc/shadow
6.
Connected client is validated using netlink to query kernel about the socket
peer and verify whether the connected client has privilege.

##message format

The client connected to the password server via socket should use following
message format to send user information:

 +--------------------------------------------------------+
 |         MSG field name                 |  size (bytes) |
 +--------------------------------------------------------+
 |          operation code (opcode)       |   4           |
 +--------------------------------------------------------+
 |          username                      |   50          |
 +--------------------------------------------------------+
 |          old password                  |   50          |
 +--------------------------------------------------------+
 |          new password                  |   50          |
 +--------------------------------------------------------+

 The password server sends the status about the password server update in
 following message format:

 +--------------------------------------------------------+
 |         MSG field name                 |  size (bytes) |
 +--------------------------------------------------------+
 |          status code (error code)      |   4           |
 +--------------------------------------------------------+

##operation code
Operation code (opcode) is used by both a client and the password server.
The password server performs the password related action based on the opcode.

The opcode is 4 byte integer value. Below is the list of opcodes:
 +-----------------------------------------------------------------------------+
 | opcode name             | opcode | Description                              |
 +-----------------------------------------------------------------------------+
 | PASSWD_MSG_CHG_PASSWORD | 1      | change password for a given user         |
 +-----------------------------------------------------------------------------+
 | PASSWD_MSG_ADD_USER     | 2      | create a new user                        |
 +-----------------------------------------------------------------------------+
 | PASSWD_MSG_DEL_USER     | 3      | delete a given user                      |
 +-----------------------------------------------------------------------------+

## error code format
After the password server processes a request from the client, it sends an error
code back to the client to inform about the operation status.

The error code is 4 byte integer value and below describes the error code definition:

 +-----------------------------------------------------------------------------+
 | error code name               | opcode | Description                        |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_FATAL              | -1     | fatal error                        |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_SUCCESS            |  0     | operation is successfully done     |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_USER_NOT_FOUND     |  1     | a given user is not found          |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_PASSWORD_NOT_MATCH |  2     | invalid old password               |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_SHADOW_FILE        |  3     | cannot access shadow file          |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_INVALID_MSG        |  4     | invalid message format             |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_INSUFFICIENT_MEM   |  5     | out of memory error                |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_RECV_FAILED        |  6     | receive message failed             |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_INVALID_OPCODE     |  7     | unknown opcode                     |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_INVALID_USER       |  8     | invalid user info                  |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_INVALID_PARAM      |  9     | invalid parameter is used          |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_PASSWD_UPD_FAIL    | 10     | password update failed             |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_SEND_FAILED        | 11     | fail to send message to the client |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_USERADD_FAILED     | 12     | fail to add a user                 |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_USER_EXIST         | 13     | a given user already exists        |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_USERDEL_FAILED     | 14     | fail to delete user                |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_DECRYPT_FAILED     | 15     | fail to decrypt the message        |
 +-----------------------------------------------------------------------------+
 | PASSWD_ERR_YAML_FILE          | 16     | cannot access YAML file            |
 +-----------------------------------------------------------------------------+

## socket descriptor and public key location
For the client to communicate with the password server, it needs to open a UNIX
socket and send an encrypted message (using public key provided).

To get the information about the socket descriptor and public key location,
the client program must parse the YAML file to extract such information.
YAML file contains the location of socket descriptor and public key.

YAML formatted file is stored in /etc/ops-password-srv/ops-passwd-srv.yaml.

YAML file contains following information:
 +--------------------------------------------------------+
 | Field name      |  Description                         |
 +--------------------------------------------------------+
 | type            | the describes a type of file         |
 |                 | - SOCKET  : UNIX socket descriptor   |
 |                 | - PUB_KEY : public key               |
 +--------------------------------------------------------+
 | path            | file location in the filesystem      |
 +--------------------------------------------------------+
 | description     | description of file                  |
 +--------------------------------------------------------+

 The type 'SOCKET' depicts the socket descriptor which is used by the client
 to create a connection with the password server using UNIX socket.

 The type 'PUB_KEY' stores the location of a public key which the password server
 generates at start-up.  The public key is used by the client to encrypt a
 request.


text:
Snaps are containerised software packages that are simple to create and install on all major Linux systems without modification. [Learn more](https://docs.snapcraft.io/).

[![Snap Status](https://build.snapcraft.io/badge/AssemblyScript/assemblyscript.svg)](https://snapcraft.io/assemblyscript)

repository: ibaxio/assemblyscript

repo_name: ibaxio/assemblyscript


text:
---
layout: default
title: Nameservers
---

# Nameservers

DNSControl can handle a variety of provider scenarios for you:

- A single provider manages everything for your domains (Ex: name.com registers and serves dns)
- A single provider serves dns separately from the registrar (Ex: NAME.COM registers and Cloudflare hosts dns records)
- Multiple providers "co-host" dns (Ex: Route53 and Google Cloud DNS both serve as authoritative nameservers)
- One or more "active" dns hosts and another "backup" dns host. (Ex: route53 hosts dns, but I update a local bind server as a backup)

All of these scenarios differ in how they manage:

- The root list of authoritative nameservers stored in the TLD zone by your registrar.
- The list of NS records for the base domain that is served by each dns host.

DNSControl attempts to manage these records for you as much as possible, according the the following processes:

## 1. Specifying Nameservers

There are several different ways to declare nameservers for a zone:

1. Explicit [`NAMESERVER`](/js#NAMESERVER) records in a domain:

    `NAMESERVER("ns1.myhost.tld")`
2. Request all nameservers to use from a provider (usually via api):

    `DnsProvider(route53)`
3. Request a limited number of nameservers from a provider:

    `DnsProvider(route53, 2), DnsProvider(gcloud, 2)`

    This can be useful to limit the total number of NS records when using multiple providers together, for performance reasons.

## 2. DNSControl processes

The first step in running a domain is a first pass to collect all nameservers that we should use.
DNSControl collects all explicit nameservers, and calls the method on each provider to get nameservers to use.
After this process we have a list of "Authoritative Nameservers" for the domain.

As much as possible, all dns servers should agree on this nameserver list, and serve identical NS records. DNSControl will generate
NS records for the authoritative nameserver list and automatically add them to the domain's records.
NS records for the base domain should not be specified manually, as that will result in an error.

{% include alert.html text="Note: Not all providers allow full control over the NS records of your zone. It is not recommended to use these providers in complicated scenarios such as hosting across multiple providers. See individual provider docs for more info." %}

DNSControl will also register the authoritative nameserver list with the registrar, so that all nameserver are used in the TLD registry.

## 3. Backup providers

It is also possible to specify a DNS Provider that is not "authoritative" by using `DnsProvider("name", 0)`. This means the provider will be updated
with all records to match the authoritative ones, but it will not be registered in the tld name servers, and will not take traffic.
Its nameservers will not be added to the authoritative set. While this may seem an attractive option, there are a few things to note:

1. Backup nameservers will still be updated with the NS records from the authoritative nameserver list. This means the records will still need to be updated to correctly "activate" the provider.
2. Costs generally scale with utilization, so there is often no real savings associated with an active-passive setup vs an active-active one anyway.

gha_language: Go

gha_license_id: MIT


text:
HtTemplateResolverModule
========================

[![Master Branch Build Status](https://api.travis-ci.org/hrevert/HtTemplateResolverModule.png)](http://travis-ci.org/hrevert/HtTemplateResolverModule)
[![Latest Stable Version](https://poser.pugx.org/hrevert/ht-template-resolver-module/v/stable.png)](https://packagist.org/packages/hrevert/ht-template-resolver-module)
[![Latest Unstable Version](https://poser.pugx.org/hrevert/ht-template-resolver-module/v/unstable.png)](https://packagist.org/packages/hrevert/ht-template-resolver-module)
[![Total Downloads](https://poser.pugx.org/hrevert/ht-template-resolver-module/downloads.png)](https://packagist.org/packages/hrevert/ht-template-resolver-module)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hrevert/HtTemplateResolverModule/badges/quality-score.png?s=12c8a758ba5e2777bf51e2e0e13f53985c76453e)](https://scrutinizer-ci.com/g/hrevert/HtTemplateResolverModule/)

HtTemplateResolverModule is a Zend Framework 2 module which allows us to easily create custom template path resolvers

## DEPRECATED
This module is deprecated. Please use [Delegator service factories](http://framework.zend.com/manual/2.3/en/modules/zend.service-manager.delegator-factories.html) to create custom template path resolvers.

##Requirements

* [Zend Framework 2](https://github.com/zendframework/zf2)
* PHP (>=5.4)

# Installation
* Add `"hrevert/ht-template-resolver-module": "0.0.*",` to your composer.json and run `php composer.phar update`
* Enable the module in `config/application.config.php`

## Basic Usage
* Create a class imlements that [Zend\View\Resolver\ResolverInterface](https://github.com/zendframework/zf2/blob/master/library/Zend/View/Resolver/ResolverInterface.php)

```php
<?php
namespace Application\View\Resolver;

use Zend\View\Resolver\ResolverInterface;

use Zend\View\Renderer\RendererInterface as Renderer;

class MyResolver implements ResolverInterface
{
    public function resolve($name, Renderer $renderer = null)
    {
      // write your code here
    }
}

```
* Now inform the [resolvers plugin manager](https://github.com/hrevert/HtTemplateResolverModule/blob/master/src/HtTemplateResolverModule/View/Resolver/ResolversPluginManager.php) about our new resolver.

```php
<?php
return [
    'ht_template_resolver' => [
        'resolvers_plugin_manager' => [
            'invokables' => [
                'my_resolver' => 'Application\View\Resolver\MyResolver',
            ]
        ]
    ]
];
```

* Now, tell the [AggregateResolver](https://github.com/zendframework/zf2/blob/master/library/Zend/View/Resolver/AggregateResolver.php) to use our new resolver.

```php
<?php
return [
    'ht_template_resolver' => [
        'resolvers' => [
            'my_resolver' => 200, // 200 means priority, the resolvers with highest priority are consulted first
        ]
    ]
];
```

repository: hrevert/HtTemplateResolverModule

repo_name: hrevert/HtTemplateResolverModule


text:
---
layout: post
title: "Weekly meeting #81"
description: "Weekly meeting #81"
date: 2018-07-16 07:30:000
tags: [ASP.NET Core, Unity, Modeling, Domain, Machine learning]
---

## Reading

* [What’s New in ASP.NET Core 2.1](https://www.codemag.com/Article/1807041/What%E2%80%99s-New-in-ASP.NET-Core-2.1) by Daniel Roth
* [What’s new in Unity 2018.1](https://www.red-gate.com/simple-talk/dotnet/c-programming/whats-new-in-unity-2018-1/) by Lance Talbert
* [Modeling Milk: A discussion on domain modeling](https://ayende.com/blog/183619-A/modeling-milk-a-discussion-on-domain-modeling) by Oren Eini
* [Machine Learning with .NET](https://www.red-gate.com/simple-talk/dotnet/net-development/machine-learning-with-net/) by Diogo Souza


text:
# Frinkiac.py
A Python wrapper for the [Frinkiac](http://frinkiac.com) and [Morbotron](http://morbotron.com) search engines.

####Example:

    from Frinkiac import search
    screenshot = search('them fing')
    screenshot.image_url()
    screenshot.meme_url()

`Screencap.image_url()`
Returns a URL string of the image sans caption.

`Screencap.meme_url(caption)` Returns a URL string with the caption provided. If no caption is provided it will return the approprate subtitle for the scene.

Once `image_url()` or `meme_url()` is hit then the Screencap object fills with the details of the scene itself:

    .ep_title, .season, .ep_number, .director,
    .writer, .org_air_date, .wiki_link

You can also get a random Screencap object by hitting `frinkiac.random()`

####Morbotron:
Just pass "False" along to the initial `.search()` or `.random()`

    from Frinkiac import random
	screenshot = random(False).meme_url()

####Thanks:
* [chanko](https://github.com/chanko/) for his [Frinkiac Ruby wrapper](https://github.com/chanko/frinkiac) I basically backward engineered.


text:
---
description: >-
  Testing the user.roles command with existing username provided as -u parameter
  and with invalid role provided as -r parameter.
---

# TEST: SECURITY-UA-39

## References

* [User Administration](../../../../../../../operations/server-administration/santedb-icdr-admin-console/user-administration.md)
* [Security Administration](../../../../../../../operations-1/system-administration/security-administration/#demo-environment)
* [SanteDB Administration & Security Console](../../../../../../../operations/server-administration/santedb-icdr-admin-console/)
* [TEST: SECURITY-UA-02](test-security-ua-02.md)
* [TEST: SECURITY-UA-03](test-security-ua-03.md)
* [TEST: SECURITY-GRA-04](../group-role-administration/test-security-gra-04.md)
* [TEST: SECURITY-GRA-05](../group-role-administration/test-security-gra-05.md)

## Discussion

The `user.roles` command is for assigning roles to a user.

* The `-u` parameter is used to specify the **username** of which user to assign roles to.
* The `-r` parameter is used to specify which **role** to assign to the specified user.
* An exception is thrown when an invalid (non-existing) role is specified.

## Pre-Conditions / Setup

1. Follow the directions from [Security Administration](../../../../../../../operations-1/system-administration/security-administration/#demo-environment) to quickly setup and start using the [SanteDB Administration & Security Console](../../../../../../../operations/server-administration/santedb-icdr-admin-console/).
2. See [TEST: SECURITY-UA-02](test-security-ua-02.md) or [TEST: SECURITY-UA-03](test-security-ua-03.md) for checking if a username exists.
3. See [TEST: SECURITY-GRA-04](../group-role-administration/test-security-gra-04.md) or [TEST: SECURITY-GRA-05](../group-role-administration/test-security-gra-05.md) for checking if a role does not exist.

## Actions/Steps

1\. Execute the `user.roles` command with `-u` parameter specified as an existing user and `-r` parameter specified as a non-existing role.

```
user.roles -u <existing username> -r <non-existing role>
```

## Expected Behaviour

* Admin Console output should appear as follows:

```
> user.roles -u TestUser123 -r not_a_role
ERR: Exception has been thrown by the target of an invocation.
        1:The specified roles do not exit. Roles are case sensitive
```

repository: santedb/dev-doc

repo_name: santedb/dev-doc


text:
Elder Scrolls Legends card explorer app

## Project requirements

* Show results in a card grid format with the image prominently displayed.
* Each card displays: Image, Name, Text, Set Name, and Type. Additional fields are optional.
* Display a loading indicator when communicating with the API.
* Use a responsive design that accommodates, at minimum, desktop and mobile.
* Initially, fetch and display the first 20 results returned by the API.
* As the user scrolls down the page, load and append additional cards using “infinite scroll.”
* Retrieve additional pages of results as-needed but do not load more than 20 cards with
each request.
* Allow the user to search for cards by Name.
* Use modern open-source web technologies to implement your solution (React, Backbone,
Angular, Vue, Underscore, etc.).
* Provide instructions for prerequisites, installation, and application setup and build in a
README file.

## Installation

This project requires:

  1. [Node.js](https://nodejs.org/en/download/) `^14.0.0`.
  2. [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable) `^1.22.4`.

```bash
yarn && yarn start
```

This command will install all required dependencies, start `webpack-dev-server` and automatically open [http://localhost:8080/](http://localhost:8080/) in your browser.

## NPM scripts

Name | Description
---|---
`build` | build production bundle
`format:styles` | format styles with Stylelint
`lint:js` | lint JavaScript for code quality issues with ESLint
`format:js` | format JavaScript with Prettier
`precommit` | run all linters and formatters with a single command

## Decisions

* Use native [`fetch`](https://caniuse.com/#feat=fetch) vs using 3rd party package, because no IE support is required.
* Use subsetted [Inter variable font](https://github.com/rsms/inter/releases) for performance reasons and greater design capabilities. [Variable font](https://caniuse.com/#feat=variable-fonts) browser support is really good, so there no reason to use static fonts fallback with [CSS `@suppots` at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@supports) for this project. The font was subsetted with the help of [`fonttools`](https://github.com/fonttools/fonttools) and was reduced from original `318KB` to `31KB`.
* Add sound effect on user interaction with [`use-sound`](https://github.com/joshwcomeau/use-sound) hook. Lets the app communicate using 2 human senses instead of 1.
* Agressively cache `.js` and `.mp3` files with [Netlify](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) and [Webpack](https://webpack.js.org/guides/caching/#output-filenames) `contenthash` file names.
* Use [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) CSS media feature in `NoCardsFound` component to avoid physical symptoms like nausea, dizziness, and malaise for certain users (requires system configuration on the user's side).
* Use a responsive grid with 1, 2, and 4 cards per row to avoid half-empty rows. (Initial and all subsequent fetches load 20 cards).
* Add dark mode feature and save user selection in the `LocalStorage` to improve UX.
* Use Angular's [git commit message styleguide](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines) to introduce consistency in the git history.
* Use ESLint, Stylelint, and Prettier to avoid friction between developers.
* Use Browserlist to share target browsers between Stylelint and babel-preset-env.
* Use Netlify JavaScript minification instead of Webpack to avoid increasing local build time.
* Use [Theme Specification](https://theme-ui.com/theme-spec) for organizing CSS-in-JS.

## TODO

As always the project in _never_ done you just stop working on it. Here is a list of things, which will be nice to add:

* Add link preload for font file to give it the highest priority and load it ASAP.
* Add CI and test suites.
* Add SVG favicons for light and dark themes.
* Add `manifest.json` and ServiceWorker for the offline-first experience.
* Add `sitemap.xml` and `robots.txt` for better SEO.
* Add React [`prop-types`](https://github.com/facebook/prop-types) to catch bugs early on.

## Issues

* On iOS, after switching activities, sounds are not played anymore. There is an open [Github issue](https://github.com/joshwcomeau/use-sound/issues/15).

## Resources

* [Elder Scrolls Legends](https://docs.elderscrollslegends.io) access ESL API endpoints, which can get information on cards and sets.
* [React](https://reactjs.org/docs/getting-started.html) is a JavaScript library for building user interfaces.
* [Styled Components](https://styled-components.com/docs) is a CSS-in-JS library.
* [Webpack](https://webpack.js.org/concepts) is a static module bundler for modern JavaScript applications.
* [Babel](https://babeljs.io/docs/en/) is a JavaScript compiler.
* [ESLint](https://eslint.org/docs/user-guide/getting-started) is a pluggable and configurable linter tool for identifying and reporting on code quality issues in JavaScript.
* [Prettier](https://prettier.io/docs/en/install.html) is an opinionated code formatter for JavaScript and other languages.

* [Netlify](https://docs.netlify.com) is a web hosting infrastructure and automation platform.
* [Yarn](https://yarnpkg.com/) is a fast, reliable, and secure dependency management.
* [Renovate](https://github.com/renovatebot/renovate) is an automated dependency updates tool.
* [Browserlist](https://github.com/browserslist/browserslist) is a tool for sharing target browsers between different front-end tools.
* [use-sound](https://github.com/joshwcomeau/use-sound) a React Hook for Sound Effects.

## Lighthouse

![Lighthouse results for https://esl-cards.netlify.app/](https://i.imgur.com/yZ1WpY2.png "Lighthouse")

repository: iamskok/esl-cards

gha_language: JavaScript

repo_name: iamskok/esl-cards


text:
# Cred Scoring

using Sourcecred to compute Cred scores to incentivize project contributions within the Org

## Requirements

* Node (10.x.x - 12.x.x)
* Yarn
* Serve (npm -i -g serve) (To deploy the Frontend graph locally)

## Local Setup Instructions

```bash
git clone https://github.com/sourcecred/sourcecred.git
cd sourcecred
yarn install
```

## Configuration

*See [Spec](project.json)*

* Sources
  - [Decentraminds Github Org](https://github.com/decentraminds)
* Weights [Spec](weights.json) (WIP **NOT Active** using defaults)
  - Edges
    -
  - Nodes
    -

## Computing Cred

Cred Scores can be updated locally by running the following commands:

```Bash
export SOURCECRED_GITHUB_TOKEN=YOUR_GITHUB_TOKEN # You can generate a personal API Token here -> https://github.com/settings/tokens
export sc=PATH_TO_YOUR_SOURCECRED_LOCAL_REPO
./update.sh
serve ./docs # Frontend will be available at http://localhost:5000
```

## Generate-Cred Github Action

The Github [action](.github/workflows/generate-cred.yml) is in charge of both re-computing the Community Cred scores and updating the Public [UI Graph](https://decentraminds.github.io/cred/timeline/@decentraminds/) every month (at 00:00)

## License

* Apache License, Version 2.0, ([LICENSE](LICENSE) or <https://www.apache.org/licenses/LICENSE-2.0>)

repository: decentraminds/cred

repo_name: decentraminds/cred


text:
## BMU
This project is written for Odroid C2 for the second verion of the buoy project. The battery management is required to monitor the state of health of the battery, status and will cut power if the conditions exceeds the design limitation of the battery. It uses a TIBQ4050 which uses Compensated End of Discharge Voltage (CEDV) to accurately guage the battery.

## Prerequisites
1. Odroid C2 with Ubuntu installed
2. WiringPi2 for Odroid
3. ROS installed
4. Change Odroid I2C Frequency(400Khz Default) to 100Khz

## Usage of BMU Class
Create an instance of BMU class bmuObject = BMU(deviceAdd, busnum) where deviceAdd is the I2C address of the device and busnum is the SMbus number. The Odroid C2 has 2 SMbus, bus 1 and 2. The default bus used is bus 1.

Most function the important functions have been coded out. To use the function just call bmuObject.toggle_DCHG_FET() to toggle discharge fet or bmuObject.operationStatusReg() to get the operation status register. For more details on what each register means, refer to http://www.ti.com/lit/ug/sluuaq3/sluuaq3.pdf

## BMU ROS
BMU ROS is written to start managing power upon boot. The problem arises because the Odroid requires power to manage the BMU, but the power has to come through the BMU hence the chicken and the egg problem. So a push button circuit was implement to power the Odroid temporary and after that, the Odroid takes over the power management. Upon BMU ROS turns on the discharge fet and turns off the push button circuit. In addition, the push button circuit is then used by the user to tell the system to shutdown.

## Author
1. Louis Goh<EMAIL_ADDRESS>2. Nikita<EMAIL_ADDRESS>
## License
The MIT License (MIT)

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

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

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

repository: nikitasurya/BMU

repo_name: nikitasurya/BMU


text:
# Installation

## npm

```shell
npm install -g typewritten
```

That's it. The script will make the necessary symlinks to `fpath` and set the prompt in your `.zshrc`.

### [Homebrew](https://brew.sh)

```shell
brew install typewritten
```

Then load typewritten in your `.zshrc` by using zsh prompinit:

```shell
autoload -U promptinit; promptinit
prompt typewritten
```

## Manual

Clone the typewritten repository somewhere you can easily link. I recommend creating a `.zsh` directory at root.

```shell
mkdir -p "$HOME/.zsh"
git clone https://github.com/reobin/typewritten.git "$HOME/.zsh/typewritten"
```

Load typewritten in your `.zshrc` by using zsh prompinit:

```shell
fpath+=$HOME/.zsh/typewritten
autoload -U promptinit; promptinit
prompt typewritten
```

Note: if using `oh-my-zsh`, set `ZSH_THEME=""` in your `.zshrc` to disable oh-my-zsh themes.

## oh-my-zsh

Clone the repository into your custom oh-my-zsh themes directory:

```shell
git clone https://github.com/reobin/typewritten.git $ZSH_CUSTOM/themes/typewritten
```

Symlink `typewritten.zsh-theme` to your oh-my-zsh custom themes directory:

```shell
ln -s "$ZSH_CUSTOM/themes/typewritten/typewritten.zsh-theme" "$ZSH_CUSTOM/themes/typewritten.zsh-theme"
ln -s "$ZSH_CUSTOM/themes/typewritten/async.zsh" "$ZSH_CUSTOM/themes/async"
```

Set `ZSH_THEME="typewritten"` in your `.zshrc` file.

Note: If creating the symlinks is a problem, you can skip the step and set `ZSH_THEME="typewritten/typewritten"` instead.

## antibody

Add `antibody bundle reobin/typewritten` to your `.zshrc`.

## antigen

Add `antigen bundle reobin/typewritten@main` to your `.zshrc`.

## zgen

Add `zgen load reobin/typewritten typewritten` to your `.zshrc`.

## zim

Add `zmodule reobin/typewritten --name typewritten` to your `.zimrc` and run `zimfw install`.

## zplug

Add `zplug reobin/typewritten, as:theme` to your `.zshrc`.

repository: reobin/typewritten

gha_language: Shell

repo_name: reobin/typewritten


text:
# BlueBot - A Java-written Discord bot

   Join the support server :

You can add the bot to your server by clicking on
this link

You can also contact me on **Steam** : [](http://steamcommunity.com/profiles/76561198206490817)

The **API** can be found [here](https://github.com/DV8FromTheWorld/JDA).
However, the required dependancies for the bot are included in this repository.

**BlueBot** will provide useful features like :
* Moderation & utility features
* Ability to enable & disable features
* Owner-only commands
* Extensible & customizable soundboard
* CleverBot integration (currently disabled)
* GIFs search
* Twitch alerts
* Command prefix customization
* Quick reactions, jokes & other stuff
* Cyanide & Hapiness comics

* More to come !

## Getting started

To edit the code, just follow these steps :
* Create your onw app [here](https://discordapp.com/login?redirect_to=/developers/applications/me).
* **Clone the project** into your favorite IDE using GitHub's integration (if you're not downloading a release).
* On your application page, get your application **token**
* Open **config.blue**
* Replace **YOURTOKENHERE** by your application token
* Replace **YOURIDHERE** by your ID
* Create a directory named soundboard in the bot's root folder. You will place your .mp3 files here.

## Commands

BlueBot provides a lot of commands. Use ```!help``` to display the complete list of them.

By typing ```help``` after each command, you'll get information on how to use the command.

**Example :** by typing ```!ping help``` you'll get the following response :
```
The command ping pings the bot (to check if it's online). Usage : !ping
```

# License

This project is realeased under the [MIT License](https://github.com/thibautbessone/DiscordBlueBot/blob/master/LICENSE).

# Also !

I'm currently a student, so the project may take a while to come to its end. Don't expect too many updates, I have some work to do and some social life to have.

And I like blue, obviously.

repository: kranack/DiscordBlueBot

repo_name: kranack/DiscordBlueBot


text:
# **Features** ([demo](http://Unrepentant.github.com/wowGuildNews/index.html))

* Shows your World of Warcraft guild's news. This includes items obtained, bought or crafted.
* This plugin automatically gets the latest guild information using Blizzard's API.
* Works with any region and language.
* Easy to set up. Add your:
  * Battle net domain
  * locale
  * Server name
  * Guild name
* Supports any language
  * Set up the news item or achievment using a template string.
  * All time is output in human readable format.
* All styling of the guild news can be modified using css.
* Item and achievement tooltips are provided by wowhead.

# **Screenshots**

![news](http://unrepentant.github.com/wowGuildNews/demo/screen1.jpg)

# Playground

* Test the plugin out [here](http://jsfiddle.net/nvgXp/5/).
* If it doesn't work after something has changed, click on the [ JSLint ] button at the top. It should show if any problems were introduced in the code.
* If the demo still doesn't work, click [ Update ] and email me a link.

# **Documentation**

* [Setup](https://github.com/Unrepentant/wowGuildNews/wiki/Setup)
* [Options](https://github.com/Unrepentant/wowGuildNews/wiki/Options)
* [Change Log](https://github.com/Unrepentant/wowGuildNews/wiki/Change)

# **Dependencies**

* jQuery 1.2+ (required)

# **Licensing**

* [MIT License](http://www.opensource.org/licenses/mit-license.php).

# **Change Log**

### Version 1.1 beta

* Moved repo: [https://github.com/Unrepentant/wowGuildNews](https://github.com/Unrepentant/wowGuildNews)
* Fixed time stamp issues being about 12 hours off
  * Blizzard is not providing a proper UTC time stamp in their feed, so it isn't being processed properly.
  * Times now show as "future time" as it does in the Warcraft armory's Recent News.
  * Modified the text options to remove "ago" from times.
  * Added `past` text option which now contains the default text `"ago"`.
  * Added `future` text option which contains the default text `"in"` (seen as "in 10 minutes").
* Added a new `showFutureTime` option:
  * Default setting is `true`
  * When `true` times that are shown as "future" times will display as "in ...".
  * When `false`, all future times will just show up as "Recently" (set by the recent text option).

### Vesion 1.0 beta

* Initial release.

repository: Unrepentant/wowGuildNews

repo_name: Unrepentant/wowGuildNews


text:
##

### Version
Version provides information about API provider

Inputs: `null`

Response: `{"Version":"string value","APIVersion":768,"BlockDelay":42}`

## Auth

### AuthNew
There are not yet any comments for this method.

Inputs: `[null]`

Response: `"Ynl0ZSBhcnJheQ=="`

### AuthVerify
There are not yet any comments for this method.

Inputs: `["string value"]`

Response: `null`

## I

### ID
ID returns peerID of libp2p node backing this API

Inputs: `null`

Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"`

## Log

### LogList
There are not yet any comments for this method.

Inputs: `null`

Response: `null`

### LogSetLevel
There are not yet any comments for this method.

Inputs: `["string value","string value"]`

Response: `{}`

## Net

### NetAddrsListen
There are not yet any comments for this method.

Inputs: `null`

Response: `{"Addrs":null,"ID":"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"}`

### NetConnect
There are not yet any comments for this method.

Inputs: `[{"Addrs":null,"ID":"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"}]`

Response: `{}`

### NetConnectedness
There are not yet any comments for this method.

Inputs: `["12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"]`

Response: `1`

### NetDisconnect
There are not yet any comments for this method.

Inputs: `["12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"]`

Response: `{}`

### NetFindPeer
There are not yet any comments for this method.

Inputs: `["12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"]`

Response: `{"Addrs":null,"ID":"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"}`

### NetPeers
There are not yet any comments for this method.

Inputs: `null`

Response: `null`

repository: xiyangge/js-lotus-client

repo_name: xiyangge/js-lotus-client


text:
# How the Internet Works

## Blurb

The Internet runs the world; it connects our devices, powers our businesses, and
even talks to our thermostats. But how does it all happen? We will follow an
adventurous young web browser from the moment a hapless user presses "enter" and
witness the trials and tribulations of many packets. Ride alongside the most
fearsome syscalls as we learn how the Internet works!

## Description

This talk is a basic overview of the technologies and protocols that get a
request from your browser to "https://google.com/" and back again. This includes
the DNS request, basics of network routing, TLS handshake and initialization,
and HTTP request.

* DNS and UDP
* Static routing and ARP
* IP, Ethernet, and 802.11
* BGP and autonomous systems
* DNS reply
* HTTP request
* TLS handshake (protocol only, not cryptography)
* TCP handshake
* HTTP reply

## Script Sketch

Type in google.com

DNS request

outbound UDP to [DNS server IP]

Show UDP message

local routing table

default gateway

ARP probe for gateway IP (or cached)

Send based on ARP'd MAC

Show IP frame

Explain Ethernet and 802.11*

Local router (static again)

Packet gets to ISP

Intro to BGP

Packet gets to [DNS server IP]

Mention recursive resolution, ask root server, repeat.

DNS server sends UDP response back.

Receive DNS reply, match ID

Cool, got the IP of google.com

Browser creates HTTP request.

TLS init

TCP Handshake

TLS handshake (no crypto)

IP and Ethernet redux

Routing redux

Show HTTP/1.1 request

Wrap in TLS

Wrap in TCP frame

More routing.

HTTP request gets to Google.com

Get the requested page (::jazzhands::)

Show HTTP reply

HTTP reply, all the way back

Unwrap body

Render HTML

repository: coderanger/talk-ideas

repo_name: coderanger/talk-ideas


text:
App::FSWInfo Component
===

## 1. Introduction

`App::FSWInfo` is an active F prime component that provides the ground with
various information about the flight system, such as the flight software build
version.

## 2. Design

#### 2.1 Component Diagram

The `App::FSWInfo` component has the following component block description
diagram (BDD) diagram:

![`App::FSWInfo` Diagram](img/FSWInfoBDD.jpg "App::FSWInfo")

#### 2.2 Ports

The `App::FSWInfo` component uses the following port types:

| Port Data Type                    | Name          | Direction | Kind        | Usage                                 |
|-----------------------------------|---------------|-----------|-------------|---------------------------------------|
| `App::Port::FSWInfo_Generate` | reportFSWInfo | input     | async_input | Tells FSWInfo report various FSW info |

It also has the following role ports:

| Port Data Type                                      | Name           | Direction | Role            |
|-----------------------------------------------------|----------------|-----------|-----------------|
| [`Fw::Cmd`](../../../../Fw/Cmd/docs/sdd.md)         | cmdIn          | input     | Cmd             |
| [`Fw::CmdReg`](../../../../Fw/Cmd/docs/sdd.md)      | cmdReg         | output    | CmdRegistration |
| [`Fw::CmdResponse`](..././../../Fw/Cmd/docs/sdd.md) | cmdResponseOut | output    | CmdResponse     |
| [`Svc::Sched`](../../../Svc/Sched/docs/sdd.md)      | schedIn        | input     | Sched           |
| [`Fw::Log`](../../../../Fw/Log/docs/sdd.md)         | eventOut       | output    | Log             |

### 2.3 Functional Description

#### 2.3.1 reportFSWInfo Port

Generates events for the flight software and Sphinx firmware versions. The FSW version string is sourced from
`FswVersionAc.hpp`, which should be generated during the FSW build process.

repository: fprime-community/fprime-sphinx

repo_name: fprime-community/fprime-sphinx


text:
# Protocol Buffers for Nim

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

A Nim library to serialize/deserialize Protocol Buffers.

To actually generate Nim code from protobuf definitions, you need the protoc
tool. To make things simple, nimpb depends on
[nimpb_protoc](https://github.com/oswjk/nimpb_protoc), which bundles protoc
binaries for the most common platforms (Windows, Linux, macOS).

**NOTE** At the moment this is at a very rough state. Do not use for any kind of production use. Anything can change at any time. You've been warned.

# Example

Given the following file:

```
syntax = "proto3";

message Test1 {
    int32 a = 1;

    enum MyEnum {
        Foo = 0;
        Bar = 1;
    }

    MyEnum e = 2;
}
```

You can use nimpb_build (a tool that comes with nimpb) to generate code like this (procs not included in the example):

```nim
type
    Test1_MyEnum* {.pure.} = enum
        Foo = 0
        Bar = 1

    Test1* = ref Test1Obj
    Test1Obj* = object of RootObj
        a: int32
        e: MyEnum
```

And you can use the generated code like this:

```nim
let message = newTest1()
message.a = 150
message.e = Test1_MyEnum.Bar

let data = serialize(message)

let message2 = newTest1(data)

assert message2.a == 150
assert message2.e == Test1_MyEnum.Bar
```

# Other libraries

If you do not want to depend on the `protoc` compiler, check Peter Munch-Ellingsen's [protobuf library](https://github.com/PMunch/protobuf-nim). It handles parsing of the protobuf files in compile time which can make building simpler.

# Services

For an example about how to generate services, see [nimtwirp](https://github.com/oswjk/nimtwirp).

repository: tmokazaki/nimpb

gha_language: Nim

repo_name: tmokazaki/nimpb


text:
An experiment that could one day become a flexible GUI library for Kotlin (JVM and Native) inspired by [React](https://reactjs.org/).

If you just want to download a binary to run it, check out the releases github tab.

Here's a gif of fiddling around with the live reload (sped up rougly 40%, real-time refresh delay is about a second on Windows).

![livereload](https://imgur.com/IN6BUkS.gif)

The live reload currently only works on the JVM.

This is how a basic component looks

```kotlin
data class HelloProps(val name: String)

@GenerateBuilders
class Hello : Component<HelloProps> {
    override fun render() {
        return gui {
            box(style = style{ backgroundColor = 0xFFFFFF.color }) {
                -"Hello, ${props.name}!"
            }
        }
    }
}
```

An annotation processor (JVM-only for now, but you can just copy the generated code over to the native version, or write it by hand) will automatically generate a `hello` [builder](https://kotlinlang.org/docs/reference/type-safe-builders.html) you can use inside the `gui` DSL.

```kotlin
gui {
    hello(name="Alex")
}
```

I also tried to re-create some parts of [MobX](https://mobx.js.org/) (somewhat limited by language capabilities), if you prefer using mutable observables.

```kotlin
@GenerateBuilders(observer = true)
class KobxCounter(kobx: KobX) : Component<Unit>() {

    var count by kobx.observable(0)

    override fun render(): Element {
        return gui {
            layoutBox {
                -"Local count using observables: $count"
                button(text="Increment", onClick = this@KobxCounter::incrementCounter)
            }
        }
    }

    fun incrementCounter(event: MouseEvent) {
        count++
    }
}
```

Later, I might also rip off some parts of [Redux](http://redux.js.org/), or use one of the existing "Redux in Kotlin" libraries.

Here's a screenshot, as you can see, it's not practically usable at the moment. I will worry about the look later.

![screenshot](screenshot.png)

Right now the code is pretty hacky, has pretty bad performance (unnecessary redraws, slow algorithms) and a lot of TODO comments, but I will be cleaning that up soon. I completely avoided reflection in order to support Kotlin Native. If it ever gets more reflection capabilities, the code could be nicer, especially the part that deals with injecting dependencies into components.

The React design is followed pretty closely right now, but over time, I might gradually change it into something more suitable for Kotlin. For now, it also has most of the React 15 limitations and issues (no Fiber yet).

Implementation-wise, it's currently using [SDL](http://libsdl.org/) for window management and [cairo](https://www.cairographics.org/) for drawing. In the future I'll probably change it to  [Skia](https://skia.org/) (the [fork](https://github.com/mono/skia) used by [SkiaSharp](https://github.com/mono/SkiaSharp) has much more extensive C API) for performance reasons.

Windows are also managed in a React-like way

```kotlin
appGui {
    window(title = "My Window", root = gui {
        button(text="Click me.")
    })
}
```

`appGui` is the top-level application component.

There is a very simple scene graph library that acts as a DOM, but the aim is most definitely not to reinvent HTML or SVG with all of their complexities. There will only be a fairly minimal set of features for flexbox-like layout. Rectangles and text are basically all that's needed (plus some other shapes). Not having to support so many features and possible cases should also help performance (and of course size). Compared to the actual browser DOM, it is also possible to write completely new low-level elements as part of an application or a library, so that you can only include those that your application actually needs.

Styles are defined with CSS-like Style objects, because I like how they can be composed together (`style = buttonStyle + redBorders`) and inherited by child components.

For the general idea, see https://www.reddit.com/r/programmingcirclejerk/comments/72hvwj/feat_request_add_a_loading_splash_screen_to_my/dnixh4h/ and the other links in that comment.

repository: peterholak/mogul

repo_name: peterholak/mogul


text:
# STM32H745_DevKit

네이버 전자공작 카페에서 진행중인 STM32H745_DevKit에 대한 프로젝트 입니다.
* https://cafe.naver.com/circuitsmanual

* ## 개발환경
  * STM32CubeIDE 1.5.0
    * https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/stm32cubeide.html

  * STM32CubeMX 6.0.1
    * https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html


text:
# dream-creator Installation

This guide will walk you through multiple ways to setup `dream-creator` on Ubuntu and Windows. If you wish to install PyTorch and dream-creator on a different operating system like MacOS, installation guides can be found [here](https://pytorch.org).

Note that in order to reduce their size, the pre-packaged binary releases (pip, Conda, etc...) have removed support for some older GPUs, and thus you will have to install from source in order to use these GPUs.

# Ubuntu:

## With A Package Manager:

The pip and Conda packages ship with CUDA and cuDNN already built in, so after you have installed PyTorch with pip or Conda, you can skip to [installing dream-creator](https://github.com/ProGamerGov/dream-creator/blob/master/INSTALL.md#install-dream-creator).

#### Github and pip:

Following the pip installation instructions
[here](http://pytorch.org), you can install PyTorch with the following commands:

```
# in a terminal, run the commands
cd ~/
pip install torch torchvision
```

Or:

```
cd ~/
pip3 install torch torchvision
```

Now continue on to [installing dream-creator](https://github.com/ProGamerGov/dream-creator/blob/master/INSTALL.md#install-dream-creator) to install dream-creator.

### Conda:

Following the Conda installation instructions
[here](http://pytorch.org), you can install PyTorch with the following command:

```
conda install pytorch torchvision -c pytorch
```

Now continue on to [installing dream-creator](https://github.com/ProGamerGov/dream-creator/blob/master/INSTALL.md#install-dream-creator) to install dream-creator.

## From Source:

### (Optional) Step 1: Install CUDA

If you have a [CUDA-capable GPU from NVIDIA](https://developer.nvidia.com/cuda-gpus) then you can
speed up `dream-creator` with CUDA.

Instructions for downloading and installing the latest CUDA version on all supported operating systems, can be found [here](https://developer.nvidia.com/cuda-downloads).

### (Optional) Step 2: Install cuDNN

cuDNN is a library from NVIDIA that efficiently implements many of the operations (like convolutions and pooling)
that are commonly used in deep learning.

After registering as a developer with NVIDIA, you can [download cuDNN here](https://developer.nvidia.com/cudnn). Make sure that you use the appropriate version of cuDNN for your version of CUDA.

Follow the download instructions on Nvidia's site to install cuDNN correctly.

Note that the cuDNN backend can only be used for GPU mode.

### (Optional) Steps 1-3: Install PyTorch with support for AMD GPUs using Radeon Open Compute Stack (ROCm)

It is recommended that if you wish to use PyTorch with an AMD GPU, you install it via the official ROCm dockerfile:
https://rocm.github.io/pytorch.html

- Supported AMD GPUs for the dockerfile are: Vega10 / gfx900 generation discrete graphics cards (Vega56, Vega64, or MI25).

PyTorch does not officially provide support for compilation on the host with AMD GPUs, but [a user guide posted here](https://github.com/ROCmSoftwarePlatform/pytorch/issues/337#issuecomment-467220107) apparently works well.

ROCm utilizes a CUDA porting tool called HIP, which automatically converts CUDA code into HIP code. HIP code can run on both AMD and Nvidia GPUs.

### Step 3: Install PyTorch

To install PyTorch [from source](https://github.com/pytorch/pytorch#from-source) on Ubuntu (Instructions may be different if you are using a different OS):

```
cd ~/
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
python setup.py install

cd ~/
git clone --recursive https://github.com/pytorch/vision
cd vision
python setup.py install
```

To check that your torch installation is working, run the command `python` or `python3` to enter the Python interpreter. Then type `import torch` and hit enter.

You can then type `print(torch.version.cuda)` and `print(torch.backends.cudnn.version())` to confirm that you are using the desired versions of CUDA and cuDNN.

To quit just type `exit()` or use  Ctrl-D.

Now continue on to [installing dream-creator](https://github.com/ProGamerGov/dream-creator/blob/master/INSTALL.md#install-dream-creator) to install dream-creator.

# Windows Installation

If you wish to install PyTorch on Windows From Source or via Conda, you can find instructions on the PyTorch website: https://pytorch.org/

### Github and pip

First, you will need to download Python 3 and install it: https://www.python.org/downloads/windows/. I recommend using the executable installer for the latest version of Python 3.

Then using https://pytorch.org/, get the correct pip command, paste it into the Command Prompt (CMD) and hit enter:

```
pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
```

After installing PyTorch, download the dream-creator Github repository and extract/unzip it to the desired location.

Then copy the file path to your dream-creator folder, and paste it into the Command Prompt, with `cd` in front of it and then hit enter.

In the example below, the dream-creator folder was placed on the desktop:

```
cd C:\Users\<User_Name>\Desktop\dream-creator-master
```

You can now continue on to [installing dream-creator](https://github.com/ProGamerGov/dream-creator/blob/master/INSTALL.md#install-dream-creator), skipping the `git clone` step.

# Install dream-creator

First we clone `dream-creator` from GitHub:

```
cd ~/
git clone https://github.com/ProGamerGov/dream-creator.git
cd dream-creator
```

To test that dream-creator works, we'll first need to create a test dataset:

```
python data_tools/create_test_data.py -output_dir test_data -num_images 1200 -shape_size 200,200
```

Now we calculate the mean and standard deviation of our newly created test dataset:

```
python data_tools/calc_ms.py -data_path test_data
```

The `calc_ms.py` script will then output something that looks like this:

```
-data_mean 126.7094,126.0554,126.9935 -data_sd 73.655,73.3885,73.7058
```

Then using the mean and standard deviation parameter inputs we generated above, we can now train a GoogleNet model using the test dataset:

```
python train_googlenet.py -data_path test_data -balance_classes -batch_size 96 -num_epochs 10 -data_mean 126.7094,126.0554,126.9935 -data_sd 73.655,73.3885,73.7058
```

If everything is working properly with the training script, then you should see output like this:

```
Total 2400 images, split into 2 classes
Classes:
 {'ellipse': 0, 'rectangle': 1}
Model has 10,021,318 learnable parameters

Epoch 1/10
------------
train Loss: 0.9526 Acc: 0.8250
  Time Elapsed 0m 23s
val Loss: 0.0319 Acc: 0.9896
  Time Elapsed 0m 27s

Epoch 2/10
------------
train Loss: 0.3052 Acc: 0.9260
  Time Elapsed 0m 49s
val Loss: 0.0699 Acc: 0.9646
  Time Elapsed 0m 52s

Epoch 3/10
------------
train Loss: 0.2157 Acc: 0.9417
  Time Elapsed 1m 15s
val Loss: 0.0142 Acc: 0.9938
  Time Elapsed 1m 19s

Epoch 4/10
------------
train Loss: 1.6389 Acc: 0.5719
  Time Elapsed 1m 42s
val Loss: 0.6930 Acc: 0.5125
  Time Elapsed 1m 45s

Epoch 5/10
------------
train Loss: 1.3215 Acc: 0.5089
  Time Elapsed 2m 8s
val Loss: 0.6986 Acc: 0.5125
  Time Elapsed 2m 12s
```

After training has finished, we can now visualize the newly created DeepDream model's FC layers using the following command:

```
python vis_multi.py -model_file bvlc_out010.pth -num_iterations 200
```

The `vis_multi.py` script should end up creating two output images, where one image has more circlelike features and the other has more squarelike features. Using more complex datasets that have more classes and images will yield far better looking results. You can find a list of image collection tools, possible sources of images, and duplicate image detection tools on the [dream-creator wiki](https://github.com/ProGamerGov/dream-creator/wiki).

Finally, to visualize a single layer and channel or to DeepDream your own image, we can use the following command:

```
# Random Noise content image
python vis.py -model_file bvlc_out010.pth -layer mixed5a -channel 7 -num_iterations 200

# With Content image
python vis.py -model_file bvlc_out010.pth -layer mixed5a -channel 7 -content_image examples/small/fc_flowers.jpg -image_size 512,512 -num_iterations 200
```

repository: ProGamerGov/dream-creator

gha_language: Python

repo_name: ProGamerGov/dream-creator


text:
# React Coroutine / Examples

This folder contains several examples of react-coroutine applied to different and non-trivial cases.

 * [Code Splitting](./code-splitting) — an example of coroutines usage for async data fetching and dynamic imports.
 * [Search Form](./search-form) — an example of progressive rendering with loading spinner and requests debouncing.
 * [Timing Motion](./timing-motion) — an example of using React Coroutine and React Motion
 * [Unidirectional Dataflow](./unidirectional-dataflow) — an example of state management solution and unidirectional dataflow described without additional libraries.

repository: alexeyraspopov/react-coroutine

repo_name: alexeyraspopov/react-coroutine


text:
---
layout: post
title:  "Unemployment Rates Over Time (I)"
date:   2017-10-03
excerpt_separator:
categories: Unemployment rates
---

I was curious to see seasonal unemployment rates by race/ethnicity and gender over time.
Another reason for the next couple posts is to show how to scrape html data from the web (specifically Bureau of Labor Statistics (BLS) website),
prepare and plot the data by important grouping variables. The time series plot data were obtained
from [here](https://www.bls.gov/webapps/legacy/cpsatab2.htm) -- I selected the seasonally adjusted and
saved in my local drive. All data wrangling and plotting was done in R.

In the second post, I will look at unemployment rates by race/ethnicity and gender over six time points (Aug 2016 - Aug 2017)
as provided in the BLS website [here](https://www.bls.gov/news.release/empsit.t02.htm) and [here](https://www.bls.gov/news.release/empsit.t03.htm)
for Hispanic/Latino at the time of writing this post. In the third post, I will provide a quick look at R codes that created all these plots.
Here is a plot of unemployment rates by race/ethnicity over time (for the last one year at 6 time points).

- **What would 10 year monthly unemployment rates by Race/Ethnicity look like? ... see plot at the end of the post!**

The plot above shows seasonal unemployment rates by race/ethnicity at six time points during the last year. Note that the 'All White'
category includes non-Caucasian Whites that maybe of Hispanic/Latino origin. It is not straight forward to remove the
Hispanic/Latino group from the 'All White' category and for demonstration purposes I left the data as it is.

Unequal distribution of wealth, burden of diseases and mortality has been observed for generations.
There are several sources for these differences. Difference in occupational status is one of the sources.

I first became interested in disparities research after taking a quantitative health research class where I
read about differences in how people from different race/ethnic backgrounds interacted with the health care system.

In my dissertation, I looked at the direct and indirect relationships of socioeconomic status (SES) factors to
health status and health care services utilization. Until I looked at the literature and reports, I did not realize
the great wealth disparities by race/ethnicity.

So, I was curious about employment/unemployment rates over time given official government data. Obviously, employment,
education, income, wealth and health are related but this relationship maybe different for different groups.

From the plot above it would seem that Asians have lower unemployment rates than Caucasian Whites but once the
Latino/Hispanic group is removed from the "All White" group, unemployment rates among Caucasian Whites is likely to be
lower than observed in the plot. What is interesting in this plot is that unemployment rates among Hispanic/Latino groups
is much lower than unemployment rates among Black/African Americans.

- **A Time Series Plot of seasonal unemployment rates by Race/Ethnicity (2007 - 2017)**

Unemployment rates for Black/African American groups is almost always two times higher than that of Asians and Whites.
You can also observe that month to month changes in unemployment are higher in the Asian and Black groups. Why?

Despite the wide perception (& actual gains in many aspects of life for minorities) about improved experience regarding
better employment, wealth accumulation and health outcomes, published indicators show consistent
lag for minorities in general but for Blacks/African Americans in particular. Monthly unemployment rate trends over the
last 10 years (as provided in the plot above) show similar rise and decline for each race/ethnic group.
What will the plot for the next 10 years (2018-2027) look like?


text:
# Knowledge-Enhanced Hierarchical Graph Transformer Network for Multi-Behavior Recommendation

```
@inproceedings{khgt_aaai21,
title = {Knowledge-Enhanced Hierarchical Graph Transformer Network for Multi-Behavior Recommendation},
author = {Lianghao Xia and Chao Huang and Yong Xu and Peng Dai and Xiyue Zhang and Hongsheng Yang and Jian Pei and Liefeng Bo},
booktitle = {Proceedings of the Thirty-Fifth Conference on Association for the Advancement of Artificial Intelligence (AAAI)},
pages = {4486--4493},
year = {2021}
}
```

links
- [aaai](https://www.aaai.org/AAAI21Papers/AAAI-3071.XiaL.pdf)
- [AAAI](https://ojs.aaai.org/index.php/AAAI/article/view/16576)

gha_language: Jupyter Notebook


text:
---
title: IXA (German Premiere)
image: /img/series/ixa.jpg
---
<iframe width="560" height="315" src="https://player.vimeo.com/video/540991682" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## IXA (German Premiere)
Country: Spain | Genre: Drama |
Director: Egoitz D. Ibargoitia, Unai Portilla | Writer: Egoitz D. Ibargoitia, Unai Portilla, Gorka Alvarez de Arcaya, Eñaut Larreina

The vertical series “IXA” is made for mobile phones. 6 independent episodes that explore the use of time and the way we see it.

repository: jensbambauer/seriale

gha_language: CSS

repo_name: jensbambauer/seriale


text:
## $5 Tech Unlocked 2021!
[Buy and download this Book for only $5 on PacktPub.com](https://www.packtpub.com/product/internet-of-things-projects-with-esp32/9781789956870)
-----
*If you have read this book, please leave a review on [Amazon.com](https://www.amazon.com/gp/product/1789956870).     Potential readers can then use your unbiased opinion to help them make purchase decisions. Thank you. The $5 campaign         runs from __December 15th 2020__ to __January 13th 2021.__*

# Hands-On-Internet-of-things-with-ESP32
Hands-On Internet of things with ESP32, Published by Packt


text:
# EzySmashers

# Require

1. Java 8 or higher
2. Apache Maven 3.3+

# Description
1. EzySmashers-app-api: contains app's request controller, app's event handler and which components just related to app
2. EzySmashers-app-entry: contains `AppEntryLoader` class, you should not add classes here
2.1 EzySmashers-app-entry/config/config.properties: app's configuration file
3. EzySmashers-common: contains components that use by both app and plugin
4. EzySmashers-plugin: contains plugin's event handler, plugin's request controller and which components just related to plugin. You will need handle `USER_LOGIN` event here
4.1 EzySmashers-plugin/config/config.properties: plugin's configuration file
5. EzySmashers-startup: contains `ApplicationStartup` class to run on local, you should not add classes here
5.1 EzySmashers-startup/src/main/resources/log4j.properties: log4j configuration file

# How to build?

You can build by:
1. Your IDE
2. Run `mvn clean install` on your terminal
3. Run `build.sh` file on your terminal

# How to run?

You just move to `EzySmashers-startup` module and run `ApplicationStartup`

To run by `ezyfox-server` you need follow by steps:
1. Download [ezyfox-sever](https://resources.tvd12.com/)
2. Setup `EZYFOX_SERVER_HOME` environment variable: let's say you place `ezyfox-server` at `/Programs/ezyfox-server` so `EZYFOX_SERVER_HOME = /Programs/ezyfox-server`
3. Run `build.sh` file on your terminal
4. Copy `EzySmashers-zone-settings.xml` to `EZYFOX_SERVER_HOME/settings/zones` folder
5. Open file `EZYFOX_SERVER_HOME/settings/ezy-settings.xml` and add to `<zones>` tag:
```xml
    <zone>
		<name>EzySmashers</name>
		<config-file>EzySmashers-zone-settings.xml</config-file>
		<active>true</active>
	</zone>
```
6. Run `console.sh` in `EZYFOX_SERVER_HOME` on your termial, if you want to run `ezyfox-server` in backgroud you will need run `start-server.sh` on your terminal

# Deploy mapping
Modules after will deploy to `ezyfox-server` will be mapped like this:
1. EzySmashers-app-api => `ezyfox-server/apps/common/EzySmashers-app-api-1.0-SNAPSHOT.jar`
2. EzySmashers-app-entry => `ezyfox-server/apps/entries/EzySmashers-app`
3. EzySmashers-common => `ezyfox-server/common/ EzySmashers-common-1.0-SNAPSHOT.jar`
4. EzySmashers-plugin => `ezyfox-server/plugins/EzySmashers-plugin`

# How to test?

On your IDE, you need:
1. Move to `EzySmashers-startup` module
2. Run `ApplicationStartup` in `src/main/java`
3. Run `ClientTest` in `src/test/java`

repository: LongChau/EzySmashers

repo_name: LongChau/EzySmashers


text:
# Auto-expanding `<details>` security and privacy self-review questionnaire

## Questions to Consider

### 2.1. What information might this feature expose to Web sites or other parties, and for what purposes is that exposure necessary?

This feature will open details elements in response to find-in-page and ScrollToTextFragment. When a details element is opened, the page can observe it via the `toggle` event which is fired and the `open` attribute. It is necessary that we continue to fire this event and add the attribute when the details element is opened because the page may be relying on them to reconcile other state in the page or in script with the open state of the details element.

### 2.2. Is this specification exposing the minimum amount of information necessary to power the feature?

Yes.

### 2.3. How does this specification deal with personal information or personally-identifiable information or information derived thereof?

If you consider find-in-page queries or ScrollToTextFragment queries personal information or PII, it is dealt with the same way "sensitive information" is in the next section.

No new information stored on the device is exposed by this feature.

### 2.4. How does this specification deal with sensitive information?

The search queries present in the ScrollToTextFragment and find-in-page features may be sensitive information, and are considered in the "Privacy Considerations" section.

### 2.5. Does this specification introduce new state for an origin that persists across browsing sessions?

This feature does not store any new data in the browser.

### 2.6. What information from the underlying platform, e.g. configuration data, is exposed by this specification to an origin?

No information from the underlying platform is exposed by this feature.

### 2.7. Does this specification allow an origin access to sensors on a user's device

No.

### 2.8. What data does this specification expose to an origin? Please also document what data is identical to data exposed by other features, in the same or different contexts.

This feature does not expose any information about an origin's state and does not enable sending or receiving of any data to or from a network connection.

### 2.9. Does this specification enable new script execution/loading mechanisms?

No.

### 2.10. Does this specification allow an origin to access other devices?

No.

### 2.11. Does this specification allow an origin some measure of control over a user agent's native UI?

No.

### 2.12. What temporary identifiers might this specification create or expose to the web?

None.

### 2.13. How does this specification distinguish between behavior in first-party and third-party contexts?

ScrollToTextFragment doesn't work on cross-origin iframes, so that isn't a concern for this feature.

Find-in-page does work on cross origin iframes, but every time find-in-page scrolls to a match in an iframe it will continue to emit `scroll` events which are already revealing more information than this feature would.

### 2.14. How does this specification work in the context of a user agent's Private Browsing or "incognito" mode?

This feature will work the same regardless of incognito mode being enabled or disabled.

### 2.15. Does this specification have a "Security Considerations" and "Privacy Considerations" section?

A Privacy Considerations section can be found further down in this document. There is no Security Considerations section because this feature does not expose any security vulnerabilities.

### 2.16. Does this specification allow downgrading default security characteristics?

No.

## Privacy Considerations

### 1. What privacy attacks have been considered?

The page could observe the `toggle` event or the addition of the `open` attribute when this feature automatically expands details elements in an attempt to find out what the user was searching for with find-in-page or ScrollToTextFragment. If the page listens to the relevant events, it may be able to determine whether the user clicked on the details element to expand it or if it was automatically opened by this feature.

### 2. What privacy attacks have been deemed out of scope (and why)?

The aforementioned privacy attack is out of scope because it is less powerful than existing vulnerabilities for find-in-page and ScrollToTextFragment, meaning that this feature has a zero information delta with find-in-page and ScrollToTextFragment.

For find-in-page, vulnerabilities already exist which use the `scroll` event which is synchronous unlike the `toggle` event this feature will trigger. Every time find-in-page scrolls to a result, the page fires a `scroll` event. If the page creates a tiny scrollable area with every next possible character the user could type, it can recreate what the user typed into find-in-page. An example page which uses this attack can be found [here](/resources/find-in-page/search-incremental.html). If we were to remove the `scroll` events from find-in-page then this feature could become another vector for this attack, but this is unlikely to happen because it would break find-in-page for web pages which rely on the `scroll` event. This attack could be addressed regardless of the particular vector by adding a delay to find-in-page's scrolling which allows the user to type in enough characters to prevent the page incrementally building the user's search query, which Safari already does today.

For ScrollToTextFragment, this feature exposes less than the existing `:target` pseudo selector added by ScrollToTextFragment.

### 3. What privacy mitigations have been implemented?

No privacy mitigations have been implemented.

### 4. What privacy mitigations have considered and not implemented (and why)?

Adding a delay to the frequency find-in-page queries are sent to the page would help mitigate the possibility of this feature being used to snoop on find-in-page. Due to the existing `scroll` events, this feature does not make the situation any worse and therefore should not be blocked on adding a delay to find-in-page. However, the find-in-page delay is planned to be implemented in chromium.

repository: WICG/display-locking

repo_name: WICG/display-locking


text:
# Yeoman Webapp with React and Browserify

This is a variation of [Yeoman's](http://yeoman.io) generated  [gulp-webapp](https://github.com/yeoman/generator-gulp-webapp) with the inclusion of [Browserify](http://browserify.org) and [React](http://reactjs.com). I consider this more a recipe to webapp than a generator, as it doesn't significantly change webapp's features, such as SASS, LiveReload, etc., but rather easily allows for Browserify syntax.

## License

[BSD license](http://opensource.org/licenses/bsd-license.php)

repository: richhauck/hii-react

repo_name: richhauck/hii-react


text:
# Evaluate a News Article with Natural Language Processing

A web tool that allows users to run Natural Language Processing (NLP) on articles or blogs found on other websites.

It uses the [Aylien](https://aylien.com/) Web API, [Webpack](https://webpack.js.org/), [Express](https://expressjs.com/) and [Jest](https://jestjs.io/).

A [starter project](https://github.com/udacity/fend/tree/refresh-2019/projects/evaluate-news-nlp) was provided.

## Quickstart

To see it:

- download the zip or clone the directory to your computer and, from inside the directory, install the depedencies with `npm i`, build the project with `npm run build-prod`, start the server with `npm start` and open the page on a web browser on `http://localhost:8081/`.

> #**MadeWithUdacity**