text:
---
title: Setting up Scala, SBT, Play, Akka
layout: post
og_image_url: "https://blog.virtengine.com/res/gotalk-intro.png"
description: Setting up Scala, SBT, Play, Akka
---
### Part 1 : Setting up Scala, SBT, Play, Akka

This will be multi-part series in building a cloud API server for our PaaS with cloud instrumentation using a messaging layer.

### 1. Let us setup SBT 0.13.

#### Installing in debian

    echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
    sudo apt-get update
    sudo apt-get install sbt

(or)

#### Manual install of sbt

- Download the [sbt_launch.jar](https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.9/sbt-launch.jar?_ga=1.124271561.2110266759.1437462670) to your ~/bin directory.

- Create a script named `sbt` in your ~/bin directory with the following contents.

    java -server -Xms1024M -Xmx3072M -Xss32M     -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=1024M -XX:+UseG1GC -XX:+AggressiveOpts -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0 -jar `dirname $0`/sbt-launch.jar "$@"

- Adjust the -Xmx, -Xms -XX:MaxPermSize based on the RAM you have.

At Megam we all have atleast 8GB or > of RAM.

#### *optional Install sbt-eclipse

Install the scala-ide eclipse plugin for Eclipse Mars.

Help > Install New Software >

Add the correct link from herehttps://scala-ide.org/download/nightly.html

You can install typesafe stack and download templates from here. https://typesafe.com/stack/download#template
https://typesafe.com/resources/typesafe-stack/downloading-installing.html

- Create a new project in eclipse.
Scala – Worksheet allows you to play around with REPL inside eclipse editor. or use command line, to use REPL

`sbt console`

If you only plan to use scala, you are done here. You can tweak your Build.scala to use the scala version you want.

### 2. Eclipsify scala project

https://github.com/typesafehub/sbteclipse/wiki https://github.com/typesafehub/sbteclipse Create a file .sbt/plugins/plugins.sbt and add the following to include eclipse plugin support.

    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0"

If you created a project from command line then run sbt > eclipse to eclipsify a project..

    ram@rammegam:~/code/megam/workspace/nilam$ sbt
    [info] Loading project definition from /home/ram/code/megam/workspace/nilam/project
    [info] Set current project to nilam (in build     file:/home/ram/code/megam/workspace/nilam/)
    [nilam] $ eclipse
    [info] About to create Eclipse project files for your project(s).
    [info] Updating {file:/home/ram/code/megam/workspace/nilam/}nilam...
    [info] Resolving org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Fin                                                                                [info] Done updating.
    [info] Compiling 6 Scala sources and 1 Java source to /home/ram/code/megam/workspace/nilam/target/scala-2.9.1/classes...
    [info] Successfully created Eclipse project files for project(s):
    [info] nilam

### 3. If you with to use akka

