text:
# Hair Salon
### Created By: Ben Ronda
***
## Project Description:
This site was designed to demonstrate proficiency in one-to-many database relationships, where *one* stylist has *many* clients.

It was built using the following:
* PHP
* Twig & Silex
* MySQL
* HTML and CSS
* Tests ran using PHPUnit

***
## Installation:
To install Hair Salon clone the following repository by:
1. Open up your terminal and type the following line:
`git clone https://github.com/ben-ronda/hair_salon_take_two.git`
2. Use this line to change directories to the project folder: `cd hair_salon_take_two`
3. In order to load the pages correctly make sure you run: `composer install`
3. Use this line to change into the web directory: `cd web`
4. Once you are in your web directory, run this line to start a local webserver `php -S localhost:8000`
5. Finally open your web browser and type `localhost:8000` into your URL bar to load the page.
***
## License
Copyright (c) 2016 Ben Ronda

This software is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
# android-usb-permission-issuer
The application grant access to all Arduino usb devices connected to Android device.

To application must be published to system folder as it should be runned as system service.
Pay attanetion that application must be installed to /system/priv-app/ folder, not system/app.
Otherwise, you will have the error: Neither user 10059 nor current process has android.permission.MANAGE_USB.

The command line example to install application on device:
adb push usb-permission-issuer.apk /system/priv-app/
adb shell chmod 644 /system/priv-app/usb-permission-issuer.apk

Tested on Odroid-XU4 device.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Developer's Guide

## Introduction

Requirements engineering is a key part of software development. Without requirements, a project's goals are hard to define and it is not clear, when the software is actually finished. Additionally, as requirements are often provided from customers towards the development organization, they are essential to ensure that all parties have the same understanding of the product. Without requirements, projects often end up as shown in the famous cartoon, [the swing and the tree](https://blog.codefor.cash/2017/08/30/software-development-risks-the-tree-swing-risk/).

In safety critical software development projects, requirements engineering has even more responsiblity. It is not sufficient to simply describe the product. A comprehensive tracing from requirements towards software and tests is necessary, too, to prove that all parts of the source code are necessary and there is no code, that shouldn't be there. Every piece of code may introduces a bug, resulting in a safety issue, and therefore argumentation is required, why it is necessary.

The REL project provides the so called "REL framework", which enables requirements engineers to define a requirements model for their software project. It allows definition of a specification, which structures the actual requirements data, and extends the requirements text with additional attributes and links. Supported by the model, software engineers can then focus on writing their requirements plus all necessary meta data. Besides the underlying DSL, the REL framework also consists of a language server implementation, which can be used to get IDE support, while working with the text files. Additionally, python integration is available, so that requirements engineers can easily write custom data exporters and validation scripts.

## Key Features of the REL Framework

- [Domain Specific Language](../rel-lib/grammar), which allows defining a requirements model with types, links, and enumerations. This model is then filled with requirements data, namely text and necessary meta data. The domain specific language resides in text files, which can be stored on the file system or in a repository, which is the fundament of all well-establised agile working models for software development
- [Core C++ Library](../rel-lib), implementing a parser for the DSL and fundamental model checking. It is implemented in C++17, without external dependencies to other libraries. The library can be embedded into any environment that is capable of integrating C++ libraries.
- [Command Line Interface](../rel-cli), to validate a requirements model by parsing all files that belong to it. It can be used in CI environment, to do fundamental model checking with every commit.
- [Language Server Implementation](../rel-ls) and [Visual Studio Code](../vscode-ext) plugin, to support developers with a powerful IDE, while working with the DSL.
- [Python Integration](../relpy), so that requirements engineers can write project-specific exporters and data validation scripts.

In a nutshell, the REL framework shall enable requirements engineers to define a requirements model and the corresponding processes, which helps the whole team to focus on the actual work of writing valuable requirements. With the domain specific language as core element, well-known agile processes can be applied. The tooling provided in the framework is focusing on clear usecases, and always provides hooks for project-specific extensions. In an ideal world, requirements engineers use the REL framework to define tooling and processes upfront, so that developers can then focus on the creative work of writing requirements.

## Not in Scope of the REL Framework

- The REL framework does not provide any guidance on **how** to write the actual requirement. English or German, semi-formal, or using HTML within the requirement text - these are project-specific decisions and there are tons of publications and books available, that elaborate on this topic. All tools within the framework can deal with unicode characters and line breaks within the requirements text, and therefore support all kinds of content.
- The REL framework does not provide any guidance about the processes, that embed requirements engineering into the software project. Processes are highly project-specific and for example tightly coupled to the safety classification of the final product. As the data resides in text files, all agile software development processes can be applied and tailored. REL's python integration allows an easy extension with project specific exporter or validation scripts. Integration into CI and automated tests can easily be developed.

## Getting Started

### Installation

To get more information about compiling and using the individual tools of the REL framework, please have a look at the corresponding README.md files.

Installation instructions of the Visual Studio Code extension can be found [here](../vscode-ext/README.md).

### Domain Specific Language Overview

The grammer of REL's domain specific language is defined [here](../rel-lib/grammar/grammar.g).

#### Requirements Specification

Within the requirements specification (file ending _.rs_), the requirements model is defined. It is possible to define custom types and enumerations.

```
type TypeName {
	attribute_name : attribute_type,
	attribute_name_2 : EnumType,
	...
}

enum EnumType {
	EnumValue1,
	EnumValue2,
	....
}
```

`attribute_type` can either be an enum type name or one of the following data types:

| Data Type        | Description  |
| ------------- |-------------|
| `id`      | A unique identifier. The parser ensures that the string used as identifier within the data is unique among the whole project.  |
| `int`      | A signed integer value.      |
| `string` | A string value, encapsulated in quotation marks.      |
| `link` | Unique id(s) of the requirement(s), the link points to. The parser ensures that all identifiers used within the link attribute exist in the model. |

#### Requirements Data

Requirements data files (file extension _.rd_) contain type instances of the `type`s defined in specification.

```
TypeName {
	attribute_name : value,
	attribute_name_2 : value,
	...
}
```

Depending on the attribute's data type within `type`'s specification, `value` is one of the following:

- `id`: an identifier defining a unique id
- `int`: a signed integer
- `string`: a string, encapsulated in quotation marks
- `link`: an identifier, that is equal to an unique id. An attribute of type `link` can contain one or more id references. If there are more links, an array notation with squared brackets `[` and `]` has to be used.
  - Example:
    - Link to single unique id: `parent_req : UniqueId1,`
	- link to multiple unique ids: `parent_req : [UID1, UID2,],`

If the attribute's data type is an enum type, `value` has to be an enum value, that exists in the enum type. Otherwise, the parser complains about non-existing enum value.

