text:
FOSAdvancedEncoderBundle
========================

## Features

The FOSAdvancedEncoderBundle adds support for changing the encoder on an
instance basis instead of using the same encoder for all instances of a class.

## Installation

### Add FOSAdvancedEncoderBundle to your project

The recommended way to install the bundle is through Composer.

```bash
$ composer require 'friendsofsymfony/advanced-encoder-bundle:~1.0'
```

### Add FOSAdvancedEncoderBundle to your application kernel

```php
    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new FOS\AdvancedEncoderBundle\FOSAdvancedEncoderBundle(),
            // ...
        );
    }
```

## Configure the encoders

You now need to configure the encoders available for the factory used by
the bundle. They are identified by a name used to reference them later. The
configuration keys available are exactly the same than for the SecurityBundle
encoder configuration.

```yaml
fos_advanced_encoder:
    encoders:
        my_encoder:
            algorithm: sha512
            iterations: 5000
            encode_as_base64: true
        another_encoder: sha1    # shortcut for the previous way
        my_plain_encoder:
            algorithm: plaintext
            ignore_case: false
        my_custom_encoder:
            id: some_service_id
```

## Use the bundle

You can now implement the `FOS\AdvancedEncoderBundle\Security\Encoder\EncoderAwareInterface`
interface in your User class. It consist of a single method `getEncoderName`
returning the name of an encoder defined previously or `null`.

If you return `null`, the standard factory of SecurityBundle will be used
(as if you were not using the interface at all). Otherwise, the encoder will
be retrieved by its name.

repository: Jason-Hendry/FOSAdvancedEncoderBundle

repo_name: Jason-Hendry/FOSAdvancedEncoderBundle


text:
---
name: Mirror Keyla Detmer
rarity: 5
series: dsc
memory_alpha:
bigbook_tier: 8
events: 8
in_portal:
date: 19/03/2020
obtained: Event
mega: false
published: true
---

This iteration of Detmer is probably one of my most anticipated cards which makes it such a shame that's she's such disappointing addition. SEC/CMD is about as vanilla a skill set as you can get and although she hits #2 with that pairing in voyages her two skilled nature make that completely redundant as it would be a negative should one want to hit a ten hour voyage.

This will be one of the few occasions where having a large event potential would be a negative. Disco and Mirror event capable crew have pretty much reached saturation now and if you've been playing for a while you will have accrued a large number of them with little effort. Most of which will be significantly more useful than Commandant Reaction-Shot here.

To focus on the positives she has a nice 400% damage hit at 8s, not as fast as her Mirror Universe compatriot Captain Killy but still enough to put a dent in any skirmish lineup. However unless you have no damage dealers, no Disco or Mirror crew or, for some reason, no decent SEC/CMD crew she is mostly useless to you in all other capacities.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Summary

At its core, Tametsi is little more than solving a system of inequalities. For any given group of cells X, there is a minimum number Y and a maximum number Z of mines within that group of cells. By combining an given set of inequalities, starting with the row/column and color hints, further inequalities can be derived. Eventually, one gets so-called "trivial" inequalities where the number of mines in a group of cells is either 0 (so all of them can be revealed) or the same as the number of cells (so all of them are mines and should be flagged). After deriving these trivial inequalities, known inequalities can be adjusted and new inequalities can be created from newly-revealed hints. The difficulty in solving puzzles lies in combining inequalities to produce more.

What follows is a fairly high-level explanation of how [TametsiSolver.py](./TametsiSolver.py) works.

# Core

As mentioned earlier, inequalities consist of three pieces of information:
* a set of cells, e.g. `{A, B, C, D}`,
* a minimum number of mines, e.g. 1, and
* a maximum number of mines, e.g. 3.

From here on, I will use `1 <= {A, B, C, D} <= 3` to represent this inequality. In fact, I'll go ahead and define some syntax to make talking about the rest of this easier. Given an inequality `X = (1 <= {A, B, C, D} <= 3)` and a similar inequality `Y = (2 <= {C, D, E} <= 2)`, then...
* `X.cells = {A, B, C, D}`, `X.min = 1`, and `X.max = 3`.
* `X + Y = UNION(X.cells, Y.cells)`, which is `{A, B, C, D, E}` in this case. For this and the following two operations, the bounds aren't considered since calculating those is considerably more complex and I want simple syntax to talk about various set operations on the cells.
* `X * Y = INTERSECTION(X.cells, Y.cells)`, which is `{C, D}` in this case.
* `X - Y = DIFFERENCE(X.cells, Y.cells)`, which is `{A, B}` in this case, and likewise, `Y - X = {E}`.
* `len(X)` is the number of cells in `X.cells`, which is `4` in this case.
* An inequality `X` is an **exact inequality** if and only if `X.min = X.max`.
* An inequality `X` is a **trivial inequality** if and only if `X.max = 0` *or* `X.min = len(X)`.

## Crossing Inequalities

Two inequalities `X` and `Y` can overlap in a variety of ways.
1. **Disjoint:** inequalities where there is no overlap between cell sets. These are simply not considered.
1. **Total overlap:** `X` and `Y` have the exact same set of cells. In such a case, the new minimum is then the maximum of `X.min` and `Y.min` and likewise, the new maximum is the minimum of maximums. Like disjoint inequalities, these are not normally considered.
1. **Subset:** `X` or `Y` is wholly contained within `Y` or `X`, respectively.
1. **Intersection:** `X` and `Y` have an overlap that is contained in but not equal to either `X` or `Y`.

Both the **subset** and **intersection** cases are special cases of a more general situation: `X` and `Y` have a non-empty overlap.

### Derived Inequalities

Crossing `X` and `Y` will produce two or three inequalities corresponding to `X * Y`, `X - Y`, and `Y - X`. Degenerate inequalities where the cell set is empty are not considered. I worked out these formulas by imagining shoving as many mines as possible into one subset or another.

**`Z = X * Y`**
* minimum: `max(0, X.min - (len(X) - len(Z)), Y.min - (len(Y) - len(Z)))` - putting as many of the mines in `X` or `Y` as possible into the cells not contained in `Z`.
* maximum: `min(len(Z), X.max, Y.max)` - putting as many of the mines in `X` or `Y` as possible into the cells contained in `Z`.

**`U = X - Y`** (also applies to **`V = Y - X`** but with `Y` instead of `X`)
* minimum: `max(0, X.min - Z.max)` - the mines in `X` minus the ones that can be put in `Z`.
* maximum: `min(len(U), max(0, X.max - Z.min))` - either all the cells in `U` are mines or it's the max number of mines in `X` minus the ones that have to be put in `Z`.

## Reducing Inequalities

Once trivial inequalities have been found and the corresponding tiles revealed or flagged, it's time to adjust inequalities that overlap with any trivial inequality. The sets of newly revealed `R` and newly flagged `F` tiles are calculated and every existing inequality is checked to see how much they overlap with these two sets. If a given inequality `X` has had all its tiles revealed and/or flagged, then it is simply removed. Otherwise, a new inequality `Z` is created:

* `Z = X - R - F` because it's simply the cells of `X` without those in `R` or `F`.
* minimum: `min(max(X.min - (X * F).len, 0), Z.len)` because it's the previous min minus all the flagged cells, unless the number of remaining cells is smaller or it's 0.
* maximum: `min(X.max - (X * F).len, Z.len)` because it's the previous max minus all the flagged cells except when the remaining number of cells is smaller.

# Improvements

## Tiles Encoded As Binary

Originally, tiles were tracked in `set` objects. Operations involving sets, such as unions, intersections, and differences, are comparatively slow in Python. Conveniently, Python's native biginteger support meant that I could encode the tiles in an inequality as a binary number where each digit was a 1 to indicate that tile was in the set and 0 otherwise. Thus, unions become binary OR, intersections become binary AND, and differences become binary AND NOT. In Python operations, these are `X & Y`, `X | Y`, and `X & ~Y`. This conferred quite a significant speedup, which makes sense; binary operations are usually pretty optimized already.

## Exact Inequalities

An "exact" inequality is one where a given inequality `X` has `X.min == X.max`. As it turns out, exact inequalities are somehow quite useful. Generally, working *only* with exact inequalities confers a massive speed improvement, largely because there aren't as many that can be derived from a given set of inequalities. However, they are not *sufficient* to deduce every logic step of all puzzles. For example, Combination Lock VI has one step that requires deriving inexact inequalities. Hence, for every step, exact inequalities are derived first and then if no progress is made, inexact inequalities are derived. Leaving these inexact inequalities around slows down the solver quite a bit because there's so many of them. Hence, so immediately after any cells are revealed or flagged, all inexact inequalities are deleted.

My solver allows you to configure the number of allowed "inexact rounds", so to speak, that specifies the maximum number of consecutive rounds that have to use inexact inequalities. The counter resets every time inexact inequalities are purged, so it's possible to have the max number of inexact rounds be 1 and still have three such rounds in a puzzle; they just can't be consecutive. I have found that setting this max to 1 produces relatively good puzzles; fewer than that tends to produce easier puzzles and more than that tends to produce weaker/messier puzzles and/or make them less satisfying to solve.

## Inequality Map

Realistically, any given set of tiles has at most one known inequality. Hence, the solver maintains a mapping from the tiles in an inequality to the min and max of that inequality. If a new inequality is derived that has the same tiles as one already known, then that means both can be replaced with a more accurate inequality that takes both pairs of bounds into account. That is, if `X.cells == Y.cells`, then (calling the new one `Z` for convenience) `Z.min = max(X.min, Y.min)` and `Z.max = min(X.max, Y.max)`.

## Extensions

These are not at all necessary for solving or generating puzzles, but I've included them as features of my solver.

* **Recording Stages**: a round can have multiple stages (make new inequalities, cross them all, purge inexact inequalities, find trivial inequalities, reduce inequalities) and a helper function `record_stage` will take note of the number of inequalities before and after the operation. One way this is useful is to know if any new inequalities were created or removed in a stage. If no inequalities are created or removed during an entire round, the puzzle is considered unsolvable.
* **Ancestry:** I don't think I actually use this feature at all, but ostensibly, every inequality also has a record of its parents and the round it was created in.

# Scoring

Scoring a puzzle accurately is actually rather difficult. Rating the difficulty of a puzzle is already a rather subjective experience for humans, let alone an algorithm. Thus far, I've only experimented with scoring methods that look at the number of rounds it took to deduce each logical step. In general, the more rounds it took, the harder it is to make that logical deduction. Most of the time, it takes just 1 round, but I have seen them go as high as 7, though that is of course quite rare.

## Smooth Difficulty

