text:
---
title: Brooklyn Slow or Unresponsive
---

There are many possible causes for a Brooklyn server becoming slow or unresponsive. This guide
describes some possible reasons, and some commands and tools that can help diagnose the problem.

Possible reasons include:

* CPU is max'ed out
* Memory usage is extremely high
* SSH'ing is very slow due (e.g. due to lack of entropy)
* Out of disk space

See [Brooklyn Requirements]({{book.path.docs}}/ops/requirements.md) for details of server
requirements.

## Machine Diagnostics

The following commands will collect OS-level diagnostics about the machine, and about the Brooklyn
process. The commands below assume use of CentOS 6.x. Minor adjustments may be required for
other platforms.

#### OS and Machine Details

To display system information, run:

```bash
uname -a
```

To show details of the CPU and memory available to the machine, run:

```bash
cat /proc/cpuinfo
cat /proc/meminfo
```

#### User Limits

To display information about user limits, run the command below (while logged in as the same user
who runs Brooklyn):

```bash
ulimit -a
```

If Brooklyn is run as a different user (e.g. with user name "adalovelace"), then instead run:

```bash
ulimit -a -u adalovelace
```

Of particular interest is the limit for "open files".

See [Increase System Resource Limits]({{book.path.docs}}/ops/troubleshooting/increase-system-resource-limits.md)
for more information.

#### Disk Space

The command below will list the disk size for each partition, including the amount used and
available. If the Brooklyn base directory, persistence directory or logging directory are close
to 0% available, this can cause serious problems:

```bash
df -h
```

#### CPU and Memory Usage

To view the CPU and memory usage of all processes, and of the machine as a whole, one can use the
`top` command. This runs interactively, updating every few seconds. To collect the output once
(e.g. to share diagnostic information in a bug report), run:

```bash
top -n 1 -b > top.txt
```

#### File and Network Usage

To count the number of open files for the Brooklyn process (which includes open socket connections):

```bash
BROOKLYN_HOME=/home/users/brooklyn/apache-brooklyn-0.9.0-bin
BROOKLYN_PID=$(cat $BROOKLYN_HOME/pid_java)
lsof -p $BROOKLYN_PID | wc -l
```

