text:
### pylogging

A simple python logger which writes logs to disk with some default configs.

### Compatible with:
Python 2.7 and 3.5

### Current stable version:
    0.2.0

### Installation:

#### Install using pip
```
pip install git+https://github.com/ansrivas/pylogging.git --upgrade
```

#### Install by adding to requirements.txt of your project
* Add the following lines to your `requirements.txt` file.
`git+https://github.com/ansrivas/pylogging.git`

* Install all packages in your `requirements.txt` file by running the command:
`$ pip install -r requirements.txt`

#### Install by adding to setup.py of your project
* Add the following to the `install_requires` parameter of your setup function:
`install_requires=['pylogging==0.1.0'],`

* Add the following to the `dependency_links` parameter of your setup function:
`dependency_links=['https://github.com/ansrivas/pylogging/tarball/master#egg=pylogging-0.1.0'],`

* Install your project along with `pylogging` by running the command:
`python setup.py install`

### Usage:

* `setup_logger` sets up the global logger with the provided settings. After calling it once, simply `import logging` and create a logger for that
   module `logger = logging.getLogger(__name__)` and use it at shown below.

```
from pylogging import HandlerType, setup_logger
import logging

logger = logging.getLogger(__name__)

if __name__ == '__main__':
    setup_logger(log_directory='./logs', file_handler_type=HandlerType.ROTATING_FILE_HANDLER, allow_console_logging=True)

    logger.error("Error logs")
    logger.debug("Debug logs")
    logger.info("Info logs")
```

### Important arguments to `setup_logger` function:

```
log_directory (str)            :directory to write log files to. Applicable only when `allow_file_logging` = True
file_handler_type              :object of logging handler from HandlerType class. Applicable only when `allow_file_logging` = True
allow_console_logging (bool)   :Turn off/on the console logging.
allow_file_logging (bool)      :Turn off/on if logs need to go in files as well.
backup_count (int)             :Number of files to backup before rotating the logs.
max_file_size_bytes (int)      :Size of file in bytes before rotating the file. Applicable only to ROTATING_FILE_HANDLER.
when_to_rotate (str)           :Duration after which a file can be rotated. Applicable only to TIME_ROTATING_FILE_HANDLER
                                Accepts following values:
                                'S'	Seconds
                                'M'	Minutes
                                'H'	Hours
                                'D'	Days
                                'W0'-'W6'	Weekday (0=Monday)
                                'midnight'	Roll over at midnight
change_log_level (dict)        :A dictionary of handlers with corresponding log-level ( for eg. {'requests':'warning'} )
gelf_handler                   :An external handler for graylog data publishing.
```

repository: jacostaperu/pylogging

repo_name: jacostaperu/pylogging


text:
---
layout: event
title: "FOSSGIS routing server"
ref: "L032"
name: "Michael Spreng"
authors: "Michael Spreng"
affiliations: ""
organization: ""
category: lightning
day:
lightning_talks_block: 4
extra_tags:
  - "lightning_talk"
  - "lightning_talks_block_4"
room: "De Donato"
sortroom: "1"
length: "5 minutes"
time: "Sunday 15:00"
recording: true
tags:
  - sotmevent
  - slot26
  - lightning_talk
  - lightning_talks_block_4
  - lightning_talk
slides: "/slides/L032-FOSSGIS_routing_server.pdf"
youtube_recording: "YW-MfiwIiBU"
---
Previously, all world wide, OSM based routing services were backed by commercial entities. The FOSSGIS routing server started in late 2017 and aims to provide a community driven routing service based on OSM data.

branch_name: refs/heads/gh-pages

extension: md

gha_language: HTML

license_type: permissive


text:
# _Anagrams_

#### _An anagram website, 7/19/2016_

#### By _**Russ Davies & Steven Tran**_

## Description

This is a simple website that will confirm if the words entered are anagrams.

## Specifications

| Behavior | Input Example | Output Example |
| :--- | :---: | ---: |
| The user will enter two words and the program will inform him/her if the words are anagrams. | ["bread", "beard"] | true |
| The user will enter multiple words and the program will return which two words (or more) are anagrams. | ["bread", "beard", "rock", "pig"] | ["bread", "beard"] |
| The user will enter two words and the program will inform him/her if the words are "partial" anagram. | ["rope", "poorest"] | true |

## Setup/Installation Requirements

* Clone our github repository.
* Install Mono and run Mono Command Prompt.
* Type "dnu restore" and then "dnx kestrel" to start up the server.
* Type "localhost:5004" in a web browser to access the web page.

## Known Bugs

No bugs yet!

## Support and contact details

Please contact the authors if you have any questions or comments.

## Technologies Used

C#, Mono, NancyFX

### License

Copyright (c) 2016 **_Russ & Davies Steven Tran_**

This software is licensed under the MIT license.

license: MIT

repository: daviesre/anagram

branch_name: refs/heads/master

repo_name: daviesre/anagram


text:
# Configuring the Akka HTTP server backend

By default, Play uses the [[Akka HTTP server backend|AkkaHttpServer]].

Like the rest of Play, the Akka HTTP server backend is configured with Typesafe Config.

@[](/confs/play-akka-http-server/reference.conf)

The configurations above are specific to Akka HTTP server backend, but other more generic configurations are also available:

@[](/confs/play-server/reference.conf)

