text:
**Day 34 - 13th Aug, 2018:** L1 Norm, L2 Norm, Max Norm

* Vector norm is nothing but the length or magnitude of the vector
* Just like co-ordinating systems, vectors are quite useful in many fields
* In Machine Learning too, we try to represent an example/sample with n factors/features in some N-dimensional space
* This is very essential for representation learning as the position of each example with respect to its position helps in inference
* Knowing vector magnitude is helpful in a number of ways
* There are different ways to derive and express the magnitude of a vector
* L1 norm, L2 norm and Max norm are three ways to calculate vector magnitude
* These can be used for regularization or as loss functions by the learning models

**L1 Norm** :
* L1 norm is also called as least absolute error
* This can be calculated by simply adding the different coordinate values together(when we assume the other point is at the origin)
```Python
# l1 norm of a vector
from numpy import array
from numpy.linalg import norm
a = array([1, 2, 3])
print(a)
l1 = norm(a, 1)
print(l1)
```

* When used as a loss function, it caluculates the sum of differences between actual and predicted values for every sample
* This way it gives a measure of how good or bad the machine learning model performed

**L2 Norm** :
* It is also called least squares
* In this norm or loss function, instead of sum of differences, the sum of squares of differences is taken to measure the vector distance or the loss
* This is how we can calulate L2 norm using Python :
```Python
# l2 norm of a vector
from numpy import array
from numpy.linalg import norm
a = array([1, 2, 3])
print(a)
l2 = norm(a)
print(l2)
```
* As a loss function, it calculates the sum of squares of differences between the actual and predicted values

**Max Norm** :
* This is the simplest of the three
* As the name suggests, max norm returns the maximum of all the values
* It can be calculated using the below code :
```Python
# max norm of a vector
from numpy import inf
from numpy import array
from numpy.linalg import norm
a = array([1, 2, 3])
print(a)
maxnorm = norm(a, inf)
print(maxnorm)
```

**How to choose between L1 and L2 norm?**
* The below table summarizes the differences between L1 and L2 norm

