text:
# battleship
Battleship CompSci Final Assignment

About This
------
This project is a Java implementation of the popular game Battleship.
You can either choose to play someone over LAN, or you can choose to
play the AI.

This game was made in May 2015, for the final assignment of the grade 11
CompSci course.

Contributors
------
> jimgao1 (Jim Gao)

> hyzzsq (Philip Huang)

> joSepH0Zz (Joseph Zhang)

Building
------
This project MUST be built in Eclipse, just download the entire
repository and import it into eclipse.

Algorithm
------
The AI for this project uses a "probability matrix / grid" algorithm,
to find the most probable positions. The implementation of this
algorithm is in the file `BattleshipSP.java`.

Error Reporting
------
If the program encountered any error, please submit them on GitHub.
Your help is appreciated.

Licensing
------
This project follows the MIT license, meaning you can do anything with
it with or without contacting me.


text:
---
title: Kiwi Nostalgia
author: Sarah
type: post
date: 2006-11-22T13:51:00+00:00
url: /924/
lj_itemid:
  - 1044
lj_permalink:
  - '#/267331.html'
post_views_count:
  - 876
categories:
  - Dublin
  - "The 'Zealand"
tags:
  - ah! sweet nostalgia

---
I’ve been thinking a lot about New Zealand since I came to Dublin. Memories keep bobbing to the surface of my mind when I least expect them to. I’m dreaming about situations that did or could have taken place, following conversations to what could have been their conclusion, closing my eyes and seeing myself sitting on the verandah of the hostel in Okarito as the sun went down, drinking hot chocolate in Katipo, going to McDonalds in Auckland in the middle of the night with Legoboy, running away from some boy I’d kissed on Stewart Island to go looking at the clearest sky and the brightest stars I’d ever seen, trying to fly my kite the park in Christchurch and eventually succeeding.

It’s odd, too, the sorts of parallels that pop up.

![The Taking of the Christ by Caravaggio](/img/blog/caravaggio.jpg)

**The Taking of the Christ by Caravaggio**

Painting in the National Gallery of Ireland

![Witness Caravaggio by Kees Bruin](/img/blog/keesbruin.jpg)

**Witness Caravaggio by Kees Bruin**

Painting in Christchurch Art Gallery, New Zealand

 [1]: http://pics.livejournal.com/froodie/pic/0002a6he/g4

license: MIT

repository: froodie/blog

branch_name: refs/heads/master

extension: md

gha_language: CSS

license_type: permissive

repo_name: froodie/blog


text:
# EDA demo

A demonstration project of my Exploratory Data Analysis skills applied to an NLP dataset: the FAA Aviation Maintenance Technician Handbook (Vol 1)

PDF sourced from https://www.faa.gov/regulations_policies/handbooks_manuals/aircraft/media/amt_airframe_hb_vol_1.pdf (retrieved on 2021-01-11)

Analysis contained within the jupyter notebook: EDA.ipynb

branch_name: refs/heads/main


text:
---
title: Plugins
permalink: /docs/running/plugins/
---

Configuration for the available plugins are stored in a JSON encoded string. The format
of this document are available with the [Plugins Overview]({{ "/docs/plugins/" | absolute_url }}).

You can override the plugin config by specifying the content in the `TALK_PLUGIN_JSON`
environment variable.

## Bundled Plugin Configuration
{:.no_toc}

Some of the core plugins that are bundled with Talk require specific configuration to be
available.

{% include toc %}

### Facebook Authentication

- `TALK_FACEBOOK_APP_ID` (*required*) - the Facebook app id for your Facebook
Login enabled app.
- `TALK_FACEBOOK_APP_SECRET` (*required*) - the Facebook app secret for your
Facebook Login enabled app.

repository: piersmana/talk

repo_name: piersmana/talk


text:
# Streaming Tilemap

This demo implements an "infinite" tilemap that uses _chunks_ (instead of a single file) that make up a tilemap. In other words, the tilemap is not made of a giant 2-dimensional array but small parts that represent portions of visible tiles. This approach has the potential of consuming less memory than a single rectangular array of tile data.

Chunk management is based on camera position where the chunks are dynamically loaded and discarded in a way that only the immediate surrounding chunks are kept in memory (thus the term _"streaming"_). While this demo asynchronously loads chunks from disk, we could easily be streaming them over the network, too. There are no loading breaks, everything will be loaded in the background. The observer (or _player_) will get the impression of seamless, infinite map.

This demo uses [Veldrid](https://github.com/mellinoe/veldrid), a cross-platform graphics API abstraction for **.NET Core** that supports various graphics backends including **Direct3D11**, **Vulkan**, **Metal**, and **OpenGL**. In theory, this demo (the _Engine_ part) runs on **Windows**, **MacOS**, and **Linux** however this demo only contains a configuration for Windows. For other platforms you only need to change the entry point that bootstraps the game. For more information, see demo code on _Veldrid Samples_ repository.

This demo consists of the **Editor** (WPF application, Windows only) and the **Engine** (Veldrid powered cross-platform "game"). The game itself features an example map that contains a handful of chunks, and you'll be controlling the camera.

> **NOTE:**
> The Editor is Windows only, but the chunk format is very simple and you can eaily create them manually as well. See section _"Chunk format"_ for more information.

## Requirements

- Visual Studio 2017 (Community edition will do)
- .NET Framework 4.7.2
- .NET Core 2.1 SDK and runtime

The source code is written in C# 7.3.

> **TIP:**
> In Visual Studio Installer app, select workloads **".NET desktop development"** and **".NET Core cross-platform development"**.

## Building & Running

1. Open the Solution in Visual Studio and Rebuild it (this should run _Nuget Restore_).
2. Set **Engine** as the Startup project and run it.

The game will open an SDL2 window (centered on screen). The window fits exactly one chunk (which is 9x9 tiles in size). Tile size is 32x32 pixels, so window ends up being 288x288 pixels. These can be configured in the **Configuration.cs** file. The chunk size is of uneven tiles because the possible player sprite would occupy the middle of the screen. If you want to edit the tiles' appearance, just modify the **tileset.png** file.

Tileset size is not limited, but it should respect the tile size intervals (32 pixels in this case). Also, the atlas texture should be square, and its width & height be a _power of two_. If you need a bigger atlas - that can fit more tiles - a 1024x1024 would do fine for example. For best compatibility, make sure to save the file with 96.0 DPI.

To change the graphics backend, edit **Program.cs** and specify it in:
```csharp
window.Run(GraphicsBackend.Direct3D11);
```

> **NOTE:**
> `Metal` is only available on a MacOS and `Direct3D11` is only available on Windows. `Vulkan` should work on all platforms (as long as you have relatively modern a GPU and up-to-date drivers), but uses more memory than the other options (dunno why, could be a Veldrid thing). `OpenGL` is not necessarily as smooth as the more modern options.

> **NOTE:**
> The demo uses pre-compiled shaders (\*.hlsl.bytes, \*.spv, and \*.metallib).
> - To compile HLSL, start the _Developer Command Prompt for VS 2017_ and run the **compile-hlsl.cmd**. If you don't have `fxc`, install the DirectX SDK.
> - To compile Vulkan, run **compile-spirv.cmd**. You'll need the Vulkan SDK.

> **TIP:**
> Veldrid also supports SPIRV, so you could first compile GLSL/HLSL to SPIRV format and then import your shaders from SPIRV. The _Veldrid Samples_ repository has more examples how to load SPIRV.

### Engine controls

- ⬅➡⬆⬇ Move camera
- Hold **SHIFT** to move faster
- **Q** to reset camera position back to chunk (0, 0)

### Some caveats

Don't do the same mistakes than I did and waste time on these things:

- When creating the GraphicsDevice, set `preferDepthRangeZeroToOne: false` or else your **OpenGL** backend will not render anything.
- When creating the GraphicsDevice, set `preferStandardClipSpaceYDirection: false` or else your **Vulkan** backend will render everything vertically mirrored.
- When creating the GraphicsDevice, set `swapchainDepthFormat: null` and the pipeline's `DepthStencilState = DepthStencilStateDescription.Disabled` or else it's easy to select the wrong _depth test_ and end up rendering nothing.
- Use `PrimitiveTopology.TriangleList` instead of `PrimitiveTopology.TriangleStrip` - the latter just isn't suitable for a tilemap scenario.

## Editor

The Editor is a standard WPF application using the MVVM design pattern (with no dependencies to any MVVM mini frameworks). **BindingSource** implements the `INotifyPropertyChanged` which offers the databinding capability. The **ViewModel** base class is derived from it.

The application spawns multiple windows:

1. The **MainWindow** contains the actual tile editor. It draws 3x3 chunks, and camera can be moved (a chunk at a time) via the _arrow keys_.
2. The **Tileset** tool window that acts as _palette_; user can select the Foreground brush (left click) and the Background brush (right click). Painting on the MainWindow happens with the same respective mouse buttons. This behavior is similar to most painting/drawing applications.
3. The **MapBrowser** tool window allows user to create and delete tilemaps, as well as choose the currently active map. This window sets up some FileSystemMonitors that detect changes to the **Maps** folder structure and refresh the UI automatically. The Map browser also features a _minimap preview_ that visualizes the _shape_ of chunks within the world. **White** blocks are chunks, **Black** blocks contain no chunks, and the (0, 0) origin chunk is visualized in **Red**.

 Their view models share information via the **Context** object. The Context also provides access to common _sevices_ such as the **AssetManager**.

Currently the **AssetManager** provides loading and saving functionality for chunks. Basically it handles chunk file reading and writing. The outside facing API is simply "give me tile data from these chunk coordinates" and "save this chunk's tile data". Chunk data is requested when the camera moves (and the chunks need to be repopulated), and saved on each _Paint_ action. Currently saving is not throttled and everything operates in real-time. Chunks are rather small (9x9) so this is not that big of a problem, but there's definitely some room for improvement.

### Main view

There's a 3x3 `UniformGrid` (according to which the window is automatically sized). Each cell contains their own designated view model, representing the chunk's data. The 9 **ChunkViewModels** are created once and stay static after that - only their content gets updated when the camera moves (or a Paint/Erase occurs).

Mouse events for painting and erasing are handled in the view's code-behind (I don't use any _Behavior_ magic in this app), and then delegated to the view model.

When the _focus_ is on the main window, move the camera with the arrow keys ⬅➡⬆⬇.

#### Chunks

