text:
---
title: Unions and Intersection Types
layout: docs
permalink: /docs/handbook/unions-and-intersections.html
oneline: How to use unions and intersection types in TypeScript
handbook: "true"
---

So far, the handbook has covered types which are atomic objects.
However, as you model more types you find yourself looking for tools which let you compose or combine existing types instead of creating them from scratch.

Intersection and Union types are one of the ways in which you can compose types.

## Union Types

Occasionally, you'll run into a library that expects a parameter to be either a `number` or a `string`.
For instance, take the following function:

```ts twoslash
/**
 * Takes a string and adds "padding" to the left.
 * If 'padding' is a string, then 'padding' is appended to the left side.
 * If 'padding' is a number, then that number of spaces is added to the left side.
 */
function padLeft(value: string, padding: any) {
  if (typeof padding === "number") {
    return Array(padding + 1).join(" ") + value;
  }
  if (typeof padding === "string") {
    return padding + value;
  }
  throw new Error(`Expected string or number, got '${typeof padding}'.`);
}

padLeft("Hello world", 4); // returns "    Hello world"
```

The problem with `padLeft` in the above example is that its `padding` parameter is typed as `any`.
That means that we can call it with an argument that's neither a `number` nor a `string`, but TypeScript will be okay with it.

```ts twoslash
declare function padLeft(value: string, padding: any): string;
// ---cut---
// passes at compile time, fails at runtime.
let indentedString = padLeft("Hello world", true);
```

In traditional object-oriented code, we might abstract over the two types by creating a hierarchy of types.
While this is much more explicit, it's also a little bit overkill.
One of the nice things about the original version of `padLeft` was that we were able to just pass in primitives.
That meant that usage was simple and concise.
This new approach also wouldn't help if we were just trying to use a function that already exists elsewhere.

Instead of `any`, we can use a _union type_ for the `padding` parameter:

```ts twoslash
// @errors: 2345
/**
 * Takes a string and adds "padding" to the left.
 * If 'padding' is a string, then 'padding' is appended to the left side.
 * If 'padding' is a number, then that number of spaces is added to the left side.
 */
function padLeft(value: string, padding: string | number) {
  // ...
}

let indentedString = padLeft("Hello world", true);
```

A union type describes a value that can be one of several types.
We use the vertical bar (`|`) to separate each type, so `number | string | boolean` is the type of a value that can be a `number`, a `string`, or a `boolean`.

## Unions with Common Fields

If we have a value that is a union type, we can only access members that are common to all types in the union.

```ts twoslash
// @errors: 2339

interface Bird {
  fly(): void;
  layEggs(): void;
}

interface Fish {
  swim(): void;
  layEggs(): void;
}

declare function getSmallPet(): Fish | Bird;

let pet = getSmallPet();
pet.layEggs();

// Only available in one of the two possible types
pet.swim();
```

Union types can be a bit tricky here, but it just takes a bit of intuition to get used to.
If a value has the type `A | B`, we only know for _certain_ that it has members that both `A` _and_ `B` have.
In this example, `Bird` has a member named `fly`.
We can't be sure whether a variable typed as `Bird | Fish` has a `fly` method.
If the variable is really a `Fish` at runtime, then calling `pet.fly()` will fail.

## Discriminating Unions

A common technique for working with unions is to have a single field which uses literal types which you can use to let TypeScript narrow down the possible current type. For example, we're going to create a union of three types which have a single shared field.

```ts
type NetworkLoadingState = {
  state: "loading";
};

type NetworkFailedState = {
  state: "failed";
  code: number;
};

type NetworkSuccessState = {
  state: "success";
  response: {
    title: string;
    duration: number;
    summary: string;
  };
};

// Create a type which represents only one of the above types
// but you aren't sure which it is yet.
type NetworkState =
  | NetworkLoadingState
  | NetworkFailedState
  | NetworkSuccessState;
```

All of the above types have a field named `state`, and then they also have their own fields:

      NetworkLoadingState
      NetworkFailedState
      NetworkSuccessState

      state
      state
      state

      code
      response

Given the `state` field is common in every type inside `NetworkState` - it is safe for your code to access without an existence check.

With `state` as a literal type, you can compare the value of `state` to the equivalent string and TypeScript will know which type is currently being used.

      NetworkLoadingState
      NetworkFailedState
      NetworkSuccessState

      "loading"
      "failed"
      "success"

In this case, you can use a `switch` statement to narrow down which type is represented at runtime:

```ts twoslash
// @errors: 2339
type NetworkLoadingState = {
  state: "loading";
};

type NetworkFailedState = {
  state: "failed";
  code: number;
};

type NetworkSuccessState = {
  state: "success";
  response: {
    title: string;
    duration: number;
    summary: string;
  };
};
// ---cut---
type NetworkState =
  | NetworkLoadingState
  | NetworkFailedState
  | NetworkSuccessState;

function logger(state: NetworkState): string {
  // Right now TypeScript does not know which of the three
  // potential types state could be.

  // Trying to access a property which isn't shared
  // across all types will raise an error
  state.code;

  // By switching on state, TypeScript can narrow the union
  // down in code flow analysis
  switch (state.state) {
    case "loading":
      return "Downloading...";
    case "failed":
      // The type must be NetworkFailedState here,
      // so accessing the `code` field is safe
      return `Error ${state.code} downloading`;
    case "success":
      return `Downloaded ${state.response.title} - ${state.response.summary}`;
  }
}
```

## Union Exhaustiveness checking

We would like the compiler to tell us when we don't cover all variants of the discriminated union.
For example, if we add `NetworkFromCachedState` to `NetworkState`, we need to update `logger` as well:

```ts twoslash
// @errors: 2366
type NetworkLoadingState = { state: "loading" };
type NetworkFailedState = { state: "failed"; code: number };
type NetworkSuccessState = {
  state: "success";
  response: {
    title: string;
    duration: number;
    summary: string;
  };
};
// ---cut---
type NetworkFromCachedState = {
  state: "from_cache";
  id: string;
  response: NetworkSuccessState["response"];
};

type NetworkState =
  | NetworkLoadingState
  | NetworkFailedState
  | NetworkSuccessState
  | NetworkFromCachedState;

function logger(s: NetworkState) {
  switch (s.state) {
    case "loading":
      return "loading request";
    case "failed":
      return `failed with code ${s.code}`;
    case "success":
      return "got response";
  }
}
```

There are two ways to do this.
The first is to turn on `--strictNullChecks` and specify a return type:

```ts twoslash
// @errors: 2366
type NetworkLoadingState = { state: "loading" };
type NetworkFailedState = { state: "failed"; code: number };
type NetworkSuccessState = { state: "success" };
type NetworkFromCachedState = { state: "from_cache" };

type NetworkState =
  | NetworkLoadingState
  | NetworkFailedState
  | NetworkSuccessState
  | NetworkFromCachedState;

// ---cut---
function logger(s: NetworkState): string {
  switch (s.state) {
    case "loading":
      return "loading request";
    case "failed":
      return `failed with code ${s.code}`;
    case "success":
      return "got response";
  }
}
```