**Some Useful Links :**
* [Differences between the L1-norm and the L2-norm (Least Absolute Deviations and Least Squares)](http://www.chioka.in/differences-between-the-l1-norm-and-the-l2-norm-least-absolute-deviations-and-least-squares/)
* [Gentle Introduction to Vector Norms in Machine Learning](https://machinelearningmastery.com/vector-norms-machine-learning/)


text:
---
published: true
category: algorithms
layout: default
---
When given a sorted array, say a vector\<int\>, how would one go about constructing the binary search tree that has "maximized bushiness", or in other words, the most close configuration to being a heap, aka complete BST? Well, this one is easy. However, let's talk about a linked list.

In an array, the idea is very easy - we just take the median of every single array and make that the head of the current depth. We perform a recursive dfs to construct the tree this way. On leetcode, I wrote this code in \<5 minutes and had it approve in 2 tries.

```c++
// Helper function
TreeNode* recurseBuild(vector<int>& nums, int start, int end){
	if(start > end)
		return nullptr;
	int med = (start+end+1)/2;
	TreeNode* node = new TreeNode(nums[med]);
	node->left = recurseBuild(nums, start, med-1);
	node->right = recurseBuild(nums, med+1, end);
	return node;
}

// Main function
TreeNode* sortedArrayToBST(vector<int>& nums) {
	if(nums.empty()){
		return nullptr;
	}
	int med = nums.size()/2;
	TreeNode* root = new TreeNode(nums[med]);
	root->left = recurseBuild(nums, 0, med-1);
	root->right = recurseBuild(nums, med+1, nums.size()-1);
	return root;
}
```
This code is so simple that I probably don't need to explain it.

**Cough cough, anyways - that's not the main attraction of this blog post. Let's carry on.**

However, I was completely humbled by the tree construction algorithm for a list. I thought about it, and one idea that I had was to have 1 pointer find the half point by moving only half as fast as the other pointer. This would be the "median". However, this is a O(nlogn) algorithm. Using the master theorem, we see that the equation is:

> T(N) = 2\*T(N/2)+O(1)

Thus, we see that the algorithm is O(nlogn).

I saw this answer online, which was an in-order construction of the tree using the linkedlist. I was flabbergasted - how does he do this?

Here's the pseudocode just for those who tl;dr:

```
TreeNode* inOrderRecurse(ListNode*& node, start to end):
	if start > end: // means we passed a single node. A single node has start == end.
    	return null
    mid = avg of start and end
    // Left side
    TreeNode* left = inOrderRecurse(node, start to mid-1)
    // Middle side
    TreeNode* subroot = new TreeNode(node->val)
    node = node->next // Key point: We move this node(originally head) to the next node.
    // Right side
    TreeNode* right = inOrderRecurse(node, mid+1 to end)

    subroot->left = left
    subroot->right = right
    return subroot

TreeNode* sortedListToBST(ListNode* head):
	len := length of the list starting with head. Use a simple while loop.
    inOrderRecurse(head, 0 to len-1)

```

I never actually had much use of in-order traversal other than this before. The main point is that **even though it seems we're taking care of the middle node's value first, we're actually going all the way to the left, taking its value from head, and then going to the next node.**

The nature of an in-order traversal is of the following:

- It takes care of the left first, then the middle, then the right
- It will execute the tree-building such that there are no disjoint sets created in the process.
- It executes the subroutine in order(as the name suggests).
	- This causes our node = node-next code execute elegantly. It only is called in order, so the correct tree node will be given the correct node's value.

Anyways. This was pretty eye-opening. I thought in-order was only for printing, since I've never encountered a problem that really uses it.

Here's my C++ code:

```c++
TreeNode* inOrderRecurse(ListNode*& node, int start, int end){
	if(start > end)
		return nullptr;
	int mid = (start+end+1)/2;
	// Left side
	TreeNode* tleft = inOrderRecurse(node, start, mid-1);
    // Middle side
	TreeNode* tnode = new TreeNode(node->val);
	tnode->left = tleft;
	node = node->next;
	// Right side
	tnode->right = inOrderRecurse(node, mid+1, end);
	return tnode;
}

TreeNode* sortedListToBST(ListNode* head) {
	ListNode* node = head;
	int listLen = 0;
	while(node){
		node = node->next;
		listLen++;
	}
	return inOrderRecurse(head, 0, listLen-1);
}
```

Hope y'all enjoyed this one. :)

<script src="https://utteranc.es/client.js" repo="OneRaynyDay/oneraynyday.github.io" issue-term="pathname" theme="github-light" crossorigin="anonymous" async> </script>

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: CSS

gha_license_id: NOASSERTION

license_type: permissive


text:
#################
#   22/01/2021  #
#################

A typical RSS feed as a sequence of "items":
```xml
<item>
  <title>At Installation Mass, New Pope Strikes a Tone of Openness</title>
  <link>http://www.nytimes.com/2005/04/24/international/worldspecial2/24cnd-pope.html</link>
  <description>The Mass, which drew 350,000 spectators, marked an important moment in the transformation of Benedict XVI.</description>
  <author>By IAN FISHER and LAURIE GOODSTEIN</author>
  <pubDate>Sun, 24 Apr 2005 00:00:00 EDT</pubDate>
  <guid isPermaLink="false">http://www.nytimes.com/2005/04/24/international/worldspecial2/24cnd-pope.html</guid>
</item>
```

1. need url / url connection, to establish the connection, and get news feed.
	-->libcurl
2. need xml parser, to extract titles, descriptions, links, and articles from xml news feed files.
	-->expat
3. need a html parser, to analyse the web page and get the content of an article.
	-->(google)gumbo-parser
4. need tokenizer to segment words from articles, calculate the frequences and build index.
	-->streamtokenizer
5. the core index is the "word -> article" mapping.
6. this mapping can be stored in a hashset using word as the key.
	-->hashset/vector

#################
#   23/01/2021  #
#################

1. [done]CURL works
2. [done]Handout "librssnews.a" works only on linux, not on MACOS(darwin).
3. [done]Decided to use CURL + expat + streamtokenizer + hashset/vector, maybe gumbo-parser for HTML.

#################
#   24/01/2021  #
#################

1. [done]expat test passed!

#################
#   25/01/2021  #
#################

1. [done]article done!
2. [done]rssparser done!

to be continued:
1. hashmap
2. article_scanner
  2.1 rewrite streamtokenizer
  2.2 count frequencies

#################
#   26/01/2021  #
#################
1. [done]hashmap cancle, hashset is good enough!
2. [done]word tokenization is done!
3. [done]frequence counting is done!
4. [done]stopwords are loaded!

to be continue:
1. build index with bag of words.

#################
#   27/01/2021  #
#################
1. [done] indexer
2. [done] move curl connection module and gumbo parser module to working space. done!

to be continued:
1. test indexer

#################
#   28/01/2021  #
#################
1. [done] test_index.c download_articles()
2. [done] rewrite curlconne.c dump_url(), now it dumps web data into memory instead of local files.
3. [done] rssparser.c parserss() now accept input web page stream from memory.

to be continued:
0. optimize makefile source files dependencies
1. change htmlparser.c clean_test() so that it can also get input stream from memory.
2. establish the chain of data stream for "index_article(index *idx, article *atc);"

#################
#   29/01/2021  #
#################
1. [done] Optimize makefile source files dependencies.
2. [done] Create recursive makefile structure. Makefile in root directory will run
sub-makefile under unit-test repository.

to be continued:
1. change htmlparser.c clean_test() so that it can also get input stream from memory.
2. establish the chain of data stream for "index_article(index *idx, article *atc);"

#################
#   30/01/2021  #
#################
1. [done] define structure article and data in their own .c file.
2. [done] clean my code, reduce code coupling, especially the unit test.
3. [done] tokenizer.c now accept char * input stream.

to be continued:
0. set stopwords hashset as a field of tokenizer. user don't have to create themselves a hashset, and pass it to tokenizer. They just need to tell tokenizer where to find the
stopwords stream.
1. continue to clean the code, to minimize the coupling in unit test.

#################
#   31/01/2021  #
#################
3 Largely used C unit-test frameworks:
==> 1. [MinUnit](http://www.jera.com/techinfo/jtns/jtn002.html)
==> 2. [Check](https://libcheck.github.io/check/)
[Tutorial for Check](https://libcheck.github.io/check/doc/check_html/check_3.html). It also recommend to use [Autotools].
==> 3. [gtest](https://github.com/google/googletest)

Interesting Knowledges:
==> 1. Some discussion on topic of unit-test toolkits in C on stackoverflow:
<https://stackoverflow.com/questions/65820/unit-testing-c-code>
==> 2. Another way to build project using [Autotools](https://www.lrde.epita.fr/~adl/autotools.html), seems better than Makefile.
==> 3. A great pragmatic book of C programming: [C Programming FAQs: Frequently Asked Questions](http://c-faq.com/index.html)
==> 4. Another great reference: [CERT C Coding Standard](https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard)

Some thoughts:
1. Currently I wiil just include [MinUnit] as a basic unit-test Macro. I don't want to introduce too much complex into this project. Keep simple, keep foolish.
2. After finish basic features, we can try to use [Check] and [Autotools].

1. [done] decide to stick with naive unit-test code.
2. [done] python generate stopwords array data, and use "#include" load stopwords into array.

to do:
1. de-coupling unit-test
2. re-write article three fields

##############################
#   01/02/2021 - 07/02/2021  #
##############################
1. [done] rebuild all unit-test so far.
2. [done] finish testing vector, hashset, tokenizer, ...
3. [done] re-write article

todo:
1. test and clean legacy of article
2. test indexer

################
#   08/02/2021 #
################
[done] 1. optimize legacy of article
  [done] 1.1 rssparser
  [done] 1.2 htmlparser
[done] 2. identify duplicate articles
[done] 3. test data
[done] 4. re-write indexer

todo:
1. test indexer

#############################
#   09/02/2021 - 12/02/2021 #
#############################
[done] 1. learn to use lldb to debug
[done] 2. test index

[done] 3. move bag_into_index(), build_index() from index into engine
    engine
    /    \
tokenizer index

[done] 4. hashset<article> articles;
[done] 5. isolate test_hashset
[done] 6. isolate test_vector

todo:
1. engine.c, engine.h

##############
# 13/02/2021 #
##############
[done] 1. copy data when building bag_of_words
[done] 2. build_index() in engine

todo:
0. debug articles
1. search() in engine
2. curlconn.c treat 301 redirction

##############
# 15/02/2021 #
##############
[done] 1. debug articles
[done] 2. engine can run!

todo:
1. curlconn.c treat 301 redirection
2. try to write index into file, and also read it from file. No need to download article and build index everytime. Or I can optimize it with con-current programming.

##############
# 16/02/2021 #
##############
[done] 1. curlconn.c treat 301 redirection
[done] 2. rss_search user interface
[done] 3. test the whole application
[done] 4. entire application run successfully.

##############
# 17/02/2021 #
##############
[done] 1. take a break

##############
# 18/02/2021 #
##############
further optimization:
  1. concurrent curlconn
  2. data permanence

repository: helloShen/programming-paradigms

gha_license_id: MIT

repo_name: helloShen/programming-paradigms


text:
# Scroll to Presenter Plugin

A [COPRL](http://github.com/coprl/coprl) presenter plugin that provides scroll_to action to scroll the browser to an element on an event

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'scroll_to_presenter_plugin', git: 'https://github.com/coprl/scroll_to_presenter_plugin', require: false
```

And then execute:

    $ bundle

## Usage in POMs

Declare the plugin in your pom, `plugin :scroll_to`.

Inside an event block cll scroll_to with the element to scroll to.

    button :scroll do
      event :click do
        scroll_to :scroll_target
      end
    end
    (1..100).each do
      body '.'
    end
    title 'Thanks for scrolling here', id: :scroll_target

You can also pass the options `smooth`(truthy) and `offset`(pixels) to fine tune your scrolling experience.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/coprl/scroll_to_presenter_plugin.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the COPRL project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/coprl/coprl/blob/master/CODE-OF-CONDUCT.md).


text:
---
layout: post
title: OTAD#66 - R Weng
description: windless sailing
img: https://f4.bcbits.com/img/a1589332738_10.jpg
date: 2021-04-28 05:59:00-0400
---

Dig the labels your favorite artists release on, the advice that just keeps on giving. Yesterday and the day before yesterday we mentioned Temple records, label co-run by [Ex-Terrestrial](/music/64_otad/), M. Salaciak (a.k.a. [Variant](/music/65_otad/)) and finally R Weng, author of my pick of today. In direct continuation of the deep space ambient techno from Variant, here is R Weng’s take on the genre with his track Seven Years from the [EP Life Principles](https://templerecordsofficial.bandcamp.com/album/life-principles), released back in 2016.

    Life Principles by R Weng

    R Weng - Seven Years (2016)

While in the same genre, R Weng’s ambient techno is a lot less bleak than Variant’s. This track slowly builds into an epic yet comfortable journey, where a flute will guide your steps through a primordial forest, the likes of Princess Mononoke or Nausicaa. 11 minutes have passed, a comparatively small amount of time given the evocative power they carry. True aural anxiolytic, hush lullaby, all that is needed in the mid-week work rush. Peace out.

    Nausicaä of the Valley of the Wind by Hayao Miyazaki (1988)

gha_language: JavaScript


text:
# hugo-solid-theme
A solid theme for hugo.
Focus on minimalism and simplicity.
A plain text page without any extra functionality weighs in at around 300kb.
Because we're here to read your content, not to watch fancy mouseover animations.

![](readmeImg/screen.png)

## Features
### Series
Many times you start a series. For example a travel blog, or some instructional.
Well I don't like to type links out, so series following a specific format will
be dealt with automatically. Currently these features are added to series:

- Previous and Next arrows at top and bottom of posts

To be recognized as a series, you need to put all your posts in one folder like
this:

```
- araroa/
  1.md
  2.md
  3.md
  4.md
  5.md
  _index.md
  sum.md
```

You must name the files ascending numerically from 1. `sum.md` must be present
to state that it is indeed a series. This `sum.md` serves as a summary for the
whole series. In the future it is planned to have the contents of this file
filled out automatically with the titles of the individual posts so that it is
really a proper summary.

### Overloaded Categories
To support sub-categories I simply created a bunch of partials and layouts and turned the paging system into a categorization tool.

What you would do is to now have a different folder your posts.
Instead of `posts`, you would place official content under `blog`.
Actually you can put everything in `posts` if you rename the proper layout
folders, this will be the default in a future version.
Every folder in `blog` is a category as long as it has `_index.md` with the appropriate frontmatter.
Every folder in a category with `_index.md` is a sub-category.
There is no limit to the nesting, but I suggest 2 is a good number.

```
▾ content/
  ▾ blog/
    ▾ computing/
      ▾ graphics/
          _index.md
          intro.md
        _index.md
```

This creates a category of computing with a sub-category of graphics, with a page `intro.md`.

#### Required parameters

In your front matter you need to specify a few terms before the page can show up. Namely, the type, and the tags.
Both are used to narrow down the range of pages iterated through.

Hugo on its own does not care about sub-directories.
Thus, everything under `content` is called content, regardless of whatever folder it is in or whatever category it is under.
This is a little annoying, because it means pages like `about.md` or `contact.md` have to have special treatment, or they will show up on the main list that displays all pages.
Thus we specify a type as a filter.
Useless pages like `about.md` can have a type of for example `post`, and our content pages will have a type of `blog`.
So we do

```
type = "blog"
```

on **every** post under `blog`, **including** `_index.md`.
The main thing is that they must be the same. You can choose any word you want.
This is done in the `archetypes` so it is generated by the `hugo new` command.

Another parameter required is `categories`.
This is required to properly define the categories of the page.
It basically checks if 2 pages have intersecting category sets, if so, then they
are under the same category.

Let us demonstrate that with an example.
Let us return to this directory structure:

```
▾ content/
  ▾ blog/
    ▾ computing/
      ▾ graphics/
          _index.md
          intro.md
        _index.md
```

In `computing/_index.md` we would specify

```
categories = ["computing"]
```

and in `computing/graphics/_index.md` we would do:

```
categories = ["computing", "computing/graphics"]
```

and in `computing/graphics/intro.md` we would write:

```
categories = ["computing/graphics","computing","anything else"]
```

Then it would show up under both computing and computing/graphics.
If you were to specify only

```
categories = ["graphics"]
```

in `intro.md`, then it will not show up nowhere.

The forward slashes are there for the URL system to direct you to subcategories.
If we were to just specify `graphics` without `computing/graphics` then it would
be looking for a folder of `content/blog/graphics` which does not exist since it
is actually under `content/blog/computing/graphics`.
This is the simplest solution, and it is quite informative actually to know how
it you are currently nested in categories.

#### Making a list of all pages

You might want a home page to be the parent of all categories. Such a page will
display every single post you have. Well an empty `categories = []` will default
to becoming the parent of everything.

### Type of content

You may notice that we also have a gallery page. You can create new gallery
content similar to `blog` content, by placing the `.md` files or directories
under the `gallery` folder. However, note that the frontmatter has to be
altered, namely you need to set

```
type = "gallery"
```

Note that `gallery` and `blog` posts will never cross. You cannot find the same
post in both pages. This is due to the `type` parameter. Every list will only
list posts with the same `type` as itself.

This is also a good time to go through what the `type` means. The `type` of a
post is another way of classifying things. This time, I want my site to have a
picture gallery and a more text-oriented blog layout, so my posts with only
pictures go to `gallery` and the rest goes to `blog`. One can have different
styling, js, layouts, etc. from the other.

Currently only these two are provided out of the box. Any other types you define
you have to make sure you create the right layouts for them. Most importantly is
the `list_<type>.html` file. Otherwise, it will not show up anywhere.

### Frontmatter
There are a few things you can activate in the front matter.
These examples are in TOML, so you would enclose them in `+++`.
i.e.

```
+++
date = "..."
title = "..."
+++
```

Check the hugo docs to translate TOML to JSON or YAML.

#### Suggested Categories
Specify an array of `suggestedCategories` to have a sidebar show up in the list page with a few suggested categories.

Used in conjunction with overloaded categories.
For example:
```
suggestedCategories = ["computers", "misc/personal"]
```

Sub categories are denoted with slashes.
This is because it is a simple url substitution.
I do not find it ugly, in fact I think it makes it even clearer that we do not use a separate title.

#### Starred Pages
Now starred pages need a separate title.
Create a table (dictionary) with 2 entries, the title of the page and the url of the page.
For example:

```
[[starredPages]]
title="About"
url="/posts/about"
/
[[starredPages]]
title="My favorite food"
url="/categorized/food/my_fav_food"
```

Note the leading slash.
This creates a sidebar below suggested categories with the pages you specified, in the order you specified them.

#### FeatherLight

[Featherlight](https://noelboss.github.io/featherlight/) is a jQuery plugin that provides lightbox effects (click to expand images).

It is not loaded by default.
If you post requires it, just specify

```
useFL = true
```

In the front matter.

Featherlight also provides a gallery plugin.
If you have multiple images in a row, you can use this to allow users to click through your images.

Enable with:

```
useFLGallery = true
```

Be sure to use the shortcodes below to create these elements automatically!

### Shortcodes
#### sliderfigure
Creates a `<figure>` element with a before/after slider.
Plays an animation when it comes into focus. The slider will move right and then left again to entice the user to grab it.

Enable FL in the front matter first. Then:

```
{{< sliderfigure src1="/img/photography/after.jpg" src2="/img/photography/before.jpg" caption="Boom">}}
```

This is done in pure CSS so unfortunately, mobile browsers cannot drag the handle.
However as a workaround the animation for mobile browsers loop indefinitely.

#### lboxfigure
Creates a `<figure>` element with a lightbox effect, i.e. clickable image.

Enable FL in the front matter first. Then:

```
{{< lboxfigure thumb="src="/img/example/thumb.png" src="/img/example/1.png" caption="Fig. 1." style="width:10%" >}}
This is the caption.
{{</lboxfigure>}}
```

The parameters are fairly self explanatory. Something to note is that the style is applied onto the figure, not the image.

#### lboxgallery
Creates a gallery that has lazy loading and a lightbox effect, i.e. clickable image.

Enable FLGallery in the front matter first. Then:

```
{{< lboxgallery staticDir="static" parentDir="img/hello/" miniThumbDir="/minithumb" thumbDir="/thumb" fullDir="/full" style="width:10%">}}
{{</lboxgallery>}}
```

It will look for images in `staticDir/parentDir/thumbDir`, and create a gallery with the images there.
The images in the gallery will have lazy loading, so before the image is visible (off screen), a lightweight version of it with the **same name** is searched for under `minithumbDir` and loaded.
When it is scrolled into view it will be swapped out with the version in `thumbDir`.
When the user clicks on it, it will expand into a full-res version with the **same name** in `fullDir`.

This means you have 3 copies of the same image under 3 directories, each with different qualities and sizes.
You can omit `minithumbDir` however if you do not care for lazy-loading.
You can remove an image by removing it in `thumbDir` alone.
Removing images in `fullDir` without first doing it in `thumbDir` results in a blank white box to open.

You can provide text within the tags separated by '\' and it will become captioned in the lightbox. For example

```
{{< lboxgallery ...>}}
caption 1\
caption 2\
 \
caption 4\
{{< /lboxgallery >}}
```

Will give the first 4 images in that directory a caption each except for the third one.
Blank captions just skip by one.
Note that the captions appear *in* the lightbox, very unlike the captions created by `lboxfigure`.

| Param | Purpose |
| --- | --- |
| `staticDir`+ | The static directory. Most of the time its just "static". Will be omitted in the final URL |
| `parentDir`+ | The parent directory of all the images. |
| `style` | CSS styles for the images, defaults to `max-width:100%` |
| `class` | The class for the `figure` tag. Note it is applied to `figure` and not `image`. |
| `*Dir` | The directory of the images. We cover some of the image types below: |
| minithumb | An extremely small thumbnail to be loaded before lazy loading. Can be left empty to load nothing before that. Defaults to "minithumb" |
| thumb | The thumbnail to be loaded by lazy loading. Should be a normal thumbnail now. Defaults to "thumb" |
| full | The full image to be shown on clicking the image. Defaults to "full" |

+: Compulsory variable.

repository: podocarp/hugo-solid-theme

repo_name: podocarp/hugo-solid-theme


text:
# passenger-ruby

Passenger and Apache 2 Docker image suitable for using with a Ruby on Rails project (with SSL support).

## Prerequisites

Requires [Docker](https://www.docker.com) and runs on Mac OS or Linux using Shell Scripts.

## Usage

For a Ruby on Rails app ensure your Dockerfile includes the version of Ruby

Your Dockerfile must copy your apps root to /opt/app. That is where the base URL is. The example belows one way

	FROM aggronerd/passenger-ruby:2.2.2

	# Dependencies for building Gems
	RUN apt-get update -qq
	RUN apt-get upgrade -y
	# For nokogiri and a JS runtime
	RUN apt-get install -y libxml2-dev libxslt1-dev nodejs

	# Setup app and install dependencies using Bundler
	ADD Gemfile* $APP_HOME/
	RUN bundle --without=development install

	# Add the rest of your source
	ADD . $APP_HOME
	RUN chown -R www-data:www-data $APP_HOME

### Enabling SSL

Copy your public SSL certificate into /opt/ssl/cert and your private key into /opt/ssl/cert_key.

To enable HTTPS with HTTP redirecting to HTTPS:

	RUN a2ensite app_https
	RUN a2dissite app_http
	RUN chown -R www-data:www-data /opt/ssl
	RUN chmod -R 700 /opt/ssl

#### Self-signed

You can add a self signed config by adding the following to your Dockerfile

	RUN apt-get install -y openssl
	RUN openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=Your ISO country code/ST=Your State/L=Your Town/O=Your Company Name/CN=yourdomainname.com" -keyout $SSL_CERT_KEY_FILE -out $SSL_CERT_FILE
	RUN chown -R www-data:www-data /opt/ssl
	RUN chmod -R 700 /opt/ssl

#### Adding certificate chain

On top of being able to add private and public certificates you can add a chain file. In your Dockerfile adding the following.

	# Before this step add the file to the container
	ENV SSL_CERT_CHAIN_FILE="/opt/ssl/my_chain_file"

It is recommended not to include private certificates in your container. You could use your own version of the entrypoint.sh script which fetches the appropiate certificates from a secure service then pass in the environmental variables before calling apache.

## Building

Build for all the Ruby versions in RUBIES:

	./build.sh all

Build a container for a specific version of Ruby:

	./build.sh 2.2.2

repository: aggronerd/passenger-ruby

repo_name: aggronerd/passenger-ruby


text:
# MTU Introduction {#mtu_doc}
Maximum Transmission Unit is a term used to describe the maximum sized "thingy" that can be sent out an interface. It can refer to the maximum frame size that a NIC can send. On Ethernet that would include the Ethernet header but typically not the IGF. It can refer to the maximum packet size, that is, on Ethernet an MTU of 1500, would allow an IPv4 packet of 1500 bytes, that would result in an Ethernet frame of 1518 bytes.

# MTU in VPP
VPP allows setting of the physical payload MTU. I.e. not including L2 overhead. Setting the hardware MTU will program the NIC.
This MTU will be inherited by all software interfaces.

VPP also allows setting of the payload MTU for software interfaces. Independently of the MTU set on the hardware. If the software payload MTU is set higher than the capability of the NIC, the packet will be dropped.

In addition VPP supports setting the MTU of individual network layer protocols. IPv4, IPv6 or MPLS. For example an IPv4 MTU of 1500 (includes the IPv4 header) will fit in a hardware payload MTU of 1500.

_Note we might consider changing the hardware payload MTU to hardware MTU_. That is, the MTU includes all L2 framing. Then the payload MTU can be calculated based on the interface's configuration. E.g. 802.1q tags etc.

There are currently no checks or warnings if e.g. the user configures a per-protocol MTU larger than the underlying payload MTU. If that happens packets will be fragmented or dropped.

## Data structures
The hardware payload MTU is stored in the max_packet_bytes variable in the vnet_hw_interface_t structure.

The software MTU (previously max_l3_packet_bytes) is in vnet_sw_interface_t->in mtu[VNET_N_MTU].

# API

## Set physical MTU

This API message is used to set the physical MTU. It is currently limited to Ethernet interfaces. Note, this programs the NIC.

```
autoreply define hw_interface_set_mtu
{
 u32 client_index;
 u32 context;
 u32 sw_if_index;
 u16 mtu;
};
```

## Set the L2 payload MTU (not including the L2 header) and per-protocol MTUs

This API message sets the L3 payload MTU. E.g. on Ethernet it is the maximum size of the Ethernet payload. If a value is left as 0, then the default is picked from VNET_MTU_L3.

```
autoreply define sw_interface_set_mtu
{
 u32 client_index;
 u32 context;
 u32 sw_if_index;
 /* $$$$ Replace with enum */
 u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
};

```

## Get interface MTU

The various MTUs on an interface can be queried with the sw_interface_dump/sw_interface_details calls.

```
define sw_interface_details
{
  /* MTU */
  u16 link_mtu;

  /* Per protocol MTUs */
  u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
};
```

# CLI

```
set interface mtu [packet|ip4|ip6|mpls] <value> <interface>
```

repository: travelping/vpp

gha_language: C

repo_name: travelping/vpp


text:
# Project 2 : "Norris Inc. E-commerce webapp"
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Javascript](https://aleen42.github.io/badges/src/javascript.svg)
![React](https://aleen42.github.io/badges/src/react.svg)
![React-Router](https://aleen42.github.io/badges/src/router.svg)
![NodeJs](https://github.com/aleen42/badges/raw/master/src/node.svg)

> A simple E-commerce web aplication created with React during a web developer bootcamp by 4 awesome students that may already be full flegded developpers (check on their [Linked In](#who-are-we) profiles).

## View the deployed web application

[https://norris-e-commerce-app.netlify.app/](https://norris-e-commerce-app.netlify.app/)

## Table of Contents
- [:seedling: Some history](#seedling-some-history)
- [:lock: Constraints](#lock-constraints)
- [:rugby_football: Scrum Team](#rugby_football-scrum-team)
- [:question: Unmet needs](#question-unmet-needs)
- [:money_with_wings: Objectives](#money_with_wings-objectives)
- [:walking: User personas](#walking-user-personas)
- [:brain: Explorations + Decisions](#brain-explorations--decisions)
- [:link: Other information](#link-other-information)
- [License](#license)
- [Available Scripts](#available-scripts)

## :seedling: Some history
### Who are we?
We are [Yauheniya](https://www.linkedin.com/in/evgeniya-gabrikova/), [Jacopo](https://www.linkedin.com/in/jacopo-luri-1111081a2/),
[Mancini](https://www.linkedin.com/in/mancia08/) and [Carlos](https://www.linkedin.com/in/carlosaore/), 4 students of [Wild Code School](https://www.wildcodeschool.com/). At the moment these lines are being written, we are attending a ["Web developer"](https://www.wildcodeschool.com/en-GB/trainings/web-developer-full-time) bootcamp that is 5 months long and is teaching us all the technical know-how and knowledge to develop interactive websites using HTML, CSS, JavaScript, so we can take a React and Node JS development project to completion.

### Why did we create this?
After learning the fundamentals of React, we were asked to team up and develop a simple web application with a few constraints. Basically, we had to use React for the user interface, use data that would be fetched from an API of our choosing and we had close to 48 hours of allotted time in our agendas distributed in two months of calendar time. Other than that, we were given free rein to do whatever kind of app that we wanted in whatever style we wanted.

Despite coming from different backgrounds and from all over the world, we became friends very quickly, so we decided to form a team and work together for this project. After brainstorming and discussing, we ended up deciding to do a simple E-commerce web application following the current trends caused by the onset of the COVID-19 pandemic. We actually dreamed up a whole narrative about us being a Scrum Team working for a fictional company called “Norris Inc.”, and how we were asked to create the web app following a line of reasoning explained in the “Unmet needs” sections.

### How was it?
The project went very well, we were able to work together with little to no conflict and we actually succeeded in creating the web app that we wanted. We also learned a lot, both in term of coding know-how and about working in a web development project. We started using Scrum for the project management and we even completed two short sprints but then we decided that it wasn't a good fit for us, as a team of students and for such a time frame. So, even if we all liked very much to work with Scrum, we decided to switch to Kanban for the final leg of the project. We don't expect to always be switching the project management approach but, in this case, we felt that it was justified and it's also quite normal for students to want to experiment new things.

All in all, it was a very fun project, we learned a lot from it, and we will all treasure the moments spent together working as a team. We hope that you will like it and if you have any questions, comments or you want to reach us, you can do so thru our Linked In profiles:
- [Habrykava Yauheniya](https://www.linkedin.com/in/evgeniya-gabrikova/)
- [Luri Jacopo](https://www.linkedin.com/in/jacopo-luri-1111081a2/)
- [Mancini](https://www.linkedin.com/in/mancia08/)
- [Carlos Orellana](https://www.linkedin.com/in/carlosaore/)

## :lock: Constraints
- Use Scrum as best as possible to manage the project.
- Must use React.
- It has to be some kind of web application that uses data coming from an API.
- Time-boxed: 2 months of calendar time but actually just ~48 effective hours.
- Only 4 students as developers, no Scrum Master, no Product Owner and no specific boundaries other than the constraint stated above.

## :rugby_football: Scrum Team
We are pretending to be a Scrum team working under a fictional company called “Norris Inc.” that sells workwear through with a “direct-to-consumer” business model through an online E-commerce platform. The clothes are made by a third party to our specifications.

The company is located in a small but very populated European city (London) that has a lot of offices and businesses. In this city there are a lot of environmental regulations that make having a big physical store unfeasible and unpractical. The better option is to ship directly to the consumer but, again, because of regulations and narrow streets it is not possible nor practical to use big trucks.

As a response, Norris Inc. has his own logistic and shipping system that utilizes small warehouses all around the city and a big network of delivery cyclist. Norris Inc. has won all the environmental and business design awards because of this.

## :question: Unmet needs
The COVID-19 pandemic has a lot of people confined in their homes. This has been going on for some time now and will not change on the foreseeable future because people in the city don’t trust Putin’s vaccine and also have taken a liking to stay at home with their cats, Netflix, wine, food and pajamas. This is exactly what has disrupted our business model. Simply put, our customers no longer have a need for work clothes to wear around the office because they are working from home in their cat hair covered pajamas.

The folks in the marketing department saw that we now have an underutilized logistic and shipping system and also that a lot of small shops owners around the city are trying to sell their products to customers that no longer go to their physical stores because they aren’t leaving their houses as much. These shops owner’s unmet need is our opportunity: Norris Inc. can provide the shipping service and charge for that.

But then there is a second unmet need. Turns out that a most of these local stores around town have always sold from physical locations and have never needed (or wanted) to sell online until now. The pandemic is forcing everyone to adapt to this new world where nobody leaves the house. So, here again, the folks from marketing saw an opportunity. Since Norris Inc. already knows how to sell online, because that is what we do, we can also help the stores around the city to do it. This basically means that we have to provide an E-commerce platform for these shops, and we can also charge for this.

A third unmet need is that a lot of these small shops around the city proud themselves in offering top-notch customer service and a lot of after-sale service. They do it because they have cultivated a very long relationship with their clients. There are a lot of cases where a clientele has been shopping for the same products in the same shop for years and years. So, if we want to host these shops under our E-commerce platform, we must also provide a way for the customer service and after-sale service to happen. We have been told that meeting this “need” is paramount to the success of the project.

## :money_with_wings: Objectives
- Learn to work in a team.
- Learn about Scrum methodology, or at least the Agile approach.
- Learn to use React.
- Make a simple but beautiful E-commerce web application.
- Have fun.
- Get hired in a job or internship.

## :walking: User personas
### Persona #1: Buyer
- 60 years old (old timer, old school).
- Born in pre-internet era (boomer?).
- Does not know how to use technology that well so he / she has the habit of asking family members for help and calling customer service for assistance and guidance.
- Knows about eBay, Amazon, Etsy and other E-commerce websites from newspaper articles and other family members and friends but does not use them or cares about them particularly. He / she finds them too difficult to use, too crowded (information overload) and not user friendly specially because those sites don't have a number where you can call to get personalized assistance.
- Uses social media, particularly Facebook.
- He or she is a retiree so lots of disposable income (translation: not particularly looking for good deals but for quality products and specific products that he / she likes for whatever reason).
- Has a credit card but also likes to pay cash and to give tips.
- Struggles to use a smartphone.
- Has a smartphone but maybe with a small screen or it's an old model.
- Also has a desktop / laptop PC but it's old one with a small screen that is used primarly for Facebook and emails.
- Lives in the outskirts, probably in a posh city area with very good pedestrian infrastructure and local shops so he / she is used to a ~15 min leisurely walk to the local shops.
- Has been going to the same shops for 20 years so he / she still wants to keep buying from them
- Currently cannot leave the house because of quarantine.
- Still wants to shop on usual places but doesn't know how.

### Persona #2: Seller
- Small local store, been there since forever.
- Mom and pop store.
- “Brick and mortar”.
- Does not sell food or other perishable items.
- Sells technology, clothes, toys, small electronics, small household appliances, etc.
- Because of pandemic I can't sell in person so to keep the business I need to sell online but I don't know how.
- Provides a lot of after-sale service and customer service.
- Has an established clientele.
- Doesn't have warehouses or shipping service so there is trepidation about selling online.

## :brain: Explorations + Decisions
### Brainstorming
Since we were given very broad guidelines, we had to spend some time deciding what we want to do and how. During our initial brainstorm meeting we kept circling back to an E-commerce application that would be used to sell something: flights? trips? clothes? pet food, supplies, and services? This was done in a conference call using a google jamboard for quickly jotting down ideas.

On a second meeting we decided to try and figure out what would be out motivation, or justification for the project, which meant that we had to also figure out who we are in this scenario. This is where things started to get interesting and the idea kind of revealed itself to us (not unlike in a Scrum managed project, mind you). Then, we did a Joint Application Development (JAD) session to clearly define the need for the project (benefits, opportunities, problems, risks, etc.) and the scope (constraints, assumptions, success factors, etc.). We used the same tools as last time.

Finally, just to “iron out the details”, we met again and made some critical decisions about the personas that the project would be targeting, laid out epics and user stories and we prioritized them using the MoSCow methodology. For this we switched to google slides and mira. All of this sound like a lot of work but it actually took place in the span of two days and it allowed us to work with very clear objectives and purposes.

### Scrum
When it was time to begin to work, we realized that we were not completely comfortable with Scrum so after talking about it we decided run what we called a “mock sprint” with one team member acting as a "Scrum Master" and another one as a "Product Owner".

This "mock sprint" basically was a Sprint with a very small set of user stories that could be done in a couple of days. We started working without expecting very much of the result but trying to pay attention to the impediments and other kind of issue. This ended up being a very smart decision because it allowed us to see some fundamental issues with our project idea and correct our workflow and behavior to better match the agile [principles](https://agilemanifesto.org/principles.html).

With the lessons learned from the “mock sprint” (laid out in a retrospective meeting), we quickly did a sprint planning session, poker planning, etc. and we started to work with complete confidence in our idea. This actually worked so well that the only real impediment we had from that point forward was scrum itself. The cost of adhering to the ceremonies, user story format, etc. started to be bigger than the benefits we were getting. In the context of the bootcamp, this project is supposed to be a learning tool before getting to more serious projects. That’s why the allotted time was very short.

### The big change
At the end of that second sprint we decided to experiment with a leaner and faster project management approach. In truth, we were hesitant to do such a drastic change in the middle of the project, but we also believed that, as students, we are supposed to try and experiment so we can learn from different sources. Also, it could be argued that we were organically following agile principle, welcoming change, simplicity, result oriented, etc. Again, this decision proved to be good because we started to work a lot faster.

### Tools
We used Jira as our main tool to assist in the project management and Confluence to store and access all the documentation being produced (master project document, meeting notes, design guidelines, etc.) and Slack together with Google Meet as our platform for communication.

In the final stages of the project we asked our fellow students for feedback so we could fix any small bugs or UI issues that were still present. Having met the critical success factors, the web application was done. We still wanted to add more features, as per all the epics that we created, but we didn’t have anymore time and we also had already surpassed the expectation for the exercise. All in all, we really enjoyed working in this project and as a team, we learned a lot and we are excited about our future as developers.

## :link: Other information
- [Coding guidelines and resources](CGUIDELINES.md)
- [Design guidelines](DGUIDELINES.md)
- [Epics](EPICS.md)

## :cop: License
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).

## :construction_worker: Available Scripts
In the project directory, you can run:

### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

 The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

repository: Samikmalhotra/e-commerce-app

branch_name: refs/heads/main

repo_name: Samikmalhotra/e-commerce-app


text:
# enter
Bogus
verified doubles

## (using Bogus)

## (but also available in RSpec 3)

## previously: naïve stubbing

```ruby
require 'ostruct'

describe Weather do
  describe '#for' do
    it 'returns weather at vehicle’s location' do
      camaro  = OpenStruct.new
      weather = Weather.new
      camaro.location = 'Warsaw'
      expect(weather.for camaro).to be :outsideish
      camaro.location = 'Wrocław'
      expect(weather.for camaro).to be :insideish
    end
  end
end
```

## now: verified stubbing!

```ruby
require 'bogus/rspec'                               # a different require!

describe Weather do
  describe '#for' do
    it 'returns weather at vehicle’s location' do
      camaro  = fake :vehicle                       # this car is a fake!
      weather = Weather.new
      stub(camaro).location { 'Warsaw' }            # stubbin’
      expect(weather.for camaro).to be :outsideish
      stub(camaro).location { 'Wrocław' }           # stubbin’
      expect(weather.for camaro).to be :insideish
    end
  end
end
```

## crisis averted via doubles you can count on!

```no-highlight
$ rspec weather_spec.rb
```

```no-highlight
F

Failures:

  1) Weather#for returns weather at vehicle’s location
     Failure/Error: stub(camaro).location { 'Warsaw' }
     NameError:
       #<…> does not respond to location
     # ./weather_spec.rb:27:in `block (3 levels) in <top (required)>'

Finished in 0.00293 seconds
1 example, 1 failure

Failed examples:

rspec ./weather_spec.rb:24 # Weather#for returns weather at vehicle’s location
```

## (pure RSpec – this passes and shouldn’t)

```ruby
describe Weather do
  describe '#for' do
    it 'returns weather at vehicle’s location' do
      camaro  = double :vehicle                           # an RSpec double
      weather = Weather.new
      allow(camaro).to receive(:location) { 'Warsaw' }    # an RSpec stub
      expect(weather.for camaro).to be :outsideish
      allow(camaro).to receive(:location) { 'Wrocław' }   # another
      expect(weather.for camaro).to be :insideish
    end
  end
end
```

## (pure RSpec – the fix)

```ruby
describe Weather do
  describe '#for' do
    it 'returns weather at vehicle’s location' do
      camaro  = instance_double 'Vehicle'                # a verified double
      weather = Weather.new
      allow(camaro).to receive(:location) { 'Warsaw' }
      expect(weather.for camaro).to be :outsideish
      allow(camaro).to receive(:location) { 'Wrocław' }
      expect(weather.for camaro).to be :insideish
    end
  end
end
```

## (RSpec verified doubles also save the day)

```no-highlight
$ rspec weather_spec.rb
```
```no-highlight
F

Failures:

  1) Weather#for returns weather at vehicle’s location
     Failure/Error: allow(camaro).to receive(:location) { 'Warsaw' }
       Vehicle does not implement:
         location
     # ./weather_spec.rb:25:in `block (3 levels) in <top (required)>'

Finished in 0.0005 seconds
1 example, 1 failure

Failed examples:

rspec ./weather_spec.rb:22 # Weather#for returns weather at vehicle’s location
```

# RSpec verified doubles

* [available in RSpec
3](https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles)

* guard when doubling existing classes

* work like regular doubles
when doubling missing classes

* (is this good or bad?)

repository: chastell/talks

repo_name: chastell/talks


text:
---
layout: post
title:  "Welcome to Jekyll!"
date:   2016-05-12 16:53:50 +0800
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

{% highlight ruby %}
def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}

Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].

[jekyll-docs]: http://jekyllrb.com/docs/home
[jekyll-gh]:   https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/

---

## 新的Jekyll

> 第一需要新建一个站并把***_post***拷贝过来

* create new host

```
    gem update jekyll
    mkdir newhost && cd newhost
    jekyll new .
```

> 第二需要新的rakefile以生成post

* 这个[Rakefile]有快速部署的功能，但需要微调，例如open为vim，时间等，具体见diff。

* [Rakefile]的使用方法：

```
rake create_post[date,title,category,content]
```

[Rakefile]: https://github.com/kingkongmok/jekyll-rakefile

---

## 遗留问题

1. 本地使用jekyll server的时候提示***favicon.ico not found***

```
      Regenerating: 1 file(s) changed at 2016-05-13 11:00:42 ...done in 2.836243085 seconds.
      Regenerating: 1 file(s) changed at 2016-05-13 11:00:50 ...done in 2.926694952 seconds.
      Regenerating: 1 file(s) changed at 2016-05-13 11:01:19 ...done in 2.852907974 seconds.
      Regenerating: 1 file(s) changed at 2016-05-13 11:01:22 [2016-05-13 11:01:24] ERROR `/favicon.ico' not found.
...done in 3.012053543 seconds.
```

extension: markdown


text:
# lazy-routes-choo-example

A choo 🚂🚋🚋🚋 project tweaked to handle lazy routes (code splitted routes) with webpack

## Install

```sh
> yarn
```

## Usage

```sh
> npm start
```

Then go on `http://localhost:8080/lazy` to see a lazy-loaded route!

![demo](demo.png)

Here is the code behind the demo :

```js
// Do not forget to wrap the view fn!
const lazyLoadedView = (wrap) => System.import('./dependency.js').then(module => wrap(module.view))

app.router((route) => [
  route('/', view),
  route('/lazy', markAsLazy(lazyLoadedView)) //<-- Here is a lazy route
])

// The promise API is a necessary tradeoff ...
app.start()
.then(domTree => document.querySelector("#choo").appendChild(domTree))
```

## How does it work ?

I've tweaked the wayfarer, and choo libraries to handle lazy routes.

I've uploaded their local forks in the `forked-lib` folder and webpack aliases each lib to the content of this folder.

Have a look at [that issue](https://github.com/yoshuawuyts/sheet-router/issues/62) for more details. 😉

repository: YannickDot/lazy-routes-choo-example

repo_name: YannickDot/lazy-routes-choo-example


text:
---
layout: default
title: Contributing to CorrugatedIron
heading: Contributing to CorrugatedIron
subheading: Keen to help out? Awesome! Here's how..
menuitem: Contributing
---

Contributing is simple! We welcome all forms of contributations including:

* **Code** - Clone the [code repository][coderepo], make some changes and submit a pull request.
* **Code Samples** - Clone the [code samples repository][codesamplesrepo], make some changes and submit a pull request.
* **Documentation** - Clone the [site repository][docrepo], make some changes and submit a pull request.
* **Issues and Feature requests** - Head over to the [issues][] page and let us know the details.

You can also contact us directly if you need to:

* OJ - [Twitter][oj_twitter] | [Email][oj_email]
* Jeremiah - [Twitter][jeremiah_twitter] | [Email][jeremiah_email]

If all else fails, drop an email to the [Raik mailing list][riak_list] and someone will respond.

  [coderepo]: https://github.com/DistributedNonsense/CorrugatedIron "Source repo"
  [codesamplesrepo]: https://github.com/DistributedNonsense/CorrugatedIron.Samples "Samples repo"
  [docrepo]: https://github.com/DistributedNonsense/distributednonsense.github.com "Site/Docs repo"
  [issues]: https://github.com/DistributedNonsense/CorrugatedIron/issues "Issues page"
  [oj_twitter]: http://twitter.com/TheColonial "OJ @ Twitter"
  [oj_email]: http://www.google.com/recaptcha/mailhide/d?k=01K-UT5C0y0MyqZ6zgLLqurA==&c=i363A5AlYoCv9B0rr0MSeQ== "Email OJ"
  [jeremiah_twitter]: http://twitter.com/peschkaj "Jeremiah @ Twitter"
  [jeremiah_email]: http://www.google.com/recaptcha/mailhide/d?k=01_NXeaRnQPkTWhxxtVPKkmg==&c=5ZqimrR5L7K2JRZ8hkPjJD5Gx_E5XlFopkz8oq0Z0Dk= "Email Jeremiah"
  [riak_list]: http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com "Riak mailing list"


text:
---
templateKey: person
name: Kevin Ryan
linkedin: alleycorp.com
description: >-

  # Chairman and Founder, MongoDB, Zola, Workframe and Nomad Health

  Kevin P. Ryan is one of the leading Internet entrepreneurs in New York, having
  founded and serving as Chairman of several businesses, including MongoDB, Zola,
  Workframe and Nomad Health.  Previously he founded and was Chairman of
  Business Insider and GILT.  Combined, these companies have raised more than
  $700 million in venture capital funding and currently employ almost 2,000
  people.  Previously, Kevin helped build DoubleClick from 1996 to 2005, first
  as President and later as CEO.  He led DoubleClick's growth from a 20-person
  startup to a publicly traded global leader with over 1,500 employees.  In
  2013, Kevin was named one of “The 100 Most Influential New Yorkers of the Past
  25 Years” by the Observer.

   Aside from his professional responsibilities, Kevin serves on the board of Mercy Corps, is Vice Chairman of The Partnership for New York City, Chairman of the Partnership for New York City’s Innovation Council, is a member of the CFR Committee on Foreign Affairs, is on the Board of TECH:NYC and in Director Emeritus for Human Right Watch.  He previously served on the boards of Yale Corporation, INSEAD, The Trust for Governors Island, the Direct Marketing Association, The Ad Council, HotJobs and the advisory board of Doctors Without Borders.  He holds a B.A. from Yale University and an M.B.A. from INSEAD.
title: Partner
founder: true
pic: /img/kevin-ryan.png
boards:
  - logo: /img/innovation-council.png
    name: Chairman
    url: "https://innovateinnyc.org/#council"
  - logo: /img/partnership-for-nyc.png
    name: Vice Chairman
    url: "https://pfnyc.org/"
  - logo: /img/yale.jpg
    name: Alumni + Investment Committee
    url: "https://www.yale.edu/"
  - logo: /img/governors-logo.jpg
    name: Board Director
    url: "https://govisland.com/about/the-trust-for-governors-island"
  - logo: /img/mercycorps.jpg
    name: Board Director
    url: "https://www.mercycorps.org/"
  - logo: /img/technyc.png
    name: Board Member
    url: "https://www.technyc.org/"
  - logo: /img/hrw.png
    name: Director Emiritus
    url: "https://www.hrw.org/"
boardsSubheading: >-
  Kevin takes has taken an active role in supporting non-profits and
  institutions serving the greater good in NYC and around the world.
recognitions:
  - logo: /img/crains.png
    name: 50 Most Influential Business People
    url: "https://www.crainsnewyork.com/awards/40-under-40-class-2001"
  - logo: /img/ey.png
    name: Entrepreneur of the Year
    url: >-
      https://www.ey.com/us/en/about-us/entrepreneurship/entrepreneur-of-the-year
  - logo: /img/vanity-fair.png
    name: New Establishment List
    url: >-
      https://www.vanityfair.com/news/2011/09/the-2011-new-establishment-list--and-the-top-spot-goes-to---
  - logo: /img/observer.jpg
    name: 100 Most Influential New Yorkers
    url: "https://observer.com/2013/03/top-100/"
recognitionsSubheading: >-
  Kevin continues to be recognized for his achievements in the business and
  philanthropic worlds.
media:
  - logo: /img/fortune.png
    name: The Godfather of NYC Tech
    url: "http://fortune.com/2014/06/30/kevin-ryan-interview-gilt-groupe/"
  - logo: /img/wsj.png
    name: Silicon Alley Insider
    url: "https://www.wsj.com/articles/SB10001424052970203554104576655342371940156"
  - logo: /img/forbes.png
    name: The Duo Behind New York's Biggest Tech Companies
    url: >-
      https://www.forbes.com/sites/jjcolao/2013/07/24/gilt-10gen-doubleclick-meet-the-duo-behind-new-yorks-most-successful-tech-companies/#6e217c1a30c4
  - logo: /img/economist.jpg
    name: Making it Click
    url: "https://www.economist.com/business/2012/02/25/making-it-click"
  - logo: /img/mashable.jpg
    name: The Man Behind the Rise of Gilt & DoubleClick
    url: "https://mashable.com/2011/09/15/kevin-ryan-interview/#fYukTCEEoEqw"
  - logo: /img/inc.jpg
    name: The Chief Recruiter
    url: >-
      https://www.inc.com/magazine/20100301/the-chief-recruiter-kevin-p-ryan-alleycorp.html#
  - logo: /img/nyt.jpg
    name: AlleyCorp Churns Out Grab Bag of Tech Companies
    url: >-
      https://www.nytimes.com/2012/09/01/technology/alleycorp-seeds-a-blossoming-internet-hub-in-new-york.html
  - logo: /img/recode.png
    name: Fixing Healthcare Next
    url: "https://www.recode.net/2016/7/25/12276332/kevin-ryan-nomad-health-funding"
MediaSubheading: >-
  Kevin has been featured in top publications across the country for his efforts
  in tech and entrepreneurship.
engagements:
  - logo: /img/cnbc.png
    name: Broadcast Guest
    url: >-
      https://www.cnbc.com/video/2011/11/18/us-retailers-defy-consumer-crunch-with-positive-sales-results-.html
  - logo: /img/fox-business.jpg
    name: Broadcast Guest
    url: "https://video.foxbusiness.com/v/1118382116001/?#sp=show-clips"
  - logo: /img/techcrunch.png
    name: Disrupt NY Speaker
    url: "https://www.youtube.com/watch?v=K38i1GXOfPA"
  - logo: /img/yale-bschool.jpg
    name: Keynote Speaker
    url: "https://www.youtube.com/watch?v=00UQATZ0hJw"
  - logo: /img/inc.jpg
    name: Live Speaker
    url: "https://www.youtube.com/watch?v=j0PvLQLspSc"
  - logo: /img/business-insider.png
    name: Innovation Speaker
    url: "https://www.youtube.com/watch?v=j0PvLQLspSc"
  - logo: /img/nyc-tech-meetup.jpeg
    name: Fireside Chat
    url: "https://www.youtube.com/watch?v=PhgfHvwgZGw"
  - logo: /img/big-think.png
    name: Innovation Speaker
    url: "https://www.youtube.com/watch?v=jLr6mrfKQLY"
  - logo: /img/dld.png
    name: Speaker
    url: "https://www.youtube.com/watch?v=aqjtRya7PLU"
  - logo: /img/appnexus.png
    name: Speaker
    url: "https://www.youtube.com/watch?v=yVRatTvVExY"
EngagementsSubheading: >-
  Kevin has spoken on everything from innovation to recruiting on the major
  networks, as keynote at events, and speaker at institutions.
---

repository: alleycorp/website

repo_name: alleycorp/website


text:
# Manageable

**Manageable** protocol opens up a new dimension by providing an elegant way of acting as -
1. Object Mapper
2. Codable
3. True deep copy of an object

In short it lets you just plug & play incurring the responsibility of exploiting the powerful features of Swift itself and removing all the complexity for you so that you can focus on only the business logic and let Managable take care of the rest.

**Details**
 1. Manageable is a protocol so it can be followed by struct, class, protocol and enums.
 2. Manageable is helpful to **parse JSON and Dictionary<String, Any> into Object and vice versa**, works like object-Mapper.
 3. Manageable provides functionality of **cloaning/copy (true deep copy)** of objects without writing any extra lines and also without following NSObject, NSCopying, Just need to **call clone()** for the object
 4. Manageable **provides date decoding/encoding strategies to handle date format of desired types**. it provides the way to parse date in iso8601Full and yyyy-MM-dd. we can provide any specific date strategiy to our desired format by implementing the method:
     public static func dateDecodingStrategy() -> JSONDecoder.DateDecodingStrategy

# Quantum
 **Quantum is a special data type that is very useful in the follwoing cases**

 - let suppose we have an Object with a property id: Int but (in some cases) sometimes from backend in different APIs we are getting id as Int and in other APIs we are getting the same object with Id of type String (String containig Int).
 - In case of DataType changed from Int to float or Int to String

**Following type of things can be of type Quantum and can be managed easily without writing any specific code.**

- var age: Quantum = 10
- var age: Quantum = "10"
- var id: Quantum =       "12345"
- var _id: Quantum = "acdf1234Yt"

**We can also have the specific type from these in the following way:**

- let ageIntValue = age.intValue
- let ageStringValue = age.stringValue
- let idStringValue = id.stringValue
- let idIntValue = id.intValue

This is workable with data types like: Int, Float, Double, Bool, String

If in case casting using intValue or stringValue, or to any other type fails it returns the default value of that type.
for Int it will return 0, for String it will return "" (blank string) for bool it will return false and double and float it will return 0.0.

# Example

	struct Person: Manageable {

	    let _id: Quantum
	    var name: String
	    var age: Int
	    var dob: Date

	//  Use of enum CodingKeys in case of custom keys else it will pick varable names as defualt keys for the variables
	    enum CodingKeys: String, CodingKey {
		case _id = "person_id"
		case name = "person_name"
		case age = "person_age"
		case dob = "person_dob"
	    }

	    init(id: Quantum, name: String, age: Int, dob: Date) {
		self._id = id
		self.name = name
		self.age = age
		self.dob = dob
	    }

	    static func dateEncodingStrategy() -> JSONEncoder.DateEncodingStrategy {
		return .formatted(DateFormatter.yyyyMMdd)
	    }

	    static func dateDecodingStrategy() -> JSONDecoder.DateDecodingStrategy {
		return .formatted(DateFormatter.yyyyMMdd)
	    }

	}

**1. convert Object to JSON**

	    let person = Person(id: 10, name: "Xyz", age: 20, dob: Date())
	    let personJSONString = person.toJSONString()
	    print(personJSONString)

**2. Convert Object to Dictionary<String, Any>**

	    let personDictionary = try! person.toDictionary()
	    print(personDictionary)

**3. convert JSON String to Concrete objects**

	    let objPerson = Person.getObject(jsonString: personJSONString) // call getObjectList(jsonString: ) to parse if array of Person
	    print(objPerson)

**4. convert Dictionary<String, Any> to Concrete objects**

	    let objP = Person.getObject(dictionary: personDictionary) // call getObjectList(getObject: ) to parse if array of Person
	    print(objP)

	    // Creating copy/clone of an object
	    let newObj = person.clone()
	    print(newObj)

	    let anotherPerson = objPerson.clone()
	    print(anotherPerson)


text:
Hacktoberfest-2020

## instructions:
  - fork this repo (by clicking fork button can be found at top right side of the webpage).
  - clone the forked repo to local system,if(git installed on your pc,if not,install it).
  ```bash
  git clone <url of forked repo>
  ```
  example:
  ```
git clone https://github.com/<your_username>/hack_the_fest.git
  ```

  - after cloning,open the directory,
      - in that, make a directory/folder that related to your contribution!
          - if there is already a folder with that name that you want to create,then add your files to that
      - upload whatever userful content you can in your directory/folder!
         - i.e, ```hack_the_fest/wallpapers/ironmap.jpg```
      - after this commit your changes and push to master.
        ```bash
         git add .
        ```
        ```bash
        git commit -m "<your git username> contributed to hacktoberfest"
        ```
        ```bash
        git push origin master
        ```

  - open the forked repo ongithub website,if you are done with above steps,
      - then it prompts you to make a pull request, do that!
  - that's it, we will review the changes and merge with our repo!

## what you can contribute?
- coding problems/solutions.
- website landing pages.
- your recent web/app projects!
- your recent web/app projects!!
- illustrations.
- books.
- wallpapers(mobile/pc).
- upload whatever you like, but it should be userful/decent content.

## Some Frequently Asked Questions
1) My pull request was labeled as invalid by a maintainer, why doesn’t it count?
If a repository maintainer decides a pull request you made was spammy or an unhelpful contribution to the project, they can add an invalid or spam label to your PR. This lets us know they do not think your pull request is a quality contribution, so it will not count toward Hacktoberfest.

2) Why is my pull request in a maturing state on my profile?
In an effort to reduce spam and help maintainers, we’ve introduced a two week review period for all pull requests. Once you have submitted an eligible pull request (ready for review, not draft), the fourteen-day review window begins. This period gives maintainers time to identify and label any spammy pull requests as invalid. If your pull request is not marked invalid during that window, it will contribute toward the four you need to complete the Hacktoberfest challenge. If during this period your pull request is labeled as invalid, you will need to submit another eligible pull request (or resolve the issue with the current pull request), at which point the review period will start again.

3)My PR was labeled as invalid, but it isn’t. What should I do?
If a maintainer labels your pull request as invalid or spam, but you don’t believe this is correct, please begin a conversation with the maintainer within the PR and explain your position.

4) What is open source?
Open source refers to source code that is publicly accessible and allows anyone to inspect, modify or learn from it. Open source projects encourage collaboration and the freedom to use the software for any purpose you wish.

5) My pull request is marked as being on an excluded repository. What does this mean?
Unfortunately, your pull request was made on a repository that doesn’t align with the core values of Hacktoberfest. We’ve decided that pull requests made to this repository will not count toward completing the challenge.

### Thanks For Contributing!!!


text:
# o-squishy-list

`o-squishy-list` has been deprecated. There are no direct alternatives; please [contact](#contact) the team if you would like to use this component.

Hides lowest priority items when space does not allow.

- [Usage](#usage)
	- [Markup](#markup)
	- [Sass](#sass)
	- [JavaScript](#javascript)
- [Contact](#contact)
- [Licence](#licence)

## Usage

### Markup

Given a root HTML element, __o-squishy-list__ will assume each immediate element child is a _content item_.

#### Declaring content item priorities

The _content items_ should be given a `data-priority` attribute containing a positive integer to indicate its priority with regard to display. The lower the number the higher the priority. Low-priority items will be hidden first, high-priority items will be hidden last.

Priority numbers do not have to start from 1 or be consecutive: the values `20`, `34`, `80` are valid and express the same relative priorities as `1`, `2`, `3`.

Where multiple items share the same priority number, they will be hidden or shown at the same time. This allows declarative configuration of the behaviour - either all items hiding and showing at once, or each item hiding and showing individually - or a combination of the two.

If an item doesn't have a `data-priority` attribute, then it will be treated as lower priority than the lowest explicitly-set priority. Therefore if no items have the attribute, they will _all_ hide and show together.

An example with four items using three levels of priority (the last item will be assumed to be priority 3):

```html
<ul>
    <li data-priority="2">Medium priority item</li>
    <li data-priority="1">High priority item</li>
    <li data-priority="2">Medium priority item</li>
    <li>Low priority item</li>
</ul>
```

Sometimes you might want a particular content item to never be hidden. You can do this by setting its priority to `-1` to remove it from the priorities list.

#### More

If some cases you might want a 'more' item which will only show when content has been hidden due to insufficient space. Simply add another `<li>` with a `data-more` attribute. It should also have a `aria-hidden="true"` attribute:

```html
<ul>
    <li data-priority="2">Medium priority item</li>
    <li data-priority="1">High priority item</li>
    <li data-priority="2">Medium priority item</li>
    <li>Low priority item</li>
    <li data-more aria-hidden="true">More</li>
</ul>
```

When a _More_ item element is present, sufficient _content items_ will be hidden to make space for it to show. The width of the _More_ item should not be allowed to change, as only the initial width is used for the content filtering calculations.

The __More__ item will not be hidden, even if there is not sufficient space for it to show.

#### Hiding items manually

If you need to hide a list item manually via CSS or JS, you need to add the data-attribute `data-o-squishy-list--ignore` to that item. This way, `o-squishy-list` will stop adding that item to its item list.

```html
<ul class="drop-off">
    <li data-priority="2" data-o-squishy-list--ignore="true">Ignore me</li>
    <li data-priority="1">Priority 1</li>
    <li data-priority="3">Priority 3</li>
    <li>No priority</li>
</ul>
```

## Sass

The root element should have minimum and maximum widths set.

Items are hidden using `aria-hidden=true`. Adding `[aria-hidden="true"] { display: none; }` to your CSS will ensure your nav items appear and disappear as expected.

In order to calculate the total width required, items must be set to `display: inline-block` or `float: left`.

### Primary and core experience

When the JS has run, a `data-o-squishy-list-js` attribute will be set on the root element. This can be used in CSS selectors to target primary or core.

For core experience, it is recommended to style content items so that they can all be accessible when they are shown - e.g. via wrapping or scrolling.

The `data-priority` attributes could also be used in CSS selectors if you wanted to only show high-priority items in the core experience:

```css
nav li:not([data-priority='1']) {
    display: none;
}
```

### Javascript

#### Construction

No code will run automatically.

An __o-squishy-list__ object must be constructed for each container you want to filter.

```javascript
var oSquishyList = require('o-squishy-list');

var nav = new oSquishyList(document.getElementsByTagName('ul'));
```

A optional second argument can be passed, containing a configuration object, with the following possible properties:

* `filterOnResize` (boolean, default `true`) - if `true` will listen for the `window.resize` event and automatically call `.squish()`

#### Methods

* `squish()` Hide items of lowest priority that don't currently fit into the available width.
* `getHiddenItems()` Returns a list of the currently hidden item elements.
* `getRemainingItems()` Returns a list of the currently remaining item elements.
* `destroy()` Unbind events, un-hide items etc.

#### Events

This module will dispatch the following events on its root element:

* `oSquishyList.ready` - when the object has constructed.
* `oSquishyList.change` - when the item(s) in view change - e.g. items have been hidden or shown. The event object will contain the following properties:
    * `detail.hiddenItems` - array of the hidden item elements. This will be an empty array when all items are shown. The _more_ item will not be included in this array.
    * `detail.remainingItems` - array of the remaining item elements. This will be an empty array when all items are hidden. The _more_ item will not be included in this array.

A common use-case for this module is a variable-width navigation, where as the available space narrows, navigation items 'drop off' and are added to an expanded 'drop-down' menu.

To achieve this, products should listen to the `oSquishyList.change` event, and use the included list of hidden items to determine what to add to the expandable drop-down menu.

For example:

```javascript
document.getElementsByTagName('ul')[0].addEventListener('oSquishyList.change', function(ev) {
    if (ev.detail.hiddenItems.length > 0) {
        // Loop through ev.detail.hiddenItems array
        // Extract the useful data from each element & add it to the More Menu
    }
}, false);
```

---

## Contact

If you have any questions or comments about this component, or need help using it, please either [raise an issue](https://github.com/Financial-Times/o-squishy-list/issues), visit [#ft-origami](https://financialtimes.slack.com/messages/ft-origami/) or email [Origami Support](mailto:origami-support@ft.com).

----

## Licence

This software is published by the Financial Times under the [MIT licence](http://opensource.org/licenses/MIT).

repository: Financial-Times/o-squishy-list

repo_name: Financial-Times/o-squishy-list


text:
# jest-transform-stub-named

Jest doesn't handle non JavaScript assets by default.

You can use this module to avoid errors when importing non JavaScript assets.

Forked from `jest-transform-stub` the difference is that this library mocks every media file to return its filename. Makes it possible to test that the correct images are loaded for components.

## Usage

```shell
npm install --save-dev jest-transform-stub-named
```

In your Jest config, add jest-transform-stub-named to transform non JavaScript assets you want to stub:

```js
{
  "jest": {
    // ..
    "transform": {
      "^.+\\.js$": "babel-jest",
      ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub-named"
    }
  }
}
```

repository: isair/jest-transform-stub-named

repo_name: isair/jest-transform-stub-named


text:
Junc
====

Obvious map for [FastRouter](https://github.com/nikic/FastRoute/).

Install
-------

To install with composer:

```sh
composer require artoodetoo/junc
```

Usage
-----

Since this package only enhances FastRoute behavior, look at its documentation.
You have to realize how to use the route dispatcher.
Then come back here to see the difference in routes.

Junc replaces series of FastRoute's $r->addRoute() to one clear (static) roadmap.

### Example 1. Basic usage:

```php
<?php

require '/path/to/vendor/autoload.php';

$map = [
  '/users'                       => 'get_all_users_handler',
  '/user/{id:\d+}'               => 'get_user_handler',
  '/articles/{id:\d+}[/{title}]' => 'get_article_handler',
];
$dispatcher = FastRoute\simpleDispatcher(new R2\Junc\RouteMapper($map));

$httpMethod = $_SERVER['REQUEST_METHOD'];
$uri = rawurldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

$routeInfo = $dispatcher->dispatch($httpMethod, $uri);
switch ($routeInfo[0]) {
    case FastRoute\Dispatcher::NOT_FOUND:
        header('HTTP/1.0 404 Not Found');
        exit;
    case FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
        header("HTTP/1.0 405 Method Not Allowed");
        exit;
    case FastRoute\Dispatcher::FOUND:
        $handler = $routeInfo[1]['do'];
        $handler($routeInfo[2]);
        break;
}
```
*Note*:
$routeInfo[1] is not a string. It's array with at least one required key 'do'.
$routeInfo[2] is assotiative array of route variables ('id' & so on.)

### Example 2. Deep hierarchy with extra attribute (which inherits to all sub-routes):

```php
$map = [
    '/'                 => 'index',
    '/forum/{id:\d+}'   => 'view_forums',
    '/admin' => [
        'allow' => 'ROLE_ADMIN',
        '/'             => 'admin_dashboard',
        '/updates'      => 'admin_updates',
        '/user' => [
            '/'         => 'admin_user_list',
            '/{id:\d+}' => 'admin_user_view',
            '/new'      => 'admin_user_new',
        ],
    ],
];
```

### Example 3. Different methods:

```php
$map = [
    '/' => 'index',
    '/post/{id:\d+}' => [
        ['on' => 'GET',  'do' => 'read_post'],
        ['on' => 'POST', 'do' => 'write_post'],
    ],
];
```

### Example 4. Caching:

```php
$dispatcher = FastRoute\cachedDispatcher(
    new R2\Junc\RouteMapper($map),
    [
        'cacheFile' => __DIR__ . '/route.cache', /* required */
        'cacheDisabled' => IS_DEBUG_ENABLED,     /* optional, enabled by default */
    ]
);
```

repository: mushzak/dev-simba

repo_name: mushzak/dev-simba


text:
# Matchi Web Server

This is the web server for the Matchi app. Below is a description of the use cases required for testing.

## Use Case Tests

ServerIP: http://<IP_ADDRESS>/

This is a RESTful api. Requests are made with standard HTTP request methods GET, POST, and DELETE.
Requests will eventually use the PUT method, but these have not been implemented yet.

You may find it helpful to use resty to make HTTP requests - this can be found at https://github.com/micha/resty

If not, curl (https://curl.haxx.se/) may be helpful.

### Create user
HTTP POST request to the resource /api/users containing json content body with the keys
'firstname', 'lastname' and optionally 'email'. The server shall return json with the
keys 'userid' and 'AuthToken'.

### Get user
HTTP GET request to the resource /api/users/{userid} with the custom header 'AuthToken' the
'AuthToken' being the same as is returned when creating a user, as seen above. Without the 'AuthToken'
header, the server should return 'Unauthorised'.

### Delete user
HTTP DELETE request to the resource /api/users/{userid} with the custom header 'AuthToken' the
'AuthToken' the same as is returned when creating a user. Without the 'AuthToken' header, the server
should return 'Unauthorised'. Subsequest get requests for this user should fail with 'Unauthorised'.

## Built on the Lumen PHP Framework

[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
[![Latest Unstable Version](https://poser.pugx.org/laravel/lumen-framework/v/unstable.svg)](https://packagist.org/packages/laravel/lumen-framework)
[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)

Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.

### Official Documentation

Documentation for the framework can be found on the [Lumen website](http://lumen.laravel.com/docs).

### Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at<EMAIL_ADDRESS>All security vulnerabilities will be promptly addressed.

### License

The Lumen framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

repository: anowlandafez/MatchiServer

repo_name: anowlandafez/MatchiServer


text:
# Cicadocola cicadarum (Šulc) Bain, 1923 SPECIES

#### Status
ACCEPTED

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

#### Published in
Ann. Univ. Stellenbosch, Reeks A (1923)

#### Original name
Saccharomyces cicadarum Šulc, 1910

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
## v1.2.3 / 2005-06-08

### Highlights
* Having a .stylperjaderc file in the working directory is now optional
* Improved performance of main `process` function

### Changes
[v1.2.2...v1.2.3](https://github.com/benedfit/stylperjade/compare/v1.2.2...v1.2.3)

## v1.2.2 / 2005-06-08

### Highlights
* Return correct status code when unused or blacklisted classes are found via CLI

### Changes
[v1.2.1...v1.2.1](https://github.com/benedfit/stylperjade/compare/v1.2.1...v1.2.2)

## v1.2.1 / 2005-06-08

### Highlights
* Tidied up package using `.npmignore`

### Changes
[v1.2.0...v1.2.1](https://github.com/benedfit/stylperjade/compare/v1.2.0...v1.2.1)

## v1.2.0 / 2005-06-08

### Highlights
* Added support for directives via comments in CSS and Jade files
* Fixed issues where setting `options.stylperjaderc` incorrectly set `options.cwd`

### Changes
[v1.1.0...v1.2.0](https://github.com/benedfit/stylperjade/compare/v1.1.0...v1.2.0)

## v1.1.0 / 2005-06-05

### Highlights
* CLI not supports a catch all argument e.g. `stylperjade .` to find all CSS and Jade files in the current working directory
* Current working directory can now be passed to the API and CLI via `options.cwd` and `-C, --chdir` respectively
* Success messages in `results.report` and CLI output are now hidden by default and are only exposed when `options.verbose: true` or `-v, --verbose` are passed to the API or CLI respectively
* Errors are now always reported irrespective of whether verbose output is enabled or not
* Line number are now reported for classes found in Jade `#[]` syntax blocks

### Changes
[v1.0.0...v1.1.0](https://github.com/benedfit/stylperjade/compare/v1.0.0...v1.1.0)

## v1.0.0 / 2005-05-21

### Highlights
* File name patterns can now be added to `options.ignoreFiles` to whitelist all classes found in those files
* CLI support

### Changes
[v0.3.6...v1.0.0](https://github.com/benedfit/stylperjade/compare/v0.3.6...v1.0.0)

## v0.3.6 / 2015-04-13

### Highlights
* Line numbers are now reported for nested classes in .jade files
* Unhandled errors in CSS and Jade files are now more helpfully returned
* The use of Jade tag interpolation no longer throws errors, but line number are still not reported

### Changes
[v0.3.5...v0.3.6](https://github.com/benedfit/stylperjade/compare/v0.3.5...v0.3.6)

## v0.3.5 / 2015-03-27

### Highlights
* 100% test coverage

### Changes
[v0.3.4...v0.3.5](https://github.com/benedfit/stylperjade/compare/v0.3.4...v0.3.5)

## v0.3.4 / 2015-03-12

### Highlights
* File names can now be added to `options.cssWhitelist` and `options.jadeWhitelist` to whitelist all classes found in those files

### Changes
[v0.3.3...v0.3.4](https://github.com/benedfit/stylperjade/compare/v0.3.3...v0.3.4)

## v0.3.3 / 2015-03-11

### Highlights
* Only parse source map once per CSS file, rather than on ever rule found in the stylesheet.
* Paths in `results` where source maps are used are now reported relative to the location of the `.stylperjaderc` file

### Changes
[v0.3.2...v0.3.3](https://github.com/benedfit/stylperjade/compare/v0.3.2...v0.3.3)

## v0.3.2 / 2015-03-09

### Highlights
* Pass file path to `jade-lexer` for better debugging

### Changes
[v0.3.1...v0.3.2](https://github.com/benedfit/stylperjade/compare/v0.3.1...v0.3.2)

## v0.3.1 / 2015-03-09

### Highlights
* Use source map to report location of CSS classes
* Dedupe file locations that are on the same line in `results.report`

### Changes
[v0.3.0...v0.3.1](https://github.com/benedfit/stylperjade/compare/v0.3.0...v0.3.1)

## v0.3.0 / 2015-03-05

### Highlights
* Improve format of `results.report` to include file names and line numbers
* CSS classes arrays returned in callback now contains list of file locations and line numbers

### Changes
[v0.2.13...v0.3.0](https://github.com/benedfit/stylperjade/compare/v0.2.13...v0.3.0)

## v0.2.13 / 2015-03-02

### Highlights
* Add support for comments in `.stylperjaderc` via [JSON.minify()](https://github.com/getify/JSON.minify)

### Changes
[v0.2.12...v0.2.13](https://github.com/benedfit/stylperjade/compare/v0.2.12...v0.2.13)

## v0.2.12 / 2015-03-02

### Highlights
* Add support for loading options via `.stylperjaderc` file

### Changes
[v0.2.11...v0.2.12](https://github.com/benedfit/stylperjade/compare/v0.2.11...v0.2.12)

## v0.2.11 / 2015-02-26

### Highlights
* CSS class parsing now finds classes in media queries

### Changes
[v0.2.10...v0.2.11](https://github.com/benedfit/stylperjade/compare/v0.2.10...v0.2.11)

## v0.2.10 / 2015-02-26

### Highlights
* Whitelisting and Blacklisting support
* Parsing of Jade classes found in ternary operators and other JavaScript logic lines found in Jade files
* Class pattern matching via [minimatch](https://github.com/isaacs/minimatch)

### Changes
<EMAIL_ADDRESS>

license: ISC

repository: tpgmartin/stylperjade

repo_name: tpgmartin/stylperjade


text:
# Dipping Chocolate w/ paraffin wax

## Equipment
* double boiler (large sauce pan for boiling water, smaller sauce pan or bowl to melt chocolate in)

## Ingredients
* 12 oz chocolate (chopped if not in chip form)
* 1 oz canning paraffin wax (such as Gulf wax, look in the canning aisle in the store)

## Instructions - abridged
1. fill bottom of a double boiler with water, bring to boil
2. While water boils, chop the paraffin into small pieces.
3. when water boils, remove from heat. melt paraffin wax in top pan of double boiler
4. when wax is melted, place the chocolate in the top pan of double boiler with the melted wax
5. Let the chocolate sit and melt, stir occasionally. when chocolate is almost entirely melted, remove from double boiler.
6. stir chocolate off heat until it is fully melted. let sit for about 10 minutes to cool slightly before use.

## Instructions - detailed
1. Fill the saucepan on the bottom with a few inches of water or just enough to create heat and steam. Bring the water to a rolling bowl, uncovered.
2. While water boils, chop the paraffin into small pieces.
3. Turn off the heat and remove. If the water is too hot (really steaming), let it cool a bit or the chocolate will seize, become grainy or burn when placed on top.
4. melt paraffin wax in top pan of double boiler
5. when paraffin wax is melted, place the chocolate in the top pan of double boiler with the melted wax
6. Let the chocolate sit and melt from the indirect heat from the steam. Stir the chocolate occasionally until it ALMOST melts (it will still retain some of its shape and look shiny). If the water cools too much, remove the top pot and reheat before proceeding.
7. Remove the top of the double boiler, and stir the chocolate very well until fully melted. The chocolate will be about 115 to 120 degrees F when measured with a Chocolate Thermometer. If some pieces of chocolate remain unmelted, repeat heating it over the double boiler for a few seconds at a time, taking care not to burn it. Stir gently.
8. Let the chocolate sit for about 10 minutes to cool slightly, and give it a good stir before using.
9. dip whatever in the chocolate, place on a waxed-paper lined cookie-sheet and allow to harden. 15 minutes to 1 hour, depending on ambient temperature.

## Notes
* the wax gives the chocolate a sheen and helps it not melt are room temperature.
* there is some debate as to the safety of using wax in chocolate, but most sources seem to think its perfectly fine:
  * [wax is going to kill you according to some guy on the internet](http://www.ochef.com/674.htm)
  * [FDA says its fine](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=175.250)
* there is a more complicated method to use with nicer chocolate called [tempering](https://blog.kingarthurflour.com/2014/01/31/a-basic-guide-to-tempering-chocolate/) that can achieve the same results
* supposedly you can use [cocoa butter](http://www.chefeddy.com/2010/03/temper-or-pre-crystallize-chocolate-using-cocoa-butter/) or [shortening](http://www.geniuskitchen.com/recipe/perfect-dipping-chocolate-199367) instead of wax to similar effect.

### Trial 1
There were a few chunks of unmelted paraffin wax in the final melted chocolate product. It didn't get in the way in the end but was annoying. Not sure why this happened yet. Might try melting chocolate and paraffin in separate pans and mixing them together next time. The chocolate had a nice bright sheen, but still melted rather easily in your hands. Ended up keeping them chilled to prevent melting. Wax might not have been distributed well, or maybe I just used crappy chocolate or the method is flawed.

## Sources
* [craftybaking.com chocolate melt](https://www.craftybaking.com/howto/chocolate-melt) - great general source for different chocolate melting techniques
* [geniuskitchen.com dipping chocolate](http://www.geniuskitchen.com/recipe/the-best-dipping-coating-chocolate-ever-282722)
* [reddit thread on paraffin wax viability/alternatives](https://www.reddit.com/r/Cooking/comments/3w828j/candy_coating_for_the_lazy_xpost_from_raskculinary/)
* [lots of detailed info on dipping chocolate](https://www.lovefromtheoven.com/melting-chocolate-to-make-cake-pops-chocolate-pretzels-chocolate-covered-marshmallows-and-more/)

repository: macgregor/cooking-journal

repo_name: macgregor/cooking-journal


text:
# Three in one
Describe how you could use a single array to implement three stacks.

# Solutions:

# Swift
```
O(n)
```

# Installation
Run `make` to build and run C++ files and run Swift files. Or you can run `.playground` file.

repository: Voley/Algorithmic-Problems

repo_name: Voley/Algorithmic-Problems


text:
# Go Simple In Memory DB

## Getting Started

Small In Memory DB for local development, no need to install Redis or whatsoever.
Just Run the DB server and use it to fiddle with your memory.
Note : this DB is not persistent, Don't use it in production.

### Prerequisites

(https://golang.org/doc/install) - How to get started with Go Lang

```
Give examples
```

### Installing

A step by step series of examples that tell you how to get a development env running

Say what the step will be

```
git clone
```

And

```
go run in-memory-db.go --port=8080 (default is 8080)
```
OR
```
go build in-memory-db.go
```
then
```
./in-memory-db --port=8080 (default is 8080)
```

then through Telnet or any TCP connection
```
telnet <IP_ADDRESS> 8080
```

### Usage
to SET data
```
SET key value
```

to GET data
```
GET key
```

to check if key isset
```
ISSET key
```

to set linked list
```
Lset key
```

to get data from linked list
```
LGET key
```

to delete linked list
```
LDEL key
```

to push in linked list
```
LPUSH key value1 value2 etc...
```

to remove last element in linked list
```
LPOP key
```

to push in left of linked list
```
LSHIFT key value
```

to remove from left of linked list
```
LUNSHIFT key
```

to remove value in linked list
```
LRM key value1 value2 etc...
OR
LREMOVE key value1 value2 etc...
```

to remove values in linked list using (index) int
```
LUNLINK key index1 index2 etc...
```

to get value using (index) int
```
LSEEK key index
```
to set hashtable
 ```
 HSET key
 OR
 HSET key value1 value2 etc...
 ```

 to get data from hashtable
 ```
 HGET key
 ```

 to delete hashtable
 ```
 HDEL key
 ```

 to push element in hashtable
 ```
 HPUSH key value1 value2 etc...
 ```

 to remove element from hashtable
 ```
 HRM key value1 value2 etc...
 OR
 HREMOVE key value1 value2 etc...
 ```
to dump data to screen
```
DUMP
```

to Delete
```
DEL key
```

to clear memory
```
CLEAR
```

supporting namespacing, you can switch databases by using
```
USE key
```
to switch back to `master` database simply run
```
USE master
```

to list all open databases
```
SHOW
```

and to get which is the current database
```
WHICH
```

to close the connection
```
BYE
```
and Help
```
HELP
```

## License

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

repository: alaaelgndy/go-in-memory-db

repo_name: alaaelgndy/go-in-memory-db


text:
# Lib16 RSS Builder for PHP 7
A library for creating RSS feeds written in PHP 7.

[![Build Status](https://travis-ci.com/lib16/rss-builder-php.svg?branch=master)](https://travis-ci.com/lib16/rss-builder-php)
[![Coverage](https://codecov.io/gh/lib16/rss-builder-php/branch/master/graph/badge.svg)](https://codecov.io/gh/lib16/rss-builder-php)

## Installation with Composer
This package is available on [packagist](https://packagist.org/packages/lib16/rss), so you can use [Composer](https://getcomposer.org) to install it.
Run the following command in your shell:

```
composer require lib16/rss
```

## Basic Usage
Example markup is taken from [en.wikipedia.org/wiki/Rss](https://en.wikipedia.org/wiki/Rss)

```php
<?php
require_once 'vendor/autoload.php';

use Lib16\RSS\Channel;
use Lib16\RSS\RssMarkup;

$channel = Channel::create(
    'RSS Title',
    'This is an example of an RSS feed',
    'http://www.example.com/main.html'
);
$channel
    ->pubDate(new DateTime('2010-09-06 00:01 +0'))
    ->lastBuildDate(new DateTime('2009-09-06 16:20 +0'))
    ->ttl(1800);

$channel
    ->item(
        'Example entry',
        'Here is some text containing an interesting description.',
        'http://www.example.com/blog/post/1'
    )
    ->guid('7bd204c6-1655-4c27-aeee-53f933c5395f', false)
    ->pubDate(new DateTime('2009-09-06 16:20 +0'));

RssMarkup::headerfields('example');
print $channel;
```
… generates the following output:

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
    <channel>
        <title>RSS Title</title>
        <description>This is an example of an RSS feed</description>
        <link>http://www.example.com/main.html</link>
        <pubDate>Mon, 06 Sep 2010 00:01:00 +0000</pubDate>
        <lastBuildDate>Sun, 06 Sep 2009 16:20:00 +0000</lastBuildDate>
        <ttl>1800</ttl>
        <item>
            <title>Example entry</title>
            <description>Here is some text containing an interesting description.</description>
            <link>http://www.example.com/blog/post/1</link>
            <guid isPermaLink="false">7bd204c6-1655-4c27-aeee-53f933c5395f</guid>
            <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
        </item>
    </channel>
</rss>
```


text:
# Sets

A _Set_ is an unordered type which stores data as a collection of unique _items_. A Set is not inherently meant to be accessed directly. Sets in the PTL are realized as standard NBT arrays:
```
MySet = [2.71828f,{foo:{bar:"baz"}},"minecraft:stone_button",13]
```

The following operations on Sets are provided, either as functions or translatable snippets:
* `add : <Self> <Item> -> <Self>`
  * Adds `<Item>` to `<Self>`
  * Does nothing if `<Item>` is already present in `<Self>`
* `and : <Self> <Other> -> <Self>`
  * Returns the Set of all items in `<Self>` and `<Other>`
* `diff : <Self> <Other> -> <Diff>`
  * Removes all items in `<Other>` from `<Self>` if they are present
* `length : execute store result <$score> <obj> run data get <locale> <path-to-Self>`
  * Stores the length of `<Self>` in `<$score> <obj>`
* `or : <Self> <Other> -> <Self>`
  * Returns the Set of all items in `<Self>` or `<Other>`
* `subset : <Self> <Other> -> <$subset>`
  * Returns whether `<Other>` is a subset of `<Self>`