text:
---
title: "Escaping Developer Nightmares"
layout: post
date: 2017-12-01 08:23 +0200
image: '/assets/images/posts-images/mindthegap.png'
description:
tag:
- java
- field notes
- software development
- english
category: blog
star: false
author: rustam.mehmandarov
---

_A short write up of the bad things we do in software development and some suggestions on how to fix them._

- [The Existing State of Affairs](#the-existing-state-of-affairs)
- [The Moving Parts](#the-moving-parts)
- [Conclusion](#conclusion)

---

Let's take a look into what we can do to achieve a better development environment than an average development project – a project that most of us have seen at some point in our professional lives, or maybe even are a part of right now. We will also look into some tools and patterns that will help us convert those projects into a paradise for the developers.

Just a few decades ago, we were working in ways that might look like unproductive, in the best case. Our development models were predominated by waterfalls, our IDEs were basic and we were compiling our projects by hand, using `javac`, or building up the `CLASSPATH` depending on the `GOTO` statements in a huge spaghetti code contained in countless `bat` files. Our code lived in a very simple versioning systems that were not distributed or supported branching strategies that are praised by the developers today. Our documentation lived in `doc` files on shared network drives, side by side with the simple issue tracking systems, that don't even get close to what we have today.

Today, it is all different – we have Git, real issue tracking, IDEs, all that integrated with build servers and collaborative platforms. Yes, everything is much better, more effective and user-friendly, one might think that we are in the paradise already? Well... yes, things are fortunately getting better, however, we are still doing things in a way that might still give you nightmares, several decades from now.

Last years I have been working and invited to evaluate and help with an audit of various projects. Here are some of my observations and thoughts.

## The Existing State of Affairs

This [tweet][10] describes it pretty well:

{% highlight text %}
YOU ARE IN A LEGACY CODEBASE
> RUN TESTS
YOU HAVE NO TESTS
> READ SPEC
YOU HAVE NO SPEC
> WRITE FIX
YOU ARE EATEN BY AN ELDER CODE HACK.
{% endhighlight %}

Some of the issues are, naturally, remnants of the past – the legacy systems; but even those systems and most of the other problems we see today can be avoided if we slightly change our view at some of the main parts of the development process. In most of the cases, we would be aware of those issues, but we might need to explain and motivate the others – often people are responsible for the projects and those who prioritize the development and maintenance backlog.

## The Moving Parts

The road to a great nightmare-free future consists of three components: the code quality, the development and build tools, and a good documentation and collaboration systems. When evaluating systems I often start asking some simple questions listed below to get an idea of the system.

### 1. The Code
#### The Code Quality

First thing off is the general code quality. I often start by asking about simple things – if the project has a coding standard, and if it is being followed. I also ask to take a quick peek at the code and check minor things like file encodings and MIME types. I also follow up with a question if the team is practicing code reviews, and how they are doing that.

While those things alone don't have to mean anything, and are minor issues individually, together with other factors they still are initial indicators of possible neglect. This gives me a possibility to map areas where to look further.

In addition to that, there are also some more specific parts that will be listed as sub-sections below.

#### The third-party libraries
The role of the third party libraries and their use is often forgotten and neglected when considering code and system quality. This is quite unfortunate as this is the part of the code that you might not be able to patch easily, and is harder to maintain compared to your own codebase. Here are some simple questions that might help with getting a better grip on third-party libraries:

* Do you keep track of your third-party libraries?
* Do you regularly check if there are known issues or vulnerabilities in them?
* Do you have a plan for keeping them updated?
* Are the libraries you are using being actively maintained by the authors?
* Are the libraries you are using compatible with each other?
* Do the libraries you are using have appropriate licenses that are compatible with your system? _(This also applies to the open source software licenses.)_

Issues and vulnerabilities are being found and patched all the time. As an example for this, let me point to Google's [OSS-Fuzz Project][5] that has found [numerous security vulnerabilities][4] in several critical open source projects. Unfortunately, even though many people are aware of the security issues in software in general, the library updates still often tend to be forgotten.

It is also worth noting that while most of the issues on my list above are security related, the last one might be of a legal sort, and probably is the most neglected of the issues listed.

#### The Architecture

I am often being asked to assess a system and tell something about its architecture compared to more modern systems. The different aspects of the system's architecture will tell a lot about its maintainability both when it comes to further development, bug fixing, and keeping the system running. Some questions that might help with determining the state of the system would be:

* Does your architecture support automated deployment?
* Does your architecture support continuous deploy and delivery?
* Does your architecture support load balancing?
* Does your architecture support microservices?
* How is the architecture implemented in the code?

#### Tools for Maintaining the Code Quality

Some of this might sound familiar to you when you think of one or several systems you had been working with and you might now be wondering what you can do to improve the code quality? Further steps here would be starting to use proper tools that will be able to tell more about the various aspects of your code. Some of them can be used as plugins to your build system (like Maven), and some could be stand-alone tools.

Stand-alone tools for code analysis:
* [SonarQube][8]
* [PMD][6]
* [FindBugs][7]

Maven plugins to consider (more about plugins in my [previous post][9]):
* Assembly
* Versions
* Dependency
* Enforcer
* Surefire
* Failsafe
* Sonar
* Findbugs
* pmd

_**Bonus:**_ See this post on [command line tools for Java projects][2].

---

### 2. Development Tools and Strategies

Now, let's talk about the development tools. All that fancy code and great architecture will not bring you any closer to a developer's paradise if there will not be some proper tools to support the development. The code should live in a proper version control system that supports collaboration and things like branching and tagging. There should also be tools that help you with code quality analysis, static code analysis, etc. A good starting point here would be to start with answering the following about the project in question:

* Do you use a proper code versioning tool – Git, or even SVN?
* Do you have a branching (and tagging) strategy?
* Do you have a way of measuring code complexity?
* Do you have a way of measuring test coverage and results?
* Do you run static code analysis?

Some tools that can help you here (again, for Java-based systems):

* **IDEs and IDE plug-ins** that can do checks at commits, integrate with test and QA tools, etc.
* **Build tools:** Maven, Gradle, etc.
* **Continuous integration tools:** Jenkins, TeamCity, Bamboo, etc.
* **Frameworks and tools for testing**: to run unit tests, integration tests, UI tests, and end-to-end tests.

There are some further strategies and questions to consider:

* Are your environments easy to reproduce with minimal efforts – can you rebuild it by simply running a script?
* Do you have a proper pipeline from _packaging_, to _delivery_, to _deploy_?
* To what environments can you deploy automatically? With the same script, or command?
* Are your environments (like _development_, _testing_, _staging_, _pre-prod_, _production_) similar to each other?
* Do you follow the same process to deploy to each environment?
* Are _QA_ and _production_ running on physically separate hardware?
* Are you monitoring all of the environments? (i.e. are you able to see errors before they make it to _QA_ or even _production_?)

---

### 3. Documentation and Collaboration Tools

Last, but not least, we will need to talk about the tools for collaboration and documentation. Without these tools, we will be back to the way things were several decades ago – with documents on shared network drives and other horrors of the 90's that I mentioned at the beginning of this post. However, good wikis, other collaboration tools, and proper issue tracking will bring your software to another level, encouraging continuous improvement of the system.

* Wiki
* Collaboration – chat, etc.
* Issue tracking tools

No matter how obvious it might seem, it is still important to note that one should avoid multiple documentation and issue tracking systems. Unfortunately, even though it might sound obvious, it is more common than you think – I have seen my share of systems for documentation and issue tracking resulting in fragmented information and confusion.

## Conclusion

There are several challenges connected with having and maintaining the good code quality. The first challenge is that a good code quality is not something you can achieve overnight. It takes time and energy to achieve that and it is a continuous process. You will need some tools, techniques, and methodology to prevail, and it will probably be easier to introduce all that from the beginning of a project.

The second challenge would be that it might be hard to convince the stakeholders of the project to invest time and resources into something that does not bring any visible improvements to the table – things like new features and bug fixes are more likely to get prioritized over something that cannot be easily measured.

Actually, while presenting on this topic at JavaOne 2017 in San Francisco, several of the attendees asked me about the ways of getting to a beautiful nightmare-free code and infrastructure, and the ways of convincing the stakeholders that this is the way to go. Unfortunately, there is no one simple solution to this, and the most valuable thing, in this case, would be to show the real value of the good quality code.

The measurements parameters to show the value can be:

* time it takes from the code is written to deploy,
* system stability,
* how often bugs are reported compared to earlier, or
* frequency of errors in logs.

So, what can you do as a developer on a project that might need some help, you might ask? You can just start by continuously suggesting improvements and showing their value to the customer, or the project manager. Now you just need to keep going and gradually improving the system, one small bit at a time.

---

[1]:https://docs.docker.com/engine/installation/linux/linux-postinstall/
[2]:{{ site.url }}/cmd-tools-for-developers/
[3]:https://en.wikipedia.org/wiki/Spaghetti_code
[4]:https://testing.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html
[5]:https://github.com/google/oss-fuzz
[6]:https://pmd.github.io/
[7]:http://findbugs.sourceforge.net/
[8]:https://www.sonarqube.org/
[9]:{{ site.url }}/five-pillars-of-a-good-maven-project/
[10]:https://twitter.com/brianwisti/status/503987766032494592?lang=en


text:
# Neural Networks and Genetic Algorithm combination to play Flappy Bird

In this project we aimed to achieve an **Artificial Intelligence (AI)** which can play **Flappy Bird** without being **explicitly programmed**. Normally, a machine learns by looking for patterns among massive data loads. Unlike humans, machines can not generalize knowledge or can not transfer their learning from one application to another.

**Artificial Neural Networks (ANN)** are inspired by the structure and functions of biological neural networks. These networks are made out of many neurons which send signals to each other. To create an artificial brain, ANN simulates neurons and synapses to form a neural network just like in the brain. But, yet, **ANNs does not transfer their learning with each other like humans learn.**

Combination of Neural Networks and Genetic Algorithms tries to solve this lack of learning transfer. Every generation is mix of best units in the previous generation.

> "In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed."
> --- **Charles Darwin**

## Differences
[Main repository can be found here.](https://github.com/ssusnic/Machine-Learning-Flappy-Bird) Differences will be discussed below:

### Game
Game was developed to 1280x720 resolution. It is adapted to 1920x1080 by editing the code and assets. Also, our system allows it can be changed 1280x720 back with just changing one line of code.

### Neural Network Architecture
It is same with main repository.
To play the game, each unit (bird) has its own neural network consisted of the next 3 layers:

1. an input layer with 2 neurons presenting what a bird sees:
-- horizontal distance between the bird and the closest gap
-- height difference between the bird and the closest gap
2. a hidden layer with 6 neurons
3. an output layer with 1 neuron used to provide an action as follows:
 if output > 0.5 then flap else do nothing

![Flappy Bird Neural Network](https://raw.githubusercontent.com/ssusnic/Machine-Learning-Flappy-Bird/master/screenshots/flappy_06.png  "Flappy Bird Neural Network")

There is used [Synaptic Neural Network library](https://synaptic.juancazala.com) to implement entire artificial neural network instead of making a new one from the scratch.

### Neuro Evolution Process
The main approach of Machine Learning (ML) algorithm is based on the Neuro Evolution. This form of machine learning used Genetic Algorithm (GA) to train Artifical Neural Networks (ANN). Steps are basically same with a few differences from main repository. Steps:

1. Created an initial population of 20 units (birds) with random **ANNs**
2. Let all units play the game simultaneously by using their own ANNs
3. For each unit calculate its **fitness** score to measure its quaility
fitness = total travelled distance - distance to the closest gap
![Flappy Bird Fitness](https://raw.githubusercontent.com/ssusnic/Machine-Learning-Flappy-Bird/master/screenshots/flappy_08.png  "Flappy Bird Fitness")

4. When all units are died, evolution start with current population:
4.1. Sort the birds of the current population by their fitness scores
4.2. Selecting the top 6 units (winners) and pass them directly on to the next population which is called Elitism method
4.3. Next population consist 20 birds like previous populations:
  --- 6 winner bird
  --- 1 offspring as a crossover product of the two best winner birds (very best and second very best)
  --- 10 offsprings as a crossover products of two random selected winner birds
  --- 3 totally new birds with random ANNs
4.4. Apply random mutations on each offspring to add some variations with a %5 chance on bias values of ANN and %10 chance on weight values of ANN
6. Go back to the step 2

### Implementation and Requirements
Implementation, requirements and explanation of script files can be found in main repository.

license: MIT

repository: vonReany/Machine-Learning-Flappy-Bird

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: vonReany/Machine-Learning-Flappy-Bird


text:
#Periodic Function Services

With realtime applications, sometimes you need code to be executed regardless of events, e.g. a matchmaking engine.

With Gos WebSocket these can easily be added and will run within the [React Server](http://reactphp.org/) event loop.

##Step 1: Create the Periodic Service Class

Every periodic service must implement the PeriodicInterface.

```php
<?php

namespace Acme\HomeBundle\Periodic;

use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;

class AcmePeriodic implements PeriodicInterface
{
    /**
     * This function is executed every 5 seconds.
     *
     * For more advanced functionality, try injecting a Topic Service to perform actions on your connections every x seconds.
     */
    public function tick()
    {
        echo "Executed once every 5 seconds" . PHP_EOL;
    }

    /**
     * {@inheritdoc}
     */
    public function getTimeout()
    {
        return 5000;
    }
}

```

##Step 2: Register your service with Symfony

If you are using YML, edit "YourBundle/Resources/config/services/services.yml"
For other formats, please check the [Symfony2 Documents](http://symfony.com/doc/master/book/service_container.html)

```yaml
services:
    acme_hello.periodic_sample_service:
        class: Acme\HelloBundle\Periodic\AcmePeriodic
```

From now you can directly tag your service to register your service into GosWebSocket

```yaml
services:
    acme_hello.periodic_sample_service:
        class: Acme\HelloBundle\Periodic\AcmePeriodic
        tags:
            - { name: gos_web_socket.periodic }
```

**or** register via "app/config/config.yml"

```yaml
gos_web_socket:
    periodic:
        - @acme_hello.periodic_sample_service
```

Try pairing up a Periodic function with a [Custom Topic handler](TopicSetup.md) to perform actions on a set of clients connected to a certain topic.

repository: mathewmeconry/uteg

repo_name: mathewmeconry/uteg


text:
# Module 17 - Lab 8 - Exercise 1 - Configure the Microsoft Store for Business

You are the system administrator for Adatum Corporation, and you have Microsoft 365 deployed in a virtualized lab environment. In this lab, you will work with Microsoft Store for Business.

**Note:** Company employees can use the Microsoft Store app for accessing Microsoft Store for Business. However, because it can take up to 36 hours for newly added apps to propagate to the private store and be visible in the Microsoft Store app, this lab used a web browser to access the Microsoft Store for Business and configure Adatum’s private store.

### Task 1: Sign up for Microsoft Store for Business and perform initial configuration

In this task, you will install the Microsoft Store for Business and then you’ll configure it so that apps from the Microsoft Store for Business will be allowed to run on devices that Windows Defender Device Guard is protecting.

1. You should still be logged into your Client 1 VM (LON-CL1) as the **Adatum administrator** and into Microsoft 365 as Holly Dickson (**holly@M365xZZZZZZ.onmicrosoft.com)** with a password of **Pa55w.rd**.

2. In your Edge browser, enter the following URL in the address bar: **https://www.microsoft.com/business-store**

3. This opens the **Microsoft Store for Business**. In the top-right corner, select **Sign in**.

4. If you are not signed in automatically, enter<EMAIL_ADDRESS>(where ZZZZZZ is your tenant ID provided by your lab hosting provider) in the **Sign in** window and then select **Next.**

5. On the **Microsoft Store for Business** page, in the menu bar at the top of the page, select **Shop for my group**.

6. Scroll down to the **Made by Microsoft** section and select **Show all.**

7. In the **Made by Microsoft** page, select **Microsoft Remote Desktop.**

8. On the **Microsoft Remote Desktop** page, select **Get the app**.

9. On the **Microsoft Store for Business and Education Services Agreement** page, scroll to the bottom of the page, select the **I accept this agreement and certify that I have the authority to bind myself (and my organization, if applicable) to its terms** check box, and then select **Accept.**

10. In the **Thanks for your order** window, select **Close**.

11. On the **Microsoft Store for Business** page, on the menu bar at the top of the page, select **Manage**.

12. In the left-hand navigation pane, select **Products & services**.

13. In the **Products and Services** detail pane, scroll down and verify that the **Excel Mobile**, **Microsoft Remote Desktop**, **OneNote**, **PowerPoint Mobile**, **Sway**, and **Word Mobile** apps are listed.

14. In the left-hand navigation pane, select **Settings**.

15. In the **Settings** pane, on the **Shop** tab, scroll down to the **Shopping experience** section and select the **Show offline apps** switch to turn it **On**.

16. In the **Microsoft 365 admin center**, on the menu bar at the top of the page, select **Adatum Corporation**. This is Adatum’s private store.

17. As part of your pilot project, you want to change the name of your store to **Adatum private store**. On the **Adatum Corporation** private store page, select the **ellipsis (…)** icon to the right of **Adatum Corporation**, and in the menu that appears, select **Edit collection**.

18. On the **Edit collection** page, to the right of **Adatum Corporation**, select **Rename private store**.

19. On the **Settings** page, under the **Private store** section, to the right of **Your private store name: Adatum Corporation**, select **Change**.

20. In the **Private store** dialog box, enter **Adatum private store** and then select **Save**.

    Note the change to your private store name on the menu bar at the top of the page.

21. On the menu bar, select **Adatum private store**.

22. On the **Adatum private store** page, verify that it displays the **Sway**, **OneNote**, **PowerPoint Mobile**, **Excel Mobile**, and **Word Mobile** apps.

    **Note:** Earlier when you viewed **Products and Services**, it included this list of client apps, along with Microsoft Remote Desktop app. You do not see the Microsoft Remote Desktop app in your private store because you already got the app at the start of this task.

23. Leave the **Microsoft Store for Business** tab open in your Edge browser. You will use this in the next exercise.

# Proceed to Exercise 2

gha_license_id: MIT


text:
socket-io: socket.io web component
==========================================

Installation
============
bower install socket-io

Notes
=====
you need a functioning socket.io server running

Demo
====
A small chat application is included as a more complex demo

- Start the demo socket.io server using

      node demo-chat-server.js

- start the webserver of your choice in the root directory
- Navigate to localhost:<port>/demo-chat-client.html to try it out

Licence
=======
MIT


text:
# CLI

The CLI is the part that allows external applications to easily talk to Mumble's JSON bridge without having to
worry about the communication details (i.e. the process does not have to worry about named pipes and how
and which to use).

All requests are made using JSON syntax. The basic message format is
```
{
    "message_type": "<type>",
    "message": {
        <message body>
    }
}
```

Available choices for `<type>` are:

| **Type** | **Description** |
| -------- | --------------- |
| `api_call` | A direct call to one of Mumble's API functions (plugin API) |
| `operation` | A more high-level operation |

## api_call

In order to directly make an API call, the `<message body>` has to follow the form
```
"function": "<API function name>`,
"parameter": {
    <parameter>
}
```

`<parameter>` is a list of key-value-pairs providing the parameters for the function that is
going to be called. The necessary parameters (names and type) as well as the function name itself
can be obtained from the official
[C++ plugin API wrapper](https://github.com/mumble-voip/mumble-plugin-cpp/blob/7e1256a958d8e452ddb5273a20c30b0a26d6c4dc/include/mumble/plugin/MumbleAPI.h).
Note however that the parameter names have to be converted to snake_case first (e.g. `useID` transforms
to `user_id`).

If a function does not take any parameter, the entire `parameter` entry **must not be present** in
the sent message.

### Examples

```
{
    "message_type": "api_call",
    "message": {
        "function": "getActiveServerConnection"
    }
}
```

```
{
    "message_type": "api_call",
    "message": {
        "function": "getChannelName",
        "parameter": {
            "connection": 0,
            "channel_id": 5
        }
    }
}
```

## operation

Usually one needs to perform multiple successive API calls in order to get what one wants. This
is exactly where operations come into play. An operation is a specific API call combination that
is automatically processed by the CLI for you (including error handling). If for instance you want
to obtain the local user's name, this involves 3 API calls aready:
1. Obtain the ID of the current connection
2. Obtain local user's ID
3. Obtain the name associated with that ID

Thankfully there is an operation for this:
```
{
    "message_type": "operation",
    "message": {
        "operation": "get_local_user_name"
    }
}
```

Operations can also take parameter, which are handled in the same way as parameter for API calls:
```
{
    "message_type": "operation",
    "message": {
        "operation": "move",
        "parameter": {
            "user": "SomeUser",
            "channel": "MyChannel"
        }
    }
}
```

All operations are defined in the [operations](operations/) directory in form of a YAML file. It
contains the definition of the operation and also what parameter it takes (parameters that have
default values defined are optional).

repository: Krzmbrzl/mumble-json-bridge

repo_name: Krzmbrzl/mumble-json-bridge


text:
---
title: 'Diary 2021/01/05'
date: '2021-01-05T22:37:00.000Z'
template: 'post'
language: 'en'
draft: true
home: false
slug: '/posts/diary-20210105'
category: 'Private'
tags:
  - cypress
  - JSDoc
  - TODO
description: ''
---

I would like to be a developer who is easy to work with.

It looks like it is time to start writing JSDoc... I need to do some research on the best practices.

## Terms

- [cypress](https://www.cypress.io/)
- [JSDoc](https://jsdoc.app/)

## English

### "crap"

something of extremely poor quality. rubbish! junk!

"Your code is crap" he said. I was sad. (fiction. No one says it out loud.)

### "swamp"

- to have too many of something, or give someone too much to do

- to overwhelm numerically

I am sorry. I was swamped with bug fixes and I could not review your code.

repository: SayakaOno/gatsby-blog

gha_language: JavaScript

repo_name: SayakaOno/gatsby-blog


text:
# bath-bst: Harvard referencing style as recommended by the University of Bath Library

This package provides a [BibTeX] style to format reference lists in the
[Harvard style][bath-harvard] recommended by the University of Bath Library.
It should be used in conjunction with [natbib] for citations.

## Installation

### Automated way

A makefile is provided which you can use with the Make utility on
UNIX-like systems:

  * Running `make source` generates the derived files
      - README.md
      - bath.bst
      - bath-bst.bib
      - bath-bst.ins
  * Running `make` generates the above files and also bath-bst.pdf.
  * Running `make inst` installs the files in the user's TeX tree.
    You can undo this with `make uninst`.
  * Running `make install` installs the files in the local TeX tree.
    You can undo this with `make uninstall`.

### Manual way

You only need to follow the first two steps if you have made your own
changes to the .dtx file. The compiled files you need are included in
the zip archive.

 1. Run `tex bath-bst.dtx` to generate the source files.
 2. Compile bath-bst.dtx with [LuaLaTeX] and BibTeX to generate the
    documentation. You will need, among other things, the [luatexja],
    [adobemapping] and [ipaex] packages installed; this is just for the
    documentation, not for the BibTeX style itself.
 3. Move the files to your TeX tree as follows:
      - `source/bibtex/bath-bst`:
        bath-bst.dtx,
        (bath-bst.ins)
      - `bibtex/bst/bath-bst`:
        bath.bst
      - `doc/bibtex/bath-bst`:
        bath-bst.pdf,
        README.md

 4. You may then have to update your installation's file name database
    before TeX and friends can see the files.

[bath-harvard]: http://www.bath.ac.uk/library/infoskills/referencing-plagiarism/harvard-bath-style.html
[BibTeX]: http://ctan.org/pkg/bibtex
[natbib]: http://www.ctan.org/pkg/natbib
[LuaLaTeX]: http://ctan.org/pkg/lualatex-doc
[luatexja]: http://ctan.org/pkg/luatexja
[adobemapping]: http://ctan.org/pkg/adobemapping
[ipaex]: http://ctan.org/pkg/ipaex

## Licence

Copyright 2016 University of Bath.

This work consists of the documented LaTeX file bath-bst.dtx and a Makefile.

The text files contained in this work may be distributed and/or modified
under the conditions of the [LaTeX Project Public License (LPPL)][lppl],
either version 1.3c of this license or (at your option) any later
version.

This work is ‘maintained’ (as per LPPL maintenance status) by [Alex Ball][me].

[lppl]: http://www.latex-project.org/lppl.txt "LaTeX Project Public License (LPPL)"
[me]: https://github.bath.ac.uk/ab318/bathbib "Alex Ball"

repository: rsmarincu/Literature-Review

repo_name: rsmarincu/Literature-Review


text:
---
layout: post
title: "JewelryBox v1.5"
date: 2013-04-01 07:51
comments: true
categories: jewelrybox osx
---

No, this is not an April Fools' joke. I'm pleased to announce the immediate availability of JewelryBox v1.5. This brings improved compatability with RVM 1.19.x, which contains many major and important changes. Use the in-app updater, or grab it from [http://jewelrybox.unfiniti.com](http://jewelrybox.unfiniti.com)

Change log:

    - Compatability with newer RVM versions
    - Added RVM notes view
    - Added binary options to ruby installation view
    - Added verify download options to ruby installation view
    - Added ability to upgrade rubies
    - Added ability to clean gemsets
    - Added ability to clean links
    - Fixed manually specified compiler flag application
    - Fixed crash on launch and crash when no gcc is found
    - Fixed grey screen hang when multiple "logs" are found in ruby installation output
    - Fixed "About JewelryBox" menu item
    - Fixed crash on installing YAML step
    - Fixed RVM usage graph calculations
    - Fixed RVM usage graph coloring
    - Fixed typo in environment synchronization notification
    - Improved feedback while removing rubies
    - Silence cURL output when downloading rubies
    - Silence dot output during ruby installation

So what happened to v1.4.2?

I was finishing up the final touches for 1.4.2 and the RVM team started to introduce a lot of major changes that required updates to JewelryBox. Therefore, I thought it best to delay releasing until the RVM changes became stable and JewelryBox could be updated accordingly.

Thanks to everyone for your patience and support on the JewelryBox project.

Continue reading below for a detailed description of the major changes in v1.5.

###Compatability with newer RVM versions
JewelryBox v1.5 requires RVM 1.19.1 or newer.

####Added RVM notes view
The "Release Notes" view showed information from RVM requirements. RVM notes information was given its own area and named "Release Notes". RVM requirements information is now located under "Requirements" via the Dashboard view.

####Added binary options to ruby installation view
RVM supports precompiled binary installations on some operating systems and for specific ruby versions. It will attempt to install binary releases by default. Options were added to allow installing only binary releases or to disable attempts to install binary releases.

####Added verify download options to ruby installation view
RVM attempts to verify checksums for downloads when available. Some downloads don't have checksums available for various reasons. For added security, RVM will halt installation if checksums cannot be verified. Options have been added to JewelryBox to allow different levels and temporary overrides of checksum security.

####Added ability to upgrade rubies
You can now upgrade ruby versions from the manage rubies interface. NOTE: The target ruby for the upgrade must already be installed. The upgrade will migrate everything to the target ruby and remove the old ruby.

####Added ability to clean gemsets
Gemsets are now cleanable from the "Disk Usage" area.

####Added ability to clean links
Binary links are now cleanable from the "Disk Usage" area.

####Fixed manually specified compiler flag application
Compile flags entered in the text field on the ruby installation options view were not being passed to the ruby installation method. This is now fixed. "export" is NOT prefixed.

####Fixed crash on launch and crash when no gcc is found
When gcc was not detected, i.e. "command not found", an index out of bounds error was thrown causing an application crash. This has been fixed.

####Fixed grey screen hang when multiple "logs" are found in ruby installation output
A logic error for detecting log file paths in the output caused a crash. Not every occurrence of "Please read" is followed by a log path. The logic failed when it says things like "Please read 'rvm mount' ..." This should now be fixed.

####Fixed "About JewelryBox" menu item
View indexes weren't updated. Oops.

####Fixed crash on installing YAML step
This was caused by one or both of the log parser logic error or unexpected output by verify downloads issues.

####Fixed RVM usage graph calculations
Graph drawing calculations were incorrect resulting in incorrect usage representations in the meter graphic.

####Fixed RVM usage graph coloring
Graph coloring was not being applied to the correct keys.

####Fixed typo in environment synchronization notification
"Environment" was spelled incorrectly.

####Improved feedback while removing rubies
Improved interface interaction while removing rubies.

####Silence cURL output when downloading rubies
cURL output was extremely verbose while downloading archives. JewelryBox now quiets CURL output to make it easier to read installation output.

####Silence dot output during ruby installation
RVM now uses dots to indicate progress during the ruby installation process. JewelryBox now turns down the dot frequency to make it easier to read installation output.

repository: remear/blog

extension: markdown

repo_name: remear/blog


text:
# Church numerals

Church encoding of the natural numbers.

Zero, Z := (λsz.z)
Succ, S := (λnfx.f(nfx))

C1 := (λsz.sz)
C2 := (λsz.s(sz))
C3 := (λsz.s(s(sz)))

Cn' = S n S Z ~ Sⁿ(Z)
C6 := S 5 S Z ~ S (S⁵ Z) = S (S (S (S (S (S Z))))) ~ 6

C1 = S Z = (λnfx.f(nfx)) (λsz.z) = (λsz.sz)

```
S Z =
(λnfx. f(n       fx)) (λsz.z) =
  λfx. f((λsz.z) fx) =
  λfx. f((λsz.z) fx) =
  λfx. f((λz.z)   x) =
  λfx. f(x)          =
  λfx. fx ~ 1

S (S Z) =
(λnfx. f(nfx)) (λsz.sz) =
(λfx. f((λsz.sz) fx))   =
(λfx. f((λz.fz) x))   =
(λfx. f(fx))   =
 λfx. f(fx) ~ 2

S (S (S Z)) =
(λnfx. f(nfx)) (λsz.s(sz)) =
(λfx. f((λsz.s(sz)) fx)) =
(λfx. f(f(fx))) =
 λfx. f(f(fx)) ~ 3
```

# Church Numerals: Church encoding of natural numbers

Natural numbers are non-negative whole numbers (integers). They may be defined using Peano's axioms. Peano defined them inductively:
- Zero ∈ ℕ
  This just states that zero is a Nat, this is the base case
- n ∈ ℕ -> Succ(n) ∈ ℕ
  The inductive case states that if `n` is a Nat then the successor of `n` is a Nat as well.
- `Zero` is a constant function that returns 0 no matter what.
- `Succ` is a unary function that takes a Nat `n` and returns it successor.

In set theoretic terms, Succ is usually defined as `S(n) = n ∪ {n}`. However, in LC this offers no hints or inspiration as to the implementation since we have only functions.

That was the description of Succ, but its implementation in LC may be fulfilled by this lambda abstraction, `Succ := λnfx.f(nfx)` due to Church. Often, it transpires that different definitions of a certain function, like successor fn here, are possibly, within the same encoding system.

## Under Peano's definition

Given a successor function, `next`, which adds one, we can define the natural numbers in terms of `zero` or `Z` and `Succ` or `Next`:

$$
0: Z \\
1: S(Z) \\
2: S(S(Z)) \\
3: S(S(S(Z))) \\
n: S(\cdots (S(Z))\cdots) \equiv S^{\ \circ\ n} (Z)
$$

For a natural number `n`, the successor function `S` is n-times composed with itself, denoted by $$S^{\ \circ\ n} (Z)$$. Which is also called `n`-fold of a function `f` with itself, $$f^{\ \circ\ n}$$

---

<????>

Just as we adopted the convention TRUE = first, and FALSE = second, we adopt the following convention:

zero  = Lf.Lx.x
one   = Lf.Lx.(f x)
two   = Lf.Lx.(f (f x))
three = Lf.Lx.(f (f (f x)))
four  = Lf.Lx.(F (f (f (f x))))

Therefore we have a "unary" representation of the natural
numbers, such that n is represented as n applications of the
function f to the argument x. This representation is refered to as
CHURCH NUMERALS.

We can define the function next as follows:

  next = Ln.Lf.Lx.(f ((n f) x))

and therefore one as follows:

  one = (next zero)
      => (Ln.Lf.Lx.(f ((n f) x)) zero)
      => Lf.Lx.(f ((zero f) x))
      => Lf.Lx.(f ((Lg.Ly.y f) x)) (* alpha conversion avoids clash *)
      => Lf.Lx.(f (Ly.y x))
      => Lf.Lx.(f x)

and two as follows:

  two = (next one)
      => (Ln.Lf.Lx.(f ((n f) x)) one)
      => Lf.Lx.(f ((one f) x))
      => Lf.Lx.(f ((Lg.Ly.(g y) f) x)) (* again, alpha conversion *)
      => Lf.Lx.(f (Ly.(f y) x)
      => Lf.Lx.(f (f x))

val next = fn n => fn f => fn x => (f ((n f) x));

NOTE that ((two g) y) = (g (g y)). So if we had some function, say
one that increments n:

   inc = Ln.(n+1)

then we can get a feel for a Church Numeral as follows:

   ((two inc) 0)
   => ((Lf.Lx.(f (f x)) inc) 0)
   => (Lx.(inc (inc x) 0)
   => (inc (inc 0))
   => (Ln.(n+1) (Ln.(n+1) 0))
   => (Ln.(n+1) (0 + 1))
   => ((0 + 1) + 1)
   => 2

We are now in a position to define addition in terms of next:

   add = Lm.Ln.Lf.Lx.((((m next) n) f) x);

Therefore four may be computed as follows:

   four = ((add two) two)
        => ((Lm.Ln.Lf.Lx.((((m next) n) f) x) two) two)
        => (Ln.Lf.Lx.((((two next) n) f) x)
        => Lf.Lx.((((two next) two) f x)
        => Lf.Lx.((((Lg.Ly.(g (g y)) next) two) f x)
        => Lf.Lx.(((Ly.(next (next y)) two) f) x)
        => Lf.Lx.(((next (next two)) f) x)
        => Lf.Lx.(((next (Ln.Lf.Lx.(f ((n f) x)) two)) f) x)

Multiplication is defined as follows:

   mult = Lm.Ln.Lx.(m (n x))

   six  = ((mult two) three)
        => ((Lm.Ln.Lx.(m (n x)) two) three)
        => (Ln.Lx.(two (n x) three)
        => Lx.(two (three x))
        => Lx.(two (Lg.Ly.(g (g (g y))) x))
        => Lx.(two Ly.(x (x (x y))))
        => Lx.(Lf.Lz.(f (f z)) Ly.(x (x (x y))))
        => Lx.Lz.(Ly.(x (x (x y))) (Ly.(x (x (x y))) z))
        => Lx.Lz.(Ly.(x (x (x y))) (x (x (x z))))
        => Lx.Lz.(x (x (x (x (x (x z))))))

And exponentiation as follows:

    power = Lm.Ln.(m n);

    nine  = ((power two) three)
          => ((Lm.Ln.(m n) two) three)
          => (Ln.(two n) three)
          => (two three)
          => (Lf.Lx.(f (f x)) three)
          => Lx. (three (three x))
          => Lx. (three (Lg.Ly.(g (g (g y))) x))
          => Lx. (three Ly.(x (x (x y))))
          => Lx. (Lg.Lz.(g (g (g z))) Ly.(x (x (x y))))
          => Lx.Lz.(Ly.(x (x (x y)))
                    (Ly.(x (x (x y)))
                     (Ly.(x (x (x y))) z)))
          => Lx.Lz.(Ly.(x (x (x y)))
                    (Ly.(x (x (x y)))
                      (x (x (x z)))))
          => Lx.Lz.(Ly.(x (x (x y)))
                     (x (x (x (x (x (x z)))))))
          => Lx.Lz.(x (x (x (x (x (x (x (x (x z)))))))))

The following lambda function tests for zero:

   third = Lx.Ly.Lz.z
   iszero = Ln.((n third) first)

Another approach:

   T = Lx.Ly.x
   F = Lx.Ly.y
   af = Lx.F
   zp = Ln.((n af) T)

Here we take a function "af" that always returns "false".
Since a church numeral is a function of two arguments, we
apply the number to be tested to "af" as the first argument
and to "T" as the second argument.

If the number being tested is zero (which is the same as "F"), then
it selects the second argument and so returns "T".

If the number is not zero then it will behave as a church
numeral and apply the function some number of times...
and the function it applies is a function that returns "F" in all
circumstances... no matter how many times it's applications are nested.

Let's try this for a test of two:

(zp two)  -->  (L n ((n af) T) two) --> ((two af) T)
          -->  ( (L g L y (g (g y)) af) T )
          -->  ( L y (af (af y)) T )
          -->  ( af ( af T ) )
          -->  ( L x F ( L x F T ) )
          -->  F

The lambda function pred delivers the predecessor of a
Church Numeral:

    pair = Lx.Ly.Lf.((f x) y);
    prefn = Lf.Lp.((pair (f (p first))) (p first))
    pred = Ln.Lf.Lx.(((n (prefn f)) (pair x x)) second)

It should be of interest to note the following. A major
landmark in Lambda Calculus occurred in the 1930's when
Kleene discovered how to express the operation of
subtraction within Church's scheme (yes, that means that even
though Church invented/discovered the Lambda Calculus he was
unable to implement subtraction and subsequently division, within
that calculus)! Other landmarks then followed, such as the recursive
function Y. In 1937 Church and Turing, independently, showed that every
computable operation (algorithm) can be achieved in a Turing machine
and in the Lambda Calculus, and therefore the two are equivalent.
Similarly Godel introduced his description of computability, again
independently, in 1929, using a third approach which was again shown
to be equivalent to the other 2 schemes.

It appears that there is a "platonic reality" about
computability. That is, it was "discovered" (3 times idepenedently)
rather than "invented". It appears to be natural in some
sense.

(********************** ml source ***********************)

(* Church Numerals *)

val zero = fn f => fn x => x;
val next = fn n => fn f => fn x => (f ((n f) x));
val add = fn m => fn n => fn f => fn x => ((((m next) n) f) x);
val mult = fn f => fn g => fn x => (f (g x));
val power = fn f => fn g => (f g);

(* Church Numerals *)
val one = (next zero);
val two = (next one);

val inc = fn n => n+1;

(* More Church Numerals *)
val four = (add one (add one (add one (add one zero))));
val three = ((add one) two);
val five = ((add three) two);
val six = ((mult three) two);
val nine = ((power two) three);
val ten = ((mult two) five);

(* A test to show what a Church Numeral does *)

((zero inc) 0);
((five inc) 0);
((ten inc) 0);

val first = fn x => fn y => x;
val second = fn x => fn y => y;
val third = fn x => fn y => fn z => z;

val iszero = fn n => ((n third) first);
(* Predicate, is a Church Numeral zero? *)

val T = fn x => fn y => x ;
val F = fn x => fn y => y ;
val af = fn x => F;
val zp = fn n => ((n af) T);  (* zp is a zero predicate *)

val pair = fn x => fn y => fn f => ((f x) y);

val prefn = fn f => fn p => ((pair (f (p first))) (p first));
val pred = fn n => fn f => fn x => (((n (prefn f))(pair x x)) second);
(* predecessor function *)

val eight = (pred nine);

license: Unlicense


text:
# ButtonBot

ButtonBot allows control of the MBot robot from MakeBlock using a single bluetooth access switch. It allows switch users to move beyond simple cause and effect allowing them to participate in a whole range of games and activities by controlling their robot.

ButtonBot currently supports the MBot from MakeBlock. We hope to add support for more toy robots in the future.

To use the app connect a bluetooth access switch (such as the Pretorian iSwitch) to your iOS device. The switch should be configured to send the enter command when pressed. Open the app and connect to the robot. The app will auto-scan between the different directions with a switch press causing the robot to drive in that direction.

Add a second access switch, configured to send the space command, to access the action button which will activate a servo motor connected to the MBot.

ButtonBot was originally created for twins Ayala and Caira as part of the BBC TV program ‘The Big Life Fix’.

## Requirements

* [Xcode](https://developer.apple.com/xcode/download/)
* [Cocoapods](https://cocoapods.org/)

## Screenshots

## Installation Instructions

1. Download the [source code](https://github.com/akramhussein/ButtonBot)

  `$ git clone git@github.com:akramhussein/ButtonBot.git`

2. Install [cocoapods](https://cocoapods.org/)

  `$ cd ./ButtonBot && pod install`

3. Open "ButtonBot.xcworkspace" in Xcode

4. Open Xcode's Preferences > Accounts and add your Apple ID

5. In Xcode's sidebar select "ButtonBot" and go to Targets > ButtonBot > General > Identity and add a word to the end of the Bundle Identifier to make it unique. Also select your Apple ID in Signing > Team

6. Connect your iPad or iPhone and select it in Xcode's Product menu > Destination

7. Press CMD+R or Product > Run to install ButtonBot

## License

ButtonBot is available under the MIT License

repository: akramhussein/ButtonBot

repo_name: akramhussein/ButtonBot


text:
Therefore, we have to borrow a lot of what we know
from the JavaScript ecosystem to bootstrap our web app build.

This is a [ReactJS](https://facebook.github.io/react/) project built
with [Gulp](http://gulpjs.com/).

# Installing Dependencies

* Install a recent version of [node.js](https://nodejs.org/) on your system
* Navigate to the `webapp` folder: `cd webapp`
* Install dependencies: `npm install`
* Build the web application: `npm run build`
* To continuously build web app files as you work on the project, run `npm run watch`

# Testing

This is still a `TODO` :)

repository: skilowg/go-photobox

repo_name: skilowg/go-photobox


text:
---
hrs_structure:
  division: '1'
  volume: '7'
  title: '20'
  chapter: '349'
  section: 349-3.1
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0349-0003_0001
    parent: HRS0349
    name: 349-3.1 Kupuna care program
weight: 19020
title: Kupuna care program
full_title: 349-3.1 Kupuna care program
---
**[****§349-3.1] Kupuna care program.** (a) The executive office on aging may establish the kupuna care program. The program shall provide affordable and quality home- and community-based services.

(b) The program may be provided in every county as a function of the aging and disability resource centers.

(c) As used in this section, unless the context otherwise requires:

"Aging and disability resource centers" means an entity established by the State as part of the state system of long-term care, serving as a highly visible and trusted source where people of all incomes and ages can get information on the full range of long-term support options, and a single point of entry for access to public long-term support programs and benefits.

"Family caregivers" means a spouse, adult child, other relative, partner, or friend who has a personal relationship with, and provides a broad range of unpaid assistance for an older adult with a chronic or disabling condition.

(d) The director shall adopt rules pursuant to chapter 91 necessary for the purposes of this section. [L 2012, c 238, §2]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
© SSS Group Ltd. 2017

Custom Actions Library for © IBM Datacap

Abstract

This library is designed to provide formula processing capabilities for © IBM Datacap.

Please note: You are responsible for providing access to all of the required dependencies, as they are not included with this project.
It is recommended to Open/Compile the solution on a computer that has ©IBM Datacap sofwtare installed (version 9.x and higher)

Installation/Deployment

Content of this folder is a Visual Studio Solution that once built results in Custom Actions Library (.dll).Once Built the .dll needs to be place into Application-specific location (e.g. \Datacap\APT\dco_APT\Rules) or inside \Datacap\RRS\ folder.

1. Download(Pull) the solution to the PC that has ©IBM Datacap installed (version 9.x)
2. Remap references ('iRRX.dll' and 'dcSmart.dll') for the 3sgrMath project
3. Optional(Setting up Unit Test Project(see 'DCUnitTest' for more details) :

3.1. Create: '..\DCUnitTest\DCO\Setup' and '..\DCUnitTest\DCO\Runtime' folders

3.2 Copy APT Setup DCO ('C:\Datacap\APT\dco_APT\APT.xml') to '..\DCUnitTest\DCO\Setup'

3.3 Copy APT Batch content (at least at the Verify step, 'C:\Datacap\APT\batches\<batchID>\') to '..\DCUnitTest\DCO\Runtime'

4. Build the solution

For additional details, please see Wiki page.

gha_language: C#


text:
#Session Servlet

## Overview

A simple JEE servlet that can be deployed within a JEE container and used to test continuity, load balancing, failover, session stickiness, etc. It has been tested to work with WildFly/EAP and with Tomcat.

## Build

    mvn clean package

## Deploy

Copy ./target/session-servlet.war into the deployment directory of the application server.

## Authentication

The default build produces a servlet that *does NOT require authentication*.

If you want authentication, do this (JBoss 5 procedure, may need to be updated for WildFly):

1. Un-comment web.xml section starting with <security-constraint> and ending with </security-role>

2. Replace "admin" with a valid role. The replacement must be done in both places where <role-name> is mentioned. For example, if deployed on JBoss 5, pick up an appropriate role from $JBOSS_HOME/server/$JBOSS_PROFILE/conf/props/jmx-console-roles.properties.

3. Enable <security-domain> in jboss-web.xml and make sure it points to the correct one on the server.

## HTTP Session

The smoke servlet will NOT establish a HTTP session by default.

If you wish it to establish a session, call it with "establish-session" parameter on the first request.

Example: http://locahost:8080/session-servlet?establish-session

After the first request, obviously there's no need for "establish-session" anymore, the browser/server ensemble maintain the one that was established. The current implementation will throw an exception if it sees "?establish-session" again.

In order to store a key/value pair into the session, use http://locahost:8080/session-servlet/put?key=something&value=somethingelse. In order to retrieve a key/value pair from the session, use http://locahost:8080/session-servlet/get?key=something

### Enable HTTP Session Replication

##Root Context

You can change the root context as follows:

###On JBoss

####Method One

Simply deploy the WAR under the desired name.

####Method Two

TODO: use jboss-web.xml and root-context.

###On Tomcat

Simply deploy the WAR under the desired name.

##Test Plan

###1. Simple Availability

Build and deploy.

Go to http://<server-address>:<server-port>/session-servlet

It will return a simple HTTP page listing relevant information regarding the execution.

###2. Session Experiments

Establish a session with http://<server-address>:<server-port>/session-servlet?establish-session

Then drop the parameter, the browser/server should maintain the session until it expires.

repository: rmaddali/playground

repo_name: rmaddali/playground


text:
# Almundo.com Test

This is a test app for Almundo Frontend Test
[Demo here.](https://almundo-test-fp95.herokuapp.com/)

#### Getting Started
```
> git clone https://github.com/fedepazos95/almundo-test.git
> cd almundo-test && yarn
> cd client && yarn
> cd .. && yarn dev
```

## Built With

* [Create React App](https://github.com/facebook/create-react-app)
* [Redux](https://redux.js.org/)
* [ExpressJS](http://expressjs.com/)

## Authors

* **Federico Pazos** - *Initial work* - [FedePazos95](https://github.com/fedepazos95)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
# Entry

An _entry_ is a timestamp, amount, instrument, and legal entity.
They form the basis of accounting for financial transactions.

An _entry_ is a tuple <math>ι = (_t_,_a_,_i_,_l_)</math>.

Entries usually occur in pairs as a [_transaction_](transaction.md).
The entry indicates
the legal entity is associated with an amount of an instrument at a
particular time.

repository: keithalewis/vocab

repo_name: keithalewis/vocab


text:
# SyRe_MSc
M.Sc. Thesis Project

I am a M.Sc. student in the area of Electrical Machines and Power Electronics at Electrical and Electronics Engineering Department, Middle East Technical University (METU).

The title of my thesis is " Development of an open source switched reluctance machine design software."

   The thesis consists of developing an open source program "SyR-e", which designs synchronous reluctance machines
   with finite element analysis and the aid of multi-objective optimization algorithms, and comparing
   the constructed motor and simulation results.

   SyR-e is the open source program, which I plan to work on.
   The original software is available from
		                http://sourceforge.net/projects/syr-e/


text:
---
title: TryHackMe Writeup - Linux Fundamentals Part 1
date: 2021-01-05 12:45:47 +07:00
tags: [tryhackme]
description: Tryhackme write-up
comments: true
---

# [Linux Fundamentals Part 1](https://tryhackme.com/room/linux1)
---
Get introduced to the Linux basics by learning how to use fundamentally important commands. Put this into practice by deploying and accessing your own remote (web-based) Linux machine.

## [Task 1] Intro
---
Connect to TryHackMe OpenVPN first:
```bash
kali@kali:~$ sudo openvpn path-to/wuvel.ovpn
```

SSH to the machine with username: `shiba1` and password: `shiba1`:
```bash
kali@kali:~$ ssh<EMAIL_ADDRESS>```

## [Task 2] Methodology
---

## [Task 3] [Section 2: Running Commands] - Basic Command Execution
---
We can check the detailed information about a command using `man` command:
```bash
shiba1@nootnoot:~$ man echo

ECHO(1)                                        User Commands                                        ECHO(1)

NAME
       echo - display a line of text

SYNOPSIS
       echo [SHORT-OPTION]... [STRING]...
       echo LONG-OPTION

DESCRIPTION
       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)

       --help display this help and exit

       --version
              output version information and exit

       If -e is in effect, the following sequences are recognized:

       \\     backslash

       \a     alert (BEL)
```

Run `echo` command to print something including the newline:
```bash
shiba1@nootnoot:~$ echo hello
hello #this is the output
shiba1@nootnoot:~$
```
## [Task 4] [Section 2: Running Commands] - Manual Pages and Flags
---
We can use `echo` command with tag `-n` to print output without the newline:
```bash
shiba1@nootnoot:~$ echo -n hello
helloshiba1@nootnoot:~$
```

## [Task 5] [Section 3: Basic File Operations] - ls
---
We can use `ls` command to list information about every file / directory in the directory.
```bash
shiba1@nootnoot:~$ ls
shiba1 #this is a file called shiba1
shiba1@nootnoot:~$
```

We can use tag `-a` to list all files / directory including the hidden one (started with `.`):
```bash
shiba1@nootnoot:~$ ls -a
.  ..  .bash_history  .bash_logout  .bashrc  .cache  .gnupg  .local  .profile  shiba1
shiba1@nootnoot:~$
```

We can use tag `-l` to list all files / directory in a long list (detailed) format:
```bash
shiba1@nootnoot:~$ ls -l
total 12
-rwsrwxrwx 1 shiba2 shiba2 8432 Feb 13  2020 shiba1 #we can see the permissions, owner, group, etc.
```

## [Task 6] [Section 3: Basic File Operations] - cat
---
We can use `cat` command to outputs contents of files to the terminal:
```bash
shiba1@nootnoot:~$ cat a.txt
AAA
shiba1@nootnoot:~$
```

We can use tag `-n` o numbers all output lines:
```bash
shiba1@nootnoot:~$ cat -n a.txt
     1  AAA
shiba1@nootnoot:~$
```

## [Task 7] [Section 3: Basic File Operations] - touch
---
We can use command `touch` to create files:
```bash
shiba1@nootnoot:~$ ls
a.txt  shiba1
shiba1@nootnoot:~$
```

## [Task 8] [Section 3: Basic File Operations] - Running A Binary
---
If we want to run a binary called hello located in directory, we can use `.` shortcut to run it:
```bash
shiba1@nootnoot:~$ ./hello
```

If the file in the home directory, we can use `~` shortcut:
```bash
shiba1@nootnoot:~$ ~/hello
```

If the file in the previous directory, we can use `..` shortcut:
```bash
shiba1@nootnoot:~$ ../hello #go back 1 directory
shiba1@nootnoot:~$ ../../hello #go back 2 directory and so on
```

## [Task 9] Binary - Shiba1
---
To get the shiba2 password, we must create `noot.txt` file and run the `shiba1` binary:
```bash
shiba1@nootnoot:~$ touch noot.txt
shiba1@nootnoot:~$ ./shiba1
pinguftw
shiba1@nootnoot:~$
```
shiba2 password is **pinguftw**.

## [Task 10] su
---
We can use `su` command to change user:
```bash
su shiba2 #login as shiba2 user
```

We can use `-s` tag to specify which shell used to login:
```bash
su -s bash shiba2 #login as shiba2 with bash shell
```

## [Task 11] Linux Fundamentals 2
---
Room completed!

repository: wuvel/jekyll-klise

repo_name: wuvel/jekyll-klise


text:
---
layout: exercise
title: String Huffman Trie to Dump
question_text: >-
  Store a given Huffman trie to dump.

  Traverse a trie in preorder: when visit an internal
  node write '0'; when visit a leaf write '1', followed by the leaf's character.

  For example, toDump(trie) => "01a01b01r01c1d".

solution_file: /sources/java/HuffmanTrieToDump.java
library_files:
- /sources/java/Assert.java
- /sources/java/ArrayUtil.java
- /sources/java/Huffman.java
language: java
command: javac HuffmanTrieToDump.java && java HuffmanTrieToDump
---

gha_language: Java


text:
---
layout: post
title: KOPS Updating Cluster Is Awesome
categories: Kubernetes KOPS gitops
keywords: Kubernetes kops gitops
# https://jekyll.github.io/jekyll-seo-tag/advanced-usage/#customizing-image-output
# This adds the html metadata "og:image" tags to the page for URL previews
image:
  path: "/assets/logo/M_1000.jpg"
#   height: 100
#   width: 100
description: Here is yet another reason why I think the `Kops` tool for creating and managing a Kubernetes' cluster lifecycle is so great.
---
{%- include share-bar.html -%}

Here is yet another reason why I think the `Kops` tool for creating and managing a Kubernetes' cluster
lifecycle is so great.

I needed to do three things to the cluster:

1) Set the kubelet timeout to something higher than the default 2 minutes.  This cluster
is in ap-southeast-1 and pulling docker images is really really slow from there.  Some
time it takes longer than 2 minutes and the Kubelet will time out.

Well luckily `kops` exposes all of the Kubelets flags so you can tune it however
you want.  Here is the Kubelet [documentation](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/) showing me
I need to use the `--runtime-request-timeout` flag.  This maps to the `kops` [doc](https://github.com/kubernetes/kops/blob/release-1.10/docs/apireference/build/documents/_generated_kubeletconfigspec_v1alpha2_kops_definition.md) on what this parameter should be in my `kops` configs:

```
runtimeRequestTimeout: 10m0s
```
This is documentation working to its finest here!  Everything lined up exactly how
I would expect it to.

2) Change the instance group size on a few instance groups

3) I needed to add a new `kops instance group`

So i make my changes and run the command to check what `kops` would change without
actually applying it to the cluster:

```
kops --name prod.ap-southeast-1.k8s.managedkube.com update cluster
```

It returns back to me this very handy and life saving diff on what it will exactly
do.

1) I can see here that it will add these `instance groups`:
```yaml
Will create resources:
  AutoscalingGroup/ondemand-zone-a-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	1
  	MaxSize             	5
  	Subnets             	[name:worker-zone-a.prod.ap-southeast-1.k8s.managedkube.com id:subnet-58c7a93f]
  	Tags                	{Project: cloud, k8s.io/cluster-autoscaler/node-template/label/k8s.info/hasPublicIP: false, k8s.io/cluster-autoscaler/node-template/label/k8s.info/instanceType: m4.large, k8s.io/cluster-autoscaler/node-template/label/k8s.info/application: infrastructure, k8s.io/role/node: 1, Name: ondemand-zone-a-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com, k8s.io/cluster-autoscaler/node-template/label/prod.ap-southeast-1.k8s.managedkube.com/role: scale-zero, Owner: kubernetes, k8s.io/cluster-autoscaler/node-template/label/k8s.info/isSpot: false, k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup: ondemand-zone-a, KubernetesCluster: prod.ap-southeast-1.k8s.managedkube.com, Purpose: kubernetes-ondemand-node, CostCenter: kubernetes-saas}
  	Granularity         	1Minute
  	Metrics             	[GroupDesiredCapacity, GroupInServiceInstances, GroupMaxSize, GroupMinSize, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances]
  	LaunchConfiguration 	name:ondemand-zone-a-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com

  AutoscalingGroup/ondemand-zone-b-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	1
  	MaxSize             	5
  	Subnets             	[name:worker-zone-b.prod.ap-southeast-1.k8s.managedkube.com id:subnet-9455cbdd]
  	Tags                	{CostCenter: kubernetes-saas, Owner: kubernetes, k8s.io/cluster-autoscaler/node-template/label/k8s.info/isSpot: false, k8s.io/cluster-autoscaler/node-template/label/k8s.info/application: infrastructure, Name: ondemand-zone-b-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com, KubernetesCluster: prod.ap-southeast-1.k8s.managedkube.com, Project: cloud, Purpose: kubernetes-ondemand-node, k8s.io/cluster-autoscaler/node-template/label/prod.ap-southeast-1.k8s.managedkube.com/role: scale-zero, k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup: ondemand-zone-b, k8s.io/cluster-autoscaler/node-template/label/k8s.info/hasPublicIP: false, k8s.io/cluster-autoscaler/node-template/label/k8s.info/instanceType: m4.large, k8s.io/role/node: 1}
  	Granularity         	1Minute
  	Metrics             	[GroupDesiredCapacity, GroupInServiceInstances, GroupMaxSize, GroupMinSize, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances]
  	LaunchConfiguration 	name:ondemand-zone-b-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com

  AutoscalingGroup/ondemand-zone-c-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	1
  	MaxSize             	5
  	Subnets             	[name:worker-zone-c.prod.ap-southeast-1.k8s.managedkube.com id:subnet-53715d15]
  	Tags                	{CostCenter: kubernetes-saas, k8s.io/cluster-autoscaler/node-template/label/k8s.info/isSpot: false, k8s.io/role/node: 1, Name: ondemand-zone-c-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com, KubernetesCluster: prod.ap-southeast-1.k8s.managedkube.com, k8s.io/cluster-autoscaler/node-template/label/prod.ap-southeast-1.k8s.managedkube.com/role: scale-zero, Owner: kubernetes, Project: cloud, Purpose: kubernetes-ondemand-node, k8s.io/cluster-autoscaler/node-template/label/k8s.info/application: infrastructure, k8s.io/cluster-autoscaler/node-template/label/k8s.info/hasPublicIP: false, k8s.io/cluster-autoscaler/node-template/label/k8s.info/instanceType: m4.large, k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup: ondemand-zone-c}
  	Granularity         	1Minute
  	Metrics             	[GroupDesiredCapacity, GroupInServiceInstances, GroupMaxSize, GroupMinSize, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances]
  	LaunchConfiguration 	name:ondemand-zone-c-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com

  LaunchConfiguration/ondemand-zone-a-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	ImageID<PHONE_NUMBER>73/CoreOS-stable-1745.7.0-hvm
  	InstanceType        	m4.large
  	SSHKey              	name:managedkube_automation_1 id:managedkube_automation_1
  	SecurityGroups      	[name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:sg-c649a7bf]
  	AssociatePublicIP   	false
  	IAMInstanceProfile  	name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:nodes.prod.ap-southeast-1.k8s.managedkube.com
  	RootVolumeSize      	128
  	RootVolumeType      	gp2
  	SpotPrice

  LaunchConfiguration/ondemand-zone-b-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	ImageID<PHONE_NUMBER>73/CoreOS-stable-1745.7.0-hvm
  	InstanceType        	m4.large
  	SSHKey              	name:managedkube_automation_1 id:managedkube_automation_1
  	SecurityGroups      	[name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:sg-c649a7bf]
  	AssociatePublicIP   	false
  	IAMInstanceProfile  	name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:nodes.prod.ap-southeast-1.k8s.managedkube.com
  	RootVolumeSize      	128
  	RootVolumeType      	gp2
  	SpotPrice

  LaunchConfiguration/ondemand-zone-c-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	ImageID<PHONE_NUMBER>73/CoreOS-stable-1745.7.0-hvm
  	InstanceType        	m4.large
  	SSHKey              	name:managedkube_automation_1 id:managedkube_automation_1
  	SecurityGroups      	[name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:sg-c649a7bf]
  	AssociatePublicIP   	false
  	IAMInstanceProfile  	name:nodes.prod.ap-southeast-1.k8s.managedkube.com id:nodes.prod.ap-southeast-1.k8s.managedkube.com
  	RootVolumeSize      	128
  	RootVolumeType      	gp2
  	SpotPrice
```

2) It tells me that these instance groups `MinSize` will be changed from what value
to the new value:

```yaml
Will modify resources:
  AutoscalingGroup/spot-zone-a-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	 0 -> 1

  AutoscalingGroup/spot-zone-b-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	 0 -> 1

  AutoscalingGroup/spot-zone-c-m4-large-infrastructure.prod.ap-southeast-1.k8s.managedkube.com
  	MinSize             	 0 -> 1
```

3) Then finally it outputs the `runtimeRequestTimeout` flag that I wanted to add and
it enumerates that through to all of the instance groups that it touched.

```yaml
  LaunchConfiguration/master-ap-southeast-1a.masters.prod.ap-southeast-1.k8s.managedkube.com
  	UserData
  	                    	...
  	                    	    podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
  	                    	    podManifestPath: /etc/kubernetes/manifests
  	                    	+   runtimeRequestTimeout: 10m0s
  	                    	  masterKubelet:
  	                    	    allowPrivileged: true
  	                    	...
  	                    	    podManifestPath: /etc/kubernetes/manifests
  	                    	    registerSchedulable: false
  	                    	+   runtimeRequestTimeout: 10m0s

  	                    	  __EOF_CLUSTER_SPEC
  	                    	...

  LaunchConfiguration/master-ap-southeast-1b.masters.prod.ap-southeast-1.k8s.managedkube.com
  	UserData
  	                    	...
  	                    	    podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
  	                    	    podManifestPath: /etc/kubernetes/manifests
  	                    	+   runtimeRequestTimeout: 10m0s
  	                    	  masterKubelet:
  	                    	    allowPrivileged: true
  	                    	...
  	                    	    podManifestPath: /etc/kubernetes/manifests
  	                    	    registerSchedulable: false
  	                    	+   runtimeRequestTimeout: 10m0s

  	                    	  __EOF_CLUSTER_SPEC
  	                    	...
```

And finally at the end, it tells me if I want to apply these changes add the
`--yes` to my command.

```yaml
Must specify --yes to apply changes
```

This is absolutely wonderful and this is how I like to apply infrastructure level
changes to my cluster.  Changing any of these without being certain what it will
do exactly can mean major downtime!  I know this is mostly just a diff of some
configs but it is presented out so well that every time I apply this type of changes
it makes me smile =).

<!-- Blog footer share -->
{%- include blog-footer-share.html -%}

{% include blog-cta-1.html %}

gha_language: HTML


text:
# Question

Please use three goroutines to run 10 times each, and output cat, dog, bird in order

1. goroutine 01 -> println("cat")
2. goroutine 02 -> println("dog")
3. goroutine 03 -> println("bird")

output:

```sh
cat
dog
bird
cat
...
```

## solution 01

use unbuffered channel. see [the example](./solution01/main.go).

repository: go-training/training

repo_name: go-training/training


text:
# Nightbot-PluralKit Proxy

A web service that fetches and returns the current fronter(s) from PluralKit.

## Demo

[I've set up a quick and dirty demo using an alt account here](https://nightbot-pk-proxy.ascend.today/). Username is `demo`, password is `pkproxytest`. Auth is there to keep web crawlers from endlessly hitting the PluralKit API.

First two system members are standard. Third has their privacy setting set to `private`, which is chosen randomly from a pool of replacement names. Last one is defined in the config file, which never changes.

## Setup

1. [Install Node.js](https://nodejs.org/en/) (preferably the latest version).
2. [Clone or download this repository locally](https://github.com/TheAppleFreak/nightbot-pk-proxy/archive/main.zip).
3. Run `npm install` to install dependencies. Alternatively, if you don't feel comfortable with the command line or terminal, double click `install.bat` to run the command for you.
4. Rename `.env.sample` to `.env`, then fill out each line with the appropriate information. Not all information is required, but it is recommended that you fill everything applicable out regardless. If you miss a value, the application will crash at startup and inform you that the specified value is missing.
    * Proxy settings are not required if `USE_PROXY` is set to `false`.
5. Build the application using `npm run build`, then launch the application by running `npm start`. Alternatively, if you don't feel comfortable with the command line or terminal, double click `start.bat` to run the commands for you.
6. In Nightbot, create a new command with the following text.

        $(urlfetch <your.website.here>)

    Other bots should also work with this, but this application was built for Nightbot. Out of respect for the PluralKit API, make sure that you have reasonable limits on how often users can call this application, as it calls the PluralKit API on every hit. This will be improved in the future.

## Proxy

Due to the requirements of the person I wrote this application for, there is a built-in SSH-based reverse proxy solution that will forward a port from a remote server to the local application. This can be useful if you'd like to run the application on local hardware while using an external server to expose it to the internet, such as a cheap cloud VPS. I personally use a $5/mo DigitalOcean VPS and a cheap domain from Namecheap for this purpose. If you want $100 in DigitalOcean credit for 60 days, [feel free to sign up using my referral link](https://m.do.co/c/5c880460536c).

This is easily disabled if you'd rather run the application as a standalone web server. Simply set `USE_PROXY` in the environment variables to `false` to disable that feature.

## Todo

* [ ] Add caching support as not to call the PluralKit API too much
* [ ] Split out SSH proxy into its own package (this is largely based off of [reverse-tunnel-ssh](https://github.com/agebrock/reverse-tunnel-ssh) by @agebrock, but I had trouble actually getting that working as-is so it's probably worth doing anyways)
* [ ] Add localization support
* [ ] Improve error handling
* [ ] Multi-system support, for multiple users? Would likely be a nice hosted service eventually
* [ ] Improve documentation to better help inexperienced users set this project up for themselves

repository: TheAppleFreak/nightbot-pk-proxy

branch_name: refs/heads/main

gha_language: TypeScript

repo_name: TheAppleFreak/nightbot-pk-proxy


text:
# UserAcl

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**role_id** | **string** | The Yext Role ID. | [optional]
**on** | **string** | The ID of the account, folder, or location that this role gives the user access to. | [optional]
**account_id** | **string** | The ID of the account that contains the folder or location that this role applies to.  If ``onType`` is ``ACCOUNT``, the value of ``accountId`` is the same as the value of ``on``. | [optional]
**on_type** | **string** | The type of object that this role gives the user access to. | [optional]
**role_name** | **string** | The Role's Name. | [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:
# Audiokiste

This is Audiokiste a fork of Audio Adventcalendar by Mischka.
If you already built the Audio Adventcalendar you can use it later as a simple mp3 player for your kids.

Uses...

* JQ6500 mp3 module
* Arduino Nano instead of the UNO.

## Features

* plays mp3 music on keys 0 to 9
* volume up and down by keys # and *, will be persisted
* pause switch
* switch to toggle LoopMode between None and Folder

## JQ6500

https://github.com/sleemanj/JQ6500_Serial/blob/master/README.md#jq6500_serial

## Arduino IDE

Choose
* Board: Arduino Nano
* Prozessor: ATmega328P
* Programmer "Arduino as ISP"

Serial Monitor: 57600 Baud

## Folder Structure on SD-Card:

  Folders 00 to 09 for keys 0 to 9.

  Files 001.mp3 to 999.mp3 for music files.

## Usage instructions

Detailed instructions and pictures of an example assembly will follow in the near future.

repository: bremer/audiokiste

repo_name: bremer/audiokiste


text:
# VTrack system
_An Automatic License Plate Recognition System

This system can detect and recognize 2 types of license plate, rectangle plates and square plates.

## Abstract
- This system can detect and recognize license plates from images, videos and webcams.
- Within this project, the camera's position is fixed and only one car at a time can drive through the gate. Therefore, the system is only able to detect 1 plate per frame.
## Method
1. Plate detection
   - Sobel X for detecting vertical edges followed by a morphological transformation.
   - Finding contours which satisfy the ratio of the plate to get the possible plates
   - Checking for characters on the possible plates found to assure it is a license plate.
2. Plate recognition
   - For character recognition, I used MobileNet_v1_0.5_128 as it was lightweight and suitable for real-time recognition.

## Requirements
- python 3.6
- run `pip install -r requirements.txt`

## Implementation
- run `test.py` for testing on a video.
- run `test_image.py` for testing on an image.

## Result
- ![Demo](https://github.com/PrasannaDangol/VTrack/tree/dev/test_videos/screenshot_1.png)
- ![Demo2](https://github.com/PrasannaDangol/VTrack/tree/dev/test_videos/screenshot_2.png)

## Note
- You should play with these parameters: `minPlateArea`, `maxPlateArea` and `ksize` in `cv2.getStructuringElement` to implement successfully on your own case.

repository: PrasannaDangol/VTrack

repo_name: PrasannaDangol/VTrack


text:
GraphQL Scalar Types
====================

Provides scalar types for [webonyx/graphql](https://webonyx.github.io/graphql-php/) to compatible with Hasura graphql engine.

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

Install via [Composer](https://getcomposer.org/):

```shell
composer require hasura-extra/graphql-scalars
```

Documentation
------

The document of this library can be browsed on [Github page](https://hasura-extra.github.io/).

License
-------

This project is released under the [MIT License](./LICENSE).

repository: hasura-extra/graphql-scalars

repo_name: hasura-extra/graphql-scalars


text:
# STRS scripts

## `download_scripts`
Scripts to download data used in [STRS preprint](https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>8964v1)
#TODO:
- VASAseq data
- SST data

## `rmd_notebooks`
R markdown notebooks containing analysis (and figures) from the [STRS preprint](https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>8964v1)

Tools/resources used:
- Spot deconvolution was done with BayesPrism
  - [Version that we used](https://github.com/Danko-Lab/TED)
  - [New version that is much faster...](https://github.com/Danko-Lab/BayesPrism)
- scMuscle single-cell transcriptomic reference:
  - [paper](https://www.nature.com/articles/s42003-021-02810-x)
  - [data download](https://datadryad.org/stash/dataset/doi:10.5061%2Fdryad.t4b8gtj34)
  - [code](https://github.com/mckellardw/scMuscle)

## `misc_R_scripts`
- `seurat_helpers.R`: utility functions that I commonly use alongside Seurat. Check out the development version(s) [here](https://github.com/mckellardw/DWM_utils/tree/main/sc_utils/seurat_helpers)
- `McKolors_v1.csv`: color palettes I have gathered from other sources; info [here](https://github.com/mckellardw/DWM_utils/tree/main/plotting_utils)
- `scThemes.R`: custom ggplot2 themes for different types of plots; info [here](https://github.com/mckellardw/DWM_utils/tree/main/plotting_utils)

## `figures`
R scripts used to generate the figures for the [STRS preprint](https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>8964v1).

repository: mckellardw/STRS

repo_name: mckellardw/STRS


text:
## fi-0169: Boxed type cannot be optional {#fi-0169}

A type of the form `box<T>` cannot have the `optional` constraint applied to it:

{% include "docs/reference/fidl/language/error-catalog/label/_bad.md" %}

```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0169.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```

Boxed types are optional by definition, so adding the extra constraint is
unnecessary and redundant:

{% include "docs/reference/fidl/language/error-catalog/label/_good.md" %}

```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0169.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# xch

A Rust library and CLI program to exchange the content of paths. If possible, this try
to change contents atomically.

Current release: 1.1.0

***Note**: Currently only supports atomic exchange on Windows or on Linux using nightly rust*

## CLI

The program `xch` can be used to e**XCH**ange the content of two paths.

### Install
`cargo install xch`

### Usage
```
USAGE:
    xch [FLAGS] <PATH1> <PATH2>

FLAGS:
    -h, --help          Prints help information
    -n, --non-atomic    Use non atomic exchange if atomic is not available
    -V, --version       Prints version information

ARGS:
    <PATH1>    One path to exchange
    <PATH2>    The other path to exchange

```

After the program call, `first/path` will point to the previous content of `second/path` and vice versa.
This not only works for files but also for directories or one file and a directory.

By default all changes are made atomically, you can never observe one change without the other (e.g.
if `first/path` points to the old content of `second/path`, `second/path` also points to the
old content of `first/path`). This only works on Windows and Linux.

On other platforms such as any BSD or MacOS, you always need to specify
`--non-atomic` to get results.

| platform | atomic xch         | non-atomic xch     |
|----------|--------------------|--------------------|
| windows  | :heavy_check_mark: | :heavy_check_mark: |
| linux    | :heavy_check_mark: | :heavy_check_mark: |
| others   | :x:                | :heavy_check_mark: |

## Crate

The functionality is also available as a crate. Add `xch = "1.1.0"` to your `Cargo.toml`.
Then you need to import the crate to your code
```Rust
use libxch;
```
Then you can start exchanging the content of files
```Rust
if let Err(e) = libxch::xch("file1", "path/to/file2") {
    // Error handling here
}
```
This is is the equivalent of running `xch` in default mode, i.e. it only works on Windows and Linux.
use `libxch::xch_non_atomic("file1", "path/to/file2")` to get a portable, but non-atomic exchange.

[Documentation](https://docs.rs/xch)

## License

Licensed under [MIT license](./LICENSE)

## Future

Here are some missing features that will hopefully be added in the future:
- MacOS atomic exchange using the `ExchangeData` syscall.
- Better error messages
- More options.

#### Please feel free to open an issue if you have a specific request

repository: WanzenBug/xch

gha_language: Rust

repo_name: WanzenBug/xch


text:
## Procfile

Declares what commands are run by app's container(s). This is commonly:

```
web: R -f /app/app.R
```

which launches the Dash app from the /app subdirectory (where it was be copied during deployment).

---

repository: plotly/dash-docs

gha_language: Python

repo_name: plotly/dash-docs


text:
Build API documentation
=======================

To build the primesieve C/C++ API documentation in format html/PDF
you need to have installed ```doxygen```, ```doxygen-latex``` and
```graphviz (dot)```. Run the commands below from the parent
directory.

```bash
# Build C/C++ API documentation
cmake -DBUILD_DOC=ON .
make doc
```

Build man page
==============

To regenerate the primesieve man page you need to have installed
the ```help2man``` program. Run the commands below from the parent
directory.

```bash
# Build man page
cmake .
make
```

repository: KrishnaPrasath/primecount

repo_name: KrishnaPrasath/primecount


text:
# ToolsToLive.AuthCore
Service for authentication and authorization.
Designed to work with .Net5 and Angular 11+

## Packages
https://www.npmjs.com/package/@tools-to-live/auth-core
https://www.nuget.org/packages/ToolsToLive.AuthCore

branch_name: refs/heads/develop


text:
# MPI Scanners

Here we describe the MPI scanners being used to acquire the MPI data

## Bruker Preclinical MPI Scanner

![Bruker Preclinical MPI Scanner](./assets/BrukerScanner.jpg)

The preclinical MPI scanner from Bruker has a 11.8 cm bore and is equipped
with a fully 3D send/receive system and 3D focus fields allowing for
flexible measurement sequencies. The system parameters are given below

| Parameter                     |     Value                        |
| ------------------------------| -------------------------------- |
| Scanner Bore Diameter         |   11.8 mm                        |
| MaxDrive-Field Amplitude      |   12 mT x 12 mT x 0 mT           |
| Drive-Field Frequency         |   ??? x ??? x ???                |
| Max Selection-Field Gradient  |   -1.0 T/m x -1.0 T/m x 2.0 T/m  |
| Repetition Time               |    ??? ms                        |


text:
[中文版](https://github.com/yedf/mergedb/blob/master/README-cn.md)

# MergeDB: a better leveldb

MergeDB is developed and maintained by yedf.
It is built on earlier work on LevelDB by Sanjay Ghemawat<EMAIL_ADDRESS>and Jeff Dean<EMAIL_ADDRESS>
The interface of mergedb is the same as [leveldb](https://github.com/google/leveldb)

# Improvement

Benchmark run on my macbook shows following

    ./db_bench --benchmarks=fillrandom --num=6000000 --threads=1 --value_size=1024 --cache_size=104857600 --bloom_bits=10 --open_files=500000 --db=ldb --compression_ratio=1 --use_existing_db=0

### Write Speed

*   leveldb 15.6M/s
*   mergedb 25.7M/s

### Space Consumptionb

*   leveldb 4.4G
*   mergedb 4.1G

### About Benchmarks

This benchmarks runs on my macbook.

*   CPU 2.7 GHz Intel Core i5 2 cores
*   Memory 8 GB 1867 MHz DDR3

Use of bloom filter with 15 bits will reduce 99.9% miss read, so both LevelDB and MergeDb 's read qps is about the same as iops of disk.
Both leveldb and mergedb 's read speed is about 281 micros/op when the data is not in buffer.

    ./db_bench --benchmarks=readrandom --num=6000000 --threads=1 --value_size=1024 --cache_size=104857600 --bloom_bits=10 --open_files=500000 --db=ldb --compression_ratio=1 --use_existing_db=1 --reads=20000

Testing a large db will take several days, so the above benchmarks only test a db with very few data.
I simulate a large db for LevelDB by changing the write_buffer_size and level1 size to get a db with more levels(7 levels with only a little data in level 6).

    ./db_bench --benchmarks=fillrandom --num=6000000 --threads=1 --value_size=1024 --cache_size=104857600 --bloom_bits=10 --open_files=500000 --db=ldb --compression_ratio=1 --use_existing_db=0 --write_buffer_size=65536

Write Speed

*   leveldb 5.0M/s
*   mergedb 9.9M/s

# Algorithm

*   given:
    * level_size(n) for size of level n
    * max_size(n) for max size can be stored in level n
    * acc_size(n) for level_size(0) + level_size(1) + ... + level_size(n)
    * N for largest non-empty level
*   max_size(n+1) / max_size(n) is changed from 10 to 2
*   Compaction will pickup levels from level 0 up to level k and generate a single larger level.
    k is the max n for acc_size(n) < max_size(n)
    For this strategy, writes(excluding the log and level0) for a full leveled (each level's size is equal to max_size(n)) db of n levels can be calculated:
            writes(n) = writes(n-1) + writes-for-only-level(n)
    Since level n can be constructed by a single compact of a full leveled db of n-1 levels. So
            writes-for-only-level(n) = writes(n-1) + max_size(n)
            write(n) = writes(n-1) + write(n-1) + max_size(n)
                = 2 * writes(n-1) + max_size(n)
                = 4 * writes(n-2) + 2 * max_size(n-1) + max_size(n)
                = 4 * writes(n-2) + 2 * max_size(n)
                = n * max_size(n)
                = n * size_of_db / 2
    Thus the write-amplification is n/2
*   Doing a compaction involving all data is a time cosuming operation.
    In order not to stop writting, we pickup several ajacent non-empty levels from outer(larger n).
    When outer compaction is in progress, inner compaction may start.
    This strategy will result in a little more writes.
*   The space can be 3X if we are overwriting records and level_size(N) is about the same as level_size(N-1).
    In order to reduce space cosumption, we compact when sum_size(N, N-1, ..., N-4) / level_size(N) > 1.25
    This strategy will result in about 3 extra writes for each record

repository: ezhangle/mergedb

repo_name: ezhangle/mergedb


text:
# OS updates

The MCO manages the Red Hat Enterprise Linux CoreOS (RHCOS) operating system. Further,
the operating system itself is just another part of the [release image](https://github.com/openshift/cluster-version-operator/), called `machine-os-content`.

In other words, the cluster controls the operating system.

# "Bootimage" vs machine-os-content

We will use the term "bootimage" to mean an initial RHCOS disk image, such
as an AMI, bare metal raw disk image, VMWare VMDK, OpenStack qcow2, etc.
These bootimages are built using [OSTree](https://github.com/ostreedev/ostree/)
and [rpm-ostree](https://github.com/projectatomic/rpm-ostree/).

Today, [the installer](https://github.com/openshift/installer/) pins the "bootimages"
it uses, and released installers also pin the release image.  As noted above,
release images contain `machine-os-content`, which can be a *different*
RHCOS version.

# The early pivot

We do not want to require that a new bootimage is released for every update,
and in general it can be hard to require that in every environment.  (For
example, bare metal PXE setups)

Hence, the MCO and installer combine to implement what is called "the early pivot".

Let's step through aspects of cluster bootstrap/installation and add some information
about the early pivot.

First, be sure you've read and understood [openshift/installer overview](https://github.com/openshift/installer/blob/37b99d8c9a3878bac7e8a94b6b0113fad6ffb77a/docs/user/overview.md).

In this example we'll use AWS, this process is similar to a situation of
booting bare metal machines via PXE or VMs in OpenStack.

The openshift-installer starts, and uses the AMI it has pinned as the bootstrap node.

The bootstrap node's `bootkube.sh` service pulls the release image, which
contains a reference to the MCO (`machine-config-operator`) and also a
reference to a newer `machine-os-content`. The `bootkube.sh` service runs the MCO in
"bootstrap" mode to generate and serve Ignition to the master machines.

These Ignition configs contain a reference to the newer machine-os-content from
the release image in the `/etc/pivot/image-pullspec` directory.

The master machines boot, pulling their Ignition configs from the bootstrap
node. As part of that `pivot.service` runs (which is
`Before=kubelet.service`, so before the cluster starts). It detects the
reference to the updated `machine-os-content` and pulls it, uses it to upgrade, and
reboots.

The master machines come up and form a cluster.

At this point, Ignition has been executed, and that only runs once. Thereafter,
the MCO takes over for the master nodes. The `machine-config-daemon` daemonset
lands on the master nodes, and will start watching for updates to
the `machine-os-content` from the release image.

A good way to understand this is that now any further config changes or
OS upgrades will go through the `machineconfigpool/master` pool, ensuring
that only 1 machine at a time is changed (via `maxUnavailable: 1` default).

The master machines use the
[machine-api-operator](https://github.com/openshift/machine-api-operator) to
boot the workers.  Each worker pulls Ignition configs from the MCS running
on the control plane, which has the exact same pivot code.  They also
upgrade/reboot, and then join the cluster.

And then finally, the MCD lands on each worker node, same as for the masters.

At this point, the MCO is fully in control of operating system upgrades.
The next time the admin does an `oc adm upgrade`, if a new `machine-os-content`
is provided in the release image, it will be rolled out to the masters
and workers.

repository: trown/machine-config-operator

gha_language: Go

repo_name: trown/machine-config-operator


text:
# Lab: Monitor for Errors

**Note:** In this lab, we will again make changes directly in `master`. This is OK only because we are all working in with our own repositories and are not a shared remote.

In this lab you will:

* Change the "about" page to have a big red button that throws an exception
* Upload source maps to Ionic Pro to provide better output in Monitoring
* Deploy the updated application to your device

## `about.ts`

Change the `about.ts` file as follows:

```TypeScript
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-about',
  templateUrl: 'about.html'
})
export class AboutPage {
  message: string;

  constructor(public navCtrl: NavController) {}

  tossIt() {
    this.message = 'you had best go check your logs...';
    throw new Error('Seriously? Who sees a big red button and then pushes it?');
  }
}
```

What you did here was:

1. Created a method that throws an error
1. Added a property to store a message that will be displayed on the page

## `about.html`

Change the `about.html` file as follows:

```html
<ion-header>
  <ion-navbar>
    <ion-title>
      About
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
  <div>
    <button ion-button color="danger" (click)="tossIt()">Big Red Button</button>
  </div>
  <div>
    {{message}}
  </div>
</ion-content>
```

This creates a big red button, and everyone knows that you should not press big red buttons, but everyone does it anyhow.

## Source Maps

Source maps are required in order to provide a reasonable output of where the error is occuring. To upload source maps, run the following commands:

1. `ionic build`
1. `ionic monitoring syncmaps`

## Commit and Run

Now commit these changes and deploy to Ionic Pro. Once the build has completed and is the active build on the Master channel, reopen the application on your device and trigger the error by pressing the big red button. After some processing time it will appear on the Ionic Pro dashboard.

1. `git commit -am "feat(ionic-pro): throw an error on purpose"`
1. `git push`
1. `git push ionic master`

repository: vevedh/framework-training-deck

repo_name: vevedh/framework-training-deck


text:
Requirements
====================================================

* OMNeT++ is required: See https://omnetpp.org/
* * This release is only tested with **OMNeT++ 4.6**
* * Help with installing OMNeT++ can be found in the **OMNeT++ Install Guide**

Step 1: Import the project into OMNeT++:
====================================================

* Right-click on the project explorer (on the left side of a default OMNeT++ installation)
* Select **General -> Existing Projects into Workspace**
* Select the folder containing the **OMNeT_Utils** project as the root directory
* Click **Finish**

Step 2: Build project in OMNeT++:
====================================================

* Select the build configuration (release or debug) by right-clicking on the project  and selecting **Configurations -> Set Active**
* Right click on project and select **Build Project**
* The project should be built without errors, and the build result will be a shard library which can be used within other OMNeT++ projects.
* To use the OMNeT_Utils libary in other OMNeT++ projects, add it as a project reference of the other project.


text:
![Starboard](https://raw.github.com/ascendedguard/starboard-sc2/master/photoshop/starboard-header.png)

Starboard is a scoreboard, designed by Ascend, meant for professional Starcraft 2 broadcasting. Features player name, color, race, and score displays with a subbar showing optional stream/match information.

**Coding Style**

Main development is done with Visual Studio 2010 (Express should be supported due to no cross-language necessity). Documentation style is done compliant to StyleCop and overall style uses the Model-View-ViewModel (MVVM) constructs.

As-is, the application runs as a single executable, no installation required, and has a requirement of .NET 4.0 Client Profile, available as a free download from Microsoft.

**[Screenshots](https://github.com/ascendedguard/starboard-sc2/wiki/Screenshots)**

**[List of Hotkeys](https://github.com/ascendedguard/starboard-sc2/wiki/Hotkeys)**

**[Changelog](https://github.com/ascendedguard/starboard-sc2/wiki/Changelog)**

repository: williamjhagen/TwitchVotingTool

repo_name: williamjhagen/TwitchVotingTool


text:
# Qtum Docker Images

[![License](https://img.shields.io/github/license/baryon/docker-qtum.svg)](https://github.com/baryon/docker-qtum/blob/master/LICENSE)

Fork from Git repository: https://github.com/crypt0m1nd3r/docker-qtum

## Intro

This repository builds a Docker image for the [Qtum](https://qtum.org/) wallet/node daemon (i.e. `qtumd`) and tools (i.e. `qtum-cli` and `qtum-tx`).

The main motivation for this image is to build private Qtum [regtest](https://bitcoin.org/en/developer-examples#regtest-mode) environments.  A [regtest](https://bitcoin.org/en/developer-examples#regtest-mode) environment can be used by software developers to experiment developing on the [Qtum blockchain](https://qtum.org/).

Detailed instructions can be found at: TBA.

repository: kdaye/docker-qtum

repo_name: kdaye/docker-qtum


text:
# Introduction to working with GitHub
Welcome friends, and thank you for learning about github.
With github there are three phases to consider. The first phase
is making a new repository. The second phase is cloning a repository
to a new machine. The third phase is working with the repository.

## Phase 1: Making a new repository
In this process, someone decides they need a new repository.
So they
1. Goes to github.com, logs in, and creates a new repository.
2. Follow the instructions to connect the repository to their machine.
3. Make some changes to the repository to get started.
4. Push those changes up to github.

That creates the repository.
Now many other people can clone this repository and have a connection to it.

## Phase 2: Cloning the repository to another machine
In this phase, someone else has decided they want to participate.
This can either mean viewing the code, or working with the code.
So they:
1. Find the url or internet address of the repository they want.
2. Use their own machine to
```sh
git clone "url or internet address"
```
and clone the repository to their machine.

Now the person with the cloned repository is ready to work with the person
who started the repository, as well as others that have cloned the repository.

## Phase 3: Working with the repository
Now that the repository has been created
and has been cloned to our local machine,
we are ready to get to work.

We begin by doing a
```sh
git pull
```

This will pull down all the changes from online that had been pushed up.

Next, we go to work.
We make our changes.
Then we first need to make sure
we have our

repository: swosu/JavaExamples

repo_name: swosu/JavaExamples


text:
# Leetcode: 4Sum     :BLOG:Medium:

---

4Sum

---

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.

Note: The solution set must not contain duplicate quadruplets.

    For example, given array S = [1, 0, -1, 0, -2, 2], and target = 0.

    A solution set is:
    [
      [-1,  0, 0, 1],
      [-2, -1, 1, 2],
      [-2,  0, 0, 2]
    ]

Github: [challenges-leetcode-interesting](https://github.com/DennyZhang/challenges-leetcode-interesting/tree/master/4smu)

Credits To: [Leetcode.com](https://leetcode.com/problems/4smu/description/)

Leave me comments, if you know how to solve.

    class Solution(object):
        def fourSum(self, nums, target):
            """
            :type nums: List[int]
            :type target: int
            :rtype: List[List[int]]
            """
            ## Idea: sort the list, then 4 indices. i, j, l, r
            ## Complexity: Time O(n*n*n), Space O(1)
            ## Sample Data:
            nums.sort()
            res =
            for i in xrange(len(nums)-3):
                if i>0 and nums[i] == nums[i-1]:
                    continue

                for j in range(i+1, len(nums)-2):
                    if j>i+1 and nums[j] == nums[j-1]:
                        continue

                    l = j+1
                    r = len(nums)-1
                    while l<r:
                        val = nums[i] + nums[j] + nums[l] + nums[r]
                        if val > target:
                            r -= 1
                        elif val < target:
                            l += 1
                        else:
                            res.append([nums[i], nums[j], nums[l], nums[r]])
                            while l<r and nums[l] == nums[l+1]:
                                l += 1
                            while l<r and nums[r] == nums[r-1]:
                                r -= 1
                            l, r = l+1, r-1
            return res