I initially scored my puzzles very simply: just look at how many of each difficulty level there are. I later developed a different scoring algorithm that attempts to optimize for "smoothness" in the difficulty curve. So [1, 3, 3, 1] should be better than [1, 5, 1, 1].

Excepting unsolvable and trivial puzzles, the smooth difficulty score is calculated by taking every adjacent pair of steps `a, b`, calculating intermediate scores, and then summing them up. The intermediate score for a given pair of steps `a, b` is calculated by setting `x = min(a, b)` and `y = max(a, b)` and then calculating `x * (y - 1) / (y - x + 1)`. The intent is to reward similarity between `a` and `b` as well as rewarding higher values for them.

Let's suppose a given puzzle has steps of difficulty [1, 3, 2, 1, 3, 1]. Then the pairs and intermediate scores are as follows:

```
1, 3 -> 1 * (3 - 1) / (3 - 1 + 1) = 2 / 3 ~= 0.667
3, 2 -> 2 * (3 - 1) / (3 - 2 + 1) = 4 / 2 ~= 2.0
2, 1 -> 1 * (2 - 1) / (2 - 1 + 1) = 1 / 2 ~= 0.5
1, 3 ~= 0.667
3, 1 ~= 0.667
```

Which sums up to about 4.5 altogether.

Now let's suppose it instead had difficulty steps of [1, 1, 6, 1, 1].

```
1, 1 -> 1 * (1 - 1) / (1 - 1 + 1) = 0
1, 1 = 0
1, 6 -> 1 * (6 - 1) / (6 - 1 + 1) = 5 / 5 = 1
1, 1 = 0
1, 1 = 0
```

Which sums up to 1 altogether.

So a puzzle that has a few medium difficulty steps will score much higher than a puzzle that just has one really hard step. My intent is that this produces puzzles that are more enjoyable to play given that the difficulty curve tends to be a bit more level.

repository: elendiastarman/Tametsi-level-generator

branch_name: refs/heads/main

gha_language: Python

gha_license_id: MIT

repo_name: elendiastarman/Tametsi-level-generator


text:
# OneNote XML schemas

This folder contains the XML schemas of various versions of OneNote. References:

- [OneNote 2013 schema](https://docs.microsoft.com/en-us/archive/blogs/descapa/onenote-2013-com-api-xml-schema-onenote-2013-xsd) is the source of `onenote15.xsd`.
- [OneNote 2010 schema](https://docs.microsoft.com/en-us/archive/blogs/descapa/onenote-2010-xml-schema) is the source of `onenote14.xsd`.

The scheme found there is the same as that [provided by Microsoft through official channel](https://www.microsoft.com/en-us/download/details.aspx?id=27396). (They might be licensed differently. Read EULA to be sure.)

repository: GeeLaw/onenote-object-model

repo_name: GeeLaw/onenote-object-model


text:
# getting-start-with-laravel
This resource provides best tutorial links to start with and step by step guide

### Get Start with API

- [What is REST API? | Web Service](https://www.youtube.com/watch?v=qVTAB8Z2VmA)
- [What is a REST API? by Mosh](https://www.youtube.com/watch?v=SLwpqD8n3d0)
- [RESTful API series by Atif](https://www.youtube.com/playlist?list=PLYVcyg3AF-zvDDXBLDyn9UJSgAYMWpUS3)


text:
---
layout: page

sidebar:
  title: Documentation
  navigation: docs

title:  Page layouts
date:   2017-01-11 14:47:50 +0100
author: Desired Persona
post_meta: false
permalink: /docs/page-layouts/
---

### Archive Pages
This theme fully supports [Jekyll Archives](https://github.com/jekyll/jekyll-archives){:target="_blank"} plugin.

1. Update your sites `_config.yml` file with the required settings.

```yaml
# Jekyll Archives Settings https://github.com/jekyll/jekyll-archives
jekyll-archives:
  enabled:
     - categories
     - tags
     - year
     - month
     - day
  layout: 'archive'
  permalinks:
    year: '/:year/'
    month: '/:year/:month/'
    day: '/:year/:month/:day/'
    tag: '/tag/:name/'
    category: '/category/:name/'
```

2. Copy `archive.html` page from `/docs/pages/` demo folder in to your sites `/pages/` directory.

3. Copy `category.html` and `tag.html` pages from `/docs/pages/` demo folder in to your sites `/pages/` directory. These pages will auto update all categories and tags automatically every time you build your site.

BTW the year, month & day archive pages are auto-generated for you using the `archive.html` layout.

gha_language: CSS


text:
# kick_tip
Trying to predict the outcome for a given football matchup using (statistical) learning methods.

##### Problem definition:
A set of football clubs defined as
![equation](http://latex.codecogs.com/gif.latex?C%3A%3D%5Cleft%20%5C%7B%20x%5Cin%20%5Cmathbb%7BR%7D%5E%7BN%7D%20%7C%5C%20x%20%5C%20%5Ctext%7Bgiven%20some%20specific%20time%7D%5C%20t%20%5C%20%5Ctext%7Brepresents%20the%20state%20of%20a%20club%20in%20respective%20football%20league%20%7D%20%5Cright%20%5C%7D) is given.
For any tuple ![equation](http://latex.codecogs.com/gif.latex?%28x%2Cy%29%5Cin%20C%5E2) the outcome is encoded as ![equation](http://latex.codecogs.com/gif.latex?f%28x%2Cy%29%5Cin%20%5B0%2C1%5D) where 0 indicates a strong tendency
in favor of x and vice versa.
The mapping that is to be learned is defined as
![equation](http://latex.codecogs.com/gif.latex?f_%5Ctheta%3A%20C%5E2%20%5Crightarrow%20%5B0%2C1%5D%20%2C%20%28x%2Cy%29%20%5Cmapsto%20o), where theta is the parameter of the function that is being "learned" and o is the outcome as described above.
Goal is then to optimize the function f so that the error on the training data is minimized and the model is able to generalize to unseen data.

###### Possible strong features that may be interesting to extract:
Clubprestige (e.g. a value that represents the 'prestige' of a club based on (performance) history in the respective league),
relative Clubstrength (e.g. a value that represents a conclusion on past encounters within a certain matchup),
Playerstrength (e.g. a value that represents the current squad), etc.

## To-Do's:
List of things that need to be done:
* Check on available literature i.e., related work
    * [Ulmer et al. on Premier League Predictions using AI & ML](http://cs229.stanford.edu/proj2014/Ben%20Ulmer,%20Matt%20Fernandez,%20Predicting%20Soccer%20Results%20in%20the%20English%20Premier%20League.pdf)
    * [Pettersson on using RNN for Football Match Prediction](http://publications.lib.chalmers.se/records/fulltext/250411/250411.pdf)
    * [Silfwer on his attempt of doing the same and collecting data over 2 years](https://doctorspin.me/digital-strategy/machine-learning/)
    * [Raval YT Video on Football Match Prediction with Deep Learning](https://www.youtube.com/watch?v=6tQhoUuQrOw)
* Collect data (write some script to automatically extract information from specific sites to some form of database)
* Future: Feature-Extraction & Preprocessing, Devlop/Train/Evaluate some model

#### Additional remarks
This repo is created simply out of fun, trying to take the things one has learned in the past by taking classes and
getting to know and love learning methods and apply them on some real life application that is cool (rather
than in the context of academia-only). My friend Bilal came up with the idea, so I created this repo for us to
manage things in one place cleanly. Robin is also involved though sceptical, I hope that we may find/take the time
to try this out (at least if we don't get rich we gain some experiences and insights by doing it anyways haha).


text:
# Working with the source

The DayPicker monorepo works together with [Yarn workspaces](https://yarnpkg.com/features/workspaces):

- `./package/react-day-picker`: this workspace contains the DayPicker source code and the development tools
- `./website`: the [Docusaurus](http://v2.docusaurus.io) app for [the documentation website](http://react-day-picker-next.netlify.app)

## Getting started

1. Clone the monorepo and install the dependencies

   ```
   $ git clone git@github.com:gpbl/react-day-picker.git
   $ cd react-day-picker
   $ yarn install
   ```

2. Open [react-day-picker.code-workspace](https://github.com/gpbl/react-day-picker/blob/master/react-day-picker.code-workspace) with vscode for a ready development environment.

## Development scripts

While working with the source code you will find useful these scripts:

```bash
$ yarn workspace react-day-picker typecheck-watch # start the typecheck in watch mode
$ yarn workspace react-day-picker develop         # start the build in watch mode
$ yarn workspace website start                    # start the website in watch mode
$ yarn workspace website typecheck-watch          # start the typecheck in watch mode for website
```

Some These are configured to start when opening the vscode project.

## Testing

In DayPicker we run unit tests and integration tests:

```bash
$ yarn workspace react-day-picker test  # run the unit tests
$ yarn workspace website test           # run the integration tests
```

Run the relative watch script to run the test in watch mode:

```bash
$ yarn workspace react-day-picker test-watch  # run the unit tests
$ yarn workspace website test-watch           # run the integration tests
```

repository: mnouraei/react-day-picker

repo_name: mnouraei/react-day-picker


text:
# generator-csebot
[![Build Status](https://joalmeid.visualstudio.com/_apis/public/build/definitions/8b82ddcf-c765-463a-8325-394badc0294a/65/badge)](https://joalmeid.visualstudio.com/generator-csebot/_build)

This project is Yeoman Generator with CI/CD for [Microsoft Bot Framework](http://botframework.com) a.k.a BotBuilder.
It started with a fork from [DarqueWarrior/generator-team](https://github.com/DarqueWarrior/generator-team) where [Donovan Brown](https://twitter.com/DonovanBrown) created a great yeoman generator for several languages and DevOps targeting different platforms.
Based on this [yo csebot](http://donovanbrown.com/post/yo-Team) yeoman generator, I had the need to be able to speed up project kickoffs with botbuilder.
I'm sharing this with the community - feel free to colaboration, raise [issues](https://github.com/joalmeid/generator-csebot/issues), and ask for features!

>
> With this generator, you can **pick your language**, and it will **create Bot boilerplates projects** with **complete CI and CD** on **VSTS** or **TFS**.
>

![Demo](images/cse-generator-demo.gif)

## Capabilities
***generator-csebot*** is a [Yeoman](http://yeoman.io/) generator that creates a complete CI/CD pipeline in [Team Foundation Server](https://www.visualstudio.com/tfs/) or [Visual Studio Team Services](https://www.visualstudio.com/team-services/) for your [Microsoft Bot Framework](http://botframework.com) bot in the following languages:
- Csharp (C#)
- Node.js
- Typescript

Bot comes with:
- [Bot Builder SDK Azure Extensions](https://github.com/Microsoft/BotBuilder-Azure), namely with [Azure Table Storage](https://azure.microsoft.com/en-us/services/storage/tables/) for storing bot state.
- [Application Insights integration](https://github.com/Microsoft/BotBuilder-Azure), already configured and with sample telemetry modules, ready for use.
- It allows you to deploy to [Azure App Service](https://azure.microsoft.com/en-us/services/app-service/web/) workloads.

## Requirements
- [Team Foundation Server 2017+](https://www.visualstudio.com/downloads/) or [Visual Studio Team Services Account](https://app.vsaex.visualstudio.com/profile/account)
   - [Personal Access Token](https://www.visualstudio.com/en-us/docs/setup-admin/team-services/use-personal-access-tokens-to-authenticate)
- [Azure Subscription](https://azure.microsoft.com/en-us/free/)
- [Node.js](http://nodejs.org/)
- [NPM](https://www.npmjs.com/)
- [Git](http://git-scm.org/)
- [.NET Framework 4.6](https://www.microsoft.com/en-us/download/details.aspx?id=21)

## Install / Usage
You can read how to use it at ***[Getting Started](https://github.com/joalmeid/generator-csebot/wiki/Getting-Started)***.

## Roadmap
- Add docker support
- Investigate on how to register bot automatically into Dev Portal
- Add similar *templates* to Bot Dev Portal in all supported languages
  - **Basic bot**: A bot with the basic building blocks needed for any conversation: a welcome message, greeting, and a fallback response when what the user says is not understood by your bot.
  - **Echo bot**: A simple bot that can echo back a user's message.
  - **QnA bot**: A bot that demonstrates how to use qnamaker.ai to power a single-turn question and answer experience.
  - **Simple Conversation bot**: A bot that demonstrates the use of bot memory to have a simple, contextual conversation with the user.
  - **Bot memory**: A bot that remembers user’s communication preference and later recalls that in a conversation.
  - **Multi-turn conversation bot**: A bot that helps a user book a table at Contoso Cafe - a fictitious coffee shop, based out of Seattle, WA.
  - **Context carry over bot**: A bot that helps a user find cafe locations by carrying over context from prior conversations.
  - **Prompt for user input bot**: A bot that demonstrates different ways to prompt a user for input while interacting with Contoso Cafe - a fictitious coffee shop based out of Seattle, WA.
  - **Complete Contoso Cafe bot**: A complete bot for Contoso Cafe - a fictitious coffee shop based out of Seattle, WA. This bot can do all tasks that are otherwise covered in the individual samples.

## Debug
You can debug the generator using [VS Code](http://code.visualstudio.com/). You need to update the launch.json. Replace any value in [] with your information.  Use [npm link](https://docs.npmjs.com/cli/link) from the root folder to load your local version.

repository: joalmeid/generator-csebot

gha_language: JavaScript

repo_name: joalmeid/generator-csebot


text:
---
name: messages_strings_send_recv_multi
language: C
library: czmq
---

Sending multiple string frames is possible using the `zstr_sendm` function. This
function will postpone the actually sending of the message until the last frame
is ready.

```c
zstr_sendm (socket, "HELLO");
zstr_sendm (socket, "beautiful");
zstr_send (socket, "WORLD!");
```

Or do the same even simpler with the `zstr_sendx` function. Last parameter must
be NULL!

```c
zstr_sendx (socket, "HELLO", "beautiful", "WORLD!", NULL);
```

To receive a series of string frame use the `zstr_recvx` function. Each string
is allocated and filled with string data!

```c
char *hello, beautiful, world;
zstr_recvx (socket, &hello, &beautiful, &world, NULL);
```


text:
# Peridiopsora mori (Barclay) K.V. Prasad, B.R.D. Yadav & Sullia, 1993 SPECIES

#### Status
SYNONYM

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

#### Published in
Curr. Sci. 65(5): 426 (1993)

#### Original name
Caeoma mori Barclay, 1890

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Aecidium/Aecidium mori/ Syn. Peridiopsora mori/README.md

repo_name: mdoering/backbone


text:
# Release post process

Product marketing is responsible for creating the monthly release post in collaboration with the product and content teams. Here is an overview of the process:

**10 days before release ships**

- Product marketing generates the release post template with placeholder section for highlights

**7 days before release ships**

- PMs to recommend which updates to feature and provide draft copy and assets (videos, links, screenshots) for all highlights directly to the PR.
- If assets aren't ready, PM to add a placeholder for expected assets.

**Up until release ships**

- VP Product runs the script to generate changelog and merges it into the release template.
- If necessary, PMs make edits to the changelog based on what was actually shipped.
- PMs add final assets.
- Product marketing to package and draft the release post and share with Rebecca and Christina for review.

**0-2 days after release ships**

- No new additions or edits from the product team
- Managing Editor edits and publishes release post.

repository: Princesso/about

repo_name: Princesso/about


text:
![](https://github.com/sylhare/Elixir/blob/master/resources/elixir.png?raw=true)

[![Hex pm](http://img.shields.io/hexpm/v/hexper.svg?style=flat)](https://hex.pm/packages/hexper)
[![Build Status](https://travis-ci.org/sylhare/Elixir.svg?branch=master)](https://travis-ci.org/sylhare/Elixir)
[![codecov](https://codecov.io/gh/sylhare/Elixir/branch/master/graph/badge.svg)](https://codecov.io/gh/sylhare/Elixir)

Elixir is a functional, concurrent, general-purpose programming language that runs on the Erlang virtual machine (BEAM).

Elixir also provides a productive tooling (`Mix` build tool, interactive shell)and an extensible design (scalability, fault-tolerance).

Instead of thinking of object, you think of little easy to test process that you spawn and kill when needed.

## Getting started

Go to [elixir-lang.org](https://elixir-lang.org/install.html) and install elixir following the instruction, on MacOS with brew:
```
brew install elixir
```

Elixir has an interactive prompt called `iex` that you can try on the commad line. To quit the `iex` use `[command] + [c]` then `[a]`.

To run a script try with:
```bash
elixir hello.exs
```

To compile your module you should use `elixirc` such as
```bash
elixirc hello.exs
```

## Using Mix

`Mix` is a development tool for Elixir that help kick start an Elixir project:

```bash
mix new demo
```

Before running a project you might want to update all dependency using:

```bash
mix deps.get
```

And a project will be generated. To test your mix project try using:

```bash
mix test
```

However is you want to use your project functions in the `iex`, go in your root folder and run:

```bash
# The -S is for source
iex -S mix
```

### Mix project organisation

It is adviced to follow the Mix structure in order to organise your files, ie:

  - The package script should be in `lib`
  - The test files of the scripts in `test`
  - Configuration settings in `config`

For the other folder, usually they are populated dynamically:

  - `deps` is for installed dependencies
  - `_build` is the compiled sources of your project
  - `doc` is for documentation that can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)

```bash
mix docs
```

### Mix project integration

The package can be installed
by adding the package name to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:demo, "~> 0.1.0"}
  ]
end
```

Package can be either download from repository or directly fron [Hex](hex.pm)

### Publishing a Mix project

Mix projects are hosted on [Hex](https://hex.pm/docs/publish). To get started, you will need to install `hex` using:

```bash
mix local.hex
```

Then you will need an account:

```bash
mix hex.user register
```

Then follow the procedure to add the correct metadata to your `mix.exs` so that you can finally publish it:

```bash
mix hex.publish
```

## Tips

There are no multiple comments line. A comments starts like in python with `#`

```elixir
# Will print Hello world
IO.puts "Hello world"
```

What is the difference between `.ex` and `.exs`:

  - The `ex` is compiled to the erlang `.beam` code
  - The `.exs` is more of a script that is compiled just-in-time.

## Sources

- [Introduction to Elixir](https://elixir-lang.org/getting-started/introduction.html)
- [Elixir libraries](https://github.com/h4cc/awesome-elixir)
- [Phoenix - Elixir Rest framework](http://phoenixframework.org/)
- [Hex tasks](https://hex.pm/docs/tasks)
- [Elixir command line app](http://asquera.de/blog/2015-04-10/writing-a-commandline-app-in-elixir/)
- [Generate documentation with Ex_doc](https://brainlid.org/elixir/2016/09/01/phoenix-project-documentation.html)

repository: sylhare/Elixir

repo_name: sylhare/Elixir


text:
---
layout: post
title:  "Arcane Convolution"
date:   2017-01-01
source: From the Arcane Archive
tags: [bard, cleric, shugenja, sorcerer, warlock, witch, wizard, level4, abjuration, hb, fan]
---

**4th-level abjuration**

**Casting Time**: 1 action

**Range**: Self (120-foot radius)

**Components**: V, S, M (a pinch of powdered glass)

**Duration**: 1 minute

This spell distorts the rules of the universe in a short range around you, wreaking arcane havoc. For the duration, some damage types are exchanged with others, as shown on the table below.
Additionally, no creature within range can regain hit points due to magic. Instead, when a creature would regain hit points, it must make a Constitution saving throw or takes necrotic damage equal to the amount it would have regained.

|Old Type|New Type|
|:-:|:-|
|Acid|Poison|
|Cold|Fire|
|Fire|Radiant|
|Force|Necrotic|
|Lightning|Psychic|
|Necrotic|Thunder|
|Poison|Force|
|Psychic|Lightning|
|Radiant|Acid|
|Thunder|Cold|

repository: Teamdael/spellbook

extension: markdown

repo_name: Teamdael/spellbook


text:
# CSR 1010 Eddystone-URL Beacon

## Installing the Windows CSR Development Environment
* Install the CSR Development Environment - to obtain the SDK you will need to register for an account
at [CSR](https://www.csrsupport.com/register.php) and buy the Bluetooth LE dev kit (see below)
* The project in this directory was built using the CSR uEnergy SDK <IP_ADDRESS> (xIDE)
* By default the SDK install directory will be c:/CSR-uEnergy_SDK-<IP_ADDRESS>/
* The  CS1010 beacon code in this directory can be copied into c:/CSR-uEnergy_SDK-<IP_ADDRESS>/apps
* The target hardware is the CSR uEnergy Development Kit DB-CSR1010-10137-1A which uses CSR's
Bluetooth Low Energy Single Mode Silicon
* A CSR USB-SPI adapter module and cables are also needed for development
* The dev kit, adapter module, and cables can be purchased from [digikey](http://www.digikey.com)

repository: peterkinalex/eddystone

branch_name: refs/heads/txeddystone

gha_language: C

repo_name: peterkinalex/eddystone


text:
# sha256sum

> Calculate SHA256 cryptographic checksums.

- Calculate the SHA256 checksum for file(s) or files in a directory, one checksum per file:

`sha256sum {{filename1}}`
`sha256sum {{filename1}} {{filename2}}`
`sha256sum {{directory/\*}}`

- Read a file of SHA256 sums and verify all files have matching checksums:

`sha256sum -c {{filename.sha256}}`

repository: andreiRS/tldr

repo_name: andreiRS/tldr


text:
# Implementing XMPP Extensions

This document is about implementing extensions.
If you are looking for a list of XEPs implemented by this library, see
[https://mellium.im/docs/xeps/](https://mellium.im/docs/xeps/).

The [`mellium.im/xmpp`] module contains a number of packages that implement
[XMPP Extension Protocols][XEP] (XEPs).
When contributing new packages, or publishing your own proprietary extensions
separately, it's important to make sure that your package is consistent with
existing code.
The rules in this post were designed to facilitate consistent extension packages
and should always be followed when contributing new packages upstream.

## Group XEPs into packages by functionality

Normally this means that each XEP is given its own package.
However, for smaller or tightly coupled XEPs this may mean sharing a package.
For instance, [XEP-0082: XMPP Date and Time Profiles][XEP-0082] and [XEP-0202:
Entity Time][XEP-0202] are both related to the concept of transmitting time over
an XMPP connection, and XEP-0082 is effectively just a list of constants.
Because of this, they both share a single package,
[`mellium.im/xmpp/xtime`][`mellium.im/xmpp/xtime`] (note that `xtime` would not
normally be considered a good package name, `time` would be better but this
conflicts with a package in the standard library).
Similarly, the various XEPs that make up the Jingle signaling protocol would
likely be grouped together.
Meanwhile [XEP-0234: Jingle File Transfer][XEP-0234] and [XEP-0047: In-Band
Bytestreams][XEP-0047] are both about file transfer, but they likely would *not*
share a single package as they wouldn't share much code whereas XEP-0234 likely
*would* share code with other Jingle related XEPs.

When in doubt, [ask][support].
There are no hard and fast rules to grouping XEPs into packages.

## Namespaces and Constants

Most packages will implement at least one XEP, and most XEPs will define an XML
namespace.
XML namespaces used by the package should be included as exported string
constants.
If a single namespace will be defined, it should be called `NS` by convention.
For example, the `mam` package might define the namespace as `mam.NS`:

    // The XML namespace used by this package, provided as a convenience.
    const NS = `urn:xmpp:mam:2`

If multiple namespaces are defined in a single package (because it implements
more than one XEP or because the XEP it implements defines more than one
namespace) they should be prefixed with `NS` and followed by a word describing
the specific namespace.
For example, the `disco` package defines `disco.NSInfo` and `disco.NSItems`:

    // Namespaces used by this package
    const (
    	NSInfo  = `http://jabber.org/protocol/disco#info`
    	NSItems = `http://jabber.org/protocol/disco#items`
    )

Other constants and "magic" values such as [standardized data form
types][XEP-0068] should be exported in a similar manner for the users
convenience.

[XEP-0068]: https://xmpp.org/extensions/xep-0068.html

## Implement data transmissions with simple functions

Users of your package shouldn't have to think about XML, stanzas, or XMPP.
Instead, we should provide our users with simple functions that can be used to
perform basic operations over the network, and which result in common types
where possible.
For example, the [`xtime.Get`] function sends an IQ requesting the time to the
given address over the given session and returns an ordinary [`time.Time`]:

    func Get(ctx context.Context, s *xmpp.Session, to jid.JID) (time.Time, error)
        Get sends a request to the provided JID asking for its time.

Under the hood this might be sending an IQ and blocking while it waits for a
response, or returning a payload that had been previously decoded by a message
handler.
The user doesn't need to know the details, all that they care about is asking
for a time and getting one in the format they're already used to dealing with.

## Use the `mux` package to handle incoming data

The [`mellium.im/xmpp/mux`] package provides an [`xmpp.Handler`] that can
multiplex various top level elements to custom handlers based on their name or
stanza type and the name of a payload.
While other multiplexers may exist in the future, they should all use the
standard handler types:

- [`xmpp.Handler`] for non-stanza top level elements or custom muxers
- [`mux.IQHandler`]
- [`mux.MessageHandler`]
- [`mux.PresenceHandler`]

Because of this, if your package handles one or more types of payload it should
contain a type, generally called `Handler` (eg. [`xtime.Handler`] or
[`ping.Handler`]) that implements one or more of the above handler interfaces
and can be registered with a [`mux.ServeMux`] to respond to incoming payloads.

Similarly, your package should contain a [`mux.Option`] that registers the
handler.
Generally this option will be called `Handle`, but if multiple handlers exist
that need to be registered separately more descriptive names may be necessary
such as `example.HandleData` and `example.HandleOpen`.
This can either create a new handler if the handler does not require any
configuration as the [`ping.Handle`] option does, or take a specific handler to
register if further configuration may be required as the [`xtime.Handle`] option
does.
Options configure the `mux.ServeMux` using fields that are not exported, so they
must be constructed in terms of other, existing, options.
For example, the handler form `xtime` only handles a specific type of IQ and is
defined as:

    // Handle returns an option that registers a Handler for entity time requests.
    func Handle(h Handler) mux.Option {
    	return mux.IQ(stanza.GetIQ, xml.Name{Local: "time", Space: NS}, h)
    }

A handler that needs to handle multiple types can use a raw `mux.Option` func to
group multiple options into one:

    // Handle is an option that registers an example handler that implements
    // both IQHandler and MessageHandler.
    func Handle(h Handler) mux.Option {
    	return func(m *ServeMux) {
    		mux.IQ(stanza.GetIQ, xml.Name{Local: "example", Space: NS}, h)(m)
    		mux.Message(stanza.NormalMessage, xml.Name{Local: "example", Space: NS}, h)(m)
    	}
    }

## Export structs for marshaling and unmarshaling

Normally the user will want to use the functions and handlers defined in your
package to transmit and receive data, but sometimes they may need to reimplement
your extension to add their own proprietary extensions, or to instrument the
code for a required logging or metrics library.
So that users can reimplement as little as possible, and for the sake of
consistency between implementations, we export structs that can be used to
marshal or unmarshal stanzas and payloads.

Many XEPs will likely have a single payload that needs to be exported.
In this case, if the payload does not need any custom logic to marshal or
unmarshal, a struct representing the full IQ (or other stanza type) should be
exported.
For example, the [`mellium.im/xmpp/ping`] package contains the definition for a
ping IQ:

    // IQ is encoded as a ping request.
    type IQ struct {
    	stanza.IQ

    	Ping struct{} `xml:"urn:xmpp:ping ping"`
    }

Exported stanza types should be named after the type of stanza they implement.
The name of the previous examples type when fully qualified is therefore
[`ping.IQ`].
If multiple stanza types need to be exported from the same package, give them
all descriptive names, for example: `example.RequestMessage` and
`example.ResponseMessage`.

If one or more payloads exist that need custom logic to marshal or unmarshal,
export the individual payload type with implementations of [`xml.Marshaler`]
and [`xml.Unmarshaler`] containing the custom logic.

In either case, the exported stanza or payload types should implement the
following interfaces:

- [`xmlstream.Marshaler`]
- [`xmlstream.WriterTo`], implemented in terms of `xmlstream.Marshaler`
- [`xml.Marshaler`], implemented in terms of `xmlstream.WriterTo` if custom
  marshaling logic is required
- [`xml.Unmarshaler`] if custom unmarshaling logic is required

For an example, see the source for [`xtime.Time`].

## Lazily decode large, repeating payloads

When unmarshaling a payload of unknown length that contains many similar
children, an iterator should be written instead of unmarshaling them all into a
slice.
This gives the user the option of keeping memory usage low by reusing values,
reducing copying when the length is unknown and a slice would have to be
extended, and keeping CPU usage low by only partially decoding the child
elements if we can short circuit after finding a particular child.

The iterator type should be called `Iter` and can be used to lazily decode
children into a type the user can deal with.
The `Iter` type should have an API similar to the following example, taken from
the [`roster`] package:

```
// Iter is an iterator over roster items.
type Iter struct{}

// Item returns the last roster item parsed by the iterator.
(i *Iter) Item() Item

// Next reports whether there are more items to decode.
(i *Iter) Next() bool

// Err returns the last error encountered by the iterator (if any).
(i *Iter) Err() error

// Close indicates that we are finished with the given iterator and processing
// the stream may continue.
// Calling it multiple times has no effect.
(i *Iter) Close() error
```

The `Item` method and its return type are named after the thing being
decoded, in this case a roster item, and may be different for every `Iter`.
From the developers perspective, the `Iter` type can now decode elements from
the stream with a simple for loop:

```
iter := roster.Fetch(context.TODO(), session)
defer iter.Close()

for iter.Next() {
	item := iter.Item()
	// Do something with the roster item
}
if iter.Err() != nil {
	// Handle errors
}
```

Because iterators are common and all largely share the same logic to decode
child elements and return them, much of the logic has been extracted into the
[`xmlstream.Iter`] type.
Instead of operating directly on decoded child elements, the `xmlstream.Iter`
type operates on the token stream and returns access to each top-level start
token it finds, letting your custom `Iter` type do the final decoding into a
concrete type of your choosing.
In the case of the `roster` package, this type is a `roster.Item`.

Most iterators will need to maintain some internal state.
This normally comprises any errors that were generated, a value representing the
last child element that was decoded, and an underlying `xmlstream.Iter`.

On your `Iter` type, most methods need to simply call the similarly named method
on the underlying `xmlstream.Iter`.
The exceptions are the `Err` and `Next` methods.
The `Err` method should return any errors generated by your decoding first and
if no such errors exist return `iter.Err()`.
The `Next` method is a bit more complicated.
It should first check that no previous decoding errors exist and that
`iter.Next()` is true.
If this is the case it should decode the tokens provided by `iter.Current()` and
save the result or any errors generated.

For example, the `roster` package defines `Next` like so:

```
// Next returns true if there are more items to decode.
func (i *Iter) Next() bool {
	if i.err != nil || !i.iter.Next() {
		return false
	}
	start, r := i.iter.Current()
	d := xml.NewTokenDecoder(r)
	item := Item{}
	i.err = d.DecodeElement(&item, start)
	if i.err != nil {
		return false
	}
	i.current = item
	return true
}
```

Functions that returns iterators are called `Fetch` by convention (eg.
`roster.Fetch`), or start with `Fetch` if the type of the item is not obvious
(eg. `disco.FetchItems`).

[`xmlstream.Iter`]: https://pkg.go.dev/mellium.im/xmlstream#Iter
[`mellium.im/xmpp`]: https://pkg.go.dev/mellium.im/xmpp/mux
[`mellium.im/xmpp/mux`]: https://pkg.go.dev/mellium.im/xmpp/mux
[`mellium.im/xmpp/ping`]: https://pkg.go.dev/mellium.im/xmpp/ping
[`mellium.im/xmpp/xtime`]: https://pkg.go.dev/mellium.im/xmpp/xtime
[`mux.IQHandler`]: https://pkg.go.dev/mellium.im/xmpp/mux#IQHandler
[`mux.MessageHandler`]: https://pkg.go.dev/mellium.im/xmpp/mux#MessageHandler
[`mux.Option`]: https://pkg.go.dev/mellium.im/xmpp/mux#Option
[`mux.PresenceHandler`]: https://pkg.go.dev/mellium.im/xmpp/mux#PresenceHandler
[`mux.ServeMux`]: https://pkg.go.dev/mellium.im/xmpp/mux#ServeMux
[`ping.Handle`]: https://pkg.go.dev/mellium.im/xmpp/ping#Handle
[`ping.Handler`]: https://pkg.go.dev/mellium.im/xmpp/ping#Handler
[`ping.IQ`]: https://pkg.go.dev/mellium.im/xmpp/ping#IQ
[`roster`]: https://pkg.go.dev/mellium.im/xmpp/roster
[`roster.Item`]: https://pkg.go.dev/mellium.im/xmpp/roster#Item
[support]: https://mellium.im/docs/SUPPORT
[`time.Time`]: https://golang.org/pkg/time/#Time
[XEP-0047]: https://xmpp.org/extensions/xep-0047.html
[XEP-0082]: https://xmpp.org/extensions/xep-0082.html
[XEP-0202]: https://xmpp.org/extensions/xep-0202.html
[XEP-0234]: https://xmpp.org/extensions/xep-0234.html
[XEP]: https://xmpp.org/extensions/
[`xml.Marshaler`]: https://golang.org/pkg/encoding/xml/#Marshaler
[`xmlstream.Marshaler`]: https://pkg.go.dev/mellium.im/xmlstream#Marshaler
[`xmlstream.WriterTo`]: https://pkg.go.dev/mellium.im/xmlstream#WriterTo
[`xml.Unmarshaler`]: https://golang.org/pkg/encoding/xml/#Unmarshaler
[`xmpp.Handler`]: https://pkg.go.dev/mellium.im/xmpp#Handler
[`xtime.Get`]: https://pkg.go.dev/mellium.im/xmpp/xtime#Get
[`xtime.Handle`]: https://pkg.go.dev/mellium.im/xmpp/xtime#Handle
[`xtime.Handler`]: https://pkg.go.dev/mellium.im/xmpp/xtime#Handler
[`xtime.Time`]: https://pkg.go.dev/mellium.im/xmpp/xtime#Time

repository: mellium/xmpp

gha_language: Go

repo_name: mellium/xmpp


text:
+++
date = 2023-03-17T12:46:52+05:30
title = "Write and publish a Kubernetes Operator - Part 1"
description = ""
tags = ["kubernetes", "operators", "go", "openshift", "olm", "operator-sdk"]
series = ["kubernetes operators"]
+++

This is the first post in the series of posts about writing and publishing a Kubernetes Operator. This series will
discuss the following topics:
* how to write an Operator,
* run it on a Kubernetes cluster,
* create a bundle and package it into an index image,
* create a `CatalogSource` resource using this index image,
* and finally create an Operand out of the Operator installed through the `CatalogSource`.

This particular post covers first two, while the next post wil discuss remaining topcis.

Tooling used by me for this blog series:

* OS: Fedora 37
* Kubernetes: minikube v1.29.0 with Docker provider
* OLM specific tooling:
  * `operator-sdk` version 1.27.0
  * `opm` version 1.26.4

The Operator we are going to create here isn't a unique idea of mine. It's based on
[this post by Ishan Khare](https://ishankhare.dev/posts/6/), but is created using `operator-sdk` instead of
`kubebuilder`. Let's get started.

{{< notice note >}}
I'm writing this blog series as a part of learning Kubernetes Operators and Operator Framework myself. There might
be mistakes in the post. Please share any feedback/suggestions via [Twitter](https://twitter.com/dharm1t).
{{< /notice >}}

### Initialize the project

Create a directory and initialize the project in it:
```shell
$ mkdir at-operator
$ cd at-operator
$ operator-sdk init --domain example.com --repo github.com/dharmit/at-operator
$ operator-sdk create api --group at --version v1alpha1 --kind At --resource --controller

$ ls
api  bin  config  controllers  hack  Dockerfile  go.mod  go.sum  main.go  Makefile  PROJECT  README.md
```

### What does the "At Operator" do?

Similar to the original implementation, the At Operator here runs a specific command at the given time. To do this,
it creates a Kubernetes Pod in which it runs the command. Nothing fancy here. :)

### Code for the Operator

Code is divided into two main parts:
1. API - `api` directory. This contains the Go structs that define an At resource.
2. Controllers - `controllers` directory. This contains the reconciliation logic.

#### API

It mainly defines the `At` struct and the structs for its fields defining the spec and status. Of main interest here
is the `AtSpec` struct which contains the `Schedule`, which is UTC time, and `Command` to be executed at the
specified schedule. Below is the code for the file `api/v1alpha1/at_types.go`:

{{< gist dharmit 86002f8820efdeb770f25ab77595bb72 at_types.go >}}

As mentioned in the
[`operator-sdk` documentation](https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/#define-the-api),
run `make generate` after modifying the `*_types.go` file. This will update the `api/v1alpha1/zz_generate_deepcopy.go`
file to ensure our API’s Go type definitions implement the
[`runtime.Object` interface](https://github.com/kubernetes/apimachinery/blob/8d1258da8f386b809d312cdda316366d5612f54e/pkg/runtime/interfaces.go#L319-L326)
that all Kind types must implement.

```shell
$ make generate
```

#### Controller

The controller contains the reconciliation logic. It is the heart of an Operator as it is the business logic of the
system which logic goes into the `Reconcile` function.

The `Reconcile` function for our Operator updates the Phase of a newly created Operand to `PENDING`. Next it
evaluates the difference between the current time and the time mentioned  in the `.spec.schedule` of the Operand. If
this difference in time is greater than 0, it requeues the Operand to run  it after the `diff` amount of time. On
the other hand, if the difference is less than 0, it runs the command  mentioned in `.spec.command` of our Operand
by creating a Pod using the `busybox` image.

Below is the code for `controllers/at_controller.go`:

{{< gist dharmit 86002f8820efdeb770f25ab77595bb72 at_controller.go >}}

Notice that we have added `Owns(&corev1.Pod{})` in the `SetupWithManager` function. This ensures that the Pod
created by our Operator is owned by the `At` instance that created it. As a result, when we do `kubectl delete at
sample-at`, Kubernetes garbage collector deletes the Pod as well.

Next run the command `make manifests` which generates the CRD manifests under `config/crd/bases` directory.

```shell
$ make manifests
```

### Build the container images

In the `Makefile`, set the desired value for `IMAGE_TAG_BASE` and use it to set the value of `IMG`:

```makefile
# use the container registry and namespace you have access to
IMAGE_TAG_BASE ?= quay.io/dharmit/at-operator
IMG ?= ${IMAGE_TAG_BASE}:${VERSION}
```

Now build the container image and push it. Make sure to login to the container registry first:

```shell
$ docker login -u $QUAY_USERNAME -p $QUAY_PASSWORD quay.io
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/dshah/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

$ make docker-build docker-push
```

That builds and pushes the container image for `at-operator`. With the configurations shown here, it builds and
pushes `quay.io/dharmit/at-operator:v0.0.1` to the Red Hat Quay registry.

### Run the Operator as Deployment on a cluster

Using `make deploy` will create a new namespace on the cluster and start a Deployment for our Operator there.

```shell
$ make deploy
$ kubectl get ns
NAME                 STATUS   AGE
at-operator-system   Active   4s    <------ newly created by "make deploy"
default              Active   139m
kube-node-lease      Active   139m
kube-public          Active   139m
kube-system          Active   139m

$ kubectl get deploy -n at-operator-system
NAME                             READY   UP-TO-DATE   AVAILABLE   AGE
at-operator-controller-manager   1/1     1            1           2m21s
```

It also creates our CRD on the cluster:
```shell
$ kubectl get crds
NAME                 CREATED AT
ats.at.example.com   2023-03-17T10:27:43Z
```

Create an `At` with below spec. Modify the schedule to the date and time when you are trying this out, and note that
time should be in UTC (run `date -u` on the CLI) because that's the default timezone used by a Kubernetes cluster:
```shell
$ cat <<EOF | kubectl create -f -
apiVersion: at.example.com/v1alpha1
kind: At
metadata:
  name: sample-at
spec:
  schedule: "2023-03-19T08:00:00Z"
  command: "echo hello world"
EOF
```

The logs of the Pod created for our Operator's Deployment look something like below:
```shell
$ kubectl logs at-operator-controller-manager-5b4549c455-82n4r -f
1.6792134703300617e+09	INFO	controller-runtime.metrics	Metrics server is starting to listen	{"addr": "<IP_ADDRESS>:8080"}
1.6792134703302734e+09	INFO	setup	starting manager
1.6792134703304198e+09	INFO	Starting server	{"kind": "health probe", "addr": "[::]:8081"}
1.6792134703304203e+09	INFO	Starting server	{"path": "/metrics", "kind": "metrics", "addr": "<IP_ADDRESS>:8080"}
I0319 08:11:10.330433       1 leaderelection.go:248] attempting to acquire leader lease at-operator-system/6cceeaca.example.com...
I0319 08:11:10.337896       1 leaderelection.go:258] successfully acquired lease at-operator-system/6cceeaca.example.com
1.679213470337917e+09	DEBUG	events	at-operator-controller-manager-5b4549c455-82n4r_4d3b6c39-b01d-45e5-9cf0-3bae78c29a76 became leader	{"type": "Normal", "object": {"kind":"Lease","namespace":"at-operator-system","name":"6cceeaca.example.com","uid":"b0042073-01e8-44fc-89b8-c22a728375ac","apiVersion":"coordination.k8s.io/v1","resourceVersion":"28109"}, "reason": "LeaderElection"}
1.6792134703379743e+09	INFO	Starting EventSource	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "source": "kind source: *v1alpha1.At"}
1.6792134703380027e+09	INFO	Starting EventSource	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "source": "kind source: *v1.Pod"}
1.679213470338007e+09	INFO	Starting Controller	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At"}
1.6792134704389532e+09	INFO	Starting workers	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "worker count": 1}
1.6792134704390779e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "08c339f8-4149-425c-b153-c87087c65c31"}
1.6792134704391074e+09	INFO	Phase: PENDING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "08c339f8-4149-425c-b153-c87087c65c31"}
1.679213470439118e+09	INFO	Schedule parsing done	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "08c339f8-4149-425c-b153-c87087c65c31", "Result": "19.560889822s"}
1.679213490000635e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "f9879ed4-4210-4bd2-9619-caa15028daec"}
1.6792134900006685e+09	INFO	Phase: PENDING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "f9879ed4-4210-4bd2-9619-caa15028daec"}
1.6792134900006785e+09	INFO	Schedule parsing done	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "f9879ed4-4210-4bd2-9619-caa15028daec", "Result": "-670.194µs"}
1.6792134900006816e+09	INFO	Time to execute	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "f9879ed4-4210-4bd2-9619-caa15028daec", "Ready to execute": "echo hello world"}
1.6792134900130224e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "9cfd8930-d726-404e-baec-c2f879e423eb"}
1.6792134900130394e+09	INFO	Phase: RUNNING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "9cfd8930-d726-404e-baec-c2f879e423eb"}
1.6792134900174663e+09	INFO	Pod created successfully	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "9cfd8930-d726-404e-baec-c2f879e423eb", "name": "sample-at"}
1.6792134900175796e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "8bd0631a-fb83-4a74-939d-c4c1c6d44a5c"}
1.6792134900176141e+09	INFO	Phase: RUNNING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "8bd0631a-fb83-4a74-939d-c4c1c6d44a5c"}
1.679213490024618e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "b4a787db-c39d-4921-93b1-781db45f24b6"}
1.6792134900246475e+09	INFO	Phase: RUNNING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "b4a787db-c39d-4921-93b1-781db45f24b6"}
1.679213490029606e+09	INFO	==== Reconciling at ====	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "72b1330f-c22c-4e10-986f-4781add65817"}
1.6792134900296335e+09	INFO	Phase: RUNNING	{"controller": "at", "controllerGroup": "at.example.com", "controllerKind": "At", "At": {"name":"sample-at","namespace":"at-operator-system"}, "namespace": "at-operator-system", "name": "sample-at", "reconcileID": "72b1330f-c22c-4e10-986f-4781add65817"}
```

First instance of reconciliation evaluates the time and finds that the At should be run about 20 seconds later and
requeues it to run at that time. When it's time, it runs the command mentioned in our manifest (`echo hello world`
in this case). You should see a Pod with `Completed` status like below:
```shell
$ kubectl get pods sample-at
NAME                                              READY   STATUS      RESTARTS   AGE
sample-at                                         0/1     Completed   0          18s

$ kubectl logs sample-at
hello world
```

### That's it!

That's it in this part. In the next part of the series, we will see how to pack our At Operator into a bundle image,
pack the bundle into an index image, and finally run things through Operator Lifecycle Manager like you do for the real
Operators available via [OperatorHub](https://operatorhub.io).

repository: dharmit/dharmitshah

gha_language: HTML

repo_name: dharmit/dharmitshah


text:
---
title: "Building a traffic fine scraper with Python"
layout: post
date: 2019-01-07 03:20
published: true
image: ../assets/posts/joystick_diagram.png
headerImage: false
tag:
- Python
- Web Scraping
- Automation
- Bots
- Selenium
category: blog
author: rodferro
description: Building a traffic fine scraper with Python and Selenium
---

> This post has been featured in [dev.to](https://dev.to/rodolfoferro/building-a-traffic-fine-scraper-with-python-2j76) and [codementor](https://www.codementor.io/ferrorodolfo/building-a-traffic-fine-scraper-with-python-qz5tm7q93).

Motivation

The other day I was remembering that during my visit to Mexico City back in June '17 (for my participation on the first edition of the [PythonDay México](https://rodolfoferro.xyz/pythondaymx/)), a [friend of mine](https://twitter.com/JMireles_) hosted me at his house during my time there. The thing is that during my stay we were talking about building something that could be useful, so we decided to scrape a website in which car owners from Mexico City would be able to verify their traffic fines.

The website is the following: [http://www.multasdetransito.com.mx/infracciones/df-distrito-federal](http://www.multasdetransito.com.mx/infracciones/df-distrito-federal)

As you may have noticed if you opened the site, it contains an input to write down the car plate from which you can search the traffic attached to that plate (if it has any).

My friend told me that only a small group of Mexico City residents knew about that site, so it might be useful to create something in which they can consult this info in an easier way.

After this, I was like: *"Dude, today I held a workshop on how to build a TwitterBot in 30 minutes for the PythonDay, what if we build a TwitterBot that inputs the plate in the site and then scrapes the info from it automatically?"*. He said yes. With this, we built [MultaBot](https://twitter.com/MultaBot/with_replies) a TwitterBot that used to read a car plate and scrape for its traffic fines.

We started with this project as a private project, but the other day I was invited by the *[Division of Law, Politics and Government](http://www.ddpg.ugto.mx/)* of my university to give a tech talk about how automation can be useful for future jobs not for only people in tech industry, but also for politicians and lawyers. When I remembered about this, I thought that it would be a nice example, so I wanted to improve on its base and ended with this example script that now I want to share with you.

Experimentation

I'll explain the whole code, so you'll understand what's happening every tep of the way. To begin, I'll import [Selenium](https://selenium-python.readthedocs.io/) and the Python [data pretty printer](https://docs.python.org/3/library/pprint.html):

Selenium will allow us to automate the control of a web browser, so the idea will be to use it to automatically open the website, input the car plate and after the traffic fines are loaded, extract and parse them for the `pprint` output.

After this, I created a function to launch the browser and scrape the info off of the car plate. If `verbose` is set to `True`, the function will print the details of each traffic fine:

Inside the function I set the url to be scraped, then I called function named `busca_placa_df` (which means *search_plate_df*, *df* stands for Federal District in Spanish) and then I closed and quit the opened browser for this search.

Then, I built the main function that inputs data and then scrapes the traffic fines:

As you see, in lines `24-26` I clear the data in the input field with `id=plate` from the HTML source, then input the car plate that I want to look for, and after this I look for the button by its XPath and click it (lines `28-29`).

I now want to know the results for the search, for this I look for the element with `id=secciones` in the HTML of the response (lines `31-32`) and first verify if it has any debts by looking if the resulting text is only `"INFRACCIONES"`, if so I returned a message saying t has no debts (lines `33-34`). In the other case, in lines `35-36` I save the result with the text it contains (which specifies the number of traffic fines for the plate).

If the `verbose` flag is turned on, then the scraper will get all the info of each traffic fine (lines `38-40`). For this, it will look for the element with `id=tablaDatos` in the HTML, which contains all the info of each traffic fine and if it is not empty (line `41`) it will iterate for each traffic fine and then extract all the info them (lines `42-50`). I now build a dict with the response to serve it in a nice way using `pprint` (lines `52-67`) and return the result (line `69`).

To test the script I just called the function `launch_browser` with a demo car plate (that coincidently has 2 traffic fines) and print out the results (lines `72-74`):

If you run this in a script, you'd get an output like this one (note that it prints the 2 traffic fines I mentioned 😝):

Conclusion

At the beginning, what we thought would be a project just for fun to work together that night *–like a mini hackathon–* ended up being a useful project that could be helpful for citizens in Mexico City.

As you have seen, Python has tools that help to automate some things in very cool ways. I mean, if you run the script as it is provided, you should see a browser window to open automatically, then the text gets written alone in the input field and the results are shown by their own. **Isn't this really awesome?**

Please let me know what you build with Selenium and Python in the comments! 💻🐍🤙🏼


text:
# reflux-rehydrate

Wrapper to rehydrate RefluxJS stores

Rehydrate RefluxJS store wrapper classes, to support isomorphic rendering, or loading from local storage (running offline or recovering unsaved data)

At this stage, this library is not needed. You can rehydrate your stores simply by calling `Reflux.init()` then calling `setState()` just like you would inside the store.

```
 constructor(props: Object) {
    super(props);
    Reflux.init(MyStore).setState({myData: this.props.myData});
  }
```

However this library also adds a quick wrapper so we can just do one call `Reflux.rehydrate()`. We also hope to expand on this functionality in the future to assist with persistance to local storage etc.

## Installation

`npm install reflux-rehydrate` or `yarn add reflux-rehydrate`

Requires RefluxJS using the latest ES6 configuration

To do something similar with older ES5 mixins, see my fork of the [Super-Simple-Flux](https://github.com/openmaphub/Super-Simple-Flux) where I've added an initWithProps tie-in on the mixin.

## Usage

### Components

In componentWillMount, initialize the store singleton using `Rehydrate.initStore(MyStore)`, then call the rehydrate action with a state object containing the data to be rehydrated, for example `Actions.rehydrate(this.props)`

Example Code:
```
import Reflux from 'reflux-rehydrate';
import MyStore from '../stores/MyStore';

export default class MyComponent extends Reflux.Component {

   constructor(props: Object) {
    super(props);
    Reflux.rehydrate(MyStore, {myData: this.props.myData});
  }

  //...
}
```

Be sure that the names you use in `rehydrate()` actually match what is expected in the store just like any other call to `setState()`

### Actions

Not currently needed, but optional for future compatibility so we can automatically setup actions in your stores.

```
import {createActions} from 'reflux-rehydrate';
export default createActions([
  'myAction1', 'myAction2'
]);
```

### Store

Create your Store as you normally would.

## Development

This project is using Rackt to simplify building React components https://github.com/mzabriskie/rackt-cli

repository: maphubs/reflux-rehydrate

repo_name: maphubs/reflux-rehydrate


text:
Position Manager
======================================

## Position Manager Payload
Stored in org.theenergymashuplab.cts.controller.payloads package, in this class all the rest call to access position manager is stored.

Following describes all its api.
1. createPosition : Will add position into the table.
2. getPositionHistoryToId : Fetch position from table with respect to the sellerId.
3. getPositionHistoryFromId : Fetch position from table with respect to the buyerId.
4. getPositionHistory : Fetch position from table with respect to the count.
5. getStatus : Fetch status from table given the id of respective position id.

## Position Manager Model
Stored in org.theenergymashuplab.cts.model package, it represents the database table.

## Position Repository
Stored in org.theenergymashuplab.cts.repository package, in this class all the native queries are stored.

repository: EnergyMashupLab/NIST-CTS-Agents

gha_language: Java

repo_name: EnergyMashupLab/NIST-CTS-Agents


text:
# scoop-netlifyctl

[Scoop](http://scoop.sh/) is a command line installer for Windows.

This is a Scoop bucket for [Netlifyctl](https://github.com/netlify/netlifyctl).

## Installation

1. Install Scoop: https://github.com/lukesampson/scoop/wiki/Quick-Start
2. Add tihs bucket to Scoop: `scoop bucket add netlifyctl https://github.com/netlify/scoop-netlifyctl`
3. Install Netlifyctl: `scoop install netlifyctl`


text:
# OVH-CLI

## Configuration

You can store configuration into `.ovh-cli.toml` in paths:
* `/etc/ovh-cli/`
* `/usr/local/etc/ovh-cli/`
* `~/` (user home)
* `./`

Configuration sample:

```toml
# File ~/.ovh-me-cli.toml

log-level = "info"
# profile = account2

[default]
endpoint = "ovh-eu"
application-key = "XXXXXXXXXxx"
application-secret = "XXXXXXXXXXXXXXXXXXXXXXXX"
consumer-key = "XXXXXXXXXXXXXXXXXXXXXXXX"

[account2]
endpoint = "ovh-eu"
application-key = "XXXXXXXXXxx"
application-secret = "XXXXXXXXXXXXXXXXXXXXXXXX"
consumer-key = "XXXXXXXXXXXXXXXXXXXXXXXX"

...
```

Following fields MUST be in each sections:
* `endpoint`
* `application-key`
* `application-secret`
* `consumer-key`

It is possible to save which account to select in configuration file with `profile`.

repository: AdFabConnect/ovh-cli

repo_name: AdFabConnect/ovh-cli


text:
---
layout: project
title: "Wearable Robotic Third Arm"
image: /assets/images/projects/thirdarm-project.jpg
category: projects
published: true
tags: [design]
---
{% include JB/setup %}

The Wearable Robotic Third Arm project seeks to build a lightweight supernumerary robotic arm for assisting a user in collaborative activities.

**Collaborators: [Vighnesh Vatsal](http://hrc2.io/people/vighnesh-vatsal), Tatsuhiro Koshi, Mei Zhang**

Human-robot augmentation is the idea of using robotics to share the physical and cognitive task loads of a human user, typically realized with wearable robots. Until recently, such devices have taken the form of prostheses or exoskeletons, which replace or enhance already existing human functions. We present a supernumerary robotic device that provides a user with capabilities not found in nature.

Our device is an elbow mounted additional forearm, aimed at human-robot collaboration in close-range activities. The primary research goal is to study the interaction schemes and generate autonomous robot behaviors that will assist a user in a collaborative manipulation or assembly task.


text:
Lots of Qt freshers asked me how to become a Qt master, since Qt is becoming more and more powerful in both UI creation and logic implementation.

Below I made a Qt learning roadmap for you to help you learn Qt systematically and become a master of the latest Qt technology.

![](../../public/blog/posts/Qt-Master-Roadmap/QtMasterRoadmap.png)

You might need to omit some of the steps such as building Linux image with Yocto if you don't plan to work with embedded Linux.

Anyway, just follow the learning road map from the top to the bottom with your best effort, you surely will become a Qt expert.
However, if you would like to save your time and effort, or if you would like to build a Qt experts team in a short time, don't hesitant to contact me, because I can provide you and your team with the best trainings and practices according to your own demands.

repository: victorsummer/vitoblog

filename: Qt Master Roadmap.md

repo_name: victorsummer/vitoblog


text:
# Discord spam bots with multiple account support and more. *Made strictly for testing anti-spam for server owners*

## PLEASE READ EVERYTHING BEFORE WRITING AN ISSUE!!\
DM Spammers are broken as of right now.

### GUI -> [<img src="https://s.put.re/pgh732Cd.png" width="65" />](https://github.com/Merubokkusu/Fuyuumi/releases/latest)

[![Gitter](https://badges.gitter.im/discord-spam-bots/community.svg)](https://gitter.im/discord-spam-bots/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Twitter](https://img.shields.io/twitter/follow/merubokkusu?style=social)](https://twitter.com/intent/follow?screen_name=merubokkusu)

[![Paypal](https://img.shields.io/badge/paypal-donate-brightgreen)](https://www.paypal.me/Merubokkusu?)

[![Steam](https://img.shields.io/badge/donate-steam-green?logo=Steam&style=flat-square)](https://steamcommunity.com/tradeoffer/new/?partner=94720138&token=GY23F7tU)

# Features
- Account Creator
- Mulitple accounts
- Image spammer
- Insult spammer
- Text spammer
- Server joining
- Proxy support

# Requirements
- Python 3.6+ (I use [3.7.8](https://www.python.org/downloads/release/python-378/))
- discum (pip install discum)
- Beautiful Soup 4 (pip install bs4
- Selenium (pip install selenium)
- Requests (pip install requests)

# Setup
- [Setting up the bot | aka the Wiki](https://github.com/Merubokkusu/discord-spam-bots/wiki)

# Info
Linux bots are tested using VM Virutal Box and Ubuntu/BunsenLabs

# ToS (READ ME!)

Self-bots are against Discord's terms of service, using this on servers that aren't your own will get your account deleted.
You could even get banned while using it on your own server. I'm not responsible if you do.

This script is made only for testing your server's anti-spam, using bots like [sweetie](https://github.com/blackhole12/sweetiebot),  etc.

![its a face](http://i.imgur.com/bTMYozm.png)


text:
Checkout Page

   Solution for a challenge from  Devchallenges.io.

      Demo

     |

      Solution

     |

      Challenge

## Table of Contents

- [Table of Contents](#table-of-contents)
- [Overview](#overview)
  - [Built With](#built-with)
- [Features](#features)
- [How To Use](#how-to-use)
- [Contact](#contact)

## Overview

I tried this challenge to see what it could be like. First impression: it's really interesting :) I'll probably do more.

### Built With

- [Compile Hero](https://github.com/Wscats/compile-hero)

## Features

This site was created in response to a [DevChallenges] challenge (https://devchallenges.io/challenges). The [challenge] (https://devchallenges.io/challenges/0J1NxxGhOUYVqihwegfO) was to integrate a form for sending purchase.
You had to follow the given design, add the correct inputs and display a message if the form was incomplete and complete.
We didn't have to use javascript but seeing that I use it, I made the number of articles work with the price and the total

## How To Use

To clone and run this application, you'll need [Git](https://git-scm.com).

```bash
# Clone this repository
$ git clone https://github.com/your-user-name/your-project-name
```

Then open the index.html file with your local server. Example: [live serve](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) with VScode

## Contact

- Website [killian-thevenin](https://killian-thevenin.netlify.app)
- GitHub [@TheveninKillian](https://github.com/TheveninKillian)
- Twitter [@Killian_Thvn](https://twitter.com/Killian_Thvn)

repository: TheveninKillian/challenges

repo_name: TheveninKillian/challenges


text:
---
title: "GDScript progress report: Writing a tokenizer"
excerpt: "GDScript is being rewritten. In this article we talk about the new tokenizer—the first step in the compilation process."
categories: ["progress-report"]
author: George Marques
image: /storage/app/uploads/public/5eb/018/a65/5eb018a659a8f843228718.png
date: 2020-05-04 11:00:00
---

Some of you may not be aware, but I'm currently rewriting GDScript. It was discussed during the last Godot Sprint in Brussels and the core developers approved the idea.

The main rationale to rewrite the GDScript implementation is that it has been changed so much that it's gotten quite hard to understand after receiving so many new features. This is also an opportunity to clean up, tidy up, and modernize the code, like it happened for some other parts of the engine that got rewritten in the past years.

The objective is to have a more "textbook-like" compiler, which will help maintenance both by those already acquainted with the Godot source and by new faces who saw something about writing compilers in the past. Hopefully this will make it harder to mess something up, given this is critical code for the engine users.

*See other articles in this Godot 4.0 GDScript series:*

1. (you are here) [GDScript progress report: Writing a tokenizer](https://godotengine.org/article/gdscript-progress-report-writing-tokenizer)
2. [GDScript progress report: Writing a new parser](https://godotengine.org/article/gdscript-progress-report-writing-new-parser)
3. [GDScript progress report: Type checking is back](https://godotengine.org/article/gdscript-progress-report-type-checking-back)
4. [GDScript progress report: New GDScript is now merged](https://godotengine.org/article/gdscript-progress-report-new-gdscript-now-merged)
5. [GDScript progress report: Typed instructions](https://godotengine.org/article/gdscript-progress-report-typed-instructions)
6. [GDScript progress report: Feature-complete for 4.0](https://godotengine.org/article/gdscript-progress-report-feature-complete-40)

## Why not a parser generator?

I've seen this question more than once: why can't we use a parser generator? Then we would just need to write a grammar specification and the generator makes the whole parser for us.

The main problem with parser generators—and the main reason modern language compilers don't use them—is that it is incredibly hard to provide meaningful error messages to the users of the language. With hand-made parsers we can inject checks, such as properly validating the path you put in a `preload` statement, among other things.

The GDScript grammar is also pretty much settled (except maybe for a few of the new features) so we don't benefit from prototyping and iterating on a grammar definition, which is the main selling point of parser generators.

## Rewriting the tokenizer

The first step when writing a compiler is to make the *tokenizer* (also called *scanner* by some authors). It has the responsibility of reading the characters of the source code and bundling them together as meaningful chunks which are called *tokens*. Tokens contain information about what they mean and where they occured. This makes the following compilation steps easier to manage as they don't have to deal with minutiae such as comments and whitespace, which are not meaningful for the final execution.

I'm taking this opportunity to make the tokenizer a bit smarter (and maybe a bit dumber in some regards) in order to make the parsing simpler (I'll write about the parser when I get there). The new tokenizer will emit special tokens when it detects there's an indentation change and also a newline. Since GDScript is indentation based, this helps the parser identify the start and end of blocks. This approach is also used by Python, so I'm not being revolutionary here.

I'm also rewriting the `--test gd*` commands so they work with the new code. Those are very useful during this rewrite since they allow me test the steps of the compiler without needing to have everything ready. I can make sure the tokenizer is working properly before moving on to the parser.

## What is a token?

A **token** is a data container which describes the characters in the source code as something meaningful for the programming language. The main thing to store is the token type (e.g. a symbol, an identifier, a keyword, etc.), which is a value taken from an enum, since there are limited variety. This is used by the parser to understand which statement to expect.

Another thing is the potential associated data. If it's, say, a `+` sign it doesn't matter since the type `Token::PLUS` is enough to recognize it, but a `Token::IDENTIFIER` needs to have the actual identifier to be referred. Literal values, such as numbers and strings, also need to be stored. The new tokenizer uses a single Variant to store this.

It's also useful to store positional information about the token: line/column where it starts and ends. This is not useful for interpreting the code, but is incredibly valuable for creating readable error messages.

## Features of the new tokenizer

As mentioned, the main reason for the rewrite is to make it smarter, so let me show off some of the new features.

### Storing correct positional data

The old tokenizer stored only line and column, but there are many tokens that span across many columns and some across multiple lines. For example, a snippet like this one:

```gdscript
var x = "string"
x += """\
Multiline String
"""
```

Can now be tokenized like this:

```
0001 var x = "string"
     ^^^
 --> var
-------------------------------------------------------
0001 var x = "string"
         ^
 --> Identifier(StringName) x
-------------------------------------------------------
0001 var x = "string"
           ^
 --> =
-------------------------------------------------------
0001 var x = "string"
             ^^^^^^^^
 --> Literal(String) string
-------------------------------------------------------
0001 var x = "string"
                     ^
 --> Newline
-------------------------------------------------------
0002 x += """\
     ^
 --> Identifier(StringName) x
-------------------------------------------------------
0002 x += """\
       ^^
 --> +=
-------------------------------------------------------
0002 x += """\
0003 Multiline String
0004 """
     ^^^^^^^^^^^^^^^^
 --> Literal(String) Multiline String

-------------------------------------------------------
0004 """
        ^
 --> Newline
-------------------------------------------------------
EOF
```

This is actually the output of the new tokenizer test. It rewrites the lines and points to the whole span of the token. This is meant to improve error messages by pointing the user to the exact spot.

### Creating indentation and newline tokens

While the previous tokenizer kept track of indentation characters and newlines, it let the parser decide the current indentation level, and whether or not a newline was relevant. The new one only generates a newline token when it's not empty, and also emits tokens for indentation. For example:

```gdscript
"start"

	"indent"
		"more indent"
"two dedents"
```

Is tokenized like this:

```
0001 "start"
     ^^^^^^^
 --> Literal(String) start
-------------------------------------------------------
0001 "start"
            ^
 --> Newline
-------------------------------------------------------
0003     "indent"
     ^^^^
 --> Indent
-------------------------------------------------------
0003     "indent"
         ^^^^^^^^
 --> Literal(String) indent
-------------------------------------------------------
0003     "indent"
                 ^
 --> Newline
-------------------------------------------------------
0004         "more indent"
     ^^^^^^^^
 --> Indent
-------------------------------------------------------
0004         "more indent"
             ^^^^^^^^^^^^^
 --> Literal(String) more indent
-------------------------------------------------------
0004         "more indent"
                          ^
 --> Newline
-------------------------------------------------------
0005 "two dedents"
     ^
 --> Dedent
-------------------------------------------------------
0005 "two dedents"
     ^
 --> Dedent
-------------------------------------------------------
0005 "two dedents"
     ^^^^^^^^^^^^^
 --> Literal(String) two dedents
-------------------------------------------------------
0005 "two dedents"
                  ^
 --> Newline
-------------------------------------------------------
EOF
```

You can see that it detects a decrease in two levels by emitting two `dedent` tokens. It also doesn't emit a newline on line 2 because it's empty.

### Error reporting and leniency

The old tokenizer only allowed for one error, after which it would only return the same error if you asked for a new token. Now it returns the error but keeps going through the process so you can detect many errors at once. So this:

```gdscript
"invalid escape \h <- here"
		"indent"
	"mismatched unindent"
```

Gives this:

```
0001 "invalid escape \h <- here"
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 --> Literal(String) invalid escape  <- here
-------------------------------------------------------
0001 "invalid escape \h <- here"
                     ^^
 --> Error(String) Invalid escape in string.
-------------------------------------------------------
0001 "invalid escape \h <- here"
                                ^
 --> Newline
-------------------------------------------------------
0002         "indent"
     ^^^^^^^^
 --> Indent
-------------------------------------------------------
0002         "indent"
             ^^^^^^^^
 --> Literal(String) indent
-------------------------------------------------------
0002         "indent"
                     ^
 --> Newline
-------------------------------------------------------
0003     "mismatched unindent"
     ^^^^^
 --> Error(String) Unindent doesn't match the previous indentation level.
-------------------------------------------------------
0003     "mismatched unindent"
     ^^^^^
 --> Dedent
-------------------------------------------------------
0003     "mismatched unindent"
         ^^^^^^^^^^^^^^^^^^^^^
 --> Literal(String) mismatched unindent
-------------------------------------------------------
0003     "mismatched unindent"
                              ^
 --> Newline
-------------------------------------------------------
0004
     ^
 --> Dedent
-------------------------------------------------------
EOF
```

You can notice that the error in the string comes after the string token. That's okay because the parser will report all errors at once and they will be sorted by position.

Indentation level is also correctly maintained even in case of a mismatch (that's why there's two dedents for one indent). This is helpful to keep the parsing lenient in some special cases, which I'll talk more about when I write about the parser.

### Recognizing extra tokens

Some characters and sequences aren't allowed in the source code but they can be tokenized so a better error message can be provided. Example:

```
? ` <<<<<<< ======= >>>>>>>
```

Result:

```
0001 ? ` <<<<<<< ======= >>>>>>>
     ^
 --> ?
-------------------------------------------------------
0001 ? ` <<<<<<< ======= >>>>>>>
       ^
 --> `
-------------------------------------------------------
0001 ? ` <<<<<<< ======= >>>>>>>
         ^^^^^^^
 --> VCS conflict marker
-------------------------------------------------------
0001 ? ` <<<<<<< ======= >>>>>>>
                 ^^^^^^^
 --> VCS conflict marker
-------------------------------------------------------
0001 ? ` <<<<<<< ======= >>>>>>>
                         ^^^^^^^
 --> VCS conflict marker
-------------------------------------------------------
0001 ? ` <<<<<<< ======= >>>>>>>
                                ^
 --> Newline
-------------------------------------------------------
EOF
```

The question mark can be recognized as an attempt to use the C-style ternary conditional operator, so we can show the user the correct operator for GDScript.

We also recognize conflict markers so you can easily notice that you have a merge conflict in the file.

## What comes next

Now that the tokenizer is pretty much done, I'll start rewriting the parser, which is responsible for reading the sequence of tokens and making sense out of them, deciding if it's a function, variable, expression, etc. I'll write more about it when I have something to show.

repository: godotengine/godot-website

repo_name: godotengine/godot-website


text:
# ssoAuthentication
- a light weight app containing files which are necessary to be loaded in the SSO popup window
- contains ssoAuthenticationInjector file which is responsible for communicating with SmartEdit app

## SETUP
This light weight app follows a slightly different build process when compared with extensions based on SmartEdit. The setup includes
- All source files under `/src` directory
- Custom webpack configuration (`webpack.conf.js`)
- Custom typescript configuration (`tsconfig.json`)
- Two grunt tasks configured in `/smartedit-custom-build/config/shell.js` for both dev (`grunt shell:devbuildssoauthenticationinjector`) and prod (`grunt shell:prodbuildssoauthenticationinjector`) environments and added these tasks as part of `grunt dev` and `grunt packageSkipTests` respectively in `Gruntfile.js`

repository: karthik-git-user/SAP-Stage

repo_name: karthik-git-user/SAP-Stage


text:
---
layout: default
---

# 1995-07-16 - Re: Anti-Electronic Racketeering Act of 1995 (fwd)

## Header Data

From<EMAIL_ADDRESS>(Andrew Spring)

To<EMAIL_ADDRESS>Message Hash: 7024d41865f1ec95593f3fe7bce7b345016c74bdcb5b4b81babdf77bd69477e5

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-07-16 11:52:06 UTC

Raw Date: Sun, 16 Jul 95 04:52:06 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Andrew Spring)
Date: Sun, 16 Jul 95 04:52:06 PDT
To<EMAIL_ADDRESS>Subject: Re: Anti-Electronic Racketeering Act of 1995 (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>ranked as a mobster subject to RICO.  My guess is that the intent is that
>from one placement on an FTP server or one posting to a newsgroup, the
>perpetrator of that heinous act will have passed his RICO qualification and
>therefore be subject to having all he owns taken from him.

RICO question:  i thought that the idea of RICO is to confiscate assets of
racketeers that are derived from criminal activities.  PGP and remailer
software is distributed free.  so would RICO seizures even apply (yes I
know this doesnt' always stop the FBI)?

--
Thank you VERY much!  You'll be getting a Handsome Simulfax Copy of your
OWN words in the mail soon (and My Reply).
<EMAIL_ADDRESS>PGP Print: 0529 C9AF 613E 9E49  378E 54CD E232 DF96
   Thank you for question, exit left to Funway.

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Andrew Spring)](/authors/andrew_spring_at_ping_be_andrew_spring_)"

+ 1995-07-16 (Sun, 16 Jul 95 04:52:06 PDT) - Re: Anti-Electronic Racketeering Act of 1995 (fwd) -<EMAIL_ADDRESS>(Andrew Spring)_


text:
# script-fu-quarterscale
GIMP 2.8 Script-Fu Image Plugin - Downscales all opened images to 25%

## Installation

Copy `.scm` file into your GIMP scripts directory

## Usage

Image -> Transform -> Quarterscale

repository: RichardMarks/script-fu-quarterscale

repo_name: RichardMarks/script-fu-quarterscale


text:
# terraform-provider-switch-case
Terraform module which helps to manage switch-case statements.

## Usage
```
# Expression to compare
variable "fruit" {
    default = "apple"
}

# Cases to compare with expression
variable "fruits" {
    default = {
        "apple" = {
            message = "Apple is selected"
        },
        "orange" = {
            message = "Orange is selected"
        },
        "strawberry" = {
            message = "Strawberry is selected"
        }
    }
}

# Module do switch-case for you
module "my-switch-case" {
    source = "github.com/lonnyantunes/terraform-provider-switch-case"
    expression = var.fruit
    cases = var.fruits
}

# It returns a result
output "selected_fruit" {
    value = module.my-switch-case.result.message
}
```

## Inputs

| Name          | Description |  Type 	                             |  Default 	| Required  |
|:---	        |:---	      |:---	                                 |:---	        |:---	    |
| expression  	| The string that you want to compare with your different cases of strings 	      |  `string`  	                         | ""             | Yes       |
| cases  	    | The strings you want to compare with the provided expression	      | `map(object({ message = string }))`  	                         |
{
  "" = {
         error = "You have to write and set your custom cases."
  }
}
            | Yes       |

## Outputs
| Name          | Description |
|:---	        |:---	      |
| result  	    | Return the object matching your expression      |

repository: oferchen/terraform-provider-switch-case

repo_name: oferchen/terraform-provider-switch-case