text:
project_path: /web/_project.yaml
book_path: /web/ilt/pwa/_book.yaml

{# wf_auto_generated #}
{# wf_updated_on: 2018-09-19 #}
{# wf_published_on: 2016-01-01 #}

# Lab: Workbox {: .page-title }

## Overview

[Workbox](https://workboxjs.org/) is the successor to  [`sw-precache`](https://github.com/GoogleChrome/sw-precache) and  [`sw-toolbox`](https://github.com/GoogleChrome/sw-toolbox). It is a collection of libraries and tools used for generating a service worker, precaching, routing, and runtime-caching. Workbox also includes modules for easily integrating  [background sync](/web/tools/workbox/modules/workbox-background-sync) and  [Google Analytics](/web/tools/workbox/modules/workbox-google-analytics) into your service worker.

In this lab, you'll use the `workbox-sw.js` library and the `workbox-build` Node.js module to build an offline-capable progressive web app (PWA).

#### What you'll learn

* How to write a service worker using the `workbox-sw.js` library
* How to add routes to your service worker using `workbox-sw.js`
* How to use the predefined caching strategies provided in `workbox-sw.js`
* How to augment the `workbox-sw.js` caching strategies with custom logic
* How to generate a production-grade service worker with `workbox-build`

#### What you should already know

* Basic HTML, CSS, and JavaScript
* ES2015 Promises
* How to run commands from the command line
* Some familiarity with service workers is recommended
* Familiarity with Node.js and gulp is recommended

#### What you will need

* Computer with terminal/shell access
* Connection to the internet
* A  [browser that supports service worker](https://jakearchibald.github.io/isserviceworkerready/)
* A text editor
*  [Node.js](https://nodejs.org/en/) and  [npm](https://www.npmjs.com/)

## 1. Get set up

If you have not downloaded the repository and installed the  [LTS version of Node.js](https://nodejs.org/en/), follow the instructions in [Setting up the labs](setting-up-the-labs).

### 1.1 Install project dependencies and start the server

Navigate to the `project/` directory via the command line:

    cd workbox-lab/project/

Run the following command to install the project dependencies:

    npm install

Then build and serve the app with the following command:

    npm run serve

You can terminate the `serve` process at any time with `Ctrl-c`.

#### Explanation

The `npm install` command installs the project dependencies based on the configuration in `package.json`. Open `project/package.json` and examine its contents.

The important package is  [`workbox-build`](/web/tools/workbox/guides/precache-files/workbox-build), which is a module used to generate a list of assets that should be precached in a service worker. You'll see how that's used in a later step.

Also note that the `serve` script aliases the `gulp serve` command.

The remaining dependencies in `package.json` are used by gulp in `gulpfile.js`.

Open `gulpfile.js` and examine its contents. The gulp `build` task "builds" the app; in this case by copying the `src/` files into a `build/` directory (using the `clean` and `copy` tasks). The `serve` task builds the app (with the build task) and then the `build/` directory served and `watch`ed. The `watch` functionality ensures that the app is rebuilt whenever `src/` files are updated.

Since we ran the gulp `serve` task with `npm run serve`, the app should be built and served on `localhost:8081/`.

Why didn't we just run the `gulp serve` task directly? First, running gulp from the command line requires a global installation of the gulp command line tool. Second, relying on a global installation gives us less control over the gulp version used since `package.json` only specifies the local gulp version, but not any global versions. Aliasing `gulp` commands with `npm scripts` in `package.json` allows us to work around these issues and use the local gulp package directly.

### 1.3 Open the app and explore the code

Open the app in your browser by navigating to `localhost:8081/`. The app is a news site containing some "trending articles" and "archived posts". We will be performing different runtime caching strategies based on whether the request is for a trending article or archived post.

Note: [Unregister](tools-for-pwa-developers#unregister) any service workers and [clear all service worker caches](tools-for-pwa-developers#clearcache) for localhost so that they do not interfere with the lab. In Chrome DevTools, you can achieve this by clicking __Clear site data__ from the __Clear storage__ section of the __Application__ tab.

Open the `workbox-lab/project/` folder in your text editor. The `project/` folder is where you will be building the lab.

This folder contains:

* `src/images/` folder contains sample images
* `src/js/animation.js` is a javascript file for page animations
* `src/pages/` folder contains sample pages
* `src/style/main.css` is the stylesheet for the app's pages
* `src/sw.js` is where we will write our source service worker using `workbox-sw.js`
* `src/index.html` is the home page HTML file
* `gulpfile.js` configures gulp tasks
* `package.json` and `package-lock.json` track Node.js dependencies

All of the `src/` files were also copied over to the `build/` folder as mentioned in the previous section.

## 2. Write a basic service worker using workbox-sw

Now that we have the starting app working, let's start writing the service worker.

In the empty source service worker file, `src/sw.js`, add the following snippet:

```
importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.4.1/workbox-sw.js');

if (workbox) {
  console.log(`Yay! Workbox is loaded 🎉`);

  workbox.precaching.precacheAndRoute([]);

} else {
  console.log(`Boo! Workbox didn't load 😬`);
}
```

Save the file. Observe that our production service worker (`build/sw.js`) was automatically updated by gulp `watch`.

#### Explanation

In this code, the `importScripts` call imports the `workbox-sw.js` library from a Content Delivery Network (CDN). Once the library is loaded, the `workbox` object gives our service worker access to all the  [Workbox modules.](/web/tools/workbox/modules/)

The `precacheAndRoute` method of the `precaching` module takes a precache "manifest" (a list of file URLs with "revision hashes") to cache on service worker installation. It also sets up a cache-first strategy for the specified resources, serving them from the cache by default.

Currently, the array is empty, so no files will be cached.

Rather than adding files to the list manually, `workbox-build` can generate the manifest for us. Using a tool like `workbox-build` has multiple advantages:

1. The tool can be integrated into our build process. Adding `workbox-build` to our build process eliminates the need for manual updates to the precache manifest each time that we update the apps files.
2. `workbox-build` automatically adds "revision hashes" to the files in the manifest entries. The revision hashes enable Workbox to intelligently track when files have been modified or are outdated, and automatically keep caches up to date with the latest file versions. Workbox can also remove cached files that are no longer in the manifest, keeping the amount of data stored on a user's device to a minimum. You'll see what `workbox-build` and the file revision hashes look like in the next section.

#### Learn more

While we are using  [workbox-build](/web/tools/workbox/guides/precache-files/workbox-build) with gulp in this lab, Workbox also supports tools like webpack with  [workbox-webpack-plugin](/web/tools/workbox/guides/precache-files/webpack) and npm-build processed with  [workbox-cli](/web/tools/workbox/guides/precache-files/cli).

## 3. Inject a manifest into the service worker

Now we need to configure `workbox-build` to inject a precache manifest in the `precacheAndRoute` call in the service worker file.

Add code to include the `workbox-build` module into `gulpfile.js`:

```
const workboxBuild = require('workbox-build');
```

Then add a `build-sw` task in `gulpfile.js` (above the `build` task) to generate and inject the precache manifest:

```
const buildSw = () => {
  return workboxBuild.injectManifest({
    swSrc: 'src/sw.js',
    swDest: 'build/sw.js',
    globDirectory: 'build',
    globPatterns: [
      '**\/*.css',
      'index.html',
      'js\/animation.js',
      'images\/home\/*.jpg',
      'images\/icon\/*.svg',
    ]
  }).then(resources => {
    console.log(`Injected ${resources.count} resources for precaching, ` +
        `totaling ${resources.size} bytes.`);
  }).catch(err => {
    console.log('Uh oh 😬', err);
  });
}
gulp.task('build-sw', buildSw);
```

Finally, update the `build` task to include the `build-sw` task in its `series`. The updated `build` task should be as follows:

```
const build = gulp.series('clean', 'copy', 'build-sw');
gulp.task('build', build);
```

Since we've updated `gulpfile.js`, we need to rerun the gulp `serve` task in the command line. Terminate the `serve` process with `Ctrl+c` and then restart it with `npm run serve`.

Observe that the `precacheAndRoute` call in the production service worker (`build/sw.js`) has been updated with the precache manifest, and should look like this (your hash values may be different):

```
workbox.precaching.precacheAndRoute([
  {
    "url": "style/main.css",
    "revision": "919792b0fc1138b73c7553f56cae2c41"
  },
  {
    "url": "index.html",
    "revision": "49dc015edffceba2a88e909b944675c0"
  },
  // ...
]);
```

#### Explanation

The `build-sw` task uses the `workbox-build` module's  [`injectManifest`](/web/tools/workbox/reference-docs/prerelease/module-workbox-build.html#.injectManifest) method. This method copies a source service worker file, specified in `swSrc`, to an output specified by `swDest`. Workbox searches the new service worker for an empty `precacheAndRoute()` call and populates the empty array with the assets defined in `globPatterns`. Adding the `build-sw` task to the `build` task ensures that the production service worker is regenerated anytime the `src/` files change.

#### Learn more

[Precaching documentation](/web/tools/workbox/modules/workbox-precaching)

## 4. Register and test the service worker

Now add a script in the bottom of `index.html` (just before the closing `</body>` tag) to register the new service worker:

```
  <script>
    if ('serviceWorker' in navigator) {
      window.addEventListener('load', () => {
        navigator.serviceWorker.register('/sw.js')
          .then(registration => {
            console.log('Service Worker registered! 😎');
          })
          .catch(err => {
            console.log('Registration failed 😫 ', err);
          });
      });
    }
  </script>
```

Return to the app and [unregister](tools-for-pwa-developers#unregister) any existing service workers and [clear all service worker caches](tools-for-pwa-developers#clearcache). In Chrome DevTools, you can do this in one easy operation by going to the __Application__ tab, clicking __Clear Storage__ and then clicking the __Clear site data__ button.

Note: You can automatically activate updated service workers in Chrome Developer Tools by selecting __Update on reload__ in the __Server Workers__ tab.

Refresh the page and check the developer console; you should see the registration success message. You can also use developer tools to check that [status of the service worker](tools-for-pwa-developers#accesssw). In Chrome DevTools, you can find service workers in the __Service Worker__ section of the __Application__ tab.

Next, observe that the resources specified in the precache manifest have [been cached](tools-for-pwa-developers#inspect-cache-storage). In Chrome DevTools, you can see your caches by expanding the __Cache Storage__ section in the __Application__ tab.

Note: In Chrome, the DevTools Cache interface is not always updated automatically, even if new files are cached. If you don't see the cached files, right-click __Cache Storage__ in the __Application__ tab and choose __Refresh Caches__. If a similar method is not available in your browser, then try reloading the page.

Now go "offline" by pressing `Ctrl+c` to terminate the gulp server. Refresh the app in the browser. The home page should load even though we are offline!

Note: In Chrome, you may see a console error indicating that the service worker could not be fetched: `An unknown error occurred when fetching the script. service-worker.js Failed to load resource: net::ERR_CONNECTION_REFUSED`. This error is shown because the browser couldn't fetch the service worker script (because the site is offline), but that's expected because we can't use the service worker to cache itself. Otherwise the user's browser would be stuck with the same service worker forever!

#### Explanation

In addition to precaching, the `precacheAndRoute` method sets up an implicit cache-first handler, ensuring that the precached resources are served offline.

Note: Workbox also handles an edge case that we haven't mentioned. Workbox knows to serve `my-domain/index.html` even if `my-domain/` is requested! With this functionality, you don't have to manage multiple cached resources (one for `index.html` and one for `/`).

## 5. Add routes to the service worker

`workbox-sw.js` has a  [`routing`](/web/tools/workbox/modules/workbox-routing) module that lets you easily add routes to your service worker.

Let's add a route to the service worker now. Copy the following code into `src/sw.js` beneath the `precacheAndRoute` method. Make sure you're not editing the production service worker, `build/sw.js`, as this file will be overwritten by our build process.

```
workbox.routing.registerRoute(
  /(.*)articles(.*)\.(?:png|gif|jpg)/,
  workbox.strategies.cacheFirst({
    cacheName: 'images-cache',
    plugins: [
      new workbox.expiration.Plugin({
        maxEntries: 50,
        maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days
      })
    ]
  })
);
```

Save the file.

Rebuild the app (including the service worker) and restart the server with the following command:

    npm run serve

Refresh the app and [activate the updated service worker](tools-for-pwa-developers#activate) in the browser. In Chrome DevTools you can activate a new service worker by clicking __skipWaiting__ in the __Service Worker__ section of the __Application__ tab. Navigate to __Article 1__ and __Article 2__. Check the caches to see that the `images-cache` now exists and contains the images from Articles 1 and 2. You may need to refresh the caches in developer tools to see the contents.

#### Explanation

The  [`registerRoute`](/web/tools/workbox/reference-docs/prerelease/workbox.routing#.registerRoute) method on the  [`routing`](/web/tools/workbox/modules/workbox-routing) class adds a route to the service worker. The first parameter in `registerRoute` is a regular expression URL pattern to match requests against. The second parameter is the handler that provides a response if the route matches. In this case the route uses the  [`strategies`](/web/tools/workbox/modules/workbox-strategies) class to access the  [`cacheFirst`](/web/tools/workbox/modules/workbox-strategies#cache_first_cache_falling_back_to_network) run-time caching strategy. This means that whenever the app requests article images, the service worker checks the cache first for the resource before going to the network.

The handler in this code also configures Workbox to maintain a maximum of 50 images in the cache (ensuring that user's devices don't get filled with excessive images). Once 50 images has been reached, Workbox will remove the oldest image automatically. The images are also set to expire after 30 days, signaling to the service worker that the network should be used for those images.

__Optional:__ Write your own route that caches the user avatar. The route should match requests to `/images/icon/*` and handle the request/response using the  [`staleWhileRevalidate`](/web/tools/workbox/modules/workbox-strategies#stale-while-revalidate) strategy. Give the cache the name "icon-cache" and allow a maximum of 5 entries to be stored in the cache. This strategy is good for icons and user avatars that change frequently but the latest versions are not essential to the user experience. You'll need to remove the icon from the precache manifest so that the service worker uses your `staleWhileRevalidate` route instead of the implicit cache-first route established by the `precache` method.

## 6. Use a customized networkFirst cache strategy

### 6.1 Write the basic handler using the `handle` method

Sometimes content must always be kept up-to-date (e.g., news articles, stock figures, etc.). For this kind of data, the `cacheFirst` strategy is not the best solution. Instead, we can use the `networkFirst` strategy to fetch the newest content first, and only if that fails does the service worker get old content from the cache.

Copy the following code below the existing route in `src/sw.js`:

```
const articleHandler = workbox.strategies.networkFirst({
  cacheName: 'articles-cache',
  plugins: [
    new workbox.expiration.Plugin({
      maxEntries: 50,
    })
  ]
});

workbox.routing.registerRoute(/(.*)article(.*)\.html/, args => {
  return articleHandler.handle(args);
});
```

Save the file, refresh the app, and update the service worker in the browser. Reload the home page and click a link to one of the Trending Articles. Check the caches to see that the `articles-cache` was created and contains the article you just clicked. You may need to refresh the caches to see the changes.

__Optional:__ Test that articles are cached dynamically by visiting some while online. Then take the app offline again by pressing `Ctrl+C` in the command line and re-visit those articles. Instead of the browser's default offline page, you should see the cached article. Remember to re-run `npm run serve` to restart the server.

__Optional:__ Test the `networkFirst` strategy by changing the text of the cached article and reloading the page. Even though the old article is cached, the new one is served and the cache is updated.

#### Explanation

Here we are using the `networkFirst` strategy to handle a resource we expect to update frequently (trending news articles). This strategy updates the cache with the newest content each time it's fetched from the network.

Unlike the images route established in the previous step, the code above uses the  [`handle`](/web/tools/workbox/reference-docs/prerelease/workbox.strategies.NetworkFirst#handle) method on the built-in `networkFirst` strategy. The `handle` method takes the object passed to the handler function (in this case we called it `args`) and returns a promise that resolves with a response. We could have passed in the caching strategy directly to the second argument of `registerRoute` as we did in the previous example, but instead we return a call to the `handle` method in a custom handler function. This technique gives us access to the response, as you'll see in the next step.

### 6.2 Handle invalid responses

The `handle` method returns a promise resolving with the response, so we can access the response with a `.then`.

Add the following `.then` inside the `article` route after the call to the `handle` method:

```
.then(response => {
    if (!response) {
      return caches.match('pages/offline.html');
    } else if (response.status === 404) {
      return caches.match('pages/404.html');
    }
    return response;
  });
```

Then add `pages/offline.html` and `pages/404.html` to the `globPatterns` in the `build-sw` task defined in `gulpfile.js`. The updated `build-sw` task should look like this:

```
const buildSw = () => {
  return workboxBuild.injectManifest({
    swSrc: 'src/sw.js',
    swDest: 'build/sw.js',
    globDirectory: 'build',
    globPatterns: [
      '**\/*.css',
      'index.html',
      'js\/animation.js',
      'images\/home\/*.jpg',
      'images\/icon\/*.svg',
      'pages/offline.html',
      'pages/404.html'
    ]
  }).then(resources => {
    console.log(`Injected ${resources.count} resources for precaching, ` +
        `totaling ${resources.size} bytes.`);
  }).catch(err => {
    console.log('Uh oh 😬', err);
  });
}
gulp.task('build-sw', buildSw);
```

Save the files. Restart gulp by terminating the `serve` process with `Ctrl+c` and re-running `npm run serve`. Refresh the app activate the updated service worker in the browser. On the app home page, try clicking the __Non-existent article__ link. This link points to an HTML page, `pages/article-missing.html`, that doesn't actually exist. You should see the custom 404 page that we precached!

Now try taking the app offline by pressing `Ctrl+C` in the command line and then click any of the links to unvisited articles. You should see the custom offline page!

Note: If you've already cached all the articles, you can clear the caches and refresh the page in order to test the offline page.

#### Explanation

The `.then` statement receives the response passed in from the handle method. If the response doesn't exist, then it means the user is offline and the response was not previously cached. Instead of letting the browser show a default offline page, the service worker returns the custom offline page that was precached. If the response exists but the status is 404, then our custom 404 page is returned. Otherwise, we return the original response.

## 7. Optional: Add a customized cacheFirst cache strategy

So far you have implemented many caching strategies with Workbox, and in the previous section you learned how to add custom logic to the default Workbox caching options.

This last exercise is a challenge with less guidance (you can still see the solution code if you get stuck). You need to:

* Add a final service worker route for the app's "post" pages (`pages/post1.html`, `pages/post2.html`, etc.).
* The route should use Workbox's `cacheFirst` strategy, creating a cache called "posts-cache" that stores a maximum of 50 entries.
* If the cache or network returns a resources with a 404 status, then return the  `pages/404.html` resource.
* If the resource is not available in the cache, and the app is offline, then return the  `pages/offline.html` resource.

#### Hints

* Review the previous section for how to add additional logic to Workbox's built-in strategy handlers.
* The Workbox `cacheFirst` handler handles no-connectivity differently than `networkFirst`: instead of passing an empty response to the `.then`, it  *rejects*  and goes to the next `.catch`.

## Congratulations!

You have learned how to use Workbox to create production-ready service workers!

### What we've covered

* Writing a service worker using the `workbox-sw.js` library
* Adding routes to your service worker using `workbox-sw.js`
* Using the predefined caching strategies provided in `workbox-sw.js`
* Augmenting the `workbox-sw.js` caching strategies with custom logic
* Generating a production-grade service worker with `workbox-build`

### Resources

*  [Workboxjs.org](https://workboxjs.org/)
*  [Workbox](/web/tools/workbox/) - developers.google.com


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZETEST_MATHTEST_MATCHSYMMETRY_H_
#define _BLAZETEST_MATHTEST_MATCHSYMMETRY_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <blaze/math/adaptors/Forward.h>
#include <blaze/math/constraints/Matrix.h>
#include <blaze/math/typetraits/IsDiagonal.h>
#include <blaze/math/typetraits/IsHermitian.h>
#include <blaze/math/typetraits/IsSymmetric.h>
#include <blaze/math/typetraits/RemoveAdaptor.h>
#include <blaze/util/mpl/If.h>

namespace blazetest {

//=================================================================================================
//
//  CLASS DEFINITION
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Matches the symmetry property of two matrix types.
//
// The MatchSymmetry type trait matches the symmetry property of the first matrix type \a T1 to
// the second matrix type \a T2: In case \a T1 is a diagonal matrix, the resulting type \a Type
// will be a DiagonalMatrix of \a T2. In case \a T1 is a symmetric matrix or a Hermitian matrix
// with real element types, the resulting type \a Type will be a SymmetricMatrix of \a T2. In
// case \a T1 is a Hermitian matrix, the resulting type \a Type will be a HermitianMatrix of
// \a T2. Else \a Type is set to \a T2. Note that this type trait only works for matrix types.
// The attempt to instantiate it with non-matrix types results in a compile time error.
*/
template< typename T1    // The adapted type
        , typename T2 >  // The type to be adapted
struct MatchSymmetry
{
 private:
   //**********************************************************************************************
   /*! \cond BLAZE_INTERNAL */
   using Tmp = blaze::RemoveAdaptor_t<T2>;
   /*! \endcond */
   //**********************************************************************************************

 public:
   //**********************************************************************************************
   /*! \cond BLAZE_INTERNAL */
   using Type = blaze::If_t< blaze::IsDiagonal_v<T1>
                           , blaze::DiagonalMatrix<Tmp>
                           , blaze::If_t< blaze::IsSymmetric_v<T1>
                                        , blaze::SymmetricMatrix<Tmp>
                                        , blaze::If_t< blaze::IsHermitian_v<T1>
                                                     , blaze::HermitianMatrix<Tmp>
                                                     , T2 > > >;
   /*! \endcond */
   //**********************************************************************************************

 private:
   //**Compile time checks*************************************************************************
   /*! \cond BLAZE_INTERNAL */
   BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE( T1 );
   BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE( T2 );
   /*! \endcond */
   //**********************************************************************************************
};
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Auxiliary alias declaration for the MatchSymmetry class template.
//
// The MatchSymmetry_t alias declaration provides a convenient shortcut to access the nested \a Type
// of the MatchSymmetry class template. For instance, given the types \a T1 and \a T2 the following
// two type definitions are identical:

   \code
   using Type1 = typename MatchSymmetry<T1,T2>::Type;
   using Type2 = MatchSymmetry_t<T1,T2>;
   \endcode
*/
template< typename T1    // The adapted type
        , typename T2 >  // The type to be adapted
using MatchSymmetry_t = typename MatchSymmetry<T1,T2>::Type;
//*************************************************************************************************

} // namespace blazetest

#endif

redpajama_set_name: RedPajamaGithub


text:
using Newtonsoft.Json;

namespace SlackConnector.Connections.Models
{
    internal class Profile
    {
        [JsonProperty("first_name")]
        public string FirstName { get; set; }

        [JsonProperty("last_name")]
        public string LastName { get; set; }

        [JsonProperty("real_name")]
        public string RealName { get; set; }

        [JsonProperty("real_name_normalized")]
        public string RealNameNormalised { get; set; }

        public string Email { get; set; }
    }
}


text:
body {
     background: url("images/city_lights2.jpg");
     background-size: cover;
     background-repeat: repeat-y;
     font-family: "Trebuchet MS", Helvetica, sans-serif;
     color: #d8d8d8;

}

input[type=submit] {
	padding: 5px 15px;
	background-color: #9966CC;
	font-size: 16px;
	text-align: center;
	text-decoration: none;
	font-family: "Trebuchet MS", Helvetica, sans-serif;
	color: white;
	cursor: pointer;
	border: none;
}

input:hover[type=submit] {
	background-color: #9999CC;
}

button {
	padding: 5px 15px;
	background-color: #9966CC;
	font-size: 16px;
	text-align: center;
	text-decoration: none;
	font-family: "Trebuchet MS", Helvetica, sans-serif;
	color: white;
	cursor: pointer;
	border: none;
}

button:hover {
	background-color: #9999CC;
}

h2 {
	font-family: "Trebuchet MS", Helvetica, sans-serif;
	letter-spacing: 3px;
	word-spacing: 5px;
}

.background {

	background: rgb(153, 102, 153);
	background: rgba(153, 102, 153, 0.4);

}

.dark_filter
{
	background: rgb(30, 30, 30);
	background: rgba(30, 30, 30, 0.6);
}

table
{
	border: 1px solid white;
	width: 100%;
}

td, th {
	border-style: none;
	height: 50 px;
	text-align: center;
}


text:
<?php

namespace ConfigToken\TokenFilter\Exception;

/**
 * @codeCoverageIgnore
 */
class UnknownFilterException extends \Exception
{
    public function __construct($filterName = "", $scope = "", $code = 0, \Exception $previous = null)
    {
        if ($scope == "") {
            $message = sprintf('Unknown filter "%s".', $filterName);
        } else {
            $message = sprintf('Unknown filter "%s" in "%s".', $filterName, $scope);
        }
        parent::__construct($message, $code, $previous);
    }
}


text:
using Kudu.Core.SourceControl;

namespace Kudu.Core.Deployment
{
    public static class DeploymentManagerExtensions
    {
        public static void Deploy(this IDeploymentManager deploymentManager, IRepository repository, string id, string deployer, bool clean)
        {
            ChangeSet changeSet = null;
            if (id != null)
            {
                changeSet = repository.GetChangeSet(id);
            }

            deploymentManager.Deploy(repository, changeSet, deployer, clean);
        }
    }
}


text:
import { waitFor } from '@testing-library/dom';
import { render } from '@testing-library/react';
import React from 'react';
import {
  getRendererPreviewMethods,
  mockCore,
  mockRendererCore,
} from 'react-cosmos-shared2/ui';
import { loadPlugins, resetPlugins, Slot } from 'react-plugin';
import { fakeFetchResponseStatus } from '../testHelpers/fetch';
import { rendererErrorMsg, rendererReadyMsg } from '../testHelpers/messages';

beforeEach(() => jest.isolateModules(() => require('..')));

afterEach(resetPlugins);

function registerTestPlugins() {
  mockCore({
    getWebRendererUrl: () => 'mockRendererUrl',
  });
  mockRendererCore();
}

function loadTestPlugins() {
  fakeFetchResponseStatus(200);
  loadPlugins();

  return render(<Slot name="rendererPreview" />);
}

function getRuntimeStatus() {
  const rendererPreview = getRendererPreviewMethods();
  return rendererPreview.getRuntimeStatus();
}

it('sets "error" runtime status', async () => {
  registerTestPlugins();
  loadTestPlugins();

  window.postMessage(rendererErrorMsg, '*');

  await waitFor(() => expect(getRuntimeStatus()).toBe('error'));
});

it('sets "connected" runtime status', async () => {
  registerTestPlugins();
  loadTestPlugins();

  window.postMessage(rendererErrorMsg, '*');
  window.postMessage(rendererReadyMsg, '*');

  await waitFor(() => expect(getRuntimeStatus()).toBe('connected'));
});

it('keeps "connected" runtime status once set', async () => {
  registerTestPlugins();
  loadTestPlugins();

  window.postMessage(rendererReadyMsg, '*');
  window.postMessage(rendererErrorMsg, '*');

  await waitFor(() => expect(getRuntimeStatus()).toBe('connected'));
});


text:
title: Expanding computer science through partnerships
social:
  "og:title": "Code.org announces 11 new partners to expand computer science"
  "og:description": "Each partner offers a different approach, but they all share one thing: a commitment to adding computer science into the formal curriculum in schools."
  "og:image": "http://code.org/images/student-tatiana.jpg"
  "og:image:width": 1200
  "og:image:height": 628
  "og:video": ""
  "og:video:width": ""
  "og:video:height": ""
  "og:video:type": ""
---

# Expanding computer science through partnerships

<% facebook = {:u=>'http://code.org/3rdparty-partners'} %>
<% twitter = {:url=>'http://code.org/3rdparty-partners', :related=>'codeorg', :text=>'Code.org announces 11 new partners to expand computer science'} %>
<%= view :share_buttons, facebook:facebook, twitter:twitter %>

<%= view "popup_window.js" %>

[letter]

### June 3, 2015

SEATTLE — Code.org announced today 11 new partnerships with computer science education organizations to help schools where Code.org it isn't able to work directly.

Code.org's new partners are: Edhesive*, Beauty and Joy of Computing, Bootstrap, Codecademy, CodeHS, Globaloria, National Math and Science Initiative, Project Lead the Way, Technology Education And Literacy in Schools, ScratchEd, and Tynker.

This announcement follows Code.org's recent partnerships with the National Science Foundation and the College Board, and helps educators choose the best learning resources to their students, in a space with so many options available.

Code.org has curated a list of options for schools that want to teach computer science. Each of these partners offers a different approach — some offer curriculum, some offer professional development, some offer a blend — but they all share one thing in common: a commitment to adding computer science into the formal curriculum in schools.

As Code.org approaches school districts nationwide to establish computer science programs, it will also highlight these partnership alternatives to help educators and administrators find the best fit for their students. Code.org will also promote partners on its website and integrate select resources into its curriculum.

By integrating computer science into the course schedule in K-12 schools — where gender is usually evenly split and students of all ethnic and economic backgrounds are represented — we see an increase in diversity of students learning computer science, who may never try it otherwise. In addition, learning computer science in a classroom can help students progress faster and further than learning on their own.

"Code.org is dedicated to ensuring that every K-12 student has the opportunity to learn computer science," said Hadi Partovi, founder and CEO of Code.org. "This is a community effort, and we're proud to partner with some of the top organizations to bring this field into the K-12 curriculum, and to inspire students from all backgrounds to try computer science and re-shape their futures."

Choose a CS partner and get started [http://code.org/educate/3rdparty](/educate/3rdparty).

Code.org welcomes new partners:

[Edhesive](http://edhesive.com/), [BJC](http://bjc.berkeley.edu/), [Bootstrap](http://www.bootstrapworld.org/), [Codecademy](http://www.codecademy.com/), [CodeHS](https://codehs.com/), [Globaloria](http://globaloria.com/), [NMSI](https://www.nms.org/), [PLTW](https://www.pltw.org/), [TEALS](https://www.tealsk12.org/), [ScratchEd](http://scratched.gse.harvard.edu/guide/), [Tynker](https://www.tynker.com/).

*Edhesive was formally named Amplify Education.

****

**About Code.org**

Code.org is a 501c3 public non-profit dedicated to expanding participation in computer science and increasing participation by women and underrepresented students of color. Its vision is that every student in every school should have the opportunity to learn computer programming. After launching in 2013, Code.org organized the Hour of Code campaign – which has introduced over 100 million students to computer science to date – and partnered with 70 public school districts nationwide to expand computer science programs. Code.org is supported by philanthropic donations from corporations, foundations and generous individuals, including Microsoft, Infosys Foundation, USA, The Ballmer Family Giving, Omidyar Network and others. For more information, visit [code.org](/).

For more information, contact press@code.org


text:
#include "precomp.h"
#include "Frame.h"
#include "Nbls.h"
#include "Gre.h"
#include "NdisFilter.h"
#include "Icmp.h"
#include "Arp.h"
#include "Gre.h"
#include "Tcp.h"
#include "Udp.h"
#include "Igmp.h"
#include "Ipv6.h"
#include "Icmp6.h"
#include "OvsNetBuffer.h"

VOID DbgPrintNbFrames(NET_BUFFER* pNb, const char* msg)
{
#if OVS_DBGPRINT_FRAMES
    VOID* buffer;
    OVS_ETHERNET_HEADER* pEthHeader;

    buffer = NdisGetDataBuffer(pNb, NET_BUFFER_DATA_LENGTH(pNb), NULL, 1, 0);
    pEthHeader = (OVS_ETHERNET_HEADER*)buffer;

    OVS_CHECK(buffer);

    if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_QTAG))
    {
        pEthHeader += OVS_ETHERNET_VLAN_LEN;
    }

    DEBUGP_FRAMES(LOG_INFO, "%s: nb frames: size=%d; eth type = 0x%x\n", msg, NET_BUFFER_DATA_LENGTH(pNb), RtlUshortByteSwap(pEthHeader->type));
    DbgPrintNb(pNb, msg);
    DbgPrintMac(pEthHeader);

    if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV4))
    {
        const OVS_IPV4_HEADER* pIpv4Header = ReadIpv4Header(pEthHeader);

        ReadIpv4ProtocolFrame(pIpv4Header);
    }
    else if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV6))
    {
        DEBUGP_FRAMES(LOG_INFO, "ipv6\n");
    }
    else if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_ARP))
    {
        OVS_ARP_HEADER* pArpHeader = NULL;

        pArpHeader = (OVS_ARP_HEADER*)((BYTE*)(pEthHeader)+sizeof(OVS_ETHERNET_HEADER));

        DEBUGP_FRAMES(LOG_INFO, "sending arp: op = %s, sender ip: %d.%d.%d.%d; sender mac: %02x-%02x-%02x-%02x-%02x-%02x; "
            "target ip:%d.%d.%d.%d; target mac: %02x-%02x-%02x-%02x-%02x-%02x\n ", RtlUshortByteSwap(pArpHeader->operation) == 1 ? "request" : "reply",

            pArpHeader->senderProtocolAddress[0], pArpHeader->senderProtocolAddress[1], pArpHeader->senderProtocolAddress[2], pArpHeader->senderProtocolAddress[3],
            pArpHeader->senderHardwareAddress[0], pArpHeader->senderHardwareAddress[1], pArpHeader->senderHardwareAddress[2],
            pArpHeader->senderHardwareAddress[3], pArpHeader->senderHardwareAddress[4], pArpHeader->senderHardwareAddress[5],

            pArpHeader->targetProtocolAddress[0], pArpHeader->targetProtocolAddress[1], pArpHeader->targetProtocolAddress[2], pArpHeader->targetProtocolAddress[3],
            pArpHeader->targetHardwareAddress[0], pArpHeader->targetHardwareAddress[1], pArpHeader->targetHardwareAddress[2],
            pArpHeader->targetHardwareAddress[3], pArpHeader->targetHardwareAddress[4], pArpHeader->targetHardwareAddress[5]);
    }
#else
    UNREFERENCED_PARAMETER(pNb);
    UNREFERENCED_PARAMETER(msg);
#endif
}