Because the `switch` is no longer exhaustive, TypeScript is aware that the function could sometimes return `undefined`.
If you have an explicit return type `string`, then you will get an error that the return type is actually `string | undefined`.
However, this method is quite subtle and, besides, [`--strictNullChecks`](/tsconfig#strictNullChecks) does not always work with old code.

The second method uses the `never` type that the compiler uses to check for exhaustiveness:

```ts twoslash
// @errors: 2345
type NetworkLoadingState = { state: "loading" };
type NetworkFailedState = { state: "failed"; code: number };
type NetworkSuccessState = { state: "success" };
type NetworkFromCachedState = { state: "from_cache" };

type NetworkState =
  | NetworkLoadingState
  | NetworkFailedState
  | NetworkSuccessState
  | NetworkFromCachedState;
// ---cut---
function assertNever(x: never): never {
  throw new Error("Unexpected object: " + x);
}

function logger(s: NetworkState): string {
  switch (s.state) {
    case "loading":
      return "loading request";
    case "failed":
      return `failed with code ${s.code}`;
    case "success":
      return "got response";
    default:
      return assertNever(s);
  }
}
```

Here, `assertNever` checks that `s` is of type `never` — the type that's left after all other cases have been removed.
If you forget a case, then `s` will have a real type and you will get a type error.
This method requires you to define an extra function, but it's much more obvious when you forget it because the error message includes the missing type name.

## Intersection Types

Intersection types are closely related to union types, but they are used very differently.
An intersection type combines multiple types into one.
This allows you to add together existing types to get a single type that has all the features you need.
For example, `Person & Serializable & Loggable` is a type which is all of `Person` _and_ `Serializable` _and_ `Loggable`.
That means an object of this type will have all members of all three types.

For example, if you had networking requests with consistent error handling then you could separate out the error handling into its own type which is merged with types which correspond to a single response type.

```ts twoslash
interface ErrorHandling {
  success: boolean;
  error?: { message: string };
}

interface ArtworksData {
  artworks: { title: string }[];
}

interface ArtistsData {
  artists: { name: string }[];
}

// These interfaces are composed to have
// consistent error handling, and their own data.

type ArtworksResponse = ArtworksData & ErrorHandling;
type ArtistsResponse = ArtistsData & ErrorHandling;

const handleArtistsResponse = (response: ArtistsResponse) => {
  if (response.error) {
    console.error(response.error.message);
    return;
  }

  console.log(response.artists);
};
```

repository: zyzbroker/typescript-handbook-pdf

gha_language: Shell

repo_name: zyzbroker/typescript-handbook-pdf


text:
# dra-test-driver

This driver implements the controller and a resource kubelet plugin for dynamic
resource allocation. This is done in a single binary to minimize the amount of
boilerplate code. "Real" drivers could also implement both in different
binaries.

## Usage

The driver could get deployed as a Deployment for the controller, with leader
election. A DaemonSet could get used for the kubelet plugin. The controller can
also run as a Kubernetes client outside of a cluster. The same works for the
kubelet plugin when using port forwarding. This is how it is used during
testing.

Valid parameters are key/value string pairs stored in a ConfigMap.
Those get copied into the ResourceClaimStatus with "user_" and "admin_" as
prefix, depending on whether they came from the ResourceClaim or ResourceClass.
They get stored in the `ResourceHandle` field as JSON map by the controller.
The kubelet plugin then sets these attributes as environment variables in each
container that uses the resource.

Resource availability is configurable and can simulate different scenarios:

- Network-attached resources, available on all nodes where the node driver runs, or
  host-local resources, available only on the node whether they were allocated.
- Shared or unshared allocations.
- Unlimited or limited resources. The limit is a simple number of allocations
  per cluster or node.

While the functionality itself is very limited, the code strives to showcase
best practices and supports metrics, leader election, and the same logging
options as Kubernetes.

## Design

The binary itself is a Cobra command with two operations, `controller` and
`kubelet-plugin`. Logging is done with [contextual
logging](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/3077-contextual-logging).

The `k8s.io/dynamic-resource-allocation/controller` package implements the
interaction with ResourceClaims. It is generic and relies on an interface to
implement the actual driver logic. Long-term that part could be split out into
a reusable utility package.

The `k8s.io/dynamic-resource-allocation/kubelet-plugin` package implements the
interaction with kubelet, again relying only on the interface defined for the
kubelet<->dynamic resource allocation plugin interaction.

`app` is the driver itself with a very simple implementation of the interfaces.

## Deployment

### `local-up-cluster.sh`

To try out the feature, build Kubernetes, then in one console run:
```console
RUNTIME_CONFIG="resource.k8s.io/v1alpha2" FEATURE_GATES=DynamicResourceAllocation=true ALLOW_PRIVILEGED=1 ./hack/local-up-cluster.sh -O
```

In another:
```console
go run ./test/e2e/dra/test-driver --feature-gates ContextualLogging=true -v=5 controller
```

In yet another:
```console
sudo mkdir -p /var/run/cdi && sudo chmod a+rwx /var/run/cdi /var/lib/kubelet/plugins_registry
go run ./test/e2e/dra/test-driver --feature-gates ContextualLogging=true -v=5 kubelet-plugin
```

And finally:
```console
$ kubectl create -f test/e2e/dra/test-driver/deploy/example/resourceclass.yaml
resourceclass/example created
$ kubectl create -f test/e2e/dra/test-driver/deploy/example/pod-inline.yaml
configmap/pause-claim-parameters created
pod/pause created

$ kubectl get resourceclaims
NAME             CLASSNAME   ALLOCATIONMODE         STATE                AGE
pause-resource   example     WaitForFirstConsumer   allocated,reserved   19s

$ kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
pause   1/1     Running   0          23s
```

There are also examples for other scenarios (multiple pods, multiple claims).

### multi-node cluster

At this point there are no container images that contain the test driver and
therefore it cannot be deployed on "normal" clusters.

## Prior art

Some of this code was derived from the
[external-resizer](https://github.com/kubernetes-csi/external-resizer/). `controller`
corresponds to the [controller
logic](https://github.com/kubernetes-csi/external-resizer/blob/master/pkg/controller/controller.go),
which in turn is similar to the
[sig-storage-lib-external-provisioner](https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner).

repository: kubernetes/kubernetes

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: kubernetes/kubernetes


text:
# simple-js-slider
It's a simple vanilla js slider

## Example
Your site should already have some markup. Only 1 block with images is enough

```html
<div class="slider">
    <img src="img/1.jpg">
    <img src="img/2.jpg">
    <img src="img/3.jpg">
</div>
```
Then you have to create a slider object.
```javascript
// parent class, images, maxwidth, maxheight, autoslide
let slider = new Slider('.slider', '.slider img', 600, 900, true);
// also you must set images for your buttons
slider.setButtons("img/icons/previous.png", "img/icons/next.png");

// And finally render it
slider.render();
```

## Options
Before rendering, you can also change the transition duration and auto slide frequency (in seconds).
```javascript
slider.options.transitionDuration = 2;
slider.options.autoSlideFrequency = 2;
```

license: MIT


text:
A condenser capsule can withstand high temperatures.
The woman has no clue how long she spent there
and dreams of doing honest farmwork,

surrounded by the stench of living death.

Stripped from past and future, she dwells in the ever-present.
Some time ago the man ripped off the skin of the woman's limbs and tore her body into chunks. He put her stolen bones inside the capacitor to keep [a small amount of energy](https://github.com/the-vtex-files/the-vtex-files.github.io/blob/master/capsule.mp4).

Charged and decharged by the value of resistance, what was it precisely?

"And ye shall know the truth and the truth shall make you free." - John 8:32

is carved in stone in the lobby of the Original Headquarters Building.

The man was asked to unearth the truth, but has the truth asked for it?

His blood frozen from doing duty at the front line

while firestorms rage in full view of the world.

Does the star at the center not deposit enough power?

The apparent sun is the true sun as seen by an observer on the moon.

A compass is is not needed, a [shadow tip](https://www.armystudyguide.com/content/army_board_study_guide_topics/land_navigation_map_reading/field-expedient-methods-of-determining-direction.shtml) will do, maybe one of her bones can tell of which direction the wind is blowing from, he thinks

A fire would be great to get some warmth, black fallout is the worst that can happen, he thinks

Her bones are well dense and elastic, they will oscillate and provoke a superposition of states, he thinks

Waves of Longing to demonstrate the unintelligble truth

![](/images/psychedelic_epiphany-thumb.jpg)

license: Unlicense


text:
# Steam Arguments Launcher

Launches applications through Steam. Arguments passed into the launcher are passed into the configured application.

This is intended for situations where an application is launched from another
environment e.g. a browser, where one has little-to-no control over how it gets
launched and what arguments are passed to it. By replacing the original executable,
this launcher captures the arguments, then launches the game through Steam.

## Use instructions

This launcher should be put in place of the original application, and be configured to launch the
(now renamed) application. Steam should be configured to have a non-steam game set to
this launcher, with "launch options" set to `-steam_game_launch`

The `gameid` of the non-steam game will be used when the configurator asks for
the game id. It can be retrieved by creating a desktop shortcut for the non-steam
game and checking its properties. The `gameid` is the numbers following `steam://rungameid/`

## Configuration options

* application name (`exe_name`): The file name of the renamed application
* steam path (`steam_path`): The path to Steam, e.g. `C:\Program Files (x86)\Steam\Steam.exe`
* game id (`steam_gameid`): The game id of this launcher for the specific application

Additionally, the `debug` option can be turned on by editing the configuration file.
This will display information when the game is launched leave the launch windows open.

The `args` setting is used internally between activating Steam and launching the
actual application. It is automatically set when activating Steam and cleared
when launching the application.

## Further explanation:

Before setting up this launcher, an application may work as follows:

`Browser -> Application w/ launch arguments`

After setting up this launcher, an application will work as follows:

```plain
Browser ->
Launcher w/ launch arguments ->
Launch arguments are written to config file ->
Launcher tells Steam to run launcher (overlay and controller support enabled here) ->
Launcher reads arguments from config file, clears arguments from file ->
Application w/ launch arguments
```

Note that the only reason the launcher runs the game the second time it's ran is because of
the `-steam_game_launch` argument, which tells it that Steam is launching it to play the game
rather than a browser or something else.


text:
# Async JSON

A library for parsing json in parts, avoiding the need to keep the complete document in memory. The parsing works through a statemachine with a state stack for nested arrays and objects.

## ATTENTION

In the current state \" escape sequences are supported but not comfortable replaced like in other parsers.
That means that the user has to expect escape sequencesin string views of the original content.

## TODO:
* provide utilities to optionally convert \u unicode escape symbols and similar
* optimize binary size and performance by improving hsm
* find a better way to parse floats/doubles.
* printing - or rather transformation support

## License

Boost Software License.

## Dependencies

* optional C++ std features like string_view
* hsm: https://github.com/APokorny/hsm (so transitively kvasir mpl and https://github.com/APokorny/tiny_tuple)
* Upcoming setup with fetch content will allow you to just:
```CMake
project(async_json_env LANGUAGES CXX)
cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0048 NEW)
include(FetchContent)
fetchcontent_declare(async_json
    GIT_REPOSITORY https://github.com/APokorny/async_json
    GIT_TAG development)
fetchcontent_makeavailable(async_json)
  ...
```
* previously this was the preferred setup:

```CMake
project(async_json_env LANGUAGES CXX)
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0048 NEW)
set(as_subproject
    kvasir_mpl hsm tiny_tuple)

macro(find_package)
    if(NOT ${ARGV0} IN_LIST as_subproject)
        _find_package(${ARGV})
    endif()
endmacro()

add_subdirectory(mpl)
add_subdirectory(tiny-tuple)
add_subdirectory(hsm)
add_subdirectory(async_json)
```

branch_name: refs/heads/development


text:
* MY PLAN TO TACKLE JQUERY:
  * Find a few great cheat sheets on jQuery to explore and play with on Chameleon site
    Timebox: 30 minutes [was actually an hour...]
  * Resources:
  1. https://oscarotero.com/jquery/
  2. http://makeawebsitehub.com/jquery-mega-cheat-sheet/
  3. http://www.cheat-sheets.org/saved-copy/jQuery-1.5-Visual-Cheat-Sheet.pdf

  *

gha_language: JavaScript


text:
# My personal page and blog - [vikash.me](http://vikash.me)
This code powers my personal website hosted on Google App Engine. I learned a lot about front end development and design while building this. Its fully responsive and build without using any UI framework or library, just using flexbox(which is cool by the way!). It was a great learnin process and I am proud to showcase it here.

## Installation:
1. Clone the repo `git clone https://github.com/codervikash/vikash.git`.
2. Run `npm install` to install npm dependencies.
3. Run `gulp dev` for dev build or `gulp` for prod build. Run `gulp watch` to watch for changes in repo
4. To run server locally `dev_appserver.py app.yaml` or `gcloud app deploy  app.yaml --project <project_name>` to deploy to app engine.

## Tech Stack:
### Platform
* Google App Engine (Google Cloud PaaS)
* Google Cloud Datastore (NoSQL datastore)
* Google Cloud Storage(Blog images and static data)

### Language/Libraries/Tools
* Python (Webapp2)
* SCSS, HTML5(of course!), Gulp(frontend workflow)
* [Scribble](https://github.com/codervikash/scribble) - its a blogging platform developed by me! check it out! :heart_eyes:

## Contributing:
Your contributions are always welcome, please fork thhe repo and send a PR. TO file bug raise a issue or directly contact me on my<EMAIL_ADDRESS>or reach on twitter [@codervikash](https://twitter.com/codervikash)

## Licence:
MIT

gha_license_id: MIT


text:
**NOTE:**
This library will not be maintained any further.  **You probably want to use
the excellent [Arrow](http://crsmithdev.com/arrow/) library.**

> “There should be one—and preferably only one—obvious way to do it.”

In fact, version 0.7 of times has been rewritten to be implemented on top of
Arrow, so it still provides the Times interface, but you'll already be using
Arrow.  You can probably easily replace your times function calls by Arrow
objects.

---

Times
=====

Build status:
[![Build Status](https://travis-ci.org/nvie/times.svg?branch=master)](http://travis-ci.org/nvie/times)
[![Coverage Status](https://img.shields.io/coveralls/nvie/times.svg)](https://coveralls.io/r/nvie/times?branch=master)

Times is a small, minimalistic, Python library for dealing with time
conversions to and from timezones, for once and for all.

Accepting time
--------------

Never work with _local_ times.  Whenever you must accept local time input (e.g.
from a user), convert it to universal time immediately:

```pycon
>>> times.to_universal(local_time, 'Europe/Amsterdam')
datetime.datetime(2012, 2, 1, 10, 31, 45, 781262)
```

The second argument can be a `pytz.timezone` instance, or a timezone string.

If the `local_time` variable already holds timezone info, you _must_ leave out
the source timezone from the call.

To enforce best practices, `times` will never implicitly convert times for you,
even if that would technically be possible.

Date Strings
------------
If you want to accepting datetime representations in string form (for example,
from JSON APIs), you can convert them to universal datetimes easily:

```pycon
>>> import time, times
>>> print times.to_universal('2012-02-03 11:59:03-0500')   # auto-detects source timezone
```

`Times` utilizes the string parsing routines available in [dateutil][1].  Note
that the source timezone is auto-detected from the string.  If the string
contains a timezone offset, you are not allowed to explicitly specify one.

If the string does not contain any timezone offset, you _must_ specify the
source timezone explicitly:

```pycon
>>> print times.to_universal('2012-02-03 11:59:03', 'Europe/Amsterdam')
```

This is the inverse of `times.format()`.

POSIX timestamps
----------------
If you prefer working with UNIX (POSIX) timestamps, you can convert them to
safe datetime representations easily:

```pycon
>>> import time, times
>>> print times.to_universal(time.time())
2012-02-03 11:59:03.588419
```

Note that `to_universal` auto-detects that you give it a UNIX timestamp.

To get the UNIX timestamp representation of a universal datetime, use:

```pycon
>>> print times.to_unix(universal_time)
```

Current time
------------

When you want to record the current time, you can use this convenience method:

```pycon
>>> import times
>>> print times.now()
datetime.datetime(2012, 2, 1, 11, 51, 27, 621491)
```

Presenting times
----------------

To _present_ times to the end user of your software, you should explicitly
format your universal time to your user's local timezone.

```pycon
>>> import times
>>> now = times.now()
>>> print times.format(now, 'CET')
2012-02-01 21:32:10+0100
```

As with the `to_universal` function, the second argument may be either
a timezone instance or a timezone string.

**Note**: It _is_ possible to convert universal times to local times, using
`to_local`).  However, you probably shouldn't do it, unless you want to
`strftime()` the resulting local date multiple times.  In any other case, you
are advised to use `times.format()` directly instead.

[1]: http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2

repository: nvie/times

gha_language: Python

repo_name: nvie/times


text:
---
layout: post
title:  "Yes! My first post"
date:   2015-01-13 16:26:44
categories: update
comments: true
---

Hello! My name is Gustavo Penha, and this is the first post of my blog. I am a computer scientist currently studying at [UFMG][ufmg] who wants to graduate by 2016 :). I am doing this blog as sort of an experiment. I'll post about things such as open-source contributions - which I intend to do this year - and other works from college as well as from scientific initiation that I been doing for about a month.

Moving from myself to another subject, this site is being served by [Jeskyll][jeskyll], which I got to know because of github's trending open-source projects page. I will be completely honest and say that I gave it a try mostly because it's a project written in ruby, and I've been drawed to this programming language since I've got the opportunity to use it.

It was incredibly painless to start my blog using [Jeskyll][jeskyll] and I believe I will keep using it for the near future. I still have to learn more about [Markdown][markdown], which is the way I am styling this text right now. Overall they both seems pretty nice.

What took me the most effort was publishing it in Github pages, I was constantly getting the error below:

>The page build failed with the following error:

>The file `my-site/css/main.scss` contains syntax errors

After some time searching for errors in this file and in github and stackoverflow threads, I realized on this [blog][blogpost] by @egeersoz that my error was using another folder for my blog inside my repository. After moving everything to the root of the repository it started working fine.

To wrap up this post and start this blog I will make a short list of what I expect to be focusing on this blog:

* Computer Science
* Code
* Programming
* Open-source
* Articles
* Tutorials

I think that's all for my first post guys, cya.

[ufmg]:      https://www.ufmg.br/
[jeskyll]:   http://jekyllrb.com/
[markdown]:  https://guides.github.com/features/mastering-markdown/
[blogpost]: http://www.egeersoz.com/jekyll/update/2014/09/06/using-jekyll-and-github-pages-for-blogging.html

repository: roynirmal/compass

repo_name: roynirmal/compass


text:
---
layout: post
title: Blogging With Github Pages
date: 2015-12-22 17:24 -0800
categories: tech
tags: writing,blogging,github,markdown
---

Github Pages + Jekyll + Markdown + Typekit + TextExpander = Bliss.

I'm liking the combo of Jekyll and Github Pages a LOT. Just added Typekit to my site so I can use the excellent [Lato font](http://www.latofonts.com/lato-free-fonts/) by Warsaw-based [type designer Łukasz Dziedzic](https://plus.google.com/106163021290874968147/posts). I may have gone a bit nuts with the Typekit embed code and added it to not just the head.html in my includes directory, but also to all the templates and other pages. Sorry if this causes any issues.

<!-- more -->

Also exploring using redcarpet markdown instead of kramdown so I can use Github-flavored markdown. This is mostly so I can mess around with `inline code`. Wonder if this works with standard syntax highlighting.

Github Markdown test:

```javascript
var s = "JavaScript syntax highlighting";
alert(s);
```

Standard Jekyll Syntax:

{% highlight json %}
var s = "JavaScript syntax highlighting";
alert(s);
{% endhighlight %}

Using the Github Markdown definitely works better - and I can preview the syntax highlighing in the Github web interface too, which is not the case for Jekyll code.

Next up, Disqus integration. Because I know you're all dying to interact with me via my blog.

Then: truncating posts on the front page.

extension: markdown


text:
# Computational Thinking and Data Science

## What is Computational Thinking?

One of the goals of the Callysto project is to "Introduce computational thinking to K-12 students in Canada", so what is computational thinking? Computational thinking involves solving problems by designing questions and processes that can be computed. One way of describing the process of computational thinking is:

1. Decompose - break down the problem into parts
2. Recognize patterns - find trends in the problem
3. Design an algorithm - create a *series of steps* to solve the problem
4. Abstract - remove some specifics to generalize the solution
5. Evaluate - analyze the solution

It's important to notice that there was no mention of "programming" or "coding". Computational thinking within the scope of student learning is generally problem solving or testing in a way that works with technology.

> Thinking like a computer scientist means more than being able to program a computer. It requires thinking at multiple levels of abstraction
> [Wing 2006](https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf)

Computational thinking is an analysis and problem-solving methodology. This is what the Callysto project is incorporating into the K-12 curricula.

Computational thinking can be taught:
- By incorporating it as a problem solving methodology in traditional lesson plans.
- Without any need to see/understand code.
- By defining/analyzing a problem as you may in order to solve the problem using a computational approach.
- By laying out algorithms which start at a problem definition and lead to a solution.
- In subjects other than math and science.

## What is Data Science?

Data science involves obtaining and communicating information from (usually large) sets of observations. This usually involves collecting, cleaning, manipulating, visualizing, and synthesizing data in order to gain insights and inform the decision-making process.

Data science is often about answering questions like:
- What happened (descriptive)
- Why did that happen? (diagnostic)
- What might happen next? (predictive)
- How can we make changes? (prescriptive)

## Summary

When developing Jupyter notebooks for the Callysto project, it may be appropriate to consider "teaching students to code" as a secondary goal. The highest priority is to introduce computational thinking and data science processes within activities or lessons that students would be doing anyway.

- Not all Jupyter notebooks need to teach the students how to code
- Demonstrate thought process while solving the problem
- How are you breaking down/formulating the problem?
    - Why did you choose to do it that way?
    - What methods are you using and why?
- What data are important to finding your solution?
- Which visualizations are you using and why?

The goal of Callysto is to introduce students to the idea of computational thinking and data science within the regular curriculum. We are using Jupyter notebooks because they are designed around the idea of "literate programming", meaning that it is possible to explain not only your code, but the underlying theory, directly in the notebook itself. Jupyter notebooks allow us to break down a problem computationally and explain the solution process.

## External References

To get a better idea of computational thinking the following articles are good starting point:

- [J.M. Wing. 2006. Computational Thinking. Communications of the ACM. Vol. 49, No. 3](https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf).
- [J.M. Wing. 2014. Computational Thinking Benefits Society. Social Issues in Computing blogpost ](http://socialissues.cs.toronto.edu/index.html%3Fp=279.html).

repository: callysto/training-manual-live

gha_language: Jupyter Notebook

repo_name: callysto/training-manual-live


text:
# CS-GO-Dookie-Mod
Drop a steaming hot turdburger on scrubs with this Sourcemod plugin for CS:GO.

Remake of the "Take A Dookie" AMX plugin by PaintLancer for CS 1.6

## Install Instructions
1. Create a dedicated server if you haven't already. [Instructions here.](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)
2. Install SourceMod. [Instructions here.](https://wiki.alliedmods.net/Installing_SourceMod)
3. Download the latest CS:GO Dookie Mod release. [Releases here.](https://github.com/delebota/CS-GO-Dookie-Mod/releases)
4. Extract to desktop and open the CS-GO-Dookie-Mod-X.X folder.
5. Copy all the files and folder into your dedicated server's root folder. (For Example: ...\steamapps\common\CSGO - Dedicated Server\csgo)
6. Overwrite-All if prompted.
7. Restart server.

## CVars
#####These can be changed via the console by an Admin.
- sm\_dlr - Max number of dookies a player can take per round. - Default Value is 5.
- sm\_dsk - Knife kills grant a "super dookie". - Default Value is 1. 1 means enabled, 0 means disabled.
- sm\_dshs - Number of headshots in one round to get a "super dookie". - Default Value is 3.

## Usage Instructions
Type !dookie in the console while near a player's body.

Bind the command for easy access. For example, type **bind t "!dookie"** in the console or add it to your autoexec.cfg

Type !dookie_help in the console for help while in-game.

repository: delebota/CS-GO-Dookie-Mod

repo_name: delebota/CS-GO-Dookie-Mod


text:
---
layout: news_item
title: "Algebra builder"
date: "2015-06-05 19:29:07 -0800"
author: jhyde
categories: ["new features"]
---
<!--
{% comment %}
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}
-->

Calcite's foundation is a comprehensive implementation of relational
algebra (together with transformation rules, cost model, and metadata)
but to create algebra expressions you had to master a complex API.

We're solving this problem by introducing an
[algebra builder]({{ site.apiRoot }}/org/apache/calcite/tools/RelBuilder.html),
a single class with all the methods you need to build any relational
expression.

For example,

{% highlight java %}
final FrameworkConfig config;
final RelBuilder builder = RelBuilder.create(config);
final RelNode node = builder
  .scan("EMP")
  .aggregate(builder.groupKey("DEPTNO"),
      builder.count(false, "C"),
      builder.sum(false, "S", builder.field("SAL")))
  .filter(
      builder.call(SqlStdOperatorTable.GREATER_THAN,
          builder.field("C"),
          builder.literal(10)))
  .build();
System.out.println(RelOptUtil.toString(node));
{% endhighlight %}

creates the algebra

{% highlight text %}
LogicalFilter(condition=[>($1, 10)])
  LogicalAggregate(group=[{7}], C=[COUNT()], S=[SUM($5)])
    LogicalTableScan(table=[[scott, EMP]])
{% endhighlight %}

which is equivalent to the SQL

{% highlight sql %}
SELECT deptno, count(*) AS c, sum(sal) AS s
FROM emp
GROUP BY deptno
HAVING count(*) > 10
{% endhighlight %}

The [algebra builder documentation]({{ site.baseurl }}/docs/algebra.html) describes the
full API and has lots of examples.

We're still working on the algebra builder, but plan to release it
with Calcite 1.4 (see
[[CALCITE-748](https://issues.apache.org/jira/browse/CALCITE-748)]).

The algebra builder will make some existing tasks easier (such as
writing planner rules), but will also enable new things, such as
writing applications directly on top of Calcite, or implementing
non-SQL query languages. These applications and languages will be able
to take advantage of Calcite's existing back-ends (including
Hive-on-Tez, Drill, MongoDB, Splunk, Spark, JDBC data sources) and
extensive set of query-optimization rules.

If you have questions or comments, please post to the
[mailing list]({{ site.baseurl }}/develop).

repository: apache/calcite

branch_name: refs/heads/main

gha_language: Java

repo_name: apache/calcite


text:
# ceN's Coordinate Tracker

## This is a coordinate tracker for New World that uses [Tesseract.js](https://tesseract.projectnaptha.com/) OCR library built with [Node.js](https://nodejs.org) and a Powershell script.

## **This tool does NOT read/write to the games memory.**

## How it works

-   The node application streams your latitude and longitude via a Server Sent Event (SSE).
-   The powershell application takes a screenshot at a specific offset and sends the image bitmap back to node via a MemoryStream

## The flow

1. Node calls the powershell script to capture either lat/lng.
2. Powershell takes the request and captures either lat/lng and sends the image bitmap back to node in a memory stream
3. Node receives the bitmap, and sends it to Tesseract
4. Tesseract does its best to parse the numbers from the image and returns it back to node
5. Node gets the parsed data from Tesseract. If the text is valid, it sends it to clients connected to `http://localhost:3000/events` via an SSE

---

## Resolutions Tested

-   1920x1080

---

## Pre-Reqs

-   [nodev14.18.0 LTS](https://nodejs.org/dist/v14.18.0/node-v14.18.0-x64.msi)

## Running From Source

-   run `npm install`
-   run program from debugger by launching the `Launch Program` task or run `npm start` from powershell. For some reason running npm start from vscode doesnt work right

## Generate an executable (Experimental)

-   run `npm install`
-   run `npm run build`. This will create `server.exe`

## License

-   This project is licensed under the [MIT](./LICENSE.txt) license
-   Tesseract is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license

repository: NaNraptor/newworld-coordinate-tracker

repo_name: NaNraptor/newworld-coordinate-tracker


text:
## ☀ Part 13: App Actions

### 📚 You will learn

- how to organize test code using Page Objects
- how to call into application directly from tests
- benefits of App Actions

+++

## Based on

- 📝 blog [Stop using Page Objects and Start using App Actions](https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/)
- 💻 code [bahmutov/test-todomvc-using-app-actions](https://github.com/bahmutov/test-todomvc-using-app-actions)

+++

## How do we organize our tests?

@ul

- 👍 Cypress allows you to write a lot of E2E tests
- 👎 Cypress allows you to write a LOT of E2E tests
  @ulend

+++

## Let us write a Page Object

- STOP 🛑 `todomvc` app, instead

```sh
npm run start:react
```

Full React TodoMVC implementation with routing.

Note:
We will be running a different implementation of TodoMVC at the same port. So stop previous app server and start the new app from the root folder using the above command.

+++

- find Page Object in `cypress/integration/13-app-actions/todo-page-object.js`
- open `cypress/integration/13-app-actions/using-po-spec.js`

+++

## Todo: write create todos test

use the page object methods

```js
beforeEach(() => {
  // visit the page
})

it('creates 3 todos', () => {
  // create default todos
  // and check that there are 3 of them
})
```

+++

```js
import { todoPage } from '../todo-page-object'

beforeEach(() => {
  todoPage.visit()
})

it('creates 3 todos', () => {
  todoPage.createTodos()
  const todos = todoPage.todos()
  todos.should('have.length', 3)
})
```

Note:
The object-oriented wrapper and imperative style in the code.

+++

## Todo: write toggle test

```js
// cypress/integration/13-app-actions/using-po-spec.js
context('toggles items', () => {
  beforeEach(() => {
    // what should you do before each test?
  })

  it('completes second item', () => {
    // toggle 1 item
    // check class names for all 3 items
  })
})
```

+++

![Toggle test](/slides/13-app-actions/img/toggle.png)

Note:
Our goal is to use todo page instance to create todos, then toggle one of them (again using the page object), then confirm class names like `todoPage.todos(0).should('not.have.class', 'completed')`.

+++

```js
beforeEach(() => {
  todoPage.createTodos()
})
it('completes second item', () => {
  todoPage.toggle(1)
  todoPage.todos(0).should('not.have.class', 'completed')
  todoPage.todos(1).should('have.class', 'completed')
  todoPage.todos(2).should('not.have.class', 'completed')
})
```

+++

You can implement Page Objects using classes, custom commands or simple functions.

+++

## My problems with the Page Object

@ul

- goes through the page DOM (slow)
- adds extra layer of code on top of unstable DOM
- duplicates code already in the app
  @ulend

+++

```
      Tests

-----------------       tight

  Page Objects

~ ~ ~ ~ ~ ~ ~ ~ ~     very loose

    HTML UI

-----------------       tight

Application code
```

+++

## Code overhead

@ul

- What methods do you have in the Page Object?
- What methods do you see in `todomvc-react/js/todoModel.js`?
  @ulend

+++

```js
// app.jsx
var model = new app.TodoModel('react-todos')
if (window.Cypress) {
  window.model = model
}
```

## Todo: access `model` from DevTools console

+++

## Todo: create a todo from DevTools console

and toggle an item

+++

> 💡 Cypress can do anything you can do from the DevTools console

+++

## Todo: start a new file `spec.js`

- gets the `window.model` instance
- invokes `addTodo` to add several todos

**tip:** use [`cy.invoke`](https://on.cypress.io/invoke)

Note:
Look up and improve `addTodo` method in `js/todoModel.js` if necessary

+++

## Todo: write a test for routing

- set up initial todos using app action `addTodo`
- toggle an item or two
- check if each view shows correct number of items

+++

## More tests

Open and run `cypress/integration/13-app-actions/po-full-spec.js`. It has tests for

- adding todos
- editing
- toggling
- routing

+++

Look at the group of tests for "New Todo". They all go through the DOM

Look at the group of tests for "Routing"

```js
context('Routing', function () {
  beforeEach(function () {
    todoPage.createTodos()
  })
  // routing tests
})
```

+++

Most of the Page Object method calls in this spec are to create initial data or change some data (like `toggle`) - same actions as in `todoModel.js`

- Are these tests faster than before? Why?
- Are these tests coupled to the app's model or to the DOM?

+++

## App actions rules

@ul

- when testing feature X - the test goes through UI for feature X
- when testing feature Y - the test uses app action to do X
  @ulend

Note:
You still cover all page features, you just don't cover them multiple times.

+++

## Focused errors

### In `todomvc-react/js/todoItem.jsx`

Comment out line in the render function

```js
onChange={this.props.onToggle}
```

Which tests have failed?

Note:
Only the tests for marking items as completed should fail, because the rest goes through the model to toggle an item.

+++

## 🏁 App actions vs Page Objects

@ul

- Page Objects write an extra layer of code
- App actions are a client of the application's model
- App actions take shortcuts for faster tests
  @ulend

Note:
The extra layer of code in Page Objects is built on top of the DOM and events, which are not machine-linted. This layer also does not benefit the user, and just slows down the tests.


text:
### [CVE-2020-14056](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14056)
![](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

Monsta FTP 2.10.1 or below is prone to a server-side request forgery vulnerability due to insufficient restriction of the web fetch functionality. This allows attackers to read arbitrary local files and interact with arbitrary third-party services.

### POC

#### Reference
- https://github.com/sbaresearch/advisories/tree/public/2019/SBA-ADV-20191203-02_Monsta_FTP_Server-Side_Request_Forgery

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
layout: default
---

# 1996-01-15 - Where to get PGP (short version of FAQ)

## Header Data

From: Michael Paul Johnson<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: eab98a4638532f11a778ba6426e4212c4cd5ea57662263092ee319713bec5986

Message ID: \<Pine.SUN.3.91.960115134823.2645B-100000@netcom6\>

Reply To: _N/A_

UTC Datetime: 1996-01-15 21:50:17 UTC

Raw Date: Mon, 15 Jan 96 13:50:17 PST

## Raw message

```
{% raw  %}From: Michael Paul Johnson<EMAIL_ADDRESS>Date: Mon, 15 Jan 96 13:50:17 PST
To<EMAIL_ADDRESS>Subject: Where to get PGP (short version of FAQ)
Message-ID: <Pine.SUN.3.91.960115134823.2645B-100000@netcom6>
MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

WHERE TO GET PGP FAQ (SHORT VERSION)

Revised 15 January 1996

For questions not covered here, please see alt.security.pgp FAQs at
rtfm.mit.edu.  For the long version of this FAQ, get
ftp://ftp.csn.net/mpj/getpgp.asc or send mail to<EMAIL_ADDRESS>or
point your web browser at http://www.csn.net/~mpj.

 WHAT IS THE LATEST VERSION OF PGP?

 Platform(s)       Latest Version        Distribution File Names
__________________________________________________________________________
|                |                     |                                 |
|DOS, Unix,      | Viacrypt PGP 2.7.1  | disk sets                       |
|Mac, Windows,   |                     |                                 |
|or WinCIM/CSNav |                     |                                 |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Hardware-based  | Viacrypt 2.7.1      | disk sets                       |
|PGP/Token       |                     |                                 |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|DOS, Unix, VAX, | MIT PGP 2.6.2       | pgp262.zip  (DOS + docs)        |
|others          |                     | pgp262s.zip (source)            |
|                |                     | pg262s.zip source on CompuServe |
|                |                     | pgp262s.tar.gz (source)         |
|                |                     | pgp262s.tar.Z (source)          |
|                |                     | pgp262dc.zip (documentation)    |
|                |                     | pg262d.zip (docs on CompuServe) |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Macintosh       | MIT PGP 2.6.2       | MacPGP2.6.2-130v1.hqx           |
|                | Mac version 1.3.0   | m262pgp.hqx (same as above)     |
|                |                     | MacPGP2.6.2-130v1.source.asc    |
|                |                     | m262pgps.asc (same as above)    |
|                | PGPfone 1.0 beta 5  |                                 |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Power Mac       | Zbigniew's "beta"   | Fatmacpgp262b131.sea.hqx        |
|                |                     | f262pgp.hqx (same as above)     |
|                |                     | Fatmacpgp262b131.src.hqx        |
|                |                     | f262pgps.hqx (same as above)    |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Amiga           | PGP 2.6.2 Amiga 1.4 | pgp262-a14-000.lha              |
|                |                     | pgp262-a14-020.lha              |
|                |                     | pgp262-a14-src.lha              |
|                |                     | PGPAmi262is.lha (international) |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Atari           | Atari MIT PGP 2.6.2 | pgp262st.zip                    |
|                | Atari International | pgp262ib.zip                    |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|OS/2            | MIT PGP 2.6.2       | pgp262-os2.zip                  |
|                |                     | on ftp.gibbon.com               |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Non-USA version | PGP 2.6.2i from     | pgp262i.zip  (DOS executable)   |
|to avoid RSAREF | Stale Schumacher,   | pgp262ix.zip (32-bit DOS)       |
|license.        | Kai Uwe Rommel,     | pgp262i-os2.zip (OS/2 exe)      |
|                | Harald Denker, and  | pgp262ib.zip (Atari)            |
|                | Peter Simons        | PGPAmi262is.lha (Amiga)         |
|                |                     | pgp262is.zip (source)           |
|                |                     | pgp262is.tar.gz (Unix source)   |
|                |                     |                                 |
|                | Canadian "mutant"   | MacPGP262ca124.exe.sea.hqx      |
|                | not for USA use     | MacPGP262ca124.src.sea.hqx      |
|________________|_____________________|_________________________________|
|                |                     |                                 |
|Unofficial      | PGP 2.6.2ui         | pgp262iu.zip                    |
|non-USA version | Not for use in the  |                                 |
|fully under Gnu | USA because of      |                                 |
|public license  | probable patent     |                                 |
|(based on 2.3a  | infringement        |                                 |
|code)           | problems.           |                                 |
|________________|_____________________|_________________________________|

WHERE CAN I GET VIACRYPT PGP?

Just call<PHONE_NUMBER> and read them your credit card number and your
address.

WHERE IS PGP ON THE WORLD WIDE WEB?

 * http://web.mit.edu/network/pgp-form.html (U. S. PGP primary distribution
   site)

 * http://web.mit.edu/network/pgpfone (PGP Fone primary distribution site)

 * http://www.ifi.uio.no/~staalesc/PGP/home.html (International PGP
   primary distribution site)

 * http://www.epic.org/privacy/tools.html

 * http://www.csua.berkeley.edu/cypherpunks/home.html

 * http://www.leo.org/archive/os2/crypt/

WHERE CAN I FTP PGP IN NORTH AMERICA?

If you are in the USA or Canada, you can get PGP by following the
instructions in any of:

 * ftp://net-dist.mit.edu/pub/PGP/README

 * ftp://ftp.csn.net/mpj/README.MPJ

 * ftp://miyako.dorm.duke.edu/pub/GETTING_ACCESS

 * ftp://ftp.csua.berkeley.edu/pub/cypherpunks/pgp/

 * ftp://ftp.gibbon.com/pub/pgp/README.PGP

 * ftp://ftp.wimsey.bc.ca/pub/crypto/software/README

WHERE IS PGP ON COMPUSERVE?

GO NCSAFORUM. Follow the instructions there to gain access to Library 12:
Export Controlled.

AOL

It is possible to get PGP from ftp sites with hidden directories
with the following trick:  (1) View the README file with the hidden
directory name in it, then quickly (2) Start a new ftp connection,
specifiying the hidden directory name with the ftp site's address, like
ftp.csn.net/mpj/I_will_not_export/crypto_xxxxxxx (where the xxxxxxx is
replaced with the current character string).

WHAT BULLETIN BOARD SYSTEMS CARRY PGP?

MANY BBS carry PGP. The following carry recent versions of PGP and allow free
downloads of PGP.

<PHONE_NUMBER> Colorado Catacombs BBS, Longmont CO

<PHONE_NUMBER> Computer Virus Research Center (CVRC) BBS, Indianapolis, IN
   Login First Name: PGP  Last Name: USER   Password: PGP

<PHONE_NUMBER> Exec-Net, New York, NY

<PHONE_NUMBER>, Self-Governor Information Resource, El Paso, Texas

WHERE CAN I FTP PGP CLOSE TO ME?

 * DE

ftp://ftp.informatik.uni-hamburg.de/pub/virus/crypt/pgp
ftp://ftp.uni-kl.de/pub/aminet/util/crypt
ftp://ftp.westfalen.de/pd/Atari/Pgp(Atari)

 * ES

ftp://encomix.es/pub/pgp/pgp262i/pgp262i.zip

 * IT

ftp://ftp.dsi.unimi.it/pub/security/crypt/PGP

 * FI

ftp://ftp.funet.fi/pub/crypt

 * NL

ftp://ftp.nl.net/pub/crypto/pgp
ftp.nic.surfnet.nl/surfnet/net-security/encryption/pgp

 * SE

ftp://leif.thep.lu.se

 * UK

ftp://ftp.demon.co.uk/pub/amiga/pgp
ftp://ftp.ox.ac.uk/pub/crypto/pgp

HOW CAN I GET PGP BY EMAIL?

If you have access to email, but not to ftp, send a message saying
"help" to
<EMAIL_ADDRESS><EMAIL_ADDRESS>or<EMAIL_ADDRESS>
 To get pgp 2.6.2i by email:
  Send a message to
<EMAIL_ADDRESS>with your request in the
  Subject: field.

Subject What you will get GET pgp262i.zip MS-DOS executable
(uuencoded) GET pgp262is.zip MS-DOS source code (uuencoded) GET
pgp262is.tar.gz UNIX source code (uuencoded)

For FAQ
information, send e-mail to<EMAIL_ADDRESS>with
    send usenet/news.answers/ftp-list/faq
in the body of the message.

WHAT ARE SOME GOOD PGP BOOKS?
      Protect Your Privacy: A Guide for PGP Users
      by William Stallings
      Prentice Hall PTR
      ISBN 0-13-185596-4
      US $19.95

      PGP: Pretty Good Privacy
      by Simson Garfinkel
      O'Reilly & Associates, Inc.
      ISBN 1-56592-098-8
      US $24.95

      E-Mail Security: How to Keep Your Electronic Mail Private
      "Covers PGP/PEM"
      by Bruce Schneier
      Wiley Publishing

      The Computer Privacy Handbook: A Practical Guide to E-Mail Encryption,
      Data Protection, and PGP Privacy Software
      by Andre Bacard
      Peachpit Press
      ISBN 1-56609-171-3
      US $24.95
<PHONE_NUMBER> or<PHONE_NUMBER>

      THE OFFICIAL PGP USER'S GUIDE
      by Philip R. Zimmerman
      MIT Press
      April 1995 - 216 pp. - paper - US $14.95 - ISBN 0-262-74017-6 ZIMPP

      PGP SOURCE CODE AND INTERNALS
      by Philip R. Zimmerman
      April 1995 - 804 pp. -
      US $55.00 - 0-262-24039-4 ZIMPH

      Ordering information for the last two books:
      Call US Toll Free 1-800-356-0343 or<PHONE_NUMBER>.
      Cite code 5CSC and number 661.
      Allow 4-6 weeks for delivery within North America.
      Allow 8-12 weeks for delivery outside of North America.

      How to Use PGP, 61 pages,  (Pub #121) from the Superior
      Broadcasting Company,
      Box 1533-N, Oil City, PA 16301, phone:<PHONE_NUMBER> (about US
      $10-$13).

WHERE CAN I GET PGP LANGUAGE MODULES?

http://www.ifi.uio.no/~staalesc/PGP/language.html
ftp://ftp.ifi.uio.no/pub/pgp/doc/

IS PGP LEGAL?

Yes.  See ftp://ftp.csn.net/mpj/getpgp.asc for some of the issues.

WHAT IS PHILIP ZIMMERMANN'S LEGAL STATUS?

Philip Zimmermann was under investigation for alleged violation of export
regulations, with a grand jury hearing evidence for about 28 months, ending
11 January 1996. The Federal Government chose not to comment on why it
decided to not prosecute, nor is it likely to.  The Commerce Secretary stated
that he would seek relaxed export controls for cryptographic products, since
studies show that U. S. industry is being harmed by current regulations.
Philip endured some serious threats to his livelihood and freedom, as well as
some very real legal expenses, for the sake of your right to electronic
privacy.

Although there was no direct and open legal battle, there was a lot of behind
the scenes work by Phil's legal team, headed by Philip L. Dubois
(dubois@dubois.com). GREAT JOB!  If you ever are in the situation of needing
a good lawyer to help you with similar Federal harassment, consider yourself
fortunate if Mr. Dubois will take your case.

Philip Zimmermann is breathing more easily these days, still a free man and
able to work to support his family.  The battle is won, but the war is not
over. The regulations that caused him so much grief and which continue to
dampen cryptographic development, harm U. S. industry, and do violence to the
U. S. National Security by eroding the First Ammendment of the U. S.
Constitution and encouraging migration of cryptographic industry outside of
the U. S. A. are still on the books.  If you are a U. S. Citizen, please
write to your U. S. Senators, Congressional Representative, President, and
Vice President pleading for a more sane and fair cryptographic policy.

WHERE CAN I GET WINDOWS & DOS SHELLS FOR PGP?

http://www.ifi.uio.no/~staalesc/AutoPGP.html
http://www.dayton.net/~cwgeib
ftp://oak.oakland.edu/SimTel/msdos/security/apgp22b.zip
ftp://oak.oakland.edu/SimTel/win3/security/pgpw40.zip
http://alpha.netaccess.on.ca/~spowell/crypto/pwf31.zip
ftp://ftp.netcom.com/pub/dc/dcosenza/pgpw40.zip
ftp://Sable.ox.ac.uk/pub
http://www.firstnet.net/~cwgeib/welcom.html
ftp://ftp.netcom.com/pub/ec/ecarp/pgpwind.zip
http://www.eskimo.com/~joelm(Private Idaho)
ftp://ftp.eskimo.com/~joelm
http://www.xs4all.nl/~paulwag/security.htm
http://www.LCS.com/winpgp.html
ftp://mirrors.aol.com/mir01/circa/pub/pc/win3/util/pwf31.zip
ftp://ftp.leo.org/pub/comp/os/os2/crypt/gcppgp10.zip
ftp://ftp.leo.org/pub/comp/os/os2/crypt/pmpgp.zip

WHERE DO I GET PGPfone(tm)?

PGPfone is in beta test for Macintosh users. A Windows 95 version is
being developed.

http://web.mit.edu/network/pgpfone
ftp://net-dist.mit.edu/pub/PGPfone/README
ftp.hacktic.nl/pub/pgp/pgpfone

WHERE DO I GET NAUTILUS?

Bill Dorsey, Pat Mullarky, and Paul Rubin have come out with a program called
Nautilus that enables you to engage in secure voice conversations between
people with multimedia PCs and modems capable of at least 7200 bps (but 14.4
kbps is better). See

ftp://ripem.msu.edu/pub/crypt/GETTING_ACCESS
ftp://ripem.msu.edu/pub/crypt/other/nautilus-phone-0.9.2-source.tar.gz
ftp://ftp.csn.net/mpj/README
ftp://ftp.csn.net/mpj/I_will_not_export/crypto_???????/voice/naut092.zip
ftp://miyako.dorm.duke.edu/pub/GETTING_ACCESS
ftp://miyako.dorm.duke.edu/mpj/crypto/voice/naut092.zip
ftp://ftp.dsi.unimi.it/pub/security/crypt/cypherpunks/nautilus
ftp://ftp.ox.ac.uk/pub/crypto/misc

The Colorado Catacombs BBS<PHONE_NUMBER>

HOW DO I ENCRYPT MY DISK ON-THE-FLY?

Rather than manually encrypting and decrypting files, it is sometimes easier
(and therefore more secure, because you are more likely to use it) to use a
utility that encrypts or decrypts files on the fly as you use them in your
favorite applications. This also allows you to automatically encrypt
temporary files generated by your applications if they are on the encrypted
volume.

http://www.cs.auckland.ac.nz/~pgut01/sfs.html
ftp://ftp.informatik.uni-hamburg.de/pub/virus/crypt/disk/
ftp://ftp.csn.net/mpj/I_will_not_export/crypto_???????/disk/
ftp://ftp.csn.net/mpj/README for the ???????)
ftp://miyako.dorm.duke.edu/mpj/crypto/disk/
ftp://ftp.nic.surfnet.nl/surfnet/net-security/encryption/disk/
ftp://ftp.demon.co.uk/pub/ibmpc/secdev/secdev14.arj

HOW DO I PUBLISH MY PGP PUBLIC KEY?

Send mail to one of these addresses with the single word "help" in the
subject line to find out how to use them. These servers sychronize keys with
each other.

<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
WWW interface to the key servers:
http://www-swiss.ai.mit.edu/~bal/pks-toplev.html

For US $20/year or so, you can have your key officially
certified and published in a "clean" key database that is much less
susceptible to denial-of-service attacks than the other key servers.
Send mail to<EMAIL_ADDRESS>for information, or look at http://www.Four11.com/

CAN I COPY AND REDISTRIBUTE THIS FAQ?

Yes. Permission is granted to distribute unmodified copies of this FAQ.

Please e-mail comments to<EMAIL_ADDRESS>

-----BEGIN PGP SIGNATURE-----
Version: 2.7.1

iQCVAwUBMPoQzfX0zg8FAL9FAQEKUgQAl2nu1KMT1txZV87pgiiSMmuZcHSIyGvY
0maabI+pPg8FjtxJwcrfWjVVgQVyQGSBsh+NC0eQvGpW4DFWt1p7bCaINunBcohn
jf4xdqmejuIy0e52P0+Jgs88Y3UzudYcWnjAXP//fH569ThxlQoJmLiZI/IeKRk+
9pAVQAmPLec=
=YMrS
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [January 1996](/archive/1996/01)

+ Return to "[Michael Paul Johnson <mpj@netcom.com>](/authors/michael_paul_johnson_mpj_at_netcom_com_)"

+ 1996-01-15 (Mon, 15 Jan 96 13:50:17 PST) - Where to get PGP (short version of FAQ) - _Michael Paul Johnson<EMAIL_ADDRESS>


text:
---
layout: default
---

# 1997-09-04 - Re: FBI calls for mandatory key escrow

## Header Data

From<EMAIL_ADDRESS>(Anonymous)

To<EMAIL_ADDRESS>Message Hash: 7c407d48ddaf0808b1434d1f7003b5205d12630d708eb01fdf1a6b84c027a23f

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-09-04 06:00:04 UTC

Raw Date: Thu, 4 Sep 1997 14:00:04 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Anonymous)
Date: Thu, 4 Sep 1997 14:00:04 +0800
To<EMAIL_ADDRESS>Subject: Re: FBI calls for mandatory key escrow
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Tim May wrote:
> Even the weaker form of Freeh's suggestion, that key escrow capabilities be
> forced into all Internet products, even if the use is "voluntary," seems to
> lack constitutional support. Could the Federal Trade Commission force all
> products to have such features? The Consumer Safety Products Commission?
>
> I don't know where the authority for mandatory seat belts and  air bags is
> claimed to come from, either. Or helmet laws in various states.

  The 'authority' comes, as always, from power and money.
  The "Drive 55" mandate is a perfect example of the government stealing
the citizen's money, then giving it back in the form of highway funding,
with the condition that those states who don't give up their right to
decide their own state laws don't get any cash.
  The greedy fucks feeding at the government troughs want to get their
hands on that money _now_, because there is no telling who will be ahead
of them in at the trough by the time the Constitutional issues are
settled.

  The bottom line is that the federal government gets their authority by
virtue of armed robbery, bribery and illegal seizure.
  Who is going to stop them? They have the guns! When our elected
officials
in Congress delved into the INSLAW affair, the Department of Justice
told
them to "Fuck off." and refused to cooperate with those who represent
the
citizens. Congress's reaction was to say, "Yup. They're defying us."
  Ipso facto--Congress is not running the country. The LEA's are running
the country. Go figure...

TruthMonger # -23A(Sub.C)-009

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Anonymous)](/authors/nobody_at_replay_com_anonymous_)"

+ 1997-09-04 (Thu, 4 Sep 1997 14:00:04 +0800) - Re: FBI calls for mandatory key escrow -<EMAIL_ADDRESS>(Anonymous)_


text:
# ZIG

Zig is a simple data format. It is designed to be edited by hand.
It is also pretty easy to parse and generate, though.
You can think of Zig as an alternate, indentation-based
syntax for JSON.

Here is a short example that shows all data structures:

```
{
  type: 'error'
  subtype: nil
  description: "
    Check your Internet connection. Restart any router, modem,
    or other network devices you may be using.
  color: {
    r: 255
    g: 192
    b: 0
  # TODO: do we need these any more?
  flags: [
    true
    false
    true
```

In order of appearance: hash, string, nil, multiline string, number,
comment, list, boolean.

repository: tlossen/zig

repo_name: tlossen/zig


text:
## Version 2.9.0

### Periodic 2.9.0, one step closer.
* fixed assets and primary assets in admin
* cleaned up reader theme, iOS fixes
* updated default content in DBseed
* added core controller support for preview themes
* added support for tags and categories for assets
* added support for environment specific themes
* added custom view engine support
* added new admin

### Notes
* Periodic
 * Added support for pre start up scripts (new relic)
 * Added custom session secret( add to config.json)
 * Added support for custom node modules (add to config.json)
* Extension: Core Controller (2.0.2)
 * preview theme support
* Extension: Preview Theme (1.0.0)
 * environment view html customization support
* Extension: Google Analytics (1.0.0)
 * environment view html customization support
* Extension: Install (2.9.0)
 * environment specific configuration installation
* Extension: Admin (2.9.1)
 * new theme settings, new content editor, support for html augmentation in views


text:
## How to Improve Your Voice
[Reference](https://www.wikihow.com/Improve-Your-Voice)

- Practice breathing into your diaphragm.
- Release your jaw.
- Breathe through a stirring straw.
- Trill your lips.
- Humming.
- Stretch your tongue for better articulation.
- Improve your diction with tongue twisters.
- Saying "hooty gees" to relax your larynx.
- Balance vocal resonance with "ooh-oh-uh-ahs".
- Exercising your voice.

## How to Talk With a Deeper Voice
[Reference](https://www.wikihow.com/Talk-With-a-Deeper-Voice)

- Projecting: speak in front of a mirror.
- Relax your throat, so you don't tighten your vocal chords.
- Perform reading exercises.
- Do vocal exercises with a mobile app.
- Humming.
- Speak through the mouth, not nasally.
- Practice projecting your speaking voice.
- Chin up.
- Swallow before speaking.
- Speak slowly.
- Breathe naturally.

## Develop a Strong He-Man Voice by Using the Voice Nature Gave You
[Reference](https://www.artofmanliness.com/2011/11/13/masculine-voice/)

- Don't try to artificially lower your voice, it damages the vocal cords and no one can understand you.
- Voice must come from the mask, not your nose. Mask = lips, bridge, sides of the nose.
- Breathe from the diaphragm/belly. Belly should be the one expanding, not chest/shoulders.

repository: daryllxd/lifelong-learning

gha_language: Elixir

gha_license_id: Unlicense

repo_name: daryllxd/lifelong-learning


text:
# Image Manipulation with OpenCV and NumPy

In this example, we'll:
- Sharpen an image, using an unsharp mask (also available as a [gist](https://gist.github.com/soroushj/1217c523f6fe3cd3eccfd67337007e02))
- Convert a color image into a grayscale one, using the Y channel of the YCbCr color space (also available as a [gist](https://gist.github.com/soroushj/ce3765e5374bb081f3fdbd8e7f2c2ffa))

repository: soroushj/python-opencv-numpy-example

repo_name: soroushj/python-opencv-numpy-example


text:
# ResizeWindow
Resize an external application's window on Windows OS. It is useful for screen capture.

![Sample](appsample.png)

MIT license.

repository: isshiki/ResizeWindow

repo_name: isshiki/ResizeWindow


text:
# exec

![](../.gitbook/assets/exec.png)

The `in_exec` Input plugin executes external programs to receive or pull event logs. It will then read TSV \(tab-separated values\), JSON or MessagePack from the standard output of the program.

You can run a program periodically or permanently. To run periodically, please use the `run_interval` parameter.

It is included in Fluentd's core.

## Example Configuration

```text
<source>
  @type exec
  command cmd arg arg
  <parse>
    keys k1,k2,k3
  </parse>
  <extract>
    tag_key k1
    time_key k2
    time_format %Y-%m-%d %H:%M:%S
  </extract>
  run_interval 10s
</source>
```

Refer to the [Configuration File](../configuration/config-file.md) article for the basic structure and syntax of the configuration file.

## Plugin Helpers

* [`compat_parameters`](../plugin-helper-overview/api-plugin-helper-compat_parameters.md)
* [`extract`](../plugin-helper-overview/api-plugin-helper-extract.md)
* [`parser`](../plugin-helper-overview/api-plugin-helper-parser.md)
* [`child_process`](../plugin-helper-overview/api-plugin-helper-child_process.md)

## Parameters

See [Common Parameters](../configuration/plugin-common-parameters.md).

### `@type`

The value must be `exec`.

### `command`

| type | default | version |
| :--- | :--- | :--- |
| string | required parameter | 0.14.0 |

The command \(program\) to execute.

### `tag`

| type | default | version |
| :--- | :--- | :--- |
| string | required if `extract`/`tag_key` is not specified | 0.14.0 |

The tag of the output events.

### `run_interval`

| type | default | version |
| :--- | :--- | :--- |
| time | nil | 0.14.0 |

The interval time between periodic program runs. If not specified, command script runs only once.

### `read_block_size`

| type | default | version |
| :--- | :--- | :--- |
| size | 10240 | 0.14.9 |

The default block size to read if parser requires partial read.

### `connect_mode`

| type | default | available values | version |
| :--- | :--- | :--- | :--- |
| enum | `read` | `read`/`read_with_stderr` | 1.11.3 |

Control target IO:

* `read`: Read logs from stdio
* `read_with_stderr`: Read logs from stdio and stderr.

`read_with_stderr` is mainly for debug.

### `<parse>` section

| required | multi | version |
| :--- | :--- | :--- |
| false | false | 0.14.9 |

Refer these for more details about `parse` section:

* [Parser Plugin Overview](../parser/)
* [Parse Section Configuration](../configuration/parse-section.md)

#### `@type`

| type | default | version |
| :--- | :--- | :--- |
| string | tsv | 0.14.9 |

Overwrites the default value in this plugin.

#### `time_type`

| type | default | version |
| :--- | :--- | :--- |
| string | float | 0.14.9 |

Overwrites the default value in this plugin.

#### `time_key`

| type | default | version |
| :--- | :--- | :--- |
| string | nil | 0.14.9 |

Overwrites the default value in this plugin.

#### `estimate_current_event`

| type | default | version |
| :--- | :--- | :--- |
| bool | false | 0.14.9 |

Overwrites the default value in this plugin.

### `<extract>` Section

| required | multi | version |
| :--- | :--- | :--- |
| false | false | 0.14.9 |

See [Extract section configurations](../configuration/extract-section.md).

#### `time_type`

| type | default | version |
| :--- | :--- | :--- |
| string | float | 0.14.9 |

Overwrites the default value in this plugin.

## Use Cases

### Monitor Load Averages

Here is a simple example to fetch load average stats on Linux systems. This configuration instructs Fluentd to read `/proc/loadavg` once per minute and emit the file content as events.

```text
<source>
  @type exec
  tag system.loadavg
  command cat /proc/loadavg | cut -d ' ' -f 1,2,3
  run_interval 1m
  <parse>
    @type tsv
    keys avg1,avg5,avg15
    delimiter " "
  </parse>
</source>
```

This configuration emits events like this one:

```text
2018-06-29 17:27:35.115878527 +0900 system.loadavg: {"avg1":"0.30","avg5":"0.20","avg15":"0.05"}
```

### Real World Example: Scrape Hacker News Top Page

If you already have a script that runs periodically \(say, via `cron`\) that you wish to store the output to multiple backend systems \(HDFS, AWS, Elasticsearch, etc.\), `in_exec` is a great choice.

The only requirement for the script is that it outputs TSV, JSON or MessagePack.

For example, this [script](https://gist.github.com/kiyoto/1bd903ad1bdd6ac51fcc) scrapes the front page of [Hacker News](http://news.ycombinator.com) and scrapes information about each post:

Suppose that script is called `hn.rb`. Then, you can run it every 5 minutes with the following configuration:

```text
<source>
  @type exec
  <parse>
    @type json
  </parse>
  tag hackernews
  command ruby /path/to/hn.rb
  run_interval 5m # don't hit HN too frequently!
</source>
<match hackernews>
  @type stdout
</match>
```

And if you run Fluentd with it, you will see the following output \(if you are impatient, `CTRL+C` to flush the stdout buffer\):

```text
2017-12-08 14:19:33.160567411 +0900 hackernews: {"time":1512710373,"rank":1,"title":"Japan eyes startup visa program","points":160,"user_name":"benguild","duration":"4 hours ago  ","num_comments":0,"unique_id":"item?id=15875627","hiring_notice":false}
2017-12-08 14:19:33.160735378 +0900 hackernews: {"time":1512710373,"rank":2,"title":"Bookbinding: A Tutorial","points":46,"user_name":"jstrieb","duration":"2 hours ago  ","num_comments":0,"unique_id":"item?id=15876260","hiring_notice":false}
2017-12-08 14:19:33.160769125 +0900 hackernews: {"time":1512710373,"rank":3,"title":"My Quadriplegic Husband and Me","points":92,"user_name":"mooreds","duration":"4 hours ago  ","num_comments":0,"unique_id":"item?id=15875772","hiring_notice":false}
2017-12-08 14:19:33.160799115 +0900 hackernews: {"time":1512710373,"rank":4,"title":"Wall Street banks hit pause button on Bitcoin","points":16,"user_name":"tadasv","duration":"1 hour ago  ","num_comments":0,"unique_id":"item?id=15876497","hiring_notice":false}
2017-12-08 14:19:33.160824386 +0900 hackernews: {"time":1512710373,"rank":5,"title":"A Spectator Who Threw a Wrench in the Waymo/Uber Lawsuit","points":107,"user_name":"kynthelig","duration":"4 hours ago  ","num_comments":0,"unique_id":"item?id=15875685","hiring_notice":false}
```

Of course, you can use Fluentd's many output plugins to store the data into various backend systems like [Elasticsearch](../how-to-guides/free-alternative-to-splunk-by-fluentd.md), [HDFS](../how-to-guides/http-to-hdfs.md), [MongoDB](../how-to-guides/apache-to-mongodb.md), [AWS](../how-to-guides/apache-to-s3.md), etc.

If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.

repository: fluent/fluentd-docs-gitbook

repo_name: fluent/fluentd-docs-gitbook


text:
# embLua
The aim of embLua (includes the complete Lua 5.3.4 core) is to provide C/C++ developers the possibility to extend their microcontroller/embedded device with scripting functionality.
The main focus of embLua is the fast/easy integration in custom projects and new platforms. Therefore only a subset of Lua modules and global functions are available:
- table module
- string module
- math module
- global functions: assert, collectgarbage, error, getmetatable, ipairs, next, pairs, pcall, print, rawequal, rawlen, rawget, rawset, select, setmetatable, tonumber, tostring, type, xpcall, loadstring, load

Note: The math module is only included if the define LUA_WITH_MATH is defined in luaProjectConfig.h.

## embLua requirements
To run scripts which do something 'meaningful' embLua needs:
- RAM: 1k Stack, 11k Heap
- ROM (not optimized code): 120 on MSP430, 90k on Renesas
- C-Library

## Integrating embLua
To integrate embLua in a custom project:
- copy the source files embLua/lua into your project
- create the embLua config file luaInterface.h (an example can be found under embLua/examples/MSP430F6747A_FreeRTOS/luaProject)

### luaProjectConfig.h
This file is used to configure embLua (an example can be found under embLua/examples/MSP430F6747A_FreeRTOS/luaProject).

#### Memory management
embLua can be configured to use the build in memory management functions (embLua/lua/helper/luaHeap.c) or to use project specific memory functions. To configure the memory management following defines are used:

- LUA_HEAP_SIZE: The heap size if the build in memory management shall be used
- LUA_MEM_ENTER_CRITICAL_SECTION and LUA_MEM_LEAVE_CRITICAL_SECTION: These defines are used protect the memory management calls if several Lua instance in different tasks are created
- DONT_USE_LUA_HEAP_MANAGEMENT_FUNCTIONS: If the build in memory function shall not be used then this define must be set.
- luaMallocFunction(size) and luaFreeFunction(pointer): These defines must be set if the build in memory management shall not be used (*DONT_USE_LUA_HEAP_MANAGEMENT_FUNCTIONS*)

#### Other configuration options
- luaPointerSize_t: If the size of size_t is not the pointer size on the current platform then this define must be set (example: on the MSP430 the pointer size is 32Bit but size_t is only 16Bit)
- LUA_DECIMAL_POINT: The "radix character" (decimal point) used by Lua is per default '.'. With this define this character can be changed.
- LUA_WITH_MATH: If the math module shall be included then this define must be set.
- WITH_PRECOMPILED_SCRIPTS: If Lua shall execute precompiled script (luac.exe) then this define must be set.

## Embedding lua scripts
To execute a Lua script the function dostring (embLua/lua/helper/luaHelper.c) can be used. This function can execute scipts wich resides in the RAM or in the ROM.

### Compiling a Lua script into ROM
For this purpose embLua/lua/convertToHeader.lua can be used. This script converts a Lua script into a header file. To run this script the header file must be included and dofile with the name of the header file must be called (an example can be found in embLua/examples/MSP430F6747A_FreeRTOS/main.c).

Under embLua/examples/MSP430F6747A_FreeRTOS/luaProject/Scripts a batch file can be found (convertToHeader.bat) which shows the usage of convertToHeader.lua.

## Extending embLua
To extend embLua with custom module/functions the define LUA_INTERFACE_LIBS can be used. An example can be found under embLua/examples/MSP430F6747A_FreeRTOS/luaProject/luaInterface.h

repository: szieke/embLua

repo_name: szieke/embLua


text:
# Zero BTC Screen

Bitcoin (or any other currency) stock price for your RPi Zero

![display](display_1.jpeg)
![display](display_2.jpeg)

## Hardware

### Platform

* Raspberry Pi Zero W (or any other RPi)

### Screens

* Waveshare eInk displays: epd2in13v2, epd2in13bv3
* inkyWhat (Red, Black, White)
* Virtual (picture)

## Installation

1. Turn on SPI via `sudo raspi-config`
    ```
    Interfacing Options -> SPI
   ```
2. Install dependencies
    ```
    sudo apt update
    sudo apt-get install python3-pip python3-pil python3-numpy
    pip3 install RPi.GPIO spidev
    ```

3. Install drivers for your display
    1. Waveshare display
    ```
    git clone https://github.com/waveshare/e-Paper.git ~/e-Paper
    pip3 install ~/e-Paper/RaspberryPi_JetsonNano/python/
    ```
   for more information refer to: https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
    2. Inky wHAT display
    ```
    pip3 install inky[rpi]
    ```
4. Download Zero BTC Screen
    ```
    git clone https://github.com/dr-mod/zero-btc-screen.git ~/zero-btc-screen
    ```
5. Run it
    ```
    python3 ~/zero-btc-screen/main.py
    ```

## Screen configuration

The application supports multiple types of e-ink screens, and an additional "picture" screen.

To configure which display(s) to use, configuration.cfg should be modified. In the following example an e-ink epd2in13v2
and "picture" screens are select:

```cfg
[base]
console_logs             : false
#logs_file               : /tmp/zero-btc-screen.log
dummy_data               : false
refresh_interval_minutes : 15
currency                 : BTC

# Enabled screens or devices
screens : [
    epd2in13v2
#    epd2in13bv3
    picture
#    inkyWhatRBW
  ]

# Configuration per screen
# This doesn't make any effect if screens are not enabled above
[epd2in13v2]
mode : candle

[epd2in13bv3]
mode  : line

[picture]
filename : /home/pi/output.png

[inkyWhatRBW]
mode : candle
```

### Autostart

To make it run on startup you can choose from 2 options:

1. Using the rc.local file
    1. `sudo nano /etc/rc.local`
    2. Add one the following before `exit 0`
   ```
   /usr/bin/python3 /home/pi/zero-btc-screen/main.py &
   ```
   conversely, you can run in `screen` you can install it with `sudo apt-get install screen`
   ```
   su - pi -c "/usr/bin/screen -dm sh -c '/usr/bin/python3 /home/pi/zero-btc-screen/main.py'"
   ```
2. Using the system's services daemon
    1. Create a new service configuration file
       ```
        sudo nano /etc/systemd/system/btc-screen.service
        ```
    2. Copy and paste the following into the service configuration file and change any settings to match your
       environment
       ```
        [Unit]
        Description=zero-btc-screen
        After=network.target

        [Service]
        ExecStart=/usr/bin/python3 -u main.py
        WorkingDirectory=/home/pi/zero-btc-screen
        StandardOutput=inherit
        StandardError=inherit
        Restart=always
        User=pi

        [Install]
        WantedBy=multi-user.target
        ```
    3. Enable the service so that it starts whenever the RPi is rebooted
       ```
        sudo systemctl enable btc-screen.service
       ```
    4. Start the service and enjoy!
       ```
        sudo systemctl start btc-screen.service
       ```

       If you need to troubleshoot you can use the logging configurations of this program (mentioned below).
       Alternatively, you can check to see if there is any output in the system service logging.
       ```
        sudo journalctl -f -u btc-screen.service
       ```

repository: dapuru/zero-btc-screen

repo_name: dapuru/zero-btc-screen


text:
# Popular Classical Artists

This single-page application is a showcase for the four most well-known classical composers: Bach, Beethoven, Chopin, and Mozart.

Pieces attributed to these composers are available for listening on respective biographies.

## Deploying the application

```
git clone https://github.com/longnguyen1997/popular-classical-artists.git
cd ./popular-classical-artists
npm install
npm start
```


text:
+++
title = "Reading List"
date = 2020-01-02
draft = false
categories = ["self"]
url = "/reading"
hidden = "true"
+++

This is a page of things I'm hoping to read "soon" (for some value of soon). It's some cross between a digital bookshelf and public bookmarks, where I drop papers that cross my radar or blog posts, talks, or other ideas.

Some of these I've printed out and carry around with me. Others are unlikely to ever be read because they're so far out of my areas of expertise or interest. While this page is mostly for my own reference, it also pretty broadly shows the types of work I'm interested in.

<!--more-->

## Papers
[Generalizable and robust TV advertising effects](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3273476) linked from the correspondent

[Lessons from Archives: Strategies for Collecting Sociocultural Data in Machine Learning](https://arxiv.org/abs/1912.10389) by Eun Seo Jo & Timnit Gebru (from FAT* 2020)

[Exposure to ideologically diverse news and opinion on Facebook](https://science.sciencemag.org/content/348/6239/1130) from Science - study out of Facebook research (short)

[The small effects of political advertising are small regardless of context, message, sender, or receiver: Evidence from 59 real-time randomized experiments](https://advances.sciencemag.org/content/6/36/eabc4046) tl;dr ads bad don't work

[Fairness and Accountability Design Needs for Algorithmic Support in High-Stakes Public Sector Decision-Making](https://arxiv.org/abs/1802.01029)

[Auditing local news presence on Google News](https://www.nature.com/articles/s41562-020-00954-0) (get the PDF from https://osf.io/hwuxf/, [Twitter](https://twitter.com/seanafischer/status/1308067040939438081))

[Datasheets for datasets](https://arxiv.org/abs/1803.09010)

[Election emails project](https://electionemails2020.org/)

[Learning Representations of Hierarchical Slates in Collaborative Filtering](https://dl.acm.org/doi/10.1145/3383313.3418484) - RecSys 2020, out of Netflix

[Characterizing Communication Patterns between Audiences and Newsbots](https://www.tandfonline.com/doi/abs/10.1080/21670811.2020.1816485?journalCode=rdij20)

[Lots of papers from Koustuv Saha's page](https://koustuv.com/)

[NeurIPS keynote](https://nips.cc/virtual/2020/public/invited_16166.html)

[Anticipatory ethics and the role of uncertainty](https://arxiv.org/pdf/2011.13170.pdf) from NeurIPS workshop

[Extracting training data from large language models](https://arxiv.org/abs/2012.07805) (Twitter; on GPT-2)

[Data Leverage: A Framework for Empowering the Public in its Relationship with Technology Companies](https://arxiv.org/abs/2012.09995) (Twitter; FAccT 2021)

[Where Responsible AI meets Reality: Practitioner Perspectives on Enablers for shifting Organizational Practices](https://arxiv.org/abs/2006.12358) (Twitter; CSCW 2021)

## Archives
See [Reading List Archive #1]({{< ref "posts/reading_list_archive_1.md" >}}).


text:
# App structure and config

## Overview

This is the structure of ngStartup:

```bash
.
├── src/                            # folder with source of your application: you code here
├── config/                         # folder with app and project configuration
├── dist/                           # folder (out of git) created during compiling
├── bower.json                      # Grunt configuration file
├── bower_components                # folder (out of git) that contains external libraries
├── Gruntfile.js                    # Grunt configuration file
├── LICENSE                         # license
├── node_modules                    # folder (out of git) that contains npm modules
├── package.json                    # npm metadata and project description
└── README.md                       # presentation file and documentation
```

As you can see the original project (before installation) has just `/src` and `/config` folders. Other folders (`/bower_components`, `/dist`, `/node_modules`) will be created by npm install but are ignored by git.

## The /src folder

The `/src` folder contains all your angular files, styles and assets. When you start working with ngStartup, you can edit all these files adding your logic, images, and more.

```bash
.
└── src                          # source of your application
 ├── app                         # your app modules (for example: news, home, login...)
 ├── common                      # your common modules (for example: header, directives, helpers)
 ├── assets                      # images, videos, fonts and layou elements
 ├── i18n                        # translations in json format
 ├── index.html                  # the index of your single page application
 ├── less                        # less files (will be transformed into css)
 └── sass                        # sass files (will be transformed into css)
```

The `/src` folder is very important because contains all your codes. The most of you job will be inside this folder. Let's go to see that more in detail:

![foldering](http://ngstartup.corleycloud.com/assets/images/ngstartup02.png)

Under **Modules** chapter you can see how to add new modules in this folder.
When you run grunt build, watch and compile tasks, the code in `/src` is compiled and moved with external dependencies (bower_components) into `/dist` folder. This strategy helps you to code better because the final result (in `/dist/compile`) is a minified, uglified, compressed and optimized app ready for production.

## The /config folder
The config folder contains several configuration files:

```bash
.
└── config                          # folder with app and project configuration
    ├── build.config.js             # list of js, css and assets files that will be used in compiling
    ├── secret.json.dist            # template for secret.json
    ├── secret.json                 # conf out of git for security and private keys (phonegap token, AWS s3 keys...)
    ├── karma-unit.tpl.js           # test settings
    ├── module.prefix               # Wrapper function for compiled scripts
    ├── module.suffix               # Wrapper function for scripts
    └── phonegap.config.xml         # phonegap/cordova configuration
```

You should configure you app changing:

1. `package.json` changing the name, description, version and other infos
2. `bower.json` with new dependencies
3. `/config/build.config.js` with new dependency files and switching less/sass (choose the best for you)
4. `/config/secret.js` with reserved credentials for Phonegap Build and AWS S3 (out of git)

For points 2 and 3 go to *Grunt and Bower* chapter.

About point 4: this file is out of vcs (version control system): it contains secret keys used by Grunt to compile your app con build.phonegap.com and to upload your app to Amazon S3. In this way you'll never your passwords to git.

## App configuration

The `/src/common/conf.js` file is a configuration file for your angular modules.

Thanks to a specific Grunt task, this file can be filled with different information for build and compile stages. Watch at an example of config file:
``` javascript
angular.module('ng-startup.appConf', [])
// env: build
.constant('appConf', {
  "endPoint": "http://rest.test.corley.it/",
  "defaultLanguage": "en_EN",
  "debug": true
})
// endenv
// env: compile
.constant('appConf', {
  "endPoint": "http://rest.test.corley.it/",
  "defaultLanguage": "en_EN",
  "debug": false
})
// endenv
;
```

When you launch `grunt build:web`, `grunt build:mobile` and `grunt watch` the lines of code between `// env: compile` and `// endenv` will be dropped. The result in compiled app will be:

``` javascript
angular.module('ng-startup.appConf', [])
.constant('appConf', {
  "endPoint": "http://rest.test.corley.it/",
  "defaultLanguage": "en_EN",
  "debug": true
})
;
```

In `/src/app/app.js` and whenever you want, you can use the appConf constant:

``` javascript
angular.module(
  'ng-startup',
  [
    'ng-startup.appConf'
    // list of other dependencies
  ]
)
.config(['$logProvider', 'appConf', function myappConf($logProvider, appConf) {
  $logProvider.debugEnabled(appConf.debug);
}]);
```

At the other side, when you run `grunt compile:web` and `grunt compile:mobile` tasks, the lines of code between `// env: build` and `// endenv` will be dropped. In the example above your app will enable $log debugging for build stages, and disable for compile stages.

## Phonegap configuration

Phonegap/cordova apps needs a config.xml file with list of plugins and other settings. Please refer to *Cordova/Phonegap* chapter to know how to edit `/config/phonegap.config.xml` file.

repository: corley/ng-startup-documentation

repo_name: corley/ng-startup-documentation


text:
---
layout: default
---

# 1998-10-13 - Soccer Moms?

## Header Data

From: "Brown, R Ken"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 9408f866e192b5d3edf5ac58a4640889f12caa12d5bac8ae06a7eff7b12eb753

Message ID: \<896C7C3540C3D111AB9F00805FA78CE2013F84C8@MSX11002\>

Reply To: _N/A_

UTC Datetime: 1998-10-13 13:56:11 UTC

Raw Date: Tue, 13 Oct 1998 21:56:11 +0800

## Raw message

```
{% raw  %}From: "Brown, R Ken"<EMAIL_ADDRESS>Date: Tue, 13 Oct 1998 21:56:11 +0800
To<EMAIL_ADDRESS>Subject: Soccer Moms?
Message-ID: <896C7C3540C3D111AB9F00805FA78CE2013F84C8@MSX11002>
MIME-Version: 1.0
Content-Type: text/plain

In the middle of an interesting article about digital cash, forwarded
here by Bob Hettinga, there was the line:

> After all, the kind of soccer moms who elected Bill Clinton

"Divided by a common language" as I am  I genuinly don't know what that
means. And I can't even guess from context. I'd have expected a dig at
liberals or feminists or welfare recipients at that point; and I can't
work out what soccer has to do with it.

Do mothers play soccer much in the USA?

Football (as the 95% of the world's population that aren't either
English-speaking North Americans or else Rugby fans call the Beautiful
Game) is associated in my mind with young men, specifically working
class men. It's connotations are entirely macho, even violent.  When a
big match is on men gather in pubs and bars and shout at TVs whilst
knocking back the lager. You avoid the centre of town if you don't want
to risk getting involved in a fight.  People get *killed* at football
matches.  That's pretty much true in every big city inthe world outside
North America (and Japan where the fans are polite).

This honestly isn't a troll - I am in fact bewildered by the phrase.

Ken Brown

{% endraw %}
```

## Thread

+ Return to [October 1998](/archive/1998/10)

+ Return to "[Alan Olsen <alan@clueserver.org>](/authors/alan_olsen_alan_at_clueserver_org_)"
+ Return to "["Brown, R Ken" <brownrk1@texaco.com>](/authors/brown_r_ken_brownrk1_at_texaco_com_)"
+ Return to "[Jim Burnes <jvb@ssds.com>](/authors/jim_burnes_jvb_at_ssds_com_)"
+ Return to "[Petro <petro@playboy.com>](/authors/petro_petro_at_playboy_com_)"
+ Return to "[Robert Hettinga <rah@shipwright.com>](/authors/robert_hettinga_rah_at_shipwright_com_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1998-10-13 (Tue, 13 Oct 1998 21:56:11 +0800) - Soccer Moms? - _"Brown, R Ken"<EMAIL_ADDRESS>  + 1998-10-13 (Wed, 14 Oct 1998 00:22:41 +0800) - [Re: Soccer Moms?](/archive/1998/10/b212fa4f83536fece67cb29651812b7841bfc4b54531af32e81be47dc2433785) - _Tim May<EMAIL_ADDRESS>    + 1998-10-13 (Wed, 14 Oct 1998 06:24:05 +0800) - [Re: Soccer Moms?](/archive/1998/10/c3988a5d7e0d5a61546d9dbc0c7dec14303c66425c288d7d046b9449325e58da) - _Robert Hettinga<EMAIL_ADDRESS>  + 1998-10-13 (Wed, 14 Oct 1998 00:49:41 +0800) - [Re: Soccer Moms?](/archive/1998/10/e9eed67870e3ff6c00714b674d0d44024fb227db95690c4caba299414fea45e3) - _Jim Burnes<EMAIL_ADDRESS>  + 1998-10-13 (Wed, 14 Oct 1998 05:20:08 +0800) - [Re: Soccer Moms?](/archive/1998/10/05702f5737c36973a6c16bb272fb2637685215355565f7ec8552d1e170fc3e81) - _Robert Hettinga<EMAIL_ADDRESS>  + 1998-10-15 (Fri, 16 Oct 1998 00:45:27 +0800) - [Re: Soccer Moms?](/archive/1998/10/aca956585008fd504a7e61e21ca1b4aa80f2b6ab4f093306dae5c51e645e29a2) - _Alan Olsen<EMAIL_ADDRESS>  + 1998-10-28 (Thu, 29 Oct 1998 03:47:10 +0800) - [Re: Soccer Moms?](/archive/1998/10/af66c45cae83b6d29ed175be8cb39da87febf63a59ca6806a9e3392eb8bdc996) - _Petro<EMAIL_ADDRESS>


text:
---
tags:
- spot exchange connector
---

# `gate_io`

## 📁 [Connector folder](https://github.com/CoinAlpha/hummingbot/tree/master/hummingbot/connector/exchange/gate_io)

## ℹ Exchange Info

**gate_io**
[Website](https://www.gate.io/en/) | [CoinMarketCap](https://coinmarketcap.com/exchanges/gate-io/) | [CoinGecko](https://www.coingecko.com/en/exchanges/gate-io)

* API docs: https://www.gate.io/docs/apiv4/en/index.html
* Transaction fees: https://www.gate.io/fee
* Minimum order size: https://support.gate.io/hc/en-us/articles/360000808414-What-is-minimum-order-size-
* Creating API keys: https://support.gate.io/hc/en-us/articles/900000114363-What-are-APIKey-and-APIV4keys-for-

## 👷 Maintenance

* Release added: [0.41.0](/release-notes/0.41.0/) by CoinAlpha
* Maintainer: CoinAlpha

## 🔑 Connection

Run `connect gate_io` in order to enter your API keys:

```
Enter your gate_io API key >>>
Enter your gate_io secret key >>>
```

If connection is successful:
```
You are now connected to gate_io.
```

## 🪙 Fees

Hummingbot assumes 0.2% maker fees and 0.2% taker fees ([source](https://github.com/CoinAlpha/hummingbot/blob/master/hummingbot/connector/exchange/gate_io/gate_io_utils.py#L21)).

Users can override these assumptions with [Override Fees](/global-configs/override-fees/).

repository: matthewbackhouse/hummingbot

repo_name: matthewbackhouse/hummingbot


text:
# Kanban UI

The kanban ui came in at around **~75 LOC** and is built from **3 primary components** and about **~20 elements** where used.

```
git clone git@github.com:hendore/classy-elements.git
cd ./classy-elements/demos/kanban-ui
npm install
npm run serve
```

![](./preview.png)

repository: jeffersonsimaogoncalves/classy-elements

repo_name: jeffersonsimaogoncalves/classy-elements


text:
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/deploy/symlink.php -->
<!-- Then run bin/docgen -->

# symlink

[Source](/recipe/deploy/symlink.php)

* Tasks
  * [`deploy:symlink`](#deploysymlink) — Creating symlink to release

## Tasks
### deploy:symlink
[Source](/recipe/deploy/symlink.php#L5)

repository: martijngastkemper/deployer

gha_language: PHP

repo_name: martijngastkemper/deployer


text:
# Change Log

## [2.0.0] - 2019-12-06

### Refactored

* Refactor with Typescript, get more readable usage tips by ide

### Changed

* Use `navigator.userAgent` to recognize Vite App, so only usable in Vite App version 3.2.0 and abover

### Features

* Add method `app.scan` which can invoke the camera to scan a QR code

* Add static property `enabled`, indicate in Vite App or not

### Removed

* Remove the static property `_support` `_inIosContainer` `_inAndroidContainer`

repository: vitelabs/vite-bridge

gha_language: TypeScript

repo_name: vitelabs/vite-bridge