text:
---
layout: post
header: default
title: "Building Better Tools: Implementing the UNIX Philosophy in C/C++"
author: Braden Hitchcock
---

Engineering is about building things that last. In every engineering discipline,
engineers strive to invent structures, materials, compounds, and machines that
can be used every day for years to come to make the world a better place.

Software engineering is no different.

When designing and building a software system, we must think about what
practices and patterns we can follow to ensure that our system won't become
obsolete five years after we build it.
Unfortunately, this is easier said than done; but one of the methods used to
improve the maintainability, flexibility, and extensibility of software is
modular design: building a system out of smaller components that work together
to accomplish a larger goal.

These fundamental principles of modularity and composability are at the heart of
the UNIX Philosophy.

## The UNIX Philosophy

> The UNIX philosophy emphasizes building simple, short, clear, modular, and
> extensible code that can be easily maintained and repurposed by developers
> other than its creators. The UNIX philosophy favors composability as opposed
> to monolithic design. [1]

Software engineering is more than just writing code. It's about designing
systems that can adapt to the rapidly changing world around them. The UNIX
Philosophy, originated by Ken Thompson and elaborated on by others, is just one
of the methods we can use to produce such software.

UNIX was originally designed to help build research software. One of the primary
purposes of research is to explore the unknown and adapt to changing
circumstances, so it's only natural that the philosophy driving its design would
be built on modularity and composition. Doug McIlroy, a pioneer in
component-based software engineering, summarized the UNIX philosophy in the 1978
Bell System Technical Journal. Among other things, he mentioned two simple
methods for building composable software: [2]

1. Make each program do one thing well.
1. Expect the output of every program to become the input of another.

These two points in particular resonated with me. I am a huge advocate for the
creation of highly-cohesive, loosely-coupled software that facilitates
maintenance and growth, so seeing such a paradigm well-accepted and embedded in
the UNIX system was reassuring. In fact, if you really think about it, this is
exactly what a UNIX shell does: it provides a single interface that allows you
to interact with the system by using hundreds of separate and distinct
executables. Oftentimes, you can combine several of these executables
together—chaining their inputs and outputs—to accomplish a larger
goal.

In the context of creating a suite of tools (or a single tool that can be
extended), we can see where this philosophy starts to give us an advantage. The
original creators of UNIX could have built one, monolithic master program that
could do everything all the commands available in a UNIX shell can do, but
imagine the overhead nightmare it would be to maintain and extend such a system.
Luckily, they chose a modular system that could be easily extended not just by
the UNIX creators, but by any developer with a tool in mind.

## Designing a Modular System

It's impossible to know from day one all of the possible ways your software will
be used, even when it is built for a very specific purpose. We as developers
can't imagine exactly how a user will interact with our system, nor can we
anticipate all the possible feature requests we may receive. This is one of the
reasons why customer interaction in agile development methodologies is a key
component to success. We can, however, design our system in such a way that when
we receive an unanticipated request for functionality, we can easily build it
into our system.

A possible high-level design implementation of the UNIX philosophy is diagrammed
in Figure 1.

![The UNIX Philosophy](/public/images/posts/unix-philosophy.png "A possible implementation of the UNIX philosophy")
_Figure 1: A possible implementation of the UNIX philosophy_

We have a single main process that receives a command. Rather than executing the
command's associated action, the main process spawns a child process that has
been specifically built for that action. Prior to spawning the extension
process, the main process sets up the necessary communication channels so that
the extension process can send the results of its work back to its parent.

## The UNIX Philosophy in C/C++

> Standard: C++17, Compiler: GCC 7.5, OS: Linux

Let's assume that we are building a system similar in design to the one in
Figure 1. To keep things simple, our system will act much like `command` from a
UNIX shell: it will invoke the command passed to it as its first argument and
forward the remaining options and arguments to the child process.

Building this program is fairly easy. We can use a few low-level C calls to
spawn child process and enable communication between the parent and child:

- `pipe`: Create a communication channel between parent and child.
- `fork`: Spawn a child process.
- `dup2`: Re-route the child process' standard output to the parent process.
- `execvp`: Execute a sub-command (a separate executable) in the child process.
- `read`: Read the output of the child process.
- `waitpid`: Check in occasionally to see if the child process is still running.

If we revisit the high-level view of our system from Figure 1, we get a more
specific C++ design shown in Figure 2.

![UNIX Philosophy ++](/public/images/posts/unix-philosophy-cpp.png "C++ Implementation for the UNIX Philosophy")
_Figure 2: Using C++ to implement the UNIX Philosophy_

Let's explore this design's implementation by walking through some code.

### Set Up Communication and Spawn the Child

We start off by creating our communication channel using the `pipe` function:

```cpp
#include <unistd.h>

#include <stdexcept>

using std::runtime_error;

int main(int argc, char* argv[]) {
    int channel[2];
    int result = ::pipe(channel);
    if(result < 0) {
        throw runtime_error("failed to open pipe");
    }
}
```

Our `channel` array now holds two file descriptors: `channel[0]` holds the
_read_ end of the pipe, and `channel[1]` holds the _write_ end. Once we have the
channel setup, we can spawn a child process:

```cpp
    int pid = ::fork();
    if (pid < 0) {
        throw runtime_error("failed to spawn child process");
    }

    if (pid == 0) {
        // Child process
    } else {
        // Parent process
    }
```

Now that we have the parent-child process relationship, let's look at the
implementation details for the child (our extension process).

### The Child (Extension) Process

```cpp
        // Child process
        ::dup2(channel[1], STDOUT_FILENO);
        ::close(channel[0]);
        ::close(channel[1]);
        ::execvp(argv[1], argv + 1);
```

Notice that in our child process, we are redirecting the standard output of the
child process into the write end of the pipe using `dup2` and `STDOUT_FILENO`.
This makes it easy for our child process to communicate with the parent without
having to keep track of the file descriptor corresponding to to the write end of
our pipe. Instead, we can just write our output to `stdout` and the parent
process can read it.

We also need to make sure that we close **both** the read and write ends of the
pipe we created earlier. We close the read end because we aren't the ones
reading from the pipe: the parent process is. We close the write end because,
after using `dup2` there are two file descriptors pointing to the same write end
of the pipe, and since we are only going to be using `stdout`, we don't need a
handle on write end of the pipe created with the explicit `pipe` call. Moral of
the code: don't forget to clean up after yourself!

Finally, we use `execvp` to execute the command that is passed to our executable
as the first argument, and we forward the remaining arguments to the command.

### The Parent (Main) Process

```cpp
// #include <sys/types.h>
// #include <sys/wait.h>
// #include <cstring>
// #include <iostream>

        // Parent process
        ::close(channel[1]);

        const int BUF_LEN = 256;
        const int READ_LEN = BUF_LEN - 1;

        char buf[BUF_LEN];
        ::memset(buf, 0, BUF_LEN);

        while (true) {
            int bytesRead = ::read(channel[0], buf, READ_LEN);
            if (bytesRead == 0) {
                // The child process has exited
                ::waitpid(-1, nullptr, 0);
                break;
            }

            std::cout << buf << std::endl;

            result = ::waitpid(-1, nullptr, WNOHANG);
            if (result > 0) {
                // The child has exited, but there might still be data in the
                // pipe. Drain it.
                while (true) {
                    bytesRead = ::read(channel[0], buf, READ_LEN);
                    if (bytesRead == 0) {
                        // There is no more data in the pipe
                        break;
                    }
                    std::cout << buf << std::endl;
                }
                break;
            }
        }

        ::close(channel[0]);
```