You can read more about the configuration settings in the [Akka HTTP documentation](https://doc.akka.io/docs/akka-http/current/configuration.html?language=scala).

> **Note:** Akka HTTP has a number of [timeouts configurations](https://doc.akka.io/docs/akka-http/current/common/timeouts.html?language=scala#server-timeouts) that you can use to protect your application from attacks or programming mistakes. The Akka HTTP Server in Play will automatically recognize all these Akka configurations. For example, if you have `idle-timeout` and `request-timeout` configurations like below:
>
> ```
> akka.http.server.idle-timeout = 20s
> akka.http.server.request-timeout = 30s
> ```
>
> They will be automatically recognized. Keep in mind that Play configurations listed above will override the Akka ones.

There is also a separate configuration file for the HTTP/2 support in Akka HTTP, if you have enabled the `AkkaHttp2Support` plugin:

@[](/confs/play-akka-http2-support/reference.conf)

> **Note:** In dev mode, when you use the `run` command, your `application.conf` settings will not be picked up by the server. This is because in dev mode the server starts before the application classpath is available. There are several [[other options|ConfigFile#Using-with-the-run-command]] you'll need to use instead.

repository: pettyjamesm/playframework

repo_name: pettyjamesm/playframework


text:
# Working with JSON

Json values are supported through codecs, which encode/decode values to json strings. Most often, you'll be using a
third-party library to perform the actual json parsing/printing. See below for the list of supported libraries.

All the integrations, when imported into scope, define `jsonBody[T]` and `jsonQuery[T]` methods.

Instead of providing the json codec as an implicit value, this method depends on library-specific implicits being in
scope, and basing on these values creates a json codec. The derivation also requires
an implicit `Schema[T]` instance, which can be automatically derived. For more details see sections on
[schema derivation](schemas.md) and on supporting [custom types](customtypes.md) in general. Such a design provides
better error reporting, in case one of the components required to create the json codec is missing.

```eval_rst
.. note::

  Note that the process of deriving schemas, and deriving library-specific json encoders and decoders is entirely
  separate. The first is controlled by tapir, the second - by the json library. Any customisation, e.g. for field
  naming or inheritance strategies, must be done separately for both derivations.
```

## Implicit json codecs

If you have a custom, implicit `Codec[String, T, Json]` instance, you should use the `customCodecJsonBody[T]` method instead.
This description of endpoint input/output, instead of deriving a codec basing on other library-specific implicits, uses
the json codec that is in scope.

## JSON as string

If you'd like to work with JSON bodies in a serialised `String` form, instead of integrating on a higher level using
one of the libraries mentioned below, you should use the `stringJsonBody` input/output. Note that in this case, the
serialising/deserialising of the body must be part of the [server logic](../server/logic.md).

A schema can be provided in this case as well:

```scala
import sttp.tapir._
import sttp.tapir.generic.auto._
case class MyBody(field: Int)
stringJsonBody.schema(implicitly[Schema[MyBody]].as[String])
```

## Circe

To use [Circe](https://github.com/circe/circe), add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonCirce` trait, see [MyTapir](../mytapir.md)):

```scala
import sttp.tapir.json.circe._
```

The above import brings into scope the `jsonBody[T]` body input/output description, which creates a codec, given an
in-scope circe `Encoder`/`Decoder` and a `Schema`. Circe includes a couple of approaches to generating encoders/decoders
(manual, semi-auto and auto), so you may choose whatever suits you.

Note that when using Circe's auto derivation, any encoders/decoders for custom types must be in scope as well.

For example, to automatically generate a JSON codec for a case class:

```scala
import sttp.tapir._
import sttp.tapir.json.circe._
import sttp.tapir.generic.auto._
import io.circe.generic.auto._

case class Book(author: String, title: String, year: Int)

val bookInput: EndpointIO[Book] = jsonBody[Book]
```

### Configuring the circe printer

Circe lets you select an instance of `io.circe.Printer` to configure the way JSON objects are rendered. By default
Tapir uses `Printer.nospaces`, which would render:

```scala
import io.circe._

Json.obj(
  "key1" -> Json.fromString("present"),
  "key2" -> Json.Null
)
```

as

```json
{"key1":"present","key2":null}
```

Suppose we would instead want to omit `null`-values from the object and pretty-print it. You can configure this by
overriding the `jsonPrinter` in `tapir.circe.json.TapirJsonCirce`:

```scala
import sttp.tapir.json.circe._
import io.circe.Printer

object MyTapirJsonCirce extends TapirJsonCirce {
  override def jsonPrinter: Printer = Printer.spaces2.copy(dropNullValues = true)
}

import MyTapirJsonCirce._
```

Now the above JSON object will render as

```json
{"key1":"present"}
```

## µPickle

To use [µPickle](http://www.lihaoyi.com/upickle/) add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-upickle" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonuPickle` trait, see [MyTapir](../mytapir.md) and add `TapirJsonuPickle` not `TapirCirceJson`):

```scala
import sttp.tapir.json.upickle._
```

µPickle requires a `ReadWriter` in scope for each type you want to serialize. In order to provide one use the `macroRW` macro in the companion object as follows:

```scala
import sttp.tapir._
import sttp.tapir.generic.auto._
import upickle.default._
import sttp.tapir.json.upickle._

case class Book(author: String, title: String, year: Int)

object Book {
  implicit val rw: ReadWriter[Book] = macroRW
}

val bookInput: EndpointIO[Book] = jsonBody[Book]
```

Like Circe, µPickle allows you to control the rendered json output. Please see the [Custom Configuration](https://com-lihaoyi.github.io/upickle/#CustomConfiguration) of the manual for details.

For more examples, including making a custom encoder/decoder, see [TapirJsonuPickleTests.scala](https://github.com/softwaremill/tapir/blob/master/json/upickle/src/test/scala/sttp/tapir/json/upickle/TapirJsonuPickleTests.scala)

## Play JSON

To use [Play JSON](https://github.com/playframework/play-json) add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-play" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonPlay` trait, see [MyTapir](../mytapir.md) and add `TapirJsonPlay` not `TapirCirceJson`):

```scala
import sttp.tapir.json.play._
```

Play JSON requires `Reads` and `Writes` implicit values in scope for each type you want to serialize.

## Spray JSON

To use [Spray JSON](https://github.com/spray/spray-json) add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-spray" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonSpray` trait, see [MyTapir](../mytapir.md) and add `TapirJsonSpray` not `TapirCirceJson`):

```scala
import sttp.tapir.json.spray._
```

Spray JSON requires a `JsonFormat` implicit value in scope for each type you want to serialize.

## Tethys JSON

To use [Tethys JSON](https://github.com/tethys-json/tethys) add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-tethys" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonTethys` trait, see [MyTapir](../mytapir.md) and add `TapirJsonTethys` not `TapirCirceJson`):

```scala
import sttp.tapir.json.tethysjson._
```

Tethys JSON requires `JsonReader` and `JsonWriter` implicit values in scope for each type you want to serialize.

## Jsoniter Scala

To use [Jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-jsoniter-scala" % "1.7.3"
```

Next, import the package (or extend the `TapirJsonJsoniter` trait, see [MyTapir](../mytapir.md) and add `TapirJsonJsoniter` not `TapirCirceJson`):

```scala
import sttp.tapir.json.jsoniter._
```

Jsoniter Scala requires `JsonValueCodec` implicit value in scope for each type you want to serialize.

## Json4s

To use [json4s](https://github.com/json4s/json4s) add the following dependencies to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-json4s" % "1.7.3"
```

And one of the implementations:

```scala
"org.json4s" %% "json4s-native" % "4.0.6"
// Or
"org.json4s" %% "json4s-jackson" % "4.0.6"
```

Next, import the package (or extend the `TapirJson4s` trait, see [MyTapir](../mytapir.md) and add `TapirJson4s` instead of `TapirCirceJson`):

```scala
import sttp.tapir.json.json4s._
```

Json4s requires `Serialization` and `Formats` implicit values in scope, for example:

```scala
import org.json4s._
// ...
implicit val serialization: Serialization = org.json4s.jackson.Serialization
implicit val formats: Formats = org.json4s.jackson.Serialization.formats(NoTypeHints)
```

## Zio JSON

To use [zio-json](https://github.com/zio/zio-json), add the following dependency to your project:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-json-zio" % "1.7.3"
```
Next, import the package (or extend the `TapirJsonZio` trait, see [MyTapir](../mytapir.md) and add `TapirJsonZio` instead of `TapirCirceJson`):

```scala
import sttp.tapir.json.zio._
```

Zio JSON requires `JsonEncoder` and `JsonDecoder` implicit values in scope for each type you want to serialize.

## JSON query parameters

You can specify query parameters in JSON format by using the `jsonQuery` method. For example, using Circe:

```scala
import sttp.tapir._
import sttp.tapir.json.circe._
import sttp.tapir.generic.auto._
import io.circe.generic.auto._

case class Book(author: String, title: String, year: Int)

val bookQuery: EndpointInput.Query[Book] = jsonQuery[Book]("book")
```

## Other JSON libraries

To add support for additional JSON libraries, see the
[sources](https://github.com/softwaremill/tapir/blob/master/json/circe/src/main/scala/sttp/tapir/json/circe/TapirJsonCirce.scala)
for the Circe codec (which is just a couple of lines of code).

## Coproducts (enums, sealed traits, classes)

If you are serialising a sealed hierarchy, such as a Scala 3 `enum`, a `sealed trait` or `sealed class`, the configuration
of [schema derivation](schemas.md) will have to match the configuration of your json library. Different json libraries
have different defaults when it comes to a discrimination strategy, so in order to have the schemas (and hence the
documentation) in sync with how the values are serialised, you will have to configure schema derivation as well.

Schemas are referenced at the point of `jsonBody` and `jsonQuery` usage, so any configuration must be available in the implicit scope
when these methods are called.

## Optional json bodies

When the body is specified as an option, e.g. `jsonBody[Option[Book]]`, an empty body will be decoded as `None`.

This is implemented by passing `null` to the json-library-specific decoder, when the schema specifies that the value is
optional, and the body is empty.

## Next

Read on about [working with forms](forms.md).

repository: softwaremill/tapir

gha_language: Scala

repo_name: softwaremill/tapir


text:
# About Us

We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg).

## Project Team

#### [Gabriel Sim](http://github.com/gabrielsim1993)

Role: Developer

Responsibilities: Team Leader, Logic, Deliverables, Git expert

-----

#### [Maggie Li Yundi](http://github.com/maggiemeow)

Role: Developer

Responsibilities: Testing, Model, Code Quality, Integration

-----

#### [Tang Shenqi](http://github.com/tangshenqi)

Role: Developer

Responsibilities: UI, Eclipse expert

-----

#### [Aditya Hendraatmaja](https://github.com/ahendraatmaja)

 Role: Developer

 Responsibilities: Documentation, Data

 -----

# Contributors

We welcome contributions. See [Contact Us](ContactUs.md) page for more info.

* [Akshay Narayan](https://github.com/se-edu/addressbook-level4/pulls?q=is%3Apr+author%3Aokkhoy)
* [Sam Yong](https://github.com/se-edu/addressbook-level4/pulls?q=is%3Apr+author%3Amauris)

repository: MaggieMeow/main

repo_name: MaggieMeow/main


text:
---
title: "deleteObject"
description: ""
layout: "method"
tags:
    - "method"
    - "sldn"
    - "Scale"
classes:
    - "SoftLayer_Scale_Member"
aliases:
    - "/reference/services/softlayer_scale_member/deleteObject"
---
# [SoftLayer_Scale_Member](/reference/services/SoftLayer_Scale_Member)::deleteObject

Delete this group member. This is not the recommended way to delete members. Instead, users should use invocations on the group itself to do scaling.

## Overview

-----

### Parameters
|Name | Type | Description |
| --- | --- | --- |

### Required Headers
* authenticate
* SoftLayer_Scale_MemberInitParameters

### Return Values
* boolean

gha_license_id: NOASSERTION


text:
# IO

An object oriented interface to PHP's streams.

## Classes & Interfaces

### Interface IO\Writeable

 * `write(string $data)`:
   Writes the given string to the stream and returns the number of Bytes
   which got written.

### Interface IO\Readable

 * `read([int $length = null])`:
   If `length` is omitted or Null then it reads everything up to EOF into
   a String.

### Interface IO\Seekable

 * `seek([int $offset = 0, [int $whence = SEEK_SET]])`

### Interface IO\Rewindable

 * `rewind()`

### Interface IO\Flushable

 * `flush()`

### Interface IO\Closable

 * `close()`

### Interface IO\FileDescriptor

 * `toFileDescriptor()`: Must return a stream resource for use in stream
   functions.

### Class IO\Stream

 * Implements IO interfaces with standard PHP Stream functions, like
   `fwrite`, `fread`, `fgets`, `fseek`, `fclose`.
 * Returned by `IO\open`, `IO\pipe`, `IO\Socket\{client,server}`,… functions.
 * Could implement additional utility functions like `gets` (alias for `fgets`), and `puts` (writes data with a separator).
 * `getIterator` should return an iterator which iterates over each
   line of the stream.
 * Should provide a method for getting an iterator which iterates over each byte
   of the stream.

### Class IO\StreamContext

 * Allows to pass options to the given wrappers.
 * Has an `open` method, which acts just like `IO\open` but constructs and passes
   the stream context to `fopen`.
 * Implements the same functions like the core `IO` namespace with the same
   interface, except that they act within the stream context.

Example:

	<?php

	use OOIO\StreamContext;

	$ctx = new StreamContext([
		"http" => [
			"method" => "HEAD"
		]
	]);

	# To get an IO object:
	$stream = $ctx->open("http://google.com");

	# To get the contents only (same like `IO\read()` except it
	# respects the stream context options):
	$body = $ctx->read("http://google.com");

## Functions

These are all namespaced functions which act in the default stream context.
Note that `read` and `write` are both _binary safe_.

### read(string $name, [int $maxLength = -1, [int $offset = -1]])

Acts like `file_get_contents`.

### write(string $name, string $data)

Acts like `file_put_contents`.

Example:

	<?php

	use OOIO\IO;

	IO::write("/tmp/lol.txt", str_repeat(3, "lol "));

### open(string $uri, [string $mode])

Opens a stream, much like `fopen` but returns an `Jack\IO\Stream`.

Example:

	<?php

	use OOIO\IO;

	$stream = IO::open("/tmp/foo.txt", "w+");
	$stream->puts("Foo Bar");

### select()

Returns a selector which must be initialized with streams.

When the stream is set to non-blocking it returns immediately, otherwise
it blocks until at least one file descriptor changed or the timeout
is hit.

Example:

	<?php

	use OOIO\IO;

    $selector = IO::select();
    $selector->register(IO::stdin(), 'r');

    list($r, $w, $e) = $selector->select();

	# The item exists in the response, so there's something there
	# to be read. Let's read it:
	if ($res = @$r[0]) {
		echo "Got: ", $res->read();
	}

### pipe()

Returns a list of two interconnected Unix streams.

What gets written to one side is available for reading on the other.

Example:

	<?php

	use OOIO\IO;

	$msg = "ping";
	list($rp, $wp) = IO::pipe();

    $selector = IO::select()->register($rp, 'r')->register($wp, 'w');

	foreach (range(0, 100) as $_) {
		list($r, $w) = $selector->select();

		if ($r) {
			$ret = $r[0]->gets();

			print($ret.PHP_EOL);

			switch ($ret) {
				case "ping":
					$msg = "pong";
					break;
				default:
				case "pong":
					$msg = "ping";
					break;
			}
		}

		if ($w) {
			$w[0]->puts($msg);
		}
	}

# IO\Socket

## Functions

### server(string $socketName)

Example:

	<?php

	use OOIO\IO,
	    OOIO\IO\Socket;

    $STDERR   = IO::stderr();
	$server   = Socket::server("tcp://<IP_ADDRESS>");
    $selector = IO::select()->register($server, 'r');

	for (;;) {
		list($readable) = $selector->select();

		if ($readable) {
			$peer = $readable[0]->accept(0);

			if (!$peer) continue;

			$msg = $peer->gets();

			if (preg_match("/quit/i", $msg)) {
				$peer->close();
			} else {
				$STDERR->printf("Got: %s\n", [$msg]);

				$peer->puts($msg);
			}
		}
	}

### client(string $socketName)

repository: CHH/ooio

gha_language: PHP

repo_name: CHH/ooio


text:
# Step 2

In this step, we are going to add DynamoDB support to our application. So we have to do the following things:

*  Create an appropiate IAM role to give AWS lambda permissions to operate over DynamoDB.
*  Create a new function that reads contents from DynamoDB.
*  Give more permissions to AWS lambda to let the `get-index` functions invoke the new funtion.
*  Create a few custom variables that will help us define other configurations.
*  Add a few environment variables to our functions.
*  Create the DynamoDB table where we will store the restaurants data.
*  Populate the DynamoDB table with some data.

## IAM role

We have to add an IAM role to give our functions permissions enough to operate over AWS services.

Serverless Framework let you define a global IAM role for every function you define in your service.

So in the provider section of our serverless yaml file we are going to add the following section:

```yaml
iamRoleStatements:
  - Effect: Allow
    Action: dynamodb:scan
    Resource: arn:aws:dynamodb:#{ AWS::Region }:#{ AWS::AccountId }:table/${ self:service }-${ self:provider.stage }-restaurants
  - Effect: Allow
    Action: execute-api:Invoke
    Resource: arn:aws:execute-api:#{ AWS::Region }:#{ AWS::AccountId }:*/*/GET/restaurants
```

Take into account that indentation is critical in yaml files, so ensure you put it in the correct level, just nested in the provider section.

This role allow functions to perform `dynamodb:scan` over an specific DynamoDB table, that we will call `big-mouth-dev-restaurants`. To make it more scalable, we are going to define several things interpolating whenever is possible.

The second sentence, allows functions to invoke a lambda function through its linked API Gateway http event GET to `/restaurants` path.

## DynamoDB

For DynamoDB we need, first of all, create the AWS resource, so we are going to define it.

Serverless Framework operates over AWS Cloudformation service defining Infrastructure As Code in yaml files, so you can add Cloudformation resources to your service.

In this case, we are going to put this definition into a separated file `resources/infraestructure/dynamodb.yml` with the following content:

```yaml
Resources:
  restaurantsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: ${ self:custom.restaurantsTable }
      AttributeDefinitions:
        - AttributeName: name
          AttributeType: S
      KeySchema:
        - AttributeName: name
          KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1
```

Now, we have to let serverless know, where is this additional resource definition located, so we need to add a few extra lines to our serverless yaml file:

```yaml
resources:
  - ${ file( resources/infrastructure/dynamodb.yml ) }
```

This resources section must to be at the root level of the serverless yaml file.

## Get restaurants function

We are going to add a `functions/get-restaurants.js` file that will retrieve restaurants data from DynamoDB with the following code:

```javascript
'use strict';

const co = require( "co" );
const AWS = require( "aws-sdk" )
const dynamodb = new AWS.DynamoDB.DocumentClient()

const defaultResults = process.env.defaultResults || 8;
const tableName = process.env.restaurants_table;

function* getRestaurants( count ) {
    let request = {
        TableName: tableName,
        Limit: count
    };

    let response = yield dynamodb.scan( request ).promise();

    return response.Items;
}

module.exports.handler = co.wrap( function* ( event, context, callback ) {

    let restaurants = yield getRestaurants( defaultResults );

    const response = {
        statusCode: 200,
        body: JSON.stringify( restaurants )
    };

    callback( null, response );
} ) ;
```

We also need to add a new function in the serverless yaml file with a new path in our api inside the functions section of the yaml:

```yaml
get-restaurants:
  handler: functions/get-restaurants.handler
  events:
    - http:
        path: /restaurants/
        method: get
  environment:
    restaurants_table: ${ self:custom.restaurantsTable }
```

As you can see, we also have added an environment variable for the function with the name of the DynamoDB table interpolated in a variable that we will define in the following section.

This `custom.restaurantsTable` variable is the same that we have used in the DynamoDB resource definition in the previous section.

In order to create the table into AWS, you have to make a deployment, so as we have seen before:

```bash
sls deploy --stage dev --aws-profile PROFILE_NAME
```

Now, we are going our DynamoDB table with some data. We are giong to use the following script:

```javascript
'use strict';

const co = require( 'co' );
const AWS = require( 'aws-sdk' );
var credentials = new AWS.SharedIniFileCredentials({profile: 'PROFILE_NAME'});
AWS.config.credentials = credentials;
AWS.config.region = "eu-west-1";
const dynamodb = new AWS.DynamoDB.DocumentClient();

let restaurants = [
  {
    name: "Fangtasia",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/fangtasia.png",
    themes: ["true blood"]
  },
  {
    name: "Shoney's",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/shoney's.png",
    themes: ["cartoon", "rick and morty"]
  },
  {
    name: "Freddy's BBQ Joint",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/freddy's+bbq+joint.png",
    themes: ["netflix", "house of cards"]
  },
  {
    name: "Pizza Planet",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/pizza+planet.png",
    themes: ["netflix", "toy story"]
  },
  {
    name: "Leaky Cauldron",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/leaky+cauldron.png",
    themes: ["movie", "harry potter"]
  },
  {
    name: "Lil' Bits",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/lil+bits.png",
    themes: ["cartoon", "rick and morty"]
  },
  {
    name: "Fancy Eats",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/fancy+eats.png",
    themes: ["cartoon", "rick and morty"]
  },
  {
    name: "Don Cuco",
    image: "https://d2qt42rcwzspd6.cloudfront.net/manning/don%20cuco.png",
    themes: ["cartoon", "rick and morty"]
  },
];

let putReqs = restaurants.map(x => ({
  PutRequest: {
    Item: x
  }
}));

let req = {
  RequestItems: {
    'big-mouth-step-3-restaurants': putReqs
  }
};
dynamodb.batchWrite(req).promise().then(() => console.log("all done"));
```

Save into a file, for example `seed-restaurants.js` change the value of `PROFILE_NAME` with the right value and execute it using the following command:

```bash
node seed-restaurants.js
```

If everything was OK, you will see the **all-done** message.

## Other changes

As we said before, we are going to add several custom variables to use, for example, in the previous step for the restaurants table name:

```yaml
custom:
  serviceStage: ${ self:service }-${ self:provider.stage }
  restaurantsTable: ${ self:custom.serviceStage }-restaurants
  serviceEndpoint: ${ cf:${ self:custom.serviceStage }.ServiceEndpoint }
```

These variables definition must be also at the root level of the serverless yaml file. Take into consideration, that in yaml files _order matters_, so be sure that your definitions are in the right order to let interpolation resolve values the right way.

Pay special attention to `serviceEndpoint` variable interpolation. It uses a function called "cf" that is a CloudFormation interpolation function. This means that this value must be in the output of the CloudFormation referenced stack and the stack must exists in AWS.

Now, we are going to update our get-index function with the following code:

```javascript
'use strict';

const co = require( "co" );
const Promise = require( "bluebird" );
const fs = Promise.promisifyAll( require( "fs" ) );
const Mustache = require( "mustache" );
const http = require( "superagent-promise" )( require( "superagent" ), Promise );
const restaurantsApiRoot = process.env.restaurants_api;
const aws4 = require( "aws4" );
const URL = require( "url" );

const days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ];

var html;

function* loadHtml() {
  if( !html ) {
    html = yield fs.readFileAsync( 'static/index.html', 'utf-8' );
  }
  return html;
}

function* getRestaurants() {

  let url = URL.parse( restaurantsApiRoot );
  let opts = {
    host: url.hostname,
    path: url.pathname
  };

  aws4.sign( opts );

  return ( yield http
    .get( restaurantsApiRoot )
  ).body;
}

module.exports.handler = co.wrap( function* ( event, context, callback ) {

  let template = yield loadHtml();
  let restaurants = yield getRestaurants();
  let dayOfWeek = days[ new Date().getDay() ];
  let view = {
    dayOfWeek,
    restaurants
  }
  let html = Mustache.render( template, view );

  const response = {
    statusCode: 200,
    body: html,
    headers: {
      'Content-type': 'text/html; charset=UTF-8'
    }
  };

  callback( null, response );
} ) ;
```

As you can see, we have added a request to `get-restaurants`, so we also need to add the endpoint as an environment variable to our serverless yaml file inside our get-index function definition, like this:

```yaml
environment:
  restaurants_api: ${ self:custom.serviceEndpoint }/restaurants
```

Dependencies of the function have also change, so be sure to install them before execute the function.

The only thing that remains is an update of our html file:

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Big Mouth</title>

    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
            integrity="sha384-Dziy8F2VlJQLMShA6FHWNul/veM9bCkRUaLqr199K94ntO5QUrLJBEbYegdSkkqX"
            crossorigin="anonymous"></script>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

    <style>
      .fullscreenDiv {
        background-color: #05bafd;
        width: 100%;
        height: auto;
        bottom: 0px;
        top: 0px;
        left: 0;
        position: absolute;
      }
      .restaurantsDiv {
        background-color: #ffffff;
        width: 100%;
        height: auto;
      }
      .dayOfWeek {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 32px;
        padding: 10px;
        height: auto;
        display: flex;
        justify-content: center;
      }
      .column-container {
        padding: 0;
        margin: 0;
        list-style: none;
        display: flex;
        flex-flow: column;
        flex-wrap: wrap;
        justify-content: center;
      }
      .row-container {
        padding: 5px;
        margin: 5px;
        list-style: none;
        display: flex;
        flex-flow: row;
        flex-wrap: wrap;
        justify-content: center;
      }
      .item {
        padding: 5px;
        height: auto;
        margin-top: 10px;
        display: flex;
        flex-flow: row;
        flex-wrap: wrap;
        justify-content: center;
      }
      .restaurant {
        background-color: #00a8f7;
        border-radius: 10px;
        padding: 5px;
        height: auto;
        width: auto;
        margin-left: 40px;
        margin-right: 40px;
        margin-top: 15px;
        margin-bottom: 0px;
        display: flex;
        justify-content: center;
      }
      .restaurant-name {
        font-size: 24px;
        font-family:Arial, Helvetica, sans-serif;
        color: #ffffff;
        padding: 10px;
        margin: 0px;
      }
      .restaurant-image {
        padding-top: 0px;
        margin-top: 0px;
      }
      .row-container-left {
        list-style: none;
        display: flex;
        flex-flow: row;
        justify-content: flex-start;
      }
      .menu-text {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 24px;
        font-weight: bold;
        color: white;
      }
      .text-trail-space {
        margin-right: 10px;
      }
      .hidden {
        display: none;
      }
      label, button, input {
        display:block;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 18px;
      }

      fieldset {
        padding:0;
        border:0;
        margin-top:25px;
      }
    </style>
  </head>

  <body>
    <div class="fullscreenDiv">
      <ul class="column-container">
        <li class="item">
          <img id="logo" src="https://d2qt42rcwzspd6.cloudfront.net/manning/big-mouth.png">
        </li>
        <li class="item">
          <input id="theme" type="text" size="50" placeholder="enter a theme, eg. cartoon"/>
          <button onclick="searchRestaurants()">Find Restaurants</button>
        </li>
        <li>
          <div class="restaurantsDiv column-container">
            <b class="dayOfWeek">{{dayOfWeek}}</b>
            <ul id="restaurantsUl" class="row-container">
              {{#restaurants}}
              <li class="restaurant">
                <ul class="column-container">
                    <li class="item restaurant-name">{{name}}</li>
                    <li class="item restaurant-image">
                      <img src="{{image}}">
                    </li>
                </ul>
              </li>
              {{/restaurants}}
            </ul>
          </div>
        </li>
      </ul>
    </div>

  </body>

</html>
```

Now, you can test both functions locally. In this case, we are going to call DynamoDB service, so we need to add credentials that allow us perform the action:

```bash
sls invoke local -f get-index --stage dev --aws-profile PROFILE_NAME
```

Or

```bash
sls invoke local -f get-restaurants --stage dev --aws-profile PROFILE_NAME
```

You can also use `serverless-offline` to test locally adding the profile argument too:

```bash
sls offline --stage dev --aws-profile PROFILE_NAME
```

---

[<-- Previous step](../step-1/step-1.md) ------------- [Next step -->](../step-3/step-3.md)

[<-- Back to index](../../readme.md#Big-mouth)

gha_language: TypeScript

gha_license_id: MIT


text:
(parallel-overview)=

# Overview and getting started

## Examples

We have various example scripts and notebooks for using ipyparallel in our
{file}`docs/source/examples` directory, as covered in the [examples][] section.

[examples]: ../examples/index.md

## Introduction

This section gives an overview of IPython's
architecture for parallel and distributed computing. This architecture
abstracts out parallelism in a general way, enabling IPython to
support many different styles of parallelism, including:

- Single program, multiple data (SPMD) parallelism
- Multiple program, multiple data (MPMD) parallelism
- Message passing using MPI
- Task farming
- Data parallel
- Combinations of these approaches
- Custom user-defined approaches

Most importantly, IPython enables all types of parallel applications to
be developed, executed, debugged, and monitored _interactively_. Hence,
the `I` in IPython. The following are some example use cases for IPython:

- Quickly parallelize algorithms that are embarrassingly parallel
  using a number of simple approaches. Many simple things can be
  parallelized interactively in one or two lines of code.
- Steer traditional MPI applications on a supercomputer from an
  IPython session on your laptop.
- Analyze and visualize large datasets (that could be remote and/or
  distributed) interactively using IPython and tools like
  matplotlib.
- Develop, test and debug new parallel algorithms
  (that may use MPI) interactively.
- Tie together multiple MPI jobs running on different systems into
  one giant distributed and parallel system.
- Start a parallel job on your cluster and then have a remote
  collaborator connect to it and pull back data into their
  local IPython session for plotting and analysis.
- Run a set of tasks on a set of CPUs using dynamic load balancing.

```{tip}
At the SciPy 2014 conference in Austin, Min Ragan-Kelley presented a
complete 4-hour tutorial on the use of these features, and all the materials
for the tutorial are now [available online](https://github.com/minrk/IPython-parallel-tutorial/blob/HEAD/Index.ipynb). That tutorial provides an
excellent, hands-on oriented complement to the reference documentation
presented here.
```

## Architecture overview

```{figure} figs/wideView.png
:width: 300px
```

The IPython architecture consists of four components:

- The IPython engine
- The IPython hub
- The IPython schedulers
- The IPython client

These components live in the {mod}`ipyparallel` package,
which can be installed with {command}`pip` or {command}`conda`.

% TODO: include zmq in install_index

### IPython engine

The IPython engine is an extension of the IPython kernel for Jupyter.
The engine listens for requests over the network, runs code, and returns results.
IPython parallel extends the {ref}`Jupyter messaging protocol <jupyterclient:messaging>`
to support native Python object serialization and add some additional commands.
When multiple engines are started, parallel and distributed computing becomes possible.

### IPython controller

The IPython controller processes provide an interface for working with a set of engines.
At a general level, the controller is a collection of processes to which IPython engines
and clients can connect. The controller is composed of a {class}`Hub` and a collection of
{class}`Schedulers`. These Schedulers are typically run in separate processes on the
same machine as the Hub.

The controller also provides a single point of contact for users who wish to
access the engines connected to the controller. There are different ways of
working with a controller. In IPython, all of these models are implemented via
the {meth}`.View.apply` method, after
constructing {class}`.View` objects to represent subsets of engines. The two
primary models for interacting with engines are:

- A **Direct** interface, where engines are addressed explicitly
- A **LoadBalanced** interface, where the Scheduler is entrusted with assigning work to
  appropriate engines

Advanced users can readily extend the View models to enable other
styles of parallelism.

```{note}
A single controller and set of engines can be used with multiple models
simultaneously. This opens the door for lots of interesting things.
```

#### The Hub

The center of an IPython cluster is the Hub. This is the process that keeps
track of engine connections, schedulers, clients, as well as all task requests and
results. The primary role of the Hub is to facilitate queries of the cluster state, and
minimize the necessary information required to establish the many connections involved in
connecting new clients and engines.

#### Schedulers

All actions that can be performed on the engine go through a Scheduler. While the engines
themselves block when user code is run, the schedulers hide that from the user to provide
a fully asynchronous interface to a set of engines.

### IPython client and views

There is one primary object, the {class}`~.parallel.Client`, for connecting to a cluster.
For each execution model, there is a corresponding {class}`~.parallel.View`. These views
allow users to interact with a set of engines through the interface. Here are the two default
views:

- The {class}`DirectView` class for explicit addressing.
- The {class}`LoadBalancedView` class for destination-agnostic scheduling.

## Getting Started

To use IPython for parallel computing, you need to start one instance of the
controller and one or more instances of the engine. Initially, it is best to
start a controller and engines on a single host.
To start a controller and 4 engines on your local machine:

```ipython
In [1]: import ipyparallel as ipp
In [2]: cluster = ipp.Cluster(n=4)
In [3]: await cluster.start_cluster() # or cluster.start_cluster_sync() without await
```

```{note}
Most Cluster methods are async,
and all async cluster methods have a blocking version with a `_sync` suffix,
e.g. `await cluster.start_cluster()` and `cluster.start_cluster_sync()`
```

You can also launch clusters at the command-line with:

```
$ ipcluster start -n 4
```

which is equivalent to `ipp.Cluster(n=4, cluster_id="").start_cluster()`

and connect to the already-running cluster with {meth}`.Cluster.from_file`

```python
cluster = ipp.Cluster.from_file()
```

For a convenient one-liner to start a cluster and connect a client,
use {meth}`~.Cluster.start_and_connect_sync`:

```ipython
In [1]: import ipyparallel as ipp
In [2]: rc = ipp.Cluster(n=4).start_and_connect_sync()
```

More details about starting the IPython controller and engines can be found
{ref}`here <parallel-process>`.

Once you have a handle on a cluster,
you can connect a client.
To make sure everything is working correctly,
try the following commands:

```ipython
In [2]: rc = cluster.connect_client_sync()

In [3]: rc.wait_for_engines(n=4)

In [4]: rc.ids
Out[4]: [0, 1, 2, 3]

In [5]: rc[:].apply_sync(lambda: "Hello, World")
Out[5]: [ 'Hello, World', 'Hello, World', 'Hello, World', 'Hello, World' ]
```

When a client is created with no arguments, the client tries to find the corresponding JSON file
in the local `~/.ipython/profile_default/security` directory. Or if you specified a profile,
you can use that with the Client. This should cover most cases:

```ipython
In [2]: cluster = ipp.Cluster.from_file(profile="myprofile", cluster_id="...")
In [3]: rc = cluster.connect_client_sync()
```

If you have put the JSON file in a different location or it has a different name, create the
Cluster object like this:

```ipython
In [2]: cluster = ipp.Cluster.from_file('/path/to/my/cluster-.json')
```

Remember, a client needs to be able to see the Hub's ports to connect. So if the controller and client are on
different machines,
you may need to use an ssh server to tunnel access to that machine,
in which case you would connect with:

```ipython
In [2]: c = ipp.Client('/path/to/my/ipcontroller-client.json'<EMAIL_ADDRESS>```

Where 'myhub.example.com' is the url or hostname of the machine on
which the Hub process is running (or another machine that has direct access to the Hub's ports).

The SSH server may already be specified in ipcontroller-client.json, if the controller was
instructed at its launch time.

### Cluster as context manager

The {class}`~.ipyparallel.Cluster` and {class}`~.ipyparallel.Client` classes can be used as context managers
for easier cleanup of resources.

- Entering a `Cluster` context

  1. starts the cluster
  2. waits for engines to be ready
  3. connects a client
  4. returns the client

- Exiting a `Client` context closes the client's socket connections to the cluster.
- Exiting a `Cluster` context shuts down all of the cluster's resources.

If you know you won't need your cluster anymore after you use it,
use of these context managers is encouraged.
For example:

```python
import ipyparallel as ipp
# start cluster, connect client
with ipp.Cluster(n=4) as rc:
    e_all = rc[:]
    ar = e_all.apply_sync(task)
    ar.wait_interactive()
    results = ar.get()
# have results, cluster is shutdown
```

You are now ready to learn more about the {ref}`Direct <parallel-direct>` and {ref}`LoadBalanced <parallel-task>` interfaces to the
controller.

[zeromq]: https://zeromq.org/

repository: ipython/ipyparallel

branch_name: refs/heads/main

gha_language: Jupyter Notebook

repo_name: ipython/ipyparallel


text:
# Python helper class: CloudSqlAdmin

Using the client libraries is definitely simpler than directly calling the REST APIs, but as we saw in the [client library examples](admin-api.md), there are still some complexities you need to manage. These range from creating a request body to dealing with pagination, authentication, and other details.

To minimize context switching and distractions, you may find it useful to put together helper functions or classes that abstract away all of those details, so that you can stay hyper-focused on your business logic. I've created a small proof of concept of such a helper class, covered below.

## The CloudSqlAdmin helper class

The [gcsql_admin.py](gcsql_admin.py) file in this repo contains a ```CloudSqlAdmin``` class, which is a container for entity-specific classes that wrap the functionality of the top-level instance methods of the [Cloud SQK Admin API](https://developers.google.com/resources/api-libraries/documentation/sqladmin/v1beta4/python/latest/). Here's a high-level architectural diagram:

![CloudSqlAdmin architecture](images/CloudSqlAdmin.png)

I've only implemented three of the entity-specific classes so far (Instances, Databases, and Users), including methods that simplify the [client library examples](admin-api.md) we looked at earlier.

The basic concept is that you instantiate ```CloudSqlAdmin``` and then call an entity-specific method. For example, here's how you'd create a new user in a Cloud SQL instance:

```python
sql_admin = CloudSqlAdmin()
if sql_admin.users.insert(project, instance, host, username, password):
    print(f"User created: {username}")
else:
    print(f"ERROR inserting user: {sql_admin.response}")
```

There's less code than in the client library example, because the wrapper class has handled creating the request body and other details.

Here's another example, showing how to get all of the instances in a project without any need to deal with the details of pagination:

```python
sql_admin = CloudSqlAdmin()
for instance in sql_admin.instances.list(project):
    print(f"Instance: {instance['name']}")
```

You can find examples of working with ```CloudSqlAdmin``` in the [samples.py](samples.py) file in this repo. For convenience, those sample use settings from [config.py](config.py) for MY_PROJECT and MY_INSTANCE, so you'll need to set those to your own project and instance names to run the samples.

If you'd like to call Cloud SQL Admin APIs that _haven't_ been implemented in the entity-specific classes in CloudSqlAdmin, you can use the ```CloudSqlAdmin.service``` member. The ```tier_list``` function in samples.py provides an example of how to do this:

```python
sql_admin = CloudSqlAdmin()
request = sql_admin.service.tiers().list(project=project)
response: dict = request.execute()
print(response)
```

```CloudSqlAdmin``` is just one of many approaches you could take for simplifying use of the Cloud SQL admin APIs. For example, if you prefer a functional approach you might want to simply create a service resource object (as done in the ```service_client()``` function in [gcsql_admin.py](gcsql_admin.py)) and then create helper functions that take this object as an argument in the spirit of dependency injection. Do whatever feels right for you.

A few final things to note about ```CloudSqlAdmin```:

* Since this is intended as a simple educational sample, it doesn't include error handling and other details you'd want to add for production use.
* I've included Python 3 type annotations to clarify some things. These are ignored by the Python interpreter, and you can ignore them as well if you're not accustomed to Python's type annotations.
* For authentication, there's an ```APP_CREDENTIALS``` setting in [config.py](config.py) that stores the name of a local app registration JSON file, and those credentials will be used if the environment variable isn't set. This essentially automates [setting the environment variable](https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable), so that you don't need to do that each place where you want to run your code.

repository: dmahugh/gcsql-admin

repo_name: dmahugh/gcsql-admin


text:
# Split XLS, Retain Addresses
Splits an xls file with addresses for geocoding in Google MyMaps.

## Features

* Splits xls into 2000 rows by default ([MyMaps limit](https://support.google.com/mymaps/answer/3024836?co=GENIE.Platform%3DDesktop&hl=en))
* Retains mappable street addresses
* Removes any "PO Box" cells but retains City, State
* Removes lines that don't contain a valid address

## Installation

1. Install `openpyxl`
    ```bash
    pip3 install openpyxl
    ```

2. Set execute permissions for script
    ```bash
    chmod +x xls-addresses-split
    ```

3. Edit the script and specify the required header names that match your xls file
    ```bash
    xls_req_headers = [["Street",False,-1],["City",False,-1],["State",False,-1]]
    ```

## Usage

1. Split target xls into new files
    ```bash
    ./xls-addresses-split "file.xls"
    ```

2. You can optionally specify the number of rows
    ```bash
    ./xls-addresses-split "file.xls" 500
    ```

repository: sirken/xls-split-addresses-mymaps

repo_name: sirken/xls-split-addresses-mymaps


text:
# Vsphere Example Files
## Contents
* *.yaml files - concrete example files that can be used as is.
* *.yaml.template files - template example files that need values filled in before use.

## Generation
For convenience, a generation script which populates templates where possible.

1. Run the generation script. This wil produce ```provider-components.yaml```
```
./generate-yaml.sh
```
2. To define the master machine, copy `machines.yaml.template` to `machines.yaml` and
manually edit `machineVariables`.

3. To define nodes, copy `machineset.yaml.template` to `machineset.yaml` and
manually edit `machineVariables`. If needed, adjust `replicas` as well.

4. Copy `cluster.yaml.template` to `cluster.yaml` and
manually edit `providerConfig`.

5. *Optional*: Copy `addons.yaml.template` to `addons.yaml` and
+manually edit `parameters`.

## Manual Modification
You may always manually curate files based on the examples provided.

repository: dixudx/cluster-api

repo_name: dixudx/cluster-api


text:
# Running TFS on windows
Rubn a windows 10 box with TFS installed

# [LAB-01](../../tree/LAB-01) - Set Windows 10 Virtualbox
## Setup Docker
* Install Virtualbox
* Install Vagrant
* Have a look at the Vagrant file
    * This should run a windows 10 box
    * The provisioner will install TFS etc
* Run vagrant
```
vagrant up
```
* RDP to windows box
```

```

---
Free to use under [MIT Licence](./LICENCE)

Copyright (c) Mike Scott 2020

repository: MikeAScott/win-tfs

repo_name: MikeAScott/win-tfs


text:
# Cache JSON two way biding between regular and dynamic objects
==========================

This project has been developed for one of partners during a workshop where they needed to bind 'regular' Cache objects (registered, persistent classes)
to dynamic object in order to exchange data effectively by means of REST API. The adapter allows to bridge the existing gap in Cache JSON implementation.
With the adapter, is is easy to extend regular Cache classes by adding the adapter class into the base classes list.

How to use:
add the kutac.JSON.Adapter into the base class list

in your code, when you need to expose regular class as a dynamic one, call instance method %Expose() like this:
set x=##class(myregularclass).%New() / or %OpenId(id).%Expose()
now you have a dynamic object so you can call directly .%ToJSON() to show serialized data

when you need to bind incoming JSON string/stream, just do following:
set x=##class(myregularclass).%Bind({}.%FromJSON(jsonstring),.sc)

this is a relatively simple intrface, tested on a limited set of classes, but shall support literal attributes as well as reference attributes and collections as well as relatinships.

Further, when binding to a persistent class, the adapter is using definition of an IdKey index (defautl or custom) to identify existing instance of a persistent class so it not only creates new instacne but mofifies existing instance when appropriate.

for more information, please see this [article](https://community.intersystems.com/post/binding-regular-cache-object-dynamicobject-and-vice-versa).

Dan Kutac


text:
Now that you have the images and templates for deploying a Jupyter Notebook loaded, you can create the Jupyter Notebook workspace by running the command:

```execute
read -p "Enter Password: " NOTEBOOK_PASSWORD && oc new-app --template notebook-workspace --param APPLICATION_NAME=workspace --param NOTEBOOK_PASSWORD=$NOTEBOOK_PASSWORD
```

This command will prompt you for a password to secure access to the Jupyter Notebook workspace. Enter the password you would like to use.

Once the template has been processed and the deployment created, you should see output similar to:

```
--> Deploying template "workshop/notebook-workspace" to project workshop

     Jupyter Notebook Workspace
     ---------
     Template for deploying Jupyter Notebook images with persistent storage and webdav filesystem access.

     * With parameters:
        * APPLICATION_NAME=workspace
        * NOTEBOOK_IMAGE=s2i-minimal-notebook:3.6
        * NOTEBOOK_PASSWORD=grumpy
        * NOTEBOOK_MEMORY=512Mi
        * VOLUME_SIZE=1Gi

--> Creating resources ...
    deploymentconfig.apps.openshift.io "workspace" created
    persistentvolumeclaim "workspace-data" created
    service "workspace" created
    route.route.openshift.io "workspace" created
    route.route.openshift.io "workspace-webdav" created
--> Success
    Access your application via route 'workspace-workshop.apps.grumpy-xyz.openshiftworkshop.com'
    Access your application via route 'workspace-webdav-workshop.apps.grumpy-xyz.openshiftworkshop.com'
    Run 'oc status' to view your app.
```

The template creates a set of resources for the deployment. These include a persistent volume for storing data for your Jupyter Notebook workspace, and a route, which exposes the Jupyter Notebook workspace via a URL so you can access it. When you connect to the Jupyter Notebook workspace, a secure connection will be used and you will need to login using the password you supplied.

For this workspace, the name `workspace` was passed to the `APPLICATION_NAME` template parameter. If you do not supply this template parameter, it will default to using the name `custom-notebook`. This name is used in the resources created, and the URL you use to access the Jupyter Notebook workspace.

If you were to create multiple Jupyter Notebook workspaces in the one project, you should give them unique names using the `APPLICATION_NAME` template parameter.

To monitor progress of the deployment, run the command:

```execute
oc rollout status deploymentconfig workspace
```

The initial deployment when using the `notebook-workspace` template can take some time. This is because the persistent volume will need to be populated, by copying the contents of the workspace from the image to the persistent volume. Depending on the class of persistent storage used by the cluster, how long this will take can vary. A subsequent restart of the Jupyter Notebook instance will be quicker, as the copying of contents only needs to be done once.

Once the deployment has completed, the `oc rollout status` command will exit, and the Jupyter Notebook workspace will be ready to use.


text:
---
id: faastjs.functionstats.remotestartlatency
title: FunctionStats.remoteStartLatency property
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[faastjs](./faastjs.md) > [FunctionStats](./faastjs.functionstats.md) > [remoteStartLatency](./faastjs.functionstats.remotestartlatency.md)

## FunctionStats.remoteStartLatency property

Statistics for how long requests take to start execution after being sent to the cloud provider. This typically includes remote queueing and cold start times. Because this measurement requires comparing timestamps from different machines, it is subject to clock skew and other effects, and should not be considered highly accurate. It can be useful for detecting excessively high latency problems. Faast.js attempt to correct for clock skew heuristically.

**Signature:**

```typescript
remoteStartLatency: Statistics;
```


text:
eriner
======

A fork of the Powerline-inspired [agnoster] theme.

The aim of this theme is to only show you *relevant* information. Like most
prompts, it will only show git information when in a git working directory.
However, it goes a step further: everything from the current user and hostname
to whether the last call exited with an error to whether background jobs are
running in this shell will all be displayed automatically when appropriate.

<img width="706"<EMAIL_ADDRESS>
What does it show?
------------------

  * Status segment:
    * `✘` when there was an error.
    * `⚡` when you're root.
    * `⚙` when there are background jobs.
    * `r` when you're in a [ranger] spawned shell.
    * Python [venv] indicator.
    * `username@hostname` when in a ssh session.
  * Working directory segment.
  * Git segment (background color varies if working tree is clean or dirty):
    * Current branch name, or commit short hash when in ['detached HEAD' state].
    * `±` when in a dirty working tree.

Settings
--------

The background color for each segment can be customized with an environment
variable. If the variable is not defined, the respective default value is used.

| Variable     | Description                          | Default value |
| ------------ | ------------------------------------ | ------------- |
| STATUS_COLOR | Status segment color                 | black         |
| PWD_COLOR    | Working directory segment color      | cyan          |
| CLEAN_COLOR  | Clean git working tree segment color | green         |
| DIRTY_COLOR  | Dirty git working tree segment color | yellow        |

Advanced settings
-----------------

You can customize how the current working directory is shown with the
[prompt-pwd module settings].

The git indicators can be customized by changing the following git-info module
context formats:

| Context name | Description         | Default format |
| ------------ | ------------------- | -------------- |
| branch       | Branch name         | ` %b`         |
| commit       | Commit short hash   | `➦ %c`         |
| action       | Special action name | ` (%s)`        |
| dirty        | Dirty state         | ` ±`           |

Use the following command to override a git-info context format:

    zstyle ':zim:git-info:<context_name>' format '<new_format>'

For detailed information about these and other git-info settings, check the
[git-info documentation].

These advanced settings must be overridden after the theme is initialized.

Requirements
------------

In order for this theme to render correctly, a font with Powerline symbols is
required. A simple way to install a font with Powerline symbols is to follow the
[instructions here].

Requires Zim's [prompt-pwd] module to show the current working directory, and
[git-info] to show git information.

[agnoster]: https://github.com/agnoster/agnoster-zsh-theme
[ranger]: https://github.com/ranger/ranger
[venv]: https://docs.python.org/3/library/venv.html
['detached HEAD' state]: https://git-scm.com/docs/git-checkout#_detached_head
[prompt-pwd module settings]: https://github.com/zimfw/prompt-pwd/blob/master/README.md#settings
[git-info documentation]: https://github.com/zimfw/git-info/blob/master/README.md#settings
[instructions here]: https://github.com/powerline/fonts/blob/master/README.rst#installation
[prompt-pwd]: https://github.com/zimfw/prompt-pwd
[git-info]: https://github.com/zimfw/git-info

repository: zimfw/eriner

repo_name: zimfw/eriner


text:
# Classifier

Inspired by [Denis Bazhenov](http://bazhenov.me/)

	* http://bazhenov.me/blog/2012/06/11/naive-bayes.html
	* http://bazhenov.me/blog/2013/04/23/maximum-entropy-classifier.html

[Naive Bayes classifier](http://en.wikipedia.org/wiki/Naive_Bayes_classifier) and [Principle of maximum entropy classifier](http://en.wikipedia.org/wiki/Principle_of_maximum_entropy) implementations on Ruby.

## Usage

```ruby
require 'classifier'

@bayes = Classifier::Bayes.new(["SPAM", "HAM"])

spam = @bayes.cls("SPAM")
ham = @bayes.cls("HAM")

spam.teach("Buy viagra free without a reciepe")
spam.teach("Enlarge your mojo twice for free")
spam.teach("Total sale! Last autumn collection!")
spam.teach("Mojo and Evil for free!")

ham.teach("Hi Peter! Let's go to sale in the moll?")
ham.teach("Buy some lemonade for party!")
ham.teach("It's a party time!")
ham.teach("Waiting in the moll")

res = @bayes.classify("Buy some viagra please!")
p res
#=> [["SPAM", 0.8], ["HAM", 0.19999999999999998]]

res = @bayes.classify("It is party in the mall")
p res
#=> [["HAM", 0.9818181818181818], ["SPAM", 0.018181818181818146]]

res = @bayes.classify("New tokens presented")
p res
#=> [["SPAM", 0.5], ["HAM", 0.5]]
```

## Contributing

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


text:
---
layout: index
title: grid_fill
---

"grid\_fill" is a [string](../types/string.html) attribute. It specifies the HTML colour name to use for the fill colour for this room on the map.

repository: textadventures/quest

gha_language: C#

repo_name: textadventures/quest


text:
---
title:  "local module development for Magento2 with composer"
date:   2016-12-13 00:00:00
categories: Magento2
---

# Preface

One thing I like about Magento2 is, that it is completly based on [composer](https://getcomposer.org/). It means you are able to separate development of Magento2 modules from the actual store you are testing it on. This is especially useful, if you are having multiple modules installed in multiple stores.

# The problem

Suppose I have a module, I want to use in my current store. To install it with composer I would add it to my `composer.json` like this:

    {
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/bka/magento2-delete-orders.git"
            }
        ],
        "require": {
            "bka/delete-orders": "~1.0.0"
        }
    }

After running `composer install`, a copy of the module is placed in `vendor/bka/delete-orders`. Now, the problem is you cannot really make changes to this module without breaking a sweat. The module inside `vendor` is just a copy and not git repo. One working way would be:

* make changes to your original repository
* commit and push
* run composer update inside your project
* test your change

Not a satisfying workflow.

# The solution

The golden trick in this case is to specify a local repo with type path like this:

    {
      "repositories": [
          {
              "type": "path",
              "url": "/home/bernd/work/magento2-modules/*"
          }
      ]
    }

Now, when running `composer install` the content is symlinked.

    composer install
     Loading composer repositories with package information
     Installing dependencies (including require-dev)
       - Installing bka/delete-orders (1.0.0)
           Symlinked from /home/bernd/work/magento2-modules/magento2-delete-orders/
    Writing lock file
    Generating autoload files

## Global configuration

An even better approach is, to define the path to your shared modules globally for all projects inside a `~/.composer/conig.json` like this:

    {
        "repositories": [
            {
                "type": "path",
                "url": "/home/bernd/work/magento2-modules/*"
            }
        ],
        "config": {
            "minimum-stability": "dev",
            "prefer-stable": true
        }
    }

This cool thing about this is, that this config only applies on your local system. When deploying, the pushed version in the regular repo will be used.


text:
---
layout: post
title: "Malware, Cyber Attacks and the problem of patching"
date: 2017-05-13 09:06:57 +0100
comments: true
categories:
 - security
 - business
 - featured
featured:
  preview: /images/uploads/network_rack-300x199.jpg
  large: /images/uploads/network_rack.jpg
  caption: Network Rack by Kev
  url: https://flic.kr/p/pt18wC
---

According to news reports, the UK, among over 90 other countries has just been hit by a large malware campaign which has taken down various services, including a number of health based services.

It's easy at this point to look at the details and just exclaim that the organisations affected should just patch more frequently, but the reality is much much harder than that.
<!-- more -->

## The details of the infections

As I know it at the time (9am on Saturday 13th of May), the infection is a ransomware piece of malware called WCry, a variant of Wana Decryptor.  You can find a technical breakdown at [Talos Intelligence](http://blog.talosintelligence.com/2017/05/wannacry.html)

For those of you who don't know what that means, it's a bit of code, that somebody wrote, that when run on your machine, goes and finds a number of files on your system and encrypts them using strong cryptography, and then shows a message demanding payment in the pseudonymous currency "bitcoin" to decrypt your files and put them back.

The malware gets onto the first machine through a "phishing" campaign, so essentially an email that looks legitimate, and needs you to open a document included in the email.  Once you open the attachment, the malware runs and your machine is infected.

Furthermore, the malware runs some additional code while it is encrypting your files.  It goes and looks on your network for any computer which is talking something called SMB, the fileshare protocol.  So all of your coworkers who share their files with you, and those central servers that have the office fileshare.

If it finds a machine that is sharing files, it then uses a bug in windows, called [MS17-010](https://technet.microsoft.com/en-us/library/security/ms17-010#Vulnerability%20Information) (after the Microsoft security bulletin that announced it).  It's also being called EternalBlue after the codename in a dump of exploits allegedly from the NSA which revealed the bug.

This bug means that even if your computer is "secured", the malware can copy itself onto the other computer and then run itself on there, spreading, a bit like a virus does around a school or workplace.

Furthermore, the WCry uses a "backdoor" called DoublePulsar, again from the alleged NSA dump, which enables it to move from just executing code on the machine to complete control of the machine.  This combination of using multiple bugs is called a "chain" and until the last few years has only generally been in the most advanced possible hacking groups.

## The killswitch

The author, presumably in order to test it, built in a killswitch to the malware.  So when it first infects a machine, it attempts to access a domain on the internet which doesn't exist.

A UK based security researcher called MalwareTech registered the domain having discovered this bit of code and this [appears to have stopped new infections](https://twitter.com/MalwareTechBlog/status/863097345885470720).

This means the risk of new infections is much lower, but it wouldn't take much for any hacker to take a sample of the malware, modify it to use a different domain and re-release it.

## What's the impact?

Once it has gotten onto a single computer in an organisation, it is attempting to spread, so it will move around the computer network, using the bug above to spread.  That means that except in cases of blind luck, or where other measures have been taken, the ransomware will spread to a central computer pretty fast and from there out to every desktop it can find.

Furthermore, in todays world, it's not just desktops that get affected.  Lots of computers run Windows, so for example I've seen pictures of [bus display terminals](https://twitter.com/Avas_Marco/status/863107445559889921) in a bus terminal that are affected.  I'm sure that in the coming days we'll see some other systems like Point of Sale (like tills), window displays in shops and things like that affected.

Once infected, things are pretty rough.  Security researchers are looking into the malware now, and if they are lucky, the author will have made an error in writing or using the cryptographic routines that mean that they'll be able to build a tool to provide the decryption key.  This has happened before with some other major ransomware infections, but it depends on how well the author wrote their encryption routines.

The best solution here is to format the infected computer and reinstall Windows and restore the data from backups.  If organisations are using cloud based productivity applicatons such as Office 365 or the Google GSuit, then no data should be lost.

If people are saving local data to their machine, then hopefully the organisation has a good backup strategy and can restore from a backup.

## Could this have been prevented?

Yes and no.

People keep saying that if you had patched the MS17-010 30 days ago, when it was released (March 14th), then people wouldn't have been affected.  That's only true for the second stage, the spreading of the malware.  People who got infected by email would still have been infected.

But if you had patched your computer, then the malware wouldn't spread to you, and that's part of the virality of the malware.  It spreads without needing user input after the initial infection.

It's also possible that the original infection in some systems is caused by an infection via the MS17-010 exploit.  It could be that some organisations expose their file shares publicly, because there are security protections such as username and password authentication, you might find that this is a way into an organisation.

It's also worth noting that pretty much all versions of Windows were affected by this bug, so it's not just out of date Windows XP machines, which didn't receive the patch, it was a bug in Windows 8, Windows 10, Windows Server 2016 as well.  It was patched by Microsoft in those versions, but again, only 30 odd days ago.

It's also the case that if you had a good UTM firewalls, and they were up to date, then the malware might never have been able to call out to get the executable code.  However that would have been dependant on having the right signatures or rules in place.

Equally blocking the original phishing emails would have prevented the original infection.

However, given the extent of the SMB vulnerability, it only takes one machine to get infected and if it moved inside your network boundary, it was game over.

## Patching is easy right?  Download it and apply it?

For home computers, patching is pretty easy, and yet most users don't do it.  It's the equivalent of hitting the appstore update all button on a regular basis, and I know people who don't even do that!

The reality of a large enterprise is that the IT systems are hugely complicated.

A real, and medium sized organisation might have systems dating back to the early 90's and banks and health organisations even older systems, all alongside the modern new windows 10 boxes.

The individual desktop of a receptionist in the organisation might need not only to do the specific functions it needs but to also run custom software that was written for windows 95, or terminal applications to enable it to talk to the back office tools and systems

Within any given enterprise it system you might be looking at tens of thousands of desktops, running hundreds of different configurations of applications.
Rolling out a Microsoft patch to windows across that set of systems might not be easy because it's really hard to test all those configurations.

And if you are say a national newspaper and the patch means that the only machine confit that doesn't work is the specific one that does overnight layout operations, then you have to decide whether patching the machine is worth running the risk of it not working and the newspaper not getting out.

Moving to another OS doesn't help you. The large dumps recently have shown that there are vulnerabilities in all operating systems.

Enterprise IT is a much harder problem to solve than my area, in digital systems. We should be able to patch our systems easily and fast because we have much smaller estate sprawls and configurations compared to most desktop estates.

If you want to terrify yourself, add in that many organisations now outsource various systems. So your IT helpdesk might be being run by an outsourced helpdesk provider instead.
However, people don't generally like phoning an outsourced call center, so organisations bring in the outsourced service provider into the building. They have some desktops, which you probably don't control, but probably connect to your network. S if you get infected and it spreads to them as a managed service provider, that means that they might become an inter-organisational infection vector to their other customers.

Now add in post rooms, help desks, room booking systems, HVAC systems and more and you begin to get the idea of what a corporate network looks like. It's terrifying.

## Patch early, patch often

Enterprise systems (including the ones we've seen attacked already and we'll see more, this isn't health service specific) have an average patch time in the hundreds of days, an average of 120 days according to [Infosec Magazine](https://www.infosecurity-magazine.com/news/companies-average-120-days-patch/).

This patch was released around 30 days.

Sadly patch faster is not compatible with the way IT is done is lots of big organisations, and the challenge for us security and technology people is to make it easier to patch faster.

The goal has to be to be able to patch within hours, but that's multiple orders of magnitude hard for a vast and colossal set of organisations.

## So how could we fix this?

We need to rethink the way that we do computing and IT.  Virtual desktops in the cloud might provide organisations with a [Blue/Green](https://martinfowler.com/bliki/BlueGreenDeployment.html) deployment strategy for enterprise IT, enabling firms to roll out patched operating systems and roll back easily if there is a problem.

We need to see segmented networks with unidirectional firewalls.  While there might need to be a centrally accessible fileshare, there's absolutely no reason for that server to reach out to desktops on the same protocol.

Things like [Google's BeyondCorp](https://research.google.com/pubs/pub43231.html) is a good example of starting to build systems where the network doesn't just trust every other computer on the network, but that we can start being more intelligent about what devices can access which services.

We need to ensure that email is scanned more effectively and that users aren't shown phishing emails wherever possible.  Things like DMARC can help weed out emails that are illegitimate.

We need to change the story, not just do it better.  Doing patching better might get us from 120 days to 60 days or even 30 days, but it can't create an order of magnitude change.  To do that we need new practices for a new generation of IT and computing.

## Don't click that link

It's also easy for someone to say that if only users didn't click the original phishing link, then this wouldn't have happened.

Blaming the user for security problems that they are ill-equipped to deal with is in vogue at the moment.

But as you can see from my Colleague Terence Eden's excellent ["Would you fall for this phishing scam"](https://shkspr.mobi/blog/2016/12/would-you-fall-for-this-phishing-scam/), modern phishing emails look shockingly convincing.

User training and teaching users to not click links is really hard when most of their jobs involves receiving emails and clicking links and typing their password into Google every few days because security required they get logged out.

Some of the best newest thinking on this area is coming out of Academia and the [NCSC](https://www.ncsc.gov.uk) and I recommend you watch the video to understand how [people are the unsung heroes of cybersecurity](https://www.ncsc.gov.uk/blog-post/people-unsung-heroes-cyber-security)

repository: bruntonspall/bruntonspall-site

extension: markdown

gha_language: JavaScript

repo_name: bruntonspall/bruntonspall-site


text:
---
layout: post
title: Cappadocia Aka the Moon
modified:
categories:
description:
tags: []
image:
  feature: 2015-12-18-cappadocia-aka-the-moon/cover.jpg
  credit: Henry Jenkins
  creditlink: http://henryjenkins.name
comments: false
share: false
date: 2015-12-18T00:00:00+13:00
---

After a week in Istanbul, we headed to Cappadocia. Going there is a great way to feel like you are on another planet as the landscape are other-worldly. There were many places to explore and we were sad to leave as we could have easily spent another week hiking there. Cappadocia is famous for it’s unusual rock formations - ‘fairy chimneys’, surreal landscapes and the houses and underground cave networks carved into the soft volcanic rock. Because it is in Turkey you don’t have the excessive access restrictions for safety reasons like you would in a lot of other places. This means that you really get to wander around and explore the surreal landscape and features relatively freely.

In Cappadocia we visited Derinkuyu underground city, Ihlara valley and Selime monastery

While we were in Cappadocia we had an unusual experience. We were walking down a quiet street when a car pulled over and out tumbled 6 high-schoolers who walked over to us and whipped out their phones to start filming us while asking awkward questions in english. They knew enough english to ask us some simple questions but not enough to explain to us what was going on. It was very confusing. A friend of ours cleared up the mystery later, apparently if you don’t have enough marks to pass english at high-school you could get extra marks by filming yourself having a conversation with an english-speaker.

repository: steakunderscore/just-out-for-a-walk

repo_name: steakunderscore/just-out-for-a-walk


text:
# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]
### Added
- Add `Directory` to replace `AcmeDirectory`
- Add support for deleting registration
- Add support for account key roll-over

## 1.0.7 - 2017-07-20
### Changed
- Fix error when parsing directory resource with *meta* property. ([#5][i5])

[Unreleased]: https://github.com/fszlin/certes/compare/v1.0.7...HEAD

[i5]: https://github.com/fszlin/certes/issues/5

repository: llenroc/certes

repo_name: llenroc/certes


text:
OSGI Launcher
-------------

This is a simple OSGI launcher based on the Felix boot code. It can
start any OSGI framework that supports the Framework-API.

By default the launcher will search for bundles in the "bundles"
directory. This launcher does not support specifying deployed bundles
via properties - my use-case requires that the installation is stable
and not prone to user interference.

This launcher scans the bundle directory for sub-directories.

After launching, the deployment code will validate that all bundles
have been started. A bundle that is not started is an indicator of a
configuration problem like not finding a required package. The launcher
does not validate services - it is up to the validation code at higher
levels to do so.

repository: tmorgner/osgi-runner

repo_name: tmorgner/osgi-runner


text:
---
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

# GitLab Shell documentation has moved

[![pipeline status](https://gitlab.com/gitlab-org/gitlab-shell/badges/main/pipeline.svg)](https://gitlab.com/gitlab-org/gitlab-shell/-/pipelines?ref=main)
[![coverage report](https://gitlab.com/gitlab-org/gitlab-shell/badges/main/coverage.svg)](https://gitlab.com/gitlab-org/gitlab-shell/-/pipelines?ref=main)
[![Code Climate](https://codeclimate.com/github/gitlabhq/gitlab-shell.svg)](https://codeclimate.com/github/gitlabhq/gitlab-shell)

The documentation for GitLab Shell [has moved into the `gitlab` repository](https://docs.gitlab.com/ee/development/gitlab_shell/).

repository: gitlabhq/gitlab-shell

gha_language: Go

repo_name: gitlabhq/gitlab-shell


text:
# fmedina771.github.io
My portfolio that is currently being updated

An energetic and motivated young web developer looking for a challenging, informative and engaging position along talented professionals that will improve my skills while encouraging personal growth and development.

--EDUCATION--

Rutgers University			                           April 2017 – October 2017
Rutgers Coding Bootcamp - Full Stack Web Development
Immersive and hands on 6-month boot camp dedicated to designing and building web applications.  Including front end and back end projects touch on different frameworks and libraries.

Bergen Community College, Paramus, NJ		           January 2016 – Present
Associate in Computer Science
Currently working towards and Associates in Computer Science and eventually transferring to a four year University to continue my education and achieve a Bachelor’s in IT or CS.

--(Unrelated) WORK EXPERIENCE--

Production Assistant/ Assistant Director		       January 2014 – Present
Netflix, FX, A&E, CBS

Worked closely alongside high profiled talent and reviewed confidential scripts and background material. Practical experience in a variety of roles involving assistant directing, supervising, and day-to-day studio and production activities.   Projects worked on include:
•	Orange is the New Black
•	The Girl on the Train
•	Unforgettable
•	Law & Order SVU
•	Person of Interest

--ADDITIONAL ASSOCIATIONS--

•	Codesmith NYC Meetup (JavaScript the Hard Parts)
•	Javascript.NYC Meetup
•	Code for Newark

--REFERENCES--

Alexander Medina
Tech Information Risk @ Morgan Stanley –<PHONE_NUMBER> -<EMAIL_ADDRESS>Erdal E. Gerda
Senior Systems Engineer @ Bloomberg –<PHONE_NUMBER> –<EMAIL_ADDRESS>

--Skills--

-- Languages:

•	CSS/CSS3
•	HTML/5/XHTML
•	JavaScript
•	XML

-- Libraries/
Frameworks:

•	jQuery
•	Bootstrap
•	Firebase
•	Ionic Mobile
•	Angular JS
•	Node.js
•	Express.js
•	Handlebars.js
•	React.js

-- Databases:

•	MySQL
•	MongoDB

-- Operating Systems:

•	Mac OSX
•	Windows
•	Basic Linux CLI

-- Other:

•	SDLC
•	Agile Methodology: Scrum, Kanban
•	Heroku
•	Github
•	Adobe Flash Builder (Flex)
•	Flash


text:
# cloud-employeeslistapp

# Application links in SCP CF

https://p1943057769trial-trial-dev-employeeslist-ui.cfapps.eu10.hana.ondemand.com/index.html

https://p1943057769trial-trial-dev-employeeslist-java.cfapps.eu10.hana.ondemand.com/core/employees
https://p1943057769trial-trial-dev-employeeslist-java.cfapps.eu10.hana.ondemand.com/core/test

# Blogs and tutorials about this scenario
https://blogs.sap.com/2015/12/08/sap-hana-sps-11-new-developer-features-hdi/

https://help.sap.com/doc/4505d0bdaf4948449b7f7379d24d0f0d/2.0.01/en-US/b3092cdd8e754a08a9e86006a53c4cca.html

https://www.sap.com/developer/tutorials/xsa-hdi-module.html

# CF commands
java -jar mta.jar -build-target=CF build

cf deploy cloud-employeeslistapp-tomee.mtar

cf allow-space-ssh SPACE_NAME
cf enable-ssh APP_NAME

cf security-groups
cf security-group SECURITY_GROUP

cf ssh -L localhost:30015:<host>:<port> <application_name> -N

cf m
cf cs application-logs lite app-logs
cf bs employeeslist-java app-logs
cf restage employeeslist-java

https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html

C:\Users\fabiano.a.rosa>cf curl /v2/info
{
   "name": "",
   "build": "",
   "support": "https://help.cf.eu10.hana.ondemand.com",
   "version": 0,
   "description": "Cloud Foundry at SAP Cloud Platform",
   "authorization_endpoint": "https://login.cf.eu10.hana.ondemand.com",
   "token_endpoint": "https://uaa.cf.eu10.hana.ondemand.com",
   "min_cli_version": null,
   "min_recommended_cli_version": null,
   "api_version": "2.98.0",
   "app_ssh_endpoint": "ssh.cf.eu10.hana.ondemand.com:2222",
   "app_ssh_host_key_fingerprint": "f3:12:47:b5:3a:19:6e:6c:4e:9d:90:2e:6f:8e:87:cc",
   "app_ssh_oauth_client": "ssh-proxy",
   "doppler_logging_endpoint": "wss://doppler.cf.eu10.hana.ondemand.com:443"
}

ssh -p 2222<EMAIL_ADDRESS>


text:
node-webnfc
===========
This Node.js module provides an implementation of the the
[W3C Web NFC API](https://w3c.github.io/web-nfc/), using
[neard](http://git.kernel.org/cgit/network/nfc/neard.git) as backend.
Other backends may also be supported in the future.

As the Web NFC specification is targeted browsers (UAs, in spec language),
there are a few ways this implementation differs from the spec.

- It does *not* require a secure context
- It currently doesn't use the Web NFC record due to a limitation with ```neard```
  - This means that it does not write origins to Web NFC record
- It uses only one push slot (either for tags, or peers, or both).

Examples and testing
--------------------
Use ```test/tests.js``` as a playground for testing.
Also refer to the [testing guidelines](./test/howto.md).

Known issues
------------
- Writing tags fails with ```neard``` reporting ```"not enough space on tag"```.
- Multiple record tags are not working with the current version of ```neard```.
- External Type tags are not working with the current version of ```neard```.

repository: zolkis/node-webnfc

repo_name: zolkis/node-webnfc


text:
# TOTO Numbers Generator

This is an app which shows the most common numbers in time periods and is also able to generate random numbers.

The '1 Year' button shows the most drawn numbers for last year.
The '5 Years' button shows the most drawn numbers for the previous 5 years.
The '10 Years' button shows the most drawn numbers for the previous 10 years.
The 'All Time' button shows the most drawn numbers since the beginning of the lottary in 1958.
The 'Random Six' button shows random six numbers.
There is also a help button.

repository: GrumpyAPI/TOTO-Numbers-Generator

repo_name: GrumpyAPI/TOTO-Numbers-Generator


text:
TODO
====

## Uncompleted

- [ ] Embed.ly integration
- [ ] Test on Medium

## Future

- [ ] Rate limit reloads (1 per sec?)
- [ ] Group gists together (by tag?, by folder?)

## Completed

- [x] Log in using GitHub (1h)
- [x] List gists for user (1h)
- [x] Download gist.
- [x] Parallelize gist download.
- [x] Deliver gist files over HTTP (with MIME types)
- [x] Implement oEmbed (http://oembed.com/)
- [x] Add TLS support.
- [x] Domain name registration
- [x] Create DigitalOcean droplet
- [x] Error reporting (Bugsnag)
- [x] CI (Drone)
- [x] Test Coverage (Coveralls)
- [x] Continuous Deployment (Drone)
- [x] Upstart service
- [x] Log management (Papertrail)
- [x] Metrics (Datadog)
- [x] Reload if accessing any .html
- [x] Unit Tests
  - [x] MockGitHubClient
  - [x] GitHub tests
  - [x] Handler tests
- [x] UI
  - [x] Home page (unauthenticated)
  - [x] Dashboard (authenticated)
- [x] Visually test embeds
- [x] Add .gist-exposed class to iframe.
- [x] Favicon

repository: benbjohnson/gist

repo_name: benbjohnson/gist


text:
# eeprom

## Description

Some fans have EEPROMs on them. In these cases, the `eeprom` JSON stanza can be
used to have the application re-bind the EEPROM driver to the EEPROM instance
after a new fan is detected. This will trigger the EEPROM to be read by the
appropriate code if the platform is configured to do so.

This is optional and only required if the above behavior is desired.

## Keys

- ["bus_address"](#bus_address)
- ["driver_name"](#driver_name)
- ["bind_delay_ms"](#bind_delay_ms)

### "bus_address"

The I2C bus and address string of the form BB-AAAA that is used by the I2C
subsystem in sysfs.

```
"bus_address": "3-0050"
```

### "driver_name"

The name of the eeprom driver in sysfs.

```
"driver_name": "at24"
```

### "bind_delay_ms"

The number of milliseconds to wait after a fan is detected before binding the
driver to the device in case the device takes some time to initialize after
being plugged into power. If no delay is required, a value of zero can be used.

```
"bind_delay_ms": 1000
```

## Example

[
  {
    "name": "fan0",
    "path": "/system/chassis/motherboard/fan0",
    "methods": [
      {
        "type": "tach",
        "sensors": [
          "fan0_0"
        ]
      }
    ],
    "rpolicy": {
      "type": "anyof"
    },
    "eeprom": {
      "bus_address": "30-0050",
      "driver_name": "at24",
      "bind_delay_ms": 1000
    }
  }
]

repository: ibm-openbmc/phosphor-fan-presence

repo_name: ibm-openbmc/phosphor-fan-presence


text:
# Build Instructions

1. Open and build the PlayGen.SUGAR.Unity project.
2. Open the Unity project.
3. Click Menu/Tools/Build SUGAR Package.
4. Copy the built package from Build/SUGAR.unitypackage.
5. Import it into your project and let the magic begin.

## Making Changes to SUGAR Client

1. Build SUGAR project
2. Open SUGAR/PlayGen.SUGAR.Client.Development/bin/Debug/net46
3. Copy new .dll files to sugar-unity/lib/SUGAR/Client
4. Open and Build PlayGen.SUGAR.Unity project

repository: Ne-Ice/SUGAR-Unity

repo_name: Ne-Ice/SUGAR-Unity


text:
# Modules Exercise 2

1. Create a Python package containing three modules each module should contain one function.
2. Use `__init__.py` to integrate the three functions together.
3. Import the package using `import your_package_name`.
4. Import just the three functions using `from package import func1, func2, func3`.

repository: austind/pyplus-ons

repo_name: austind/pyplus-ons


text:
## Development

#### Prerequisites

- [Git](https://git-scm.com/)
- [node.js](https://nodejs.org/en/). We recommend using node.js v10.x, but all
  versions starting from v6 should work.  Upgrading and managing node versions
  can be easily done using [`nvm`](https://github.com/creationix/nvm) or its
  Windows alternatives.
- [`npm`](https://www.npmjs.com/) v6.x and up (which ships by default with
  node.js v10.x) to ensure that the
  [`package-lock.json`](https://docs.npmjs.com/files/package-lock.json) file is
  used and updated correctly.
- A Unix shell, to run the Bash commands given in these contribution
  guidelines. If you use Windows, you do not have a Unix shell automatically
  installed; you may want to use a Unix emulator such as Cygwin or an SSH
  client
  ([setup instructions](http://faculty.smu.edu/reynolds/unixtut/windows.html)).

#### Step 1: Clone the dash-bio repo and install its dependencies

```bash
git clone https://github.com/plotly/dash-bio.git
cd dash-bio
npm install
```

#### Step 2: Develop

Development of a component for this repository comprises two parts:
the component itself, and a sample application that showcases the capabilities
of your component and how it interacts with Dash.

##### Components
Components can either be created using React, or they can be written in pure
Python.

##### Demo applications
Instead of creating standalone Dash apps for each component, there is a file
structure in place to create a main "gallery" page that contains links to each
(component) application. Consequently, the implementation of a component needs
to follow a specific file structure for the corresponding app to be displayed
and run correctly.

###### Setup
In the `tests/dash/` subfolder, please create a file named
`app_{your component name in snake case}.py`. In this file, please include the
following functions:

* `layout()` should return whatever you would have in your `app.layout`. Due to
the way the CSS is set up for each application, it is advisable to create a
container `div` that will house your application, e.g.,
```python
def layout():
    return html.Div(id='my-component-container', children=[
        "A sample component",
        dash_bio.MyComponent(id='my-component'),
        html.Div(id='my-component-output'),
    ])
```
* `callbacks(app)` should contain all of the callbacks in the application and
not return anything, e.g.,
```python
def callbacks(app):
    @app.callback(
        Output('my-component-output', 'children'),
        [Input('my-component', 'someProperty')]
    )
    def update_output(property):
        return "Value: {}".format(str(property))
```

###### Testing
Test out your application by going to the repository's root directory and
running

```bash
python index.py
```
Then navigate to `localhost:8050` in your web browser. You should see the
gallery page. To get to your application, click on the square that displays the
name of your component upon hover.

You will need to quit the Python application and rerun it if you have made
changes to the Python file itself, or have recently rebuilt/reinstalled the
Dash Bio package. To see updated CSS changes, you can simply reload the webpage
in your browser.

###### CSS
All custom CSS stylesheets should go in the `assets/` folder. Please create a
stylesheet with a filename specific to your component. In addition, all ids and
class names in your application should be prefixed by the name of your
component (this is done so that the stylesheet for one application doesn't
accidentally affect another application).

Please note that the header on your application is part of the page; therefore,
if you want to make a container `div` for your application as mentioned in the
Setup subsection, please account for an extra height of `100px` that is taken
up by the header when you are specifying the height of the container.

###### Final touches
In the `tests/dash/images/` subfolder, please include a PNG file named
`pic_{your component name in snake case}.png`.

In your demo app file, please include the following functions:
* `description()` is responsible for the text that shows up on hovering over
your application in the gallery page. It should return a short string with a
description of the component, e.g.,
```python
def description():
    return "Display bioinformatics data with this component."
```
* `header_colors()` controls the appearance of the header for your application.
It should return a dictionary with any or all of the specified keys `bg_color`
(string), `font_color` (string), and `light_logo` (boolean). Please change the
background color from default, and try to choose one that isn't used for
another application, e.g.,
```python
def header_colors():
    return {
        'bg_color': 'rgb(255, 0, 0)',
        'font_color': 'rgb(255, 255, 255)',
        'light_logo': True
    }
```

Please lint any additions to Python code with `pylint` and/or `flake8`.

Commit each changeset corresponding to a conceptual entity.
Write commit messages at the imperative (e.g., "Document workflow").
Each commit is small; a pull request typically consists of a few commits.

#### Step 3: Run tests locally

To run integration tests locally on, say, Google Chrome:
```bash
pip install -r tests/requirements.txt
pytest tests --driver Chrome
```
Do not worry if you get errors running this last command. You will have to
download a Chrome driver, install it, and add its path. Follow what the error
messages point to (this will be platform-specific).

We want more integration tests.

We do not have a suite of unit tests yet.

TODO Include at least one unit test per component.

#### Step 4: Rebuild the package if necessary

If you have made changes to the JS code, then you need to rebuild the package:

```bash
npm run build:all
```

The auto-generated Python files will reflect your updates to the logic.
If, instead, you have made changes to the layout, you do not need to rebuild
the package.

#### Step 5: Submit a pull request (PR)

Fill out the description template in the GitHub interface.
When you submit the PR, a Heroku review app will be automatically created; it
will remain available for 5 days.


text:
# Kellermania yuccifolia (J.G. Hall) Nag Raj, 1993 SPECIES

#### Status
SYNONYM

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

#### Published in
Coelomycetous Anamorphs with Appendage-bearing Conidia (Ontario) 443 (1993)

#### Original name
Neottiospora yuccifolia J.G. Hall, 1915

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Sordariomycetes/Hypocreales/Alpakesa/Alpakesa yuccifolia/ Syn. Kellermania yuccifolia/README.md

repo_name: mdoering/backbone