text:
---
layout: page-fullwidth
header:
    image_fullwidth:
subheadline:
title:  "Political System"
teaser:
permalink: "/politics/system/"
breadcrumb: true

categories:
    - politics
tags:
    - blog
    - content
    - post
    - post format

---
>
Knowledge will forever govern ignorance; and a people who mean to be their own governors must arm themselves with the power which knowledge gives.

- James Madison
{: .text-left }

**Table of Contents**
{: #toc }
*  TOC
{:toc}

## Overview {#overview}

The government of the Bahamas consists of three majors parts:

 The Queen (represented by the Governor-General)

 An elected House of Assembly (lower house / chamber)

 An appointed Senate (upper house / chamber)

### The Queen of the Bahamas

The formal head of the Bahamian government is a woman, Queen Elizabeth II. She appoints a viceregal representative called the Governor-General to carry out her constitutional duties in her absence.

Powers and Responsibilities

In conjunction with the Prime Minister (the leader of the major ruling party), the Governor-General appoints government Ministers ( The role of the Governor-General is not well understood or documented outside of the constitution.

Term Limits: The Governor-General typically ends their term within five years but have no term limits.

[Up to table of contents](#toc)
{: .text-right }

### The House of Assembly

The House of Assembly (HoA) consists of 38 'Members of Parliament' (MPs) who are elected from individual constituencies (neighborhoods). Jump down to the voting section by clicking here to learn more about that process. These 38 MPs are the only elected government positions.

These results implicity decide two other positions:

1. The Prime Minister - the controlling head of the Bahamian government

2. The Leader of the Opposition

While affliation with a political party is not necessary to run for a MP position, the two named positions require it.

The office of Prime Minister is held by the leader of the party which wins a majority of House of Assembly positions (also known as seats). Political parties hold leadership conventions where they elect their party leaders.

The Leader of the Opposition is appointed by the Governor General and is typically the leader of the party which wins the second highest seat count. (This is not always the case as we saw in 2016 when Loretta Butler-Turner was appointed as the Leader of the Opposition while Hubert Minnis was still the leader of the FNM).

Eligibility

The constitution stipulates two requirements for holding a membership position in the House of Assembly:

1. being a citizen of the Bahamas who is 21 years or older

2. residing in the Bahamas for at least one year immediately before the date of nomination for election

* You do not need to reside in the constituency in which you are interested in running.

Powers and Responsibilities

The HoA performs all major legislative functions.

Term Limits: 5 years

Some MPs are also selected as Ministers of one of 17 areas such as education, finance, and foreign affairs. See "Ministries" section below.

Head to the Know Your Politician page to see the current Members of Parliament.

[Up to table of contents](#toc)
{: .text-right }

### Senate

The Senate consists of 16 members called Senators. These Senators are not elected, rather, they are appointed by the Governor-General after consultation with the Prime Minister and the Leader of the Opposition. To decide on the Senator positions, the Governor-General consults:

 the Prime Minister alone to appoint 9 of these Senators;

the Leader of the Opposition alone to appoint 4;

both the Prime Minister and the Leader of the Oppositions to appoint the remaining 3.

The Senate has a leadership position called the President of the Senate.

The Senate is meant to operate as a checks-and-balance much like the US system.

Eligibility

The constitution stipulates two requirements for being appointed as a Senator:

1. being a citizen of the Bahamas who is 30 years or older

2. residing in the Bahamas for at least one year immediately before the date of appointment

Powers and Responsibilities

The Senate can pass bills and make bill amendments which must be approved by the House of Assembly. The Senate may reject a bill that has passed the HoA. However, if the House passes the bill in two successive sessions, after Senate refusal, the HoA may send the bill directly to the Governor-General without the Senate's consent.

Term Limits: 5 years

[Up to table of contents](#toc)
{: .text-right }

## Ministries {#ministries}

There are currently 17 distinct areas of government interest that positioned as official ministries. These are to be led by the sitting Minister along with a Permanent Secretary with some exceptions (a Financial Secretary for the Ministry of Finance and Chief Medical Officer for the Ministry of Health, for example). The current government ministries are:

1. Agriculture, Marine Resources and Local Government
2. Education, Science and Technology
3. Environment and Housing
4. Finance
5. Financial Services
6. Foreign Affairs and Immigration
7. Grand Bahama
8. Health
9. Labour and National Insurance
10. National Security
11. Office of the Attorney General & Ministry of Legal Affairs
12. Public Service
13. Social Services and Community Development
14. Tourism
15. Transport and Aviation
16. Works and Urban Development
17. Youth, Sports and Culture

[Up to table of contents](#toc)
{: .text-right }

## Departments {#departments}

There are numerous government departments including:

1.	Archives
2.	Bahamas National Geographic Information Systems (BNGIS) Centre
3.	Business License
4.	Cooperatives Development
5.	Court of Appeal
6.	Customs Department
7.	Fire Services
8.	Forestry Unit
9.	HIV-AIDS Center
10.	Housing
11.	Immigration
12.	Internal Audit
13.	Labor
14.	Marine Resources
15.	Meteorology
16.	National Anti-Drug Secretariat
17.	National Emergency Management Agency (NEMA)
18.	Parliamentary Registration Department
19.	Port Department
20.	Post Office Department
21.	Princess Margaret Hospital (PMH)
22.	Public Health
23.	Public Prosecutions
24.	Registrar Generals Department
25.	Road Traffic
26.	Royal Bahamas Defense Force
27.	Royal Bahamas Police Force
28.	Royal Bahamas Police Force - Grand Bahama
29.	Sandilands Rehabilitation Centre
30.	Social Services
31.	Statistics
32.	Supreme Court
33.	Treasury Department
34.	VAT Bahamas

[Up to table of contents](#toc)
{: .text-right }

## Corporations & Agencies {#agencies}

There are also numerous government corporations and statutory agencies including:

1.	19CCEM Conference Secretariat
2.	Auditor General
3.	Bahamas ACP Secretariat
4.	Bahamas Agricultural & Industrial Corporation (BAIC)
5.	Bahamas Bureau of Standards and Quality (BBSQ)
6.	Bahamas Development Bank
7.	Bahamas Electricity Corporation (BEC)
8.	Bahamas Environment Science and Technology Commission (BEST)
9.	Bahamas Investment Authority
10.	Bahamas Maritime Authority
11.	Bahamas Trade Commission
12.	Bahamasair Holding Ltd
13.	Bank of The Bahamas
14.	Broadcasting Corporation of The Bahamas
15.	Cellular Liberalization Task Force
16.	Central Bank of The Bahamas
17.	Compliance Commission
18.	Data Protection Commissioner
19.	Financial Intelligence Unit
20.	Foreign Account Tax Compliance Act (FATCA)
21.	Hotel Corporation of The Bahamas
22.	Maritime Matters
23.	Nassau Flight Services
24.	National Insurance Board (NIB)
25.	Public Hospitals Authority (PHA)
26.	Securities Commission of The Bahamas
27.	The Bahamas Telecommunications Company Ltd (BTC)
28.	University of The Bahamas (UB)
29.	Utilities Regulation & Competition Authority (URCA)
30.	Water & Sewerage Corporation

[Up to table of contents](#toc)
{: .text-right }

## Voting {#voting}

The only elected positions in the Bahamian government are the 38 Members of Parliament.

The 38 MPs correspond to 38 individual constituencies and citizens may only vote in their residential constituency.

"...The current legal framework does not grant the electoral management body supervision of campaign finance, nor does it delegate this function to other public entities. In fact, political campaigns are fully funded from private sources. Campaign financing is currently unregulated and political parties are not required to report on the flows or administration of their campaign funds." State of the Nation Report, page 32 This has led to serious allegations of corruption in the past. Campaign financing can decide elections and reveal conflicts of interest.

Eligibility

To vote you must:

1. be a citizen of the Bahamas who is 18 years or older

2. residing in the Bahamas for at least one year immediately before the date of appointment

[Up to table of contents](#toc)
{: .text-right }

## Constituencies {#constituencies}

There are currently 39 constituencies, 24 on Nassau and 15 on the family islands.

|Nassau                           | Nassau                          | Family Island                         |
| :-----------------------------: | :-----------------------------: |:-------------------------------------:|
| 1. Bain Town & Grants Town      | 13. Marathon                    | 1. Cat Island, Rum Cay & San Salvador |
| 2. Bamboo Town                  | 14. Freetown (Montagu)          | 2. Central & South Abaco              |
| 3. Carmichael                   | 15. Mount Moriah                | 3. Central & South Eleuthera          |
| 4. Centreville                  | 16. Nassau Village              | 4. Central Grand Bahama               |
| 5. Elizabeth                    | 17. Pinewood                    | 5. East Grand Bahama                  |
| 6. Englerston                   | 18. Seabreeze                   | 6. Exumas and Ragged Island           |
| 7. Fort Charlotte               | 19. South Beach                 | 7. Long Island 						|
| 8. Fox Hill                     | 20. Southern Shores             | 8. Mangrove Cay & South Andros        |
| 9. Garden Hills                 | 21. St. Anne's                  | 9. Marco City 		                |
| 10. Golden Gates                | 22. St. Barnabas                | 10. M.I.C.A.L.* 					    |
| 11. Golden Isles                | 23. Tall Pines                  | 11. North Abaco                		|
| 12. Killarney                   | 24. Yamacraw                    | 12. North Andros & Berry Islands	    |
|                                 |              					| 13. North Eleuthera           		|
|                                 |              					| 14. Pineridge			           		|
|                                 |              					| 15. West Grand Bahama & Bimini		|

* Mayaguana, Inagua (Great & Little), Crooked Island, Acklins, and Long Cay

[Up to table of contents](#toc)
{: .text-right }

branch_name: refs/heads/gh-pages


text:
# Phaeoacremonium krajdenii L. Mostert, Summerb. & Crous, 2005 SPECIES

#### Status
ACCEPTED

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

#### Published in
in Mostert, Groenewald, Summerbell, Robert, Sutton, Padhye & Crous, J. Clin. Microbiol. 43(4): 1761 (2005)

#### Original name
Phaeoacremonium krajdenii L. Mostert, Summerb. & Crous, 2005

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
tabletesting
============

A Go library to aid in running table based tests.

Basic Usage
-----------

A TableTester will attempt to check each field name in the test data supplied
to TableTester.RunAgainst with the reference value specified. This example
shows a string based test.

    func RunOneTest(t *testing.t) {
        test := tabletesting.StringTableTester{"SomeStringField", "test data"}
        actualdata := struct {SomeStringField string}{"test data"}
        if err := test.RunAgainst(actualdata); err != nil {
            t.Errorf("Test failed with error \"%s\"\n", err)
        }
    }

This example shows how to run multiple tests using the RunSeries function.

    func RunMultipleTests(t *testing.t) {
        testtable := []tabletesting.TableTester{
            tabletesting.StringTableTester{"SomeStringField", "test data"},
            tabletesting.StringTableTester{"SomeOtherStringField", "more test data"},
        }
        actualdata := struct {
            SomeStringField string
            SomeOtherStringField string
        }{ "test data", "more test data"}

        if err := tabletesting.RunSeries(testtable, actualdata); err != nil {
            t.Errorf("A test has failed with error \"%s\"\n", err)
        }
    }

license: MIT

repository: elmiko/tabletesting

repo_name: elmiko/tabletesting


text:
---
layout: post
title: Cats and dogs - Some better results
subtitle:
categories: [ift6266]
---

My last post was followed by a long time without much activity, the main reason being that I focused on a very interesting Kaggle competition that just ended. A blog post is coming.

That being said, my last implementation before that break was a network inspired by vggnet for which I get some interesting results. Here are the learning curves followed by some remarks.

![Loss](/img/2016-03-17-cats-and-dogs-some-better-results/loss.png)
![Error](/img/2016-03-17-cats-and-dogs-some-better-results/error.png)

Yeah 0% validation error ! (argument below)

# Network architecture

This network is based on the paper from the team that won ImageNet 2014 with their vggnet. It consists in stacking convolution layers with small filters and downsampling with maxpool every couple of layers. Here is the complete architecture from input to output:

 - 2 convolutions layers with 32 (3, 3) filters
 - maxpool
 - 3 convolutions layers with 64 (3, 3) filters
 - maxpool
 - 4 convolutions layers with 128 (3, 3) filters
 - maxpool
 - fully connected layer with 500 hidden units
 - sigmoid

You can find this architecture implemented [here](https://github.com/tfjgeorge/ift6266/blob/f5e5206994f0082dc3dd2536f33f6f527a0eb76b/catsdogs/models/vggnet.py)

# Some remarks

## NaNs

Similar to [Florian](https://florianbordes.wordpress.com/2016/02/16/cats-vs-dogs-2-error-rate-10/), I find that Adam optimizer is very powerful in terms of finding a good solution in a minimal number of epochs, but it also reaches a NaN value at some point. In [one of the block examples](https://github.com/mila-udem/blocks-examples/blob/master/reverse_words/__init__.py) first committed by Bart there is a trick which consists of just stopping the training as soon as the gradient contains a NaN.

I would be interested though in knowing where this NaNs come from and how to avoir getting NaNs too early in the learning.

In my case the loss curve stop being plotted when a NaN is reached, and the validation error goes to 0 because of the way it is computed.

## Sigmoid output

Some other students from the course use onehot encoded targets and use a softmax as their final layer. I instead just use a sigmoid, where a value close to 0 means that the network think the current image is a cat, and a value close to 1 for a dog.

Is there any difference in term of optimization by using this different views ? I am not sure.

Also in Yann Lecun's [efficient backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf) paper some tricks are mentionned to improve the sigmoid such as choosing target value not where the sigmoid saturates but at points where the second derivative is highest. I have not seen any more litterature that mention this trick but it is worth trying.

## Valid error

My validation error is computed using the same data pipeline that involves taking a random crop of the image. This can go wrong if the random crop selected does not contain a relevant part of the image for the cats/dogs task.


text:
# Com.Aspose.Omr.Model.OmrResponseInfo
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ResponseVersion** | **string** | String value representing version of the response. | [optional]
**ProcessedTasksCount** | **int?** | Total amount of processed tasks |
**SuccessfulTasksCount** | **int?** | Total amount of successful tasks, i.e. tasks that completed without errors |
**Details** | [**OMRResponseDetails**](OMRResponseDetails.md) | Additional information regarding performed task. | [optional]

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

gha_language: C#

gha_license_id: MIT


text:
Py2/py3 script that can download macOS components direct from Apple

Can also now build Internet Recovery USB installers from Windows using [dd](http://www.chrysocome.net/dd) and [7zip](https://www.7-zip.org/download.html).

**NOTE:** As of macOS 11 (Big Sur), Apple has changed the way they distribute macOS, and internet recovery USBs can no longer be built via MakeInstall on Windows.  macOS versions through Catalina will still work though.

**NOTE 2:** As of macOS 11 (Big Sur), Apple distributes the OS via an InstallAssistant.pkg file.  `BuildmacOSInstallApp.command` is not needed to create the install application when in macOS in this case - and you can simply run `InstallAssistant.pkg`, which will place the install app in your /Applications folder on macOS.

Thanks to:

* FoxletFox for [FetchMacOS](http://www.insanelymac.com/forum/topic/326366-fetchmacos-a-tool-to-download-macos-on-non-mac-platforms/) and outlining the URL setup
* munki for his [macadmin-scripts](https://github.com/munki/macadmin-scripts)
* timsutton for [brigadier](https://github.com/timsutton/brigadier)
* wolfmannight for [manOSDownloader_rc](https://www.insanelymac.com/forum/topic/338810-create-legit-copy-of-macos-from-apple-catalog/) off which BuildmacOSInstallApp.command is based

repository: corpnewt/gibMacOS

gha_language: Python

repo_name: corpnewt/gibMacOS


text:
![Logo](Nightstand-Logo.png)

[![Version](https://img.shields.io/cocoapods/v/Nightstand.svg?style=flat)](https://cocoapods.org/pods/Nightstand)
[![Platform](https://img.shields.io/cocoapods/p/Nightstand.svg?style=flat)](https://cocoapods.org/pods/Nightstand)
![Swift Version](https://img.shields.io/badge/swift-5.0-orange.svg)

## What is it?
Nightstand is a fully customizable and convenient way to construct static table views for iOS. It removes the need to implement delegate and datasource methods; just construct your rows and sections, and configure them how you please. Nightstand takes care of the rest.

Nightstand allows you use built-in cell types, or custom cell types. You can also use your existing UIViewControllers or UITableViewControllers just by having them conform to the necessary protocol.

## Why use it?
Traditional table view implementations can become unwieldy since they require logic to be spread across multiple delegate and data source methods. When we work with static tables, it’s much easier to think in terms of **sections** and **rows**, rather than in terms of delegates and data sources.

Nightstand allows you to construct an entire table by just defining a collection of sections and rows, without having to work with delegate or data source methods. This allows you to think more statically about your table views.

One of the most interesting features of Nightstand is that it allows you define and use your own UITableViewCells, so the possibilites are limitless.

## Rows
Nightstand’s **Row** type represents a single row within a section. A **Row** can be one of the built in types: **Default, Subtitle, Value1, or Value2**

```swift
let row = Row<DefaultTableViewCell>(...)
```

or a **Row** can be a custom cell type that you define.

```swift
let row = Row<UserTableViewCell>(...)
```

A **Row** has a **Model**, **Actions**, and a **Configuration**.
* A row’s **Model** defines the data that the row will use to populate its views.

```swift
let model = DefaultTableViewCell.Model(text: "Hello World", image: nil)
```

* A row’s **Actions** define what happens when it is selected or (optionally) when its accessory view is selected.

```swift
let actions = TableViewCellActions(didSelectCell: { navigateToAnotherView() },
                             didTapAccessoryView: { displayAlert() })
```

* A row’s **Configuration** defines its style.

```swift
var configuration = TableViewCellConfiguration()
configuration.selectionStyle = .none
configuration.accessoryType = .detailButton
```

## Sections
Nightstand’s **Section** type represents a single section within a table.

```swift
let section = Section(title: "Hello World",
                        rows: [
                            Row<DefaultTableViewCell>(...),
                            Row<Value1TableViewCell>(...),
                            Row<UserTableViewCell>(...) ])
```

## Putting it all together
Once you’ve defined your **Row**s and **Section**s, you can use them to initialize your Nightstand:

```swift
let nightstand = Nightstand(sections: sections)
```

**Nightstand** conforms to `UITableViewDelegate` and `UITableViewDataSource`, and is extended to have default implementations for all of the supported methods. Your only job is to set the `Nightstand` as the `UITableView`'s data source and delegate.

```swift
tableView.dataSource = nightstand
tableView.delegate = nightstand
```

Nightstand will take care of the rest.

If you're having any trouble, or want to see more code, please refer to the example project. To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Creating Custom Cells

It's possible to use your own UITableViewCells in a Nightstand table. Make sure that your cell defines the following initializer:

```swift
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: UserTableViewCell.reuseIdentifier)

    // You can add any additional initialization logic here
}
```

Nightstand extends UITableViewCell so that it has a `reuseIdentifier` by default. In fact, the above initializer is all you need in order to implement cell reuse.

The next thing you'll need to do is have your cell conform to the `Configurable` protocol. This protocol has two requirements:

```swift
associatedtype Model
func configure(with model: Model)
```

You can define your cell's Model explicitly like so:

```swift
extension UserTableViewCell {
    struct Model {
        var name: String
        var age: Int?
        var image: UIImage?
    }
}
```

You can also use a model from another part of your application:

```swift
extension UserTableViewCell: Configurable {
    typealias Model = SomeOtherModel
}
```

Then you just need to implement the required method:

```swift
extension UserTableViewCell: Configurable {
    func configure(with model: Model) {
        nameLabel.text = model.name
        ageLabel.text = String(age)
        profileImageView.image = image
    }
}
```

## Installation

For swift 4.2 support, please use version 0.1.0

### CocoaPods

CocoaPods is a dependency manager for Cocoa projects. To install Nightstand with CocoaPods:

Update your Podfile to include the following:

```ruby
use_frameworks!

pod 'Nightstand'
```

Run pod install.

### Carthage

Coming Soon

## How can I report an issue?
Please report any issues using GitHub Issues

## How can I contribute?
Please open a Pull Request for any minor fixes or contributions. For any major contributions or ideas, feel free to contact me or open an issue and I'd be happy to discuss it with you.

## Author

Tyler Neveldine<EMAIL_ADDRESS>
## License

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

repository: tnev/Nightstand

repo_name: tnev/Nightstand


text:
---
layout: post
author: csiu
date: 2017-03-30
title: "Day34: Getting the variable importance"
categories: update
tags:
  - 100daysofcode
  - machine-learning
excerpt: Using Garson's algorithm
---

*Note: The data used in today's posting is from the extracted MLP parameter weights of yesterday.*

The Jupyter Notebook for this little project is found [here](https://nbviewer.jupyter.org/github/csiu/100daysofcode/blob/master/nn/day34_mlp_important_features.ipynb).

### Inspecting the ANN model parameters

After loading the model parameters, we begin to look at (1) how many parameters are there and (2) what is the structure of these parameters.

    Number of params: 4
    -------------------
    (784, 100)   # Weights for input to hidden layer
    (100,)       # Bias weights to hidden layer
    (100, 10)    # Weights for hidden to output layer
    (10,)        # Bias weights to output layer

### Visualizing parameter weights between layers

We next plotted the parameter weights of each layer. Unsurprisingly, the weights are all over the place.

*TOP: weights of input to hidden layer;*\\
*BOTTOM: weights of hidden to output layer.*

### Visualizing the parameter weights across input features

When we visualize the parameter weights to the hidden layer by input feature, we find that some input features are more variable in terms of parameter weights than others.

### Garson's algorithm to calculate variable importance

Using Garson's algorithm to calculate the feature importance for each of the different output classes, we get the following figure...

... which shows the feature importance as being identical across the output classes. When we consider the math, this property makes sense:

### Getting the important features

Finally, we are able to sort by the variable importance for the important features.

      relative_importance

      69
      0.001629

      79
      0.001550

      502
      0.001537

      135
      0.001526

      530
      0.001520

      248
      0.001511

      417
      0.001510

      678
      0.001506

      401
      0.001504

      734
      0.001495

repository: csiu/blog

repo_name: csiu/blog


text:
# Action Recognition

Action recognition (also often called activity recognition) consists of classifying different actions from a sequence
of frames in videos.

This directory contains example projects for building video-based action recognition systems.
Our goal is to enable users to easily and quickly train high-accuracy action recognition models with fast inference speed.

![](./media/action_recognition.gif "Example of action recognition")

*Example of action recognition*

Currently, we provide two state of the art model implementations, Two-Stream [Inflated 3D ConvNet, I3D](https://arxiv.org/pdf/1705.07750.pdf)
and RGB [ResNets with (2+1)D convolutions, R(2+1)D](https://arxiv.org/abs/1711.11248)
along with their example notebooks for fine-tuning on [HMDB-51 dataset](http://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/).
More details about the models can be found in [Models](#models) section below.

Each project describes independent SETUP process with a separate conda environment under its directory.

We recommend to use R(2+1)D implementation for its competitive accuracy (see below [comparison table](#comparison)) with much faster inference speed as well as less-dependencies on other packages.
We also provide the Webcam stream notebook for R(2+1)D to test real-time inference.

Nevertheless, I3D implementation gives a good example of utilizing the two-stream approach for action recognition so that those who want to benchmark and/or tryout different approaches can use.

## Projects

| Directory |  Description |
| -------- |  ----------- |
| [r2p1d](r2p1d)  | Scripts for fine-tuning a pre-trained R(2+1)D model on HMDB-51 dataset
| [i3d](i3d)  | Scripts for fine-tuning a pre-trained I3D model on HMDB-51 dataset
| [video_annotation](video_annotation)  | Instructions and helper functions to annotate the start and end position of actions in video footage|

### Models

The R(2+1)D model was presented in \[2\] where the authors pretrained the model on [Kinetics400](https://arxiv.org/abs/1705.06950) and produced decent performance close to state of the art on the HMDB-51 dataset.
In [r2p1d](r2p1d) we demonstrate fine-tuning R(2+1)D model [pretrained on 65 million videos](https://arxiv.org/abs/1905.00561).
We use the pretrained weight from [https://github.com/moabitcoin/ig65m-pytorch](https://github.com/moabitcoin/ig65m-pytorch).

In [i3d](i3d) we show how to fine-tune I3D model. This model was introduced in \[[1](https://arxiv.org/pdf/1705.07750.pdf)\]
and achieved state of the art in action classification on the HMDB-51 and UCF-101 datasets.
Here, we use models pre-trained on Kinetics from [https://github.com/piergiaj/pytorch-i3d](https://github.com/piergiaj/pytorch-i3d).

The following table shows the comparison between the reported performance in the original papers and our results on HMDB-51 dataset.
Please note that the accuracies from the papers are averages over 3 splits, while ours are based on the split 1 only.
Also, the original R(2+1)D paper used the model pretrained on Kinetics400 but we used the one pretrained on the 65 million videos which explains the higher accuracy (74.5% vs 79.8%).

*Comparison on HMDB-51*

| Model | Reported in the paper | Our results |
| ------- | -------| ------- |
| R(2+1)D RGB | 74.5 | 79.8 |
| I3D RGB | 74.8 | 73.7 |
| I3D Optical flow | 77.1 | 77.5 |
| I3D Two-Stream | 80.7 | 81.2 |

### Annotation
In order to train an action recognition model for a specific task, annotated training data from the relevant domain is needed. In [video_annotation](video_annotation), we provide tips and examples for how to use a best-in-class video annotation tool ([VGG Image Annotator](http://www.robots.ox.ac.uk/~vgg/software/via/)) to label the start and end positions of actions in videos.

## State of the art

In the tables below, we list datasets which are commonly used and also give an overview of the state-of-the-art. Note that the information below is reasonably exhaustive and should cover most major publications until 2018. Expect however some level of incompleteness and slight incorrectness (e.g. publication year being off by plus/minus 1 year due) since the tables below were mainly compiled to give a high-level picture of where the field is and how it evolved over the last years.

Recommended reading:
- As introduction to action recognition the blog [Deep Learning for Videos: A 2018 Guide to Action Recognition](http://blog.qure.ai/notes/deep-learning-for-videos-action-recognition-review).
- [ActionRecognition.net](http://actionrecognition.net/files/dset.php) for the latest state-of-the-art accuracies on popular research benchmark datasets.
- All papers highlighted in yellow in the publications table below.

*Popular datasets*

| Name  | Year  |  Number of classes |	#Clips |	Average length per video | Notes |
| ----- | ----- | ----------------- | ------- | -------------------------  |  ----------- |
| KTH   | 2004| 6| 600| |  | |
|Weizmann|	2005|	9|	81|	|	 |
|HMDB-51| 2011|	51|	6.8k| |	 |
|UCF-101|	2012|	101|	13.3k|	7 sec (min: 1sec, max: 71sec)|	|
|Sports-1M|	2014|	487|	1M| | |
|THUMOS14|	2014|	101|	18k|	(total: 254h)|	Dataset for temporal action |
|ActivityNet|	2015|	200|	28.1k|	? 1 min 40 sec|	|
|Charades|	2016|	157|	66.5k from 9848 videos|	Each video (not action) is 30 seconds	| Daily tasks, classification and temporal localization challenges|
|Youtube-8M|	2016|	4800 | |  | Not an action dataset, but rather a classification one (ie what objects occur in each video). Additional videos added in 2018.|
|Kinetics-400|	2017|	400|	306k|	10 sec|	|
|Kinetics-600|	2018|	600|	496k|   |
|Something-Something|	2017|	174|	110k|	2-6 sec	| Low level actions, e.g. "pushing something left to right". Additional videos added in 2019.|
|AVA|	2018|	80|	1.6M in 430 videos|	Each video is 15min long with 1 frame annotated per second with location of person, and for each  person one of 80 "atomic" actions. Combine people annotations into tracks.
|Youtube-8M Segments|	2019|	1000|	237k|	5sec|	Used for localization Kaggle challenge. Think focuses on objects, not actions.|

Popular publications, with recommended papers to read highlighted in yellow:

Most publications focus on accuracy rather than on inferencing speed. The paper "Representation Flow for Action Recognition" is a noteworthy exception with this figure:

\[1\] J. Carreira and A. Zisserman. Quo vadis, action recognition?
a new model and the kinetics dataset. In CVPR, 2017.

\[2\] D. Tran, et al. A Closer Look at Spatiotemporal Convolutions for Action Recognition. 	arXiv:1711.11248 \[cs.CV\], 2017.

repository: evilches/ComputerVision

repo_name: evilches/ComputerVision


text:
# node-redis-server
A Redis Server Implamentation in Node a abstraction layer over the Redis Protocol to accept redis clients.

https://redis.io/topics/protocol

repository: direktspeed/node-redis-server

repo_name: direktspeed/node-redis-server


text:
While formatting preferences are very personal, a number of style guides require or disallow spaces between curly braces,
This rule aims to maintain consistency around the spacing inside of object literals. It also applies to EcmaScript 6 destructured assignment and import/export specifiers. This rule takes one argument that can be(always or never) always enforces a space after curly.
Fixable: This rule is automatically fixable using the --fix flag on the command line.

```
//Bad with always:
var obj = {'foo': 'bar'};
var obj = { 'foo':'bar'};

//Good with always:
var obj = { 'foo': 'bar' };

```
[Source](http://eslint.org/docs/rules/object-curly-spacing)

gha_license_id: NOASSERTION


text:
# solidpython_ff

Fast and Furious [solidpython](https://github.com/SolidCode/SolidPython), more pythonic!

[Solidpython](https://github.com/SolidCode/SolidPython)sticks to [Openscad's](https://www.openscad.org/) operation(arguments) (objects,...) API.

This is a slim wrapper (and some tiny utility functions) that turn this into a
python object.operation(arguments) API.

For example:

```
translate([0,0,10]) (
	cylinder(r=3,h=10) +
	rotate([0,90,0]) (
		cylinder(r=3, h=10 )
		)
)
```

becomes
```
(cylinder(r=3, h=10) + cylinder(r=3, h=10).rotate([0,90,0])).translate([0,0,10])
```

There's also abbreviations, so you can go

```
cy(r=3, h=10) + cy(r=3, h=10).r([0,90,0])).t([0,0,10])
```

The functions have been tuned to understand to understand
the openscady 'list-triplets' as well as regular old parameters,
and the utils convenience functions are also available.

```
cy(r=3, h=10) + cy(r=3, h=10).r(0,90,0)).t(0,0,10)
```

Or even
```
(cy(r=3, h=10) + cy(r=3, h=10)).rzx().up(10) # rotate z to x
```

More convenience:

```
cy(r=3, h=10, segments = 64).scale(x=10, y=5) # z = 1 is implied, 64 segments is the default
cy(r=3, h=10).s(x=10, y=5) # z = 1 is implied

square(3,5).e(10, axis='x', center=True) #  a rectangle 3*5, extruded by 10mm, down 5mm, rotated so that extrusion direction is in the x axis.

cy(3,0).debug() # translates to # in openscad
cy(3,0).d()

cy(3,0).background() # translates to % in openscad
cy(3,0).b()

q(10,20,30) + cy(1.5,31).hole() # or .h() for 'first class negative space, and quick cubes

rq(10, r=2, axis='x', edges=(0,1)) # a 10x10x10 cube that has the top edges, parallel to the x axis rounded (so the 'straight' face is facing x)

q(10).x(5) # alias for forward.
q(10).y(5) # alias for right.
q(10).z(5) # alias for up.

q(10).dump("example.scad") # write the object to a .scad file (calls scad_render_to_file)

```


text:
# Jitsi as a Service

🍿 Check out the [video demo](https://vimeo.com/502720048)

Get started for free with [JaaS](https://jaas.8x8.vc).

Here's a bit of sample code to help you get started using JaaS.

## To generate JWT using an API:
For the purpose of this example we've put together a [RunKit.com endpoint](https://runkit.com/matt/jwt-jaas-generator), which you can clone if you want. Generating JWT manually is tedius and unnecessary if you have an endpoint to hit. We suggest putting this logic in your app/web app and provide this only as an example.

branch_name: refs/heads/main


text:
---
title: "Computer Ethics"
metaTitle: "Computer Ethics"
order: 1
---

## The Ten Commandments of Computer Ethics

Written by the Computer Ethics Institute

by the **Computer Ethics Institute**

1. Thou shalt not use a computer to harm other people.
2. Thou shalt not interfere with other people's computer work.
3. Thou shalt not snoop around in other people's computer files.
4. Thou shalt not use a computer to steal.
5. Thou shalt not use a computer to bear false witness.
6. Thou shalt not copy or use proprietary software for which you have not paid.
7. Thou shalt not use other people's computer resources without authorization or proper compensation.
8.
9. Thou shalt think about the social consequences of the program you are writing or the system you are designing.
10. Thou shalt always use a computer in ways that ensure consideration and respect for your fellow humans.

repository: ganicke/makecode-apcsp

gha_language: JavaScript

repo_name: ganicke/makecode-apcsp


text:
getdns-php
==========

A PHP language binding for the getdns API, version 0.11.0.
This implementation is licensed under the New BSD License (BSD-new).

Dependencies:

* PHP 5.x (PHP 5.6.8 was used for development and testing)
* libgetdns 0.9.*
* getdns library header files

The configure script will confirm that the dependencies have been met,
but it will not check version numbers.

To build:

    $ phpize
    $ ./configure --enable-getdns
    $ make
    $ sudo make install

To clean:

    $ make clean
    $ phpize --clean

Note that the following getdns library functions are not
implemented in this extension:

* getdns_context_create_with_memory_functions()
* getdns_context_create_with_extended_memory_functions()
* getdns_context_set_eventloop()
* getdns_context_set_memory_functions()
* getdns_context_set_extended_memory_functions()
* getdns_dict_create_with_memory_functions()
* getdns_dict_create_with_extended_memory_functions()
* getdns_list_create_with_memory_functions()
* getdns_list_create_with_extended_memory_functions()
* getdns_pretty_snprint_dict()
* getdns_pretty_snprint_list()
* getdns_snprint_json_dict()
* getdns_snprint_json_list()

Each makes assumptions about memory management functions
that aren't directly applicable to PHP.

## Documentation

Documentation is written in the DocBook format preferred
by the PHP community. XML input files can be found in the
doc-in directory.

Documentation intended for human consumption is provided in
HTML format and can be found in the doc-out directory. The
documentation root can be found at
doc-out/php-chunked-xhtml/index.html.

## Regression Tests

A suite of regression tests (written in
[phpt](http://qa.php.net/write-test.php) format) is included
with the extension. Test cases can be found in the tests
directory. All of the tests can be executing by running
"make test" after building the extension as described
above. The test cases are written to validate positive
code paths that produce successful results.

## To Do

* Testing of error code paths.
* Fix bugs as they are uncovered by testing.

repository: getdnsapi/getdns-php-bindings

repo_name: getdnsapi/getdns-php-bindings


text:
# ModpackUploader

This tool can automate the process of uploading modpacks to Curseforge.
It creates a modpack manifest, which is then posted along with metadata to Curseforge for upload.
When the upload has completed, server files are attached.
The server files are automatically generated from files/folders you specify.

It's possible to integrate [Github Changelog Generator](https://github.com/github-changelog-generator/github-changelog-generator) and [Changelog Generator for mods](https://github.com/TheRandomLabs/ChangelogGenerator) by toggling them in the settings, and configuring them.

Almost everything can be toggled on/off in the settings.

## Usage
* Unzip the file into your modded Minecraft Instance.
* Fill in the .build.json file with appropriate information - This specifies the manifest information. The mods folder is automatically included.
* Fill in the settings.ps1 file.
* Double-click the ModpackUploader.bat or start ModpackUploader.ps1 using the command line.

## Dependencies
* cURL - https://curl.haxx.se/download.html
* 7-Zip - https://www.7-zip.org/download.html

## Linux
* Linux users need to download a specific version of the Twitch Export Builder. Rename it to "TwitchExportBuilder.exe".
    Find it here: https://github.com/Gaz492/twitch-export-builder/releases/

* Linux users need Powershell Core to run Powershell scripts.
    Find it here: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6

* The setting ENABLE_ALWAYS_UPDATE_JARS only works on Windows.

### Credits
A big thanks goes out to:

Gaz492 for his Twitch Export Builder project, which made this tool possible.
https://github.com/Gaz492/twitch-export-builder/

TheRandomLabs for his Changelog Generator project, which greatly improves this tool.
https://github.com/TheRandomLabs/ChangelogGenerator

repository: bvierra/ModpackUploader

repo_name: bvierra/ModpackUploader


text:
A Set is a linear data structure that has a collection of values that are not repeated. A set can store unique values without any particular order.
In the real world, sets can be used to collect all tags for blog posts and conversation participants in a chat. The data can be of Boolean, integer,
float, characters, and other types. Static sets allow only query operations, which means operations related to querying the elements. Dynamic and
mutable sets allow for the insertion and deletion of elements. Algebraic operations such as union, intersection, difference, and subset can be defined
on the sets. The following example shows the Set integer with a map integer key and bool as a value:

```
//main package has examples shown
// in Hands-On Data Structures and algorithms with Go book
package main
// importing fmt package
import (
 "fmt"
)
//Set class
type Set struct {
 integerMap map[int]bool
}
//create the map of integer and bool
func (set *Set) New(){
 set.integerMap = make(map[int]bool)
}

```

The `AddElement`, `DeleteElement`, `ContainsElement`, `Intersect`, `Union`, and main methods are discussed in the following sections

## The AddElement method

The `AddElement` method adds the element to a set. In the following code snippet, the `AddElement` method of the Set class adds the element to
`integerMap` if the element is not in the Set. The `integerMap` element has the key integer and value as bool, as shown in the following code:

```

// adds the element to the set
func (set *Set) AddElement(element int){
 if !set.ContainsElement(element) {
  set.integerMap[element] = true
 }
}

```

The example output after invoking the AddElement method with parameter 2 is as follows. The check is done if there is an element with value 2. If there is no element,
the map is set to true with the key as 2:

```
Add element method
does the set have element : false
set has the current element true
initial set &{map[1:true 2:true]}
true

```

Let's take a look at the DeleteElement method in the next section.

## The DeleteElement method

The DeleteElement method deletes the element from integerMap using the delete method. This method removes the element
from the integerMap of the set, as follows:

```

//deletes the element from the set
func (set *Set) DeleteElement(element int) {
    delete(set.integerMap,element)
}

```

## The ContainsElement method

The ContainsElement method of the Set class checks whether or not the element exists in integerMap. The integerMap element
is looked up with a key integer element, as shown in the following code example:

```

//checks if element is in the set
func (set *Set) ContainsElement(element int) bool{
 var exists bool
 _, exists = set.integerMap[element]
 return exists
}

```

## The main method – contains element

 the main method creates Set, invokes the New method, and adds elements 1 and 2. The check is done if element 1 exists in the set:

```
// main method
func main() {
    var set *Set
    set = &Set{}
    set.New()
    set.AddElement(1)
    set.AddElement(2)
    fmt.Println(set)
    fmt.Println(set.ContainsElement(1))
}

```
Run the following command to execute the set.go file:

```
go run set.go

```

## The InterSect method

 the InterSect method on the Set class returns an intersectionSet that consists of the intersection of set and anotherSet. The set
class is traversed through integerMap and checked against another Set to see if any elements exist:

```
//Intersect method returns the set which intersects with anotherSet

func (set *Set) Intersect(anotherSet *Set) *Set{
 var intersectSet = & Set{}
 intersectSet.New()
 var value int
 for(value,_ = range set.integerMap){
   if anotherSet.ContainsElement(value) {
    intersectSet.AddElement(value)
   }
 }
 return intersectSet
}

```

repository: truong-vcc/GopherLabs

repo_name: truong-vcc/GopherLabs


text:
# Recipe Lister

For the uninspired home cook

## Development Mode Setup

Make sure to have Node.js, git, and webpack pre-installed to continue.

To install a local copy of the repository, fork or clone to your local drive via terminal:

```
git clone https://github.com/larrycustodio/recipe-finder.git <YOUR_REPO_DIRNAME>
```

Switch to the active directory, then install all npm module dependencies:
```
cd <YOUR_REPO_DIRNAME>
npm i
```

Launch the development server:
`npm run dev`
and the web app should open up on your default internet browser!

## Setting up environment variables
Create a .env file on the root directory, `touch .env`

## Deployment (TBD)
Add additional notes about how to deploy this on a  live system

## Authors
* **Larry Custodio** - *Developer* - [larrycustod.io](https://larrycustod.io/)

## License

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

## References & Acknowledgments

* API powered by The Meal DB [Documentation](https://www.themealdb.com/)
* A few happy hours for the spur of the moment ideas...

repository: larrycustodio/recipe-finder

repo_name: larrycustodio/recipe-finder


text:
# ECE318-toolkit

Toolkit helpful to the course ECE318 fundamental optics.

## Usage
ECE318 toolkit now support the following commands:
```
fr         Find fresnal coef and return refractive angle      Required Arguments: ['ni', 'nt', 'theta_i']
r2fin      Find finesse with reflectivity                     Required Arguments: ['R']
fin2r      Find reflectivity with finesse                     Required Arguments: ['Finesse']
prop       Convert between different light properties         Required Arguments: ['type', 'value']
q/quit     Quit the toolkit                                   Required Arguments: ['NONE']
help       Show this help message                             Required Arguments: ['NONE']
```

## Command Usage
### fr (Find fresnel coef)
fr supports both radius and degree input. It can also detect Total Internal Reflection automatically.\
added partial caculation for field and intensity penetration depth
```
ECE318_toolkit >> fr 1 1.5 30deg
theta_t:  0.3398 = 19.471 deg
r_te:  -0.2404 		t_te:  0.7596
r_tm:  -0.1589 		t_tm:  0.7726
ECE318_toolkit >> fr 1 1.5 0.5235987
theta_t:  0.3398 = 19.471 deg
r_te:  -0.2404 		t_te:  0.7596
r_tm:  -0.1589 		t_tm:  0.7726

ECE318_toolkit >> fr 1.5 1 60deg
Total Internal Reflection
phi_te:  -1.671 = -95.741 deg		phi_tm:  0.7645 = 43.803 deg
(for pen_dep calculation) beta:  0.8292 *(w/c)  =  5.2097 /freq
```
### fin2r/r2fin (Find finesse coef from reflectivity, and vice versa)
fin2r supports both percentage expression and float expression.
```
ECE318_toolkit >> fin2r 76.95
Reflectivity: 0.959998
ECE318_toolkit >> r2fin 0.96
Coef of Finesse: 2400.0 Finesse:  76.953
ECE318_toolkit >> r2fin 96%
Coef of Finesse: 2400.0 Finesse:  76.953
```
### prop (Convert between light's spacial and temporal properties)
index of refraction initially setup to be 1.\
prop support input under standard SI units (suggest using scientific notation for nm, THz, ps etc).
```
ECE318_toolkit >> prop k 4.19E6
index of refraction =  1
k =  4.19e+06 rad/m,  f =  6.669e+05 m-1,  lam =  1.5e-06 m;
w =  1.256e+15 rad/s,  V =  1.999e+14 Hz,  T =  5.002e-15 s;
ECE318_toolkit >> prop n 1.2
set up new index of refraction =  1.2
ECE318_toolkit >> prop lam 1500E-9
index of refraction =  1.2
k =  4.189e+06 rad/m,  f =  6.667e+05 m-1,  lam =  1.5e-06 m;
w =  1.046e+15 rad/s,  V =  1.666e+14 Hz,  T =  6.004e-15 s;
```
### brew_crit (Find brewster angle and critical angle)
brew_crit supports both radian and degree expression
```
ECE318_toolkit >> brew_crit 1.5 1
Brester angle:  0.588003 = 33.690068 deg
Critical angle:  0.729728 = 41.810315 deg
```


text:
# Google Calendar for Chrome

## No Longer Available to Install

This Chrome extension is **no longer available to install**, though the source code is available here to fork & modify.

### Why?

For more than a decade, this has been a side project for me, and I have enjoyed working on it for most of that time. Thanks to all the users and contributors for your hard work, especially our volunteer translators, and everyone who has contributed bug fixes and performance improvements over the years!

This was originally a hackathon project encouraged by the Chrome and Calendar teams at Google, before the public launch of the Chrome Extensions API. I had never intended for this to be a personal project that I’d maintain for so long, and the fact that it has lasted & thrived over a full decade is, quite frankly, remarkable in hindsight!

Over the years, I’ve attempted to convince the Calendar team to adopt it as part of their first-party roadmap, but it is not something they’d like to take on, which I fully understand. During the last couple of years, the number of requests I have received from various teams at Google to make changes (small and large) to this extension far outweigh the amount of time I am able to spend on it.

At this point, it is clear to me that it’s best for our 5 MM+ users, for Google, and for myself to declare this project formally shut down.

I realize this is disruptive to those of you who have come to depend on this little tool, but fear not, there are alternatives! If you’d like to continue using this, you can also run it directly from source on your own machine.

## Alternatives

### Source Code

This Git repo will remain available, in case anyone is interested in forking it and releasing it as their own extension under their own account. The [Apache 2 License](COPYING) explicitly permits it, and I encourage you to do that.

### Other Calendar Extensions

There are several other extensions available that include similar features. Feel free to send pull requests editing this README to list your extension here.

- [Button for Google Calendar™](https://chrome.google.com/webstore/detail/button-for-google-calenda/lfjnmopldodmmdhddmeacgjnjeakjpki) — An exact copy of this extension.

- [MeetApps](https://chrome.google.com/webstore/detail/jgliplolinicikblamobaaagffepghie) — To easily join online calls.

- [Quick View for Google Calendar](https://chrome.google.com/webstore/detail/quick-view-for-google-cal/jjmfhjhfkipdojpiohplpfoliolcemlp) — A custom take on this extension.

- [Checker Plus for Google Calendar](https://chrome.google.com/webstore/detail/checker-plus-for-google-c/hkhggnncdpfibdhinjiegagmopldibha).

Or search the Chrome Extensions Store for “[calendar](https://chrome.google.com/webstore/search/calendar)”.

repository: yxliang/google-calendar-crx

repo_name: yxliang/google-calendar-crx


text:
---
id: scalability
title: Scalability
---

Ory services are running in high-scale production environments that handle millions of requests per day. To scale Ory, spin up
another VM, Docker container, or pod of Ory Kratos, Ory Hydra or Keto with the same configuration. Ory scales effortlessly to
thousands of pods without any additional work. There is no need for complex key-value stores or message queues to serve high
traffic environments.

If you use multiple SQL instances use HAProxy or similar technology for
[SQL load balancing](https://severalnines.com/resources/database-management-tutorials/mysql-load-balancing-haproxy-tutorial).

## Mail courier

Ory Kratos processes emails by storing them in an email queue on your database and running a mail courier worker to handle this
queue. To avoid processing the same email multiple times, only one instance of this mail courier should be run at one time. For
simple single-instance Ory Kratos deployments, the courier can simply be run as a background worker, but for multi-instance Ory
Kratos deployments, it needs to be run a distinct singleton foreground worker. To learn more about setup and configuration, read
the [Mail courier in self-hosted Ory Kratos](../../kratos/self-hosted/mail-courier-selfhosted) document.

Ory Kratos doesn't have any special requirements when it comes to high availability as it doesn't manage state itself but instead
relies on the SQL database for that.

It's therefore possible to use Ory Kratos with auto-scaling groups for example in Kubernetes without any additional configuration.

repository: ory/docs

gha_language: TypeScript

repo_name: ory/docs


text:
# Flight Surety
## How to run
### System Requirements
1. Node v10.15.3
2. Ganache CLI v6.4.3 (ganache-core: 2.5.5)
3. Solidity 0.4.24
4. Truffle v5.0.11 (core: 5.0.11)
5. Solidity - 0.4.24 (solc-js)
6. Web3.js v1.0.0-beta.37

### Setup
#### Obtain the code
1. Downwload and unzip this repo to a folder on your machine.
2. Open Terminal in this folder
3. Run:
```bash
npm install
```

#### Start Ganache
You will need specific configuration of ganache. So run:
```bash
ganache-cli -l<PHONE_NUMBER>99 -m "candy maplcake sugar puddi cream honey rich smooth crumble sweet treat" -e 10000 -a 30
```
This command will create the local test network with the following props:
1. gas limit =<PHONE_NUMBER>99
2. test accounts = 30
3. ether on each test account = 10000

#### Migrate contracts to ganache
Specific configuration of test network is configured in truffle under the `development_cli` alias.

So, you need to migrate the contract to this specific network. Hence, run in the project folder:
```bash
truffle migrate --network development_cli
```

#### Start Oracle Server
Now server depends on `truffle-contract` npm package, so you need to install it.

But if you just run `npm install` inside `./src/server`  folder, it will fail.

So first go ahead and open your node modules
```bash
cd ./node_modules
```
Then remove
```bash
rm -rf web3-providers-ws
```

Now, go up to you project folder again.

To start oracle server, you will have to change the folder in the Terminal first:
```bash
cd ./src/server
```
And install the `truffle-contract`
```bash
npm install
```

And start the server as normal Node.js process:
```bash
node server.js
```

#### Start Dapp
Dapp that will allow you to interact with deployed contracts will be server for you on `localhost:8000`.
In the project folder run:
```bash
npm run dapp
```

__At this point you have set up the system locally, and you are good to go with tests and interactions with UI.__

__CAUTION! After you run automatic tests, please tear down the local system and set it up again for interaction with UI.__

To set everything up again, run in the project folder
```bash
> ganache-cli -l<PHONE_NUMBER>99 -m "candy maplcake sugar puddi cream honey rich smooth crumble sweet treat" -e 10000 -a 30
> truffle migrate --network development_cli
> cd ./src/server
> node server.js
> cd ../..
> npm run dapp
```
Now open the `locallhost:8000` in your browser.

### Run tests
__IMPORTANT!__ You need to run the test files as described below. Otherwise, tests may fail due to bugs in the truffle/ganache.

___Please, find yourself in the project folder again.___

1. Run unit tests for Flight Surety Data Contract
```bash
truffle test test/FlightSuretyDataTest.js --network development_cli
```

2. Run unit tests for Flight Surety App Contract
```bash
truffle test test/FlightSuretyAppTest.js --network development_cli
```

3. Run integration tests for Oracle App with FlightSurety
```bash
truffle test test/OracleTest.js --network development_cli
```

### Interact with UI
The Dapp has four sections: Contract, Airlines, Flights and Insurances.

Sections contain forms for the specific resource in the system.

Outcome of each form request outputs to Results section.

__IMPORTANT!__

When you try to search the Flight or Insurance in `Get Flight`/ `Get Insurance` forms, you need to use
the __Id__ of the flight or insurance.

Ids are integers, starting with 1.

So if you have created two insurances in the network,
and you want to search for the first one, then use `1` as Insurance Id in the `Get Insurance` form.

Same applies to `Buy Insurance`. You need to use integer id of the flight. For first flight in the system the id will be `1`.


text:
## Palindrome Partitioning II

Given a string *s*, partition *s* such that every substring of the partition is a palindrome.

Return the minimum cuts needed for a palindrome partitioning of *s*.

For example, given *s* = `"aab"`,

Return `1` since the palindrome partitioning `["aa","b"]` could be produced using 1 cut.

repository: cloudzfy/leetcode

repo_name: cloudzfy/leetcode


text:
# Workflow
## Getting started
Each task has an *Issue* associated with it. *Issues* are created and assigned to team members by a leader. When you start resoving an *Issue*, you **have to change** a *Label* from *To Do* to *Doing*

 ![](./images/workflow/issue_labels.png)

## Before writing a code
Before starting writing a code, **create a new branch from branch *develop***. You can use following commands:

`git checkout develop` - switch to branch *develop*

`git checkout -b <branch name>` - create a new branch named <branch name> from branch *develop*

Name the new branch using this convention: *{Issue number}-{Issue title}* and use only lowercase and hyphens. So for example for an *Issue* named `Sign-in page setup #1` branch shuld be named `1-sign-in-page-setup`.

## After writing some code
After writing some code and pushing **at least one commit** to repository, you should create a *Pull request*, so others can see changes you make and review them.

 ![](./images/workflow/new_pull_request_1.png)

 ![](./images/workflow/new_pull_request_2.png)

 ![](./images/workflow/new_pull_request_3.png)

## After finishing task
After finishing task change *Issue* and *Pull request* label from *Doing* to *To Reviev* and notify others, so they can review your code.

## Merging
After successful review you can merge your pull request.


text:
---
title: "[자료구조] 01. Software Engineering Principles"
layout: article
aside: false
sidebar: false
categories: [KyungHee Univ., C++, Data Structure]
license: false
show_subscribe: false
show_title: true
---

### The Software Life Cycle
- Problem analysis
- Requirements elicitation
- Software specification
- High and low level design
- Implementation
- Testing and Verification
- Delivery
- Operation
- Maintenance

 문제 분석(무엇이 문제인가?) > 요구사항 도출(필요 내용 파악) > 사양 설정(어떤걸 구현해야할까?) > 디자인(어떤식으로 만들어야할까?) > 구현 > 테스트와 확인(디버깅, 동작확인) > 전달(사용자에게 전달) > 구동(이용) > 유지(필요에 따라 앞선 과정들 반복하며 업데이트)

### Software Engineering
- A disciplined approach to the desing, production, and maintenance of computer programs
- that are developed on time and within cost estimates,
- using tools that help to manage the size and complexity of the resulting software products.

정해진 시간내에, 정해진 금액 한도 내에서 개발해야한다.

### Programmer ToolBoxes
- Hardware
> the computers and their peripheral devices
- Software
> operation systems, editors, compilers, interpreters, debugging systems, test-data generators, and so on
- Ideaware
> shared body of knowledge

### An Algorithm is ...
- A logical sequence of discrete steps that describes a complete solution to a given problem computable in a finite amount of time.

### Goals of Quality Software
- It works.
- It can be modified without excessive time and effort.
- It is reusable.
- It is completed on time and within budget.

동작하는가? 우선 동작하는 것이 중요하다.

고치는데 얼마나 적은 시간과 노력이 들어가는가? 스파게티코드로 작성하게 되면 고치기가 힘들어진다.

재사용할 수 있는가? 매번 다시 만들기 힘들기 때문에 재사용할 수 있도록 만드는 것이 좋다.

시간과 예산안에서 완성되는가? 시간과 예산 안에 완성하지 못하는 것을 만드는 것은 큰 의미를 갖지 못한다.

### Detailed Program Specification
- Tells what the program must do, but not how it does it.
- Is written documentation about the program.

Specification : 프로그램이 "어떻게 동작하는가?"가 아닌 "무엇을 하는가?"를 기술한 문서

### Abstraction
- A model of a complex system that includes only the details essential to the perspective of the viewer of the system.
- Programs are abstractions.

사용자 입장에서 중요한 것(필요한 것)만 보이도록 노출시키는 것이 중요하다. 사용자는 개발자가 만드는 모든 것을 알 필요가 없고 그런 프로그램을 사용에 어려움이 있다.

### Information Hiding
- The practice of hiding the details of module with the goal of controlling access to the details from the rest of the system.

Abstraction을 위해 Information hiding이 필요하다.

중요한것만 보이고, 나머지는 보이지 않도록.

### Stepwise Refinement
- A problem is approached in stages.

Similar steps are followed during each stage, with the only difference being the level of detail involved.

Some variations :
> Top-down, Bottom-up, Functional decomposition, Round-trip gestalt design

### Procedural vs. Object-Oriented Code
"Read the specification of the software you want to build.

Underline the **verbs if you are after procedural code**, the **nouns if you aim for an object-oriented program**."

- Grady Booch, "What is and Isn't Object Oriented Design," 1989.

### Two Approaches to Building Manageable Modules
|Functional Decomposition | Object-Oriented Design |
|-------------------------|------------------------|
|Divides the problem into more easily handled subtasks, until the functional modules(subproblems) can be coded. | Identifies various objects composed of data and operations, that can be used together to solve the problem.|
|Focus on : Process | Focus on : data objects|

### Object-Oriented Design
A technique for developing a program in which the solution is expressed in terms of objects self-contained entities composed of data and operations on that data.

### For Each Test Case:
- Determine inputs.
- Determine the expected behavior of the program.
- Run the program and observe the resulting behavior.
- Compare the expected behavior and the actual behavior.

### Program Verification
- Program Verification is the process of determining the degree to which a software product fulfills its specifications.

### Verification vs. Validation (V & V)
- Program verification asks, "Are we doing the job right?"
- Program validation asks, "Are we doing the right job?"

일을 올바르게 하고 있는가?

올바른 일을 하고 있는가?

즉, 동작을 수행하고 작동이 올바르게 되는지 Verification하고 원하는 스펙, 원하는 기능에 맞게 해나가고 있는지 Validation한다.

### Types of Erros
- Specification
- Design
- Coding
- Input

아래 단계가 될수록 시간과 비용이 든다. 따라서, 에러는 조기에(상위 단계에세) 빨리 발견하는 것이 좋다.

### Cost of a Specification Error Based on When it is discovered
![image](https://user-images.githubusercontent.com/79047370/114646447-3b05a880-9d16-11eb-9f77-60a6104d9ade.png)

### Controlling Erros
- Robustness : The ability of a program to recover following an error; the ability of a program to continue to operate within its environment
- Preconditions : Assumptions that must be true on entry into an operation or function for the postconditions to be guaranteed.
- Postconditions : Statements that describe what results are to be expected at the exit of an operation or function, assuming that the preconditions are true.

Robustness : 에러가 있더라도 멈추지 않고 환경에 적응해(대처하여) 계속해서 동작하는 능력


text:
## 10 定时图

这只是个提案，主题和内容可能改变.

非常欢迎您参与这个新特性的讨论。您的反馈、创意和建议可以帮助我们找寻适合的解决方案。

### 10.1 声明参与者

使用 concise or robust 关键字声明参与者, 选择哪个取决于所需的显示样式。

通过 @ 标注, 和 is 动词定义状态.

```plantuml {hide=false}
@startuml
robust "Web 浏览器" as WB
concise "Web 用户" as WU
@0
WU is 空闲
WB is 空闲
@100
WU is 等待中
WB is 处理中
@300
WB is 等待中
@enduml
```

### 10.2 Binary and Clock

It's also possible to have binary and clock signal, using the following keywords:
* binary
* clock

```plantuml {hide=false}
@startuml
clock clk with period 1
binary "Enable" as EN
@0
EN is low
@5
EN is high
@10
EN is low
@enduml
```

### 10.3 增加消息

使用下述的语法增加对消息的描述。

```plantuml {hide=false}
@startuml
robust "Web 浏览器" as WB
concise "Web 用户" as WU
@0
WU is 空闲
WB is 空闲
@100
WU -> WB : URL
WU is 等待中
WB is 处理中
@300
WB is 等待中
@enduml
```

### 10.4 相对时间

It is possible to use relative time with @.

```plantuml {hide=false}
@startuml
robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU
@0
WU is Idle
WB is Idle
DNS is Idle
@+100
WU -> WB : URL
WU is Waiting
WB is Processing
@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL
@+100
DNS is Processing
@+300
DNS is Idle
@enduml
```

### 10.5 Anchor Points

Instead of using absolute or relative time on an absolute time you can define a time as an anchor point by using the as keyword and starting the name with a :.

@XX as :<anchor point name>

```plantuml {hide=false}
@startuml
clock clk with period 1
binary "enable" as EN
concise "dataBus" as db
@0 as :start
@5 as :en_high
@10 as :en_low
@:start
EN is low
db is "0x0000"
@:en_high
EN is high
@:en_low
EN is low
@:en_high-2
db is "0xf23a"
@:en_high+6
db is "0x0000"
@enduml
```

### 10.6 Participant oriented

Rather than declare the diagram in chronological order, you can define it by participant.

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
@WB
0 is idle
+200 is Proc.
+100 is Waiting
@WU
0 is Waiting
+500 is ok
@enduml
```

### 10.7 Setting scale

You can also set a specific scale.

```plantuml {hide=false}
@startuml
concise "Web User" as WU
scale 100 as 50 pixels
@WU
0 is Waiting
+500 is ok
@enduml
```

### 10.8 Initial state

You can also define an inital state.

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
WB is Initializing
WU is Absent
@WB
0 is idle
+200 is Processing
+100 is Waiting
@WU
0 is Waiting
+500 is ok
@enduml
```

### 10.9 Intricated state

A signal could be in some undefined state.

```plantuml {hide=false}
@startuml
robust "Signal1" as S1
robust "Signal2" as S2
S1 has 0,1,2,hello
S2 has 0,1,2
@0
S1 is 0
S2 is 0
@100
S1 is {0,1} #SlateGrey
S2 is {0,1}
@200
S1 is 1
S2 is 0
@300
S1 is hello
S2 is {0,2}
@enduml
```

### 10.10 Hidden state

It is also possible to hide some state.

```plantuml {hide=false}
@startuml
concise "Web User" as WU
@0
WU is {-}
@100
WU is A1
@200
WU is {-}
@300
WU is {hidden}
@400
WU is A3
@500
WU is {-}
@enduml
```

### 10.11 Hide time axis

It is possible to hide time axis.

```plantuml {hide=false}
@startuml
hide time-axis
concise "Web User" as WU
WU is Absent
@WU
0 is Waiting
+500 is ok
@enduml
```

### 10.12 Using Time and Date

It is possible to use time or date.

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
@2019/07/02
WU is Idle
WB is Idle
@2019/07/04
WU is Waiting : some note
WB is Processing : some other note
@2019/07/05
WB is Waiting
@enduml
```

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
@1:15:00
WU is Idle
WB is Idle
@1:16:30
WU is Waiting : some note
WB is Processing : some other note
@1:17:30
WB is Waiting
@enduml
```

### 10.13 Adding constraint

It is possible to display time constraints on the diagrams.

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
WB is Initializing
WU is Absent
@WB
0 is idle
+200 is Processing
+100 is Waiting
WB@0 <-> @50 : {50 ms lag}
@WU
0 is Waiting
+500 is ok
@200 <-> @+150 : {150 ms}
@enduml
```

### 10.14 Highlighted period

You can higlight a part of diagram.

```plantuml {hide=false}
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
@0
WU is Idle
WB is Idle
@100
WU -> WB : URL
WU is Waiting #LightCyan;line:Aqua
@200
WB is Proc.
@300
WU -> WB@350 : URL2
WB is Waiting
@+200
WU is ok
@+200
WB is Idle
highlight 200 to 450 #Gold;line:DimGrey : This is my caption
@enduml
```

### 10.15 Adding texts

You can optionally add a title, a header, a footer, a legend and a caption:

```plantuml {hide=false}
@startuml
Title Some title
header: Some header
footer: Some footer
legend
Some legend
end legend
caption Some caption
robust "Web Browser" as WB
concise "Web User" as WU
@0
WU is Idle
WB is Idle
@100
WU is Waiting
WB is Processing
@300
WB is Waiting
@enduml
```

### 10.16 Complete example

Thanks to Adam Rosien for this example.

```plantuml {hide=false}
@startuml
concise "Client" as Client
concise "Server" as Server
concise "Response freshness" as Cache
Server is idle
Client is idle
@Client
0 is send
Client -> Server@+25 : GET
+25 is await
+75 is recv
+25 is idle
+25 is send
Client -> Server@+25 : GET\nIf-Modified-Since: 150
+25 is await
+50 is recv
+25 is idle
@100 <-> @275 : no need to re-request from server
@Server
25 is recv
+25 is work
+25 is send
Server -> Client@+25 : 200 OK\nExpires: 275
+25 is idle
+75 is recv
+25 is send
Server -> Client@+25 : 304 Not Modified
+25 is idle
@Cache
75 is fresh
+200 is stale
@enduml
```

### 10.17 Digital Example

```plantuml {hide=false}
@startuml
scale 5 as 150 pixels
clock clk with period 1
binary "enable" as en
binary "R/W" as rw
binary "data Valid" as dv
concise "dataBus" as db
concise "address bus" as addr
@6 as :write_beg
@10 as :write_end
@15 as :read_beg
@19 as :read_end
@0
en is low
db is "0x0"
addr is "0x03f"
rw is low
dv is 0
@:write_beg-3
en is high
@:write_beg-2
db is "0xDEADBEEF"
@:write_beg-1
dv is 1
@:write_beg
rw is high
@:write_end
rw is low
dv is low
@:write_end+1
rw is low
db is "0x0"
addr is "0x23"
@12
dv is high
@13
db is "0xFFFF"
@20
en is low
dv is low
@21
db is "0x0"
highlight :write_beg to :write_end #Gold:Write
highlight :read_beg to :read_end #lightBlue:Read
db@:write_beg-1 <-> @:write_end : setup time
db@:write_beg-1 -> addr@:write_end+1 : hold
@enduml
```

### 10.18 Adding color

You can add color.

```plantuml {hide=false}
@startuml
concise "LR" as LR
concise "ST" as ST
LR is AtPlace #palegreen
ST is AtLoad #gray
@LR
0 is Lowering
100 is Lowered #pink
350 is Releasing
@ST
200 is Moving
@enduml
```

[Ref. QA-5776]

license: NCSA

repository: steve-hao/others

path: /md/mpe/PlantUML/10 定时图.md

filename: 10 定时图.md

repo_name: steve-hao/others


text:
# string-o-matic

There are many great sites for developers that provide hashing, encryption, and string manipulation functions.
Unfortunately most of them don't do the work in the browser with javascript, don't offer a live preview, have
each function on a different page, and don't give a choice of output formats for byte array output.

The aim of this site is to provide all those options in one place. You'll be able to build up a pipeline of
transformation steps that take your input and then process it any way you want to give the desired output.
Want an encrypted value represented as a URL-safe base 64 string with line separators every 80 characters?
No problem. Want your hex string in upper case with commas between each pair? Easy.

This site is easy to run locally for developers who want to test encryption and hashing without entering
passwords and secret keys on a website. As there are no server round trips and no analytics or other
libraries included from other sites, this site should be safe for use with sensitive data.

![Preview](docs/preview.png)

![Preview Mobile](docs/preview_mobile.png)

### Current status

This project started in March 2018 and has reached MVP, with a relatively small set of transformation steps included
and more to follow.

The [After MVP](https://github.com/string-o-matic/string-o-matic/projects/2) project lists planned future features. If
you have a feature request that isn't listed, please open an issue or a pull request!

### Development setup

This project is bootstrapped with [create-react-app](https://github.com/facebook/create-react-app) so all you need to
run it is Node >= 8. Earlier versions may also work but haven't been tested.

Clone the project and run `npm install` then `npm start` to start developing locally. SCSS files are watched and
compiled as you work, and new styles loaded by the browser without refreshing the page.

Please refer to the documentation for `create-react-app` for more details.

Run in development mode with live reload:

    npm start

Run tests:

    npm test

Run SASS-lint:

    npm run lint-css

Run webpack bundle analyzer:

    npm run analyze

Run a production build including all tests:

    npm run build

### Test production build

To test the site with production nginx configuration and ensure that minification does not break anything, use Docker
to wrap the production build. The following steps will compile the app, then build and launch an nginx Docker container
that serves it with all the security and caching headers required. Self-signed certificates for localhost are provided.

    npm run build
    docker build --tag string-o-matic .
    docker run --name string-o-matic --rm -p 8000:80 -p 8443:443 string-o-matic

Now browse to https://localhost:8443/ and click through the security warning. If necessary, change the port mappings to
avoid conflicts with other services you have running.

You can also test the production build with `serve -s build` but this will not include all the security and caching
headers sent by nginx.

### License

MIT

Copyright (c) 2018 David Morrissey

repository: string-o-matic/string-o-matic

repo_name: string-o-matic/string-o-matic


text:
# C with Hiredis

## Install

This code needs the [Hiredis](https://github.com/redis/hiredis) client library.

On MacOs X, install via

```
$ brew install hiredis
```

## Build

```
$ gcc -Wall -O2 c_hiredis_performance.c -lhiredis -o c_hiredis_performance
```

## Run

```
$ time ./c_hiredis_performance
```

## My Result

```
$ time ./c_hiredis_performance
Connecting...
Connected!
Done

real  0m2.959s
user  0m1.831s
sys 0m0.034s
```

=> 338,000 cps

repository: rdterner/redis-client-benchmarks

repo_name: rdterner/redis-client-benchmarks


text:
Pattern: Global coroutine usage

Issue: -

## Description

Report usages of `GlobalScope.launch` and `GlobalScope.async`. It is highly discouraged by the Kotlin documentation:

> Global scope is used to launch top-level coroutines which are operating on the whole application lifetime and are
> not cancelled prematurely.

> Application code usually should use an application-defined CoroutineScope. Using async or launch on the instance
> of GlobalScope is highly discouraged.

Example of **incorrect** code:

```kotlin
fun foo() {
    GlobalScope.launch { delay(1_000L) }
}
```

Example of **correct** code:

```kotlin
val scope = CoroutineScope(Dispatchers.Default)

fun foo() {
    scope.launch { delay(1_000L) }
}

fun onDestroy() {
   scope.cancel()
}
```

## Further Reading

* [Detekt - GlobalCoroutineUsage](https://detekt.dev/docs/rules/coroutines/#globalcoroutineusage)
* [kotlinx.coroutines](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-global-scope)

repository: Adroiti/docs-for-code-review-tools

repo_name: Adroiti/docs-for-code-review-tools


text:
# Tree

## Binary tree

inary is the most basic form of tree structure where each node has a maximum of two child nodes. The child nodes are known as left and right nodes.

## Binary search tree

A binary search tree (BST) is a special type of binary tree where the nodes are stored in a sorted manner. It is sorted in such a way that at any given point, a node value must be greater than or equal to the left child node value and smaller than the right child node value. Each node has to satisfy this property to consider it as a binary search tree. Since the nodes are sorted in a particular order, the binary search algorithm can be applied to search items in a BST in logarithmic time.

repository: quan-vu/php-algorithm

repo_name: quan-vu/php-algorithm


text:
A command-line toolkit to extract text content and category data from Wikipedia dump files

## About

WP2TXT extracts text and category data from Wikipedia dump files (encoded in XML / compressed with Bzip2), removing MediaWiki markup and other metadata.

## Changelog

**May 2023**

- Problems caused by too many parallel processors are addressed by setting the upper limit on the number of processors to 8.

**April 2023**

- File split/delete issues fixed

**January 2023**

- Bug related to command line arguments fixed
- Code cleanup introducing Rubocop

**December 2022**

- Docker images available via Docker Hub

**November 2022**

- Code added to suppress "Invalid byte sequence error" when an ilegal UTF-8 character is input.

**August 2022**

- A new option `--category-only` has been added. When this option is enabled, only the title and category information of the article is extracted.
- A new option `--summary-only` has been added. If this option is enabled, only the title, category information, and opening paragraphs of the article will be extracted.
- Text conversion with the current version of WP2TXT is *more than 2x times faster* than the previous version due to parallel processing of multiple files (the rate of speedup depends on the CPU cores used for processing).

## Screenshot

**Environment**

- WP2TXT 1.0.1
- MacBook Pro (2021 Apple M1 Pro)
- enwiki-20220720-pages-articles.xml.bz2 (19.98 GB)

In the above environment, the process (decompression, splitting, extraction, and conversion) to obtain the plain text data of the English Wikipedia takes less than 1.5 hours.

## Features

- Converts Wikipedia dump files in various languages
- Creates output files of specified size
- Allows specifying ext elements (page titles, section headers, paragraphs, list items) to be extracted
- Allows extracting category information of the article
- Allows extracting opening paragraphs of the article

## Setting Up

### WP2TXT on Docker

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) (Mac/Windows/Linux)
2. Execute `docker` command in a terminal:

```shell
docker run -it -v /Users/me/localdata:/data yohasebe/wp2txt
```

- Make sure to Replace `/Users/me/localdata` with the full path to the data directory in your local computer

3. The Docker image will begin downloading and a bash prompt will appear when finished.
4. The `wp2txt` command will be avalable anywhare in the Docker container. Use the `/data` directory as the location of the input dump files and the output text files.

**IMPORTANT:**

- Configure Docker Desktop resource settings (number of cores, amount of memory, etc.) to get the best performance possible.
- When running the `wp2txt` command inside a Docker container, be sure to set the output directory to somewhere in the mounted local directory specified by the `docker run` command.

### WP2TXT on MacOS and Linux

WP2TXT requires that one of the following commands be installed on the system in order to decompress `bz2` files:

- `lbzip2` (recommended)
- `pbzip2`
- `bzip2`

In most cases, the `bzip2` command is pre-installed on the system. However, since `lbzip2` can use multiple CPU cores and is faster than `bzip2`, it is recommended that you install it additionally. WP2TXT will attempt to find the decompression command available on your system in the order listed above.

If you are using MacOS with Homebrew installed, you can install `lbzip2` with the following command:

    $ brew install lbzip2

### WP2TXT on Windows

Install [Bzip2 for Windows](http://gnuwin32.sourceforge.net/packages/bzip2.htm) and set the path so that WP2TXT can use the bunzip2.exe command. Alternatively, you can extract the Wikipedia dump file in your own way and process the resulting XML file with WP2TXT.

## Installation

### WP2TXT command

    $ gem install wp2txt

## Wikipedia Dump File

Download the latest Wikipedia dump file for the desired language at a URL such as

    https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2

Here, `enwiki` refers to the English Wikipedia. To get the Japanese Wikipedia dump file, for instance, change this to `jawiki` (Japanese). In doing so, note that there are two instances of `enwiki` in the URL above.

Alternatively, you can also select Wikipedia dump files created on a specific date from [here](http://dumps.wikimedia.org/backup-index.html). Make sure to download a file named in the following format:

    xxwiki-yyyymmdd-pages-articles.xml.bz2

where `xx` is language code such as `en` (English)" or `ja` (japanese), and  `yyyymmdd` is the date of creation (e.g. `20220801`).

## Basic Usage

Suppose you have a folder with a wikipedia dump file and empty subfolders organized as follows:

```
.
├── enwiki-20220801-pages-articles.xml.bz2
├── /xml
├── /text
├── /category
└── /summary
```

### Decompress and Split

The following command will decompress the entire wikipedia data and split it into many small (approximately 10 MB) XML files.

    $ wp2txt --no-convert -i ./enwiki-20220801-pages-articles.xml.bz2 -o ./xml

**Note**: The resulting files are not well-formed XML. They contain part of the orignal XML extracted from the Wikipedia dump file, taking care to ensure that the content within the <page> tag is not split into multiple files.

### Extract plain text from MediaWiki XML

    $ wp2txt -i ./xml -o ./text

### Extract only category info from MediaWiki XML

    $ wp2txt -g -i ./xml -o ./category

### Extract opening paragraphs from MediaWiki XML

    $ wp2txt -s -i ./xml -o ./summary

### Extract directly from bz2 compressed file

It is possible (though not recommended) to 1) decompress the dump files, 2) split the data into files, and 3) extract the text just one line of command. You can automatically remove all the intermediate XML files with `-x` option.

    $ wp2txt -i ./enwiki-20220801-pages-articles.xml.bz2 -o ./text -x

## Sample Output

Output contains title, category info, paragraphs

    $ wp2txt -i ./input -o /output

- [English Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_en.txt)
- [Japanese Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_ja.txt)

Output containing title and category only

    $ wp2txt -g -i ./input -o /output

- [English Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_en_category.txt)
- [Japanese Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_ja_category.txt)

Output containing title, category, and summary

    $ wp2txt -s -i ./input -o /output

- [English Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_en_summary.txt)
- [Japanese Wikipedia](https://raw.githubusercontent.com/yohasebe/wp2txt/master/data/output_samples/testdata_ja_summary.txt)

## Command Line Options

Command line options are as follows:

    Usage: wp2txt [options]
    where [options] are:
      -i, --input                      Path to compressed file (bz2) or decompressed file (xml), or path to directory containing files of the latter format
      -o, --output-dir=<s>             Path to output directory
      -c, --convert, --no-convert      Output in plain text (converting from XML) (default: true)
      -a, --category, --no-category    Show article category information (default: true)
      -g, --category-only              Extract only article title and categories
      -s, --summary-only               Extract only article title, categories, and summary text before first heading
      -f, --file-size=              Approximate size (in MB) of each output file (default: 10)
      -n, --num-procs                  Number of proccesses (up to 8) to be run concurrently (default: max num of available CPU cores minus two)
      -x, --del-interfile              Delete intermediate XML files from output dir
      -t, --title, --no-title          Keep page titles in output (default: true)
      -d, --heading, --no-heading      Keep section titles in output (default: true)
      -l, --list                       Keep unprocessed list items in output
      -r, --ref                        Keep reference notations in the format [ref]...[/ref]
      -e, --redirect                   Show redirect destination
      -m, --marker, --no-marker        Show symbols prefixed to list items, definitions, etc. (Default: true)
      -b, --bz2-gem                    Use Ruby's bzip2-ruby gem instead of a system command
      -v, --version                    Print version and exit
      -h, --help                       Show this message

## Caveats

* Some data, such as mathematical formulas and computer source code, will not be converted correctly.
* Some text data may not be extracted correctly for various reasons (incorrect matching of begin/end tags, language-specific formatting rules, etc.).
* The conversion process can take longer than expected. When dealing with a huge data set such as the English Wikipedia on a low-spec environment, it can take several hours or more.

## Useful Links

* [Wikipedia Database backup dumps](http://dumps.wikimedia.org/backup-index.html)

## Author

* Yoichiro Hasebe<EMAIL_ADDRESS>
## References

The author will appreciate your mentioning one of these in your research.

* Yoichiro HASEBE. 2006. [Method for using Wikipedia as Japanese corpus.](http://ci.nii.ac.jp/naid/110006226727) _Doshisha Studies in Language and Culture_ 9(2), 373-403.
* 長谷部陽一郎. 2006. [Wikipedia日本語版をコーパスとして用いた言語研究の手法](http://ci.nii.ac.jp/naid/110006226727). 『言語文化』9(2), 373-403.

Or use this BibTeX entry:

```
@misc{wp2txt_2023,
  author = {Yoichiro Hasebe},
  title = {WP2TXT: A command-line toolkit to extract text content and category data from Wikipedia dump files},
  url = {https://github.com/yohasebe/wp2txt},
  year = {2023}
}
```

## License

This software is distributed under the MIT License. Please see the LICENSE file.

gha_language: Ruby


text:
# Vertical Rhythm

## New in this version
* All files can now be imported as a mixin.
* Standard 6 font sizes (xs - xxl).
* New calculations for typeface specific cap heights.
* Baseline can now be toggled via a variable instead of a checkbox.
* Fixed some bugs in the calculations.

## [Demo](http://vicompany.github.io/vertical-rhythm/)
A collection of examples that displays the effects of a proper vertical rhythm.

## How it works
### Base typography
The goal of typography is to create balanced, readable and legible text. Good typography depends on many factors.

VR takes into account the cap height of different typefaces. This is the only number that needs some fine-tuning to get everything just right. Located in: <_vr-user-settings.scss>

```
$show-baseline: true;

$font-display: Arial, sans-serif;
$cap-font-display: 0.0155em;

$px-font-size: 16;
$px-line-height: 24;

$modular-scale: 'golden section';
```

### Modular scales
The next step is selecing one of the 17 predefined modular scales.

```
$modular-scales: (
  'minor-second': 1.067,
  'major-second': 1.125,
  'minor-third': 1.2,
  'major-third': 1.25,
  'perfect-fourth': 1.333,
  'augmented-fourth': 1.414,
  'perfect-fifth': 1.5,
  'minor-sixth': 1.6,
  'golden-section': 1.618,
  'major-sixth': 1.667,
  'minor-seventh': 1.778,
  'major-seventh': 1.875,
  'octave': 2,
  'major-tenth': 2.5,
  'major-eleventh': 2.667,
  'major-twelfth': 3,
  'double-octave': 4
);
```

### Alignment
All alignment classes are based on the $rhythm ($base-font-size * $base-line-height).

```
div  { margin-bottom: $distance-s; }
h1   { @include vr($font-display, $font-size-m); }
code { padding: $paragraph-trailer; }
img  { max-height: $size-m; }
```

### Borders
Use negative margins to align elements that have a top- and/or bottom border(s). Aligning borders might be a bit tricky at first, but eventually it becomes second nature.

```
.foo {
  margin-top: ($border-width-m * -1);
  border-top: $border-width-m solid $black;
}

.bar {
  margin-bottom: ($distance-s - $border-width-m);
  border-bottom: $border-width-m solid $black;
}
```

## License

Vertical Rhythm is licensed under the [MIT license](http://opensource.org/licenses/MIT).

repository: manoahupson/vertical-rhythm

repo_name: manoahupson/vertical-rhythm


text:
Getting a Flat Belly
======================
Jeff Cavaliere points out in his video that abdominal exercises are good
but they don't make you lose belly fat. Good and consistent abdominal
workouts will build abs but then abs can't be formed upon a big belly.

Diet has to change and aerobics have to be mixed in exercise routine to
burn existing fat. Even when ripped, fats may still be settled underneath
the obliques.

repository: josephrexme/knowledge

repo_name: josephrexme/knowledge


text:
# rationals
_extended rational number type for javascript_

Why I think this lib is great:

- Representing fractions is not just easy, but it's natural. This is what
rational numbers do best. Operations like `0.1 + 0.2` are a pain in js,
but using rational numbers, it's just: `r(1,10).plus(1,5) === r(3,10)`

- This lib provides a type of object which will work with 1/0 or 0/0 just as well.
This is especially useful if you plan to plot values on a graph.

I've got the inspiration for this lib from here: [MF105: The extended rational numbers in practice](http://www.youtube.com/watch?v=YMQkLojL2ek)

# Support
[![browser support](https://ci.testling.com/ashnur/rationals.png)](https://ci.testling.com/ashnur/rationals)

# Examples
```
var r = require('rationals');

// denominator of 1 is optional
r(1) === r(1); // true

r(1,1) === r(1); // true

// all rationals will be always reduced
r(2,4) === r(13,26); // true

r(100,50) === r(2); // true

// chaining works
r(1,2).plus(r(1,3)).minus(r(1,4)).times(r(1,5)).per(r(1,6)) === r(49,70); // true

// my personal favorite aproximation of Pi, from ancient china
r(355,113).val(); // 3.1415929203539825

// you can give floats and they will be converted into rationals
rats(0.4,0.1) == rats(4);

```

# API
- _a & b are objects created with the rationals() function_
- in the parentheses you have some common aliases for the methods

#### Addition
- add _(plus)_

    `a.add(b)`

#### Subtraction
- subtract _(minus, sub)_

    `a.sub(b)`

#### Multiplication
- multiply _(times, mul)_

    `a.mul(b)`

#### Division
- divide _(per, div)_

    `a.div(b)`

#### Examining
- toString

    Examining an object can be hard, but if you cast it to a string: `r(355,113)+''` will return `'355/113'`.

    So `r(625,125).toString()` will return `'5/1'`.

#### Display
- display

    Just like toString(), but the numerator will be shown only if it's not 1.
    That is, integers will appear without a slash symbol and a denominator.

    `r(625,125).display()` returns `'5'`.

#### Approximation
- val _(value)_

    Will return the numerator divided with the denominator.

    `r(355,113).val(); //3.1415929203539825`

#### Ordering
- compare _(value)_

    Will return -1, 0 or 1 if the rational is smaller, equal or larger than the rational it is compared to

    `r(-999,605).compare(R(272,835)) // -1`
    `r(-966,743).compare(R(-632,198)) // 1`
    `r(-3,9).compare(R(12,-36)) // 0`

#### Compare absolute values
- compareAbs _(value)_

    Same as compare but without signs.

    `r(-999,605).compareAbs(R(272,835)) // 1`

# Good to know
If you provide anything else as the numerator, than an integer, float or a numerica string an exception will be thrown.
On the other hand, if you do the same with the denominator, it will be cast to 1. This is because
I am lazy, and I do not want to handle wrong values and undefined values differently throwing for the former
and casting to 1 for the latter.

# Install
```
npm install rationals
```

**You can use it in the browser with [browserify](http://browserify.org/)**


text:
---
title: 'ROSS - Rotordynamic Open Source Software'

tags:
  - rotordynamic
  - dynamics
  - Python
authors:
 - name: Raphael Timbó
   orcid: 0000-0001-7689-5486
   affiliation: 1
 - name: Rodrigo Martins
   orcid: 0000-0002-9996-6600
   affiliation: 2
 - name: Gabriel Bachmann
   orcid: 0000-0003-4401-8408
   affiliation: 4
 - name: Flavio Rangel
   orcid: 0000-0002-4852-8141
   affiliation: 5
 - name: Júlia Mota
   orcid: 0000-0002-9547-9629
   affiliation: 3
 - name: Juliana Valério
   orcid: 0000-0002-6198-7932
   affiliation: 5
 - name: Thiago G Ritto
   orcid: 0000-0003-0649-6919
   affiliation: 2
affiliations:
 - name: Petrobras - Petróleo Brasileiro S.A.
   index: 1
 - name: Universidade Federal do Rio de Janeiro, Department of Mechanical Engineering, Rio de Janeiro, Brazil
   index: 2
 - name: Universidade Federal do Rio de Janeiro, Graduate Program in Informatics, Rio de Janeiro, Brazil
   index: 3
 - name: Universidade Federal do Rio de Janeiro, Department of Electrical Engineering, Rio de Janeiro, Brazil
   index: 4
 - name: Universidade Federal do Rio de Janeiro, Department of Computer Science, Rio de Janeiro, Brazil
   index: 5
date: 10 October 2019
bibliography: paper.bib
---

# Summary

There are several critical rotating equipment crucial to the industry, such as compressors,
pumps and turbines.
Computational mechanical models aim to simulate the behavior of such mechanical
systems [@friswell2010dynamics; @vance2010machinery; @childs1993turbomachinery; @ishida2012linear; @gasch2006rotordynamik].
These models are used to support research and decision making. To this purpose, we present ROSS,
an open source library written in Python for rotordynamic analysis.

Concerning rotordynamics softwares, there are some commercial finite element softwares that have a rotordynamic
module [@comsol; @ansys], some softwares based on a commercial platform (Matlab) [@madyn; @dynamicsrotating], and others
that are independent [@rotorinsa; @trcsoftware].
To use these softwares one needs to buy licenses, and they are not intended to be developed in a collaborative public
manner.

ROSS allows the construction of rotor models and their numerical simulation. Shaft elements, as a default, are
modeled with the Timoshenko beam theory, which considers shear and rotary inertia effects, and discretized by means of
the Finite Element Method [@friswell2010dynamics]. Disks are assumed to be rigid bodies, thus their strain energy is not taken
into account. And bearings/seals are included as linear stiffness/damping coefficients.

After defining the element matrices and assembling the global matrices of the system, ROSS draws the rotor geometry,
runs simulations, and obtains results in the form of graphics. It performs several analyses, such as static analysis,
Campbell Diagram, mode shapes, frequency response, and time response.

The general form of the equation for the system, after matrix assembly is

\begin{equation}\label{eq:general-form}
   \mathbf{M \ddot{q}}(t)
  + \mathbf{C}(\Omega) \mathbf{\dot{q}}(t)
  + \omega \mathbf{G} \mathbf{\dot{q}}(t)
  + \mathbf{K}(\Omega) \mathbf{{q}}(t)
  = \mathbf{f}(t)\,,
\end{equation}

where $\textbf{q}$ is the generalized coordinates of the system (displacements and rotations),
$\mathbf{M}$, $\mathbf{K}$, $\mathbf{C}$ and $\mathbf{G}$ are the mass, stiffness, damping and gyroscopic
matrices, $\Omega$ is the excitation frequency, $\omega$ is the rotor whirl speed and $\mathbf{f}$ is the generalized
force vector.

We have built the package using main Python packages such as NumPy [@van2011numpy], SciPy [@jones2001scipy]
and Bokeh [@bokeh2019].

Besides the [documentation](https://ross-rotordynamics.github.io/ross-website/), a set of Jupyter Notebooks
is available for the tutorial and some examples. Users can also access these notebooks through a [Binder server](https://mybinder.org/v2/gh/ross-rotordynamics/ross/master).

As an example, Figure 1 shows a centrifugal compressor modeled with ROSS.

![Centrifugal Compressor modeled with ROSS.](rotor_plot.png)

The shaft elements are in gray,
the impellers represented as disks are in blue and the bearings are displayed as springs and dampers. This plot is generated with Bokeh,
and we can use the hover tool to get additional information on each element.

One analysis that can be carried out is the modal analysis. Figure 2 shows the Campbell Diagram generated for this
compressor; the natural frequencies and the log dec vary with the machine rotation speed.

![Campbell Diagram for the Centrifugal Compressor.](campbell.png)

The Campbell Diagram is one of the results that can be obtained from the model, other types of analysis can be found
on the [documentation](https://ross-rotordynamics.github.io/ross-website/). The software is extensible and new elements
or new types of analysis can be easily included.

# Acknowledgements
We acknowledge that ROSS development is supported by Petrobras, Universidade Federal do Rio de Janeiro (UFRJ) and
Agência Nacional de Petróleo, Gás Natural e Biocombustíveis (ANP).

# References

repository: thiagoritto/ross

repo_name: thiagoritto/ross


text:
# Wiki-Projects VCK190-Boot Repository
This repository contains Versal Example Designs related to boot on a VCK190 board.

---
## **What to Expect:**
Each Versal Example Design contains the following structure:

```
<design>
├── Hardware
│   └── constraints
│       └── constraints.xdc
├── README.md
├── Icons
├── Scripts
│   ├── <design>_bd.tcl
│   └── project_top.tcl
└── Software
    ├── PetaLinux
    └── Vitis
````
Each design's `README.md` will provide a detailed overview of the Versal Example Design.

For example:

- **Design Summary** - Brief summary of the design.

- **Required Hardware and Tools** - Listing of required hardware

- **Build Instructions** - Instructions on how to re-build the designs

- **Validation** - List of exact validation hardware, and results of validation tests run against the design

- **Known Issues** - Current known issues with the design and/or workarounds for these issues.
---
## **Troubleshooting / Assistance**
If you find you are having difficulty bringing up one of the designs, or need some additional assistance, please reach out on the [Xilinx Community Forums](https://forums.xilinx.com).

Be sure to [search](https://forums.xilinx.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&inactive=false) the forums first before posting, as someone may already have the solution!

---