Sticking with the theme of cleaning up after ourselves, first thing we do is
close the write end of the pipe. Then, after initializing a buffer, we begin to
read the output of the child process. In this trivial example, all we do is
write that output to the main process' standard output, but you can imagine a
more complicated scenario where the data coming from the child could be a set of
formatted events the parent process is waiting for.

After each call to `read` we check in on the child process with a call to
`waitpid`. We use the `WNOHANG` option flag to force the check to not block our
current thread of execution. If the child process has exited, `waitpid` will
return an integer value greater than zero, so we can proceed to draining the
pipe and then breaking from our read-loop. Otherwise, the child process is still
alive, and we go back for more data.

The other edge case we need to watch out for is when the child process
terminates after our call to `waitpid` but before our next call to `read`. If
this is the case, then `read` will return zero and we can make another call to
`waitpid` to ensure the child process exited (and optionally get its status)
before breaking from our read-loop.

Finally, don't forget to close the read end of the pipe!

### The Entire Program

Putting all the pieces together gives us the following simple program:

```cpp
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include <cstring>
#include <iostream>
#include <stdexcept>

using std::runtime_error;

int main(int argc, char* argv[]) {
    int channel[2];
    int result = ::pipe(channel);
    if(result < 0) {
        throw runtime_error("failed to open pipe");
    }

    int pid = ::fork();
    if (pid < 0) {
        throw runtime_error("failed to spawn child process");
    }

    if (pid == 0) {
        // Child process
        ::dup2(channel[1], STDOUT_FILENO);
        ::close(channel[0]);
        ::close(channel[1]);
        ::execvp(argv[1], argv + 1);
    } else {
        // Parent process
        ::close(channel[1]);

        const int BUF_LEN = 256;
        const int READ_LEN = BUF_LEN - 1;

        char buf[BUF_LEN];
        ::memset(buf, 0, BUF_LEN);

        while (true) {
            int bytesRead = ::read(channel[0], buf, READ_LEN);
            if (bytesRead == 0) {
                // The child process has exited
                ::waitpid(-1, nullptr, 0);
                break;
            }

            std::cout << buf << std::endl;

            result = ::waitpid(-1, nullptr, WNOHANG);
            if (result > 0) {
                // The child has exited, but there might still be data in the
                // pipe. Drain it.
                while (true) {
                    bytesRead = ::read(channel[0], buf, READ_LEN);
                    if (bytesRead == 0) {
                        // There is no more data in the pipe
                        break;
                    }
                    std::cout << buf << std::endl;
                }
                break;
            }
        }

        ::close(channel[0]);
    }

    return 0;
}
```

We can then save this as `main.cpp` and compile it using the following command:

```text
g++  -o command main.cpp
```

Then run it using:

```text
./command ls -l
```

Which will output the contents of the current directory.

## Conclusions

The UNIX Philosophy helps us write software that is easier to maintain and
extend. By leveraging a modular design and utilizing composition, adopting this
mindset can help us write software that will better withstand the test of time.
The software will be flexible enough to adapt to the fast-paced changes in the
ever-evolving world of software engineering.

As with all design patterns, this philosophy isn't a silver bullet. Think about
what your software's purpose is and, if it makes sense, try making it more
modular by splitting it into a set of smaller executables that work together to
accomplish your goal.

## References