See [REL's requirements](../requirements) or the [test project](../test) for more syntax examples.

### Designing the Requirements Specification

Designing and writing the requirements specification is the starting point, if the REL framework is used in a software development project. The following design guidelines help requirements engineers to cover all aspects in their project. It is also recommended to study the examples available in the project, namely [REL's own requirements](../requirements) and [all test projects](../test).

At the beginning, the main type definitions are specified, which cover the majority of requirements data within the project. Requirements engineers should always think about the necessary attributes, which are required and make sense to support the processes. The more attributes, the more effort developers have to spend while creating type instances and filling them with data. Additionally, more attributes most likely lead to more efforts in terms of custom validations, that are executed in CI and are not covered by REL's basic validation (which only takes care about syntax and validity of type instances and their specification).

### Data Structuring

All data is stored in text files. This means that some kind of file and directory structure has to be defined, so that developers know where to put their content. It is important to define a suitable structure at the beginning, so that people can start working. Some aspects to consider:

- the REL parser processes all files in an alphabetical order. This behavior is important to know, because on the one hand, it ensures deterministic execution. On the other hand, sequence of files located in the repository has an impact, e.g. on data export. The sequence files and the data inside is parsed is reflected within the output artefacts, e.g. within a generated HTML file. This behavior is intended, because requirements are always categorized (at least by their files) or are maybe accompanied with explanatory paragraphs, which only make sense if the order is preserved.
- Requirements specification can be distributed among multiple files or can be kept in a single file. The parser always processes all specification files found within the directory trees first.
- It makes sense to split the actual requirements data into multiple files, grouped depending on their scope. A "category", if necessary, can either be implied by the file name or another approach would be to define a text field or enumeration, that defines the category.

### Custom Validation and Export Formats

Every project has its own needs in terms of custom validation and export formats. Therefore [relpy](../relpy) embeds REL into python, so that requirements engineers can write own scripts that operate on the model. For sample code and more explanation about the python integration, refer to the [README of relpy](../relpy/README.md).

For example, a custom valiator could check that a set of attributes is set consistently, or that special metrics applied to the requirement text (e.g. contains valid semi-formal formulas) are fulfilled. The REL parser itself already ensures the following:
- syntax of the language in all files is valid
- type instance matches to type definition within specification
- attributes defined as "id" are uniquely set among the whole model
- Enum attributes used in type instances exist
- the whole model can be read without errors

For all other use cases, own validators can be written in python.

The same applies for export formats: Excel, HTML, CSV, PDF, ... depending on the stakeholders and the size of the project, there are different needs. With custom python scripts, the requirements model can be transferred in every format desired.

### CI Integration

[rel_cli](../rel-cli) can be used to parse the model on command line. It checks syntax and compliance of the data to the specification. If rel-cli is integrated into CI, it can check every pull request, to ensure that the model is always consistent.

To validate the requirements in more detail, custom validators can be written in python, by using [relpy](../relpy). The resulting scripts can then be executed as part of the pull request validation, too.

## Setup Dependency to REL Framework in Bazel

The REL project is available on Github and uses Bazel as build system. All build steps and the fundamental run options of the framework are available via Bazel.

If you create an own repository for your requirements project, consider using Bazel as build system for it. A build system for requirements? Yes, this makes totally sense, because lots of operations that are normally used for programming, can be applied to requirements projects that use REL, too. For example, validating the current model. Or run the HTML export. In the following paragraphs, we will describe how to setup a Bazel build environment for you requirements project and model the dependency towards REL's repository, to benefit from its Bazel integration.

If you are not familiar with Bazel so far, and for more information about it, please refer to its documentation on the web: [bazel.build](https://bazel.build)

### Setting up Dependency to REL Repository in WORKSPACE file

Within your Bazel WORKSPACE file, located in the root of your repository, add REL's Git repository as a new entry:

```
git_repository(
    name = "rel",
    remote = "https://github.com/sscit/rel",
    tag = "v0.6.0",
)
```

Check the [REL Release Page](https://github.com/sscit/rel/releases) on Github to find out about the latest release of REL and the corresponding tags.

### Defining Bazel Validation Rule for Requirements Project

In the previous chapter, setting up the initial requirements specification and the relationship towards requirements data has been described. We now assume that you defined a basic model in folder "requirements" within your repo, consisting of a requirements specification `spec.rs` and one data file `data.rd`. To make them available via Bazel, create a BUILD file with one file group in folder "requirements":
```
filegroup(
    name = "my_requirements",
    srcs = glob(["*.rd"]) + ["spec.rs"],
    visibility = ["//visibility:public"],
)

```

Additionally, create a `sh_binary` in the same BUILD file, which can be executed with `bazel run`. The rule pulls all required tools from the REL repository, builds them if necessary and executes them on the command line, together with your model as input data.

```
sh_binary(
    name = "validate_my_requirements",
    srcs = ["@rel//rel-cli:rel_cli_script"],
    args = ["-r", "-v", "./requirements"],
    data = [":my_requirements", "@rel//rel-cli:rel_cli"],
    visibility = ["//visibility:public"],
)
```

Run validation via bazel:
```
bazel run //requirements:validate_my_requirements
```

Note that bazel run incorporates building rel_cli from source. Therefore C++17 compiler has to be available. You may have to add file [.bazelrc](./../.bazelrc) into your workspace root folder or extend it with the necessary compiler options.

repository: lsp-implementaions/rel

branch_name: refs/heads/main

repo_name: lsp-implementaions/rel


text:
# Creating AuthServers to Authenticate and Authorize

An `AuthServer` is a service that handles creating, verifying and refreshing authorization tokens. You create an `AuthServer` in your application channel and inject into types that deal with authorization. This types include:

* `Authorizer`: middleware controller that protects endpoint controllers from unauthorized access
* `AuthController`: endpoint controller that grants access tokens
* `AuthCodeController`: endpoint controller that grants authorization codes to be exchanged for access tokens

An `AuthServer` must persist the data it uses and creates - like client identifiers and access tokens. Storage is often performed by a database, but it can be in memory, a cache or some other medium. Because of the many different storage mediums, an `AuthServer` doesn't perform any storage itself - it relies on an instance of `AuthServerDelegate` specific to your application. This allows storage to be independent of verification logic.

## Creating Instances of AuthServer and AuthServerDelegate

`AuthServerDelegate` is an interface that an `AuthServer` uses to handle storage of client identifiers, tokens and other authorization artifacts. An `AuthServer` must be created with a concrete implementation of `AuthServerDelegate`. Conduit contains a concrete implementation of `AuthServerDelegate` that uses the ORM. It is highly recommended to use this implementation instead of implementing your own storage because it has been thoroughly tested and handles cleaning up expired data correctly.

This concrete implementation is named `ManagedAuthDelegate<T>`. It exists in a sub-package of Conduit and must be explicitly imported. Here's an example of creating an `AuthServer` and `ManagedAuthDelegate<T>`:

```dart
import 'package:conduit/conduit.dart';
import 'package:conduit/managed_auth.dart';

class MyApplicationChannel extends ApplicationChannel {
  AuthServer authServer;

  @override
  Future prepare() async {
    final context = ManagedContext(...);
    final delegate = ManagedAuthDelegate<User>(context);
    authServer = AuthServer(delegate);
  }

  ...
}
```

\(Notice that `ManagedAuthDelegate` has a type argument - this will be covered in the next section.\)

While `AuthServer` has methods for handling authorization tasks, it is rarely used directly. Instead, `AuthCodeController` and `AuthController` are hooked up to routes to grant authorization tokens through your application's HTTP API. Instances of `Authorizer` secure routes in channels. All of these types invoke the appropriate methods on the `AuthServer`. Here's an example `ApplicationChannel` subclass that sets up and uses authorization:

```dart
import 'package:conduit/conduit.dart';
import 'package:conduit/managed_auth.dart';

class MyApplicationChannel extends ApplicationChannel {
  AuthServer authServer;
  ManagedContext context;

  @override
  Future prepare() async {
    context = ManagedContext(...);
    final delegate = ManagedAuthDelegate<User>(context);
    authServer = AuthServer(delegate);
  }

  @override
  Controller get entryPoint {
    final router = Router();

    // Set up auth token route- this grants and refresh tokens
    router.route("/auth/token").link(() => AuthController(authServer));

    // Set up auth code route- this grants temporary access codes that can be exchanged for token
    router.route("/auth/code").link(() => AuthCodeController(authServer));

    // Set up protected route
    router
      .route("/protected")
      .link(() => Authorizer.bearer(authServer))
      .link(() => ProtectedController());

    return router;
  }
}
```

For more details on authorization controllers like `AuthController`, see [Authorization Controllers](controllers.md). For more details on securing routes, see [Authorizers](authorizer.md).

## Using ManagedAuthDelegate

`ManagedAuthDelegate<T>` is a concrete implementation of `AuthServerDelegate`, providing storage of authorization tokens and clients for an `AuthServer`. Storage is accomplished by Conduit's ORM. `ManagedAuthDelegate<T>`, by default, is not part of the standard `conduit` library. To use this class, an application must import `package:conduit/managed_auth.dart`.

The type argument to `ManagedAuthDelegate<T>` represents the application's concept of a 'user' or 'account' - OAuth 2.0 terminology would refer to this type as a _resource owner_. A resource owner must be a `ManagedObject<T>` subclass that is specific to your application. Its table definition _must extend_ `ResourceOwnerTableDefinition` and the instance type must implement `ManagedAuthResourceOwner<T>`, where `T` is the table definition. A basic definition may look like this:

```dart
class User extends ManagedObject<_User>
    implements _User, ManagedAuthResourceOwner<_User> {
}

class _User extends ResourceOwnerTableDefinition {
  @Column(unique: true)
  String email;
}
```

By extending `ResourceOwnerTableDefinition` in the table definition, the database table has the following four columns:

* an integer primary key named `id`
* a unique string `username`
* a password hash
* a salt used to generate the password hash

A `ResourceOwnerTableDefinition` also has a `ManagedSet` of `tokens` for each token that has been granted on its behalf.

The interface `ManagedAuthResourceOwner<T>` is a requirement that ensures the type argument is both a `ManagedObject<T>` and `ResourceOwnerTableDefinition`, and serves no other purpose than to restrict `ManagedAuthDelegate<T>`'s type parameter.

This structure allows an application to declare its own 'user' type while still enforcing the needs of Conduit's OAuth 2.0 implementation.

The `managed_auth` library also declares two `ManagedObject<T>` subclasses. `ManagedAuthToken` represents instances of authorization tokens and codes, and `ManagedAuthClient` represents instances of OAuth 2.0 clients. This means that a Conduit application that uses `ManagedAuthDelegate<T>` has a minimum of three database tables: users, tokens and clients.

`ManagedAuthDelegate<T>` will delete authorization tokens and codes when they are no longer in use. This is determined by how many tokens a resource owner has and the tokens expiration dates. Once a resource owner acquires more than 40 tokens/codes, the oldest tokens/codes \(determined by expiration date\) are deleted. Effectively, the resource owner is limited to 40 tokens. This number can be changed when instantiating `ManagedAuthDelegate<T>`:

```dart
final delegate = ManagedAuthDelegate(context, tokenLimit: 20);
```

## Configuring the Database

`ManagedAuthDelegate<T>` requires database tables for its users, tokens and clients. Use the [database command-line tool](../db/db_tools.md) on your project to generate migration scripts and execute them against a database. This tool will see the declarations for your user type, `ManagedAuthToken` and `ManagedAuthClient` and create the appropriate tables.

repository: aadarshadhakalg/conduit

repo_name: aadarshadhakalg/conduit


text:
All CRUD operations under the hood use `StorageManager.operation()`, which then runs the operations through all configured middleware before calling `StorageBackend.operation()`. This is used by the device-to-device Sync functionality for example to log all database modifications to a separate log. `StorageMiddleware` usage looks like this:

```typescript
import { StorageMiddleware } from '@worldbrain/storex/lib/types/middleware'

export class LogMiddleware implements StorageMiddleware {
    public log : Array<{ operation : any, result : any }> = []

    async process ({operation, next} : { operation : any[], next : { process : Function } }) {
        const result = await next.process({operation})
        this.log.append({ operation, result })
        return result
    }
}

// Setup your storageManager here
const logMiddleware = new LogMiddleware()
storageManager.setMiddleware([
    logMiddleware,
])
await storageManager.collection('user').createObject({ name: 'Joe' })
console.log(logMiddleware.log)
```

repository: WorldBrain/storex

gha_language: TypeScript

gha_license_id: MIT

repo_name: WorldBrain/storex


text:
---
title: "Tuples"
permalink: /docs/python/tuples-python/
excerpt: "This post discuss about the tuples data structure in python"
author_profile: false
sidebar:
  title: "Python"
  nav: python
toc: true
read_time : true
toc_sticky: true
---

A t`tuple` in Python is similar to python `list` that we have previously discussed. The difference between the two is that we cannot change the elements of a tuple once it is assigned whereas we can change the elements of a list.  Tuple is normally enclosed by `( )`.

##### creating a tuple in python

A tuple is created by placing all the items (elements) inside parentheses `()`, separated by commas. It can have any number of items and they may be of different data types.

```python
# empty tuple
my_tuple = ()

# tuple of strings
my_tuple = ("Apple","Orange","Banana")

# tuple of integers
my_tuple = (1,4,5)

# tuple of mixed data types
my_tuple = (2,"Coconut",4,7.68)
```

There can be nested tuples as well,

```python
# nested tuple containing tuples as well as lists
my_tuple = (2,["Coconut","Apple","Orange"],4,7.68,(1,2,2))
```

One thing to notice here is that,`my_tuple` is also an object in python of the `tuple` type. Tuple can be created without using `( )`, which is known as **tuple packing**.

##### how to access elements from a tuple

`tuple` objects in python can be accessed through indexing, similar to that of `list`.

```python
# creating a tuple of items
my_tuple = ("Apple","Orange","Jackfruit")

# printing the tuple elements starting from 0
print(my_tuple[1])
print(my_tuple[-2])
print(my_tuple[2])

# trying to access the 3rd index
try:
    print(my_tuple[-4])
except:
    print("An error occured")
```

```
OUTPUT :

Orange
Orange
Jackfruit
An error occured
```

##### how to access a range of elements in a tuple ?

We can access a range of items in a tuple by using the slicing operator colon `:`, similar to that of `list`.

```python
# tuple slicing in Python
my_tuple = ('e','d','u','a','l','g','o')

# elements 3rd to 5th
print(my_tuple[2:5])

# elements beginning to 3rd
print(my_tuple[:-4])
```

```
OUTPUT :

('u', 'a', 'l')
('e', 'd', 'u')
```

##### changing elements of a tuple

Unlike lists, tuples are immutable. This means that elements of a tuple cannot be changed once they have been assigned. But, if the element is itself a mutable data type like list, its nested items can be changed. This is one of the important difference between the `tuple` and the `list` data type.

```python
# declaring a tuple in python
my_tuple = (1,2,3,5,6)

# changing one item of the tuple
try:
    my_tuple[3] = 10
    print(my_tuple)
except:
    print("Error occured")
```

```
OUTPUT :

Error occured
```

##### adding/inserting elements to a tuple

Unlike lists, we can't add/insert elements to a tuple. Tuples are immutable in nature, hence there are no such methods in python which can enable addition of new elements to the tuple. But there are few techniques that can be used to add elements to the tuple. One of which is **tuple concatenation**.

##### concatenating in a tuple

The `+` operator can be used for the concatenation of tuples, similar to lists.

```python
# creating the tuples
tuple1 = (1,2,3,4)
tuple2 =  ("Apple","coconut")

# adding the tuples
tuple3 = tuple1 + tuple2

# printing the added tuples
print(tuple3)
```

```
OUTPUT :

(1, 2, 3, 4, 'Apple', 'coconut')
```

##### deleting elements from the tuple

As tuples are immutable in nature, deleting an element is not possible, unlike lists. But the entire deletion of the tuple is possible by using the `del` keyword.

```python
# creating the tuples
tuple1 = (1,2,3,4)

del tuple1

try:
    print(tuple1)
except:
    print("An error occured")
```

```
OUTPUT :

An error occured
```

#### Exercise your way out

1. Write a Python program to add an item in a tuple.

2. Write a Python program to find the repeated items of a tuple.

3. Write a Python program to check whether an element exists within a tuple.

4. Write a Python program to reverse a tuple.

5. Write a Python program to unzip a list of tuples into individual lists.

6. Write a Python program to convert a tuple of string values to a tuple of integer values.

   ```
   Original tuple values:
   (('333', '33'), ('1416', '55'))
   New tuple values:
   ((333, 33), (1416, 55))
   ```

 **We are here to help** ! Be sure to check our website and don't hesitate to ask any questions on our community platform. We provide personal mentoring and teaching too, in order to upgrade your skills. Vist [www.edualgoacademy.com](https://www.edualgoacademy.com) to get started.
{: .notice--info}

 **Spotted a bug ?** Great job, you found a bug. Please report it to us in our<EMAIL_ADDRESS>and we'll fix it as soon as possible.
{: .notice--danger}

repository: edualgo/StudyPortal-Docs

repo_name: edualgo/StudyPortal-Docs


text:
# Valley

## About

Valley is a simple theme and accompanying color scheme for Sublime Text 2 & 3. It is mostly derived from  [Soda](https://github.com/buymeasoda/soda-theme), the right place to start for any custom theme development for Sublime. Thanks Soda!

## Design

![Screen Shot!](https://raw.github.com/luozhihua/sublime-theme-valley/master/screenshots.png)

## Installation
Alternatively, if you are a git user, you can install the theme and keep up to date by cloning the repo directly into your `Packages` directory in the Sublime Text application settings area.

While inside the `Packages` directory, clone the theme repository using the command below:

```bash
git clone git://github.com/luozhihua/sublime-theme-valley.git "Theme - Valley"
```

### Manual Installation
You can also install it manually by following these instructions:

1. [Download theme files](https://github.com/luozhihua/sublime-theme-valley/archive/master.zip)
2. Unzip the files and copy the folder newly created folder into your Sublime Text Packages directory with the name `Theme - Valley`. You can find that directory by selecting "Preferences > Browse Packages ...".

## Activating the Theme
Activate the theme by modifying your user preferences to include the following:

```javascript
{
  "theme": "Valley Dark.sublime-theme",
  "color_scheme": "Packages/Theme - Valley/Valley Dark.tmTheme"
}
```

If you need help locating your user preferences file, you can find it selecting "Preferences > Settings - User".

## Optional Settings
The following options can be set in your user preferences:

```javascript
{
  // Monokai color scheme (SublimeText's default) with Valley background color
  "color_scheme": "Packages/Theme - Valley/Valley Monokai.tmTheme",

  // Ability to change row height of sidebar tree
  // Options: xsmall, small, medium, large, xlarge
  "flatland_sidebar_tree_xsmall" : true
}
```

repository: luozhihua/sublime-theme-valley

repo_name: luozhihua/sublime-theme-valley


text:
# local

**local** is a web platform that allows local businesses to sell their products online and make them available to a broader range of customers rather than just their locals ones and neighbors.

From restaurants to fruit shops, bakeries, or traditional product makers and sellers, they all have a chance to sell on **local**.
Local and traditional products are now accessible to everyone, everywhere.

## Motivation

This project is a consequence of CS50's final project to develop a software from scratch.
The idea was to build a web based application for small businesses, allowing them to have a platform to sell and showcase their products to a broader audience.

From a customer point of view they can find more products that are not accessible in big supermarkets and buy local in an easier way.

## Version

`1.0.0`

* As a **Business** you can:
    * register;
    * log in;
    * create a business (register your activity on **local**);
    * edit your account details;
    * add stores;
    * add products;
    * check orders received.

* As a **Customer** you can:
    * register;
    * log in;
    * edit your account details;
    * add products to a basket;
    * buy products
    * see your current and past orders

## Screenshots

![basket](screenshots/basket.png)
![orders](screenshots/orders.png)
![login](screenshots/login.png)

## Tech/framework used

**local** was built with:

* Flask - as a web application framework;
* Bootstrap - for views' styling;
* Sqlite3 - for database management;

## Libraries

* Flask `pip install Flask`
* Flask-Session `pip install Flask-Session`
* CS50 `pip install cs50`
* WTForms `pip install WTForms`
* Flask-WTF `pip install Flask-WTF`
* Pillow `pip install pillow`

## How to launch local

1. Clone this repo
2. Check if you have all the packages installed on your machine
3. In your project directory, open your terminal and run:
    * Macbook or Linux `flask run`
    * Windows `python -m flask run`
4. On your terminal window will display "Running on http://(address):(port)"
5. Click or copy it to your browser
6. You are ready to go!

## Improvements

We hope `1.0.0` is the first version of a future real application and the improvements are constant but we already have this in mind:

* Filter stores by location or category
* Apply promo to product's price
* Send an email notification when orders' status change
* Apply a new design

## Credits

This project was an idea of two CS50 students who met online and that, after a couple of messages, decided to start working on this final project together.
They are:

* [@JadeRebecca](https://github.com/JadeRebecca)
* [@jopijuco](https://github.com/jopijuco)

## License

MIT License

repository: jopijuco/local

gha_language: Python

repo_name: jopijuco/local


text:
# Tooler [![Build Status](https://travis-ci.org/revathskumar/tooler.png?branch=master)](https://travis-ci.org/revathskumar/tooler)
## Ruby Project boilerplater

### What it does
 * Generate minimum code need to run
 * Add README.md
 * Add License
 * Add .gitignore
 * Add Gemfile
 * Add Procfile

### Install
    $ gem install tooler

### Usage
    $ cd project/directory
    $ tooler [cuba/sinatra]
    $ thin -R config.ru start

### Current Support
 * Cuba
 * Sinatra

### TODO
 * Initialize git
 * Get input from users.
 * Add support to create a ruby gem
 * Write tests for tooler
 * Generate test template
 * Generate spec template

### License
The MIT License (MIT)
Copyright (c) 2013 Revath S Kumar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: revathskumar/tooler

repo_name: revathskumar/tooler


text:
# LearningVue
Learning Vuejs by building a single page application that shows the guitar tab with links to youtube and lyrics of the song

## Acknowledgement

The project is built followed from the tutorial from (freeCodeCamp)[http://www.freecodecamp.org] taught by (Cody Siebert)[https://twitter.com/CodyLSeibert]

repository: vijaykumardev/LearningVue

repo_name: vijaykumardev/LearningVue


text:
---
title: 'Lean UX'
---

Lean UX
_Often associated with use in start-ups, this methodology is focused on the rapid evaluation of hypotheses (i.e. learning loops), while putting in the minimal amount of effort required to test these hypotheses._

*   [ Andy Budd::Blogography - My thoughts on Lean UX](http://www.andybudd.com/archives/2011/10/my_thoughts_on_lean_ux/)
*   [Jeff Gothelf on Design as a Hypothesis | The Hipper Element](http://thehipperelement.com/post/60361702934/jeff-gothelf-on-design-as-a-hypothesis)
*   [Lean Design for Good User Experience](http://www2.le.ac.uk/departments/computer-science/people/elaw/HCI-3T/P6Gasik.pdf)
*   [Lean UX: Rethink Development](http://www.drdobbs.com/architecture-and-design/lean-ux-rethink-development/231902070)

gha_language: HTML


text:
# dash-intel.com -blog on website tips and tricks.

## About

Dash-intel.com is an online resource and learning website created to help you and others find what you are looking for.

The creators of this site have a special interest in all things web and analytics related. The site started as a learning platform for Power BI and has been continously expanded upon.

We also do freelance, consulting and web development work for small businesses. If you are interested in learning more please feel free to drop us a line at<EMAIL_ADDRESS>

repository: arhoy/dash-intel

gha_language: PHP

repo_name: arhoy/dash-intel


text:
### 301 Reading Notes

## Class -05

# Heroku

- how to deploy an app, change its configuration, view logs, scale, and attach add-ons

- install heroku

```

$ sudo snap install heroku --classic

$ heroku login

```

- clone your git repository to your local folder.

```
$ git clone https://github.com/heroku/node-js-getting-started.git
$ cd node-js-getting-started

```

- deploy the app to Heroku

```
$ heroku create
```

- now deploy code

```
$ git push heroku main

```

- ensure the application is running

```
$ heroku ps:scale web=1
```

- open desployed server

```
$ heroku open
```

- In order to scale you have to upgrade to a pro account. By default, your app is deployed on a free dyno. Free dynos will sleep after a half hour of inactivity (if they don’t receive any traffic). This causes a delay of a few seconds for the first request upon waking. Subsequent requests will perform normally. Free dynos also consume from a monthly, account-level quota of free dyno hours - as long as the quota is not exhausted, all free apps can continue to run.

To avoid dyno sleeping, you can upgrade to a hobby or professional dyno type as described in the Dyno Types article. For example, if you migrate your app to a professional dyno, you can easily scale it by running a command telling Heroku to execute a specific number of dynos, each running your web process type.

- to install dependencies Run this command in your local directory to install the dependencies, preparing your system for running the app locally:

```
$ npm install
```

- you can now run your app locally with this command, then open browser and go to localhost:PORT

```
$heroku local web
```

# Push Local Changes

- how to push to heroku

```

$ git add .

$ git commit -m "add cool face api"

$ git push heroku main

$ heroku open cool

```

- Provisions and add-ons

- Add-ons are third-party cloud services that provide out-of-the-box additional services for your application, from persistence through logging to monitoring and more.

```
$ heroku addons:create papertrail
```

- to list addons

```
$ heroku addons
```

- Define config vars : Heroku lets you externalize configuration - storing data such as encryption keys or external resource addresses in config vars.

- In the index.js, Under the existing get() call, add another:

```
.get('/times', (req, res) => res.send(showTimes()))
```

- At the end of the file, add the following definition for the new function

```
showTimes = () => {
  let result = '';
  const times = process.env.TIMES || 5;
  for (i = 0; i < times; i++) {
    result += i + ' ';
  }
  return result;
}
```
- heroku local will automatically set up the environment based on the contents of the .env file in your local directory. In the top-level directory of your project, there is already a .env file that has the following contents:

```
TIMES=2
```

- If you run the app with heroku local, you’ll see two numbers will be generated every time.

To set the config var on Heroku, execute the following:

```
$ heroku config:set TIMES=2

$ heroku config
```

## Adding Postgres and other database

- The add-on marketplace has a large number of data stores, from Redis and MongoDB providers, to Postgres and MySQL.

- add the database

```
$ heroku addons:create heroku-postgresql:hobby-dev

$ heroku config
```

- to add postgress to your dependencies

```
$ npm install pg

 "dependencies": {
    "cool-ascii-faces": "^1.3.4",
    "ejs": "^2.5.6",
    "express": "^4.15.2",
    "pg": "^8.1.0"
  },

```

- Now edit your index.js file to use this module to connect to the database specified in your DATABASE_URL environment variable. Add this near the top

```
const { Pool } = require('pg');
const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
  ssl: {
    rejectUnauthorized: false
  }
});
```

- Now add another route, /db, by adding the following just after the existing .get('/', ...)

```
.get('/db', async (req, res) => {
    try {
      const client = await pool.connect();
      const result = await client.query('SELECT * FROM test_table');
      const results = { 'results': (result) ? result.rows : null};
      res.render('pages/db', results );
      client.release();
    } catch (err) {
      console.error(err);
      res.send("Error " + err);
    }
  })

  ```

  - use the heroku pg:psql command to connect to the remote database, create a table and insert a row:

  ```
  $ heroku pg:psql
  ```

![https://howtonode.org/deploy-blog-to-heroku]


text:
---
layout: default
---

# 1998-07-07 - US to Ease Crypto Export

## Header Data

From: John Young<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: bc4e9321973d3f0e634746f9466d8ad51688dd6cad4f344c44d578ae38daa16f

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1998-07-07 15:17:39 UTC

Raw Date: Tue, 7 Jul 1998 08:17:39 -0700 (PDT)

## Raw message

```
{% raw  %}From: John Young<EMAIL_ADDRESS>Date: Tue, 7 Jul 1998 08:17:39 -0700 (PDT)
To<EMAIL_ADDRESS>Subject: US to Ease Crypto Export
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

7 July 1998
Source:
http://www.washingtonpost.com/wp-srv/WPlate/1998-07/07/064l-070798-idx.html
Thanks to FT

U.S. to Ease Limits on Export of Data-Scrambling Technology

By Elizabeth Corcoran
Washington Post Staff Writer
Tuesday, July 7, 1998; Page E04

Commerce Secretary William Daley plans to announce today
that the government will give U.S. software companies new
freedom to export their most sophisticated data-scrambling
technology to financial institutions chartered in 45 countries,
according to Clinton administration sources.

Under the new rules, which officials said are likely to take
effect in late summer, eligible banks, securities firms,
brokerage houses and credit-card companies will need to
receive approval only once from the Commerce Department
before they can license the most sophisticated "encryption," or
data-scrambling, technology.

Once they receive approval, those institutions will be
permitted to share the technology with any of their branch
offices, except for those located in terrorist states.
Government sources estimate that the new rules will include
about 70 percent of the world's banks, including the 100
largest (ranked by assets).

For years, the government has closely regulated export of
encryption software, on the grounds that terrorists or hostile
governments might use it to cloak their communications. The
software industry argues that the rules are unworkable and
unfairly block foreign sales. Unfriendly parties wanting to use
encryption already can obtain it overseas, industry executives
said.

The new rules on banks are "a move in the right direction,"
said one industry executive familiar with the regulations. "But
we're still leaving some groups out. Basically, we need to keep
spreading the circle wider," to include the growing number of
businesses offering financial services, such as insurance
companies.

"What we've heard sounds great," said Kawika Daguio, a
lobbyist for the American Bankers Association. "We've been
arguing [for several years] that the regulatory structure we
have guarantees we're good citizens" who wouldn't make illicit
use of the technology, he said.

Now the government appears to have agreed.

Current regulations require that U.S. companies apply for
permits before exporting anything but the simplest versions of
encryption products. To export more sophisticated
technology, organizations must have a plan for creating
so-called "spare keys." That way, law enforcement officials
who have obtained a court order would be able to unlock the
information.

In May 1997, the Commerce Department said it would not
restrict the sophistication of the data-encryption technology
sold to financial institutions. But it required spare keys and
case-by-case licensing. Approvals have been slow. Now the
government is doing away with the key requirement, defining
more precisely which financial institutions qualify and pledging
to end case-by-case approval.

Because of concerns about money laundering, the government
will grant the new permission only to financial institutions
chartered in countries that have agreed to take steps against
money-laundering. If U.S. companies want to sell to financial
institutions chartered in other countries, they will have to
apply for licenses from the Commerce Department.

Such provisions still fall short of the demands of U.S.
companies. "To take a piecemeal approach [to loosening
encryption restrictions] is the wrong direction," said Ed
Gillespie, executive director of Americans for Computer
Privacy, a lobbying group. "We need a blanket lifting of
restrictions with individual prohibitions," such as bans on
sending such technology to terrorist states, he said.

In a related development, a federal court in Ohio ruled on
Friday that posting the text of an encryption program on the
Internet, where people all over the world could see it, was not
protected by the constitutional right to free speech.

The ruling, made late Friday, contradicts a ruling made by a
California district court last August. Privacy advocates predict

that the issue will be taken up by the U.S. Supreme Court.

(c) Copyright 1998 The Washington Post Company

{% endraw %}
```

## Thread

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

+ Return to "[John Young <jya@pipeline.com>](/authors/john_young_jya_at_pipeline_com_)"

+ 1998-07-07 (Tue, 7 Jul 1998 08:17:39 -0700 (PDT)) - US to Ease Crypto Export - _John Young<EMAIL_ADDRESS>  + 1998-07-07 (Tue, 7 Jul 1998 14:04:16 -0700 (PDT)) - [Re: US to Ease Crypto Export](/archive/1998/07/06ab162053c102b4d72cba5755c34d1f7e7ae30e6009e431b8d5958e75e5a96b) - _John Young<EMAIL_ADDRESS>


text:
#WICit: Where to Shop with WIC

### The California deployment of WICit is live! Check it out at [findwic.com](http://findwic.com)!

###Setup (Mac)
  - [Install node.js and NPM (Node Package Manager)](http://blog.nodeknockout.com/post/65463770933/how-to-install-node-js-and-npm)
  - Install grunt command-line on your machine: `sudo npm install -g grunt-cli`
  - [Fork the repository and setup a local clone](https://help.github.com/articles/fork-a-repo)
  - Move into your local wicit directory: `cd <yourdirectory>/wicit`
  - Install dependencies: `grunt build-dev`
  - Start the development server: `grunt dev`
  - [Try it out](http://localhost:3000)

###License
WICit is free software, and may be redistributed under the MIT-LICENSE.

repository: bengee/wicit

repo_name: bengee/wicit


text:
#[Time Machine.](http://a-time-machine.herokuapp.com)

Go back to the future with this tiny Javascript *Time Machine*. Built in React and given some Fancy CSS3 styling using Sass: a little retro goes a long way. Browser-prefixing not included.

**Live preview:** http://a-time-machine.herokuapp.com

##Credits

* Built on: TIY Starter Kit by [Justin Richards](https://github.com/magentanova/tiy-starter-kit).

##License
[MIT License](https://opensource.org/licenses/MIT)

repository: FranCarstens/timeMachine

repo_name: FranCarstens/timeMachine


text:
# Naona (Kiswahili for 'I see')
A really simple template engine.
## install with composer
```
composer require tillklockmann\naona:1.0.1
```

## usage

Create a views folder in the root dir to store the templates.
Template files are supposed to have the following naming convention:

**template-name.view.php**

Instantiate the View class
```php
$view = new Naona\View;
```
Optionally you can set the path to the template folder:
```php
$view = new Naona\View('path\to\folder');
```
Display the template with ``` render() ``` .
```php
$view->template('index')->render();
```
Set template variables  ``` set(string key, mixed value) ```
```php
// Controller.php
$myTitle = 'Great Website';
$this->view->template('index')
    ->set('title', $myTitle)
    ->render();
```
In the template file
```php
// index.view.php
<h1><?= $title ?></h1>
```

repository: tillklockmann/naona

repo_name: tillklockmann/naona


text:
17 JS Advanced: Regular Exam - 07.07.19
=======================================

---
---

17.01. SoftDo (DOM Manipulation)
--------------------------------

Exam problems for the ["JavaScript Advanced" course \@
SoftUni](https://softuni.bg/courses/js-advanced). Submit your solutions in the
SoftUni Judge system at
<https://judge.softuni.bg/Contests/Compete/Index/1715#0>.

**Use the given skeleton to solve this problem.**

#### *Note: You have NO permission to change directly the given HTML (index.html file).*

### Your Task

Write the missing JavaScript code to make the SoftDo application work as
expected.

#### [Ask Question]

When the **textarea** *(Type your question here…)* is filled with some question
and the button [**SEND**] is clicked, the current question should be displayed
in the [**Pending Questions**] **section.** The input field for the username is
**NOT required** - if it is filled, show the **given username** under the
question, otherwise, the username is **Anonymous**.

##### [Ask Question as an Anonymous User *(input field is empty)]*

##### [Ask Question with Username *(input field is filled with some username)]*

##### [Pending Question]

**Each** pending question:

-   Children elements must be wrapped in a **div** element with class
    "**pendingQuestion**"

    -   First child is **img** which is same for every user (Anonymous or not).
        The user icon is provided in the skeleton resources (**images folder**).
        Each **img** should have **src**, **width** and **height attributes**.

    -   Second child is a **span** element which holds the **username** (the
        given one from the input field or the Anonymous one).

    -   Third child is а **p element**, which is the given question from the
        **textarea**.

    -   The last (fourth child) is a **div** element with **class**
        "**actions**" which is а parent element of the two buttons
        ([**Archive**] and [**Open**])

        -   [**Archive**] button has class "**archive**" and text content
            "**Archive**"

        -   [**Open**] button has **class** "**open**" and text content
            "**Open**"

-   Should be appended to the **div** with id "**pendingQuestions**"

Clicking on the [**Archive**] **button** should **remove** the current question
(**div** element).

#### [Open Question]

If the [**Open**] **button** is clicked, the current question should be **moved
(Append)** from the "**pendingQuestions**" section to the "**openQuestions**"
section.

##### [Open a Question *(Moved from the [Pending] to the [Open] section)]*

##### [Open Question Structure]

**Each** open question:

-   Children elements must be wrapped in a **div element** with class
    "**openQuestion**"

    -   First child is **img** which is same for every user (Anonymous or not).
        The user icon is provided in the skeleton resources (**images folder**).
        Each **img** should have **src**, **width** and **height attribute**

    -   Second child is a **span element** which holds the **username** (the
        given one from the input field or the Anonymous one)

    -   Third child is a **p element**, which is the given question from the
        **textarea**

    -   Fourth child is a **div element** with **class** "**actions**" which is
        a parent element of the [**Reply**] **button**

        -   [**Reply**] **button** has **class** "**reply"** and text content
            "**Reply**"

    -   The last child here is a **div element** with class "**replySection**"
        which is a parent element of the **input**, **button** and **ol**
        elements:

        -   **Input element** should have **class** "**replyInput**", **type**
            "**text**" and **placeholder** "**Reply to this question here...**"
            *Set in that order!*

        -   **Button** element should have **class** "**replyButton**" and text
            content "**Send**"

        -   The ordered list **(ol element)** should **two** attributes
            (**class** "**reply**" and **type** "**1**") *Set in that order!*

-   Should be appended to the **div** with id "**openQuestions**"

**Keep in mind** when the pending question is moved (appended) to the open
questions section, the current question structure should be like the example
above (The elements must be created inside the **replySection** but the section
should **not be displayed**)

#### [Reply to the question]

By default, every **div element** with class "**replySection**" has **CSS
styles** which are **property display**-**value none** (**display: none**), but
if some of the [**Reply**] **buttons** are clicked, the current **replySection**
must be shown (The **display property** must be **changed** to **block**
(**display: block**). If the button [**Back**] is clicked again (when the
section is displayed), the styles must be changed again to **display:none.**

If the **input field** in the "**replySection"** is filled with some text
(answer to the current question) and the [**Send**] button is clicked, the
current answer (the input value) must be appended to the ordered list (**ol
element**) like text content on list item (**li element**)

### Solution 1: 01. SoftDo (DOM Manipulation)
### Solution 2: 01. SoftDo (DOM Manipulation)
### Solution 3: 01. SoftDo (DOM Manipulation)

---

17.02. PizzUni
--------------

Exam problems for the ["JavaScript Advanced" course \@
SoftUni](https://softuni.bg/courses/js-advanced). Submit your solutions in the
SoftUni Judge system at
<https://judge.softuni.bg/Contests/Compete/Index/1715#0>.

**Use the provided PizzUni class to solve this problem.**

#### Your Task

Using **Mocha** and **Chai** write **unit tests** to test the entire
functionality of the **PizzUni class**. Make sure instances of it have all the
**required functionality** and **validation**. You may use the following code as
a template:

### Functionality

The code inside the **pizzuniClass.js** file defines a class that contains
information about an auto service. An instance of the class should support the
following operations:

#### constructor()

An instance of **PizzUni class** should have the following **3 properties**:

-   **registeredUsers** - by default is an **empty array**

-   **availableProducts** - by default is an **object** that must have only 2
    properties:

    -   **pizzas** - array with **3 strings:**
        ("Italian Style", "Barbeque Classic" and "Classic Margherita")

    -   **drinks** - array with **3 strings** ("Coca-Cola", "Fanta" and "Water")

-   **orders** - by default is an **empty array**

#### registerUser({email})

This function **registers** a user by the given email (**string**) into
**registeredUsers property**

-   Receives a **string** (email)

-   If the email is **already used** for registration before that, the expected
    behavior of the class is to **throw an error** with the following message:
    \`**This email address (\${email}) is already being used!**\`

-   Otherwise, the given email is successfully registered to the
    **registeredUsers property** as an object. That object holds the given
    **email** and **orderHistory** which by default is an **empty array.**

-   At the end, the **current object** should be **returned**.

#### makeAnOrder()

This function **makes an order** from an **already registered** user and
**saves** the **current order** into their **orderHistory** property.

-   Receives 3 parameters - **email**, **orderedPizza** and **orderedDrink**

    -   If the incoming email is **NOT** registered in the **registeredUsers
        property**, the following error should be thrown:
        "**You must be registered to make orders!**";

-   An order is considered **valid** when the incoming **orderedPizza** is one
    of the **pizzas** in the **availableProducts property**. If it is not the
    following error is thrown:
    "**You must order at least 1 Pizza to finish the order.**".

-   The **orderedDrink** is **not required.** But if it is ordered, the drink
    should be one of the **drinks** in the **availableProducts property**.

-   When the **order is valid** a new **object** which holds information about
    the current order (**the ordered pizza** and **the ordered drink, if any**)
    is pushed in the registered user **orderHistory property.** Also, a new
    **object** which holds information like (**ordered pizza**, **ordered
    drink** (if any), **email** and **status** which is **pending**) is pushed
    in the **orders** property.

-   The following function **returns** a **number** (the **index** of the order
    in the **orders** array)

#### completeOrder()

This function **changes** the **status** of the **first object** with status
"**pending**" to "**completed'** in the **orders** property and **returns** the
**current object**.

#### detailsAboutMyOrder({id})

-   Receives a **number** (id) which is the **index** for the current order

-   If the current **order id** (index) is valid, the function returns the
    status of that order in format:
    "**Status of your order: {pending/completed}**"

#### doesTheUserExist({email})

-   Receives a **string** (email) and **returns** an **object** with all the
    registered users with that email

### Submission

Submit your tests inside a **describe()** statement, as shown above.

### Solution 1: 02. PizzUni
### Solution 2: 02. PizzUni

---

17.03. Computer
---------------

Exam problems for the ["JavaScript Advanced" course \@
SoftUni](https://softuni.bg/courses/js-advanced). Submit your solutions in the
SoftUni Judge system at
<https://judge.softuni.bg/Contests/Compete/Index/1715#0>.

### Your Task

### Write a Computer class which supports the described functionality below.

### Functionality

#### constructor()

Receives **3** parameters at initialization of the class (**ramMemory, cpuGHz,
hddMemory**), where each of them is a **number.**

Should have these **5** properties:

-   **ramMemory** - **number** (should be the same as the received
    **ramMemory**)

-   **cpuGHz** - **number** (should be the same as the received **cpuGHz**)

-   **hddMemory** - **number** (should be the same as the received
    **hddMemory**)

-   **taskManager** – **empty array**

-   **installedPrograms** - **empty array**

#### installAProgram({name}, {requiredSpace})

This **function** should **install a new program** on the computer and **save**
it in the **installedPrograms property**.

-   If the **total hddMemory** is **exceeded** while trying to install a new
    program, **new error** should be **thrown** with the following message:
    "**There is not enough space on the hard drive**"

-   If there is available space to install the given program, a **new object**
    with the given **name** and **requiredSpace** should be created and stored
    to the **installedPrograms array property.**

Keep in mind that when you successfully install a program you must **decrease**
the total **hdd memory** on the computer with the **capacity** for the
**currently installed program**!

The following function should **return** the **newly created object**.

#### uninstallAProgram({name})

This **function** should **uninstall** an **already installed** program on the
computer (**remove** the **first program** with the **given name** from the
**installedPrograms property**).

-   If there **are no installed** programs with the **given name,** a **new
    error** should be **thrown** with the following message:
    "**Control panel is not responding**"

-   If **installedPrograms property** contains an object with the **given
    name**, that object should be **removed** from the array.

Also logically reversed move is to **increase** the total **hdd memory** with
the **capacity** of the **currently uninstalled program**!

This function should **return** the **installedPrograms array** where the given
program name is excluded.

#### openAProgram({name})

This **function** should **open** an already installed program on the computer.

Receives a **string** (name of that program)

-   If the given **name** is **not** present in the **installedPrograms
    property**, a **new error** should be **thrown** with the following message:
    "**The \${name} is not recognized**"

-   If the given name is an installed program and it is already open, a new
    error should be thrown with the following message:
    **The \${name} is already open**"

To open an installed program, you must **calculate** how much **RAM memory** and
**CPU usage** the program will need.

To find out how much:

-   **ram memory** the current program will need, use the following formula:
    **(programRequiredSpace / totalRamMemory) \* 1.5**

-   **cpu usage** the current program will need, use the following formula:
    **( ( programRequiredSpace / CPU GHz ) / 500) \* 1.5**

>   *Keep in mind the both formulas calculate a numbers in percent (%) for the
>   current ram and cpu usage.*

If the **total ram usage reaches or exceeds 100%** (*the ram usage for all
opened programs*), the function should throw a **new error** with the following
message:
**"{programName} caused out of memory exception**"

If the **total cpu usage reaches or exceeds 100%** (*the cpu usage for all
opened programs*), the function should throw a **new error** with the following
message:
"**{programName} caused out of cpu exception**"

*If both (ram usage and cpu usage) reaches or exceeds 100% return the ram memory
exception case.*

When **ram** and **cpu usages** is **calculated**, create a **new object** with:

-   **name** (name of the program)

-   **ramUsage** (current ram usage that the program uses in %)

-   **cpuUsage** (current cpu usage that the program uses in %).

*The properties must be exactly as they are mentioned! Also, you don’t have to
round the numbers!*

When the object is created, push it in the **taskManager array property.**

The function must **return** the **newly created object.**

#### taskManagerView()

This **function** prints all opened programs (the objects in the **taskManager
array property**). Keep in mind that the percentages for (**cpu** and **ram
usages**) must be shown **without** any **decimal part** (You can use the
**.toFixed(0)**).

-   If there is no opened program, the function **returns** a **string** with
    the following message:
    "**All running smooth so far**"

-   If there is at least one opened program, visualize it in the following
    format:
    "**Name - {programName} \| Usage - CPU: {cpuUsage}%, RAM: {ramUsage}%**"

If there is more than one opened program, each of them must be in **new line**.

This function **returns** a **string** in the format mentioned above.

### Submission

Submit only your **Computer class.**

### Examples

This is an example how the code is **intended to be used**:

|                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Sample code usage**                                                                                |
| let computer = new Computer(4096, 7.5, 250000);

 computer.installAProgram('Word', 7300);
 computer.installAProgram('Excel', 10240);
 computer.installAProgram('PowerPoint', 12288);
 computer.uninstallAProgram('Word');
 computer.installAProgram('Solitare', 1500);

 computer.openAProgram('Excel');
 computer.openAProgram('Solitare');

 console.log(computer.installedPrograms);
 console.log(('-').repeat(50)) // Separator
 console.log(computer.taskManager); |
| **Corresponding output**                                                                                |
| [ { name: 'Excel', requiredSpace: 10240 },
  { name: 'PowerPoint', requiredSpace: 12288 },
  { name: 'Solitare', requiredSpace: 1500 } ]
 --------------------------------------------------
[ { name: 'Excel', ramUsage: 3.75, cpuUsage: 4.096 },
  { name: 'Solitare',
    ramUsage: 0.54931640625,
    cpuUsage: 0.6000000000000001 } ]                                                                                |

|                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Sample code usage**                                                                                |
| let computer = new Computer(4096, 7.5, 250000);

 computer.installAProgram('Word', 7300);
 computer.installAProgram('Excel', 10240);
 computer.installAProgram('PowerPoint', 12288);
 computer.installAProgram('Solitare', 1500);

 computer.openAProgram('Word');
 computer.openAProgram('Excel');
 computer.openAProgram('PowerPoint');
 computer.openAProgram('Solitare');

 console.log(computer.taskManagerView());                                               |
| **Corresponding output**                                                                                |
| Name - Word | Usage - CPU: 3%, RAM: 3%
Name - Excel | Usage - CPU: 4%, RAM: 4%
Name - PowerPoint | Usage - CPU: 5%, RAM: 5%
Name - Solitare | Usage - CPU: 1%, RAM: 1%                                                                                |

### Solution: 03. Computer

---

path: /17 Exam/README.md


text:
# UILayoutKit

[![CI Status](https://img.shields.io/circleci/project/github/Strobocop/UILayoutKit.svg)](https://circleci.com/gh/Strobocop/UILayoutKit)
[![Version](https://img.shields.io/cocoapods/v/UILayoutKit.svg?style=flat)](http://cocoadocs.org/docsets/UILayoutKit)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/UILayoutKit.svg?style=flat)](http://cocoadocs.org/docsets/UILayoutKit)
[![Platform](https://img.shields.io/cocoapods/p/UILayoutKit.svg?style=flat)](http://cocoadocs.org/docsets/UILayoutKit)
![Swift](https://img.shields.io/badge/%20in-swift%204.0-orange.svg)

## Description

**UILayoutKit** description.

## Usage

Coming soon.

## Installation

**UILayoutKit** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'UILayoutKit', :git => 'https://github.com/Appsaurus/UILayoutKit'
pod 'Swiftest', :git => 'https://github.com/Appsaurus/Swiftest'
pod 'UIKitExtensions', :git => 'https://github.com/Appsaurus/UIKitExtensions'
```

**UILayoutKit** is also available through [Carthage](https://github.com/Carthage/Carthage).
To install just write into your Cartfile:

```ruby
github "Appsaurus/UILayoutKit"
```

**UILayoutKit** can also be installed manually. Just download and drop `Sources` folders in your project.

## Contributing

We would love you to contribute to **UILayoutKit**, check the [CONTRIBUTING](github.com/Appsaurus/UILayoutKit/blob/master/CONTRIBUTING.md) file for more info.

## License

**UILayoutKit** is available under the MIT license. See the [LICENSE](github.com/Appsaurus/UILayoutKit/blob/master/LICENSE.md) file for more info.

repository: Appsaurus/UILayoutKit

repo_name: Appsaurus/UILayoutKit


text:
# mendicant

A "beggar-bot" application for (e-waste-related) fundraising; inspired by Sašo Sedlaček's [Beggar Robot](http://sasosedlacek.com/beggar-robot/).

repository: bdunnette/mendicant

repo_name: bdunnette/mendicant


text:
# ShiftLeft dind-jenkins-slave

A Docker image which allows for running Docker in Docker (DinD). This image is meant to be used with the [Jenkins Docker plugin](https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin). It allows for Docker containers used as Jenkins build slaves to create and publish their own Docker images in-turn.

This is a mashup of

* [jenkins/ssh-slave](https://registry.hub.docker.com/u/jenkins/ssh-slave/)
* [tehranian/dind-jenkins-slave](https://registry.hub.docker.com/u/tehranian/dind-jenkins-slave/)
* [evarga/jenkins-slave](https://registry.hub.docker.com/u/evarga/jenkins-slave/)
* [jpetazzo/dind](https://registry.hub.docker.com/u/jpetazzo/dind/)

## Requirements

* The container must be run with `--privileged` in order for nested-Docker to work. There is a check box to enable this for the image within the Jenkins UI.

## Running

To run a Docker container

```bash
docker run -it --rm -e "JENKINS_SLAVE_SSH_PUBKEY=$(cat ~/.ssh/id_rsa.pub)" --privileged -p 2222:22 shiftleft/dind-jenkins-slave
```

```bash
$ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 jenkins@localhost
$ docker run -it --rm hello-world
```

### How to use this image with Docker Plugin

To use this image with [Docker Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin), you need to
pass the public SSH key using environment variable `JENKINS_SLAVE_SSH_PUBKEY` and not as a startup argument.

In _Environment_ field of the Docker Template (advanced section), just add:

    JENKINS_SLAVE_SSH_PUBKEY=<YOUR PUBLIC SSH KEY HERE>

Don't put quotes around the public key. You should be all set.

repository: ShiftLeftSecurity/dind-jenkins-slave

repo_name: ShiftLeftSecurity/dind-jenkins-slave


text:
### Isn't the prompt displaying the current user and directory?

It does, however, the `PS1` variable has backslash-escaped special characters called _PROMPTING_ characters that are decoded as follows:

- `\u` - the username of the current user
- `\w` - the current working directory, with `$HOME` abbreviated with a tilde
- `$` -- the `$` dollar character is commonly used for Unix/Linux prompts

Let's override the `PS1` current value, `\u \w $`, to something else.

In your terminal execute:

```
PS1="something else $ "
```

Fortunately for us, the `PS1` overwrite is only temporary.

There are 2 ways of getting back our original `PS1`, either by overwriting it again:

```
PS1="\u \w $ "
```

Or by `exit`ing the current shell session:

```
something else $ exit
```

Click on the __re-connect__ button afterwards.

gha_language: Shell


text:
> Terminal string styling done right

[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)

<img<EMAIL_ADDRESS>width="900">

---

				Sindre Sorhus' open source work is supported by the community on GitHub Sponsors and Dev

		Special thanks to:

			All your environment variables, in one place

				Stop struggling with scattered API keys, hacking together home-brewed tools,

				and avoiding access controls. Keep your team and servers in sync with Doppler.

---

## Highlights

- Expressive API
- Highly performant
- Ability to nest styles
- [256/Truecolor color support](#256-and-truecolor-color-support)
- Auto-detects color support
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020

## Install

```console
$ npm install chalk
```

## Usage

```js
const chalk = require('chalk');

console.log(chalk.blue('Hello world!'));
```

Chalk comes with an easy to use composable API where you just chain and nest the styles you want.

```js
const chalk = require('chalk');
const log = console.log;

// Combine styled and normal strings
log(chalk.blue('Hello') + ' World' + chalk.red('!'));

// Compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));

// Pass in multiple arguments
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));

// Nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));

// Nest styles of the same type even (color, underline, background)
log(chalk.green(
	'I am a green line ' +
	chalk.blue.underline.bold('with a blue substring') +
	' that becomes green again!'
));

// ES2015 template literal
log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);

// ES2015 tagged template literal
log(chalk`
CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`);

// Use RGB colors in terminal emulators that support it.
log(chalk.keyword('orange')('Yay for orange colored text!'));
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
log(chalk.hex('#DEADED').bold('Bold gray!'));
```

Easily define your own themes:

```js
const chalk = require('chalk');

const error = chalk.bold.red;
const warning = chalk.keyword('orange');

console.log(error('Error!'));
console.log(warning('Warning!'));
```

Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):

```js
const name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
//=> 'Hello Sindre'
```

## API

### chalk.`<style>[.<style>...](string, [string...])`

Example: `chalk.red.bold.underline('Hello', 'world');`

Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.

Multiple arguments will be separated by space.

### chalk.level

Specifies the level of color support.

Color support is automatically detected, but you can override it by setting the `level` property.

If you need to change this in a reusable module, create a new instance:

```js
const ctx = new chalk.Instance({level: 0});
```

| Level | Description |
| :---: | :--- |
| `0` | All colors disabled |
| `1` | Basic color support (16 colors) |
| `2` | 256 color support |
| `3` | Truecolor support (16 million colors) |

### chalk.supportsColor

Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.

Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.

Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.

### chalk.stderr and chalk.stderr.supportsColor

`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.

## Styles

### Modifiers

- `reset` - Resets the current color chain.
- `bold` - Make text bold.
- `dim` - Emitting only a small amount of light.
- `italic` - Make text italic. *(Not widely supported)*
- `underline` - Make text underline. *(Not widely supported)*
- `inverse`- Inverse background and foreground colors.
- `hidden` - Prints the text, but makes it invisible.
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.

### Colors

- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `blackBright` (alias: `gray`, `grey`)
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`

### Background colors

- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`

## Tagged template literal

Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).

```js
const chalk = require('chalk');

const miles = 18;
const calculateFeet = miles => miles * 5280;

console.log(chalk`
	There are {bold 5280 feet} in a mile.
	In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
`);
```

Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).

Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:

```js
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
```

Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.

All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.

## 256 and Truecolor color support

Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.

Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).

Examples:

- `chalk.hex('#DEADED').underline('Hello, world!')`
- `chalk.keyword('orange')('Some orange text')`
- `chalk.rgb(15, 100, 204).inverse('Hello!')`

Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).

- `chalk.bgHex('#DEADED').underline('Hello, world!')`
- `chalk.bgKeyword('orange')('Some orange text')`
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`

The following color models can be used:

- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`

## Windows

If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.

## Origin story

[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.

## chalk for enterprise

Available as part of the Tidelift Subscription.

The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

## Related

- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal

## Maintainers

- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)

repository: ChromeDevTools/devtools-frontend

repo_name: ChromeDevTools/devtools-frontend


text:
---
title: Hiking 4 Nerds
subtitle: Hiking app made with flutter
layout: default
modal-id: 2
date: 2020-01-30
video: hiking-4-nerds.mp4
thumbnail: hiking-4-nerds-thumbnail.png
alt: image-alt
project-date: Januar 2020
client: University
category: App Development
repo: Github
repo-url: https://github.com/dephiloper/HikingForNerds
description: This app was developed within one semester for a project assignment
  in a group of 7 students. The main task was to develop a hiking route app, which
  offers the user round hiking routes with interesting stops. The app was developed in the
  Cross-Platform Framework Flutter with the programming language Dart. One of the main features
  of the app is that it only uses map material and geodata from Open-Street-Map. Furthermore,
  all map data is hosted on a university server to avoid dependence on external services.
  Download Link

---

extension: markdown


text:
---
name: Bug report
about: Create a report to help us improve
title: 'bug: issue title'
labels: bug
assignees: ''

---

### Describe the bug
Provide a clear and concise description of the bug.

### To Reproduce
Provide step-by-step instructions to reproduce the bug:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### Expected behavior
Provide a clear and concise description of the behaviour expected in the above-mentioned scenario.

### Screenshots
If applicable, provide screenshots to explain the bug.

### Package versions
 - @medly-components/core :
 - @medly-components/forms :
 - @medly-components/icons :
 - @medly-components/layout :
 - @medly-components/loaders :
 - @medly-components/theme :
 - @medly-components/utils :

### Additional context
Provide any additional information about the bug or the bug scenario.

repository: medly/medly-components

repo_name: medly/medly-components


text:
There is no such thing as an HDMI 1.4 or 2.0 cable.

There are only two different kinds of HDMI cables specified by the Industry:

- High Speed
- Standard

High Speed (with Ethernet) HDMI Cables will support the new higher bandwidths (up to 18Gbps). it called HDMI 2.0

## HDMI 2.1

The new version is called **HDMI" 2.1** and it adds several new features including a new cable type.

## HDMI Cables

![HDMI-Cables](images/2018-11-28-09-53-52.png)

## References

- https://www.hdmi.org/consumer/finding_right_cable.aspx
- https://www.cnet.com/news/do-you-need-new-hdmi-cables-for-hdr/

repository: kexplo/TIL

repo_name: kexplo/TIL


text:
# Nsdb Architecture

NSDb is a time series database, thus it is optimized for handling time series data, i.e. a series of multi dimensional data points indexed by time.
A time series record, called `Bit` in the NSDb nomenclature, is a structure composed of:

* a `timestamp`, a long field that represents the record time instant
* a `value`, a numerical value ( INT, BIGINT or DECIMAL), that represents the Bit main characteristic, the number that identifies the main bit feature at a given timestamp.
* `dimensions`, set of key-value pairs. Keys are strings and can be considered as the dimension name; dimension's value can be a STRING, an INT, a BIGINT or a DECIMAL and tells us that the value referred to a key. Dimensions are secondary Bit characteristic and can be used to filter or aggregate results.

If we want to model the number of accesses to emergency rooms in a country (or in a state or a region) we can use a time series record (a `Bit`) with the following features:

* access time as the timestamp
* the number of patients entered in the ER for triage as the `Value`
* some additional information useful for filtering and aggregating as `dimensions`
  - the hospital name
  - the patients' priority
  - the hospital coordinates (geohash)

### Metrics and Bit

A series of time series records (bits) is called `metric`.

NSDb provides two levels of containers for metrics: `database` and `namespace`.

A bit belongs to a namespace, which belongs to a database.

To declare the database and the namespace is not required in a sql statement, but it is necessary for the outer context (e.g. rest apis, java apis or cli)

### Metric Info

The following properties can be configured for a metric. This configuration must be performed before inserting bits and cannot be updated.

* shard interval: the time interval that determines the shard length.
* retention: the time interval in which data are kept into the indices.

## Schema design

Given the time series nature of NSDb, it would be improper to talk about a metric's schema because each bit can have different dimensions.
Anyway, it is important to point out that bits of the same metric must be homogeneous to each other.
The following rules must be followed by a series of Bits:

* value type must be the same (e.g. DECIMAL or INT)
* dimensions can be present or not, but if present their type must be the same among bits; e.g. dimension `d` can be present in `bit1` and not in `bit2` but if a bit contains the same dimension with a different type (STRING vs INT for example) it will be rejected.

Given the above preconditions, it is possible to infer and retrieve a schema for a metric, which will be composed of:

* a long timestamp
* a numeric value
* the union of each bit's dimensions

## Sql support

NSDb supports a custom SQL like query language.
For more information, the [full doc](SQL_doc.md) could be examined.

Essentially, dimensions and timestamp can be used to compose where conditions or group by clauses and value for aggregation clauses.

Reusing the ER example explained above, in order to select accesses with WHITE priority and sort results by the time we can run this query:

```sql
select * from accesses where priority = WHITE order by timestamp desc
```

while for retrieving the sum of accesses grouped by priority this query can be used

```sql
select sum(value) from accesses group by priority
```

## Publish-Subscribe Streaming

Perhaps the most interesting feature of NSDb is a special case of data streaming based on a publish-subscribe pattern.

![Publish-Subscribe Model](img/pub-sub.png "Publish Subscribe Model")

A user needs to subscribe by performing the following steps:

* open a WebSocket
* send a specific json message providing a database, a namespace and a valid query

NSDb will return the query results, the `Historical data` first, then, every time a record that fulfills the query provided is inserted, it will be sent to the subscriber's websocket.
If we consider NSDb as a Source and the subscriber as a Sink, this publish-subscribe mechanism can be interpreted as a simple streaming pipeline.

## Overall Architecture

![Overall Architecture](img/overall.png "Overall Architecture")

NSDb strongly relies on [akka](https://github.com/akka/akka), _the implementation of the Actor Model on the JVM._

This model gives the right abstraction to build high traffic, concurrent and distributed systems.
Using it makes easy to handle concurrency, and also provides an abstraction for creating and maintaining a cluster of actors (e.g. it's not necessary to implement gossip and anti-entropy protocols).

### Storage System

NSDb takes full advantage of [Apache lucene™](https://lucene.apache.org/core/), thanks to which it is possible to index bits and run high performance searches. It also provides many primitives useful to optimize indexes and related queries to fit time series requirements.

In addition to Lucene, the native file system is used for writing a commit log, used to keep track of all the writes and deletions happened in the system; it is essential in case of disaster recovery. In fact, all the log entries are written before being performed, so that it is possible to replay them in case of failure.

### Consistency

In order to maximize write throughput and also to guarantee a real time events delivery, It has been decided to adopt a custom `consistency` strategy.
After the write operation has been logged in the commit log, it is accumulated into an internal buffer which is periodically flushed into the index, and in parallel it is checked against all the subscribed query and published to all the suitable subscribers.
This means, that from the subscriber point of view, the effects of an insert operation will be observable in real time, while for ordinary users, NSDb behaves like a `eventually consistent` system, i.e. records are stored only after a configurable interval.

### Shards

One of the most relevant properties of a time series database is that data continuously comes, will be always inserted and never updated, and given the nature of the data itself, that is the fact that it's naturally ordered by time, leads us to adopt a sharding strategy called ***Natural Time Sharding***.

Users can configure a sharding interval
```
sharding {
    interval = 15s //15m 15d 1y are valid values
}
```

according to which, shards will be created.

repository: radicalbit/NSDb

gha_language: Scala

repo_name: radicalbit/NSDb


text:
# asu-course-search
A Python project built on top of BeautifulSoup & Selenium that allows searching for courses at Arizona State University

---

#### Software & Library Versions Used
| Item | Arch | Version |
| ---- | ---- | ------- |
| Windows 10 Education | 64-bit | 1809 |
| Google Chrome | 64-bit | 75.0.3770.100 |
| ChromeDriver | 32-bit | 75.0.3770.90 |
| Python | 64-bit | 3.7.3 |
| beautifulsoup4 | - | 4.7.1 |
| soupsieve | - | 1.9.2 |
| selenium | - | 3.141.0 |
| urllib3 | - | 1.25.3 |

---

#### Using the Software
(*this section will be populated once a full-release is created*)

repository: damionmounts/asu-course-search

gha_license_id: NOASSERTION

repo_name: damionmounts/asu-course-search