VOID DbgPrintOnbFrames(OVS_NET_BUFFER* pOvsNb, const char* msg)
{
#if OVS_DBGPRINT_FRAMES
    for (NET_BUFFER* pNb = NET_BUFFER_LIST_FIRST_NB(pOvsNb->pNbl); pNb != NULL; pNb = NET_BUFFER_NEXT_NB(pNb))
    {
        DbgPrintNbFrames(pNb, msg);
    }
#else
    UNREFERENCED_PARAMETER(pOvsNb);
    UNREFERENCED_PARAMETER(msg);
#endif
}

BOOLEAN ReadProtocolFrame(_In_ NET_BUFFER* pNb)
{
    OVS_ETHERNET_HEADER* pEthHeader = NULL;
    const OVS_IPV4_HEADER* pIpv4Header = NULL;
    void* pAllocBuffer = NULL;
    OVS_ARP_HEADER* pArpHeader = NULL;
    OVS_IPV6_HEADER* pIpv6Header = NULL;

    pEthHeader = ReadEthernetHeader_Alloc(pNb, &pAllocBuffer);
    if (!pEthHeader)
    {
        //TODO: what do we do if we could not alloc mem for eth header?
        //ATM simply send forward
        DEBUGP(LOG_ERROR, "Could not alloc mem for eth header. nb: %p\n", pNb);
        return FALSE;
    }

    if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_QTAG))
    {
        //advance ethernet header by QTag Prefix. pEthHeader->type will be pEthHeader->clientType from ethernet tagged struct.
        pEthHeader += OVS_ETHERNET_VLAN_LEN;
    }

    if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV4))
    {
        pIpv4Header = ReadIpv4Header(pEthHeader); //proto type: 1 = ICMP; 2 = IGMP; 6 = tcp; 0x11 = udp

        if (pIpv4Header->Protocol != OVS_IPPROTO_UDP)
        {
            DbgPrintMacMsg(pEthHeader, "NB");
            ReadIpv4ProtocolFrame(pIpv4Header);
        }
    }
    else if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_IPV6))
    {
        pIpv6Header = (OVS_IPV6_HEADER*)((UINT8*)(pEthHeader)+sizeof(OVS_ETHERNET_HEADER));

        //do nothing: it is not encapsulated, goes to the same ip dest
    }
    else if (pEthHeader->type == RtlUshortByteSwap(OVS_ETHERTYPE_ARP))
    {
        pArpHeader = (OVS_ARP_HEADER*)((BYTE*)(pEthHeader)+sizeof(OVS_ETHERNET_HEADER));

        DbgPrintArp(pArpHeader);
    }
    else
    {
        //must check all  protocol types.
        OVS_CHECK(0);
    }

    return TRUE;
}


