text:
# καταγωνίζομαι.

<!-- Status: S2=Needs2ndReview -->
<!-- Lexica used for edits: BDAG, FFM, LN, BN, A-S -->

## Word data

* Strongs: G26100.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 1.

* All Scriptures cited: Yes.

## Etymology:

* LXX/Hebrew glosses:

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses:

### Sense 1.0:

#### Definition:

To achieve total victory over

#### Glosses:

defeat, conquer, overcome

#### Explanation:

#### Citations:

;[οἳ](../G37390/01.md) [διὰ](../G12230/01.md) [πίστεως](../G41020/01.md) κατηγωνίσαντο [βασιλείας](../G09320/01.md) [εἰργάσαντο](../G20380/01.md) [δικαιοσύνην](../G13430/01.md) [ἐπέτυχον](../G20130/01.md) [ἐπαγγελιῶν](../G18600/01.md) [ἔφραξαν](../G54200/01.md) [στόματα](../G47500/01.md) [λεόντων](../G30230/01.md),
;"It was through faith that they conquered kingdoms, worked justice, and received promises. They stopped the mouths of lions,",  (ULB)
:[Heb 11:33](heb 11:33).

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
---
title: Google Adsense and Disqus
date: 2019-10-02T12:32:15-06:00
author: gerryw1389
layout: single
classes: wide
permalink: 2019/10/google-adsense-and-disqus
categories:
  - WebSoftware
---
<!--more-->

### Description:

This post describes how I added Google Adsense and Disqus to the Github Pages hosted website. Not sure if this is 100% legal yet, but [I think so](https://webapps.stackexchange.com/questions/56898/am-i-allowed-to-host-a-commerical-website-on-github-pages)

### To Resolve:

1. Google Adsense

   - In order to add Google Adsense from my blog I need to create a custom script to insert between `<head>` elements

   - Since I'm currently using the remote theme [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes), this means adding the following file in my local instance:

   ```shell
   cd /mnt/c/_gwill/google/scripts/powershell/site/gerryw1389.github.io
   mkdir ./includes/
   mkdir ./includes/head
   touch ./includes/head/custom.html
   ```

   - Copy and paste the following, then save and exit:

   ```javascript
   <!-- start custom head snippets -->

   <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
   <script>
   (adsbygoogle = window.adsbygoogle || []).push({
      google_ad_client: "ca-pub-someChars",
      enable_page_level_ads: true
   });
   </script>

   <!-- insert favicons. use https://realfavicongenerator.net/ -->

   <!-- end custom head snippets -->
   ```

   - Then do a `git commit` and `git push` to Github as usual and wait for the build to complete.

   - Now go back to Google Adsense and look and see what it says:

   ![adsense](https://automationadmin.com/assets/images/uploads/2019/06/adsense.png){:class="img-responsive"}

2.

   - Then in your `_config.yml`

   ```yaml
   site settings:
   comments:
   provider: "disqus"
   disqus:
      shortname: "automationadmin-com"

   # Down below, in post settings, add
   comments: true
   ```

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Changes in Sharp.Diagnostics.Logging
This file documents all notable changes.

Most lines should begin with one of these words:
*Add*, *Fix*, *Update*, *Change*, *Deprecate*, *Remove*.

<!--
## [Unreleased](https://github.com/sharpjs/Sharp.Diagnostics.Logging/compare/v1.0.1...HEAD)
-->

## [1.0.1](https://github.com/sharpjs/Sharp.Diagnostics.Logging/compare/v1.0.0...release/1.0.1)
- Fix packaging issues:
  - Enable deterministic build.
  - Embed untracked sources in symbols package.

## [1.0.0](https://github.com/sharpjs/Sharp.Diagnostics.Logging/compare/v0.1.0...release/1.0.0)
- Update build targets to .NET Framework 4.6.1 (was 4.5) and .NET Standard 2.0
- Update test targets to .NET Framework 4.8, .NET Core 3.1 (was 3.0), and .NET 6.0
- Update System.Diagnostics.DiagnosticSource to 6.0.0
- Modernize project structure

## [0.1.0](https://github.com/sharpjs/Sharp.Diagnostics.Logging/compare/v0.0.0...v0.1.0)
- Add dependency: `System.Diagnostics.DiagnosticSource`
- Add support for correlation via `System.Diagnostics.Activity`
- Update test targets to .NET Framework 4.8 and .NET Core 3.0

## [0.0.0](https://github.com/sharpjs/Sharp.Diagnostics.Logging/tree/v0.0.0)
Initial release.

<!--
  Copyright 2022 Jeffrey Sharp

  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-->

license: ISC


text:
# CarthageRemoteCache

[![Test Status](https://github.com/kayak/carthage_remote_cache/actions/workflows/ruby.yml/badge.svg)](https://github.com/kayak/carthage_remote_cache/actions/workflows/ruby.yml)
[![Gem Version](https://badge.fury.io/rb/carthage_remote_cache.svg)](https://badge.fury.io/rb/carthage_remote_cache)

Centralized cache to serve Carthage frameworks. Useful for distributed CI setup with several build machines. It's aware of your `xcodebuild` and `swift` versions and builds on top of Carthage's `.xyz.version` file mechanism.

## Installation

The gem is published at [rubygems.org](https://rubygems.org/gems/carthage_remote_cache), installation is as easy as:

    $ gem install carthage_remote_cache

_Note: Installing ri documentation for sinatra can be quite slow. Install with_ `--no-rdoc --no-ri` _if you don't want to wait._

## Quickstart

1. Run `carthagerc server` to start the cache on a remote server
2. `cd` to your project's root folder
3. Run `carthagerc init` to create `Cartrcfile` and point the server property to your  running server URL
4. Assuming your `Carthage` directory is already built, run `carthagerc upload` to populate remote cache
5. Push your `Cartrcfile` and from a different machine run `cartrcfile download` to fetch frameworks into `Carthage/Build/` folder
6. Build your app without having to wait for `carthage bootstrap`

## Usage

### Init

Before running any other commands, it's required to initialize `carthagerc` in your project directory by running:

    $ carthagerc init

Which produces a `Cartrcfile`. Configuration is done via plain `ruby` code, so it is as simple as:

    Configuration.setup do |c|
      c.server = "http://localhost:9292/"
    end

`Cartrcfile` is supposed to be version controlled (e.g. included in git repository), so that it lives along your code and all consumers of the repository have access to same configuration.

### Upload Workflow

Make sure that all your framework binaries have been built with `carthage`, otherwise there is nothing to upload.

    $ carthage bootstrap

Start the upload with:

    $ carthagerc upload

After couple of seconds you should be able to see confirmation in terminal:

    Uploaded 53 archives (97.2 MB), skipped 0.

#### Overwriting Existing Cache

Attempting to run `carthagerc upload` again will not upload any framework binaries, since all of them are already present on the cache server:

    Uploaded 0 archives (0.0 MB), skipped 53.

If your cache happens to be tainted by invalid framework binaries, you can overwrite existing cache with

    $ carthagerc upload --force

#### Upgrading Xcode or Swift

It is recommended to always perform the upload workflow after upgrading Xcode and Swift versions since `carthagerc` cached frameworks are not only bound to framework versions, but also to your build environment.

### Download Workflow

Once the cache server has been populated with framework binaries, it's time to fetch frameworks from a different machine. Make sure to pull in `Cartrcfile` from the repository before executing:

    $ carthagerc download

You should expect to see the following output on a machine with empty `Carthage` folder:

    Downloaded and extracted 53 archives (97.2 MB), skipped 0 archives.

Your project should be ready for building.

#### Overwrite Local Carthage Folder

In case you happen to change a file in `Carthage/Build` by accident, it's possible to force download all frameworks again with:

    $ carthagerc download --force

#### Download Only Some Platforms

The example above downloaded all frameworks for all platforms (iOS, macOS, tvOS, watchOS). If large dependencies or network speed are an issue, you can download only a subset of the platforms by using the `--platform` argument:

    $ carthagerc download --platform iOS,macOS,tvOS,watchOS

Please note, that invoking the `download` command multiple times with different platform arguments is not supported. The `.version` file will "forget" that `carthagerc` already downloaded the platform specified before the last download. If you need multiple platforms, specify them in a single `download` command once, delimited with a comma.

### Config

To get a quick overview on Xcode / Swift / Framework versions, execute

    $ carthagerc config

Which will print similar information:

    Xcodebuild: 9C40b
    ---
    Swift: 4.0.3
    ---
    Server: http://localhost:9292/
    ---
    Cartfile.resolved:
    github "kayak/attributions" "0.3"
    ---
    Local Build Frameworks:
    Attributions 0.3 [:iOS]

### Verify Framework Versions

When switching between development branches, it's very easy to lose track of whether existing framework binaries in `Carthage/Build` match version numbers from `Cartfile.resolved`. As a result, you will probably lose several minutes of your development time, because `Xcode` doesn't tell you about outdated or missing framework binaries.

Luckily, `carthage_remote_cache` provides following command:

    carthagerc verify

If existing frameworks match `Cartfile.resolved`, script exits with `0` and doesn't print anything.

In the event of framework version mismatch, you'll be able to observe following output:

    Detected differences between existing frameworks in 'Carthage/Build' and entries in 'Cartfile.resolved':

    +-----------------+----------------+-------------------+
    | Framework       | Carthage/Build | Cartfile.resolved |
    +-----------------+----------------+-------------------+
    | CocoaLumberjack |          3.2.1 |             3.4.1 |
    | PhoneNumberKit  |          1.3.0 |             2.1.0 |
    | HelloWorld      |              - |             3.0.0 |
    +-----------------+----------------+-------------------+

    To resolve the issue:
    - run `carthagerc download` to fetch missing frameworks from the server.
    - if the issue persists, run `carthage bootstrap` to build frameworks and `carthagerc upload` to populate the server.

#### Git Hook

Running `carthagerc verify` manually on every git checkout / merge / pull could be quite cumbersome. To automate this task, integrate following script [carthagerc-verify-githook](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/carthagerc-verify-githook) into your repository's git hooks, e.g. `post-checkout`.

See `$ man githooks` for all available git hooks and their documentation.

### Cache Server

Start the server with

    $ carthagerc server

and browse to [localhost:9292](http://localhost:9292/) where you should be able to see the default _Welcome_ message.

Framework binaries will be stored in `~/.carthagerc_server` folder.

Server is bound to port 9292 by default. If you need to use different port, specify the port number via `-pPORT` or `--port=PORT` command line arguments, e.g.:

    $ carthage server -p9000
    $ carthage server --port=9000

Don't forget to change port number in your version controlled `Cartrcfile`.

#### Version Compatibility

Before each `carthagerc [upload|download]`, the script compares its version number against cache server. If the version doesn't match, `carthagerc` aborts with:

    Version mismatch:
      Cache server version: 0.0.7
      Client version:       0.0.6

    Please use the same version as cache server is using by running:
    $ gem install carthage_remote_cache -v 0.0.7

Please note, that this functionality only works with clients starting with version [0.0.6](https://github.com/kayak/carthage_remote_cache/releases/tag/0.0.6).

#### Directory Structure

Cache server stores version files and framework archives in following directory structure:

    .carthagerc_server/
      9C40b/                            # Xcode version
        4.0.3/                          # Swift version
          Framework1/
            1.0.0/                      # Framework1 version
              .Framework1.version       # Carthage .version file
              Framework1-iOS.zip        # Framework binary, dSYM and bcsymbolmap files
              Framework1-macOS.zip
              Framework1-tvOS.zip
              Framework1-watchOS.zip
            2.0.3/                      # Framework1 version
              .Framework1.version
              Framework1-iOS.zip
          Framework2/
            v3.2/                       # Framework2 version
              .Framework2.version
              Framework2-iOS.zip

It's safe to delete whole directories since no other metadata is stored.

#### Launch Agent

You can also run the cache server as a launch agent. Copy the template [com.kayak.carthagerc.server.plist](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/com.kayak.carthagerc.server.plist) file to `~/Library/LaunchAgents`, change log
paths to include your username and run:

    $ launchctl load -w ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist

If you want to stop the agent, run:

    $ launchctl unload ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist

Check out official documentation on [Launch Agents](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) for more info.

#### Docker

To build an image based on the latest released gem, run

    $ docker build -t carthagerc .

Afterwards you can run the image in a container using

    $ docker run -d --publish 9292:9292 --name carthagerc carthagerc:latest

The server will now be available on port 9292 on `localhost`. Note that the command above will cause any data added to `~/.carthagerc_server` to be written into the container layer. While this works, it's generally discouraged due to decreased performance and portability. To avoid this, you can use a volume.

    $ docker run -d --publish 9292:9292 --mount "source=carthagerc,target=/root/.carthagerc_server" --name carthagerc carthagerc:latest

We also recommend adding the `--log-opt` option to limit the size of logs, e.g. `--log-opt max-size=50m`.

To inspect the logs after running, use

    $ docker logs carthagerc

To stop the container, run

    $ docker container stop carthagerc

### Version

    $ carthagerc version

### Help

Documentation is also available when running `carthagerc` or `carthagerc --help`. Both commands print list of available commands with brief description.

    carthagerc COMMAND [OPTIONS]

    ...

    COMMANDS
        config
            print environment information and Cartrcfile configuration

        download [-f|--force] [-v|--verbose] [-mPLATFORM|--platform=PLATFORM]
            fetch missing frameworks into Carthage/Build

        init
            create initial Cartrcfile in current directory

        upload [-f|--force] [-v|--verbose]
            archive frameworks in Carthage/Build and upload them to the server

        server [-pPORT|--port=PORT]
            start cache server

        verify
            compare versions from Cartfile.resolved to existing frameworks in Carthage/Build

        version
            print current version number

    OPTIONS
        -f, --force                      Force upload/download of framework archives even if local and server .version files match
        -h, --help                       Show help
        -m, --platform=PLATFORM          Comma delimited list of platforms which should be downloaded from the server; e.g. `--platform iOS,macOS`; Supported values: iOS, macOS, tvOS, watchOS
        -n, --no-retry                   Don't retry download or upload on network failures
        -p, --port=PORT                  Server application port used when starting server, default port is 9292
        -v, --verbose                    Show extra runtime information

## Development

### Setup

After checking out the repo, run `dev/setup` to install dependencies. You can also run `dev/console` for an interactive prompt that will allow you to experiment.

### Development Server

To start development server, run `dev/start_server`, which utilizes `rerun` for automatic reloading of source code and resources.

### Tests

Execute unit tests with `rake test` or start monitoring directories for changes with `bundle exec guard`.

### Source Code Format

Before committing, make sure to auto-format source code wit `rake format`.

### Gem Lifecycle

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/carthage_remote_cache).

### Experiments With Example Folder

Repository is bundled with an example Carthage setup for your experiments. Open the [example](https://github.com/kayak/carthage_remote_cache/blob/master/example) folder, where you should be able to see following files, which are preconfigured to bring in a couple of frameworks:
- Cartfile
- Cartfile.resolved
- Cartrcfile

Make sure to build these dependencies with `carthage bootstrap` before attempting to upload them.

Try out a few commands:

    $ carthagerc config
    $ carthagerc upload
    $ carthagerc download

## License

The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).

branch_name: refs/heads/master

gha_language: Ruby


text:
+++
title = "Container and Proxies"
date =  2019-12-16T11:50:07+01:00
weight = 5
+++

# Container behind Proxies

To configure a proxy within your docker container, set one or both of the following environment variables within your docker run command.

{{<highlight bash>}}
-e HTTP_PROXY=http://server-ip:port/
-e HTTPS_PROXY=http(s)://server-ip:port/
{{</highlight >}}

Use a HTTP_PROXY for http target sites and HTTPS_PROXY for https sites, if you switch between secure and insecure sites or just to be sure not to worry about it, you can also define both proxies at the same time, e.g. like this:

{{<highlight bash>}}
docker run --rm -p 5901:5901 -p 6901:6901 -e HTTP_PROXY=http://server-ip:port/ -e HTTPS_PROXY=http(s)://server-ip:port/ taconsol/sakuli:2.2.0
{{</highlight >}}

repository: sakuli/docs

branch_name: refs/heads/develop

gha_language: CSS

gha_license_id: MIT

repo_name: sakuli/docs


text:
## I. What is Docker? - Definitions
- In a Nutshell, Docker is an ecosystem for packaging a *web* app *and* its host environment into a consumer-ready deliverable.
- Is a containerization (not virtualization) platform.
  - Is NOT the hypervisor.
  - This makes it lightweight enough to run on any OS that supports Docker (More on this in the Scalability section.)

So why should I care about Docker? Isn't it only for Linux developers? The fact is, with the advent of WSL, and especially since the release of WSL 2, Docker is becoming more and more accessible to Windows developers too.

## II. Some advantages of the Docker ecosystem:
- Light-weight Compartmentalization with external visibility
  - Forces sysadmins to properly deal with the separation of data from the app (backups).
  - Exploits in your app (or a sibling container) won't take down the host.
  - Unlike a full virtualization platform, you can still see into the container images from the host.

- Cross-platform compatibility
  - Because they include the OS, they can be deployed on a totally dissimilar system from your dev environment - even with non-cross-platform apps. (Norman will describe how to consume a Docker image in his part of this talk.)
  - Docker can run on any hardware from ARM 64 platforms like the Raspberry Pi to cloud clusters, enabling painless migration to other OS's.
    - Give yourself an out when your host OS is discontinued. (Running on CentOS vs Docker within CentOS)
    - Protect yourself against vendor lock-in. (Contractual difficulties with cloud hosting providers - Parler app).

- Security
  - In the hands of the image publisher. You select the OS environment for your app.
  - You update when you want to, after careful testing. The burden of ensuring compatibility between the App, its Dependencies, and the OS is now on the Developers rather than the unsuspecting Sysadmin. Remove the 'Oh, no!' moments when an OS update breaks live systems on the field.
  - Use [`docker scan`](https://docs.docker.com/engine/scan/) to check your local images.

- Scalability
  - Docker has become the linga franca of containerization.
  - Manage your containers directly with [Docker Swarm](https://docs.docker.com/engine/swarm/) or [Kubernetes](https://kubernetes.io/), with [Portainer](https://www.portainer.io/), or with cloud ecosystems like OpenStack, MS Azure, or AWS.
  - Some of these cloud services [directly integrate](https://www.docker.com/partners) with Docker.

## III. Some specific use-cases for Docker:
- Flexible development toolchains with image layers and snapshots (Gitea, Seq)
  - Share configuration among team members and customize from that.
- "Throw-away" build environments (CI/CD pipelines)
- Portable and scalable testing environments (NPM, Postman (`newman`)).
- "One-click", pre-configured software installs.

## IV. Basic Docker Components
Here's the high-level difference between `docker` commands, `.dockerfile`, and Docker Compose:
- `docker` commands are for manually building images and running containers
- `.dockerfile` is the script used to build docker images from the contents of a given directory.
- `.docker-compose.yml` files are scripts that automate the tasks you can do manually with `docker` commands.
  - They're not a one-to-one correlation to `docker` commands.
  - Often used to manage clusters of dependent images. (The cloud platforms mentioned earlier would rely on Docker Compose.)

## V. Build Demo (for the Devs)
Build the docker image via code (`.dockerfile`)
I. Build on SG's dev PC
- Simple `docker build` from existing binaries (used for CI pipelines)
- The Build Context:
  - If you want the directory from which you call BUILD, use `.`
  - May be overriden with a local PATH or a Git URL
  - If dockerfile is not in this context, you must specify it with the '-f' flag.
    - Example: `docker build -f scripts/dockerfile --force-rm -t abc21/update-server:test .`
    - Note that we must use properly formed Linux paths (`/`, not `\`)
- ***TODO:*** Port Bindings
- ***TODO:*** Volume declaration
- ***TODO:*** Environment variables
- Spin up app.

II. Build from 'remote' Git repository
- `docker build` with Git repo path
  - GitHub example: `docker build -f scripts/dockerfile-build --force-rm -t abc21/update-server:latest github.com/ode2code95/ac21-update-server#develop`
  - To run: `docker run -d -p 5000:80 --name abc21-container-test abc21/update-server:latest`
  - Note the branch-name notation.
- Image will `dotnet restore` and build code.
- Note: Be sure to clean up source when done.
- Image will run resulting binaries

## VI. Deployment Demo (for the SysAdmins)
By Norman King. Notes may be available later.

gha_language: C#


text:
InfluxDB [![Build Status](https://travis-ci.org/crodas/InfluxPHP.png?branch=master)](https://travis-ci.org/crodas/InfluxPHP)
========

Simple PHP client for [InfluxDB](http://influxdb.org/), an open-source, distributed, time series, events, and metrics database with no external dependencies.

InfluxDB > v0.9 support
=======================

The 0.2.0 version of this library now supports InfluxDB 0.9. Please note that InfluxDB 0.9 is still pre-release software.

InfluxDB v0.8.X users
=====================

Influxdb >=0.9.0 brings many breaking changes to the API. InfluxDB 0.8.X users may use the legacy client by using the 0.1.* series instead.
For the documentation, please have a look at the 0.1.* version!

How to install it
-----------------

The easiest way is to install it via [composer](http://getcomposer.org)

Create a composer.json file with the following contents:

With InfluxDB 0.9 and above:

```json
{
    "require": {
        "crodas/influx-php": "^0.9"
    }
}
```

With InfluxDB 0.8.*:

```json
{
    "require": {
        "crodas/influx-php": "0.1.*"
    }
}
```

How to use it
-------------

You need to create a client object.

```php
$client = new \crodas\InfluxPHP\Client(
   "localhost" /*default*/,
   8086 /* default */,
   "root" /* by default */,
   "root" /* by default */
);
```

The first time you should create an database.

```php
$db = $client->createDatabase("foobar");
$client->createUser("foo", "bar"); // <-- create user/password
```

You can create more users than the default root user.

```php
$client->createUser('username', "password");
```

Show existing users:

```php
$users = $client->getUsers();
```

User privileges are controlled by per-databases users. Any user can have 'read', 'write' or 'all' access, represented by the constants InfluxClient::PRIV_READ, InfluxClient::PRIV_WRITE and InfluxClient::PRIV_ALL.

```php
$client->grantPrivilege(InfluxClient::PRIV_ALL, 'database', 'username');

// revoke rights by
$client->revokePrivilege(InfluxClient::PRIV_ALL, 'database', 'username');
```

The cluster administrator can be set with:

```php
$client->setAdmin('username');

// delete admin righty by:
$client->deleteAdmin('einuser');
```

Create data is very simple.

```php
$db = $client->foobar;

// single input:
$db->insert("some label", [ 'fields' => array('value' => 2)]);

// single input; the 'name' identifier will be overwritten by array content:
$db->insert("some label", ['name'=> 'some label', 'fields' => array('value' => 2)]);

// multiple insert, this is better...
// The 'name' field is optional, if not set, the default parameter (here: 'foobar') will be used

$db->insert("foobar", array(
            array('name' => 'lala',   'fields' => array('type' => 'foobar', 'karma' => 25)),
            array(   'fields' => array('type' => 'foobar', 'karma' => 45)),
            ));

```

It is recommended that you encode most metadata into the series Tags.

```php

$db->insert("foobar",[['tags' => ['type' => 'one'], 'fields' => ['value' => 10]]]);

```

Now you can get the database object and start querying.

```php
$db = $client->foobar;
// OR
$db = $client->getDatabase("foobar");

foreach ($db->query("SELECT * FROM foo") as $row) {
    var_dump($row, $row->time);
}
```

If there are multiple result series, a MultipleResultSeriesObject instance will be returned. So if you are not sure about the results of the query, check the type of the returned object.

An example of getting multiple result sets is:

```php

// Here the 'type' value is stored as metadata in the tags entry. So if there are two 'type' tags found, you will get two result series
$result = $db->query("SELECT count(value) FROM test1 where  time >= '2015-01-01T12:00:00Z' and time < '2015-01-02T00:00:00Z' group by time(1h), type");

```

Please have a look at the DBTest.php class, you will find some more examples there.

repository: jacquestrdx/githubdte

gha_language: PHP

repo_name: jacquestrdx/githubdte


text:
go-tutorial
===========

Code use in short (2hr) Go tutorial for some of MBB.

Read [FASTA](https://en.wikipedia.org/wiki/FASTA_format) file and push each entry to a channel.
Take entries from channels and give to 12 workers to perform computation on each.
 Right now only prints out entry.

####Fasta reader not complete

 * Does not handle `;` starting lines or those that wrap additional lines using `;`
 * Does not [fast fail](https://en.wikipedia.org/wiki/Fail-fast)

See

repository: gnewton/go-tutorial

repo_name: gnewton/go-tutorial


text:
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TextXD/charters4textxd2018/master)

*OR*

Click here for [TextXD collaboration session](https://jupyter.textxd.org/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2FTextXD%2Fcharters4textxd2018&app=notebook)

# Word Embeddings: Workshop and Exploration of Charter Schools
This repository includes a workshop (more info below) introducing word embedding models as well as hack session starter code for loading and exploring word embedding models with charter school data. Some data are contained in the repo; others will be linked into the Jupyter instance we'll set up to start the workshop. The charter school data come from author Jaren Haber's web-scraping of charter school websites, and the embeddings were created in the word2vec implementation in gensim. The repository is prepared for TextXD 2018 (http://www.textxd.org/) at the Berkeley Institute for Data Science (BIDS), UC Berkeley.

## Introduction to word embeddings (workshop)

### Overview
This one-hour workshop introduces word embeddings in Python and explores the features produced through the word2vec model. We'll mainly use the [Akkadian ORACC corpus](https://github.com/niekveldhuis/Word2vec), put together by Professor Niek Veldhuis, UC Berkeley Near Eastern Studies. We'll also look briefly at a Word2Vec model trained on the ECCO-TCP corpus of 2,350 eighteenth-century literary texts made available by Ryan Heuser.

### Learning Goals
* Learn the intuition behind word embedding models (WEMs)
* Learn how to implement a WEM using the gensim implementation of word2vec
* Explore a corpus you've probably never seen before
* Think through how visualization of WEMs might help you explore your corpus
* Implement text analysis on a non-English language

### Prerequisites
All are welcome! You don't need to know how neural nets work or be a Python expert to benefit from this workshop. We'll focus on the concepts behind word embeddings more than the specific syntax. This workshop will be most useful to people who have some familiarity with Python but have never done word embeddings before.

### Contributing
If you notice a problem with these materials, please make an issue describing the problem. Collaboration and transparency are worth everyone's time!

### Workshop leader
* Jaren Haber

### Acknowledgments
* Laura Nelson and [the D-Lab](http://dlab.berkeley.edu/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TextXD/charters4textxd2018/master)


text:
[![libpampa](https://live.staticflickr.com/65535/49963724858_dd170ee43f_o.png)]()

[![License](https://img.shields.io/badge/license-Apache%202.0-informational.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/oAGoulart/libpampa)](https://github.com/oAGoulart/libpampa/releases)
[![Build Status](https://dev.azure.com/agoulart/libpampa/_apis/build/status/oAGoulart.libpampa?branchName=master)](https://dev.azure.com/agoulart/libpampa/_build/latest?definitionId=1&branchName=master)

A library with some algorithms I implemented during my CS course @ unipampa.

## Usage

This library is supposed to be used just by including the files you need in your code, like this:

```c
#include "memory.h"
```

There are some caveats tho, some headers may require system specific libraries or dependencies (there isn't much I can do about that), here is a list of requirements for each header:

+ **memory.h**
  - on Windows: *Kernel32.lib*
+ **file.h**
  - on Windows: *Kernel32.lib* (because it uses **memory.h**)

Make sure to link these libraries when compiling your code, you can do this easily using CMake:

```cmake
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
  target_link_libraries(your_exe Kernel32.lib)
endif()
```

### Building examples and tests

To build the examples and tests provided, just use CMake!

```sh
mkdir build && cmake ../
```

Then you should be able to run the executables!

### Generating documentation

You can use the documentation on `docs/` as reference.

To generate documentation again, use Doxygen (`docs/` were generated on Windows x64):

```sh
doxygen Doxyfile
```

## Contributions

Feel free to leave your contribution here, I would really appreciate it!
Also, if you have any doubts or troubles using this library just contact me or leave an issue.

repository: oAGoulart/libpampa

gha_language: C

repo_name: oAGoulart/libpampa


text:
To display the new *Start Page+* window:

- click **View** | **Start Page+**

![Recent Items](assets/images/start-page-plus.png)

## Recent Items

The *Recent Items* list brings back the ability to filter the list of recent items,
and the grouping by timeframe that we had in VS 2017.

![Recent Items](assets/images/recent-items.png)

### Live Filtering

Type a name, or a partial name, into the filter box above the list to display just the matching items
as you type.

Click the **X** in the filter box to start again, or to go back to the full list of items.

![Recent Items](assets/images/recent-items-live-filtering.png)

### Collapsible Timeframes

Each timeframe group can be collapsed or expanded by clicking anywhere on the group name.
This can come in handy if you want to view items that are currently not being displayed
without having to scroll all the way down.

![Recent Items](assets/images/recent-items-collapsed.png)

### Buttons

#### Pin An Item

![Recent Items](assets/images/recent-item-pin.png)

#### Unpin An Item

![Recent Items](assets/images/recent-item-unpin.png)

#### Remove An Item

![Recent Items](assets/images/recent-item-remove.png)

### Context Menu

Right-clicking an item brings up a context menu to give you access to more actions.

#### Pin/Unpin An Item

Right-click an ***unpinned*** item in the *Recent Items* list, and select *Pin item*
in the context menu to ***pin*** it.
Or click on the icon to the right of the date.

Right-click on a ***pinned*** item in the *Recent Items* list, and select *Unpin item*
in the context menu to ***unpin*** it.
Or click on the icon to the right of the date.

![Recent Items](assets/images/recent-item-context-menu-unpin.png)

#### Remove An Item

Right-click any item in the *Recent Items* list, and select *Remove item*
in the context menu to remove it.

![Recent Items](assets/images/recent-item-context-menu-remove.png)

#### Copy An Item's Path

Right-click any item in the *Recent Items* list, and select *Copy item path*
in the context menu to copy it path to the Windows clipboard.
You can then paste it anywhere you need to.

![Recent Items](assets/images/recent-item-context-menu-copy-item-path.png)

#### Open Item In VS

Right-click any item in the *Recent Items* list, and select *Open in new VS instance*
in the context menu to copy its path to the Windows clipboard.
You can then paste it anywhere you need to.

![Recent Items](assets/images/recent-item-context-menu-open-in-vs.png)

### Links

![Recent Items](assets/images/links-recent-items.png)

#### Refresh

When you select the number of items to display, you'll need to click the *Refresh* link to see
the change.
It's also a quick way to expand all of the timeframe groups at once.

#### Settings

Clicking on the *Settings* link will open the `Tools` | `Options` | `Start Page+` | `Recent Items`
settings page without having to navigate through the dropdowns.

## Get Started

The *Get Started* list gives new users a simplified way to get to their code, the same as in VS 2019's
*Start Window*. Plus a few extras.

![Start Items](assets/images/get-started.png)

### Clone Or Checkout Code

Quickly get code from an online repository by entering the repository location.
You can also browse GitHub or Azure DevOps repositories from here,
which will take you to the *Connect* dialog.

### Open A Local Folder

Open any folder on your local machine, or on a network share.
Here *local* basically just means '*not in the cloud*'.

### Open A Project Or Solution

A quick way to get to the *Open Project/Solution* dialog without having to use `File` | `Open` | `Project/Solution`.

### Create A New Project

A quick way to get to the *New Project* dialog without having to use `File` | `New` | `Project`.

### Restart Visual Studio

Any time you need to restart Visual Studio you can do it from the *Start Page+* window in just one click.
No need to close and re-open Visual Studio manually.

### Restart As Administrator

You can also restart Visual Studio as Administrator without having to you through the hassle of finding
and right-clcking a Visual Studio shortcut etc.

Note: if you launch Visual Studio as Administrator, you can't get back to a non-elevated session by
clicking on *Restart Visual Studio*.
There doesn't seem to be a programmatic way to force an elevated session to restart as a normal session.

### Links

![Recent Items](assets/images/links-get-started.png)

#### Changelog

With just a single-click you can see what's changed in the new version of *Start Page+*.

#### Version Number

This is a subtle way of being able to see the version number of the currently installed version of
*Start Page+*.

Clicking on the version number will open the website's Overview page.
On there you can see what the latest available version of *Start Page+* is at the top of the page.

#### Options

Clicking on the *Options* link is a quick way to get to the *Start Page+* options page without
having to use `Tools` | `Options` | `Start Page+`.

## Developer News

The *Developer News* feed brings back VS 2017's handy list of Microsoft developer-related news items that was removed from
VS 2019.
I don't know how many times I've seen something that interests me that I might have missed if I hadn't seen it on my
start page.

![Developer News](assets/images/developer-news.png)

### Items Feed Url

By default the feed url is set to the url of the original *Developer News* that used to be in Visual Studio 2017.
Microsoft is currently still maintaining that feed, but could stop doing so at any time.
You could choose to use the *Visual Studio Blog* feed url instead if you wanted.

In the past the two feeds have displayed a different set of posts,
with Visual Studio Blog having more posts that the Developer News feed.
But it seems that may currently have the same items.

The *Visual Studio Blog* feed url is `https://devblogs.microsoft.com/visualstudio/feed`.

### Items to Display

You can choose the number of items that are displayed in the list.

There are only 10 items in the orginal feed, and Microsoft replaces older posts with new ones.
If you set a feed url to something that has a lerger number of items you might want to limit
how many are downloaded and displayed.

### Open Items in VS

By default the items open right in VS itself, rather than switching to the default browser.
Personally, I prefer having to switch applications as little as possible.
When I'm working in Visual Studio, I prefer to stay in Visual Studio, and not have my attention derailed by having
to switch to a different application, and then back again to Visual Studio.

However, for those people who prefer links to be opened in their default browser,
there's an option to change *Start Page+*'s behavior to do just that.

### Links

![Recent Items](assets/images/links-developer-news.png)

#### Refresh

There is currently no auto-refresh for *Developer News*, so you'll have to click *Refresh* to
check if you have the latest available news items from Microsoft.

Also, when you select the number of items to display, you'll need to click the *Refresh* link
to see the change.

#### Settings

Clicking on the *Settings* link will open the `Tools` | `Options` | `Start Page+` | `Developer News`
settings page without having to navigate through the dropdowns.

## General Options

![General Options](assets/images/options-general.png)

### Enable Start Page+

This setting allows _Start Page+_ to be disabled if you need to,
without having to uninstall the _Start Page+_ extension, which would require you to exit
**all** instances of Visual Studio, wait while the _VSIX installer_ does its thing,
then open Visual Studio again.

### Enable Start Page+ Options

By default, a 'Start Page+ Options' command is added to the `Tools` | `Options` menu.
This setting lets you choose to not have the menu item added.

The default value is `true`.

### Max Width

This setting will allow you to make the contents of the _Start Page+_ window wider or narrower

The default value is `1175`.

### Version Number

This setting simply displays the version number of _Start Page+_ that's currently installed.

## Start Tab Options

![Start Tab Options](assets/images/options-start-tab.png)

### Show Start Tab Title

This setting determines whether the *Start* tab title is displayed.

The default value is `true`.

### Start Tab Title Text

This setting will allow you to change the text of the *Start* tab title.

The default value is `What would you like to do today?`.

## Recent Items Options

![Recent Items Options](assets/images/options-recent-items.png)

### Items to Display

This setting will allow you to determine how many items are displayed in the *Recent Item* list.

The default value is `50`.

### Show File Extensions

This setting allows to hide a project/solution's extension (.csproj, .sln) in the *Recent Items* list.

The default value is `false`;

## Developer News Options

![Developer News Options](assets/images/options-developer-news.png)

### Clear List Before Refresh

This setting clears the list before the data is retrieved, so there's a visual cue that the
list has in fact been refreshed.

The default value is `true`.

### Items to Display

This setting will allow you to determine how many items are displayed in the *Developer News* list.

The default value is `10`.

### Items Feed Url

This setting allows you to change the feed url for *Developer News* to any RSS feed that you choose.

The default value is `https://vsstartpage.blob.core.windows.net/news/vs`.

### Open Links in VS

When this setting is set to `true`, any clicked item that opens a web page will be opened in a browser window
**inside** of Visual Studio.

When set to `false`, clicked items will be opened in your default browser.

The default value is `true`.

repository: luminous-software/start-page-plus

repo_name: luminous-software/start-page-plus


text:
#ScreepsSegmentedMemory Module for [Screeps](https://screeps.com)

Module created to handle RawMemory.segments for you!

Make sure to check the [functionality](Functionality.md)
Memory requirements are also [defined](MemoryLayout.md)

repository: invisioblack/ScreepsSegmentedMemory

repo_name: invisioblack/ScreepsSegmentedMemory


text:
---
post_title: Responsive Definition Lists: Solved by flexbox
post_date: 2017-03-29 12:16:17
post_modified: 2017-03-29 12:16:17
post_status: draft
post_type: post
post_author: Luke Boyle
---

Consider the definition list. Here's a simple example. The standard behaviour would have the term and definition both as block level elements, naturally stacking down like so.

Term 1

A longer definiton. A definition usually expands on the term.🌚

Term 2

A longer definiton. A definition usually expands on the term.🌚

But what if we want the term and definition to sit inline?  The image below exhibits a compromise I made with the designer on a previous project. ![](http://lukeboyle.com/app/uploads/2017/03/Screen-Shot-2017-03-29-at-10.58.59-pm.png) Making the dt/dd inline-block works to a certain degree, however, when setting widths explicitly you will have serious issues going down the breakpoints. The `display:block` span just forces the content to stay in it's respective line. This, however, is not correct usage, as a `dl` is only supposed to have `dt` or `dd` elements inside it. EDIT: Since working on this project, it looks like we're now permitted to wrap a `dt+dd` group in a div to control flow. So how can flexbox help us here?

gha_language: TypeScript


text:
## Chinese NER  ##
- In NER task, recently, BiLSTM-CRF Neural Networks are often used, and get the best performance. but I use a simple Neural Networks(`BiLSTM`) and context feature to train data, and get a good performance close to the `BiLSTM-CRF`.

## Requirement ##

	pyorch: 0.3.1
	python: 3.6.1
	cuda: 8.0 (support cuda speed up, can chose)

## Usage ##
	modify the config file, detail see the Config directory
	(1)	sh run.sh
	(2)	python -u main_hyperparams.py --config_file ./Config/config.cfg

## Model ##

- `BiLSTM + context feature`
- `BiLSTM-CRF`
- Now, only support `BiLSTM + context feature`, BiLSTM-CRF will be support later.

## Data ##

- The number of sentences in the two data is calculated as follows:
![](https://i.imgur.com/5BgPews.jpg)

## Time ##

- A simple test of the training speed and decoding time on the `CPU` and `GPU`，requires only `4 seconds` for the decoding time on the GPU. why so fast ?  In terms of decoding, batch calculation is performed in some places, so the decoding time is much faster than one sentence.
![](https://i.imgur.com/RjaG80A.jpg)

## Performance ##

- The following results are based on the neural network model of `BiLSTM + context feature`.
![](https://i.imgur.com/mG3JyuC.jpg)

## Reference ##

- updating......

## Question ##

- if you have any question, you can open a issue or email<EMAIL_ADDRESS>163.com}`.

- if you have any good suggestions, you can PR or email me.


text:
# Lab Framework

HTML5-based open source scientific models, visualizations, graphing, and probeware from the
[Concord Consortium](http://www.concord.org). This framework is deployed in the following places.
These sites contain many examples of what it can do:

- **[lab-framework.concord.org](http://lab-framework.concord.org)** _(production)_
- **[lab-framework.concord.org/branch/master/](http://lab-framework.concord.org/branch/master/)** _(development)_

## Setup Development

### Prerequisites:

- [node.js, npm](developer-doc/setup-node.md)
- [RVM, Ruby 2.0 and Bundler](developer-doc/setup-ruby.md)
- [additional Linux notes](developer-doc/linux-notes.md)

### Setup the local Lab repository for development

1. Clone the git repository
2. `cd lab`
3. `npm install`
4. `npm run build`
5. open another new terminal and run `npm start`
6. open http://localhost:9191

### Testing

Lab is using [Jest test framework](https://jestjs.io/).

- `npm test` will run all tests.
- `npm run test:coverage` will execute all tests and display code coverage stats.

### Modules

Note that most of the JS source files use paths relative to "src/lab" directory instead to the file itself.
It's caused by the fact that this project has been using RequireJS and has been converted semi-automatically.
It's fine but it requires custom configuration in a few places:

- Webpack: `resolve: { modules: [path.resolve(__dirname, "./src/lab"), "node_modules"] }`
- Jest, package.json: `"modulePaths": [ "<rootDir>/src/lab" ]`
- NodeJS scripts have to setup NODE_PATH env variable (too see example config check `md2d-node-api.js`).

## Contributing to Lab

If you think you'd like to contribute to Lab as an external developer:

1. Create a local clone from the repository located here: http://github.com/concord-consortium/lab.
   This will by default have the git-remote name: **origin**.

2. Make a fork of http://github.com/concord-consortium/lab to your account on github.

3. Make a new git-remote referencing your fork. I recommend making the remote name your github user name.
   For example my username is `stepheneb` so I would add a remote to my fork like this:

        git remote add stepheneb git@github.com:stepheneb/lab.git

4. Create your changes on a topic branch. Please include tests if you can. When your commits are ready
   push your topic branch to your fork and send a pull request.

## Automated Browser Testing

Lab framework tests are automated using open source support from [BrowserStack](http://www.browserstack.com/) and [SauceLabs](https://saucelabs.com/).

For more information, please visit [lab-selenium-tests repository](https://github.com/concord-consortium/lab-selenium-tests).

## More Documentation

SVG support is required to run Lab.
IE 9+, FF, Chrome, Safari, iOS Safari, Chrome for Android all support SVG

- [Project Configuration](developer-doc/configuration.md)
- [Repository Structure](developer-doc/repository-structure.md)
- [Localization](developer-doc/localization.md)
- [Physical Constants and Units](developer-doc/physical-constants-and-units.md)
- [Deployment](developer-doc/deployment.md)
- [References](developer-doc/references.md)
- [Java Resources](developer-doc/java.md)
- [Building Website](developer-doc/website.md)
- [Fonts](developer-doc/fonts.md)

repository: concord-consortium/lab

gha_language: JavaScript

repo_name: concord-consortium/lab


text:
---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
    jupytext_version: 1.10.3
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

# The DDB file (DFPT)

This notebook explains how to use AbiPy and the DDB file produced by Abinit to analyze:

* Phonon band structures including the LO-TO splitting in polar semiconductors
* Phonon fatbands, phonon DOS and projected phonon DOS
* Born effectives charges $Z^*_{\kappa,\alpha\beta}$ and the dielectric tensors
  $\epsilon^{\infty}_{\alpha\beta}$, $\epsilon^{0}_{\alpha\beta}$
* Thermodynamic properties in the harmonic approximation

In the last part, we discuss how to use the `DdbRobot` to analyze multiple DDB
files and perform typical convergence studies.

```{include} snippets/plotly_matplotlib_note.md
```

## Suggested references

* [Dynamical matrices, Born effective charges, dielectric permittivity tensors, and interatomic force constants from density-functional perturbation theory](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.55.10355)
* [Phonons and related crystal properties from density-functional perturbation theory](https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.73.515)

## Integration with the materials project database

AbiPy, [pymatgen](http://pymatgen.org/) and [fireworks](https://materialsproject.github.io/fireworks/)
have been used by [Petretto et al](https://www.nature.com/articles/sdata201865)
to compute the vibrational properties of more than 1500 compounds with Abinit.
The results are available on the [materials project website](https://materialsproject.org/).
The results for the rocksalt phase of MgO are available at <https://materialsproject.org/materials/mp-1009129/>

To fetch the DDB file from the materials project database and build a `DdbFile` object, use:

```python
ddb = abilab.DdbFile.from_mpid("mp-1009129")
```

<hr>

Remember to set the `PMG_MAPI_KEY` in your ~/.pmgrc.yaml as described
[here](http://pymatgen.org/usage.html#setting-the-pmg-mapi-key-in-the-config-file).

## How to create a DdbFile object

Let us start by importing the basic AbiPy modules we have already used in the other examples:

```{code-cell}
import warnings
warnings.filterwarnings("ignore")  # Ignore warnings

from abipy import abilab
abilab.enable_notebook() # This line tells AbiPy we are running inside a notebook

import abipy.data as abidata
import os

# This line configures matplotlib to show figures embedded in the notebook.
# Replace `inline` with `notebook` in classic notebook
%matplotlib inline

# Option available in jupyterlab. See https://github.com/matplotlib/jupyter-matplotlib
#%matplotlib widget
```

To open a DDB file, use the high-level interface provided by abiopen:

```{code-cell}
ddb_filepath = abidata.ref_file("mp-1009129-9x9x10q_ebecs_DDB")
ddb = abilab.abiopen(ddb_filepath)
```

A DdbFile has a structure object:

```{code-cell}
print(ddb.structure)  # Lengths in Angstrom.
```

and a list of q-points associated to the dynamical matrix $D(q)$:

```{code-cell}
ddb.qpoints
```

At this point, it is worth mentioning that Abinit takes advantage of symmetries
to reduce the number of q-points as well as the number of perturbations that
must be computed explicitly within DFPT.

The set of q-points in the DDB file (usually) does not form a homogeneous sampling of the Brillouin zone (BZ).
Actually they correspond to the sampling of the irreducible wedge (IBZ), and this sampling is obtained
from an initial **q**-mesh specified in terms of divisions along the three reduced directions (ngqpt).

```{code-cell}
ddb.qpoints.plotly();
```

Note that the DDB file does not contain any information about the value of ngqpt because
one can merge an arbitrary list of q-points in the same DDB.
The algorithms implemented in anaddb, however, need to know the divisions to compute integrals in the full BZ
(this is indeed one of the variables that must be provided by the user in the anaddb input file).

AbiPy uses a heuristic method to guess the q-mesh from this scattered list of q-points
so that you do not need to specify this parameter when calling anaddb:

```{code-cell}
ddb.guessed_ngqpt
```

```{warning}
If the guess is wrong, you will need to manually set this attribute to the correct value of `ngqpt` before
invoking anaddb from python.
This could happen if, for instance, you have merged DDB files computed with $q$-points that do not belong to same grid.
````

To test whether the DDB file contains the entries associated to
$\epsilon^{\infty}_{\alpha\beta}$ and $Z^*_{\kappa,\alpha\beta}$, use:

```{code-cell}
print("Contains macroscopic dielectric tensor:", ddb.has_epsinf_terms())
print("Contains Born effective charges:", ddb.has_bec_terms())
```

Metadata are stored in the header of the DDB file.
AbiPy parses this initial section and stores the values in a dict-like object.
Let us print a sorted list with all the keys in the header:

```{code-cell}
from pprint import pprint
pprint(sorted(list(ddb.header.keys())))
```

and use the standard syntax for dictionaries to access the keys:

```{code-cell}
print("This DDB has been generated with ecut", ddb.header["ecut"], "Ha and nsym", ddb.header["nsym"])
```

We can also print the DDB object to get a summary of the most important parameters and dimensions:

```{code-cell}
print(ddb)

# If more info is needed use:
# print(ddb.to_string(verbose=1)
```

If you are a terminal aficionado, remember that one can use the
[abiopen.py](http://abinit.github.io/abipy/scripts/abiopen.html) script
to open the DDB file directly from the shell and generate a jupyter notebook with the `-nb` option.
For a quick visualization script use [abiview.py](http://abinit.github.io/abipy/scripts/abiview.html).

## Invoking Anaddb from the DdbFile object

The `DdbFile` object provides specialized methods to invoke anaddb and
compute important physical properties such as the phonon band structure, the phonon density of states, etc.
All these methods have a name that begins with the `ana*` prefix followed by a verb (`anaget`, `anacompare`).
These specialized methods

- build the anaddb input file
- run anaddb
- parse the netcdf files produced by the Fortran code
- build and return [AbiPy objects](http://abinit.github.io/abipy/api/dfpt_api.html) that can be used to plot/analyze the data.

Note that in order to run anaddb from AbiPy, you need a manager.yml with configuration options.
For further details, please consult the
[TaskManager documentation](http://abinit.github.io/abipy/workflows/taskmanager.html).

The python API is flexible and exposes several anaddb input variables.
The majority of the arguments have default values covering the most common cases
so that you will need to specify these arguments explicitly only if the default behavior does not suit your needs.
The most important parameters to remember are:

* **ndivsm**: Number of divisions used for the smallest segment of the high-symmetry q-path.
* **nqsmall**: Defines the q-mesh for the phonon DOS in terms of
     the number of divisions used to sample the smallest reciprocal lattice vector. 0 to disable DOS computation.
* **lo_to_splitting**: Activate the computation of the frequencies in the $q\rightarrow 0$ limit with the
  inclusion of the non-analytical term (requires {{dipdip@anaddb} 1 and DDB with
  $Z^*_{\kappa,\alpha\beta}$ and $\epsilon^{\infty}_{\alpha\beta}$).

The high-symmetry q-path is automatically selected assuming the structure
fulfills the conventions introduced by [Setyawan and Curtarolo](https://arxiv.org/abs/1004.2974)
but you can also specify your own **q**-path if needed.

## Plotting phonon bands and DOS

To compute phonon bands and DOS, use:

```{code-cell}
# Call anaddb to compute phonon bands and DOS. Return PHBST and PHDOS netcdf files.
phbstnc, phdosnc = ddb.anaget_phbst_and_phdos_files(
    ndivsm=20, nqsmall=20, lo_to_splitting=True, asr=2, chneut=1, dipdip=1, dos_method="tetra")

# Extract phbands and phdos from the netcdf object.
phbands = phbstnc.phbands
phdos = phdosnc.phdos
```

Let us have a look at the high symmetry q-path automatically selected by AbiPy with:

```{code-cell}
phbands.qpoints.plot();
```

and plot the phonon bands along this path with:

```{code-cell}
phbands.plot();
```

```{code-cell}
phbands.plotly();
```

Note the discontinuity of the optical modes when we cross the $\Gamma$ point.
In polar semiconductors, indeed, the dynamical matrix is non-analytical for $q \rightarrow 0$.
Since `lo_to_splitting ` was set to True, AbiPy has activated the calculation of the phonon frequencies
for all the $q \rightarrow \Gamma$ directions present in the path.

There are several band crossings and anti-crossings hence it's not easy
to understand how the branches should be connected.
Fortunately, there is a heuristic method to **estimate** band connection from
the overlap of the eigenvectors at adjacent q-points.
To connect the modes and plot the phonon branches with different colors, use:

```{code-cell}
phbands.plot_colored_matched();
```

```{warning}
This heuristic method may fail so the results should be analyzed critically (especially
when there are non-analytic branches crossing $\Gamma$).
Besides, the algorithm is sensitive to the k-path resolution
thus it is recommended to check the results by increasing the number of points per segment.
```

To plot the DOS, $g(\omega)$, and the integrated $IDOS(\omega) = \int^{\omega}_{-\infty} g(\omega')\,d\omega'$, use:

```{code-cell}
phdos.plot();
```

Note how the phonon DOS integrates to $3 * N_{atom} = 6$

To plot the phonon bands and the DOS on the same figure use:

```{code-cell}
phbands.plot_with_phdos(phdos, units="meV");
```

```{code-cell}
phbands.plotly_with_phdos(phdos, units="meV");
```

## Fatbands and projected DOS

The `phbands` object stores the phonon displacements, $\vec{d}_{q\nu}$ and the eigenvectors, $\vec{\epsilon}_{q\nu}$
obtained by diagonalizing the dynamical matrix $D(q)$.

\begin{equation}
D(q) \vec{\epsilon}_{q\nu} = \omega_{q\nu}^2 \vec{\epsilon}_{q\nu}
\end{equation}

We can therefore use the eigenvectors (or the displacements) to associate
a width to the different bands (a.k.a. fatbands).
This width gives us a qualitative understanding of the vibrational mode: what are the atomic types involved in
the vibrations at a given energy, their direction of oscillation and the amplitude (related to the displacement).

```{code-cell}
# NB: LO-TO is not available in fatbands
phbands.plotly_fatbands(use_eigvec=True, units="Thz");
```

To plot the fatbands with the type-projected DOS stored in `phdocsnc` use:

```{code-cell}
phbands.plot_fatbands(phdos_file=phdosnc, colormap="rainbow", alpha=0.4, units="cm-1");
```

We can also plot the PJDOS summed over directions and atomic types without fatbands with the command:

```{code-cell}
phdosnc.plotly_pjdos_type();
```

The netcdf file contains the individual contributions to the total DOS
for each atomic site and the three cartesian directions.
So there are several quantities we can plot to understand the vibrational spectrum of our systems.
For example, we can decide to sum over all atoms of the same type while keeping
the dependence on the Cartesian direction:

```{code-cell}
phdosnc.plot_pjdos_cartdirs_type(units="Thz");
```

This analysis tells us that the peak at ~16 Thz mainly consists of oxygen vibrations along z.
We could now extend this analysis by looking at the contributions arising from the different sites with:

```{code-cell}
#phdosnc.plot_pjdos_cartdirs_site(view="inequivalent", units="eV", stacked=True);
```

but we prefer to stop here and discuss other tools that can be used to analyze individual phonon modes.

## Visualizing atomic displacements

In you need to visualize the lattice vibrations in 3D to gain a better insight
about the nature of the phonon modes you may want to use the
[phononwebsite](http://henriquemiranda.github.io/phononwebsite/).
One can either convert the out_PHBST.nc produced by anaddb into json format
and upload it to the phononwebsite server or, alternatively, open the terminal and
execute the AbiPy script:

    abiview.py ddb out_DDB --phononwebsite

to automate the entire process (replace out_DDB with the name of your DDB file).

Note that there are other AbiPy methods that are quite handy if we need to investigate the nature of the
phonon modes at a particular q-point without a 3D visualization tool.
For example, it is possible to analyze the contribution given by the different types of atoms
to the phonon displacements at a given q-point with:

```{code-cell}
phbands.plot_phdispl(qpoint=(0, 0, 0), tight_layout=True);
```

As expected the first three (acoustic) modes have zero frequency and
the two atoms oscillate with the same amplitude.
These modes indeed correspond to a rigid translation of the crystal hence
the amplitude (and the direction) does not depend on the atomic site.
The other three optical modes are (almost) degenerate, while LO-TO splitting should be present, but this is due to the fact
that we are using the frequencies at the $\Gamma$ point without the inclusion of the non-analytical term.

```{code-cell}
#phbands.plot_phdispl((0, 0, 0.1), is_non_analytical_direction=True, tight_layout=True);
```

To project the phonon displacements along the three cartesian directions, use:

```{code-cell}
phbands.plot_phdispl_cartdirs(qpoint=(0, 0, 0.0), tight_layout=True);
```

This plot confirms that the first three modes correspond to a rigid translation along x, y and z, respectively.

## Analyzing the breaking of the acoustic sum rule

Due to the invariance of the system under an *infinitesimal* rigid translation, the frequency of the lowest
three modes at $\Gamma$ should be zero.
Unfortunately, all the terms that are evaluated on the real-space FFT mesh
(e.g. $V_{xc}$, non-linear core-correction) break this kind of translational invariance.
The error depends on several factors: the density of the FFT mesh,
pseudopotentials with hard model core charges, XC functional, etc.)
Note that it is not always possible to reduce the error to zero by just increasing the convergence parameters
but fortunately it is possible to restore the acoustic sum rule via the {{asr_anaddb}} input variable.

One can easily compare the phonons bands obtained with different values of {{asr_anaddb}} with:

```{code-cell}
asr_plotter = ddb.anacompare_asr()
```

This method invokes anaddb with different values of {{asr_anaddb}} and returns a plotter object
we can call to compare the phonon band structures:

```{code-cell}
asr_plotter.combiplot();
```

```{code-cell}
asr_plotter.combiplotly();
```

Now we can perform a similar test for the treatment of the non-analytical term in the $q \rightarrow 0$ limit.
We compute the phonon band dispersion for {{dipdip_anaddb} in [0, 1] and the compare the
results on the same figure with the commands:

```{code-cell}
dipdip_plotter = ddb.anacompare_dipdip(nqsmall=0)
```

```{code-cell}
dipdip_plotter.combiplot();
```

```{code-cell}
dipdip_plotter.combiplotly();
```

The figure above shows that the (Fourier interpolated) bands obtained with dipdip = 0
have unphysical oscillations around the $\Gamma$ point.
These oscillation are due to the long-range behavior in real space of the interatomic force constants
in polar semiconductors.
The correct description of this long-range term without dipdip = 1
would require using an extremely dense q-point mesh in the DFPT calculation.

With {{dipdip_anaddb} = 1, on the other hand, we can model this long-range behavior in terms of a dipole-dipole
interaction involving the Born effective charges and the macroscopic dielectric tensor.
This allows us to decompose the full dynamical matrix into:

\begin{equation}
D(q) = D^{sr}(q) + D^{dip-dip}(q)
\end{equation}

The analytical part of the dynamical matrix, $D^{sr}(q)$, is short-ranged and can be Fourier-interpolated
with a relatively coarse q-mesh.
Then the model for the non-analytical term, $D^{dip-dip}(q)$, is added back to the interpolated matrix to get
the full dynamical matrix.
This procedure solves the problem with the unphysical oscillations and is required to describe
correctly the non-analytical behavior of the optical modes for $q \rightarrow 0$.

## Computing DOS with different q-meshes

Phonon DOS and derived quantities (e.g. thermodynamic properties) are sensitive to the BZ sampling
and dense meshes may be required to converge the final results.

The method `anacompare_phdos` provides a simple interface to
compare phonon DOS computed with different $q$-meshes.
We only need to provide a list of integers (`nqsmalls`). Each integer defines the number of divisions used to
sample the smallest reciprocal lattice vector while the other two vectors are sampled such
that proportions are preserved.

To calculate three phonon DOS with increasing number of q-points use:

```{code-cell}
res = ddb.anacompare_phdos(nqsmalls=[8, 12, 24])
```

The return value is a named tuple with the phonon DOSes in res.phdoses while res.plotter
is PhononDosPlotter.
We can easily compare our results with:

```{code-cell}
res.plotter.combiplot();
```

## Thermodynamic properties in the harmonic approximation

The thermodynamic properties of an ensemble of non-interacting phonons can be
expressed in terms of integrals of the phonon DOS $g(\omega)$ using:

\begin{equation} %\label{eq:helmholtz}
\Delta F = 3nNk_BT\int_{0}^{\omega_L}\text{ln}\left(2\text{sinh}\frac{\hbar\omega}{2k_BT}\right)g(\omega)d\omega
\end{equation}

\begin{equation} %\label{eq:free_en}
\Delta E = 3nN\frac{\hbar}{2}\int_{0}^{\omega_L}\omega\text{coth}\left(\frac{\hbar\omega}{2k_BT}\right)g(\omega)d\omega
\end{equation}

\begin{equation} %\label{eq:c_v}
C_v = 3nNk_B\int_{0}^{\omega_L}\left(\frac{\hbar\omega}{2k_BT}\right)^2\text{csch}^2\left(\frac{\hbar\omega}{2k_BT}\right)g(\omega)d\omega
\end{equation}

\begin{equation} %\label{eq:entropy}
S = 3nNk_B\int_{0}^{\omega_L}\left(\frac{\hbar\omega}{2k_BT}\text{coth}\left(\frac{\hbar\omega}{2k_BT}\right) - \text{ln}\left(2\text{sinh}\frac{\hbar\omega}{2k_BT}\right)\right)g(\omega)d\omega,
\end{equation}

where $k_B$ is the Boltzmann constant.
This should represent a reasonable approximation especially in the low-temperature
regime in which anharmonic effects can be neglected.

Let's plot the vibrational contributions to the thermodynamic properties as function of temperature $T$:

```{code-cell}
phdos.plot_harmonic_thermo();
```

and the zero-point energy $\dfrac{1}{2 N_q} \sum_{q\nu} \omega_{q\nu}$

```{code-cell}
zpe = phdos.zero_point_energy
print("Zero-point energy", zpe, zpe.to("Ha"))
```

To get the free energy for a range of temperatures in Kelvin degrees, use:

```{code-cell}
f = phdos.get_free_energy(tstart=10, tstop=100)
#f.plot();
```

## Macroscopic dielectric tensor and Born effective charges

Let us call anaddb to compute the electronic contribution to the macroscopic dielectric tensor,
$\epsilon^{\infty}_{\alpha\beta}$, and the Born effective charges $Z^*_{\kappa,\alpha\beta}$:

```{code-cell}
emacro, becs = ddb.anaget_epsinf_and_becs(chneut=1)
```

Note the use of `chneut` to enforce charge neutrality.

```{code-cell}
emacro
```

```{code-cell}
becs
```

In the computation of the low-frequency (infrared) dielectric tensor, $\epsilon^{0}_{\alpha\beta}$,
one has to include the response of the ions, whose motion will be triggered by the electric field.
One can show that:

\begin{equation} %\label{eq:dielectric}
\epsilon^{0}_{\alpha\beta}(\omega) = \epsilon^{\infty}_{\alpha\beta} + 4\pi\sum_m\frac{S_{m,\alpha\beta}}{(\omega^{\Gamma}_m - \omega)^2}.
\end{equation}

where $\omega^{\Gamma}_m$ are the phonon frequencies at the center of the BZ and $S_{m,\alpha\beta}$
is the so-called mode-oscillator strength tensor that depends on the phonon displacement
and the Born effective charges.

To compute the dielectric tensor using the data stored in the DDB file, use:

```{code-cell}
dtgen = ddb.anaget_dielectric_tensor_generator()
```

```{code-cell}
# call print to get useful information
print(dtgen)
```

To compute the tensor for a given frequency:

```{code-cell}
e0 = dtgen.tensor_at_frequency(0)
print(e0)
```

To plot the frequency dependence with a damping factor of 1e-4 eV (phonon linewidth):

```{code-cell}
dtgen.plot(w_max=None, gamma_ev=1e-4, component='diag', units='eV');
```

## Using `DdbRobot` to perform convergence studies

A `DdbRobot` receives a list of DDB files and provides methods
to construct [pandas dataframes](https://pandas.pydata.org/pandas-docs/stable/10min.html)
and analyze the results of multiple calculations.
DdbRobots, in particular, are extremely useful to study the convergence of the phonon frequencies with respect to some computational parameters e.g. the number of k-points and the electronic smearing in metallic systems.

In this example, we are interested in the effect of the k-point sampling and the smearing parameter
on the vibrational properties of magnesium diboride.
$MgB_2$ is a metallic system with a critical temperature of 39 K that is the highest among conventional
(phonon-mediated) superconductors.
We use precomputed DDB files obtained by running GS+DFPT calculations with different values
of `nkpt` and `tsmear`.

Let's build our `DdbRobot` object with:

```{code-cell}
import os
paths = [
    #"mgb2_444k_0.01tsmear_DDB",
    #"mgb2_444k_0.02tsmear_DDB",
    #"mgb2_444k_0.04tsmear_DDB",
    "mgb2_888k_0.01tsmear_DDB",
    "mgb2_888k_0.02tsmear_DDB",
    "mgb2_888k_0.04tsmear_DDB",
    "mgb2_121212k_0.01tsmear_DDB",
    "mgb2_121212k_0.02tsmear_DDB",
    "mgb2_121212k_0.04tsmear_DDB",
]

paths = [os.path.join(abidata.dirpath, "refs", "mgb2_phonons_nkpt_tsmear", f) for f in paths]

robot = abilab.DdbRobot.from_files(paths)
robot
```

The [abicomp.py](http://abinit.github.io/abipy/scripts/abicomp.html)
script provides a command line interface to build robots from a list of files/directories
given as arguments

The DDB files are now stored in the robot with a label constructed from the file path.
These labels, however, are not very informative. In principle we would like to have a label
that reflects the value of ({{nkpt}}, {{tsmear}}) also because these labels
will be used to generate the labels in our plots.

Let's fix it with a function that recomputes the labels from the metadata available in ddb.header:

```{code-cell}
function = lambda ddb: "nkpt: %s, tsmear: %.2f" % (ddb.header["nkpt"], ddb.header["tsmear"])
robot.remap_labels(function);
robot
```

We are usually interested in the convergence behavior with respect to one
or two parameters of the calculations.
Let's build a pandas dataframe with the most important parameters extracted from the DDB header:

```{code-cell}
robot.get_params_dataframe()
```

Now we tell the robot to invoke anaddb to compute the phonon bands for all DDB files.
Since we are not interested in the phonon DOS, ``nqsmall`` is set to 0

```{code-cell}
r = robot.anaget_phonon_plotters(nqsmall=0)
```

Now we can plot all the phonon band structures on the same figure with:

```{code-cell}
r.phbands_plotter.combiplot();
```

The plot is a bit crowded. Still, it is clear
that there are portions of the vibration spectrum that are quite sensitive to the values of ({{nkpt}}, {{tsmear}}).

In metals, it's common to analyze the convergence of the physical properties by plotting the results
as function of the k-point sampling for fixed value of {{tsmear}}.
Let's do something similar for the phonon band structures with the command:

```{code-cell}
r.phbands_plotter.gridplot_with_hue("tsmear", units="Thz");
```

Each panel now shows the phonon dispersion computed with different k-point samplings at fixed {{tsmear}}.

The results obtained with the largest broadening (0.04 Ha) seem to be converged
but remember that the "converged" result are in principle obtained in the limit
$nkpt \rightarrow +\infty$ and $tsmear\rightarrow 0$
(well it's not always possible to reach the mathematical limit so we should try to understand what happens
to our observables when we are **approaching** this limit and if it's possible to find values of ({{nkpt}}, {{tsmear}})
that are "close enough" to convergence).

The middle panel reveals that there are two branch (6-7, Python indexing) along $\Gamma-A$ that are quite sensitive
to the sampling of the Fermi surface and this picture is confirmed by the first panel obtained with the lowest value
of the electronic broadening.

This analysis tells us two things:

* We should analyze in more detail the convergence behavior of these specific branches wrt ({{nkpt}}, {{tsmear}})
  to make sure our results are really converged
* The strong variations observed in that particular region of the phonon spectrum could represent the signature
  of an important coupling between these vibrational modes and the electrons on the Fermi surface...

If you now dig a bit into the scientific literature, you will find that this is the famous $E_{2g}$ branch
(in-plane oscillations of the two B atoms, twofold degenerate at $\Gamma$)
that plays an important role in explaining the superconducting behavior of $MgB_2$.

Let's look in more details at the softening at the $\Gamma$ point.
We start by calling get_dataframe_at_qpoint to construct a dataframe
with the phonon frequencies and the parameters of the calculation

```{code-cell}
data = robot.get_dataframe_at_qpoint(qpoint=(0, 0, 0), units="meV", with_geo=False)
data
```

and use [seaborn](https://seaborn.pydata.org/) to produce a scatter plot in which the color of the points depends on tsmear:

```{code-cell}
robot.plot_xy_with_hue(data, x="nkpt", y="mode6", hue="tsmear");
```

A DDbRobot is essential a dictionary of DdbFiles and we can therefore reuse the DdbFile methods to call anaddb.
For example, we said that the two degenerate $E_{2g}$ modes at $\Gamma$
involve in-plane oscillations of the two Mg atoms.
Let's check this with:

```{code-cell}
key = "nkpt: 864, tsmear: 0.04"
gamma_point = (0, 0, 0)

phbands_gamma = robot[key].anaget_phmodes_at_qpoint(gamma_point, dipdip=0, lo_to_splitting=False)
phbands_gamma.plot_phdispl_cartdirs(gamma_point);
```

### How to analyze the converge of $\epsilon^0$, $\epsilon^\infty$ and Born effective charges

Let's assume we have computed the dielectric properties and the Born effective charges for a given
system with different k-meshes and we want to analyze the convergence of the results.
Also in this case, the `DdbRobot` provides methods to automate most of the boring work.

As usual, we start by creating a robot from a list of paths to DDB files.
Here we use three different files produced with 2x2x2, 4x4x4 and 8x8x8 k-meshes.

```{code-cell}
paths = [
    "out_ngkpt222_DDB",
    "out_ngkpt444_DDB",
    "out_ngkpt888_DDB"]

paths = [os.path.join(abidata.dirpath, "refs", "alas_eps_and_becs_vs_ngkpt", f) for f in paths]

alas_robot = abilab.DdbRobot.from_files(paths)
alas_robot
```

Now we call `anacompare_epsinf` to create a pandas `Dataframe` with the upper triangle
of the $\epsilon_{ij}^\infty$ dielectric tensor (Voigt notation) and we add the number of k-points
in the IBZ to the table to facilitate the analysis:

```{code-cell}
r = alas_robot.anacompare_epsinf(ddb_header_keys="nkpt")
r.df
```

A similar approach can be used to analyze $\epsilon_{ij}^0$

```{code-cell}
r = alas_robot.anacompare_eps0(ddb_header_keys="nkpt")
r.df
```

Analyzing the convergence of the Born effective charges is a bit more complicated
because now we have a tensor for each atom in the unit cell:

```{code-cell}
r = alas_robot.anacompare_becs(ddb_header_keys="nkpt")
r.df
```

But we can use the pandas API to select a portion of the data.
The below code, for example, selects the Born effective charges for *As*:

```{code-cell}
r.df[r.df["site_index"] == 1]
```

<!--- Click [TODO here]() to visualize the vibrational spectrum of $MgB_2$ with phononwebsite -->


text:
## ContactUs 0.5.0 (Unreleased)

* Require Ruby >= 1.9.3 going forward. [Jeff Dutil]

## ContactUs 0.4.0 (Oct 29th 2012)

* Add default rails form helper support and remove Formtastic dependency. [Jeff Dutil]
* Added support for SimpleForm. [flyerhzm]
* Added Japanese locale. [yosiyuki]
* Added French locale. [bgantaume]
* No longer copy default views & locales during installation.  Copy manually with rake tasks when wanting to customize now. [Jeff Dutil]

## ContactUs 0.3.0 (May 15th 2012)

* Changed route to /contact-us from /contact_us for seo. [Jeff Dutil]

## ContactUs 0.2.1 (May 4th 2012)

* Use the users provided email address in the email notifications reply_to field. [Jeff Dutil]

## ContactUs 0.2.0 (February 25th 2012)

* Added ContactUs.mailer_from setting in order to send from verified address, which is better practice than pretending the email is from the user. [Jeff Dutil]
* Added ContactUs.require_name setting in order to ask for the name with the contact form. [Jeff Dutil]
* Added ContactUs.require_subject setting in order to for the subject with the contact form. [Jeff Dutil]
* Formtastic dependency updated to >= 2.1.0 in order to fix commit_button deprecation. [Jeff Dutil]

## ContactUs 0.1.5 (January 6th, 2012)

* Added Chinese zh locale [kinopyo]

## ContactUs 0.1.4 (September 26th, 2011)

* Added German locale
* Email subject is now included in i18n

## ContactUs 0.1.3 (September 2, 2011)

* Added Brazilian Portuguese locale [brunoarueira]
* Added Spanish locale [igmarin]
* Added Italian locale [igmarin]

## ContactUs 0.1.2 (August 18, 2011)

* 100% Test Coverage under Ruby 1.8.7, 1.9.2, 1.9.3, REE, ruby-head, rbx-2.0 [Jeff Dutil]


text:
---
title: Welcome to TrueCoders
date: '2018-08-21'
---

## Our Mission

Our aim is to bridge the gap of tech talent in our community. We believe smart passionate people should always be engaged in doing what they love to do.

Our mission is to educate, elevate, and supply smart, passionate people with authentic coding skills to ensure they're capable of solving real-world programming problems.

## Our Team

Our team is dedicated to ensuring that you:

* Learn soft skills in order to work with people
* Achieve hard, real world programming skills
* Establish a process to elevate your career
* Become the best developer you can become

## Our Students

You're here because:

* You are interested in computers and programming
* You want to pursue a career in software development
* You are excited to learn new concepts and challenge yourself
* You passed the Aptitude Test with flying colors

This course will be intensive, diving into deep programming concepts. There will be times you want to give up.

But press on. Work hard. Put in the time. You'll get out what you put into this course. There is real victory for those who graduate from this course: You'll be employed as Developers!

## Our Pledge

> Coding is a craft and I pledge to perform it as such.\
> I will make my character apparent to those who come behind me.\
> My code will be ever simpler with a more refined purpose.\
> I will leave code better than when I found it so that when I or others come back to it, it will not rob us of time, the most precious of things.


text:
Graphical and Serial Console Access
===================================

Once a virtual machine is started you are able to connect to the
consoles it exposes. Usually there are two types of consoles:

-   Serial Console

-   Graphical Console (VNC)

> Note: You need to have `virtctl`
> [installed](/installation/?id=client-side-virtctl-deployment) to gain
> access to the VirtualMachineInstance.

Accessing the serial console
----------------------------

The serial console of a virtual machine can be accessed by using the
`console` command:

    $ virtctl console --kubeconfig=$KUBECONFIG testvmi

Accessing the graphical console (VNC)
-------------------------------------

Accessing the graphical console of a virtual machine is usually done
through VNC, which requires `remote-viewer`. Once the tool is installed
you can access the graphical console using:

    $ virtctl vnc --kubeconfig=$KUBECONFIG testvmi

If you need to open only a vnc-proxy without executing the `remote-viewer` command, it can be done using:

    $ virtctl vnc --kubeconfig=$KUBECONFIG --proxy-only testvmi

this would print the port number on your machine where you can manually connect using any of the vnc viewers

Debugging console access
------------------------

Should the connection fail, you can use the `-v` flag to get more output
from both `virtctl` and the `remote-viewer` tool, to troubleshoot the
problem.

    $ virtctl vnc --kubeconfig=$KUBECONFIG testvmi -v 4

> **Note:** If you are using virtctl via ssh on a remote machine, you
> need to forward the X session to your machine (Look up the -X and -Y
> flags of `ssh` if you are not familiar with that). As an alternative
> you can proxy the apiserver port with ssh to your machine (either
> direct or in combination with `kubectl proxy`)

RBAC Permissions for Console/VNC Access
---------------------------------------

### Using Default RBAC ClusterRoles

Every KubeVirt installation after version v0.5.1 comes a set of default
RBAC cluster roles that can be used to grant users access to
VirtualMachineInstances.

The **kubevirt.io:admin** and **kubevirt.io:edit** ClusterRoles have
console and VNC access permissions built into them. By binding either of
these roles to a user, they will have the ability to use virtctl to
access console and VNC.

### With Custom RBAC ClusterRole

The default KubeVirt ClusterRoles give access to more than just console
in VNC. In the event that an Admin would like to craft a custom role
that targets only console and VNC, the ClusterRole below demonstrates
how that can be done.

    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRole
    metadata:
      name: allow-vnc-console-access
    rules:
      - apiGroups:
          - subresources.kubevirt.io
        resources:
          - virtualmachineinstances/console
          - virtualmachineinstances/vnc
        verbs:
          - get

The ClusterRole above provides access to virtual machines across all
namespaces.

In order to reduce the scope to a single namespace, bind this
ClusterRole using a RoleBinding that targets a single namespace.

repository: idnt-devops/user-guide

repo_name: idnt-devops/user-guide


text:
# Cabal
Cabal is an experimental p2p community chat platform.

[Website](https://cabal-club.github.io/)

[Source](https://github.com/cabal-club)
## Install
In your terminal :
> npm i -g cabal
## Clients
[Desktop](https://github.com/cabal-club/cabal-desktop)

[Mobile](https://github.com/cabal-club/cabal-mobile)
## Public
To join the cabal public chat
> cabal://4ae5ec168a9f6b45b9d35e3cc1d0f4e3a436000d37fae8f53b3f8dadfe8f192f

license: Unlicense

repository: Antharia/knowledge

gha_license_id: Unlicense

repo_name: Antharia/knowledge


text:
# Introduction

pnm is a header-only, standalone Netpbm image reader/writer for modern C++ (C++11 or later).

It has no dependencies except for C++ Standard Library.

the interfaces are inspired by png++.

## What is Netpbm image format?

https://en.wikipedia.org/wiki/Netpbm_format

repository: ToruNiina/pnm

repo_name: ToruNiina/pnm


text:
# pymuscle-docs
Documentation for the PyMuscle library.

The contents of this repository are automatically generated with [Sphinx](http://www.sphinx-doc.org/en/master/). Issues with  this documentation should be created in the main [PyMuscle repository](https://github.com/iandanforth/pymuscle/issues).

### Docs Website

https://iandanforth.github.io/pymuscle-docs/

### Library Repository

https://github.com/iandanforth/pymuscle

repository: iandanforth/pymuscle-docs

repo_name: iandanforth/pymuscle-docs


text:
# BasicLWCs
A collection of the most basic LWCs, with a twist. There is no Hello World here, only LWCs that you will really use.

See the [Wiki](https://github.com/JodieM/BasicLWCs/wiki) for the list of components and details of each component.

repository: JodieM/BasicLWCs

repo_name: JodieM/BasicLWCs


text:
# Online speciation of biogenic emissions now available in the CMAQ repo

**Author/P.O.C.:**, [Jesse Bash](mailto:bash.jesse@epa.gov), Computational Exposure Division, U.S. EPA

## Brief Description

The Biogenic Emission Inventory System (BEIS) may be applied online in CMAQv5.2. This algorithm includes speciation of biogenic emissions into significant volatile organic compound species. The species produced are then mapped into CMAQ-available chemical mechanisms as determined by an input namelist called gspro, which is now distributed with the CMAQ repo. The file contains a header describing the various qquantities present inside. Briefly, each line is identified by a mechanism, followed by a mapping from a BEIS species to a surrogate species in that mechanism.

## Significance and Impact

Now that this file is distributed with the repo, users should have full access to modify the mapping of biogenic emissions into their chemical mechanism. For example, monoterpenes may be split into alpha-pinene, beta-pinene and limonene if the corresponding tracers are added to the model.

## Affected Files:

biog/beis3/gspro/gspro_biogenics_1mar2017.txt

## References:

Not Applicable

-----
## Internal Records:

### Relevant Pull Requests:
  [PR #197]

### Commit IDs:
cae9ef1
03a596f
4374727
e1cc83f
d7713ae

repository: rcboykin/CMAQ

repo_name: rcboykin/CMAQ


text:
[![Build Status](https://travis-ci.org/navikt/kafka-embedded-env.svg?branch=master)](https://travis-ci.org/navikt/kafka-embedded-env)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/no.nav/kafka-embedded-env/badge.svg)](https://maven-badges.herokuapp.com/maven-central/no.nav/kafka-embedded-env)

# kafka-embedded-env

A simple API for creating an embedded Kafka environment with the KafkaEnvironment class, typically used for running integration tests.

Based on the [Confluent Open Source distribution](https://www.confluent.io/product/confluent-open-source/) v7.2.x.

Instead of using the classic ports (2181, 9092, ...) for each server, the class will get the required number of available ports
and use those in configurations for each server.

```kotlin
class KafkaEnvironment(
    noOfBrokers: Int = 1,
    topicNames: List<String> = emptyList(),
    topicInfos: List<TopicInfo> = emptyList(),
    withSchemaRegistry: Boolean = false,
    val withSecurity: Boolean = false,
    users: List<JAASCredential> = emptyList(),
    autoStart: Boolean = false,
    brokerConfigOverrides: Properties = Properties()
) : AutoCloseable {
    data class TopicInfo(val name: String, val partitions: Int = 2, val config: Map<String, String>? = null)
}

fun start() // start servers in correct order

fun stop() // stop servers in correct order - session data are available

fun tearDown() // when finished with the kafka environment, stops servers and remove session data
```
Maximum allowed number of brokers is 2.

## Security
The 'withSecurity' parameter gives a kafka cluster with security, thus authentication and authorization
* Secured Zookeeper, kafka broker must authenticate and be authorized
* Secured Kafka broker (and inter broker), clients (including Schema registry) must authenticate and be authorized
* No security for Schema Registry clients
* No TLS

See ```JAASContext.kt``` for details and predefined set of producer and consumer credentials.
Observe that auto creation of topics is disabled when security is enabled.

The 'users' parameter is an option for custom set of producer and consumer credentials. Only relevant when
security is enabled.

## Getting Started
Add the dependency:

#### Gradle
```
dependencies {
    testImplementation "no.nav:kafka-embedded-env:3.2.2"
}
```

#### Maven
```
<dependency>
    <groupId>no.nav</groupId>
    <artifactId>kafka-embedded-env</artifactId>
    <version>3.2.2</version>
    <scope>test</scope>
</dependency>
```

**Note**: It is recommended that you use the Confluent version matching this library - currently v7.2.x

## Examples
### Default
```kotlin
val kafkaEnv = KafkaEnvironment()

kafkaEnv.start()
// do stuff
kafkaEnv.tearDown()
```

The default settings gives
* 1 Zookeeper
* 1 Kafka broker

### Custom 1
```kotlin
val kafkaEnv = KafkaEnvironment(
    noOfBrokers = 2,
    topicNames = listOf("test1", "test2", "test3"),
    withSchemaRegistry = true,
    autoStart = true
)
// do stuff
kafkaEnv.tearDown()
```
The above configuration gives
* 1 Zookeeper instance
* 2 Kafka brokers
* 1 Schema Registry instance

Given topics are automatically created and all servers are started in correct order - ready to use.
Each topic will have number of partitions equal to number of brokers.

### Custom 2
```kotlin
val kafkaEnv = KafkaEnvironment(
    noOfBrokers = 2,
    topicNames = listOf("custom1"),
    withSecurity = true,
    users = listOf(JAASCredential("myP1", "myP1p"),JAASCredential("myC1", "myC1p")),
    autoStart = true
)
// do stuff
kafkaEnv.tearDown()
```
The above configuration gives
* 1 Zookeeper instance
* 2 Kafka brokers

Given users are added to Kafka brokers JAAS context (authentication) and the topic is automatically created.
Observe that relevant authorization must be given before produce and consume scenario is activated.

See [Confluent authorization](https://docs.confluent.io/current/kafka/authorization.html).

For 'crash course' approach, see relevant test cases with security in ```KafkaEnvironmentSpec.kt```

## ServerPark
An instance of KafkaEnvironment has a serverPark (ServerPark) property, giving access to details depending
on the state. Each server (ServerBase) has a few relevant properties and start/stop functions.

```kotlin
data class ServerPark(
    val zookeeper: ServerBase,
    val brokerStatus: BrokerStatus,
    val schemaRegStatus: SchemaRegistryStatus,
    val status: ServerParkStatus
)

abstract class ServerBase {
    protected var status: ServerStatus = NotRunning

    open val host: String = "localhost"
    abstract val port: Int
    abstract val url: String

    abstract fun start()
    abstract fun stop()
}
```
Thus each server can be stopped and started independently.

In order to ease the state handling, some properties are available.

```kotlin
val zookeeper get() = serverPark.zookeeper as ZKServer
val brokers get() = serverPark.getBrokers()
val brokersURL get() = serverPark.getBrokersURL()
val adminClient get() = serverPark.getAdminClient()
val schemaRegistry get() = serverPark.getSchemaReg()
```
Be aware of what you are doing
* kafka environment without brokers (noOfBrokers = 0), gives empty list for 'brokers'
* non started kafka environment gives 'null' for 'adminClient'
* a started kafka environment without brokers still gives 'null' for 'adminClient'
* ...

The 'adminClient' property creates an instance of AdminClient with super user authorization. Thus, feel free to play
with it. See [Kafka AdminClient API](https://kafka.apache.org/20/javadoc/org/apache/kafka/clients/admin/AdminClient.html)
for the set of available operations.

**Please close adminClient after use.**

## Changelog

### [3.2.2]
- Upgrade to Confluent 7.3.1
- Upgrade to Kafka 3.2.3
- Upgrade to Surefire 3.0.0-M8

### [3.2.1]
- Moved some dependencies from scope test

### [3.2.0]
- Fix Snyk issues

### [3.1.7]
- Upgrade to Confluent 7.2.1
- Upgrade to Ktor 2.0.3
- Upgrade to Kafka 3.2

### [3.1.4]
- Upgrade to Ktor 2.0.1
- Change to use Apache maven wrapper

### [3.1.3]
- Dependency bumps Confluent 7.1.1
- Github actions setup-java to v3

### [3.1.2]
- Bad merge fix

### [3.1.1]
- Upgrade to Kotlin 1.6.20
- Upgrade to Ktor 2.0.0
- Upgrade to Java to 17

### [3.1.0]
- Kafka 3.1.0
- Confluent Platform 7.1.0
- Kotlin 1.6.20
- Ktor 1.6.8
- Logback 1.2.11
- Slf4j 1.7.33

### [2.8.1]
- Multiple dependency bumps:
- Kafka 2.8.1
- Confluent Platform 6.2.1
- Kotlin 1.6.0
- Ktor 1.6.5
- Spek 2.0.17
- Slf4j 1.7.32
- Logback 1.2.7
- Kluent 1.68

### [2.8.0]
- Upgrade to Kafka 2.8.0
- Upgrade to Confluent Platform 6.2.0

### [2.7.0]
- Upgrade to Kafka 2.7.0
- Upgrade to Confluent Platform 6.1.0
- Changed to Kafka Scala build 2.13

### [2.5.0]
- Upgrade to Kafka 2.5.0
- Upgrade to Confluent Platform 5.5.0
- Fixes issue where config overrides were not passed to the AdminClient

### [2.4.0]
- Upgrade to Kafka 2.4.0
- Upgrade to Confluent Platform 5.4.0

### [2.3.0]
- Use Kafka 2.3.1
- Use Confluent 5.3.1

### [2.2.3]
- Increase default Zookeeper connection timeout from Kafka brokers in another attempt to remediate sporadically failing tests on slow machines

### [2.2.2]
- Another attempt at increasing waiting attempts for embedded Zookeeper in attempt to remediate sporadically failing tests on slow machines

### [2.2.1]
- Increase timeouts against embedded Zookeeper in attempt to remediate sporadically failing tests on slow machines

### [2.2.0]
- Upgrade to Kafka 2.3.0
- Upgrade to confluent platform 5.3.0

### [2.1.1]

- Improved path handling for temporary files (#7)

### [2.1.0]

#### What's new?

The possibility to override topic as well as broker configurations:

```
@param topicInfos a list of topics to create at environment startup - default empty
@param topicNames same as topicInfos, but for topics that can use the default values
@param brokerConfigOverrides possibility to override broker configuration
```

```kotlin
class KafkaEnvironment(
    noOfBrokers: Int = 1,
    topicNames: List<String> = emptyList(),
    topicInfos: List<TopicInfo> = emptyList(),
    withSchemaRegistry: Boolean = false,
    val withSecurity: Boolean = false,
    users: List<JAASCredential> = emptyList(),
    autoStart: Boolean = false,
    brokerConfigOverrides: Properties = Properties()
) : AutoCloseable {
    data class TopicInfo(val name: String, val partitions: Int = 2, val config: Map<String, String>? = null)
}
```

#### Breaking changes from 2.0.x

`class KafkaEnvironment`:
 - The parameter `topics` should be renamed to `topicNames` if you wish to keep the behaviour from previous versions.

## Contact

Create an issue here on the GitHub issue tracker. Pull requests are also welcome.

Internal resources may reach us on Slack in the #kafka channel.

repository: navikt/kafka-embedded-env

gha_language: Kotlin

repo_name: navikt/kafka-embedded-env


text:
c-mnalib
========
<img src="logo.png" height="50" style="float: left;"/>
C-mnalib is a C library for easy access and configuration of mobile network modems, e.g., LTE modems.
The library focuses on providing access to network quality indicators and network parameters of the modems by using AT commands.

The project is currently in beta development stage. Please contact<EMAIL_ADDRESS>for further information about this library.

## Library Overview

### Supported Devices
* Sierra Wireless MC7455 (via AT commands) with GOBI drivers from the manufacturer.
* Sierra Wireless MC7565 (via AT commands) with GOBI drivers from the manufacturer.

### Dependencies
This is based on Archlinux packages. Other distributions may slightly differ.

#### Library:

* base-devel
    * cmake
    * pkg-config
    * gcc
    * binutils
    * ...
* glib2
* curl
* libcurl-compat
* libgudev

#### Scripts:

* autossh     (for automatic reverse tunnels)

### Conflicts
This software conflicts with the systemd-service ModemManager. ModemManager uses the AT command interface to configure the mobile broadband connection for the NetworkManager service and pipes the payload-data through it.
However, c-mnalib requires exclusive access to the AT command interface.
Check for ModemManager via
```
systemctl status ModemManager
```
and disable it
```
sudo systemctl stop ModemManager
sudo systemctl disable ModemManager
```

## Installation
Clone this respository in a working directory and build using cmake. Make sure you have installed the required dependencies.
```
git checkout <URL of this GIT repository>
cd c-mnalib
mkdir build
cd build
cmake ../
make
## Optional
sudo make install
```

### Compile with Debug Symbols (for Easier Core-dump Analysis):

Release mode optimized but adding debug symbols, useful for profiling :
```
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ...
```
Debug mode with NO optimization and adding debug symbols :
```
cmake -DCMAKE_BUILD_TYPE=Debug ...
```

## License
The software is released under MIT license.

## Acknowledgements
If you wish to acknowledge this library in a publication, please refer to:
```
@InProceedings{FalkenbergSliwaPiatkowskiEtal2018a,
	Author = {Robert Falkenberg and Benjamin Sliwa and Nico Piatkowski and Christian Wietfeld},
	Title = {Machine Learning Based Uplink Transmission Power Prediction for LTE and Upcoming 5G Networks using Passive Downlink Indicators},
	Booktitle = {2018 IEEE 88th IEEE Vehicular Technology Conference (VTC-Fall)},
	Year = {2018},
	Address = {Chicago, USA},
	Month = {Aug},
	Url = {https://arxiv.org/abs/1806.06620}
}
```

## Supplemental Notes

### Checking Mobile Quota
#### T-Mobile Germany
* Browser: http://datapass.de
* CURL: http://datapass.de/home?continue=true
* Via T-Mobile API (json results):
    * Source: http://www.b.shuttle.de/hayek/hayek/jochen/wp/blog-de/2016/04/08/wenn-einem-programmierer-beim-abruf-von-pass-telekom-de-langweilig-wird/
```
# curl --user-agent 'Mozilla/4.0' http://pass.telekom.de/api/service/generic/v1/status | jq .usedVolumeStr
"482,76_MB"
```

repository: learning-lte/c-mnalib

repo_name: learning-lte/c-mnalib