1. Wikipedia (2020) "UNIX philosophy". visited 30 Apr 2020.
   [https://en.wikipedia.org/wiki/Unix_philosophy][ref-wikipedia-2020]
2. McIlroy D., Pinson, E. N., Tague, B. A. (1978). ["UNIX Time-Sharing System:
   Foreword"][ref-mcilroy-1978]. _The Bell System Technical Journal_. Bell
   Laboratories. pp. 1902–1903.

[ref-wikipedia-2020]: https://en.wikipedia.org/wiki/Unix_philosophy
[ref-mcilroy-1978]: https://archive.org/details/bstj57-6-1899/page/n5/mode/2up

gha_language: CSS


text:
# Sample evaluator applications

- [.NET Core unit test](./Netcore-Trx): evaluation performed by using .NET Core unit tests and the output is based on a `trx` result file
- [Messages printed to console](./Console-log): evaluation results printed to console; results and final output parsed from there

license: MIT

repository: bmeaut/ahk-cli

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: bmeaut/ahk-cli


text:
# Moniker

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

This project is a Frigga replacement aimed at making naming strategies within
Spinnaker more flexible.

## How it works

Every resource is assigned a Moniker which exposes `app`, `stack`, `detail`,
and `cluster` fields. If, for example, a Moniker is assigned using Frigga,
we can say that `cluster` = `app`-`stack`-`detail`. However, Frigga isn't
required.

Every cloud provider, Spinnaker account, or even resource can decide how
Monikers get applied/derived. What this means is that we can support either
deriving and assigning a Moniker directly via the resource's name (what
Frigga does), or store the Moniker in the resource's metadata. As an example,
the new Kubernetes provider stores Monikers in annotations:

```yaml
metadata:
  annotations:
    "moniker.spinnaker.io/application": my-application-name
    "moniker.spinnaker.io/cluster": canary-frontend
  name: frontend-test-cache
```

Notice that the resource's name, cluster and application are completely
decoupled.

The logic for assigning & deriving Monikers only needs to happen in the
relevant Clouddriver integration; the rest of Spinnaker only sees the Moniker
that was assigned to a resource. This gives the rest of Spinnaker one
vocabulary for looking up resources by their relationships (in particular
deciding which application and cluster a resource belongs to).

repository: spinnakerbot/moniker

repo_name: spinnakerbot/moniker


text:
---
layout: msdnpost
title: DirectXTex and DirectXMesh now support Direct3D 12
date: 2017-02-01 06:55
author: Chuck Walbourn
comments: true
categories: [direct3d, github]
---
As part of my multi-year personal project of providing open source replacements for the deprecated D3DX library once found in the legacy DirectX SDK, two libraries are focused on content creation tools and build pipelines. DirectXTex handles loading image files, texture processing including format conversion, mipmap generation, block-compression, and writing out 'fully cooked' textures into DDS files. DirectXMesh provides geometry support such as computing normals and tangent-frames, transparent vertex cache optimization, and provides utilities for extracting/inserting vertex data in vertex buffers.

These libraries were originally written for DirectX 11, and it seems likely that most tools should continue to use DirectX 11 for the simplicity and ease of developer productivity. There are, however, cases where you want to use some of this functionality 'in-engine', so the January 2017 releases include DirectX 12 API support as well.

DirectXTex January 2017 release on GitHub

DirectXMesh January 2017 release on GitHub

To simplify supporting all the various platforms and Windows SDK combinations, the library continues to default to using DirectX 11. If you want to use DirectX 12, you need to explicitly include the required headers before including the library header:

```cpp
#include <d3d12.h>
#include "DirectXTex.h"
```

You also need to link with the DirectXTex_Desktop_2015_Win10.vcxproj, DirectXTex_Windows10.vcxproj, or DirectXTex_XboxOneXDK_2015.vcxproj projects which build with both DirectX 11 and DirectX 12 support.

If you want to use both DirectX 11 and DirectX 12 in the same compilation module, then you need to explicitly include both:

```cpp
#include <d3d11_1.h>
#include <d3d12.h>
#include "DirectXTex.h"
```

The story is similar for DirectXMesh, although in this case it's just to let you use D3D12_ input layouts enums and structures instead of D3D11_--the data itself is identical.

In case you missed it, DirectXTex was updated to support the HDR (RGBE) file format as a source for floating-point HDR texture data, as well as having 'opt-in' support for OpenEXR. For more details on how to enable OpenEXR, see this page.

Related: DirectX Tool Kit for DirectX 12

branch_name: refs/heads/main

gha_language: HTML


text:
# Whitehouse Petitions
This repo contains my seventh Swift project from Paul Hudson's awesome [Hacking With Swift](http://www.hackingwithswift.com/) tutorial series.

![](https://raw.githubusercontent.com/duliodenis/HackingWithSwift/master/art/Whitehouse.gif)

This project takes a data feed from a website and parses it into useful information for users. We use UITabBarController, NSData, and JSON in order to construct the app. The JSON feed that the app uses is the freely available "We the people" Whitehouse petitions feed where Americans can submit requests for action and others can vote on them.

### Support or Contact
Visit [ddApps.co](http://ddapps.co) to see more.


text:
# Concord Overview

_Concord's main feature is to enable **Modules for Laravel Applications** on top
of Laravel's built in Service Providers._

## Why Modules?

There are two major use-cases for using modular organization:

1. **Organizing Application** Structure (within a single application)
2. Creating **Reusable Modules** (across several applications)

### Organizing An Application

Most of the business applications quickly reach the level of complexity where it
matters the way the code is being organized. There are several approaches to
organizing the code, and one of them is the modular structure - this is what
Concord was built around.

In case a module lives within the app's codebase (ie. not installed via
composer) then Concord calls that an _in-app module_. These modules shouldn't
consider any code re-use, just keep related functionality in more or less
decoupled modules.

### Reusable Modules

Concord was written with extensible modules in mind. You may have code you're
copypasting from one project to another, or even worse - starting from scratch
over and over with minimal changes again. These repeating units can be
outsourced to modules and can be used across several applications that use those
modules in a specific, custom manner.

These kinds of modules are libraries, usually have their own repository and are
typically installed with composer. Concord calls these _external modules_. These
kinds of modules should consider that they'll be used by applications that
probably want to alter or extend their basic behavior. Concord has quite several
facilities to support that.

#### Example Scenario

You may have an in-house CMS module that can handle pages, posts in multiple
languages. App "A" only want the pages feature in a single language while app
"B" wants all the CMS features. Then comes your client of app "A" and says they
want to assign a specific color to each page. You can decide whether you want to
implement this in your common CMS module or just for app "B". With Concord you
shall be able to do either of those.

#### Composing Parts

Modules consist of different [parts](map.md) like models (entities),
controllers, config files, migrations, views, routes, requests, middleware,
frontend assets and so on.

Laravel itself solves many of these problems, so **whenever a solution in
Laravel exists, it's being used**.

## Modules

Modules are the de-coupled implementations of the business logic and they have
to comply with Concord's basic rules in order to be able to cooperate as a
unified application.

## Boxes

Boxes are optional. Think of them as "boilerplate" applications. They wrap
several modules, and are subject to customization by the final Application.

## Application

Any Laravel 5.5+ application can be a Concord compliant application that
complies with its rules.

The application defines it's own logic and incorporates Concord
modules and/or boxes.

### Simple Layout (Modules Only)

![Simple Layout (Modules Only)](img/layers-simple.png)

### Multi-box Layout

![Multi-box Application Structure](img/layers-multibox.png)

## Why Boxes And Modules?

Reading further you'll see that some [parts](map.md) are advised to be kept in
modules and others in boxes/application.

The reason behind is that modules should be kept decoupled, so whenever it's
possible, they should not be aware of other modules. In case they really depend
on another module, this dependency should be expressed explicitly (via
composer). Number of dependent modules should be kept as low as possible.

Modules however need to be "glued" together, by pivot tables, aggregate classes,
controllers, forms, event-listeners, etc. Concord encourages these kinds of
parts to be implemented either in boxes or in the application. Boxes are
technically modules as well.

Concord has a [recommendation](map.md) of which part should be implemented
where. For example it's possible to define controllers in modules, but it is
recommended that you rather implement controllers in boxes or in the
application.

**Next**: [Installation »](installation.md)

repository: artkonekt/concord

gha_language: PHP

gha_license_id: MIT

repo_name: artkonekt/concord


text:
# goMidas

Go implementation of [C++](https://github.com/bhatiasiddharth/MIDAS) code by [Siddharth Bhatia](https://github.com/bhatiasiddharth)

## Installation

You can install and use the package by cloning this repository in your project folder:

```
git clone https://github.com/ritesh99rakesh/goMidas.git
```

## Table of Contents

  - [Features](#features)
  - [Use Cases](#use-cases)
  - [Installation](#getting-started)
  - [Demo](#demo)
  - [Datasets](#datasets)
  - [MIDAS in other Languages](#midas-in-other-languages)
  - [Online Articles](#online-articles)
  - [Citation](#citation)

## Features

  - Finds Anomalies in Dynamic/Time-Evolving Graphs
  - Detects Microcluster Anomalies (suddenly arriving groups of
    suspiciously similar edges e.g. DoS attack)
  - Theoretical Guarantees on False Positive Probability
  - Constant Memory (independent of graph size)
  - Constant Update Time (real-time anomaly detection to minimize harm)
  - Up to 48% more accurate and 644 times faster than the state of the
    art approaches

For more details, please read the paper - [MIDAS: Microcluster-Based
Detector of Anomalies in Edge
Streams](https://www.comp.nus.edu.sg/~sbhatia/assets/pdf/midas.pdf).
*Siddharth Bhatia, Bryan Hooi, Minji Yoon, Kijung Shin, Christos
Faloutsos*. AAAI 2020.

## Use **Cases**

1.  Intrusion Detection
2.  Fake Ratings
3.  Financial Fraud

## Usage

There are two ways to use goMidas:
1. Use the `Midas` and `MidasR` functions in the package in this repository:

    Example:
    ```go
    package main

    import (
        "fmt"
        goMidas "github.com/ritesh99rakesh/goMidas"
    )

    func main() {
        src := []int{2, 2, 3, 3, 5, 5, 7, 11, 1, 2}
        dst := []int{3, 3, 4, 4, 9, 9, 73, 74, 75, 76}
        times := []int{1, 1, 2, 2 ,2, 2, 2, 2, 2, 2}
        numRows := 4
        numBuckets := 769

        // get anomaly scores
        anomalyScore := goMidas.Midas(src, dst, times, numRows, numBuckets)
        fmt.Println(anomalyScore)
    }
    ```
2. Use the `main.go` provided in `example` folder in this repository to run MIDAS algorithm from command line.

   The file `main.go` just requires you to specify the `data.csv` file containing containing `src`, `dst` and `timestamps`.

   You just have to run:
   ```bash
   go run main.go -input <input-file> -<other-optional-arguments>
   ```

   Complete details for the available arguments:
   ```bash
   -alpha float
       Alpha: Temporal Decay Factor. Default is 0.6 (default 0.6)
   -buckets int
       Number of buckets. Default is 769 (default 769)
   -input string
       Input File. (Required)
   -norelations
       To run Midas instead of Midas-R.
   -output string
       Output File. Default is scores.txt (default "scores.txt")
   -rows int
       Number of rows/hash functions. Default is 2 (default 2)
   -undirected
       If graph is undirected.
   ```

   For more details and to know how to find AUC of the anomaly scores, refer `example` folder in this repository.

## Datasets

1.  [DARPA](https://www.ll.mit.edu/r-d/datasets/1998-darpa-intrusion-detection-evaluation-dataset):
    [Original
    Format](https://www.comp.nus.edu.sg/~sbhatia/assets/datasets/darpa_original.csv),
    [MIDAS
    format](https://www.comp.nus.edu.sg/~sbhatia/assets/datasets/darpa_midas.csv)
2.  [TwitterWorldCup2014](http://odds.cs.stonybrook.edu/twitterworldcup2014-dataset)
3.  [TwitterSecurity](http://odds.cs.stonybrook.edu/twittersecurity-dataset)

## MIDAS in other Languages

1.  [C++](https://github.com/bhatiasiddharth/MIDAS) by [Siddharth
    Bhatia](https://github.com/bhatiasiddharth)
2. [Python](https://github.com/ritesh99rakesh/pyMIDAS) by [Ritesh Kumar](https://github.com/ritesh99rakesh)
2.  [Rust](https://github.com/scooter-dangle/midas_rs)
    by [Scott Steele](https://github.com/scooter-dangle)
3.  [Ruby](https://github.com/ankane/midas) by [Andrew
    Kane](https://github.com/ankane)

## Online Articles

1.  KDnuggets: [Introducing MIDAS: A New Baseline for Anomaly Detection
    in
    Graphs](https://www.kdnuggets.com/2020/04/midas-new-baseline-anomaly-detection-graphs.html)
2.  Towards Data Science: [Controlling Fake News using Graphs and
    Statistics](https://towardsdatascience.com/controlling-fake-news-using-graphs-and-statistics-31ed116a986f)
3.  Towards Data Science: [Anomaly detection in dynamic graphs using
    MIDAS](https://towardsdatascience.com/anomaly-detection-in-dynamic-graphs-using-midas-e4f8d0b1db45)
4.  Towards AI: [Anomaly Detection with
    MIDAS](https://medium.com/towards-artificial-intelligence/anomaly-detection-with-midas-2735a2e6dce8)

## Citation

If you use this code for your research, please consider citing our
paper.

``` markup
@article{bhatia2019midas,
  title={MIDAS: Microcluster-Based Detector of Anomalies in Edge Streams},
  author={Bhatia, Siddharth and Hooi, Bryan and Yoon, Minji and Shin, Kijung and Faloutsos, Christos},
  journal={arXiv preprint arXiv:1911.04464},
  year={2019}
}
```

## Issues

If you find any problem with the code, please raise an issue.


text:
---
layout: post
title:  'Announcing Openpanel as our gold Sponsor!'
date:   2019-07-18
categories: python pydata conference sponsor gold
permalink: /openpanel_gold_sponsor/
---

**Date**: 18 July 2019

We are proud to announce [**Openpanel**](https://www.onepanel.io) as our **Gold Sponsor** for PyData Delhi 2019!

Each year, PyData Delhi brings together an audience of more than 450 data science scientists, programmers, and professionals at a single platform: The PyData Delhi Conference. This flagship conference is proudly supported by a set of incredible sponsors who share equal credit in making this event a huge success.

OnePanel is an open and extensible platform for building, training and deploying reproducible deep learning applications at scale.
A Kubernetes based platform, OnePanel’s pre-built environments are loaded with familiar open-source tools and can scale to many instances for training complex models.

We deeply value their contribution in helping us organise this conference and thank them for their support in sustaining the stature of this marque conference!

Written by [**Harshita Diddee**](https://www.linkedin.com/in/harshita-diddee/) and [**Mayank Singh**](https://www.linkedin.com/in/code-monk08/)

-PyData Delhi Team

repository: pydatadelhi/blog

branch_name: refs/heads/gh-pages

gha_language: Ruby

repo_name: pydatadelhi/blog


text:
---
layout: default
---

# 1994-09-07 - Re: AIDs testing and privacy

## Header Data

From<EMAIL_ADDRESS>(Timothy C. May)

To<EMAIL_ADDRESS>(Mike Markley)

Message Hash: 23d7732903fb6f09b7f24d6bb67f9b12e9303fb34b6229c2e6594b45cf4a43ab

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-09-07 23:14:01 UTC

Raw Date: Wed, 7 Sep 94 16:14:01 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Timothy C. May)
Date: Wed, 7 Sep 94 16:14:01 PDT
To<EMAIL_ADDRESS>(Mike Markley)
Subject: Re: AIDs testing and privacy
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Mike Markley wrote:

> What about being denied a job because you have been treated for some
> disease? How about being denied a loan because your medical history has
> a profile that indicates that your life expectancy is shorter than the
> duration of the loan? It seems that the potential for abuse is so great
> that we should not allow such cross referencing.
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There's the rub! While I may not _like_ what people or companies do
with data about me, I generally don't support laws telling them what
they can do, what they can't do, etc.

And such normative laws ("they shouldn't keep such records and hence
we'll outlaw them") won't work in an era of strong crypto and privacy.
In fact, some of us support data havens precisely to have records of,
say, terminal diseases so we'll not lend money to Joe-who-has-AIDS. It
may not be "fair" to Joe, but it's my money. (Same idea as in using
offshore or cryptospatial data havens to bypass the nonsense in the
"Fair Credit Reporting Act" that outlaws the keeping of certain kinds
of facts about credit applicants, such as that they declared
bankruptcy 10 years ago or that they left a string of bad debts in
Germany in the 1970s, etc.)

I won't go into the many issues here, as this is an ideological
digression. Cypherpunks understand that laws won't protect their privacy.

--Tim May

--
..........................................................................
Timothy C. May         | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>     | anonymous networks, digital pseudonyms, zero
408-688-5409           | knowledge, reputations, information markets,
W.A.S.T.E.: Aptos, CA  | black markets, collapse of governments.
Higher Power: 2^859433 | Public Key: PGP and MailSafe available.
"National borders are just speed bumps on the information superhighway."

{% endraw %}
```

## Thread

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

+ Return to "[Adam Shostack <adam@bwh.harvard.edu>](/authors/adam_shostack_adam_at_bwh_harvard_edu_)"
+ Return to "[Chris Hibbert <hibbert@netcom.com>](/authors/chris_hibbert_hibbert_at_netcom_com_)"
+ Return to "[Jim Hart <hart@chaos.bsu.edu>](/authors/jim_hart_hart_at_chaos_bsu_edu_)"
+ Return to "[Michael  Conlen <meconlen@IntNet.net>](/authors/michael_conlen_meconlen_at_intnet_net_)"
+ Return to "[Mike Markley <mmarkley@microsoft.com>](/authors/mike_markley_mmarkley_at_microsoft_com_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1994-09-07 (Wed, 7 Sep 94 14:34:05 PDT) - [Re: AIDs testing and privacy](/archive/1994/09/3e25c09d4470407b6d34a4c79b178b1d63fa0a26a8aca520dbbb9be6f1537d4f) - _Mike Markley<EMAIL_ADDRESS>  + 1994-09-07 (Wed, 7 Sep 94 16:14:01 PDT) - Re: AIDs testing and privacy -<EMAIL_ADDRESS>(Timothy C. May)_
    + 1994-09-08 (Wed, 7 Sep 94 17:02:15 PDT) - [Re: AIDs testing and privacy](/archive/1994/09/11ae621c64c358d59f8fea0bbc24da68f7a3c7399f7f6a76cddd738b89153371) - _Michael  Conlen<EMAIL_ADDRESS>      + 1994-09-08 (Wed, 7 Sep 94 17:38:30 PDT) - [Hiring Blacks](/archive/1994/09/f9229422a29df8a82abaa9f3aa9d50f2e0a5d305f28128c7669038b9770e973e) -<EMAIL_ADDRESS>(Timothy C. May)_
        + 1994-09-08 (Wed, 7 Sep 94 18:51:32 PDT) - [Re: Hiring Blacks](/archive/1994/09/07800a15e7372e6b7f29d25767597a551e87a96a80d3ec7f301fdff9285d0146) - _Michael  Conlen<EMAIL_ADDRESS>    + 1994-09-08 (Thu, 8 Sep 94 00:29:43 PDT) - [Privacy regulations](/archive/1994/09/aed3c25603916719061e4c9ab4be80e3ce9474d7c3dc2dda9dfb145879d04454) - _Jim Hart<EMAIL_ADDRESS>      + 1994-09-08 (Thu, 8 Sep 94 10:42:55 PDT) - [Re: Privacy regulations](/archive/1994/09/700c14424035e8f5b420d491ec04901b92950c276a31f548de939c50c63c5b6b) -<EMAIL_ADDRESS>(Timothy C. May)_
        + 1994-09-08 (Thu, 8 Sep 94 13:04:03 PDT) - [Re: Privacy regulations](/archive/1994/09/46f5deb29cfe35f8d3c17a4d3d3d76ffa2153afe1a2f99b92f72b90a6c5787cd) - _Adam Shostack<EMAIL_ADDRESS>          + 1994-09-09 (Thu, 8 Sep 94 17:00:11 PDT) - [Re: Privacy regulations](/archive/1994/09/989dd7f31550058cd2085b8b914243cad2f7952a2bb8c9906229fd1d753deecf) -<EMAIL_ADDRESS>(Timothy C. May)_
          + 1994-09-09 (Thu, 8 Sep 94 21:03:39 PDT) - [Re: Privacy regulations](/archive/1994/09/627123b58a92861d559bf8a2130afadde718608d44592b89575e8dd85df3ab40) - _Michael  Conlen<EMAIL_ADDRESS>            + 1994-09-11 (Sat, 10 Sep 94 18:23:25 PDT) - [SSNs and Privacy regulations](/archive/1994/09/d276e42da6ddbf8b2c61d99d2912be9f09ca3ed0c435003efc0e3d0ae3a9d902) - _Chris Hibbert<EMAIL_ADDRESS>


text:
---
title: "Using a gender lens to address COVID-19 response in Refugee Settings"
date: 2020-08-04
event_passed: true
series: "covid"
teaser: "A diverse panel of experts from the worlds of international development research and practice will discuss research priorities and possible policy solutions for refugees."
registration_link: https://us02web.zoom.us/webinar/register/WN_I5jjfZmGTjKdqgyG5z1yeg
---

Webinar Video

Title: Using a gender lens to address COVID19 response in Refugee Settings

Date: Tuesday, August 04, 2020

Time: 10:00 AM – 11:30 AM (EDT)

Duration: 1.5 Hours

## Related Materials

[Webinar summaries - Using a gender lens to address COVID-19 response in Refugee Settings (PDF Version)](/resources/seminars/covid-19-gender-lens-refugee-settings.pdf)

## Overview:

COVID-19 has become an unprecedented global crisis. The pandemic and its associated economic crisis have exposed deep structural inequalities around the world, with disproportionate effects on women and girls. This webinar will discuss current issues around COVID-19 and refugee settings. A diverse panel of experts from the worlds of international development research and practice will discuss research priorities and possible policy solutions for refugees.

This is the seventh event in a series of research-to-practice Webinar on the gender dimensions of COVID19 organized by the Women’s Empowerment in Development (WED) Lab at McGill in partnership with the Institute for the Study of International Development and made possible thanks to funding from the Growth and Economic Opportunities for Women (GrOW 2) program, a multi-funder initiative by the Bill & Melinda Gates Foundation, the William and Flora Hewlett Foundation and Canada’s International Development Research Centre.

## Description:

By the end of July 2020, health actors had confirmed more than 16.5 million cases of COVID-19, including more than 653,000 deaths in 213 countries around the world. While these figures are high, they do not adequately depict the gravity of the pandemic. As a result of restricting movement, halting travel, closing business, and disrupting global supply chains, COVID-19 has affected every aspect of human life.

As with other pandemics in recent history, women are particularly vulnerable. COVID-19 has further aggravated structural inequalities that systematically disadvantage women. Given the current challenges, it is important to focus attention on the gender dimensions of COVID-19 and its impact on refugee settings. While refugees are not inherently more susceptible to COVID-19, the conditions in which many refugees live and their difficulty in accessing basic health services leave them highly vulnerable.

## Featuring:

* Rachel Kiddell-Monroe (MSF)
* Jane Linekar (Mixed Migration Centre)
* Celina de Sola (Glasswing)
* Stephanie McBride (WUSC)

repository: WED-Lab/website

gha_language: Vue

gha_license_id: NOASSERTION

repo_name: WED-Lab/website


text:
# Icinga Knowledge Base - IWKB000003

## Short Message

The service cannot be started/modified/added because it is marked for deletion. Re-Installing the Icinga Agent fails and starting it is also not possible.

## Example Exception

The service cannot be started because it is marked for deletion.

## Reason

In some edge cases it can happen that the `icinga2` service is not removed during an upgrade or uninstallation process. The reason for this is that another tool might have a `lock` on the service, preventing Windows from deleting it. For example this could be the `services` window on where you can manage service, like restarting them or a PowerShell instance you used to work with to modify the service itself.

## Solution

The easiest way of course is to simply reboot the system - this will remove any lock on the service and once Windows is rebooted, the service is deleted.

As this solution is how ever not really usable in enterprise environments, the best approach would be to close all windows which could interact with the service or you interacted with. This includes:

* Windows Task Manager
* PowerShell / Cmd instances
* Services.msc
* Visual Studio Code / PowerShell ISE (because of the PowerShell instance)

Once you found the tool locking the service, it will be removed and you can reinstall the Icinga Agent properly.

repository: Icinga/icinga-powershell-framework

gha_language: PowerShell

repo_name: Icinga/icinga-powershell-framework


text:
# Notes on usage

To use this you need to use paraview 5.5 or later

- Load the data file: `data2d.vtu`
- Use the programmable filter with the contents of `interpolate.py`
- Use the tessellate filter and adjust `Chord Error` and
  `Maximum number of Subdivisions` for acceptable output

# License
With the exception of `quadrature.jl` all this software is covered by the
Creative Commons Zero v1.0 Universal


text:
# date-fns upgrade

Support package with helper functions for `date-fns` upgrade from `1.x` to `2.x`

Codemod that will help you apply these helpers automatically located here -
[date-fns-upgrade-codemod](https://github.com/date-fns/date-fns-upgrade-codemod).

## Installation

```bash
npm install @date-fns/upgrade --save
# or with yarn
yarn add @date-fns/upgrade
```

## Usage

### convertTokens

`convertTokens` is a helper function used for 2nd argument of `format` function
to convert date tokens like `YYYY` to new format.
See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg)
for more details.

```diff
+import { convertTokens } from '@date-fns/upgrade/v2'

const formattedDate = format(
  new Date(),
- 'YYYY',
+ convertTokens('YYYY'),
)
```

### legacyParse

<EMAIL_ADDRESS>functions don't accept string as arguments any more (see [CHANGELOG](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md#changed)), `legacyParse` is used to simplify that transition, it uses algorithm from `1.x` to do that. See [this post](https://blog.date-fns.org/post/we-cut-date-fns-v2-minimal-build-size-down-to-300-bytes-and-now-its-the-smallest-date-library-18f2nvh2z0yal) for details on "why" this was done.

```diff
+import { legacyParse } from '@date-fns/upgrade/v2'

const formattedDate = format(
- '2014',
+ legacyParse('2014'),
  'YYYY',
)
```

### legacyParseMap

`legacyParseMap` is used same as `legacyParse` but for arguments that accept arrays.

```diff
+import { legacyParseMap } from '@date-fns/upgrade/v2'

var dateToCompare = new Date(2015, 8, 6)
var datesArray = [
  '2014-01-01',
  '2015-01-01'
]
-var result = closestIndexTo(dateToCompare, datesArray)
+var result = closestIndexTo(dateToCompare, legacyParseMap(datesArray))
```

## License

[MIT © Sasha Koss](https://kossnocorp.mit-license.org/)

repository: date-fns/date-fns-upgrade

gha_language: TypeScript

repo_name: date-fns/date-fns-upgrade


text:
# Deployment with Docker
by Srdjan Grubor

2 unrecognized

---

* Let's start this by covering scaling thresholds first. If your services as a whole can completely fit and run well on a relatively small or medium virtual machine or a bare-metal host and you don't anticipate sudden scaling needs, virtualization on the deployment machines will lead you down the path of pain that really isn't warranted in most cases.

La tua evidenziazione alla posizione 458-460 | Aggiunto in data lunedì 15 luglio 2019 00:36:10

* but just in case you have automated build tooling, adding a version layer that can break the cache whenever you change it makes the container very easy to update.

La tua evidenziazione alla posizione 997-999 | Aggiunto in data martedì 7 luglio 2020 20:40:49

url: https://raw.githubusercontent.com/FrancescoPolitano/francescopolitano.github.io/f2eeef4445c70c7a6f03881c18c901a0db3b6ef3/_highlights/Srdjan Grubor - Deployment with Docker.md


text:
> No longer maintained: Users are encouraged to try
> [TextProto](https://marketplace.visualstudio.com/items?itemName=thejustinwalsh.textproto-grammer)
> instead
> ([relevant thread](https://github.com/thesofakillers/vscode-pbtxt/issues/4)).

# VS Code - Textual Protobuf

[Textual Protobuf](https://medium.com/@nathantnorth/protocol-buffers-text-format-14e0584f70a5)
syntax highlighting for [VS Code](https://code.visualstudio.com/).

Works with `.prototxt` and `.pbtxt` files

This is a very basic VS Code extension that I made because I wanted my `.pbtxt`
files to be colored. Please feel free to contribute via pull requests.

![demo](https://user-images.githubusercontent.com/26286291/82671253-82f08c80-9c79-11ea-918f-20bd3114b8f9.png)

## Acknowledgements

This is simply a port of
[malmaud/atom-pbtxt](https://github.com/malmaud/atom-pbtxt).

repository: thesofakillers/vscode-pbtxt

repo_name: thesofakillers/vscode-pbtxt


text:
## Original Socket Coding [Back](./../socket.md)
- write a new **higher-level** transport protocol based on **IP protocol**

### 1. Create original socket

##### method
```c
int socket(int family, int type, int protocol)
```

##### parameters
- family: AF_INET
- type: SOCK_RAW
- protocol:
	- IPPROTO_ICMP: ICMP數據包
	- IPPROTO_IGMP: IGMP數據包
	- IPPROTO_IP: IP數據包

##### return value
- \>=0: success
- -1: failure

### 2. Set IP options
- set whether automatically fill the IP header

```c
int on = 1;
setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on));
```

- on=0: 由協議自動填充
- on=1: 用戶程序填充

### 3. Bind
- if **IP_HDRINCL** has been set, ```bind()``` takes no effect, and you must fill each IP datagram by yourself
- local bind: ```bind()```
- opposite bind: ```connect()```

### 4. Send or Receive
##### send
- if you has not called ```connect()``` to bind, you must use ```sento()``` or ```sendmsg()```  to send data
- if you has called, then ```write()``` or ```send()``` is allowed to use

##### receive
- data from **UDP** and **TCP** won't be sent to original socket
- receive data from **ICMP**
	- **echo** response
	- **timestamp** response
	- **mask** response
	- ...
	<img src="./ICMP.png">
- receive data from other types of protocols
- receive data which cannot be recognized by the **Kernel**

repository: YYY-TEAM/PersonalWiki

repo_name: YYY-TEAM/PersonalWiki


text:
# Neubot DASH Go client and server

[![GoDoc](https://godoc.org/github.com/neubot/dash?status.svg)](https://godoc.org/github.com/neubot/dash) [![Build Status](https://travis-ci.org/neubot/dash.svg?branch=master)](https://travis-ci.org/neubot/dash) [![Coverage Status](https://coveralls.io/repos/github/neubot/dash/badge.svg?branch=master)](https://coveralls.io/github/neubot/dash?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/neubot/dash)](https://goreportcard.com/report/github.com/neubot/dash)

This repository contains an implementation of Neubot's DASH experiment
client and server, both written in Go.

## Server

The server is meant to be deployed at Measurement Lab. For this reason the
release procedure for the server, described below, uses Docker. Images will
be available as [neubot/dash](https://hub.docker.com/r/neubot/dash).

### Release

```bash
docker push neubot/dash
```

repository: Shyran-Systems/dash

repo_name: Shyran-Systems/dash


text:
# booster-task-list-shared-library

This module is used to list shared libraries of each dependency

本模块用于显示每个依赖项中包含的动态库

## Getting Started

```bash
./gradlew listSharedLibraries
```

gha_language: Kotlin


text:
[![docs](https://img.shields.io/badge/docs-latest-blue)](https://codefree.readthedocs.io/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/codefree)](https://pypi.org/project/codefree/)
[![PyPI](https://img.shields.io/pypi/v/codefree)](https://pypi.org/project/codefree)
[![license](https://img.shields.io/github/license/CharlesPikachu/codefree.svg)](https://github.com/CharlesPikachu/codefree/blob/master/LICENSE)
[![PyPI - Downloads](https://pepy.tech/badge/codefree)](https://pypi.org/project/codefree/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/codefree?style=flat-square)](https://pypi.org/project/codefree/)
[![issue resolution](https://isitmaintained.com/badge/resolution/CharlesPikachu/codefree.svg)](https://github.com/CharlesPikachu/codefree/issues)
[![open issues](https://isitmaintained.com/badge/open/CharlesPikachu/codefree.svg)](https://github.com/CharlesPikachu/codefree/issues)

Documents: https://codefree.readthedocs.io/

# CodeFree
```sh
CodeFree: Make no code a reality.
You can star this repository to keep track of the project if it's helpful for you, thank you for your support.
```

# Support Sources
| Source                 | Official Website of the Source                                   | Core Code                                              | Reference                                                   |
| :----:                 | :----:                                                           | :----:                                                 | :----:                                                      |
| Stackoverflow          | [click](https://stackoverflow.com/)                              | [click](./codefree/sources/stackoverflow.py)           | [click](https://github.com/drathier/stack-overflow-import)  |

# Install

#### Pip install
```sh
run "pip install codefree"
```

#### Source code install
```sh
(1) Offline
Step1: git clone https://github.com/CharlesPikachu/codefree.git
Step2: cd codefree -> run "python setup.py install"
(2) Online
run "pip install git+https://github.com/CharlesPikachu/codefree.git@master"
```

# Quick Start

#### Search Code

```python
from codefree import codefree

engine = codefree.CodeFree(keyword='quick sort')
code = engine(return_code=True)
print(code)
```

#### Execute Code

```python
from codefree import codefree

engine = codefree.CodeFree(keyword='quick sort')
lst = [2, 5, 1, 4, 6, 10, 3]
g = {'lst': lst}
engine(return_code=False, globals=g, following_code='result = quickSort(lst)')
print(g['result'])
```

# Screenshot

![img](./docs/screenshot.gif)

# Projects in Charles_pikachu
- [Games](https://github.com/CharlesPikachu/Games): Create interesting games by pure python.
- [DecryptLogin](https://github.com/CharlesPikachu/DecryptLogin): APIs for loginning some websites by using requests.
- [Musicdl](https://github.com/CharlesPikachu/musicdl): A lightweight music downloader written by pure python.
- [Videodl](https://github.com/CharlesPikachu/videodl): A lightweight video downloader written by pure python.
- [Pytools](https://github.com/CharlesPikachu/pytools): Some useful tools written by pure python.
- [PikachuWeChat](https://github.com/CharlesPikachu/pikachuwechat): Play WeChat with itchat-uos.
- [Pydrawing](https://github.com/CharlesPikachu/pydrawing): Beautify your image or video.
- [ImageCompressor](https://github.com/CharlesPikachu/imagecompressor): Image compressors written by pure python.
- [FreeProxy](https://github.com/CharlesPikachu/freeproxy): Collecting free proxies from internet.
- [Paperdl](https://github.com/CharlesPikachu/paperdl): Search and download paper from specific websites.
- [Sciogovterminal](https://github.com/CharlesPikachu/sciogovterminal): Browse "The State Council Information Office of the People's Republic of China" in the terminal.
- [CodeFree](https://github.com/CharlesPikachu/codefree): Make no code a reality.
- [DeepLearningToys](https://github.com/CharlesPikachu/deeplearningtoys): Some deep learning toys implemented in pytorch.
- [DataAnalysis](https://github.com/CharlesPikachu/dataanalysis): Some data analysis projects in charles_pikachu.
- [Imagedl](https://github.com/CharlesPikachu/imagedl): Search and download images from specific websites.
- [Pytoydl](https://github.com/CharlesPikachu/pytoydl): A toy deep learning framework built upon numpy.
- [NovelDL](https://github.com/CharlesPikachu/noveldl): Search and download novels from some specific websites.

# More
#### WeChat Official Accounts
*Charles_pikachu*
![img](./docs/pikachu.jpg)

repository: CharlesPikachu/codefree

repo_name: CharlesPikachu/codefree


text:
---
title: 'cdcam: Cambridge Digital Communications Assessment Model'
tags:
  - python
  - mobile telecommunications
  - technoeconomic
  - simulation
  - 5G
authors:
  - name: Edward J Oughton
    orcid: 0000-0002-2766-008X
    affiliation:  "1, 2"
  - name: Tom Russell
    orcid: 0000-0002-0081-400X
    affiliation: 1
affiliations:
  - name: Environmental Change Institute, University of Oxford
    index: 1
  - name: Computer Laboratory, University of Cambridge
    index: 2
date: 15 October 2019
bibliography: paper.bib
---

# Summary

Digital connectivity is an essential infrastructure service, as more and more people and machines are connected to the internet. Mobile internet access is one of the cheapest ways to connect wirelessly, and  new technologies (particularly 5G) can offer access speeds which can rival fixed broadband connections. Successive generations of mobile telecommunication technologies (3G-5G) have increased data transmission rates and reduced latency. However, user-generated data traffic has been growing exponentially over the past decade which is concerning for both mobile network operators and policy decision-makers, with future growth forecasts indicating this trend is likely to continue [@Oughton:2018a].

The Cambridge Digital Communications Assessment Model (``cdcam``), is a decision-support model which quantifies the performance of digital infrastructure strategies for mobile digital communications. ``cdcam`` models the performance of 4G and 5G technologies as they roll-out over space and time, given a set of exogenous population and data growth scenarios, and potential deployment strategies.

![Framework for capacity/demand/strategy assessment](cdcam-framework.png)

The simulation approach can be used nationally, or for a specific sub-regional area. The same decision-support modelling approach is taken as in the field of telecommunication regulation, where the Long-Run Incremental Cost is estimated for a representative hypothetical mobile network operator.

## Statement of Need

Every decade a new generation of cellular technology is standardised and released. Increasingly, given the importance of the Internet of Things, Industry 4.0 and Smart Health applications, both governments and other digital ecosystem actors want to understand the costs associated with digital connectivity. However, there are very few open-source tools to help simultaneously understand both the engineering and cost implications of new connectivity technologies such as 5G. Hence, there is a key research need for this software.

Governments currently have a strong interest in 5G, with many making it a cornerstone of their industrial strategy. But there remain many coverage issues associated with basic 2G-4G mobile connectivity, particularly in rural areas. Market-led deployment approaches have many benefits, but as the delivery of connectivity in low population density areas becomes less viable, the market will at some point fail to deliver the infrastructure to support these necessary services. Software tools can help to provide the evidence base for policy and government to develop effective strategies to address this issue.

Additionally, while many large mobile network operators have their own in-house technoeconomic network planning capabilities, smaller operators do not. As a result, engineering analysis and business case assessment often take place as separate steps, rather than as an integrated process. This is another key use case for ``cdcam`` as engineers and business analysts at smaller operators could use the software to assess the costs of delivering connectivity to target areas.

## Uniqueness

The software is unique because unlike the industry-standard Long-Run Incremental Cost modelling approach, which is predominantly spreadsheet-based, the ``cdcam`` explicitly models the spatio-temporal roll-out of a new generation of cellular technology (e.g. 5G roll-out).

Such a framework allows users to explore how different infrastructure strategies based on heterogeneous technologies perform in terms of the capacity provided, the degree of population coverage, and the necessary investment costs.

## Spatial Units

Three types of spatial units are used in the model, including sites (points), lower layer statistical units, treated here as postcode sectors (polygons), and upper layer statistical units, treated here as local authority districts (polygons). The justification for using two layers of polygon statistical units is that it allows local areas to be upgraded using a high level of spatial granularity (n=9000), but then provides a level of aggregation for reporting results in a more manageable way (n=380).

## Technologies and Deployment Strategies

There are three main ways to enhance the capacity and coverage of a wireless network: improving the spectral efficiency; adding more spectrum; and building more sites.

An analogy with a highway can be a useful way to explain these techniques. Improving the spectral efficiency enables you to fit more bits per Hertz on a radio wave, which is analogous to more vehicles per lane on a highway. Adding more spectrum provides you with more lanes on the highway, in which to fit more vehicles. Finally, building more sites can enable greater spatial reuse of existing spectrum, which is analogous to increasing the density of roads in an area, reducing the level of congestion.

``cdcam`` is capable of testing all three technology options by: upgrading sites to 4G, or from 4G to 5G, hence improving spectral efficiency; adding more spectrum bands, for either 4G (0.8 and 2.6 GHz), or 5G (0.7, 3.5, 26 GHz); and building more sites (a Small Cell layer).

Each of these technology options is then grouped into a set of strategies, including: No Investment, Spectrum Integration, Small Cells, Spectrum integration and Small Cells (hybrid).

## Cellular capacity estimation

A common way to estimate the system capacity of a cellular network is via stochastic geometry methods. In this model we make use of another open-source Python library with stochastic geometry capabilities, the Python Simulator for Integrated Modelling of 5G, ``pysim5G`` [@Oughton:2019b]. Using ``pysim5G``, a capacity lookup table is generated using a set of simulations for each frequency band, for inter-site distances ranging from 400m to 30km. This lookup table is provided with the ``cdcam`` release in the data folder.

## Applications

``cdcam`` has already been used to test the capacity, coverage and cost of 5G infrastructure in Britain [@Oughton:2018a; @Oughton:2018b] and the Netherlands [@Oughton:2019a].

The model is one of several infrastructure simulation models being used in ongoing research as part of the ITRC Mistral project to analyse national infrastructure systems-of-systems, using scenarios of population change generated by ``simim`` [@simim] and connected by a simulation model coupling library, ``smif`` [@smif].

## Acknowledgements

We would like to acknowledge the funding which has enabled development of cdcam, from the EPSRC via (i) the Infrastructure Transitions Research Consortium Mistral project (EP/N017064/1) and (ii) the EPSRC-funded Researcher in Residence programme at the UK's Digital Catapult.

# References

repository: nismod/cdcam

gha_language: Python

repo_name: nismod/cdcam


text:
---
title: Toad in the Hole
layout: default
---

* auto-gen TOC:
{:toc}

---

A great meal for an autumnal evening.  Best served with a seriously Porty onion gravy and garden peas!  Rather unhelpfully I never use any measures for the Yorkshire Pudding batter as I tend to do it by feel.

## Ingredients
 - Thick sausages from the butcher
 - Tabasco sauce
 - Olive oil

### Yorkshire Pudding Batter
 - 3 heaped dessert spoons of plain flour
 - 3 eggs
 - salt & pepper
 - chopped up rosemary
 - milk

### Ingredients for the gravy
 - butter
 - 2 or 3 shallots
 - Ruby Port
 - Bisto

## Utensils
 - a hand held blender.  This is a must have for anyone wanting to make good Yorkshire Puddings as it aerates the mix and helps the flour mix in.

## How to make the Yorkshire Pudding batter
1. Put the flour, osemary salt and pepper in a decent sized measuring jug
1. Crack the eggs in to the flour mix and with a fork beat the eggs into the flour.  It should end up in a stodgy mix with the flour and eggs well mixed.
1.
1. Use the blender until its really really well mixed with no lumps of flour in there.
1. Now add more milk until its the consistency of a thin milkshake
1. Put aside for at least an hour

## Making the Toad in the Hole
1. Put the sausages in a roasting tray, splatter with tabasco and olive oil and shake them about until they are really covered
1. Put into the top of a hot oven (200c) and bake for about 30 mins stirring a few times
1. After 30 minutes turn up the heat to 225c and let it heat up
1. Add the Yorkshire Pudding batter quickly and shut the door
1. Bake for 20 to 25 minutes until golden brown
1. Serve with fresh vegatables and onion gravy.

## Making the Porty onion gravy
1. Drop a decent sized knob of butter in a saucepan and heat well
1. Add in thinly sliced shallots and cook them until they soften
1. As they cook add small slots of port to stop it burning
1. If you can be bothered make fresh gravy do so: I just use Bisto as its good enough
1. Add a good dose of port to your taste ... i add a layout
1. Reduce so you burn off the alcohol and thicken to a gloopy gravy


text:
# Azure functions (Private Beta)

Function used to forward Azure logs, including Activity and Diagnostic logs from EventHub.
This is currently in Private beta, instructions and code are subject to modifications.

# Quick Start

The provided NodeJs script must be deployed into your Azure Functions service. We will explain how in this step-by-step tutorial.

## 1. Create a new EventHub triggered function

- Expand your function app and click the + button next to Functions. If this is the first function in your function app, select Custom function. This displays the complete set of function templates.
- In the search field type `Event Hub` and choose `Event Hub Trigger`
- Select the `Javascript` language in the right menu
- Enter a name for the function
- Add the wanted `Event Hub connection` or create a new one if you haven't have one already
- Select the `Event Hub consumer group` and the `Event Hub Name` you want to pull logs from

## 2. Provide the code

- Copy paste the code of the function
- In the `Integrate` part, make sure the `Event Hub Cardinality` is set to `Many`

## Parameters

- **API KEY**:

There are 2 possibilities to set your Datadog's API key (available in your Datadog platform):

1. Replace `<your-api-key>` in the code with the API Key value
2. Set the value through the `DD_API_KEY` environment variable

- **Custom Tags**:

You have two options to add custom tags to your logs (tags must be a comma-separated list of strings):

- Manually by editing the function code to add the tag list to the variable `DD_TAGS`
- Automatically with the `DD_TAGS` environment variable


text:
# BIT Web UI

This is the framework's user interface, which allows users to interact with the system in order to see its status, as well as look up reports from the different bit-clients.

The web app was created using `create-react-app` and is written in Typescript & React.
The base components were built using Material-UI and Axios was used for API calls to the server.

## Installation
In order to run the app you'll need `node` and `npm` installed on your machine.
First run `npm install` and then to start the app use `npm start` as usual.

repository: edendoron/bit-framework

gha_language: Go

repo_name: edendoron/bit-framework


text:
The Alice begins the connection process by creating a one time use PIN authentication code
on her administration device. The PIN creation request specifies the rights to be granted
to the connecting device:

~~~~
<div="terminal">
<cmd>Alice> account pin /threshold
<rsp>PIN=ABQR-GO5I-FPIE-TK5O-M4VU-DALE-WM
 (Expires=2021-10-26T15:49:02Z)
</div>
~~~~

A connection request is made on the connecting device as before except that this time
the PIN is specified. This time, only the 'threshold' right is granted.

~~~~
<div="terminal">
<cmd>Alice3> device request<EMAIL_ADDRESS>/pin ^
    ABQR-GO5I-FPIE-TK5O-M4VU-DALE-WM
<rsp>   Device UDF = MCVN-XLLT-LLNW-U4HR-BOMG-RA6Z-UWRR
   Witness value = 2WZP-KNZF-JMKO-RQSU-WYTH-UU35-NWXV
</div>
~~~~

Since the connection request is pre-authenticated by the PIN, it is not necessary for
Alice to review the connection request. The connection request is accepted
automatically when the administration device is synchronized:

~~~~
<div="terminal">
<cmd>Alice> message pending
<rsp>MessageID: 2WZP-KNZF-JMKO-RQSU-WYTH-UU35-NWXV
        Connection Request::
        MessageID: 2WZP-KNZF-JMKO-RQSU-WYTH-UU35-NWXV
        To:  From:
        Device:  MCVN-XLLT-LLNW-U4HR-BOMG-RA6Z-UWRR
        Witness: 2WZP-KNZF-JMKO-RQSU-WYTH-UU35-NWXV
MessageID: NCVP-LUEL-F3OI-QOAM-HND2-WG5Z-346D
        Group invitation::
        MessageID: NCVP-LUEL-F3OI-QOAM-HND2-WG5Z-346D
        To<EMAIL_ADDRESS>From<EMAIL_ADDRESS>MessageID: NDAD-KLJY-C5JO-JGXL-VUWG-Y6PP-PSFJ
        Confirmation Request::
        MessageID: NDAD-KLJY-C5JO-JGXL-VUWG-Y6PP-PSFJ
        To<EMAIL_ADDRESS>From<EMAIL_ADDRESS>        Text: start
MessageID: NAP7-MRKY-LGHV-W6C2-IDAX-ELNG-V5NT
        Contact Request::
        MessageID: NAP7-MRKY-LGHV-W6C2-IDAX-ELNG-V5NT
        To<EMAIL_ADDRESS>From<EMAIL_ADDRESS>        PIN: AAIE-IVI5-54XO-5PHG-VE62-FFS7-62GQ
<cmd>Alice> account sync /auto
</div>
~~~~

Alice can now synchronize her newly connected device to her account:

~~~~
<div="terminal">
<cmd>Alice3> device complete
<rsp>   Device UDF = MCVN-XLLT-LLNW-U4HR-BOMG-RA6Z-UWRR
   Account =<EMAIL_ADDRESS>   Account UDF = MB5I-R24M-QXJT-KDBF-XFOA-DGC3-U3AA
<cmd>Alice3> account sync
</div>
~~~~

The Dynamic QRCode connection scheme uses exactly the same mechanism except that instead
of the PIN being presented to Alice in the form of an alphanumeric string, the connection
information is encoded as a URI and presented to the connecting device as a QR code.

The URI corresponding to the connection PIN is:

~~~~
<EMAIL_ADDRESS>~~~~

repository: vijayrkn/Mathematical-Mesh

repo_name: vijayrkn/Mathematical-Mesh