text:
package com.github.rgmih.jawamp.message;

import java.util.List;

import com.google.gson.JsonElement;

public class PublishMessage extends Message {
	private String topicURI;
	private JsonElement event;

	private boolean excludeMe = false;
	private List<String> exclude;
	private List<String> eligible;

	private final EventMessage eventMessage;

	public PublishMessage(String topicURI, JsonElement event) {
		this(topicURI, event, false);
	}

	public PublishMessage(String topicURI, JsonElement event, List<String> exclude) {
		this(topicURI, event, false);
		this.exclude = exclude;
	}

	public PublishMessage(String topicURI, JsonElement event, boolean excludeMe) {
		super(MessageType.PUBLISH);
		this.topicURI = topicURI;
		this.event = event;
		this.excludeMe = excludeMe;
		eventMessage = new EventMessage(topicURI, event);
	}

	public PublishMessage(String topicURI, JsonElement event, List<String> exclude, List<String> eligible) {
		this(topicURI, event, false);
		this.exclude = exclude;
		this.eligible = eligible;
	}

	public String getTopicURI() {
		return topicURI;
	}

	public JsonElement getEvent() {
		return event;
	}

	public boolean isExcludeMe() {
		return excludeMe;
	}

	public List<String> getExclude() {
		return exclude;
	}