To render chunk data (tiles), this application uses **WriteableBitmaps** that can be used as _ImageSources_ for WPF `Image` elements. For blitting bitmap regions from one bitmap to another, I use the [WriteableBitmapEx](https://www.nuget.org/packages/WriteableBitmapEx) library. Each chunk has a 9x9 array for tiles, and for each tile we blit the appropriate 32x32 region from the tileset bitmap to the chunk's bitmap.

The tile array holds 1-based index values to the tileset. Zero means empty (= no tile) whereas 1 means the first tile in the tileset. For zero values we just present a black rectangle.

### Tilesets

The tileset is an atlas texture that contains each tile arranged in a grid. The top-left tile corresponds index 0, its first right neighbor 1 etc. Tile indices flow like text, wrapping onto the next "line":

        0
        1
        2
        3

        4
        5
        6
        7

        8
        9
        10
        11

        12
        13
        14
        15

**Tileset.cs** contains some helper methods for calculating the 0-based index from the given row and column as well as determining the row and column that corresponds the given index. The Editor version of Tileset.cs contains the loaded bitmap, and is able to blit tiles to another bitmaps. The Engine version doesn't contain the texture itself, and is mainly used for tile index calculations.

Tile index is assumed to be zero-based everywhere else except in the chunk's tile array where zero means _"no data"_ i.e. just empty black rectangle. Number 1 refers to the first tile in the tileset. The reason for this is purely the serialization format, which is an _unsigned 16-bit integer_, or `ushort`.

The Editor spawns a separate tool window that contains the tileset from which the user can select the foreground and background brushes using the left and right mouse buttons, respectively. Current brushes are stored in the shared **Context** (from where the **MainViewModel** can access it).

Every bitmap surface - where tiles are shown - is basically a `WriteableBitmap`, even if the bitmap itself wouldn't be changed. The **WriteableBitmapEx** library only provides extension methods for WriteableBitmaps.

> **TIP:**
> If you get strange exceptions from the **WriteableBitmapEx** library during blitting, debug the bitmap's size and DPI values; my Paint.NET once saved the PNG file with DPI 95.9... instead of exactly 96.0 DPI which caused unexpected size-effects and an exception. I re-saved the image in another application and it fixed the problem.

### Maps

The tilemaps are stored in the **"Maps"** folder that will then contain sub folders for the individual maps. Each individual map folder contains a number of .chunk files. The chunk filenames follow a naming convention `x,y.chunk` where both **x** and **y** represent chunk coordinates. For example, the origin chunk's filename would be **"0,0.chunk"** and one directly to the north-west would be **"-1,-1.chunk"** (the Y-axis grows downward on screen).

The files are written realtime when the user paints on them. The **Map browser** (tool window) sets a **FileSystemWatcher** that monitors the map folders, and updates the map list on the UI as needed.

> **CAUTION:**
> The editor always creates a **Default** map. During application startup this folder is cleared so it's an empty workspace every time. Be sure to create a new map and edit that instead so that your work will not be lost.

The **Clean** button in the map list will simply remove chunks that are completely empty. You may have touched a chunk previously, but later cleared it back to zero. In this case the chunk file would still exist even though it contains no meaningful data. It's a good practice to run a Clean operation before copying the chunk files to, say, the Engine's map folder.

## Chunk format

A chunk contains 9x9=81 tiles. Each tile is encoded as an `ushort` and takes 2 bytes. There are no line breaks i.e. all tiles are consecutive. Value zero means "no data" and is rendered as a black rectangle. Any other value indicates the tile index. For example, number 1 refers to the first tile in the tileset texture.

The chunk file only contains the raw tile data - the coordinates are inferred from the filename. Therefore the exact file size for each chunk is 81x2=162 bytes.

The small chunk size would enable streaming over network scenarios, too.

## Engine

The Engine is a .NET Core application and uses [Veldrid](https://github.com/mellinoe/veldrid). The published application contains assemblies from [ImageSharp](https://github.com/SixLabors/ImageSharp), [SharpDX](https://github.com/sharpdx/SharpDX), and [SDL2](https://www.libsdl.org/). The app spawns a simple 288x288 game window, which is just enough to fit a _chunkful_ of tiles in it. You can move the camera with the arrow keys ⬅➡⬆⬇, speed it up by holding **SHIFT**, and reset the camera with **Q**.

- The .chunk files are stored as **Content**, and copied to the **Maps/Overworld** folder
- The tileset texture "tileset.png" is stored as **Content**, and copied to the **Assets** folder
- The shaders are stored as **Embedded resource**, and therefore compiled into the assembly. All shader files start with "Basic" and then specify whether they're for vertex or fragment stages. This naming convention is important. HLSL, Metal, and Vulkan shaders are included both as source code and pre-compiled forms. GLSL and GLSLES are source-only

If you need to make changes to the shaders, you must re-compile them. I've included **compile-hlsl.cmd** and **compile-spirv.cmd** for compiling the HLSL and Vulkan shaders, respectively.

The current default is **Direct3D11**, but you can change the preferred graphics backend in **Program.cs**.

### Game window and the Game base class

The hosting window and the game logic are separate classes, but a game's lifetime is tied to that of the window's. Basically the window must exist first, and then the game instance is attached to the window.

```csharp
var window = new GameWindow("Window title");
var game = new MyGame(window);
window.Run(GraphicsBackend.Direct3D11);
```

To create a game class, simply derive it from the `Game` base class:

```csharp
public class MyGame : Game
{
    public SampleGame(IGameWindow window) : base(window)
    {
    }

    protected override void CreateResources(ResourceFactory factory)
    {
    }

    protected override void FreeResources()
    {
    }

    protected override void Draw(float deltaSeconds)
    {
    }

    protected override void Update(float deltaSeconds)
    {
    }

    protected override void OnKeyDown(KeyEvent state)
    {
        if (state.Key == Key.Escape)
        {
            this.Exit();
        }
    }
}
```

The `Game` base class gets the window instance, subscribes to some of its events, and will then call the virtual methods at appropriate times:

- `CreateResources` will be called first. Use the passed factory to create any graphics _resources_ (buffers, layouts, resource sets, pipelines etc.)
- `Update` will be called once per frame, just before `Draw`. You can check player input, update physics, and other gameplay related things here.
- `Draw` will be called once per frame. Update shader buffers and issue the rendering commands here. Finally, swap the _backbuffer_.
- `FreeResources`will be called when the window has closed and any remaining resources need to be released. You'd typically store all resources created by the `ResourceFactory` into class fields, and then Dispose them in this method.

This demo uses an SDL2 window (also OpenTK is an option). There's a special value we can use in place of X and Y coordinates, `Sdl2Native.SDL_WINDOWPOS_CENTERED`, that allows us to center the window. This is handy because the .NET Core BCL doesn't provide a way to enumerate display devices (and to calculate the centered position).

The Window object itself doesn't provide many useful properties (apart from `Resizable = false` that is used in this demo), but should you need more advanced window controls, check out the **Sdl2Native** class:

```csharp
Sdl2Native.SDL_SetWindowFullscreen(window.SdlWindowHandle, SDL_FullscreenMode.FullScreenDesktop);
Sdl2Native.SDL_MaximizeWindow(window.SdlWindowHandle);
```

### Handling input

The GameWindow takes a snapshot of key and mouse events once per frame. These events are handled by the **InputTracker** that keeps the global key and mouse state i.e. what keys and buttons are currently being held down and what buttons received a _Down_ event during the most recent update. This class is static, and therefore easily accessible from everywhere. However, it's not thread-safe. You should process its state in the game's `Update` method.

> **TIP:**
> Mouse position is also accessible from the InputTracker.

### Chunk management

The _World_ contains _chunks_ that make up the map. Within the world there's also a _Camera_ (that the user can move with the arrow keys). X coordinates grow to the right, and Y coordinates grow downwards (meaning that when the camera moves up, its Y coordinate decreases). Both coordinates can go negative. In fact, the camera starts at position (0, 0) and you can then move to any direction.

Camera coordinates are in pixels. During the _Update_, camera movement speed is proportional to the screen FPS so that the actual graphics performance doesn't have any impact on the observed scrolling speed on screen; it'll take the same amount of time to scroll from one location to another regarless of what FPS the game is running. This means that camera coordinates are of `double` type.

Each frame, we calculate which chunk is directly at the camera's location. This is the main chunk we're interested in because it'll determine which other chunks are loaded or discarded. Ideally, we want to keep enough surrounding chunks loaded in the world so that when the camera moves there's always something visible that scrolls into view. This gives the impression of seamless "infinite" map with no loading breaks.

The **ChunkManager** keeps a cache of _active_ chunks in the world. "Active" here means that it's close enough to the camera's chunk, and is either still loading or has finished loading tile data (we load the data asynchronously). Whenever the camera position is updated, the ChunkManager will go through its cache and throw away chunks that are too far away from the camera. Then it'll see what chunks are near the camera and load any that are not yet in the cache.

Chunks are _pooled_ so that we don't create new tile arrays every time we add a chunk to the cache. Instead we withdraw an unused chunk from the pool, and then start loading its data. When chunks are discarded, they're simply returned to the pool. This technique avoids creating GC garbage.

When rendering, the game asks the ChunkManager for tile data of a certain chunk (based on chunk position). If no chunk exists at those coordinates, it returns just an empty array, full of zeroes, that gets rendered as all-black. Otherwise the chunk's real tile data is returned (this can still be full of zeroes if the chunk hasn't finished loading).

Chunks that need to be loaded are queued to **ChunkProcessor** that runs the queue in a separate thread. No loading job is added if the same chunk (for the same location) is already queued.

Also ChunkProcessor is notified about the camera position. This is to prevent unnecessary loading jobs that could occur when the chunk whose data should be loaded next has already been discarded for being too far away from the camera. Those jobs will just be skipped.

The loading queue uses a `BlockingCollection<T>` that implements the producer-consumer pattern. Although the current demo doesn't really use true parallelism, this solution will scale if needed. We could easily have 4 _processor_ threads for loading multiple chunks simultaneously (for example, over the network).

Loaded data gets written (from a stream) to a _staging array_. Once complete, the staging array's contents gets _copied_ to the chunk's _back buffer_, and the staging array can then be re-used for the next loading job.

Yes, each chunk actually has two tile arrays, one of which is in use (and being rendered from), and the other being a temporary place-holder for new data. This is because chunk loading is asynchronous and otherwise we could accidentally end up updating the array while it's being used for rendering. This might only have 1 frame worth of visual artifacts - which might not be such a big deal - but imagine if your game had collision detection that depends on data integrity (during the _Update_ phase). Then partial updates can have more serious consequences.

So just at the beginning of _Update_ we tell all cached chunks who have obtained data to their back buffer, to flip it. Essentially the back buffer then becomes the current buffer and vice versa. This happens in the main thread.

### Some caveats

Usually you calculate chunk/tile coordinates based on camera position simply by dividing an integer by the size. For example:

```csharp
int tileSize = 32;
int cameraX;

var tileXUnderCamera = cameraX / tileSize;
```

This works as long as all coordinates are >=0. To also cover negative numbers, `Math.Floor` is required:

```csharp
var tileXUnderCamera = (int)Math.Floor((double)cameraX / tileSize)
```

So you convert `int`→`double`, divide, take `Floor` and then convert back to `int`. Yuck.

What we'd really need is a _floor division_ like `a//b` in Python, but C# doesn't provide one out-of-the-box. So I added helper methods `DivFloor` ad its corresponding `ModFloor` in **Utility.cs**. Those operate with both positive and negative integers.

## How to: Load editor maps in the demo

Let's say you have created a map named **"test"**. You'll find the chunk files in **Editor\bin\Debug\Maps\test**.

Before copying the files, run the **Clean** operation from the Map browser's list. This will remove unused chunk files.

Then simply copy all the .chunk files to **Engine\bin\Debug\netcoreapp2.1\Maps\Overworld**. Make sure you use the same tileset image you used with the Editor (both the Editor and Engine projects contain one).

> **NOTE:**
> When running from Visual Studio, chunk files are copied to the output folder when the app is built. This operation will naturally overwrite the chunk files in the target folder. To prevent an unintended overwrite, include the chunk files in the project, mark them as **Content**, and set `Copy to Output Directory=Copy always`.

repository: zerppa/StreamingTilemap

repo_name: zerppa/StreamingTilemap


text:
# XMPP Chat
## UVG Redes Proyecto 1 - XMPP
---

This project is a chat client that implements the XMPP Protocol. This client is based on the python library [slixmpp](https://slixmpp.readthedocs.io/en/latest/). Consist of two files, app.py, which is the main file and is in charge of showing the unauthenticated menu options to the user; and client.py, which is the XMPP Client custom implementation. The client make use of the following XEP Plugins:

- [XEP-0004 - Data forms](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0004.html)
- [XEP-0030 - Service Discovery](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0030.html)
- [XEP-0045 - Multi-User Chat](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0045.html)
- [XEP-0066 - Out-of-band Data](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0066.html)
- [XEP-0071 - XHTML-IM](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0071.html)
- [XEP-0077 - In-band Registration](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0077.html)
- [XEP-0085 - Chat State Notifications](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0085.html)
- [XEP-0128 - Service Discovery Extensions](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0128.html)
- [XEP-0199 - XMPP Ping](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0199.html)
- [XEP-0363 - HTPP File Upload](https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0363.html)

## Specifications and Features of the Client
---
### The client has the following event listeners:
---
- Event: session_start
    - This event is triggered when the client is connected and the user is logged in.

- Event: register
    - This event is triggered when the user is on registration process.

- Event: message
    - This event is triggered when the user receive a message of any type.

- Event: chatstate_active
    - This event is triggered when some user that we are chatting with set its chat state as active.

- Event: chatstate_inactive
    - This event is triggered when some user that we are chatting with set its chat state as inactive.

- Event: chatstate_composing
    - This event is triggered when some user that we are chatting with set its chat state as composing.

- Event: chatstate_paused
    - This event is triggered when some user that we are chatting with set its chat state as paused.

- Event: chatstate_gone
    - This event is triggered when some user that we are chatting with set its chat state as gone.

### Client class methods
---
- init: class initializer, loads the event handlers.
- start: set initial presence status, update the user contacts, and show the menu options.
- load: update the state of the client, is usefull to know is there is new messages.
- authenticated_menu: print the menu.
- register: send the xmpp petition to register a new user.
- logout: disconnect the client and ends the authenticated flow.
- list_contacts: list all the user contacts.
- update_contacts: temporaly store of the user contacts extracted from the roster
- add_contacts: add a user to my roster (contact list)
- show_contact: show info of a specific contact
- chat: send a message to a specific user
- group_chat: send a message to a group chat
- join_group: join a group chat
- receive_message: get the messages and files received
- presence: set and send presence
- send_chat_status: send chat status
- receive_chatstate_active: receive chat state active
- receive_chatstate_inactive: receive chat state inactive
- receive_chatstate_composing: receive chat state composing
- receive_chatstate_paused: receive chat state paused
- receive_chatstate_gone: receive chat state gone
- send_file: upload and send a file
- destroy_account: destroy the current user account on the server

## How to install and use
---
### How to install
---
    * Important: USE PYTHON 3.7
    pip3 install -r requirements.txt
    python app.py -q

### How to use
---
Available menu options:
- Registration
- Login
- Logout
- Chat
- Join Group
- Group Chat
- Presence
- List Contacts
- Show Contact
- Add Contanct
- Send File
- Destroy Account


text:
---
title: 'Chatr: Exploring React & RxJS with a Chat Application'
publishedAt: '2016-03-29T17:37:22.000Z'
updatedAt: '2016-04-04T00:27:22.000Z'
menu: content/menus/main.md
header: content/headers/main.md
status: publish
body:
  - content: >
      [React.js](https://facebook.github.io/react/) has pretty well skyrocketed
      through the JavaScript community since its initial announcement, and with
      its reactive approach to UI, there's been a growing interest in functional
      programming in the JavaScript community as a result. Because JavaScript
      allows you to pass functions around like objects, it makes it very easy to
      apply functional concepts to the language. Like much of the community,
      I've also been
<EMAIL_ADDRESS>      [quite](http://fr.umio.us/favoring-curry/) [a
      bit](http://fr.umio.us/why-ramda/) about [functional
      programming](https://github.com/timoxley/functional-javascript-workshop),
      but I haven't had the opportunity to build a full-fledged application on
      these ideas.

      I've played around with
      [RxJS](https://github.com/Reactive-Extensions/RxJS) &
      React<FootnoteReference id="1" /> a little bit, but I'm not entirely sure
      what a full-stack architecture might look like (yet). I want to explore
      the possibilities by building a real-time chat application (with the
      uninspiring name Chatr) on Node.js with RxJS, React, &
      [Ramda](http://ramdajs.com/0.19.1/index.html), applying functional
      programming to a system that can easily be modeled as a stream of
      messages/events.

      With RxJS, I should be able pipe messages around the application,
      including into React to update the UI on the client side, as well as to
      and from a data store like [Redis](http://redis.io/) or a messaging queue
      like [RabbbitMQ](https://www.rabbitmq.com/) on the server side, with the
      data streaming between the server & client over a Socket.io stream. This
      architecture could also be inspired by
      [Flux](https://facebook.github.io/flux/), ensuring all data flows into a
      central "store stream," which then pipes out the messages to wherever it
      needs to go. This primary data store stream probably could be reused on
      both the client & server side, which allows us to introduce some
      isomorphism in both our data handling & UI.

      My plan is to build this in public and write about it, and see what some
      of the advantages and drawbacks of this approach for building web
      applications. You can follow along with [the repo on
      GitHub](https://github.com/mAAdhaTTah/chatr), or keep up with the [thread
      on this website](https://jamesdigioia.com/thread/rxjs-react-w-chatr/).

      Before we can get started doing anything interesting, we've got to get
      some boilerplate going. Since we want to try out some isomorphic
      techniques, we're going to need to, at a minimum, get the JSX compiled on
      the server side. [`babel`](https://babeljs.io/) is the default standard
      for compiling JSX, and they have a very clear
      [example](https://github.com/babel/example-node-server) for getting it
      running on the server. Since we're already using it, we're also going to
      bring in ES6 compilation and use that for both the server- and client-side
      code.

      Following along with the example, we're going to add `nodemon`,
      `babel-cli`, and the two babel presets we're going to use,
      `babel-preset-es2015` and `babel-preset-react`. Since we're going to be
      sharing the `babel` configuration between the server and client, we need a
      `.babelrc` file, which `babel` uses to register presets and plugins:

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/babelrc-2/"
      provider="twitter" />

      Finally, add `nodemon server.js --exec babel-node` to the `package.json`'s
      scripts key as `"start"`, so we can run `npm start` to run the server.
      `babel-node` is shipped with the `babel-cli` package we installed, and it
      ensures our server-side code is compiled on-the-fly by `babel` and then
      run in `node`, with `nodemon` recompiling and restarting the server
      whenever our code changes.

      We're going to use [express.js](http://expressjs.com/) to handle routing
      and serve our static assets.  You should see a big "Hello
      World!". Got it? Good! Let's get some script and style compilation going.

      We'll start with the scripts. [`webpack`](https://webpack.github.io/) and
      [`browserify`](http://browserify.org/) are both solid options for
      compiling scripts using `babel`. I've used `browserify` a lot more than
      I've used `webpack`, so I'm going to use `webpack` for this project.
      Fortunately, the configuration isn't that complicated for a simple setup
      like this:

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/webpack-config-js-2/"
      provider="twitter" />

      We're not going to worry about getting any of the really complicated
      features setup, like hot reloading or dev servers or anything like that.
      Instead, we're going start with to create a simple script that uses some
      ES6 to ensure that we're compiling our scripts correctly.

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/client-js-2/"
      provider="twitter" />

      If you've `npm install`ed `webpack`, you can just run `webpack` in your
      terminal and it should spit out a `main.min.js` file in your `public`
      folder. Pull that up in your [browser](http://localhost:3000/main.min.js)
      and you should see the compiled file.

      On the style side, we can compile our `styles.scss` file with `node-sass`.
      I'm going to be including [Bourbon](http://bourbon.io/),
      [Neat](http://neat.bourbon.io/), and [Bitters](http://bitters.bourbon.io/)
      for this project, as I like their mixin-only approach for its flexibility
      and control. Here's the very basic `styles.scss` file:

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/styles-scss-2/"
      provider="twitter" />

      I'd love to get this setup with [Eyeglass](http://eyeglass.rocks/) as
      well, but we'll start with this. Install `node-sass` and run `node-sass
      styles.scss public/styles.css`. We [should
      see](http://localhost:3000/styles.css) the CSS file rendered, compressed
      and compiled correctly, with a long sourcemap appended at the end.

      Finally, we're going to convert the root route to render a template for us
      instead of using a simple string. In this case, we're going to register
      [Handlebars](http://handlebarsjs.com/) using
      [`express-handlebars`](https://github.com/ericf/express-handlebars):

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/handlebars-2/"
      provider="twitter" />

      which we're going to use to render a very simple template:

      <Embed
      url="https://jamesdigioia.com/gistpens/chatr-boilerplate/main-hbs-2/"
      provider="twitter" />

      This is set up this way in preparation for implementing is server-side
      rendering! The `app` variable in the template context will become the
      rendered HTML string from React, and the `state` variable will be the
      state object that produced the given HTML. Then on the client side, we'll
      pull in current state, render the React components on the current state on
      the page, and bootstrap the application. This is how the [Redux
      docs](https://github.com/reactjs/redux/blob/master/docs/recipes/ServerRendering.md)
      suggest doing it, and since they know what they're doing, we're going to
      follow their lead.

      But we're going to wire that up in the next tutorial. For now, you should
      have a simple page page, rendering "Hello World!", with a CSS file and a
      script that outputs `3` to the console. Next, we're going to write our
      first React component, render it on the server, and bootstrap our
      application.

      <FootnoteDefinition id="1">
        In the next version of WP-Gistpen, the settings page is built with React & RxJS.
      </FootnoteDefinition>
    _template: richText
excerpt: >
  React.js has pretty well skyrocketed through the JavaScript community since
  its initial announcement, and with its reactive approach to UI, there’s been a
  growing interest in functional programming in the JavaScript community as a
  result. Because JavaScript allows you to pass functions around like objects,
  it makes it very easy to apply functional concepts to \[…]
featuredMedia: content/media/observe-all-the-things-with-rxjs.md
categories:
  - reference: content/categories/web-development.md
_template: standard
---

repository: mAAdhaTTah/frontend

gha_language: JavaScript

gha_license_id: MIT

repo_name: mAAdhaTTah/frontend


text:
outer
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Computes the [outer product](https://en.wikipedia.org/wiki/Outer_product).

The outer product between two vectors `x` and `y` is denoted as x ⊗ y and is equivalent to the matrix multiplication `x y^t`. For a vector `x` of length *M* and `y` of length *N*, it is equal to

## Installation

``` bash
$ npm install compute-outer
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).

## Usage

``` javascript
var outer = require( 'compute-outer' );
```

#### outer( x, y[, opts] )

Computes the outer product between `x` and `y`. `x` and `y` have to either [`numbers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [`arrays`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or [`typed arrays`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). Passing a single number either as `x` or `y` will be treated as when passing a vector of length one. The function returns a [`matrix`](https://github.com/dstructs/matrix) with *M* rows and *N* columns, where *M* is the length of `x` and *N* the length of `y`.

``` javascript
outer( [ 1, 2, 3], 2 )
/*
	[ 2
	  4
	  6 ]
*/
outer( 2, [ 1, 2, 3] )
/*
	[ 2 4 6 ]
*/

outer( [ 2, 4 ], [ 1, 3 ] )
/*
	[ 2  6
	  4 12 ]
*/
```

The function accepts the following two `options`:

* 	__accessor__: accessor `function` for accessing `array` values.
* 	__dtype__: output [`matrix`](https://github.com/dstructs/matrix) data type. Default: `float64`.

For object `arrays`, provide an accessor `function` for accessing `array` values.

``` javascript
var data = [
	['beep', 5],
	['boop', 3],
	['bip', 8],
	['bap', 3],
	['baz', 2]
];

function getValue( d, i ) {
	return d[ 1 ];
}

var out = outer( data, 2, {
	'accessor': getValue
});
/*
	[ 10
	   6
	  16
	   6
	   4 ]
*/
```

When calculating the outer product between two object `arrays`, provide an accessor `function` which accepts `3` arguments.

``` javascript
var data = [
	['beep', 2],
	['boop', 4],
];

var arr = [
	{'x': 1},
	{'x': 3},
];

function getValue( d, i, j ) {
	if ( j === 0 ) {
		return d[ 1 ];
	}
	return d.x;
}

var out = outer( data, arr, {
	'accessor': getValue
});
/*
	[ 2  6
	  4 12 ]
*/
```

__Note__: `j` corresponds to the input `array` index, where `j=0` is the index for the first input `array` and `j=1` is the index for the second input `array`.

By default, the output data structure is `float64` in order to preserve precision. To specify a different data type, set the `dtype` option (see [`matrix`](https://github.com/dstructs/matrix) for a list of acceptable data types).

``` javascript
var data, out;

out = outer( [1,2,3], 2, {
	'dtype': 'int32'
});
/*
	[ 2
	  4
	  6 ]
*/

out.dtype === 'int32'
// returns true
```

## Examples

``` javascript
var outer = require( 'compute-outer' );

var data,
	out,
	i;

// Plain arrays...
data = new Array( 10);
for ( i = 0; i < data.length; i++ ) {
	data[ i ] = i;
}
out = outer( data, data );

// Object arrays (accessors)...
function getValue( d ) {
	return d.x;
}
for ( i = 0; i < data.length; i++ ) {
	data[ i ] = {
		'x': data[ i ]
	};
}
out = outer( data, data, {
	'accessor': getValue
});

// Typed arrays...
data = new Int32Array( 10 );
for ( i = 0; i < data.length; i++ ) {
	data[ i ] = i;
}
out = outer( data, data );
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

## Tests

### Unit

Unit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.

### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ make view-cov
```

---
## License

[MIT license](http://opensource.org/licenses/MIT).

## Copyright

Copyright © 2015. The [Compute.io](https://github.com/compute-io) Authors.

[npm-image]: http://img.shields.io/npm/v/compute-outer.svg
[npm-url]: https://npmjs.org/package/compute-outer

[travis-image]: http://img.shields.io/travis/compute-io/outer/master.svg
[travis-url]: https://travis-ci.org/compute-io/outer

[coveralls-image]: https://img.shields.io/coveralls/compute-io/outer/master.svg
[coveralls-url]: https://coveralls.io/r/compute-io/outer?branch=master

[dependencies-image]: http://img.shields.io/david/compute-io/outer.svg
[dependencies-url]: https://david-dm.org/compute-io/outer

[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/outer.svg
[dev-dependencies-url]: https://david-dm.org/dev/compute-io/outer

[github-issues-image]: http://img.shields.io/github/issues/compute-io/outer.svg
[github-issues-url]: https://github.com/compute-io/outer/issues

repository: compute-io/outer

repo_name: compute-io/outer


text:
# Krinkle Dotfiles: Primary workstation

See the **[install](./install#blob-path)** file for the automated provisions.

Additional setups and workflows documented below.

## Screenshots

## SSH Key

See <https://help.github.com/articles/generating-ssh-keys>.

## GPG key

* https://help.github.com/articles/generating-a-new-gpg-key/
* https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account/
* https://help.github.com/articles/telling-git-about-your-gpg-key/

## Development

### Checkouts

```
mkdir -p ~/Development

cd ~/Development
doclonegerrit mediawiki/core mediawiki
doclonegerrit oojs/core
doclonegerrit oojs/ui
doclonegerrit integration/config wikimedia/integration-config
doclonegerrit operations/mediawiki-config wikimedia/operations-mediawiki-config
doclonegerrit operations/puppet wikimedia/puppet
doclonegerrit operations/debs/wmf-sre-laptop wmf-sre-laptop

doclonegerrit cdb
doclonegerrit jquery-client
doclonegerrit mediawiki/libs/less.php less.php
doclonegerrit mediawiki/libs/node-cssjanus node-cssjanus
doclonegerrit mediawiki/libs/php-cssjanus php-cssjanus
doclonegerrit RelPath
doclonegerrit RunningStat
doclonegerrit WrappedString
doclonegerrit mediawiki/libs/Minify
doclonegerrit mediawiki/libs/ScopedCallback
doclonegerrit mediawiki/libs/Timestamp
doclonegerrit mediawiki/libs/WaitConditionLoop
doclonegerrit mediawiki/php/excimer

cd ~/Development/mediawiki/skins
doclonegerrit mediawiki/skins/Vector
doclonegerrit mediawiki/skins/MonoBook

cd ~/Development/mediawiki/extensions
doaddwmext AbuseFilter
doaddwmext CategoryTree
doaddwmext Cite
doaddwmext CiteThisPage
doaddwmext CodeEditor
doaddwmext EventLogging
doaddwmext EventStreamConfig
doaddwmext examples
doaddwmext Gadgets
doaddwmext Interwiki
doaddwmext NavigationTiming
doaddwmext ParserFunctions
doaddwmext TemplateData
doaddwmext WikimediaEvents

# Copy and ignore
cp $KDF_BASE_DIR/hosts/primary/mw-LocalSettings.php ~/Development/mediawiki/LocalSettings.mine.php
echo LocalSettings.mine.php >> .git/info/exclude
```

## Applications

Install via App Store:

* Affinity Photo
* Mini Calendar
* Pixelmator
* Simplenote
* Skitch
* Telegram
* The Unarchiver
* Time Out

Install (other):

* 1Password
* Carbon Copy Cloner
* coconutBattery
* Firefox
* Google Chrome
* GPG Suite (GPG Keychain)
* ImageOptim
* KeeWeb
* Little Snitch
* Logitech Options
* NetNewsWire (+Feedbin)
* OpenOffice
* PhpStorm
* Podman Desktop
* Proton VPN
* Sublime Text
* VLC

### 1Password

OpenJS Foundation:

* username + password + "Recovery Kit.pdf" (server + key)

### Carbon Copy Cloner

Settings / Dashboard:

* (disabled) Show CCC's icon in the menu bar.

Tasks:

* Import Tasks... from backed up `.ccctask` file.

### Podman Desktop

* (enabled) docker-compose binary system wide
* Podman machine: 4 CPU, 4 GB mem, 40 GB disk

### 🌱 Fresh

Install from <https://gerrit.wikimedia.org/g/fresh>.

### Finder

Finder Preferences -> General:

* New Finder windows show: Home directory.

Finder Preferences -> Sidebar:

* (disabled) Favourites / Recents.
* (enabled) Favourites / (all others).
* (disabled) iCloud Drive.
* (disabled) Locations / My Computer.
* (disabled) Locations / CDs (includes "Remote Disc" placeholder)
* (enabled) Locations / (all others).
* (disabled) Tags.

Desktop / View:

* Sort By: Snap to Grid (enabled).

### Firefox

Preferences -> Search:

* Default search engine: DuckDuckGo.

Preferences -> Home:

* (enabled) Web search
* (disabled) Shortcuts
* (disabled) Recommended by Pocket
* (disabled) Recent activity

Preferences -> Security:

* (disabled) Ask to save logins and passwords.

Advanced Preferences (`about:config`):

* (enabled) `view_source.wrap_long_lines` _(match Chromium's default behaviour)_
* (change from 3 to 1) `mousewheel.with_meta.action` _(avoid unexpected page zoom action when scrollwheel is still spinning and holding down cmd key for something else; [source](https://support.mozilla.org/en-US/questions/953341))_

Toolbar:

* (Remove from Toolbar) Pocket

Sync:

* (enabled) Bookmarks.

Plugins:

* Wayback Machine
* WikimediaDebug

### Gmail

Settings -> General:

* (enabled) Keyboard shortcuts on. _This allows quick keyboard-based processing of issue tracker and code review messages. By pressing `#` (Shift-3)._

Settings -> Advanced:

* (enabled) Custom keyboard shortcuts. _Google hasn't considered non-American keyboards. As such, the shortcut for `Delete` is non-functional on British English keyboards. Neither Shift-3 (£), nor Shift-Alt-3 (#) works. But you can make it work by adding `£` as custom second shortcut for `Delete`. After enabling this feature, you have to save settings and reload the page before it works. Then, under "Setttings -> Keyboard Shortcuts" add `£` in the second column for "Delete", and again, save and reload before it works. Happy deleting!_

### GPG Suite

System Preferences / GPG Suite / Settings:

* (disabled) Store in macOS Keychain.

### KeeWeb

Settings / General / Function:

* (enabled) Automatically save and sync periodically.
* (enabled) Clear cipboard after copy: In a minute.
* (enabled) Minimize the app instead of close.

Settings / General / Auto lock:

* (enabled) When the computer is locked or put to sleep.

### Little Snitch

Preferences:

* Preselected Options / Rule Lifetime: For 10 minutes.
* (enabled) Confirm with Return or Escape

### Logitech Options

MX Master / Mouse:

* Scroll wheel button: None.
* Middle button ("Manual switch"): Look Up.
* Thumb wheel: Horizontal scroll.
* Thumb forward: Click.
* Thumb back: Right click.
* Thumb pad button: None.

MX Master / Point & Scroll:

* Scroll direction: Standard.
* Smooth scrolling: Disabled.
* SmartShift: Disabled.
* Scroll wheel mode: Free spin.

Logitech Options "Plus" regressions:

* "Look Up" missing.
  * Workaround: keyboard shortcut "ctrl-cmd-D" ([Reddit source](https://old.reddit.com/r/logitech/comments/tfyu5i/look_up_action_disappeared_in_logi_options_beta/))
* "Click" mapping no longer holds (e.g. for dragging in drag-and-drop, or to move/resize a window), when mapping "Thumb forward" to "Click" (via Advanced click).
  * Workaround: N/A. Use regular mouse buttons, and pray you don't get RSI.
  * Reports:
    [Reddit 1](https://old.reddit.com/r/logitech/comments/14y3nxr/mx_master_2s_side_buttons_no_click_and_hold/),
    [Reddit 2](https://old.reddit.com/r/logitech/comments/z3jjyc/bring_back_left_click_for_buttons_in_options/),
    [Reddit 3](https://old.reddit.com/r/logitech/comments/wiyowd/altshiftctrl_click_functions_on_mx3/),
    [Logi 1](https://support.logi.com/hc/en-gb/community/posts/9037143525655-Logi-Option-advanced-click-can-t-be-holded),
    [Logi 2](https://support.logi.com/hc/en-us/community/posts/360032668873-Click-and-Hold),
    [Logi 3](https://support.logi.com/hc/en-us/community/posts/360032391954-Logitech-Options-Advanced-Click),
    [Logi 4](https://support.logi.com/hc/en-gb/community/posts/360044026454-No-Advanced-Middle-Click-for-Mac-OS-Logi-Options).

### Messages app

Preferences:

* (disabled) Play sound effects.
* Keep messages: One Year (default: Forever).

### Music app

View:

* (enabled) Show Status Bar.

Settings > General:

* (disabled) Show "Apple Music".
* (disabled) Notifications "When song changes".

### PhpStorm

License:

* Import offline activation key.
* Or recover via JetBrains account
* Or obtain via <https://office.wikimedia.org/wiki/JetBrains> (restricted)

### Simplenote

View:

* Notes List / Note Display: Condensed.
* Notes List / Sort Order: Alphabetical.

### Safari

View:

* (enabled) Show Status Bar

Preferences -> General:

* Safari opens with: "A new window".
* New windows: "Empty page".
* New tabs: "Empty page".
* (disabled) Open safe files after downloading.

Preferences -> AutoFill:

* (disabled) Everything.

Preferences -> Search:

* Search engine: DuckDuckGo
* (disabled) Preload Top Hit in the background.

Preferences -> Advanced:

* (enabled) Pressing Tab will highlight each item on a webpage.

### Skitch

Preferences:

* (disabled) Auto-expand canvas.

### Sublime Text

* Install Package Control (via cmd-P).

Plugins:

* EditorConfig
* Less
* Puppet
* Theme - Soda
* TrailingSpaces

### System Preferences

Apple ID:
* (enabled) Messages
* (enabled) FaceTime
* (enabled) iCloud > Find My Mac
* (disabled) Everything else, including:
  * Optimise Mac Storage
  * Photos
  * Keychain
  * Access iCloud Data on the Web

Trackpad:

* (enabled) Tap to click
* (disabled) Mission Control
* (disabled) App Expose
* (disabled) Launchpad
* (disabled) Show Desktop

Accessibility -> Mouse & Trackpad -> Trackpad Options:

* (enabled) Enable dragging by "three finger drag".

Date & Time -> Clock:

* (enabled) Show date.

Dock:

* (disabled) Show recent applications in Dock.

Internet Accounts:

* (enabled) Fastmail / Contacts.

Keyboard -> Text:

* (disabled) Correct spelling automatically.
* (disabled) Use smart quotes. _(Sorry, I do I love these but, the vast majority
  of text areas it affects I may end up writing code in; Besides, any context
  in which I write "properly" already supports this own its own without OS support)_
* (disabled) Add full stop with double-space.

Keyboard -> Shortcuts -> Mission Control:

* (disabled) Mission Control - "^↑" (These interfere with Sublime Text selection expansion shortcuts, `Shift ctrl ↑` and `Shift ^ ↓`.):
* (disabled) Application Windows - "^↓"

Desktop & Dock -> Mission Control:

* (disabled) Automatically rearrange Spaces based on most recent use.
* (enabled) When switching to an application, switch to a Space with open windows for the application.
  See also <https://apple.stackexchange.com/a/44801/33762>.

Desktop & Dock -> Hot Corners:

* (enabled) Top left: Desktop.
* (enabled) Top right: Mission Control.

Lock Screen:

* Turn display off on battery after: 20 minutes.
* Turn display off on power adapter after: 1 hour.
* (enabled) Require password after screen saver or display is turned off. After: "immediately".

Sharing:

* Computer Name: `krinkle-mbp#`

Spotlight -> Search results:

* (disabled) Spotlight Suggestions
* (disabled) Allow Spotlight Suggestions in Look Up

Spotlight -> Privacy:

* Prevent indexing of: `~/Development` (performance reasons).

Time Machine:

* Exclude: `~/Development`.
* Exclude: `~/Downloads`.

Trackpad -> More Gestures:

* (disabled) Swipe between pages.
* (enabled) Swipe between spaces by "swipe sideways with **four** fingers. _(Keep "three fingers" reserved for dragging.)_
* (disabled) Mission Control. _(Triggered via Hot Corners instead. Keep "three fingers" reserved for dragging.)_

### Terminal app

Preferences -> Profiles:

* Pro

Preferences -> Profiles -> Text:

* Font: Menlo Regular 12pt.
* Cursor: Vertical Bar
* (enabled) Blink cursor

Preferences -> Profiles -> Window:

* (enabled) **Working directory**
* (enabled) **Working directory path**
* (enabled) **Active process name**
* (disabled) Arguments

Preferences -> Profiles -> Tab:

* (enabled) **Working directory**
* (disabled) Working directory path
* (disabled) Active process name
* (disabled) Arguments

### Thunderbird

Accounts:

* Set up Fastmail.

Accounts -> Folders -> Archive options:

* When archiving messages, place them in: A single folder (default: Yearly archived folders).

Accounts -> Junk:

* (disable) Enable adaptive junk mail controls.

Settings > Composition:

* (disabled) Automatically add outgoing email addresses to my address book.

Settings -> Chat:

* (disabled) Let my contacts know that I am idle.
* (disabled) Send typing notifications.

Add-ons Manager / Extensions:

* [tbkeys-lite](https://addons.thunderbird.net/en-US/thunderbird/addon/tbkeys-lite/) ([source](https://github.com/wshanks/tbkeys))
  * `"#": "cmd:cmd_delete"`

Advanced Preferences:

* Change default sort order from Asc (1) to Desc (2).
  https://superuser.com/a/13551/164493
  `mailnews.default_sort_order=2`

* Make "Get new messages" do what it says. Change from `false` to `true`.
  https://superuser.com/a/108756/164493
  `mail.server.default.check_all_folders_for_new`

### VLC

VLC 3.0.18 (macOS 13.4 Ventura) fails to render subtitle text in
HiDPI (Retina) resolution. https://code.videolan.org/videolan/vlc/-/issues/27793

Workaround:
* Settings > Show All > Video > Output modules: "Mac OS X OpenGL video output"

repository: Krinkle/dotfiles

repo_name: Krinkle/dotfiles


text:
[![PyPI
version](https://badge.fury.io/py/pydivsufsort.svg)](https://badge.fury.io/py/pydivsufsort) [![Build
Status](https://travis-ci.com/louisabraham/pydivsufsort.svg?branch=master)](https://travis-ci.org/louisabraham/pydivsufsort) [![Coverage](https://codecov.io/gh/louisabraham/pydivsufsort/branch/master/graph/badge.svg)](https://codecov.io/gh/louisabraham/pydivsufsort)

# `pydivsufsort`: bindings to libdivsufsort

`pydivsufsort` prebuilds `libdivsufsort` as a shared library and
includes it in a Python package with bindings.

**Features**:

- bindings to `divsufsort` that return numpy arrays
- handle almost any integer data type (e.g. `int64`) and not only `char`
- additional string algorithms

## Installation

On Linux, macOS and Windows:

```
python -m pip install pydivsufsort
```

We provide precompiled wheels for common systems using `cibuildwheel`, and a source distribution for Unix systems. Manual compilation on Windows might require some tweaking, please create an issue.

## Usage

### Using String Inputs

```python
import numpy as np
from pydivsufsort import divsufsort, kasai

string_inp = "banana$"
string_suffix_array = divsufsort(string_inp)
string_lcp_array = kasai(string_inp, string_suffix_array)
print(string_suffix_array, string_lcp_array)
# [6 5 3 1 0 4 2] [0 1 3 0 0 2 0]
```

### Using Integer Inputs

```python
import numpy as np
from pydivsufsort import divsufsort, kasai

string_inp = "banana$"

# Convert the string input to integers first
int_inp = np.unique(np.array(list(string_inp)), return_inverse=True)[1]
int_suffix_array = divsufsort(int_inp)
int_lcp_array = kasai(int_inp, int_suffix_array)
print(int_suffix_array, int_lcp_array)
# [6 5 3 1 0 4 2] [0 1 3 0 0 2 0]
```

### Using Multiple Sentinel Characters Witin A String

```python
import numpy as np
from pydivsufsort import divsufsort, kasai

sentinel_inp = "a$banana#and@a*bandana+"
sentinel_suffix_array = divsufsort(sentinel_inp)
sentinel_lcp_array = kasai(sentinel_inp, sentinel_suffix_array)
print(sentinel_suffix_array, sentinel_lcp_array)
# [ 8  1 14 22 12  7  0 13 21  5 19  3  9 16  2 15 11 18  6 20  4 10 17] [0 0 0 0 0 1 1 1 1 3 3 2 3 0 3 0 1 0 2 2 1 2 0]
```

## Testing

```
pytest
```

## Technical details (for performance tweaks)

`libdivsufsort` is compiled in both 32 and 64 bits, as [the 32 bits version is faster](https://github.com/y-256/libdivsufsort/issues/21). `pydivsufsort` automatically chooses to use the 32 bits version when possible (aka when the input size is less than `2**31-1`).

For best performance, use contiguous arrays. If you have a sliced array, pydivsufsort converts it automatically with [`numpy.ascontiguousarray`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.ascontiguousarray.html).

The precompiled libraries use OpenMP. You can disable it by setting the env variable `OMP_NUM_THREADS=1`, and it will yield the same performance as the version compiled without OpenMP

The original `libdivsufsort` only supports char as the base type. `pydivsufsort` can handle arrays of any integer type (even signed), by encoding each element as multiple chars, which makes the computation slower. If your values use an integer type that is bigger than required, but they span over a small contiguous range, `pydivsufsort` will automatically change their type (see [#6](https://github.com/louisabraham/pydivsufsort/issues/6)).

## Acknowledgements

- [Yuta Mori](https://github.com/y-256) for writing [libdivsufsort](https://github.com/y-256/libdivsufsort)
- [Sean Law](http://seanlaw.github.io/) for initiating this project and contributing

repository: seanlaw/pydivsufsort

repo_name: seanlaw/pydivsufsort


text:
Today I learned

- Paradox of the Active User
>Users never read manuals but start using the software immediately. They are motivated to get started and to get their immediate task done: they don't care about the system as such and don't want to spend time up front on getting established, set up, or going through learning packages.

>The "paradox of the active user" is a paradox because users would save time in the long term by taking some initial time to optimize the system and learn more about it. But that's not how people behave in the real world, so we cannot allow engineers to build products for an idealized rational user when real humans are irrational: we must design for the way users actually behave.

- https://www.nngroup.com/articles/paradox-of-the-active-user/

repository: pandorasNox/til

repo_name: pandorasNox/til


text:
# Entry

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | The ID of the entry. | [optional]
**name** | **str** | The name of the entry. | [optional]
**parent_id** | **int** | The ID of the parent entry. | [optional]
**full_path** | **str** | The full path in the Laserfiche repository to the entry. | [optional]
**folder_path** | **str** | The path in the Laserfiche repository to the parent folder. | [optional]
**creator** | **str** | The name of the user that created this entry. | [optional]
**creation_time** | **datetime** | The creation time of the entry. | [optional]
**last_modified_time** | **datetime** | The last modification time of the entry. | [optional]
**entry_type** | **OneOfEntryEntryType** | The type of the entry. | [optional]
**is_container** | **bool** | A boolean indicating if this entry is a container object; it can have other entries as children. | [optional]
**is_leaf** | **bool** | A boolean indicating if this entry is a leaf object; it cannot have other entries as children. | [optional]
**template_name** | **str** | The name of the template assigned to this entry. | [optional]
**template_id** | **int** | The id of the template assigned to this entry. | [optional]
**template_field_names** | **list[str]** | The names of the fields assigned to the template assigned to this entry. | [optional]
**volume_name** | **str** | The name of the volume that this entry is associated with. | [optional]
**fields** | [**list[FieldValue]**](FieldValue.md) | The fields assigned to this entry. | [optional]
**tags** | [**list[WTagInfo]**](WTagInfo.md) | The tags assigned to this entry. | [optional]
**links** | [**list[WEntryLinkInfo]**](WEntryLinkInfo.md) | The links assigned to this entry. | [optional]
**row_number** | **int** | Row number assigned to this entry in the listing. | [optional]
**properties** | **dict(str, object)** |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
# Hardware

## Central components
- 1 x Raspberry Pi 3 Starter Kit (80€)
    * Hub for home assistant
    * https://geizhals.at/raspberry-pi-3-modell-b-a1436432.html

## Doors
- Electrical Locks (10.50€)
  * Used to secure the doors
  * https://de.aliexpress.com/item/Stainless-Door-12V-DC-Fail-Safe-NO-Narrow-type-Door-Electric-Strike-Lock-For-Access-Control/32797143296.html

- Wemos D1 Mini (3.50€)
  * To control the locks
  * https://de.aliexpress.com/store/product/D1-mini-Mini-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266/1331105_32529101036.html

- Wemos D1 Relay (1.80€)
  * To be able to plug the lock into the wemos
  * https://de.aliexpress.com/store/product/Relay-Shield-for-WeMos-D1-mini-button/1331105_32596395175.html

- NFC Module - MFRC522 (3.30€)
  * To read the cards to grant access
  * Works with the wemos
  * https://de.aliexpress.com/item/Compact-RFID-Reader-Writer-and-NFC-module-MFRC522-13-56MHz-Power-5V-3-3V-For-Arduino/32667518116.html

repository: alghammariosmah/ulnoiot

repo_name: alghammariosmah/ulnoiot


text:
---
title: Alloy How-tos
weight: '30'
---

# Alloy How-tos

This chapter has several sections dedicated to how-to instructions for Alloy.

* [Alloy Best Practices and Recommendations](/guide/Alloy_Framework/Alloy_How-tos/Alloy_Best_Practices_and_Recommendations/)

* [Alloy Debugging and Troubleshooting](/guide/Alloy_Framework/Alloy_How-tos/Alloy_Debugging_and_Troubleshooting/)

* [Alloy Reference Guides](/guide/Alloy_Framework/Alloy_How-tos/Alloy_Reference_Guides/)

* [Alloy Samples](/guide/Alloy_Framework/Alloy_How-tos/Alloy_Samples/)

repository: sgtcoolguy/titanium-docs

repo_name: sgtcoolguy/titanium-docs


text:
## Transition

Define transition animation for entering and leaving

* [→ CodePen](https://codepen.io/omijs/pen/JjYyezQ)

## Import

```js
import '@omiu/transition'
```

Or use script tag to ref it.

```html
<script src="https://unpkg.com/@omiu/transition"></script>
```

## Usage

```html
<o-transition></o-transition>
```

## API

### Props

```tsx
{
  name: string
  leavingTime?: number
  autoRemove?: boolean
}
```

### 默认属性

```tsx
{
  name: 'o'
}
```
### Events

* BeforeEnter
* beforeEnter
* AfterEnter
* afterEnter
* enter
* BeforeLeave
* beforeLeave
* AfterLeave
* afterLeave
* leave

repository: Tencent/omi

gha_license_id: NOASSERTION

repo_name: Tencent/omi


text:
Floyd.js
========

Floyd.js is an extremely simple, yet versatile cycle-detection library in JS. It (surprisingly) implements a version of [Floyd's algorithm](http://dl.acm.org/citation.cfm?doid=321420.321422).

Installation
------------

Grab it directly from Github by cloning or install it with NPM:

```bash
npm install floyd
```

Usage
-----

Floyd.js is usually called through its `detectCycles` function.

### `detectCycles(path, [options])`

This function takes a path and an optional options object.

A _path_ is an array comprised of nodes. Each node exposes a set of outgoing edges, referencing the indices of other nodes in the path.

A _node_ can either be an array of indices directly, or be an object exposing them through a property.

### Examples

A simple number path:

```javascript
// (0) -> (1) -> (2) -> (3) -> (0)
var numberPath = [1, 2, 3, 0];

floyd.detectCycles(numberPath);
// => [ { firstIndex: 0, stepsFromStart: 0, length: 5 } ]
```

Each node being an array of out-edges:

```javascript
var arrayPath = [
    [1, 3],
    [2],
    [3],
    [1],
];

floyd.detectCycles(arrayPath);
// => [ { firstIndex: 3, stepsFromStart: 1, length: 3 } ]
```

Each node being an object with out-edges exposed in a property:

```javascript
var disconnectedPath = [
    {'out': [1]},
    {},
    {'out': [3]},
    {'out': [2]},
];

floyd.detectCycles(disconnectedPath);
// => [ { firstIndex: 2, stepsFromStart: 2, length: 2 } ]
```

Each node being an object comprised of both in-edges and out-edges, and non-default property names:

```javascript
var complexPath = [
    {},
    {'incoming': [3], 'outgoing': [2, 3]},
    {'incoming': [3]},
    {'incoming': [0], 'outgoing': [3]},
    {'incoming': [1], 'outgoing': [1]},
];

floyd.detectCycles(complexPath, {
    outNodePropertyName: 'outgoing',
    inNodePropertyName: 'incoming',
    normalizePath: true
});
// => [ { firstIndex: 3, stepsFromStart: 2, length: 1 } ]
```

The path being an object with arbitrary edge keys:

```javascript
var objectGraph = {
    object1: ['object2'],
    object2: ['object3'],
    object3: ['object1'],
};

floyd.detectCycles(objectGraph);
// => [ { firstKey: 'object1', stepsFromStart: 0, length: 3 } ]
```

Options
-------

The following default options apply:

```javascript
{
    outEdgePropertyName: 'out',
    inEdgePropertyName: 'in',
    normalizePath: false
}
```

Known Issues
------------

* When several cycles partially overlap, not all of them will be returned. Usually in such cases, the shortest cycle (from the start node) is returned.

repository: myrlund/floyd

repo_name: myrlund/floyd


text:
# Changelog

All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v4.1.0](https://github.com/voxpupuli/puppet-windows_firewall/tree/v4.1.0) (2022-06-03)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v4.0.0...v4.1.0)

**Implemented enhancements:**

- Integrate with hiera for creation of exceptions [\#127](https://github.com/voxpupuli/puppet-windows_firewall/pull/127) ([bahner](https://github.com/bahner))
- \(GH-121\) Add support for puppet 7.x [\#122](https://github.com/voxpupuli/puppet-windows_firewall/pull/122) ([TraGicCode](https://github.com/TraGicCode))

**Closed issues:**

- Add support for puppet 7.x [\#121](https://github.com/voxpupuli/puppet-windows_firewall/issues/121)

**Merged pull requests:**

- Dependency and Support Bump [\#129](https://github.com/voxpupuli/puppet-windows_firewall/pull/129) ([trevor-vaughan](https://github.com/trevor-vaughan))
- Allow stdlib 8.0.0 [\#119](https://github.com/voxpupuli/puppet-windows_firewall/pull/119) ([smortex](https://github.com/smortex))
- Update README.md to include instruction on how to remove a rule [\#118](https://github.com/voxpupuli/puppet-windows_firewall/pull/118) ([mike406](https://github.com/mike406))

## [v4.0.0](https://github.com/voxpupuli/puppet-windows_firewall/tree/v4.0.0) (2021-03-20)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v3.0.0...v4.0.0)

**Breaking changes:**

- Drop Puppet 5; require Puppet 6.1.0 [\#114](https://github.com/voxpupuli/puppet-windows_firewall/pull/114) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- Fixing display\_name to default to the resource title [\#113](https://github.com/voxpupuli/puppet-windows_firewall/pull/113) ([msiroskey](https://github.com/msiroskey))
- Fix truncated verification [\#107](https://github.com/voxpupuli/puppet-windows_firewall/pull/107) ([JasonN3](https://github.com/JasonN3))

**Closed issues:**

- remote\_port and local\_port should also support string for comma-separated port list or dash-separated port range. [\#80](https://github.com/voxpupuli/puppet-windows_firewall/issues/80)

**Merged pull requests:**

- Local and Remote port range and csv \#80 [\#106](https://github.com/voxpupuli/puppet-windows_firewall/pull/106) ([sbezzy](https://github.com/sbezzy))
- Fixed provider for making changes via Puppet [\#104](https://github.com/voxpupuli/puppet-windows_firewall/pull/104) ([Nekototori](https://github.com/Nekototori))
- Make more use of data types [\#103](https://github.com/voxpupuli/puppet-windows_firewall/pull/103) ([alexjfisher](https://github.com/alexjfisher))

## [v3.0.0](https://github.com/voxpupuli/puppet-windows_firewall/tree/v3.0.0) (2020-07-30)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v2.0.2...v3.0.0)

**Breaking changes:**

- modulesync 2.7.0 and drop puppet 4 [\#88](https://github.com/voxpupuli/puppet-windows_firewall/pull/88) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- New Provider with Types and Docs [\#89](https://github.com/voxpupuli/puppet-windows_firewall/pull/89) ([alexjfisher](https://github.com/alexjfisher))

**Fixed bugs:**

- Master O/S conditionals Completely Broken [\#66](https://github.com/voxpupuli/puppet-windows_firewall/issues/66)

**Closed issues:**

- Missing dependency puppetlabs-registry in PuppetForge version. [\#29](https://github.com/voxpupuli/puppet-windows_firewall/issues/29)

**Merged pull requests:**

- modulesync 3.0.0 & puppet-lint updates [\#101](https://github.com/voxpupuli/puppet-windows_firewall/pull/101) ([bastelfreak](https://github.com/bastelfreak))
- Bump puppetlabs/registry [\#99](https://github.com/voxpupuli/puppet-windows_firewall/pull/99) ([spotter-puppet](https://github.com/spotter-puppet))
- Allow puppetlabs/stdlib 6.x [\#98](https://github.com/voxpupuli/puppet-windows_firewall/pull/98) ([dhoppe](https://github.com/dhoppe))
- Remove duplicate CONTRIBUTING.md file [\#94](https://github.com/voxpupuli/puppet-windows_firewall/pull/94) ([dhoppe](https://github.com/dhoppe))
- Support puppetlabs/stdlib 6.x. [\#92](https://github.com/voxpupuli/puppet-windows_firewall/pull/92) ([pillarsdotnet](https://github.com/pillarsdotnet))
- removed operatingsystemversion and old os testing [\#90](https://github.com/voxpupuli/puppet-windows_firewall/pull/90) ([Nekototori](https://github.com/Nekototori))
- Remove Linux acceptance nodesets [\#84](https://github.com/voxpupuli/puppet-windows_firewall/pull/84) ([ekohl](https://github.com/ekohl))

## [v2.0.2](https://github.com/voxpupuli/puppet-windows_firewall/tree/v2.0.2) (2018-10-19)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v2.0.1...v2.0.2)

**Fixed bugs:**

- Documentation is not updated for new puppet 4 data types [\#65](https://github.com/voxpupuli/puppet-windows_firewall/issues/65)

**Closed issues:**

- Update documentation for changed attribute data types [\#79](https://github.com/voxpupuli/puppet-windows_firewall/issues/79)

**Merged pull requests:**

- modulesync 2.2.0 and allow puppet 6.x [\#82](https://github.com/voxpupuli/puppet-windows_firewall/pull/82) ([bastelfreak](https://github.com/bastelfreak))
- example and param doc update [\#81](https://github.com/voxpupuli/puppet-windows_firewall/pull/81) ([joeypiccola](https://github.com/joeypiccola))
- allow puppetlabs/stdlib 5.x [\#77](https://github.com/voxpupuli/puppet-windows_firewall/pull/77) ([bastelfreak](https://github.com/bastelfreak))

## [v2.0.1](https://github.com/voxpupuli/puppet-windows_firewall/tree/v2.0.1) (2018-08-20)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v2.0.0...v2.0.1)

**Fixed bugs:**

- Remove hardcoded c drive reference for firewall exceptions [\#63](https://github.com/voxpupuli/puppet-windows_firewall/pull/63) ([TraGicCode](https://github.com/TraGicCode))

**Closed issues:**

- Update puppetlabs-registry module dependency [\#72](https://github.com/voxpupuli/puppet-windows_firewall/issues/72)
- Don't  working when Windows installed not on drive C:\ [\#52](https://github.com/voxpupuli/puppet-windows_firewall/issues/52)
- Use in-built Windows Facter facts [\#45](https://github.com/voxpupuli/puppet-windows_firewall/issues/45)
- liamjbennett/win\_facts module causes Registry errors [\#34](https://github.com/voxpupuli/puppet-windows_firewall/issues/34)
- fixing remote ports [\#22](https://github.com/voxpupuli/puppet-windows_firewall/issues/22)
- fix broken ensure=absent [\#21](https://github.com/voxpupuli/puppet-windows_firewall/issues/21)

**Merged pull requests:**

- allow puppetlabs/registry 2.x [\#74](https://github.com/voxpupuli/puppet-windows_firewall/pull/74) ([bastelfreak](https://github.com/bastelfreak))
- Remove docker nodesets [\#69](https://github.com/voxpupuli/puppet-windows_firewall/pull/69) ([bastelfreak](https://github.com/bastelfreak))
- drop EOL OSs; fix puppet version range [\#68](https://github.com/voxpupuli/puppet-windows_firewall/pull/68) ([bastelfreak](https://github.com/bastelfreak))
- Puppet 4+ data types to get rid of some validate\_re [\#61](https://github.com/voxpupuli/puppet-windows_firewall/pull/61) ([ofalk](https://github.com/ofalk))

## [v2.0.0](https://github.com/voxpupuli/puppet-windows_firewall/tree/v2.0.0) (2017-11-17)

[Full Changelog](https://github.com/voxpupuli/puppet-windows_firewall/compare/v1.1.0...v2.0.0)

**Merged pull requests:**

- bump puppet version dependency to \>= 4.7.1 \< 6.0.0 [\#58](https://github.com/voxpupuli/puppet-windows_firewall/pull/58) ([bastelfreak](https://github.com/bastelfreak))

## [v1.1.0](https://github.com/voxpupuli/puppet-windows_firewall/tree/v1.1.0) (2017-02-11)

This is the last release with Puppet3 support!
* Fix several markdown issues
* Add missing badges
* Fix several rubocop issues
* Set min version_requirement for Puppet + bump deps
* Rubocop: automatic fixes

## 2016-05-08 Release 1.0.3

* modulesync with voxpupuli defaults

## 2016-02-03 Release 1.0.2

* Added support for matching remote ports

## 2015-07-23 Release 1.0.1

* Fixed rules not being deleted

## 2013-10-20 Release 0.0.3

* Add program rule support, various other fixes

## 2013-10-20 Release 0.0.2

* Some bug fixes and additional testing

## 2013-10-20 Release 0.0.1

* The initial version

\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

gha_language: Ruby


text:
# AudioInfo Tool
Shows audio file information. Supports MP3 and FLAC (under development).

### Installation

Until I have a PyPI package.

```
    $ git clone https://github.com/JuanjoSalvador/AudioInfo-Tool.git
    $ cd AudioInfo-Tool
    $ sudo pip install -r requirements.txt
    $ chmod +x ainfo.py
```

### Usage

```
 $ ./ainfo.py <option> /path/to/file
```

| Option | Description |
|--------|-------------|
| -t     | Shows only technical info |
| -f     | Shows all info available |
| -i     | Shows ID metatags |

Sample output for `ainfo -t ~/my.mp3`

```
    File: my.mp3
    Audio offset: 0
    Bitrate: 192 kbps
    Encoder: LAME 3.96.1+
    Filesize: 2184381
    Layer: 3
    Length: 1.52 minutes
    Mode: 1
    MPEG version: 1
```
### TO DO
* Create pip package
* Add more audio codecs
* Optimizing code

### License

MIT License

repository: JuanjoSalvador/AudioInfo-Tool

gha_language: Python

repo_name: JuanjoSalvador/AudioInfo-Tool


text:
# Jenkins Job DSL Gradle Example

An example [Job DSL](https://github.com/jenkinsci/job-dsl-plugin) project that uses Gradle for building and testing. Check out [this presentation](https://www.youtube.com/watch?v=SSK_JaBacE0) for a walkthrough of this example (starts around 14:00).

## File structure

    .
    ├── src
    │   ├── jobs                # DSL script files
    │   ├── main
    │   │   ├── groovy          # support classes
    │   │   └── resources
    │   │       └── idea.gdsl   # IDE support for IDEA
    │   ├── scripts             # scripts to use with "readFileFromWorkspace"
    │   └── test
    │       └── groovy          # specs
    └── build.gradle            # build file

# Script Examples

* [Example 1](src/jobs/example1Jobs.groovy) - shows basic folder/job creation
* [Example 2](src/jobs/example2Jobs.groovy) - shows how to create a set of jobs for each github branch, each in its own folder
* [Example 3](src/jobs/example3Jobs.groovy) - shows how to use the configure block
* [Example 4](src/jobs/example4Jobs.groovy) - shows a way to reuse job definitions for jobs that differ only with a few properties
* [Example 5](src/jobs/example5Jobs.groovy) - shows how to pull out common components into static methods
* [Example 6](src/jobs/example6Jobs.groovy) - shows how to include script resources from the workspace
* [Example 7](src/jobs/example7Jobs.groovy) - shows how to create jobs using builders
* [Example 8](src/jobs/example8Jobs.groovy) - shows how to use DSL extensions provided by other plugins

## Testing

`./gradlew test` runs the specs.

[JobScriptsSpec](src/test/groovy/com/dslexample/JobScriptsSpec.groovy)
will loop through all DSL files and make sure they don't throw any exceptions when processed. All XML output files are written to `build/debug-xml`.
This can be useful if you want to inspect the generated XML before check-in. Plugins providing auto-generated DSL must be added to the build dependencies.

If you prefer to stub the auto-generated DSL, you can use [JobScriptsSpecAlternative](src/test/groovy/com/dslexample/JobScriptsSpecAlternative.groovy),
though you may miss some syntax errors.

## Seed Job

You can create the example seed job via the Rest API Runner (see below) using the pattern `jobs/seed.groovy`.

Or manually create a job with the same structure:

* Invoke Gradle script
   * Use Gradle Wrapper: `true`
   * Tasks: `clean test`
* Process Job DSLs
   * DSL Scripts: `src/jobs/**/*Jobs.groovy`
   * Additional classpath: `src/main/groovy`
* Publish JUnit test result report
   * Test report XMLs: `build/test-results/**/*.xml`

Note that starting with Job DSL 1.60 the "Additional classpath" setting is not available when
[Job DSL script security](https://github.com/jenkinsci/job-dsl-plugin/wiki/Script-Security) is enabled.

## Other Resources

* [Job DSL Playground](http://job-dsl.herokuapp.com/) - App for debugging Job DSL scripts.
* [Job DSL API Viewer](https://jenkinsci.github.io/job-dsl-plugin/) - Full Job DSL syntax reference.
* [Job DSL REST Example](https://github.com/sheehan/job-dsl-rest-example) - Example that shows how to make Job DSL updates via the Jenkins REST API. Originally part of this repo, later split off.

#### Gradle Plugins
Plugins that automatically apply the functionality laid out in this example repo.
* [Gradle Job DSL Support Plugin](https://github.com/AOEpeople/gradle-jenkins-job-dsl-plugin) - Plugin for easy management of Jenkins Job DSL scripts with Gradle.
* [Gradle Jenkins Job DSL Plugin](https://github.com/heremaps/gradle-jenkins-jobdsl-plugin) - Plugin to manage Jenkins Job DSL projects in a Gradle project.

repository: sheehan/job-dsl-gradle-example

gha_language: Groovy

repo_name: sheehan/job-dsl-gradle-example


text:
# Personalized-Cancer-Diagnosis
**Description**

A lot has been said during the past several years about how precision medicine and, more concretely, how genetic testing is going to disrupt the way diseases like cancer are treated. Once sequenced, a cancer tumor can have thousands of genetic mutatio ns. But the challenge is distinguishing the mutations that contribute to tumor growth (drivers) from the neutral mutations (passengers). As not all mutations lead to cancer. Due to a mutation in a gene, there is some genetic variation developed in a gene. But the question comes, from which particular mutation this genetic variation happened in a gene. Currently this interpretation of genetic mutations is being done manually which is a very time-consuming task. Based on a gene and a variation in it, a clinical pathologist has to manually review and classify every single genetic mutation based on evidence from text-based clinical literature.

**Business Problem**

A molecular pathologist selects a list of genetic variations of interest that he/she want to analyze.
The molecular pathologist searches for evidence in the medical literature that somehow are relevant to the genetic variations of interest.
Finally, this molecular pathologist spends a huge amount of time analyzing the evidence related to each of the variations to classify them into any one of the 9 different classes. Our goal here is to replace step 3 by a machine learning model. The molecular pathologist will still have to decide which variations are of interest, and also collect the relevant evidence for them. But the last step, which is also the most time consuming, will be fully automated by a machine learning model.
Our goal here is to replace step 3 by a machine learning model. The molecular pathologist will still have to decide which variations are of interest, and also collect the relevant evidence for them. But the last step, which is also the most time consuming, will be fully automated by a machine learning model.

**Problem Statement**

Classify the given genetic variations/mutations based on evidence from text-based clinical literature. In this problem, we need to find the mutation-type given the gene, variation and some text data from published research.

**Source of Data**
Source: https://www.kaggle.com/c/msk-redefining-cancer-treatment/data Data: Memorial Sloan Kettering Cancer Center (MSKCC)

**Real-world/Business objectives and constraints.**

No low-latency requirement.

Interpretability is important.

Errors can be very costly.

Probability of a data-point belonging to each class is needed.

**Prerequisites**

Python 3

Anaconda: It will install ipython notebook and most of the libraries which are needed like sklearn, pandas, seaborn, matplotlib, numpy
and scipy.

mlxtend

Library used

ipython-notebook - Python Text Editor/Google colab

sklearn - Machine learning library

seaborn, matplotlib.pyplot, - Visualization libraries

numpy, scipy- number python library

pandas - data handling library

mlxtend - used for stacking the models

Done by- Author
Sai Krishna


text:
---
type: "inproceedings"
title: "Novel algebras for advanced analytics in Julia"
authors:
- Shah, Viral B.
- Edelman, Alan
- Karpinski, Stefan
- Bezanson, Jeff
- Kepner, Jeremy
year: "2013"
booktitle: "High Performance Extreme Computing Conference (HPEC), 2013 IEEE"
doi: "10.1109/HPEC.2013.6670347"
---
A linear algebraic approach to graph algorithms that exploits the sparse adjacency matrix representation of graphs can provide a variety of benefits. These benefits include syntactic simplicity, easier implementation, and higher performance. One way to employ linear algebra techniques for graph algorithms is to use a broader definition of matrix and vector multiplication. We demonstrate through the use of the Julia language system how easy it is to explore semirings using linear algebraic methodologies.


text:
## TellX

To use:
```
!tell ascii-soup Email me when you get this message please
```
The next time `ascii-soup` joins the `#phpoxford` channel he will receive
 a private message from Spires giving him the message you typed above.

repository: ascii-soup/spires-plugin-tellx

gha_language: PHP

repo_name: ascii-soup/spires-plugin-tellx


text:
# Lockr API Client

## Usage Overview

```php
$cert_path = '/path/to/lockr/client/cert.pem';
$partner_name = 'lockr partner name';
$region = 'us';

// Partner is the authentication unit for Lockr.
// $cert_path is the path to a PEM encoded x509 certificate
// provided by Lockr.
// $partner_name is the name of the partner to authenticate,
// usually 'custom' for certificates provided directly by Lockr.
// $region indicates where to store keys ('us' or 'eu')
$partner = new \Lockr\Partner($cert_path, $partner_name, $region);
$client = new \Lockr\Lockr($partner);

// SiteClient provides operations on a site.
$site_client = new \Lockr\SiteClient($client);

$status = $site_client->exists();

// KeyClient provides operations for keys.
$key_client = new \Lockr\KeyClient($client);

$key_client->set('my_key', 'secret key value', 'My Key');
$key_value = $key_client->get('my_key');
```

repository: lockr/lockr-client

repo_name: lockr/lockr-client


text:
---
title: Versioning
metaTitle: "sensenet API - Versioning"
metaDescription: "sensenet API - Versioning"
---

Versioning, also known as revision control, is the management of changes to documents and other information stored in a file system or repository. The main goal of versioning is to prevent information from being overwritten or deleted during everyday work with documents. Changes are kept track of, and a mechanism is offered to restore a particular document to a previous version.

The versioning system of sensenet also provides mechanisms for keeping the published version of a document under heavy editing visible to outside users, while you continue to work on the latest, draft version.

# Enable versioning

In sensenet, versioning is disabled by default. It can be enabled for folders or content lists, or even for individual contents by setting the value of the `Versioning Mode` field. (Subfolders inherit versioning settings by default.)

Versioning mode can be set as the followings:

| Name | Number | Description |
|-|-|-|
|**None**|0|The default setting of the Root folder, no versioning.|
|**Inherited**|1|The folder inherits its versioning mode from its parent. This is the default setting for all other content.|
|**Major only**|2|Only major versions (1.0, 2.0,...) are preserved.|
|**Major and minor**|3|Every version is preserved (1.0, 1.1, 1.2,...).|

With the following example you switch on versioning for a workspace:

<tab category="collaboration" article="versioning" example="enableVersioning" />

# Content states

Content in the repository can have several non-numeric version states:

| | | |
|-|-|-|
|A|APPROVED|Only a major version can be in approved state: 1.0A or 2.0A. The last approved version of the content is that users with low level permission can see.|
|L|LOCKED|When a content is locked, only the user who locked it can modify it.|
|D|DRAFT|A draft version is only visible to users who have permission to see minor versions of a content. Any other user will see the last public version.|
|P|PENDING|When approval is enabled in a folder or list, then contents cannot be published without approval.| After sending a content for approval it remains in pending for approval state, until somebody with sufficient rights approves it.|
|R|REJECTED|If a content is not correct, the user with approving rights can reject it. This means it is not published and should be refined.|

# Get current version of a content

Current version is always saved as a value of the field `Version` on every content. As you can see in the following code snippet you can get the current version number as any of the common field values:

<tab category="collaboration" article="versioning" example="versionNumber" />

# Get a specific version of a content

You can easily get a specific (older) version of a content knowing the actual version number. You can set it as a param of the OData url like in the next example:

<tab category="collaboration" article="versioning" example="specificVersion" />

# Checkout a content for edit

Following example shows you how to checkout (lock) a document:

<tab category="collaboration" article="versioning" example="checkout" />

# Checkin a content

With the next example you will checkin a document adding a checkin comment:

<tab category="collaboration" article="versioning" example="checkin" />

# How to know if a content is locked

If a content is checked out by someone it became locked for other users. Locked is also a field on every content so you can easily check if a content is locked or not. With the following code snippet you can find out if a content is locked and by whom it is locked:

<tab category="collaboration" article="versioning" example="locked" />

# Save a draft version

When versioning mode is set to 'Major and minor', you are able to work with draft versions. If you want to create a draft, save to content without publishing the changes (e.g. using the Publish action). You can save the content over and over again, until you use the publication, only draft versions are generated.

# Publish a new major version

As it is mentioned before using the Publish action makes a content public, creating its major version. In the next example you can see how to publish a document:

<tab category="collaboration" article="versioning" example="publish" />

# Undo changes

It can happen that you don't want publish your changes and you want to withdraw them. Using the next example you will be able to undo the changes that you've made on a content:

<tab category="collaboration" article="versioning" example="undoChanges" />

# Force undo changes

It is also possible to undo other users' changes on a document. This feature is really useful when somebody leave a content in checked out (locked) and does not able or willing to finish the work on the content. If you are allowed to do that (it can be set with permissions) with the next snippet you can undo changes made by another user and return to the previous version:

<tab category="collaboration" article="versioning" example="forceUndoChanges" />

# Take lock over

Following lets administrators take over the lock of a checked out document from another user. A new locker user can be provided using the 'user' parameter (user path or id as string). If left empty, the current user will take the lock.

<tab category="collaboration" article="versioning" example="takeLockOver" />

# Get version history of a content

You're able to get all the version history (current version, old minor and major versions, etc) related to a content at once. Following example shows you how:

<tab category="collaboration" article="versioning" example="versionHistory" />

# Restore an old version

It is also possible to recall an older version. In the next example you can see how you can restore a previous major version of a content:

<tab category="collaboration" article="versioning" example="recallVersion" />

<note>You must be allowed to restore previous versions having 'Recall old versions' permission allowed on the content.</note>

<!--# Delete an old version

Sometimes it could be useful to remove old versions, because if you're working on a content constantly creating tons of versions, it may increase the size of the database. With the following example you can remove a previous version:

<tab category="collaboration" article="versioning" example="deleteVersion" />

<note>You must be allowed to restore previous versions having 'Delete old versions' permission allowed on the content.</note>-->