text:
---
title: Caveats
description:
---

Passwords
=========

One of the first things you'll learn when you try to adopt a new
keyboard layout is that you have an extremely hard time logging in
anywhere.  That's because your muscle memory no longer works for
passwords and since that is what you usually rely on, you now have to
spell everything out mentally.  Even then, it still usually ends up
wrong because you can't see any mistakes you're making.  This can be
very frustrating until you are proficient with the new layout.

This is a good reason to go with the recommended [PKL] until you are
proficient at Minimak.  PKL allows you to turn the Minimak layout on and
off with a hotkey.  Just hit both Alt keys together and it will
suspend Minimak, putting you back in QWERTY.  Handle your login, then
hit both Alts again to toggle back to Minimak.  You'll want to do this
whenever you deal with passwords.

Creating Passwords
------------------

You especially don't want to use Minimak to create new passwords until
you are 100% accurate.  That's because learning a new layout
(temporarily) makes you mistype letters in a consistent and reproducible
fashion.  If you do try to make passwords, you will typically end up
with a password that's good enough to get most systems to accept it, since
you can type it the same way twice, but isn't the password you thought
it was because you couldn't see your (consistently) mistyped letters.

Even when you're fairly confident of your new typing skills, it's a good
idea to type new passwords into a text editor first, then cut and paste
them into the site or application that needs it.

Logging In
----------

Another thing to note is that the different methods of changing layouts
don't always work for your system's bootup login prompt.

If you use a method that only remaps your keys after you login, you'll
need to remember to type your system login password in QWERTY in order
to log into your account.  This is true for PKL and layouts created with
MKLC, since they are only enabled after you log in.

If you use the same password for sites or programs, then after you log
in, you will then need to remember to type it in Minimak.  This can be a
bit disconcerting since you will frequently have to remember two ways of
typing the same thing.

If you go with [registry mapping], it will change layouts at boot-time,
so you won't have to remember to type in QWERTY at the login screen.
And you'll really mess with anyone who steals your password, then
tries to log into your machine thinking it's QWERTY.

Applications
============

VMware Console
--------------

VMware Console for Windows seems to rely on scan codes, which don't get
changed by remapping.  So your mappings won't have any effect in the
console.  This only happens in console and not, for example, when RDCing
to a virtual machine.  I've only encountered this with the console
software for VMware, but it's possible you may encounter it with other
programs as well.

In this case, the remapping software will work everywhere except the
window for the program in question. You'll just have to remember to type
in QWERTY for that window.  Even the boot mapping method doesn't fix
this.

VIM
---

While some of the keys with which [VIM] users are familiar have changed
with Minimak, the good news is that most are unchanged.  However, you
may want to remap the functionality of the J (down) and K (up) keys to N
and E respectively.  That means you'll probably want to map N (next) to
K as well.

Personally, I don't use key mappings because I'd rather learn the native
positions for my keyboard layout so I can have a single .vimrc which
doesn't have to change if I change layouts.  I use vim on some machines
which have to stay QWERTY, but I don't like having to create a
layout-specific .vimrc to maintain just for those machines.

While there is definitely relearning to be done when it comes to using
Minimak with VIM, there is a good argument to be made that Minimak is
the VIM-friendliest of the popular layouts today, due to the smallest
number of remappings.

Keyboard Lettering
==================

You may notice that the printed letters on your keyboard don't change
to match your new layout.

That is by design.

You see, having appropriately printed letters on your keyboard only
serves to encourage hunting-and-pecking, as well to encourage those
people who are not you to use your computer.  Eliminating both of these
temptations is considered a feature.

If you need to see the key layout for visual reference while you are
learning Minimak, [PKL] supports this.  You can also purchase [keyboard
lettering] stickers, which although they are made for Colemak, can
really be used for any layout since you choose where to affix them.

Or, if you have $1086 to burn, consider the [Optimus Popularis]
keyboard.  It lets you show any letter (or image, for that matter) on
any key!

[![Optimus Popularis Image]{: style="display:block;margin-left:auto;margin-right:auto" }][Optimus Popularis]

Or, if you're a real keyboard ninja, consider [Das Keyboard Model S
Ultimate], which has no lettering at all!  At least then it won't be
misleading.

[![Das Keyboard Image]{: style="display:block;margin-left:auto;margin-right:auto" }][Das Keyboard Model S Ultimate]

I'll also put in a plug for my favorite keyboard, the [TypeMatrix
ergonomic keyboard].  It's a great ergonomic keyboard, and inexpensive.
I like the 2020 model, which is available in the store for only $59.
You can get the 2030 as a blank model though.

[![TypeMatrix Image]{: style="display:block;margin-left:auto;margin-right:auto" }][TypeMatrix ergonomic keyboard]