	public List<String> getEligible() {
		return eligible;
	}

	public EventMessage toEventMessage() {
		return eventMessage;
	}
}


text:
<?php

declare(strict_types=1);

namespace Viserio\Component\Container\Tests\UnitTest\PhpParser\NodeVisitor;

use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Trait_;
use PHPUnit\Framework\TestCase;
use ReflectionFunction;
use Viserio\Component\Container\PhpParser\NodeVisitor\ClosureLocatorVisitor;
use Viserio\Contract\Container\Exception\RuntimeException;

/**
 * @internal
 *
 * @covers \Viserio\Component\Container\PhpParser\NodeVisitor\ClosureLocatorVisitor
 *
 * @small
 */
final class ClosureLocatorVisitorTest extends TestCase
{
    public function testClosureNodeIsDiscoveredByVisitor(): void
    {
        $closure = function (): void {}; $startLine = __LINE__;

        $reflectedClosure = new ReflectionFunction($closure);
        $closureFinder = new ClosureLocatorVisitor($reflectedClosure);
        $closureNode = new Closure([], ['startLine' => $startLine]);
        $closureFinder->enterNode($closureNode);

        self::assertSame($closureNode, $closureFinder->closureNode);
    }

    public function testClosureNodeIsAmbiguousIfMultipleClosuresOnLine(): void
    {
        $this->expectException(RuntimeException::class);

        $closure = function (): void {}; function (): void {}; $startLine     = __LINE__;

        $closureFinder = new ClosureLocatorVisitor(new ReflectionFunction($closure));
        $closureFinder->enterNode(new Closure([], ['startLine' => $startLine]));
        $closureFinder->enterNode(new Closure([], ['startLine' => $startLine]));
    }

    public function testCalculatesClosureLocation(): void
    {
        $closure = function (): void {};

        $closureFinder = new ClosureLocatorVisitor(new ReflectionFunction($closure));

        $closureFinder->beforeTraverse([]);

        $node = new Namespace_(new Name(['Foo', 'Bar']));
        $closureFinder->enterNode($node);
        $closureFinder->leaveNode($node);

        $node = new Trait_('Fizz');
        $closureFinder->enterNode($node);
        $closureFinder->leaveNode($node);

        $node = new Class_('Buzz');
        $closureFinder->enterNode($node);
        $closureFinder->leaveNode($node);
        $closureFinder->afterTraverse([]);

        $actualLocationKeys = \array_filter($closureFinder->location);
        $expectedLocationKeys = ['directory', 'file', 'function', 'line'];

        self::assertEquals($expectedLocationKeys, \array_keys($actualLocationKeys));
    }

    public function testCanDetermineClassOrTraitInfo(): void
    {
        $closure = function (): void {};

        $closureFinder = new ClosureLocatorVisitor(new ReflectionFunction($closure));
        $closureFinder->location['namespace'] = 'Viserio\Component\Container\Tests\UnitTest\PhpParser\NodeVisitor';
        $closureFinder->location['class'] = 'FooClass';
        $closureFinder->afterTraverse([]);

        self::assertEquals('Viserio\Component\Container\Tests\UnitTest\PhpParser\NodeVisitor\FooClass', $closureFinder->location['namespace'] . '\\' . $closureFinder->location['class']);

        $closureFinder->location['class'] = null;
        $closureFinder->location['trait'] = 'FooTrait';
        $closureFinder->afterTraverse([]);

        self::assertEquals('Viserio\Component\Container\Tests\UnitTest\PhpParser\NodeVisitor\FooTrait', $closureFinder->location['namespace'] . '\\' . $closureFinder->location['trait']);
    }
}


text:
package org.apache.bigtop.itest;

import java.lang.annotation.Documented;

/**
 * Specifies a parameter to be passed into a test via a system property.
 * The parameter may be a String, an int, a long, or a boolean. If the type
 * of the parameter is not specified, it defaults to String.
 * A default value (String value, int value, long value) may be specified
 * for the parameter if its type is not boolean; the default value of a
 * boolean parameter is false.
 */
@Documented
public @interface Property {
  public static enum Type {
    STRING, INT, LONG, BOOLEAN;
  }

  String name();

  Type type() default Type.STRING;

  String defaultValue() default "";

  int intValue() default 0;

  long longValue() default 0L;
}


text:
.PHONY: _pwd_prompt decrypt_conf encrypt_conf

CONF_FILE=config.js

# 'private' task for echoing instructions
_pwd_prompt:
	@echo "Contact peleg3@gmail.com for the password."

# to create config/dev_env.yml
decrypt_conf: _pwd_prompt
	openssl cast5-cbc -d -in ${CONF_FILE}.cast5 -out ${CONF_FILE}
	chmod 600 ${CONF_FILE}

# for updating config/dev_env.yml
encrypt_conf: _pwd_prompt
	openssl cast5-cbc -e -in ${CONF_FILE} -out ${CONF_FILE}.cast5


text:
std::map<String, const CoreModel*> CoreModel::s_core_models;

const CoreModel* CoreModel::getCoreModel(String type)
{
   if (!s_core_models.count(type))
   {
      if (type == "nehalem")
         s_core_models[type] = new CoreModelNehalem();
      else
         LOG_PRINT_ERROR("Unknown core model %s", type.c_str());
   }
   return s_core_models[type];
}


text:
/**
*
* OurPeopleGallery
*
*/

import React from 'react';
import Helmet from 'react-helmet';
import {GridList, GridTile} from 'material-ui/GridList';
import Header from 'components/Header';
import HeaderMobile from 'components/HeaderMobile';
import Footer from 'components/Footer';
import Responsive from 'react-responsive';

class OurPeopleGallery extends React.PureComponent {
  render() {

    const flexImg={
      height:"100%",
      width:"100%",

    }

    return (

        <Responsive minDeviceWidth={800}>
        <GridList cols={10} padding={1}>

          <GridTile cols={4} rows={2}>

          </GridTile>

          <GridTile cols={2} rows={2}>

          </GridTile>

          <GridTile cols={4} rows={2}>

          </GridTile>

          <GridTile cols={3} rows={2}>

          </GridTile>

          <GridTile cols={4} rows={2}>

          </GridTile>

          <GridTile cols={3} rows={2}>

          </GridTile>

          <GridTile cols={6} rows={3}>

          </GridTile>

          <GridTile cols={4} rows={3}>

          </GridTile>

          <GridTile cols={4} rows={3}>

          </GridTile>

          <GridTile cols={6} rows={3}>

          </GridTile>

          <GridTile cols={10} rows={4}>

          </GridTile>

        </GridList>
        </Responsive>

      <Responsive maxDeviceWidth={799}>
        <GridList cols={10} padding={1}>

          <GridTile cols={5} rows={3}>

          </GridTile>

        <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

          <GridTile cols={5} rows={3}>

          </GridTile>

        </GridList>

      </Responsive>

    );
  }
}

