text:
# Project 3 Changes
See [project 2 documentation](#project-2-documentation) for previous command-line functionalities.

### Web App
The project was previously a command-line tool which made it less convenient to use and less accessible to the average user who may not have experience with command-line operations. To improve this, we have created a web app that wraps around the original tool and provided a better User Interface. The frontend UI includes a search bar, inputs for the number of results, currency, and sort by options, and a table to show the list of results. In the table, users can directly click on the item name to go to the product web page and add the item to their wishlist.

### REST API
Along with the web app, we have created REST API endpoints so that the tool can be more extendable and accessible. Future contributors can create their own interface such as a browser extension to interact with the tool. See the [REST API Descriptions](https://github.com/SE21-Team2/slash/blob/main/docs/restapi_descriptions.md) document for more details.

### Enhanced Profile Creation and Wishlist
Version 2 of Slash included the `Full Version` that allowed users to log in with their email address and create a wishlist. In project 3, we created a more sophisticated log in and authentication system with username and password and required users to register for a profile before logging in. The frontend UI also made it easier for users to view, add, remove items from their wishlist. This is implemented with connection to the database as described later in this document.

### Sorting Logic Updates
Previously, it is possible for users to specify the number of items to return. The tool would return that number of items for _each_ website and we thought that this would be confusing to the user. Instead, we decided to just return the specified number (_num_) of items in the overall search. For the default search, it would attempt to return a fraction of _num_ for each website for a total of the given number. For the sorted searches, it would retrieve the specified number of items for each website and then sort the values. It would then only return the top _num_ values of the sorted list.

### Scrape Item Image
With the web app and user interface, the tool can now show an image of the item. This can better allow users to compare the items across sites and determine if they want the item.

### Cloud Deployment
The app can now be run through a Heroku dyno, allowing for better bot up-time and consistency and removing the inconvenience of forcing someone to run the bot locally on their own computer. An instance running the current state of the project can be found at [https://team2-slash.herokuapp.com/](https://team2-slash.herokuapp.com/).

### Database
Previously, all persistent data was stored in local files and each action would overwrite the entirety of data files. However, this approach suffers at scale, where datasets are large and operations are done frequently and concurrently. We transitioned persistent storage to use a PostgreSQL instance hosted through the Heroku cloud platform, to solve these issues. This also improves on the profile creation functionality so users can login to the wep app and view their saved wishlists.

# Project 2 Documentation (CLI features replaced by Web API in Project 3)

:golf: Flags and Command Line Arguments
---
Currently the tool supports the following flags and command line arguments. These flags and arguments can be used to quickly filter and guide the search to get you the best results very quickly.

| Arguments | Type | Default | Description                                                                                |
|-----------|------|---------|----------------------------------------------------------------------------------------------|
| --search  | str  | None    | The product name to be used as the search query                                              |
| --num     | int  | 3       | Maximum number of products to search                                                         |
| --sort    | str  | re      | Sort results by relevance (re) or by price (pr)                                              |
| --des     | bool | -       | Set boolean flag if results should be sorted in non-increasing order                         |
| --csv     |      | -       | Save results as CSV                                                                          |
| --full    | str  | F       | T for full version of app; F for mini version of app                                         |
| --link    |      |         | Show links in the table                                                                      |
|--currency | str  |         | Display the amount in specified currency(inr, euro, aud, yuan, yen, pound)                   |

:card_index_dividers: Some Examples
---

#### 1. Searching
```--search```  accepts one argument string which it uses to search and scrape the requested products on
the e-commerce websites. So, to use this, run the python script followed by the --search argument and the
search string. The search string should be in double quotes if it have two or more words. Example:
```
For Mac
python3 slash.py --search "socks"

For Windows
python slash.py --search "socks"
```
```
             timestamp                                    title   price                                     link  website rating
0  04/11/2021 13:09:36  CelerSport Ankle Athletic Running So...  $12.70  www.amazon.com/gp/slredirect/picasso...   amazon    4.8
1  04/11/2021 13:09:36  CelerSport 6 Pack Men's Ankle Socks ...  $15.95  www.amazon.com/gp/slredirect/picasso...   amazon    4.7
2  04/11/2021 13:09:36  Men's Athletic Ankle Socks 8 Pairs T...  $22.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.6
3  04/11/2021 13:09:39  Hanes Women's Cool Comfort Ankle Soc...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
4  04/11/2021 13:09:39  Hanes Women's Cool Comfort Crew Sock...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
5  04/11/2021 13:09:39  AND1 Men's Cushion No Show Socks, 12...  $11.47  www.walmart.comhttps://wrd.walmart.c...  walmart    4.6
6  04/11/2021 13:09:40  Follkee Women's Alpaca Wool Socks Pe...  $18.49  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
7  04/11/2021 13:09:40  Alpaca Socks | GoWith 2 Pairs Cozy W...  $19.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
8  04/11/2021 13:09:40                  Great White Shark Socks  $11.95  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
```

#### 2. Sorting
```--sort``` accepts one or more arguments that determine how the tool sorts and filters the requested products
after scraping. The first value is used to initially sort and filter the results of the scraping. The arguments
following the first one are not required but will be used to further sort the filtered results. Example:
```
For Mac
python3 slash.py --search "socks" --sort ra

For Windows
python slash.py --search "socks" --sort ra
```
```
           timestamp                                       title    price   website      rating
 0  03/11/2021 21:42:53  Hanes Women's Cool Comfort Ankle Socks, ...  $10.97   walmart         4.2
 1  03/11/2021 21:42:53  Hanes Women's Cool Comfort Crew Socks, 1...  $10.97   walmart         4.2
 2  03/11/2021 21:42:53  Hanes Mens FreshIQ Ankle Cushion Socks, ...  $13.46   walmart         4.2
 3  03/11/2021 21:42:51  10 Pairs Ankle Socks No Show Sock Low-Cu...  $11.95   amazon          4.3
 4  03/11/2021 21:42:50  Mens Cushioned Work Socks 10 Pairs           $12.10   amazon          4.5
 5  03/11/2021 21:42:50  Women's 6-Pack Performance Cotton Cushio...  $17.70   amazon          4.5
 6  03/11/2021 21:42:54  PDF Crikey Crocodile Socks Knit Animal S...  7.50     Etsy            4.5
 7  03/11/2021 21:42:54  5socks /set -  Cotton Women's Socks          16.00    Etsy            5
 8  03/11/2021 21:42:54  Follkee Women's Alpaca Wool Socks Perfec...  18.49    Etsy            5

```
#### 3. Sort Order
The ```--des``` flag can be set to sort the requested products in a non-increasing order. This flag will be
actually used when coupled with ```--sort```. Example:
```
For Mac
python3 slash.py --search "socks" --sort pr --des

For Windows
python slash.py --search "socks" --sort pr --des
```
```
           timestamp                                   title        price    website  rating

 0  04/11/2021 13:18:30                                                        Etsy
 1  04/11/2021 13:18:30                                                        Etsy
 2  04/11/2021 13:18:30                                                        Etsy
 3  04/11/2021 13:18:27  6-pk. Performance Cotton Crew Socks Size...  $34.38   amazon     4.7
 4  04/11/2021 13:18:27  Men's 10 Pairs Cotton Moisture Control H...  $25.49   amazon     4.7
 5  04/11/2021 13:18:27  Men's Dri-Tech Comfort Crew Sock             $25.45   amazon     4.8
 6  04/11/2021 13:18:29  AND1 Men's Cushion No Show Socks, 12 Pac...  $11.47   walmart    4.6
 7  04/11/2021 13:18:29  Hanes Women's Cool Comfort Ankle Socks, ...  $10.97   walmart    4.2
 8  04/11/2021 13:18:29  Hanes Women's Cool Comfort Crew Socks, 1...  $10.97   walmart    4.2
```

#### 4. Result length
The maximum number of results that are scraped from each website can be set using the ```--num``` argument. It accepts
an integer value ```n``` and then returns ```n``` results from each website. Note that tool returns a maximum of
the value of ```n``` and the number of results on the webiste. By default this value is set to 3. Example:
```
For Mac
python3 slash.py --search "socks" --num 5

For Windows
python slash.py --search "socks" --num 5
```
```
              timestamp                                    title   price                                     link  website rating
0   04/11/2021 13:13:33  CelerSport 6 Pack Men's Ankle Socks ...  $15.95  www.amazon.com/gp/slredirect/picasso...   amazon    4.7
1   04/11/2021 13:13:33  CelerSport Ankle Athletic Running So...  $12.70  www.amazon.com/gp/slredirect/picasso...   amazon    4.8
2   04/11/2021 13:13:33  Men's Athletic Ankle Socks 8 Pairs T...  $22.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.6
3   04/11/2021 13:13:33  CelerSport 6 Pack Men's Athletic Cre...  $18.95  www.amazon.com/gp/slredirect/picasso...   amazon    4.6
4   04/11/2021 13:13:33    Women's 10-Pair Value Pack Crew Socks   $8.79  www.amazon.com/Hanes-Womens-Crew-Whi...   amazon    4.7
5   04/11/2021 13:13:36  Hanes Women's Cool Comfort Ankle Soc...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
6   04/11/2021 13:13:36  Hanes Women's Cool Comfort Crew Sock...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
7   04/11/2021 13:13:36  AND1 Men's Cushion No Show Socks, 12...  $11.47  www.walmart.comhttps://wrd.walmart.c...  walmart    4.6
8   04/11/2021 13:13:36  Gildan Adult Men's Performance Cotto...  $10.00  www.walmart.comhttps://wrd.walmart.c...  walmart    4.3
9   04/11/2021 13:13:36  Hanes Women's Cool Comfort No Show S...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.4
10  04/11/2021 13:13:37  Follkee Women's Alpaca Wool Socks Pe...  $18.49  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
11  04/11/2021 13:13:37  Alpaca Socks | GoWith 2 Pairs Cozy W...  $19.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
12  04/11/2021 13:13:37                  Great White Shark Socks  $11.95  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
13  04/11/2021 13:13:37  Miss June’s| 1 Pair Cashmere Wool bl...  $15.00  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
14  04/11/2021 13:13:37  Customized Dog Socks - Put Your Cute...   $8.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
```

#### 5.Currency
```--currency``` provides basic currency conversion for different currencies like INR, EURO, AUD, YUAN, YEN and POUND.

Example:
```
For Mac
python3 slash.py --search "socks" --currency "inr"

For Windows
python slash.py --search "socks" --currency "inr"

```

![image](https://user-images.githubusercontent.com/48826459/140242430-0d7d2707-095a-4a2d-86a7-c5e91b88d725.png)

#### 6. Main Menu
```--full``` command is used to display the complete menu for the project. If the argument passed is "T", the Full version of the app will be displayed. If the argument passed is "F", the mini version of the app is displayed.

Example:

##### 1) When argument "F" is passed :
```
For Mac
python3 slash.py --search "socks" --full "F"

For Windows
python slash.py --search "socks" --full "F"

```
```
             timestamp                                    title   price                                     link  website rating
0  04/11/2021 16:10:02  Men's 6 Pack Everyday Kit Cushioned ...  $12.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.6
1  04/11/2021 16:10:02  Compression Athletic Crew Socks (6 P...  $19.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.4
2  04/11/2021 16:10:02  CelerSport 6 Pack Women's Ankle Runn...  $15.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.8
3  04/11/2021 16:10:05  Hanes Women's Cool Comfort Ankle Soc...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
4  04/11/2021 16:10:05  Hanes Women's Cool Comfort Crew Sock...  $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
5  04/11/2021 16:10:05  AND1 Men's Cushion No Show Socks, 12...  $11.47  www.walmart.comhttps://wrd.walmart.c...  walmart    4.6
6  04/11/2021 16:10:06  Follkee Women's Alpaca Wool Socks Pe...  $18.49  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
7  04/11/2021 16:10:06  Alpaca Socks | GoWith 2 Pairs Cozy W...  $19.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
8  04/11/2021 16:10:06                  Great White Shark Socks  $11.95  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
```

##### 2) When argument "T" is passed :
```
For Mac
python3 slash.py --search "socks" --full "T"

For Windows
python slash.py --search "socks" --full "T"

```

###### 2.a) The output window asks for user information in order to store the data in the database. It also displays the menu for the user. The user can select the product which             he/she wishes to search, check the existing list and see the currency conversion.

```
C:\Anant\NCSU\GITHUB\slash\src>python slash.py --full T
Welcome to Slash!
Please enter the following information:
Name: Anant
Email<EMAIL_ADDRESS>Welcome  Anant
Select from following:
1. Search new product
2. See exiting list
3. See Currency Conversion
4. Exit
```
##### 2.b) If the user inputs 1 i.e. Search new product, the command ```--search``` will be used. The product which the user wishes to search for needs to be entered.

```
1
Enter name of product to Search: socks
```
```
               timestamp                                    title       price                                     link  website rating
0    04/11/2021 12:24:24  CelerSport Ankle Athletic Running So...      $12.70  www.amazon.com/gp/slredirect/picasso...   amazon    4.8
1    04/11/2021 12:24:24  CelerSport 6 Pack Men's Ankle Socks ...      $15.95  www.amazon.com/gp/slredirect/picasso...   amazon    4.7
2    04/11/2021 12:24:24  Men's 6 Pack Everyday Kit Cushioned ...      $12.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.6
3    04/11/2021 12:24:24  Compression Athletic Crew Socks (6 P...      $19.99  www.amazon.com/gp/slredirect/picasso...   amazon    4.4
4    04/11/2021 12:24:24    Women's 10-Pair Value Pack Crew Socks       $8.79  www.amazon.com/Hanes-Womens-Crew-Whi...   amazon    4.7
5    04/11/2021 12:24:24  Men's Dri-tech Moisture Control Crew...      $14.99  www.amazon.com/Dickies-Multi-Pack-Dr...   amazon    4.7
6    04/11/2021 12:24:24  Women's Performance Heel Tab Athleti...      $14.99  www.amazon.com/Saucony-Womens-Perfor...   amazon    4.8
7    04/11/2021 12:24:24       Mens Cushioned Work Socks 10 Pairs      $12.10  www.amazon.com/Fruit-Loom-Everyday-S...   amazon    4.5
8    04/11/2021 12:24:24  CelerSport Ankle Athletic Running So...      $12.70  www.amazon.com/CelerSport-Ankle-Athl...   amazon    4.8
9    04/11/2021 12:24:24  mens Dual Defense Cushioned Socks - ...      $11.97  www.amazon.com/Fruit-Loom-Cushion-De...   amazon    4.7
10   04/11/2021 12:24:24  mens Athletic Cushioned Crew Socks (...      $18.99  www.amazon.com/adidas-Mens-Athletic-...   amazon    4.7
11   04/11/2021 12:24:25  Hanes Women's Cool Comfort Ankle Soc...      $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
12   04/11/2021 12:24:25  Hanes Women's Cool Comfort Crew Sock...      $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.2
13   04/11/2021 12:24:25  AND1 Men's Cushion No Show Socks, 12...      $11.47  www.walmart.comhttps://wrd.walmart.c...  walmart    4.6
14   04/11/2021 12:24:25  Gildan Adult Men's Performance Cotto...      $10.00  www.walmart.comhttps://wrd.walmart.c...  walmart    4.3
15   04/11/2021 12:24:25  Hanes Women's Cool Comfort No Show S...      $10.97  www.walmart.com/ip/Hanes-Women-s-Coo...  walmart    4.4
16   04/11/2021 12:24:25  Avia Women's Performance Flatknit Lo...       $9.97  www.walmart.com/ip/Avia-Women-s-Perf...  walmart      5
17   04/11/2021 12:24:25  Athletic Works Men's Ankle Socks 12 ...       $9.97  www.walmart.com/ip/Athletic-Works-Me...  walmart    4.4
18   04/11/2021 12:24:25  Athletic Works Men's Crew Socks 12 Pack       $9.97  www.walmart.com/ip/Athletic-Works-Me...  walmart    4.5
19   04/11/2021 12:24:25  Hanes Women's Cool Comfort Sport Ank...  From $8.97  www.walmart.com/ip/Hanes-Women-s-Com...  walmart    4.5
20   04/11/2021 12:24:25  Hanes Women's Cool Comfort No Show S...  From $5.99  www.walmart.com/ip/Hanes-Women-s-Com...  walmart    4.5
21   04/11/2021 12:24:26  Follkee Women's Alpaca Wool Socks Pe...      $18.49  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
22   04/11/2021 12:24:26  Alpaca Socks | GoWith 2 Pairs Cozy W...      $19.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
23   04/11/2021 12:24:26                  Great White Shark Socks      $11.95  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
24   04/11/2021 12:24:26  Miss June’s| 1 Pair Cashmere Wool bl...      $15.00  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
25   04/11/2021 12:24:26  Custom Face Socks w Text, Personaliz...       $7.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
26   04/11/2021 12:24:26  Customized Dog Socks - Put Your Cute...       $8.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
27   04/11/2021 12:24:26  Follkee Women's Alpaca Wool Socks Pe...      $18.49  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
28   04/11/2021 12:24:26  Custom Pet Socks - Dog Socks For Men...       $9.88  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
29   04/11/2021 12:24:26  PDF Knitting Pattern Crikey Crocodil...       $7.50  www.Etsy.comhttps://www.etsy.com/lis...     Etsy    4.5
30   04/11/2021 12:24:26  5 PAIRS of Cashmere Wool Blend Socks...      $34.36  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
31   04/11/2021 12:24:26  Custom Pet Socks, Dog Socks, Pup Soc...       $7.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
32   04/11/2021 12:24:26  Warm & Cozy Cupcake Socks, Sleeping,...       $4.99  www.Etsy.comhttps://www.etsy.com/lis...     Etsy      5
```

Once the product list is displayed, the user is given the option to choose whether to save in the product or if he or she wished to open the browser and check the link.

```
Enter 1 to save product to list
2 to open link in browser
else enter any other key to continue
1
Enter row number of product to save: 4
```

Here, as the user entered 1, the product is saved in the list.

```
             timestamp                                  title  price                                     link website rating
4  04/11/2021 12:24:24  Women's 10-Pair Value Pack Crew Socks  $8.79  www.amazon.com/Hanes-Womens-Crew-Whi...  amazon    4.7
```
```
Select from following:
1. Search new product
2. See exiting list
3. See Currency Conversion
4. Exit
2
```
##### 2.c) Now that we know that there is an element in the list, we can select the "See existing List" option.
```
   timestamp                                  title  price                                     link website  rating
0  04/11/2021 12:24:24  Women's 10-Pair Value Pack Crew Socks  $8.79  www.amazon.com/Hanes-Womens-Crew-Whi...  amazon     4.7
```

With the list output, the user is also giventhe option to choose whether to delete the item from the list or to open the link for the product.

```
Select from the following:
1. Delete item from list
2. Open link in Chrome
3. Continue
2

Enter row number to open in chrome: 0

![image](https://user-images.githubusercontent.com/48826459/140417153-365d93d4-df64-4658-a016-eadcabeebf89.png)
```
```
Select from following:
1. Search new product
2. See exiting list
3. See Currency Conversion
4. Exit
4
Thank You for Using Slash
```

#### 7. Save products in csv
```--csv``` command is used to save the complete list of the searched product in a csv format.
```--cd``` command here is used to change the directory for the csv file.
Example:
```
For Mac
python3 slash.py --search "socks" --csv --cd C:\Anant\NCSU\slash_test_csv

For Windows
python slash.py --search "socks" --csv --cd C:\Anant\NCSU\slash_test_csv

```
```
CSV Saved at:  C:\Anant\NCSU\slash_test_csv
File Name: C:\Anant\NCSU\slash_test_csv\socks211104_1223.csv
```

![image](https://user-images.githubusercontent.com/48826459/140409684-a352f30a-9b01-4369-a044-f166eab42630.png)

gha_language: Python


text:
---
title: Deleted root@localhost account in MySQL
author: Kev
layout: post
permalink: /deleted-rootlocalhost-account-in-mysql/
redirect_from: /2011/07/02/deleted-rootlocalhost-account-in-mysql/
syntaxhighlighter_encoded:
  - 1
dsq_thread_id:
  -<PHONE_NUMBER>
dsq_needs_sync:
  - 1
categories:
  - Linux
tags:
  - mysql
---
Like the fool I am, whilst messing about with user privileges in phpMyAdmin I managed to delete the root account. Suddenly I found myself with no access to any of my databases <img src="http://www.kevssite.com/wp-includes/images/smilies/icon_sad.gif" alt=":(" class="wp-smiley" />

It took a while to figure out how to re-create the root@localhost user, so here’s how I did it.<!--more-->

1.    Start the msql server up with skip-grant-tables option
3.  Log in to mysql
4.  Change to the mysql database
5.  Create the root user
6.  Re-start mysql server

For those that like a cut n paste approach, these are the commands:
{% highlight bash %}
service mysqld stop
mysqld_safe --skip-grant-tables &
mysql
use mysql
create user root@localhost;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' with grant option;
commit;
FLUSH PRIVILEGES;
exit
service mysqld restart
{% endhighlight %}

You can confirm that the root account has been created (or is indeed missing!) by listing entries on the user table:
{% highlight bash %}
use mysql;
select Host,User from user;
{% endhighlight %}

Good luck!
Kev.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Session 2; An Introduction to Classes and Objects

In this session we are going to give an introduction to [classes and objects](https://www.w3schools.com/python/python_classes.asp) in python. Classes and objects are the basis of [OOP(Object Oriented Programming)](https://en.wikipedia.org/wiki/Object-oriented_programming#:~:text=Object-oriented%20programming%20(OOP),(often%20known%20as%20methods)) and will be used extensively throughout the course, and in lots of existing python code.

You have already used Objects so far in the course (Integers (int), Strings (str), Lists(list)) without even knowing it. Now it's time to learn what they are, and how you can create your own!

**NOTE**: Out of habit I use different terms, so when i'm talking in class ```instance == object``` and ```member values == attributes```

## Agenda

- Objects/instances
- Classes
- Starting our Game

## Additional Resources

[Slides](https://docs.google.com/presentation/d/1qn_p7oQGK7l32ZScIPU20GBANtYoJ97ivH2sODwT6J8/edit#slide=id.g8d84a60dfe_0_0)

[W3C Python class explanation](https://www.w3schools.com/python/python_classes.asp)

[Python classes (Corey Schafer)](https://www.youtube.com/watch?v=ZDa-Z5JzLYM)

## Further Reading

All of these links below will expand on what was taught about classes, and teach you some interesting things about them. You don't need to know any of these things for the course, but they're useful tools for python in general:

- [Everything is an Object in python](https://www.codingninjas.com/blog/2020/08/27/how-everything-in-python-is-an-object/)
- [Docstrings in python](https://canadiancoding.ca/posts/post/python/docstrings/)
- [Dunder/Magic methods in python](https://dbader.org/blog/python-dunder-methods)
- [Getters and Setters](https://www.datacamp.com/community/tutorials/property-getters-setters)
- [Dataclasses (a faster way to create classes, but is quite advanced)](https://canadiancoding.ca/posts/post/python/dataclasses/)
- [Metaclasses (very advanced)](https://realpython.com/python-metaclasses/)

path: /Session 2/README.md

branch_name: refs/heads/main


text:
# Brian McVeigh's Dotfiles

## Inspired and forked from Ryan Bates Dot Files

Check out his dotfiles. [Ryan's Dotfiles](https://github.com/ryanb/dotfiles)

I am running on Mac OS X, but it will likely work on Linux as well.

Also, feel free to fork my implementation of his dotfiles and customize it to your liking.

## Installation

Run the following commands in your terminal. It will prompt you before it does anything destructive. Check out the [Rakefile](https://github.com/ryanb/dotfiles/blob/custom-bash-zsh/Rakefile) to see exactly what it does.

```terminal
cd && git clone https://github.com/bmcveigh/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
rake install
```

After installing, open a new terminal window to see the effects.

Feel free to customize the .zshrc file to match your preference.

## Uninstall

To remove the dotfile configs, run the following commands. Be certain to double check the contents of the files before removing so you don't lose custom settings.

```
unlink ~/.bin
unlink ~/.gitignore
unlink ~/.gemrc
unlink ~/.gvimrc
unlink ~/.irbrc
unlink ~/.vim
unlink ~/.vimrc
rm ~/.zshrc # careful here
rm ~/.gitconfig
rm -rf ~/.dotfiles
rm -rf ~/.oh-my-zsh
chsh -s /bin/bash # change back to Bash if you want
```

Then open a new terminal window to see the effects.

## Creating custom scripts

Scripts are autoloaded from the tools directory. Simply create a directory and a <your_script_name>.sh file with
your script in that directory. Note that it's important to make sure your file has the .sh suffix or else the
autoloader will not load your script. For example, if I have a tool called foo, I would run the
following commands from this repository's root directory:

```
cd tools
mkdir foo
cd foo
touch foo.sh
```

repository: bmcveigh/dotfiles

repo_name: bmcveigh/dotfiles


text:
## APPublicIP Swift 3 - Original Project by AlbanPerli

Get the device's current public IP Address.
Based on https://www.ipify.org/
(unlimited requests for free)

## One shot
```swift
let ipChecker = APPublicIP();
ipChecker.getCurrentIP { (ip) -> Void in
        print(ip)
}
```

## Listen to any IP Address change.
```swift
let ipChecker = APPublicIP();
ipChecker.checkForCurrentIP({ (ip) -> Void in
        print(ip)
}, interval: 0.5.second)
```

## Installation
As for now please clone the repository and drag the source folder into your project to use APPublicIP

###### This project uses https://github.com/radex/SwiftyTimer from Radek Pietruszewski

## License
APPublicIP is available under the MIT license. See the LICENSE file for more info.


text:
## HTML rendering

The following page compares the HTML rendering obtained by
   1. Mozilla Firefox 65
   2. inscriptis and
   3. Lynx 2.8.9dev.19
 to each other.

Since inscriptis is often used for natural language processing, we do not insert any line breaks, unless they are explicitley requested in the HTML code (e.g. using `<p>`, `<br>`, etc.).

### Use cases

1. [Wikipedia table](#Wikipedia-table)
2. [Nested tables](#Nested-tables)
3. [Whitespace handling](#Whitespace-handling) (e.g. formatting of `<pre>` tags and `<code>` blocks)

### Wikipedia table
A table taken from the English Wikipedia page for [Chur](https://en.wikipedia.org/wiki/Chur).

* Firefox (screenshot)

* inscriptis
```
Climate[edit]

Chur has an oceanic climate in spite of its inland position. Summers are warm and sometimes hot, normally averaging around 25 °C (77 °F) during the day, whilst winter means are around freezing, with daytime temperatures being about 5 °C (41 °F). Between 1981 and 201 Chur had an average of 104.6 days of rain per year and on average received 849 mm (33.4 in) of precipitation. The wettest month was August during which time Chur received an average of 112 mm (4.4 in) of precipitation. During this month there was precipitation for an average of 11.2 days. The driest month of the year was February with an average of 47 mm (1.9 in) of precipitation over 6.6 days.[14]

Climate data for Chur (1981-2010)
Month                                  Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep     Oct     Nov     Dec     Year
Average high °C (°F)                   4.8     6.4     11.2    15.1    20.0    22.7    24.9    24.1    20.0    16.1    9.5     5.3     15.0
                                       (40.6)  (43.5)  (52.2)  (59.2)  (68.0)  (72.9)  (76.8)  (75.4)  (68.0)  (61.0)  (49.1)  (41.5)  (59.0)
Daily mean °C (°F)                     0.7     1.8     5.9     9.7     14.3    17.1    19.1    18.5    14.8    10.8    5.2     1.7     10.0
                                       (33.3)  (35.2)  (42.6)  (49.5)  (57.7)  (62.8)  (66.4)  (65.3)  (58.6)  (51.4)  (41.4)  (35.1)  (50.0)
Average low °C (°F)                    −2.6    −2.0    1.6     4.6     8.9     11.8    13.8    13.7    10.3    6.6     1.7     −1.4    5.6
                                       (27.3)  (28.4)  (34.9)  (40.3)  (48.0)  (53.2)  (56.8)  (56.7)  (50.5)  (43.9)  (35.1)  (29.5)  (42.1)
Average precipitation mm (inches)      51      47      55      49      71      93      109     112     81      56      70      55      849
                                       (2.0)   (1.9)   (2.2)   (1.9)   (2.8)   (3.7)   (4.3)   (4.4)   (3.2)   (2.2)   (2.8)   (2.2)   (33.4)
Average snowfall cm (inches)           34.0    24.7    10.3    1.5     0.4     0.0     0.0     0.0     0.1     0.1     10.0    20.6    101.7
                                       (13.4)  (9.7)   (4.1)   (0.6)   (0.2)   (0.0)   (0.0)   (0.0)   (0.0)   (0.0)   (3.9)   (8.1)   (40.0)
Average precipitation days (≥ 1.0 mm)  7.3     6.6     8.1     7.5     9.9     11.2    11.0    11.2    8.4     7.0     8.5     7.9     104.6
Average snowy days (≥ 1.0 cm)          4.8     3.9     2.5     0.4     0.1     0.0     0.0     0.0     0.0     0.0     1.6     4.1     17.4
Average relative humidity (%)          73      70      65      63      64      67      68      71      73      73      74      75      70
Mean monthly sunshine hours            97      112     139     147     169     177     203     185     155     135     93      81      1,692
Source: MeteoSwiss [14]
```
* lynx
```
Climate[[166]edit]

   Chur has an [167]oceanic climate in spite of its inland position.
   Summers are warm and sometimes hot, normally averaging around 25 °C
   (77 °F) during the day, whilst winter means are around freezing, with
   daytime temperatures being about 5 °C (41 °F). Between 1981 and 201
   Chur had an average of 104.6 days of rain per year and on average
   received 849 mm (33.4 in) of [168]precipitation. The wettest month was
   August during which time Chur received an average of 112 mm (4.4 in) of
   precipitation. During this month there was precipitation for an average
   of 11.2 days. The driest month of the year was February with an average
   of 47 mm (1.9 in) of precipitation over 6.6 days.^[169][14]
   Climate data for Chur (1981-2010)
   Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Year
   Average high °C (°F) 4.8
   (40.6) 6.4
   (43.5) 11.2
   (52.2) 15.1
   (59.2) 20.0
   (68.0) 22.7
   (72.9) 24.9
   (76.8) 24.1
   (75.4) 20.0
   (68.0) 16.1
   (61.0) 9.5
   (49.1) 5.3
   (41.5) 15.0
   (59.0)
   Daily mean °C (°F) 0.7
   (33.3) 1.8
   (35.2) 5.9
   (42.6) 9.7
   (49.5) 14.3
   (57.7) 17.1
   (62.8) 19.1
   (66.4) 18.5
...
```

---

### Nested tables
A table that contains three other tables per row.

* Firefox (screenshot)

* inscriptis

```
 Single

First

red        green
     blue
red        green

Second

     blue
red        green
     blue

Nested

red        green       blue              blue
     blue         red        green  red        green
red        green       blue              blue

     blue         red        green       blue
red        green       blue         red        green
     blue         red        green       blue

red        green       blue              blue
     blue         red        green  red        green
red        green       blue              blue
```

* lynx
```
                                     Single

First

   red      green
       blue
   red      green

Second

       blue
   red      green
       blue

                                     Nested

   red      green
       blue
   red      green
       blue
   red      green
       blue
       blue
   red      green
       blue
       blue
   red      green
       blue
   red      green
       blue
   red      green
       blue
   red      green
       blue
   red      green
       blue
   red      green
       blue
   red      green
       blue
       blue
   red      green
       blue
```
### Whitespace handling

Code examples taken from [Python (programming language)](https://en.wikipedia.org/wiki/Python_(programming_language) on Wikipedia.

* Firefox (screenshot)

* inscriptis
```
  Python programming examples [ edit ]

  Hello world program:

    print('Hello, world!')

  Program to calculate the factorial of a positive integer:

    n = int(input('Type a number, and its factorial will be printed: '))

    if n < 0:
        raise ValueError('You must enter a positive integer')

    fact = 1
    i = 2
    while i <= n:
        fact *= i
        i += 1

    print(fact)

  Libraries [ edit ]

  Python's large standard library, commonly cited as one of its greatest strengths,[99] provides tools suited to many tasks. For Internet-facing applications, many standard formats and protocols such as MIME and HTTP are supported. It includes modules for creating graphical user interfaces, connecting to relational databases, generating pseudorandom numbers, arithmetic with arbitrary-precision decimals,[100] manipulating regular expressions, and unit testing.
```

* lynx
```
Python programming examples[edit]

   Hello world program:

print('Hello, world!')

   Program to calculate the factorial of a positive integer:

n = int(input('Type a number, and its factorial will be printed: '))

if n < 0:
    raise ValueError('You must enter a positive integer')

fact = 1
i = 2
while i <= n:
    fact *= i
    i += 1

print(fact)

Libraries[edit]

   Python's large standard library, commonly cited as one of its greatest strengths,^[99] provides tools suited to many tasks. For Internet-facing applications, many standard formats and
   protocols such as MIME and HTTP are supported. It includes modules for creating graphical user interfaces, connecting to relational databases, generating pseudorandom numbers, arithmetic
   with arbitrary-precision decimals,^[100] manipulating regular expressions, and unit testing.
```

repository: weblyzard/inscriptis

repo_name: weblyzard/inscriptis


text:
# Cake.Rest

Cake Add-in to ease consumption of REST APIs using [RestSharp](http://restsharp.org/).

[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/cake-contrib/Cake.Rest/blob/master/LICENSE)

## Information

| | master branch |
|---|---|
|NuGet|[![NuGet](https://img.shields.io/nuget/v/Cake.Rest.svg)](https://www.nuget.org/packages/Cake.Rest)|
|AppVeyor|[![Build status](https://img.shields.io/appveyor/ci/cakecontrib/cake-rest.svg)](https://ci.appveyor.com/project/cakecontrib/cake-rest)|
|Travis CI|[![Build status](https://api.travis-ci.com/cake-contrib/Cake.Rest.svg?branch=master)](https://travis-ci.com/cake-contrib/Cake.Rest)|
|Code Coverage|[![Code Coverage](https://img.shields.io/coveralls/github/cake-contrib/Cake.Rest.svg?style=flat)](https://coveralls.io/github/cake-contrib/Cake.Rest)|

## Build

To build this library, we use [Cake](https://cakebuild.net/) and [Cake.Recipe](https://github.com/cake-contrib/Cake.Recipe).

On Windows PowerShell, run the bootstrapper through:

```powershell
.\build.ps1
```

or on Linux/macOS:
```
./build.sh
```

## Credits
- João Antunes (Coding Militia) for [his great walkthrough on using Cake on CI/CD to publish a library to NuGet](http://https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-02-defining-the-build-with-cake-publish-nuget). Code from example project used under MIT.

- [@phillipsj](https://github.com/phillipsj) for [Cake.Netlify](https://github.com/cake-contrib/Cake.Netlify), some Cake code and some parts of CI/CD configurations come from that repo.

- [The RestSharp Project](http://restsharp.org/), without RestSharp this would not be this easy.

gha_language: C#

gha_license_id: MIT


text:
# STUtility

[![CI Status](http://img.shields.io/travis/suancaiyucc<EMAIL_ADDRESS>[![Version](https://img.shields.io/cocoapods/v/STUtility.svg?style=flat)](http://cocoapods.org/pods/STUtility)
[![License](https://img.shields.io/cocoapods/l/STUtility.svg?style=flat)](http://cocoapods.org/pods/STUtility)
[![Platform](https://img.shields.io/cocoapods/p/STUtility.svg?style=flat)](http://cocoapods.org/pods/STUtility)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

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

```ruby
pod 'STUtility'
```

## Author

<EMAIL_ADDRESS><EMAIL_ADDRESS>
## License

STUtility is available under the MIT license. See the LICENSE file for more info.

repository: suancaiyu/STUtility

repo_name: suancaiyu/STUtility


text:
---
title: "\n\t\t\t\tMacBook Pro 13.3 inch 8GB Memory Upgrades\t\t"
date: 2011-01-25 00:00:00 Z
categories:
- jim
author<EMAIL_ADDRESS>comments: true
excerpt: "\n\t\t\t\t\t\t"
layout: post
link: https://jim.am/macbook-pro-13-3-inch-8gb-memory-upgrades/
wordpress_id: 5429
---

What do you get when you combine the best selling Apple MacBook with the most RAM or memory you can install in a current shipping MacBook Pro? A small, powerful – and thanks in part to the 8GB of RAM that maxes out the 13.3 inch MacBook Pro – notebook computer from Apple that has the most ram possible installed and in most cases, for less than $100 for MacBook Pro 8GB

[![Best MacBook Pro Price](http://www.jim.am/wp-content/uploads/2011/03/Screen-shot-2011-03-24-at-7.39.14-AM1.png)](http://www.amazon.com/gp/product/B002QQ8H8I/ref=as_li_ss_tl?ie=UTF8&tag=ramseeker-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B002QQ8H8I)

[table id=1 /]

**[Best Priced MacBook Pro](http://www.amazon.com/gp/product/B002QQ8H8I/ref=as_li_ss_tl?ie=UTF8&tag=ramseeker-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B002QQ8H8I)**

You can even offset the the cost of 8GB MacBook Pro RAM by selling your old, or original memory that came installed in the MacBook Pro 13 inch back to [some](http://www.jim.am/oempcworld) [memory](http://www.jim.am/ramjet) [manufacturers](http://www.jim.am/memoryx) who will take your older memory in as a trade where you offset the cost and get 8GB RAM for MacBook Pro even cheaper than you could if you bought the RAM

To max out the 13 inch MBP, you need to remove (in most cases) the 2 x 2GB memory modules in the two memory upgrade slots and replace them with 2x 4GB RAM for MacBook Pro. There’s quite a selection of best memory stores (see sidebar) to buy MacBook RAM from but to get the best price you should compare prices on both 4GB memory modules for MacBook Pro and also 8GB memory upgrade kits too as some stores only market their memory upgrades as ram modules, while others prefer to sell you a 8GB MacBook RAM Upgrade KIT which consists of two 4GB DDR3 1066 SDRAM memory modules for MacBook Pro

Stores I recommend for memory upgrades are [Crucial](http://amzn.to/2oA2gjC), [OWC](http://www.jim.am/OWC), [Data Memory Systems](http://www.jim.am/dms), [18004Memory](http://www.jim.am/1800), [MemoryX](http://www.jim.am/memoryx) and [OEMPCWORLD](http://www.jim.am/oempcworld)

There’s other memory stores but over the 14 yeas of tracking memory upgrades I find that these few stores support and sell quality Apple Memory Upgrades for less than what you would pay if you were to buy the RAM from Apple, which while convenient sometimes – is not the best way to save money on ram upgrades.

** Best RAM prices for MacBook Memory Upgrades:

**

repository: ramseeker/sidey

extension: markdown

repo_name: ramseeker/sidey


text:
# JSON powered Dynamic Form Nextjs app with Antd Form

This is a sample app using Json to render dynamic form using Antd Form component with Nextjs serverside rendering

Install it and run:

```bash
npm install
npm run dev
# or
yarn
yarn dev
```

repository: jimmdd/dynamic-json-form-with-antd

gha_language: JavaScript

repo_name: jimmdd/dynamic-json-form-with-antd


text:
# system_mpi: Portable MPI interface for Fortran

The MPI standard defines three different Fortran interfaces. This leads to a challenge when creating portable software that can support all three interfaces. The three interfaces can be described as follows:

- A legacy interface, invoked with `include 'mpif.h'`. This interface is deprecated and produces lots of type mismatch errors on recent gfortran releases, but remains the only available option for some systems and compilers.
- A Fortran 90 interface, invoked with `use mpi`.
- A Fortran 2008 interface, invoked with `use mpi_f08`.

`system_mpi` provides a proxy for the best-available linked MPI library.

## Installation

Build using CMake:

``` bash
mkdir build
cd build
cmake ..
make
make install
```

## Usage

To use system_mpi, a program or library needs to be linked to the `system_mpi` library. For code built using CMake, this can be accomplished by loading system_mpi with `find_package(system_mpi)` and linking targets with `target_link_libraries`.

In addition, the library needs to be linked to the same MPI library that was used to compile `system_mpi`. `system_mpi` includes a helper function `configure_mpi_target` that will link a target to the MPI library.

For example, if you have a library called `my_library` compiled from `my_library.F90` and an executable called `my_executable` compiled from `my_executable.F90`, your CMakeLists.txt might look like the following:

``` cmake
cmake_minimum_required(VERSION 3.10)

project(my_project)

enable_language(Fortran)

find_package(system_mpi)

add_library(my_library SHARED my_library.F90)
target_link_libraries(my_library PUBLIC system_mpi)
configure_mpi_target(my_library)

add_executable(my_executable program.F90)
target_link_libraries(my_executable PRIVATE system_mpi)
configure_mpi_target(my_executable)
```

### Calling MPI procedures

Within the source code, add `use system_mpi` to the top of each module or procedure that calls MPI functions. At compile-time the compiler will select the best available Fortran interface, using the `mpi` or `mpi_f08` module as required.

For the most part, the differences between the three interfaces consist of subtle differences in argument types. `system_mpi` provides the following preprocessor definitions that can be used to adapt to these type differences:

<style>
td, th { border: 1px solid grey; padding:5px }
table { margin: 1em}
</style>

| Name             | Description               | mpi      | mpi_f08     |
|------------------|---------------------------|----------|-------------|
| MPI_COMM_TYPE    | Type of MPI communicators | integer  | MPI_Comm    |
| MPI_STATUS_TYPE  | Type of MPI statuses      | integer  | MPI_Status  |
| MPI_REQUEST_TYPE | Type of MPI requests      | integer  | MPI_Request |

The above preprocessor directives can be used to produce portable code that works with all three MPI interfaces. When calling an MPI procedure that accepts an MPI communicator, status, or request, use the appropriate preprocessor directive in place of the type specified in the MPI documentation, and it will be replaced with the appropriate type before compilation.

Here is an simple example that uses all three of the above preprocessor definitions:

``` fortran
program MPI_example

  use system_mpi

  MPI_COMM_TYPE::comm
  MPI_REQUEST_TYPE::request
  MPI_STATUS_TYPE::status
  integer::ierr
  integer::data=0

  ! Initialize MPI
  call MPI_Init(ierr)

  ! Set the comm to MPI_COMM_WORLD
  comm=MPI_COMM_WORLD

  ! Broadcast the data variable to all processors (nonblocking)
  call MPI_Ibcast(data,1,MPI_INTEGER,0,comm,request,ierr)

  ! Wait for broadcast to complete
  call MPI_Wait(request,status,ierr)

  call MPI_Finalize(ierr)

end program MPI_example
```

The function MPI_Waitall adds an additional complication because it accepts an array of MPI statuses whose dimensionality differs among the three MPI interfaces. `system_mpi` provides a portable wrapper procedure `system_mpi_waitall` that accepts a 1-D array of type `MPI_REQUEST_TYPE` and calls `MPI_Waitall` with the appropriate arguments.

## License

[MIT](https://choosealicense.com/licenses/mit/)

DISTRIBUTION A: Approved for public release, distribution is unlimited


text:
# Spring Boot Dev Tools Gradle Plugin

![CI](https://github.com/thombergs/spring-devtools-gradle-plugin/workflows/CI/badge.svg)
[![GitHub release](https://img.shields.io/github/release/thombergs/spring-boot-devtools-gradle-plugin.svg)](https://plugins.gradle.org/plugin/io.reflectoring.spring-boot-devtools)

This plugin enables [Spring Boot Dev Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-devtools) in your Gradle-based project to improve the dev loop when working on your Spring Boot application.

This plugin brings the following tasks:

* `./gradlew restart` to trigger a restart of the Spring application context when you have changed a Java file
* `./gradlew reload` to trigger a refresh of static resources when you have changed HTML templates, images, or other static resources

Run these tasks while you have started a Spring Boot application via `./gradlew bootrun` and the changes you made will become visible in the application after a couple seconds. A reload is quicker than a restart because it doesn't need to restart the Spring application context.

If you want a more in-depth explanation about what Spring Boot Dev Tools does to appreciate what this Gradle plugin is doing for you, have a look at the article [Optimize Your Dev Loop with Spring Boot Dev Tools](https://reflectoring.io/spring-boot-dev-tools/).

## Configuration

### Apply the plugin

Apply the plugin to the Gradle module containing the Spring Boot application:

```groovy
plugins {
  id 'org.springframework.boot' version '2.3.2.RELEASE'
  id 'io.spring.dependency-management' version '1.0.9.RELEASE'
  id 'java'
  id 'io.reflectoring.spring-boot-devtools' version '0.0.2' // <---
}
```

### Configure a trigger file

Add this to your `application.yml`:

```yaml
devtools:
  restart:
    trigger-file: .triggerFile
    additional-paths: build
```

This configures Spring Boot Dev Tools to only restart the Spring Boot app when the file `/build/.triggerFile` changes. This file is touched by the plugin each time it has updated all the changed files.

### Configure contributing modules

If you want to see changes in contributing modules (i.e. Gradle modules that contribute a JAR file to the Spring Boot application), you have to declare if you want them to be included in a restart and a reload by adding them to the `restart` and/or `reload` configuration:

```groovy
dependencies {

  // these modules contribute a JAR file to the Spring Boot app
  implementation project(':module1')
  implementation project(':module2')

  // this enables auto-restart for changes in module1
  restart project(':module1')

  // this enables auto-reload for changes in module2
  reload project(':module2')

  // Spring Boot dependencies and other dependencies omitted
}
```

Running `./gradlew restart` will now copy all compiled Java files into the `build/classes` folder of the Spring Boot module to refresh the classpath and trigger a restart.

Running `./gradlew reload` will now copy all files from `src/main/resources` from the module into the `build/resources` folder of the Spring Boot module to refresh the classpath and trigger a reload.

If a module contributes resource files from a different location than `src/main/resources`, you can specify a custom Gradle task to be called on `restart` for each module:

```groovy
devtools {

  modules {
    // "module1" is a random, but unique, identifier for
    // the module we're configuring.
    module1 {

      // Must be one of the modules in the restart configuration.
      dependency = ":module1"

      // This task will be called every time `./gradlew reload` is called.
      // It's expected to all changed resources into the folder "build/resources/main". From there, they
      // will automatically be copied to the main module. Alternatively, this task can copy any changed files
      // directly into the "build/resources/main" folder of the main module.
      reloadTask = "reload"

    }
  }
}
```

### Configure a custom trigger file

If the default trigger file `.triggerFile` does not suit you, you can change to name othe trigger file:

```groovy
devtools {
  // Change the name of the trigger file. The plugin creates this file in the "build" folder of the
  // main module after each call of the "restart" task. Make sure to configure the same trigger file
  // in devtools.restart.trigger-file in your application.yml or application.properties file.
  triggerFile = ".triggerFile"
}
```

## Samples

Look at the sample projects to see the plugin in action:

* [single-module](samples/single-module)
* [multi-module](samples/multi-module)

## Limitations

The plugin has been tested with single- and multi-module Gradle builds in a pretty standard configuration that should cover the most common cases. The plugin has also been successfully tested with NPM projects (wrapped in Gradle) that provide Javascript resources to a Spring Boot application.

The plugin currently works with these assumptions:

* the contributing modules have the `java` plugin installed
* the contributing modules produce a single JAR file in `build/libs`
* the build folder of the modules is `build`
* ... and probably a bunch of other assumptions that I haven't identified, yet.

Feel free to open issues with feature requests or pull requests with improvements!


text:
# cache-size

Get a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache)'s size in bytes, useful when working with Service Workers.
\* Take into account that responses of type `opaque` will report a size of 0, more information [here](https://fetch.spec.whatwg.org/#concept-filtered-response-opaque), [here](https://stackoverflow.com/questions/39109789/what-limitations-apply-to-opaque-responses) and [here](https://blog.fullstacktraining.com/what-is-an-opaque-response/).

## Install

```
$ npm install cache-size
```

## Usage

```js
import cacheSize from 'cache-size';

cacheSize('static-assets');
//=> 12327273 the space used by the entire cache in bytes
```

## API

### cacheSize(cachename)

#### cachename

Type: `string`

The name of the cache whose size you want to know.

repository: fgilio/cache-size

repo_name: fgilio/cache-size


text:
# Legends of Runeterra DRA20
Collective project where the knowledge acquired in the subject will be put into practice, taking as an example game data from RIOT Legends of Runeterra - Rapid Application Development 2020 UAL

## Collaborators

* **Manel Mena** -  [https://github.com/manelme](https://github.com/manelme). :key:
* **Francisco José Martín López** - [https://github.com/FranciscoMartLop](https://github.com/FranciscoMartLop). :key:
* **Francisco Jesús García López** -  [https://github.com/Frangar1998](https://github.com/Frangar1998).
* **Alejandro Francisco García Uclés** -  [https://github.com/AlejandroFrGU](https://github.com/AlejandroFrGU).
* **Adalid Villanueva** - [https://https://github.com/avillanueva047](https://github.com/avillanueva047).
* **Marius Cosmin Magurean** - [https://github.com/MM-Cosmin](https://github.com/MM-Cosmin). :key:
* **Juan Soler Márquez** -  [https://github.com/juansoler](https://github.com/juansoler). :key:
* **Jose Antonio Parra Sánchez** -  [https://github.com/JoseAntonioPS](https://github.com/JoseAntonioPS). :key:
* **Joaquin Francisco Sánchez Capel** - [https://github.com/JoaSanCap](https://github.com/JoaSanCap).

# Disclaimer

Runeterra DRA20 isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Legends of Runeterra. Legends of Runeterra and Riot Games are trademarks or registered trademarks of Riot Games, Inc. Legends of Runeterra © Riot Games, Inc.


text:
---
title: LAMP Installation on Manjaro
description: A walk-through on how to configure Linux, Apache, MariaDB, and PHP (LAMP) for development or production purposes.
img: markus-spiske-466ENaLuhLY-unsplash.jpg
alt: LAMP Installation on Manjaro
featured: 0
author:
    name: Jesse Quinn
    bio: All about Jesse
    img: https://images.unsplash.com/photo-1533636721434-0e2d61030955?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2550&q=80
    alt: profile photo
publishedAt: 2019-10-28T03:00:00.000Z
updateAt: 2020-07-19T03:00:00.000Z
---

#### Introduction
A LAMP configuration is a linux distro setup to use Apache, a well known and popular httpd, a SQL server such as MariaDB or Mysql, and a scripting language like PHP, Python or Perl; thus forming the acronym LAMP. However, a LAMP server could in fact use Nginx or another httpd server or Postresql or many other databases.

#### Installation
The following is based on [here](https://www.ostechnix.com/install-apache-mariadb-php-lamp-stack-on-arch-linux-2016/).

On Manjaro/Archlinux it is always advisable to run:

	sudo pacman -Syu
	sudo pacman -S apache php php-apache mysql

to update your system with current software and install the required packages. You should be prompted with two database options. Select  ```mariadb```.

##### Apache
Edit the Apache configuration file and comment out the following line if it is not already:
:

	sudo nano /etc/httpd/conf/httpd.conf
	# LoadModule unique_id_module modules/mod_unique_id.so

Enable and start the Apache service with systemd:

	sudo systemctl enable httpd
	sudo systemctl start httpd

Verify the status:

	sudo systemctl status httpd
	sudo journalctl -xe

Create a test index.html with the following html:

	sudo nano /srv/http/index.html

		<title>Hello World</title>

Hello World

Visit your localhost in your favourite browser http://localhost or http://localipaddress to confirm you receive ```Hello World```.

##### MariaDB
Initialize the database with:

	sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

like Apache we need to use systemd to load the MariaDB service permanently

	sudo systemctl enable mysqld
	sudo systemctl start mysqld

Check the status of the service

	sudo systemctl status mysqld
	sudo journalctl -xe

run the following script to setup the root user

	sudo mysql_secure_installation

##### PHP
Revisit the Apache configuration file:

	sudo nano /etc/httpd/conf/httpd.conf

and comment out the ```mod_mpm_event``` and either add or uncomment the following:

	#LoadModule mpm_event_module modules/mod_mpm_event.so
	LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
	LoadModule php7_module modules/libphp7.so
	AddHandler php7-script php
	Include conf/extra/php7_module.conf

Create a test for php:

	sudo nano /srv/http/test.php
	<?php
		phpinfo();

Restart Apache and vist http://localhost/test.php

	sudo systemctl restart httpd

You are done. You can either use phpMyAdmin or your IDE such as phpstorm/datagrip from [JetBrains](https://www.jetbrains.com/) to interact with your database. I personally opt to use my IDE.

##### phpMyAdmin

Install phpMyAdmin:

	sudo pacman -S phpmyadmin

Edit the ```php.ini``` file and uncomment the following:

	sudo nano /etc/php/php.ini
	extension=bz2.so
	extension=mysqli.so

We need to map phpMyAdmin to an url with Apache:

	sudo nano /etc/httpd/conf/extra/phpmyadmin.conf
	Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
	<Directory "/usr/share/webapps/phpMyAdmin">
		DirectoryIndex index.php
		AllowOverride All
		Options FollowSymlinks
		Require all granted
	</Directory>

and include the configuration to the Apache configuration file:

	sudo nano /etc/httpd/conf/httpd.conf
	Include conf/extra/phpmyadmin.conf

We need to also edit the phpMyAdmin configuration file and restart the Apache service:

	sudo nano /etc/webapps/phpmyadmin/config.inc.php
	$cfg['blowfish_secret'] = '`somesecrethere`';
	sudo systemctl restart httpd


text:
# Using Swagger in Liberty [![Build Status](https://travis-ci.org/WASdev/sample.swagger.svg?branch=master)](https://travis-ci.org/WASdev/sample.swagger)

This sample contains a few ways of how to use Swagger documentation within Liberty. This application contains
two individual servlets:  the JAX-RS servlet is used to handle requests to a Tasks API, which allows user to create, view and delete Task objects, while the second servlet is an extension of a HTTPServlet and is used to resond to requests for a Contacts API.
Contacts API lets you create, view and update Contact objects.

[TasksResource](/swagger-sample/src/main/java/net/wasdev/swaggersample/jaxrs/TasksResource.java) is a
JAX-RS resouce classs that uses both JAX-RS and Swagger annotations to document the API.

Documentation for HTTPServlet based API [ContactsServlet](/swagger-sample/src/main/java/net/wasdev/swaggersample/servlet/ContactsServlet.java)
is provided using Swagger stub file [swagger.json](/swagger-sample/src/main/webapp/META-INF/stub/swagger.json)

## Getting Started

Browse the code to see what it does, or build and run it yourself:
* [Building and running on the command line using Maven and Gradle](/docs/Using-cmd-line.md)
* [Building and running using Eclipse and WebSphere Development Tools (WDT)](/docs/Using-WDT.md)

Once the server has been started, go to [REST API Discovery](https://developer.ibm.com/wasdev/blog/2016/02/17/exposing-liberty-rest-apis-swagger/) Explorer at [https://localhost:9444/ibm/api/explorer/](https://localhost:9444/ibm/api/explorer/)
to interact with the sample. Default credentials are login: user, password: demo

## Notice

© Copyright IBM Corporation 2016, 2017.

## License

```text
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
````


text:
# Nightly builds

Nightly builds are provided to allow developers to use the latest features that haven't been released yet. The nightly builds of each package are published on each successful build of the main branch. Use the installation instructions below for each respective package.

### Store

```sh
npm install github:ngrx/store-builds
```

```sh
yarn add github:ngrx/store-builds
```

### Store Devtools

```sh
npm install github:ngrx/store-devtools-builds
```

```sh
yarn add github:ngrx/store-devtools-builds
```

### Effects

```sh
npm install github:ngrx/effects-builds
```

```sh
yarn add github:ngrx/effects-builds
```

### Router Store

```sh
npm install github:ngrx/router-store-builds
```

```sh
yarn add github:ngrx/router-store-builds
```

### Entity

```sh
npm install github:ngrx/entity-builds
```

```sh
yarn add github:ngrx/entity-builds
```

### Data

```sh
npm install github:ngrx/data-builds
```

```sh
yarn add github:ngrx/data-builds
```

### Component

```sh
npm install github:ngrx/component-builds
```

```sh
yarn add github:ngrx/component-builds
```

### ComponentStore

```sh
npm install github:ngrx/component-store-builds
```

```sh
yarn add github:ngrx/component-store-builds
```

### Schematics

```sh
npm install github:ngrx/schematics-builds --save-dev
```

```sh
yarn add github:ngrx/schematics-builds --dev
```

repository: ngrx/platform

gha_language: TypeScript

gha_license_id: NOASSERTION

repo_name: ngrx/platform


text:
grunt-contrib-livereload is composed of two tasks:

* `livereload-start`: sets up a local server that will serve the needed js file and the wesocket that will control your browser
* `livereload`: triggers the browser reload

Additionally a Connect middleware is available to inject a JS snippet into the page to that will connect the browser to the livereload server.

This task support multiple browsers, which means all the browsers listening on the livereload port will be reloaded at the same time.

Note that grunt-contrib-livereload is designed to use [grunt-regarde](https://github.com/yeoman/grunt-regarde) instead grunt-contrib-watch (mainly due to shortcomings in the `watch` task which doesn't give access to changed files because it spawns tasks in subprocesses.)

## The livereload-start task

This task starts a server ([tiny-lr](https://github.com/mklabs/tiny-lr)) in the background, which will:
* serve the `livereload.js`
* act as a websocket server: each browser that opens a websocket to this server will be refreshed

By default the server listens on port 35729, but this can be changed through the `port` options.

## The livereload task

This task needs to be called to trigger a reload. It must be passed the list of files that have changed (i.e. `livereload:foo.txt:bar.txt`)

## The middleware

A connect middleware (`livereloadSnippet`) is delivered as an helper (located in `grunt-contrib-livereload/lib/utils`). This middleware must be the first one inserted.

It will be inserted on the fly in your HTML and will connect back to the livereload server.

```html
<!-- livereload snippet -->
<script>document.write('<script src=\"http://'
+ (location.host || 'localhost').split(':')[0]
+ ':" + port + "/livereload.js?snipver=1\"><\\/script>')
</script>
```

repository: coltpini/angNoMon-Startup

repo_name: coltpini/angNoMon-Startup


text:
---
layout: default
---

# 1995-09-27 - [ PROPOSED NEW STANDARD ] "I-like-encrypted-mail" tag

## Header Data

From: Travis Corcoran<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: cca0b8fe0513cb3d39864cee50372848ecc1935b7e578de340f3e3f645b4a760

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-09-27 15:21:38 UTC

Raw Date: Wed, 27 Sep 95 08:21:38 PDT

## Raw message

```
{% raw  %}From: Travis Corcoran<EMAIL_ADDRESS>Date: Wed, 27 Sep 95 08:21:38 PDT
To<EMAIL_ADDRESS>Subject: [ PROPOSED NEW STANDARD ] "I-like-encrypted-mail" tag
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Summary:

	This message tosses out an idea for conveying within an { email |
	usenet } message the datum "the author of this message prefers to
	receive PGP encrypted communications" in a standard machine-readable
	form.

Motivation:

	In the most recent version of my

		<a href="http://www.openmarket.com/personal/tjic/emacs.html">
	 mail-secure.el package
		</a>

	I included a feature that allows users to maintain a list of
	correspondants who prefer to receive encrypted mail.  This list is
	then used by the package at email-send-time to see if a piece of email
	should be encrypted.

	I and others on this list include tags along the lines of "PGP
	encrypted mail preferred" in our .sigs.  It occured to me that this
	could be automated:

	(1) a standard "I-like-encrypted-mail" tag could be defined
	(2) cryptography-capable mail tools could scan incoming messages for
			this tag and add the originators of any message containing the
			tag to a list
	(3) cryptography-capable mail tools could then use this list when
			sending (as mail-secure.el currently does).

Possible Implementations:

	A couple of different methods occur to me to implement step #1:

	(a) a new header could be defined and added to messages (as per
	section 3 of

		<a href="http://www.cis.ohio-state.edu/htbin/rfc/rfc1505.html">
	RFC 1505
		</a>

	), along the lines of

		X-Rcv-Security-Prefered: PGP-Encryption

	(b) a certain keyword or phrase could be defined that could be
	inserted in the .sig block of a message.  Ex:

		--
<EMAIL_ADDRESS>		PGP-Encrypted-Mail-Preferred

	I am tempted to suggest something either compatible with or in the
	spirit of

		<a href="http://www.eit.com/creations/s-http/draft-ietf-wts-shttp-00.txt">
	SHTTP
		</a>

	negotiation blocks, but restrain myself from doing so because this

	(a) seems needlessly baroque for the information being conveyed
	(b) falsely implies that a negotiation is taking place, when in fact a
		mere advisory is being issues.

Security concerns:

	A temporary denial-of-service/annoyance attack could be mounted by an
	adversary who issues one forged message from individual A with the
	"PGP-encrypted-mail prefered tag" present, and then puts a fake key on
	a keyserver.  Anyone who uses a tag-aware mail-reading package and
	sees this message would send future mail to individual A encrypted in
	a manner that didn't allow A to read it.

Please mail or post any thoughts on this proposal.

Thanks,

TJIC

{% endraw %}
```

## Thread

+ Return to [September 1995](/archive/1995/09)

+ Return to "[Travis Corcoran <tjic@OpenMarket.com>](/authors/travis_corcoran_tjic_at_openmarket_com_)"

+ 1995-09-27 (Wed, 27 Sep 95 08:21:38 PDT) - [ PROPOSED NEW STANDARD ] "I-like-encrypted-mail" tag - _Travis Corcoran<EMAIL_ADDRESS>


text:
## Overview

"JS Task Group". Simple JS-based replacement for Make, Gulp, etc. Similar in design to [Gtg](https://github.com/mitranim/gtg) made for Go.

Jtg works differently from other task runners. It's _not_ a CLI executable. It's just a library that you import and call.

Tiny, dependency-free. Two versions:

* `jtg_node.mjs`: for [Node.js](https://nodejs.org) >= 0.15.
* `jtg_deno.mjs`: for [Deno](https://deno.land).

The API is isomorphic, but some functions are Node-only, at least for now.

## TOC

* [Why](#why)
* [Usage](#usage)
* [Tasks](#tasks)
* [Cancelation](#cancelation)
  * [Process Leaks](#process-leaks)
* [API](#api)
  * [`function runCli`](#function-runclifuns)
  * [`function runArgs`](#function-runargsfuns-args)
  * [`function watch`](#function-watchtarget-test-opts)
  * [`function emptty`](#function-emptty)
  * [`class Ctx`](#class-ctx)
    * [`property ctx.signal`](#property-ctxsignal)
    * [`method ctx.run`](#method-ctxrunfun)
    * [`method ctx.par`](#method-ctxparfuns)
    * [`method ctx.ser`](#method-ctxserfuns)
    * [`method ctx.sub`](#method-ctxsub)
    * [`method ctx.re`](#method-ctxre)
    * [`method ctx.each`](#method-ctxeachiter)
    * [`method ctx.preEach`](#method-ctxpreeachiter)
  * [`function spawn`](#function-spawncmd-args-opts)
  * [`function fork`](#function-forkcmd-args-opts)
  * [`function link`](#function-linkproc)
  * [`function wait`](#function-waitproc)
  * [`function kill`](#function-killproc)
  * [Undocumented](#undocumented)
* [Changelog](#changelog)

## Why

* Make is less portable.
* `package.json` scripts are less portable. Also, `npm run` is slow to start.
* Gulp is too bloated and complex.

Jtg is JS-based, tiny, trivially simple, and _is not a CLI_.

## Usage

In Node, install via NPM, run your script via `node`. See the sample `make.mjs` script below.

```sh
npm i -ED jtg

# Run default task.
node make.mjs

# Run specific task.
node make.mjs build

# List available tasks.
node make.mjs --help

# Known tasks (case-sensitive): ["watch","build","styles","scripts","server"]
```

In Deno, import by URL, run your script via `deno run`.

```js
import * as j from<EMAIL_ADDRESS>```

Sample `make.mjs` for Node. The file name is arbitrary.

```js
import * as fp from 'fs/promises'
import * as j from 'jtg'

await j.runCli(watch, build, styles, scripts, server)

async function watch(ctx) {
  await ctx.par(stylesW, scriptsW, serverW)
}

async function build(ctx) {
  await ctx.par(styles, scripts)
}

async function styles(ctx) {
  await j.wait(j.spawn('sass', ['main.scss:main.css'], ctx))
}

async function stylesW(ctx) {
  await j.wait(j.spawn('sass', ['main.scss:main.css', '--watch'], ctx))
}

async function scripts(ctx) {
  const mod = await import('<your-script-build-tool>')
  await mod.someBuildFunction()
}

async function scriptsW(ctx) {
  const mod = await import('<your-script-build-tool>')
  await mod.someWatchFunction()
}

async function server(ctx) {
  // Imported module should use top-level await to "block" until a crash.
  await import('./scripts/server.mjs')
}

async function serverW(ctx) {
  const events = fp.watch('scripts', {...ctx, recursive: true})

  for await (const [sub] of ctx.preEach(events)) {
    j.fork('./scripts/server.mjs', [], sub).once('error', j.logNonAbort)
  }
}
```

## Tasks

In Jtg, tasks are named functions. On the CLI, you specify the name of the task function to run. It may invoke other tasks.

Like other task runners, Jtg forms a "task group", where each task runs no more than once. This is convenient for build systems where many tasks rely on some shared task, and may be invoked either individually or all together. See the [Usage](#usage) example above.

A task takes one argument: a [`Ctx`](#class-ctx) instance. The context stores the results of previously-called task functions, which allows [`ctx.par`](#method-ctxparfuns) and [`ctx.ser`](#method-ctxserfuns) to deduplicate them. It also has an associated [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal): [`ctx.signal`](#property-ctxsignal).

Jtg leaves error handling to you. If you don't handle exceptions, they crash the process. For build tools, this is usually desirable.

## Cancelation

Cancelation happens for the following reasons:

* Main process terminates.
* Main task terminates.

Cancelation happens in the following ways:

* When the main process terminates, its _immediate_ children _may_ also terminate, depending on exactly how your Node/Deno process got killed. In Node on Unix, this is only true for children created by [`spawn`](#function-spawncmd-args-opts) and [`fork`](#function-forkcmd-args-opts). However, _indirect_ children usually will _not_ automatically terminate; see [Process Leaks](#process-leaks).
* When the main task terminates, but the process is still running, the [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) available as [`ctx.signal`](#property-ctxsignal) is aborted, causing termination of any activities that took this signal, including subprocesses created by [`spawn`](#function-spawncmd-args-opts) and [`fork`](#function-forkcmd-args-opts), if `ctx` was passed to them. Note that `Deno.run` doesn't support abort signals yet (as of `1.10.1`).

### Process Leaks

By default, on _all_ operating systems, child processes don't terminate together with parents. Both Node and Deno make some limited effort to terminate their _immediate_ children, but not their descendants. Be aware that most programs, written for most systems, don't link with their child processes this way.

Interrupt via `Ctrl+C` usually works on every system, but crashes are fraught with peril. For example, when you shell out to `sh` (Unix) or `cmd.exe` (Windows) to spawn another program, and then the current process crashes or gets killed, the shell sub-process will terminate, but the sub-sub-process will not.

On Unix, Jtg's subprocess functions such as [`spawn`](#function-spawncmd-args-opts) and [`kill`](#function-killproc) make an effort to ensure termination of entire subprocess groups. However, on Windows, the necessary operating system APIs appear to be unavailable in Node. To reduce process leaks, avoid sub-sub-processes.

The [Usage](#usage) example above invokes `sass`, which demonstrates this very problem. At the time of writing, the recommended Sass implementation is `dart-sass`, and the recommended way to install it on Windows is via Chocolatey. The installation process creates one real executable and one unnecessary wrapper executable, which shells out to the real one, _without_ linking together via the job object API. An abrupt termination leaks the sub-sub-process. You can avoid this issue by modifying your `%PATH%`, allowing the OS to find the real executable before the fake one.

On Windows, Deno currently doesn't use the job object API. When a Deno process gets killed by an external cause other than Ctrl+C, even the immediate child processes are not killed.

## API

### `function runCli(...funs)`

Shortcut for CLI scripts. See the [Usage](#usage) example above. Simply calls [`runArgs`](#function-runargsfuns-args) with CLI args.

### `function runArgs(funs, args)`

* `funs` must be an iterable of task functions.
* `args` must be an array of strings, usually CLI args.

Chooses one task function, by name, based on the provided args. Runs the task, or prints help and terminates. If `args` are empty, runs the first task.

In addition to provided functions, supports `-h`, `--help` and `help`, which print available tasks and terminate. If there's no match, prints available tasks and terminates.

Like most Jtg functions, this is async. If a task was found, returns the promise of its execution.

```js
// Runs `watch`.
j.runArgs([build, watch], ['watch'])

// Runs the first function (`build`).
j.runArgs([build, watch], [])

// Prints help.
j.runArgs([build, watch], ['--help'])
```

### `function watch(target, test, opts)`

An [async iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) over FS events. Wraps `'fs/promises'.watch` (Node) or `Deno.watchFs` (Deno), normalizing FS paths and filtering them via `test`.

`test` may be nil, a function, or a `RegExp`. It tests an FS path, always Posix-style (`/`-separated) and relative to the current working directory (`process.cwd()` or `Deno.cwd()`). If the test fails (the result is falsy), an event is ignored (not yielded).

`target` and `opts` are passed directly to the underlying FS watch API. Additionally, this adds missing support for `opts.signal` in Deno. (Known issue: in some Deno versions/environments, attempting to stop file watching may fail with a `BadSource` error.)

For watch-and-restart tasks, wrap this iterator via [`ctx.each`](#method-ctxeachiter) or [`ctx.preEach`](#method-ctxpreeachiter), which create a separate `AbortSignal` for each iteration.

Example:

```js
import * as j from 'jtg'

function watch(ctx) {
  const events = j.watch('target', /[.]html|css$/, {...ctx, recursive: true})

  for await (const event of events) {
    notifyClientsAboutChanges(event)
  }
}

```

### `function emptty()`

Clears the terminal. More specifically, prints to stdout escape codes "Reset to Initial State" and "Erase in Display (3)", causing a full-clear in most terminals. Useful for watching-and-restarting.

### `class Ctx`

Represents a "task group", the context of a task run. Created automatically. The same instance is passed to every task in the group. Stores their results for deduplication.

Pass `ctx.signal` to APIs that take an `AbortSignal` for cancelation. You can pass `ctx` as-is, or merge `ctx.signal` with other opts:

```js
import * as fp from 'fs/promises'
import * as j from 'jtg'

const events = fp.watch('some_folder', ctx)
const events = fp.watch('some_folder', {signal: ctx.signal, recursive: true})
const events = fp.watch('some_folder', {...ctx, recursive: true})

const proc = j.fork('some_file.mjs', [], ctx)
const proc = j.fork('some_file.mjs', [], {signal: ctx.signal, killSignal: 'SIGINT'})
const proc = j.fork('some_file.mjs', [], {...ctx, killSignal: 'SIGINT'})
```

#### `property ctx.signal`

Associated [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal), which is the new standard for cancelation, supported by `fetch`, `child_process` and various other APIs. Use this for [cancelation](#cancelation).

On the main context, this is aborted when the main task terminates for any reason. On sub-contexts created with [`ctx.sub`](#method-ctxsub), this is auto-aborted on each cycle of [`ctx.each`](#method-ctxeachiter) or [`ctx.preEach`](#method-ctxpreeachiter). Can be aborted manually via `ctx.abort` (undocumented) or [`ctx.re`](#method-ctxre).

#### `method ctx.run(fun)`

Runs the provided task function no more than once. If the task was previously invoked (and possibly still running!), its result is stored and returned from this call. For async functions, their stored result is a promise, not the final value.

This is for singular dependencies. For multiple dependencies, use [`ctx.par`](#method-ctxparfuns) and [`ctx.ser`](#method-ctxserfuns).

```js
// build -> [styles + scripts] -> clean
async function build(ctx) {
  await ctx.par(styles, scripts)
}

// Called from two tasks, but runs only once.
async function clean(ctx) {
  await someDeleteOperation(ctx)
}

async function styles(ctx) {
  await ctx.run(clean)
  await someStyleBuild(ctx)
}

async function scripts() {
  await ctx.run(clean)
  await someScriptBuild(ctx)
}
```

#### `method ctx.par(...funs)`

Short for "parallel", or rather "concurrent". Runs the provided task functions concurrently, but no more than once per [`Ctx`](#class-ctx). The result of every task function is stored in `ctx` and reused on redundant calls.

```js
async function watch(ctx) {
  await ctx.par(stylesW, scriptsW, serverW)
}
```

#### `method ctx.ser(...funs)`

Short for "serial". Runs the provided task functions serially, but no more than once per [`Ctx`](#class-ctx). The result of every task function is stored in `ctx` and reused on redundant calls.

```js
async function html(ctx) {
  await ctx.ser(clean, styles, templates)
}
```

#### `method ctx.sub()`

Creates a sub-context that:

* Prototypally inherits from the super.
* May be aborted without affecting the super.
* Is aborted when the super is aborted.

Useful for watching-and-restarting. Should be paired with [`ctx.re`](#method-ctxre) to abort and replace the sub-context on each iteration.

Most of the time, you should use [`ctx.each`](#method-ctxeachiter) or [`ctx.preEach`](#method-ctxpreeachiter) instead.

#### `method ctx.re()`

Short for "replace". Aborts the context and returns a new _sibling_ context. Should be used on sub-contexts created via [`ctx.sub`](#method-ctxsub).

```
        super
       /
      /
    sub0

    sub0.re() -> sub1

        super
       /     \
      /       \
    sub0      sub1
    (aborted)
```

#### `method ctx.each(iter)`

Wraps an [async iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of). Returns an iterable that yields `[sub, val]` for each `val` in the iterable, where `sub` is a [_sub-context_](#method-ctxsub) of `ctx`, aborted before the next iteration.

Useful for watching-and-restarting. Consider using [`emptty`](#function-emptty) to clear the terminal on each iteration. Also see [`ctx.preEach`](#method-ctxpreeachiter) that runs the first iteration immediately.

Gotcha 1: handle all your errors.

Gotcha 2: all sub- and super- contexts share the memory of previously-called tasks. Tasks that repeat in a loop must be run "manually", _not_ through `ctx.run`, `ctx.ser` or `ctx.par`, which would deduplicate them.

```js
import * as fp from 'fs/promises'

async function watch(ctx) {
  const events = fp.watch('some_folder', ctx)

  for await (const [sub, event] of ctx.each(events)) {
    j.emptty()
    console.log('[watch] FS event:', event)
    startSomeActivity(sub).catch(j.logNonAbort)
  }
}
```

#### `method ctx.preEach(iter)`

Same as [`ctx.each`](#method-ctxeachiter), but starts immediately, by yielding one sub-context before walking the async iterable.

Useful for watching-and-restarting.

```js
import * as fp from 'fs/promises'

async function watch() {
  const events = fp.watch('some_folder', ctx)

  for await (const [sub] of ctx.preEach(events)) {
    startSomeActivity(sub).catch(j.logNonAbort)
  }
}
```

### `function spawn(cmd, args, opts)`

(Only in `jtg_node.mjs`.) Variant of `child_process.spawn` where:

* Standard output/error is inherited from the parent process.
* Sub-sub-processes are less likely to [leak](#process-leaks) (Unix only).

Should be combined with [`wait`](#function-waitproc). Pass `ctx` as the last argument to take advantage of [`ctx.signal`](#property-ctxsignal) for cancelation.

```js
async function styles(ctx) {
  await j.wait(j.spawn('sass', ['main.scss:main.css'], ctx))
}
```

### `function fork(cmd, args, opts)`

(Only in `jtg_node.mjs`.) Variant of `child_process.fork` where:

* Standard output/error is inherited from the parent process.
* Sub-sub-processes are less likely to [leak](#process-leaks) (Unix only).

Should be combined with [`wait`](#function-waitproc). Pass `ctx` as the last argument to take advantage of [`ctx.signal`](#property-ctxsignal) for cancelation.

```js
async function server(ctx) {
  await j.wait(j.fork('./scripts/server.mjs', [], ctx))
}
```

### `function link(proc)`

(Only in `jtg_node.mjs`.)

Used internally by [`spawn`](#function-spawncmd-args-opts) and [`fork`](#function-forkcmd-args-opts). Registers the process for additional cleanup via [`kill`](#function-killproc). Returns the same process.

### `function wait(proc)`

(Only in `jtg_node.mjs`.) Returns a `Promise` that resolves when the provided process terminates for any reason.

```js
async function styles(ctx) {
  await j.wait(j.spawn('sass', ['main.scss:main.css'], ctx))
}
```

### `function kill(proc)`

(Only in `jtg_node.mjs`.)

Variant of `proc.kill()` that tries to terminate the entire subprocess tree. Assumes that it was spawned by [`spawn`](#function-spawncmd-args-opts) or [`fork`](#function-forkcmd-args-opts). These functions share some platform-specific logic.

Automatically used by [`link`](#function-linkproc). In most cases, you don't need to call this.

On Windows, this is equivalent to `proc.kill()`. On Unix, this tries to send a termination signal to the entire subprocess group.

### Undocumented

Some minor APIs are exported but undocumented to avoid bloating the docs. Check the source files and look for `export`.

## Changelog

### 0.1.4

* Support both Node and Deno.
* Added `watch`.

### 0.1.3

Fixed a memory/listener leak in sub-contexts.

### 0.1.2

TLDR: better support for "watch"-style tasks.

Just like the Go `context` package, `Ctx` now supports sub-contexts. A sub-context created via `ctx.sub` prototypally inherits from the previous context, but has its own `AbortController` and `AbortSignal`. Just like in Go:

* Aborting a super-context aborts every sub-context.
* Sub-contexts can be aborted without aborting super-contexts.

This is useful for watching-and-restarting, where each cycle uses a sub-context aborted before the next cycle.

New `ctx` methods:

* `ctx.sub`
* `ctx.re`
* `ctx.each`
* `ctx.preEach`

New functions:

* `emptty`

New undocumented functions. Various minor tweaks.

## License

https://unlicense.org

## Misc

I'm receptive to suggestions. If this library _almost_ satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts

license: Unlicense

repository: mitranim/jtg

repo_name: mitranim/jtg


text:
word2vec
========

[![travis-ci](https://api.travis-ci.org/danielfrg/word2vec.svg)](https://travis-ci.org/danielfrg/word2vec)

Python interface to Google word2vec.

Training is done using the original C, other funcionality is pure python + numpy.

## Installation

`pip install word2vec`

I recommend the [Anaconda python distribution](http://continuum.io/downloads)

**Note**: Only linux and OS X are supported.

### Development

Clone the repo and `pip install -e .`

## Usage

The easiest way is to look at this example:
[word2vec](http://nbviewer.ipython.org/urls/raw.github.com/danielfrg/word2vec/master/examples/word2vec.ipynb)

The default functionality from word2vec is also available from the command line as:
- word2vec
- word2phrase
- word2vec-distance
- word2vec-word-analogy
- word2vec-compute-accuracy

Experimental funcionality on doc2vec can be found in this other example:
[doc2vec](http://nbviewer.ipython.org/urls/raw.github.com/danielfrg/word2vec/master/examples/doc2vec.ipynb)

## Issues

Some people reported that they needed to do this if running OS X:
[http://stackoverflow.com/questions/15590169/ld-library-not-found-for-lgfortran-mac-symlink-issue](http://stackoverflow.com/questions/15590169/ld-library-not-found-for-lgfortran-mac-symlink-issue)


text:
# TableDiff

TableDiff is a small library that takes two collections and generates
a diff that is suitable for feeding into `UITableView` or
`UICollectionView` to animate the changes. It additionally tracks
which items have been updated so that UI code can adjust individual
rows or cells.

We created it to animate between distinct collection states in a Redux-like
architecture like [ReSwift](https://github.com/ReSwift/ReSwift).

### Table of Contents

* [Getting Started](#getting-started)
* [Implementations](#implementations)
* [Updates](#updates)
* [Goals and Non-Goals](#goals)
* [Bugs and Feature Requests](#bugs)
* [Contributing](#contributing)

## Getting Started

Please see the [demo](https://github.com/willowtreeapps/TableDiff/tree/develop/Demo)
app for a working example.

Initially you will want to make the elements in your datasource to conform to
the protocol `SequenceDiffable`. This means you need to
* Conform to `Equatable`
* Have a `identifier` variable that is `Hashable`

The `identifier` is used to determine if two items are the same, while equality
checks to see if the same item has been updated.

When you want to update the datasource you will need to calculate the diff:

```swift
let (diff, updates) = originalData.tableDiff(newData)
```

Then you can choose to either perform all the updates yourself or you can use the
convenience extensions to handle the moves/inserts/deletes:

```swift
tableView.applyDiff(diff)
collectionView.applyDiff(diff)
```

Updates still need to be managed manually, as this is app specific code. You
can change the animation styles with additional parameters on the helpers.

### Implementations

We originally approached this problem with a
[Longest Common Subsequence](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem)
algorithm, based on the work of [Dwifft](https://github.com/jflinter/Dwifft).
However, that algorithm only speaks in inserts and deletes, while for some use
cases we would prefer to use `UITableView`'s move capabilities.

We provide three different implementation options:

* `.lcs`: This is the original LCS based algorithm, which only returns inserts
  and deletes.
* `.lcsWithMoves`: This is the same algorithm with a post-processing step included
  to turn some delete/insert pairs into moves. This does not always line up with
  what you may perceive as the "intuitive moves".
* `.allMoves`: This algorithm looks for all possible moves first, and then layers
  in inserts and deletes. It creates the nicest effect for moves, but has more
  extraneous instructions in the diff.

You can choose which implementation to use via a parameter. The default value is
`.allMoves`.

```swift
tableView.applyDiff(diff, implementation: .lcs)
```

### Updates

Updates to an individual item are tracked while the diff is created. But since
an update implies the same item is in both collections, you have the choice of
which collection's indices you'd like to use. You can choose to have the first
collection's indices with `.pre`, or the second collection's with `.post`. The
default is `.pre`.

```swift
tableView.applyDiff(diff, updateStyle: .post)
```

## Goals

* Calculate diff between 2 `CollectionTypes` :+1:
* Translate diff into moves/inserts/deletes/updates :+1:
* Adapt algorithm to be used with sections

## Bugs and Feature Requests

Have a bug or a feature request? Please first read the
[issue guidelines](https://github.com/willowtreeapps/tablediff/blob/develop/CONTRIBUTING.md)
and search for existing and closed issues. If your problem or idea is not
addressed yet, please open a
 [new issue](https://github.com/willowtreeapps/TableDiff/issues/new).

## Contributing

Please read through our
[contributing guidelines](https://github.com/willowtreeapps/tablediff/blob/develop/CONTRIBUTING.md).
Included are directions for opening issues, coding standards, and notes on development.

repository: willowtreeapps/tablediff

branch_name: refs/heads/develop

gha_language: Swift

repo_name: willowtreeapps/tablediff


text:
# Create-A-Vhost!
Simple script that will download installation and run configurations for a virtual host on Ubuntu.

## Instructions
Start of with adding a new A record for the host at your host provider.
SSH into your server (ubuntu)

Tested on Ubuntu 20.04, Digital Ocean (Droplet) & AWS (Ec2)

```bash
git clone https://github.com/xhika/Create-A-Vhost.git
```

### Terminal
```bash
cd into folder

!! Before running the script make sure to
edit the NGINX_HOST value to your desired host name !!

chmod +w+r+x install.sh
chmod +w+r+x config.sh

sudo ./install.sh
```

### Multiple Virtual Hosts
If multiple host wants to be created, don't forget to change the NGINX_HOST variable's value in .env file for a new Virtual Host to be created and then run

```sudo ./config```

## AWS (EC2)
For this script to work on AWS EC2 instance follow these steps:
```
1. Enter EC2 dashboard -> Instances
2. Click on your newly created instance and a window will open below.
3. Click Security tab, then inder Security group click on link
4. Edit inbound rules and add rules for http & https
select source to be <IP_ADDRESS>/0
as the first ssh is on default.
5. Save rules!
```
## Digital Ocean (Droplet)
```
Just SSH into your droplet and follow the steps in this readme.
```

## Troubleshooting
- If any troubles occur, make sure ports 80 & 443 are available.
- If certbot fails, make sure envsubst have replaced variables correctly check in /etc/nginx/sites-enabled/{your_host_name}

repository: mkucewicz-hub/Create-A-Vhost

repo_name: mkucewicz-hub/Create-A-Vhost


text:
# Running Server and Client locally
## Prerequisites

First, ensure you have the following installed:

1. NodeJS - Download and Install latest version of Node: [NodeJS](http://http://nodejs.org)
2. Git - Download and Install [Git](http://git-scm.com)

After that, use `Git bash` to run all commands if you are on Windows platform.

## Clone repository

In order to start the project use:

```bash
$ git clone https://github.com/vitto-moz/tanks.git
$ cd tanks
```

## Run Server

To run server locally, just install dependencies and run `gulp` task to create a build:

```bash
$ cd server
$ npm install -g gulp-cli
$ npm install
$ gulp build
$ npm start
```

## Run Server For Develpment

To build and restart server file on every changes of ts files - run:

```bash
$ npm run dev
```

The `socket.io` server will be running on port `8080`

## Run React Client

Open other command line window and run following commands:

```bash
$ cd client
$ yarn install
$ yarn start
```

Now open your browser in following URL: [http://localhost:4300/](http://localhost:4300/)

## License

MIT

repository: vitto-moz/tanks

repo_name: vitto-moz/tanks


text:
# Scala.js typings for fs-extra

Typings are for version 11.0

## Library description:
fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.

|                    |                 |
| ------------------ | :-------------: |
| Full name          | fs-extra |
| Keywords           | fs, file, file system, copy, directory, extra, mkdirp, mkdir, mkdirs, recursive, json, read, write, extra, delete, remove, touch, create, text, output, move, promise |
| # releases         | 6 |
| # dependents       | 0.0 |
| # downloads        | 3.029595603333333E8 |
| # stars            | 8810.0 |

## Links
- [Homepage](https://github.com/jprichardson/node-fs-extra)
- [Bugs](https://github.com/jprichardson/node-fs-extra/issues)
- [Repository](https://github.com/jprichardson/node-fs-extra)
- [Npm](https://www.npmjs.com/package/fs-extra)

## Note
This library has been generated from typescript code from [DefinitelyTyped](https://definitelytyped.org).

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
---
title: Preface
---

When you study a pattern by a book such as [GoF](#ref-GoF) or [PoEAA](#ref-PoEAA)
it seems within your grasp. But as soon as you run into a task required the pattern
it brings many questions: "Is it really the very pattern for the case?
Do I implement it aright? Did I get the pattern on the first place?"
I believe the best way to study software design patterns is implementing each in your
preferred language on your specific tasks. For example if you take Bridge pattern
XWindow and PMWindow you unlikely to have such task in web-deve on the contrary
themeng..

In my turn I made these examples in PHP and EcmaScript

So this is an online book on github to be continously updated


text:
# Gloeocystidiellum sulfureoisabellinum (Litsch.) Boidin, 1957 SPECIES

#### Status
SYNONYM

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

#### Published in
Publ. Mus. Natl. Hist. Nat. 17: 122 (1957)

#### Original name
Corticium sulphureoisabellinum Litsch., 1940

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
### [CVE-2017-18283](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-18283)
![](https://img.shields.io/static/v1?label=Product&message=Snapdragon%20Mobile&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Improper%20Input%20Validation%20in%20Bluetooth%20Controller&color=brighgreen)

### Description

Possible memory corruption when Read Val Blob Req is received with invalid parameters in Snapdragon Mobile in version QCA9379, SD 210/SD 212/SD 205, SD 625, SD 835, SD 845, SD 850, SDA660.

### POC

#### Reference
- https://www.qualcomm.com/company/product-security/bulletins

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
date: 2000-01-01T00:00:00+00:00
title: DRONE_BUILD_PARENT
author: bradrydzewski
---

Provides the parent build number for the current running build. The parent build number is populated from an exiting build that is being promoted.

```
DRONE_BUILD_PARENT=42
```

repository: drone/docs

gha_language: SCSS

repo_name: drone/docs


text:
# Movie Recommendation Engine

### Table of Contents

1. [Description](#description)
2. [Dataset](#dataset)
3. [Licensing, Authors, and Acknowledgements](#licensing)

## Description

This recommender uses [FunkSVD](https://medium.com/datadriveninvestor/how-funk-singular-value-decomposition-algorithm-work-in-recommendation-engines-36f2fbf62cac) to make predictions of ratings.
It uses either FunkSVD or a knowledge based recommendation (highest ranked) to make recommendations for users. Given a movie, the recommender uses Content based recommendation to provide movies that are most similar.

## Dataset

The MovieTweetings dataset consists of ratings on movies that were contained in well-structured tweets on Twitter. This dataset is the result of research conducted by [Simon Dooms](http://scholar.google.be/citations?user=owaD8qkAAAAJ) (Ghent University, Belgium). The dataset can be viewed at [github](https://github.com/sidooms/MovieTweetings).

## Licensing, Authors, Acknowledgements

Author:Christian Emiyah

Email<EMAIL_ADDRESS>

License: MIT License.

repository: emichris/Movie-Recommender

repo_name: emichris/Movie-Recommender


text:
# Research_QuadTree
My name is Dídac Llop i serna, student of the
[CITM](https://www.citm.upc.edu/ing/estudis/graus-videojocs/). This content is generated for the second year’s subject Project 2, under supervision of lecturer Ricard Pillosu.

## About the project

This project contains a research about the functions to quadtree by optimitzate the code, and his aplication in	check collisions and camera culling. I have enfasis in check collisions.

You can find my research in [website]( https://didaclis.github.io/Research_QuadTree/).

Link to the [repository](https://github.com/didaclis/Research_QuadTree).

## Controls

### Main

+ arrows to move the camera.

### Debug

+ 4 to put entities.
+ F5 active/disactive quadtree.

## Built With

* [Visual Studio](https://visualstudio.microsoft.com/)
* Dvelopment libraries:  [SDL](https://www.libsdl.org/license.php), [STL](https://www.geeksforgeeks.org/the-c-standard-template-library-stl/) and [PugiXML](https://pugixml.org/)
* profiler: [Brofiler](http://www.brofiler.com/)
* [Tiled](https://www.mapeditor.org/)

## Author

* **Didac Llop i Serna** - GitHub account: [didaclis](https://github.com/didaclis) Contact<EMAIL_ADDRESS>
## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/didaclis/Research_QuadTree/blob/master/LICENSE) file