text:
# Classification of Cuisines using Recipe Ingredients - Milestone Report

### Table of Contents:
1. [Introduction](#Introduction)
2. [Data Acquisition/Cleaning](#Data)
3. [Data Exploration](#EDA)
4. [Initial Findings](#Findings)
5. [Next Steps](#Next_steps)
6. [Resources](#Resources)

## 1. Introduction

Problem: Food is a massive and complex arena in which culture, geography, climate, and social factors combine to create unique cuisines around the world. With the age of the internet, millions of recipes are now shared instantly and easily accessible. Many ingredients previously specific to certain regions of the world are now also widely available due to online commerce.

**Objectives**

With this dataset, provided by Yummly, I aim to answer the following questions:

1. **What are the ingredients uniquely used or combined that make up the “signatures” of particular cuisines?**
2. **Can we learn more about the origins of cuisine by analyzing their ingredients to provide insights into the cultures and regions from which they originate?**

**Client**

The client for this project would be a recipe-hosting website, such as Yummly. Being able to intelligently group recipes into cuisine categories could improve new recipe discovery and engagement for their users. Some applications of a model that can group cuisines include recommendation of a cuisine based on available ingredients, or suggested pairings of spices and or other ingredients based on ingredients that are frequently used together.

**Broader Impact**

Beyond directly providing the capability to categorize cuisines based on their ingredients, analysis of this data can provide valuable insight into the evolution of cuisines. If it can be coupled with feedback from a community, such as from users that use and rate the recipe quality on Yummly, it has the potential to be used to create new recipes that intelligently combine ingredients to produce suggestions for promising yet unexplored recipes.

## 2. Data Acquisition/Cleaning

#### Objectives

1. Load the data and extract general info and structure
2. Deal with outlier values in recipe ingredients
3. Export cleaned version of dataset for further exploration and analysis

### 2.1 Load Original Dataset

The dataset that I am working with can be found in the "data" folder of this repository (filename is train.json), or from its origin at the site for [Kaggle's "What's Cooking?" Competition](https://www.kaggle.com/c/whats-cooking).

To start, the dataset was loaded from a json file into a dataframe so that it could be viewed and modified as needed. Below is the information on the original dataset.

```python
data.info()
```

    <class 'pandas.core.frame.DataFrame'>
    RangeIndex: 39774 entries, 0 to 39773
    Data columns (total 3 columns):
    cuisine        39774 non-null object
    id             39774 non-null int64
    ingredients    39774 non-null object
    dtypes: int64(1), object(2)
    memory usage: 932.3+ KB

```python
# Count how many duplicate rows appear in the dataset
data.duplicated(subset='id').sum()
```

    0

We can see that the data is relatively clean with no apparent null entries, and apparently free of duplicate entries. We can now check what each entry of the data looks like.

```python
# Preview first few rows of data
data.head(10)
```

      cuisine
      id
      ingredients

      0
      greek
      10259
      [romaine lettuce, black olives, grape tomatoes...

      1
      southern_us
      25693
      [plain flour, ground pepper, salt, tomatoes, g...

      2
      filipino
      20130
      [eggs, pepper, salt, mayonaise, cooking oil, g...

      3
      indian
      22213
      [water, vegetable oil, wheat, salt]

      4
      indian
      13162
      [black pepper, shallots, cornflour, cayenne pe...

      5
      jamaican
      6602
      [plain flour, sugar, butter, eggs, fresh ginge...

      6
      spanish
      42779
      [olive oil, salt, medium shrimp, pepper, garli...

      7
      italian
      3735
      [sugar, pistachio nuts, white almond bark, flo...

      8
      mexican
      16903
      [olive oil, purple onion, fresh pineapple, por...

      9
      italian
      12734
      [chopped tomatoes, fresh basil, garlic, extra-...

There are three columns presented above:

**cuisine** - indicates the category of cuisine for a particular recipe
**id** - unique recipe ID number
**ingredients** - contains a list of ingredients for the respective entry

The main columns of interest here are the cuisine and ingredients categories. To begin, we should inspect the contents of each. Below is a list of all cuisine categories that appear in the dataset.

    Cuisine Categories in the dataset (by occurence):
    italian         7838
    mexican         6438
    southern_us     4320
    indian          3003
    chinese         2673
    french          2646
    cajun_creole    1546
    thai            1539
    japanese        1423
    greek           1175
    spanish          989
    korean           830
    vietnamese       825
    moroccan         821
    british          804
    filipino         755
    irish            667
    jamaican         526
    russian          489
    brazilian        467
    Name: cuisine, dtype: int64

    There are 20 cuisine categories represented in this dataset.

![png](images/mr_output_8_1.png)

We can see that some categories, such as Italian and Mexican Cuisines occupy much larger fractions of the data, but overall there aren't any cuisines with overly small amounts of recipes represented here.

Next we will take a look at the ingredient details. First, we will look at the statistics of overall length of the ingredients list for each entry.

    count    39774.000000
    mean        10.767713
    std          4.428978
    min          1.000000
    25%          8.000000
    50%         10.000000
    75%         13.000000
    max         65.000000
    dtype: float64

     Median Value: 10.0

![png](images/mr_output_10_1.png)

There is quite a large variation in the number of ingredients per recipe, with a maximum of 65 in this dataset. The average tends to be about 10 ingredients per recipe. Surprisingly, there are recipes with only 1 ingredient! We can see the ingredients for these below.

    japanese ['sushi rice']
    vietnamese ['dried rice noodles']
    indian ['plain low-fat yogurt']
    indian ['unsalted butter']
    japanese ['udon']
    thai ['sticky rice']
    indian ['butter']
    mexican ['corn tortillas']
    thai ['grained']
    southern_us ['lemonade concentrate']
    thai ['jasmine rice']
    indian ['unsalted butter']
    italian ['cherry tomatoes']
    french ['butter']
    indian ['cumin seed']
    french ['haricots verts']
    mexican ['vegetable oil']
    spanish ['spanish chorizo']
    spanish ['sweetened condensed milk']
    japanese ['water']
    greek ['phyllo']
    indian ['unsalted butter']

Now we can look at some more details of the ingredients we are working with. We will look at the total list of all ingredients in the data.

    Number of unique ingredients in the dataset: 6714
    Number of total ingredients in the dataset: 428275

    Ingredients ranked by occurence in the data:
    salt                                          18049
    onions                                         7972
    olive oil                                      7972
    water                                          7457
    garlic                                         7380
    sugar                                          6434
    garlic cloves                                  6237
    butter                                         4848
    ground black pepper                            4785
    all-purpose flour                              4632
    pepper                                         4438
    vegetable oil                                  4385
    eggs                                           3388
    soy sauce                                      3296
    kosher salt                                    3113
    green onions                                   3078
    tomatoes                                       3058
    large eggs                                     2948
    carrots                                        2814
    unsalted butter                                2782
    ground cumin                                   2747
    extra-virgin olive oil                         2747
    black pepper                                   2627
    milk                                           2263
    chili powder                                   2036
    oil                                            1970
    red bell pepper                                1939
    purple onion                                   1896
    scallions                                      1891
    grated parmesan cheese                         1886

![png](images/mr_output_15_0.png)

We can see that while salt is almost ubiquitous, less than half of our ingredients show up more than a few times each. This will need to be addressed, since it may make building a predictive model very difficult. One reason for this is that many similar ingredients have many variants, as is shown below for ingredients containing "Turkey".

    turkey breast steaks: 1
    turkey salami: 1
    turkey ham: 1
    sliced turkey: 6
    lean ground turkey: 26
    rich turkey stock: 1
    hot italian turkey sausage: 2
    boneless turkey breast: 3
    ground turkey sausage: 1
    turkey tenderloins: 11
    smoked turkey breast: 5
    turkey carcass: 2
    turkey burger: 1
    low fat mild Italian turkey sausage: 1
    Italian turkey sausage: 54
    turkey sausage links: 3
    turkey meatballs: 1
    turkey kielbasa: 18
    turkey gravy: 1
    sweet turkey sausage: 1
    whole turkey: 1
    turkey giblet stock: 1
    turkey thigh: 2
    ground turkey breast: 39
    smoked turkey: 16
    ground turkey: 168
    cooked turkey: 48
    Italian turkey sausage links: 2
    turkey breast deli meat: 2
    roast turkey: 10
    turkey: 62
    dark turkey meat: 1
    turkey sausage: 15
    turkey hot dogs: 1
    smoked turkey drumstick: 1
    turkey breast tenderloins: 2
    fat free ground turkey breast: 1
    turkey mince: 1
    turkey legs: 9
    seasoned ground turkey: 1
    low-fat turkey kielbasa: 1
    turkey stock: 9
    turkey bacon: 12
    boneless skinless turkey breasts: 1
    turkey breast cutlets: 10
    hot italian turkey sausage links: 4
    turkey broth: 6
    smoked turkey sausage: 13
    turkey breast: 25
    turkey breakfast sausage: 4
    turkey meat: 15
    andouille turkey sausages: 2
    skinless boneless turkey breast halves: 1
    Number of Turkey variations: 53
    Total times ingredients with Turkey were used: 626

We can see that although turkey appears more than 600 times in the dataset, there are over 50 variants of turkey in the ingredient set, and most are only present a few times. In addition, we cannot simply set all variants to be labeled as "Turkey" since some, such as turkey stock are only flavorings and do not include any of the original turkey meat.

In order to deal with these variants, several (or many) steps will need to be taken.

### 2.2. Dealing with outliers (the messy part)

The next section will be a bit messy with many iterations in place to converge on a final set of ingredients. Hopefully my explanations will make a clear throughline to follow.

* First, I will take each ingredient from our ingredient_rankings (which is an ordered form of our unique ingredients set) and extract only the nouns. This means that 'chopped ingredient', 'fresh ingredient', 'baked ingredient' etc. will be converted to 'ingredient'.

* Next, I take only the singular form of each ingredient, so that there aren't unnecessary duplicates (e.g. 'onions' and 'onion')

Note: some words don't play nicely with NLTK's database of vocabulary (such as 'garlic', which tends to be classified as an adjective. e.g. 'garlic cloves' is simplified as 'clove') so I will include two lists of words for this process that will be updated throughout this section. They are **'words_to_exclude'** for words I do not want in my final list, and **'words_to_include'** for words that I do not want filtered out.

* Next, there are some ingredients in our dataset are either misspelled or incomplete in some way (e.g. 'any', 'extra', 'asian') we can deal with misspellings later, but first, we should make sure that some of the words that are falling through the cracks do not, such as 'flour', 'couscous', 'pudding', etc.

After these processing steps, the data has been transformed to what is shown below:

          original ingredients     simplified
    0                     salt           salt
    1                   onions          onion
    2                olive oil      olive oil
    3                    water          water
    4                   garlic         garlic
    5                    sugar          sugar
    6            garlic cloves   garlic clove
    7                   butter         butter
    8      ground black pepper         pepper
    9        all-purpose flour          flour
    10                  pepper         pepper
    11           vegetable oil  vegetable oil
    12                    eggs            egg
    13               soy sauce      soy sauce
    14             kosher salt           salt
    15            green onions          onion
    16                tomatoes         tomato
    17              large eggs            egg
    18                 carrots         carrot
    19         unsalted butter         butter
    20            ground cumin          cumin
    21  extra-virgin olive oil      olive oil
    22            black pepper         pepper
    23                    milk           milk
    24            chili powder   chili powder
    25                     oil            oil
    26         red bell pepper    bell pepper
    27            purple onion          onion
    28               scallions       scallion
    29  grated parmesan cheese         cheese

    After 1st Step: Unique ingredients reduced from 6714 to 4446

Ok! So after these processing steps we've dropped about 2,200 ingredients (1/3 of our original set!), but there is still a long way to go.

* Next, we check to see if there are any spelling errors causing variations in our ingredient set.

For this step, we have several sources of misspelled words. There are words originating from other languages such as *'edamame'* and *'arborio'*.

We also have some words that are brand-related, such as *'lipton'*, *'smithfield'* and *'knorr'*.

Finally, in addition to the normal misspellings (e.g. *cheesi* instead of cheese or cheesy) there are many misspelling entries that have special characters, such as *'johnsonvilleâ®'* and *'crã¨me fraã®che'*. These are the easiest to deal with since we can simply remove all words that are not strictly composed of alphabetic characters.

The following steps were taken to deal with misspelled words:

1. the words with non-alphabetic characters have been removed
2. remove the brand-related words by adding them into the 'words_to_exclude' list
3. check the misspelled words left, along with their frequency in the list of ingredients

The number of misspelled ingredients remaining are shown below:

    Number of total misspellings occuring in simple_ingredients4: 701
    misspell_errors list exported to .txt file!

There are a lot of entries in the misspelled ingredients. This presents a dilemma, since it's too long to go through by hand, and the strange nature of of many of the words not being strictly English makes them difficult to be interpreted correctly by a local spell-checker. No worries, Google's spell checker to the rescue! The workflow for this step is going to require some manual labor (until I find a way to do this within the script). The steps are as follows:

1. Export the list of misspellings to a txt file (completed above)
2. Import the list into a google doc manually
3. Use google doc spell checker to quickly run through and make corrections where possible
4. Export google doc as .txt file in the data folder ('data/misspells_corrected.txt')
5. Import .txt file into list and create a dictionary of misspelled words to corrected versions for quick replacement

Using Google's spell check, I was able to complete these steps in less than 5 minutes total, which is in my opinion an superb return on time efficiency for around 700 entries in multiple languages. Now we can replace the misspelled entries with the corrected versions using the dictionary that has been built.

Now that we have run through quite a few of our options in removing errors and combining ingredients via several methods, we see that we still have about 4,000 ingredients in our list (60% of our original ingredients!). But which of these are useful to our analysis? Next I remove outliers in the dataset for ingredients that only appear a few times within the ~40k recipes.

    Number of unique ingredients in simplified dataset: 4068
    Number of unique ingredient words: 2081

Although we still have about 4,000 ingredients in our dataset, we can see that only 2,000 ingredient words appear in the data. Additionally, we can compare the distribution of ingredients before and after our processing of the data.

![png](images/mr_output_26_0.png)

    Top 10 most common original ingredients:
    salt                   18049
    onions                  7972
    olive oil               7972
    water                   7457
    garlic                  7380
    sugar                   6434
    garlic cloves           6237
    butter                  4848
    ground black pepper     4785
    all-purpose flour       4632
    pepper                  4438
    vegetable oil           4385
    eggs                    3388
    soy sauce               3296
    kosher salt             3113
    green onions            3078
    tomatoes                3058
    large eggs              2948
    carrots                 2814
    unsalted butter         2782
    dtype: int64

    Top 20 most common ingredients (simplified):
    salt             21122
    pepper           17106
    onion            16700
    olive oil        10625
    garlic            9451
    water             8716
    sugar             8629
    butter            7927
    egg               7186
    garlic clove      7076
    flour             6902
    tomato            6477
    ginger            4680
    soy sauce         4470
    vegetable oil     4385
    milk              4029
    cheese            3939
    cumin             3678
    bell pepper       3505
    carrot            3126
    dtype: int64

    Number of ingredients that appear more than 40 times (0.1% of entries in data): 733
    Number of words that appear more than 40 times (0.1% of entries in data): 610

Now that the ingredients have been simplified and consolidated, we can see that the number of ingredients that appear in more than 0.1% of data entries (40 times) is about 700, while the number of words that appear above the same threshold is about 600. We can now move to creating a dataset that holds only these ingredients for export.

This dataset will be what is used for exploration and analysis, and has the following 4 columns:

**id** - the unique identification number for each recipe
**cuisine** - the category label of the recipe cuisine
**ingredients** - a simplified list of ingredients, processed by the steps above (with outliers removed)
**words** - a list of unique words that appear in the ingredients list (with outliers removed)

Additionally, since come of the ingredients lists may have been emptied if they only contained non-noun words or symbols, we must removed these rows before exporting our dataset.

    Number of rows dropped from dataset: 17

Only 17 rows needed to be removed from the dataset, and now it is ready for export. The new dataset will be exported as **data_clean.pkl** to the data folder.

```python
# Set the index of the dataset to be the 'id' column of the dataframe
data_clean = data_clean.set_index('id')
data_clean.info()
```

    <class 'pandas.core.frame.DataFrame'>
    Int64Index: 39757 entries, 10259 to 2362
    Data columns (total 3 columns):
    cuisine        39757 non-null object
    ingredients    39757 non-null object
    words          39757 non-null object
    dtypes: object(3)
    memory usage: 1.2+ MB

## 3. Data Exploration

```python
# Load the cleaned dataset from the data folder
data = pd.read_pickle('data/data_clean.pkl')

# Preview the first few rows
data.head()
```

      cuisine
      ingredients
      words

      id

      10259
      greek
      [feta cheese crumbles, olive, grape tomato, on...
      [pepper, crumbles, olive, lettuce, tomato, rom...

      25693
      southern_us
      [corn meal, milk, thyme, flour, salt, tomato, ...
      [meal, milk, thyme, vegetable, flour, salt, to...

      20130
      filipino
      [garlic powder, salt, cooking oil, onion, chic...
      [mayonnaise, powder, soy, salt, onion, chicken...

      22213
      indian
      [water, salt, vegetable oil]
      [wheat, vegetable, salt, water, oil]

      13162
      indian
      [milk, bay leaf, shallot, chili powder, garlic...
      [leaf, masala, onion, garam, cayenne, yogurt, ...

The **ingredients** column provides a list of ingredients, while the **words** column provides us with a unique set of words found in each respective ingredients list. We will use both columns for analysis.

### 1. What are the most frequently used ingredients in each cuisine?

We can get an idea of the ingredients used in each cuisine by splitting ingredients and words by categories.

```python
cuisines[1].head()
```

      cuisine
      ingredients
      words

      id

      16903
      mexican
      [pepper, jalapeno pepper, corn tortilla, salt,...
      [cilantro, tortilla, fresh, poblano, olive, ch...

      41995
      mexican
      [cilantro, coriander, chili powder, cinnamon, ...
      [cilantro, powder, coriander, flank, olive, ch...

      40523
      mexican
      [cilantro, salt, rom tomato, lime, onion, jala...
      [cilantro, pepper, salt, tomato, lime, onion, ...

      1299
      mexican
      [cheese, flour tortilla, egg]
      [tortilla, flour, sausage, cheese, egg]

      10276
      mexican
      [garlic powder, chili powder, sea salt, cumin,...
      [powder, sea, chili, salt, cumin, onion, papri...

We will use a collection of wordclouds since: 1) They are a pretty good way to visualize the most common ingredients found in any subset of our data, and 2) They are really fun.

Below is a preview of the collection of wordclouds generated from their respective ingredients lists.

![png](images/mr_output_40_0.png)

![png](images/mr_output_41_0.png)

![png](images/mr_output_41_1.png)

![png](images/mr_output_41_2.png)

![png](images/mr_output_41_3.png)

There are a few things we can see by looking briefly through the wordclouds above. Firstly, ingredients like salt and onions seem to be ubiquitous, represented in every cuisine of our dataset. Alternatively, there are some clearly unique ingredients widely used in some cuisines, such as cumin in Mexican recipes. These standouts may definitely help us to build a model of cuisine prediction later on, if they can be weighted more importantly than those which appear in all cuisines.

We can also see rankings of the average lengths of ingredients lists for each cuisine to get an idea of which cuisines enjoy more complex dishes than others.

![png](images/mr_output_43_0.png)

It looks like cuisines like Moroccan, Indian and Thai use the most ingredients per recipe, while British, Irish and Brazilian cuisines have slightly simpler recipe lists.

It may also be useful to see which cuisines use the widest variety of ingredients to get an idea of the breadth of ingredients or flavors that make up each cuisine.

![png](images/mr_output_45_0.png)

We can see that although Moroccan, Indian and Thai lead with the most ingredients per recipe, the kitchens of Mexican, Italian and Southern U.S. cuisines are stocked with a larger variety of ingredients in our dataset. In all cases, Brazilian cuisine tends to be a simpler affair.

### Preparing data for Vectorization (TF-IDF weighted Processing)

While the visualizations above are nice, ubiquitous ingredients such as onion, salt, and garlic tend to obscure the ingredients unique to each cuisine. In order to account for this distribution and extract the ingredients that form a "signature" of each cuisine, we will use TF-IDF weighting which will give higher importanct to words which mainly appear in their respective category, and not across many cuisines.

Before we can proceed to apply this weighting to our cuisine ingredient lists, the ingredient lists for recipes of each cuisine will be normalized to be approximately the same length to adjust for cuisines that have a wide difference in the number of recipes represented. We will choose a random sample set of 20,000 ingredients for each cuisine for our analysis (the mean ingredients for all recipes is ~10, so this approximates about 2,000 recipes each).

![png](images/mr_output_47_0.png)

The plots above show us a much better representation of which ingredients form the unique signature of each cuisine. We can also use this grouping to see how similar cuisines are, as shown below.

![png](images/mr_output_49_0.png)

Great! Although we've input nothing beyond labels and recipe ingredients, we can see that the visualization has naturally grouped together cuisines that are similar! Geography seems to play a role, since many Eastern and Western countries are grouped closely, and we can see the cuisines that best bridge the gap between these two, such as Filipino and Indian cuisines!

Now that we seem to have isolated the valuable data, we can return to our wordclouds and generate wordclouds that accurately depict the signature ingredients of each cuisine.

![png](images/mr_output_51_0.png)
![png](images/mr_output_51_1.png)
![png](images/mr_output_51_2.png)
![png](images/mr_output_51_3.png)
![png](images/mr_output_51_4.png)
![png](images/mr_output_51_5.png)
![png](images/mr_output_51_6.png)
![png](images/mr_output_51_7.png)
![png](images/mr_output_51_8.png)
![png](images/mr_output_51_9.png)
![png](images/mr_output_51_10.png)
![png](images/mr_output_51_11.png)
![png](images/mr_output_51_12.png)
![png](images/mr_output_51_13.png)
![png](images/mr_output_51_14.png)
![png](images/mr_output_51_15.png)
![png](images/mr_output_51_16.png)
![png](images/mr_output_51_17.png)
![png](images/mr_output_51_18.png)
![png](images/mr_output_51_19.png)

### TF-IDF for each recipe

Now that we have looked at ingredients grouped together by their cuisine, we can perform a similar representation and visualization by processing each recipe individually into a TF-IDF weighted format.

    <39757x720 sparse matrix of type '<class 'numpy.float64'>'
    	with 267634 stored elements in Compressed Sparse Row format>

This time, instead of just projecting the data onto 2 dimensions, we will compress the data onto about 100 dimensions and then feed that into a t-SNE algorithm. This algorithm will plot the data onto a 2-dimensional space that we can try to use to visualize if cuisine recipes can be grouped together without explicit labelling.

![png](images/mr_output_55_0.png)

We can see above that there are some nice groupings for most of the data above! The algorithm has done a good job representing each individual recipe with its associated cuisine. There is still room for improvement here though, since several of the cuisines with less entries such as British, Irish, Russian, etc. Are still quite spread out.

There are two corrections we can make to attempt to fix this. First, the distribution of recipes should be equalized, so that each cuisine is represented an approximately equal amount. Second, This model still includes ubiquitous ingredients such as Salt, Onion, Garlic, etc.! These entries should be excluded, similar to the previous work that was done during building of the tf-idf model. Making these corrections are likely to improve the groupings of recipes performed by t-SNE.

## 4. Initial Findings

In this project the Yummly recipe dataset was investigated with a wide range of metrics to explore and analyze the attributes of various cuisines. The ingredients that make up a cuisines "signature" were identified for each cuisine, exposing what makes the flavors of each cuisine unique.

Overall, the analysis showed that the make up of cuisines is also related, in part, to geography. Cuisines from Eastern countries such as China, Korea, and Japan were shown to share a relatively common makeup of ingredients, while Western-based cuisines such as French, Irish and British were also similar. This analysis was also able to extract some information for cuisines that are mixed, which could be an indicator of their origins, such as is seen in Filipino cuisines, which were shown to fall somewhere in between Eastern and Western cuisines. This is not without base, since the Phillipines, while geographically located near the Eastern countries, was long colonized and controlled by the Spanish ([see this link for further information](https://en.wikipedia.org/wiki/History_of_the_Philippines_(1521%E2%80%931898)). Viewed from this perspective, deeper results from this dataset have the potential to yield "genomic" data of cuisines, tracing their origins and history.

## 5. Classification Models

Now that the data has been explored visually from several different angles, the next step will be to build a model in attempts to predict the cuisine of a recipe given its ingredients. The TF-IDF feature representation of ingredients will be used as the base input for predictive models. The problem is a multinomial classification problem, with 20 cuisine classes being considered.

Several models will be implemented and compared, with current candidates including K-nearest neighbors, multinomial Naive Bayes, Random Forests and Logistic Regression. The models will be compared primarily by classification accuracy, but precision and recall metrics will also be taken into account.

## 6. Resources

* Dataset - [Kaggle's "What's Cooking?" Competition Site](https://www.kaggle.com/c/whats-cooking/data)
* Project Proposal - [github link](https://github.com/emenriquez/Springboard-Coursework/blob/master/Capstone%20Project%202/Project%20Proposal%20-%20Cuisines.md)
* Code (IPython Notebooks):
    * Data Cleaning - [github link](https://github.com/emenriquez/Springboard-Coursework/blob/master/Capstone%20Project%202/Data%20Wrangling%20-%20Cuisines.ipynb)
    * Data Exploration - [github link](https://github.com/emenriquez/Springboard-Coursework/blob/master/Capstone%20Project%202/EDA%20-%20Cuisines.ipynb)

repository: emenriquez/Springboard-Coursework

path: /Capstone Project 2/Milestone Report.md

filename: Milestone Report.md

repo_name: emenriquez/Springboard-Coursework


text:
# Penicillium glandicola var. glandicola VARIETY

#### Status
ACCEPTED

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

#### Published in
in Samson & Pitt (eds), Advances in Penicillium and Aspergillus Systematics (New York) 147 (1986)

#### Original name
Coremium glandicola Oudem., 1903

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
# Netflix Interview Questions
* [Coding Round Questions](#coding)
* [Technical Interview Questions](#tech)
   * [Data Structures and Algorithms](#dsalg)
   * [DBMS](#dbms)
   * [Operating System](#os)
   * [System Design](#design)

Coding round questions

 - Write a contains() function in JavaScript
 - Enhance the contains function to make it part of the JavaScript system(e.g. HTMLElement.prototype)
 - How do you find the union and intersection of two lists assuming millions of values?
 - How do you optimize the solution?
 - Write code to implement a singleton.

---
Technical Interview Questions
- What is a singleton?

Data Structures and Algorithms

 - There are 10000 servers and need to send a file of size 1MB to each server, starting from a laptop. There is only 1 MB of bandwidth between each server. What's the shortest time possible to send this file to all the servers?

DBMS

Operating System

System Design

license: MIT

repository: adityanjr/code-DS-ALGO

gha_license_id: MIT

repo_name: adityanjr/code-DS-ALGO


text:
# Roundcube user_activity plugin

### Introduction

This plugin logs successful logins  and show on a windows, the IP address, time and date of the auth.

### Current Status

* Save satisfactorily IP address, date and time and hits by  IP on the database

#### Supported databases

| Database    |
| ----------- |
| PostgreSQL  |

#### License

This plugin is distributed under the BSD license. Please see user_activity.php for the complete license.

#### Tested on

| Version |
| ----------- |
| 0.8.4       |

##### Contact

Author: Reymer Antonio Vargas Solano
e-mail: reymervargas--at--gmail--dot--com
June 17th, 2013


text:
# An improved version of Turbo algorithm for the Black-box optimization (BBO) competition organized by NeurIPS 2020
This implemention is our solution for the BBO competition organized by NeurIPS 2020 conference: https://bbochallenge.com/

# Final results
Our algorithm ranked the 4th place on the “warm start friendly” leaderboard: https://bbochallenge.com/altleaderboard
It also ranked 17th place on the final leaderboard: https://bbochallenge.com/leaderboard

## Result on “warm start friendly” leaderboard
![leaderboard](https://github.com/nphdang/turbo_bbo_neurips_2020/blob/master/leaderboard.jpg)

# Main contributions
1. Reduce the bounds of hyper-parameters of each machine learning classifier
2. Improve the diversity in selecting batch elements
3. Increase the number of explored trust regions by using a base-length decay

# Installation
This implemention is based on Turbo algorithm. Please find the required packages from the Turbo's Github: https://github.com/uber-research/TuRBO

# How to run
This implemention is developed for optimizing machine learning models in the BBO competition. Please find the instruction from the competition Github: https://github.com/rdturnermtl/bbo_challenge_starter_kit/

# License
This implemention is released under Apache License 2.0 license except for the code derived from Turbo.


text:
# United States Expatriation at an All-Time High

![](./images/expatriation-title-new.png)

## Introduction

The Internal Revenue Service (IRS) of the United States releases quarterly reports tracking the number of expatriated citizens processed in the previous three-month period. The reports are announced via the [Federal Register](https://www.federalregister.gov/) which is the primary publication medium of the federal government and used by a number of agencies as an outreach arm to the public.

Ostensibly, the tax bureau maintains these records instead of Citizenship and Immigration Services (CIS) because the IRS uses that information to adjudicate decisions regarding those expatriating citizens upon whom the Expatriation Tax is levied.

An expatriate must meet any one of the following criteria to be liable for the eponymous tax:

* Average annual net income tax for the five years ending before the date of expatriation or termination of residency is more than a specified amount that is adjusted for inflation ($151,000 for 2012, $155,000 for 2013, $157,000 for 2014, and $160,000 for 2015).
* Net worth is $2 million or more on the date of expatriation or termination of residency.
* Failure to certify on `Form 8854` that the citizen has complied with all U.S. federal tax obligations for the five years preceding the date of expatriation or termination of residency.

IRS [Form `8854`](https://www.irs.gov/pub/irs-pdf/f8854.pdf) available at is a statement which confirms that up to the date of your expatriation, you have complied with United States Federal Tax Code to the letter of the law. Failing to correctly complete this document means that you are obligated to pay the Expatriation Tax, even if you do not meet either of the previous criteria.

Previous article tracking United States expatriation:

* [2017 Q2](2017-1.md)

## Data

The [Federal Register](https://www.federalregister.gov/) is a publishing outlet for the United States Government where the IRS
officially releases quarterly information about American citizens who renounce their passport in lieu of a new one and other long-term
residents who have decided to repatriate, view the raw data [here](https://www.federalregister.gov/documents/2017/05/10/2017-09475/quarterly-publication-of-individuals-who-have-chosen-to-expatriate-as-required-by-section-6039g) and use the [Axibase Data Crawler](https://github.com/axibase/atsd-data-crawlers/tree/irs-expatriation-data-crawler) designed specifically for collecting, parsing, organizing and inserting historical expatriation data and new data as it becomes available.

Axibase covered the expatriation release from [last quarter](2017-1.md) and is using
the release for this quarter to follow-up. Every election cycle countless celebrities and netizens issue their promise to leave
if their candidate fails to get elected and the growing notoriety surrounding the 2016 Presidential Election has proven to
be no different.

This type of social theater is almost as old as the country itself as there have been
a number of similarly divisive elections throughout American history: Andrew Jackson's victory in 1828 is seen as a populace uprising against
the corrupt political elite and a return to the authority of the common man, Abraham Lincoln's second term is sometimes viewed as the
tightening of federal authority to excessive levels that ultimately led to the American Civil War, Franklin Roosevelt was called
a dangerous communist whose infamous court-packing plan favorably increased the number of seats on the Supreme Court to his
advantage and is seen as abhorrent and traitorous by many, and of course who can forget recent elections that have featured scandal after
scandal and two modern Presidents who served after losing the popular vote, but winning in the electorate.

![](./images/expat-001.png)

[![](../images/new-button.png)](https://apps.axibase.com/chartlab/654b9945#fullscreen)

```sql
SELECT date_format(time,'yyyy') AS "Year", value AS "Naturalizations"
 FROM Naturalized.Citizens
```

> Data queried in the [SQL Console](https://axibase.com/docs/atsd/sql/).

```txt
| Year | Naturalizations  |
|------|------------------|
| 2001 | 613,161          |
| 2002 | 589,727          |
| 2003 | 456,063          |
| 2004 | 536,176          |
| 2005 | 600,366          |
| 2006 | 702,663          |
| 2007 | 659,233          |
| 2008 | 1,050,399        |
| 2009 | 741,982          |
| 2010 | 619,075          |
| 2011 | 690,705          |
| 2012 | 762,742          |
| 2013 | 777,416          |
| 2014 | 654,949          |
| 2015 | 729,995          |
```

To give the issue further context, the table and visualization above use the most current Naturalization data from the [Department of Homeland Security data](https://www.uscis.gov/news/fact-sheets/naturalization-fact-sheet).

Naturalization is the sister process to expatriation,
because as a person expatriates from one country they must be naturalized in another or end up a [stateless person](http://www.unhcr.org/stateless-people.html).

Naturalization numbers in America have remained fairly constant throughout the last decade because there are a number of federal regulations that
control the amount of long-term immigrants that America accepts each year and that quota is met without fail. As noted in the
our Q1 article, the sister value and subject of this examination, expatriation numbers, has been steadily growing for several
consecutive years.

![](./images/expat-002.png)

[![](../images/new-button.png)](https://apps.axibase.com/chartlab/7fa5b643#fullscreen)

```sql
SELECT date_format(time+365*24*60*60000, 'yyyy') AS "Year",
  count(value) AS "Year Total",
  count(value)-lag(count(value)) AS "Y-o-Y Change",
  100*(count(value)-lag(count(value)))/lag(count(value)) AS "Y-o-Y Change, %"
FROM "us-expatriate-counter"
  WHERE entity = 'us.irs' AND datetime <= '2017-06-30T00:00:00Z'
GROUP BY period(1 YEAR, END_TIME)
  ORDER BY period(1 YEAR, END_TIME)
```

> The above query features syntax and calculated values. See the [SQL Documentation](https://axibase.com/docs/atsd/sql/examples/) for syntax examples.

```ls
| Year | Year Total | Y-o-Y Change | Y-o-Y Change, % |
|------|------------|--------------|-----------------|
| 2000 | 273        | null         | null            |
| 2001 | 502        | 229          | 84              |
| 2002 | 322        | -180         | -36             |
| 2003 | 646        | 324          | 101             |
| 2004 | 474        | -172         | -27             |
| 2005 | 911        | 437          | 92              |
| 2006 | 351        | -560         | -61             |
| 2007 | 368        | 17           | 5               |
| 2008 | 394        | 26           | 7               |
| 2009 | 166        | -228         | -58             |
| 2010 | 1395       | 1229         | 740             |
| 2011 | 1812       | 417          | 30              |
| 2012 | 1412       | -400         | -22             |
| 2013 | 2091       | 679          | 48              |
| 2014 | 2766       | 675          | 32              |
| 2015 | 3626       | 860          | 31              |
| 2016 | 4143       | 517          | 14              |
| 2017 | 6807       | 2664         | 64              |
```

![](./images/expat-006.png)

[![](../images/new-button.png)](https://apps.axibase.com/chartlab/7fa5b643/5/#fullscreen)

Expatriation has been increasing each year by roughly 30% since 2010, which featured abnormally high expatriation rates, most
likely attributable to the economic turndown of the Great Recession which began in the United States as a result of the sub-prime
mortgage crisis. American citizenship is often sought after for the economic opportunity that comes along with the passport, as the
ability to work and do business in the country is heavily restricted or regulated, and with the value of that investment or
opportunity in question, it is unsurprising that the number of investors in the system, that is, new citizens, would fluctuate. It seems
appropriate to call naturalization an investment because of the nature of the process, which is long, complicated, and often
quite expensive similar to a long-position that costs more at purchasing time but promises high returns after reaching
maturity.

The peak, or more appropriately, valley of the global recession occurred in 2009 when the global GDP contracted causing
a decline in the median family income of [about five percent](https://web.stanford.edu/group/recessiontrends/cgi-bin/web/sites/all/themes/barron/pdf/IncomeWealthDebt_fact_sheet.pdf).

![](./images/expat-003.png)

[View in ChartLab](https://apps.axibase.com/chartlab/7fa5b643/2/#fullscreen)

```sql
SELECT CEIL(CAST(date_format(time, 'M') AS NUMBER)/3) AS "Quarter", date_format(time, 'yyyy') AS "Year",
  count(value) AS "Quarter Total"
FROM "us-expatriate-counter"
  WHERE entity = 'us.irs' AND date_format(time, 'yyyy-MM') >= '2013-01' AND datetime <= now
GROUP BY period(1 QUARTER)
  ORDER BY period(1 QUARTER)
```

| Quarter | Year | Quarter Total |
|---------|------|---------------|
| 1       | 2013 | 679           |
| 2       | 2013 | 1129          |
| 3       | 2013 | 560           |
| 4       | 2013 | 631           |
| 1       | 2014 | 999           |
| 2       | 2014 | 576           |
| 3       | 2014 | 775           |
| 4       | 2014 | 1061          |
| 1       | 2015 | 1331          |
| 2       | 2015 | 459           |
| 3       | 2015 | 1426          |
| 4       | 2015 | 1057          |
| 1       | 2016 | 1154          |
| 2       | 2016 | 506           |
| 3       | 2016 | 1379          |
| 4       | 2016 | 2359          |
| 1       | 2017 | 1313          |
| 2       | 2017 | 1756          |

Reducing the timespan to look at data over the last 5 years captures the repetition of this trend for this
period of time. Of the eighteen quarters included in this query, only six of them, roughly 33% showed negative growth for
this statistic.

## Conclusion

Growing expatriation numbers provide interesting insight into the perception of America both domestically and abroad, as these
numbers not only include U.S. citizens who renounce their citizenship, but also long-term resident aliens who have returned home.

Almost unbelievably, the IRS does not strip characteristic information about expatriates from their publications meaning that
first and last names are included in the data. Using [Social Security data](https://www.ssa.gov/oact/babynames/decades/century.html)
concerning the most common first names chosen throughout the last century and [United States Census data](https://www.census.gov/main/www/cen2000.html) concerning the most common last names to compare, the following queries and visualizations show
the number of expatriates by common first and common last name throughout the entire observed period, ranked by their frequency
in the IRS publication.

**The goal of these queries is purely demonstrative and lighthearted. There is no intention to invade privacy, defame people, or
otherwise cause harm.**

![](./images/expat-004.png)

```sql
SELECT tags.first_name AS "First Name",
  count(value) AS "Expat Total"
FROM "us-expatriate-counter"
  WHERE entity = 'us.irs' AND datetime <= now
GROUP BY tags.first_name
  ORDER BY count(value) desc
LIMIT 15
```

```txt
| First Name  | Expat Total |
|-------------|-------------|
| JOHN        | 323         |
| MICHAEL     | 317         |
| DAVID       | 310         |
| ROBERT      | 273         |
| PETER       | 211         |
| JAMES       | 200         |
| THOMAS      | 193         |
| DANIEL      | 179         |
| WILLIAM     | 172         |
| SUSAN       | 167         |
| RICHARD     | 160         |
| MARY        | 155         |
| CHRISTOPHER | 153         |
| JENNIFER    | 138         |
| PATRICIA    | 132         |
```

> All of these names appear on the list of most common American first names, linked [here](https://www.ssa.gov/oact/babynames/decades/century.html)

![](./images/expat-005.png)

```sql
SELECT tags.last_name AS "Last Name",
  count(value) AS "Expat Total"
FROM "us-expatriate-counter"
  WHERE entity = 'us.irs' AND datetime <= now
GROUP BY tags.last_name
  ORDER BY count(value) desc
LIMIT 15
```

| Last Name | Expat Total |
|-----------|-------------|
| LEE       | 230         |
| KIM       | 136         |
| WONG      | 109         |
| CHAN      | 104         |
| WANG      | 102         |
| CHEN      | 89          |
| SMITH     | 74          |
| LIN       | 71          |
| WU        | 57          |
| CHANG     | 57          |
| PARK      | 53          |
| NG        | 49          |
| LIM       | 47          |
| LIU       | 46          |
| LI        | 45          |

>Only the name Smith appears on the list of most common American last names.

Use the [Axibase Data Crawler](https://github.com/axibase/atsd-data-crawlers/tree/irs-expatriation-data-crawler) to collect the data used in this article and examine it yourself in [ChartLab](https://apps.axibase.com/chartlab).

repository: nmoiseykin/atsd-use-cases

repo_name: nmoiseykin/atsd-use-cases


text:
# SuspendedViewStub

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

## About

**It's my first pod, and if you find bugs, or some question - write me on email, or make issue in this repo.**

It is just simple stub for your application, when you press home button. The main window is covered by a view of a specific color or your custom controller. Additionally, you can set autoclosing when your app resets foreground mode. In demo, I use custom controller with password field.

![About](https://github.com/Torlopov-Andrey/SuspendedViewStub/blob/master/Source/stub_demo.gif)

## Installation

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

```ruby
pod "SuspendedViewStub"
```

## Example

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

## How it use

* In your project add the following line to your `Podfile`:

```ruby
pod "SuspendedViewStub"
```

In your project you have 2 ways:

* Use colored view. Than you write in `AppDelegate.swift`:

``` Swift
func applicationDidEnterBackground(_ application: UIApplication) {
SuspendedViewStub.setStub(color: .green)
}
```

* Use custom controller. Than you write in `AppDelegate.swift`:

``` Swift
func applicationDidEnterBackground(_ application: UIApplication) {
SuspendedViewStub.setStub(sceneName: CONTROLLER_IDENTITY, autocomplete: false)

//By default storyboardname is "Main" and autocomplete is true.
SuspendedViewStub.setStub(sceneName: CONTROLLER_IDENTITY, storyboardName: STORYBOARD_NAME, autocomplete: false)
}
```

* Important to write in `AppDelegate.swift` next code:

``` Swift
func applicationWillEnterForeground(_ application: UIApplication) {
//This code is required!
SuspendedViewStub.removeStub()
}
```

That's all

## Author

<EMAIL_ADDRESS>
skype: torlopov.andrey

## License

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

repository: andreytorlopovold/SuspendedViewStub

repo_name: andreytorlopovold/SuspendedViewStub


text:
# Coursera-DE-C2-search-commands
Search Commands Lab

## Goal:   Learn to search from the Bash prompt

Learn to use Bash to search the filesystem

### Part 1: Search with find

1.  Search the filesystem for CSV files:  `find -name "*.csv"`
2.  What did you find?
3.  Search the filesystem for `.txt` files: `find -name "*.txt"`
4.  What did you find?

### Part 2: Search with find, xargs and grep

1.  Use the following command to find text inside the searched files: `find -name "*.txt" | xargs grep Apple`
2.  What did you find out?
3.  Run the following command:  `grep -R Banana .`
4.  What did you find out?
5.  What are the pros and cons of the first approach and the second approach?

branch_name: refs/heads/main


text:
# Typical Usage

Now that you have seen what Optimism can do, let's flex our muscles a bit and see how far this goes.

{% tabs %}
{% tab title="Vanilla Rails Scaffold" %}
{% code title="app/views/posts/\_form.html.erb" %}
```rust
<%= form_with(model: post, id: "posts_form") do |form| %>
  <%= form.container_for :name, class: "field" do %>
    <%= form.label :name %>
    <%= form.text_field :name %>
    <%= form.error_for :name, class: "danger hide" %>
  <% end %>

  <%= form.container_for :body, class: "field" do %>
    <%= form.label :body %>
    <%= form.text_area :body %>
    <%= form.error_for :body, class: "danger hide" %>
  <% end %>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>
```
{% endcode %}
{% endtab %}

{% tab title="Bootstrap" %}
{% code title="app/views/posts/\_form.html.erb" %}
```rust
<%= form_with(model: post, id: "posts_form") do |form| %>
  <%= form.container_for :name, class: "input-group" do %>
    <%= form.label :name %>
    <%= form.text_field :name, class: "form-control" %>
    <%= form.error_for :name, class: "small align-bottom text-danger d-none" %>
  <% end %>

  <%= form.container_for :body, class: "input-group" do %>
    <%= form.label :body %>
    <%= form.text_area :body, class: "form-control" %>
    <%= form.error_for :body, class: "small align-bottom text-danger d-none" %>
  <% end %>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>
```
{% endcode %}
{% endtab %}
{% endtabs %}

Here we introduce the `container_for` helper, which wraps a form element in a `div` that has an id similar to the `error_for` helper, except you're looking at _posts\_body\_container_. More importantly, the container receives a CSS class called _error_ that can be used to change the visual characteristics of the error message as well as the input element itself. **It is this interplay between cascading style and the order in which the styles are declared that makes this approach work.** Consider the following CSS:

{% tabs %}
{% tab title="Vanilla Rails Scaffold" %}
```css
.danger {
  color: red;
}

.hide {
  display: none;
}

.field.error > .hide {
  display: block;
}

.field.error > input,
.field.error > textarea {
  background-color: rgba(255, 239, 213, 0.7);
}
```
{% endtab %}

{% tab title="Bootstrap" %}
```css
.input-group.error > .d-none {
  display: inline !important;
}

.input-group.error > input,
.input-group.error > textarea {
  background-color: rgba(255, 239, 213, 0.7);
}
```
{% endtab %}
{% endtabs %}

When there is a validation error on an input element, the error message is injected into the span and an _error_ CSS class is added to the container for that element. This results in a cascade where **the class responsible for hiding the error message is now flipped to display it instead**. In this example, we also show how we can change the visual characteristics of the input elements themselves, in this case making the background color a sickly and distressing translucent peach. It really helps sell the urgency.

If you assign an id to the form itself that matches the expected format - in this case, `posts_form` - Optimism will also place an _invalid_ class on the form if there are _any_ errors at all. This gives the developer the flexibility to demonstrate an error state at the form level by tweaking how the form is displayed.

{% hint style="info" %}
Unfortunately, we can't automatically generate the id for the form during its own declaration. Luckily, the format is pretty easy: **resources\_form**.
{% endhint %}

## Gotchas

Optimism is a fundamentally simple library, which means that inevitably, there's going to be scenarios that require some extra consideration.

#### Radio buttons and checkboxes

Thanks to a quirk of the way certain OG form input elements work, it's possible for an unchecked element to not be included in a form's parameters. For example, if you have a set of radio buttons with no default selection, your `params` hash will not include data for it.

Make sure to use the `checkbox` helpers that Rails provides, which implement a clever hack to make sure that unchecked checkboxes produce a `false` value in your `params`.

![](.gitbook/assets/web_developer.svg)

repository: leastbad/optimism

gha_language: Ruby

repo_name: leastbad/optimism


text:
---
layout:     post
title: "WildFly Camel Source To Image Builds"
summary: "An introduction to S2I builds with the WildFly Camel project"
tags: [WildFly, Camel, OpenShift]
---

The WildFly Camel project provides a container image which is capable of performing [Source To Image (S2I)](https://github.com/openshift/source-to-image#source-to-image-s2i) builds.

## S2I basics

First some preamble on what S2I is and how it works. It enables you to produce repeatable builds of docker images from source code.

An S2I builder image contains the required toolchain for building your project. For Java, that's usually Maven or Gradle. For Ruby apps a builder image
might contain bundler to install Ruby Gems etc, and a Golang app builder image would contain the Go compiler.

For a Java builder image, if it sees that the provided source code contains a pom.xml file, it can assume that it's possible to run a Maven build to package the application. For WildFly, this usually means producing a JAR, WAR or EAR. When the Maven build completes successfully, the builder image copies any built artifacts across to the WildFly deployments directory.

Here are some ways in which you can create and deploy Camel projects using the S2I builder image.

## Local directory S2I build

To start with, grab the S2I client binary from the project [releases](https://github.com/openshift/source-to-image/releases) page. Then switch to a Maven project directory for any deployable JAR or WAR project and run:

{% highlight bash %}
s2i build . wildflyext/wildfly-camel my-awesome-application
{% endhighlight %}

You can also run an S2I build on a directory containing pre-assembled artifacts. In this case there is no need for the builder image to run a Maven build.

When the S2I build is complete, you can run your application with docker:

{% highlight bash %}
docker run -ti wildflyext/wildfly-camel my-awesome-application
{% endhighlight %}

## Remote S2I build

You can also perform S2I builds using the URL to a git repository.

{% highlight bash %}
s2i build https://github.com/wildfly-extras/wildfly-camel-examples.git \
    -r 8.0.0 \
    --context-dir camel-cdi \
    wildflyext/wildfly-camel:8.0.0 wildfly-camel-example-cdi
{% endhighlight %}

## OpenShift S2I template build

The WildFly Camel project provides an OpenShift [ImageStream](https://docs.okd.io/latest/architecture/core_concepts/builds_and_image_streams.html#image-streams). You can add it to your cluster as follows:

{% highlight bash %}
oc apply -f http://wildfly-extras.github.io/wildfly-camel/sources/wildfly-camel-imagestream.json
{% endhighlight %}

Next install the WildFly Camel S2I application template:

{% highlight bash %}
oc apply -f http://wildfly-extras.github.io/wildfly-camel/sources/wildfly-camel-application-template.json
{% endhighlight %}

Now browse to the OpenShift web console, choose from an existing project or create a new one. Click 'Browse Catalog'. You should see an option to select named 'WildFly Camel':

![WildFly Camel S2I](/images/wfc-openshift.png)

Fill out the template parameters and click finish to start the S2I build.

![WildFly Camel S2I Build](/images/wfc-build-openshift.png)

When the build completes successfully you will see a running pod.

![WildFly Camel S2I Running Pod](/images/wfc-pod-openshift.png)

## Conclusion

Hopefully this is a good introduction to S2I with WildFly Camel. If you want to learn more, check out some of these links:

* [WildFly Camel S2I Documentation](http://wildfly-extras.github.io/wildfly-camel/#_source_to_image)
* [OKD Documentation](https://docs.okd.io/latest)
* [Source To Image Project](https://github.com/openshift/source-to-image)
* [WildFly S2I base image project](https://github.com/openshift-s2i/s2i-wildfly)
* [Red Hat Fuse on OpenShift](https://access.redhat.com/documentation/en-us/red_hat_fuse/7.1/html/fuse_on_openshift_guide/)


text:
# NeuroPlots

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaNeuroscience.github.io/NeuroPlots.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaNeuroscience.github.io/NeuroPlots.jl/dev)
[![Build Status](https://github.com/JuliaNeuroscience/NeuroPlots.jl/workflows/CI/badge.svg)](https://github.com/JuliaNeuroscience/NeuroPlots.jl/actions)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)

gha_language: Julia


text:
# Green Screen Gif Generator

A demo project using the Seriously.js library to create a "Confused John Travolta" gif generator

Demo: http://nikmaniatis.github.io/greenscreen-gif/

background image should be of width=446 & height=360 in rder for the app to work correctly, as it does not support autoscaling (for now at least).

## Code Licence MIT

Copyright (c) 2016 Nikolaos Maniatis

## Content Credits

Confused John Travolta .mp4 file is one of the few available around the internet. It has been used only for demostration and it is not clear the copyright status around it.

Backround images are from wikipedia

repository: kjarnot/greenscreen-gif

repo_name: kjarnot/greenscreen-gif


text:
# dispatch-poker-cards-to-n-people
shuffle and dispatch poker cards to N(n>0) people [PHP]

**Purpos**

Shuffle the 52 cards{Heart[H],Spade[S],Club[C],Diamond[D] * (A,2,3,...9,10=X,J,Q,K)} and then dispatch the cards to n people(n>0);

**Input**

n-The number of people

**Output**

Output format

Heart = H, Spade = S, Club = C, Diamond = D;

1=A, 10=X, 11=J, 12=Q, 13=K, 2~9

Split with comma(,); One line for one person; Start a new line whit [LF]

Ex.
```
S-1,H-J,C-3,...
H-X,S-Q,D-4,...
...
...
```

repository: DQPHP/dispatch-poker-to-n-people

repo_name: DQPHP/dispatch-poker-to-n-people


text:
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/csweichel/werft)

# Werft
Werft is a Kubernetes-native CI system. It knows no pipelines, just jobs and each job is a Kubernetes pod.
What you do in that pod is up to you. We do not impose a "declarative pipeline syntax" or some groovy scripting language.
Instead, Werft jobs have run Node, Golang or bash scripts in production environments.

## Installation
The easiest way to install Werft is using its [Helm chart](helm/).
Clone this repo, cd into `helm/` and install using
```
helm dep update
helm upgrade --install werft .
```

### GitHub
For the time being Werft has a strong GitHub dependency. For a werft server to run you'll need a GitHub app.
To create the app, please [follow the steps here](https://developer.github.com/apps/building-github-apps/creating-a-github-app/).

When creating the app, please use following values:

| Parameter | Value | Description |
| --------- | ----------- | ------- |
| `User authorization callback URL` | `https://your-werft-installation.com/github/app` | The `/github/app` path is important, the domain should match your installation's `config.baseURL` |
| `Webhook URL` | `https://your-werft-installation.com/github/app` | The `/github/app` path is important, the domain should match your installation's `config.baseURL` |
| `Permissions` | Contents: Read-Only | |
| | Commit Status: Read & Write | |
| `Events` | Meta | |
| | Push | |

### Configuration

The following table lists the configurable parameters of the Werft chart and their default values.

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `github.webhookSecret` | Webhook Secret of your GitHub application. See [GitHub Setup](#github) | `my-webhook-secret` |
| `github.privateKeyPath` | Path to the private key for your GitHub application. See [GitHub setup](#github) | `secrets/github-app.com` |
| `github.appID` | AppID of your GitHub application. See [GitHub setup](#github) | `secrets/github-app.com` |
| `github.installationID` | InstallationID of your GitHub application. Have a look at the _Advanced_ page of your GitHub app to find thi s ID. | `secrets/github-app.com` |
| `config.baseURL` | URL of your Werft installatin | `https://demo.werft.dev` |
| `config.timeouts.preperation` | Time a job can take to initialize | `10m` |
| `config.timeouts.total` | Total time a job can take | `60m` |
| `github.appID` | AppID of your GitHub application. See [GitHub setup](#github) | `secrets/github-app.com` |
| `image.repository` | Image repository | `csweichel/werft` |
| `image.tag` | Image tag | `latest` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `replicaCount`  | Number of cert-manager replicas  | `1` |
| `rbac.create` | If `true`, create and use RBAC resources | `true` |
| `resources` | CPU/memory resource requests/limits | |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `affinity` | Node affinity for pod assignment | `{}` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

```console
$ helm install --name my-release -f values.yaml .
```
> **Tip**: You can use the default [values.yaml](values.yaml)

### OAuth
Werft does not support OAuth by itself. However, using [Vouch](https://github.com/vouch/vouch-proxy) that's easy enough to add.

## Setting up jobs
Wert jobs are files in your repository where one file represents one job.
A Werft job file mainly consists of the [PodSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podspec-v1-core) that will be run.
Werft will add a `/workspace` mount to your pod where you'll find the checked out repository the job is running on.

For example:
```YAML
pod:
  containers:
  - name: hello-world
    image: alpine:latest
    workingDir: /workspace
    imagePullPolicy: IfNotPresent
    command:
    - sh
    - -c
    - |
      echo Hello World
      ls
```
This job would print Hello World and list all files in the root of the repository.

Checkout [werft's own build job](.werft/build-job.yaml) for a more complete example.

> **Tip**: You can use the werft CLI to create a new job using `werft init job`

### GitHub events
Werft starts jobs based on GitHub push events if the repository contains a `.werft/config.yaml` file, e.g.
```YAML
defaultJob: ".werft/build-job.yaml"
rules:
- path: ".werft/deploy.yaml"
  matchesAll:
  - or: ["repo.ref ~= refs/tags/"]
  - or: ["trigger !== deleted"]
```

The example above starts `.werft/deploy.yaml` for all tags. For everything else it will start `.werft/build-job.yaml`.

## Log Cutting
Werft extracts structure from the log output its jobs produce.

The default cutter in Werft expects the following syntax:

| Code | Command | Description |
| --------- | ----- | ----------- |
| `[someID\|PHASE] Some description here` | Enter new phase | Enters into a new phase identified by `someID` and described by `Some description here`. All output in this phase that does not explicitely name a slice will use `someID` as slice.
| `[someID] Arbitrary output` | Log to a slice | Logs `Arbitrary output` and marks it as part of the `someID` slice.
| `[someID\|DONE]` | Finish a slice | Marks the `someID` slice as done. No more output is expected from this slice in this phase.
| `[someID\|FAIL] Reason` | Fail a slice | Marks the `someID` slice as failed becuase of `Reason`. No more output is expected from this slice in this phase. Failing a slice does not automatically fail the job.
| `[type\|RESULT] content` | Publish a result | Publishes `content` as result of type `type`

> **Tip**: You can produce this kind of log output using the Werft CLI: `werft log`

## Command Line Interface
Werft sports a powerful CI which can be used to create, list, start and listen to jobs.

### Installation
The Werft CLI is available on the [GitHub release page](https://github.com/csweichel/werft/releases), or using this one-liner:
```bash
curl -L werft.dev/get-cli.sh | sh
```

### Usage
```
werft is a very simple GitHub triggered and Kubernetes powered CI system

Usage:
  werft [command]

Available Commands:
  help        Help about any command
  init        Initializes configuration for werft
  job         Interacts with currently running or previously run jobs
  log         Prints log-cuttable content
  run         Starts the execution of a job
  version     Prints the version of this binary

Flags:
  -h, --help          help for werft
      --host string   werft host to talk to (defaults to WERFT_HOST env var) (default "localhost:7777")
      --verbose       en/disable verbose logging

Use "werft [command] --help" for more information about a command.
```

## Attribution

Logo based on [Shipyard Vectors by Vecteezy](https://www.vecteezy.com/free-vector/shipyard)

## Thank You
Thank you to our contributors:

- [csweichel](https://github.com/csweichel)
- [corneliusludmann](https://github.com/corneliusludmann)
- [jankeromnes](https://github.com/jankeromnes)
- [JesterOrNot](https://github.com/JesterOrNot)

repository: isgasho/werft

repo_name: isgasho/werft


text:
---
layout: post
title:  "Apachecon 2017 – Evolution of an Apache Spark Architecture for Processing Game Data"
date:   2017-05-17
desc: ""
keywords: "Apache,Spark,Streaming"
categories: [Platform]
tags: [Apache,Spark,Data Platform]
icon: icon-html
---

<img src="{{ site.img_path }}/apachecon/apachecon-logowfeather459x459.png" width="50%" display="block">

Apache Spark Streaming is a powerful component for enabling real-time insights.  However, how do analytical warehouses keep up with a micro-batch feed at scale?  WB Analytics will share our architecture for tuning event ingestion, through Spark Streaming, to AWS Redshift, to provide near real-time insights.

Read more [here](https://apachebigdata2017.sched.com/event/9zzA/evolution-of-an-apache-spark-architecture-for-processing-game-data-nick-afshartous-warner-brothers-interactive-entertainment-wbie).


text:
# DynamoDB Viewer
View DynamoDB Tables from this single page app. Connect to production or to a DynamoDB-local instance.

# Usage

Visit https://ayanray.github.io/dynamodb-viewer/

Use it! Submit the form fields and connect.

## Running dynamodb-local

When you run [dynamodb-local](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html), it does not support HTTPS. So I made a small HTTPS proxy to route traffic to a dynamodb-local instance.

Read more about it here:
https://github.com/ayanray/dynamodb-https-proxy

When you use the [Online Viewer](https://ayanray.github.io/dynamodb-viewer/), just enter https://URL_TO_PROXY:PORT and it should allow you to connect to DynamoDB-Local.

# Contributing

To contribute, fork this repo, make your changes, and submit a PR.

#### Useful References:

Bootstrap: Used to Layout the Page
- http://getbootstrap.com/css/
- http://getbootstrap.com/components/

Bootstrap Tables: Used to view Dynamo Data
- http://bootstrap-table.wenzhixin.net.cn/

DynamoDB: AWS SDK Used to talk to Dynamo
- http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html

repository: ayanray/dynamodb-viewer

branch_name: refs/heads/develop

repo_name: ayanray/dynamodb-viewer


text:
## OpenDesk Collection

This repository is work-in-progress. It (will) contain(s) a series of JSON
documents containing information about the designs published on OpenDesk.

The intention is that the JSON document format will evolve to follow an
open publishing specification for locally made CNC furniture, as defined in
the [opendesk/schema](https://github.com/opendesk/schema) repo.

license: Unlicense

repository: opendesk/collection

repo_name: opendesk/collection


text:
---
title: Functions in JavaScript
excerpt: Functions in JavaScript
coverImage:
  url: /assets/blog/functions-in-javascript/cover.jpg
  alt: Functions in JavaScript
  title: Photo by Julian Hochgesang on Unsplash
date: "2021-11-02T17:12:00Z"
author:
  name: Pijush Barik
  picture: /assets/blog/authors/pijush-barik.jpeg
  twitter: "pijushbarik"
tags:
  - Functions
  - JavaScript
meta:
  title: Functions in JavaScript
  keywords:
    - functions in javascript
    - javascript
    - functions
    - first class functions
    - function declaration
    - function statement
    - arrow functions
    - blog
  ogImage: /assets/blog/functions-in-javascript/cover.jpg
---

Functions in JavaScript are so much powerful. There are varieties of ways to define and declare a function in JavaScript. Based on definitions
and declarations, function behaves differently.

## Function declartion or a function statement

In JavaScript, a function declarations and a function statement is identical. Just like a variable declaration must start with `var`, a function
declaration must start with `function`. A function declaration tells JavaScript, about that function's name, return type and parameters.

```javascript
// function declaration
function say(something) {
  console.log(something);
}

// we can invoke the function
say("Hello");
```

The above code declares a function named `say` with parameter `something`, and has a return type of `void` (returns nothing). When a function has been
declared, it can be accessed/called/invoked from anywhere in the scope where it has been declared.

## Function expression

#### First thing first. What is the difference between an expression and a statement?

An expression is something that produces a value. For example, `2 + 3` is an expression, and it produces a value `5`. An expression may contain arithmetic
operators, boolean operators, function call (`()`) operator.
In the other hand, a statement is anything that makes a complete line of a code (which can be compared to a complete sentence in a language). For example
`let five = 2 + 3;` is a statement and it's a complete line of a valid code.  So, expressions
are like words and one or more word(s) builds up a sentence i.e., a statement.

#### Now, what is a function expression then?

In JavaScript, along with declaring a function, we can assing that function to a variable, and that is a function expression. A function expression is similar
to any other variable assignment. When a function expression is assigned to a variable or used inside another expression, it creates a complete JavaScript
statement.

```javascript
var a = 10; // variable declaration and assignment
// function expression
var saySomething = function (something) {
  console.log(something);
};

console.log(a);
// we can invoke the saySomething function same way
saySomething();
```

Just like we access the variable `a`, we can access the variable `saySomething` same way (since, it's an function, we call it). In this example,
the part `function (something) { console.log(something); }` is an expression. We are assigning the reduced value of that expression to the variable
`saySomething`, and that makes it a statement. In function expression, we create a anonymous function (a function with no name) and assigns to a
variable.

## First-class function

If a programming language can treat a function just like any other variables, we say that the programming langugae have First-class functions.
JavaScript treats functions as fist-class function, and that's what makes JavaScript so poerful in terms of function usages. In the function expression
section, we saw that we are creating a function expression and assigned to a variable. Just like accessing another variables, we can invoke that function
with that variable with adding `()` at the end. We also can pass a function as a argument to another function, return a function from a function.

```javascript
//
// Example of passing function as an argument
//
function saySomething(something) {
  console.log(something);
}

function sayHelloTo(name, say) {
  say(`Hello ${name}`); // we can call `say` from here
}

sayHelloTo("Ray", saySomething); // we passed `saySomething` function as an argument to `sayHelloTo`

// Output: Hello Ray
```

```javascript
//
// Example of returning a function from a function
//
function addFiveTo(x) {
  return function () {
    // returning a function from `addFiveTo` function
    return x + 5;
  };
}

const adder = addFiveTo(10);
console.log(adder());

// Output: 15
```

## Arrow function

JavaScript introduced Arrow functions in ES5 syntax. An arrow function is defined like this,

```javascript
const f = () => {
  // function body
};

f(); // just like we invoke other functions
```

Arrow functions are a syntactic sugar or a kind of shorthand of writing functions in JavaScript. If we can see closely, we can see similarities between the
arrow function and a function expression, except the function keyword and some other syntax. This part `() => {}` is an expression of an anonymous function
and same as `function () {}`. So, an arrow function is also a function expression but with a different syntax.

```javascript
// Function expression
const f1 = function () {
  console.log("Function expression");
};

const f2 = () => {
  console.log("Arrow function");
};
```

#### Arrow function returns by default

An arrow functions returns the evaluated value from an expression when the function is not wrapped with the function block (`{ ...function body goes here }`).

```javascript
const sum1 = function (x, y) {
  return x + y; // we need an explicit return statement if we want to return something from a regular function
};

const sum2 = (x, y) => x + y; // we don't need any return statement to return something from an arrow function

const sum3 = (x, y) => {
  return x + y; // when wrapped inside a function block if we want to return something we must explicitely write a return statement
};
```

Unlike regular functions, arrow functions has it's limitations on its scope and it does not have its own bindings to `this` or `super`, and should not be used as
class methods.

branch_name: refs/heads/prod

gha_language: TypeScript


text:
# deckly

[![NPM package][npm-img]][npm-url]
[![Build Size][build-size-img]][build-size-url]
[![Dependencies][dependencies-img]][dependencies-url]

Deckly is a JavaScript library to build dashboards of integrated maps and plots.
Uses React, deck.gl, and plotly.
Maps and plots are automatically linked, so that when you hover over the map, the plots are dynamically adjusted. This functionality is powered by React.

Check out the examples:

* [NZ Cancer](https://uoa-eresearch.github.io/deckly/examples/cancer) ([source](https://github.com/UoA-eResearch/deckly/blob/main/examples/cancer.html))
* [AirBNBs vs Land Value in Christchurch](https://uoa-eresearch.github.io/airbnb/) ([source](https://github.com/UoA-eResearch/airbnb/blob/main/index.html))

## Installation

### NPM module
```
npm install deckly
```
or
```
yarn add deckly
```
Then:
```
import Deckly from 'deckly';
```
or
```
var Deckly = require('deckly');
```

### UMD
```
<script src="https://unpkg.com/deckly/umd/deckly.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/deckly/umd/deckly.css">
```

## Usage
Deckly({options})

[npm-img]: https://img.shields.io/npm/v/deckly.svg
[npm-url]: https://npmjs.org/package/deckly
[build-size-img]: https://img.shields.io/bundlephobia/minzip/deckly.svg
[build-size-url]: https://bundlephobia.com/result?p=deckly
[dependencies-img]: https://img.shields.io/david/uoa-eresearch/deckly.svg
[dependencies-url]: https://david-dm.org/uoa-eresearch/deckly

repository: UoA-eResearch/deckly

repo_name: UoA-eResearch/deckly


text:
# Toggl CLI

[![PyPI version](https://badge.fury.io/py/togglCli.svg)](https://badge.fury.io/py/togglCli)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/togglCli.svg)](https://pypi.org/project/togglCli)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/togglCli.svg)](https://pypi.org/project/togglCli/)
[![codecov](https://codecov.io/gh/AuHau/toggl-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/AuHau/toggl-cli)
[![Build Status](https://travis-ci.org/AuHau/toggl-cli.svg?branch=master)](https://travis-ci.org/AuHau/toggl-cli)

> Command line tool and set of Python wrapper classes for interacting with toggl's API

## Install

Easiest way to install this package is through PyPi:

```shell
$ pip install togglCli
```

## Usage

For full overview of Toggl CLI capabilities please see [full documentation](https://toggl.uhlir.dev).

### CLI tool

With first run of the command you will be asked several questions to bootstrap default config file
(only UNIX-like system are supported; for Window's users there is created dummy config file, which you have to setup manually).

To get overview of all commands and options please use `--help` option. Check out also help pages of the subcommands!

Several examples of commands:

```shell
# Starts tracking new time entry
$ toggl start

# Displays/enable modifications of currently running time entry
$ toggl now

# Lists all projects
$ toggl projects ls
```

### API wrappers

Toggl CLI comes with set of Python's class wrappers which follow similar pattern like Django ORM.

The wrappers depends on config object which if not provided, the default config file (eq. `~/.togglrc`) is used.

Toggl CLI uses `pendulum` for datetime management, but it is compatible with Python's native datetime, so you can use that if you want to.

```python
from toggl import api, utils
import pendulum

new_entry = api.TimeEntry(description='Some new time entry', start=pendulum.now() - pendulum.duration(minutes=15), stop=pendulum.now())
new_entry.save()

list_of_all_entries = api.TimeEntry.objects.all()

current_time_entry = api.TimeEntry.objects.current()

# Custom config from existing file
config = utils.Config.factory('./some.config')

# Custom config without relying on any existing config file
config = utils.Config.factory(None)  # Without None it will load the default config file
config.api_token = 'your token'
config.timezone = 'utc'  # Custom timezone

project = api.Project.object.get(123, config=config)
project.name = 'Some new name'
project.save()
```

## Contributing

Feel free to dive in, contributions are welcomed! [Open an issue](https://github.com/auhau/toggl-cli/issues/new) or submit PRs.

For PRs please see [contribution guideline](https://github.com/AuHau/toggl-cli/blob/master/CONTRIBUTING.md).

## License

[MIT ©  Adam Uhlir & D. Robert Adams](https://github.com/AuHau/toggl-cli/blob/master/LICENSE)

repository: AuHau/toggl-cli

gha_language: Python

gha_license_id: NOASSERTION

repo_name: AuHau/toggl-cli


text:
![Emails with attachments in Concourse pipelines](https://raw.githubusercontent.com/pivotalservices/concourse-pipeline-samples/master/common/images/email_with_attachment.png)

# Emails with file attachments in Concourse pipelines
This is an example of a Concourse pipeline that sends emails with file attachments by leveraging the [Nodemailer Node.js package](https://nodemailer.com/).

To add it to your pipeline, extract [this project](https://github.com/pivotalservices/concourse-pipeline-samples/tree/master/email-with-attachments) from github and copy the following files to your pipeline scripts and tasks directory:
- [send-email.yml](https://github.com/pivotalservices/concourse-pipeline-samples/blob/master/email-with-attachments/ci/tasks/send-email.yml)
- [send-email.js](https://github.com/pivotalservices/concourse-pipeline-samples/blob/master/email-with-attachments/ci/scripts/send-email.js)

Then update the last line of *send-email.yml* to point to your resource name and sub-directory where *send--email.js* is located:
```
      node <your-resource-directory-path-goes-here>/send-email.js
```

In your pipeline definition file, this is how you define a task to send an email with attachments:
```
    - task: email-notification-failure
      file: <your-resource-directory-location-goes-here>/send-email.yml
      params:
        SMTP_HOST: <<your-smtp-host-goes-here  e.g. smtp.gmail.com>
        SMTP_PORT: <<your-smtp-server-port-number  e.g. 465>
        SMTP_USERNAME: <<your-email-id-with-encoded-@-sign  e.g. myemail%40gmai.com >
        SMTP_PASSWORD: <your-email-password>
        EMAIL_FROM: <the-sender-email-address-without-enconding   e.g<EMAIL_ADDRESS>        EMAIL_TO: <the-list-of-comma-separated-destination-emails-without-encoding  e.g. him<EMAIL_ADDRESS>        EMAIL_SUBJECT_TEXT: <email-subject-message   e.g. Hello there>
        EMAIL_BODY_TEXT: <email-body-text   e.g. This is my email body.>
        EMAIL_ATTACHMENTS: <json-array-with-attachments-info. See format below. Omit this field if no attachment is needed>
```
Example of input for the the ```EMAIL_ATTACHMENTS``` parameter:
- For one attachment file:
```
   EMAIL_ATTACHMENTS: '[{ "filename": "my-attachment.txt","path": "./pipeline-scripts/email-with-attachments/my-attachment.txt", "contentType":"text/plain"}]'
```
- For two or more attachment files:
```
   EMAIL_ATTACHMENTS: '[{ "filename": "myfile1.txt","path": "./my-path/myfile1.txt", "contentType":"text/plain"},{ "filename": "report.json","path": "./my-path/report.json", "contentType":"application/json"}]'
```

You are now ready to run your pipeline and send emails with attachments from it.

**Note**: some SMTP hosts, such as Gmail, enforce restrict security roles about the source app that requests emails. See [this note](https://nodemailer.com/using-gmail/) on how to configure your account to avoid your emails from being rejected by the server.

---
## How to setup and run the sample pipeline
If you want to see the full sample pipeline provided in action, here is how you can set it up on your own Concourse server:

##### Pre-requisites to setup this example on your Concourse server

1. An instance of [Concourse installed](http://concourse-ci.org/installing.html) up-and-running.
1. The [Concourse Fly command line interface](http://concourse-ci.org/fly-cli.html) installed on your local machine.

##### Configuration steps
1. Clone the sample git repository on your local machine
     __clone https://github.com/pivotalservices/concourse-pipeline-samples.git__
     __cd concourse-pipeline-samples/email-with-attachments__

1. Setup the pipeline credentials file
  * Make a copy of the sample credentials file
  __cp ci/credentials.yml.sample ci/credentials.yml__

  * Edit _ci/credentials.yml_ and fill out all the required credentials:
  .
_```git-project-url```:_ the URL of the git repositor containing the pipeline scripts
_```smtp-host```:_ your smtp host  (e.g. ```smtp.gmail.com```)
_```smtp-port```:_ your smtp server port number  (e.g. ```465```)
_```smtp-username```:_ your userId/email-address with the smtp server with encoded @ sign  (e.g. ```myemail%40gmai.com```)
_```smtp-password```:_ your userId/email-address password
_```email-from```:_ the sender email address without enconding   (e.g<EMAIL_ADDRESS>
_```email-to```:_ the list of comma separated destination emails without encoding  (e.g. ```him<EMAIL_ADDRESS>

3. Configure the sample pipeline in Concourse with the following commands:
   __fly -t <your-concourse-alias> set-pipeline -p email-pipeline -c ci/pipeline.yml -l ci/credentials.yml__

4. Access to the Concourse web interface, click on the list of pipelines, unpause the _email-pipeline_ and then click on its link to visualize its pipeline diagram
5. To execute the pipeline, click on the ```send-email-with-attachment``` job and then click on the ```+``` sign to execute the pipeline.

The recipients listed you your ```email-to``` parameter should receive an email shortly after the pipeline is run successfully.

--------------
**Note 1**: as of the writing of this sample, the existing email resources for Concourse do not provide a mechanism to attach files to emails (or at least they are not documented), thus the motivation to write another simple email mechanism like this.
**Note 2**: the assets created in this sample (e.g. scripts and docker image) can be used as the starting point for a new email resource implementation for Concourse. Time permitting, that may be my next small project in the near future.

repository: amazted/concourse-pipeline-samples

repo_name: amazted/concourse-pipeline-samples


text:
---
title: Supported SharePoint App Models
page_title: Supported SharePoint App Models
description: Check our Web Forms article about Supported SharePoint App Models.
slug: sharepoint/2013/installation-and-deployment/supported-sharepoint-app-models
tags: supported,sharepoint,app,models
published: True
position: 0
---

# Supported SharePoint App Models

>caution Telerik Web Parts for SharePoint 2013 are retired with R2 2023 being their final release. Technical support will be available until June 2024 for eligible licenses.

##

The SharePoint 2013 Apps are divided into several types, depending on where they are hosted. The following list contains information about each type and whether Telerik® UI for ASP.NET AJAX support it:

* **Provider-hosted (supported)** - Developer or IT department provides the hosting structure for the application, so there is no limitation for the technology that can be used, including Telerik® UI for ASP.NET AJAX.

* **Autohosted (supported)** - The application is hosted in Windows Azure. In general Telerik® UI for ASP.NET AJAX support Azure.

* **SharePoint-hosted (not supported)** - This kind of app lives entirely in the client’s SharePoint environment and it is limited to using only HTML and JavaScript. Telerik® UI for ASP.NET AJAX depend on server rendering, so this scenario is not supported. You may use Kendo UI widgets. For more information visit [Introduction to Using Kendo UI in SharePoint Online – A “How To” Series](https://developer.telerik.com/featured/introduction-using-kendo-ui-sharepoint-online-series/).

More information on SharePoint app model can be found in [this MSDN article](https://msdn.microsoft.com/library/office/apps/fp179930%28v=office.15%29).

repository: telerik/ajax-docs

gha_language: C#

repo_name: telerik/ajax-docs


text:
# Lignyota Fr. GENUS

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Summa veg. Scand. (Stockholm), Section Post. 459 (1849)

#### Original name
Lignyota Fr.

### Remarks
null


text:
---
layout: single
title: "Week 8: Visual Display of Data Part 2"
permalink: /courses/6002Data/6002Week8/
author_profile: false

---

This week we will continue our exploration of graph-making in R.

This week we will focus on the basics of making a plot publication-quality.

### Lecture Topics
* What makes a plot publication-quality?
* Fixing axes, reordering factors, considering data-density
* Figure captions
* Exporting for publication
* Doing all of the above in both ggplot and base

### Resources

The most important resource this week is the [ggplot2 cheat sheet](https://github.com/rstudio/cheatsheets/raw/master/data-visualization-2.1.pdf)

The PACE system can be [accessed at this link](https://pacev2.apexcovantage.com/)

## Activities

Within the R project there is an analysis file with basic code for a couple of plots. In-class (not for marks) you will make one of these publication-quality.

## Code and Data
[Week 8 project](/assets/images/FISH6002_Week8.zip)

## Lecture slides

<script async class="speakerdeck-embed" data-id="b78fe47fe770476888becaa66d2be696" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script>

Slides available via [speakerdeck](https://speakerdeck.com/mi_fish_sci/fish-6002-week-8-displaying-data-visually-2)


text:
## Hetero Feature Selection Pipeline Example Usage Guide.

#### Example Tasks

This section introduces the Pipeline scripts for different types of tasks.

1. Selection by Fast-sbt Task:

    script: pipeline-hetero-feature-selection-fast-sbt.py

2. Selection by Iv Value Task :

    script: pipeline-hetero-feature-selection-iv-selection.py

3. Selection by Iv Top-k Task :

    script: pipeline-hetero-feature-selection-iv-top-k.py

4. Selection by Manually Task:

    script: pipeline-hetero-feature-selection-manually.py

5. Selection by Manually with Setting left columns Task:

    script: pipeline-hetero-feature-selection-manually-left.py

6. Multi-host Task:

    script: pipeline-hetero-feature-selection-multi-host.py

7. Multiple Input Isometric Model Task:

    script: pipeline-hetero-feature-selection-multi-iso.py

8. Selection by Percentage Value Task:

    script: pipeline-hetero-feature-selection-percentage-value.py

9. Selection with Setting Col-names Task:

    script: pipeline-hetero-feature-selection-select-col-names.py

10. Selection with Setting Col-indices Task:

    script: pipeline-hetero-feature-selection-select-cols.py

11. Selection by Multiple Methods Task:

    script: pipeline-hetero-feature-selection-selection.py

12. Single Predict Task:

    script: pipeline-hetero-feature-selection-single-predict.py

13. Selection with Setting Anonymous Col-names Task:

    script: pipeline-hetero-feature-selection-select-anonymous-col-names.py

14. Selection by Setting Anonymous Columns in Manually Filter:

    script: pipeline-hetero-feature-selection-anonymous-manually.py

15. Selection by Setting Anonymous Left Columns in Manually Filter:

    script: pipeline-hetero-feature-selection-anonymous-manually-left.py

16. Selection with VIF Filter:

    script: pipeline-hetero-feature-selection-vif.py

17. Selection with Pearson:

    script: pipeline-hetero-feature-selection-pearson.py

18. Selection with Pearson & Prediction:

    script: pipeline-hetero-feature-selection-pearson-predict.py

19. Selection with local-only filters:

    script: pipeline-hetero-feature-selection-local-only.py

20. Selection with Multi-class Data:

    script: pipeline-hetero-feature-selection-multiclass.py

21. Selection with Multi-class Data & All Filter Types:

    script: pipeline-hetero-feature-selection-multiclass-all-case.py

Users can run a pipeline job directly:

    python ${pipeline_script}

repository: FederatedAI/FATE

repo_name: FederatedAI/FATE


text:
---
templateKey: blog-post
title: The origin of the Hong Kong Cha Chaan Teng
date: 2018-11-07T07:55:00.000Z
description: >-
  If you live in Hong Kong you’ve definitely seen them around — diners forever
  bustling with locals, serving up an eclectic blend of Chinese, Western, and
  Japanese dishes on their menus. Have you ever wondered how they came to be?
featuredpost: false
featuredimage: /img/0_g4pz7aza9j-rn_pj.jpg
tags:
  - Hong Kong
  - Cantonese
  - Food
  - Culture
  - Chinese Food
---

![](/img/0_g4pz7aza9j-rn_pj.jpg)

_**The Bing Sutt**_

_Bing sutt_, the Cantonese reading of the characters “冰室” — meaning “ice” and “room” — were the original incarnations of _cha chaan teng’s_. They were first spotted around the 1940s, when the city was still under the rule of the British colonial empire. Influenced by the British customs of afternoon tea, bing sutt’s served a wide variety of drinks and light snacks such as baked goods and desserts, very much like the café franchises Starbucks or Pacific Coffee that we see nowadays. Central to their service was the way they served their food quickly and at cheap, affordable prices. The name “ice room” might have come about because of the cold drinks, shaved ice desserts, ice cream they tend to serve.

**The _Cha Chaan Teng_**

_Cha chaan teng_, with the characters “茶餐廳”, has the literal meaning of “tea restaurant”. A common perception is that they evolved from _bing sutt_ to meet the growing demands of customers, offering everything the _bing sutt_ had to offer in addition to full-cooked meals, from rice dishes to spaghettis to soup-instant noodles.

However, the true difference actually lies in the type of restaurant license owned by the two. _Bing sutt’s_ carry a “smaller” license that only allows them to carry cooked food items — dishes that don’t require a stove. The licenses carried by _cha chaan teng’s_ allowed them to cook in their kitchens, which is the reason why _cha chaan teng’s_ menus are so much more varied.

These days, locals generally refer to this sort of restaurant as _cha chaan teng_. While a small number of stores might still have the characters for _bing sutt_ in their name, they are _cha chaan teng_ through and through.

Whether you go to _cha chaan teng’s_ regularly or have never set foot in one, here are a few dishes and drinks that you will almost certainly find and definitely should try in all _cha chaan teng’s_ in Hong Kong:

![](/img/q1.png)

                                                      Meals and baked food

![](/img/q2.png)

Check out our[ Cantonese](https://fluentup.com/course-detail?id=5bc40ae96cac3e4dd37e7c4f) course to learn more of these useful Hong Kong food phrases for when you visit the city!

repository: architchoudhury/fluentup-blog-cms

gha_language: JavaScript

repo_name: architchoudhury/fluentup-blog-cms


text:
# MOTS2
Multi-Objective Tabu Search 2

# file structure

For each application, the folders are:

- bin: The output executables go here, both for the app and for any tests and experiments.
- build: This folder contains all object files, and is removed on a clean.
- config: create the development and production config files
- doc: Any notes, like  assembly notes and configuration files, are here.
- include: All project header files. All necessary third-party header files that do not exist under /usr/local/include are also placed here.
- lib: Any libs that get compiled by the project, third party or any needed in development. Prior to deployment, third party libraries get moved to /usr/local/lib where they belong, leaving the project clean enough to compile on our Linux deployment servers. This is used to test different library versions than the standard.
- experiments: smaller classes or files to test technologies or ideas, and keep them around for future reference. They go here, where they do not dilute the real application�s files, but can still be found later.
- src: The application and only the application�s source files.
- test: All test code files.

# python extension

python 3

# DevOps

Coverage:
[![Coverage Status](https://coveralls.io/repos/github/christos-tsotskas/MOTS2/badge.svg?branch=master)](https://coveralls.io/github/christos-tsotskas/MOTS2?branch=master)

# LICENCE

By cloning/downloading/forking this repository (or part of it), you automatically agree and accept the license terms.

Reference one of the following:

```
@article{tsotskas2015multi,
  title={Multi-Objective Tabu Search 2: First Technical Report},
  author={Tsotskas, Christos and Kipouros, Timoleon and Savill, Mark A},
  year={2015},
  publisher={Cranfield University}
}

@inproceedings{tsotskas2013biobjective,
  title={Biobjective optimisation of preliminary aircraft trajectories},
  author={Tsotskas, Christos and Kipouros, Timoleon and Savill, Mark},
  booktitle={International Conference on Evolutionary Multi-Criterion Optimization},
  pages={741--755},
  year={2013},
  organization={Springer Berlin Heidelberg}
}

@article{razzaq2013multi,
  title={Multi-objective optimization of a fluid structure interaction benchmarking},
  author={Razzaq, Mudassar and Tsotskas, C and Turek, S and Kipouros, T and Savill, M and Hron, J},
  journal={CMES: Computer Modeling in Engineering \& Sciences},
  volume={90},
  number={4},
  pages={303--337},
  year={2013}
}

@article{razzaq2010insight,
  title={Insight into Fluid Structure Interaction Benchmarking through Multi-Objective Optimization},
  author={Razzaq, M and Tsotskas, C and Turek, S and Hron, J and Kipouros, T and Savill, M},
  journal={Wiley InterScience},
  volume={2},
  pages={1--25},
  year={2010}
}

```

## license dependencies

MOTS2, on its own is licensed under the Apache model.

In addition, the following packages were also used that follow individual licensing schemes.

- easylogging++ , v9.96.4, https://github.com/muflihun/easyloggingpp, MIT license
- catch2, v2.2.2, https://github.com/catchorg/Catch2, BSL-1 license

# Future
add CI/CD with Travis