text:
# Particle Public/Private Event Tips

*Tips for dealing with public and private events for Particle publish and subscribe*

Tests were performed on May 2, 2017 using system firmware 0.6.1.

## Private Events

Most of the time you'll probably want to use private events. These are only visible to the owner of the devices. (We'll discuss products in a later section of this document.)

### Sending private events from a device

This is the sample code I used for sending a private event:

```
#include "Particle.h"

int counter = 0;

void setup() {
	Serial.begin(9600);
}

void loop() {
	char eventData[64];
	snprintf(eventData, sizeof(eventData), "%d", ++counter);

	Particle.publish("gThpa2fp-test", eventData, PRIVATE);
	delay(10000);
}
```

I used an unique event name ("gThpa2fp-test") because I also ran tests for subscribing not using the private/my devices flags, and I didn't want to get flooded with events from other accounts.

### Receiving private events in the Event Log

The easiest way to monitor your events is the log in the [console](https://console.particle.io/logs).

![Event Log](images/01eventlog.png)

### Receiving private events with the CLI

You can also monitor events using the [Particle CLI](https://docs.particle.io/reference/cli/#particle-subscribe).

You can use the `mine` keyword to get events from my devices only:

```
$ particle subscribe gThpa2fp-test mine
Subscribing to "gThpa2fp-test" from my personal stream (my devices only)
Listening to: /v1/devices/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"42","ttl":"60","published_at":"2017-05-02T11:34:57.563Z","coreid":"xxx"}
{"name":"gThpa2fp-test","data":"43","ttl":"60","published_at":"2017-05-02T11:35:07.595Z","coreid":"xxx"}
```

Though if you leave the `mine` off, you'll get both public and private events. Even though the event was published as private, you'll still get the events this way:

```
$ particle subscribe gThpa2fp-test
Subscribing to "gThpa2fp-test" from the firehose (all devices) and my personal stream (my devices)
Listening to: /v1/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"36","ttl":"60","published_at":"2017-05-02T11:33:57.557Z","coreid":"xxxx"}
{"name":"gThpa2fp-test","data":"37","ttl":"60","published_at":"2017-05-02T11:34:07.557Z","coreid":"xxx"}
```

### Receiving private events on a device

Receiving private events on a Photon/Electron can be done using the `MY_DEVICES` option to [Particle.subscribe](https://docs.particle.io/reference/firmware/photon/#particle-subscribe-).

```
#include "Particle.h"

void myHandler(const char *event, const char *data);

void setup() {
	Serial.begin(9600);
	Particle.subscribe("gThpa2fp-test", myHandler, MY_DEVICES);
}

void loop() {
}

void myHandler(const char *event, const char *data) {
	Serial.printlnf("event=%s data=%s", event, data);
}

```

And the output on the serial monitor:

```
event=gThpa2fp-test data=5
event=gThpa2fp-test data=6
event=gThpa2fp-test data=7
```

What may be less obvious is that if you leave off the `MY_DEVICES` option, you *only* get public events. You do not receive private events from your own devices. In this way, subscribing is different than how the CLI behaves. This is discussed more in the public events section.

### Receiving private events with the cloud API

Receiving [stream of my events](https://docs.particle.io/reference/api/#get-a-stream-of-your-events) from the API works as you'd expect:

```
$ curl https://api.particle.io/v1/devices/events/gThpa2fp-test?access_token=xxx
:ok
```

And the output:

```
event: gThpa2fp-test
data: {"data":"1","ttl":"60","published_at":"2017-05-02T13:46:51.859Z","coreid":"xxx"}

event: gThpa2fp-test
data: {"data":"2","ttl":"60","published_at":"2017-05-02T13:47:01.833Z","coreid":"xxx"}
```

Receiving the [public stream of events](https://docs.particle.io/reference/api/#get-a-stream-of-events) from the API works like it does from the CLI. It returns both public and private events that match your prefix filter.

```
$ curl https://api.particle.io/v1/events/gThpa2fp-test?access_token=xxx
:ok
```

```
event: gThpa2fp-test
data: {"data":"12","ttl":"60","published_at":"2017-05-02T13:48:41.842Z","coreid":"xxx"}

event: gThpa2fp-test
data: {"data":"13","ttl":"60","published_at":"2017-05-02T13:48:51.842Z","coreid":"xxx"}
```

### Sending private events from the CLI

Sending a private event from the CLI just requires adding `--private` to the command:

```
$ particle publish gThpa2fp-test 100 --private
```

This showed up in the Photon serial output when subscribing using `MY_DEVICES`:

```
event=gThpa2fp-test data=100
```

In other words, `MY_DEVICES` also works with CLI and cloud API requests authenticated from your account.

### Sending private events from the cloud API

```
$ curl https://api.particle.io/v1/devices/events -d "name=gThpa2fp-test" -d "data=200" -d "private=true" -d access_token=xxx
```

This showed up in the Photon serial output when subscribing using `MY_DEVICES`:

```
event=gThpa2fp-test data=200
```

## Public Events

Public events are visible to anyone using the Particle cloud. You need to be careful when subscribing to public events, because they can come from anyone, and if the event name you're subscribed to is not sufficiently unique, you may get a large number of unexpected events.

### Sending public events from a device

I used this code to send a public event from a Photon:

```
#include "Particle.h"

int counter = 0;

void setup() {
	Serial.begin(9600);
}

void loop() {
	char eventData[64];
	snprintf(eventData, sizeof(eventData), "%d", ++counter);

	Particle.publish("gThpa2fp-test", eventData);
	delay(10000);
}
```

It's just like the code for private events except the Particle.publish call does not specify `PRIVATE` as a parameter.

### Receiving public events in the Event Log

The easiest way to monitor your events is the log in the [console](https://console.particle.io/logs). The event log only shows your events, however it will show them regardless of whether the events have the PRIVATE flag or not.

### Receiving public events with the CLI

While running the code above sending public events, you will still see them in the CLI if you subscribe using the `mine` option since they're from your device.

```
$ particle subscribe gThpa2fp-test mine
Subscribing to "gThpa2fp-test" from my personal stream (my devices only)
Listening to: /v1/devices/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"2","ttl":"60","published_at":"2017-05-02T14:18:38.293Z","coreid":"xxx"}
{"name":"gThpa2fp-test","data":"3","ttl":"60","published_at":"2017-05-02T14:18:48.328Z","coreid":"xxx"}
```

It also works if you leave off the `mine` option:

```
$ particle subscribe gThpa2fp-test
Subscribing to "gThpa2fp-test" from the firehose (all devices) and my personal stream (my devices)
Listening to: /v1/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"9","ttl":"60","published_at":"2017-05-02T14:19:48.299Z","coreid":"xxx"}
{"name":"gThpa2fp-test","data":"10","ttl":"60","published_at":"2017-05-02T14:19:58.302Z","coreid":"xxx"}
```

The main difference with publishing not using the `PRIVATE` flag is that it can be received when logged into a different Particle account:

```
C:\Users\IEUser>particle subscribe gThpa2fp-test
Subscribing to "gThpa2fp-test" from the firehose (all devices) and my personal stream (my devices)
Listening to: /v1/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"1","ttl":"60","published_at":"2017-05-02T14:41:35.102Z","coreid":"xxx"}
{"name":"gThpa2fp-test","data":"2","ttl":"60","published_at":"2017-05-02T14:41:45.072Z","coreid":"xxx"}
```

### Receiving public events on a device

This code will receive public events on a Photon or Electron:

```
#include "Particle.h"

void myHandler(const char *event, const char *data);

void setup() {
	Serial.begin(9600);
	Particle.subscribe("gThpa2fp-test", myHandler);
}

void loop() {
}

void myHandler(const char *event, const char *data) {
	Serial.printlnf("event=%s data=%s", event, data);
}
```

One thing to beware of: This will only subscribe to public events. If you send a PRIVATE event, it will not be received by the code above, even if it is from one of your devices!

### Sending public events from the CLI

This CLI command will send a public event that can be received by the code above, as it does not include the `--private` option.

```
particle publish gThpa2fp-test 100
```

### Sending public events from the cloud API

Using the `private=false` option (or leaving it out entirely) sends a public event. This event is received by the code above.

```
$ curl https://api.particle.io/v1/devices/events -d "name=gThpa2fp-test" -d "data=200" -d "private=false" -d access_token=xxx
```

## Private Product Events

Product events are currently designed to work in the device-to-cloud direction, allowing individual devices to send to the product creator via webhook, SSE, etc..

There currently is limited support for the product creator to send product events to be received by product devices.

### Receiving private events on a product device

I used this code on my Photon. Note that this is installed as product firmware, and the device is owned by a user, like a simple auth product device would be configured.

```
#include "Particle.h"

// Make sure you update these with your product ID and version!
PRODUCT_ID(1319);
PRODUCT_VERSION(23);

void myHandler(const char *event, const char *data);

void setup() {
	Serial.begin(9600);
	Particle.subscribe("gThpa2fp-test", myHandler, MY_DEVICES);
}

void loop() {
}

void myHandler(const char *event, const char *data) {
	Serial.printlnf("event=%s data=%s", event, data);
}
```

### Sending private events from the CLI

Sending a private event from the CLI from the same account that owns the Photon works as expected, the event is received by the Photon:

```
$ particle publish gThpa2fp-test 101 --private
```

A public event is not be received by the Photon, as would be expected if you use MY_DEVICES on the subscribing side, as that's the way it works for non-product devices as well.

Note that this is just sending a regular event, not a product event.

### Sending private product events from the cloud

In order to access the product APIs you'll need a product bearer access token. That's described in greater detail in [Authenticating Particle product APIs](https://github.com/rickkas7/particle_notes/tree/master/authenticating-product-apis).

```
$ curl https://api.particle.io/v1/products/1319/events -d "name=gThpa2fp-test" -d "data=102" -d "private=true" -d "access_token=xxx"
```

This was received by my product device:

```
event=gThpa2fp-test data=102
```

However I did not receive this event on a different product device that was owned by a different user. It appears that even though I created a product-specific bearer token, it still has an association with a given user. I think it might be the user that created the product, and therefore created the OAuth client.

Thus this is less useful than I anticipated. It probably can be used in the case where the product creator claims all of the devices, but not in other situations.

## Public Product Events

### Receiving public events on a product device

I used this code on my Photon. Note that this is installed as product firmware, and the device is owned by a user, like a simple auth product device would be configured.

```
#include "Particle.h"

// Make sure you update these with your product ID and version!
PRODUCT_ID(1319);
PRODUCT_VERSION(24);

void myHandler(const char *event, const char *data);

void setup() {
	Serial.begin(9600);
	Particle.subscribe("gThpa2fp-test", myHandler);
}

void loop() {
}

void myHandler(const char *event, const char *data) {
	Serial.printlnf("event=%s data=%s", event, data);
}
```

### Sending public product events from the cloud

In order to access the product APIs you'll need a product bearer access token. That's described in greater detail in [Authenticating Particle product APIs](https://github.com/rickkas7/particle_notes/tree/master/authenticating-product-apis).

```
$ curl https://api.particle.io/v1/products/1319/events -d "name=gThpa2fp-test" -d "data=105" -d "private=false" -d "access_token=xxx"
```

This time the event was received by both devices.

Unfortunately, as a public event, this also means that everyone who subscribes to the event can see it, even if they're not part of the product:

```
$ particle subscribe gThpa2fp-test
Subscribing to "gThpa2fp-test" from the firehose (all devices) and my personal stream (my devices)
Listening to: /v1/events/gThpa2fp-test
{"name":"gThpa2fp-test","data":"105","ttl":"60","published_at":"2017-05-02T16:46:46.042Z","coreid":"001"}
```

Also, anyone can send one. For example, even from another account this will trigger the subscription.

```
$ particle publish gThpa2fp-test 101
```


text:
---
title: "Stochastic Contextual Edit Distance and Probabilistic FSTs"
date: 2014-06-01
publishDate: 2021-08-20T18:07:06.497496Z
authors: ["Ryan Cotterell", "Nanyun Peng", "Jason Eisner"]
publication_types: ["1"]
abstract: "String similarity is most often measured by weighted or unweighted edit distance d(x, y). Ristad and Yianilos (1998) defined stochastic edit distance—a probability distribution p(y | x) whose parameters can be trained from data. We generalize this so that the probability of choosing each edit operation can depend on contextual features. We show how to construct and train a probabilistic finite-state transducer that computes our stochastic  ontextual edit distance. To illustrate the improvement from conditioning on context, we model typos found in social media text."
featured: false
publication: "*Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics*"
publication_short: "ACL"
links:
- name: Anthology
  url: https://www.aclweb.org/anthology/P14-2102.pdf
url_pdf: papers/cotterell+al.acl14.pdf
---

license: MIT

repository: rycolab/website

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: rycolab/website


text:
# Layout tag: dialog

Custom dialog tag, to encompass widgets.

The dialog tag allows to create a custom dialog box.  Contrary to the
window tag, it doesn't describe a window and its elements.  Usually, a
dialog is created in a control method (in response to user action).
For instance, if a user presses on a button of a window, a dialog might
appear to ask for additional information.

Notice that this tag is reserved for custom dialogs.  BUI offers you
other ways to create default dialogs.

```
<dialog title="Give me more info here">
  ...
</dialog>
```

## Usage

There are two main usages of a dialog layout.  Both use a dialog
tag and can be spawned from a window control method.

### Bare layout

The first approach is to call the `pop_dialog` method of the `Window`
class, giving it a string representation of the custom dialog layout.
This allows for very quick processing.  Here is an example that
creates a basic dialog box with a text input and two buttons: the
window control method that spawns this dialog also has to handle the
user input.

```
class Example(Window):

    """Example window."""

    async def on_profile(self):
        """The user clicked on the 'profile' button."""
        dialog = await self.pop_dialog("""
            <dialog title="Enter your name">
              <text x=2 y=3 id=name>Enter your name here:</text>
              <button x=1 y=5 set_true>OK</button>
              <button x=4 y=5 set_false>Cancel</button>
            </dialog>
        """)

        # The call to the pop_dialog method will block until the user
        # has clicked on 'ok' or 'cancel'
        if dialog: # The user has pressed on OK
            name = dialog["name"].value
            print(f"The user entered the name: {name!r}")
        else: # The user has clicked on cancel
            print("The user cancelled the operation, do nothing.")
```

The created dialog is contained inside a string representation.  This
string representation holds the dialog layout.  The root tag is not
[window](window.md) but `<dialog>`.  Inside of it is a normal window
definition.  We create a dialog with a title.  Inside of it are
three widgets: a text area and two buttons.

The 'OK' button has the attribute `set_true` and the 'cancel' button
has the attribute `set_false`.  This is a common shortcut that you will
see in dialogs: a button spawned inside a dialog, if it has a set value,
will close the dialog when pressed and set the value as a result of
the dialog.  So when the 'OK' button is clicked, the button sets
the dialog result to `True` and close the dialog.  That's why, in
the control method that created the dialog, you can do something like:

    if dialog: # 'ok' has been clicked

The `set_true` and `set_false`, along with the `set` attributes,
cannot be used except on a button inside of a dialog.

The `dialog` variable in the previous control method holds the
dialog result (that is, a set value and the list of the widgets in
the dialog), so you can get what the user entered in the 'name'
field in a very straightforward way.

### Dialog class

BUI also lets you the option to define a dialog class.  This is
a good solution if you want to use the same dialog in different
places of your program.  You have to set a
[Dialog](../../widget/dialog.md) class in your program:

```python
import hashlib

from bui import Dialog

class Hashes(Dialog):

    """Dialog to show the list of supported hashes in Python and let the user choose one."""

    # Note that you can (and maybe should) write the layout in a
    # separate .bui file.
    layout = mark("""
        <dialog title="Available hashes">
          <table x=1 y=2 id=hashes>
            <col>Algorithm</col>
            <col>Digest size</col>
            <col>Guaranteed</col>
          </table>
          <button x=1 y=5 set_true>OK</button>
          <button x=4 y=5 set_false>Cancel</button>
        </dialog>
    """)

    def on_init(self):
        """The dialog will be popped up just after."""
        table = self["hashes"]
        for name in sorted(hashlib.algorithms_available):
            guaranteed = name in hashlib.algorithms_guaranteed
            algorithm = getattr(hashlib, name)()
            table.add_row(name, algorithm.digest_size,
                    'yes' if guaranteed else 'no')
```

You can then use the window's `pop_dialog` method, giving it
not the string layout, but the dialog class instead:

```python
class Example(Window):

    async def on_hash(self):
        """The user pressed on the 'hash' button."""
        dialog = await self.pop_dialog(Hashes)
        # Block until 'ok' or 'cancel' has been pressed
        if dialog:
            hash_name = dialog["hashes"].selected.name
```

The advantage of this method is that you don't have to redefine the
layout and some control methods in the dialog itself.  This is useful
if you want to pop the same dialog in different places of your program.
Also note that you can set control methods in your dialog class (like
`on_init` in the previous example).

## Attributes

| Name         | Required | Description              | Example     |
| ------------ | -------- | ------------------------ | ----------- |
| `title` | Yes | The dialog title.  This attribute is mandatory. | `<dialog title="Tell me more">` |
| `rows` | No | The number of rows in the dialog grid. Default is `6`. | `<dialog rows=10>` |
| `cols` | No | The number of columns in the dialog grid. Default is `6`. | `<dialog cols=5>` |

You cannot set a window or dialog without a proper title.  Doing so
would impair accessibility for screen readers.  If these tools can
read anything at all on your window, it's the title bar, so be sure
it's not empty.

> `title` is a translatable attribute.  If internationalization is
  set, it should contain the `ytranslate` path to the title and will
  be translated in the proper language as needed.

The `rows` and `cols` attributes are used to set the dialog grid.  You
can think of them as the height (in rows) and width (in columns) of the
grid.  Changing this value won't make the window any bigger, but
it will give you more control on how to place the widget in the window
itself.  On the other hand, having a large grid can make designing not
so easy.  It all depends on your needs.

> Note: you don't have to set the same number of rows and columns.
  This is just the default value.  You can set different values with no
  trap:

```
<dialog cols=1 rows=8>
```

This will set a dialog with only one column, but 8 rows.  If you place
a widget in `x=0 y=0`, it will take all the window's width.  Again,
this doesn't change the window size in any way, just the way widgets
are placed on it.  You can picture the window to always be a
square but sliced in different portions (squares or rectangles, more
or less big depending on the height and width you set in the window
tag).

## Data

A dialog is a specific graphical element since it only contains other
elements and has no meaning by itself.  Therefore, you cannot send
it data, it wouldn't make much sense.  Instead, you should
send data to the dialog's graphical elements themselves.

However, some dialog attributes can be changed on the fly.

| Attribute      | Meaning and type | Example                     |
| -------------- | ---------------- | --------------------------- |
| `title` | The title (str) | `self.title = "New title"` |

These attributes can be accessed and set using the standard Python
syntax for attributes.  Behind the scenes, these attributes are cached,
handled by an extended `property()`, but you don't really need to
worry about how it works.  Suffice it to say that:

    class Example(Dialog):

        def on_press_a(self):
            self.title = "You pressed A."

... will update the dialog title when the user presses the 'a' key
on her keyboard.

## Controls

The dialog tag is tied to the [Dialog](../../widget/Dialog.md)
class.  Therefore, when you write controls on this class, you often
want to catch controls on indidivual graphical elements in the dialog.
There are a few exceptions however:

| Control                           | Method       | Description    |
| --------------------------------- | ------------ | -------------- |
| [close](../../control/close.md) | `on_close` | The dialog is about to be closed, but isn't closed yet. |
| [focus](../../control/focus.md) | `on_focus` | The dialog is focused or lose focus. |
| [init](../../control/init.md) | `on_init` | The dialog is ready to be displayed, but is not displayed just yet. |
| [press](../../control/press.md) | `on_press` | The user presses on a key from her keyboard. This control can have sub-controls. |
| [release](../../control/release.md) | `on_release` | The user relases a key on her keyboard. This control can have sub-controls. |
| [type](../../control/type.md) | `on_type` | The user types a character using her keyboard. This control can have sub-controls. |

Notice that we don't specify the dialog identifier.  It would make
no sense here.  Therefore, to use these events, you should just add a
method in the dialog class with the control name and no identifier:

    class ExampleDialog(Dialog):

        def on_focus(self):
            print(f"Am I focused? {'yes' if self.focused else 'no'}")

repository: vincent-lg/bui

repo_name: vincent-lg/bui


text:
---
title:   "Tidy+"
bg:      orangered
color:   white
style:   left
fa-icon: plus-circle
---

# Software using HTML Tidy

The HTML Tidy library, **`libtidy`**, is used and incorporated into many applications and projects. It offers an
extensive API to read in and parse html from a file or buffer into a DOM like node tree, has cleaning
and diagnostic services, ability to iterate through this node tree, interogating attributes,
child nodes, and a pretty print output. This is a list of just a few applications and projects.

- [edbrowse][10] is a portable line editor like `ed` and a browser like `lynx`, an email
  client, and much more, and is the preferred tool of a large community of visually
  impaired developers and users. [Read more…][11]

- [mod_tidy][20] is a **`libtidy`** based DSO module for Apache 2.0 that parses, cleans up,
  and pretty-prints the web server (X)HTML output. [Read more…][21]

- [node-libtidy][node-libtidy] provides server-side JavaScript bindings for libtidy.
  It aims to provide not only a high-level interface to a complete tidy run,
  but also offers methods which closely model the **`libtidy`** interface.

- [tidy-test][30] is a set of sample applications that exercise various aspects of the **`libtidy`**
  API. And always looking for more `samples`. It also includes a CMake module, [FindTidy.cmake][31]
  to be able to find installed Tidy headers and library for the compile link.

- [Notepad++][40] is a powerful editor, and several people offer a plugin that uses **`libtidy`**
  to do cleaning, indenting, etc. Some version incompatibilites have been noted.

- [Balthisar Tidy][42] is a free, full fledged text editor for **macOS** that
  encourages you to tidy your documents live, during editing.

There are also applications that use the tidy console executable externally to add
html cleaning.

- [CSE HTML Validator][41] is a commercial application for web professionals, webmasters,
  etc, anyone who wants to improve their web site, or money back. It includes an interface
  to the tidy exe.

**Note that items appearing here aren’t endorsements by HTACG or the HTML Tidy Project team,
but we do exercise some editorial discretion about what appears here.**

If you think there’s something we’re missing that uses modern Tidy or **`libtidy`**, please
feel free to issue a github pull request against this [web site][1], and we will be sure to
add it. You will want to edit [this file][2].

[1]: https://github.com/htacg/html-tidy.org/tree/gh-pages
[2]: https://github.com/htacg/html-tidy.org/tree/gh-pages/plus/_posts

[10]: https://github.com/CMB/edbrowse
[11]: /plus/#plus_edbrowse

[20]: http://sourceforge.net/projects/mod-tidy/
[21]: /plus/#plus_mod_tidy

[30]: https://github.com/geoffmcl/tidy-test
[31]: https://github.com/geoffmcl/tidy-test/blob/master/CMakeModules/FindTidy.cmake

[40]: https://notepad-plus-plus.org/
[node-libtidy]: https://github.com/gagern/node-libtidy
[41]: https://www.htmlvalidator.com/

[42]: http://www.balthisar.com/software/tidy/

license: HTMLTIDY

branch_name: refs/heads/gh-pages

gha_language: CSS

gha_license_id: NOASSERTION


text:
# [TwentyThreeHq](http://www.23hq.com)

23hq.com Provider
23 is easy photo sharing. Share private or public with
photo albums, tags, storage, slideshow, photoblog, subscriptions, send
photos and much more This provider generates html tags for single pictures.

## Implementation Details

- Provider
Name: TwentyThreeHq
- Documentation: NONE
- HTTPS support: NO
- Fake Response: NO
- Oembed Params: maxwidth , maxheight
- Supported Hosts: 23hq.com
- Responsive response: NO
- Collections: DefaultProviderCollection

repository: mpratt/Embera

gha_language: PHP

gha_license_id: MIT

repo_name: mpratt/Embera


text:
# PM10 pollution analysis - TopK Maximum value

**Input**: a collection of structured CSV files containing the daily value of PM10 value for a set of sensors with the following format:

    sensorId,date,value

Example:

    s1,2016-01-01,20.5
    s2,2016-01-02,30.1
    s1,2016-01-01,60.2
    s2,2016-01-02,20.4
    s1,2016-01-03,55.5
    s2,2016-01-03,52.5

**Output**: the top ```n``` maximum values. Example (n = 3):

    60.2
    55.5
    52.5

```sh
BD-Labs/Exercise33/target$ spark-submit --class it.polito.bigdata.spark.SparkDriver --deploy-mode client --master local Exercise33-1.jar ./in/ 3
```

repository: AndreaCossio/PoliTo-Projects

repo_name: AndreaCossio/PoliTo-Projects


text:
# Using Excepticon in Azure Functions

In a conventional web application, error handling is often handled globally in the application's middleware.  Azure Functions, however, do not currently give the developer the ability to define custom middleware for an Azure Functions application, so for this guide, we'll be configuring Excepticon at the function level.

Adding Excepticon to your Azure Function can be accomplished in a few simple steps.

### 1. Install the Excepticon Nuget Package

Install the latest version of the **Excepticon** package in your Azure Functions project via the Nuget Package Manager, the Package Manager Console, or the dotnet CLI.

Package Manager Console:

```Package Manager Console
Install-Package Excepticon
```

dotnet CLI:

```dotnet CLI
dotnet add package Excepticon
```

### 2. Add Excepticon to Your Function

In your Azure Function, initialize the ExcepticonSdk and use it to capture any exceptions that occur during the execution of your function:

```        csharp
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */5 * * * *", RunOnStartup = true)]TimerInfo myTimer, ILogger log)
{
    using (ExcepticonSdk.Init(_appSettings.ExcepticonOptions)
    {
        try
        {
            // Function logic
        }
        catch (Exception ex)
        {
            ExcepticonSdk.CaptureException(ex);
        }
    }
}
```

### 3. Add Excepticon API Key to Configuration

In this example, I pass an instance of `ExcepticonOptions` which contains my project's API Key to the `ExcepticonSdk.Init` method.  `ExcepticonOptions` is initialized on startup from the app's configuration, and it is registered as a property on the `FunctionsAppSettings` object, which is registered with the DI container and directed into the Azure Function:

FunctionsAppSettings:

```csharp
public interface IFunctionsAppSettings : IAppSettings
{
    ExcepticonOptions ExcepticonOptions { get; }
}

public class FunctionsAppSettings : IFunctionsAppSettings
{
    public FunctionsAppSettings(IConfiguration config)
    {
        ExcepticonOptions = config.GetSection("Excepticon").Get<ExcepticonOptions>();
    }

    public ExcepticonOptions ExcepticonOptions { get; }
}
```

Instantiation and registration of `FunctionsAppSettings` in Startup.cs:

```csharp
public override void Configure(IFunctionsHostBuilder builder)
{
    var appSettings = new FunctionsAppSettings(_configuration, _isDevelopment);
    builder.Services.AddSingleton((IFunctionsAppSettings)appSettings);
}
```

Injection of `FunctionsAppSettings` into Azure Function:

```csharp
public TestExceptionTimerFunction(IFunctionsAppSettings appSettings)
{
    _appSettings = appSettings;
}
```

The Exception API Key will attempt to be retrieved from one of the registered .NET Core [configuration providers](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1).

You project's API Key can be obtained from the Project Settings page for your project of the Excepticon web app.

The API Key can also be stored and retrieved from an environment variable, and app setting on the Azure app service, Azure key vault, or any other registered configuration provider, as long as it is nested in an `Excepticon` subsection.

### Alternatives

Though storing the Excepticon ApiKey as a properly secured configuration setting and accessing it via a configuration provider is the preferred method, there is an overload for `ExcepticonSdk.Init()` that lets you pass your project's ApiKey directly in code:

```csharp
using (ExcepticonSdk.Init("{Your ApiKey Here"))
```

This is an easy way to test integration with Excepticon, but is not recommended for production apps and services.

### Source Code

Source code showing the configuration of Excepticon in and Azure Functions project can be found [here](https://github.com/Excepticon/excepticon-dotnet/tree/master/examples/Excepticon.Examples.AzureFunctions).

repository: Excepticon/excepticon-docs

repo_name: Excepticon/excepticon-docs


text:
#  Model Parser
turns your models into *drumroll* queryable searches in your w2vdb !!!

uses batch prepared statement to get you models where they're suppose to be

### to make:
```
mvn clean package
```
### to run:
```
java -jar target/model-parser-1.0-SNAPSHOT-jar-with-dependencies.jar
```

gha_language: C


text:
Plug-n-Hack content probe
====

Content probe is javascript that can be injected into a content document to expose functionality to a tool.

The source is split into several source files for convenience and readibility. You may want to combine them for
convenient injection; a python script for doing just that is included (combine.py).

To run this, simply cd to the probe/src directory and do this:

```
python combine.py
```

License is the BSD License - just because I found myself using bits of
Firebug (which is under the BSD License).

repository: mozmark/Plug-n-Hack

gha_language: JavaScript

repo_name: mozmark/Plug-n-Hack


text:
---
layout: default
title: Bot Routing
permalink: Bot-Routing
parent: Features
---

**Bot Routing** feature enables developers to use many bots inside one channel. One logical scenario can be separated
into several independent bots with it own NLU providers or business logic. These are some example usages:

* Multilingual Bots with separate NLU
* A/B Testing
* Canary Deployment

### BotRoutingEngine

`BotRoutingEngine` is an implementation of `BotEngine` allowing developers to change executable `BotEngine` for
different clients.

```kotlin
val MainBotEngine = BotEngine(MainScenario)

val MultilingualBotEngine = BotRoutingEngine(
    main = "main" to MainBotEngine,
    routables = mapOf("firstEngine" to FirstExampleEngine, "secondEngine" to SecondExampleEngine)
)
```

* parameter `main` defines a default engine to process requests until client is routed to another engine.
* parameter `routables` defines a list of routable engine client requests can be routed to.

When client is routed to another engine, he or she will remain using specified engine until routing back or forward to
next bot.
> Using `Bot Routing` requires a shared instance of `BotContextManager` for every routable engine as `BotRoutingContext`
> is stored inside client context. Cleaning client context means erasing all routing state, the execution will be passed back to `main` engine.

### BotRoutingApi

`BotRoutingApi` can be accessed from `action` blocks inside scenario. This API grants access to following methods:

* `route` - route current bot request to specified engine with name from `routables` map. Next requests will be also
  send to this engine.
* `routeBack` - route current bot request back to previous bot engine
* `changeEngine` - route client all next requests to specified engine with name from `routables` map.
* `changeEngineBack` - route client all next requests back to previous bot engine.

### Example

Example usage of **Bot Routing** can be found
at [Multilingual Bot Example](https://github.com/just-ai/jaicf-kotlin/tree/master/examples/multilingual-bot).

repository: just-ai/jaicf-kotlin

gha_language: Kotlin

repo_name: just-ai/jaicf-kotlin


text:
# richcontext.scholapi

[Rich Context](https://coleridgeinitiative.org/richcontext)
API integrations for federating discovery services and metadata
exchange across multiple scholarly infrastructure providers.

Development of the Rich Context knowledge graph uses this library to:

  * identify dataset links to research publications
  * locate open access publications
  * reconcile journal references
  * reconcile author profiles
  * reconcile keyword taxonomy

This library has been guided by collaborative work on community
building and metadata exchange to improve Scholarly Infrastructure,
held at the *2019 Rich Context Workshop*.

## Installation

Prerequisites:

- [Python 3.x](https://www.python.org/downloads/)
- [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
- [Biopython.Entrez](https://biopython.org/)
- [Crossref Commons](https://gitlab.com/crossref/crossref_commons_py)
- [Dimensions CLI](https://github.com/digital-science/dimcli)
- [Requests](https://2.python-requests.org/en/master/)
- [Requests-Cache](https://github.com/reclosedev/requests-cache)
- [Selenium](https://github.com/SeleniumHQ/selenium/)
- [xmltodict](https://github.com/martinblech/xmltodict)

To install from [PyPi](https://pypi.python.org/pypi/richcontext.scholapi):

```
pip install richcontext.scholapi
```

If you install directly from this Git repo, be sure to install the
dependencies as well:

```
pip install -r requirements.txt
```

Then copy the configuration file template `rc_template.cfg` to `rc.cfg`
and populate it with your credentials.

NB: be careful not to commit the `rc.cfg` file in Git since by
definition it will contain sensitive data, e.g., your passwords.

Parameters used in the configuration file include:

| parameter | value |
| --- | --- |
| `chrome_exe_path` | path/to/chrome.exe |
| `core_apikey` | CORE API key |
| `dimensions_password` | Dimensions API password |
| `elsevier_api_key` | Elsvier API key |
| `email` | personal email address |
| `orcid_secret` | ORCID API key |
| `repec_token` | RePEc API token |

Download the [`ChromeDriver`](https://chromedriver.chromium.org/downloads)
webdriver for the `Chrome` brower to enable use of Selenium.
This will be run in a "headless" mode.

For a good (though slightly dated) tutorial for installing and testing
Selenium on Ubuntu Linux, see:
<https://christopher.su/2015/selenium-chromedriver-ubuntu/>

## Usage

```
from richcontext import scholapi as rc_scholapi

# initialize the federated API access
schol = rc_scholapi.ScholInfraAPI(config_file="rc.cfg", logger=None)
source = schol.openaire

# search parameters for example publications
title = "Deal or no deal? The prevalence and nutritional quality of price promotions among U.S. food and beverage purchases."

# run it...
if source.has_credentials():
    response = source.title_search(title)

    # report results
    if response.message:
        # error case
        print(response.message)
    else:
        print(response.meta)
        source.report_perf(response.timing)
```

## Testing

First, be sure that you're testing the source and not from an
installed library.

Then run unit tests on the APIs for which you have credentials and
generate a coverage report:

```
coverage run -m unittest discover
```

Then create GitHub issues among the submodules for any failed tests.

Also, you can generate a coverage report and upload that via:

```
coverage report
bash <(curl -s https://codecov.io/bash) -t @.cc_token
```

Test coverage reports can be viewed at
<https://codecov.io/gh/Coleridge-Initiative/RCApi>

## API Integrations

APIs used to retrieve metadata:

  * *PubMed family*
    + [PubMed](https://www.ncbi.nlm.nih.gov/books/NBK25501/)
    + [EuropePMC](https://europepmc.org/RestfulWebService)

  * *Scholix family*
    + [OpenAIRE](https://develop.openaire.eu/)
    + [Crossref](https://www.crossref.org/services/metadata-delivery/)
    + [DataCite](https://support.datacite.org/docs/api)

  * *OA family*
    + [Unpaywall](https://unpaywall.org/products/api)
    + [dissemin](https://dissemin.readthedocs.io/en/latest/api.html)
    + [Semantic Scholar](http://api.semanticscholar.org/)

  * *Misc.*
    + [RePEc](https://ideas.repec.org/api.html)
    + [NSF-PAR](https://par.nsf.gov/search/)
    + [ORCID](https://www.orcid.org/)
    + [CORE](https://core.ac.uk/services/api/)
    + [Dimensions](https://docs.dimensions.ai/dsl/api.html)
    + [SSRN](https://www.ssrn.com/)

See the coding examples in the `test.py` unit test for usage patterns
per supported API.

## Troubleshooting

  * `ChromeDriver`

If you encounter an exception about the `ChromeDriver` version, for
example:

```
selenium.common.exceptions.SessionNotCreatedException: Message: session not created:
  This version of ChromeDriver only supports Chrome version 78
```

Then check your instance of the *Chrome* browser to find its release
number, then go to <https://chromedriver.chromium.org/downloads> to
download the corresponding required version of `ChromeDriver`.

## Literature

For more background about *open access publications* see:

> Piwowar H, Priem J, Larivière V, Alperin JP, Matthias L, Norlander B, Farley A, West J, Haustein S. 2017.
The State of OA: A large-scale analysis of the prevalence and impact of Open Access articles
*PeerJ Preprints* 5:e3119v1
<https://doi.org/10.7287/peerj.preprints.3119v1>

## Contributions

If you'd like to contribute, please see our listings of
[*good first issues*](https://github.com/Coleridge-Initiative/RCApi/labels/good%20first%20issue).

For info about joining the AI team working on Rich Context, see
<https://github.com/Coleridge-Initiative/RCGraph/blob/master/SKILLS.md>

## Kudos

Contributors:
[@ceteri](https://github.com/ceteri),
[@IanMulvany](https://github.com/IanMulvany),
[@srand525](https://github.com/srand525),
[@ernestogimeno](https://github.com/ernestogimeno),
[@lobodemonte](https://github.com/lobodemonte),
plus many thanks for the inspiring *2019 Rich Context Workshop* notes by
[@metasj](https://github.com/metasj),
and guidance from
[@claytonrsh](https://github.com/claytonrsh),
[@Juliaingridlane](https://github.com/Juliaingridlane).

repository: kaydoh/RCApi

repo_name: kaydoh/RCApi


text:
---
title: Plugins, Scripts, and Commands
summary: An introduction to writing plugin scripts.
permalink: /guides/plugin-scripts/
redirect_from: /introduction/plugin-scripts/
order: 300
---

A Plugin in Sketch defines one or more commands, which Sketch will display menu items for.

Each of these commands is actually implemented as a JavaScript function (we call them handlers), located in a script file in the bundle.

Each script can contain as many handlers as you need, and each command can be implemented by a different handler, so it’s up to you whether you arrange things with one script per command, or put all the command handlers in a single script file.

So to find out how to make Plugins, you first need to know how to write Sketch scripts.

Teaching you how to write JavaScript code is beyond the scope of these pages, so we’re going to assume that you already know that bit. If not, there are lots of good [learning resources](/resources/) on the internet!

## Script Syntax

Scripts in Sketch are written using [CocoaScript](https://github.com/ccgus/CocoaScript).

This is a bridge that lets you write JavaScript scripts that can call native Objective-C/Cocoa.

Using it, you can write the logic of your Plugin in JavaScript, but can call the actual classes and methods that implement Sketch itself when you want to make it do something.

The basics are as follows:

* you write your JavaScript code as you normally would
* using the bridge, you can obtain Objective-C objects from the host application (in this case Sketch), or from the system itself
* basic Objective-C objects that have a JavaScript equivalent (such as strings and numbers), can typically be used in the same way as their JS versions
* you can read and write properties on custom Objective-C objects as you would in JS
* you can call methods on custom Objective-C objects, using either the familiar JavaScript syntax, or the Objective-C square bracket syntax.

(See the [More On CocoaScript](/guides/cocoascript/) page for more details.)

When your script is called by Sketch, you are passed some _context_, including the Objective-C objects representing the current Sketch document and selection.

You can then read properties, perform calculations, and call methods on these objects, to accomplish your script’s purpose.

## Script Context

When a user selects a Plugin menu command, Sketch looks up which handler (CocoaScript function) to call, and which script file to call it in.

When the handler is called, it is passed a single _context_ variable. This contains some important properties that you can use to access the objects that you’ll need.

For example, the selection property gives you a list of the selected layers in the current document:

```js
var onRun = function(context) {
  var selection = context.selection
  for (var i = 0; i < selection.count(); i++) {
    var layer = selection[i]
    log('layer ' + layer.name + ' is selected.')
  }
}
```

All Plugins in Sketch have access to the following default variables:

* **command**: an [`MSPluginCommand`](/reference/class/MSPluginCommand/) object representing the script command currently executing
* **document**: an [`MSDocument`](/reference/class/MSDocument/) object representing the current document
* **plugin**: an [`MSPluginBundle`](/reference/class/MSPluginBundle/) object representing the plugin bundle containing the currently executing script
* **scriptPath**: an `NSString` containing the full path to the currently executing script
* **scriptURL**: like **scriptPath**, but as an NSURL object
* **selection**, an `NSArray` of the layer(s) that are selected in the current document; each item of this array is an [`MSLayer`](/reference/class/MSLayer/) object

## Trying Out Scripts

The easiest way to try out simple scripts is via the **Plugins › Custom Plugin…** menu item.

This gives you a text field into which you can type your script.

Hitting the **Run** button will execute the script and display any output or errors in the lower panel.

You can use this interface to explore and experiment.

## Creating a Plugin

Once you have a script that you want to develop into a proper Plugin, you can use the **Save…** button in the **Run Custom Script…** sheet.

This will create a Plugin folder (known as a [Plugin Bundle](/guides/plugin-bundles/)) and save your script into it.

The resulting Plugin will have a single command and a single script file. Executing the command will call the `onRun` function in the script, which will contain the code you entered.

From this starting point, you can expand your Plugin by editing the files in the folder directly.

You can add more code to your `onRun` function, add more functions, and even more script files.

By editing the `manifest.json` file in the Plugin folder, you can customise the name of the command, enter a description, and even expand the Plugin to define multiple commands.

For more information on this, see [Plugin Bundles](/guides/plugin-bundles/).

repository: nichenqin/SketchAPI

branch_name: refs/heads/develop

repo_name: nichenqin/SketchAPI


text:
# Mongo installation
This role will install Mongo in either standalone mode, or in cluster mode. It is intended to be used in the OpenConext platform.

You need to set the role of your mongo hosts in the host_vars.

the key is `mongo_replication_role:` and it can have the values: "primary", "secondary" or arbiter.

Please review the official Mongo documentation for more information.

repository: OpenConext/OpenConext-deploy

gha_language: Jinja

repo_name: OpenConext/OpenConext-deploy


text:
# NgPortfolio

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.1.

This project, paired with the tutorials, is aimed at allowing devs to create and customize their own portfolio site using Angular.
With Firebase there is an added benefit of being able to store data and host your site (free of charge).

## Getting Started
### The Angular App
* Once you've cloned the repo, be sure to run `npm i`.
* Assuming you have an existing firebase project:
    * Run `firebase init` to initialize firebase in your project and be sure to select the existing project.
    * Be sure to include Firebase Hosting, and Firestore
    * Ensure that your public directory is the same as the build `outputPath` in your `angular.json`. In this case it will be `/dist/Ng-Portfolio`.
* **Be sure to include your Firebase config settings inside the `environment.ts` and `environment.prod.ts`** (Feels like a bit too much effort to create separate environments for a portfolio app.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Build and Deploy to Firebase

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

* Be sure to delete the current `/dist` directory and all of its contents.
* Run `ng build --prod`.
* Cd in to the `/dist/Ng-Portfolio` directory and run the command: `firebase deploy --only hosting`.
* Have a look at the terminal for the URL which your app will be hosted on.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

branch_name: refs/heads/main


text:
# junit5-docker

The [testcontainers project is adding support to JUnit 5](https://github.com/testcontainers/testcontainers-java/issues/87#issuecomment-272088989) and we want to avoid unnecessary standards.
This library is a small workaround while waiting for testcontainers to fully support JUnit5 but won't evolve.

[![Build Status](https://travis-ci.org/FaustXVI/junit5-docker.svg?branch=master)](https://travis-ci.org/FaustXVI/junit5-docker)
[![Build status](https://ci.appveyor.com/api/projects/status/j2bfqs6klneyohli/branch/master?svg=true)](https://ci.appveyor.com/project/FaustXVI/junit5-docker/branch/master)

Start docker containers from your junit tests

The documentation can be found here : https://faustxvi.github.io/junit5-docker/

[![Codescene analysis](https://codescene.io/projects/317/status.svg)](https://codescene.io/projects/317/jobs/latest-successful/results)


text:
# jmoldow-python3-async-tutorial
Tutorial for everything async in Python3: generators, coroutines, async/await syntax, and asyncio.

Author: [Jordan Moldow][]
License: [Apache License, Version 2.0][Apache License]
URL: <https://github.com/jmoldow/jmoldow-python3-async-tutorial>

---------------------------------------

## Introduction

Have you ever seen code like:

    # Code sample from <https://github.com/aio-libs/aiohttp/blob/2.0.4/README.rst>
    # Copyright (c) 2013-2017 Nikolay Kim, Andrew Svetlov, and other aiohttp contributors: <https://github.com/aio-libs/aiohttp/blob/2.0.4/CONTRIBUTORS.txt>.
    # License: Apache Software License, Version 2.0, <https://github.com/aio-libs/aiohttp/blob/2.0.4/LICENSE.txt>
    async def fetch(session, url):
        with aiohttp.Timeout(10, loop=session.loop):
            async with session.get(url) as response:
                return await response.text()

and wondered things like:
- What do these ``async`` and ``await`` keywords do?
- What does it look like when this code executes?
- How does this asynchronous execution work?

Or perhaps you've never seen this style of Python programming before.

If any of these things apply to you, I hope that this tutorial can be
educational for you.

Python 3.4 introduced, via the proposal in [PEP 3156][], the
[``asyncio``][asyncio docs] standard library module, a Python standard for
asynchronous programming and event loops.

Python 3.5 expanded this, via the proposal in [PEP 492][], which extended the
[syntax of the Python language][Python language data model reference] with the
``async`` and ``await`` keywords, and also introduced the notion of native
coroutines and awaitables.

I had a difficult time understanding these features. On multiple occasions, I
read the PEPs and the language reference. I also listened to a few conference
talks on the subject. While these references gave good information on the
"what" of the material ("``asyncio`` provides an event loop that can run
multiple IO-bound tasks on a single thread", "``async def`` lets you define an
asynchronous coroutine", "``await`` waits on the value of a coroutine/future
and returns the final result", etc.), they did not help me develop a mental
model of what these things actually meant, how they worked at runtime, or how
one would write or run asynchronous code.

After many attempts, with the help of reading the [CPython source code][], I've
finally developed a decent understanding of what is going on with those
features. Since I personally had trouble learning via the existing
documentations and conference talk videos, I'm hoping that this tutorial can
make the topic more accessible to others who might not understand it yet.

This tutorial is meant to cement my own understanding of async programming in
Python, as well as to augment the existing body of documentation on these
subjects, since I personally found them to be lacking for beginners.

We'll start from simple generators, moving to `yield from` syntax, and then to
coroutines. From there we'll show how the language was extended with
async/await syntax and native coroutines, and then finally we'll look at how
the asyncio library executes these coroutines via its event loop.

[PEP 3156]: <https://www.python.org/dev/peps/pep-3156/> 'PEP 3156 -- Asynchronous IO Support Rebooted: the "asyncio" Module'
[PEP 492]: <https://www.python.org/dev/peps/pep-0492/> 'PEP 492 -- Coroutines with async and await syntax'
[CPython source code]: <https://github.com/python/cpython> 'The source code of the C core reference implementation of Python'
[asyncio docs]: <https://docs.python.org/3.4/library/asyncio.html> 'asyncio - Asynchronous I/O, event loop, coroutines and tasks'
[Python language data model reference]: <https://docs.python.org/3.5/reference/datamodel.html> 'Python language data model reference'

## Locally running the Jupyter notebooks

### Bootstrapping requirements

- ``python3.6``
- ``virtualenv``
- ``make`` (setup can be performed manually if ``make`` isn't available)

### Notebook requirements

See ``requirements.txt``.

### Commands

#### Start the server

    make run_jupyter_notebook

This will create a new ``python3.6`` virtualenv in this directory, install the
latest versions of all the project's PyPI dependencies listed in
``requirements.txt``, and start the Jupyter notebook server. When the server
starts, the home page will be opened in the default web browser.

#### Manually start the server

    make && source .pyvenv/bin/activate && python -m jupyter notebook

This does the same thing as ``make run_jupyter_notebook``, but allows you to
pass custom options to `jupyter`.

#### Clean the repository

    make clean

This will delete everything that hasn't already been committed.

---------------------------------------

## Copyright Attributions

This projects includes code samples from <https://github.com/python/cpython/tree/v3.6.1>.
Copyright (c) 2001-2017 Python Software Foundation.
All Rights Reserved.
License: Python license, <https://www.python.org/3.6/license.html>

This projects includes code samples from <https://github.com/aio-libs/aiohttp/tree/2.0.4>.
Copyright (c) 2013-2017 Nikolay Kim, Andrew Svetlov, and other aiohttp contributors: <https://github.com/aio-libs/aiohttp/blob/2.0.4/CONTRIBUTORS.txt>.
License: Apache Software License, Version 2.0, <https://github.com/aio-libs/aiohttp/blob/2.0.4/LICENSE.txt>

## License

License: [Apache License, Version 2.0][Apache License]
[Jordan Moldow][], 2017

>     Copyright 2017 Jordan Moldow
>
>     Licensed under the Apache License, Version 2.0 (the "License");
>     you may not use this file except in compliance with the License.
>     You may obtain a copy of the License at
>
>         http://www.apache.org/licenses/LICENSE-2.0
>
>     Unless required by applicable law or agreed to in writing, software
>     distributed under the License is distributed on an "AS IS" BASIS,
>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>     See the License for the specific language governing permissions and
>     limitations under the License.

[Jordan Moldow]: <https://github.com/jmoldow> "Jordan Moldow"
[Apache License]: <http://www.apache.org/licenses/LICENSE-2.0> "Apache License, Version 2.0"


text:
### Bolt Installer for Composer

This is a custom workflow based on Bolt CMS and InuitCSS framework.

## Initial Setup

You must have Composer installed, if you don't just run `./install-composer`

Once Composer is installed just run:

`./install`

## Theme development

Go to `public_html/theme/base-2017_dev/source/` and run `npm start`

## Project reviews

To generate a public preview for reviewing use [ngrok](https://ngrok.com/) on the project root:

`ngrok http -host-header=rewrite ${PWD##*/}.dev:80`

## Production build

On `public_html/theme/base-2017_dev/source/` directory run `npm run build`

See the README file in `public_html/theme/base-2017_dev/source/` to learn more about modifying the current theme.

repository: EzeRangel/public-site

gha_language: HTML

repo_name: EzeRangel/public-site


text:
# Paginator

[![Version](https://img.shields.io/cocoapods/v/Paginator.svg?style=flat)](https://cocoapods.org/pods/Paginator)
[![License](https://img.shields.io/cocoapods/l/Paginator.svg?style=flat)](https://cocoapods.org/pods/Paginator)
[![Platform](https://img.shields.io/cocoapods/p/Paginator.svg?style=flat)](https://cocoapods.org/pods/Paginator)

## Example

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

===============================================================================

The controllers implemented in the pagingViewController do need to conform to the Pageable protocol.
```swift
class ViewControllerOne: UIViewController, Pageable {

    // MARK: - Paging implicit properties

    var pageTitle: String {
        return "vcOne"
    }

    func pagingViewDidShow() {
        textfield.becomeFirstResponder()
    }
}
```

To implement this in your base viewController:
```swift
    /// This function is used to only at the pagingView (top bar),
    /// with an amount of titles given to it.
    func exampleAddingOnlyThePagingView() {
        // PagingView titles
        let pagingView = PagingView(titles: ["Red", "Gray", "Blue"])

        // PagingView Delegate
        pagingView.delegate = self

        // Add pagingView
        pagingView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(pagingView)

        // give the pagingView some contstraints
        pagingView.topAnchor.constraint(equalTo: view.topAnchor, constant: 16).isActive = true
        pagingView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
        pagingView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
        pagingView.heightAnchor.constraint(equalToConstant: 100).isActive = true
    }

    /// Here we instantiate some viewControllers, and show the pagingViewController with the initialized viewControllers.
    /// We can add this PagingViewController to a containerView so we have a baseController that is in control of the pagingViewController.
    func exampleAddingThePagingViewController() {
        let controller1 = ViewControllerOne()
        let controller2 = ViewControllerTwo()
        let controller3 = ViewControllerThree()

        let controller = PagingViewController(viewControllers: [controller1, controller2, controller3], initialIndex: 0)
        self.present(controller, animated: true, completion: nil)
    }
```

## Installation

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

```ruby
pod 'ADPaginator'
```

## Contributing

For those who want to contribute, please create feature branches on develop and create a Pull Request when done. We will work with a release 'master' and beta 'beta' branch.

## Author

AdamsDevelopment<EMAIL_ADDRESS>
## License

Paginator is available under the MIT license. See the [LICENSE](https://github.com/AdamsDevelopment/Paginator/blob/master/LICENSE) file for more info.


text:
### 9. Input and Output

Reading from and writing to terminal are side-effects as they can change result of same operation.
Separate purely functional code from IO via Type System. The IO Type constructor produces types with IO actions wrapped around a value.
They can be performed by evaluating them inside a main function.
Special steps are necessary for conversion. Return returns a regular value into an IO action, a '<-' left arrow converts an IO action into a regular value.

* code sample calculating number of words in [enable1.txt](http://norvig.com/ngrams/enable1.txt)

```h9.1.hs
import System.IO

main = do
       handle <- openFile "enable1.txt" ReadMode
       contents <- hGetContents handle
       putStrLn ("There are " ++ show (length (lines contents)) ++ " words.")
       hClose handle
```

> usage

```
± % runhaskell h9.1.hs                                                                                !1154
There are 172820 words.
```
---

* printing a random word from word-list

```
import System.IO
import System.Random

main = do
       handle <- openFile "enable1.txt" ReadMode
       contents <- hGetContents handle
       --- getStdGen returns seed for a random number generator wrapped in an IO action
       gen <- getStdGen
       --- map was used to get rid of last char if it comes of as newline
       --- randomR has type spec as can return alphabet and more, return random Value and new seed
       let allWords = map init (lines contents)
           (n, _) = randomR (0, (length allWords) - 1) gen :: (Int, StdGen)
       play (allWords !! n)
       hClose handle

play word = do
            putStrLn ("The word is " ++ word ++ ".")
```

> usage

```
± % runhaskell h9.1.hs
The word is musings.

± % runhaskell h9.1.hs
The word is miscalculates.
```
---

* guess if a letter is in word

```
import System.IO
import System.Random

main = do
       handle <- openFile "enable1.txt" ReadMode
       contents <- hGetContents handle
       gen <- getStdGen
       let allWords = map init (lines contents)
           (n, _) = randomR (0, (length allWords) - 1) gen :: (Int, StdGen)
       play (allWords !! n)
       hClose handle

play word = do
            putStrLn word
            putStrLn "Enter a letter to guess:"
            line <- getLine
            putStrLn (handle (head line) word)
            play word

handle letter word
       | letter `elem` word = "Yup"
       | otherwise          = "Nope"
```

> usage

```
± % runhaskell h9.1.hs
subsaturated
Enter a letter to guess:
s
Yup
subsaturated
Enter a letter to guess:
w
Nope
subsaturated
Enter a letter to guess:
h9.1.hs: <stdin>: hGetLine: end of file

```

---

* full-on Hangman style game

```
import System.IO
import System.Random

main = do
       handle <- openFile "enable1.txt" ReadMode
       contents <- hGetContents handle
       gen <- getStdGen
       let allWords = map init (lines contents)
           (n, _) = randomR (0, (length allWords) - 1) gen :: (Int, StdGen)
           word = allWords !! n
       play word (map (\x -> '_') word)
       hClose handle

play word known = do
            putStrLn known
            putStrLn "Enter a letter to guess:"
            line <- getLine
            play word (handle (head line) word known)

handle letter word known
  | letter `elem` word = zipWith (\w k -> if w == letter then w else k) word known
  | otherwise          = known
```

> usgae

```
± % runhaskell h9.1.hs
__________
Enter a letter to guess:
a
___a_____a
Enter a letter to guess:
i
___a_____a
Enter a letter to guess:
s
s__a_____a
Enter a letter to guess:
t
s__a_____a
Enter a letter to guess:
r
s__a_____a

```
---

try
* [stanford.edu !! schwarz-evil-hangman](http://nifty.stanford.edu/2011/schwarz-evil-hangman)

---

gha_language: Elixir


text:
# kaholo-plugin-vsphere
Kaholo Plugin for VMWare vSphere

## Settings:
1) User (String) **Required** - Username of user to connect with.
2) Password (Vault) **Required** - Password of user to connect with.
3) Host (String) **Required** - The hostname of the host to connect to(only host name, no need for https://).

## Methods: List datacenter
This method will list all your datacenters in your VSPhere.

### Parameters:
1. DC name (String) **Optional** - If provided, filter by name provided.

## Method: Create datacenter
This method will create a new Datacenter in your vsphere.

###  Parameters:
1. Datacenter name (String) **Required** - The name of the new datacenter to create.
2. Datacenter folder (String) **Required** - Path of folder to create the datacenter in.

## Method: Delete datacener
This method will delete a datacenter from your vsphere.

### Parameters:
1. Datacenter ID (String) **Required** - The name of the new datacenter to delete.
2. Force (Boolean) **Optional** - Should force delete. If specified delete the datacenter even if it is not empty. Default value is false.

repository: Kaholo/kaholo-plugin-vsphere

repo_name: Kaholo/kaholo-plugin-vsphere


text:
jetty Cookbook
==============

[![Build Status](https://travis-ci.org/chef-cookbooks/jetty.svg?branch=master)](http://travis-ci.org/chef-cookbooks/jetty)
[![Cookbook Version](https://img.shields.io/cookbook/v/jetty.svg)](https://supermarket.chef.io/cookbooks/jetty)

Installs and configures Jetty, Java servlet engine and webserver.

Requirements
------------
#### Platforms
- Debian, Ubuntu

#### Chef
- Chef 12+

#### Cookbooks
- java

Attributes
----------
* `node["jetty"]["host"]` - Listen to connections from this network host, default '<IP_ADDRESS>'.
* `node["jetty"]["port"]` - The network port used by Jetty, default '8080'.
* `node["jetty"]["jetty_args"]` - Additional arguments to pass to Jetty, default ''.
* `node["jetty"]["java_options"]` - Extra options to pass to the JVM, default '-Xmx256m -Djava.awt.headless=true'.
* `node['jetty']['install_java']` - Install java via the java cookbook. Defaults to true

Recipes
-------

## default.rb

The default recipe will install the native package for Jetty. The service will be managed via the package provided init scripts.

Usage
-----

Simply include the recipe where you want Jetty installed.

License & Authors
-----------------

**Author:** Cookbook Engineering Team<EMAIL_ADDRESS>
**Copyright:** 2010-2015, Chef Software, Inc.

```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: sportngin-cookbooks/jetty

repo_name: sportngin-cookbooks/jetty


text:
# code-wars
Code Wars solutions

## Pair Kata 6-4-18

Link: https://www.codewars.com/kata/abbreviate-a-two-word-name

Problem Domanin: Write a function to take a first and last name and convert it into initials with a dot in between them. The initials need to be upper case.

repository: ZhenChiX/code-wars

repo_name: ZhenChiX/code-wars


text:
FTP server for lwip and tinyfatfs
=================================

This repository contains the ftp-server for lwip Copyright (c) 2002 Florian
Schulze and an API translation layer Copyright (c) 2013 Philipp Tölke.

The translation layer translates between the vfs-API the ftp server uses and
the well known tinyfatfs by ChaN, which can be downloaded at
http://elm-chan.org/fsw/ff/00index_e.html .

The translation-layer

* is not reentrant and it is possible that multiple
  concurrent ftp-connections are *not* supported.
* relies on malloc(). It would be easy to change this to use a pooled allocator
* does not use long filenames for any function apart from getcwd().

All code in this repository is licensed under a 3-clause BSD license

Patches, comments and pull-requests are welcome.

repository: BBBSnowball/lwip-ftpd

repo_name: BBBSnowball/lwip-ftpd


text:
---
layout: default
---

# 1997-12-14 - IRS intimidation of Cypherpunks

## Header Data

From: bureau42 Anonymous Remailer<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 99bb76f799b3fc52565660fe4187570c4e5f57a7ad6b986d5cdc055c1f18966a

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-12-14 23:31:10 UTC

Raw Date: Mon, 15 Dec 1997 07:31:10 +0800

## Raw message

```
{% raw  %}From: bureau42 Anonymous Remailer<EMAIL_ADDRESS>Date: Mon, 15 Dec 1997 07:31:10 +0800
To<EMAIL_ADDRESS>Subject: IRS intimidation of Cypherpunks
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Sun, 14 Dec 1997 at 08:12:31 -0600 Human Gus-Peter wrote:

>>> We should not let distaste/disgust for Jim's ideas and
>>> tactics blind us to the important legal and constitutional
>>> questions lurking beneath the surface of this investigation
>>> and prosecution - there's some possibility that the IRS
>>> used its investigation of Jim as a threat to other prolific
>>> authors on the Internet.

>  The government's armed assault on Ma and Pa Bell's
> residence took place within hours of an email being sent
> to him containing a rough draft of a chapter of an InterNet
> published manuscript describing and lauding Bell's AP system.

>>> For example, copies of the press release announcing the
>>> raid on Jim's home were mailed, apparently from computer
>>> systems inside the IRS, to individuals active on the
>>> Cypherpunks list. The IRS has never before (or since)
>>> bothered to notify those individuals about criminal
>>> investigations which might otherwise be of interest.

>   It is interesting to note that the emails from
> treasury.gov constituted the same type of 'threat' that
> Bell was roundly accused of by government officials and
> the press.

I've seen brief mention of this before, but have never seen
any details on the list. Aside from Jim Choate questioning
my arithmetic or attention span, would anyone be kind enough
to provide pointers to information about incidents of c-p
list members having received unsolicited email from .gov?

Declan, did you catch a whiff of this when it happened? I
would think everyone's alarm bells would have gone off and
people would have been intensely interested in the messages
themselves, particularly the headers.

StringPullMongerII

{% endraw %}
```

## Thread

+ Return to [December 1997](/archive/1997/12)

+ Return to "[bureau42 Anonymous Remailer <nobody@bureau42.ml.org>](/authors/bureau42_anonymous_remailer_nobody_at_bureau42_ml_org_)"
+ Return to<EMAIL_ADDRESS>(Anonymous)](/authors/nobody_at_replay_com_anonymous_)"
+ Return to "[Paul Bradley <paul@fatmans.demon.co.uk>](/authors/paul_bradley_paul_at_fatmans_demon_co_uk_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1997-12-14 (Mon, 15 Dec 1997 07:31:10 +0800) - IRS intimidation of Cypherpunks - _bureau42 Anonymous Remailer<EMAIL_ADDRESS>  + 1997-12-15 (Tue, 16 Dec 1997 01:31:08 +0800) - [No Subject](/archive/1997/12/3ed7a5fff8703fc6e34639bbece81df636d10a8b7fac1a4bb6eb8c543b0cf78f) -<EMAIL_ADDRESS>(Anonymous)_
  + 1997-12-15 (Tue, 16 Dec 1997 02:30:07 +0800) - [The "warnings" several of us received from Big Brother](/archive/1997/12/f8d21fff29e5c0e3257fc036b0c59ef1b3c05a23cf629c851dc4a3500de12b90) - _Tim May<EMAIL_ADDRESS>  + 1997-12-18 (Fri, 19 Dec 1997 04:32:41 +0800) - [Re: IRS intimidation of Cypherpunks](/archive/1997/12/f081096cb44a7450aee4000cf4ae39db0fa2e2aa058a2da0eed1c950f7f7848c) - _Paul Bradley<EMAIL_ADDRESS>


text:
# Predefined Rules \(Templates\)

build.security includes predefined rules that are commonly used in authorization management. These rules are created and customized per integration for you and can easily and quickly be added to your authorization policies.

![Docker common rule](https://files.readme.io/bbf39ff-commonruleex.PNG)

### Start with Best Practice Rules

To see a list of the predefined rules for an integration, you can create a policy for that integration and enable the option to **Start with best practice rules \(recommended\)**.

![Enable predefined rules](https://files.readme.io/139874f-bestpractices.PNG)

With this option enabled, the New Policy Panel will appear when you click Save. The predefined rules for the integration you selected will be listed on this panel.

![](../../../.gitbook/assets/predefined-rules.png)

You can then select the predefined rules that best expresses the policy item you would like to add. Once this is added to the policy items table, you can add additional predefined rules \(or empty rules or custom blocks\) to further define your policy.

Each time you add a policy item to the policy, it will immediately appear in the policy items table, expanded and ready for you to complete any required data. For example, you might want to deny access based on an IP address. The predefined rule will express this need, but it requires you to specify which IP addresses you wish to block.

In addition to the information readily available in the policy item table, the expanded view offers additional details relevant to the policy item.

Although the contents of this expanded section can vary, you can expect to see:

* Specify whether you want the rule to be an **Allow** or **Deny** rule.
* Description of the rule will already be provided, but you can edit it as needed
* Additional field \(optional and customized for the specific policy item. For example, for most of the integrations, a rule such as the Check HTTP method rule will have a field for HTTP method; for Docker integrations, another field might appear.
* Rego code, which displays the syntax of the Rego code for this policy item

repository: RavenZZ/docs

repo_name: RavenZZ/docs


text:
---
layout: post
title: Chromebook vs MacBook
subtitle: an experiment and a comparison
fa-icon: bolt
author: luke patrick
date:   2016-05-18 12:00:00
permalink: chromebook-vs-macbook/
category: tech
desc: We attempt to totally replace a MacBook with a Chromebook. The Devil is in the details, and our comparison is chock-full of details.
tags:
- chromebook
- chrome os
- os x
- linux
- open source
- macbook
---

A while back, I vowed to [give Chrome OS another go](http://routerchowder.com/chromebook-replacing-macbook/) as my primary work horse. There were a lot of reasons, most of which you can read about here. But to summarize, I love the fact that the OS puts all my stuff in the cloud. Plus, someone with a low budget can do most of my job with a sub 200 piece of hardware.

Both of these things are good, but how does a Chromebook stack up versus a MacBook? Can you replace a MacBook with a Chromebook?

To find out, I spent a month following this set of rules:

- **Rule #1:** The Chromebook will be my primary work horse, and barring emergencies, I will abstain from Mac OS X.
- **Rule #2:** There will be exceptions. Where I can find a solution to an exception using Ubuntu, I will do just that.
- **Rule #3:** I'll use open source or free software only. This simulates what it's like to use a Chromebook as a cash-strapped kid.
- **Rule #4:** At the end of the project, I'll provide a detailed rundown of what worked, what did not and what you need to replace your Mac with a Chromebook.

 So for those with an eye to be easily pleased, here's the tidy summary.

> Can you replace a MacBook with a Chromebook? . . . No. You can't. But that doesn't mean you can't give it a try!

And for most things you do, the Chromebook will be more than adequate. Plus, using Linux on the side does round out the platform quite a bit.

All in all, it was more doable than I thought. And barring a few major problems, you'll find the experience an exciting one. If you've been thinking about replacing your MacBook with a Chromebook, use the headings below to see if it's a good fit.

___

### S*&% You Can Absolutely Replace

For most activities done on a MacBook, you only need the Chrome browser. For instance, surfing YouTube and Facebook requires no extra input at all. If you want your Facebook experience to be faster, you can even use a tool like  [Facebook Flat](https://chrome.google.com/webstore/detail/facebook-flat/kadbillinepbjlgenaliokdhejdmmlgp?hl=en-US).

Same goes for basic operations like writing or number crunching.  [Google Docs](http://docs.google.com) and  [Google Sheets](http://sheets.google.com) will both keep you covered without issue. If you want an iTunes replacement, you can — for the most part — get by with  [Spotify](http://spotify.com). Though if you need to manage your iPhone's music via your computer, you're SOL. Then again, who does that in 2016, anyway?

In the office, you'll find Google Hangouts is a more than suitable  [GoToMeeting](http://gotomeeting.com) replacement. Plus  [Slack comes stock](https://chrome.google.com/webstore/detail/slack/jeogkiiogjbmhklcnbgkdcjoioegiknm?hl=en-US) in the Chrome Store.

And if we look beyond the standard Chrome experience, Ubuntu provides a wealth of new options. In my previous review of the Chrome OS, I mentioned needing an easier way to SSH into my servers. Thanks to [Crouton](https://github.com/dnschneid/crouton), managing a shell script or two is no problem via the built-in Chrome terminal.

Crouton does a number for several other pain points, too. FTP is more than manageable thanks to [FileZilla](https://filezilla-project.org/) . Same goes for [Torrent downloads](https://www.transmissionbt.com/) — of a *strictly* legal variety. And if you feel restricted by my favorite Chrome editor [Caret](https://chrome.google.com/webstore/detail/caret/fljalecfjciodhpcledpamjachpmelml?hl=en), you can use Linux to hack away in [Atom](https://atom.io/).

It's all pretty seamless. By default, Crouton runs as a switchable desktop. You can accessit when needed by pressing Ctrl+Alt+Shift+Back or Ctrl+Alt+Shift+Forward.I actually preferred to simply start the apps I needed via the command line. They ran in tabs just like Chrome apps, and for the most part, it was beautiful. But, we'll talk more about that in a second.

> Overall, the theory of using Ubuntu in the background to compliment Chrome OS is a sound one. If you just need a few tweaks and additions, it makes the Chromebook a true competitor to a MacBook or MacBook Air.

### S*&% You _Might_ Be Able to Replace

From here out, though, things are going to get weird. All the above solutions work well, but immediately I found some problems with no obvious remedy. Some were more solvable than others.

For instance, I prefer an actual email client. On my MacBook I make heavy use of [AirMail](http://airmailapp.com/) . I would have preferred to see [Sparrow](http://www.macrumors.com/2015/02/17/google-pulls-sparrow/) make it through the ages, but whatever. Life moves on.

Either way, such an option just isn't available for Chrome OS — yet, anyway. Sure, you can use [CloudMagic](https://chrome.google.com/webstore/detail/cloudmagic/kddkcfbhnacmdhojcgppgpdhimdldane?hl=en-US), but it's a slow, often buggy experience.

So what can you do? Well, you can go one of two ways. You can use Google's Gmail service itself, a solution that works well for those with one or two inboxes. It's all pretty smooth, and if you want a fancier experience, try [Inbox by Google](https://www.google.com/inbox/). I actually like the latter. But until it adds a unified inbox, Gmail is [a better fit](https://gmail.googleblog.com/2015/03/all-your-mail-together-in-one-place.html) for Frequent Emailers like myself.

That being said, I missed having a dedicated email client running in the background. I hardly think about AirMail unless I need it, and then it's there for me. Plus, it's beautiful and offers a wealth of add-ons (snooze, to-do lists, etc.) that make it handy. What if I don't want to compromise at all?

There's not a lot of hope here — at least for now. By using Ubuntu, you can harness the full power of [Nylas N1](https://nylas.com/). And I have to say, it's a beautiful, powerful piece of open source software. Chrome also makes it a little slow to run at times. Which hardly remedies our original problem. If I can't leave it running in the background, then I'm better off using a native app like Gmail.

The last alternative is simply to use your phone. This is what I did most of the time. AirMail released a new iOS app simultaneously with Chrome OS II: The Reckoning. As such, it was often quicker to pop out my phone and fire off a message that way. Shamefully, when I had to send a lot of emails, I usually cracked the MacBook.

We'll be hearing about that MacBook a lot more from here out.

Starting with texting. As of writing this, there's actually more hope for me.I just purchased the new Nexus 6P. Thatmeans things like [AirDroid](https://www.airdroid.com/) and [Pushbullet](https://www.pushbullet.com/) are now on the table. With that in mind, the Chromebook may become a whole new platform for my communication needs.

For those with an iOS device, though, prepare to use your phone here, too.

Aside from these pain points, [1Password integration](https://agilebits.com/) is still a problem. Though, they also released a new service (1Password for Teams) that helped to relieve some pressure.  Namely, graphics.

I complained about this a lot the last time around, but if you want to perform an Adobe-style task, you are out of luck. At least via Chrome OS itself. There are options, but none are nearing production quality — not for professional use, anyway. You can [read the original](http://routerchowder.com/chromebook-for-web-development/) for a more in-depth breakdown of what Google-native stuff has to offer.

I had high hopes that Linux might provide a boost here. And to be fair it did a little. I tried Gimp, Inkscape, and Xara. Hell, I even installed WINE and rolled Illustrator up that way. And yet —

Don't get me wrong. I love open source software, and a good Linux app gets me excited. But the experience with this is just *not* there. I can't imagine a creative at even a small firm bringing Inkscape into a meeting. The file format transfer between standard Adobe options and these programs is a mess. Even using a [raw SVG can get weird.](http://www.howtogeek.com/wp-content/uploads/2009/11/x5bsod.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.vYS2_0xBFt.png)

All in all, there are just too many inconsistencies and bugs to make design via Chrome worth it. Plus, Mac OS X has [Sketch](http://www.sketchapp.com/) — in my opinion, the greatest design suite ever constructed.

My attempt to replace MacBook with Chromebook coincided with a bunch of new design projects. I will admit there were days when I shoved the Mac into my bag and did not swap back until I returned that evening. If I purchased a Chromebook Pixel and used WINE on the side, I might be able to achieve the same results in Chrome OS. But considering that solution costs more than my MacBook Air, it's just not worth it.

### Too Many Rules Broken

After a month of trying to use only Chrome OS, I came away a little disheartened. I actually came to relish the moments I caved and used my MacBook. Depriving yourself of those Mac niceties makes them seem almost [Godlike](http://www.modernthrill.com/wp-content/uploads/2013/05/arrested-development-in-god-we-trust-10.jpg) when you return. And here's the crux of the matter:

I actually managed to keep to my own rules pretty well. Other than using Sketch a lot, I kept to the Chromebook and used open source software. In fact, there are a lot of cool (and totally free) projects out there. N1 is a great example. The app looks beautifuland can be [forked on GitHub](https://github.com/nylas/N1) at no cost.

But I also had some philosophical problems with the experiment. I came to realize that using Linux breaks what I love most about Chrome OS. I could no longer Power Wash my computer, lest I break my new Linux installs. Considering it takes 30-minutes or more to setup again, the cloud Zen is trashed. There are SD Card workarounds, but —it's just not the same.

Likewise, I wanted to prove that a kid with a dream and $200 could go without a MacBook forever. At this point, I don't think that's the case. Not completely, anyway.

Sure, the Chromebook powers through most tasks with ease. And for coding, it can't be beat. But if a kid needs [to learn Linux](https://media.giphy.com/media/XreQmk7ETCak0/giphy.gif), use less-than ideal software (for designing) and shell out for a Chromebook with lots of RAM to run Inkscape. . . . The original hypothesis breaks down sooner than later.

### Going Forward

You might be surprised to hear, then, that I'm still using my Chromebook. Quite a lot, actually. When I need to code for hours at a time, you'll find me at [Alpine Modern](http://www.yelp.com/biz/alpine-modern-cafe-boulder-3) hacking out an API or swearing at Javascript. All via Chrome OS.

I did reset the software, though. My Acer is running pure Chrome OS, and I'm much happier. After a month of abstaining post-experiment, I'm once again enjoying the simplicity. It seems forcing yourself into Chrome OS limitations can really take the shine off. But after some time to recoup, it's all still there waiting for me.

> Chromebooks are fantastic machines. I will continue to evangelize them to just about anyone I meet. But they can't replace a MacBook.

For day-to-day use with most consumers, it'll be a welcome, simplified change. Just know that until Google works out the kinks, it's no Mac OS X Killer.

Not *yet*, anyway.

repository: lukechanning/chowder-bucket

repo_name: lukechanning/chowder-bucket


text:
---
layout: post
title: Christian's Night
---
In this page we're going to put some quick summary of the night.
This can include the [brand](https://www.capitalbrewing.co/pages/brews) or whatever.

> When moving furniture, let the owner of walk backward.
> __Reeves Father__

## Votes

|               | Appearance | Smell | Taste | Mouthfill | Packaging |
| :------------ | :--------: | :---: | :---: | :-------: | :-------: |
| Blake         | 3          | 2     | 4     | 3         | 3         |
| Marco         | 2.5        | 4.5   | 3     | 5         | 2         |
| Christian     | 2          | 4     | 2.5   | 4.5       | 3         |
| Sifu          |            |       |       |           |           |
| John          |            |       |       |           |           |

## More

We could add pics, but even not.
![alt text for image](https://brouhahabrewery.com.au/wp-content/uploads/2018/08/Brouhaha-Brewery-Craft-Beer-Middle-of-the-Road.jpg){:width="300px"}
As an example of the syntax I add a pic here


text:
[![Build Status](https://travis-ci.org/Sammers21/rss-reader.svg?branch=master)](https://travis-ci.org/Sammers21/rss-reader)

# Rss-reader

This is the demo of how you can use [vertx-cassandra-client](https://github.com/Sammers21/vertx-cassandra-client) by real example.

## Running

1. Before running the example you should ensure that cassandra service running locally on port 9042.
As a option you can run cassandra with [ccm](https://github.com/riptano/ccm#installation)(Cassandra Cluster Manager).
Follow [this](https://github.com/riptano/ccm#installation) instructions for installing ccm.
After installing you will be able to run a single node cluster:
    ```bash
    ccm create rss_reader -v 3.11.2 -n 1 -s
    ccm start
    ```

2. Building [vertx-cassandra-client](https://github.com/Sammers21/vertx-cassandra-client) locally:
    ```bash
    git clone https://github.com/Sammers21/vertx-cassandra-client
    cd vertx-cassandra-client
    mvn clean install -Dmaven.test.skip=true -s .travis.maven.settings.xml
    ```
3. Running the app:
    ```bash
    ./gradlew vertxRun
    ```
    You may also noted that we are using [vertx-gradle-plugin](https://github.com/jponge/vertx-gradle-plugin) for running the app.
    It means that the app will be reloaded automatically when code changes.
4. Now you can open your browser and go to `localhost:8080`

gha_language: Java


text:
---
layout: post
title:  "Find all tables without primary key in MySQL"
description: "Query that helps to find tables without primary key, simple and efficient way to find performance bottlenecks"
date:   2015-02-17 19:05:45
categories:
- programming
tags:
- mysql
- database
- ubuntu
comments: true
---

## Search across all databases (schemas) for tables without primary key

The following query obtains the list of tables without primary key, those who destroys the database performance

```sql
SELECT
    t.TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES AS t
LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS k
ON (
       t.TABLE_NAME = k.TABLE_NAME
   AND k.CONSTRAINT_SCHEMA = t.TABLE_SCHEMA
   AND k.constraint_name = 'PRIMARY'
)
WHERE
    t.TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')
AND k.constraint_name IS NULL;
```

In this example, the `INFORMATION_SCHEMA.TABLES` table is used to find all t. The `TABLE_NAME` column is selected, and the `WHERE` clause is used to filter system related databases.

`LEFT JOIN` is used to join with table `KEY_COLUMN_USAGE` and filter the tables that do not have a primary key.

## Restrict search for tables without primary key to a specific databases (schema)

```sql
SELECT
    t.TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES AS t
LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS k
ON (
       t.TABLE_NAME = k.TABLE_NAME
   AND k.CONSTRAINT_SCHEMA = t.TABLE_SCHEMA
   AND k.constraint_name = 'PRIMARY'
)
WHERE
    t.TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')
AND t.TABLE_SCHEMA = '<database name>' -- put database name here
AND k.constraint_name IS NULL;
```

A friendly advise, the result list of these queries should be an `Empty set`.

Happy querying!

    {% include page_tags_list_books.html %}

extension: markdown


text:
[< Previous](https://github.com/tonymontaro/leetcode-hints/tree/master/problems/number-of-boomerangs "Number of Boomerangs")

[Next >](https://github.com/tonymontaro/leetcode-hints/tree/master/problems/serialize-and-deserialize-bst "Serialize and Deserialize BST")

## [448. Find All Numbers Disappeared in an Array (Easy)](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array "找到所有数组中消失的数字")

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

Find all the elements of [1, n] inclusive that do not appear in this array.

Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.

Example:

Input:
[4,3,2,7,8,2,3,1]

Output:
[5,6]

### Related Topics
  [[Array](https://github.com/tonymontaro/leetcode-hints/tree/master/tag/array/README.md)]

### Similar Questions
  1. [First Missing Positive](https://github.com/tonymontaro/leetcode-hints/tree/master/problems/first-missing-positive) (Hard)
  1. [Find All Duplicates in an Array](https://github.com/tonymontaro/leetcode-hints/tree/master/problems/find-all-duplicates-in-an-array) (Medium)

repository: tonymontaro/leetcode-hints

repo_name: tonymontaro/leetcode-hints


text:
# grunt-bump-version

> Bump version numbers for the specified files.

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-bump-version --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-bump-version');
```
### Overview
In your project's Gruntfile, add a section named `bump_version` to the data object passed into `grunt.initConfig()`. This is a simple task, and does not conform to multi task options & files input types! All available configuration styles are described below.

```js
grunt.initConfig({
  bump_version: {
    options: {
      // Task-specific options go here.
    },
    files: [
      // Target-specific files go here.
    ],
  },
});
```

And now you can call it from CLI like this:
```shell
grunt bump_version:[version number]
```

### Usage Examples

#### Default Options
In this example the version number in the specfied files (depending on the file extension) are modified in place. With the default options the version number in js and json files are modified.

```js
grunt.initConfig({
  bump_version: {
    options: {},
    files: ['path/to/file'],
  },
});
```

#### Custom Options
In this example, custom options are used to change the regex match with the specified sub string in `.txt` files. The regular expression always needs a capturing parentheses to change the version number.

```js
grunt.initConfig({
  bump_version: {
    options: {
      txt: {
        regex: /version: '([0-9\.]*)'/g,
        substr: '%s'
      }
    },
    files: ['path/to/file'],
  },
});
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

repository: Klab-Berlin/grunt-bump-version

repo_name: Klab-Berlin/grunt-bump-version


text:
# ownCloud Infinite Scale: Phoenix

[![Build Status](https://cloud.drone.io/api/badges/owncloud/ocis-phoenix/status.svg)](https://cloud.drone.io/owncloud/ocis-phoenix)
[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/afe89eb0894848c5b67dc0343afd1df9)](https://www.codacy.com/app/owncloud/ocis-phoenix?utm_source=github.com&utm_medium=referral&utm_content=owncloud/ocis-phoenix&utm_campaign=Badge_Grade)
[![Go Doc](https://godoc.org/github.com/owncloud/ocis-phoenix?status.svg)](http://godoc.org/github.com/owncloud/ocis-phoenix)
[![Go Report](http://goreportcard.com/badge/github.com/owncloud/ocis-phoenix)](http://goreportcard.com/report/github.com/owncloud/ocis-phoenix)
[![](https://images.microbadger.com/badges/image/owncloud/ocis-phoenix.svg)](http://microbadger.com/images/owncloud/ocis-phoenix "Get your own image badge on microbadger.com")

**This project is under heavy development, it's not in a working state yet!**

## Install

You can download prebuilt binaries from the GitHub releases or from our [download mirrors](http://download.owncloud.com/ocis/phoenix/). For instructions how to install this on your platform you should take a look at our [documentation](https://owncloud.github.io/extensions/ocis_phoenix/)

## Development

Make sure you have a working Go environment, for further reference or a guide take a look at the [install instructions](http://golang.org/doc/install.html). This project requires Go >= v1.12. For the frontend it's also required to have [NodeJS](https://nodejs.org/en/download/package-manager/) and [Yarn](https://yarnpkg.com/lang/en/docs/install/) installed.

```console
git clone https://github.com/owncloud/ocis-phoenix.git
cd ocis-phoenix

make generate build

./bin/ocis-phoenix -h
```

## Security

If you find a security issue please contact<EMAIL_ADDRESS>first.

## Contributing

Fork -> Patch -> Push -> Pull Request

## License

Apache-2.0

## Copyright

```console
Copyright (c) 2020 ownCloud GmbH <https://owncloud.com>
```

repository: owncloud/ocis-phoenix

gha_language: Go

repo_name: owncloud/ocis-phoenix


text:
# Instructions

The instructions we will be following for building the retro game console can be found here:

[Lifehacker - How to Build a Raspberry Pi Retro Game Console for $35](http://lifehacker.com/how-to-turn-your-raspberry-pi-into-a-retro-game-console-498561192)

RetroPie comes with a couple of games out the box. Beyond this, ROMs can be found via Google (for example, http://www.emuparadise.me/). Many are illegal however and we cannot condone downloading them, however if you wish to do so in your own home that is your decision.

## Transferring ROMs
Transferring ROMs is done via SFTP or a network share. We recommend FileZilla for this.

* [Download FileZilla](https://filezilla-project.org/)
* Turn on your Raspberry Pi and go through any initial controller setup it asks you to do
* Navigate to the RetroPie menu option
* Go to "Show IP Address" and note down the 2nd inet address (It will be something like <IP_ADDRESS>)
* In the FileZilla site manager, use the following settings:
  * The IP address above
  * Protocol = SFTP
  * Logon Type = Normal
  * Username = pi
  * Password = raspberry
* Click "Connect" and accept the warning that comes up about keys
* Once you are connected, browse to the `/home/pi/RetroPie/roms`
* This is where you can upload ROMs. After uploading ROMs, you will need to press "Start" in retropie and select Quit -> Quit Emulation station. This will restart the system and your new ROMs should show up

## Legal sources of ROMS
Not all ROMs are illegal! Here is a list of legal places where you can download some:
* http://www.mamedev.org/roms/
* http://scummvm.org/games/

There are likely to be others if you search for "public domain roms" and other such search terms.

license: Unlicense


text:
# Metric-Server
## Introduction

Metrics Server is a cluster-wide aggregator of resource usage data.

## Note
The original work for this helm chart is present @ [Helm Charts]( https://github.com/helm/charts) Based on the [metrics-server]( https://github.com/helm/charts/tree/master/stable/metrics-server) chart

## Resources Required
The chart deploys pods consuming minimum resources as specified in the resources configuration parameter (default: Memory: 200Mi, CPU: 100m)

## Chart Details
The Chart is used to deploy Metrics Server.

## Prerequisites
- Kubernetes 1.7+
- Tiller 2.7.2 or later

## Installing the Chart
To install the chart
- helm install --name <release-name> stable/ibm-metrics-server
## Configuration

Parameter | Description | Default
--- | --- | ---
`rbac.create` | Enable Role-based authentication | `true`
`serviceAccount.create` | If `true`, create a new service account | `true`
`serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | ``
`apiService.create` | Create the v1beta1.metrics.k8s.io API service | `true`
`image.repository` | Image repository | default ex.`ibmcom/metrics-server-ppc64le`
`image.tag` | Image tag | `v0.2.1`
`image.pullPolicy` | Image pull policy | `IfNotPresent`

## Limitations

## NOTE
This chart has been validated on ppc64le.

gha_language: Smarty


text:
# mmir-plugin-asr-google-xhr

Cordova plugin for the MMIR framework that allows Automatic Speech Recognition (ASR)
via Google web speech recognition services (v2)

supported options for recognize() / startRecord():
 * language: String
 * result: Number

supported custom options for recognize() / startRecord():
 * sampleRate: Number
 * appKey: String

repository: mmig/mmir-plugin-asr-google-xhr

repo_name: mmig/mmir-plugin-asr-google-xhr