export default OurPeopleGallery;


text:
The Intridea style changelog was pioneered on the Hashie project. It has many elements that can you use and prevents some other elements as follows.

### Titles

✅ You can have up to four levels of titles

```markdown
# This is a title for my changelog
## lower case also works and so do numbers 123
### Colons: They are awesome
#### Probably not used all that often
```

❌ Only letters (a-z), numbers, underscores and colons are allowed in titles

```markdown
#### Emoji is not allowed 😢
#### Hyphens are not allowed thus sugar-free is not valid
#### Multiple sentences. Are not allowed
#### Commas, neither
#### No accented characters sorry Beyoncé
```

❌ Titles must start with a leading space

```markdown
#This is not valid
```

✅ You can place your titles inside a single parens

```markdown
# (This is allowed)
## [This is allowed]
### {This is also allowed}
```

❌ Parens in a title must match, and you can only have one set

```markdown
# (Not valid
## {Not valid)
### Not valid ()
#### [] Not valid
#### ((Not valid))
```

✅ You can have a [semantic-versioning](https://semver.org/) compatible version number

```markdown
# 1.0.0
## 1.0.0-alpha
### (3.2.1-beta+reallybuggy.1)
```

❌ Version numbers which do not follow [semantic-versioning](https://semver.org/) are not allowed

```markdown
# 01.0.0.notvalid
```

❌ You cannot combine version numbers with other text

```markdown
# Not valid 1.0.0
# Not valid (1.0.0)
```

✅ You can include an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-formatted date along with a version, inside or outside parens

```markdown
# 1.0.0 2019
## 1.0.0 (2019-12-31)
### (1.0.0) (2019/12/31)
#### (1.0.0) 20191231
```

❌ No other date or time formats are allowed

```markdown
# 1.0.0 (2019-12)
# 1.0.0 (2019-W1)
# 1.0.0 (2019-04-28T09:21:58Z)
# 1.0.0 (31/12/2019)
```

❌ Dates cannot be combined with normal titles

```markdown
# Not valid (2019/12/31)
```

### Changelog entries

✅ Under each title, you can have changelog entries in the format: `* {optional link to GitHub pull request that must be followed by a colon} {a single sentence of text description} - {author github link}.`:

```markdown
* Entry without a PR link - [@ivoanjo](https://github.com/ivoanjo).
* [#1](https://github.com/dblock/danger-changelog/pull/1): Entry with a PR link - [@dblock](https://github.com/dblock).
* Yes, this is a weird entry, but it's still valid! Also Beyoncé is welcome here, as is 松本 行弘 and our nice emojis 👍 - [@ivoanjo](https://github.com/ivoanjo).
```

❌ Entry descriptions need to start with an uppercase A-Z letter

```markdown
* not valid - [@ivoanjo](https://github.com/ivoanjo).
* いいえ - [@ivoanjo](https://github.com/ivoanjo).
* ❌ - [@ivoanjo](https://github.com/ivoanjo).
* [#1](https://github.com/dblock/danger-changelog/pull/1): not valid - [@dblock](https://github.com/dblock).
```

❌ GitHub pull request links need to be followed with a colon

```markdown
* [#1](https://github.com/dblock/danger-changelog/pull/1) Not valid - [@dblock](https://github.com/dblock).
```

❌ Only links to GitHub are allowed, and only using `https`

```markdown
* No GitLab - [@ivoanjo](https://gitlab.com/ivoanjo).
* No insecure http - [@ivoanjo](http://github.com/ivoanjo).
* [#1](https://you-get-the-point.com): Entry with a PR link - [@dblock](https://github.com/dblock).
```
❌ Only a single sentence is allowed

```markdown
* Did stuff. Then more stuff - [@ivoanjo](https://github.com/ivoanjo).
```

❌ A dash needs to separate the text description from the author

```markdown
* Missing a dash here ➡ [@ivoanjo](https://github.com/ivoanjo).
```

❌ An entry must end with a period

```markdown
* Not valid - [@ivoanjo](https://github.com/ivoanjo)
```

### Blank lines

✅ You can have them

```markdown

```


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12._02
{
	class Program
	{
		static void Main()
		{
			var registers = new Dictionary<char, int>
			{
				{'a', 0}, {'b', 0}, {'c', 1}, {'d', 0}
			};

			int placeholder;

			var instructions = File.ReadAllLines("input.txt").Select(line => line.Split(' ')).ToList();

			Func<string, int> getValue = (instruction) => int.TryParse(instruction, out placeholder) ? placeholder : registers[instruction[0]];

			Func<string[], int> process = (instruction) =>
			{
				int address = instructions.IndexOf(instruction);

				switch (instruction[0])
				{
					case "cpy":
						registers[instruction[2][0]] = getValue(instruction[1]);
						address++;
						break;
					case "inc":
						registers[instruction[1][0]]++;
						address++;
						break;
					case "dec":
						registers[instruction[1][0]]--;
						address++;
						break;
					case "jnz":
						int op1 = getValue(instruction[1]);
						int op2 = getValue(instruction[2]);
						address += op1 == 0 ? 1 : op2;
						break;
				}

				return address;
			};

			int next = process(instructions[0]);

			while (next < instructions.Count && next >= 0)
				next = process(instructions[next]);

			Console.WriteLine(registers['a']);
			Console.ReadKey();
		}
	}
}


text:
(function () {
    'use strict';
    angular.module('sections.header')
        .directive('svSocialTopNavCell', function ($mdBottomSheet, $mdSidenav) {
            return {
                replace: true,
                templateUrl: 'scripts/sections/header/directives/sv-social-top-nav-cell.html',
                scope: {},
                controller: function ($scope, $timeout) {
                    $scope.alert = '';
                    $scope.showListBottomSheet = function ($event) {
                        $scope.alert = '';
                        $mdBottomSheet.show({
                            templateUrl: 'scripts/common/templates/social-top-nav-cell.html',
                            targetEvent: $event
                        }).then(function (clickedItem) {
                            $scope.alert = clickedItem.name + ' clicked!';
                        });
                    };
                    $scope.listItemClick = function ($index) {
                        var clickedItem = $scope.items[$index];
                        $mdBottomSheet.hide(clickedItem);
                    };
                    $scope.closeSideBar = function ($index) {
                        var clickedItem = $scope.items[$index];
                        $mdSidenav('left').hide(clickedItem);
                        $mdSidenav('right').hide(clickedItem);
                    };
                }
            };
        });
})();


text:
<?php namespace App\Http\Controllers;

use App\Events\RefreshTokenEvent;
use App\Extensions\Helper;
use App\Http\Requests\LoginRequest;
use App\Http\Requests\RefreshTokenRequest;
use App\Http\Requests\RegistrationRequest;
use App\Repositories\TokenRepository;
use App\Repositories\UserRepository;
use App\Services\CacheService;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Intervention\Image\Facades\Image;

class AuthController extends Controller
{
	public function postRegistration (RegistrationRequest $request, UserRepository $userRepository, TokenRepository $tokenRepository, CacheService $cacheService) {
		$form = [
			'name'     => trim($request->get('name')),
			'email'    => trim($request->get('email')),
			'password' => $request->get('password'),
		];

		// check if profile picture exits
		if ($request->hasFile('profile_picture')) {
			$imageName = sprintf('%s.png', str_random(30));
			$imagePath = "images/{$imageName}";
			$image = Image::make($request->file('profile_picture'));
			$image->resize(30, 30);
			$image->save(storage_path($imagePath));
			$form['profile_picture'] = $imagePath;
		}

		$user = $userRepository->saveNewUser($form);
		// write request to log file
		Helper::logRequest($form, $request->route()->getName());
		// generate access token
		$token = $tokenRepository->saveNewToken($user->id);
		// cache access token for 5 min with user id as value
		$cacheService->insertAccessTokenToCache($token->access_token, $token->user_id, 5);

		return $this->respondSuccess([
			'user_id'       => $user->id,
			'name'          => $user->name,
			'email'         => $user->email,
			'access_token'  => $token->access_token,
			'refresh_token' => $token->refresh_token,
			'expires_in'    => $token->expires_in->toDateTimeString(),
		], 201);
	}

	public function postLogin (LoginRequest $request, TokenRepository $tokenRepository, CacheService $cacheService) {
		$credentials = [
			'email'      => $request->get('email'),
			'password'   => $request->get('password'),
			'deleted_at' => null,
		];

		$isAccepted = Auth::attempt($credentials);
		if (false === $isAccepted) {
			return $this->respondError([ 'message' => 'Email or Password mismatch', ], 400);
		}

		$user = Auth::user();
		// save access token
		$token = $tokenRepository->saveNewToken($user->id);
		// cache access token for 5 min with user id as value
		$cacheService->insertAccessTokenToCache($token->access_token, $token->user_id, 5);

		return $this->respondSuccess([
			'user_id'       => $user->id,
			'name'          => $user->name,
			'email'         => $user->email,
			'access_token'  => $token->access_token,
			'refresh_token' => $token->refresh_token,
			'expires_in'    => $token->expires_in->toDateTimeString(),
		], 200);
	}

	public function postRefreshToken (RefreshTokenRequest $request, TokenRepository $tokenRepository, CacheService $cacheService) {
		$accessToken = $request->bearerToken() ?: $request->get('access_token');
		$refreshToken = $request->get('refresh_token');

		$user = Auth::user();
		$previousAccessToken = $tokenRepository->matchAccessTokenWithRefreshToken($accessToken, $refreshToken, $user->id);

		if (!$previousAccessToken || Carbon::now()->gt(new Carbon($previousAccessToken->expires_in))) {
			return $this->respondError([ 'token' => 'Invalid Token' ]);
		}

		$newToken = $tokenRepository->saveNewToken($user->id);
		event(new RefreshTokenEvent($previousAccessToken, $newToken));
		$cacheService->insertAccessTokenToCache($newToken->access_token, $newToken->user_id, 5);

		return $this->respondSuccess([
			'user_id'       => $user->id,
			'name'          => $user->name,
			'email'         => $user->email,
			'access_token'  => $newToken->access_token,
			'refresh_token' => $newToken->refresh_token,
			'expires_in'    => $newToken->expires_in->toDateTimeString(),
		], 200);
	}

    public function validateToken (Request $request, TokenRepository $tokenRepository) {
        $userAccessToken = $request->bearerToken() ?: $request->get('access_token');

        $user = Auth::user();
        $token = $tokenRepository->validateAccessToken($userAccessToken);

        if (!$token) {
            return $this->respondError([ 'token' => 'Invalid Token' ], 400);
        }

        return $this->respondSuccess([
            'user_id'      => $user->id,
            'name'         => $user->name,
            'email'        => $user->email,
            'access_token' => $token->access_token,
            'expires_in'   => $token->expires_in,
        ], 200);
    }
}


text:
package br.ufpe.cin.tamarino.arduinoGenerator;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import br.ufpe.cin.tamarino.arduinoGenerator.functions.Include;
import br.ufpe.cin.tamarino.conf.Conf;
import br.ufpe.cin.tamarino.conf.Conf.ConfKeys;

public class ArduinoCodeBuild {

	private static int count=0;

	private StringBuffer code;
	private File finalFile;

	private List<AbstractScript> includeFluxogram;
	private List<AbstractScript> varDeclarationFluxogram;
	private List<AbstractScript> setupFluxogram;
	private List<AbstractScript> loopFluxogram;

	public ArduinoCodeBuild(){
		code=new StringBuffer("");
		setupFluxogram = new ArrayList<AbstractScript>();
		loopFluxogram = new ArrayList<AbstractScript>();
		includeFluxogram=new ArrayList<AbstractScript>();
		varDeclarationFluxogram=new ArrayList<AbstractScript>();
	}

	public void addInclude(Include inc){
		includeFluxogram.add(inc);
	}

	public void addVarDeclaration(VarDeclaration var){
		varDeclarationFluxogram.add(var);
	}

	public void addSetupFunction(AbstractScript function){
		setupFluxogram.add(setupFluxogram.size(), function);
	}

	public void removeSetupFunction(AbstractScript function){
		setupFluxogram.remove(function);
	}

	public void addLoopFunction(AbstractScript function){
		loopFluxogram.add(loopFluxogram.size(), function);
	}

	public void removeLoopFunction(AbstractScript function){
		loopFluxogram.remove(function);
	}

	public File getFinalFile(){
		return this.finalFile;
	}

	public boolean processCode(StringBuffer header){
		boolean result = false;

		// Montagem do código

		//CABECALHO E DESCRICAO
		addCodeHeader(header);

		//INCLUDES
		for(AbstractScript inc : includeFluxogram){
			inc.mountScript();
			code.append(inc.getScript());
		}

		code.append("\n");

		//VARIAVEIS GLOBAIS
		for(AbstractScript global:varDeclarationFluxogram){
			global.mountScript();
			code.append(global.getScript());
		}

		code.append("\n");

		// função SETUP
		code.append("void setup(){\n");
		AbstractScript.addTabs();
		for (AbstractScript function : setupFluxogram) {
			function.mountScript();
			code.append(function.getScript());
		}
		AbstractScript.remTabs();

		code.append("}\n\n");

		// função LOOP

		code.append("void loop(){\n");
		AbstractScript.addTabs();
		for (AbstractScript lFunction : loopFluxogram) {
			lFunction.mountScript();
			code.append(lFunction.getScript());
		}
		AbstractScript.remTabs();
		code.append("}\n");

		// Fim da montagem do código

		// Salvar o código em um arquivo .INO
		result = saveCode();

		return result;
	}

	private void addCodeHeader(StringBuffer buffer) {
		code.append("/** \n"+buffer.toString()+" \n */\n\n");
	}

	private boolean saveCode(){
		boolean result = false;
		finalFile = new File(Conf.getInstance().getProperty(ConfKeys.PATH_TEMP)+"/arduinoCode"+count+".ino");
		try {
			BufferedWriter br = new BufferedWriter(new FileWriter(finalFile));
			br.write(code.toString());
			br.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		count++;
		return result;
	}
}


text:
<法規>
<法規性質>法律</法規性質>
<英文法規名稱>Stamp Tax Act</英文法規名稱>
<中文法規名稱>印花稅法</中文法規名稱>
<法規網址>https://law.moj.gov.tw/Eng/LawClass/LawAll.aspx?pcode=G0340091</法規網址>
<最新英文異動日期>20020515</最新英文異動日期>
<廢止註記>
</廢止註記>
<附件 />
<沿革內容><![CDATA[1. Full text (24 articles) Promulgated on 8 December 1934 by Presidential Decree.
2. Amendment promulgated on 10 December 1936 by Presidential Decree.
3. Amendment promulgated on 29 February 1937 by Presidential Decree
4. Amendment promulgated on 29 April 1943 by Presidential Decree
5. Amendment promulgated on 18 January 1944 by Presidential Decree
6. Amendment promulgated on 1 October 1945 by Presidential Decree
7. Amendment promulgated on 16 April 1946 by Presidential Decree
8. Full text (30 articles) promulgated on 6 June 1947 by Presidential Decree.
9. Full text (36 articles) promulgated on 3 April 1948 by Presidential Decree.
10. Amendment promulgated on 21 June 1950 by Presidential Decree.
11. Full text (44 articles) promulgated on 6 June 1953 by Presidential Decree.
12. Amendment promulgated on 9 December 1954 by Presidential Decree
13. Amendment promulgated on 24 October 1958 by Presidential Decree
14. Amendment promulgated on 8 June 1973 by Presidential Decree
15. Full text (31 articles) promulgated on 5 July 1978 by Presidential Decree.
16. Amendment promulgated on 5 December 1979 by Presidential Decree.
17. Amendment promulgated on 16 April 1984 by Presidential Decree
18. Amendment to Articles 5, 7 & 9 and deletion of Article 19 promulgated on 17 January 1986 by Presidential Decree.
19. Deletion of Articles 27 and 28 promulgated on 30 July 1993 under Presidential Decree.
20. Amendment to Article 8 promulgated on 15 May 2002 by Presidential Decree No. Hua–Tsung-1-Yi 09100095560.]]></沿革內容>
<前言><![CDATA[]]></前言>
<法規內容>
  <編章節>   Chapter I - General</編章節>
  <條文>
    <條號>Article 1</條號>
    <條文內容><![CDATA[Documents provided in this Act and drawn up in the territory of the Republic of China shall be subject to the levy of stamp tax according to this Act.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 2</條號>
    <條文內容><![CDATA[Unless otherwise specified in this Act, stamp tax shall be collected by means by the issuance of tax stamps by the Ministry of Finance.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 3</條號>
    <條文內容><![CDATA[The dollar amounts provided in this Act shall be denominated in the national currency (yuan), which, for practical purposes, shall be converted into a comparable common currency issued under the authorization of the Central Government.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 4</條號>
    <條文內容><![CDATA[Documents subject to the levy of stamp tax shall be retained for at least two years after the rights and obligations provided in said document cease to exist. But for publicly owned enterprises or joint ventures of public and private enterprises, the duration of retention shall accord to the provisions of the Accounting and other relevant regulations.]]></條文內容>
  </條文>
  <編章節>   Chapter II - Scope of Taxation</編章節>
  <條文>
    <條號>Article 5</條號>
    <條文內容><![CDATA[Types of documents subject to the levy of stamp tax include:
(deleted).
Receipts for monetary payments: referring to documents, books or records drawn upon the receipt of money, such as receipts, slips, releases, bank books, payment records and the like issued to identify monetary payment, but excluding monetary receipts for commercial invoices or commercial invoices for monetary receipts.
Deeds for sale of movables: Referring to deeds receipts issued for sale of movables.
Contracting agreements: Referring to agreements executed for the completion of a specifically ordered task, e.g. construction contracts, printing contracts, OEM contracts and the like.
Contracts for the sale, transfer and partition of real estate: Referring to pledge of lien on real estate, or deeds or contracts for sale, exchange, gratuitous transfer, or partition of real estate to be submitted to government agencies for registration.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 6</條號>
    <條文內容><![CDATA[The following documents are exempted from the levy of stamp tax:
Contracts or deeds executed by all levels of government agencies and townships (at town, city and district levels).
Monetary receipts executed by public or private schools.
Deeds or documents executed by government-owned or private enterprises internally and not involved in rights or obligations with third parties, including those issued for internal use between the head office and branches.
Debit notes sent out for claim of payments or audit purposes.
Duplicates or transcripts where a tax stamp has been affixed to the original document.
Bus tickets, train tickets, boat tickets, air tickets and other tickets for carriage of passengers or cargoes.
Receipts for the sale of self-grown agricultural products (including agriculture, forestry, fisheries and livestock) issued by farmer's associations or wholesalers at the first wholesale level on behalf of farmers.
Receipts identifying payment of salaries or wages.
Receipts identifying payment of social benefits, payments to the family of a deceased person or pensions.
Receipts for taxes or donations to the government issued by collecting agencies.
Receipts issued by voluntary handlers of government grants at the time of reimbursement.
Receipts identifying tax returns.
Receipts issued for the sale of tax stamps.
Receipts for donations issued by corporate entities organized for educational, cultural, public/social welfare, or charitable purposes.
Receipts issued by the Agricultural Land and Water Association to its members for payment for irrigation services.
Contracts for the construction or repair of aircraft, ships or boats engaged in transnational transport.]]></條文內容>
  </條文>
  <編章節>   Chapter III - Tax Rate or Tax Amount</編章節>
  <條文>
    <條號>Article 7</條號>
    <條文內容><![CDATA[The stamp tax rates or amounts are as follows:
(deleted).
Monetary receipts: Tax stamps at 0.4% of the amount received to be affixed by the person drawing up the receipt. Receipts for deposit of bid bonds: Tax stamps at 0.1% of the money deposited by the bidder to be affixed by the person drawing up the receipt.
Contracting agreements: Tax stamps at 0.1% of the contract price, to be affixed by the person executing the contract or drawing up the receipt.
Contracts for the sale, transfer, or partition of real estate: Tax stamps at 0.1% of the contract price, to be affixed by the person executing the contract or drawing up the receipt.
Contracts for the sale of movables: Tax stamps at 4 yuan per piece, to be affixed by the person executing the contract or drawing up the receipt.]]></條文內容>
  </條文>
  <編章節>   Chapter IV - Tax Return and Payment</編章節>
  <條文>
    <條號>Article 8</條號>
    <條文內容><![CDATA[Documents subject to the levy of stamp tax shall be affixed with a sufficient amount of tax stamps at the time of delivery or use; in a case where the tax amount due is so large that the affixation of tax stamps is inconvenient, the taxpayer may apply to the local tax authority for issuing a tax payment notice and pay the tax accordingly.
Stamp tax to be paid on various documents executed by any publicly owned enterprise or private enterprise may, upon the approval of the local tax authority, be paid by filing a collective tax return. The procedure for filing collective tax returns shall be prescribed by the Ministry of Finance.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 9</條號>
    <條文內容><![CDATA[Stamp tax shall be computed in common currency. For cases where stamp tax is paid by affixing tax stamps, the tax stamp is waived if the tax amount for the case calculated by the applicable rate is less than one dollar of common currency, and waived for a portion of the tax amount that is less than one dollar of common currency. For cases where stamp tax is paid by filing a collective tax return, tax is waived if the collective tax is less than one dollar of common currency and waived for a portion of the tax amount that is less than one dollar of common currency.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 10</條號>
    <條文內容><![CDATA[After affixing the tax stamps to the taxable document, the taxpayer should affix a seal over the edges of the stamps in order to cancel the stamps; the aforesaid seal may be replaced by personal signature or mark. In case the tax stamps are connected to each other in a way that makes affixing a seal over the edges of the stamps difficult, the taxpayer may affix a seal over the junctions of the tax stamps for cancellation purposes.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 11</條號>
    <條文內容><![CDATA[Tax stamps that have been affixed and cancelled may not be removed for reuse.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 12</條號>
    <條文內容><![CDATA[A taxable document shall have at least two copies, to be held each by the parties concerned or related parties, while each copy shall be affixed with tax stamps respectively. The duplicates or transcripts of the same document shall be affixed with tax stamps, provided they are regarded the same as the original.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 13</條號>
    <條文內容><![CDATA[If the same document can be categorized under two types of document subject to the same tax rate, only tax stamps applicable to one type of document are required; if the same document is subject to different tax rates, the higher rate shall govern.
Where a document subject to a higher tax rate is substituted by a document subject to a lower tax rate, the document shall be affixed with tax stamps in the amount calculated at the higher tax rate.
Where a taxable document is substituted by a tax-exempt document, tax stamps corresponding to the type of the taxable document shall be affixed.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 14</條號>
    <條文內容><![CDATA[If the same activity produces two or more documents, each document shall be affixed with applicable tax stamps according to its type, unless otherwise specified in this Act.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 15</條號>
    <條文內容><![CDATA[A document that is soon to be expired as agreed by the parties concerned, but which will continue to be in use shall be affixed with additional tax stamps.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 16</條號>
    <條文內容><![CDATA[If a document has been affixed with tax stamps and continues to be in use after modification due to a change of circumstances, the changes shall be affixed with additional tax stamps if applicable.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 17</條號>
    <條文內容><![CDATA[If the amount of a taxable document is denominated in a foreign currency, it shall be, for the purpose of determining stamp tax, converted to the national currency at the government-prescribed or approved exchange rate at the time of delivery or use.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 18</條號>
    <條文內容><![CDATA[If a taxable document does not indicate a dollar amount, stamp tax shall be determined according to the products and quantity provided in the document and the prevailing market prices of the products at the time of use.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 19</條號>
    <條文內容><![CDATA[(deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 20</條號>
    <條文內容><![CDATA[Books and records for documenting the receipt of monetary payments shall be affixed with tax stamps for each transaction. In cases where the payee of a monetary payment signs on the payment book of the payer in lieu of issuing a receipt, the payer will deduct the amount of stamp tax from the payment and affix the same amount of tax stamps on the book on behalf of the payee.
In a transaction where a temporary receipt is issued before the delivery of a formal receipt, or a receipt is issued each time for an installment payment before the issue of a gross receipt, such temporary receipts or installment receipts shall be affixed with a sufficient amount of tax stamps. At the time a formal receipt or gross receipt is issued, the payee shall recover the receipts already issued and paste them to the back of the formal or gross receipt, and affix additional tax stamps to make up the difference in stamp tax due, if any.
If the payee fails to paste the temporary receipt or installment receipts to the back of the formal receipt or gross receipt issued, he/she shall affix tax stamps corresponding to the total amount indicated in the receipt.]]></條文內容>
  </條文>
  <編章節>   Chapter V - Examination</編章節>
  <條文>
    <條號>Article 21</條號>
    <條文內容><![CDATA[The examination of stamp tax shall be conducted by the agency in charge of stamp tax under the Ministry of Finance in accordance with the Tax Collection Act; the examination rules shall be prescribed by the Ministry of Finance.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 22</條號>
    <條文內容><![CDATA[Any person may report violation of this Act to the competent tax authority.]]></條文內容>
  </條文>
  <編章節>   Chapter VI - Penalties</編章節>
  <條文>
    <條號>Article 23</條號>
    <條文內容><![CDATA[Violation of Paragraph 1 of Article 8 or Articles 12 to 20 herein for failing to affix tax stamps required or affixing insufficient tax stamps shall be subject to a fine at five to fifteen times the tax owed in addition to making up the tax stamps required.
Late payment of stamp tax in cases where collective payment applies shall be subject to the actions stipulated in Article 20 of the Tax Collection Act; if the payment is more than thirty (30) days in arrears, the case shall be forwarded to the court for enforcement and the violator shall be imposed a fine at one to five times the tax owed, depending on the severity of the violation.
Violation of Article 4 herein shall be subject to a fine of not more than 1,000 yuan, depending on the severity of the violation.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 24</條號>
    <條文內容><![CDATA[Violation of Article 10 herein shall be subject to a fine at five to ten times the amount of tax stamps not cancelled or nullified as required, depending on the severity of the violation.
Violation of Article 11 shall be subject to a fine at twenty to thirty times the amount of tax stamps removed for reuse, depending on the severity of the violation.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 25</條號>
    <條文內容><![CDATA[Persons who interfere with the authority's examination of stamp tax shall be subject to the actions provided in the Criminal Code with regard to interference in a public function.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 26</條號>
    <條文內容><![CDATA[In a case where a document violates two or more provisions provided herein, each violation will be ruled on separately and the resulting penalties will be imposed collectively.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 27</條號>
    <條文內容><![CDATA[(deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 28</條號>
    <條文內容><![CDATA[(deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 29</條號>
    <條文內容><![CDATA[Subsequent to the imposition of a penalty, taxpayers responsible in cases of violation involving a failure to pay stamp tax or the removal of tax stamps for reuse shall make up the stamp tax required, and taxpayers responsible in cases of violation involving a failure to cancel or nullify tax stamps as required shall make up the cancellation. Where the whereabouts of such taxpayers are unknown, the document user or holder shall be responsible for complying with the preceding provisions.]]></條文內容>
  </條文>
  <編章節>   Chapter VII - Other Provisions</編章節>
  <條文>
    <條號>Article 30</條號>
    <條文內容><![CDATA[The enforcement rules of this Act shall be drawn up by the Ministry of Finance, subject to the approval of the Executive Yuan.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 31</條號>
    <條文內容><![CDATA[This Act shall be implemented upon promulgation.
The date of implementation for amendment to the clauses of this Act shall be set by the decree of the Executive Yuan.]]></條文內容>
  </條文>
</法規內容>
</法規>


text:
export function set(data) {
  return {
    type: 'PUSHER_SET',
    data,
  };
}

export function setPort(port) {
  return {
    type: 'PUSHER_SET_PORT',
    port,
  };
}

export function setUsername(username, force = false) {
  return {
    type: 'PUSHER_SET_USERNAME',
    username: username.replace(/[\W_]+/g, ''),
    force,
  };
}

export function connect() {
  return {
    type: 'PUSHER_CONNECT',
  };
}

export function disconnect() {
  return {
    type: 'PUSHER_DISCONNECT',
  };
}

export function upgrade() {
  return {
    type: 'PUSHER_UPGRADE',
  };
}

export function reload() {
  return {
    type: 'PUSHER_RELOAD',
  };
}

export function restart() {
  return {
    type: 'PUSHER_RESTART',
  };
}

export function localScan() {
  return {
    type: 'PUSHER_LOCAL_SCAN',
  };
}

export function getConnections() {
  return {
    type: 'PUSHER_GET_CONNECTIONS',
  };
}

export function connectionAdded(connection) {
  return {
    type: 'PUSHER_CONNECTION_ADDED',
    connection,
  };
}

export function updateConnection(connection) {
  return {
    type: 'PUSHER_UPDATE_CONNECTION',
    connection,
  };
}

export function connectionChanged(connection) {
  return {
    type: 'PUSHER_CONNECTION_CHANGED',
    connection,
  };
}

export function connectionRemoved(connection) {
  return {
    type: 'PUSHER_CONNECTION_REMOVED',
    connection,
  };
}

export function request(method, params = null, response_callback = null, error_callback = null) {
  return {
    type: 'PUSHER_REQUEST',
    method,
    params,
    response_callback,
    error_callback,
  };
}

export function getConfig() {
  return {
    type: 'PUSHER_GET_CONFIG',
  };
}

export function setSharedConfig(shared_config) {
  return {
    type: 'PUSHER_SET_SHARED_CONFIG',
    shared_config,
  };
}

export function getSharedConfig() {
  return {
    type: 'PUSHER_GET_SHARED_CONFIG',
  };
}

export function sharedConfig(shared_config) {
  return {
    type: 'PUSHER_SHARED_CONFIG',
    shared_config,
  };
}

export function getVersion() {
  return {
    type: 'PUSHER_GET_VERSION',
  };
}

export function deliverBroadcast(method, params) {
  return {
    type: 'PUSHER_DELIVER_BROADCAST',
    data: {
      method,
      params,
    },
  };
}

export function deliverMessage(recipient, method, params) {
  return {
    type: 'PUSHER_DELIVER_MESSAGE',
    data: {
      recipient,
      method,
      params,
    },
  };
}

export function getRadio() {
  return {
    type: 'PUSHER_GET_RADIO',
  };
}

export function startRadio(uris) {
  return {
    type: 'PUSHER_START_RADIO',
    uris,
  };
}

export function updateRadio(uris) {
  return {
    type: 'PUSHER_UPDATE_RADIO',
    uris,
  };
}

export function stopRadio() {
  return {
    type: 'PUSHER_STOP_RADIO',
  };
}

export function radioStarted(radio) {
  return {
    type: 'PUSHER_RADIO_STARTED',
    radio,
  };
}

export function radioChanged(radio) {
  return {
    type: 'PUSHER_RADIO_CHANGED',
    radio,
  };
}

export function radioStopped() {
  return {
    type: 'PUSHER_RADIO_STOPPED',
  };
}

export function debug(message = null) {
  return {
    type: 'PUSHER_DEBUG',
    message,
  };
}

export function getQueueMetadata() {
  return {
    type: 'PUSHER_GET_QUEUE_METADATA',
  };
}

export function queueMetadataChanged(queue_metadata) {
  return {
    type: 'PUSHER_QUEUE_METADATA_CHANGED',
    queue_metadata,
  };
}

export function addQueueMetadata(tlids = [], from_uri = null) {
  return {
    type: 'PUSHER_ADD_QUEUE_METADATA',
    tlids,
    from_uri,
  };
}

/**
 * Pinned URIs
 * */

export function getPinned() {
  return {
    type: 'PUSHER_GET_PINNED',
  };
}

export function addPinned(item) {
  return {
    type: 'PUSHER_ADD_PINNED',
    item,
  };
}

export function removePinned(uri) {
  return {
    type: 'PUSHER_REMOVE_PINNED',
    uri,
  };
}

export function setPinned(pinned) {
  return {
    type: 'PUSHER_SET_PINNED',
    pinned,
  };
}

export function pinnedUpdated(pinned) {
  return {
    type: 'PUSHER_PINNED_UPDATED',
    pinned,
  };
}

/**
 * Commands (buttons)
 * */

export function getCommands() {
  return {
    type: 'PUSHER_GET_COMMANDS',
  };
}

export function setCommand(command) {
  return {
    type: 'PUSHER_SET_COMMAND',
    command,
  };
}

export function setCommands(commands) {
  return {
    type: 'PUSHER_SET_COMMANDS',
    commands,
  };
}

export function removeCommand(id) {
  return {
    type: 'PUSHER_REMOVE_COMMAND',
    id,
  };
}

export function runCommand(id, notify = false) {
  return {
    type: 'PUSHER_RUN_COMMAND',
    id,
    notify,
  };
}

export function commandsUpdated(commands) {
  return {
    type: 'PUSHER_COMMANDS_UPDATED',
    commands,
  };
}


text:
import abc

from oslo.config import cfg
import six

from neutron.common import constants as n_const
from neutron.common import log
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

@six.add_metaclass(abc.ABCMeta)
class L2populationRpcCallBackMixin(object):
    '''General mixin class of L2-population RPC call back.

    The following methods are called through RPC.
        add_fdb_entries(), remove_fdb_entries(), update_fdb_entries()
    The following methods are used in a agent as an internal method.
        fdb_add(), fdb_remove(), fdb_update()
    '''

    @log.log
    def add_fdb_entries(self, context, fdb_entries, host=None):
        if not host or host == cfg.CONF.host:
            self.fdb_add(context, fdb_entries)

    @log.log
    def remove_fdb_entries(self, context, fdb_entries, host=None):
        if not host or host == cfg.CONF.host:
            self.fdb_remove(context, fdb_entries)

    @log.log
    def update_fdb_entries(self, context, fdb_entries, host=None):
        if not host or host == cfg.CONF.host:
            self.fdb_update(context, fdb_entries)

    @abc.abstractmethod
    def fdb_add(self, context, fdb_entries):
        pass

    @abc.abstractmethod
    def fdb_remove(self, context, fdb_entries):
        pass

    @abc.abstractmethod
    def fdb_update(self, context, fdb_entries):
        pass

class L2populationRpcCallBackTunnelMixin(L2populationRpcCallBackMixin):
    '''Mixin class of L2-population call back for Tunnel.

    The following all methods are used in a agent as an internal method.
    '''

    @abc.abstractmethod
    def add_fdb_flow(self, br, port_info, remote_ip, lvm, ofport):
        '''Add flow for fdb

        This method assumes to be used by method fdb_add_tun.
        We expect to add a flow entry to send a packet to specified port
        on bridge.
        And you may edit some information for local arp respond.

        :param br: represent the bridge on which add_fdb_flow should be
        applied.
        :param port_info: list to include mac and ip.

            [mac, ip]
        :remote_ip: remote ip address.
        :param lvm: a local VLAN map of network.
        :param ofport: a port to add.
        '''
        pass

    @abc.abstractmethod
    def del_fdb_flow(self, br, port_info, remote_ip, lvm, ofport):
        '''Delete flow for fdb

        This method assumes to be used by method fdb_remove_tun.
        We expect to delete a flow entry to send a packet to specified port
        from bridge.
        And you may delete some information for local arp respond.

        :param br: represent the bridge on which del_fdb_flow should be
        applied.
        :param port_info: a list to contain mac and ip.
            [mac, ip]
        :remote_ip: remote ip address.
        :param lvm: local VLAN map of network.
        :param ofport: a port to delete.
        '''
        pass

    @abc.abstractmethod
    def setup_tunnel_port(self, br, remote_ip, network_type):
        '''Setup an added tunnel port.

        This method assumes to be used by method fdb_add_tun.
        We expect to prepare to call add_fdb_flow. It will be mainly adding
        a port to a bridge.
        If you need, you may do some preparation for a bridge.

        :param br: represent the bridge on which setup_tunnel_port should be
        applied.
        :param remote_ip: an ip for port to setup.
        :param network_type: a type of network.
        :returns: a ofport value. the value 0 means to be unavailable port.
        '''
        pass

    @abc.abstractmethod
    def cleanup_tunnel_port(self, br, tun_ofport, tunnel_type):
        '''Clean up a deleted tunnel port.

        This method assumes to be used by method fdb_remove_tun.
        We expect to clean up after calling del_fdb_flow. It will be mainly
        deleting a port from a bridge.
        If you need, you may do some cleanup for a bridge.

        :param br: represent the bridge on which cleanup_tunnel_port should be
        applied.
        :param tun_ofport: a port value to cleanup.
        :param tunnel_type: a type of tunnel.
        '''
        pass

    @abc.abstractmethod
    def setup_entry_for_arp_reply(self, br, action, local_vid, mac_address,
                                  ip_address):
        '''Operate the ARP respond information.

        Do operation of arp respond information for an action
        In ovs do adding or removing flow entry to edit an arp reply.

        :param br: represent the bridge on which setup_entry_for_arp_reply
        should be applied.
        :param action: an action to operate for arp respond infomation.
            "add" or "remove"
        :param local_vid: id in local VLAN map of network's ARP entry.
        :param mac_address: MAC string value.
        :param ip_address: IP string value.
        '''
        pass

    def get_agent_ports(self, fdb_entries, local_vlan_map):
        for network_id, values in fdb_entries.items():
            lvm = local_vlan_map.get(network_id)
            if lvm is None:
                continue
            agent_ports = values.get('ports')
            yield (lvm, agent_ports)

    @log.log
    def fdb_add_tun(self, context, br, lvm, agent_ports, ofports):
        for remote_ip, ports in agent_ports.items():
            # Ensure we have a tunnel port with this remote agent
            ofport = ofports[lvm.network_type].get(remote_ip)
            if not ofport:
                ofport = self.setup_tunnel_port(br, remote_ip,
                                                lvm.network_type)
                if ofport == 0:
                    continue
            for port in ports:
                self.add_fdb_flow(br, port, remote_ip, lvm, ofport)

    @log.log
    def fdb_remove_tun(self, context, br, lvm, agent_ports, ofports):
        for remote_ip, ports in agent_ports.items():
            ofport = ofports[lvm.network_type].get(remote_ip)
            if not ofport:
                continue
            for port in ports:
                self.del_fdb_flow(br, port, remote_ip, lvm, ofport)
                if port == n_const.FLOODING_ENTRY:
                    # Check if this tunnel port is still used
                    self.cleanup_tunnel_port(br, ofport, lvm.network_type)

    @log.log
    def fdb_update(self, context, fdb_entries):
        '''Call methods named '_fdb_<action>'.

        This method assumes that methods '_fdb_<action>' are defined in class.
        Currently the following actions are available.
            chg_ip
        '''
        for action, values in fdb_entries.items():
            method = '_fdb_' + action
            if not hasattr(self, method):
                raise NotImplementedError()

            getattr(self, method)(context, values)

    @log.log
    def fdb_chg_ip_tun(self, context, br, fdb_entries, local_ip,
                       local_vlan_map):
        '''fdb update when an IP of a port is updated.

        The ML2 l2-pop mechanism driver sends an fdb update rpc message when an
        IP of a port is updated.

        :param context: RPC context.
        :param br: represent the bridge on which fdb_chg_ip_tun should be
        applied.
        :param fdb_entries: fdb dicts that contain all mac/IP informations per
                            agent and network.
                               {'net1':
                                {'agent_ip':
                                 {'before': [[mac, ip]],
                                  'after': [[mac, ip]]
                                 }
                                }
                                'net2':
                                ...
                               }
        :param local_ip: local IP address of this agent.
        :local_vlan_map: local VLAN map of network.
        '''

        for network_id, agent_ports in fdb_entries.items():
            lvm = local_vlan_map.get(network_id)
            if not lvm:
                continue

            for agent_ip, state in agent_ports.items():
                if agent_ip == local_ip:
                    continue

                after = state.get('after')
                for mac, ip in after:
                    self.setup_entry_for_arp_reply(br, 'add', lvm.vlan, mac,
                                                   ip)

                before = state.get('before')
                for mac, ip in before:
                    self.setup_entry_for_arp_reply(br, 'remove', lvm.vlan, mac,
                                                   ip)


text:
package fr.eyal.datalib.sample.netflix.data.config;

import fr.eyal.lib.data.service.DataLibWebConfig;
import fr.eyal.lib.data.service.model.DataLibRequest;
// Start of user code Top100Config imports
// You can add here your personal imports
// DO NOT MODIFY THE GENERATED COMMENTS "Start of user code" and "End of user code

public class Top100WebConfig extends DataLibWebConfig {

    protected static Top100WebConfig sInstance; //Singleton of the WebConfig

    public static Top100WebConfig getInstance() {
        synchronized (Top100WebConfig.class) {
	        if (sInstance == null) {
	            sInstance = new Top100WebConfig();
	        }
		}
        return (Top100WebConfig) sInstance;
    }

    private Top100WebConfig() {}

    private int httpType = DataLibRequest.HTTP_REST_GET;
	private int requestOptions = DataLibRequest.OPTION_NO_OPTION;
    private int parseType = DataLibRequest.PARSE_TYPE_SAX_XML;

    /**
     * Get the HTTP type o the request
     * @return the corresponding
     */
    @Override
    public int getHttpType() {
        return httpType;
    }

    @Override
    public int getParseType() {
        return parseType;
    }

    @Override
    public int getRequestOptions() {
        return requestOptions;
    }

// Start of user code Top100Config
// You can add here your personal content
// DO NOT MODIFY THE GENERATED COMMENTS "Start of user code" and "End of user code

}


text:
namespace boost
{
    //
    // This interface is deprecated, use range_reverse_iterator<T>
    //

    template< typename C >
    struct range_reverse_result_iterator : range_reverse_iterator<C>
    { };

} // namespace boost

#endif


text:
<?php

require_once('loginaagje.php');
if (isset($_POST["json"])) {
    $data = json_decode($_POST["json"]);
    $requestarticle = "select itemId, itemName, itemPrice, itemBitmap, itemAssortment from articles where itemId = " . $data->msg;
    $resultstr = "";
// Create connection
    $conn = new mysqli($servername, $username, $password, $database);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
        $resultstr = "No connection with mysql";
    } else {
        if ($result = $conn->query($requestarticle)) {
            while ($row = $result->fetch_object()) {
                $resultstr .= $row->itemId;
                $resultstr .= ",";
                $resultstr .= $row->itemName;
                $resultstr .= ",";
                $resultstr .= $row->itemPrice;
                $resultstr .= ",";
                $resultstr .= base64_encode($row->itemBitmap);
                $resultstr .= ",";
                $resultstr .= $row->itemAssortment;
            }
        }
        $conn->close();
    }
    $data->msg = $resultstr;
    echo json_encode($data);
}
?>


text:
@interface SSImagePickerHelper ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate>
@property (nonatomic, copy) SSImagePickerHelperDidCaptureImageBlock didCaptureImageBlock;

@end

@implementation SSImagePickerHelper

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.allowsEditing = YES;
    }
    return self;
}

- (void)showImagePickerViewControllerSourceType:(UIImagePickerControllerSourceType)sourceType onViewController:(UIViewController *)viewController completionHandler:(SSImagePickerHelperDidCaptureImageBlock)completionHandler
{
    if (![UIImagePickerController isSourceTypeAvailable:sourceType]) {
        if (completionHandler) {
            completionHandler(nil, nil);
        }
        return;
    }

    self.didCaptureImageBlock = completionHandler;

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.delegate = self;
    imagePickerController.allowsEditing = self.allowsEditing;
    imagePickerController.sourceType = sourceType;

    if (sourceType == UIImagePickerControllerSourceTypeCamera) {
        imagePickerController.mediaTypes =  [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
    }

    [viewController presentViewController:imagePickerController animated:YES completion:NULL];

}

- (void)dismissImagePickerViewController:(UIImagePickerController *)picker {
    __weak __typeof(self)weakSelf = self;

    [picker dismissViewControllerAnimated:YES completion:^{
        weakSelf.didCaptureImageBlock = nil;
    }];
}

#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];

    if ([mediaType isEqualToString:@"public.image"]) {
        UIImage *image = nil;
        if (self.allowsEditing) {
            image = info[UIImagePickerControllerEditedImage];
        }
        else {
            image = info[UIImagePickerControllerOriginalImage];
        }

        if (self.didCaptureImageBlock) {
            image = [image fixOrientation];
            self.didCaptureImageBlock(image, info);
        }
    }
    else {
        if (self.didCaptureImageBlock) {
            self.didCaptureImageBlock(nil, info);
        }
    }

    [self dismissImagePickerViewController:picker];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    if (self.didCaptureImageBlock) {
        self.didCaptureImageBlock(nil, nil);
    }
    [self dismissImagePickerViewController:picker];
}

@end


text:
module Rake
  module WordpressUpgraderFormer03
    VERSION = "0.0.1"
  end
end