To count (or view the number of "established" internet connections, run:

```bash
netstat -an | grep ESTABLISHED | wc -l
```

#### Linux Kernel Entropy

A lack of entropy can cause random number generation to be extremely slow. This can cause
tasks like ssh to also be extremely slow. See
[Linux kernel entropy]({{book.path.docs}}/ops/troubleshooting/increase-entropy.md)
for details of how to work around this.

## Process Diagnostics

#### Thread and Memory Usage

To get memory and thread usage for the Brooklyn (Java) process, two useful tools are `jstack`
and `jmap`. These require the "development kit" to also be installed
(e.g. `yum install java-1.8.0-openjdk-devel`). Some useful commands are shown below:

```bash
BROOKLYN_HOME=/home/users/brooklyn/apache-brooklyn-0.9.0-bin
BROOKLYN_PID=$(cat $BROOKLYN_HOME/pid_java)

jstack $BROOKLYN_PID
jmap -histo:live $BROOKLYN_PID
jmap -heap $BROOKLYN_PID
```

#### Runnable Threads

The [jstack-active](https://github.com/apache/brooklyn-dist/blob/master/scripts/jstack-active.sh)
script is a convenient light-weight way to quickly see which threads of a running Brooklyn
server are attempting to consume the CPU. It filters the output of `jstack`, to show only the
"really-runnable" threads (as opposed to those that are blocked).

```bash
BROOKLYN_HOME=/home/users/brooklyn/apache-brooklyn-0.9.0-bin
BROOKLYN_PID=$(cat $BROOKLYN_HOME/pid_java)

curl -O https://raw.githubusercontent.com/apache/brooklyn-dist/master/scripts/jstack-active.sh

jstack-active $BROOKLYN_PID
```

#### Profiling

If an in-depth investigation of the CPU usage (and/or object creation) of a Brooklyn Server is
requiring, there are many profiling tools designed specifically for this purpose. These generally
require that the process be launched in such a way that a profiler can attach, which may not be
appropriate for a production server.

#### Remote Debugging

If the Brooklyn Server was originally run to allow a remote debugger to connect (strongly
discouraged in production!), then this provides a convenient way to investigate why Brooklyn
is being slow or unresponsive. See the Debugging Tips in the
tip [Debugging Remote Brooklyn]({{book.path.docs}}/dev/tips/debugging-remote-brooklyn.md)
and the [IDE docs]({{book.path.docs}}/dev/env/ide/index.md) for more information.

## Log Files

Apache Brooklyn will by default create brooklyn.info.log and brooklyn.debug.log files. See the
[Logging]({{book.path.docs}}/ops/logging.md) docs for more information.

The following are useful log messages to search for (e.g. using `grep`). Note the wording of
these messages (or their very presence) may change in future version of Brooklyn.

#### Normal Logging

The lines below are commonly logged, and can be useful to search for when finding the start of a section of logging.

```text
2016-05-30 17:05:51,458 INFO  o.a.b.l.BrooklynWebServer [main]: Started Brooklyn console at http://<IP_ADDRESS>:8081/, running classpath://brooklyn.war
2016-05-30 17:06:04,098 INFO  o.a.b.c.m.h.HighAvailabilityManagerImpl [main]: Management node tF3GPvQ5 running as HA MASTER autodetected
2016-05-30 17:06:08,982 INFO  o.a.b.c.m.r.InitialFullRebindIteration [brooklyn-execmanager-rvpnFTeL-0]: Rebinding from /home/compose/compose-amp-state/brooklyn-persisted-state/data for master rvpnFTeL...
2016-05-30 17:06:11,105 INFO  o.a.b.c.m.r.RebindIteration [brooklyn-execmanager-rvpnFTeL-0]: Rebind complete (MASTER) in 2s: 19 apps, 54 entities, 50 locations, 46 policies, 704 enrichers, 0 feeds, 160 catalog items
```

#### Memory Usage

The debug log includes (every minute) a log statement about the memory usage and task activity. For example:

```text
2016-05-27 12:20:19,395 DEBUG o.a.b.c.m.i.BrooklynGarbageCollector [brooklyn-gc]: brooklyn gc (before) - using 328 MB / 496 MB memory (5.58 kB soft); 69 threads; storage: {datagrid={size=7, createCount=7}, refsMapSize=0, listsMapSize=0}; tasks: 10 active, 33 unfinished; 78 remembered, 1696906 total submitted)
2016-05-27 12:20:19,395 DEBUG o.a.b.c.m.i.BrooklynGarbageCollector [brooklyn-gc]: brooklyn gc (after) - using 328 MB / 496 MB memory (5.58 kB soft); 69 threads; storage: {datagrid={size=7, createCount=7}, refsMapSize=0, listsMapSize=0}; tasks: 10 active, 33 unfinished; 78 remembered, 1696906 total submitted)
```

These can be extremely useful if investigating a memory or thread leak, or to determine whether a
surprisingly high number of tasks are being executed.

#### Subscriptions

One source of high CPU in Brooklyn is when a subscription (e.g. for a policy or enricher) is being
triggered many times (i.e. handling many events). A log message like that below will be logged on
every 1000 events handled by a given single subscription.

```text
2016-05-30 17:29:09,125 DEBUG o.a.b.c.m.i.LocalSubscriptionManager [brooklyn-execmanager-rvpnFTeL-8]: 1000 events for subscriber Subscription[SCFnav9g;CanopyComposeApp{id=gIeTwhU2}@gIeTwhU2:webapp.url]
```

If a subscription is handling a huge number of events, there are a couple of common reasons:
* first, it could be subscribing to too much activity - e.g. a wildcard subscription for all
  events from all entities.
* second it could be an infinite loop (e.g. where an enricher responds to a sensor-changed event
  by setting that same sensor, thus triggering another sensor-changed event).

#### User Activity

All activity triggered by the REST API or web-console will be logged. Some examples are shown below:

```text
2016-05-19 17:52:30,150 INFO  o.a.b.r.r.ApplicationResource [brooklyn-jetty-server-8081-qtp1058726153-17473]: Launched from YAML: name: My Example App
location: aws-ec2:us-east-1
services:
- type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer

2016-05-30 14:46:19,516 DEBUG brooklyn.REST [brooklyn-jetty-server-8081-qtp1104967201-20881]: Request Tisj14 starting: POST /v1/applications/NiBy0v8Q/entities/NiBy0v8Q/expunge from <IP_ADDRESS>
```

#### Entity Activity

If investigating the behaviour of a particular entity (e.g. on failure), it can be very useful to
`grep` the info and debug log for the entity's id. For a software process, the debug log will
include the stdout and stderr of all the commands executed by that entity.

It can also be very useful to search for all effector invocations, to see where the behaviour
has been triggered:

```text
2016-05-27 12:45:43,529 DEBUG o.a.b.c.m.i.EffectorUtils [brooklyn-execmanager-gvP7MuZF-14364]: Invoking effector stop on TomcatServerImpl{id=mPujYmPd}
```

repository: iuliana/brooklyn-docs

repo_name: iuliana/brooklyn-docs


text:
---
layout: default
---

# 1998-03-30 - Re: Lamers- mudt die

## Header Data

From: StanSquncr<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: f04cdb355018545b28a54bbf1eca2397eb63983ee368abc0519b3ce6e307c1cb

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1998-03-30 16:09:14 UTC

Raw Date: Mon, 30 Mar 1998 08:09:14 -0800 (PST)

## Raw message

```
{% raw  %}From: StanSquncr<EMAIL_ADDRESS>Date: Mon, 30 Mar 1998 08:09:14 -0800 (PST)
To<EMAIL_ADDRESS>Subject: Re: Lamers- mudt die
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

In a message dated 98-03-30 09:38:22 EST<EMAIL_ADDRESS>writes:

<< In<EMAIL_ADDRESS>on 03/30/98
    at 05:57 PM<EMAIL_ADDRESS>said:

 >Hey you  ;-((

 <sigh> Parents really need to keep their children away from the keyboard. >>

<sigh> William, I think that WAS the parent!  Children really need to keep
their parents away from the keyboard.

Stan

{% endraw %}
```

## Thread

+ Return to [March 1998](/archive/1998/03)

+ Return to "[StanSquncr <StanSquncr@aol.com>](/authors/stansquncr_stansquncr_at_aol_com_)"

+ 1998-03-30 (Mon, 30 Mar 1998 08:09:14 -0800 (PST)) - Re: Lamers- mudt die - _StanSquncr<EMAIL_ADDRESS>

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
 Hey 👋, I'm Tank!

  <img align="left" alt="Tank's Daily Blog" width="24px"<EMAIL_ADDRESS>/>

  <img align="left" alt="Tank's LinkdeIn" width="24px"<EMAIL_ADDRESS>/>

  <img align="left" alt="Tank's github" width="24px"<EMAIL_ADDRESS>/>

  <img align="left" alt="Tank's Facebook" width="24px"<EMAIL_ADDRESS>/>

A **PhD Student of University of Chinese Academy of Sciences** 🚀 from Beijing, China

---
I'm a PhD Student of [University of Chinese Academy of Sciences](https://english.ucas.ac.cn/) majoring in Bioinformatics and Biostatistics who loves computer programming such as C(++), Java, Python and R, where I work to help labmate members learn and use programming to do better work in less time, with less friction, and (perhaps) more joy.

I love working with data scientists and statistician and Bio scientists who is skilled in quantitatice genetics across the spectrum- from beginners to advanced hackers- and particularly enjoy using software tools to create educational materials that enlighten and engage learners. Topics I teach range from python programming to machine learning. My teaching materials have been used by [Student of Chung-Ang University, Seoul 06974, Korea](https://neweng.cau.ac.kr/index.do), [UCAS](https://english.ucas.ac.cn/index.php/admission/graduate), [Innovation Class@University of Beijing Forestry](http://jwc.bjfu.edu.cn/lxsybzl/index.html), and now [IGDB Bailab Root Microbiome](http://bailab.genetics.ac.cn/index.html)

📚📚 teaching some courses:
  - 🤔 course: Multivariate Statistical Analysis
    institution: University of Chinese Academy of Sciences
    year: 2018 Fall
  - 🤔 course: Data Mining I
    institution: University of Chinese Academy of Sciences
    year: 2019 Spring
  - 🤔 course:  Elements in Statistics
    institution: IGDB
    year: 2019 Spring
  - 🤔 course: Time Series
    institution: IGDB
    year: 2019 Spring
  - 🤔 course: Artificial Intelligence & Deep Learning
    institution: IGDB
    year: 2019 Fall
  - 🤔 course: Mathematical Statistics II
    institution: IGDB
    year: 2019 Fall

🌱🌱 I’m currently pursuing deeplearning applicaiton into metagenome

💬💬 [Email to me if any<EMAIL_ADDRESS>

If you find my work good, consider giving it a (͡ ° ͜  ͡ °) ☆*:.¨☆´;.☆ or ℱᵒᒻᒻᵒ꒳ ◡̈⃝ It helps me stay on track and be motivated.

PhD Student @ Data Miner & Coder at University of Chinese Academy of Sciences

  Welcome to Comment on My Daily Blog

repository: TankMermaid/TankMermaid

branch_name: refs/heads/main

repo_name: TankMermaid/TankMermaid


text:
# Modified

1. 通过 option 设置 log 的行为（flag 设置方式保留）

```go
    gglog.WithOptions(gglog.OptLogDir(".//log_dir/"), gglog.OptToStderr())
    gglog.Debug("some thing")
    gglog.Flush()
```

2. log 写入文件时，写入单独的文件
3. 添加 log threshold 小于等于 threshold 的日志不输出，可通过 http 设置
4. flushInterval 改为 5 秒
5. MaxSize 默认修改为 128M

TODO:
1. 可配置按文件大小或者日期分隔

# 例子

设置 logthreshold

```go
gglog.WithOptions(gglog.OptLogThreshold("DEBUG")) // INFO WARNING ERROR FATAL
gglog.WithOptions(gglog.OptLogThreshold("0"))     // 0		1     2     3
gglog.Debug("debug debug debug")
gglog.Info("info info info")

// output
20181128 16:39:29.310600 main.go:11 I] info info info
```

# glog

Leveled execution logs for Go.

This is an efficient pure Go implementation of leveled logs in the
manner of the open source C++ package
https://github.com/google/glog

By binding methods to booleans it is possible to use the log package
without paying the expense of evaluating the arguments to the log.
Through the -vmodule flag, the package also provides fine-grained
control over logging at the file level.

The comment from glog.go introduces the ideas:

    Package glog implements logging analogous to the Google-internal
    C++ INFO/ERROR/V setup.  It provides functions Info, Warning,
    Error, Fatal, plus formatting variants such as Infof. It
    also provides V-style logging controlled by the -v and
    -vmodule=file=2 flags.

    Basic examples:

    	glog.Info("Prepare to repel boarders")

    	glog.Fatalf("Initialization failed: %s", err)

    See the documentation for the V function for an explanation
    of these examples:

    	if glog.V(2) {
    		glog.Info("Starting transaction...")
    	}

    	glog.V(2).Infoln("Processed", nItems, "elements")

The repository contains an open source version of the log package
used inside Google. The master copy of the source lives inside
Google, not here. The code in this repo is for export only and is not itself
under development. Feature requests will be ignored.

Send bug reports to<EMAIL_ADDRESS>


text:
---
description: How to create different types of rooms from Rocket.Chat Mobile app.
---

# Rooms on Rocket.Chat Mobile

### Channel

To create a [**Channel**](../user-guides/rooms/channels/) on Rocket.Chat mobile app,

* Tap on  icon on the app bar.
* Tap **Channel**.
* Select the users you want to be part of your channel, or search for users you wish to add.
* Enter **Channel Name**.
* Turn on **Privacy** If you want only invited users to access this channel.
* Turn on the **Read Only** to let authorized users write messages while unauthorized users can only read.
* Turn on or off the **Broadcast** switch.
* Tap on **Create Channel.**

### Team

To create a [**Team**](../../guides/user-guides/rooms/teams/) on Rocket.Chat mobile app,

* Tap on  icon on the app bar.
* Tap **Team.**
* Select the users you want to be part of your team, or search for users you wish to add.
* Enter **Team Name**.
* Turn on **Privacy** If you want only invited users to access this team.
* Turn on or off the **Broadcast** switch.
* Tap **Create** **Team**.

### **Direct Message**

To create a [**Direct Message**](../user-guides/rooms/direct-messages/) on Rocket.Chat mobile app,

* Tap on  icon on the app bar.
* Tap on **Direct Message**.
* Select/Search the users you want to start a direct message with.
* Tap **Create** in the top right corner to finalize the creation.

### Discussion

To create a [**Discussion**](../user-guides/rooms/discussions/) on Rocket.Chat mobile app,

* Tap on  icon on the app bar.
* Select the name of the **parent channel or group** to which this discussion is linked.
* Give a meaningful name for your discussion
* Tap the **Invite users** to add users.
* Tap **Create.**

repository: sebudot/docs

repo_name: sebudot/docs


text:
---
title: Support public chain Bitcoin Cash
authors:
  - name: Team Mixin
tags: [Bitcoin Cash]
---

Mixin Network now supports the 4th public chain Bitcoin Cash, the ticker is BCH, the official website is <https://bitcoincash.org/>.

Bitcoin Cash brings sound money to the world, fulfilling the original promise of Bitcoin as "Peer-to-Peer Electronic Cash". Merchants and users are empowered with low fees and reliable confirmations. The future shines brightly with unrestricted growth, global adoption, permissionless innovation, and decentralized development.

```json
{
  asset_id: "fd11b6e3-0b87-41f1-a41f-f0e9b49e5bf0",
  chain_id: "fd11b6e3-0b87-41f1-a41f-f0e9b49e5bf0",
  symbol: "BCH",
  name: "Bitcoin Cash",
  icon_url: "https://mixin-images.zeromesh.net/tqt14x8iwkiCR_vIKIw6gAAVO8XpZH7ku7ZJYB5ArMRA6grN9M1oCI7kKt2QqBODJwr17sZxDCDTjXHOgIixzv6X=s128";;,
  asset_key: "fd11b6e3-0b87-41f1-a41f-f0e9b49e5bf0",
  reserve: "0",
  confirmations: 24,
}
```

gha_language: JavaScript


text:
Checks for if and unless statements used as modifiers of other if or
unless statements.

# Examples

```ruby

# bad
tired? ? 'stop' : 'go faster' if running?

# bad
if tired?
  "please stop"
else
  "keep going"
end if running?

# good
if running?
  tired? ? 'stop' : 'go faster'
end
```

[Source](http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/IfUnlessModifierOfIfUnless)

repository: codacy/codacy-rubocop

gha_language: Ruby

gha_license_id: NOASSERTION

repo_name: codacy/codacy-rubocop


text:
# Skills, Tactics, Plays - 2 {#t20163}

# Questions about Plays?

-   Last meeting was pretty dense
    -   We *NEED* to have 1 on 1 time with each of you, so it is *your* responsibility to wave us over if you're stuck!
-   Topics Covered:
    -   Python
    -   State Machines
    -   Play/Skill/Tactic Structure
-   And today, we're going into…

## Additional Information

-   See the previous slide deck and docs for more information, they should be a pretty comprehensive overview of our play system.

# Subbehaviors!

-   A Behavior is a generic name for any skill, play, or tactic.
-   Last meeting we learned about Plays/Skills/Tactics
    -   How do we put them together?
-   Subbehaviors allow you to reuse our behaviors in many plays.
    -   Example: We have *one* move play, used by kicker tactics, passing tactics, goalie, etc.

## Examples of Subbehaviors

-   Offense Play contains Passing Tactics, and Move Skills
-   Passing Tactic Contains Move and Kick Skills

## *Behavior* Tree!

```text
Basic122::running
    Mark::running[robot=4]
        move(0.767296, 6.51286)
        endVelocity(0, 0)
        face(0.160718, 9.15305)
    PivotKick::capturing
        Capture::course_approach[robot=2]
            face(0.160718, 9.15305)
            avoidBall(-1)
            move(0.176939, 9.114)
            endVelocity(0, 0)
    Mark::running[robot=1]
        move(-0.829012, 6.03814)
        endVelocity(0, 0)
        face(0.160718, 9.15305)
```

### Details

-   Here we have a tree of all the behaviors running
-   We have a basic122 play running
-   It is running 2 Marks, and a PivotKick in this frame
-   The marks are directly running robot commands, like move, and face.
-   The PivotKick is running a capture skill, which is running robot commands, like face, move, etc.

## *Behavior* Tree! (cont.)

```text
Basic122::running
    Defense::defending
        SubmissiveDefender::marking
            Move::completed[robot=5]
                face(0.160718, 9.15305)
        SubmissiveDefender::marking
            Move::completed[robot=3]
                face(0.160718, 9.15305)
        SubmissiveGoalie::block
            Move::running[robot=0]
                face(0.160718, 9.15305)
                move(0.290916, 0.14)
                endVelocity(0, 0)
```

### Details

-   Pretty much same thing here
-   We've got a Defense tactic running, with SubmissiveDefender and Goalie Skills
-   These skills actually run robot commands.

# How do I use subbehaviors?

## Adding Subbehaviors

```python
  self.add_subbehavior(skill_object,
                       "Name of Subbehavior",
                       required=False or True
                       priority=10) # A higher number is higher priority
```

### Details

-   For more docs on this entire section see [this link.](https://robojackets.github.io/robocup-software/classgameplay_1_1single__robot__composite__behavior_1_1_single_robot_composite_behavior.html)
-   These subbehaviors show up in the behavior tree when you run your program.
-   This can be extremely useful when debugging state transitions or subbehavior assignments.

## Removing Subbehaviors

```python
self.remove_subbehavior('string name')

self.remove_all_subbehaviors()
```

## Getting Subbehavior Plays

```python
a_subbheavior = self.subbehavior_with_name('string name')
```

# Real Examples

## CoordinatedPass Tactic

```python
  def on_enter_running(self):
      receiver = skills.pass_receive.PassReceive()
      receiver.receive_point = self.receive_point
      self.add_subbehavior(receiver,
                           'receiver',
                           required=self.receiver_required)

  def on_exit_running(self):
      self.remove_subbehavior('receiver')
```

## Line Up Tactic

-   First State Machine is set up, then:

```python
  # Triggered whenever the line changes
  self.remove_all_subbehaviors()
  for i in range(6):
      pt = self._line.get_pt(0) + (self.diff * float(i))
      self.add_subbehavior(
          skills.move.Move(pt),
          name="robot" + str(i),
          required=False,
          priority=6 - i)
```

```python
  def execute_running(self):
      for i in range(6):
          pt = self._line.get_pt(0) + (self.diff * float(i))
          self.subbehavior_with_name("robot" + str(i)).pos = pt
```

# RoboCup Pro Tip

-   Find some code doing something like what you want
-   Tweak it until it works
-   It's less effective than working everything out, but it's great for beginners!

# How do I get MY Robot?!?

## Dynamic Assignment

-   Our role assignment system picks the best robot for the task
-   You define your constraints, and we'll give you a robot if we can!
-   It's also some black magic…

## But I want Robot X!

-   Override Role Requirements to add your constraints!
-   This next section is Extra Credit…
    -   And it's a massive oversimplification
    -   See `role_assignment.py` for more information.

### Get the closest robot

```python
  # From Move
  def role_requirements(self):
      reqs = super().role_requirements()
      # Destination Shape is used for distances to points or segments
      reqs.destination_shape = self.pos
      return reqs
```

### Get the robot with all the hardware

```python
  def role_requirements(self):
      reqs = super().role_requirements()
      reqs.require_kicking = True
      # try to be near the ball
      if main.ball().valid:
          reqs.destination_shape = main.ball().pos
      return reqs
```

### I really, really, want MY Robot!

```python
  # From Goalie
  def role_requirements(self):
      reqs = super().role_requirements()

      # This iteration is needed if we have
      # subbehaviors we want to have applied as well.
      for req in role_assignment \
          .iterate_role_requirements_tree_leaves(reqs):

          req.required_shell_id \
              = self.shell_id if self.shell_id != None else -1
      return reqs
```

# Assignment

-   Create a binary clock play
-   Display the current minute in binary on the field
    -   Use a robot to represent a 1, and lack of a robot to represent a 0
-   Starter code is in `soccer/gameplay/plays/skel/binary_clock.py`.
-   Move it to `soccer/gameplay/plays/training` to begin.

repository: RoboJackets/robocup-software

repo_name: RoboJackets/robocup-software


text:
---
id: 107
title: The best feature of ios safari 8
date: 2014-09-18T13:42:56+00:00
author: dmarges
layout: post
guid: http://www.donmarges.io/?p=107
permalink: /the-best-feature-of-ios-safari-8/
categories:
  - WebGL
tags:
  - apple
  - ios 8
  - safari 8
  - webgl
---
[](http://www.donmarges.io/wp-content/uploads/2014/09/WebGL_500_151_75.png) Safari 8 for iOS will now have WebGL enabled!!! As a 3D Graphics geek this is the thing coming from the newest Apple updates that I’m most excited for. The guys at Sencha have a great and in-depth article about all of the new features that Safari 8 will have so I will just send you guys that way 😉

Apple Shows Love for HTML5 with iOS 8


text:
# Ordered Jobs

Imagine we have a list of jobs, each represented by a character. Because certain jobs must be done before others, a job may have a dependency on another job. For example, a may depend on b, meaning the final sequence of jobs should place b before a. If a has no dependency, the position of a in the final sequence does not matter.

The goal of this challenge is to parse the job dependency structure and produce a sequence of jobs in the order that observes their dependency chain.

Author: Rocio Membrilla

repository: ixesta/JavaScript-Coding-Challenge

repo_name: ixesta/JavaScript-Coding-Challenge


text:
# Spicy Shrimp Tacos with Garlic Cilantro Lime Slaw

## Overview

- Yield:
- Prep Time:
- Cook Time:
- Total Time:

## Ingredients

## Method

## References and Acknowledgments

[Spicy Shrimp Tacos with Garlic Cilantro Lime Slaw](https://pinchofyum.com/spicy-shrimp-tacos-with-garlic-cilantro-lime-slaw)


text:
[![Build](https://github.com/jthomperoo/predictive-horizontal-pod-autoscaler/workflows/main/badge.svg)](https://github.com/jthomperoo/predictive-horizontal-pod-autoscaler/actions)
[![codecov](https://codecov.io/gh/jthomperoo/predictive-horizontal-pod-autoscaler/branch/master/graph/badge.svg)](https://codecov.io/gh/jthomperoo/predictive-horizontal-pod-autoscaler)
[![go.dev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/jthomperoo/predictive-horizontal-pod-autoscaler)
[![Go Report Card](https://goreportcard.com/badge/github.com/jthomperoo/predictive-horizontal-pod-autoscaler)](https://goreportcard.com/report/github.com/jthomperoo/predictive-horizontal-pod-autoscaler)
[![Documentation Status](https://readthedocs.org/projects/predictive-horizontal-pod-autoscaler/badge/?version=latest)](https://predictive-horizontal-pod-autoscaler.readthedocs.io/en/latest)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
# Predictive Horizontal Pod Autoscaler

# What is it?

This is a [Custom Pod Autoscaler](https://www.github.com/jthomperoo/custom-pod-autoscaler);
aiming to have identical functionality to the Horizontal Pod Autoscaler, however with added
predictive elements using statistical models.

This uses the
[Horizontal Pod Autoscaler reimplemented as a Custom Pod Autoscaler](https://www.github.com/jthomperoo/horizontal-pod-autoscaler)
extensively to provide most functionality for the Horizontal Pod Autoscaler parts.

# Why would I use it?

This autoscaler lets you choose models and fine tune them in order to predict how many replicas a
resource should have, preempting events such as regular, repeated high load.

# What systems would need it?

Systems that have predictable changes in load, for example; if over a 24 hour period the load on a
resource is generally higher between 3pm and 5pm - with enough data and use of correct models and
tuning the autoscaler could predict this and preempt the load, increasing responsiveness of the
system to changes in load. This could be useful for handling different userbases across different
timezones, or understanding that if a load is rapidly increasing we can prempt the load by
predicting replica counts.

# How does it work?

This project works by calculating the number of replicas a resource should have, then storing
these values and using statistical models against them to produce predictions for the future.
These predictions are compared and can be used instead of the raw replica count calculated by
the Horizontal Pod Autoscaler logic.


text:
# jMonkeyEngine 3 with JRuby

This is an example/template for game programming using [jMonkeyEngine 3][1]
with [JRuby][2]. Including multi-platform packaging using [Rawr][3].

[1]: http://jmonkeyengine.com/
[2]: http://www.jruby.org/
[3]: http://rawr.rubyforge.org/

## Getting started:

Take a look at `src/ruby/main.rb`. It's a port of
[the "Hello SimpleApplication" tutorial on the jme wiki](http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication)
with additional code to illustrate using your own ruby and java classes alongside each other.

### Running the sample code:

The sample code draws a blue box, lets you walk around with the wasd keys,
look around with the mouse, and hit `ESC` to exit. It also prints some
messages to the console to illustrate calling your own custom ruby and java
classes.

Make sure you have [JRuby][1] and [Rawr][3]. I'll leave the specifics up to you,
but I highly recommend using [rvm](https://rvm.beginrescueend.com/).

To run the code directly with jruby:

    rake rawr:compile
    jruby src/ruby/main.rb

*You only need the compile step if you have java code under `src/java` (which we do).*

Or to package and run the app as a jar:

    rake rawr:jar
    java -jar package/jar/jme3-jruby-template.jar

Or to package and run the app as an OS X .app:

    rake rawr:bundle:app
    open package/osx/jme3-jruby-template.app

Or to package and run the app as a Windows .exe:

    rake rawr:bundle:exe
    package/windows/jme3-jruby-template.exe

## Important files/directories:

    jme3-jruby-template
    |
    |__lib
    |  |
    |  |__java # => Third-party java libraries (jars)
    |  |
    |  |__ruby # => Third-party ruby libraries (unpacked gems)
    |
    |__package
    |  |
    |  |__classes
    |     |
    |     |__java # => *.class files compiled from the *.java files under src/java
    |     |
    |     |__ruby # => *.class files compiled from the *.rb files under src/ruby
    |
    |__src
       |
       |__java # => Your own java source code lives here
       |
       |__ruby # => Your own ruby source code lives here
          |
          |__main.rb # => The file that gets executed on startup

## TODO:

* using gems...


text:
# Security Policy

## Supported Versions

This repositoriy is officially unsuported.  However, community support is encouraged by contributors.

## Reporting a Vulnerability

Open an [issue](https://github.com/braxtonj/wix_logdna_adapter/issues) for the community.


text:
# Mock Premier League
[![Build Status](https://travis-ci.org/Baystef/mock-premier-league.svg?branch=develop)](https://travis-ci.org/Baystef/mock-premier-league)

 API that serves the latest score of fixtures of matches in a “Mock Premier League”

## Technologies

- Node JS
- Express
- ESLint
- Babel
- MongoDB
- Redis
- POSTMAN
- Jest

## Prerequisites

To work with this project, you need to have the following setup on your local machine

1. [NodeJS](https://nodejs.org)
2. [Git](https://git-scm.com/downloads)
3. [Postman](https://www.getpostman.com/downloads)
4. [Redis](https://www.redislabs.com)

## Install and run locally

```bash
$ git clone https://github.com/Baystef/mock-premier-league.git
$ cd Mock-PL

$ npm i
$ npm run seed
$ npm run start:dev
```
```bash
If redis has been successfully installed and configured (For windows users)

$ start redis-server.exe redis.windows.conf
$ start redis-cli.exe

On the redis-cli, send a
$ ping
you should get a
- PONG
response this means redis port is live and ready.

To see changes in real time, send
$ monitor
```
## Testing
```
$ npm test
```

# API Usage

```js
// login as admin
{
  email<EMAIL_ADDRESS>  password: "password"
}

// login as user
{
  email<EMAIL_ADDRESS>  password: "password"
}
```

API BASE URL https://mock-pl.herokuapp.com/.

## Authentication endpoints `/api/v1/users`

| method | route        | description               | data                                          |
| ------ | ------------ | ------------------------- | ----------------------------------------------|
| POST   | /users/signup| Sign Up                   | `{first_name, last_name, email, password}`    |
| POST   | /users/signin| Sign In                   | `{email, password}`                           |
| POST   | /users/logout| Logout                    |                                               |

## User endpoints `/api/v1/users`

| method | route               | description             | data                                 |
| ------ | ------------------- | ----------------------- | ------------------------------------ |
| GET    | /users              | Get all users           |                                      |
| PATCH  | /users/admin/:email | Create Admin            |                                      |

## Team endpoints `api/v1/teams`

| method | route            | description          | data                            |
| ------ | ---------------- | -------------------- | ------------------------------- |
| POST   | /teams           | Add a team           | `{teamName, noOfPlayers, coach}`|
| GET    | /teams           | Get all teams        |                                 |
| GET    | /teams?_teamName_| Get team by name     |                                 |
| GET    | /teams?_coach_   | Get team by coach    |                                 |
| PUT    | /teams/:teamName | Update a team        | `{teamName, noOfPlayers, coach}`|
| DELETE | /teams/:teamName | Delete a team        |                                 |

## Fixture endpoints `api/v1/fixtures`

| method | route          | description             | data                                 |
| ------ | -------------- | ----------------------- | ------------------------------------ |
| POST   | /fixtures      | Create a fixture        | `{ homeTeam, awayTeam, fixtureDate }`|
| GET    | /fixtures      | Get all fixtures        |                                      |
| GET    | /fixtures?_status_| Get pending or completed fixtures|                          |
| GET    | /fixtures?_fixtureLink_| Get a fixture   |                                      |
| PUT    | /fixtures/:fixtureLink | Update a fixture| `{ homeTeam, awayTeam, fixtureDate }`|
| DELETE | /fixtures?_fixtureLink_| Delete a fixture|                                      |
| PATCH  | /fixtures/play/:fixtureLink| Complete a fixture|                                |

## Search endpoint `api/v1/search`

| method | route          | description             | data                                 |
| ------ | -------------- | ----------------------- | ------------------------------------ |
| POST   | /search?_term_ | Robust search with home or away team as _term_ query |         |

## Admin only endpoints

| method | route                      | description               |
| ------ | -------------------------- | ------------------------- |
| GET    | /users                     | Get all users             |
| PATCH  | /users/admin/:email        | Create Admin              |
| POST   | /teams                     | Add a team                |
| PUT    | /teams/:teamName           | Update a team             |
| DELETE | /teams/:teamName           | Delete a team             |
| POST   | /fixtures                  | Create a fixture          |
| PUT    | /fixtures/:fixtureLink     | Update a fixture          |
| PATCH  | /fixtures/play/:fixtureLink| Complete a fixture        |
| DELETE | /fixtures?_fixtureLink_    | Delete a fixture          |

# API Docs
https://documenter.getpostman.com/view/7629676/SVn2Pvxo
# App URL
https://mock-pl.herokuapp.com/
# Author
Daramola Adebayo
# LICENSE
The code in this project is licensed under MIT license.

repository: Baystef/mock-premier-league

branch_name: refs/heads/develop

repo_name: Baystef/mock-premier-league


text:
---
title: Spring MVC
date: "2021-03-19T23:46:37.121Z"
---

![Spring MVC Architecture](./SpringMVCarch.png)
Built on top of Servlet API with all Spring Core features is a sub framework of Spring used to build web applications. Spring MVC works implementing Model-view-controller design pattern.
##Advantages:

> separate roles Model, View and controller
> configuration using spring is easier and powerful
> springs way for building web applications
> once configuration is done application development is fast
> easy to test and flexible
> process form data and help manage application states for web requests

![Spring MVC Architecture Working](./springmvcwork.png)
##Internally

> Dispatcher Servlet is given by Spring Dev Team
> Developer has to create model, Controller(Handle request and based on that place data in model or retrieve or store data) and View
> View Template could be JSP, JSTL or ThymeLeaf, Velocity etc

InternalResourceViewResolver is used to mention the location of view pages and suffix used. The controller class returns the name of the view page and the respective location and suffix is picked from here.

<annotation-driven />Tells Dispatcher servlet to look for controllers using annotations.

<context:component-scan base-package="com.spring" />Tells dispatcher servlet where to look for controllers

```xml
<init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring-servlet.xml</param-value>
</init-param>
```

##Spring MVC app steps:

> Configure Dispatcher Servlet
> Set up url mapping to Spring MVC Dispatcher Servlet
> Add support to component scanning
> add support for conversion, formatting and validation
> Define Spring MVC view resolver(how do we display the webpages or where are the pages located)
> create controller class
> define controller method
> add request mapping to controller method
> return view name
> develop view page

**Configure Spring Dispatcher Servlet**

web.xml:

```xml
<servlet>
      <servlet-name>mydispacter</param-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<!--give location of configuartion-->
<init-param>
      <param-name>contextConfiguration</param-name>
      <param-value>/WEB-INF/demo-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
```

**Set up url mapping to Spring MVC Dispatcher**
web.xml:

```xml
<servlet>
      <servlet-name>mydispatcher</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>

<servlet-mapping>
      <servlet-name>mydispatcher</servlet-name>
      <url-pattern>/</url-pattern>
</servlet-mapping>
<!--any url or request coming in send it to the dispatcher-->
```

**Support for component-scanning, conversion, formatting, validation and defining the spring mvc view resolver**
servlet.xml

```xml
<beans>
      <!--component scan-->
      <context:component-scan base-package="com.example.springdemo"/>
      <!--conversion, formatting and validation-->
      <mvc:annotation-driver/>
      <!--view resolver-->
      <bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/view"/>
      <propertyname="suffix" value=".jsp"/>
      </bean>
</beans>
```

**Create Controller class-> define controller method->Add request mapping to controller method->return view name from method->develop view page**

```java
@Controller
public class HomeController{
//@RequestMapping shows the url from where the request is to be handled by this method
      @RequestMapping("/show")
      public String showMyPage(){
            return "main menu";
            //menu menu is a simple jsp page
      }
      @RequestMapping("/process")
      public String processMyPage(){
            return "main menu";
            //menu menu is a simple jsp page
      }
}
```

##Read form Data using Spring MVC

> Create Controller class
> Show HTML Form: Create controller method to show HTML form, Create view page for HTML form
> Process HTML Form: Create controller method to process the form, Create view page for confirmation

showpage.jsp

```jsp
<form action="processForm" method="GET">
      <input type="text" name="studentname" placeholder="you name?"/>
      <input type="submit"/>
</form>
```

```java
@Controller
public class HomeController{
 @RequestMapping("/show")
      public String showMyPage(){
            return "showpage";
            //menu menu is a simple jsp page
      }
 @RequestMapping("/processForm")
      public String processFormv1(){
            return "mainmenu";
//access in jsp ${param.studentname}
      }
}
```

_Model in controllers during request mapping_

```java
@RequestMapping("/home")
public String home(Locale locale, Model model) {
	Date date=new Date();
	DateFormat dateFormat=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
	String formattedDate=dateFormat.format(date);
	model.addAttribute("serverTime", formattedDate);
	return "home";
}
@RequestMapping("/uppercase")
public String uppercase(HttpServletRequest request, Model model) {
      //read request param from html form
      String name=request.getParameter("studentname");
      //covert to uppercase
      name=name.toUpperCase();
      //create message
      String result="Hi!! "+name;
      //add message to model
      model.addAttribute("message",result);
      //here message can be replaced by anything the attribute name is upto you as long as it is consistent
      return "uppercase";
}
```

Access the message in uppercase.jsp as

```jsp
<h1>The message is : ${message}</h1>
```

**Use @RequestParam to read form data: which allows us to read the data and automatically bind it to a parameter coming into your method**

```java
@RequestMapping("/uppercase")
public String uppercase(@RequestParam("studentname") String name, Model model) {
      //covert to uppercase
      name=name.toUpperCase();
      //create message
      String result="Hi!! "+name;
      //add message to model
      model.addAttribute("message",result);
      //here message can be replaced by anything the attribute name is upto you as long as it is consistent
      return "uppercase";
}
```

**Model comes in empty initially and then attributes are added later**

_Map parent mapping for all methods in the controller add RequestMapping on top of controller overall_
_avoid ambiguous mapping with same path of request mapping? add parent mapping a relative mapping for all controllers_

```java
@Controller
@RequestMapping("/baap")
public class HomeController{
      //other request mapping methods
      @RequestMapping("/bache")
      public String bache(Model model){
            //...
      }
 }
}
```

_@ModelAttribute: bind it to the object parameter and get details from mvc form data : databinding is handled by spring_
_@Valid is used to indicate that the object should be validated and result to be stored in BindingResult: This validation is to be used in Controller classes_
_@InitBinder in a method would do a preprocessing on form validated input removed leading and trailing white spaces and if its a blank whitespace thats also removed and makes it null_

**???Create a CUstome validation using @interface and Helper Validator class???**

##Validation Annotations

> @NotNull: checks that annotated values is not null
> @Max/@Min: must be a value >= / <= the value
> @Size: size must match the given size
> @Pattern: must match a regular expression pattern
> @Future/@Past: Date must be in future or past of given date
> and many more....


text:
# Jetyak UAV Utilities

***Aiming to provide an interface for the interaction of UAV and jetyaks***
This Documentation is not complete. It does not reflect recent changes nor the entire scope of the project.
## Basic Command Palette

### Startup

#### M100
* Terminal on the Manifold
	* source the workspace
	* ```sudo -s```
	* ```roslaunch jetyak_uav_utils visionAndSDKM.launch```
* Terminal Anywhere (must maintain connection or use screen)
	* source the workspace
	* ```roslaunch jetyak_uav_utils m100_controller.launch```
		* This will give an error if you do not have an SD mounted and configured in the launch file

#### N3
* Terminal on the Manifold
	* source the workspace
	* ``` sudo -s ```
	* ```roslaunch jetyak_uav_utils visionAndSDKN3.launch```
* Terminal Anywhere (must maintain connection or use screen)
	* source the workspace
	* ```roslaunch jetyak_uav_utils n3_controller.launch```
		* This will give an error if you do not have an SD mounted and configured in the launch file

### Modes and changing

The modes are: takeoff, follow, leave, return, land, ride, and hover. They may be changed by calling ```rosservice call /jetyak_uav_utils/setMode "data: '<MODE>'"``` and replacing <MODE> with the mode. This is case insensitive.

#### Brief explanation of each behavior
* takeoff
	* Start the UAVs motors by calling the ```prop_enable``` or ```takeoff``` service.
	* Lifts off the platform either by the action taken by the lower level controller in ```takeoff``` or using tags after ```prop_enable``` is called.
* follow
	* Follows at a certain pose relative to the tags. This pose may be changed through the ```setFollowPosition``` service.
* leave
  * No output from behaviors, expects an external behavior to begin communicating with dji_pilot
* return
  * Flys up to a certain altitude above the boat.
  * Uses boat GPS to return to the area near the boat.
  * When near the boat, look for tags that provide the same pose difference that GPS does
  * Switch to following mode when a good tag is found and we are near the following pose
* land
  * Move into a pose relative to, just above, the landing platform.
  * When stable and in a good position, land
* ride
  * Ensure motors are off
* hover
  * hold position

### Communication with Mavros and QGroundControl

#### Setting up communications with jetyak from GCS
* Terminal 1
	```
	roscore
	```
* Terminal 2
	```
	rosrun mavros mavros_node _fcu_url:="/dev/ttyUSB0:57600" _gcs_url:="udp-b://<IP_ADDRESS>:14555@14550" __name:="jetyak<#>"
	```
	* This will create a connection to the Radio and allow QGC to connect over UDP
	* Do this for each jetyak and change <#> to the jetyak number.
* Terminal 3
	```
	./QGroundControl.AppImage
	```
  * Add new Comm Link "Mavproxy"
  	* Type: UDP
  	* Listening Port 14550
  * Connect
* Important topics:
  * GPS: ``` /jetyak<#>/global_position/global ```
  * IMU: ``` /jetyak<#>/imu/data ```
  * Heading: ``` /jetyak<#>/global_position/compass_hdg ```

#### Setting up communication to the drone

## Prerequisites
Here listed a few dependencies that need to be downloaded from the corresponding
repository.

* DJI Onboard SDK
```
git clone https://github.com/dji-sdk/Onboard-SDK.git
cd Onboard-SDK
mkdir build
cd build
cmake ..
make
sudo make install
```

* DJI Onboard SDK ROS from the catkin_ws/src directory
```
git clone https://github.com/dji-sdk/Onboard-SDK-ROS
catkin_make -C ..
```

* ar\_track\_alvar
```
sudo apt install ros-<VERSION>-ar-track-alvar
```


text:
---
id: 2
title: Rapid Integrations on a Plug-In Friendly Dashboard App
slug: dasheroo
alt: image-alt
client: Dasheroo
tags: RoR, JavaScript, postgres, custom-software-development, rapid-rampup
project-url: ''
related-services: [custom-software-development]
status: published
---

The Problem

Dasheroo were a start-up with a viable business idea: to provide a place were digital marketers and business people could see metrics from all the online tools they use in one place. The problem was that in order to build this, Dasheroo needed a build large number of integrations with their product.

Our Solution

The engineers at Dasheroo built a platform which supported integrations in a pluggable fashion. In order to add an integration, all a developer had to do was to write a plug-in for the application. The process of writing a plug-in was well-defined and standardised. It was convenient for us to “go to town” writing plug-in for Dasheroo. Before long the product had a volume of integrations necessary to make it a viable contender in the marketplace.

Proven Results / Value Add

Dasheroo went from a proof-of-content to a fully-fledged MVP, ready to woo customers and meet revenue targets. This was possible due to the large number of integrations we added to the product.

extension: markdown

gha_language: HTML


text:
This page was generated with Wiki Builder. Do not change the format!

## Info
The definition of an item and quantity required in a character's inventory in order to perform an action.

## Schema
* **Schema Type:** Definition
* **Type:** object

## Properties
Name | Type | Description
---- | ---- | -----------
count | integer:int32 | The minimum quantity of the item you have to have.
itemHash | [[Destiny.Definitions.DestinyInventoryItemDefinition|Destiny-Definitions-DestinyInventoryItemDefinition]]:integer:uint32 | The hash identifier of the item you need to have. Use it to look up the DestinyInventoryItemDefinition for more info.
deleteOnAction | boolean | If true, the item/quantity will be deleted from your inventory when the action is performed. Otherwise, you'll retain these required items after the action is complete.

## Example
```javascript
{
    // Type: integer:int32
    "count": 0,
    // Type: [[Destiny.Definitions.DestinyInventoryItemDefinition|Destiny-Definitions-DestinyInventoryItemDefinition]]:integer:uint32
    "itemHash": 0,
    // Type: boolean
    "deleteOnAction": false
}

```

## References
1. https://bungie-net.github.io/multi/schema_Destiny-Definitions-DestinyItemActionRequiredItemDefinition.html#schema_Destiny-Definitions-DestinyItemActionRequiredItemDefinition

repository: kramrm/BungieNetPlatform

repo_name: kramrm/BungieNetPlatform


text:
# Changelog

## Release 0.7.0

### New features

* **Provide credentials as parameters**
  ([#17](https://github.com/puppetlabs/puppetlabs-aws_inventory/pull/17))

  The `resolve_reference` task has new `aws_access_key_id` and `aws_secret_access_key`
  parameters for authenticating with AWS.

## Release 0.6.0

### New features

* **Bump maximum Puppet version to include 7.x**

## Release 0.5.2

### Bug fixes

* **Add PDK as a gem dependency**

  PDK is now a gem dependency for the module release pipeline

## Release 0.5.1

### Bug fixes

* **Add missing dependencies to module metadata**
  ([#10](https://github.com/puppetlabs/puppetlabs-aws_inventory/pull/11))

  The module metadata now includes `ruby_plugin_helper` and `ruby_task_helper`
  as dependencies.

## Release 0.5.0

### Bug fixes

* **Reference tags in target_mapping** ([#9](https://github.com/puppetlabs/puppetlabs-aws_inventory/pull/9))

  Previously, the tags attribute couldn't be effectively used in
  target_mapping because it contains an array of maps with "key" and
  "value" fields. We now convert the tags attribute into a standard key/value map so
  that tags can be looked up using `tags.Name` syntax.

## Release 0.4.0

### New features

* **Set `resolve_reference` task to private** ([#6](https://github.com/puppetlabs/puppetlabs-aws_inventory/pull/6))

    The `resolve_reference` task has been set to `private` so it no longer appears in UI lists.

## Release 0.3.0

### New features

* **Added `target_mapping` parameter in `resolve_reference` task** ([#1407](https://github.com/puppetlabs/bolt/issues/1407))

  The `resolve_reference` task has a new `target_mapping` parameter that accepts a hash of target attributes and the resource values to populate them with.

## Release 0.2.0

### Bug fixes

* **Expand `credentials` path relative to Boltdir** ([#1162](https://github.com/puppetlabs/bolt/issues/1162))

  The `credentials` option will now be expanded relative to the active Boltdir the user is running bolt with, instead of the current working directory they ran Bolt from. This is part of standardizing all configurable paths in Bolt to be relative to the Boltdir.

## Release 0.1.0

This is the initial release.


text:
# cpy

> Copy files

## Why

- Fast by using streams.
- Resilient by using [graceful-fs](https://github.com/isaacs/node-graceful-fs).
- User-friendly by accepting [globs](https://github.com/sindresorhus/globby#globbing-patterns) and creating non-existent destination directories.
- User-friendly error messages.
- Progress reporting.

## Install

```sh
npm install cpy
```

## Usage

```js
import cpy from 'cpy';

await cpy([
	'source/*.png', // Copy all .png files
	'!source/goat.png', // Ignore goat.png
], 'destination');

// Copy node_modules to destination/node_modules
await cpy('node_modules', 'destination');

// Copy node_modules content to destination
await cpy('node_modules/**', 'destination');

// Copy node_modules structure but skip all files except package.json files
await cpy('node_modules/**/*.json', 'destination');

// Copy all png files into destination without keeping directory structure
await cpy('**/*.png', 'destination', {flat: true});

console.log('Files copied!');
```

## API

### cpy(source, destination, options?)

Returns a `Promise<string[]>` with the destination file paths.

#### source

Type: `string | string[]`

Files to copy.

If any of the files do not exist, an error will be thrown (does not apply to globs).

#### destination

Type: `string`

Destination directory.

#### options

Type: `object`

Options are passed to [globby](https://github.com/sindresorhus/globby#options).

In addition, you can specify the below options.

##### cwd

Type: `string`\
Default: `process.cwd()`

Working directory to find source files.

##### overwrite

Type: `boolean`\
Default: `true`

Overwrite existing files.

##### flat

Type: `boolean`\
Default: `false`

Flatten directory structure. All copied files will be put in the same directory.

```js
import cpy from 'cpy';

await cpy('src/**/*.js', 'destination', {
	flat: true
});
```

##### rename

Type: `string | Function`

Filename or function returning a filename used to rename every file in `source`.

```js
import cpy from 'cpy';

await cpy('foo.js', 'destination', {
	// The `basename` is the filename with extension.
	rename: basename => `prefix-${basename}`
});

await cpy('foo.js', 'destination', {
	rename: 'new-name'
});
```

##### concurrency

Type: `number`\
Default: `(os.cpus().length || 1) * 2`

Number of files being copied concurrently.

##### ignoreJunk

Type: `boolean`\
Default: `true`

Ignores [junk](https://github.com/sindresorhus/junk) files.

##### filter

Type: `Function`

Function to filter files to copy.

Receives a source file object as the first argument.

Return true to include, false to exclude. You can also return a Promise that resolves to true or false.

```js
import cpy from 'cpy';

await cpy('foo', 'destination', {
	filter: file => file.extension !== 'nocopy'
});
```

##### Source file object

###### path

Type: `string`\
Example: `'/tmp/dir/foo.js'`

Resolved path to the file.

###### relativePath

Type: `string`\
Example: `'dir/foo.js'` if `cwd` was `'/tmp'`

Relative path to the file from `cwd`.

###### name

Type: `string`\
Example: `'foo.js'`

Filename with extension.

###### nameWithoutExtension

Type: `string`\
Example: `'foo'`

Filename without extension.

###### extension

Type: `string`\
Example: `'js'`

File extension.

## Progress reporting

### cpy.on('progress', handler)

#### handler(progress)

Type: `Function`

##### progress

```js
{
	completedFiles: number,
	totalFiles: number,
	completedSize: number,
	percent: number,
	sourcePath: string,
	destinationPath: string,
}
```

- `completedSize` is in bytes
- `percent` is a value between `0` and `1`
- `sourcePath` is the absolute source path of the current file being copied.
- `destinationPath` is The absolute destination path of the current file being copied.

Note that the `.on()` method is available only right after the initial `cpy` call, so make sure you add a `handler` before awaiting the promise:

```js
import cpy from 'cpy';

await cpy(source, destination).on('progress', progress => {
	// …
});
```

## Related

- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - CLI for this module
- [cp-file](https://github.com/sindresorhus/cp-file) - Copy a single file
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed

repository: sindresorhus/cpy

repo_name: sindresorhus/cpy


text:
# aviatrix_cloudwatch_agent

[back](../aviatrix.md)

### Index

- [Example Usage](#example-usage)
- [Variables](#variables)
- [Resource](#resource)
- [Outputs](#outputs)

### Terraform

```terraform
terraform {
  required_providers {
    aviatrix = ">= 2.18.2"
  }
}
```

[top](#index)

### Example Usage

```terraform
module "aviatrix_cloudwatch_agent" {
  source = "./modules/aviatrix/r/aviatrix_cloudwatch_agent"

  # cloudwatch_role_arn - (required) is a type of string
  cloudwatch_role_arn = null
  # excluded_gateways - (optional) is a type of set of string
  excluded_gateways = []
  # log_group_name - (optional) is a type of string
  log_group_name = null
  # region - (required) is a type of string
  region = null
}
```

[top](#index)

### Variables

```terraform
variable "cloudwatch_role_arn" {
  description = "(required) - CloudWatch role ARN."
  type        = string
}

variable "excluded_gateways" {
  description = "(optional) - List of excluded gateways."
  type        = set(string)
  default     = null
}

variable "log_group_name" {
  description = "(optional) - Log group name."
  type        = string
  default     = null
}

variable "region" {
  description = "(required) - Name of AWS region."
  type        = string
}
```

[top](#index)

### Resource

```terraform
resource "aviatrix_cloudwatch_agent" "this" {
  # cloudwatch_role_arn - (required) is a type of string
  cloudwatch_role_arn = var.cloudwatch_role_arn
  # excluded_gateways - (optional) is a type of set of string
  excluded_gateways = var.excluded_gateways
  # log_group_name - (optional) is a type of string
  log_group_name = var.log_group_name
  # region - (required) is a type of string
  region = var.region
}
```

[top](#index)

### Outputs

```terraform
output "id" {
  description = "returns a string"
  value       = aviatrix_cloudwatch_agent.this.id
}

output "status" {
  description = "returns a string"
  value       = aviatrix_cloudwatch_agent.this.status
}

output "this" {
  value = aviatrix_cloudwatch_agent.this
}
```

[top](#index)

repository: chadwickalex/tfwriter

repo_name: chadwickalex/tfwriter


text:
## Mill Design Principles

A lot of Mill's design principles are intended to fix SBT's flaws, as described
in the blog post
[What's wrong with SBT](http://www.lihaoyi.com/post/SowhatswrongwithSBT.html),
building on the best ideas from tools like [CBT](https://github.com/cvogt/cbt)
and [Bazel](https://bazel.build/), and the ideas from my blog post
[Build Tools as
Pure Functional Programs](http://www.lihaoyi.com/post/BuildToolsasPureFunctionalPrograms.html).
Before working on Mill, read through that post to understand where it is coming
from!

### Dependency graph first

Mill's most important abstraction is the dependency graph of `Task`s.
Constructed using the `T {...}` `T.task {...}` `T.command {...}` syntax, these
track the dependencies between steps of a build, so those steps can be executed
in the correct order, queried, or parallelized.

While Mill provides helpers like `ScalaModule` and other things you can use to
quickly instantiate a bunch of related tasks (resolve dependencies, find
sources, compile, package into jar, ...) these are secondary. When Mill
executes, the dependency graph is what matters: any other mode of organization
(hierarchies, modules, inheritance, etc.) is only important to create this
dependency graph of `Task`s.

### Builds are hierarchical

The syntax for running targets from the command line `mill Foo.bar.baz` is
the same as referencing a target in Scala code, `Foo.bar.baz`

Everything that you can run from the command line lives in an object hierarchy
in your `build.sc` file. Different parts of the hierarchy can have different
`Target`s available: just add a new `def foo = T {...}` somewhere and you'll be
able to run it.

Cross builds, using the `Cross` data structure, are just another kind of node in
the object hierarchy. The only difference is syntax: from the command line you'd
run something via `mill core.cross[a].printIt` while from code you use
`core.cross("a").printIt` due to different restrictions in Scala/Bash syntax.

### Caching by default

Every `Target` in a build, defined by `def foo = T {...}`, is cached by default.
Currently this is done using a `foo/meta.json` file in the `out/` folder. The
`Target` is also provided a `foo/` path on the filesystem dedicated to it, for
it to store output files etc.

This happens whether you want it to or not. Every `Target` is cached, not just
the "slow" ones like `compile` or `assembly`.

Caching is keyed on the `.hashCode` of the returned value. For `Target`s
returning the contents of a file/folder on disk, they return `PathRef` instances
whose hashcode is based on the hash of the disk contents. Serialization of the
returned values is tentatively done using uPickle.

### Short-lived build processes

The Mill build process is meant to be run over and over, not only as a
long-lived daemon/console. That means we must minimize the startup time of the
process, and that a new process must be able to re-construct the in-memory data
structures where a previous process left off, in order to continue the build.

Re-construction is done via the hierarchical nature of the build: each `Target`
`foo.bar.baz` has a fixed position in the build hierarchy, and thus a fixed
position on disk `out/foo/bar/baz/meta.json`. When the old process dies and a
new process starts, there will be a new instance of `Target` with the same
implementation code and same position in the build hierarchy: this new `Target`
can then load the `out/foo/bar/baz/meta.json` file and pick up where the
previous process left off.

Minimizing startup time means aggressive caching, as well as minimizing the
total amount of bytecode used: Mill's current 1-2s startup time is dominated by
JVM classloading. In future, we may have a long lived console or
nailgun/drip-based server/client models to speed up interactive usage, but we
should always keep "cold" startup as fast as possible.

### Static dependency graph and Applicative tasks

`Task`s are *Applicative*, not *Monadic*. There is `.map`, `.zip`, but no
`.flatMap` operation. That means that we can know the structure of the entire
dependency graph before we start executing `Task`s. This lets us perform all
sorts of useful operations on the graph before running it:

- Given a Target the user wants to run, pre-compute and display what targets
  will be evaluated ("dry run"), without running them

- Automatically parallelize different parts of the dependency graph that do not
  depend on each other, perhaps even distributing it to different worker
  machines like Bazel/Pants can

- Visualize the dependency graph easily, e.g. by dumping to a DOT file

- Query the graph, e.g. "why does this thing depend on that other thing?"

- Avoid running tasks "halfway": if a Target's upstream Targets fail, we can
  skip the Target completely rather than running halfway and then bailing out
  with an exception

In order to avoid making people using `.map` and `.zip` all over the place when
defining their `Task`s, we use the `T {...}`/`T.task {...}`/`T.command {...}`
macros which allow you to use `Task#apply()` within the block to "extract" a
value.

```scala
def test() = T.command {
  TestRunner.apply(
   "mill.UTestFramework",
   runDepClasspath().map(_.path) :+ compile().path,
   Seq(compile().path)

}
```

This is roughly equivalent to the following:

```scala
def test() = T.command { T.zipMap(runDepClasspath, compile, compile) {
  (runDepClasspath1, compile2, compile3) =>
  TestRunner.apply(
    "mill.UTestFramework",
    runDepClasspath1.map(_.path) :+ compile2.path,
    Seq(compile3.path)
  )
}
```

This is similar to SBT's `:=`/`.value` macros, or `scala-async`'s
`async`/`await`. Like those, the `T {...}` macro should let users program most of
their code in a "direct" style and have it "automatically" lifted into a graph
of `Task`s.

## How Mill aims for Simple

Why should you expect that the Mill build tool can achieve simple, easy &
flexible, where other build tools in the past have failed?

Build tools inherently encompass a huge number of different concepts:

- What "Tasks" depends on what?
- How do I define my own tasks?
- Where do source files come from?
- What needs to run in what order to do what I want?
- What can be parallelized and what can't?
- How do tasks pass data to each other? What data do they pass?
- What tasks are cached? Where?
- How are tasks run from the command line?
- How do you deal with the repetition inherent in a build? (e.g. compile, run &
  test tasks for every "module")
- What is a "Module"? How do they relate to "Tasks"?
- How do you configure a Module to do something different?
- How are cross-builds (across different configurations) handled?

These are a lot of questions to answer, and we haven't even started talking
about the actually compiling/running any code yet! If each such facet of a build
was modelled separately, it's easy to have an explosion of different concepts
that would make a build tool hard to understand.

Before you continue, take a moment to think: how would you answer to each of
those questions using an existing build tool you are familiar with? Different
tools like [SBT](http://www.scala-sbt.org/),
[Fake](https://fake.build/legacy-index.html), [Gradle](https://gradle.org/) or
[Grunt](https://gruntjs.com/) have very different answers.

Mill aims to provide the answer to these questions using as few, as familiar
core concepts as possible. The entire Mill build is oriented around a few
concepts:

- The Object Hierarchy
- The Call Graph
- Instantiating Traits & Classes

These concepts are already familiar to anyone experienced in Scala (or any other
programming language...), but are enough to answer all of the complicated
build-related questions listed above.

## The Object Hierarchy

The module hierarchy is the graph of objects, starting from the root of the
`build.sc` file, that extend `mill.Module`. At the leaves of the hierarchy are
the `Target`s you can run.

A `Target`'s position in the module hierarchy tells you many things. For
example, a `Target` at position `core.test.compile` would:

- Cache output metadata at `out/core/test/compile/meta.json`

- Output files to the folder `out/core/test/compile/dest/`

- Source files default to a folder in `core/test/`, `core/test/src/`

- Be runnable from the command-line via `mill core.test.compile`

- Be referenced programmatically (from other `Target`s) via `core.test.compile`

From the position of any `Target` within the object hierarchy, you immediately
know how to run it, find its output files, find any caches, or refer to it from
other `Target`s. You know up-front where the `Target`'s data "lives" on disk, and
are sure that it will never clash with any other `Target`'s data.

## The Call Graph

The Scala call graph of "which target references which other target" is core to
how Mill operates. This graph is reified via the `T {...}` macro to make it
available to the Mill execution engine at runtime. The call graph tells you:

- Which `Target`s depend on which other `Target`s

- For a given `Target` to be built, what other `Target`s need to be run and in
  what order

- Which `Target`s can be evaluated in parallel

- What source files need to be watched when using `--watch` on a given target (by
  tracing the call graph up to the `Source`s)

- What a given `Target` makes available for other `Target`s to depend on (via
  its return value)

- Defining your own task that depends on others is as simple as `def foo =
  T {...}`

The call graph within your Scala code is essentially a data-flow graph: by
defining a snippet of code:

```scala
val b = ...
val c = ...
val d = ...
val a = f(b, c, d)
```

you are telling everyone that the value `a` depends on the values of `b` `c` and
`d`, processed by `f`. A build tool needs exactly the same data structure:
knowing what `Target` depends on what other `Target`s, and what processing it
does on its inputs!

With Mill, you can take the Scala call graph, wrap everything in the `T {...}`
macro, and get a `Target`-dependency graph that matches exactly the call-graph
you already had:

```scala
val b = T { ... }
val c = T { ... }
val d = T { ... }
val a = T { f(b(), c(), d()) }
```

Thus, if you are familiar with how data flows through a normal Scala program,
you already know how data flows through a Mill build! The Mill build evaluation
may be incremental, it may cache things, it may read and write from disk, but
the fundamental syntax, and the data-flow that syntax represents, is unchanged
from your normal Scala code.

In Mill, inheriting from traits is the primary way for re-using common parts of
a build:

- Scala "project"s with multiple related `Target`s within them, are just a
  `Trait` you instantiate

- Replacing the default `Target`s within a project, making them do new
  things or depend on new `Target`s, is simply `override`-ing them during
  inheritance

- Modifying the default `Target`s within a project, making use of the old value
  to compute the new value, is simply `override`ing them and using `super.foo()`

- Required configuration parameters within a `project` are `abstract` members

- Cross-builds are modelled as instantiating a (possibly anonymous) class
  multiple times, each instance with its own distinct set of `Target`s

In normal Scala, you bundle up common fields & functionality into a `class` you
can instantiate over and over, and you can override the things you want to
customize. Similarly, in Mill, you bundle up common parts of a build into
`trait`s you can instantiate over and over, and you can override the things you
want to customize. "Subprojects", "cross-builds", and many other concepts are
reduced to simply instantiating a `trait` over and over, with tweaks.

## Prior Work

### SBT

Mill is built as a substitute for SBT, whose problems are
[described here](http://www.lihaoyi.com/post/SowhatswrongwithSBT.html).
Nevertheless, Mill takes on some parts of SBT (builds written in Scala, Task
graph with an Applicative "idiom bracket" macro) where it makes sense.

### Bazel

Mill is largely inspired by [Bazel](https://bazel.build/). In particular, the
single-build-hierarchy, where every Target has an on-disk-cache/output-folder
according to their position in the hierarchy, comes from Bazel.

Bazel is a bit odd in its own right. The underlying data model is good
(hierarchy + cached dependency graph) but getting there is hell. It (like SBT) is
also a 3-layer interpretation model, but layers 1 & 2 are almost exactly the
same: mutable python which performs global side effects (layer 3 is the same
dependency-graph evaluator as SBT/mill).

You end up having to deal with a non-trivial python codebase where everything
happens via:

```python
do_something(name="blah")
```

or

```python
do_other_thing(dependencies=["blah"])

```
where `"blah"` is a global identifier that is often constructed programmatically
via string concatenation and passed around. This is quite challenging.

Having the two layers be “just python” is great since people know python, but I
think it's unnecessary to have two layers ("evaluating macros" and "evaluating rule
impls") that are almost exactly the same, and I think making them interact via
return values rather than via a global namespace of programmatically-constructed
strings would make it easier to follow.

With Mill, I’m trying to collapse Bazel’s Python layer 1 & 2 into just 1 layer
of Scala, and have it define its dependency graph/hierarchy by returning
values, rather than by calling global-side-effecting APIs. I've had trouble
trying to teach people how-to-bazel at work, and am pretty sure we can make
something that's easier to use.

### Scala.Rx

Mill's "direct-style" applicative syntax is inspired by my old
[Scala.Rx](https://github.com/lihaoyi/scala.rx) project. While there are
differences (Mill captures the dependency graph lexically using Macros, Scala.Rx
captures it at runtime), they are pretty similar.

The end-goal is the same: to write code in a "direct style" and have it
automatically "lifted" into a dependency graph, which you can introspect and use
for incremental updates at runtime.

Scala.Rx is itself build upon the 2010 paper
[Deprecating the Observer Pattern](https://infoscience.epfl.ch/record/148043/files/DeprecatingObserversTR2010.pdf).

### CBT

Mill looks a lot like [CBT](https://github.com/cvogt/cbt). The inheritance based
model for customizing `Module`s/`ScalaModule`s comes straight from there, as
does the "command line path matches Scala selector path" idea. Most other things
are different though: the reified dependency graph, the execution model, the
caching module all follow Bazel more than they do CBT

repository: imxieshuang/mill

path: /docs/pages/8 - Mill Internals.md

filename: 8 - Mill Internals.md

repo_name: imxieshuang/mill


text:
# Software Best Practices for Reproducible Science
More information about the course is on the [course website](https://chayast.github.io/course_website/)


text:
# Contributing to Ethernaut

Thank you for your interesting in contributing to Ethernaut!

Please follow the steps below. If you're new to git and/or GitHub, we suggest you go through the [GitHub Guides](https://guides.github.com/introduction/flow/).

1. Fork this repository
2. Clone the fork replacing `<username>` with your github username
   - Using SSH

        ```bash
        git clone --filter=blob:none git@github.com:<username>/ethernaut.git
        ```

   - Using HTTPS

        ```bash
        git clone --filter=blob:none https://github.com/<username>/ethernaut.git
        ```

   - Using GitHub CLI

        ```bash
        gh repo clone <username>/ethernaut -- --filter=blob:none
        ```

3. Create a new branch from the latest `master`
4. Start hacking on the new branch according to the type of contribution outlined below
5. Commit and push to the new branch
6. Make a pull request against `OpenZeppelin/ethernaut master`

## Contribution Types

Currently, we are reviewing contributions of the following types:

<!-- no toc -->
- [Level development](#level-development)
- [Translations and additional languages](#translations-and-additional-languages)
- [Documentation updates and corrections](#documentation-updates-and-corrections)

If you would like to contribute in another way, please reach out to us via email: [ethernaut<EMAIL_ADDRESS>
### Level development

*A level is composed of the following elements:*

- A `<Level>Factory.sol` contract, where `<Level>` is replaced by the name of the level, that needs to extend [`Level.sol`](./contracts/contracts/levels/base/Level.sol). This factory contract will be deployed only once and registered on Ethernaut.sol by Ethernaut's owner. Players never interact with the factory directly. The factory is in charge of creating level instances for players to use (1 instance per player) and to check these instances to verify if the player has passed the level. Factories should not have state that can be changed by the player.
- A `level instance` contract named `<Level>.sol`, where `<Level>` is replaced by the name of the level, that is emitted by the factory for each player that requests it. Instances need to be completely decouppled from Ethernaut's architecture. Factories will emit them and verify them. That is, level instances don't know anything about their factories or Ethernaut. An instance's state can be completely demolished by players and even destroyed since they are not really part of the architecture, just a challenge for a player to use at will.
- A `description file` in [the descriptions directory](./client/src/gamedata/en/descriptions/levels) that the UI presents to the player and describes the level's objectives with some narrative and tips.
- A `description completion file` also located in [the descriptions directory](./client/src/gamedata/en/descriptions/levels) that the UI presents to the player when the level is passed, further information about the player, historical insights, further explanations or just a congrats message.
- A `tests file` in the [`test directory`](./contracts/test/levels/) that performs unit tests on the level.
- A `json entry` for the level in [gamedata.json](client/src/gamedata/gamedata.json) that appends metadata to the level. The UI uses this metadata to display the level's title, difficulty, etc, but also to determine if sources are shown, the default gas for the creation of an instance, instance contract verification on explorers, etc. NOTE: "deployId" **must** be unique and is also used by the deployment script.
- Optionally, an `author entry` in [authors.json](client/src/gamedata/authors.json). You can specify opt-in information about yourself in this file.

#### Example level development: King

Let's suppose that we are creating the level "King" (which is already created and available in the game of course).

1. Fork this repo, clone and yarn install.
2. Use the other levels as a basis, eg. duplicate DummyFactory.sol and Dummy.sol.
3. Rename and modify the contracts to KingFactory.sol and King.sol respectively.
4. Implement the desired instance and factory logic in solidity. See current levels and notes to understand how the game mechanics work.
5. Add the test file `contracts/test/levels/King.test.js`. Use other tests files as reference to see how tests might work.
6. Run `yarn test:contracts` and once all tests pass, register the level in [gamedata.json](client/src/gamedata/gamedata.json).
7. The level should now show up in the ui. To start the UI, set the [ACTIVE_NETWORK](client/src/constants.js) to `NETWORKS.LOCAL` and run `yarn start`.
8. Add a description markdown file, in this case client/src/gamedata/levels/king.md (make sure gamedata.json points to it). This content will now be displayed in the ui for the level.
9. Add a completed description markdown file, in this case client/src/gamedata/levels/king_complete.md (make sure gamedata.json points to it). The level will display this as additional info once the level is solved, usually to include historical information related to the level.
10. Verify that the level is playable and winnable via UI. It is common for levels to be beatable in some way in tests that doesn't work using the UI, so it is important to test it manually as well.
11. Make a PR request so that we can re-deploy the game with the new level!

### Translations and additional languages

To modify or add a new language to the list of supported ones, follow these steps:

1. under `client/src/gamedata` create a new folder with the languge you want to add.
2. Copy paste the content you want to translate of any other language into the new directory.
3. You will need to translate two things:

     - `levels` descriptions under `descriptions` subdirectory
     - `strings.json`. For this, only the values of the keys in the json must be translated. Do not translate keys (i.e. `nextLevel`).

4. If you are just modifying an already existing language you can stop here and submit a PR. If you're adding a new language go to the next steps. Translations are mantained by the community but we ask to translate at least the `strings.json` and the `instances.md` and `instances_complete.md` files entirely since those are the most important ones to understand how the game works. Levels which are not translated will default to English in any case.
5. Add a new key/value in all `strings.json` of all languages for the newly added language. For example, if you're going to add French, add

    ```bash
    #In `en/strings.json` add:

    {
        ...
        "french": "French",
        ...
    }

    #In `es/strings.json` add:
    {
        ...
        "french": "Francés",
        ...
    }
    ```

6. Once translation is done, add an entry in `client/src/containers/Headers.js` in the following code snippet for the user interface so you can select your added language:

    ```javascript
        const LANGUAGES_MAP = {
        en: strings.english,
        es: strings.spanish,
        pt_br: strings.portuguese,
        ja: strings.japanese,
        zh_cn: strings.chinese_simplified,
        zh_tw: strings.chinese_traditional,
        fr: strings.french,
        ru: strings.russian,
        ar: strings.arabic,
        tr: strings.turkish,
        };
    ```

7. You can now submit a PR and we will review.

### Documentation updates and corrections

There are no specific files that need to be changed for these types of fixes. Once you correct the documentation please open a PR and we will review it!

repository: OpenZeppelin/ethernaut

repo_name: OpenZeppelin/ethernaut


text:
---
title: A New Beginning for Vivliostyle
author:
 - murakami
 - florian
---

Vivliostyle was founded as a startup company on a vision for bridging the gap between the web and the world of printing. To this end, the company worked on an open source project, among other things.

Responding to its business needs, the company has evolved, and “other things” have become dominant; open source products are no longer at the core of its strategy.

Therefore, as of February 16, 2018, Vivliostyle-the-company has decided change its name to reflect its updated strategy, and to transfer control over Vivliostyle-the-opensource-project to former members still interested in pursuing the open source project.

For more details about the company, please consult [trim-marks.com](http://trim-marks.com/) or contact [info@trim-marks.com](mailto:info@trim-marks.com).

As Vivliostyle is no longer affiliated with a for-profit company, we're moving it from [vivliostyle.com](http://vivliostyle.com/) to [vivliostyle.org](https://vivliostyle.org/). Going forward, the “Vivliostyle” branding (including the [github organization](https://github.com/vivliostyle/), social media accounts, etc) will exclusively be used by the open source project.

We would like to thank the management of Trim-marks Inc. for letting the project continue on its own path and under its original name.

Going forward, we expect to focus on (in rough order of priority):
- Setting up automated testing and continuous integration, to track the latest web standards test
- Making on boarding for new users and new contributors easier
- Working on interoperability and fixing compatibility bugs
- Keeping up to date with the newest web standards
- Integrating better with the ecosystem (npm, docker…)
- Experimenting with new layout solutions and bringing them to standardization

If you're interested in helping this (and more) happen, make sure to get in touch!

Find us on:
* [github](http://github.com/vivliostyle/)
* [twitter](https://twitter.com/vivliostyle)
* [facebook page](https://www.facebook.com/vivliostyle)
* [facebook group](https://www.facebook.com/groups/vivliostyle)

[Stay tuned](/blog/feed.xml) for more!


text:
# Chipotle Pineapple Sauce

## Ingredients

* 250 g chopped fresh pineapple
* 1 minced onion
* 15 ml olive oil
* 2-3 chipotle peppers, with surrounding adobo sauce from can
* 120 ml water

## Directions

1. Sautee the onion in the oil until translucent
1. Add pineapple and let cook for just a couple minutes
1. Add water and peppers and sauce and cook until reduced to just thinner than a paste

tags: vegetarian, vegan

license: Unlicense


text:
---
layout: post
title: "Animation on piTFT"
date: 2022-03-17
excerpt: "ECE5725"
tags: [raspberry pi, ECE5725]
comments: false
---

> This project was part of the ECE5725: Embedded Operating Systems taught by Professor Skovria.

## Animation on piTFT

The goal was to control the animation on the piTFT display with touchscreen and external buttons. The materials we used were:
* Raspberry pi 4
* piTFT display
* breadboard
* 1k & 10k resistors
* switch

The project use the following steps:

## Setting up pi4 & piTFT
## Frame buffer
## Pull down registers
## Mplayer & FIFO
## Pygame

*I will create a post for each topic soon*


text:
# maze-generator
Simple maze generator and basic GUI in Java.

I explained codes in comments and I wrote a blog post about it which is [here](http://ozuduru.com/2016/02/10/recursive-backtracking-maze-generator-in-java-with-gui/).

I hope it helps your homeworks/projects. If you use these codes without changes in your works,
I'd be happy if you put a link for my blog page [ozuduru.com](http://ozuduru.com) or my twitter account [@onurozuduru](https://twitter.com/onurozuduru) with my name on somewhere.

repository: emersondelonga/maze-generator

repo_name: emersondelonga/maze-generator


text:
# DEPRECATED

> This is no longer supported, please consider using [https://github.com/julienloizelet/docker-openmage](https://github.com/julienloizelet/docker-openmage) instead.

> Use it to manage a Magento 1 project with docker and docker-compose.
By "already existant project On Magento 1.✕", I mean a project based on Magento 1.✕ version (community or enterprise) for which you have sources and database.

Originally forked from [andreaskoch/dockerized-magento](https://github.com/andreaskoch/dockerized-magento).

## Installing / Getting started

### Requirements

If you are on Linux you should install

- [docker](http://docs.docker.com/compose/install/#install-docker) and
- [docker-compose](http://docs.docker.com/compose/install/#install-compose)

If you are running on [Mac OS](https://docs.docker.com/engine/installation/mac/) or [Windows](https://docs.docker.com/engine/installation/windows/) you can install the [Docker Toolbox](https://docs.docker.com/engine/installation/mac/) which contains docker, docker-compose and docker-machine.

The web-server will be bound to your local ports 80 and 443. In order to access the shop you must add a hosts file entry for `yourdomainname.local`.

### Add the domain name

For Linux Users, in order to access the shop you must add the domain name "yourdomainname.local" to your hosts file (`/etc/hosts`).
If you are using docker **natively** you can use this command:

```bash
sudo su
echo "<IP_ADDRESS>    yourdomainname.local" >> /etc/hosts
```

### Get your sources ready
 We will assume sources are in a directory called `/some/path/for/your-project-sources`.
 For example, my own is `/home/julien/workspace/name-of-a-project`

### Get your database ready
   Copy a dump `yourdatabasedump.sql` in the path `data/dump`.

   If you don't have an existent database, you can do a classic Magento installation. For
   that purpose you should follow the above Installation instructions but skip the Post Installation instructions :do not create the `local.xml` file and go to the url `http://yourdomainname.local` in your favorite browser.

### Installation

1. Make sure you have docker and docker-compose on your system
2. Clone the repository `git clone https://github.com/julienloizelet/docker-magento1.git`
3. Create a  `docker-compose.override.yml` from the example `docker-compose.override.yml.dist` and make the necessary changes. (e.g replace `/some/path/for/your-project-sources` depending on your own and remove comments.)
4. If some program are listening to port 80 or 443 (e.g apache or nginx), you must stop them. (`sudo service apache2 stop`)
5. Start the projects using `sudo ./magento start` (maybe you will have to do a `chmod +x magento`).
6. (optional) If you get error messages like "permission denied", you should run `sudo chmod -R 777 bin` and then rerun  `sudo ./magento start`.

During the first start of the project **docker-compose** will

1. first **build** all docker-images referenced in the [docker-compose.yml](docker-compose.yml)
2. then **start** the containers
3. and **trigger the installer**

Once the installation is finished the installer will print the URL and the credentials for the backend to the installer log:

```
...
installer_1      | phpMyAdmin: http://yourdomainname.local:8081
installer_1      |  - Username: root
installer_1      |  - Password: pw
installer_1      |
installer_1      |
installer_1      | Mail dev: http://yourdomainname.local:8282
installer_1      |
installer_1      |
installer_1      | Frontend: http://yourdomainname.local/

```

**Note**: The build process and the installation process will take a while if you start the project for the first time. After that, starting and stoping the project will be a matter of seconds.

## Post Installation

### Import the database
1. Create a `yourdatabase` database (a simple way is to use `phpmyadmin` by going to the url : `http://localhost:8081`)
2. We will the import the database with the following commands (use `pw` as root password when prompted.):
```sudo ./magento enter mysql
cd /etc/dump
mysql -u root -h localhost -p yourdatabase < yourdatabase.sql
```
### Modify the `app/etc/local.xml` file
Go to the `/some/path/for/magento/sources` and edit the `app/etc/local.xml` file with the following content (replace `yourdatabase` name by yours):
```
<?xml version="1.0"?>
<config>
    <global>
        <install>
            <date><![CDATA[Sat, 11 Apr 2015 12:33:05 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[731aea833710535779fe8c7c49bc6c4d]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[mysql]]></host>
                    <username><![CDATA[root]]></username>
                    <password><![CDATA[pw]]></password>
                    <dbname><![CDATA[yourdatabase]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save>db</session_save>
        <redis_session>
            <host>redissession</host>
            <log_level>7</log_level>
            <port>6379</port>
            <password></password>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>0</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>gzip</compression_lib>
            <log_level>1</log_level>
            <max_concurrency>6</max_concurrency>
            <break_after_frontend>5</break_after_frontend>
            <break_after_adminhtml>30</break_after_adminhtml>
            <bot_lifetime>7200</bot_lifetime>
            <disable_locking>0</disable_locking>
        </redis_session>
        <cache>
            <backend>Mage_Cache_Backend_Redis</backend>
            <backend_options>
                <server>rediscache</server>
                <port>6379</port>
                <persistent></persistent>
                <db>0</db>
                <password></password>
                <force_standalone>0</force_standalone>
                <connect_retries>1</connect_retries>
                <read_timeout>10</read_timeout>
                <automatic_cleaning_factor>0</automatic_cleaning_factor>
                <compress_data>1</compress_data>
                <compress_tags>1</compress_tags>
                <compress_threshold>20480</compress_threshold>
                <compression_lib>gzip</compression_lib>
                <use_lua>0</use_lua>
            </backend_options>
        </cache>
    </global>
</config>
```

## Usage

You can control the project using the built-in `magento`-script which is basically just a **wrapper for docker and docker-compose** that offers some **convenience features**:

```bash
./magento <action>
```

**Available Actons**

- **start**: Starts the docker containers (and triggers the installation if magento is not yet installed)
- **stop**: Stops all docker containers
- **restart**: Restarts all docker containers and flushes the cache
- **status**: Prints the status of all docker containers
- **stats**: Displays live resource usage statistics of all containers
- **magerun**: Executes magerun in the magento root directory
- **composer**: Executes composer in the magento root directory
- **enter**: Enters the bash of a given container type (e.g. php, mysql, ...)
- **destroy**: Stops all containers and removes all data

**Note**: The `magento`-script is just a small wrapper around `docker-compose`. You can just use [docker-compose](https://docs.docker.com/compose/) directly.

## Components

### Overview

The dockerized Magento project consists of the following components:

- **[docker images](docker-images)**
  1. a [PHP 5.5](docker-images/php/Dockerfile) image
  1. a [Nginx]() image
  1. a standard [MySQL](https://hub.docker.com/_/mysql/) database server image
  1. multiple instances of the standard [Redis](https://hub.docker.com/_/redis/) docker image
  1. a standard [phpMyAdmin](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) image that allows you to access the database on port 8080
  1. a Maildev image to prevent sending email on test environnment.
  1. and a [Installer](docker-images/installer/Dockerfile) image which contains all tools for installing the project from scratch using an [install script](docker-images/installer/bin/install.sh)
- a **[shell script](magento)** for controlling the project: [`./magento <action>`](magento)
- and the [docker-compose.yml](docker-compose.yml)-file which connects all components

If you are interested in a **guide on how to dockerize a Magento** shop yourself you can have a look at a blog-post of Andreas Koch: [Dockerizing  Magento](https://andykdocs.de/development/Docker/Dockerize-Magento) on [AndyK Docs](https://andykdocs.de)

## Custom Configuration

All parameters of the Magento installation are defined via environment variables that are set in the [docker-compose.yml](docker-compose.yml) file - if you want to tailor the Magento Shop installation to your needs you can do so **by modifying the environment variables** before you start the project.

If you have started the shop before you must **repeat the installation process** in order to apply changes:

1. Modify the parameters in the `docker-compose.yml`
2. Shutdown the containers and remove all data (`sudo ./magento destroy`)
3. Start the containers again (`sudo ./magento start`)

### Changing the domain name

I set the default domain name to `yourdomainname.local`. To change the domain name replace `yourdomainname.local` with `your-domain.tld` in the `docker-compose.yml` file:

```yaml
installer:
  environment:
    DOMAIN: yourdomainname.local
```

### Change the MySQL Root User Password

I chose a very weak passwords for the MySQL root-user. You can change it by modifying the respective environment variables for the **mysql-container** ... and **installer** because otherwise the installation will fail:

```yaml
installer:
  environment:
    MYSQL_PASSWORD: <your-mysql-root-user-password>
mysql:
  environment:
    MYSQL_ROOT_PASSWORD: <your-mysql-root-user-password>
```

## Working with X-debug and Phpstorm
Here is what I am doing to configure X-debug on Phpstorm (tested on 2016.2.2 version)
1. First get the IP to put in your `docker-compose-override.yml` with a `ifconfig` command. (I obtain something like <IP_ADDRESS>).
2. Install and configure a plugin for Firefox : (i use [The easiest Xdebug](https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/))
   Go to Tools->Addons->Extensions->The easiest Xdebug and change your IDE-key : `phpstorm-xdebug`.
3. Configure Phpstorm :
  - Settings -> Languages and Frameworks -> PHP -> Debug -> Set the port (9000 for me)
  - Project Settings (where are the Magento sources) -> PHP -> Servers : Add server configuration of your site (`host = yourdomainname.local`)
  and add the path mapping `/some/path/for/your-project-sources` to `/var/www/html/web`
  - Go to Run->Edit configurations. Add "PHP Remote Debug" configuration, select your server (that you just added) and enter an IDE-key : `phpstorm-xdebug`.
  - Select Run->Debug... and select your remote configuration name (as you named it above)

## Working with my [Magento 1 installation based on composer](https://github.com/julienloizelet/composer-magento1.git)

If you are using composer with a repo like [mine](https://github.com/julienloizelet/composer-magento1.git) (i.e if you are me ...), beware that you have to create the `docker-compose.override.yml` with some specific volumes (see the `docker-compose.override.yml.dist` file).
You will then be able to run your composer commands once you will be in the `php` container :
- On a fresh install : run the following commands :
  - `sudo ./magento start`.
  - `sudo ./magento enter php7`
  - `composer install`
- As the `htdocs` folder is created at this moment, we have to restart container in order to have a functional volume (i.e a link between `htdocs` and `/var/www/html/web`).
So, just run `sudo ./magento destroy` and then `sudo ./magento start` again.

## Troubleshooting

  - On first `sudo ./magento start`, you may have an error :
`for nginx  Cannot start service nginx: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/nginx.sh\": permission denied"`
Workaround : before launch it again : `sudo chmod -R 777 bin`
  - On first `sudo ./magento start`, you may have an error : `magento1_installer | /bin/install.sh: line ... Text file busy`
Workaround : `sudo ./magento stop` then `sudo ./magento start`

## Contributing
If you'd like to contribute, please fork the repository and use a feature
branch. Pull requests are warmly welcome.
If you found any issue, please go [there](https://github.com/julienloizelet/docker-magento1/issues).

## Licensing
The code in this project is licensed under BSD 3-clause license.

gha_language: Shell