It is not suggested, however, that you remove and replace the keys of
your keyboard in the new configuration.  Some keyboards don't support
the removal of keys (i.e., they'll break) and some have keys of
differing shapes for different parts of the keyboard.

[registry mapping]: /download#rm
[PKL]: /download#pkl
[VIM]: http://www.vim.org/
[keyboard lettering]: http://www.4keyboard.com/colemakkeyboardsticker-p-234.html
[Optimus Popularis]: http://store.artlebedev.com/electronics/optimus-popularis/
[Optimus Popularis Image]: {{ urls.media }}/optimus-popularis-shop.jpg
[Das Keyboard Model S Ultimate]: http://www.daskeyboard.com/model-s-ultimate/
[Das Keyboard Image]: {{ urls.media }}/das_keyboard_s.jpg
[TypeMatrix ergonomic keyboard]: http://www.typematrix.com/shop/
[TypeMatrix Image]: {{ urls.media }}/2020-us.jpg


text:
---
title: |
    554. Speak to My Soul - Christ in Song
metadata:
    description: |
        Christ in Song 554. Speak to My Soul. Speak to my soul, dear Jesus, Speak now in tend'rest tone; Whisper in loving kindness; "Thou art not left alone," Open my heart to hear Thee, Quickly to hear Thy voice, Fill Thou my soul with praises Let me in Thee rejoice. Chorus: Speak Thou in softest whispers, Whispers of love to me; "Thou shalt be always conq'ror  Thou shalt be always free. Speak Thou to me each day, Lord, Always in tend'rest tone, Let me now hear Thy whisper," "Thou art not left alone."
    keywords:  |
        Christ in Song, adventhymnals, advent hymnals, Speak to My Soul, Speak to my soul, dear Jesus. Speak Thou in softest whispers,
    author: Brian Onang'o
---

#### Advent Hymnals
## 554. SPEAK TO MY SOUL
####  Christ in Song,

```txt
1.
Speak to my soul, dear Jesus,
Speak now in tend'rest tone;
Whisper in loving kindness;
"Thou art not left alone,"
Open my heart to hear Thee,
Quickly to hear Thy voice,
Fill Thou my soul with praises
Let me in Thee rejoice.

Chorus:
Speak Thou in softest whispers,
Whispers of love to me;
"Thou shalt be always conq'ror
Thou shalt be always free.
Speak Thou to me each day, Lord,
Always in tend'rest tone,
Let me now hear Thy whisper,"
"Thou art not left alone."

2.
Speak to Thy children ever,
Lead in the holy way;
Fill them with joy and gladness,
Teach them to watch and pray,
May they in consecration
Yield their whole lives to Thee,
Hasten Thy coming kingdom,
Till our dear Lord we see.  [Chorus]

3.
Speak now as in the old time
Thou didst reveal Thy will:
Let me know all my duty,
Let me Thy law fulfil,
Lead me to glorify Thee,
Help me to show Thy praise,
Gladly to do Thy bidding,
Honor Thee all my days,  [Chorus]

```

- |   -  |
-------------|------------|
Title | Speak to My Soul |
Key | E♭ Major |
Titles | Speak Thou in softest whispers, |
First Line | Speak to my soul, dear Jesus |
Author | L. L. P.
Year | 1908
Composer| undefined |
Hymnal|  - |
Tune| Speak to my soul, dear Jesus |
Metrical pattern | |
# Stanzas |  |
Chorus |  |
Chorus Type |  |
Subjects | Holy Spirit: Comforter |
Texts | Isaiah 30:21 |
Print Texts |
Scripture Song |  |

repository: GospelSounders/adventhymnals

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: GospelSounders/adventhymnals


text:
CClient
=======

The OneDataShare SDK for C++ 17. To begin working with the SDK, see the
[installation instructions](#install),
the
[documentation](https://didclab.github.io/CClient),
and the
[getting started](getting-started.md)
tutorial.

Table of Contents
-----------------
- [Dependencies](#dependencies)
- [Install](#install)
- [CMake Support](#cmake-support)
- [Build](#build)
- [Examples](#examples)
- [Project Structure](#project-structure)
- [Coding Style](#coding-style)

Dependencies:
-------------
The following are required to build and test this project.
- **g++ 9.3.0** - find at https://gcc.gnu.org/gcc-9/
- **cmake 3.10.0** - find at https://cmake.org/files/v3.10/
- **libcurl 7.47.0** - install with `sudo apt-get install libcurl4-openssl-dev`

Install:
--------

To install the OneDataShare C++ SDK, follow the instructions below. Note that this will require a **C++ 17** compiler,
**CMake** `3.10.0` or greater, and **Libcurl** `7.47.0` or greater.

1. Clone the github repository at https://github.com/didclab/CClient and switch to the created directory with the
following commands:
    ```
    git clone https://github.com/didclab/CClient.git;
    cd CClient
    ```

2. Create and switch to a `build` directory with
    ```
    mkdir build;
    cd build
    ```

3. Next you must initialize the build tree and specify where you want to install the OneDataShare SDK. There are two
ways to do this. To use the default GNU install directory (`/usr/local`), use
    ```
    cmake ../ -DCMAKE_BUILD_TYPE=Release
    ```
    To specify a different directory denoted by `<path>`, use
    ```
    cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<path>
    ```

4. Finally, to install the OneDataShare SDK, use
    ```
    sudo make install
    ```

CMake Support
-------------

The OneDataShare SDK fully supports CMake. Once installed, `OneDataShare` can be included in any CMake project by
calling `find_package(OneDataShare)` which will define the following:
 - `OneDataShare_FOUND` - defined if and only if CMake successfully found the `OneDataShare` package.
 - `OneDataShare_VERSION` - the version of the `OneDataShare` installation found by CMake.
 - `OneDataShare::OneDataShare` - the imported `OneDataShare` target
 - `ONEDATASHARE_LIBRARIES` - an alias for `OneDataShare::OneDataShare`

Once found, `OneDataShare::OneDataShare` can be linked with the project as shown below.

### Example ###
Here's a minimal working `CMakeLists.txt` file that finds the OneDataShare package and links the package with the project.
```
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)

project(myproject LANGUAGES CXX)

find_package(OneDataShare 0.1.0 REQUIRED)

add_executable(myproject
    src/main.cpp
)

target_link_libraries(myproject
    OneDataShare::OneDataShare
)

install(TARGETS myproject
        DESTINATION .
)
```

Build:
------
This project is built and tested using `make`. See
[`Makefile`](Makefile)
for more information on targets.

Examples:
---------
To run the examples, a `token.txt` and `url.txt` file must be created in the project root containing the OneDataShare
authentication token and OneDataShare url respectively as shown below.

`token.txt`:
```
YOURAUTHENTICATIONTOKENGOESHERE
```

`url.txt`:
```
http://localhost:8080
```

Do **not** check these files into version control.

Project Structure:
------------------
`bin/` - Local-only directory containing generated binaries. This directory is **not** to be checked into version
control.

`build/` - Local-only directory containing project build tree. This directory is **not** to be checked into version
control.

`cmake/` - Contains templates for generated CMake scripts.

`docs` - Contains generated documentation for hosting on GitHub pages.

`doxygen/` - Contains files for generating documentation.

`examples/` - Contains sample files demonstrating how to use the OneDataShare SDK. These files are not part of the
main project.

`include/` - Contains public header files to be exported with the library.

`src/` - Contains the library's source files.

`tests/` - Contains unit tests for the library.

Coding Style:
-------------
This project follows the
[C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md),
including the [recommended naming and layout rules](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl-naming-and-layout-rules).
Note that this project does **not** use the
[Guidelines Support Library](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gsl-guidelines-support-library).

repository: didclab/CClient

repo_name: didclab/CClient


text:
# Go Rubric

[TOC]

This document lists conventions to follow when writing Go in the Fuchsia Source
Tree. These conventions are a combination of best practices, project
preferences, and some choices made for the sake of consistency.

The conventions described here can be considered as adding or amending common
best practices as detailed in [Effective Go] and [Go Code Review Comments].

## General

### Ordering of declarations in a file

How declarations are organized within a Go file varies considerably, especially
since it is frequent to have one large file with all-the-things, or many smaller
files with each a-thing. We provide a few rules of thumb here.

For ordering of top-level declarations (constants, interfaces, types along with
their associated methods), it is common to list by group of functionality, with
the following order in each group:

* Constants (which includes enumerations);
* Exported interfaces, types, and functions;
* Unexported interfaces, types, and functions in support of the exported types.

As an example, a group of functionality in fidlgen lib may be the handling of
names, while another group may be reading and denormalizing the JSON IR. Such
groupings are good candidates to become their own separate files as they grow.

For a type with methods, it is common to list in order:

* The type declaration (e.g. `type myImpl struct { ...`);
* The [type assertion(s)](#type-assertions), if any;
* Methods, with exported methods first, and unexported methods second;
* It is best to group methods implementing an interface if applicable, i.e. all
  methods for interface `Foo`, then all methods for interface `Bar`;
* Often, despite being exported, the `String()` method will be last.

For an enumeration, see how to [define an enum](#enum).

 Some conventions:

* `var err error`
* `var buf bytes.Buffer`
* `var buf strings.Builder`
* `var mu sync.Mutex`
* `var wg sync.WaitGroup`
* `var ctx context.Context`
* `_, ok := someMap[someKey]`
* `_, ok := someValue.(someType)`

When defining methods, ensure that the name of the receiver is consistent (when
present). See also [pointers vs values](#pointers-vs-values).

### Avoid exporting

In Go, identifiers can be unexported or exported (the public/private terminology
is not used). An exported declaration starts with a capital letter
`MyImportantThing`, while an unexported declaration starts with a lowercase
letter `myLocalThing`.

Only export things you really need, and that you intend to reuse. Keep in mind
that exporting in a follow up change is relatively easy so prefer to not export
until necessary. This keeps the documentation cleaner.

If your type will be used by reflection, e.g. within templates or automatic
diffing à la [go-cmp], you can have an unexported identifier with exported
fields. Again, prefer unexported fields except in the situation where you are
forced to do otherwise.

There is nothing wrong with a local variable having the same name as a type. If
you would write `server := Server{...}` for an exported type, then `server :=
server{...}` is fine for an unexported type.

### Never use named return values

Semantics are confusing, and error prone. Even if it might be a good usage at
some point (rare, and doubtful), evolutions typically cause this not to be the
case anymore, which then introduces a diff that is larger than the actual
change.

You'll see advice saying that "it's fine to use named return values for this
special case", or "that special case is perfect for named return values". Our
rule is simpler, never use named return values.

(When defining interfaces, it is fine to name things. This is different from
named returns in implementations, it has no semantic implications.)

### Defining an enum {#enum}

The standard pattern to define an enumeration is:

```go
type myEnumType int

const (
    _ myEnumType = iota
    myFirstEnumValue
    mySecondEnumValue
)
```

The type can only be elided when using `iota`. With an explicit value, you must
repeat the type:

```go
const (
    _ myEnumType = iota
    myFirstEnumValue
    mySecondEnumValue
    // ...
    myCombinedValue myEnumType = 100
)
```

Additionally, if you want this enum to have a textual representation:

```go
var myEnumTypeStrings = map[myEnumType]string{
    myFirstEnumValue:  "myFirstEnumValue",
    mySecondEnumValue: "mySecondEnumValue",
}

func (val myEnumType) String() string {
    if fmt, ok := myEnumTypeStrings[val]; ok {
        return fmt
    }
    return fmt.Sprintf("myEnumType(%d)", val)
}
```

For instance [mdlint:
TokenKind](https://cs.opensource.google/search?q=%22type%20TokenKind%20int%22&ss=fuchsia%2Ffuchsia).
Using a `map` is preferred over using a `switch` since it is very common to
evolve the code to compute things off of the map, e.g. a `FromString`
constructor (inefficiently by searching, or by pre-computing a `stringsToMyEnum`
reverse map).

You should only use an enum member with value `0` if it is a natural default.
For more details, see the [enum FIDL API Rubric entry][enum-fidl-rubric].

Another option is to use [`cmd/stringer`] to generate enumerations. This generates
more efficient code, but requires a little more effort to maintain. You can use
this approach when the enumeration has stabilized.

Note: Switching to `stringer` as the default recommended approached is tracked
as [fxbug.dev/73539](https://fxbug.dev/73539).

### Sets

To represent a set, use map to an empty struct:

```go
allMembers := map[uint32]struct{}{
    5: {},
    8: {},
}
```

Note: It is common to see sets defined as maps to `bool` (it is what [Effective
Go] recommends). In Fuchsia, we have chosen to always use an empty struct due to
the small performance improvement (which comes at the cost of small added
syntax).

### Instantiating slices

If you're going to define the slice using a literal, then `[]T{ ... }` is the
way to go.

Otherwise use `var slice []T` to create an empty slice, i.e. do not use
`slice:= []T{}`.

Note that pre-allocating slices can bring meaningful performance improvements,
and may be preferred over a simpler syntax. See for instance [slices usage and
internals](https://go.dev/blog/slices-intro).

### Instantiating maps

If you're going to define the map using a literal, then `map[K]T{ ... }` is the
way to go.

Otherwise use `make(map[string]struct{})` to create an empty map, i.e. do not
use `myEmptyMap := map[K]T{}`.

### Non-normal returns

When an function needs to communicate a non-normal return, i.e. a 'failure', there are a few patterns:

1. `func doSomething(...) (data, bool)`, i.e. either return the data, or false.
2. `func doSomething(...) *data`, i.e. either return the data, or nil.
3. `func doSomething(...) (data, error)`, i.e. either return the data, or an
   error.
4. `func doSomething(...) dataWrapper`, i.e. return a wrapper which carries
   structured information about the result of the operation.

Giving hard and fast rules for when to use which-flavor-where is not possible,
but there are some general principles that apply.

Relying on `nil` vs present is error prone in Go when used in polymorphic
contexts: `nil` is not a unit, there are [many `nil` and they do not equal each
other](https://play.golang.org/p/RvxsIbQ3NLH)! Therefore, prefer returning an
extra `ok` boolean when uses of the method will likely be in polymorphic
contexts. Only use `nil` vs present as an indication when the method will be
used solely in monomorphic contexts. Or said another way, using pattern (2) is
simpler than (1) and a good replacement when all callers will be using the
function without looking at the returned value through the lens of an interface.

Returning an `error` indicates that something problematic occurred, the caller
is provided with an explanation for what happened. It is expected for the caller
to bubble up the error, possibly wrapping it along the way, or do some sort of
error handling and recovery. A key distinction from a method returning an `ok`
boolean (or `nil` data), is that when returning an `error` the method is
asserting that it knows enough of the context to classify what is happening as
erroneous.

For instance, a `LookupUser(user_id uint64)` would favor returning an ok boolean
if no user was found, but a `LookupCountryCode(code IsoCountryCode)` would favor
returning an `error` to identify that something is misconfigured if a country
cannot be lookup up (or an invalid country was requested).

Returning some sort of wrapper should be considered in cases where the result of
a method is complex, and requires structured data to describe. For instance, a
natural candidate to use a data wrapper is a validation API which traverses an
XML document, and returns a list of faulty paths, each with warnings or errors
attached to them.

### Static type assertions {#type-assertions}

Since Go uses structural subtyping, i.e. whether a type implements an interface
is determined by its structure (not by a declaration). It is easy to think a
type implements some interface, when in fact it does not. This results in
breakage at a distance, at the use site, and makes for confusing compiler
errors.

To remedy this, it is required to write type assertions for all interfaces a
type implements (yes, those in the standard library
[too](https://cs.opensource.google/fuchsia/fuchsia/+/main:tools/fidl/lib/fidlgen/formatter.go;drc=e67febe6dbde880bf9632fbe0540cf9251dcfd0a;l=55)):

```go
var _ MyInterface = (*myImplementation)(nil)
```

This creates a typed nil, whose assignment forces the compiler to check for type
conformance.

Often, we have many implementations which have to implement the same interface,
e.g. representing an abstract syntax tree with individual nodes all implementing
the Expression interface. In these cases, you should do all type assertions at
once thus also documenting all subtypes which are expected:

```go
var _ = []MyInterface{
    (*myImplementation)(nil),
    (*myOtherImplementation)(nil),
    ...
}
```

A rule of thumb about where these type assertions should be placed is as
follows:

* Prefer having a single type assertion below the implementation when each
  implementation stands on its own, e.g.
  [here](https://cs.opensource.google/fuchsia/fuchsia/+/main:tools/mdlint/rules/bad_lists.go;drc=b9496c021b59ccfed5eeeaeacee5fb9dc14005a7;l=26);
* Prefer a grouped type assertion below the interface when all implementations
  are meant to be used in concert (e.g. expression nodes of an `Expression`
  interface representing an AST), e.g.
  [here](https://cs.opensource.google/fuchsia/fuchsia/+/main:tools/fidl/lib/summarize/summary.go;drc=41966aa0f0d465f663b1b9928e5c57cf80fe38ef;l=35).

### Embedding

Embedding is a very powerful concept in Go. Make use of it. Read
[Embedding][Effective Go embedding] for an introduction.

When embedding an interface or a struct type, these should be listed first in
their enclosing interface or struct type, i.e. the embedded type(s) should
appear as the first field(s).

### Pointers vs Values {#pointers-vs-values}

For method receivers, read [Pointers vs. Values][Effective Go pointers_vs_values]
and [Receiver Type][Go Code Review Comments receiver-type].
tl;dr is to keep things consistent, but when in doubt, use a pointer receiver.
For a given type, always be consistent about how it is passed around, i.e.
always pass by value, always pass by reference, and this flows from whether
methods are defined on this type (with value or pointer receiver).

It is also worth noting that passing a struct by value, thinking that the caller
will not mutate it, is incorrect. You can easily hold maps, slices, or
references to objects, and therefore mutate those. So in Go it's an incorrect
association to think "pass by value is const".

Refer to [implementing interfaces](#implementing-interfaces) for specific advice
about method receivers.

### Implementing interfaces {#implementing-interfaces}

Generally implement interfaces using a pointer receiver; implementing an interface
using a value receiver causes that interface to be implemented by both value and
pointer, which complicates type assertions that attempt to enumerate possible
implementations of an interface. See for instance
[fxrev.dev/269371](https://fxrev.dev/269371).

There are some specific cases where implementing an interface using a value
receiver is appropriate:

* When the type is never used as a pointer. For example, custom sorting is often
  done by defining `type mySlice []myElement` and implementing
  [`sort.Interface`](https://golang.org/pkg/sort/#Interface) on `mySlice`. The
  type `*mySlice` would never be used because `[]myElement` is already a
  reference. Example
  [here](https://cs.opensource.google/fuchsia/fuchsia/+/main:tools/mdlint/core/reporter.go?q=%22type%20sortableMessages%20%5B%5Dmessage%22).
* When it is never expected to use a type assertion or type switch on values of
  the interface type. For example,
  [`Stringer`](https://golang.org/pkg/fmt/#Stringer) is often implemented on
  value types. It would be unusual for a function accepting `val Stringer` to
  switch on `val.(type)`.

When in doubt, always implement interfaces using a pointer receiver.

### Comments

Read [Commentary][Effective Go commentary], in particular:

> Doc comments work best as complete sentences, which allow a wide variety of
> automated presentations. The first sentence should be a one-sentence summary
> that starts with the name being declared.

```go
// Compile parses a regular expression and returns, if successful,
// a Regexp that can be used to match against text.
func Compile(str string) (*Regexp, error) {
```

Doc comments on types [may have a leading
article](https://github.com/golang/lint/blob/738671d3881b9731cc63024d5d88cf28db875626/lint.go#L832)
"A", "An", or "The". All documentation in the Go standard library follows this
practice, [e.g.](https://golang.org/pkg/bytes/#Buffer) `// A Buffer is a
variable-sized ...`.

For comments which are more than a sentence long, the style generally prefers
one summary sentence, then an empty line, then a paragraph providing further
details. See for instance the
[FileHeader](https://golang.org/pkg/archive/zip/#FileHeader) struct.

### Error wrapping {#error-wrapping}

When propagating errors using `fmt.Errorf`:

* Use `%s` to only include their string values;
* Use `%w` to allow callers to unwrap and observe wrapped errors; note `%w`
  makes those wrapped errors part of your API.

See [Working with Errors in Go
1.13](https://blog.golang.org/go1.13-errors), and more specifically [Whether
to Wrap](https://blog.golang.org/go1.13-errors#TOC_3.4.).

There are some specific cases where error propagation must be done in a way that
satisfies an API contract, e.g. often the case in a RDBMS driver where specific
error codes returned indicate situations callers may recover from. In such
cases, it is necessary to specifically wrap underlying errors rather than rely
on `fmt.Errorf`.

### `fmt` verbs

Avoid `%v` when possible, preferring specific fmt verbs that are supported by
the operand. This has the benefit of allowing `go vet` to check that the verb is
indeed supported by the operand.

In cases where the operand is a struct that doesn't implement `fmt.Stringer`,
`%v` is unlikely to produce a good result anyhow; `%+v` or `%#v` are likely much
better choices.

A common exception to this rule is an operand that may be `nil` at run-time -
`nil` values are well handled by `%v` but not all other verbs.

When quoting strings, use `%q` instead of explicitly calling `strconv.Quote`.

When propagating errors, see [error wrapping](#error-wrapping).

### GN targets

A typical `BUILD.gn` file for a Go tool will look something like this:

```gn
go_library("gopkg") {
  sources = [
    "main.go",
    "main_test.go",
  ]
}

go_binary("foo") {
  library = ":gopkg"
}

go_test("foo_test") {
  library = ":gopkg"
}
```

If you have nested packages (and [only in this
case](https://fuchsia-review.googlesource.com/c/fuchsia/+/406682/)), use
`name = "go.fuchsia.dev/fuchsia/<path>/..."` form in go_library to enable
recursive package sources:

```gn
go_library("gopkg") {
  name = "go.fuchsia.dev/fuchsia/tools/foo/..."
  sources = [
    "main.go",
    "subdir/bar.go",
    "extra/baz.go",
  ]
}
```

Note: We are moving away from allowing `...` in `go_library` altogether,
reserving this form for third-party code which we want to purposefully view as a
black box. However, it is frequent for code to be decomposed into multiple
packages, without individual packages being deemed "library quality", i.e. in a
shape to be reused at will. We plan to update the various GN templates to
reflect these subtleties, and offer a `go_private_library` template allowed to
be used solely by a single `go_binary` rule, and `go_third_party_library` which
would be the only allowing the use `...`. This is tracked as
[fxbug.dev/73815](https://fxbug.dev/73815).

## Testing

### Packages ending in _test

Usually a `_test.go` file is in the same package as the code it tests (e.g.
`package foo`), and it can access unexported declarations. [Go also allows
you](https://tip.golang.org/cmd/go/#hdr-Test_packages) to suffix the package
name with `_test` (e.g. `package foo_test`), in which case it is compiled as a
separate package, but linked and run with the main binary. This approach is
called external testing, as opposed to internal testing. Do not name a package
with the `_test` suffix unless you are writing external tests, see instead
[testing package](#testing-packages).

Prefer external tests when doing integration level testing, or to interact with
the exported only portion of a package under test.

Using packages ending in `_test` is also interesting to provide compiled example
code, which is copy pastable as-is with the package selector. For instance
[example
code](https://pkg.go.dev/github.com/maruel/panicparse/v2/stack#example-package-Simple)
and [its
source](https://github.com/maruel/panicparse/blob/master/stack/example_test.go#L161).

### Test utilities

Testing utilities are helpers used within a package, to help with testing. It is
'testing code' in that it lives in a file with a `_test.go` suffix. Place
testing utilities in a file named `testutils_test.go` file; this convention is
interpreted by the compiler such that this code is not included in non-test
binaries, which ensures it isn't used outside of tests.

### Testing packages {#testing-packages}

A testing package is a library whose focus is to make writing tests easier. It
is 'production code' — does not end in `_test.go` suffix — but intended only to
be used from test code.

The naming convention for testing packages is to use a "test" suffix with the
package name it is used to test. Examples in the standard library are
[httptest](https://golang.org/pkg/net/http/httptest/) and
[iotest](https://golang.org/pkg/testing/iotest/), in the Fuchsia tree
[fidlgentest](/tools/fidl/lib/fidlgentest/), and
[emulatortest](/tools/emulator/emulatortest).

## Additional resources

* [Effective Go]
* [Go Code Review Comments], view this as a supplement to [Effective Go]
* [Go FAQ](https://golang.org/doc/faq)
* [golint](https://pkg.go.dev/golang.org/x/lint/golint)
* [Go at Google: Language Design in the Service of Software
  Engineering](https://talks.golang.org/2012/splash.article)

<!-- link labels -->

[`cmd/stringer`]: https://pkg.go.dev/golang.org/x/tools/cmd/stringer
[Effective Go commentary]: https://golang.org/doc/effective_go#commentary
[Effective Go embedding]: https://golang.org/doc/effective_go#embedding
[Effective Go pointers_vs_values]: https://golang.org/doc/effective_go#pointers_vs_values
[Effective Go]: https://golang.org/doc/effective_go
[enum-fidl-rubric]: /docs/development/api/fidl.md#enum
[Go Code Review Comments receiver-type]: https://github.com/golang/go/wiki/CodeReviewComments#receiver-type
[Go Code Review Comments]: https://github.com/golang/go/wiki/CodeReviewComments
[go-cmp]: https://github.com/google/go-cmp

repository: gnoliyil/fuchsia

branch_name: refs/heads/main

repo_name: gnoliyil/fuchsia


text:
# EwoK, a secure microkernel for building secure embedded systems

[![Release](https://img.shields.io/github/release/wookey-project/ewok-kernel.svg)](https://github.com/wookey-project/ewok-kernel/releases/latest)
[![Build Status](https://dev.azure.com/phil0093/phil/_apis/build/status/wookey-project.manifest?branchName=master)](https://dev.azure.com/phil0093/phil/_build/latest?definitionId=1&branchName=master)

## What is EwoK ?

EwoK is a highly secure microkernel targeting micro-controllers and embedded systems.
It aims to bring an efficient hardening of embedded devices with a reduced impact on
the device performances.

EwoK has been designed to host complex drivers in userspace. Unlike most of
other microkernels, the goal is to support complex software stacks (ISO7816,...)
as well as high performance (USB, SDIO, CRYP) drivers. This makes EwoK valuable
for multiple use cases, including high speed and security targeted devices.
Security properties

EwoK is a microkernel enforcing strict isolation between tasks and device
drivers and providing strict access control to physical resources (devices,
etc.) and strong enforcement of the least privilege principle.

EwoK is also implemented in Ada/SPARK, a strongly typed language often used
in highly critical domains (avionic, railway systems, space, etc.) to build
safe and secure software.

Some other security features provided by EwoK:

   * Strict memory partitioning
   * Strict partitioning of physical resources (devices, etc.)
   * Fixed permissions management, set at compile time and easily verifiable
   * Stack smashing protection
   * Heap/Stack smashing protection
   * Proved W^X memory mappings
   * Strict temporal separation between declarative phase and execution phase

Ewok provides to the userspace drivers a specific interface to allow them to
use the DMA engines. It permits to achieve high performance, specifically with
high speed buses.

Nevertheless, DMA registers are never directly accessible to user tasks and any
DMA configuration implies a validation of all the inputs by the kernel before
any modification of the controller is pushed at the hardware level.

## EwoK architecture

The Ewok kernel is divided into two main components: the *libbsp* and the *kernel*
part.

The libbsp is the architecture-specific part of the kernel, hosting all the low
level and arch-specific drivers (MPU, GPIOs, timers, DMAs, etc.). The libbsp is
itself separated in:

   * *SoC-specific drivers*, such as DMA or GPIO support for the STM32F407, STM32F429 and STM32F439 SoCs
   * *Core-specific drivers*, such as MPU support for the Cortex-M4 ARMv7-m micro-architecture

The kernel part contains all specific high level content (scheduling, task
management, syscalls, etc.) and uses the libbsp as a hardware abstraction for
any low-level interaction.

## About the chosen programming languages

C is a language highly understood by most of the developers community.
Therefore, most of microkernels have been written in C and assembly.
However, because of our experience in security, we are convinced that C is
too error-prone. Its loose typing, its unsafe bitfields management, too many
compiler dependent behaviors, etc. easily lead to vulnerabilities.

An easy alternative is to use a language that enforces strong typing
and that prevent "classical" vulnerabilities (buffer overflows, dangling
pointers, etc.). However, we found that very few languages enforce strong
typing while being suitable for bare metal programming. We choosed to gave a
try to Ada/SPARK. That language exceeded our expectations, by being simple
to use and by gaving us a tremendous help in the debugging process.

Therefore, EwoK is almost entirely implemented in Ada/SPARK (with a little bit
of assembly).

## EwoK API

The whole microkernel architecture and the API provided to the user tasks are
specifically designed for helping developpers to implement highly secure and
performant drivers.

Note that despite being a microkernel, Ewok is not full-IPC driven like L4
family microkernels. Beyond this, and similarly to other kernels, EwoK
interactions with the userspace are based on syscalls. In the particular case
of EwoK, a main application has two execution contexts: standard thread mode
and ISR thread mode. Some syscalls can be executed from any context while
others cannot. This property is described in each syscall documentation, and
the developer will have to refer to it and understand in which context a piece
of code is executed before calling such a syscall.

## EwoK permission model

EwoK permission model is static. Permissions are set at configuration time,
before building the firmware, and can't be updated during the device life
cycle. Each application permissions are stored in a .rodata part of the kernel,
reducing the risk of any invalid modification.

As EwoK is a driver-oriented microkernel, permissions are also driver oriented.

For more information about the EwoK microkernel, the complete documentation is
published [here](https://wookey-project.github.io/ewok/index.html)

repository: mfkiwl/ewok-kernel-security-OS

repo_name: mfkiwl/ewok-kernel-security-OS


text:
Build: ```docker build -t apt-cacher .```

Run: ```docker run -d -p 3142:3142 --name aptcacher apt-cacher```

and then you can run containers with:
```docker run -t -i --rm -e http_proxy http://dockerhost:3142/ debian bash```

**Here, `dockerhost` is the IP address or FQDN of a host running the Docker daemon which acts as an APT proxy server.**

For more instructions and options: [see this docker example page]

[see this docker example page]: https://docs.docker.com/engine/examples/apt-cacher-ng/

license: MIT

repository: enxt/dockerfiles

repo_name: enxt/dockerfiles


text:
Audio recorder from microphone to a given file path.
No external dependencies, MediaRecorder is used for Android an AVAudioRecorder for iOS.

## Preview
<img src="https://raw.githubusercontent.com/xSILENCEx/record/master/preview/pre.gif" height=200>

## Options
- bit rate (be careful with this one on iOs)
- sampling rate
- encoder

## Platforms

### Android
```xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Optional, you'll have to check this permission by yourself. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
```
min SDK: 16 (29 if you use OPUS)

### iOs
```xml
<key>NSMicrophoneUsageDescription</key>
<string>We need to access to the microphone to record audio file</string>
```
min SDK: 8.0 (11 if you use OPUS)

## Supported encoders
```dart

enum AudioEncoder {
  /// Will output to MPEG_4 format container
  AAC,

  /// Will output to MPEG_4 format container
  AAC_LD,

  /// Will output to MPEG_4 format container
  AAC_HE,

  /// sampling rate should be set to 8kHz
  /// Will output to 3GP format container on Android
  AMR_NB,

  /// sampling rate should be set to 16kHz
  /// Will output to 3GP format container on Android
  AMR_WB,

  /// Will output to MPEG_4 format container
  /// /!\ SDK 29 on Android /!\
  /// /!\ SDK 11 on iOs /!\
  OPUS,

  ///通用格式，解决iOS无法播放Android录音问题
  AAC_ADTS,
}
```

### Android
https://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder
### iOs
https://developer.apple.com/documentation/coreaudiotypes/coreaudiotype_constants/1572096-audio_data_format_identifiers

## Usage
```dart
// Import package
import 'package:record/record.dart';

// Check and request permission
bool result = await Record.hasPermission();

// Start recording
await Record.start(
  path: 'aFullPath/myFile.m4a', // required
  encoder: AudioEncoder.AAC, // by default
  bitRate: 128000, // by default
  sampleRate: 44100, // by default
);

// Stop recording
await Record.stop();

// Get the state of the recorder
bool isRecording = await Record.isRecording();

// There's nothing to dispose, this done internally each time you call stop method.
// The plugin is aware of activity lifecycle.
// So exiting, your app or activity will stop the recording (but won't delete the
// output file).
```

## Warnings
Be sure to check supported values from the given links above.

## Known issues
None.

repository: lycstar/record

repo_name: lycstar/record


text:
nrf51-uart-bootloader
=====================

A very simple UART bootloader for nRF51822.

This application is to be written in code region 0 on an nRF51822. When running, it can then receive a Intel Hex file,
line by line over the UART port, and write the contents to code region 1. By default, a size of 0x14000 is used for CR0,
but this can be changed if needed.

The application was developed with GCC and on the Evaluation Kit, PCA10001. The quality should be considered to be a
proof of concept, nothing more.

Architecture
============
The bootloader runs in its own code region, and implements assembly wrappers for all interrupts. If the bootloader is not
currently running, any interrupts will be forwarded to the application, so that they can be handled. This gives some
extra latency.

Known issues
============
- The writing is extremely slow. It hasn't been checked in detail why this is, but transmitting a hex file is not an
efficient solution. It was chosen for the simplicity of the PC-side implementation.
- The application has not been tested very thoroughly, and might very well have issues.
- As stated above, this has been developed with GCC, and has not been tested or verified at all with Keil.


text:
---
sidebar_position: 5
title: Linux
description: You can install Podman Desktop on Linux from Flathub, a Flatpak bundle, or a ZIP archive.
tags: [podman-desktop, installing, linux, flathub, flatpak]
keywords: [podman desktop, podman, containers, installing, installation, linux, flathub, flatpak]
---

# Installing Podman Desktop on Linux

Consider installing the Podman Desktop from Flathub to have:

- One command installation
- Package updates

Alternatively, you can install Podman Desktop from:

- [A Flatpak bundle](./linux-install/installing-podman-desktop-from-a-flatpak-bundle)
- [A compressed tar file](linux-install/installing-podman-desktop-from-a-compressed-tar-file)

#### Prerequisites

- [Flatpak](https://flatpak.org/setup/)
- [Podman](https://podman.io/) stable version

#### Procedure

1. Verify the Flathub repository is enabled, and add it if required:

   ```shell-session
   $ flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
   ```

2. Install Podman Desktop from Flathub:

   ```shell-session
   $ flatpak install --user flathub io.podman_desktop.PodmanDesktop
   ```

#### Verification

- Open Podman Desktop from a terminal:

  ```shell-session
  $ flatpak run io.podman_desktop.PodmanDesktop
  ```

#### Update

- Update Podman Desktop from Flathub:

  ```shell-session
  $ flatpak update --user io.podman_desktop.PodmanDesktop
  ```

#### Additional resources

- [Podman Desktop Flathub package](https://flathub.org/apps/details/io.podman_desktop.PodmanDesktop)
- [Using Flatpak](https://docs.flatpak.org/en/latest/using-flatpak.html)

#### Next steps

- [Getting started](../getting-started/getting-started)

repository: containers/podman-desktop

gha_language: TypeScript

repo_name: containers/podman-desktop


text:
squid Cookbook CHANGELOG
=======================
This file is used to list changes made in each version of the squid cookbook.

v0.5.3 (2015-02-04)
-------------------
- [#37] Fix errors on RHEL7, Fedora
- [#36] Fix warning when squid >= 3.2
- [#33] Miscellaneous cleanup
- [#31] Remove `node['ipaddress']` as the only way to get the ipaddress.
- [#30] Add metadata for default recipe

v0.5.2 (2014-10-14)
-------------------
- Support LDAP. (@MattMencel)
- Support multiple listen ports. (@MattMencel)
- Support use of other ACL types other than url_regex. (@thoutenbos)
- Fix test harness on Ubuntu. (@juliandunn)

v0.5.1 (2014-09-02)
-------------------
- Support Ubuntu 14.04. (@maciejmajewski)

v0.5.0 (2014-07-25)
-------------------
- Don't assume default interface is 'eth0' (@juliandunn)
- Fix breakage on Fedora (@juliandunn)
- Enable a simple way to add arbitrary directives to the bottom of the squid.conf (@dansweeting)
- Add enable_cache_dir attribute to allow disabling the cache_dir (@phutchins)
- Permit configuration of cache size (@dschlenk)
- Fix all test harnesses, Rubocop violations

v0.4.2 (2014-03-27)
-------------------
- [COOK-4320] - Add support for ubuntu 13 to the squid cookbook

v0.4.0 (2014-02-27)
-------------------
- [COOK-4373] Add conditional output of optional attribute for cache_peer to template
- [COOK-4376] remove duplicated attributes
- [COOK-4377] Generate a sysconfig on Fedora

v0.3.0 (2014-02-18)
-------------------
[COOK-4066] - squid attributes should be default and not set/normal

v0.2.10
-------
### Bug
- **[COOK-3936](https://tickets.opscode.com/browse/COOK-3936)** - configure squid cache size on disk
- updating style and test harness

v0.2.8
------
### Bug
- **[COOK-3590](https://tickets.opscode.com/browse/COOK-3590)** - Fix hard-coded daemon listen port

v0.2.6
------
Cleanup in 5fc5df4 (v0.2.4) was a bit overzealous:

Ubuntu needs upstart provider specified for the service or reload
failures may occur.

v0.2.4
------
### Bug

- [COOK-2979]: squid cookbook has foodcritic failures
- [COOK-3042]: squid acl incorrect for centos 5

v0.1.0-v0.2.2
--------------
Initial public release and migration from @mattray's repository. Changelog was not created/updated at this time.

gha_language: Ruby


text:
---
published: false
title: i12
layout: post
author: Yu
categories: v32
hidden: true
---

| Item | Detail | Link |
|---:|---|---|
| Authors | Vito M. R. Muggeo| |
| Title |Analyzing Temperature Effects on Mortality Within the R Environment: The Constrained Segmented Distributed Lag Parameterization | [download](http://www.jstatsoft.org/v32/i12/paper) |
| Reference |Vol. 32, Issue 12, Jan 2010 | |
| | Submitted 2008-12-16, Accepted 2009-12-11| |
| Type | Article| |
| Abstract | Here we present and discuss the R package modTempEff including a set of functions aimed at modelling temperature effects on mortality with time series data. The functions fit a particular log linear model which allows to capture the two main features of mortality- temperature relationships: nonlinearity and distributed lag effect. Penalized splines and segmented regression constitute the core of the modelling framework. We briefly review the model and illustrate the functions throughout a simulated dataset.| |
| Paper | Analyzing Temperature Effects on Mortality Within the R Environment: The Constrained Segmented Distributed Lag Parameterization  (application/pdf, 580.4 KB)| [download](http://www.jstatsoft.org/v32/i12/paper) |
| Supplements | | |
| |modTempEff_1.5.tar.gz: R source package  (application/x-gzip, 274.5 KB)|  [download](http://www.jstatsoft.org/v32/i12/supp/1) |
| |v32i12.R: R example code from the paper  (application/octet-stream, 1.3 KB)|  [download](http://www.jstatsoft.org/v32/i12/supp/2) |
| Resources | [BibTeX](http://www.jstatsoft.org/v32/i12/bibtex) [OAI](http://www.jstatsoft.org/oai?verb=GetRecord&identifier=oai.jstatsoft/v32/i12&prefix=oai_dc)| |
| |  | [返回卷目录]({{site.baseurl}}/volume/v32.html) |

repository: yulijia/jstatsoft

repo_name: yulijia/jstatsoft


text:
# Assignment #1

## Yanwei Pan

### 1. Clocking CPU parallelism

(a)  Simulation Code: [clock.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/clock.py)
  Plot Code: [Assignment1_Q1(a).ipynb](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/Assignment1_Q1(a).ipynb)
  ![plot](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/health_simulation_mpi.png)

(b) First of all, according to Amdahl's law, the speedup of N-cores parallel computing is not only up to the number of cores (processors) we use but also up to the fraction of parallel and serial code. Therefore, the speedup isn't linear. Also, there are two bottlenecks in the multicore CPU computing process: the computing bottleneck and the memory bottleneck. In this simulation task, the computing bottleneck does exist. As a result, as the number of cores increases, the speedup couldn't increase linearly.

### 2. Clocking GPU parallelism

(a) Simulation Code: [gpu.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/gpu.py)
It takes 2.310169219970703s to run.

(b) This is quite faster than the mpi4py implementation for 1 core. However, it's still slower than the multicore implementation. This is because we only use one GPU. Compared with CPU, GPU can run much faster for computation.

### 3. Embarrassingly parallel processing: grid search

(a) Code: [grid_search_mpi.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/grid_search_mpi.py)
Computation Time for MPI: 11.182556629180908

(b) Code: [grid_search_opencl.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/grid_search_opencl.py)
Computation Time for OpenCL: 0.12177801132202148
The OpenCL implementation is much faster than MPI. This is because GPU is good at computing. As this task involves computing the average period of each rho, the advantage of using GPU is more explicit.

(c) ![plot](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/Avg%20Periods%20VS%20Rho.png)

(d)
The results from mpi4py implementation:
    The optimal rho is 0.03341708542713562
    The period is 754.707

The results from PyOpenCL implementation:
    The optimal rho is 0.004773869
    The period is 727.259

### 4. More sophisticated parallelism: minimizer

(a)  Code: [minimizer_mpi.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/minimizer_mpi.py)
Computation Time for MPI: 20.86929202079773

(b)  Code: [minimizer_opencl.py](https://github.com/lsc4ss-s20/assignment-1-Panyw97/blob/master/minimizer_opencl.py)
Computation Time for OpenCL: 15.51089358329773

(c)
The results from mpi4py implementation:
    The optimal rho is 0.10005436756323129
    The period is 2611.584
    (However, as I ran the same code on Colab, the result is:
    The optimal rho is 0.09992672365444555
    The period is 716.863
    which seems to be the correct answer. But I haven't debugged it successfully.)

The results from PyOpenCL implementation:
    The optimal rho is 0.09998509
    The period is<PHONE_NUMBER>234375

(d) This exercise is quite slower than the grid search implementations in Excercise 3. That is because `scipy.optimize.minimize()` is a serial function. Although we used parallel computing as we scattered the simulations to every core or kernel, we still need to change the value of `rho` serially. As there may be lots of rhos that we need to try in `scipy.optimize.minimize()`, the computation time may be quite longer than the grid search, which we could previously know the amount of rhos we need to try.

gha_language: Jupyter Notebook

gha_license_id: MIT


text:
### Local set-up

1. Ensure you have PHP 7, Composer, and Yarn installed

2. `composer install && yarn install`

### Linting

`./vendor/bin/phpcs -ns .`

### Running tests

`./vendor/bin/phpunit Test/`

### Versioning

There are two main versions to be aware of:

* Our Composer package version (specified in composer.json)

* Our setup_version (specified in etc/module.xml)

Updates should only change the Composer version unless strictly necessary, as incrementing the setup_version will normally require a merchant to schedule downtime.

### Releasing on the Marketplace

1. Ensure that you've bumped the composer package version

2. Build a zip with `make zip`

3. Submit a new patch at https://developer.magento.com/extensions/, with the version matching the Composer package version on Master

gha_language: PHP


text:
    SAMPLE APP :point_right:

# Cordova Background Plugin

Plugin for the [Cordova][cordova] framework to perform infinite background execution.

Most mobile operating systems are multitasking capable, but most apps don't need to run while in background and not
present for the user. Therefore, they pause the app in background mode and resume the app before switching to foreground
mode.
The system keeps all network connections open while in background, but does not deliver the data until the app resumes.

* [Cordova Background Plugin](#cordova-background-plugin)
  * [Store Compliance](#store-compliance)
  * [Supported Platforms](#supported-platforms)
  * [Installation](#installation)
  * [Usage](#usage)
    * [Enable the background mode](#enable-the-background-mode)
    * [Check if running in background](#check-if-running-in-background)
    * [Listen for events](#listen-for-events)
  * [Android specifics](#android-specifics)
    * [Transit between application states](#transit-between-application-states)
    * [Back button](#back-button)
    * [Recent task list](#recent-task-list)
    * [Detect screen status](#detect-screen-status)
    * [Unlock and wake-up](#unlock-and-wake-up)
    * [Notification](#notification)
      * [Override defaults](#override-defaults)
      * [Add an icon file](#add-an-icon-file)
      * [Run in background without notification](#run-in-background-without-notification)
  * [Quirks](#quirks)
  * [License](#license)

## Store Compliance

Infinite background tasks are not official supported on most mobile operating systems and thus not compliant with public
store vendors. A successful submssion isn't garanteed.

Use the plugin by your own risk!

## Supported Platforms

- __Android/Amazon FireOS__
- __Browser__
- __iOS__
- __Windows__ _(see #222)_

## Installation

The plugin can be installed via [Cordova-CLI][CLI].

Execute from the projects root folder:

```text
cordova plugin add https://github.com/nextivity/cordova-plugin-background-mode
```

## Usage

The plugin creates the object `cordova.plugins.backgroundMode` and is accessible after the *deviceready* event has been
fired.

```js
document.addEventListener('deviceready', function () {
  // cordova.plugins.backgroundMode is now available
}, false);
```

### Enable the background mode

The plugin is not enabled by default. Once it has been enabled the mode becomes active if the app moves to background.

```js
cordova.plugins.backgroundMode.enable();
// or
cordova.plugins.backgroundMode.setEnabled(true);
```

To disable the background mode:

```js
cordova.plugins.backgroundMode.disable();
// or
cordova.plugins.backgroundMode.setEnabled(false);
```

### Check if running in background

Once the plugin has been enabled and the app has entered the background, the background mode becomes active.

```js
cordova.plugins.backgroundMode.isActive(); // => boolean
```

A non-active mode means that the app is in foreground.

### Listen for events

The plugin fires an event each time its status has been changed. These events
are `enable`, `disable`, `activate`, `deactivate` and `failure`.

```js
cordova.plugins.backgroundMode.on('EVENT', function);
```

To remove an event listeners:

```js
cordova.plugins.backgroundMode.un('EVENT', function);
```

## Android specifics

### Transit between application states

Android allows to programmatically move from foreground to background or vice versa.

```js
cordova.plugins.backgroundMode.moveToBackground();
// or
cordova.plugins.backgroundMode.moveToForeground();
```

### Back button

Override the back button on Android to go to background instead of closing the app.

```js
cordova.plugins.backgroundMode.overrideBackButton();
```

### Recent task list

Exclude the app from the recent task list works on Android 5.0+.

```js
cordova.plugins.backgroundMode.excludeFromTaskList();
```

### Detect screen status

The method works async instead of _isActive()_ or _isEnabled()_.

```js
cordova.plugins.backgroundMode.isScreenOff(function (bool) {
...
});
```

### Unlock and wake-up

A wake-up turns on the screen while unlocking moves the app to foreground even the device is locked.

```js
// Turn screen on
cordova.plugins.backgroundMode.wakeUp();
// Turn screen on and show app even locked
cordova.plugins.backgroundMode.unlock();
```

### Notification

To indicate that the app is executing tasks in background and being paused would disrupt the user, the plug-in has to
create a notification while in background - like a download progress bar.

#### Override defaults

The title, text and icon for that notification can be customized as below. Also, by default the app will come to
foreground when tapping on the notification. That can be changed by setting resume to false. On Android 5.0+, the color
option will set the background color of the notification circle. Also on Android 5.0+, setting hidden to false will make
the notification visible on lockscreen.

```js
cordova.plugins.backgroundMode.setDefaults({
  title: String,
  text: String,
  icon: 'icon', // this will look for icon.png in platforms/android/res/drawable|mipmap
  color: String, // hex format like 'F14F4D'
  resume: Boolean,
  hidden: Boolean,
  bigText: Boolean
})
```

__Note:__ All properties are optional - only override the things you need to.

#### Add an icon file

To add an image asset to be used as a notification icon add a resource file definition to the projects `config.xml`.

```xml
<!-- config.xml -->

<platform name="android">
  <!-- Add a notification icon image -->
  <!-- "src" is where the image is; from the project root  -->
  <!-- "target" needs to be the `drawable` dir inside `platforms/android` and the file name must match the `icon` string given in  `cordova.plugins.backgroundMode.setDefaults` -->
  <resource-file src="res/icon/android/icon.png" target="app/src/main/res/drawable/icon.png"/>
</platform>
```

To modify the currently displayed notification

```js
cordova.plugins.backgroundMode.configure({...});
```

#### Run in background without notification

In silent mode the plugin will not display a notification - which is not the default. Be aware that Android recommends
adding a notification otherwise the OS may pause the app.

```js
cordova.plugins.backgroundMode.setDefaults({silent: true});
```

## Quirks

Various APIs like playing media or tracking GPS position in background might not work while in background even the
background mode is active. To fix such issues the plugin provides a method to disable most optimizations done by
Android/CrossWalk.

```js
cordova.plugins.backgroundMode.on('activate', function () {
  cordova.plugins.backgroundMode.disableWebViewOptimizations();
});
```

__Note:__ Calling the method led to increased resource and power consumption.

## License

This software is released under the [Apache 2.0 License][apache2_license].

Made with :yum: from Leipzig

? 2017 [appPlant GmbH][appplant] & [meshfields][meshfields]

[cordova]: https://cordova.apache.org

[CLI]: http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface

[changelog]: CHANGELOG.md

[apache2_license]: http://opensource.org/licenses/Apache-2.0

[appplant]: http://appplant.de

[meshfields]: http://meshfields.de


text:
---
layout: post
title: "Film Courses for Children this Summer"
permalink: /archives/2010/06/film_courses_for_children_this_summer.html
commentfile: 2010-06-10-film_courses_for_children_this_summer
category: around_town
date: 2010-06-10 09:09:27

---

Dreamcatcher Media, based in Twickenham Film Studios are running a film making summer camp for children aged 6 -16 during July and August. The camp will be run from The Cole Court Center at 150 London road, Twickenham.

There is a 5 day course where students make a 5 minute film and produce a dvd at the end or a 2 day stop animation course which can accomodate children from 6 upwards.

See [www.dreamcatchermedia.co.uk](http://www.dreamcatchermedia.co.uk) for more details.

#### Details

-   5 day course prior to June 22nd is £199 after which it's £275
-   2 day animation course prior to June 22nd is £99 and £130 afterwards

repository: pmahnke/stmgrts

gha_language: HTML

repo_name: pmahnke/stmgrts


text:
# monkey.rs

## Summury

We can learn how to make an interpreter and a compiler-vm in this book.
====> ☆☆☆  __["Writing An Interpreter in Go"](https://interpreterbook.com/)__  ☆☆☆
====> ☆☆☆  __["Writing A Compiler In Go"](https://compilerbook.com/)__  ☆☆☆
That interpreter and compiler-VM is called Monkey in the book.
The Monkey is written in Go in the book.
But in this repository it is written in Rust.

## Supports

- [x] Lexer
- [x] Parser
- [x] Evaluator
- [x] Compiler
- [x] VM
- [x] REPL
- [x] Test case
- [x] Evaluator and VM benchmarks
- [x] Not use `unsafe`

## Example

### REPL

```sh
$ cargo run
>> let a = 5
5
>> a + 10
15
>> let new_closure = fn(a) { fn() { a; }; };
Closure[CompiledFunction[0000 GetLocal 0¥n0002 Closure 3 1¥n0006 ReturnValue¥n] ]
>> let closure = new_closure(99);
Closure[CompiledFunction[0000 GetFree 0¥n0002 ReturnValue¥n] 99]
>> closure();
99
```

### Fibonacchi

```monkey
let fibonacci = fn(x) {
  if (x == 0) {
    return 0;
  } else {
    if (x == 1) {
      return 1;
    } else {
      fibonacci(x - 1) + fibonacci(x - 2);
    }
  }
};
fibonacci(15); #=> 610
```

## TODO

- [ ] Improve print output
- [ ] Improve REPL
- [ ] Refactoring
- [ ] Optimize data structure
- [ ] Support LLVM

## Contributors

- [ktanaka101](https://github.com/ktanaka101) - creator, maintainer

## License

MIT

gha_language: Rust


text:
# Euploca rariflora (Stocks) Diane & Hilger SPECIES

#### Status
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Heliotropium rariflorum Stocks

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# cp

> Copy files and folders.

- Copy a file to another location:

`cp {{path/to/file.ext}} {{path/to/copy.ext}}`

- Copy a file into another folder, keeping the filename:

`cp {{path/to/file.ext}} {{path/to/target_parent_folder}}`

- Copy a folder recursively to another location:

`cp -r {{path/to/folder}} {{path/to/copy}}`

- Copy a folder recursively, in verbose mode (shows files as they are copied):

`cp -vr {{path/to/folder}} {{path/to/copy}}`

- Copy the contents of a folder into another folder:

`cp -r {{path/to/source_folder/*}} {{path/to/target_folder}}`

- Copy text files to another location, in interactive mode (prompts user before overwriting):

`cp -i {{*.txt}} {{path/to/target_folder}}`

repository: LTHODAVDOPL/tldr

repo_name: LTHODAVDOPL/tldr


text:
---
title: "Object Conversion"
keywords: object conversion
sidebar: api_sidebar
permalink: object-conversion.html
toc: false
comments: false
---
`xmlbuilder2` can convert JS objects into XML nodes. Each key/value pair of a JS object is converted into an element node, where object key becomes the node name and object value becomes the node contents.

```js
const { create } = require('xmlbuilder');

const obj = {
  root: 'text'
};
const doc = create().ele(obj);
console.log(doc.end({ prettyPrint: true }));
```
```xml
<?xml version="1.0"?>
<root>text</root>
```
If the object value is another JS object, it will be recursively converted into nodes.
```js
const { create } = require('xmlbuilder');

const obj = {
  root: {
    foo: {
      bar: 'foobar'
    }
  }
};
const doc = create().ele(obj);
console.log(doc.end({ prettyPrint: true }));
```
```xml
<?xml version="1.0"?>
<root>
  <foo>
    <bar>foobar</bar>
  </foo>
</root>
```
If the object value is an array, each array item will be converted into a child node. In that case, name of the child nodes will be the object key.
```js
const { create } = require('xmlbuilder');

const obj = {
  root: {
    child: [
      'one',
      'two',
      'three'
    ]
  }
};
const doc = create().ele(obj);
console.log(doc.end({ prettyPrint: true }));
```
```xml
<?xml version="1.0"?>
<root>
  <child>one</child>
  <child>two</child>
  <child>three</child>
</root>
```

Although this allows element and text nodes to be easily created, a special syntax is needed for other types of nodes and element attributes. This special syntax is provided with converter strings.  Default converter strings and their behavior are as follows.

### Converter Strings

Converter strings can be customized with the `convert` option while initializing the builder; see [builder options]({{ site.baseurl }}{% link pages/builder-functions.md %}#builder-options).

#### att

Converts its key-value pair to an element attribute. Defaults to `'@'`.
```js
obj = { pilot: { '@callsign': 'Maverick', '@rank': 'Lieutenant' } }
```
will be converted into:
```xml
<pilot callsign="Maverick" rank="Lieutenant"/>
````

{% capture cb_note %}
  An alternative notation is to group multiple attributes under the attribute key.
```js
obj = { pilot: { '@': { 'callsign': 'Maverick', 'rank': 'Lieutenant' } } }
```
  is also converted into:
```xml
<pilot callsign="Maverick" rank="Lieutenant"/>
````
{% endcapture %}
{% include note.html content=cb_note markdown=1 %}

___

#### ins

Converts its value to a processing instruction node. Defaults to `'?'`. Instruction target and value should be separated with a single space character.
```js
obj = {
  '?': 'background classified ref="NAM#123456"',
  pilot: 'Pete Mitchell'
}
```
becomes:
```xml
<?background classified ref="NAM#123456"?>
<pilot>Pete Mitchell</pilot>
````
___

#### text

Converts its value to a text node if it is a string, otherwise expands its value under its parent element node. Defaults to `'#'`.
```js
obj = { monologue: {
  '#': 'Talk to me Goose!'
} }
```
becomes:
```xml
<monologue>Talk to me Goose!</monologue>
```

{% capture cb_note %}
  `text` converter is usually not needed as object values are converted to text nodes
  by default. So the above example is equivalent to:
```js
obj = { monologue: 'Talk to me Goose!' }
```
```xml
<monologue>Talk to me Goose!</monologue>
```
  `text` converter is needed in advanced use cases as explained below.
{% endcapture %}
{% include note.html content=cb_note markdown=1 %}

{% capture cb_note %}
  Since JS objects cannot contain duplicate keys, multiple text nodes can be
  created by adding some unique text after each object key or grouping node
  contents in an array. Example:
```js
obj1 = { monologue: {
  '#1': 'Talk to me Goose!',
  '#2': 'Talk to me...'
} }
obj2 = { monologue: {
  '#': [
    'Talk to me Goose!',
    'Talk to me...'
  ]
} }
```
both become:
```xml
<monologue>Talk to me Goose!Talk to me...</monologue>
```
{% endcapture %}
{% include note.html content=cb_note markdown=1 %}

{% capture cb_note %}
  `'#'` also allows mixed content. Example:
```js
obj1 = { monologue: {
  '#1': 'Talk to me Goose!',
  'cut': 'dog tag shot',
  '#2': 'Talk to me...'
} }
obj2 = { monologue: {
  '#': [
    'Talk to me Goose!',
    { 'cut': 'dog tag shot' },
    'Talk to me...'
  ]
} }
```
both become:
```xml
<monologue>
  Talk to me Goose!
  <cut>dog tag shot</cut>
  Talk to me...
</monologue>
```
{% endcapture %}
{% include note.html content=cb_note markdown=1 %}
___

#### cdata
Converts its value to a CDATA section node. Defaults to `'$'`.
```js
obj = {
  '$': '<a href="https://topgun.fandom.com/wiki/MiG-28"/>',
  aircraft: 'MiG-28'
}
```
becomes:
```xml
<![CDATA[<a href="https://topgun.fandom.com/wiki/MiG-28"/>]]>
<aircraft>MiG-28</aircraft>
````
___

#### comment
Converts its value to a comment node. Defaults to `'!'`.
```js
obj = {
  '!': 'Fictional; MiGs use odd numbers for fighters.',
  aircraft: 'MiG-28'
}
```
becomes:
```xml
<!--Fictional; MiGs use odd numbers for fighters.-->
<aircraft>MiG-28</aircraft>
```

### Namespaces

When converting JS objects, element and attribute namespaces can be specified as follows:
```js
obj = {
  'root@http://example.com/ns1': 'foo'
}
```
becomes:
```xml
<root xmlns="http://example.com/ns1">foo</root>
```


text:
# Locales

It's possible easily through the settings, to define the language that will be used for the logs.

::: tip
axe-core already has several languages available.
[See axe-core locales](https://github.com/dequelabs/axe-core/tree/develop/locales)
:::

```js
import ptBR from 'axe-core/locales/pt_BR.json'

Vue.use(VueAxe, {
  config: {
    locale: ptBR
  }
})
```

gha_language: JavaScript


text:
---
title: 'preload with font-display: optional is an Anti-pattern'
permalink: /web/preload-font-display-optional/
tags:
  - font-loading
---

Most of the _quick win_ font loading advice I’m seeing right now (and some [that I give out](/web/23-minutes/)) involves combining `preload` and the `font-display` CSS descriptor.

Just to level-set, `preload` is a way to trigger your web font requests sooner, putting them higher in the network request waterfall. `font-display` is a way to declaratively control your font loading behavior by adding a descriptor to your `@font-face` block.

_Read more at [The Comprehensive Guide to Font Loading Strategies](/web/comprehensive-webfonts/)_

Lately, I’ve seen a few developers recommend `font-display: optional`. `font-display: optional` puts your web fonts on the back burner and only renders them on repeat primed-cache visits. It’s a perfectly acceptable method if web fonts are lower on the priority list for your use case’s requirements. For the record, I’m not a huge fan of `optional` because I like to at least attempt to render web fonts on an empty-cache visit. _Caveat: in [“The Compromise,”](/web/the-compromise/) `font-display: optional` is emulated for browsers that do not support the CSS Font Loading API, a method to start moving away from using font loading polyfills for modern browsers._

However, after seeing some confusion on Twitter, I think it’s probably worth noting that if you decide to use `font-display: optional`, it would be a waste of your page’s resources to also use `preload`. It won’t break anything, it’ll just trigger that web font request early (causing network congestion if you have other critical path resources that need to be fetched). An early request won’t buy you much if the web fonts aren’t going to render when they finish.

* `preload` with `font-display: optional`: Not great ⚠
* `preload` with `font-display: swap`: Good ✅
* `preload` with `font-display: fallback`: Good ✅
* `font-display: block` with anything: Bad 🚫

Hope that clears up some of the confusion!


text:
---
layout: default
---

# 1994-07-26 - Continum of numbers and Turing Machines

## Header Data

From: Jim choate<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 0987d4897f88169698971f6328a36fc72cfa3223189890a2d709315123b9dd83

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-07-26 23:50:49 UTC

Raw Date: Tue, 26 Jul 94 16:50:49 PDT

## Raw message

```
{% raw  %}From: Jim choate<EMAIL_ADDRESS>Date: Tue, 26 Jul 94 16:50:49 PDT
To<EMAIL_ADDRESS>Subject: Continum of numbers and Turing Machines
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

Hi all,

Just a thought,

Seems to me that a Turing Machine can't simulate a continous section of
R for a simple reason, computers can only work on rational numbers and
a continous section would have irrationals in it.

Take care.

{% endraw %}
```

## Thread

+ Return to [July 1994](/archive/1994/07)

+ Return to "[Andrew Purshottam <andy@autodesk.com>](/authors/andrew_purshottam_andy_at_autodesk_com_)"
+ Return to "[Berzerk <berzerk@xmission.xmission.com>](/authors/berzerk_berzerk_at_xmission_xmission_com_)"
+ Return to "["Dietrich J. Kappe" <kap1@wimpy.cpe.uchicago.edu>](/authors/dietrich_j_kappe_kap1_at_wimpy_cpe_uchicago_edu_)"
+ Return to "[Jim choate <ravage@bga.com>](/authors/jim_choate_ravage_at_bga_com_)"
+ Return to "["Perry E. Metzger" <perry@imsi.com>](/authors/perry_e_metzger_perry_at_imsi_com_)"

+ 1994-07-26 (Tue, 26 Jul 94 16:50:49 PDT) - Continum of numbers and Turing Machines - _Jim choate<EMAIL_ADDRESS>  + 1994-07-27 (Tue, 26 Jul 94 19:20:03 PDT) - [Re: Continum of numbers and Turing Machines](/archive/1994/07/ebf93df8f6a0b19cc057cd2864b4b562a9687f1fd7828b20a551e4894b214d4a) - _Berzerk<EMAIL_ADDRESS>  + 1994-07-27 (Wed, 27 Jul 94 11:00:36 PDT) - [Re: Continum of numbers and Turing Machines](/archive/1994/07/72637b6e3fc06ec68dca5a648a8601feabc019a6e4f98231a8f7a6a05af9269b) - _Andrew Purshottam<EMAIL_ADDRESS>    + 1994-07-28 (Wed, 27 Jul 94 18:53:37 PDT) - [Re: Continum of numbers and Turing Machines](/archive/1994/07/9c685095fe46b0ca03ead665c8692beafd12dcc6cc995f667738ab03e4659c0f) - _"Perry E. Metzger"<EMAIL_ADDRESS>      + 1994-07-28 (Wed, 27 Jul 94 20:24:19 PDT) - [Continum of numbers and Turing Machines](/archive/1994/07/ed91204b106af27646287fd881c00a53bd2a5934bf348cfb5c441d181b066747) - _"Dietrich J. Kappe"<EMAIL_ADDRESS>      + 1994-07-28 (Wed, 27 Jul 94 20:25:50 PDT) - [Continum of numbers and Turing Machines](/archive/1994/07/92d3b5815a441279be3b12f618291e26cc5fdb272d1914325837ae3bf1f01cdb) - _"Dietrich J. Kappe"<EMAIL_ADDRESS>


text:
# go-ms-toolkit
[![Build Status](https://travis-ci.org/dipperin/go-ms-toolkit.svg?branch=master)](https://travis-ci.org/dipperin/go-ms-toolkit)
[![Go Report Card](https://goreportcard.com/badge/github.com/dipperin/go-ms-toolkit)](https://goreportcard.com/report/github.com/dipperin/go-ms-toolkit)
[![codecov](https://codecov.io/gh/dipperin/go-ms-toolkit/branch/master/graph/badge.svg)](https://codecov.io/gh/dipperin/go-ms-toolkit)

`go-ms-toolkit` is a programming toolkit for building microservices (or elegant monoliths) in Go

gha_language: Go


text:
# LIRI (Language Interpretation and Recognition Interface)

LIRI is a command line Node application that takes in parameters (via command line arguments or file input) to display tweets, songs from Spotify, and movie information from OMDB.

---------------------------
[![NPM](https://nodei.co/npm/liri-cli.png)](https://www.npmjs.com/package/liri-cli)

[![npm version](https://badge.fury.io/js/liri-cli.svg)](https://www.npmjs.com/package/liri-cli)
[![npm](https://img.shields.io/npm/dt/liri-cli.svg)](https://www.npmjs.com/package/liri-cli)
[![GitHub last commit](https://img.shields.io/github/last-commit/jeffreylowy/liri-node-app.svg)](https://github.com/jeffreylowy/liri-node-app)

## Table of Contents

- [Liri Commands](#liri-commands)
- [API Keys](#api-keys)
- [Make LIRI speak](#make-liri-speak)
- [Install and run via NPM](#install-and-run-via-npm)
- [Resources](#resources)

---------------------------

### LIRI Commands

`node ./liri [movie, spotify, tweets, do] <value> (--say)`

**Command**|**Value**|**Options**|**Example**|**Description**
:-----:|:-----:|:-----:|:-----:|:-----:
movie|"movie title"|--say|node liri "Blade Runner 2049" --say|Display movie information from OMDB. If host environment is macOS/Darwin, the --say flag will convert the plot text to audible speech.
spotify|"song title"|-|node liri "Thriller"|Display song information from Spotify. The default song is "The Sign" if no value is entered via the command line.
tweets|twitter handle|-|node liri "jeffreylowy"|Display 20 tweets from Twitter. The default account is @barackobama if no value is entered via the command line.
do-what-it-says|-|-|node liri do-what-it-says|Run whatever command and value are saved to the random.txt stored in the commands directory

You can also run via npm scripts.

`npm run [movie, spotify, tweets, do] <value>`

_`--say` currently does not work when run via npm script._

### API Keys

Rather than include a `keys.js` file, I used the [dotenv](https://www.npmjs.com/package/dotenv) package to create environment variables. The `.env` file is the first file required in `./liri.js`, which stores environment-specific variables in the form of `NAME=VALUE`.

Replace XXXXXX with the key/secret/token for each service.

```
OMDB_API_KEY=XXXXX
SPOTIFY_CLIENT_ID=XXXXX
SPOTIFY_CLIENT_SECRET=XXXXX
TWITTER_CONSUMER_KEY=XXXXX
TWITTER_CONSUMER_SECRET=XXXXX
TWITTER_ACCESS_TOKEN_KEY=XXXXX
TWITTER_ACCESS_TOKEN_SECRET=XXXXX
```
`process.env` now has the keys and values defined in the `.env` file

```javascript
// Line 16 in ./commands/twitter.js
let twitter = new Twitter({
	consumer_key: process.env.TWITTER_CONSUMER_KEY,
	consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
	access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
	access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
});
```

For more information, visit the NPM page for the [dotenv](https://www.npmjs.com/package/dotenv) package.

### Make LIRI speak

If Node is running on macOS/Darwin, you can make LIRI read movie plot information by passing the `--say` flag after the movie's title. This only works when the full command is entered.

Example: `node ./liri movie "Blade Runner 2049" --say`

<img src="docs/carbon-say.png">

### Install and run via NPM

This project was uploaded to NPM under the package name `liri-cli`. Though I hope to get there, the package is not yet ready to be installed globally.

Install: `npm i liri-cli`

_`--say` currently does not work when run via npm script._

### Resources

[Node docs: child_process.spawn](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)

[MDN: Number.prototype.toLocaleString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString)

[MDN: async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)

[Carbon: Source code images](https://carbon.now.sh/)

[David Walsh: Git Undo](https://davidwalsh.name/git-undo)

[codeburst.io: Array.find & Array.findIndex](https://codeburst.io/learn-javascript-es6-array-find-array-findindex-7fe4f63c6974)


text:
---
title: "Pandas Alternatives : Modin"
header :
  teaser: /assets/images/modin.png

categories:
  - Python
tags:
  - Pandas
  - Python

---

Pandas library has became the "one must installed" library for data manipulation in python and is widely used by data scientist and analyst. Pandas provide an easier way to do preprocessing and analysis on our data. However, there are times when the dataset is too large and `Pandas` may run into memory errors. The primary reason for the slowdown is pandas can’t run the program parallelly, and it only uses one CPU core for running the program. We have to shift to distributed computing platforms like Spark for working on large data.

Modin is an open source library developed by UC Berkeley’s RISELab  to speed up the computation by distributive computing. Modin uses Ray/Dask libraries in backend to parallelize the code and also we don’t need any distributive computing knowledge to use Modin. Modin Dataframe has a similar API to Pandas. So all we are to do is to continue using Pandas API as was before. Modin provides the speedup of upto 4x on 4 core laptop. Modin can be used for dataset size ranging from 1MB to 1TB.

By simply replacing the import statement, Modin offers users effortless speed and scale for their pandas workflows:

![import](https://github.com/modin-project/modin/raw/master/docs/img/Import.gif)

To learn more about the speedups you could get with Modin and try out some examples on your own, check out our [10-minute quickstart guide](https://modin.readthedocs.io/en/latest/getting_started/quickstart.html) to try out some examples on your own!

## Installation
Modin can be installed with pip on Linux, Windows and MacOS:

```
pip install modin[all]
```

## Pandas API Coverage

![API](https://editor.analyticsvidhya.com/uploads/56350WhatsApp%20Image%202022-05-23%20at%2010.05.48%20AM.jpeg)

For the functions that are not implemented in Modin, they automatically default to pandas. So for the functions that are not implemented in pandas and for user-defined functions(apply functions in pandas), Modin will convert the Modin DataFrame to Pandas DataFrame and then apply those functions. There will be some performance penalty for converting to Pandas Dataframe.

## Faster pandas, even on your laptop

The `modin.pandas` DataFrame is an extremely light-weight parallel DataFrame. Modin transparently distributes the data and computation so that you can continue using the same pandas API while working with more data faster. Because it is so light-weight, Modin provides speed-ups of up to 4x on a laptop with 4 physical cores.

In pandas, you are only able to use one core at a time when you are doing computation of any kind. With Modin, you are able to use all of the CPU cores on your machine. Even with a traditionally synchronous task like `read_csv`, we see large speedups by efficiently distributing the work across your entire machine.

```python
import modin.pandas as pd

df = pd.read_csv("my_dataset.csv")
```

![](https://raw.githubusercontent.com/modin-project/modin/master/docs/img/read_csv_benchmark.png)

Modin can handle the datasets that pandas can't
often data scientists have to switch between different tools for operating on datasets of different sizes. Processing large dataframes with pandas is slow, and pandas does not support working with dataframes that are too large to fit into the available memory. As a result, pandas workflows that work well for prototyping on a few MBs of data do not scale to tens or hundreds of GBs (depending on the size of your machine). Modin supports operating on data that does not fit in memory, so that you can comfortably work with hundreds of GBs without worrying about substantial slowdown or memory errors. With cluster and out of core support, Modin is a DataFrame library with both great single-node performance and high scalability in a cluster.

repository: Saltfarmer/blog

repo_name: Saltfarmer/blog


text:
# Cisco NXOS

[Cisco NXOS](https://www.cisco.com/c/en/us/products/ios-nx-os-software/nx-os/index.html) virtual appliance is identified with `vr-nxos` kind in the [topology file](../topo-def-file.md). It is built using [hellt/vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.

!!!note
    This is a Titanium based system, which is an older version of NX-OS.

vr-nxos nodes launched with containerlab come up pre-provisioned with SSH service enabled.

## Managing vr-nxos nodes
Cisco NXOS node launched with containerlab can be managed via the following interfaces:

=== "bash"
    to connect to a `bash` shell of a running vr-nxos container:
    ```bash
    docker exec -it <container-name/id> bash
    ```
=== "CLI via SSH"
    to connect to the NX-OS CLI
    ```bash
    ssh clab@<container-name/id>
    ```

!!!info
    Default user credentials: `admin:admin`

## Interfaces mapping
vr-nxos container can have up to 90 interfaces and uses the following mapping rules:

* `eth0` - management interface connected to the containerlab management network
* `eth1` - first data interface, mapped to first data port of NX-OS line card
* `eth2+` - second and subsequent data interface

When containerlab launches vr-nxos node, it will assign IPv4/6 address to the `eth0` interface. These addresses can be used to reach management plane of the router.

Data interfaces `eth1+` needs to be configured with IP addressing manually using CLI/management protocols.

## Features and options
### Node configuration
vr-nxos nodes come up with a basic configuration where only the control plane and line cards are provisioned, as well as the `clab` user.


text:
# qstring

[![npm (scoped)](https://img.shields.io/npm/v/@aaronhayes/qstring?style=flat-square)](https://www.npmjs.com/package/@aaronhayes/qstring)
![Build](https://img.shields.io/travis/aaronhayes/qstring?style=flat-square)
![Codecov](https://img.shields.io/codecov/c/github/aaronhayes/qstring?style=flat-square)
[![Bundle Size](https://img.shields.io/bundlephobia/min/@aaronhayes/qstring?style=flat-square)](https://bundlephobia.com/result?p=<EMAIL_ADDRESS>![License](https://img.shields.io/npm/l/@aaronhayes/qstring?style=flat-square)

The easiest way to build querystrings. A lightweight, easy to use way to build full urls including the querystring. Less than [400B Minified & GZipped](https://bundlephobia.com/result?p=@aaronhayes/qstring@1.0.1)!

The popular [query-string](https://github.com/sindresorhus/query-string) only handles the part querystring part, so there is another step of building the final url. The API inspired by JedWatson's [Classnames](https://github.com/JedWatson/classnames) Package.

## Install

```
$ npm install --save @aaronhayes/qstring
```

```
$ yarn add @aaronhayes/qstring
```

## Usage

```TypeScript
import qstring, { ArrayFormat } from '@aaronhayes/qstring';

const qs = qstring('https://myapi.com', {
    foo: 'bar',
    foobar: true,
    foo3: null,
    foo4: undefined
});

console.log(qs);
// https://myapi.com?foo=bar&foobar=true

const qs = qstring(
    'https://myapi.com',
    {
        foo: ['hello', 'world'],
        cat: 'dog'
    }
);

console.log(qs);
// https://myapi.com?foo=hello&foo=world&cat=dog

const qs = qstring(
    'https://myapi.com',
    {
        foo: ['hello', 'world'],
        cat: 'dog'
    },
    ArrayFormat.comma
);

console.log(qs);
// https://myapi.com?foo=hello,world&cat=dog

```

## See Also

- [query-string](https://github.com/sindresorhus/query-string)
- [Classnames](https://github.com/JedWatson/classnames)
- [Typescript Starter](https://github.com/bitjson/typescript-starter)

repository: aaronhayes/qstring

repo_name: aaronhayes/qstring


text:
## Splunk Twilio Modular Alert v0.5

## Overview

This is a Splunk Modular Alert for sending SMS messages using Twilio.

## Dependencies

* Splunk 6.3+
* Supported on Windows, Linux, MacOS, Solaris, FreeBSD, HP-UX, AIX

## Setup

* Untar the release to your $SPLUNK_HOME/etc/apps directory
* Restart Splunk

## Configuration

You will need a Twilio account to use this Modular Alert.

You can sign up at twilio.com

Once your Twilio account is setup you will then be able to obtain your Auth Token and Account SID from your profile.

To enter these values in Splunk , just browse to Settings -> Alert Actions -> Twilio SMS Alerts -> Setup Twilio SMS Alerting

## Using

Perform a search in Splunk and then navigate to : Save As -> Alert -> Trigger Actions -> Add Actions -> Twilio SMS Alerts

On this dialogue you can enter your "from number", "to number" and "SMS message"

For the SMS message field , token substitution can be used just the same as for email alerts.

http://docs.splunk.com/Documentation/Splunk/latest/Alert/Setupalertactions#Tokens_available_for_email_notifications

## Logging

Browse to : Settings -> Alert Actions -> Twilio SMS Alerts -> View Log Events

Or you can search directly in Splunk : index=_internal sourcetype=splunkd component=sendmodalert action="twilio"

## Troubleshooting

1) Is your "from number" correct and valid for sending SMS messages via Twilio ?
2) Are your alerts actually firing ?
3) Are your Auth token and Account SID correct ?

## Contact

This project was initiated by Damien Dallimore<EMAIL_ADDRESS>


text:
JSON Schema UI
==============

Define data content in JSON schema with validations/rules/dependencies and generate UI
--------------------------------------------------------------------------------------

Application built with the following technologies:

- Scala 2.11.1

- SBT 0.13.5

- Akka 2.3.0

- Play 2.3.0

- Reactive Mongo 0.11.0

- Specs2 2.3.8

- AngularJS 1.3.0-beta.13

and including

- HTML, CSS, CoffeeScript, Twitter Bootstrap

Introduction
------------

TODO

Setup
-----

To get you going with this application, just follow along

Scala, SBT and Play must be installed - the following assumes you are using "Homebrew", if not, tough luck:
> brew install scala

> brew install sbt

> brew install typesafe-activator

That last "brew" command in the past would have been "brew install play" but as of Play 2.3.0, the typesafe activator is utilised.
(In the following commands "activator" is again used instead of the usual "play").

In a directory where you wish to clone this project from git:
> $ git clone https://github.com/davidainslie/json-schema-ui.git

Go into the application's new project directory and complete the following:
> $ cd json-schema-ui

> $ activator

> [json-schema-ui] $ update-classifiers

> [json-schema-ui] $ idea sbt-classifiers with-sources=yes

> [json-schema-ui] $ test

Hopefully all "tests" will pass and you can now open up IntelliJ and start doing some damage.
(Sorry for not including Eclipse, but just replace the above "idea" entry appropriately).

Specs
-----
First take a look at the specs.
They can be run individually in your IDE or from SBT command line console using the "test" command.
There are both unit and integration specs, where the integration specs often use an embedded Mongodb.

To run the "integration specs" you will need PhantomJS:

> $ brew install phantomjs

Note that Ghost driver is being used where the dependency can be found in build.sbt

Application
-----------

TODO

repository: davidainslie/json-schema-ui

repo_name: davidainslie/json-schema-ui


text:
ELMS and CrocoDoc FullScreen
===================

Canvas has a great set of tools for editing, but everything is trapped in a tiny view. This extension just directly opens the feedback in the same window, full screen! I built this to improve my experience while taking an English course.

# Available for free on the [chrome appstore](https://chrome.google.com/webstore/detail/elms-and-crocodoc-fullscr/plmlhafmgopajgbdobknemohlcnohbgb?utm_source=gmail)
Canvas has a great set of tools for editing (CrocoDoc), but everything is trapped in a tiny view. You can manually inspect the source code of the page and open the feedback form in a new tab; however, this extension does it for you. The extension changes the link of the "View Feedback" button to open the document in the same page or by clicking the arrow in a new tab.

If you are looking for an alternative option to open any iframe in a new tab, see [Open Frame](https://chrome.google.com/webstore/detail/open-frame/kdhjgkkaacdhdioocfbpmhjidbinfajj)

## The things to be developed:
1. ~~Find iframe link with jQuery~~
1. ~~Redirect page to new tab~~
1. Store list of recent links and display the last 5? Bookmarks for documents? [guide](https://developer.chrome.com/extensions/browserAction)
1. Connect to the Canvas API and send a notification when you receive feedback?

## References
> How the app was built

- Built with Bootstrap, jQuery, and plenty of guides
- Sometimes it helps to return to the [fundamentals](http://jqfundamentals.com/chapter/jquery-basics)
- [Eloquent JavaScript is my go to reference](http://eloquentjavascript.net/03_functions.html)
- This [StackOverflow](http://stackoverflow.com/a/13756526/3219667) answer helped overcome a small bug with font awesome
- It always helps to know where the [invisible background page is](http://stackoverflow.com/questions/10257301/where-to-read-console-messages-from-background-js-in-a-chrome-extension)
- Built in [Sublime](https://atom.io/) with quick [reloads](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid) and [lots of color choices](http://coolors.co/app/)

repository: KyleKing/My-Programming-Sketchbook

repo_name: KyleKing/My-Programming-Sketchbook