text:
# Ansible JBoss Middleware

## Purpose

This repository provides a set of generic roles and reusable playbooks for deploying JBoss Middleware and associated CI / CD tooling.  The playbooks supports the provisoning the following products,

* JBoss Enterprise Application Platform
* JBoss Operations Network
* JBoss Enterprise Web Server

## Playbook Directory Layout

The repository is organized as follows,

*  `provisioning` - this folder consist of all roles that can be provisioned using Ansible, all subfolders within this folder are organized using Ansible inventory folder style, for more information refer to [Intro to Inventory](http://docs.ansible.com/ansible/intro_inventory.html) and [Playbook Best Practices](http://docs.ansible.com/ansible/playbooks_best_practices.html)

* `softwares` - this folder will hold all the softwares that will be used by the playbooks in provisioning various softwares without going to internet.
An example to provision a EAP on Domain mode with JON and EWS, the software folder will hold the following softwares,

apache-maven-3.3.9-bin.tar.gz

jboss-eap-6.4.0-installer.jar

jboss-eap-6.4.5-patch.zip

jboss-eap-native-6.4.0-RHEL7-x86_64.zip

jboss-ews-httpd-2.1.0-RHEL7-x86_64.zip

jon-plugin-pack-eap-3.3.0.GA.zip

jon-plugin-pack-ews-3.3.0.GA.zip

jon-server-3.3.0.GA.zip

jws-application-servers-3.0.2-RHEL7-x86_64.zip

jws-httpd-3.0.2-RHEL7-x86_64.zip

rhq-enterprise-agent-4.12.0.JON330GA.jar

* `scripts` - this folder will hold all the scripts that will be used for provisioning `vagrant` boxes for test and demo purposes, typically testing all the playbooks works fine before actual deployment

## Playbook Anatomy
The following are the plays that are available as part of this repository,

### Variables
The variables that are internally used within the playbooks and roles are defined in [vars](provisioning/vars), the typical pattern for the roles related variable is `<role_name>_vars.yml`, e.g all EAP related variables are defined in [eap_vars.yml](vars/eap_vars.yml)

### Inventory
The inventory controlled by this playbook is defined in the [inventory](provisioning/inventory)

### Plays
* [firewall.yml](provisioning/firewall.yml) - this play will perform firewall tasks from role [firewall](provisioning/roles/firewall) e.g. stop/start firewall, open firewall ports, selinux settings
*  [eap.yml](provisioning/eap.yml) - this play will perform EAP installation tasks from role [firewall](provisioning/roles/eap)
* [ews.yml](provisioning/ews.yml) - this play will perform EWS installation tasks from role [firewall](provisioning/roles/ews)
* [jon.yml](provisioning/jon.yml) - this play will perform typical firewall tasks from role [firewall](provisioning/roles/jon)
*  [services.yml](provisioning/services.yml) - this play will perform typical service tasks for the nodes, e.g. service creation for EAP, start/stop/restart services [firewall](provisioning/roles/services)

The above plays will use one or more roles internally based on the need
 - [java](provisioning/roles/java) - install java and related tools e.g. maven
 - [pgsql](provisioning/roles/pgsql) - install PostgreSql database

## Provisioning the Vagrant box

The [Vagrantfile](Vagrantfile) can be used to build a demo machine with EAP on domain/standalone mode along with JON, EWS , the steps to provision are,

* Download required softwares to the $PROJECT_HOME/softwares folder

* `vagrant up` - this will bring up the vagrant machines one for *EWS* , three *EAP* nodes and one *JON* node

Tweak `vagrantfile` to suit the required environment.

Provisioning command

> $ ansible-playbook -i provisioning/inventory [all|db|eap|ews| eap-master|eap-slaves] play_name

where `play_name` is one from the list of [Plays](#plays) defined above

e.g. to run firewall playbooks on all nodes

> $  ansible-playbook -i provisioning/inventory all firewall.yml

## WIP
The following are the currently identified improvements,

 - Reorganising the inventory with `group_vars` and `host_vars` in place of flat [inventory](provisioning/inventory)

## License
[LICENSE](LICENSE)

----------

## Relevant Links

[Ansible roles](http://docs.ansible.com/ansible/playbooks_roles.html/ "Ansible Roles")


text:
# cronist
Transform comment documentation into [ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules).

### Why?
cronist makes it easy to quickly hook up dynamic documentation into a documentation site. It also circumvents a problem with importing data as JSON files as described by this question on [stackoverflow](https://stackoverflow.com/questions/34944099/how-to-import-a-json-file-in-ecmascript-6).

Features:
  * Mdast parsing as the `mdast` key on each documentation item

Proof of concept: comments in [rubico source](https://github.com/a-synchronous/rubico) and documentation site [rubico.land](https://rubico.land/)

# Usage
Write comment documentation following a basic `@key #valid-markdown` schema.

```javascript
/**
 * @name tap
 *
 * @synopsis
 * ```coffeescript [specscript]
 * var args ...any,
 *   tapper ...args=>Promise|any
 *
 * tap(tapper)(...args) -> Promise|args[0]
 * ```
 *
 * @description
 * Call a function with a value, returning the value. Promises created by the tapper are resolved before returning the value.
 *
 * ```javascript [playground]
 * pipe([
 *   tap(console.log),
 *   value => value + 'bar',
 *   tap(console.log),
 * ])('foo') // 'foo'
 *           // 'foobar'
 * ```
 */
const tap = ...
```

Use cronist to parse the file containing the above comment documentation into ES modules.

```sh
$ cronist file-that-had-the-above-tap.js
export default [
  {
    name: 'tap',
    synopsis: '```coffeescript [specscript]\n' +
      'var args ...any,\n' +
      '  tapper ...args=>Promise|any\n' +
      '\n' +
      'tap(tapper)(...args) -> Promise|args[0]\n' +
      '```',
    description: 'Call a function with a value, returning the value. Promises created by the tapper are resolved before returning the value.\n' +
      '\n' +
      '```javascript [playground]\n' +
      'pipe([\n' +
      '  tap(console.log),\n' +
      "  value => value + 'bar',\n" +
      '  tap(console.log),\n' +
      "])('foo') // 'foo'\n" +
      "          // 'foobar'\n" +
      '```',
    mdast: {
      name: {/* ... */},
      synopsis: {/* ... */},
      description: {/* ... */}
    }
  },
  ...
]
```

# Installation
with `npm`
```sh
npm i cronist
```

license: MIT

repository: richytong/cronist

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: richytong/cronist


text:
---
title: Add attachments to an email delivery.
description: Learn how to add attachments to an email delivery and how to configure different types of email attachments.
feature: Email, Personalization
jira: KT-11920
doc-type: feature video
activity: use
team: Customer Care
role: User
level: Beginner
last-substantial-update: 2023-03-29
exl-id: 2345999f-074d-4456-a967-b9fd9760a328
---
# Add attachments to an email delivery

Learn how to add attachments to an email delivery and how to configure different types of email attachments.

>[!VIDEO](https://video.tv.adobe.com/v/3415789?quality=12&learn=on)

branch_name: refs/heads/main


text:
# Pseudomicrodochium lauri P.M. Kirk, 1983 SPECIES

#### Status
ACCEPTED

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

#### Published in
Mycotaxon 18(2): 283 (1983)

#### Original name
Pseudomicrodochium lauri P.M. Kirk, 1983

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
title: Analyzing Classification Results
description: Understanding classification results comparisons in the dashboard
category: Nexosis Concepts
subcategory: Build a model
tags: [reference, classification, results]
quick_link: true
use_codestyles: true
order: 8
---

## Analyzing Classification Results

A confusion matrix is a very common way to analyze the results of a classification model. While you can read in-depth about them on [Wikipedia](https://en.wikipedia.org/wiki/Confusion_matrix), let's look at a few examples of how different results could be interpreted.

The intent of the matrix is to map class predictions from a model against the known correct class of the training data from a hold-out set used to test model results.

We map each expected (actual) class along the vertical axis and every predicted value along the horizontal axis. This allows us to make a row-wise comparison of each class asking ourselves "when the actual (vertical) was classA, how many times did we predict (horizontal) classX". The sum of each row represents how many actual values were in the test set. The sum of each column represents the total predictions for that class during the test run. An example will make it clear.

In the canonical Iris example below we can see a model which gets everything right.

![confuion matrix iris](../assets/img/iris_confusionmatrix.png){:width="800px"}

When most (or in this case all) of the values are represented in the diagonal from left to right, then our model has done well.  Here is another example based on our CS-GO datasets where the classes are simply "1" or "0" and the model was not perfect as above.

![confuion matrix csgo](../assets/img/csgo_confusionmatrix.png){:width="800px"}

In this case you can see that as we read a horizontal row for the actual value of "0" that 66 were correctly predicted to be "0", but that 23 predictions incorrectly classified a result of "1". So that's a total of 89 possible zeroes where the model missed around 26% of the time.

Let's look at one more example to help solidify the concepts. In the following example a number of tweets have been classified as either having "negative", "neutral", or "positive" sentiment. Here the model is decent, but again far from perfect.

![confuion matrix csgo](../assets/img/airline_confusionmatrix.png){:width="800px"}

In this example you can again read across the rows and identify that the model had a hard time with "neutral" being falsely classified as "negative"; getting it wrong 105 times, or 34%. One of the other things we see in this matrix is that test values were overwhelmingly negative and that the model does pretty well with that dominant class; getting it right around 85% of the time.

gha_language: HTML


text:
These commands can be run from this directory once `bwa-parclip` is installed

1. Index The Reference.
2. Align the Reads.

```Shell

# rm ref.fa.bwaparclip.*
bwaparclip.py index ref.fa
bwaparclip.py --reference ref.fa t_R1.fastq.gz t_R2.fastq.gz -t 12

```

Then check the alignments:

```Shell
samtools flagstat bwa-parclip.bam
```
    92215 + 585 in total (QC-passed reads + QC-failed reads)
    0 + 0 duplicates
    92172 + 583 mapped (99.95%:99.66%)
    92215 + 585 paired in sequencing
    46115 + 291 read1
    46100 + 294 read2
    91783 + 0 properly paired (99.53%:0.00%)
    92134 + 579 with itself and mate mapped
    38 + 4 singletons (0.04%:0.68%)
    0 + 0 with mate mapped to a different chr
    0 + 0 with mate mapped to a different chr (mapQ>=5)

repository: PeteHaitch/bwa-parclip

repo_name: PeteHaitch/bwa-parclip


text:
- [Google Test](#google-test)
- [Integration with CMake](#integration-with-cmake)
- [Testing from command line](#testing-from-command-line)
- [Building googletests](#building-googletests)
- [Project example explanation](#project-example-explanation)

# Google Test

- [Google Test Documentation](https://github.com/google/googletest/blob/master/googletest/docs/primer.md)
- [Google Test CMake Integration](https://www.youtube.com/watch?v=Lp1ifh9TuFI)

# Integration with CMake

- Add `googletest` using `add_subdirectory`
- Link the `target_link_libraries(<target> PRIVATE gtest gtest_main)`
  - Two targets `gtest` and `gtest_main` are created
- Example: Take a look at **example** directory
  - Tests are present inside the test folder
  - example folder `CMakeLists.txt`

# Testing from command line

```bash
# Builds the program in the build directory
cmake --build build

# --output-on-failure gives you the failure output (helpful during debugging)
ctest -T test --output-on-failure
```

# Building googletests

- Create a main executable with your `test.cpp` file
- main executable should contains **dependency sources**
  - In the Example folder the dependencies are example.cpp and example.h
- This can be added in 2 ways
  - Create an example library and link that to the test executable
  - Add the sources and include files manually to the test executable

# Project example explanation

- Bar is an interface (virtual class)
  - Easy to mock when used by Foo
- Foo uses Bar (is not a virtual class)
  - Slightly tougher to mock when used by Random class
  - We need templates here for similar functionality
- Random uses Foo (is a templated class)


text:
# Code

The code and all related project files will be hosted in the [gcba-iris](https://github.com/gcba-iris) GitHub organization:

1. **Code**

    [https://github.com/gcba-iris/iris](https://github.com/gcba-iris/iris)

2. **Technical Documentation**

    [https://github.com/gcba-iris/iris-tech-docs](https://github.com/gcba-iris/iris-tech-docs)

The javascript version used will be a subset of ES6, with only the features supported by Node.js 6.5.0 without runtime flags ([shipping features](https://nodejs.org/en/docs/es6/)).

## Conventions

This project will adopt the [Airbnb javascript style guide](https://github.com/airbnb/javascript), with the following differences:

- Do call Object.prototype methods directly. ([3.9](https://github.com/airbnb/javascript#objects--prototype-builtins))
- The soft tabs will be set to 4 spaces, not 2. Actual tabs are not allowed. ([18.1](https://github.com/airbnb/javascript#whitespace--spaces))
- The lines of code must be 120 characters max, not 100. ([18.12](https://github.com/airbnb/javascript#whitespace--max-len))
- No additional trailing comma. ([19.2](https://github.com/airbnb/javascript#commas--dangling))
- Do use javascript getters/setters. ([23.2](https://github.com/airbnb/javascript#accessors--no-getters-setters))

## Testing

The testing framework used will be [tape](https://github.com/substack/tape). The following types of tests will be written:

- Unit
- Integration
- End-to-end

The unit tests should account for the majority of the test suite.

repository: gcba-iris/iris-tech-docs

repo_name: gcba-iris/iris-tech-docs


text:
# NetStash
Logstash sender for .NET

Send events to logstash instance via TCP

Saves all events into a sqlite database to prevent loss from network issues

Automatic synchronization when network connection is stablished

## Installation

Nugget Package: https://www.nuget.org/packages/NetStash

```
PM > Install-Package NetStash
```

## Usage

```
NetStashLog log = new NetStashLog("myhostname", 1233, "NSTest", "NSTestLog");

Dictionary<string, string> vals = new Dictionary<string, string>();
//Additional fields
vals.Add("customerid", "1235");

log.Error("Testing", vals);
```

## TLS Certificates

Note: certificateValidation = null >> Certificate validation will be discarded

```
NetStashLog log = new NetStashLog("myhostname", 1233, "NSTest", "NSTestLog", SslProtocols.Tls12, certificates, "domain.certificate.com", null);

Dictionary<string, string> vals = new Dictionary<string, string>();
//Additional fields
vals.Add("customerid", "1235");

log.Error("Testing", vals);
```

## Logstash config

```
input {
  tcp {
    port => 1233
    host => "<IP_ADDRESS>"
    codec => json
  }
}
filter {
  mutate { gsub => ["message", "@($NL$)@", "\r\n"] }
}
output {
  elasticsearch {

  }
}

```

## When to use

This project will work with ALL versions of elasticsearch.

If you just want to send log data, i recommend you to use NetStash.

If you are using elasticsearch 7+ and need to log error details:
I strongly recommend you to use https://github.com/elastic/apm-agent-dotnet Apm Agent Dotnet.
(I'm a contributor of this too)

## Who is using

Iron Mountain Brasil
 - All internals logs systems.

repository: iquirino/NetStash

gha_language: C#

repo_name: iquirino/NetStash


text:
Performance counters library
============================

Simple performance counters for C++11.

Usage
-----

You could use the PERFMON_SCOPE for a scope inside of a function:

```cpp
{
    PERFMON_SCOPE("scope_name");
    ... // scope body
}
```

or the PERFMON_STATEMENT for a statement:

```cpp
PERFMON_STATEMENT("counter_name") {
    ... // statement
}
```

WARNING! Most probably you would not like to use the PERFMON macros in
recursive scopes. You could, if you understand what you want; but values of
tick counter would be a bit crazy for a human being.

You could get current statistics in the following way:

```cpp
for (const auto& counter : PERFMON_COUNTERS()) {
    std::cout << counter.Name() << ' '
              << counter.Calls() << ' '
              << counter.Seconds() << std::endl;
}
```

NOTICE! Values of `PERFMON_COUNTERS()` can be imprecise because of
non-atomicity of the integer arithmetic. If you need to get a better
precision, you can call `PERFMON_COUNTERS()` multiple times and use the median.

repository: apronchenkov/perfmon

repo_name: apronchenkov/perfmon


text:
---
title: Closing on outside click
---

As part of the [navigation on the Gorillas website](/2021/03/13/gorillas-nav-a-case-study/), we needed a way to close the menu when clicking outside of it or tabbing out of it. I briefly touched on how we do it in the aforementioned article, but we’ve since revisited it and I wanted to write a short note about it.

There are plenty of ways to achieve this. That’s also why we implemented it 3 times, every time with a slightly different twist. We eventually landed on something that’s relatively simple so I thought I’d share it (both [vanilla JS](#vanilla-JS) and [React](#react)).

## HTML structure

Consider the following [disclosure widget pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure):

```html
<nav role="navigation">
  <button
    type="button"
    id="nav-toggle"
    aria-expanded="false"
    aria-controls="nav-content"
  >
    Navigation
  </button>
  <div id="nav-content" aria-hidden="true" aria-labelledby="nav-toggle">
    <ul>
      <li><a href="#">Link 1</a></li>
      <li><a href="#">Link 2</a></li>
      <li><a href="#">Link 3</a></li>
    </ul>
  </div>
</nav>

Some <a href="#">other link</a> or whatever.
```

{% info %} For more information about why we went with this particulary HTML structure, please refer to the [comprehensive post about Gorillas’ navigation](/2021/03/13/gorillas-nav-a-case-study/). {% endinfo %}

## Vanilla JS

Now, with vanilla JavaScript, our implementation would look something like this:

```js
const toggle = document.getElementById('nav-toggle')
const content = document.getElementById('nav-content')

const show = () => {
  toggle.setAttribute('aria-expanded', true)
  content.setAttribute('aria-hidden', false)
}

const hide = () => {
  toggle.setAttribute('aria-expanded', false)
  content.setAttribute('aria-hidden', true)
}

toggle.addEventListener('click', event => {
  event.stopPropagation()
  JSON.parse(toggle.getAttribute('aria-expanded')) ? hide() : show()
})

const handleClosure = event => !content.contains(event.target) && hide()

window.addEventListener('click', handleClosure)
window.addEventListener('focusin', handleClosure)
```

It works more or less like this: we listen for click events and focus change on the window object. When clicking or focusing an element that is **not** contained within the menu element, we close the menu. You’ll notice we don’t actually check whether the menu is open or not before we try closing it, because it makes little to no difference, performance wise.

One important thing to point out: we have to stop the propagationg of the click event on the toggle itself. Otherwise, it goes up to the window click listener, and since the toggle is not contained within the menu, it would close the latter as soon as we try to open it.

{% info %} We originally used [`Event.composedPath`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath), which provides the DOM path from the root of the document to the event target. Unfortunately, we noticed it wasn’t supported in many cases, so we had to revisit the implementation. {% endinfo %}

## React

Our implementation is actually in React, so I might as well share it. We use [react-a11y-disclosure](https://github.com/KittyGiraudel/react-a11y-disclosure) to handle the disclosure pattern for us, but I skipped it here for sake of simplicity.

```jsx
const useAutoClose = ({ setIsOpen, menu }) => {
  const handleClosure = React.useCallback(
    event => !menu.current.contains(event.target) && setIsOpen(false),
    [setIsOpen, menu]
  )

  React.useEffect(() => {
    window.addEventListener('click', handleClosure)
    window.addEventListener('focusin', handleClosure)

    return () => {
      window.removeEventListener('click', handleClosure)
      window.removeEventListener('focusin', handleClosure)
    }
  }, [handleClosure, menu])
}

const Menu = props => {
  const menu = React.useRef()
  const [isOpen, setIsOpen] = React.useState(false)

  useAutoClose({ setIsOpen, menu })

  return (
    <nav role='navigation'>
      <button
        type='button'
        id='nav-toggle'
        aria-expanded={isOpen}
        aria-controls='nav-content'
        onClick={event => {
          event.stopPropagation()
          setIsOpen(isOpen => !isOpen)
        }}
      >
        Navigation
      </button>
      <div id='nav-content' aria-hidden={!isOpen} aria-labelledby='nav-toggle'>
        <ul>
          <li>
            <a href='#'>Link 1</a>
          </li>
          <li>
            <a href='#'>Link 2</a>
          </li>
          <li>
            <a href='#'>Link 3</a>
          </li>
        </ul>
      </div>
    </nav>
  )
}
```

That’s it. Relatively simple in the end. For a more comprehensive solution, one might want to check [react-outside-click-handler](https://github.com/airbnb/react-outside-click-handler) from AirBnB but truth be told, I don’t know what it does that this solution doesn’t do. Anyway, I hope it helps! 💖

gha_language: Liquid


text:
# hapi-elapsed: Hapi plugin which logs elapsed time

[![Build Status](https://secure.travis-ci.org/codewinds/hapi-elapsed.png?branch=master)](http://travis-ci.org/codewinds/hapi-elapsed)

## Installation

Requires node.js >= 0.12

```bash
npm install ## install dependent node modules
```

## Usage

```javascript
// listen for our new elapsed log event
server.pack.events.on('log', function (event, tags) {
  if (tags.elapsed) {
    // do something with the elapsed event
    console.log('elapsed', event);
  }
});

var plugins = {
  'hapi-elapsed': {}
};
server.pack.require(plugins, function (err) {
  if (err) { throw err; }
  // plugin required, start server
});
```

## Goals

 - compute elapsed time from the beginning of request to the end of the response
 - emit log event with elapsed time

## Why

A simple functional Hapi plugin which calculates and logs elapsed time

## Get involved

If you have input or ideas or would like to get involved, you may:

 - contact me via twitter @codewinds  - <http://twitter.com/codewinds>
 - open an issue on github to begin a discussion - <https://github.com/codewinds/hapi-elapsed/issues>
 - fork the repo and send a pull request (ideally with tests) - <https://github.com/codewinds/hapi-elapsed>

## License

 - [MIT license](http://github.com/codewinds/hapi-elapsed/raw/master/LICENSE)

repository: codewinds/hapi-elapsed

repo_name: codewinds/hapi-elapsed


text:
# Latency problems

## Motivation

[Euler problems](https://projecteuler.net/archives) are an excellent source of Mathematical
problems to improve your programming skills. The problems are able to be solved with multiple
programming paradigms like Object Oriented, Functional or Reactive.

But in the implementation process, I missed that the problems don´t add any Latency factor to
increase the complexity and this is part of the daily problems for every Software Engineer in the market.

Programming languages provide native solutions to manage latency.
In `Java`, you can use [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html),
in `Kotlin` you can use [Coroutines](https://kotlinlang.org/docs/reference/coroutines-overview.html),
in `Scala` you can use [Future](https://www.scala-lang.org/api/2.12.3/scala/concurrent/Future.html),
in `Clojure` you can use [Future](https://clojuredocs.org/clojure.core/future).

On top of the languages, exist libraries that improve the way to manage [asynchronous](https://www.reactivemanifesto.org/glossary#Asynchronous) calls
and add [Backpressure](https://www.reactivemanifesto.org/glossary#Back-Pressure) support for Reactive use cases. In `Reactor` you can use [Mono<T>](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html) or
[Flux<T>](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html) objects,
in `RxJava`, you can use [Flowable<T>](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)

Finally, exist libraries that offer rich implementations of Reactive programming patterns.
In `Resilience4j`, you could find solutions for: `Circuit breaking`, `Rate limiting`, `Bulkheading`, `Automatic retrying`

The purpose of this repository is the creation of a set problems adding the Latency as part of the problem to be solved
in many different ways.

Enjoy the journey!

Juan Antonio Breña Moral

## Problems

### Problem 1

``` gherkin
Feature: Consume some REST God Services

Background: Decimal representation of `Zeus` is<PHONE_NUMBER>15

Scenario: Consume the APIs in a Happy path scenario
    Given a list of REST API about Greek, Roman & Nordic
    When  call and retrieve all API info
    Then  filter by god starting with `n`
    And   convert the names into a decimal format
    And   sum

Scenario: Consume the APIs considering some latency in the greek service
    Given a list of REST API about Greek, Roman & Nordic
    When  call and retrieve all API info from the good list
    Then  filter by god starting with `n`
    And   convert the names into a decimal format
    And   sum
```

![](./docs/sequence-diagram-latency-problem1.svg)

**Notes:**

- Review the timeout for Every connection.
- If in the process to load the list, the timeout is reached, the process will calculate with the rest of
the lists.
- REST API: https://my-json-server.typicode.com/jabrena/latency-problems

### Problem 2

Greek gods are quite popular and they have presence in Wikipedia, the multilingual online encyclopedia.
If you try to find further information about `Zeus` you should visit the address: https://en.wikipedia.org/wiki/Zeus

Load the list of Greek Gods and discover what is the God with more literature described on Wikipedia.

![](./docs/sequence-diagram-latency-problem2.svg)

**Notes:**

- Review the timeout for Every connection.
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/greek
- REST API 2: https://en.wikipedia.org/wiki/{greekGod}

### Problem 3

God fans are using a new API to provide information about `GREEK`, `ROMAN` or `NORDIC` gods.
It is important that the interface support Concurrent access to the API. Provide a Test that ensure
that in a Concurrent scenario, the information retrieved is `Thread Safe`.

![](./docs/sequence-diagram-latency-problem3.svg)

**Notes:**

- Review the timeout for Every connection.
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/greek

### Problem 4

``` gherkin
Given a set of providers to exchange money
When  make the request to get the rate for the exchange 100 EUR into USD
Then  find the average rate from valid responses from the the providers
```

![](./docs/sequence-diagram-latency-problem4.svg)

**Notes:**
Review the timeout for Every connection.
Money exchange providers:
- https://transferwise.com/fr?sourceCurrency=EUR&targetCurrency=USD&sourceAmount=100
- https://www.xe.com/es/currencyconverter/convert/?Amount=100&From=EUR&To=USD
- https://www.iban.com/currency-converter?from_currency=EUR&to_currency=USD&amount=100
- https://www.x-rates.com/calculator/?from=EUR&to=USD&amount=100

### Problem 5

``` gherkin
Feature: Load Balancing

Scenario: Consume a REST Greek God Service
    Given a 5 instances of the same REST API about Greek gods
    When  the client sends the request
    And   execute a load balancing policy to distribute the traffic
    Then  return all gods starting with `a`
```

![](./docs/sequence-diagram-latency-problem5.svg)

**Notes:**

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- Review the load balancing options
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/greek

### Problem 6

``` gherkin
Feature: Consume a REST Greek God Service

Scenario: Consume the API in a Happy path case
    Given a REST API about Greek gods
    When  the client sends the request
    And   execute a Retry Policy
    Then  return all gods starting with `a`

Scenario: Force an internal Retry behaviour
    Given a REST API about Greek gods
    When  the client sends the request
    And   execute a Retry Policy
    Then  return all gods starting with `a`

Scenario: Consume the API with a bad response
    Given a REST API about Greek gods
    When  the client sends the request
    And   execute a Retry Policy
    Then  return all gods starting with `a`

Scenario: Consume the API with a corrupted response
    Given a REST API about Greek gods
    When  the client sends the request
    And   execute a Retry Policy
    Then  return all gods starting with `a`

Scenario: Test a bad internal configuration
    Given a REST API about Greek gods
    When  the client sends the request
    And   execute a Retry Policy
    Then  return all gods starting with `a`

```

![](./docs/sequence-diagram-latency-problem6.svg)

**Notes:**

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- Review the retry options
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/greek

### Problem 7

``` gherkin
Feature: Consume a REST Roman God Service

Scenario: Consume the API in a Happy path case
    Given a REST API about Roman gods
    When  the client sends the request
    And   execute a Circuit Breaker Policy
    Then  return all gods finishing the name with `s`

Scenario: Force an internal Circuit Breaker behaviour
    Given a REST API about Roman gods
    When  the client sends the request
    And   execute a Circuit Breaker Policy
    Then  return all gods finishing the name with `s`

```

![](./docs/sequence-diagram-latency-problem7.svg)

**Notes:**

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- Review the circuit breaker options
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/roman

### Problem 8

``` gherkin
Feature: Consume a REST Indian God Service

Background:
A new REST API was deployed recently and the service
doesn´t have the same capacity than other God Services.
It is necessary to protect the service with a rate limiter temporally
meanwhile the God Infrastructure is increasing the consumer capacity.

Scenario: Consume the API in a Happy path case
    Given a REST API about Indian gods
    When  the client sends the request
    And   execute a Rate limiter Policy
    Then  return all gods who contains in the name `a` & `i`

Scenario: Force a Rate limiter behaviour
    Given a REST API about Indian gods
    When  the client sends the request
    And   execute a Rate limiter Policy
    Then  return all gods who contains in the name `a` & `i`

```

![](./docs/sequence-diagram-latency-problem8.svg)

**Notes:**

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- Review the rate limiter options
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/indian

### Problem 9

``` gherkin
Feature: Consume a REST God Collector

Background:
The new REST God collector service has a high demand
and it is necessary to protect the internal subsystems from
high levels of concurrent traffic.

Scenario: Consume the API in a Happy path case
    Given a REST API about God collector
    When  the client sends the request
    And   execute a Bulkhead Policy
    Then  return all gods

Scenario: Force a Bulkhead behaviour
    Given a REST API about God collector
    When  the client sends the request
    And   execute a Bulkhead Policy
    Then  return all gods
```

![](./docs/sequence-diagram-latency-problem9.svg)

**Notes:**

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- Review the bulkhead options
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/greek
- REST API 2: https://my-json-server.typicode.com/jabrena/latency-problems/roman

### Problem 9

``` gherkin
Feature: Calculate the popularity of Indian gods in Mahabharata

Background:
The Mahabharata is one of the two major Sanskrit epics of ancient India

Scenario: Calculate the influence of Indian gods in Mahabharata
    Given a REST API about Indian Gods
    When  the client sends the request
    Then  return the Top 3 indian gods mentioned in Mahabharata
    And   with presence in Wikipedia
    And   the number of hits in Mahabharata data source

```

![](./docs/sequence-diagram-latency-problem9-1.svg)

- Try to test the solution without any Internet call
- Review the timeout for Every connection.
- REST API 1: https://my-json-server.typicode.com/jabrena/latency-problems/indian
- Mahabharata Data Source: https://archive.org/stream/TheMahabharataOfKrishna-dwaipayanaVyasa/MahabharataOfVyasa-EnglishTranslationByKMGanguli_djvu.txt
- REST API 2: https://en.wikipedia.org/wiki/{indianGod}

## [Troubleshooting](./TROUBLESHOOTING.md)

## [References](./REFERENCES.md)

repository: thaingo/latency-problems

repo_name: thaingo/latency-problems


text:
---
title: Getting started
weight: 10
---

## Installation

### Installing Jetprobe

Jetprobe is a validation framework for building tests for big data pipelines. To install Jetprobe just download the [latest version](https://github.com/jetprobe/jetprobe/releases) .

Once downloaded, run the following commands to configure jetprobe to run from the command line.

### On Linux
```sh
$ tar -xvf /path/to/jetprobe-<version>.tgz
$ cd jetprobe-<version>
$ make install
$ export PATH=$PATH:~/local/bin
```
This would add the jetprobe located at  `/home/<user>/local/bin/jetprobe` to the `PATH` variable.

### On Windows
Assuming that java is installed and available in the `PATH` use the below commands to add the `jetprobe` executable to the current `PATH`.
```sh
C:\Users\Me>jar xf jetprobe-<version>.zip
C:\Users\Me>SET PATH=%PATH%;%cd%\jetprobe-0.2.0-SNAPSHOT\bin
```

## Verify the Installation
After installing JetProbe, verify the installation worked by opening a new terminal session and checking that `jetprobe` is available. By executing `jetprobe` you should see error output similar to this:

```sh
$ jetprobe -v
jetprobe 0.2.0-SNAPSHOT
build : 9bd6cacff213741ffdeb87813e66418859675da0
```
For getting the list of supported options just type `jetprobe --help`. Here's the expected output.
```
Usage: jetprobe [options]

  -t, --testjar <file>     Testable jar is required
  -c, --config <config>    Test config file path
  -r, --reportPath <path>  Report output file path
  --help                   prints this usage text

```

## Create and Run tests

### Add the library

If you are using SBT, then add the following as the library dependencies. Currently the libraries are available for Scala 2.11 and 2.12.

```
//Currently the project is in early development. Expect to get few nasty errors.
resolvers +=
  "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

libraryDependencies ++= Seq(
    "com.jetprobe" %% "jetprobe-core" % "0.2.0-SNAPSHOT",
    "com.jetprobe" %% "jetprobe-rabbitmq" % "0.2.0-SNAPSHOT",
    "com.jetprobe" %% "jetprobe-mongo" % "0.2.0-SNAPSHOT",
    "com.jetprobe" %% "jetprobe-hadoop" % "0.2.0-SNAPSHOT"
  )
```

If you are using maven as the build tool, then you can add the following dependencies

```xml
<!-- Add the snapshots repository -->
<repositories>
     <repository>
       <id>snapshots-repo</id>
       <url>https://oss.sonatype.org/content/repositories/snapshots</url>
       <releases><enabled>false</enabled></releases>
       <snapshots><enabled>true</enabled></snapshots>
     </repository>
</repositories>

<properties>
  <scala.version>2.12</scala.version>
<properties>

<dependency>
    <groupId>com.jetprobe</groupId>
    <artifactId>jetprobe-core_${scala.version}</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>com.jetprobe</groupId>
    <artifactId>jetprobe-rabbitmq_${scala.version}</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>com.jetprobe</groupId>
    <artifactId>jetprobe-mongo_${scala.version}</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>com.jetprobe</groupId>
    <artifactId>jetprobe-hadoop_${scala.version}</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>
```
Once you have added the required libraries, start by creating a Scala class to define the scenario that needs to be validated. In this case, we are trying to validate the creation of exchange, once a http request is executed.

Currently all the tests need to be written in Scala, a language offering functional programming paradigm for JVM. Every test class unlike a Junit test must extend the TestScenario trait. A trait in Scala is similar to interfaces in Java, which consists of a single method `buildScenario`. This method needs to be overridden by the Custom test class. Here is an example of Hello Test Suite in JetProbe.

```Scala
import com.jetprobe.core.TestScenario
import com.jetprobe.core.annotation.TestSuite
import com.jetprobe.core.structure.ScenarioBuilder
import com.jetprobe.mongo.storage.MongoDBConf

@TestSuite("Hello Jetprobe")
class HelloJetProbe extends TestScenario {

  val getUserInfo = Http("Create Foo ")
                    .post("http://api.server.com/v1/foo/1")
                    .body("{ 'name' : 'foo'}")

  val mongoConf = new MongoDBConf("mongodb://xxx.xxx.xx.xx")

  override def actions: ScenarioBuilder = {

    http(getUserInfo)

    //Validate the properties of Foo database
    validateWith(mongoConf){ mongo =>

      given(mongo.getDatabaseStats("foo")){ dbStats =>
        assertEquals(2,dbStats.get("indexes").get.asInt32().getValue)
      }
    }

  }
}
```

The above test once executed will just pause the test pipeline for 5 seconds and then end the test.
Once done, create a packaged jar and use the jetprobe CLI to run the test jar as below.
`jetprobe -testjar /path/to/packaged-test.jar`

Currently the framework supports testing of RabbitMQ, MongoDB, HDFS and HBase component properties. Head over to the next [section](../writing-validations) to know more about writing tests.

repository: erikroyall/jetprobe-docs

repo_name: erikroyall/jetprobe-docs


text:
---
layout: post
title: "Setup Twitter Bootstrap on Rails"
quote: "Setting up bootstrap on rails with assets precompiling fix."
image: /media/2014-04-15-bootstrap-on-rails/twitter_bootstrap-wallpaper-1024x768.jpg
video: false
comments: true
---

#"Setup Twitter Bootstrap on Rails"
Twitter Bootstrap is the most popular front-end framework for developing responsive, mobile first projects on the web. This is the most basic thing needed in rails app if no UI yet finaled yet or to design your responsive web layout.

To integrate twitter bootstrap in your rails project you can do any of the following method.

* Using gem 'twitter-bootstrap-rails' from [here](https://github.com/seyhunak/twitter-bootstrap-rails/tree/bootstrap3)
* Or below steps to integrate without gem

####Here are the steps which will be needed to integrate twitter bootstrap in rails app.

1. Download bootstap from [here](http://getbootstrap.com/getting-started/#download)
2. Extract the zip file and copy assets folder content to `yourApp/vendor/assets/`
3. Now you will have following folder in `vendor/assets/` directory
  * fonts
  * stylesheets
  * javascripts
4. Create `bootstrap_overrides.css.scss` in `yourApp/app/assets/stylesheets/` directory and add following line at the top.
  * `@import "bootstrap";`
5. Rename your `application.css` file to `application.css.scss`
6. Add `*= require bootstrap_overrides` to your `application.css.scss`
7. Add following code to your `bootstrap_overrides.css.scss` file
  *

        @font-face {
          font-family: 'Glyphicons Halflings';
          src: url(asset_path('glyphicons-halflings-regular.eot'));
          src: url(asset_path('glyphicons-halflings-regular.eot?#iefix')) format('embedded-opentype'), url(asset_path('glyphicons-halflings-regular.woff')) format('woff'), url(asset_path('glyphicons-halflings-regular.ttf')) format('truetype'), url(asset_path('glyphicons-halflings-regular.svg#glyphicons_halflingsregular')) format('svg');
        }

      Above code is to fix the glyphicons issue in asset pipelining (in production).

8. Add `config.assets.paths << "#{Rails}/vendor/assets/fonts"` in your `application.rb`
9. Add `//= require bootstrap.min` in your application.js if you want to include bootstrap js.

####If even after doing all above steps the glyphicons doesnt work then

* move the fonts to `yourApp/app/assets/fonts/`. And change fonts path in `application.rb`

i.e.  `config.assets.paths << "#{Rails}/assets/fonts"`

  You are welcome :P


text:
---
title: "Money"
date: 2021-10-08
tags:
- sapling
---

> Money is a form of shared truth

Sources: [Money Language *in Kernel*](https://kernel.community/en/learn/module-0/money-language) and [Shelling Out *in Kernel*](https://kernel.community/en/learn/module-2/shelling-out)

Money is old. "We have yet to discover a civilization that didn't have money. So, we know it's at least as old as civilization."

Money is a [[thoughts/language|language]] through which to communicate value. Then, was does this mean for [decentralization](thoughts/decentralization.md)? No one should control the expression of economic value in exactly the same way that no one controls the meaning of words: they are arrived at consensually through common use.

What money is, how it is created, and who gets to distribute it goes to the very heart of the ways in which we are all incentivised to act

[Incentives](thoughts/incentives.md) can be thought of as the [social, political and neurobiological primitives](thoughts/social%20contracts.md) which define what kinds of behaviours we express.

> Programmable money provides [[thoughts/utility|utility]] which makes it much more than just money for the internet: **it turns it into the [internet](thoughts/Internet.md) of money**.

Money allows specialization, allowing goods and services to be transformed into a intermediary representation that is accepted by society.

## Amassing Capital
Unfortunately, billionaries don't actually do anything. Even if they start with good intentions, they get cynical the more they progress and 'make it to the top'.  Because of the competition, the people who successfully can present are the ones who spent the time polishing the pitch rather than doing fundamental research and important breakthroughs.

## Money and Imagination
"I have a theory, which has not let me down so far, that there is an inverse relationship between imagination and money. Because the more money and technology that is available to [create] a work, the less imagination there will be in it." Alan Moore

## Money and Speech

> Free as in beer or free as in speech? -- Richard Stallman

Freedom of speech means that our *ability to speak* is free, but that doesn't mean we can say whatever we want (e.g. hate speech and defamation).

Similarly for [web3](thoughts/web3.md), access to the network is unrestricted (you only need a connection), but saying anything meaningful (e.g. state changing on the shared public record) has an associated cost. Thus certain behaviours we agree to be malicious (like creating fake transactions) are not disallowed, but just economically unsustainable.

Wouldn't this favour the rich? Well yes, but we can mitigate this by using weighting like [quadratic voting/funding](thoughts/quadratic%20funding.md) which values number of unique contributions more than dollar amounts.

### Taxes
Laffer curve: as the tax rate increases, the rate at which revenue increases slows down due to increased avoidance, evasion, and disincentive to engage in the taxed activity.

This can be applied to the rise and fall of empires: "governments that overburdened their taxpayers, such as the Soviet Union and later Roman Empire, ended up on the dust-heap of history, while governments that collected below the optimum were often conquered by their better-funded neighbors."

(Although, might not be [100% valid](https://qz.com/895785/laffer-curve-everything-trump-and-republicans-get-wrong-about-trickle-down-economics-and-reaganomics/amp/))

### Dispute Resolution
> Most pre-modern cultures, ranging from the Iriquois in America to the pre-Christian Germanic peoples, decided that payment was better than punishment

Curious if the main reason is that you need to keep track of whether someone has served their punishment or not and memory historically has been unreliable. On the contrary, you don't need to remember whether you were paid because you can just count your money.

The question applied to [web3](thoughts/web3.md): **can we advance the aims of rehabilitative justice using a shared and common historical record for better [accountability](thoughts/accountability.md)?**

## Engineering Money
> Money-as-a-[protocol](thoughts/Protocol.md) really allows us to do is program incentives at scales never before possible

Money, in this context, is not a concrete thing, its an abstraction to communicative values, as a language, and as a technology. It is a classifier for things that exhibit behaviour that lets us use it for
1. Store of Value
2. Medium of Exchange
3. Unit of Account

More importantly, there are tradeoffs in the above properties.
Gold is a great store of value but sucks as a medium of exchange (interesting tangent, the traditional heuristic that money *should* have inherent intrinsic value which is separate from the money but the truth is almost the opposite. If the medium used to express transactional relationship has its own value, its not a very functional abstraction).

Historically, like physical materials, we've just accepted properties the way they are and just built what we could with them. However, also like physical materials, we've found ways to engineer the fundamental properties that we want.

However, it feels liek we run into a weird [catch 22](thoughts/catch%2022.md) here where it is debatable whether the new 'engineered money' actually does have the properties we claim to have so it holds us back from developing/accepting it any more. I think this is in large part due to money being a combination of both **technical protocols and [social contracts](thoughts/social%20contracts.md)**

Andreas' argument is that we can use abstract monetary protocols which we can engineer to change gradually higher-order social contracts.

branch_name: refs/heads/hugo

gha_language: SCSS


text:
# Updaters and Defaults

The default updaters are tracked in `updater/defaults/defaults.go`.

## HTTP Resources

The following are the HTTP hosts and paths that Clair will attempt to
talk to in a default configuration. This list is non-exhaustive, as
some servers will issue redirects and some request URLs are constructed
dynamically.

{{# injecturls updater }}

repository: quay/claircore

gha_language: Go

repo_name: quay/claircore


text:
### [CVE-2008-3951](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3951)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

SQL injection vulnerability in view_ann.php in Vastal I-Tech Agent Zone (aka The Real Estate Script) allows remote attackers to execute arbitrary SQL commands via the ann_id parameter.

### POC

#### Reference
- http://securityreason.com/securityalert/4230
- https://www.exploit-db.com/exploits/6371

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
Here's a YDKJ data file parser that extracts Episode content into a JSON file containing question and answer text for each episode to assist in identifying family unsafe/awkward content.

To be clear... [newer Jackbox games](https://jackboxgames.happyfox.com/kb/article/3-are-your-games-family-friendly-what-are-they-rated/) already have family filter, so let's just consider this a fun afternoon project. ;)

# Getting Started

* Execute the `YDKJ_parser.ps1` Powershell file from the `$\JackboxPartyPack1\games\YDKJ2015` folder. This will parse all episodes and save an `episodeConversion.json` file that can be parsed by apps or opened in a text editor like [VSCode](https://code.visualstudio.com/).

# Troubleshooting

* Script doesn't run. Error message is similar to `<File> cannot be loaded because the execution of scripts is disabled on this system.`
  * See: [About Execution Policies](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1)


text:
---
layout:          post
title:           "MAGQA1 - MAG S1 Q&A"
date:            2016-10-26 12:00:00 -0400
categories:      special
tags:            [Q&A]
episode_title:   'MAG S1 Q&A'
episode_number:  'QA1'
summary:         "With Season 1 complete and Season 2 in development, Jonathan Sims and Alexander J. Newall take some time to answer your questions."
summary:
content_flags:
acast_url:       https://play.acast.com/s/themagnusarchives/mag-s1-q-a
formats:
  Google Doc: https://docs.google.com/document/d/1bvKPZcjvgUGXRe8_5F-568XXZ-Ux3ISoUSMMeil4a4s/
  DOCX:       https://drive.google.com/file/d/1kAVapRJgOg3LziFUSiajHGdMXqINLFcH/
official:        false
unofficial<EMAIL_ADDRESS>unofficial_name: tea wood
wiki_url:
---

#### ALEX

Hi. I'm Alexander J. Newall, director of *The Magnus Archives* podcast and voice of Martin on the show. And with me I have...

#### JONNY

Jonathan Sims, though you probably know me better as...

#### JONNY (TAPE RECORDING)

Jonathan Sims. _[Alex laughs]_

#### ALEX

And we are here doing a Q&A session for all of the most-asked questions from the fanbase and as a way of thanking everyone as well for listening so far.

#### JONNY

So in that vein, thank you! _[Alex chuckles]_

#### ALEX

So. We're gonna go through these questions, and Jonny's never heard any of these before, so we'll see what he makes of them. Number one. Jonny. Is that your real voice?

#### JONNY

I've been asked this a lot, actually, and there are several comments around the internet I have actually stumbled across claiming that I'm putting on a bad British accent.

##### [ALEX CHUCKLING IN BACKGROUND]

_[Sliding into American accent]_ And it is of course true. My real name is, uh, Earl... uh, Earl Big Mac. _[Alex laughs outright]_ Uh, I'm from Pennsatucky, and--no. It's my real voice. I change it a little bit. I, like, obviously I do lower it a bit and go a little bit more, little bit drier, a little bit more...

#### ALEX

Academic.

#### JONNY

Academic, yes. For Jonathan. But it is my real voice _[Alex chuckles]_ and my real accent.

#### ALEX

Funnily, no one asks if all of the other characters, their voices are real.

#### JONNY

No, apparently they sound...

#### ALEX

Human.

#### JONNY

They sound genuine, even though we've largely conjured them out of meat.

#### ALEX

So. How long have you been planning this? Is it something you've always wanted to do? Were you actively seeking an opportunity out for a long time, or did you have the idea more recently?

#### JONNY

That's sort of a difficult question, I guess. Because I've been -- in the back of my mind -- thinking of _[chuckling]_ horrible things for as long as I've been writing. Most of my short stories I'd... fire -- or for the novels I would start and get three chapters in -- would be horror of some sort. In terms of *The Magnus Archives* itself, it wasn't actually something I'd planned much until we started doing it. When I started working with Alex, he very much said, "What do you want to write?" To which my answer was, "Horror anthology," which is how *The Magnus Archives* started. And then the overarching, the conceit that kept it all together very much spiraled off into what we now know as *The Magnus Archives*.

#### ALEX

Mm-hm. With that in mind, how did you specifically get into writing and how did you craft the story? Not in a spoilery sense, but did you start with the main event and work backwards, have you let it grow over time? Basically, is it like all of the corkboards and string that everyone has at home?

#### JONNY

I'll start with the first question, which is: writing has always been sort of where I feel my strength lies, so it's always been something that I've tried to do. And tried to make myself do. There's quite a lot of... several years where I've done very little except tell people, "Oh, yes. No, I'm a writer." _[Alex chuckles]_ I love the process of creating, I hate the process of actually putting things down on the page, but it's what you've got to do. So the answer is always, really. In terms of the story itself, I started by spinning out the central conceit. Once I'd figured out I wanted this meta-narrative, most of the very early stories are ones that have been brewing for a few years, to be honest. So a lot of what has turned into the metaplot came from what themes I liked from there. Spinning them out. Then I crafted the ending, as in the ending of Season 5.

#### ALEX

Oh, yeah.

#### JONNY

I'm a hundred percent about closed arcs, and there's no way I was going to sit down and write a sprawling epic metaplot unless I knew where it was finishing. And since then, aspects of the end have shifted slightly with the writing because they always do, but I still know where it's going.

#### ALEX

Yeah, like, there's a fixed endpoint for this, which is always the goal. Okay. Another question for you. Do you know exactly where everything will end up in the story or have you introduced a few threads where you're not sure how they're going to resolve and just to have it as a throwaway thing that you might use later?

#### JONNY

The answer to that question largely depends on when in Season 1 you're asking it, to be honest. Right at the beginning, most things were to one degree or another casting a line out. I would have a story, there would be a few aspects of it that I quite liked and planned to revisit later, and as Season 1 progressed, linking some of those up gave me the structure to spin out into, I now have virtually the entire story and the entire world planned to one degree or another.

#### ALEX

Yeah. How did you start to work with Rusty Quill? A lot of people don't really know how the organization works. Were you just friendly beforehand, things like that? How did you end up working with us?

#### JONNY

There was a car boot sale down my road some two years ago and, I mean, I'd never considered myself the sort of person that would buy a Ouija board...

##### [ALEX LAUGHS]

But--no, um, I perform with a... somewhat lunatic stage show called The Mechanisms, which is a mythic space pirate musical cabaret. And most years we do the Edinburgh Fringe, so about... two years ago now?

#### ALEX

Yeah, it was about two years. Two and a half.

#### JONNY

Alex, who I sort of knew through a few people vaguely, ended up coming to one of our shows and saw it and really liked it.

#### ALEX

Yup.

#### JONNY

So when Alex started up Rusty Quill, he messaged us and said--basically, with an open offer: "Would you like to work with Rusty Quill at all?" The band as a whole, largely because there's no way to produce the sort of thing we do at speed enough to be useful in a podcast sense...

#### ALEX

You could get one episode, uh, every six months? Maybe?

#### JONNY

Yeah. Maybe. But I said, "Oh, I've been thinking of starting up a horror podcast for a while," and Alex said, "Great! It'll need a metaplot," _[Alex laughs]_ and here we are.

#### ALEX

Pretty much. How far in advance do you write the podcasts? There's obviously an overarching plot but when do you flesh it out? Do you just churn them out one at a time, do you have bits of episodes floating around and put them together? How do they, how do you assemble them?

#### JONNY

For Season 1, any given episode will probably have been written somewhere between 4-8 weeks before you actually hear it.

#### ALEX

That sounds about right.

#### JONNY

With Season 2, I've actually sat down and planned it all out in a lot more detail, so I now know what the actual episodes are going to be about.

#### ALEX

Well, ultimately as well, from a production standpoint, I mean, Season 1 was entirely new territory. It was completely exploratory, we didn't know if people were gonna like it, so ultimately there was an element of... seeing what worked, I think.

#### JONNY

Also for Season 2 I've been writing a lot more stuff down. _[Alex laughs]_ Season 1 was incredibly intricate but also largely lived entirely inside my head. A couple of the episodes which are dreamlike in tone, um, because they were written to be dreamlike. Others are a bit dreamlike in tone because it was very late at night when they were written.

#### ALEX

So, this is a follow-on question. How long does it take you to write one story, would you say? End to end.

#### JONNY

In terms of just keyboard time, maybe 5-6 hours for a first draft and then 2 hours to edit it and go over. In terms of actual planning, I will generally have an idea and then be constantly churning it over in the back of my mind for about a week. So that when I finally come to write it, I have a much more complete idea of what's going on and how it's going to shape up.

#### ALEX

So. Another question here. How do you prepare to record an episode? Alex directs, but what does that involve? They're interested in the technical and the performing aspects of this. So before we get into the technical, on to your side. We are about to record an episode. How do you prepare for that? Beyond just obviously writing some of the content.

#### JONNY

Well, obviously I've been fasting for a few days to purify the blood. _[Alex chuckling]_ To be honest, largely it involves just sitting there and reading the first few paragraphs in the Archivist voice, to get my head in the right space for actually reading it.

#### ALEX

So for my perspective, obviously, there's an element of setup involved. We use various amounts of equipment I won't go into here. But once all of the mikes and the equipment are set up, what we'll tend to do is we'll sit down, and we'll just run through the episode very quickly and decide if anything unusual has to happen in performance and we'll address how that's happened. So changes in voice, pitch, things like that.

#### JONNY

If there's any soundscaping.

#### ALEX

Soundscaping, yeah. And then beyond that, the only other thing that really takes a lot of time with prep is when you have multi-cast recording.

#### JONNY

Oh. Yeah.

#### ALEX

Because that slows that process down a lot. Because then you have to sort of go line-by-line, make sure people understand the intent of the lines, how do you say that, how do you project that. And then we're into more sort of basically the nuances of it, rather than just the sort of get it down, get it recorded.

#### JONNY

Yeah. The last episodes of the first season were easily the most complicated...

#### ALEX

Oh, yeah.

#### JONNY

...because we were doing, I mean, we were doing an actual audio drama rather than an audio drama-esque anthology series.

#### ALEX

Yeah. Following on, I figure we've already addressed this a bit. Are there any *Magnus* bloopers? Has Jonathan Sims __ever__ laughed?

#### JONNY

No.

#### ALEX

Ever?

#### JONNY

No.

##### [ALEX ATTEMPTING NOT TO LAUGH]

No, I, I laugh a lot.

 Some might say that I laugh too much.

#### ALEX

Not many.

#### JONNY

No. No, I've never actually heard it, but I assume they say...

#### ALEX

And they're dead now.

#### JONNY

I assume they say it.

#### ALEX

But in all seriousness, from the production side, we do have a few recorded gaffes but we're not intending to release them anytime soon. Mainly because it's a bit of a mood-killer.

#### JONNY

Also I'm very sweary in real life. _[Alex chuckles]_ Like, that sounds like a joke because I'm a relatively deadpan person, but it's not, I'm... very sweary. And this is meant to have a "[CLEAN]" rating on iTunes. So... no rude words. I could say "bums," maybe. _[Alex laughs]_

But I won't.

#### ALEX

So, again, discussing sort of more of the production side: when putting together an episode like Hive, how do we get the SFX? What goes into making those SFX? So a lot of our sound effects will come from like online archives. I can't recommend enough things like freesound.org, and there's a few other sites similar to that.  Truth be told, that happens less often than you'd think. Like I said, those archives are quite good, and you can get quite good at taking a sound and turning it into something that it's not. For instance, I won't tell people how we make the worm sounds, but it just involves a lot of pasta. Lots and lots of pasta.

#### JONNY

Delicious, screaming pasta.

#### ALEX

In fact, following on from that: have you ever considered your fixation with invasive worms from a Freudian perspective?

#### JONNY

I'm sure I don't know what you mean. _[Alex chuckles]_ The idea of pulsating, writhing, elongating worms tunneling into flesh is... I mean, it's just good horror, really. I don't know... I don't know what you mean.

#### ALEX

We'll skip past that one. I don't really know what they're getting at.

#### JONNY

I don't, it's nonsense, really.

#### ALEX

What are your fears?

#### JONNY

Well, quite a lot, to be honest. I feel that it's very hard to write good horror unless you're writing something that to one degree or another scares you a bit.

#### ALEX

Absolutely.

#### JONNY

If you yourself don't have just a little tingle of fear at the back of your mind when you're writing it, it's probably not as scary as it could be. So a lot of these do come from, they might not be huge fears of mine, but they are things that freak me out to one degree or another. Trypophobia, obviously, is...

#### ALEX

Oof.

#### JONNY

...quite a significant one.

#### ALEX

That's the one that we share. Yeah. Mm.

#### JONNY

Which is where a lot of Jane Prentiss comes from.

#### ALEX

I'd say certainly the episodes that are grabbing people the most, it seems, online, are the ones that tend to be quite universal. And honestly quite simple, so it'll be things like fear of falling, fear of darkness, fear of the stranger.

#### JONNY

No, exactly. So a lot of these are, it's marrying as universal a fear as you can with the specifics of what scares you. So taking your own fear and making it transferable.

#### ALEX

Yeah.

#### JONNY

So you listen to any episode and you can probably glean a nugget of what scares me.

#### ALEX

It's been confirmed that you like M. R. James, so with that in mind, what's your favorite story of his, and do you have any other literary inspirations?

#### JONNY

I mean, it's called __*The Magnus Archives.*__ _[Alex laughs]_ The show is... the show is called *The __Magnus__ Archives.* It's "Count Magnus." That's why the show is called *The Magnus Archives*. To be fair, there are others that I'm very fond of from M. R. James. Weirdly enough, I have a really specific soft spot for "A School Story," because it is possibly the most minimalist ghost story I've encountered that's managed to have a really significant effect on me.

#### ALEX

So. Inspirations other than M. R. James?

#### JONNY

I've got a real soft spot for old-school creepypasta.

#### ALEX

Who doesn't?

#### JONNY

When I used to work nights, there'd be some weeks where I didn't fully adjust to the daytime and I'd spend almost a whole week in the dark listening to creepypasta, or reading weird blogs, or just going through creepy pictures and just working myself into a real state.

#### ALEX

I mean, interestingly, I remember the first time you pitched *The Magnus Archives* to us and you described it as "M. R. James meets creepypasta for a start." And you also referenced Ionized Yeast.

#### JONNY

Oh. That's because I--again, when I was working night shifts, I lived off the generation of horror podcasting before ours. So *PseudoPod*, who are still going strong...

#### ALEX

Oh, yeah.

#### JONNY

...and the early seasons of *NoSleep*, *Knifepoint Horror*, and also, I used to delve into radio archives, and one of them from the 1940s was a show called *Lights Out.* And it was very much of the time, but it was mostly sponsored by Ionized Yeast. And every episode there'd be, like, a minute-long unique Ionized Yeast advert about how if you're only feeling half-alive and you were _[American radio announcer voice]_ "too old and tired for your job at the war factory. I sure am discouraged!"

#### ALEX

So there you have it, then. The primary influence of *The Magnus Archives* is wartime horror.

#### JONNY

It's Ionized Yeast. I mean, I'll be honest, Alex, I've always said that you look remarkably low on Vitamin B and iron. _[Alex chuckles]_ You could put on 8, 10, or more pounds of good new flesh!

#### ALEX

Moving on... Okay. These are some more questions to do with the actual story itself. Why, narratively rather than canonically, does the Magnus Institute only collate information and not engage with their learnings beyond supplementary clarification investigation?

#### JONNY

It's largely because the sort of horror stories I want to tell are standalone. They are the experiences of an individual when confronted with something sinister and inexplicable. To actively follow up with the encounters would turn it into, I mean, it would turn it into something that's more along the lines of the X-Files.

#### ALEX

Yes.

#### JONNY

Which is, like, a very valid and excellent form of horror, but not the one that I'm trying to write. Also it's useful from an audience point of view to not need to say, "Go back and listen to everything or you just won't understand what's going on!"

#### ALEX

Oh, yeah. Other question, same kind of lines: how large is the Magnus Institute? As an organization.

#### JONNY

There are between 80 and 100 staff in total. Very few of them are focused on the Archives. I think probably the core staff is maybe 40.

#### ALEX

Okay. Now, this is a bit of a specific one we're going to have to drill down to. So. You've been very specific in *The Magnus Archives* about the reasons that Sims is recording on tape, but how does the sound play into this? It's an interesting idea that some things are so fundamentally unnatural that they would cause corruption to recordings of it. But what about the music that plays for the atmosphere? Is that an actual thing that's on the tapes and thus canonical, or is it just something for the listeners? Now, that's something that I might jump in on a little bit. So...

#### JONNY

Yeah, please do.

#### ALEX

When Jonny originally pitched *The Magnus Archives* to me, there was a period of testing where we actually ran a few episodes that will never see the light of day. And what we were doing is seeing what sounded right. And part of that was to do with the sound of it. So we did versions of the Archives without the tape deck, just to test. I didn't like it. I think that it's got a sort of lo-fi charm. And then we tried doing them with the music, and we found that the music added something. Ultimately, from sort of the directorial standpoint, I've always had it that the music is not part of the actual recordings.

#### JONNY

Yeah.

#### ALEX

However, the tape deck, the distortions, the sound effects of things actually happening, the voices of the people within there, are part of the actual files. The only thing that was added is music, and the main reason for that is, it needed something to fill out that sound a little bit...

#### JONNY

Yeah.

#### ALEX

...and just give it a little bit of pop.

#### JONNY

Everything that you hear is on the actual tape within the world of *The Magnus Archives* except the music.

#### ALEX

Yeah. Yeah.

#### JONNY

Oh, and just to say, we do not mean to say that there are lost episodes of *Magnus* out there. _[Alex laughs]_ It was largely the first few episodes we just did over and over again in various formats.

#### ALEX

Yeah, we just did multiple permutations. So you're not, you've not missed anything, I'm afraid. Okay. Now, we're heading a bit more into the sort of fanbase-y kind of questions, things to do with that. So with that in mind: what's it like having the ability to interact so closely with your fanbase? Would you do it again?

#### JONNY

It's fascinating, gratifying, and it holds me to account. _[Alex laughs]_ I don't think it's even a question of would I do it again. The, I mean, the answer is yes. But moreover, the way that content is created these days, I don't think a creator has an option but to engage with the community that builds up around what you do. Unless you deliberately remove yourself.

#### ALEX

I mean, certainly you've said this to me before, which is that an element of *The Magnus Archives* was tying yourself to a rock _[Jonny chuckles]_ and then throwing that rock off a cliff and you've just gotta keep writing rope.

#### JONNY

Yeah, exactly. And the fans and the community are a big part of that. And I don't want any of that to sound like I don't love the community massively. It's really gratifying to see that something you've created has hooked people like that.

#### ALEX

But absolutely there's an element, though, that once you're accountable to those fans it does help keep getting that pen to the paper, doesn't it?

#### JONNY

Exactly. Exactly. Because it's not just me I'm responsible to. Also it is very useful in terms of writing a story like this to see which bits of the mystery, which sort of threads, are picked up. There are, I won't say who, but there are a couple of people on the various sites and message boards that I...

#### ALEX

Oh yeah.

#### JONNY

...keep an eye on because I feel that if I write something and they don't spot it, it's possibly a bit too subtle. Maybe I need to, you know, make it a bit more overt in a future episode. And others where I'll keep an eye on them in case I've made a mistake somewhere, because they will let me know. _[Alex chuckles]_

#### ALEX

Following on from that, another question to do with something similar. How do you feel about the level of scrutiny that your work gets from listeners? Does all of the checking and fact-checking and so on outweigh the positivity of listening to people on the forums going into their own theories in depth?

#### JONNY

I mean, that makes it sound like having that level of scrutiny and being called to account when I make a mistake isn't a positive.  You might give them a look and be startled or even annoyed. But it's good because it means that you're not writing unintelligible nonsense. _[Alex laughs]_ And moreover, especially with a show like *The Magnus Archives* where everything is very intricate and everything needs to be internally consistent. I can't be allowed to make mistakes because that's not fair. It's straight-up not fair to ask people to try to figure out a mystery I'm spinning out and then constantly make mistakes, get dates wrong, or feed people false information.

#### ALEX

Do you have any plans to break the mold of your current narrative style? It seems like there would be some difficulty in telling the current arc without more... live-action-style narrative sequences.

#### JONNY

Yeah. I mean, obviously that question came in before the finale of Season 1 came out. Generally as the series goes on, there will be more of that? At its core, it will still remain one episode, one statement, one story.

#### ALEX

Yeah. And the last question we've got, actually, let's try and avoid spoilers.

#### JONNY

Okay.

#### ALEX

What would you say is the biggest challenge that is facing you in Season 2?

#### JONNY

Balancing horror and mystery.

#### ALEX

Oh yes.

#### JONNY

Because fundamentally you see a lot of horror mystery series that start off extremely strong and peter out a bit, because at the beginning, horror and mystery are fantastically good together.

#### ALEX

Oh, yeah.

#### JONNY

Because they both rely on the unknown so heavily. And so the unknown feeds the horror and entices the mystery. But as it goes on, the mystery needs to be, it needs to get answers, otherwise you feel cheated, whereas the horror needs to stay unknown, because if you get all the answers to what the horror is, it's no longer scary, and if everything stays unknown and horrific, then you don't get any answers to the mystery. So I would say that the biggest challenge is trying to keep everything unknown and scary while at the same time providing enough answers to the mystery that people are willing to stay around and learn more. And there are answers. You won't learn the answers to everything. There are some small mysteries that will never be known. But a lot of the why, the what, the who, they will in time come to light.

#### ALEX

So I think that about wraps us up here. Thanks again, Jonny, for all of your time. If you'll just go back into the hole, you can carry on writing all the rest of Season 2.

#### JONNY

_[Exhausted and despairing voice]_ I just want to go to sleep, Alex.

#### ALEX

No, not for you. But thanks to everyone who's been listening so far. It's completely blown us away. The response that we've had from everyone. We weren't expecting this kind of a following...

#### JONNY

Not even remotely.

#### ALEX

...and it's an amazing thing to happen. But if people are able to, please do leave reviews on iTunes and podcast services, write reviews yourselves. That kind of content, it makes a massive difference to a smaller operation like us. Be sure to check us out on Facebook, Twitter at @therustyquill, the subreddits, our forums at the website...

#### JONNY

Oh, we are also nominated at the moment for a couple of the categories in the Audio Verse Awards, which are, voting is open until the 6^th^ November for the... semi-finals, I believe? So if you get a chance to pop on there and give us a vote, that would be massively appreciated.

#### ALEX

Again, the response we've had from fans has been amazing and anything that you're able to do in that would be a huge help to us. If you cannot wait, if you cannot hold on, if you cannot last without Jonny's... sultry... tones, until the beginning of Season 2...

#### JONNY

Yes?

#### ALEX

...you have actually recorded something with us to stave people over until then, haven't you, Jonny?

#### JONNY

Yes. It is the Halloween special for the gaming podcast. I'm running Deadlands, which is a horror Western setting which I'm very fond of. It's a lot of fun, and yeah. Go over there and listen to it. Do it now.

#### ALEX

You can find that on all the podcast services that you normally use for *The Magnus Archives*. Just look for *Rusty Quill Gaming Podcast*. And I think that about wraps us up. So, thanks again, and we look forward to seeing you again for Season 2.

#### JONNY

_[Ominous voice]_ See you then.

gha_language: Ruby


text:
# nifty

[![Clojars Project](https://img.shields.io/clojars/v/huahaiy/nifty.svg?color=sucess)](https://clojars.org/huahaiy/nifty)

A collection of useful data structures for Clojure and Clojurescript.

These data structures are intended to be used in program hotspots, so the design favors performance over immutable data semantics. That is to say, these data structures are mutalbe, though familar Clojure collection protocols are implemented.

##### Table of Contents

* [Priority Map](#priority-map)
* [Disjoint Set (Union-find)](#disjoint-set)

## Priority Map

This is a [priority queue](https://en.wikipedia.org/wiki/Priority_queue) that
also functions as a map.

The keys are the data, the values are the priorities. Data are kept in sorted order based on the priority.

Priority queue is often used in breadth first search based graph algorithms, discrete event simulation, resource management and scheduling.

```Clojure
(use 'nifty.priority-map')

;; initialize a priority map
(def m (priority-map :e 5 :b 2 :c 3 :d 4 :a 1 :f 6))

;; peek the head
(peek m)
;;=> [:a 1]

;; pop the head
(pop m)
;;=> {:e 5, :b 2, :c 3, :d 4, :f 6}

;; peek again
(peek m)
;;=> [:b 2]

;; insert a key priority pair
(assoc m :z 0)
;;=> {:e 5, :b 2, :c 3, :d 4, :f 6, :z 0}

;; peek
(peek m)
;;=> [:z 0]

```

The priority queue is implemented as a [pairing heap](https://en.wikipedia.org/wiki/Pairing_heap). The time complexity of `peek` and `assoc` are both O(1), and `pop` is O(log n).

We do not implement the optional `decrease-key` operation, as most uses of priority queue care only about the head of the queue, and the map avoids duplicates already.

Priority map does not support `dissoc` on an arbitrary key.

## Disjoint Set

This is a
[disjoint-set](https://en.wikipedia.org/wiki/Disjoint-set_data_structure), also
known as a union-find data structure. It consists of some disjoint sets of
values, where each set has a canonical value representing it.

Disjoint-set is often used to keep track of connected components of a graph, and
to implement unification.

In addition to `canonical` (find) and `union` function, set operations
are defined on the data structure, as well as some convenient functions: `sets`
return a map of canonical values to the corresponding sets of values; `members`
return the set a value belongs to.

```Clojure
(use 'nifty.disjoint-set)

;; define a disjoint set
(def a (disjoiont-set 1 2))

;; At this point, each value is its own canonical value
a
;;=> #{1 2}

(canonical a 1)
;;=> 1
(canonical a 2)
;;=> 2

;; Now union 1 and 2
(union a 1 2)
;;=> #{2}

a
;;=> #{2}

(canonical a 1)
;;=> 2
(canonical a 2)
;;=> 2

;; Now add a value
(conj a 3)
;;=> #{2 3}

;; see all the sets so far
(sets a)
;;=> {2 [1 2], 3 [3]}
(members a 1)
;;=> #{1 2}

;; Now remove 2
(disj a 2)
;;=> #{1 3}

;; now 1 becomes the canonical value
(sets a)
;;=> {1 [1], 3 [3]}
(members a 1)
;;=> #{1}
```

We implements path compression and union by rank optimizations. The amortized
time complexity is O(m`a`(n)) for m union-find operations on n elements, which is optimal, where `a` is inverse Ackermann function, essentially in constant time.

repository: huahaiy/nifty

repo_name: huahaiy/nifty


text:
---
title: "Selecting a LoRa Transceiver"
keywords:
last_updated:
tags:
sidebar: documentation_sidebar
permalink: selecting-lora-transceiver.html
folder: LoRa-LoRaWAN-Module
---

- To allow our Raspberry-Pi board to receive\transmit data in a LoRaWAN network, we must equip it with a LoRa transceiver
- **IMPORTANT :** Our transceiver should operate on the ISM band  EU433\EU868, as it is not legal to operate on other LoRaWAN ISM bands in Lebanon (such as US915).

---

### **Type-1, Pi-Hat LoRa Transceivers** :

- Pi-Hats modules are designed to be compatible with the GPIO interface of the Raspberry-Pi.
- **IMPORTANT** : How many pins does each Pi-Hat model require ? If the Pi-Hat uses too much pins, we might not be able to connect the Raspberry-Pi to other components (i.e. flow meters, GSM modules...).

| Manufacturer  | Operating Frequency | Price | Store Link |
| ------- |  -------- |  ----- | ----- |
| Pi Supply | 868MHz & 915MHz versions available | 150 USD | [Link](https://uk.pi-supply.com/products/iot-lora-node-phat-for-raspberry-pi?_pos=41&_sid=30d832a4c&_ss=r)|
| IoT Store | 433MHz & 915MHz versions available | 60 USD | [Link](https://www.iot-store.com.au/products/lora-and-gps-hat-for-raspberry-pi-long-range-transceiver) |
| Waveshare  | 915MHz version available | 35 USD | [Link](https://www.amazon.com/SX1262-LoRa-HAT-Transmission-Communication/dp/B07W83FCCZ)  |
| Dragino | 868MHz version available | 30 USD | [Link](https://www.antratek.com/raspberry-pi-lora-gps-hat-868mhz) |
| Turta   | 433MHz & 868MHZ & 915MHz versions available |  60 USD | [Link](https://turta.io/collections/raspberry-pi-hats/products/lora-hat?variant=12549674958895) |

---

### **Type-2, LoRa Transceivers Modules**

- LoRa modules which can interface with the Raspberry-Pi board through UART\I2C\SPI

| Manufacturer | Operating Frequency | Price | Store Link |
| ------- |  -------- |  ----- | ----- |
| RAK-Wireless | 868MHz & 915MHz versions available | 25 USD | [Link](https://uk.pi-supply.com/products/rak813-lorab-ble5-and-lora-module-based-on-nrf52832-and-sx127x?_pos=15&_sid=30d832a4c&_ss=r)|
| RAK-Wireless | 433MHz & 868MHz & 915MHz versions available | 15 USD | [Link](https://uk.pi-supply.com/products/rak811-lora-lorawan-module?_pos=18&_sid=30d832a4c&_ss=r) |
| REYAX | 868MHz & 915MHz versions available | 20 USD | [Link](https://www.amazon.com/RYLR896-Module-SX1276-Antenna-Command/dp/B07NB3BK5H/ref=sr_1_1?dchild=1&keywords=LoRa&qid=1594195384&rnid=2941120011&s=pc&sr=1-1) |
| HopeRF  | 915MHz version available | 15 USD | [Link](https://www.amazon.com/RFM95W-915Mhz-Transceiver-SX1276-compatible/dp/B01F6HPWMC)|
| Aptinex | 433MHz & 868MHz versions available  | 35 USD | [Link](https://www.amazon.com/Aptinex-LoRaNode-RN2483A-Microchip-LoRaWAN/dp/B01N2RJPMJ/ref=sr_1_4?dchild=1&keywords=LoRa&qid=1594195384&rnid=2941120011&s=pc&sr=1-4) |


text:
# NYRP: New York Regents Preparation

## Overview
Current project for a website to help prepare for a New York Regents
test. Students can select questions by the the year it appeared, or
by the topic it covers. Unlimited attempts are allowed per question so
students can get immediate feedback. After answering all questions or
ending the test at any point, more in-dept analysis is provided giving
students feedback on their best and worst topics. The live version
can be found here: https://regents-prep.herokuapp.com/NYRP/

## Outside Libraries
- BootStrap:  3.3.5
- JQuery:     2.1.4
- Django-widget-tweaks 1.4.8
- CSS Percentage Circle
- Google Visualization: Pie Chart

## Getting Set Up Locally
1. To get a local copy, clone this repo
`git clone git@github.com:WalterSchaertl/NYRP.git`
2. Install pip dependencies from the requirements.txt (requires python3)
`pip3 install -r requirements.txt`
3. In a terminal, start the server
`python3 manage.py runserver <IP_ADDRESS>:8000`

Note: if you run into issues, in settings.py, ensure that debug is true
(`DEBUG = True`) and all hosts are allowed (`ALLOWED_HOSTS = ["*"]`).

## Docker
If desired to run as a container, a Dockerfile and docker-compse.yml are provided.

repository: WalterSchaertl/NYRP

gha_language: Python

repo_name: WalterSchaertl/NYRP


text:
---
layout: page
title: "analysis"
comments: false
sharing: false
footer: false
sidebar: false
---

## Visualization of production run

## Ion Position

## Water String Dipole

If you closely examine the string of water in the pore, you will notice that the water molecules are not
randomly oriented. Instead the oxygen of one water points toward the hydrogens of the next. This directs
the negatively charged oxygen in one direction with the positively charged hydrogens in the other.

{% blockquote %}
QUESTION 1: Predict what happens to the orientation of the water as postively charged ion like potassium moves through the pore. When the ion is at the center of the pore, will the water above and below it be oriented in different directions?
{% endblockquote %}

We can quantify this orientation by measuring the the [net dipole](http://en.wikipedia.org/wiki/Electric_dipole_moment) of the string of waters.
The following tcl script will calculate the z-component of the net dipole for each snapshot in your trajectory and write the results to a file:

``` tcl Tk Console
set pwat [atomselect top "water and same resid as {water and within 4 of protein and z > -8 and z < 8}"]
set nframes [molinfo top get numframes]

set fout [open dipole.dat w]

for {set k 0} {$k < $nframes} {incr k} {
$pwat frame $k
$pwat update

set dipole [measure dipole $pwat -debye]
set dz [lindex $dipole 2]
puts $fout $dz
}

close $fout

```

Plot the data by launching the application `Grace` which is located in the `Applications` folder.

- Open `dipole.dat` by selecting `Data > Import > ASCII..` and then selecting `dipole.dat` as the file. You may have to navigate to `$MDT/analysis` to locate it.
- Select the options:
    - `Set type: XY`
    - `Load as: Single Set`
    - Click `OK` to plot the data

{% blockquote %}
QUESTION 2: Does the net dipole change during the simulation? If so, does it change smoothly in time or does it make a sudden jump? Give a qualitative description of what you think is going on in this plot.
{% endblockquote %}

Save an `.jpeg` image of the plot and put it in your analysis directory. To save the image, in `Grace`, under the `File > Print setup..` dropdown,
select `Device: JPEG`, and set the path in the `File name` element. Hit `Apply` then `Accept` and then `Ctrl+P`. You should now see the `.jpeg` file
in the directory you specified.

extension: markdown


text:
# .NET Core resource support

## `resx` resource file format

`resx` file format support is briefly mentioned in the the changes to the
dotnet cli default includes.
See https://docs.microsoft.com/en-us/dotnet/core/tools/csproj

With the default includes `**/*.resx` files will automatically be
treated as resources.

If you have disabled default includes, resource files can be
added by adding `<EmbeddedResource include="path.resx"/>` entries to
your csproj.

## `resx` file naming conventions

To access resources the typical methodology invloves creating a
`System.Resources.ResourceManager` instance.

```C#
using System.Resources;

namespace MyAssemblyName
{
    class MyType
    {
    }
}
.....
    ResourceManager rm = new ResourceManager(typeof(MyType));
.....
```

For this scenario the neutral language resource file is typically named

`MyType.resx`

For language or culture specific resources the file is named

`MyType.<CultureInfo.Name>.resx`

e.g.

`MyType.en.resx` for a generic English resource.

`MyType.en-US.resx` for an English as spoken in the United States resource.

## Build conventions

A resource file of the form `MyType.resx` is compiled and added to the
assembly `MyAssembly.dll` with the name `MyAssembly.MyType.resource`

A resource file of the form `MyType.<CultureInfo.Name>.resx` is compiled
and added to the satellite assembly `<CultureInfo.Name>\MyAssembly.resources.dll`
with the name `MyAssembly.MyType.<CultureInfo.Name>.resource`

## ResourceManager resource location

When the ResourceManager wants to find a string or an object it must load the
resources file associated with the requested culture.

For instance ResourceManager has two methods to get a string.

```
GetString(String)
GetString(String, CultureInfo)
```

In the first case the culture is determined implicitly using the value
of the `CultureInfo.CurrentUICulture`.  So in both cases CultureInfo is
used.

The search algorithm for finding the resources is:
* Find the owning Assembly
* Find the resource by name

To find the owning assembly the ResourceManager iterates on the current
`CultureInfo`.  It starts from the requested culture and iterates through
the `CultureInfo.Parent` until the current culture is equal to the
`Neutral` culture.

Each current culture iteration tries to load the the assembly.  It
indirectly triggers an AssemblyLoadContext.Load(AssemblyName name) with

```
AssemblyName name = {
  Name=myType.Assembly.GetName().Name + ".resources",
  CultureInfo = currentCulture
};
```

When it reaches the neutral culture, it typically simply uses `myType.Assembly`.

Once the owning assembly is found the resource must be loaded from the
assembly by name.

## Diagnosing resource location failures

For the current version of .NET Core, the exception thrown when a
resource is not found makes it difficult to determine the root cause of
the failure.  Specifically whether the assembly could not be found and
loaded, or the resource file could not be located within the assembly.

For debugging assembly load failures, adding a handler to
`AssemblyLoadContext.Default.Resolving` can be helpful.  This event is
called when the AssemblyLoadContext.Default fails to load an Assembly.
This event will not be called for any assembly which was sucessfully loaded.

```
using System.Runtime.Loader;

Assembly ResolveTrace(AssemblyLoadContext alc, AssemblyName assemblyName)
{
    Console.WriteLine($"ResolveTrace(AssemblyName {assemblyName})");

    return null;
}

AssemblyLoadContext.Default.Resolving += ResolveTrace;
```

If the assembly is loaded correctly, the next failure point would be the
resource name.  The simplest solution is to look for the resurce file in
the obj intermediate directory.

IL Spy has also been recommended as a solution.

repository: sdmaclea/NetCoreAppModel

repo_name: sdmaclea/NetCoreAppModel


text:
---
layout: post
status: publish
published: true
title: What does hybrid cloud mean for DevOps?
author_email<EMAIL_ADDRESS>categories: [Platform, Infrastructure]
description: DevOps skills for a hybrid future!
tags: [devops, servers, programming]
comments: true
crosspost_to_medium: false
---
Hybrid is making a comeback, are your DevOps skills ready?
{% include image.html
img="/public/img/cloud-devops-hybrid.jpeg"
caption="Rawf8/Adobe Stock" %}

There is no doubt that cloud is still growing, with U.K public cloud market market projected to reach $16 billion in
2022 according to [Statista][ukcloudreport].

Hybrid
=====
Despite the tremendous growth, reports are growing that businesses are pulling workloads off of public cloud platforms
and onto on prem data centres.

The Node4 report noted that 56% of the respondents said their public cloud bills were more expensive that anticipated
with 17% reporting workload incompatibility.

This means we can see companies continuing to run workloads on company-owned hardware or platforms provided by a
hosting company. A [Close Brothers report][cbreport] agrees stating 58% of U.K. SMEs do not use cloud-based computing.
The costs associated with cloud migration and concerns with security stated as reasons not to move to the cloud.

Why use cloud then?
================
This agrees with my findings, that not all workloads are suitable for the cloud. There are just three use cases for
using cloud resources for your applications.

* Startup phase where capital expense for server hardware does not make sense. In early Alpha and Beta phases,
investments into unknown levels of hardware is difficult to predict or justify.
* Dynamic workloads, during growth phase, the lead times associated with new hardware might not be able to keep up with
the growth in demand for a service
* Variable workloads seen by some seasonal or development demand is more cost effective if you can scale down operations
rather than running and paying for peak demand all the time

Were you have a mature product, the workload is very predictable or largely static, it is more cost effective to invest
in your own hardware to run the servers. It is advisable to run virtualization for it's other benefits (another blog),
but running at a fixed or predictable overhead.

Indeed AWS came out of a project to provide a self service platform for amazon.com, followed by a way to monetise spare
capacity during the off peak months.

What about DevOps?
================
Developers will still need platforms, but with a hybrid approach, infrastructure skills may become more in demand as
knowledge about virtualisation, hypervisors and networks is needed for data centres operated away from the cloud
providers.

End of cloud?
============
No signs yet. With the U.K. market growing from $12 billion in 2020 to over $16 billion in 2022, and predicted to grow
exponentially in the next five years, cloud still has a lot to offer.

Want to know more? Come ask me questions. You can find me on [Slack]({{site.data.slack.invite}}).

If you found this useful, subscribe to updates and look out for my [YouTube channel]({{site.data.youtube.channel}}) content.

[ukcloudreport]: https://www.statista.com/outlook/tmo/public-cloud/united-kingdom#:~:text=Revenue%20in%20the%20Public%20Cloud,US%2410.03bn%20in%202022.
[cbreport]: https://www.closeinvoice.co.uk/news-and-insights/over-half-smes-do-not-currently-use-cloud

gha_license_id: NOASSERTION


text:
# VerdiJS Project Layout Instance

The PLI (Project Layout Instance) is a javascript object model of the standard directory layout that all [VerdiJS](https://github.com/verdijs/verdijs/) modules use.  The standard layout enables users to instantly feel at home in any one of the [VerdiJS](https://github.com/verdijs/verdijs/) modules.

The PLI is inspired by the [Apache Maven Standard Directory Layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html).

## Directory Descriptions

The following directories are modeled by the PLI.

### Source Directories

| Directory     | Summary                                                   |
|:--------------|:----------------------------------------------------------|
| src/main/css  | Entry level CSS module(s) are contained in this directory |
| src/main/js   | Javascript supporting dynamic demoes                      |
| src/main/html | Dynamic demonstrations                                    |
| src/test/css  | CSS test utilities                                        |
| src/test/js   | Javascript supporting CSS unit tests                      |
| src/test/html | Html pages for loading the unit tests                     |

### Target Directories

| Directory        | Summary                       |
|:-----------------|:------------------------------|
| target/main/css  | Built CSS modules             |
| target/main/js   | Built javascript              |
| target/main/html | Built dynamic demo html pages |
| target/test/css  | Built test CSS utilities      |
| target/test/js   | Built test Javascript         |
| target/test/html | Built test html               |

## Usage

``` javascript
var PLI = require('verdijs-pli');
console.log(PLI.src.main.css);
//Logs `./src/main/css`
```

## Extension

More directories can easily be added, and will naturally fit with the build methodology.  For example:

| Directory            | Summary        |
|:---------------------|:---------------|
| src/main/coffescript | Coffescript    |
| src/main/jade        | Jade templates |

repository: verdijs/verdijs-pli

repo_name: verdijs/verdijs-pli


text:
# NIXT Chatbox

![alt text](img/logo_unix-chatbox-nobox.jpg)

NIXT Chatbox is Unix-based is a multi-threaded instant messaging system that allows both private and group
chats, developed in C.

As Carnegie Mellon computer science students we ssh to afs (Andrew File System) frequently, and we realized that when we want to discuss ideas or projects we tend to leave our Unix Shell, and use some instant messaging app like WhatsApp or Facebook messenger, then switch back to the Unix Shell. So, we decided to develop NIXT Chatbox as a mean of communication between us in the terminal environment, and of course, we thought it would be cool to develop our own instant messaging app!

# Getting Started

- clone the repo
``` shell
git clone https://github.com/afomer/Nixt-Chatbox.git
```
- Compile the code
``` shell
make
```
- Run the server on an listening port [if you want to run a server of your own]
``` shell
./server 1220 &
```

- Run the client executable with rlwrap and put the ip and the port of the server
``` shell
rlwrap ./client linux12.qatar.cmu.edu 1220
```

repository: afomer/Nixt-Chatbox

repo_name: afomer/Nixt-Chatbox