A sample akka source code for the Typesafe Stack (https://typesafe.com/stack). https://typesafe.com/resources/tutorials/getting-started-with-akka-scala.html From your akka code type sbt run:

    ram@rammegam:~/code/megam/workspace/megam_akka$ sbt run
    [info] Loading project definition from /home/ram/code/megam/workspace/megam_akka/project
    [info] Set current project to nilam (in build     file:/home/ram/code/megam/workspace/megam_akka/)
    [info] Updating {file:/home/ram/code/megam/workspace/megam_akka/}nilam...
    [info] Resolving com.typesafe#config;0.3.1 ...
    [info] downloading https://repo.typesafe.com/typesafe/releases/com/typesafe/akka/akka-actor/2.0.3/akka-actor-2.0.3.jar ...
    [info]     [SUCCESSFUL ] com.typesafe.akka#akka-actor;2.0.3!akka-actor.jar (9117ms)
    [info] downloading https://repo.typesafe.com/typesafe/releases/com/typesafe/config/0.3.1/config-0.3.1.jar ...
    [info]     [SUCCESSFUL ] com.typesafe#config;0.3.1!config.jar(bundle) (3345ms)
    [info] Done updating.
    [info] Compiling 1 Scala source to /home/ram/code/megam/workspace/megam_akka/target/scala-2.9.2/classes...
    [info] Running org.megam.akka.Nilam
    Count is 3
    [success] Total time: 25 s, completed 6 Nov, 2012 12:31:57 PM

### 4. Setting up Play framework

Let us create a project titled megam_play which will use external dependencies like scaliak, newman, scalaz This project megam_play was created by cloning an existing typesafe_stack (play scala sample template). You are free to pick any other template from Github.com Adding library dependencies in your Build.scala file. The scaliak, amqp dependency has been moved to a common artifact named “megam_common”

    import sbt._
    import play.Project._

    object ApplicationBuild extends Build {

     val appName = "megam_play"

      val appVersion = "0.1.0"

      val organization = "Megam Systems"

      val homepage = Some(url("https://www.megam.co"))

      val startYear = Some(2013)

      val description = "RESTful API server for the megam platform. Uses Riak and Memcache"

      /**
       *   if you use groupID %% artifactID % revision instead of groupID % artifactID % revision
       *   (the difference is the double %% after the groupID), sbt will add your project’s Scala version
       *   to the artifact name.
       */

      val play2AuthVersion = "0.11.0-SNAPSHOT"
      val megamVersion = "0.1.0-SNAPSHOT"

      val appDependencies = Seq(
        javaCore, cache,javaEbean,
        "com.twitter.service" % "snowflake" % "1.0.2" from "https://s3-ap-southeast-1.amazonaws.com/megampub/0.1/jars/snowflake.jar", //don't move this below.
    "com.github.indykish" % "megam_common_2.10" % megamVersion excludeAll (
      ExclusionRule("commons-logging","commons-logging"),
      ExclusionRule("org.slf4j","slf4j-jdk14")),
    "com.github.mumoshu" %% "play2-memcached" % "<IP_ADDRESS>",
    "jp.t2v" %% "play2-auth" % play2AuthVersion,
    "jp.t2v" %% "play2-auth-test" % play2AuthVersion % "test",
    "com.stackmob" %% "newman" % "1.3.0" % "test")

      val main = play.Project(appName, appVersion, appDependencies).settings(
    sbt.Keys.resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
    sbt.Keys.resolvers += "Typesafe Snapshots" at "https://repo.typesafe.com/typesafe/snapshots/",
    sbt.Keys.resolvers += "Scala-Tools Maven2 Snapshots Repository" at "https://scala-tools.org/repo-snapshots",
    sbt.Keys.resolvers += "Twitter Repo" at "https://maven.twttr.com", // finagle
    sbt.Keys.resolvers += "spray repo" at "https://repo.spray.io", //spray client used in newman.
    sbt.Keys.resolvers += "spray nightly" at "https://nightlies.spray.io", //spray client nighly used in newman (0.23.0).
    sbt.Keys.resolvers += "Spy Repository" at "https://files.couchbase.com/maven2" // required to resolve `spymemcached`, the plugin's dependency.
    )

    }

We package debs, hence build.sbt contains the required statements

    import sbt
    import Process._
    import com.typesafe.sbt.packager.debian.Keys._
    import    com.typesafe.sbt.packager.linux.LinuxPackageMapping
    import S3._

    scalaVersion := "2.10.3"

    scalacOptions := Seq(
      "-unchecked",
      "-deprecation",
      "-feature",
      "-optimise",
    "-Xcheckinit",
    "-Xlint",
    "-Xverify",
    "-Yinline-warnings",
    "-Yclosure-elim",
    "-language:postfixOps",
    "-language:implicitConversions",
    "-Ydead-code")

    com.typesafe.sbt.packager.debian.Keys.name in Debian := "megamplay"

    maintainer in Debian:= "Rajthilak<EMAIL_ADDRESS>
    packageSummary := "Cloud API server - Megam."

    packageDescription in Debian:= " (REST based) Cloud API server for Megam platform.The API server protects the resources using HMAC based authorization, as provided to a customer during onboarding."

    s3Settings

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
      (packageMapping((bd / "bin/mp") -> "/usr/local/share/megamplay/bin/mp")
       withUser "root" withGroup "root" withPerms "0755")
    }

    linuxPackageMappings <+= (baseDirectory) map { bd =>
      val src = bd / "target/staged"
     val dest = "/usr/local/share/megamplay/lib"
    LinuxPackageMapping(
    for {
      path <- (src ***).get
      if !path.isDirectory
    } yield path -> path.toString.replaceFirst(src.toString, dest)
    )
    }

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
      (packageMapping((bd / "conf/application-production.conf") -> "/usr/local/share/megamplay/conf/application-production.conf")
    withConfig())
    }

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
      (packageMapping((bd / "conf/application-logger.xml") -> "/usr/local/share/megamplay/conf/application-logger.xml")
    withConfig())
    }

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
    (packageMapping((bd / "conf/routes") -> "/usr/local/share/megamplay/conf/routes")
    withConfig())
    }

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
    (packageMapping((bd / "conf/messages") -> "/usr/local/share/megamplay/conf/messages")
    withConfig())
    }

    linuxPackageMappings in Debian <+= (baseDirectory) map { bd =>
    (packageMapping((bd / "conf/play.plugins") -> "/usr/local/share/megamplay/conf/play.plugins")
    withConfig())
    }

    com.typesafe.sbt.packager.debian.Keys.version in Debian <<= (com.typesafe.sbt.packager.debian.Keys.version, sbtVersion) apply { (v, sv) =>
    sv + "-build-" + (v split "\." map (_.toInt) dropWhile (_ == 0) map ("%02d" format _) mkString "")
    }

    debianPackageDependencies in Debian ++= Seq("curl", "java2-runtime", "bash (>= 2.05a-11)")

    debianPackageRecommends in Debian += "riak"

    linuxPackageMappings <+= (baseDirectory) map { bd =>
    packageMapping(
    (bd / "copyright") -> "/usr/share/doc/megam_play/copyright"
    ) withPerms "0644" asDocs()
    }

    linuxPackageMappings in Debian <+= (com.typesafe.sbt.packager.debian.Keys.sourceDirectory) map { bd =>
    (packageMapping(
    (bd / "debian/changelog") -> "/usr/share/doc/megam_play/changelog.gz"
    ) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
    }

    mappings in upload := Seq((new java.io.File(("%s-%s.deb") format("target/megamplay", "0.12.4-build-0100")),"0.1/debs/megam_play.deb"))

    host in upload := "megampub.s3.amazonaws.com"

    credentials += Credentials(Path.userHome / "software" / "aws" / "keys" / "sbt_s3_keys")

    S3.progress in S3.upload := true

 1.Plugins.sb

    // Comment to get more information during initialization
    logLevel := Level.Warn

    // The Typesafe repository
    resolvers += "Typesafe repository" at     "https://repo.typesafe.com/typesafe/releases/"

    // Typesafe snapshots
    resolvers += "Typesafe Snapshots" at    "https://repo.typesafe.com/typesafe/snapshots/"

    // Use the Play sbt plugin for Play projects

    addSbtPlugin("play" % "sbt-plugin" % "2.2.0")

project/build.properties

`sbt.version=0.13.0`

We built our own AMQP based on scalaz, and is available in https://github.com/indykish/megam_common. Now build and publish megam_common jars using the process as described in this link into https://oss.sonatype.org/content/repositories/snapshots/com/github/indykish/megam_common_2.10/0.1.0-SNAPSHOT/.

`sbt publish`

Run the play project megam_play

    ram@ramhome:~/code/megam/workspace/megam_play$ sbt
    [info] Loading global plugins from /home/ram/.sbt/0.13/plugins
    [info] Loading project definition from /home/ram/code/megam/workspace/megam_play/project
    [info] Set current project to megam_play (in build     file:/home/ram/code/megam/workspace/megam_play/)
    [megam_play] $ play
           _
      _ __ | | __ _ _  _
     | '_ | |/ _' | || |
     |  __/|_|___|__ /
     |_|          |__/

    play 2.2.0 built with Scala 2.10.2 (running Java 1.7.0_25), https://www.playframework.com

    > Type "help play" or "license" for more information.
    > Type "exit" or use Ctrl+D to leave this console.

    [megam_play] $

You can use lsof as shown below to see if the server runs on port 9000.

    [nilam] $ run

    $ sudo lsof -i:9000
    [sudo] password for ram:
    COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
    java    15640  ram  270u  IPv6  40094       TCP *:9000 (LISTEN)

Now let us add a template to show the

    1. index page,
    2. Error when an invalid URL is passed

####index.scala.html

    @(message: String)(implicit flash: play.api.mvc.Flash)
    @main("Megam Cloud v1") {
    @welcome(message)
    }

####main.scala.html

    @(title: String)(content: Html)
    <!DOCTYPE html>

    <title>@title</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Lato:300,400,700" />
    <link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/theme.css")" >
    <link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/bootstrap-theme.css")" >
    <link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/bootstrap.css")" >
    <link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/bootstrap-glyphicons.css")">
    <link rel="stylesheet" href="styles/default.css">
    <link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/styles/default.css")" >
    <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">

            @leftmenu()
            @content

####errorPage.scala.html

    @(ex: Throwable)

    @main("An error occurred while trying to run megam_play. contact support.") {

       <image src="@routes.Assets.at("images/nirvana.png")"/>

Sucked into Nirvana

        @(ex getMessage)

Stacktrace

    @({val u = new java.io.StringWriter; ex.printStackTrace(new java.io.PrintWriter(u)); u.toString})

    }

    object Global extends GlobalSettings {

     override def onStart(app: Application) {
    play.api.Logger.info("Megam Play %s App - started".format("0.1"))
    }

    override def onStop(app: Application) {
    play.api.Logger.info("Megam Play %s App - going down. Stateless folks - you don't care.".format("0.1"))
    }

    override def onError(request: RequestHeader, ex: Throwable) : Future[play.api.mvc.SimpleResult] = {
    Future.successful(InternalServerError(
      views.html.errorPage(ex)))
    }

    override def onHandlerNotFound(request: RequestHeader): Future[play.api.mvc.SimpleResult] = {
    Future.successful(NotFound(
      views.html.errorPage(new Throwable(NOT_FOUND + ":" + request.path + " NOT_FOUND"))))
     }
    }

Thee view files are placed under views directory.

Type https://localhost:9000

gha_language: CSS


text:
# 🤗 TKUDO

## What is it?

TKudo is an application that digitizes agile technique to motivate KUDO teams. Kudos are written and public acknowledgments from a colleague for something they have contributed to the team.

## Main Framework

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling.

## Requirements
- Docker

## License

TKudo is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

license: MIT

repository: juanlopezdev/tkudo

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: juanlopezdev/tkudo


text:
# chickendoor

We have chickens and live near Seattle where dawn is very early in the summers.
A system that opens the door to the chicken coop automatically means we can sleep in.  If it can also close the door, it makes vacations easier for a pet sitter.

## Requirements

* Must fail safe:  IE if it breaks down, we can still open the door and latch it at night. - This is acheived by having the actuator outside of the chicken house and attached with simple pins that a person can pull out without tools
* Must be racoon proof:  Or you might as well not have a door
* Must not crush chickens:  This probably rarely happens, but I would feel aweful if it did.  I added a pressure sensor to make the door open if it hits anything.
* Open and close based on sunrise & sunset:  No manual adjustmenst over the year.

## Files

* openscad files for project box, pressure sensor & bracket
* openscad files for helpful objects (screw hole sizer, rpi mount position test)
* python code for running on Rpi

Requires a linear actuator, a set of 2 12v relays, a 12 & 5 v power supply,
2 buttons && whatever I'm not remembering.

## How it works

The actuator is anchored on the wall outside of the door and to the door, so
when it retracts, it opens the door.  The pressure sensor is basically a hinge
connecting the actuator to the door with a button inside it.  When the actuator
presses on the hinge, it applies pressure to the button.  I just need to
position the button and possibly apply opposing elasic force.

## TODO

* retry closing if we hit a chicken
* poweroff with long press
* log to syslog/journal
* send alerts if it hits a chicken or has other problems

## For version III

* config file for time offsets
* make brackets adjustable
* make it a service that I can interact with using a client
* make separate monitoring system that can send alerts if the chicken door opener dies
* figure out math for positioning the actuator
* separate latching mechanism
* camera and imge processing to count chickens
* anit-hawk rail-gun with tracking and flight prediction

## Lessons Leaned

* The slop between the pins and the holes they go through really matters.  Shutting the door firmly wihtout setting off the pressure sensor depends on minimal slop.  I was able to offset this by cramming some wire into the holes and screwing wood to the door, making it thicker.
* setting one of the brackes a few inches off of the wall would really help.  As it is, the closed door is a straight line between them so there's very little leverage keeping it closed and that means any slop translates into a lot of wiggle in the door.
* gpiozero is amazing.  I could have written much simpler code if I'd known how   it works before I got started.

# pins I used

* LEDs 4,17
* Relays 27,22
* Buttons 23,24

repository: pileofrogs/chickendoor

branch_name: refs/heads/master

repo_name: pileofrogs/chickendoor


text:
# _Pizza Order_

#### _A fake pizza ordering website, 1/27/2017_

#### By _**Jake Campa**_

## Description

_A pizza ordering website that you create an order of multiple pizzas and display the total price_

## Specs
User selects selects the size of the pizza
User can add toppings to the pizza
User can add the pizza to the order
User can add another pizza
User can submit the order and get a total price

## Github Pages
_https://jdcamp.github.io/pizza-website/_

## Setup/Installation Requirements

* _Clone repo_
* _Open index.html_

## Known Bugs

_None Known_

## Support and contact details

_Support and bug reporting pending_

## Technologies Used

_Bootstrap, jQuery_

### License

*MIT Licensing*

Copyright (c) 2016 **_Jake Campa_**

repository: jdcamp/pizza-website

repo_name: jdcamp/pizza-website


text:
# DESCRIPTION

Use the Eval_Expression class when you want to evaluate mathematical expressions from untrusted sources. You can define your own variables and functions, which are stored in the object. Try it, it's fun!

Based on the work by:
- Miles Kaufmann <http://www.twmagic.com/>
- Lee Eden <https://www.phpclasses.org/discuss/package/2695/thread/4/>
- Jakub Jankiewicz <https://github.com/jcubic/expression.php>
- Josh Marshall <https://github.com/joshbmarshall/evalmathlogic>

Includes units test by:
- Jakub Jankiewicz <https://github.com/jcubic/expression.php>
- Josh Marshall <https://github.com/joshbmarshall/evalmathlogic>
- Daniel Bojdo <https://github.com/dbojdo/eval-math>

This library can be installed as a WordPress plugin. It adds a shortcode that can be used to evaluate expressions.

Example: `[eval]2+3*4[/eval]`

The shortcode accepts the following parameter:
- `precision` :: The result will be rounded to the supplied integer. The default is `2`.

# EXAMPLES

```php
include 'Expression.php';
include 'Stack.php';

$math = new Easy_Plugins\Evaluate\Expression;

// Basic evaluation:
$result = $math->evaluate('2+2'); // 4

// Supports: order of operation; parentheses; negation; built-in functions:
$result = $math->evaluate('-8*(5/2)^2*(1-sqrt(4))-8'); // 42

// Support of booleans.
$result = $math->evaluate('10 < 20 || 20 > 30 && 10 == 10'); // true

// Supports logic.
$result = $math->evaluate('2 + 2 == 4'); // true
$result = $math->evaluate('2 + 2 < 4'); // false
$result = $math->evaluate('2 + 2 >= 4'); // true

// Support for strings and match (regexes can be like in PHP or like in JavaScript).
$result = $math->evaluate('"Foo,Bar" =~ /^([fo]+),(bar)$/i');

// Previous call will create $0 for whole match match and $1,$2 for groups.
$result = $math->evaluate('$2'); // 'Bar'

// Create your own variables:
$math->evaluate('a = e^(ln(pi))');

// Create your own functions:
$math->evaluate('f(x,y) = x^2 + y^2 - 2x*y + 1');

// Use user-defined variables and functions.
$result = $math->evaluate('3*f(42,a)'); // 4532.92746449864

// Use custom closures.
$math->functions['date'] = function( $a ) {

    return strtotime( $a );
};

$result = $math->evaluate("date('first day of this month 00:00:00 UTC')"); // 968544000
```

# METHODS

```$math->evalute($expr)```

Evaluates the expression and returns the result.
If an error occurs, prints a warning and returns false.
If $expr is a function assignment, returns true on success.

```$math->e($expr)```

A synonym for $m->evaluate().

```$math->vars()```

Returns an associative array of all user-defined variables and values.

```$math->funcs()```

Returns an array of all user-defined functions.

# PARAMETERS

```$math->suppress_errors```

Set to `false` to turn on warnings when evaluating expressions.

```$math->last_error```

If the last evaluation failed, contains a string describing the error.
(Useful when suppress_errors is on).

# BUILT-IN FUNCTIONS

The following mathematical functions can be called within the expression:

- sin(n)
- sinh(n)
- arcsin(n)
- asin(n)
- arcsinh(n)
- asinh(n)
- cos(n)
- cosh(n)
- arccos(n)
- acos(n)
- arccosh(n)
- acosh(n)
- tan(n)
- tanh(n)
- arctan(n)
- atan(n)
- arctanh(n)
- atanh(n)
- sqrt(n)
- abs(n)
- ln(n)
- log(n)

The following logical functions have also been defined:

- if(a,b,c) - a is a logical expression, b returned if true, c if false
- or(a,b)
- and(a,b)
- not(a)

repository: easy-plugins/Evaluate-Expression

repo_name: easy-plugins/Evaluate-Expression


text:
# react-snowpack-starter

A barebones starter project with React, Babel, Yarn, and Snowpack to bundle ES modules.

### Usage

```sh
yarn # Install dependencies
yarn build # Transpile source code and copy code and web modules to /dist
cd dist && npx serve # Project will be served at localhost:5000
```

repository: mpopv/react-snowpack-starter

gha_language: HTML

gha_license_id: MIT

repo_name: mpopv/react-snowpack-starter


text:
---
redirect_from: "/story/act-1/seq-1/scene-end/"
layout: scene
title:  Lazarus
beat:   procedural
obj:    up
---

~~~
INT. DEEP OASIS - DAY

Here the PCs must solve a puzzle to get the water back on. This water will cool off the POOL.

PCs get the MAGNET.
~~~

~~~
EXT. OASIS - NIGHT

After exiting the DEEP OASIS the SHAMAN’S body is gone.
Where it was another tree has grown.
A ninth in the group around the POOL.

Water gushes out from the beak of whatever oval face was once carved into the cliff,
it cascades into the POOl.
The water of the POOL is no longer bubbling or steaming.
~~~

The first player who tries to grab it is pulled into the oasis by a tentacle,
but when they surface can’t see anything in the POOL.
In their hands is a piece of the MEDALLION. Take a Sanity check.

Outside the sandstorm dies out.

~~~
EXT. DESERT - NIGHT
After leaving the cave a solid slab of rock closes behind them.
Occult writing in glowing red surface on the rocks.
~~~

Using Photography, PCs can capture the writing seeing that it is a POEM in a foreign language.

With the interference from the sandstorm gone, Radio chatter resumes.
PCs hear Birchwell come up in conversation, and Borst makes out that the Professor is in the background.

The PCs head to the SOVIET CAMP, Borst says he will lead the PCs to where Birchwell is being held.
He says he knows a secret way in, and will explain when they arrive.

repository: evan-erdos/trail-of-cthulhu

branch_name: refs/heads/gh-pages

repo_name: evan-erdos/trail-of-cthulhu


text:
---
layout: post
title: brume
date: 2014-02-08 19:17:00
homepage: https://github.com/aigarsdz/brume
download: https://github.com/aigarsdz/brume/archive/master.zip
demo: http://aigarsdz.github.io/brume
author: Aigars Dzerviniks
thumbnail: brume.png
license: MIT License
license_link: https://github.com/aigarsdz/brume/blob/master/LICENSE.md
---

I am not a designer so I cannot impress you with breathtaking Jekyll
themes, but brume is something that just came to my mind and I had to
build it.

## Usage

- Download the ZIP file and extract it's contents.
- Open *_config.yml* file and enter your site's URL and add additional
  configuration or update the existing one if needed.
- Open *_data/brume.yml* file and fill in values for site name (site
  title), author (your name) and description (blog description). This
  file contains all the custom information about your page. You can
  access it using `site.data.brume` object.
- Open *about/index.md* file and add information about you or your
  site. You can delete this file and directory if not needed.
- Open *_data/links.yml* and add additional links or update the
  existing ones that you want to be displayed in the navigation menu.
- If you don't want to use CC BY-NC 4.0 licence for the content then
  you should change the footer text, which is located in
  *_layouts/default.html*.
- Change the logo, which can be found in *public/images* folder.
- Build your site and be happy!

extension: markdown


text:
# GetLottery
Set prize and set probability, enjoy lottery.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'get_lottery'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install get_lottery

## How to use get_lottery in general

```ruby
require 'get_lottery'
prizes = ['一等奖', '二等奖', '三等奖']

probabilities = [20,50,30]
#  Refers 20%,50%,30%

GetLottery.run(prizes, probabilities)
# will return prize

```
## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/wjiachao/get_lottery. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

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


text:
Rebar3 Proper Plugin
=====

Run PropEr test suites.

By default, will look for all modules starting in `prop_` in the `test/`
directories of a rebar3 project, and running all properties (functions of arity
0 with a `prop_` prefix) in them.

Todo/Gotchas
----

- No automated tests yet since this repo runs tests for a living

Use
---

Add the plugin to your rebar config:

    %% the plugin itself
    {project_plugins, [rebar3_proper]}.
    %% The PropEr dependency is required to compile the test cases
    %% and will be used to run the tests as well.
    {profiles,
        [{test, [
            {deps, [
                %% hex
                {proper, "1.3.0"}
                %% newest from master
                {proper, {git, "https://github.com/proper-testing/proper.git",
                          {branch, "master"}}}
            ]}
        ]}
    ]}.

Then just call your plugin directly in an existing application:

    Usage: rebar3 proper [-d <dir>] [-m <module>] [-p <properties>]
                         [-n <numtests>] [-v <verbose>] [-c [<cover>]]
                         [-w <workers>] [-t <property_type>]
                         [--retry [<retry>]] [--regressions [<regressions>]]
                         [--store [<store>]] [--long_result <long_result>]
                         [--start_size <start_size>] [--max_size <max_size>]
                         [--max_shrinks <max_shrinks>]
                         [--noshrink <noshrink>]
                         [--constraint_tries <constraint_tries>]
                         [--spec_timeout <spec_timeout>]
                         [--any_to_integer <any_to_integer>]
                         [--stop_nodes <boolean>]

      -d, --dir           directory where the property tests are located
                          (defaults to "test"). The directory also needs to be
                          declared in extra_src_dirs.
      -m, --module        name of one or more modules to test (comma-separated)
      -p, --prop          name of properties to test within a specified module
                          (comma-separated)
      -n, --numtests      number of tests to run when testing a given property
      -s, --search_steps  number of searches to run when testing a given
                          targeted property
      -v, --verbose       each property tested shows its output or not
                          (defaults to true)
      -c, --cover         generate cover data [default: false]
      -w, --workers       number of workers to use when parallelizing property
                          tests
      -t, --type          this is only used when running parallel PropEr:
                          indicates the type of the property to test, it can
                          either be "pure" when it is side-effect and has no
                          state, or "impure" when it does
      --retry             If failing test case counterexamples have been
                          stored, they are retried [default: false]
      --regressions       replays the test cases stored in the regression
                          file. [default: false]
      --store             stores the last counterexample into the regression
                          file. [default: false]
      --long_result       enables long-result mode, displaying
                          counter-examples on failure rather than just false
      --start_size        specifies the initial value of the size parameter
      --max_size          specifies the maximum value of the size parameter
      --max_shrinks       specifies the maximum number of times a failing test
                          case should be shrunk before returning
      --noshrink          instructs PropEr to not attempt to shrink any
                          failing test cases
      --constraint_tries  specifies the maximum number of tries before the
                          generator subsystem gives up on producing an
                          instance that satisfies a ?SUCHTHAT constraint
      --spec_timeout      duration, in milliseconds, after which PropEr
                          considers an input to be failing
      --any_to_integer    converts instances of the any() type to integers in
                          order to speed up execution
      --stop_nodes        this is only used when running parallel PropEr:
                          indicates whether PropEr should restart the nodes
                          for each impure property, when testing them in
                          parallel, or not

All of [PropEr's standard configurations](http://proper.softlab.ntua.gr/doc/proper.html#Options)
that can be put in a consult file can be put in `{proper_opts, [Options]}.` in your rebar.config file.

Workflow
---

A workflow to handle errors and do development is being experimented with:

1. Run any properties with `rebar3 proper`
2. On a test failure, replay the last failing cases with `rebar3 proper --retry`
3. Call `rebar3 proper --store` if the cases are interesting and you want to keep them for the future. The entries will be appended in a `proper-regressions.consult` file in your configured test directory. Check in that file or edit it as you wish.
4. Use `rebar3 proper --regressions` to prevent regressions from happening by testing your code against all stored counterexamples

Per-Properties Meta functions
---

This plugin allows you to export additional meta functions to add per-property options and documentation. For example, in the following code:

```erlang
-module(prop_demo).
-include_lib("proper/include/proper.hrl").
-export([prop_demo/1]). % NOT auto-exported by PropEr, we must do it ourselves

prop_demo(doc) ->
    %% Docs are shown when the test property fails
    "only properties that return `true' are seen as passing";
prop_demo(opts) ->
    %% Override CLI and rebar.config option for `numtests' only
    [{numtests, 500}].

prop_demo() -> % auto-exported by Proper
    ?FORALL(_N, integer(), false). % always fail

prop_works() ->
    ?FORALL(_N, integer(), true).

prop_fails() ->
    ?FORALL(_N, integer(), false). % fails also
```

When run, the `prop_demo/0` property will _always_ run 500 times (if it does not fail), and on failure, properties with a doc value have it displayed:

```
...
1/3 properties passed, 2 failed
===> Failed test cases:
prop_demo:prop_demo() -> false (only properties that return `true' are seen as passing)
prop_demo:prop_fails() -> false
```

The meta function may be omitted entirely.

Changelog
----

- 0.12.1: fix debug message to match newer rebar3 standards, fixes unintuitive handling of non-compiled directories.
- 0.12.0: drop compile phase since newer rebar3 versions handle all of that for us out of the box. Eliminates old deprecation warning.
- 0.11.1: fix unicode support in meta-functions output
- 0.11.0: add option to set search steps for targeted properties
- 0.10.4: add PropEr FSM template
- 0.10.3: fix the template change, which was apparently rushed.
- 0.10.2: create the regression file path if it doesn't exist; simplify prop_statem template
- 0.10.1: support per-app `erl_opts` values rather than only root config
- 0.10.0: support hooks for app and umbrella level; add per-property opts and docs via meta-functions; remove runtime dependency on PropEr and use the one specified by the app instead
- 0.9.0: support for umbrella projects
- 0.8.0: storage and replay of counterexamples
- 0.7.2: rely on a non-beta PropEr version
- 0.7.1: fix bug regarding lib and priv directories in code path
- 0.7.0: fix bug with include paths of hrl files from parent apps, support counterexamples with --retry
- 0.6.3: fix bug with cover-compiling in rebar 3.2.0 and above again
- 0.6.2: fix bug with cover-compiling in rebar 3.2.0 and above
- 0.6.1: fix bug on option parsing in config files
- 0.5.0: switches to package dependencies
- 0.4.0: switches license to BSD with templates
- 0.3.0: code coverage supported
- 0.2.0: basic functionality
- 0.1.0: first commits

gha_language: Erlang


text:
{{{
  "title": "SafeHaven 5.1.0 Release Notes",
  "date": "06-22-2018",
  "author": "Shi Jin",
  "attachments": [],
  "contentIsHTML": false
}}}

### Release Notes

- SafeHaven Version: 5.1.0
- Release Date: June 22, 2018

### New Features and Enhancements
This is a feature release based on [SafeHaven 5.0.1](SafeHaven5.0.1-Release-Notes.md) with the following new features:
- Add support to use Microsoft Azure as disaster recovery data center. Please refer to the [SafeHaven Azure KBs](../SafeHaven 5 CLC to Azure/master-clc-azure.md) for more detailed documentation on the "DR to Azure" use case.
- Introduce a new job system

It also comes with a number of bug fixes such as
- removing the network isolation checkbox in GUI for Linux PG since there is no such capability
- providing a way to enter new license key in GUI after the old license is expired
- fixing the bug where an AWS PG does not automatically resume sync after a temporary network outage

### Upgrade Path
* Upgrade from SafeHaven-4 to SafeHaven-5 will be a fresh new installation.
* SafeHaven-5.0.1 can be upgraded to 5.1.0 using the GUI.

### SafeHaven Most Recent Releases
Please take a look at the link below to download the latest available release
[Most recent Release updates](../Overview/Most-Recent-SafeHaven-Release-Updates.md)

### Download Links
* [SafeHavenAppliance-5.0.1.ova](https://download.safehaven.ctl.io/SH-5.0.1/SafeHavenAppliance-5.0.1.ova): OVA to be imported to private VMware vSphere or vCloud Director envrionment as templates for SRN/CMS appliances
* [Ubuntu-16.vhdx](https://download.safehaven.ctl.io/SH-5.0.0/Ubuntu-16.vhdx): Hyper-V image for SRN/CMS appliances in a private Hyper-V envrionment
* [Debian Package for CMS/SRN](https://download.safehaven.ctl.io/SH-5.1.0/safehaven-5.1.0.deb): to be used in the cluster installer
* [GUI Package](https://download.safehaven.ctl.io/SH-5.1.0/SafeHavenConsole-5.1.0.zip): zip file containing the JRE, runs on any Windows platform
  * [SafeHavenClient.5.1.0_win64.jar](https://download.safehaven.ctl.io/SH-5.1.0/SafeHavenClient.5.1.0_win64.jar): the Java application that requires an existing 64bit JRE-8 to run on a Windows OS
* Windows Downloads:
  * [Driver Installer](https://download.safehaven.ctl.io/SH-5.1.0/safehaven_windows_driver-5.1.0.exe)
  * [MakeStub.exe](https://download.safehaven.ctl.io/SH-5.1.0/MakeStub-5.1.0.exe)
* [Linux SafeHaven Onboarding Scripts Downloads](https://download.safehaven.ctl.io/SH-5.1.0/safehaven_linux_onboarding_scripts-5.1.0.tar.gz)
* [script to turn a Ubuntu-14 machine into a recovery proxy for Windows servers](https://download.safehaven.ctl.io/SH-5.1.0/makestub_for_windows.sh)

### Documentations
[SafeHaven Inventory Sheet](https://download.safehaven.ctl.io/SH-5-Docs/SafeHaven-Inventory-Sheet-Azure.xlsm)

Please note that you can check the md5 checksum against the file named [MD5SUM-5.1.0.txt](https://download.safehaven.ctl.io/SH-5.1.0/MD5SUM-5.1.0.txt).

repository: AnthonyHakim/PublicKB

path: /Disaster Recovery/SafeHaven 5 General/SafeHaven5.1.0-Release-Notes.md

gha_license_id: NOASSERTION

repo_name: AnthonyHakim/PublicKB


text:
# Laravel DB extension
[![Latest Version on Packagist](https://img.shields.io/packagist/v/mehr-it/lara-db-ext.svg?style=flat-square)](https://packagist.org/packages/mehr-it/lara-db-ext)

This package implements various extensions and improvements for Laravel's database abstraction.

Query builder:

* generateChunked
* insertOnDuplicateKey
* selectPrefixed
* updateWithJoinedData
* whereMultiColumns
* whereMultiIn
* whereNotNested
* automatic whereIn detection
* support for common table expressions (CTE)

Eloquent builder:
* generateChunked
* insertModels
* insertModelsOnDuplicateKey
* updateWithJoinedModels
* withJoined (query relations using joins instead of eager loading)

Eloquent models:
* allow to specify temporary custom date serialization format
* static access to identifiers, such as table name
* helper functions to create SQL queries using model fields
* ignore changed order of key-value-pairs when detecting changes in JSON fields **(since v2.2)**

Connection:
* disable custom SQL mode options

## Installation

To install via composer run:

    composer require mehr-it/lara-db-ext

## Usage

Before the eloquent extensions can be used, the `DbExtensions` trait must be added to all models:

    class User extends Model {
        use DbExtensions;
    }

## ToDo

The readme yet does not cover all functionality.

## updateWithJoinedData()

The `updateWithJoinedData()` method executes an update of multiple database records within a
single query. This is achieved by creating a virtual table with the update data and joining it
with the target table. See following example:

    DB::table('test_table')
        ->updateWithJoinedData([
            [
                'id'   => 1,
                'name' => 'name a updated',
                'x'    => 12,
            ],
            [
                'id'   => 2,
                'name' => 'name b updated',
                'x'    => 22,
            ],
        ]);

This will execute the following SQL statement (with the given data bound to parameters of the join table):

    update
        "test_table"
    inner join (
        (select (?) as id, (?) as "name", (?) as "x")
        union all
        (select (?) as id, (?) as "name", (?) as "x")
    ) as "data"
    on
        "test_table"."id" = "data"."id"
    set
        "test_table"."name" = "data"."name"',
        "test_table"."x" = "data"."x"'

The other parameters allow to customize the join conditions, the list of fields to be updated
and the alias of the data table. See method documentation for details.

## insertModels()
The `insertModels()` method implements mass inserts for eloquent models. It automatically sets
the timestamps and applies any mutations:

    TestModel::insertModels([
        new TestModel([
            'id'   => 1,
            'name' => 'name a updated',
            'x'    => 12,
        ])
        new TestModel([
            'id'   => 2,
            'name' => 'name b updated',
            'x'    => 22,
        ]),
    ]);

By default, the fields to insert are determined by examining the attributes of the first given
model. If you only want to insert specific attributes a custom field list can be specified.
See method documentation for details.

Neither are the passed model instances updated nor are any model events triggered.

## updateWithJoinedModels()

The `updateWithJoinedModels()` method implements the behaviour of `updateWithJoinedData()` for
eloquent models. Instead of a data array, an array of models is expected as first parameter.

    TestModel::updateWithJoinedModels([
        new TestModel([
            'id'   => 1,
            'name' => 'name a updated',
            'x'    => 12,
        ])
        new TestModel([
            'id'   => 2,
            'name' => 'name b updated',
            'x'    => 22,
        ]),
    ]);

Timestamps are updated automatically by this method, but neither are the passed model instances
updated nor are any model events triggered.

Using this method ensures that any mutators and casts are applied to the model data before
passing it to the database.

If the model does not have a primary key or you want to join based on other than primary key
field, custom join conditions can be passed as second parameter.

By default, the fields to update are determined by examining the attributes of the first given
model. If you only want to update specific attributes only or if the first model does not
contain all attributes you wish to update, a custom update field list can be specified as
third parameter.

See method documentation for further details and parameters.

## generateChunked() (query builder and eloquent)

When processing a large amount of data, laravel's `chunked()` method is widely used. But it does not
offer a simple way to pass the data on to another consumer. The `generateChunked()` method can
help here and is available for both, the eloquent and the query builder:

    $generator = User::query()
        ->where('active', true)
        ->generateChunked();

It will return a generator object, which queries data in chunks from the DB and outputs it one record
after another.

By default, data is queried in chunks of 500 records. This can be changed with the first parameter.
The second parameter accepts a callable, which is invoked for each chunk of data, right
before outputting it:

    $generator = User::query()
            ->where('active', true)
            ->generateChunked(100, function($records) {

                return $records->pluck('name');

            });

As shown above, the callback can transform the chunk data in any desired way and it's return value
will be output by the generator. **The only restriction is that it must return an iterable**. It
can even filter out some records, which should not be outputted.

### selectPrefixed

Sometimes you want certain column names to be prepended with a given prefix. Following
example prefixes all returned column names with the `"user_"` prefix:

	DB:table('users')->selectPrefixed(['id', 'name'], 'user_')->get();

	// => [['user_id' => 1, 'user_name' => 'John']]

This becomes really useful when you're using joins on tables with conflicting column names:

	DB:table('users')
		->join('children', 'users.id', '=', 'children.user_id')
		->addSelectPrefixed('users.*', 'user_')
		->addSelectPrefixed('children.*', 'child_')
		->get();

	// => [[ 'user_id' => 1, 'user_name' => 'John', 'child_id' => 12, 'child_name' => 'Maria']]

Without prefixing, the `children` fields would silently overwrite the `users` fields.
As you see it also works using wildcard column selectors. And the best: it does
not produce an extra query to obtain the table structure. In fact it does not depend on
table columns at all:

It can also be used with expressions:

	DB:table('users')->selectPrefixed(new Expression('count(*) as myCount'), 'user_')->get();

	// => [['user_myCount' => 123]]

You can also set multiple prefixes in one call if you omit the prefix parameter and pass an
associative array as first parameter

	DB:table('users')
		->join('children', 'users.id', '=', 'children.user_id')
		->selectPrefixed([
			'user_'  => 'users.*',
			'child_' => ['id', 'name'],
		])
		->get();

### whereNotNested

If you want to negate a nested where clause, the new `whereNotNested` function comes in:

	DB:table('users')
		->whereNotNested(function($query) {
			$query->where('name', 'John');
			$query->where('age', '>', 49);
		})
		->get();

This would produce following query:

	SELECT * FROM users WHERE NOT (first_name = 'John' AND age > 49)

### whereMultiIn

Some SQL dialects allow to compare multiple columns using the `IN` operator. You may use
it using the `whereMultiIn` function:

	DB:table('users')
		->whereMultiIn(['name', 'age'], [
			['John', 38],
			['Ida', 49],
		])
		->get();

This would produce following query:

	SELECT * FROM users WHERE (name, age) IN ( ('John', 38), ('Ida', 49) )

You may even pass a sub select instead of a values array:

	DB:table('users')
		->whereMultiIn(['name', 'age'], function ($query) {
			return $query->select(['parent_name', 'parent_age'])
				->from('children')
				->where('age', '<', 3);
		})
		->get();

### whereMultiColumns

The `whereMultiColumns` accepts multiple columns to be compared:

	DB:table('users')
		->whereMultiColumns(['name', 'age'], ['n', 'a'])
		->get();

This would produce following query:

	SELECT * FROM users WHERE (name = n AND age = a)

Operators are applied to the combination of columns. That's why only `=`, `!=`, `<>` are
supported.

	DB:table('users')
		->whereMultiColumns(['name', 'age'], '!=', ['n', 'a'])
		->get();

This would produce following query:

	SELECT * FROM users WHERE NOT (name = n AND age = a)

### Automatic whereIn detection

Another improvement is that the `where` functions now can be used with an array as
values parameter, so it get's automatically converted to `whereIn`. Of course this
also works with multiple columns:

	DB:table('users')
		->where('name', ['John', 'Ida'])
		->get();

	DB:table('users')
		->where(['name', 'age'], [
			['John', 38],
			['Ida', 49],
		])
		->get();

This works also for the `whereColumn` functions:

	DB:table('users')
		->whereColumn(['name', 'age'], ['n', 'a'])
		->get();

## Timezone handling

Time zone handling in database can be complicated. Laravel passes dates without timezone
information to the database. This behavior is correct as the data is usually stored without
any timezone information. When reading dates, Laravel (Eloquent) interprets dates using the
default application timezone.

But Laravel does not ensure that DateTime parameters are using the application timezone when
passing them to the database. So if you pass a date with a different timezone to database, it
will be interpreted using another timezone on reading.

To ensure all DateTime parameters are converted to application timezone before sending them to
database, this package adds the "adapt_timezone" configuration option for database connections.
If set to true, any DateTime values will be converted to the application timezone before passing
them to the database.

The `AdaptsAttributeTimezone` trait implements the timezone adaption
for Eloquent model attributes.

### Database session timezone
Some databases, such as MySQL use the database session timezone when converting dates to
timestamps (see [MySQL Documentation for details](https://dev.mysql.com/doc/refman/8.0/en/datetime.html)).
For MySQL this does only affect storing dates to TIMESTAMP columns (not for DATETIME columns) and
NOW() and CURTIME() functions. Therefore you should always configure the "timezone" parameter
for connections to the same value as the application timezone!

### Credits

Thanks to Jonas Staudenmeir and contributers of the staudenmeir/laravel-ct package, which the
common table expression support is based on.

repository: mehr-it/lara-db-ext

repo_name: mehr-it/lara-db-ext


text:
The previous sections have primarily focused on targeting single elements where the animation trigger is applied to. If we have an animation set that we want to apply to a group of elements all at once with the same trigger, we can do so using the `query` function. An example of this would be a list that applies the same animation to each list item as it is added to the DOM.

A difference of using `query` compared to targeting a specific element is where the `trigger` is applied to. When using `query`, the animation `trigger` will be applied to the parent, where the `query` function will look for elements that meet the query parameters within the parent (including nested children) which can then be used to execute some animation. Out of the box, query accepts the following tokens:

- `:enter` and `:exit` - returns all elements that are inserted or removed
- `:animating` - returns all elements that are currently animating
- `:self` - returns current element
- `@{animationName}` - returns all elements with a matching animation trigger

You can also query multiple of these properties together by passing in a comma separated string of the tokens to the `query` function. As I mentioned earlier, Angular lets you do with the queried elements essentially the same as when you target specific elements directly. The second parameter for the `query` function accepts either a single `AnimationMetadata` or an array of `AnimationMetadata`, which means that it's possible to orchestrate complex animation sequences or logic within a query function to target multiple elements.

Below is an example of how you would apply a `ShakeAnimation` to all the children elements using the `query` function.

```typescript
const ShakeAnimation = [
  style({ transform: 'rotate(0)' }),
  animate('0.1s', style({ transform: 'rotate(2deg)' })),
  animate('0.1s', style({ transform: 'rotate(-2deg)' })),
  animate('0.1s', style({ transform: 'rotate(2deg)' })),
  animate('0.1s', style({ transform: 'rotate(0)' })),
];

export const QueryShake = [
  trigger('queryShake', [
    transition('* => default', [query('.card', ShakeAnimation)]),
  ]),
];
```

## Limiting the Number of Elements Queried

Piggybacking off the previous section, Angular's animation module also gives you the option to limit the number of elements you want to animate from your query, with the ability to do a negative query: querying n number of items starting with the last element.

This is particularly useful if you want to add some animations only to the first few or the last few of a set of dynamic elements (such as elements that are created with `*ngFor`). Using the previous example's `ShakeAnimation`, we can add an additional `limit` property to the query function passing in the number of elements to be returned.

```typescript
export const QueryShake = [
  trigger('queryShake', [
    transition('* => withLimit', [
      query('.card', ShakeAnimation, {
        limit: 2,
      }),
    ]),
  ]),
];
```

repository: kiforks/angular-animations-explorer

repo_name: kiforks/angular-animations-explorer


text:
# Submission Details
* All of your work must be easily identifiable as your own.
* Ensure your work is **always** your own (or team's).
* Please submit all of your work to the Google Classroom.
  * Each individual assignment will give you information on what to submit.

# Due Dates

The due dates below are in the chart below.  The due times are the same for people in the building and those working from elsewhere.

#### Alternate Assignment Due Dates

Below is a listing of all the due dates for the course.  If you are submitting an alternative assignment to one of the below (excluding the project management section), the due dates are still the same.

#### Responsibility

It is **your** responsibility to hand things in on time, and you will **not** be reminded of the due dates for work.  Please organize yourself appropriately.

# Semester 1
## Sorted chronologically
Anything in **bold** is a culminating activity
| Assignment/Concept                                                          |   Semester 1, Week 1   |   Semester 1, Week 2   |
| --------------------------------------------------------------------------- | ---------------------- | ---------------------- |
| _Pre-Course Work_                                                           | September 17 @ 3:00PM  |  September 14 @ 3:00PM |
| 📘 [Project Planning][PP]                                            | September 22 @ 3:00PM  |  September 17 @ 3:00PM |
| 📙 [Documentation (practice, not assessed)][DOX]                     | September 24 @ 3:00PM  |  September 28 @ 3:00PM |
| 📗 [Emerging Technology][ET]                                         | October 6 @ 3:00PM     |  October 1 @ 3:00PM    |
| 📙 [Data Structures][DS]                                             | October 22 @ 3:00PM    |  October 27 @ 3:00PM   |
| 📗 [Theoretical Computer Science][TCS]                               | November 3 @ 3:00PM    |  November 10 @ 3:00PM  |
| 📙 [Recursion][RECUR]                                                | ---------------------- |  November 22 @ 3:00PM  |
| 📙 [Algorithms][ALGO]                                                | November 19 @ 3:00PM   |  December 6 @ 3:00PM   |
| 📙 [Recursion][RECUR]                                                | December 2 @ 3:00PM    | ---------------------- |
| 📗📙 Final fixes for [ET] and [TCS]                           | December 17 @ 11:59PM  | December 10 @ 11:59PM  |
| 📗📙 Final fixes for [RECUR]                                  | December 17 @ 11:59PM  | December 17 @ 11:59PM  |
| 📗📙 Final fixes for [DS] and [ALGO]                          | January 7 @ 11:59PM    | January 7 @ 11:59PM    |
| 📘 [Development and Production][PDP]                                 | January 12 @ 3:00PM    | January ~~17~~ 18 @ 3:00PM    |
| 📘 [**Close of Project (1 day)**][PC]                                | January 13 @ 11AM      | January ~~18~~ 19 @ 11AM  |
| 📗 [**Sage Contemplation (1 day)**][DSC]                             | January 14 @ 11AM      | January ~~19~~ 28 @ 11AM  |
| 📙 [**Programming Portfolio (2 days)**][PORT]                        | January 24, 25 @ 11AM  | January 20, 21 @ 11AM     |

## Sorted by OLG
| Project Management Assignment                                   |   Semester 1, Week 1   |   Semester 1, Week 2   |
| --------------------------------------------------------------- | ---------------------- | ---------------------- |
| 📙 [Documentation (practice, not assessed)][DOX]         | September 24 @ 3:00PM  |  September 28 @ 3:00PM |
| 📙 [Data Structures][DS]                                 | October 22 @ 3:00PM    |  October 27 @ 3:00PM   |
| 📙 [Recursion][RECUR]                                    | ---------------------- |  November 22 @ 3:00PM  |
| 📙 [Algorithms][ALGO]                                    | November 19 @ 3:00PM   |  December 6 @ 3:00PM   |
| 📙 [Recursion][RECUR]                                    | December 2 @ 3:00PM    | ---------------------- |
| 📙 [**Programming Portfolio (2 days)**][PORT]            | January 24, 25 @ 11AM  | January 20, 21 @ 11AM  |

| Programming Concepts                                            |   Semester 1, Week 1   |   Semester 1, Week 2   |
| --------------------------------------------------------------- | ---------------------- | ---------------------- |
| 📘 [Project Planning][PP]                                | September 22 @ 3:00PM  |  September 17 @ 3:00PM |
| 📘 [Development and Production][PDP]                     | January 12 @ 3:00PM    | January ~~17~~ 18 @ 3:00PM|
| 📘 [**Close of Project (1 day)**][PC]                    | January 13 @ 11AM      | January ~~18~~ 19 @ 11AM|

| Digital Sage Assignment                                         |   Semester 1, Week 1   |   Semester 1, Week 2   |
| --------------------------------------------------------------- | ---------------------- | ---------------------- |
| 📗 [Emerging Technology][ET]                             | October 6 @ 3:00PM     |  October 1 @ 3:00PM    |
| 📗 [Theoretical Computer Science][TCS]                   | November 3 @ 3:00PM    |  November 10 @ 3:00PM  |
| 📗 [**Sage Contemplation (1 day)**][DSC]                 | January 14 @ 11AM      | January ~~19~~ 28 @ 11AM|

[DOX]: /Documentation
[DS]: ./Data-Structures
[ALGO]: ./Algorithms
[PP]: ./Project-Planning
[PDP]: ./Project-Development-and-Production
[PC]: ./Project-Closing
[ET]: ./Emerging-Technology
[TCS]: ./Theoretical-Computer-Science
[RECUR]: ./Recursion
[DSC]: ./Digital-Sage-Contemplation
[PORT]: ./Programming-Portfolio

repository: mrseidel-classes/archives

repo_name: mrseidel-classes/archives


text:
# ispcheck
Python module to check if a domain name or email address belongs to an ISP by looking up a list of ISP domain names.

The list of ISP domains is by no means all inclusive. If you'd like to include an ISP that's not in the system, feel free to send me a line or create a pull request.

### How to use
```
In [1]: from ispcheck import check_domain, check_email

In [2]: is_isp_domain('gmail.es')
Out[2]: True

In [3]<EMAIL_ADDRESS>Out[3]: False
```

repository: pablodiazgutierrez/ispcheck

repo_name: pablodiazgutierrez/ispcheck


text:
# MyLittleShell

Small shell school project. Not meant to be a full shell one day

# HOW TO COMPILE AND RUN

gcc and cmake > 2.8 are required

./configure
./make
./run

Enjoy!

Successfully tested on :

- Fedora 23
    - gcc 5.3.1
    - cmake 3.3.2

- CentOS 7.1
    - gcc 4.8.3
    - cmake 2.8.11
    - glibc 2.17

- CentOS 6.7
    - gcc 4.4.7
    - cmake <IP_ADDRESS>

# Version History

* Version 2.1.5
Code refacto and cleanup

* Version 2.1.4
Added stderr redirection and process waiting for fail / success

* Version 2.1.3
Dynamic pipes and commands realloc

* Version 2.1.2
Fix bugs

* Version 2.1.1
Multiple pipes support

* Version 2.1.0
Added back (one) pipe handling

* Version 2.0.0
Code Refacto
Removed Pipes

* Version 1.3.0
Added pipe

* Version 1.2.0
Added process detach

* Version 1.1.0
Added stdin / stdout redirection

* Version 1.0.0
Initial Release

# 3IS 2015 @ ENSEA

repository: AchilleAsh/mlsh

repo_name: AchilleAsh/mlsh


text:
# create-repository

Easily set up a new github repository. Reads the name/description from the package.json file if it's present. Sets origin upstream if it's not already set.

```
npm install create-repository -g
```

## Usage

`create-repository` will try to read `package.json` and use the name and description properties.

```
$ create-repository
```

You can also pass values for name and description.

```
$ create-repository --name my-new-project --description "That's all I have to say about that"
```

## License

MIT


text:
---
title: android测量心率的实现方法,android测量心率的实现方法
categories:
tags: android测量心率的实现方法
---
1\. Use the camera as has been implemented in some applications already. I've
tried one of these and it wasn't great!

I don't know exactly how this would be implemented but I'm guessing that as
blood is pumped through the body, the skin changes colour slightly. The camera
would be able to detect these changes and work out the pulse (i.e. the time
between each pulse).

2\. Use the microphone. However I'm not sure if it would be sensitive enough.
You'd have to find a way to filter out background noise and pick up just the
required signal.

Using the microphone you'd have to work out how to filter out background noise
signals and detect only the sound of the pulse. The microphone would need to
be held near to the heart or somewhere where the movement of blood made enough
noise to be detected. You'd then need to work out what that noise sounds like
and detect it using some sort of audio signal processing. Then count the time
between each pulse to get the pulse rate. Here's an example of such an app in
action:http://www.bbc.co.uk/news/11145583

3\. Use the motion detection hardware. However I very much doubt this would be
sensitive enough to pick up the movement caused by the beat of the heart!

Apart from that you'd need to have some sort of external sensor - a chest
strap or similar. You can get heart rate monitors which transmit Bluetooth so
one of these might work.

repository: qijianchuan/Que

repo_name: qijianchuan/Que


text:
The network stack implements support for Content-Encodings using
"source streams", which can be composed together and mutate all the incoming
bytes from a URLRequestJob. Currently, the following streams are implemented:

* gzip (handling "deflate" and "gzip" Content-Encodings)
* brotli (handling "br" Content-Encoding)

Source streams conceptually form a chain, with the URLRequestJob as both the
beginning and end of the chain, meaning the URLRequestJob produces raw bytes at
the end and consumes unencoded bytes at the beginning. For example, to support a
hypothetical "Content-Encoding: bar,foo", streams would be arranged like so,
with "X <-- Y" meaning "data flows from Y to X", "X reads data from Y", or
"X is downstream from Y".

  URLRequestJob <-- BarSourceStream <-- FooSourceStream <-- URLRequestJob
                                                       (URLRequestSourceStream)

Here URLRequestJob pulls filtered bytes from its upstream, BarSourceStream,
which pulls filtered bytes from FooSourceStream, which in turn pulls raw bytes
from URLRequestJob. URLRequestSourceStream is the ultimate upstream, which
produces the raw data. Every stream in the chain owns its upstream. In this
case, the ultimate downstream, URLRequestJob, owns its upstream,
BarSourceStream, which in turn owns FooSourceStream. FooSourceStream owns its
upstream, URLRequestSourceStream.

All source streams conform to the following interface (named SourceStream in the
tree):

  int Read(IOBuffer* dest_buffer, size_t buffer_size,
           const OnReadCompleteCallback& callback);

This function can return either synchronously or asynchronously via the supplied
callback. The source stream chain is "pull-based", in that data does not
propagate through the chain until requested by the final consumer of the
filtered data.

repository: chromium/chromium

repo_name: chromium/chromium


text:
# Aimeos Laravel ecommerce package
[![Total Downloads](https://poser.pugx.org/aimeos/aimeos-laravel/d/total.svg)](https://packagist.org/packages/aimeos/aimeos-laravel)
[![Build Status](https://circleci.com/gh/aimeos/aimeos-laravel.svg?style=shield)](https://circleci.com/gh/aimeos/aimeos-laravel)
[![Coverage Status](https://coveralls.io/repos/aimeos/aimeos-laravel/badge.svg?branch=master&service=github)](https://coveralls.io/github/aimeos/aimeos-laravel?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/aimeos/aimeos-laravel/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/aimeos/aimeos-laravel/?branch=master)
[![License](https://poser.pugx.org/aimeos/aimeos/license.svg)](https://packagist.org/packages/aimeos/aimeos)

:star: Star us on GitHub — it motivates us a lot! 😀

[Aimeos](https://aimeos.org/Laravel) is THE professional, full-featured and
ultra fast Laravel ecommerce package!  You can install it in your
existing Laravel application within 5 minutes and can adapt, extend, overwrite
and customize anything to your needs.

[![Aimeos Laravel demo](https://aimeos.org/fileadmin/aimeos.org/images/aimeos-github.png)](https://laravel.demo.aimeos.org/)

## Features

Aimeos is a full-featured e-commerce package:

* Multi vendor, multi channel and multi warehouse
* From one to 1,000,000,000+ items
* Extremly fast down to 20ms
* For multi-tentant e-commerce SaaS solutions with unlimited vendors
* Bundles, vouchers, virtual, configurable, custom and event products
* Subscriptions with recurring payments
* 100+ payment gateways
* Full RTL support (frontend and backend)
* Block/tier pricing out of the box
* Extension for customer/group based prices
* Discount and voucher support
* Flexible basket rule system
* Full-featured admin backend
* Beautiful admin dashboard
* Configurable product data sets
* JSON REST API based on jsonapi.org
* GraphQL API for administration
* Completly modular structure
* Extremely configurable and extensible
* Extension for market places with millions of vendors
* Fully SEO optimized including rich snippets
* Translated to 30+ languages
* AI-based text translation
* Optimized for smart phones and tablets
* Secure and reviewed implementation
* High quality source code

... and [more Aimeos features](https://aimeos.org/features)

Supported languages:

Check out the demos:

* [Aimeos frontend demo](https://laravel.demo.aimeos.org)
* [Aimeos admin demo](https://admin.demo.aimeos.org)

## Alternatives

### Full shop application

If you want to set up a new application or test Aimeos, we recommend the Aimeos
shop distribution. It contains everything for a quick start and you will get a
fully working online shop in less than 5 minutes:

:star: [Aimeos shop distribution](https://github.com/aimeos/aimeos)

### Headless distribution

If you want to build a single page application (SPA) respectively a progressive web
application (PWA) yourself and don't need the Aimeos HTML frontend, then the Aimeos
headless distribution is the right choice:

:star:  [Aimeos headless distribution](https://github.com/aimeos/aimeos-headless)

## Table of content

- [Supported versions](#supported-versions)
- [Requirements](#requirements)
- [Database](#database)
- [Installation](#installation)
- [Authentication](#authentication)
- [Setup](#setup)
- [Test](#test)
- [Hints](#hints)
- [License](#license)
- [Links](#links)

## Supported versions

Currently, the Aimeos Laravel packages **2022.10 and later** are fully supported:

- Stable release: 2023.07 (Laravel 9.x and 10.x)
- old LTS release: 2022.10 (Laravel 9.x and 10.x)

If you want to upgrade between major versions, please have a look into the
[upgrade guide](https://aimeos.org/docs/latest/laravel/setup/#upgrade)!

## Requirements

The Aimeos shop distribution requires:
- Linux/Unix, WAMP/XAMP or MacOS environment
- PHP >= 8.0.11
- MySQL >= 5.7.8, MariaDB >= 10.2.2, PostgreSQL 9.6+, SQL Server 2019+
- Web server (Apache, Nginx or integrated PHP web server for testing)

If required PHP extensions are missing, `composer` will tell you about the missing
dependencies.

If you want to upgrade between major versions, please have a look into the
[upgrade guide](https://aimeos.org/docs/latest/laravel/setup/#upgrade)!

## Database

Make sure that you've **created the database** in advance and added the configuration
to the `.env` file in your application directory. Sometimes, using the .env file makes
problems and you will get exceptions that the connection to the database failed. In that
case, add the database credentials to the **resource/db section of your ./config/shop.php**
file too!

If you don't have at least MySQL 5.7.8 or MariaDB 10.2.2 installed, you will probably get an error like

```
Specified key was too long; max key length is 767 bytes
```

To circumvent this problem, drop the new tables if there have been any created and
change the charset/collation setting in `./config/database.php` to these values before
installing Aimeos again:

```php
'connections' => [
    'mysql' => [
        // ...
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        // ...
    ]
]
```

**Caution:** Also make sure that your MySQL server creates *InnoDB* tables by default as *MyISAM*
tables won't work and will result in an foreign key constraint error!

If you want to use a database server other than MySQL, please have a look into the article about
[supported database servers](https://aimeos.org/docs/latest/infrastructure/databases/)
and their specific configuration. Supported are:

* MySQL, MariaDB (fully)
* PostgreSQL (fully)
* SQL Server (fully)

## Installation

The Aimeos Laravel online shop package is a composer based library. It can be
installed easiest by using [Composer 2.1+](https://getcomposer.org) in the root
directory of your existing Laravel application:

```
wget https://getcomposer.org/download/latest-stable/composer.phar -O composer
php composer require aimeos/aimeos-laravel:~2023.07
```

Then, add these lines to the composer.json of the **Laravel skeleton application**:

```json
    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "aimeos/aimeos-laravel": "~2023.07",
        ...
    },
    "scripts": {
        "post-update-cmd": [
            "@php artisan migrate",
            "@php artisan vendor:publish --tag=public --force",
            "\\Aimeos\\Shop\\Composer::join"
        ],
        ...
    }
```

Afterwards, install the Aimeos shop package using

`composer update`

In the last step you must now execute these artisan commands to get a working
or updated Aimeos installation:

```bash
php artisan vendor:publish --provider="Aimeos\Shop\ShopServiceProvider"
php artisan migrate
php artisan aimeos:setup --option=setup/default/demo:1
```

In a production environment or if you don't want that the demo data gets
installed, leave out the `--option=setup/default/demo:1` option.

## Authentication

You have to set up one of Laravel's authentication starter kits. Laravel Breeze
is the easiest one but you can also use Jetstream.

### Laravel 9 & 10

```bash
composer require laravel/breeze
php artisan breeze:install
npm install && npm run build
```

Laravel Breeze will ask you a few questions, the most important one is the type of stack you
want to use. Select "Blade" (it's the easiest way) and use the default values for the others.

It also adds a route for `/profile` to `./routes/web.php` which may overwrite the
`aimeos_shop_account` route. To avoid an exception about a missing `aimeos_shop_account`
route, change the URL for these lines from `./routes/web.php` file from `/profile` to
`/profile/me`:

```php
Route::middleware('auth')->group(function () {
    Route::get('/profile/me', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile/me', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile/me', [ProfileController::class, 'destroy'])->name('profile.destroy');
});
```

For more information, please follow the Laravel documentation:
* [Laravel 10.x](https://laravel.com/docs/10.x/authentication)
* [Laravel 9.x](https://laravel.com/docs/9.x/authentication)

### Configure authentication

As a last step, you need to extend the `boot()` method of your
`App\Providers\AuthServiceProvider` class and add the lines to define how
authorization for "admin" is checked in `app/Providers/AuthServiceProvider.php`:

```php
    public function boot()
    {
        // Keep the lines before

        \Illuminate\Support\Facades\Gate::define('admin', function($user, $class, $roles) {
            if( isset( $user->superuser ) && $user->superuser ) {
                return true;
            }
            return app( '\Aimeos\Shop\Base\Support' )->checkUserGroup( $user, $roles );
        });
    }
```

### Create account

Test if your authentication setup works before you continue. Create an admin account
for your Laravel application so you will be able to log into the Aimeos admin interface:

```bash
php artisan aimeos:account --super <email>
```

The e-mail address is the user name for login and the account will work for the
frontend too. To protect the new account, the command will ask you for a password.
The same command can create limited accounts by using `--admin`, `--editor` or `--api`
instead of `--super` (access to everything).

## Setup

To reference images correctly, you have to adapt your `.env` file and set the `APP_URL`
to your real URL, e.g.

```
APP_URL=http://<IP_ADDRESS>:8000
```

**Caution:** Make sure, Laravel uses the `file` session driver in your `.env` file!
Otherwise, the shopping basket content won't get stored correctly!

```
SESSION_DRIVER=file
```

If your `./public` directory isn't writable by your web server, you have to create these
directories:

```
mkdir public/aimeos public/vendor
chmod 777 public/aimeos public/vendor
```

In a production environment, you should be more specific about the granted permissions!

## Test

Then, you should be able to call the catalog list page in your browser. For a
quick start, you can use the integrated web server. Simply execute this command
in the base directory of your application:

```
php artisan serve
```

### Frontend

Point your browser to the list page of the shop using:

http://<IP_ADDRESS>:8000/shop

**Note:** Integrating the Aimeos package adds some routes like `/shop` or `/admin` to your
Laravel installation but the **home page stays untouched!** If you want to add Aimeos to
the home page as well, replace the route for "/" in `./routes/web.php` by this line:

```php
Route::group(['middleware' => ['web']], function () {
    Route::get('/', '\Aimeos\Shop\Controller\CatalogController@homeAction')->name('aimeos_home');
});
```

For multi-vendor setups, read the article about [multiple shops](https://aimeos.org/docs/latest/laravel/customize/#multiple-shops).

This will display the Aimeos catalog home component on the home page you you get a
nice looking shop home page which will look like this:

[![Aimeos frontend](https://aimeos.org/fileadmin/aimeos.org/images/aimeos-frontend.jpg?2021.07)](http://<IP_ADDRESS>:8000/shop)

### Backend

If you've still started the internal PHP web server (`php artisan serve`)
you should now open this URL in your browser:

http://<IP_ADDRESS>:8000/admin

Enter the e-mail address and the password of the newly created user and press "Login".
If you don't get redirected to the admin interface (that depends on the authentication
code you've created according to the Laravel documentation), point your browser to the
`/admin` URL again.

**Caution:** Make sure that you aren't already logged in as a non-admin user! In this
case, login won't work because Laravel requires you to log out first.

[![Aimeos backend](https://aimeos.org/fileadmin/aimeos.org/images/aimeos-backend.png)](http://<IP_ADDRESS>:8000/admin)

## Hints

To simplify development, you should configure to use no content cache. You can
do this in the `config/shop.php` file of your Laravel application by adding
these lines at the bottom:

```php
    'madmin' => [
        'cache' => [
            'manager' => [
                'name' => 'None',
            ],
        ],
    ],
```

## License

The Aimeos Laravel package is licensed under the terms of the MIT license and
is available for free.

## Links

* [Web site](https://aimeos.org/Laravel)
* [Documentation](https://aimeos.org/docs/Laravel)
* [Forum](https://aimeos.org/help/laravel-package-f18/)
* [Issue tracker](https://github.com/aimeos/aimeos-laravel/issues)
* [Composer packages](https://packagist.org/packages/aimeos/aimeos-laravel)
* [Source code](https://github.com/aimeos/aimeos-laravel)

repository: aimeos/aimeos-laravel

gha_language: PHP

repo_name: aimeos/aimeos-laravel


text:
# Build **gendev** for FreeBSD

## Install Dependencies

*Note: This guide is tested for FreeBSD 11.1-RELEASE*

From the root shell, run the following commands:

    pkg install git gmake texinfo gcc openjdk-jre-7.151.01,1 wget

Type 'y' and hit enter to proceed with installing the packages.

Alternatively if you prefer to install from ports you can run the following [which will also install a much lower number of dependencies]:

    portmaster -d devel/git devel/gmake print/texinfo lang/gcc java/openjdk7-jre ftp/wget

Type 'y' and hit enter to proceed with installing the packages.

## Build the toolchain

Next, clone the repository and build the toolchain. [This may take some time to complete]

    git clone https://github.com/kubilus1/gendev.git
    cd gendev
    export MAKE=gmake [or 'setenv MAKE gmake' for csh]
    gmake

The built toolchain and SGDK can now be installed.

## Install Gendev

Gendev is installed to $GENDEV [/opt/gendev] by default. While generally not 100% in line with FreeBSD's hier policy, it doesn't cause any interference so I would recommend using this to maintain compatability.
Make sure that this directory is writable by the user.

Now install to $GENDEV

    gmake install

## Build some sample code [or your project!]

You can test your new installation by building some sample code. This is also useful as a project template.

    export GENDEV=/opt/gendev [or 'setenv GENDEV /opt/gendev' for csh]
    cd ~/  (or some other directory)
    cp -r gendev/sgdk/SGDK/sample/cube_flat ./
    cd cube_flat
    gmake -f $GENDEV/sgdk/mkfiles/makefile.gen clean all

If everything builds correctly, you should end up with a file out/rom.bin with a size of 131072 bytes. You can run this file in an emulator of choice to confirm your builds are functioning correctly.


text:
---
layout: postag
title: 'ADV'
shortdef: 'adverb'
---

### Definition

Adverbs are words that typically modify [verbs](VERB) for such categories as time, place, direction or manner. They may also modify [adjectives](ADJ) (as in _claramente falso_ "clearly fake"), other adverbs (as in _muy brevemente_ "very briefly") or even [nouns](NOUN) / [pronouns](PRON) (as in _solamente tú_ "only you").

There is a closed subclass of _pronominal adverbs_ that refer to circumstances in context, rather than naming them directly; similarly to pronouns, these can be categorized as interrogative, relative, demonstrative, etc. To conform to the UD guidelines, pronominal adverbs also get the `ADV` part-of-speech tag but they are differentiated by additional features (see [pronominal type](PronType)).

### Examples

- _muy_ "very"
- _bien_ "well"
- _exactamente_ "exactly"
- _mañana_ "tomorrow"
- _arriba, abajo_ "up, down"
- interrogative or exclamative adverbs: _dónde, cuándo, cómo, por qué_ "where, when, how, why"
- demonstrative adverbs: _aquí, allí, ahora, después_ "here, there, now, then"
- totality adverbs: _siempre_ "always"
- negative adverbs: _nunca_ "never"

branch_name: refs/heads/pages-source


text:
## Running Appium on Mac OS X

Appium on OS X supports iOS and Android testing.

### System setup (iOS)

* Appium requires Mac OS X 10.7 or greater. We recommend OS X 10.10.
* Make sure you have Xcode and the iOS SDK(s) installed. Xcode version 7.1 is
  recommended as earlier versions of Xcode are limited in which versions of iOS
  they can test against. See the next section for more detail.
* You need to authorize use of the iOS Simulator. See [below](#authorizing-ios-on-the-computer).
* If you're on Xcode 7.x, Instruments Without Delay (IWD) does not work. You can
  enable IWD (which will significantly speed up your tests) using
  [this method](/docs/en/advanced-concepts/iwd_xcode7.md)
* If you're on Xcode 6, you need to launch each simulator you intend to use
  with appium in advance, and change the default to actually show the soft
  keyboard if you want sendKeys to work. You can do this by clicking on any
  textfield and hitting command-K until you notice the soft keyboard show up.
* If you're on Xcode 6, you have a feature in Xcode called Devices
  (command-shift-2). You need to make sure that whichever deviceName you choose
  to use with Appium in your capabilities, there is only one of those per sdk
  version. In other words, if you send in a deviceName cap of "iPhone 5s" and
  a platformVersion cap of "8.0", you need to make sure that there is exactly
  one device with the name "iPhone 5s" and the 8.0 sdk in your devices list.
  Otherwise, Appium won't know which one to use.
* In iOS8, devices each have their own setting which enables or disables
  UIAutomation. It lives in a "Developer" view in the Settings app. You need to
  verify that UIAutomaion is enabled in this view before the simulator or
  device can be automated.

### Authorizing iOS on the computer

You need to authorize use of the iOS Simulator by running the `authorize-ios`
binary made available through `npm`. If you installed globally, by running
`npm install -g appium`, use

```
sudo authorize-ios
```

If you installed locally, the binary will be installed within the `node_modules/.bin`
directory, so use

```
sudo node_modules/.bin/authorize-ios

# alternatively
sudo $(npm bin)/authorize-ios
```

If you are running [Appium.app](https://github.com/appium/appium-dot-app), you can
authorize iOS through the GUI.

You need to do this every time you install a new version of Xcode.

### Testing against multiple iOS SDKs

Xcode version 7.1 allows for automatic testing against iOS versions 7.1 and later.

If you're using multiple Xcode versions, you can switch between them using:

    sudo xcode-select --switch <path to required xcode>

### System setup (Android)

Instructions for setting up Android and running tests on Mac OS X are the same as
those on Linux. See the [Android setup docs](/docs/en/appium-setup/android-setup.md).

repository: SrinivasanTarget/appium

gha_language: JavaScript

repo_name: SrinivasanTarget/appium


text:
# 1wire
Monitor and control fridge with 3 Dallas 1 wire temperature sensors and the fridge light

Filename           | Description
------------------ | -------------------------------------------------------
rrdrool-init.sh    | initializes the rrdtool database
templogger.py      | run every minute to control the light & update rrd
temp_sensor.py     | python library to read temp sensors
gpio_sensor.py     |  python library to toggle gpio bits (and read, untested)
crontab-templogger |  example crontab to call templogger.py every minute
code.py            | python web.py app for displaying temperature graphs
rc.local       	   | set up GPIO 22&27 in /sys directory
socketserver.py    | server that returns all temp values and GPIO states
socketclient.py    | client to connect to the above server
read_all.py        | read all temps and return on command line
light_on.py        | manually turn on light
light_off.py       | manually turn off light
controller.py      | latest implementation of control + server
controller_mqtt.py | latest implementation of control + server + cayenne mqtt

Other files are some tests, alternate methods of reading dallas 1-wire temp

Install python-webpy, python-rrdtool, rrdtool using apt.

* GPIO 27 controls the fridge light (+3.3V -> light on)
* GPIO 4 is the dallas 1wire bus
* GPIO 22 may some day be the fridge door open sensor
* GPIO 23 may some day be the freezer door open sensor

### Raspberry Pi wiring
* pin 1, 3V3 for dallas 1wire
* pin 7, GPIO 4 for dallas wire
* pin 9, GND for dallas 1wire
* pin 13, GPIO 27 for fridge light solid state relay
* pin 14, GND for fridge light SSR

There is a pullup resistor between 3V3 and the D1W signal (GPIO 4)

gha_language: Python


text:
# Laravel Query Log Tracker

[![Latest Stable Version](https://poser.pugx.org/ngmy/laravel-query-log-tracker/v/stable)](https://packagist.org/packages/ngmy/laravel-query-log-tracker)
[![Total Downloads](https://poser.pugx.org/ngmy/laravel-query-log-tracker/downloads)](https://packagist.org/packages/ngmy/laravel-query-log-tracker)
[![Latest Unstable Version](https://poser.pugx.org/ngmy/laravel-query-log-tracker/v/unstable)](https://packagist.org/packages/ngmy/laravel-query-log-tracker)
[![License](https://poser.pugx.org/ngmy/laravel-query-log-tracker/license)](https://packagist.org/packages/ngmy/laravel-query-log-tracker)
[![composer.lock](https://poser.pugx.org/ngmy/laravel-query-log-tracker/composerlock)](https://packagist.org/packages/ngmy/laravel-query-log-tracker)<br>
[![PHP CI](https://github.com/ngmy/laravel-query-log-tracker/workflows/PHP%20CI/badge.svg)](https://github.com/ngmy/laravel-query-log-tracker/actions?query=workflow%3A%22PHP+CI%22)
[![Coverage Status](https://coveralls.io/repos/github/ngmy/laravel-query-log-tracker/badge.svg?branch=master)](https://coveralls.io/github/ngmy/laravel-query-log-tracker?branch=master)

The Laravel package which log all executed queries.

## Demo

![Demo](https://ngmy.github.io/laravel-query-log-tracker/demo.gif)

## Features

Laravel Query Log Tracker has the following features:

* Log all executed queries with the following items:
  * SQL with bound parameters
  * Bind parameters
  * Execution time in milliseconds
  * Connection name
* Disable/Enable query logging at runtime
* More configurations:
  * Log level
  * Exclude patterns
  * Channels

## Requirements

Laravel Query Log Tracker has the following requirements:

* PHP >= 7.3
* Laravel >= 6.0

## Installation

Execute the Composer `require` command:
```console
composer require ngmy/laravel-query-log-tracker
```
This will update your `composer.json` file and install this package into the `vendor` directory.

If you don't use package discovery, add the service provider to the `providers` array in the `config/app.php` file:
```php
Ngmy\LaravelQueryLogTracker\QueryLogTrackerServiceProvider::class,
```

If you don't use package discovery, add the alias to the `aliases` array in the `config/app.php` file:
```php
'QueryLogTracker' => Ngmy\LaravelQueryLogTracker\QueryLogTrackerFacade::class,
```

### Publishing Configuration

Execute the Artisan `vendor:publish` command:
```console
php artisan vendor:publish
```
This will publish the configuration file to the `config/ngmy-query-log-tracker.php` file.

You can also use the tag to execute the command:
```console
php artisan vendor:publish --tag=ngmy-query-log-tracker
```

You can also use the service provider to execute the command:
```console
php artisan vendor:publish --provider="Ngmy\LaravelQueryLogTracker\QueryLogTrackerServiceProvider"
```

## Usage

### Log Queries

Execute queries with Laravel. That's all.

### Disable Log

There are two ways to disable log.
```php
QueryLogTracker::beginDisable();
// Execute queries for which you want to disable log
QueryLogTracker::endDisable();
```
```php
QueryLogTracker::disable(function () {
    // Execute queries for which you want to disable log
});
```

repository: ngmy/laravel-query-log-tracker

repo_name: ngmy/laravel-query-log-tracker


text:
---
title: Mapping life satisfaction with Leaflet in R
header: Mapping life satisfaction with Leaflet in R
tags: rstats leaflet mapping
---

It wasn't until after [I went through](https://bsuthersan.github.io/blog/IDACI-map) the whole process of using Leaflet.js that I discovered that there is a [Leaflet package for R!](https://rstudio.github.io/leaflet/). The documentation promised that "this R package makes it easy to integrate and control Leaflet maps in R", and they weren't wrong.

To test it out, I got a hold of some [data on life satisfaction by borough](https://data.london.gov.uk/dataset/subjective-personal-well-being-borough), sourced from the Annual Population Survey (APS) Well-being dataset. The data is organised by borough, and I chose the metric of 'general life satisfaction'. Participants were asked, "Overall, how satisfied are you with your life right now", and asked to nominate a score between 0 ("not at all"), and 10 ("completely"). The shapefiles were sourced from the [London Datastore](https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london).

Here's how the final map ended up:

![alt text](https://raw.githubusercontent.com/bsuthersan/blog/gh-pages/New%20blog%20posts/Screen%20Shot%202018-08-11%20at%2016.30.48.png)

(Looks like Hounslow is the place to be. Lewisham...not so much.)

And here's the full code:

```
library(readxl)
library(tidyverse)
library(skimr)
library(leaflet)
library(sp)
library(rgdal)

##Read in the data

mydata <- read_xls("~/Downloads/personal-well-being-borough.xls", sheet=2)

##Light editing of data

mydata <- mydata[4:35, c(2,8)]
colnames(mydata) <- c("NAME","Life_Satisfaction")
mydata$Life_Satisfaction <- as.numeric(mydata$Life_Satisfaction)

##Read in the spatial data

setwd("~/Downloads/statistical-gis-boundaries-london/ESRI")
boroughs <- readOGR(dsn = ".")

##Merge with boroughs

boroughs <- merge(boroughs, mydata, by = "NAME")

##Transform the data to appropriate coordinate system
boroughs <- spTransform(boroughs, CRS("+init=epsg:4326"))

#Filter out City of London - no data
boroughs <- boroughs[boroughs$NAME!="City of London", ]

##Define the colour palette
pal <- colorNumeric(palette = "Reds", domain = boroughs$Life_Satisfaction)

##Map
leaflet() %>%
  addProviderTiles("CartoDB.Positron", options= providerTileOptions(opacity = 0.99)) %>%
  addPolygons(data = boroughs, stroke = TRUE, color="black", weight=1, fillOpacity = 0.65,
              smoothFactor = 0.5, fillColor = ~pal(Life_Satisfaction)) %>%
  addLegend(pal = pal, values = ~Life_Satisfaction,
            opacity=1, title = "Life Satisfaction")
```

A few things to note:

- The `spTransform` function is used to transform the data to an appropriate projected coordinate system;
- You can't use the tidyverse pipe with sp objects, so I filtered the borough data 'the base way' (using susetting rather than dplyr's 'filter' function)
- Colour is mapped separately, in this case by assigning to `pal`


text:
## Grid View

* **Dokumentasi**
    * [Grid View Dokumentasi](https://api.flutter.dev/flutter/widgets/GridView-class.html)

repository: kickymaulana/mastering-flutter

repo_name: kickymaulana/mastering-flutter


text:
# Presentation Tasklist

###### (Based on provided guidelines)
###### To mark off a task, place an X inside the braces

### Guidelines
- [x] Show a title page with the name of your project and the names of your team members. --pirogoeth
- [ ] Briefly describe the view portion of your team project. --mh1723
      - [ ] Show two or three mockups of how your application will look.  --mh1723
      - [ ] List and briefely describe what Java classes are needed for the view.
- [ ] Briefly describe the model portion of your team project. --gustavomm
      - [ ] Show a list of the kind of information that will be stored in your model.
      - [ ] Provide a list and short descriptions of what Java classes will be needed for the model.
- [ ] Briefly describe the controller portion of your team project. --jaherrera5
      - [ ] Provide a list and short descriptions of what Java classes will be needed for the controller.
      - [ ] Briefly describe two milestones for your team project.
- [ ] Describe an "easy" milestone that you expect to achieve relatively quickly (within the first two weeks). --pirogoeth
- [ ] Describe a "hard" milestone that you hope to achieve as time permits. --pirogoeth

### Additional Breakdowns
- [ ] reveal.js framework --pirogoeth
- [ ] Autodeploy for presentation updates --pirogoeth

branch_name: refs/heads/develop


text:
# Moony-TexturePacker
A simple tool that packs multiple images into single texture atlas for use with Moony-Engine and Moony-SpriteBatch.
![alt text](output.png)

## Introduction
This tool packs image files into larger image maps known as texture atlases. Though this software isn't as sophisticated as others (concave polygon packing) it gets the job done and even has some neat features. It implements a bin-packing algorithm using binary spacial partitioning. It can produce compressed moony texture pack files (`.mtpf`) if you built it with the `USE_ZLIB` flag and linked the zlib library.

This software was designed to be used with either with Moony-SpriteBatch or SFML directly but is easy enough to understand that it can be modified to work within any pipeline.

## How to build
There is only one file that needs to be built and that is TexturePacker.cpp. When building you need to point your compiler to where you installed SFML. If you do not set the `USE_ZLIB` flag you don't need to worry about building and linking zlib.

If you are on windows and use Visual Studio open a `Developer Command Prompt` and enter this:

Change your directory to the source directory
>cd C:/path/to/source

Compile and link the source code
>cl /I C:/path/to/SFML/include C:/path/to/SFML/lib/sfml-system.lib C:/path/to/SFML/lib/sfml-window.lib C:/path/to/SFML/lib/sfml-graphics.lib TexturePacker.cpp

The code should compile and produce TexturePacker.exe.

If you want to build with zlib feature do this:
>cl /D USE_ZLIB /I C:/path/to/SFML/include /I C:/path/to/zlib/include C:/path/to/SFML/lib/sfml-system.lib C:/path/to/SFML/lib/sfml-window.lib C:/path/to/SFML/lib/sfml-graphics.lib C:/path/to/zlib/lib/zlib.lib TexturePacker.cpp

You can also change out the names with debug versions of the libraries if you'd like. Remember that you must put `sfml-system-2.dll`, `sfml-window-2.dll`, `sfml-graphics-2.dll` and `zlib.dll` with the executable in order for it to run. If you want to link statically it's essentially the same thing but using the `/MT` flag, though I haven't tried it..

If you are using GCC or MinGW open a `Command Prompt` or `Terminal` and enter this:

Change your directory to the source directory
>cd C:/path/to/source

Compile and link the source code
>g++ TexturePacker.cpp -I C:/path/to/SFML/include -L C:/path/to/SFML/lib -lsfml-graphics -lsfml-window -lsfml-system -s -O2 -o TexturePacker.exe

And if you want to build with zlib:
>g++ TexturePacker.cpp -D USE_ZLIB -I C:/path/to/SFML/include -I C:/path/to/zlib/include -L C:/path/to/SFML/lib -lsfml-graphics -lsfml-window -lsfml-system -L C:/path/to/zlib/lib -lzlib -s -O2 -o TexturePacker.exe

__Note!__ I don't know if this needs saying but use your own directories. C:/path/to/SFML is not a real directory, just an example. Just in case..

## How to use
Once built you can drop the tool in any directory you want but it is most useful when used from the commandline. When you run it without any args by default it will sniff around it's current directory for any images to pack. Texture pack files are named after the folder they were created in and texture pack images begin with _ta_[`NUMBER`][`FOLDER`].png, for instance: _ta_0Textures.png.

These are the options available by running the tool from the commandline.

Command | Function
---|---
`-h` | Prints a help message with the list of options
`-b` | Tells the tool not to produce seperate atlas image files but rather compress the raw color data and pack everything into the .mtpf texture pack file (requires the building with USE_ZLIB defined)
`-f [PATH]` | Designate a folder you specifically want the tool to work in
`-r` | Recursivley search through all directories under the starting directory. This can be used together with the -f flag
`-d [NUM]` | Produce `[NUM]` # of debug textures.
`-v` | Outputs more messages.

Once the tool is done packing it will produce a .mtpf file that you can parse using the Moony-SpriteBatch TextureAtlas class. If you didn't use the -b flag (or couldn't because you didn't build with USE_ZLIB) you will get an additional .png file(s). These images need to be in the same directory with the .mtpf file because they are referenced inside the file and are necessary for correctly deserializing the texture pack file.

repository: smtgo/Moony-TexturePacker

repo_name: smtgo/Moony-TexturePacker


text:
## Description

 - That's API for the application https://github.com/densch1/numerolog-frontend
 - The API has routes with Basic Authorization for security.

## Technologies

 - JS / NodeJS
 - PUG (templates for email distribution)
 - NPM

## Modules

 - JSON-Server
 - Express
 - Email Templates
 - Nodemailer
 - MomentJS
 - Passport
 - Request

##

license: Unlicense

repository: deniscreamer/numerolog-api-server

repo_name: deniscreamer/numerolog-api-server


text:
---
layout: post
title: "7th Birthday Tournament: Patchwork"
permalink: /news/7th-birthday/
tag: current
---

DDNet is turning seven years old soon and I'm proud to present to you another Summer Tournament. This time we are playing on a map that compiles the best of 7 years of DDNet history! Over 130 parts from 59 maps by 45 different mappers!

[<img class="demo" src="/Patchwork.png" />](//forum.ddnet.tw/viewtopic.php?f=33&t=6944)

Join us on **Saturday** (not Sunday!), **July 11 at 18:00 CEST** (2 hours earlier than our usual time!) to play the brand-new Moderate (★★★★★) map Patchwork by [Cøke](/mappers/C-248-ke/), [Tridemy](/mappers/Tridemy/) & [Qywinc](/mappers/Qywinc) on every official DDNet server around the world. May the first team to finish win!

Discussion on the [forum](//forum.ddnet.tw/viewtopic.php?f=33&t=6944).