text:
---
permalink: /NI_property_analysis_cleaning
layout: default
title: "NI Property Value Analysis - Loading and Cleaning"
redirect_from:
  - /NI_property_analysis_cleaning/
  - /NI_property_analysis_cleaning.html
---

Northern Ireland Domestic Property Value Data
Loading and Cleaning

Loading and properly cleaning the data is maybe the most important step of good data analysis. If you don't know what the data looks like and what the columns actually contain, instead of what you think they contain, you can't trust any of your conclusions. Here we will be loading the raw data in and examining each column for mixed data types, inconsistent data entry (fixing capitalisation or spelling mistakes), making numeric columns actually numeric and looking at missing values and what can be done to fill them out.

[Main project page](NI_property_analysis#title)

Contents

1. [Loading the Data](#Loading-the-Data)
2. [Clean Up](#Clean-Up)
    1. [Look at the data](#Look-at-the-data)
    2. [Investigating NI's 6 new counties](#Investigating-NI-s-6-new-counties)
    3. [Missing data and what can be fixed](#Missing-data-and-what-can-be-fixed)
    4. [Filling missing postcodes](#Filling-missing-postcodes)
    5. [Filling missing towns](#Filling-missing-towns)
3. [Save to File](#Save-to-File)

Loading the Data

Back to top

We don't need everything in the dataset, such as district/ward/street IDs so only loading in specific columns

```python
import pandas as pd
import numpy as np
NI_domestic_properties = "DomesticPropertyValue.csv"

column_types = {'District': object, 'Ward': object, 'Street': object, 'Building Name': object,
                'Sub-building Name': object, 'Building Number': object, 'Townland': object,
                'Town': object, 'County': object, 'Postcode': object, 'Description': object,
                'Capital Value Non-Exempt': object, 'Capital Value Exempt': object,
                'Property Size': object, 'Central Heating': object, 'Garage': object,
                'Property Address': object}

properties_df = pd.read_csv(NI_domestic_properties, dtype=column_types, usecols=column_types.keys())
properties_df.head()
```

      District
      Ward
      Street
      Building Name
      Sub-building Name
      Building Number
      Townland
      Town
      County
      Postcode
      Property Address
      Description
      Capital Value Non-Exempt
      Capital Value Exempt
      Property Size
      Central Heating
      Garage

      0
      Antrim and Newtownabbey Borough Council
      Abbey
      Abbeyglen Crescent
      NaN
      NaN
      1
      White Abbey
      Newtownabbey
      ANTRIM
      BT37 0TJ
      1 Abbeyglen Crescent, White Abbey, Newtownabbe...
      House Garden
      70,000.00
      0.00
      107.00 Square Metres
      Yes
      No

      1
      Antrim and Newtownabbey Borough Council
      Abbey
      Abbeyglen Crescent
      NaN
      NaN
      3
      White Abbey
      Newtownabbey
      ANTRIM
      BT37 0TJ
      3 Abbeyglen Crescent, White Abbey, Newtownabbe...
      House Garden
      90,000.00
      0.00
      154.95 Square Metres
      Full
      No

      2
      Antrim and Newtownabbey Borough Council
      Abbey
      Abbeyglen Crescent
      NaN
      NaN
      2
      White Abbey
      Newtownabbey
      ANTRIM
      BT37 0TJ
      2 Abbeyglen Crescent, White Abbey, Newtownabbe...
      House Garden
      70,000.00
      0.00
      103.00 Square Metres
      Yes
      No

      3
      Antrim and Newtownabbey Borough Council
      Abbey
      Abbeyglen Crescent
      NaN
      NaN
      4
      White Abbey
      Newtownabbey
      ANTRIM
      BT37 0TJ
      4 Abbeyglen Crescent, White Abbey, Newtownabbe...
      Flat (Ground Floor)
      42,000.00
      0.00
      56.00 Square Metres
      Yes
      No

      4
      Antrim and Newtownabbey Borough Council
      Abbey
      Abbeyglen Crescent
      NaN
      NaN
      6
      White Abbey
      Newtownabbey
      ANTRIM
      BT37 0TJ
      6 Abbeyglen Crescent, White Abbey, Newtownabbe...
      Flat (1st Floor)
      42,000.00
      0.00
      56.00 Square Metres
      Yes
      No

Clean Up

Back to top

Straight away there are some issues evident in the top 5 rows. Property size should be a number but includes the text "square meters". Building Name and Sub-building Name are NaN are they all NaN? What is the difference between "Full" central heating and marked "Yes". Capital Value Non-Exempt has a comma in it so won't be treated as numeric.

There are probably lots of other errors in the rest of the columns that need fixed that isn't evident in the top 5 rows. Time to dig further

Look at the data

Back to top

The first thing to do is look at the shape of the data. How many rows are we working with? Number of unique values in each column? Number of nulls?  There should be 766,350 unique addresses too but there are 2,465 too few.

11 districts, 432 wards, 22,472 streets. I know the districts is correct and the others look about right, though these will only be wards and streets with houses on them.

My knowledge of NI geography isn't great but I'm pretty sure there aren't 12 counties, so that will need further investigation.

And why are there 7 options for central heating and 4 for whether the property has a garage?

Investigating NI's 6 new counties

Back to top

```python
properties_df["County"].unique()
```

    array(['ANTRIM', 'Antrim', nan, 'DOWN', 'Down', 'ARMAGH', 'Armagh',
           'LONDONDERRY', 'Londonderry', 'TYRONE', 'Tyrone', 'FERMANAGH',
           'Fermanagh'], dtype=object)

So unsurprisingly the data is inconsistent with its capitalisation. lets fix that.

```python
properties_df['County'] = properties_df['County'].apply(lambda x: str(x).upper().capitalize())
properties_df['County'] = properties_df['County'].replace('Nan', np.nan)
properties_df["County"].unique()
```

    array(['Antrim', nan, 'Down', 'Armagh', 'Londonderry', 'Tyrone',
           'Fermanagh'], dtype=object)

That is much better. It is likely that this is also a problem with the towns too.

```python
print("Unique towns before: " + str(properties_df["Town"].nunique()))
properties_df['Town'] = properties_df['Town'].apply(lambda x: str(x).upper().capitalize())
properties_df['Town'] = properties_df['Town'].replace('Nan', np.nan)
print("Unique towns after: " + str(properties_df["Town"].nunique()))
```

    Unique towns before: 419
    Unique towns after: 313

As expected that cleaned up the towns nicely too.

The last one that looks off is the central heating and the garage columns. They are small enough that we can look at the unique values directly.

```python
print("Central Heating: " + str(properties_df["Central Heating"].unique()))
print("Garage: " + str(properties_df["Garage"].unique()))
```

    Central Heating: ['Yes' 'Full' 'No' 'ASSUMED' 'Partial' 'None' nan 'FUL']
    Garage: ['No' 'NO' 'Yes' nan 'YES']

This time we have a mixture of capitalization, spelling errors and semingly duplicate categories. Let's make Garage just Yes/No and Central Heating to Yes/Assumed/Partial/No. Full and FUL can become Yes, None can be No.

```python
properties_df["Central Heating"] = properties_df["Central Heating"].str.replace("Full","Yes")
properties_df["Central Heating"] = properties_df["Central Heating"].str.replace("FUL","Yes")
properties_df["Central Heating"] = properties_df["Central Heating"].str.replace("None","No")
properties_df["Central Heating"] = properties_df["Central Heating"].str.replace("ASSUMED","Assumed")

properties_df['Garage'] = properties_df['Garage'].apply(lambda x: str(x).upper().capitalize())
properties_df['Garage'] = properties_df['Garage'].replace('Nan', np.nan)

print("Central Heating: " + str(properties_df["Central Heating"].unique()))
print("Garage: " + str(properties_df["Garage"].unique()))
```

    Central Heating: ['Yes' 'No' 'Assumed' 'Partial' nan]
    Garage: ['No' 'Yes' nan]

Looking back at the table of unique values per column we also printed the data type. Most are objects as expected for strings but Capital Value Non-Exempt, Capital Value Exempt and Property Size should all be numeric. First the commas in the numbers need removed and " Square Metres" needs dropped from the property size column. Then they can be converted to numeric.

```python
properties_df["Capital Value Non-Exempt"] = properties_df["Capital Value Non-Exempt"].str.replace(",","")
properties_df["Capital Value Exempt"] = properties_df["Capital Value Exempt"].str.replace(",","")
properties_df["Property Size"] = properties_df["Property Size"].str.replace(",","")
properties_df["Property Size"] = properties_df["Property Size"].str.replace(" Square Metres","")

properties_df["Capital Value Non-Exempt"] = pd.to_numeric(properties_df["Capital Value Non-Exempt"])
properties_df["Capital Value Exempt"] = pd.to_numeric(properties_df["Capital Value Exempt"])
properties_df["Property Size"] = pd.to_numeric(properties_df["Property Size"])
```

Missing data and what can be fixed

Back to top

Next we want to look at what data is missing. How many empty cells does each column have, which columns does that matter in and can we fix it?

Below the type of each column is listed along with the numer of nulls in each

```python
for item in properties_df.columns:
    print('{:24}  {:6}'.format(str(item),  properties_df[item].isnull().sum()))
    #print (item, ":\t", NI_dom_prop_df[item].isnull().sum(), "\t", NI_dom_prop_df[item].dtype)
```

    District                       0
    Ward                           0
    Street                         0
    Building Name             746429
    Sub-building Name         720583
    Building Number             7639
    Townland                     251
    Town                       16102
    County                      2003
    Postcode                   52182
    Property Address            1897
    Description                  165
    Capital Value Non-Exempt       0
    Capital Value Exempt           0
    Property Size                621
    Central Heating              839
    Garage                       841

There are quite a few values missing but for some columns such as Building Name and Sub-building Name that doesn't matter, it is to be expected. 52,182 postcodes are missing though and I plan to use the postcodes for joining other data later. Fortunately we also have the full address which may have the postcode and there are only 1,897 of those missing.

Filling missing postcodes

Back to top

First lets get all the rows where the postcode is missing.

```python
rows_to_fix = properties_df["Postcode"].isnull()
```

Now lets look at a few addresses to see if they follow the same pattern. We will use sample here instead of head so we get a more representative view of the data

```python
pd.set_option('display.max_colwidth', -1)
print(properties_df[rows_to_fix]["Property Address"].sample(n=15))
#reset the max_colwidth to default
pd.set_option('display.max_colwidth', 50)
```

    503872    64 Corramore Road, Muggalnagrow, Garrison, Enniskillen BT93 4BA,
    761682    5 Ballylough Road, Ballylough, Castlewellan BT31 9NN,
    645857    15 Farm Lodge Park, Greenisland, West Division, Carrickfergus BT38 8YB,
    44554     Lock Up Garage 4, N11 Glanroy Crescent, Croghfern, Newtownabbey, Antrim,
    180153    31 Derry Park Lane, Derry, Lurgan, ARMAGH,
    465221    Lock Up Garage 7, N22 Pine Street, Clooney, Londonderry, Londonderry,
    61710     18 Forge Walk, Carrickmannan, Ballygowan, Newtownards BT23 6SX,
    173713    5 Granville Road, Killycomain, Portadown, Craigavon BT63 5DN,
    555853    The Manse, 55 Church Road, Boardmills, Carrickmaddyroe, Lisburn BT27 6UP,
    720583    24 Gallion Way, Moneymore, Magherafelt BT45 7WF,
    582720    Apartment 1, 6 Seymour Street, Lisnagarvy, Lisburn BT27 4XF,
    649206    Lock Up Garage 5, N44 Longfield Gardens, Greenisland, West Division, Carrickfergus, Antrim,
    206667    85 Carrigart Crescent, Tullygally, Craigavon BT65 5EG,
    703494    8 Elm Terrace, Gortshalgan, Dungannon BT71 6FP,
    317287    Flat 5A Moveen House, Benmore Drive, Finaghy, Ballyfinaghy, Belfast BT10 0EF,
    Name: Property Address, dtype: object

For those that have postcodes they seem to be always at the end of the address followed by a comma. Postcodes are annoying to work with as they aren't fixed length and can have a space or not a space. For this we will rely on the format of the address being relatively consistent. Strip the postcode from the end then check if it looks like a postcode, rather than resorting to complex regex. At least I can count on all Northern Ireland postcodes starting with BT which is nice.

```python
# get the last 10 characters of the address
fixed_postcodes = properties_df[rows_to_fix]["Property Address"].str.slice(-10,-1)
fixed_postcodes.sample(n=5)
```

    692051    BT80 8JG,
    700812    BT45 5FA,
    560388    , Antrim,
    451352    BT48 6AZ,
    214131    BT60 1BT,
    Name: Property Address, dtype: object

```python
#replace commas and strip leading and trailing whitespace
fixed_postcodes = fixed_postcodes.str.replace(",", "").str.strip()
fixed_postcodes.sample(n=5)
```

    523913    BT74 6BJ
    762720    BT30 8RE
    134245      Armagh
    403140    BT47 4TD
    372370     st Down
    Name: Property Address, dtype: object

```python
# get only the rows that start with "BT"
right_rows = fixed_postcodes.str.startswith('BT', na=False)
fixed_postcodes[~right_rows] = np.nan
fixed_postcodes.sample(n=5)
```

    469881    BT82 9QU
    657810         NaN
    261851    BT15 5AS
    78977          NaN
    718814    BT45 8PY
    Name: Property Address, dtype: object

```python
# add back into the dataframe
properties_df.loc[rows_to_fix, 'Postcode'] = fixed_postcodes
print("Number of missing postcodes: " + str(properties_df["Postcode"].isnull().sum()))
```

    Number of missing postcodes: 10623

10,623 are still missing but that is a big improvement. We can go a little further though. The nice thing about postcodes is that they are geographically clustered. Houses on the same street have the same postcode. So I can group the data by district, ward and street and then apply any postcode found to all that are missing one on that street.

```python
def setPostcode(group):
    # only modify if there are nan's but not all nan's
    if group["Postcode"].isnull().any() and not group["Postcode"].isnull().all():
        # find the first not null postcode
        group_postcode = group.loc[group["Postcode"].first_valid_index()]["Postcode"]
        # apply the group postcode to each with a null postcode
        properties_df.loc[group.index[group['Postcode'].isnull()], 'Postcode'] = group_postcode
    return group

properties_df.groupby(['District','Ward', "Street"]).apply(setPostcode)
print("Number of missing postcodes: " + str(properties_df["Postcode"].isnull().sum()))
```

    Number of missing postcodes: 218

Down to only 218 missing postcodes from 52,182. Not bad!

Filling missing towns

Back to top

There are 16,102 entries missing their town value. Similarly to postcodes this information is duplicated in the address

```python
pd.set_option('display.max_colwidth', -1)
print(properties_df[rows_to_fix]["Property Address"].sample(n=15))
#reset the max_colwidth to default
pd.set_option('display.max_colwidth', 50)
```

    701988    42 Creenagh Bridge Road, Creenagh, Dungannon BT71 6EY,
    452375    35 Harding Street, Londonderry BT48 6SF,
    754738    33 Carneyhough Court, Carneyhough, Newry BT34 2TW,
    759493    7 Heslips Court, Lisdrumliska, Newry BT35 8GR,
    674650    41 School Road, Eskragh, Beltany, Newtownsaville, Omagh BT78 2SD,
    61476     Lock Up Garage 5, N12 Church Hill, Ballygowan, Down,
    532798    16 Knocknamoe Bungalows, Mullaghmore, Omagh BT79 7LA,
    407982    20 Neptune Crescent, Walworth, Ballykelly, Limavady BT49 9PY,
    694962    64 Ballyronan Road, Killyfaddy, Magherafelt BT45 6EW,
    78276     20 Cedarfield, Corporation, Bangor BT20 4WH,
    42243     64 Rathmore Road, Dunadry, Rathbeg, Antrim BT41 2HX,
    441912    17 Woodend Meadow, Ballymagorry, Strabane BT82 0FB,
    122391    74 Rathmore Road, Carnalea, Bangor, Down, BT19 1NU,
    690347    24 Torrent Valley, Gortnaskea, Coalisland, Dungannon BT71 4FE,
    122179    15 Lynne Road, Carnalea, Bangor BT19 1NT,
    Name: Property Address, dtype: object

It looks like we are in luck again and the property town is before the postcode, separated on either side by a space. We can't be sure this is always the case though so we should take some precautions.

First select the rows missing the town and that has an address. Filter the property addresses for these values, split each on the space character and take the 4th element from the end in the subsequent list.

```python
rows_to_fix = properties_df["Town"].isnull() & properties_df["Property Address"].notnull()
fixed_towns = properties_df[rows_to_fix]["Property Address"].apply(lambda x: str(x).split(" ")[-4])
fixed_towns.sample(n=7)
```

    551489        Craigavon
    649664    Carrickfergus
    407828      Londonderry
    23771        Ballyclare
    600740        Craigavon
    589701        Craigavon
    24189        Ballyclare
    Name: Property Address, dtype: object

Next we want to check we actually got the right towns so filter the list by checking each value is already a town that appears in the data. Any that don't appear can be replaced with NaN. Finally add the fixed towns to the data!

```python
towns = properties_df["Town"].unique()
right_rows = fixed_towns.isin(towns)
fixed_towns[~right_rows] = np.nan
properties_df.loc[rows_to_fix, 'Town'] = fixed_towns
print("Number of missing towns: " + str(properties_df["Town"].isnull().sum()))
```

    Number of missing towns: 167

Great! Down to 167 from 16,102.

Save to File

Back to top

Save this to file so we don't have to run all this everytime we restart the kernel.

```python
properties_df.to_csv("DomesticPropertyValue 16 row cleaned.csv")
```

[Next Section - Initial Exploration](NI_property_analysis_initial_exploration#title)


text:
# motion-blitz [![Gem Version](https://badge.fury.io/rb/motion-blitz.png)](http://badge.fury.io/rb/motion-blitz) [![Code Climate](https://codeclimate.com/github/dblandin/motion-blitz.png)](https://codeclimate.com/github/dblandin/motion-blitz) [![Analytics](https://d2weczhvl823v0.cloudfront.net/dblandin/motion-blitz/trend.png)](#motion-blitz---)

### blitz (fl•ash), verb

1. Shine in a bright but brief, sudden, or intermittent way
2. Control the display of temporary messages via SVProgressHUD

__motion-blitz__'s initial development was sponsored by [dscout](https://dscout.com). Many thanks to them!

[![Success](https://github.com/dblandin/motion-blitz/blob/master/img/success.png?raw=true)](#blitz-flash-verb)

## Usage

``` ruby
Notifier = Motion::Blitz

Notifier.show
Notifier.show('Hold on!')
Notifier.show(:black)
Notifier.show('Hold on!', :gradient)

Notifier.loading # 'Loading...'
Notifier.loading(:black)

Notifier.progress(0.5)
Notifier.progress(0.8, 'Almost Done!')
Notifier.progress(0.8, :clear)
Notifier.progress(0.8, 'Almost Done!', :black)

Notifier.dismiss

Notifier.success
Notifier.success('All right!')

Notifier.error
Notifier.error('Whoops!')
```

### Masks

``` ruby
:none     # allow user interactions, don't dim background UI (default)
:clear    # disable user interactions, don't dim background UI
:black    # disable user interactions, dim background UI with 50% translucent black
:gradient # disable user interactions, dim background UI with translucent radial gradient (a-la-alertView)
```

## Setup

If you're using Bundler, add this line to your app's Gemfile:

```ruby
gem 'motion-blitz'
```

and then run:

```
$ bundle install
```

Or install it yourself with:

```
$ gem install motion-blitz
```

and require motion-blitz in your Rakefile:

```ruby
require 'rubygems'
require 'motion-blitz'
```

## Dependencies

motion-blitz depends on the SVProgressHUD CocoaPod.

You don't have to add SVProgressHUD to your Rakefile (motion-blitz handles that
dependency for you) but you need to run `$ rake pod:install` to download and
install it.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Thanks

* [Sam Vermette](https://github.com/samvermette) for [SVProgressHUD](https://github.com/samvermette/SVProgressHUD)
* [Parker Selbert](https://github.com/sorentwo) for the [Norweigan-inspired name](https://github.com/dblandin/motion-blitz/blob/master/lib/project/motion-blitz.rb#L2)
* [dscout](https://dscout.com) - for their sponsorship

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: Ruby

gha_license_id: MIT

license_type: permissive


text:
# vinyl-buffer [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/vinyl-buffer&title=vinyl-buffer&description=hughsk/vinyl-buffer%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #

Convert streaming [vinyl](http://github.com/wearefractal/vinyl) files to use
buffers.

An alternative to [gulp-streamify](http://github.com/nfroidure/gulp-streamify)
that you can pipe to, instead of being required to wrap your streams.

``` javascript
var browserify = require('browserify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var uglify = require('gulp-uglify')
var size = require('gulp-size')
var gulp = require('gulp')

gulp.task('build', function() {
  var bundler = browserify('./index.js')

  return bundler.bundle()
    .pipe(source('index.js'))
    .pipe(buffer())
    .pipe(uglify())
    .pipe(size())
    .pipe(gulp.dest('dist/'))
})
```

## Usage ##

[![vinyl-buffer](https://nodei.co/npm/vinyl-buffer.png?mini=true)](https://nodei.co/npm/vinyl-buffer)

### `vinylBuffer()` ###

Creates a transform stream that takes vinyl files as input, and outputs
modified vinyl files as output. If `file.isStream()`, `file.contents` will
be converted to a `Buffer` before being emitted again – otherwise, the file
will be emitted immediately.

## License ##

MIT. See [LICENSE.md](http://github.com/hughsk/vinyl-buffer/blob/master/LICENSE.md) for details.

repository: bensaadmucret/Loki-Plugin

branch_name: refs/heads/main

repo_name: bensaadmucret/Loki-Plugin


text:
# Cenangium populneum (Pers.) Rehm, 1896 SPECIES

#### Status
SYNONYM

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

#### Published in
Discom. 220 (1896)

#### Original name
null

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Sclerotiniaceae/Encoelia/Encoelia fascicularis/ Syn. Cenangium populneum/README.md

repo_name: mdoering/backbone


text:
# libsafet
C++ Safe Template Library

# Building libsafet
This requires installing Catch2 inorder to build. There are a number of package managers that contain catch2. If however, your package manager does not contain Catch2 please see the following steps as this requires version 2 not the most recent version 3 or the older version 1.9 which many linux distrobutions default to when installing via their package managers.

1. git clone git@github.com:catchorg/Catch2.git
2. git checkout v2.13.9
3. cmake -Bbuild -H. -DBUILD_TESTING=OFF
4. sudo cmake --build build/ --target install

Now libsafet should build on your system

1. git clone libsafet repo
2. cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
3. cmake --build build/

repository: kevin-logan/libsafet

repo_name: kevin-logan/libsafet


text:
[Home](./index) > [graph-builder](./graph-builder.md) > [EndpointPair](./graph-builder.endpointpair.md) > [adjacentNode](./graph-builder.endpointpair.adjacentnode.md)

# EndpointPair.adjacentNode method

Returns the node that is adjacent to `node` along the origin edge.

Throws an error if this [EndpointPair](./graph-builder.endpointpair.md) does not contain `node`<!-- -->.

**Signature:**
```javascript
adjacentNode(node: N): N;
```
**Returns:** `N`

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  `node` | `N` |  |

repository: sorohan/graph-builder

repo_name: sorohan/graph-builder


text:
FGTouchIndicator
================

I was in the need of some tutorial like animated touch view, so I made one (really simple, don't panic) and put it up here.

## How do I FGTouchIndicator?
Copy over the two files and `#import` them.
Then you may use the force to

    FGTouchIndicator *touch = [FGTouchIndicator touchIndicatorAnimatedFromPoint:CGPointMake(50, 50)
    toPoint:CGPointMake(300, 300) withDuration:2];
    [self.view addSubview:touch];

So that's that.

## FUUU it's not animating!!!
Oh, you might want to `startAnimating` and `stopAnimating` to handle that, sorry my bad.

## This is crap, I made a way cooler revision
Awesome! Send me a pull request and I will merge it without even looking. Seriously.

repository: finngaida/FGTouchIndicator

repo_name: finngaida/FGTouchIndicator


text:
wicket-bootstrap-example
========================

For This example to work you will need to clone the [wicket-bootstrap](https://github.com/l0rdn1kk0n/wicket-bootstrap) project and compile it using maven.

- git clone https://github.com/l0rdn1kk0n/wicket-bootstrap.git
- navigate to the directory where you cloned the above project
- git checkout bootstrap3 (to get the bootstrap3 branch)
- then in the current directory run mvn clean install

This will install wicket-bootstrap to your local maven repo.

Then do a mvn clean install on the above project and deploy to a container of your choice.
Access the application at http://localhost:8080/wicket-bootstrap-example


text:
---
layout: page
title: About Austin
tags: [about]
date: 2017-01-17
comments: false
---

Austin Roberts is an entrepreneur and technology consultant
based out of Kansas City.
[CV]

## Business

Austin is an entrepreneur, having founded [Note G](https://noteg.io) - a small
consulting company, and [OpenRelay](https://openrelay.xyz) - a company building
technology to facilitate decentralized trading of digitalized assets.

## Technology

I've always had a passion for technology and the ways it can improve people's lives. In my professional career, I have been:

* Server-side web developer
* Front-end web developer
* Development Team Lead
* DevOps lead
* Software Architect
* Blockchain Developer

And I've worked extensively with the following software:

* [Golang](https://golang.org/)
* [Python](https://www.python.org/)
* [Django](https://www.djangoproject.com/)
* JavaScript
* [CoffeeScript](http://coffeescript.org/)
* [AngularJS](https://angularjs.org/)
* [SaltStack](https://saltstack.com/)
* [Jenkins](https://jenkins.io/)
* [Gatling](http://gatling.io/)
* [0x Protocol](https://0xproject.com/)
* [Ethereum](https://ethereum.org/)

And I've had some experience with numerous other technologies.

While my background is primarily in software I also tinker with electronics,
ranging from mobile devices to the Raspberry Pi.

## Education

Personally, I have a Master's Degree in Computer Science. Education was a huge
factor in shaping who I am personally and professionally.

More broadly, I think education is one of the most important things for society
to focus on. Many of the problems facing the world today will only be solved by
well educated people, and I think bringing the best possible education to the
widest possible audience is one of the best ways to accelerate the advancement
of our society.

For a couple of years I worked for Computerized Assessments and Learning,
hoping to combine two of my passions and use technology to help further
education. As CA&L was dissolved and absorbed into its parent company, I
decided to start consulting  to pursue these passions independently.

 Part
of my passion for education stems from wanting to make sure my own children get
a good education, and grow up in a world where education is given a high
priority.

I also work hard to expose my boys to a wide range of technology. They've both
used computers from a very early age, and a while back we even set out to build
a Raspberry Pi driven robot!

## Food

Another major passion of mine is food. Aside from liking to eat good food, I
like to learn how to make a wide variety of food. I've been making [my own pizza](http://scratch.ausiv.com/recipe/pizza/2015/06/26/austins-signature-pizza.html)
for years, and have recently started dabbling in cheese making, including my
first successful traditional cheddar.


text:
# TwitterTweetBlockPreview

This is the preview component for `twitter-tweet-block` blocks. It is used in:
+ The `TwitterTweetBlockModal` (see `@triniti/cms/plugins/blocksmith/components/twitter-tweet-block-modal`)
+ Node preview components (eg the `ArticlePreviewModal`, see `@triniti/cms/plugins/news/components/article-preview-modal`). When used in a preview component, it is retrieved by the `resolver`'s `getPreview` function (see `@triniti/cms/plugins/blocksmith/resolver.js`).

### Required Props
+ `block` - A `twitter-tweet-block` block (uses mixin `triniti:canvas:mixin:twitter-tweet-block`).

### FYI
+ See the [Triniti twitter tweet mixin](https://github.com/triniti/schemas/tree/master/schemas/triniti/canvas/mixin/twitter-tweet-block).
+ See the [Twitter tweet embed docs](https://dev.twitter.com/web/embedded-tweets).

repository: triniti/cms-js

gha_language: JavaScript

repo_name: triniti/cms-js


text:
# Resources & References
* __Tomcat__
  * [The Tomcat Service for Windows - An Simple Guide | MuleSoft](https://www.mulesoft.com/tcat/tomcat-service)
  * [tomcat7 - How to set the context path of a web application in Tomcat 7.0 - Stack Overflow](https://stackoverflow.com/questions/7276989/how-to-set-the-context-path-of-a-web-application-in-tomcat-7-0)
  * [bits and bytes: How to disable session persistence across Tomcat restarts](http://datum-bits.blogspot.com/2012/05/how-to-disable-session-persistence.html)
  * [Starting, Stopping, and Restarting Tomcat - Tomcat: The Definitive Guide, 2nd Edition [Book]](https://www.oreilly.com/library/view/tomcat-the-definitive/9780596101060/ch01s02.html)

* __Eclipse__
  * [Eclipse – How to change web project context root – Mkyong.com](https://www.mkyong.com/eclipse/eclipse-how-to-change-web-project-context-root/)

* __JavaEE__
  * [Setting up role based security in tomcat · The Coders Corner](https://www.thecoderscorner.com/team-blog/hosting-servers/17-setting-up-role-based-security-in-tomcat/)
  * [Learn How to implement filters in a JSP application](https://blog.eduonix.com/java-programming-2/learn-implement-filters-jsp-application/#respond)
  * [java - doFilter called twice, intended behaviour? - Stack Overflow](https://stackoverflow.com/questions/16646819/dofilter-called-twice-intended-behaviour)

* __HTML/CSS/Bootstrap__

* __Javascript/JQuery__
  * [DataTables example - Custom filtering - range search](https://datatables.net/examples/plug-ins/range_filtering.html)

* __Oracle Database__

* __Git__
  * [How to change git account in Git bash? - Stack Overflow](https://stackoverflow.com/questions/41689395/how-to-change-git-account-in-git-bash)

---
###### Script:
```javascript
javascript:console.log(`[${document.title}](${window.location.href})`);
```

repository: duckShooter/adf

repo_name: duckShooter/adf


text:
## psh: the programmer's shell

psh is heavily inspired by the venerable csh, tcsh, and fish shells. It also draws from the programming languages C, Perl, Ruby, and JavaScript (but really only the JSON part of JavaScript).

### Syntax

#### Variables

All variables will be prefixed with `$`. Variables starting with an upper case character are automatically global environmental variables (and all subsequent characters must be an uppercase letter or an underscore).

```shell
$local
$ENV
$PATH

# Variable assignment options
# 1. classical command-style
:set $name "value"
# 2. maybe do something more programmatic (bash-style)
$name = "value"
$PATH = "/usr/local/bin:$PATH" # This is the same as `export $PATH=/usr/local/bin:$PATH` in bash
```

Also, variable scoping *shouldn't* be hard. Let's maybe have 'global' and 'local' keywords to adjust scoping in functions/subroutines/etc.

#### Keywords

Keywords will be prefixed with a colon character to distinguish them from external stuff (files, programs, etc.)

```shell
:if(test -d .)
  echo "It exists!"
:end
```

### Implementation

Need to define an intelligent parsing architecture for handling parsing, hinting, and evaluating input.

repository: dirk/psh

repo_name: dirk/psh


text:
# Tryblidaria octospora (D. Hawksw. & Coppins) Magnes, 1997 SPECIES

#### Status
SYNONYM

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

#### Published in
Biblthca Mycol. 165: 138 (1997)

#### Original name
Triblidium octosporum D. Hawksw. & Coppins, 1973

### Remarks
null

path: /life/Fungi/Ascomycota/Triblidiales/Triblidiaceae/Triblidium/Triblidium octosporum/ Syn. Tryblidaria octospora/README.md


text:
# Todo MVC app

This project is for the 'Learning a New Code Base' Udacity course. The
majority of the code was already written and the object was to go in and
add new features seamlessly in the code.

## Getting Started

First clone or download the repo to your local computer. Then to get the
project up and running for development and testing you will need to
setup gulp.

### Requires
- Node.js
- gulp-cli (installed globally)

### Install
From the command line in the root project folder run:

```$ npm install```

This will install gulp locally with all the necessary modules.

### Running Dev Environment

```$ gulp```

This task spins up a localhost server, and watches all files for changes
. BrowserSync automatically opens the index.html page and refreshes
the site after any changes are saved.

## License
MIT

repository: TodMcChesney/todo-mvc-app

repo_name: TodMcChesney/todo-mvc-app


text:
---
layout: page
title: Zhuo Yao's Project Portfolio Page
---

## Project: SWEe!

SWEe! is a desktop application used for managing CS2103T learning progress mainly through flashcards. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Given below are my contributions to the project.

* **Code contributed**: [RepoSense Link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other&tabOpen=true&tabType=authorship&zFR=false&tabAuthor=tanzhuoyao-nus&tabRepo=AY2021S1-CS2103T-T17-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other)

* **Enhancements implemented**:
  * Refactor AddCommandParserTest and ParserUtilTest classes to support the testing of adding of flashcards
  [#29](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/29)
  * Refactor ListCommand and ListCommandTest classes to list out all the flashcards
  [#39](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/39)
  * Add FilterCommand to filter for flashcards
  [#41](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/41/files) &
  [#97](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/97/files)
    * What it does: Allows the user to filter for flashcards according to category, rating and/or favourites status
    * Justification: This allows the user to toggle through the flashcard deck to display flashcards of specific
    requirements to aid navigability and ease for revision during quiz mode
    * Highlights: I have implemented the "and search" function to allow users to specify more than one filter attribute
    specification
  * Add test cases for FilterCommand under FilterCommandTest
  [#45](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/45)
  * Refactor FindCommand and FindCommandTest classes to support finding of flashcards
  [#57](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/57/files)
  * Add tag feature in flashcards to support up to multiple tags on a flashcard
  [#88](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/88)
  * Refactor LogicManagerTest, FilterCommandTest, FlashcardDeckParserTest,
  ModelManagerTest to ensure remaining test cases fully support the application
  [#110](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/110)

* **Contributions to DG**:
  * Added implementation for `filter` feature along with activity and sequence diagrams [#85](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/85)
  & [#210](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/210)
  * Added instructions for manual testing [#201](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/201)
  * Added terms to glossary [#208](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/208)
  * Minor fixes to formatting of DG

* **Contributions to UG**:
  * Added documentation to `filter` feature [#41](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/41/files) &
  [#103](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/103)
  * Minor fixes to formatting of UG

* **Contributions to team-based tasks**:
  * Maintaining the issue-tracker
  * Refactor remaining test cases to remove instances of AB3 [#110](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/110)
  * Added instructions for manual testing in DG [#201](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/201)

**Review/mentoring contributions**:
  * Reported bugs to other teams: [Issue Tracker](https://github.com/tanzhuoyao-nus/ped/issues)
  * PRs reviewed: [#53](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/53),
  [#101](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/101),
  [#105](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/105),
  [#106](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/106),
  [#109](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/109),
  [#164](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/164),
  [#175](https://github.com/AY2021S1-CS2103T-T17-2/tp/pull/175)

gha_language: Java

gha_license_id: NOASSERTION


text:
This is a MediaWiki extension that simply adds an `atitd` extension type to clearly show ATITD-specific extensions on the `Special:Version` page.

Installation
============

  * Download and place the files in a directory called `ATITDExtensions` in your `extensions/` folder.
  * Add the following code at the bottom of your LocalSettings.php:

```php
wfLoadExtension( 'ATITDExtensions' );
```

  * **Done** — Navigate to `Special:Version` on your wiki to verify that the extension is successfully installed.

license: Unlicense


text:
# fan-ui
Alma Laser's home exercise

Working demo: http://alma-fe.benkol.com/home

**A home exercise I recieved from Alma Laser. The task's description was:**

## General instructions:
- The project should be written as a single page application using ReactJS
- The UI design should be written using HTML and CSS only

## Description:
The project will consist of a web app that displays a file structure consisting of folders and images in a radial menu.

The file structure tree consists of two types of nodes:
- Folders
- Images

(You can assume that only these two types of nodes will exist)

The web app will contain the following two pages: **home** and **picture**.

### Home Page

Route: ‘/home’

The **home** page will display the file structure as a tree of folders and images.

The file tree will be displayed as a radial menu. Each level of the tree represents the content of the selected folder from the previous level, beginning with the root node. The distance of each level from the previous level should be determined by the number of nodes displayed on that level so that all nodes will fit on the page. A folder node should be colored light grey, an expanded folder node should be dark grey and a picture node should be blue.

Initial display will show only the root node (representing the root folder):

- Clicking on a folder node will display the child nodes belonging to that folder.
- Clicking on an image node will move to the picture page (see additional details below).

Child nodes for a specified folder will be retrieved using an API request to the server.

In case an error occurs while retrieving the file structure, an error message will be displayed to the user in the form of a javascript alert dialog.

Refer to the following page design for an example:

### Picture Page

Route: ‘/picture?path=<image_path>’

The **picture** page will show a selected image (the **primary image**) along with a grid of all other images present in the primary image’s parent folder (the **secondary images**).

The primary image’s path should be retrieved from a URL parameter (as specified above).

Clicking on a secondary image will display that image as the primary image and all other images as secondary images (including the old primary image).

If an error occurs while retrieving the primary image, or if no primary image parameter is supplied in the URL, the user will be redirected back to the **home** page.

The secondary images grid should be responsive, with the number of images existing on each row determined by the width of the page (there should be a maximum of 5 images on each row of the grid).

Refer to the following page design for an example:

## API Details:

URL: http://test.devsense.co.il/public/explorePictures

METHOD: GET

Headers:

- X-TOKEN: 2d4e69f4823176197ccf41caa5ee6456

Parameters:

- path: the folder path to load (use value ‘root’ to request the root folder)

Response Codes:

- 401: unauthorized request due to an incorrect or missing X-TOKEN header
- 404: the requested path was not found
- 599: random server error that can be thrown for any request
- 500: unknown server error

Response Data Structure:

- type: the node type (0 = folder, 1 = image)
- label: the node name
- children: the child nodes of the node

Response Example:
```
{
data: {
"type": 0,
"label": "folder0_0",
"children": [
{
"type": 0,
"label": "folder0_0_0"
},
{
"type": 0,
"label": "folder0_0_1"
},
{
"type": 0,
"label": "folder0_0_2"
},
{
"type": 0,
"label": "folder0_0_3"
},
{
"type": 0,
"label": "folder0_0_4"
},
{
"type": 0,
"label": "folder0_0_5"
},
{
"type": 1,
"label": "picture0_0_6",
"url": "http://thecatapi.com/api/images/get?image_id=999"
},
{
"type": 1,
"label": "picture0_0_7",
"url": "http://thecatapi.com/api/images/get?image_id=811"
}
]
}
}
```

repository: benkol/fan-ui

repo_name: benkol/fan-ui


text:
# [Qase TMS](https://qase.io) Robot Framework Listener

[![License](https://lxgaming.github.io/badges/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)

## Installation

```
pip install qase-robotframework
```

## Usage

You must add Qase case IDs to robot framework tests.
They should be added as a tags in form like `Q-<case id without project code>`. Examples:

```robotframework
*** Test Cases ***
Push button
    [Tags]  Q-2
    Push button    1
    Result should be    1

Push multiple buttons
    [Tags]  Q-3
    Push button    1
    Push button    2
    Result should be    12
```

```robotframework

*** Test Cases ***    Expression    Expected
Addition              12 + 2 + 2    16
                      2 + -3        -1
    [Tags]   Q-7

Subtraction           12 - 2 - 2    8
                      2 - -3        5
    [Tags]   Q-8
```

After adding new tags and configuring listener - you could simply use it like this:

```
robot --listener qaseio.robotframework.Listener keyword_driven.robot data_driven.robot
```

## Configuration

Listener supports loading configuration both from environment variables and from `tox.ini` file.

ENV variables:
- `QASE_API_TOKEN` - API token to access Qase TMS
- `QASE_PROJECT` - Project code from Qase TMS
- `QASE_RUN_ID` - Run ID if you want to add results to existing run
- `QASE_RUN_NAME` - Set custom run name when no run ID is provided
- `QASE_DEBUG` - If passed something - will enable debug logging for listener

Usage:
```
QASE_API_TOKEN=<API TOKEN> QASE_PROJECT=PRJCODE robot --listener qaseio.robotframework.Listener keyword_driven.robot data_driven.robot
```

`tox.ini` configuration:

```ini
[qase]
qase_api_token=<API TOKEN>
qase_project=PROJECTCODE
qase_run_id=14
qase_run_name=New Robot Framework Run
qase_debug=True
```

## Working with steps

Listener supports reporting steps results:
![](./docs/steps_results.png)
But in order to use it, you should follow some rules:
- Steps name in Qase TMS should match to the steps in Robot Framework
- If step in RF has some parameters (e.g. Push Button `12`)
parameter would be ignored and the comparison to step in TMS will be made like:
step in TMS should start with step name in RF. So if your step in RF is
`Open page` it will be matched to step `Open page https://qase.io` in TMS.
- You should preserve the order of steps. You can skip steps in RF, but
you shouldn't mix them or so on - Qase does not support creating steps
on the fly yet.

## Contribution

Install project locally:

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e .[testing]
```

Install dev requirements:

```bash
pip install pre-commit
pre-commit install
```

Test project:

```bash
tox
```

repository: mreyhans/qase-python

repo_name: mreyhans/qase-python


text:
## KerimovOleg

This project is a simple browser based implementation of the classic board game, Go, using HTML5 and JavaScript.

Only game logic and some debugging tools were developed, which means pre- and post-game state handling isn't included.

Instructions
------------

To run, launch **index.html** or **lite.html** in your browser.

 * **index.html** is the HTML5 version.
 * **lite.html** is a text based version, which also allows you to configure board size.

Notes
-----

 * The plan was also to keep View related files in subfolders, which was done partially for the Touch view, but never completed.

 * Google Chrome is the only tested browser, although things may work in other browsers as well.


text:
# OnRamp Module for Monte Carlo Methods

## Author
Justin Ragatz

## Date
19 April 2016

## About this software
The code within this directory accompanies the OnRamp for Monte Carlo Methods Module. Please review the full module document before starting the exercises.

## Getting Started
### Compile
    Make
### Run
Sequential version:

    ./<exercise name>_seq

Parallel version:

    ./<exercise name>_omp

### Clean Up
    Make Clean

repository: elise-baumgartner/onramp

repo_name: elise-baumgartner/onramp


text:
# Zignoëlla subcorticalis (Cooke) Sacc. SPECIES

#### Status
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Zignoina subcorticalis Cooke, 1885

### Remarks
null

path: /life/Fungi/Ascomycota/Sordariomycetes/Coniochaetales/Wallrothiella/Wallrothiella subcorticalis/ Syn. Zignoëlla subcorticalis/README.md


text:
---
layout: post
title: How to use Zipping operators in RxJava 3.x
bigimg: /img/image-header/yourself.jpeg
tags: [Reactive Programming]
---

## Table of contents

## Given problem

## Solution with zipping operators

Zipping allows you to take an emitted value from each Observable source and combine them into a single emission. Each Observable can emit a different type, but you can combine these different emitted types into a single emission.

- Observable.zip() factory method

    An emission from one Observable must wait to get paired with an emission from the other Observable. If one Observable calls onComplete() and the other still has emissions waiting to get paired, those emissions will simply be dropped, since they have nothing to be paired with.

    You can pass up to nine Observable instances to the Observable.zip() factory. If you need more than that, you can pass an Iterable<Observable<T>> or use zipArray() to provide an Observable[] array. Note that if one or more sources are producing emissions faster than another, zip() will queue up those rapid emissions as they wait on the slower source to provide emissions. This could cause undesirable performance issues as each source queues in memory. If you only care about zipping the latest emission from each source rather than catching up an entire queue, you will want to use combineLatest().

    Use Observable.zipIterable() to pass a boolean delayError argument to delay errors until all sources terminate and int bufferSize to hint at an expected number of elements from each source for queue size optimization. You may specify the latter to increase performance in certain scenarios by buffering emissions before they are zipped.

## When to use

## Wrapping up

Refer:


text:
# Syagrus weddelliana var. cinerea Becc. VARIETY

#### Status
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
Agric. Colon. 10(2):468, 471. 1916

#### Original name
null

### Remarks
null

path: /life/Plantae/Magnoliophyta/Liliopsida/Arecales/Arecaceae/Lytocaryum/Lytocaryum weddellianum/ Syn. Syagrus weddelliana cinerea/README.md


text:
# The Break-Even Sales Funnel Blueprint and Fundamentals Guide [Video]
This is the code repository for [The Break-Even Sales Funnel Blueprint and Fundamentals Guide [Video]](https://www.packtpub.com/application-development/break-even-sales-funnel-blueprint-and-fundamentals-guide-video), published by [Packt](https://www.packtpub.com/?utm_source=github). It contains all the supporting project files necessary to work through the video course from start to finish.
## About the Video Course
This course will help you set up a profitable funnel that can start to bring in income without the need for a website. You'll be walked through the entire funnel creation process. You'll learn how to build your own funnel without having a website and a converting list and to advertise products super effectively. You'll be taught the fastest and most powerful ways to turn visitors into subscribers. You'll create an email list and integrate it onto your capture pages and learn how to pick the right offers. In short, this course will help you create and optimize a money-magnet Facebook fan page which will automatically turn browsers into buyers.

What You Will Learn

 You'll be able to research any industry or niche to see if it's a valuable opportunity

 Sell your knowledge online

 Set up your first sales funnel

 Learn the exact sales script you should use for your products and up-sells/down-sells

## Instructions and Navigation
### Assumed Knowledge
To fully benefit from the coverage included in this course, you will need:

The book is designed for entrepreneurs, online marketers, offline marketers, and those just getting started in online marketing—in short, anyone looking to market to more people without doing more work will benefit.

### Technical Requirements
This course has the following software requirements:

N/A

## Related Products
* [Sales Funnel Mastery: The Bridge Page Sales Funnel [Video]](https://www.packtpub.com/web-development/sales-funnel-mastery-bridge-page-sales-funnel-video)

* [How to Acquire Your Dream 100 Clients: Sales Funnel Secrets from a Marketing Guru [Video]](https://www2.packtpub.com/application-development/how-acquire-your-dream-100-clients-sales-funnel-secrets-marketing-guru-video)

* [The 7 Phases and 33 Building Blocks of Every Sales Funnel [Video]](https://www.packtpub.com/web-development/7-phases-and-33-building-blocks-every-sales-funnel-video)


text:
# @ContextMenu

create discord context menu options with ease!

Here are some example screenshots:

![](../../../static/img/user-context.jpg)
![](../../../static/img/message-context.jpg)

## Example

```ts
@Discord()
export abstract class contextTest {
  @ContextMenu("MESSAGE", "message context")
  async messageHandler(interaction: ContextMenuInteraction) {
    console.log("I am message");
  }

  @ContextMenu("USER", "user context")
  async userHandler(interaction: ContextMenuInteraction) {
    console.log("I am user");
  }
}
```

## Signature

```ts
ContextMenu(
  type: "USER" | "MESSAGE",
  name?: string,
  params?: ApplicationCommandParams
)
```

## Parameters

### type

Context menu type.

| type            | default | required |
| --------------- | ------- | -------- |
| USER \| MESSAGE |         | Yes      |

### name

| type   | default | required |
| ------ | ------- | -------- |
| string | name    | Yes      |

Name of context menu. Name and handler have the same value currently.

### ApplicationCommandParams

Multiple options, check below.

| type   | default   | required |
| ------ | --------- | -------- |
| object | undefined | No       |

#### `botIds`

Array of bot ids, for which only the event will be executed.

| type      | default |
| --------- | ------- |
| string[ ] | [ ]     |

#### `defaultPermission`

"You can also set a default_permission on your commands if you want them to be disabled by default when your app is added to a new guild. Setting default_permission to false will disallow anyone in a guild from using the command--even Administrators and guild owners--unless a specific overwrite is configured. It will also disable the command from being usable in DMs."

| type    | default |
| ------- | ------- |
| boolean | true    |

#### `Description`

The Slash command description

| type   | default |
| ------ | ------- |
| string | true    |

#### `Guilds`

The guilds where the command is created

| type      | default |
| --------- | ------- |
| string[ ] | [ ]     |


text:
# Paddle2ONNX model transformation and prediction

This chapter describes how the PaddleOCR model is converted into an ONNX model and predicted based on the ONNXRuntime engine.

## 1. Environment preparation

Need to prepare PaddleOCR, Paddle2ONNX model conversion environment, and ONNXRuntime prediction environment

###  PaddleOCR

Clone the PaddleOCR repository, use the release/2.6 branch, and install it.

```
git clone  -b release/2.6 https://github.com/PaddlePaddle/PaddleOCR.git
cd PaddleOCR && python3.7 setup.py install
```

###  Paddle2ONNX

Paddle2ONNX supports converting the PaddlePaddle model format to the ONNX model format. The operator currently supports exporting ONNX Opset 9~11 stably, and some Paddle operators support lower ONNX Opset conversion.
For more details, please refer to [Paddle2ONNX](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/README_en.md)

- install Paddle2ONNX
```
python3.7 -m pip install paddle2onnx
```

- install ONNXRuntime
```
# It is recommended to install version 1.9.0, and the version number can be changed according to the environment
python3.7 -m pip install onnxruntime==1.9.0
```

## 2. Model conversion

- Paddle model download

There are two ways to obtain the Paddle model: Download the prediction model provided by PaddleOCR in [model_list](../../doc/doc_en/models_list_en.md);
Refer to [Model Export Instructions](../../doc/doc_en/inference_en.md#1-convert-training-model-to-inference-model) to convert the trained weights to inference_model.

Take the PP-OCRv3 detection, recognition, and classification model as an example:

```
wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_det_infer.tar
cd ./inference && tar xf en_PP-OCRv3_det_infer.tar && cd ..

wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_infer.tar
cd ./inference && tar xf en_PP-OCRv3_rec_infer.tar && cd ..

wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar
cd ./inference && tar xf ch_ppocr_mobile_v2.0_cls_infer.tar && cd ..
```

- convert model

Convert Paddle inference model to ONNX model format using Paddle2ONNX:

```
paddle2onnx --model_dir ./inference/en_PP-OCRv3_det_infer \
--model_filename inference.pdmodel \
--params_filename inference.pdiparams \
--save_file ./inference/det_onnx/model.onnx \
--opset_version 10 \
--input_shape_dict="{'x':[-1,3,-1,-1]}" \
--enable_onnx_checker True

paddle2onnx --model_dir ./inference/en_PP-OCRv3_rec_infer \
--model_filename inference.pdmodel \
--params_filename inference.pdiparams \
--save_file ./inference/rec_onnx/model.onnx \
--opset_version 10 \
--input_shape_dict="{'x':[-1,3,-1,-1]}" \
--enable_onnx_checker True

paddle2onnx --model_dir ./inference/ch_ppocr_mobile_v2.0_cls_infer \
--model_filename ch_ppocr_mobile_v2.0_cls_infer/inference.pdmodel \
--params_filename ch_ppocr_mobile_v2.0_cls_infer/inference.pdiparams \
--save_file ./inferencecls_onnx/model.onnx \
--opset_version 10 \
--input_shape_dict="{'x':[-1,3,-1,-1]}" \
--enable_onnx_checker True
```
After execution, the ONNX model will be saved in `./inference/det_onnx/`, `./inference/rec_onnx/`, `./inference/cls_onnx/` paths respectively

* Note: For the OCR model, the conversion process must be in the form of dynamic shape, that is, add the option --input_shape_dict="{'x': [-1, 3, -1, -1]}", otherwise the prediction result may be the same as Predicting directly with Paddle is slightly different.
  In addition, the following models do not currently support conversion to ONNX models:
  NRTR, SAR, RARE, SRN

## 3. prediction

Take the English OCR model as an example, use **ONNXRuntime** to predict and execute the following commands:

```
python3.7 tools/infer/predict_system.py --use_gpu=False --use_onnx=True \
--det_model_dir=./inference/det_onnx/model.onnx  \
--rec_model_dir=./inference/rec_onnx/model.onnx  \
--cls_model_dir=./inference/cls_onnx/model.onnx  \
--image_dir=doc/imgs_en/img_12.jpg \
--rec_char_dict_path=ppocr/utils/en_dict.txt
```

Taking the English OCR model as an example, use **Paddle Inference** to predict and execute the following commands:

```
python3.7 tools/infer/predict_system.py --use_gpu=False \
--cls_model_dir=./inference/ch_ppocr_mobile_v2.0_cls_infer \
--rec_model_dir=./inference/en_PP-OCRv3_rec_infer \
--det_model_dir=./inference/en_PP-OCRv3_det_infer \
--image_dir=doc/imgs_en/img_12.jpg \
--rec_char_dict_path=ppocr/utils/en_dict.txt
```

After executing the command, the predicted identification information will be printed out in the terminal, and the visualization results will be saved under `./inference_results/`.

ONNXRuntime result：

Paddle Inference result：

Using ONNXRuntime to predict, terminal output:
```
[2022/10/10 12:06:28] ppocr DEBUG: dt_boxes num : 11, elapse : 0.3568880558013916
[2022/10/10 12:06:31] ppocr DEBUG: rec_res num  : 11, elapse : 2.6445000171661377
[2022/10/10 12:06:31] ppocr DEBUG: 0  Predict time of doc/imgs_en/img_12.jpg: 3.021s
[2022/10/10 12:06:31] ppocr DEBUG: ACKNOWLEDGEMENTS, 0.997
[2022/10/10 12:06:31] ppocr DEBUG: We would like to thank all the designers and, 0.976
[2022/10/10 12:06:31] ppocr DEBUG: contributors who have been involved in the, 0.979
[2022/10/10 12:06:31] ppocr DEBUG: production of this book; their contributions, 0.989
[2022/10/10 12:06:31] ppocr DEBUG: have been indispensable to its creation. We, 0.956
[2022/10/10 12:06:31] ppocr DEBUG: would also like to express our gratitude to all, 0.991
[2022/10/10 12:06:31] ppocr DEBUG: the producers for their invaluable opinions, 0.978
[2022/10/10 12:06:31] ppocr DEBUG: and assistance throughout this project. And to, 0.988
[2022/10/10 12:06:31] ppocr DEBUG: the many others whose names are not credited, 0.958
[2022/10/10 12:06:31] ppocr DEBUG: but have made specific input in this book, we, 0.970
[2022/10/10 12:06:31] ppocr DEBUG: thank you for your continuous support., 0.998
[2022/10/10 12:06:31] ppocr DEBUG: The visualized image saved in ./inference_results/img_12.jpg
[2022/10/10 12:06:31] ppocr INFO: The predict total time is 3.2482550144195557
```

Using Paddle Inference to predict, terminal output:

```
[2022/10/10 12:06:28] ppocr DEBUG: dt_boxes num : 11, elapse : 0.3568880558013916
[2022/10/10 12:06:31] ppocr DEBUG: rec_res num  : 11, elapse : 2.6445000171661377
[2022/10/10 12:06:31] ppocr DEBUG: 0  Predict time of doc/imgs_en/img_12.jpg: 3.021s
[2022/10/10 12:06:31] ppocr DEBUG: ACKNOWLEDGEMENTS, 0.997
[2022/10/10 12:06:31] ppocr DEBUG: We would like to thank all the designers and, 0.976
[2022/10/10 12:06:31] ppocr DEBUG: contributors who have been involved in the, 0.979
[2022/10/10 12:06:31] ppocr DEBUG: production of this book; their contributions, 0.989
[2022/10/10 12:06:31] ppocr DEBUG: have been indispensable to its creation. We, 0.956
[2022/10/10 12:06:31] ppocr DEBUG: would also like to express our gratitude to all, 0.991
[2022/10/10 12:06:31] ppocr DEBUG: the producers for their invaluable opinions, 0.978
[2022/10/10 12:06:31] ppocr DEBUG: and assistance throughout this project. And to, 0.988
[2022/10/10 12:06:31] ppocr DEBUG: the many others whose names are not credited, 0.958
[2022/10/10 12:06:31] ppocr DEBUG: but have made specific input in this book, we, 0.970
[2022/10/10 12:06:31] ppocr DEBUG: thank you for your continuous support., 0.998
[2022/10/10 12:06:31] ppocr DEBUG: The visualized image saved in ./inference_results/img_12.jpg
[2022/10/10 12:06:31] ppocr INFO: The predict total time is 3.2482550144195557
```

repository: PaddlePaddle/PaddleOCR

gha_language: Python

repo_name: PaddlePaddle/PaddleOCR


text:
# Get Started with Webchat Plugins

Cognigy Webchat Plugins are built on top of [React](https://reactjs.org).
If you are unfamiliar with `React` or the `jsx` file format, i would recommend taking the Tutorial on their site first.

## Setting up your development environment
Since we are using React, we need a bit of setup before coding.
The easiest way is to use a bundler called [parcel](https://parceljs.org).

> If your parcel installation is slow, make sure to update to the newest NPM version

- `npm init`
- `npm i -D parcel`
- `npm i react`

Open your `package.json` file and add a new "build" job at the "scripts" field:
```json
{
    ...,
    "scripts": {
        ...,
        "build": "parcel build --out-file webchat-plugin.js src/index.jsx"
    },
    "alias": {
        "react": "./alias/react"
    }
    ...
}
```

- create a folder called `alias`
- in this new folder, create a file called `react.js`
- insert the following code in it:

```js
if (!window.__COGNIGY_WEBCHAT)
    throw new Error('Cognigy Webchat v2.7 or higher has to be loaded before this plugin');

module.exports = window.__COGNIGY_WEBCHAT.React;
```
- this configuration will make the webchat plugin use the webchat's built-in react version
- create src/index.jsx

## Define a Message Component
In the first step, we will create a React Component that will be used to render a message.
Via its `props`, it will get a `message` property representing the content of the message we want to render.
Inside that `message` object, we have a `text` property containing the raw text of the message.
We will return a `<span>` with red font color containing the `text` value of the message.
```jsx
// src/index.jsx

import * as React from 'react'

const RedText = (props) => {
    const text = props.message.text

    return (
        <span style={{ color: 'red' }}>
            {text}
        </span>
    )
}
```

## Create a Plugin Object
Now that we have our Message Component, it's time to use it in a plugin definition.
A Message Plugin definition is an object that must contain a `match` and a `component` value.
The `match` value is used to decide for which messages this plugin should be used, and the `component` value tells the webchat what Message Component to use with this plugin.
```jsx
// src/index.jsx (continued)

const redTextPlugin = {
    match: 'red-text',
    component: RedText
}
```

Setting `match` to `'red-text'` means that this plugin will match if a message has `data` that is set up like this:
```json
{
  "_plugin": {
    "type": "red-text"
  }
}
```

## Register the Plugin
In order to cause the plugin to be recognized by the webchat, it needs to be put at a specific location in the `window` object.
At that location, we have a list of webchat plugins where we want to append out plugin.
Because our plugin might be registered first, it may be that the list does not exist yet, so we have to make sure to create it if it does not exist yet.
```jsx
// src/index.jsx (continued)

// create if it does not exist yet
if (!window.cognigyWebchatMessagePlugins) {
    window.cognigyWebchatMessagePlugins = []
}

window.cognigyWebchatMessagePlugins.push(redTextPlugin);
```

## Intermediate Recap
By now, our plugin code should contain
- a Message Component
- a Plugin definition
- a 'registration' of our plugin definition

```jsx
import * as React from 'react'

const RedText = (props) => {
    const text = props.message.text

    return (
        <span style={{ color: 'red' }}>
            {text}
        </span>
    )
}

const redTextPlugin = {
    match: 'red-text',
    component: RedText
}

if (!window.cognigyWebchatMessagePlugins) {
    window.cognigyWebchatMessagePlugins = []
}

window.cognigyWebchatMessagePlugins.push(redTextPlugin);
```

## Building the Plugin
Now that we have our complete plugin code ready, we can go on and build it by running `npm run build` in the command line within the plugin folder. It should create a `webchat-plugin.js` file.
Load that file into a website before calling `initWebchat` and you are set!


text:
# how to
## Composer installation
### install
```
brew install composer
```
### check version
```
composer -V
```
## launch php builtin web server
Run the following command in the project root.
```
php -S localhost:8001
```
※The port number can be any value.

## site access
```
http://localhost:8001/
```

repository: tomatomato-work/hello-smarty

repo_name: tomatomato-work/hello-smarty


text:
# Running the tests from the command line

You can run the unit tests from the command line by entering

    rake test

in the *top level* directory of the distribution. This, however,
requires that you have installed ruby and rake (`gem install rake`).

# Running the unit tests directly from your brower

Open the file `run_unit_tests.html` in your browser. You can choose
which test to run in the left frame. The test results will appear in
the right frame.

# Creating new tests

You can use the file `_test_tmpl.html` as a basis for you new tests.