text:
# About `i18n` directory

These are QCubed-specific (e.g. "Core") language files for
translating the form drafts and other QControls to various
languages.

PLEASE NOTE: we need contributions for other languages!

If you have additional languages, or you see languages files
that need to be fixed/updated, please post your contributions
using GitHub.

repository: qcubed/application

gha_language: PHP

repo_name: qcubed/application


text:
# Microsoft SQL Server Reporting Services 2014 Custom Security Sample
As the other sample SQL server version are < 2014 or > 2014, I created this sample.

## Download Microsoft SQL Server 2014 + Reporting Services
Download and install ExpressAdv from:
https://www.microsoft.com/en-us/download/details.aspx?id=42299

The following path will use 🔸 to represent the install path.\
The default install path may look like:
```
C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services
```

## Original Source
https://archive.codeplex.com/?p=msftrsprodsamples

I have removed the database connection part from the sample, and hard coded the user verification to true. You may find "todoooooooooooooooooooo" from the code and replace with your custom security rule.

## Deployment
If the `Microsoft.ReportingServices.Interfaces` is missing, add it from 🔸\ReportServer\bin\Microsoft.ReportingServices.Interfaces.dll

Build and copy the following file to the specific directory:\
Logon.aspx -> 🔸\ReportServer\
UILogon.aspx -> 🔸\ReportMnager\Pages\
Microsoft.Samples.ReportingServices.CustomSecurity.dll, Microsoft.Samples.ReportingServices.CustomSecurity.pdb -> 🔸\ReportServer\bin\
Microsoft.Samples.ReportingServices.CustomSecurity.dll, Microsoft.Samples.ReportingServices.CustomSecurity.pdb -> 🔸\ReportManager\bin

## Configuration
Before modify the following configuration files, please create a copy for backup.

### 🔸\ReportServer\rsreportserver.config
Replace `Configuration.Authentication` to:
```
<Authentication>
    <AuthenticationTypes>
        <Custom/>
    </AuthenticationTypes>
    <EnableAuthPersistence>true</EnableAuthPersistence>
    <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
    <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
</Authentication>
```

Replace `Configuration.Extensions.Security` to:\
(For the `AdminConfiguration.UserName`, you may replace the value to your admin user name.)\
(Use need to assess the Report Manager by admin account for kick-up.)
```
<Security>
    <Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity" >
        <Configuration>
            <AdminConfiguration>
                <UserName>admin</UserName>
            </AdminConfiguration>
        </Configuration>
    </Extension>
</Security>
```

Replace `Configuration.Extensions.Authentication` to:
```
<Authentication>
    <Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,Microsoft.Samples.ReportingServices.CustomSecurity" />
</Authentication>
```

Replace `Configuration.UI` to:\
(Set UseSSL to false if not using SSL)\
(Set `<IP>` to your report server IP)
```
<UI>
    <CustomAuthenticationUI>
        <loginUrl>/Pages/UILogon.aspx</loginUrl>
        <UseSSL>True</UseSSL>
    </CustomAuthenticationUI>
    <ReportServerUrl>http://<IP>/ReportServer</ReportServerUrl>
</UI>
```

### 🔸\ReportServer\rssrvpolicy.config
Set `PermissionSetName="FullTrust"` to `configuration.mscorlib.security.policy.PolicyLevel.CodeGroup`
```
<CodeGroup
        class="FirstMatchCodeGroup"
        version="1"
        PermissionSetName="FullTrust">
```

Append following CodeGroup to `configuration.mscorlib.security.policy.PolicyLevel`\
(Remind: replace `<install path>` to your install path)
```
<CodeGroup
        class="UnionCodeGroup"
        version="1"
        Name="SecurityExtensionCodeGroup"
        Description="Code group for the custom security extension"
        PermissionSetName="FullTrust">
    <IMembershipCondition
            class="UrlMembershipCondition"
            version="1"
            Url="<install path>\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll" />
</CodeGroup>
```

### 🔸\ReportServer\web.config
Replace `configuration.'system.web'.authentication` to:
```
<authentication mode="Forms">
    <forms loginUrl="logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
    <deny users="?" />
</authorization>
```

### 🔸\ReportManager\rsmgrpolicy.config
Set `PermissionSetName="FullTrust"` to `configuration.mscorlib.security.policy.PolicyLevel.CodeGroup`
```
<CodeGroup
        class="FirstMatchCodeGroup"
        version="1"
        PermissionSetName="FullTrust">
```

Set `PermissionSetName="FullTrust"` where Description="This code group grants MyComputer code Execution permission. "
```
<CodeGroup
        class="FirstMatchCodeGroup"
        version="1"
        PermissionSetName="FullTrust"
        Description="This code group grants MyComputer code Execution permission. ">
```

### 🔸\ReportManager\Web.config
Replace `configuration.'system.web'.authentication` & `configuration.'system.web'.identity` to:
```
<authentication mode="Forms" />
<identity impersonate="false" />
```
Append following to `configuration.appSettings`\
(If you are using default instance: `MSSQLSERVER`, the instance name will be `RS_MSSQLSERVER`)
```
<add key="ReportServer" value="<Your PC Machine Name>"/>
<add key="ReportServerInstance" value="<Instance Name>"/>
```

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Settings

- [Languages](#languages)
- [Menu types](#menu-types)
- [Codelist](#codelist)
- [Plugins](#plugins)
- [Roles](#roles)
- [Permissions](#permissions)

## Languages

Language management provides you with the possibility to have a multi-lingual website. You can add as many languages as
you want by clicking the **Add new** button. At least one language is required for the website to work.

| Setting         | Description |
| ----------------|-------------|
| **Locale**      | Unique, usually 2-letter string, which represents the language abbreviation, eg. *en*. |
| **Label**       | Representational language title, eg. *English*. |
| **Order**       | The sort order, taken into account in administration and language selection on the website, expressed by the number, eg. *10*. |
| **Is default?** | Default language in which the website opens on first visit. Only one language can be default and if you mark this checkbox, any other language that was set as default will be un-selected. |
| **Is hidden?**  | When checked, the language will be disabled and hidden on the websites' language selection. |

## Menu types

The system allows you to create different menu types (navigations) with appropriate elements (menu items) and place
them on the website.

Let's say you want to have a main menu and a sidebar menu. For this occasion you must create a "Main menu" type and a
"Sidebar menu" type. Later on, you can assign a dedicated views (templates) for each of the menu types and style them
accordingly.

Each menu type must have a unique code, which is used in views with a custom Blade directive **@menu**.
Read more about the usage of it here. ***TODO: link to the @menu logic***

#####Code
Unique code that represents the single menu type, eg. *sidebar*.

#####Title
Representational menu type title, eg. *Main Menu*.

#####Order
The sort order, taken into account only in administration, expressed by the number, eg. *10*.

## Codelist

Codelist is a collection of grouped data items which are widely used across the administration.

On the initial installation, there are three codelist groups present: Dictionary group, Page layout and Content
position.

For example, Content position group defines all the positions that are available for positioning the content blocks
across the website. Each position is later on defined in the views.
Read more about the usage content positions here. ***TODO: link to the content positions logic***

####Codelist group

#####Code
Unique code that represents the single codelist group, eg. *content_position*.

#####Title
Representational codelist group title, eg. *Content Position*.

#####Order
The sort order, taken into account only in administration, expressed by the number, eg. *10*.

####Codelist item

#####Code
Unique code that represents the single codelist group item, eg. *center*.

#####Title
Representational codelist group item title, eg. *Center position*.

#####Order
The sort order, taken into account only in administration, expressed by the number, eg. *10*.

## Plugins

## Roles

## Permissions

repository: numencode/docs

repo_name: numencode/docs


text:
---
title: About
layout: page
---
![Profile Image]({{ site.url }}/{{ site.picture }})

I am a Software Engineer at Cerner Corporation. I grew up in India, in a small town called Aligarh. I have been living in United States since 2015. I received my Masters in Computer Science from The University of Iowa and a Bachelors degree in Computer Engineering from The Aligarh Muslim University.

 Programming

 I enjoy programming in Java, Ruby and Python. I recently got interested in functional programming and currently finding myself exploring Scala and Elixir.

Everyday, I am trying to be a better Generalist Software Engineer. I have worked full stack on web and mobile systems. I also have experience with Machine Learning, Data Science and Distributed Systems.

Skills

Java - Ruby - Swift - Python - JavaScript

Hadoop - Rails - iOS - Spark - ReactJS - Chef - AWS - Jenkins

MySQL - Scikit-Learn - NumPy - Pandas - d3JS - Tableau - Splunk

Scrum and Kanban

TDD and Continuous Integration


text:
# Owl Simple Typescript Application Template

NOTE: this template is not really in a perfect polished state... This is more
like a draft version.

This is a very basic skeleton to start an Owl application. This includes:

- _owl_ (until it is available on `npm`),
- a dev server,
- webpack configuration
- live reload
- typescript integration

## Getting started

1. copy this template wherever you need it
2. edit the `package.json` file with proper name, author, description, ...
3. `npm install` to install every dependency needed

Then you can run the `build` or `dev` scripts...

## Scripts

| Command         | Description                               |
| --------------- | ----------------------------------------- |
| `npm run build` | build the application (in `dist/` folder) |
| `npm run dev`   | starts a dev server                       |

repository: dipendra-karki/owl-templates

repo_name: dipendra-karki/owl-templates


text:
# cloudformation-operator

This is the Helm chart for the [cloudformation-operator](https://github.com/linki/cloudformation-operator)

## Prerequisites

- Kubernetes 1.17+

## Installing the chart
Create AWS resources with Kubernetes
The chart can be installed by running:

```bash
$ helm install cloudformation-operator-system helm/cloudformation-operator
```

## Configuration

The following table lists the configurable parameters of the cloudformation-operator chart and their default values.

| Parameter                 | Description                            | Default                                            |
| ------------------------- | -------------------------------------- | -------------------------------------------------- |
| `operator.region`         | The AWS_REGION to set                  | `eu-central-1`                                     |
| `image.repository`        | Container image repository             | `quay.io/linki/cloudformation-operator`            |
| `image.tag`               | Container image tag                    |                                                    |
| `image.sha`               | Container image shasum (overrides tag) |                                                    |
| `image.pullPolicy`        | Container pull policy                  | `IfNotPresent`                                     |
| `affinity`                | affinity settings for pod assignment   | `{}`                                               |
| `extraEnv`                | Optional environment variables         | `[]`                                               |
| `extraVolumes`            | Custom Volumes                         | `[]`                                               |
| `extraVolumeMounts`       | Custom VolumeMounts                    | `[]`                                               |
| `nodeSelector`            | Node labels for pod assignment         | `{}`                                               |
| `podAnnotations`          | Annotations to attach to pod           | `{}`                                               |
| `rbac.create`             | Create RBAC roles                      | `true`                                             |
| `serviceAccount.name`     | Existing ServiceAccount to use         | `cloudformation-operator`                          |                                          |
| `replicas`                | Deployment replicas                    | `1`                                                |
| `resources`               | container resource requests and limits | `{}`                                               |
| `tolerations`             | Toleration labels for pod assignment   | `[]`                                               |
| `tags`                    | You may want to assign tags to your CloudFormation stacks   | `[]`                          |
| `capability.enabled`      | Enable specified capabilities for all stacks managed by the operator instance   | `[]`      |

repository: linki/cloudformation-operator

gha_language: Go

gha_license_id: MIT

repo_name: linki/cloudformation-operator


text:
# Sonatype Lifecycle Docker Container

Sonatype Nexus Lifecycle is a Java and Javascript lifecycle manager that includes artifact and package scanning. You must have a [license](https://www.sonatype.com/nexus-lifecycle) in order to use this software.

### Basic Usage

To run the container with an exposed port on the host of 8070 (the default port of Sonatype) and a volume on the host to store the configuration data, run this command:

	$ docker run -d -p 8070:8070 -v /home/user/sonatype:/opt/sonatype/sonatype-work -v /home/user/sonatype-log:/opt/sonatype/log fastglass/sonatype-lifecycle

### Arguments

* **Exposed ports**: 8070
* **Volumes**:
 	* */sonatype-work/*: Volume to store the Sonatype data
	* */log/*: Volume to store the server logs

### Build Image

	$ docker build -t sonatype-lifecycle

**Note: This Docker container is not associated with Sonatype and is not an official container. Sonatype Lifecycle is downloaded from Sonatype's [website](https://www.sonatype.com/) in the build process.**


text:
# 2/25/2021

### Attending:

* Cary Phillips
* Christina Tempelaar-Lietz
* Joseph Goldstone
* Kimball Thurston
* Larry Gritz
* Nick Porcino
* Peter Hillman

### Discussion:

* Larry: sorting out issues with identifying dependencies when you
  have more than one version of a library installed on a system. Our
  CI doesn't test this case. If OpenEXR is installed in /usr/include
  but you want to use another one, it's not getting the -I's in the
  right order.

* Interop constructors:

  * Larry: I have a custom vector class that is already partially
    aware of Imath classes that's leading to compilation problems. Can
    probably get right of the old conversion constructs.

  * Nick: I just finished stripping out the last Eigen.

  * Larry: would like to test with MaterialX. They’re so far down
    their road that we probably can’t convince them to use Imath.  But
    interop would be nice.

* CLA's:

  * Christina: Epic is still in progress.

  * Kimball: Weta approval meeting is happening soon.

  * Joseph: No word from ARRI.

* Symbol visibility:

  * Kimball: GitHub did something weird in rebasing/merging #868.

  * Linux is fine, Windows is fine, but macOS is not because it uses a
    different kind of multi-level symbol management. Not just clang,
    it’s specific to macOS.

  * Nick: Let's discuss with George ElKoura about what they did for USD.

  * Kimball: We should make the change in Imath. It's the Vec2,3,4 and
    Matrix classes that are the real issue.

* Nick: still tripped up on the Windows install directory problem.  If
  you specify an install directory, Imath libraries don’t go to the
  right place, they try to go to C:\Program FIles (x86)\Imath which is
  a cmake-ism for default installations, as opposed to a generally
  accepted best practice, in my opinion.

* Nick: will look at the multiple python bindings.

* Include path:

  * The modern "correct" thing to do is to #include <subdir/header.h>
    but most use of OpenEXR has never done this.

  * But at least the OpenEXR headers have Imf/Imath prefix strings, so
    it hasn't been a problem to install them in one directory.

  * Proposed fix: include -I for both include *and* include/OpenEXR.

repository: TelltaleGames/openexr

repo_name: TelltaleGames/openexr


text:
# Contributing

As long as your pull request doesn't break the app in any way or conflict with an ongoing change (check the open issues first or send me [an<EMAIL_ADDRESS>to make sure this doesn't happen), it will likely be accepted. I have a lot of projects and may not get around to reviewing pull requests right away. If you have contributed to this project before and would like to be added to this repository as a collaborator, feel free to send me [an<EMAIL_ADDRESS>and ask.

## Branches

I don't use branches because I'm lazy. If you want to make a branch, feel free to do so, just be aware that I will completely ignore it and push my changes to master anyway, because I'm special.

## Build Instructions

This project has certian icon sets missing from the open source repository, as they are under a different license. This will not affect how you compile the project, as I am using the "hacky" method of getting resource ids for these icons from strings at runtime. Everything else should work as normal.

repository: m-byte/Status-VBat

repo_name: m-byte/Status-VBat


text:
In this folder a selection of files testing around RTZ 1.2 schema which specifically ADDS the option to include an extensions element within a leg element.

**10SimpleLegExtensions.rtz**
**11SimpleLegExtension.rtz**

These are RTZ 1.0 and 1.1 files which demonstrated that having a leg extension fails against the schema.

**12SimpleLegExtension.rtz**

This was used to test that the 1.2 schema change did allow leg extensions.

**12AndOldSTMSchema.rtz**

This shows that coupling 1.2 RTZ with STM extensions and the existing STM schema results in failure.

**12AndUpdatedUnofficalSTMSchema.rtz**

This shows that a new schema stm_extensions_02042020_unofficial.xsd which refers to RTZ 1.2 schema "fixes" the error.

repository: AndyNibbs/RTZ

gha_language: C#

repo_name: AndyNibbs/RTZ


text:
---
layout: page
title: Links
subtitle:
---

## Related Workshops and Conferences

-   [UITP (User Interfaces for
    Theorem Provers)](http://www.informatik.uni-bremen.de/uitp/)
    workshop series.
-   [MathUI (Mathematical
    User Interfaces)](http://www.cermat.org/events/MathUI/)
    worshop series.
-   [ITP (Interactive Theorem Proving)](http://itp2016.inria.fr/)
    conference series (evolution/merger of
    [TPHOLs](http://isabelle.in.tum.de/nominal/activities/tphols09/) and others).
-   [MKM (Mathematical Knowledge Management)](http://www.mkm-ig.org/)

## Related Projects, Present and Past

-   [ProofWeb](http://prover.cs.ru.nl/wiki.php) is a web-based interface
    to interactive theorem provers run on a server. It is being enhanced
    towards a Wiki for formalized mathematics.
-   [I3P](http://www-pu.informatik.uni-tuebingen.de/i3p/) is an
    IDE-based interface for Isabelle using Proof
    General-style interaction. It's perhaps in a more robust state than
    our own [Proof General Eclipse](http://proofgeneral.inf.ed.ac.uk/eclipse) prototype.
-   As a possible foundation for generic proof environments,
    [OpenMath](http://www.openmath.org/society/) is a
    standard representation form for mathematical objects, which links
    in with the [MathML](http://www.w3.org/Math/) markup language.
-   [Prosper](http://www.dcs.gla.ac.uk/prosper/) was a project to
    develop an extensible, open proof tool architecture for
    incorporating formal verification into industrial CAD/CASE tool
    flows and design methodologies. The tools include novel
    user-friendly interfaces.
-   [Isamode](http://homepages.inf.ed.ac.uk/da/Isamode) was an XEmacs
    front-end for Isabelle. It had a different feature collection
    compared with Proof General: script management wasn't supported, but
    menus and shortcuts provided one of the first widely used enhanced
    interfaces for Isabelle.
-   [CtCoq](http://www-sop.inria.fr/croap/ctcoq/ctcoq-eng.html) was an
    interface for the Coq theorem prover, developed at INRIA, Sophia
    Antipolis, as part of [Projet
    CROAP](http://www-sop.inria.fr/croap/). Like Proof General, CtCoq
    used a general approach for building user-interfaces for
    theorem provers. Unlike Proof General, CtCoq is based on a graphical
    environment with structure editing, created with the
    [Centaur](http://www-sop.inria.fr/croap/centaur/centaur.html) system.
-   [OMEGA](http://www.ags.uni-sb.de/~omega/) is a collection of
    web-based distributed tools for supporting theorem proving.

gha_language: CSS


text:
---
title: "Hooks"
id: "hooks"
---

## Overview

Hooks are user-specified SQL commands that can be executed at certain times during a run. In practice, this can be useful when performing a large number of tasks such as running grant statements, adding indices, logging, and performing table maintenance operations.

dbt supports hooks on six specific events:

- at the beginning of a run
- at the end of a run
- before a model runs
- after a model runs
- before a seed runs
- after a seed runs

All hooks types are supported on:
 - Postgres
 - Redshift
 - BigQuery
 - Snowflake

## Configuring hooks

Hooks are configured in `dbt_project.yml` as such:

```yaml
# run hooks
on-run-start:
    - "create table if not exists audit (model text, state text, time timestamp)"
on-run-end:
    - 'grant usage on schema "{{ target.schema }}" to db_reader'
    - 'grant select on all tables in schema "{{ target.schema }}" to db_reader'

# model hooks
models:
    project-name:
        pre-hook: "-- some prehook sql here"
        post-hook: "grant select on {{ this }} to db_reader"

# seed hooks
seeds:
    project-name:
        pre-hook: "-- some prehook sql here"
        post-hook: "grant select on {{ this }} to db_reader""
```

Model-level hook configuration applies, like all configuration, to the scope in which it is defined in the model hierarchy. Model hooks can also be configured within a given model as shown below. Note that the `pre-hook` and `post-hook` keywords both contain `-` characters making them invalid identifiers. Instead, use the keys `pre_hook` and `post_hook` to specific hooks inside of a model `config` block:

<Callout type="info" title="New in dbt v0.12.2">

The `pre_hook` and `post_hook` aliases are new in dbt v0.12.2. If you're using a previous version of dbt, you can use the "dict" syntax when calling config.

</Callout>

```sql
-- For a single hook, use a string
{{
  config(
    post_hook="grant select on {{ this }} to db_reader"
  )
}}

-- For multiple hooks, use a list of strings
{{
  config(
    post_hook=[
      "grant usage on {{ this.schema }} to db_reader",
      "grant select on {{ this }} to db_reader"
    ]
  )
}}"
```

Hooks are extremely powerful, allowing analysts to perform tasks such as inserting records into audit tables, executing `GRANT` statements, and running `VACUUM` commands, among others.

### Using hooks to grant

Because many dbt model configurations result in dbt dropping and then recreating database objects with every `dbt run`, it's important to ensure that appropriate users have access to `SELECT` from these models. Hooks address this: the following configurations will run a `GRANT` statement for every model and seed in the project:

```yaml
models:
    project-name:
        post-hook: "grant select on {{this}} to looker_user"

seeds:
    project-name:
        post-hook: "grant select on {{this}} to looker_user""
```

Alternately, configure this as a post-run hook:

```yaml
on-run-end:
    - 'grant usage on schema "{{ target.schema }}" to db_reader'
    - 'grant select on all tables in schema "{{ target.schema }}" to db_reader'"
```

### Using hooks to create an audit table

Here's an example of how to use hooks to insert records into an audit table for every model before and after it is built.

```yaml
models:
  project-name:
    pre-hook: "insert into _dbt.audit (event_name, event_timestamp, event_schema, event_model) values ( 'starting model deployment', getdate(), '{{this.schema}}', '{{this.name}}')"
    post-hook: "insert into _dbt.audit (event_name, event_timestamp, event_schema, event_model) values ( 'completed model deployment', getdate(), '{{this.schema}}', '{{this.name}}')""
```

### Using hooks to vacuum

Incremental models can be configured to both insert new records and update existing records. In practice, updating existing records functions as a delete and insert. In Amazon Redshift, this will, over time, result in a poorly-optimized table. To address this, developers can include a post-hook to perform a vacuum command.

Importantly, Redshift (and Postgres) require that `vacuum` and `analyze` run outside of a transaction. To indicate that a hook should run outside of a transaction, either 1) use the long-form hook interface or 2) use the `after_commit` shortcut:

```sql
{{
  config(
    post_hook=[
      after_commit("vacuum {{this.schema}}.{{this.name}}"),
      {"sql": "vacuum {{this.schema}}.{{this.name}}", "transaction": False}
     ]
  )
}}

select ..."
```

It's possible to use this strategy to perform other database maintenance tasks on dbt models such as `analyze`.

## Multiple hooks and execution ordering

Multiple instances of any hook may be defined. In this case, dbt will run each hook using the following ordering:

- Hooks from dependent packages will be run before hooks in the active package.
- Hooks defined within the model itself will be run before hooks defined in `dbt_project.yml`.
- Hooks within a given context will be run in the order in which they are defined.


text:
## All the Places Patterns Can Be Used

Patterns pop up in a number of places in Rust, and you’ve been using them a lot
without realizing it! This section discusses all the places where patterns are
valid.

### `match` Arms

As discussed in Chapter 6, we use patterns in the arms of `match` expressions.
Formally, `match` expressions are defined as the keyword `match`, a value to
match on, and one or more match arms that consist of a pattern and an
expression to run if the value matches that arm’s pattern, like this:

```text
match VALUE {
    PATTERN => EXPRESSION,
    PATTERN => EXPRESSION,
    PATTERN => EXPRESSION,
}
```

One requirement for `match` expressions is that they need to be *exhaustive* in
the sense that all possibilities for the value in the `match` expression must
be accounted for. One way to ensure you’ve covered every possibility is to have
a catchall pattern for the last arm: for example, a variable name matching any
value can never fail and thus covers every remaining case.

A particular pattern `_` will match anything, but it never binds to a variable,
so it’s often used in the last match arm. The `_` pattern can be useful when
you want to ignore any value not specified, for example. We’ll cover the `_`
pattern in more detail in the [“Ignoring Values in a
Pattern”][ignoring-values-in-a-pattern] section later in this
chapter.

### Conditional `if let` Expressions

In Chapter 6 we discussed how to use `if let` expressions mainly as a shorter
way to write the equivalent of a `match` that only matches one case.
Optionally, `if let` can have a corresponding `else` containing code to run if
the pattern in the `if let` doesn’t match.

Listing 18-1 shows that it’s also possible to mix and match `if let`, `else
if`, and `else if let` expressions. Doing so gives us more flexibility than a
`match` expression in which we can express only one value to compare with the
patterns. Also, the conditions in a series of `if let`, `else if`, `else if
let` arms aren’t required to relate to each other.

The code in Listing 18-1 shows a series of checks for several conditions that
decide what the background color should be. For this example, we’ve created
variables with hardcoded values that a real program might receive from user
input.

Filename: src/main.rs

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-01/src/main.rs}}
```

Listing 18-1: Mixing `if let`, `else if`, `else if let`,
and `else`

If the user specifies a favorite color, that color is the background color. If
today is Tuesday, the background color is green. If the user specifies
their age as a string and we can parse it as a number successfully, the color
is either purple or orange depending on the value of the number. If none of
these conditions apply, the background color is blue.

This conditional structure lets us support complex requirements. With the
hardcoded values we have here, this example will print `Using purple as the
background color`.

You can see that `if let` can also introduce shadowed variables in the same way
that `match` arms can: the line `if let Ok(age) = age` introduces a new
shadowed `age` variable that contains the value inside the `Ok` variant. This
means we need to place the `if age > 30` condition within that block: we can’t
combine these two conditions into `if let Ok(age) = age && age > 30`. The
shadowed `age` we want to compare to 30 isn’t valid until the new scope starts
with the curly bracket.

The downside of using `if let` expressions is that the compiler doesn’t check
exhaustiveness, whereas with `match` expressions it does. If we omitted the
last `else` block and therefore missed handling some cases, the compiler would
not alert us to the possible logic bug.

### `while let` Conditional Loops

Similar in construction to `if let`, the `while let` conditional loop allows a
`while` loop to run for as long as a pattern continues to match. The example in
Listing 18-2 shows a `while let` loop that uses a vector as a stack and prints
the values in the vector in the opposite order in which they were pushed.

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-02/src/main.rs:here}}
```

Listing 18-2: Using a `while let` loop to print values
for as long as `stack.pop()` returns `Some`

This example prints 3, 2, and then 1. The `pop` method takes the last element
out of the vector and returns `Some(value)`. If the vector is empty, `pop`
returns `None`. The `while` loop continues running the code in its block as
long as `pop` returns `Some`. When `pop` returns `None`, the loop stops. We can
use `while let` to pop every element off our stack.

### `for` Loops

In Chapter 3, we mentioned that the `for` loop is the most common loop
construction in Rust code, but we haven’t yet discussed the pattern that `for`
takes. In a `for` loop, the pattern is the value that directly follows the
keyword `for`, so in `for x in y` the `x` is the pattern.

Listing 18-3 demonstrates how to use a pattern in a `for` loop to destructure,
or break apart, a tuple as part of the `for` loop.

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-03/src/main.rs:here}}
```

Listing 18-3: Using a pattern in a `for` loop to
destructure a tuple

The code in Listing 18-3 will print the following:

```console
{{#include ../listings/ch18-patterns-and-matching/listing-18-03/output.txt}}
```

We use the `enumerate` method to adapt an iterator to produce a value and that
value’s index in the iterator, placed into a tuple. The first value produced is
the tuple `(0, 'a')`. When this value is matched to the pattern `(index,
value)`, `index` will be `0` and `value` will be `'a'`, printing the first line
of the output.

### `let` Statements

Prior to this chapter, we had only explicitly discussed using patterns with
`match` and `if let`, but in fact, we’ve used patterns in other places as well,
including in `let` statements. For example, consider this straightforward
variable assignment with `let`:

```rust
let x = 5;
```

Throughout this book, we’ve used `let` like this hundreds of times, and
although you might not have realized it, you were using patterns! More
formally, a `let` statement looks like this:

```text
let PATTERN = EXPRESSION;
```

In statements like `let x = 5;` with a variable name in the `PATTERN` slot, the
variable name is just a particularly simple form of a pattern. Rust compares
the expression against the pattern and assigns any names it finds. So in the
`let x = 5;` example, `x` is a pattern that means “bind what matches here to
the variable `x`.” Because the name `x` is the whole pattern, this pattern
effectively means “bind everything to the variable `x`, whatever the value is.”

To see the pattern matching aspect of `let` more clearly, consider Listing
18-4, which uses a pattern with `let` to destructure a tuple.

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-04/src/main.rs:here}}
```

Listing 18-4: Using a pattern to destructure a tuple and
create three variables at once

Here, we match a tuple against a pattern. Rust compares the value `(1, 2, 3)`
to the pattern `(x, y, z)` and sees that the value matches the pattern, so Rust
binds `1` to `x`, `2` to `y`, and `3` to `z`. You can think of this tuple
pattern as nesting three individual variable patterns inside it.

If the number of elements in the pattern doesn’t match the number of elements
in the tuple, the overall type won’t match and we’ll get a compiler error. For
example, Listing 18-5 shows an attempt to destructure a tuple with three
elements into two variables, which won’t work.

```rust,ignore,does_not_compile
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-05/src/main.rs:here}}
```

Listing 18-5: Incorrectly constructing a pattern whose
variables don’t match the number of elements in the tuple

Attempting to compile this code results in this type error:

```console
{{#include ../listings/ch18-patterns-and-matching/listing-18-05/output.txt}}
```

If we wanted to ignore one or more of the values in the tuple, we could use `_`
or `..`, as you’ll see in the [“Ignoring Values in a
Pattern”][ignoring-values-in-a-pattern] section. If the problem
is that we have too many variables in the pattern, the solution is to make the
types match by removing variables so the number of variables equals the number
of elements in the tuple.

### Function Parameters

Function parameters can also be patterns. The code in Listing 18-6, which
declares a function named `foo` that takes one parameter named `x` of type
`i32`, should by now look familiar.

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-06/src/main.rs:here}}
```

Listing 18-6: A function signature uses patterns in the
parameters

The `x` part is a pattern! As we did with `let`, we could match a tuple in a
function’s arguments to the pattern. Listing 18-7 splits the values in a tuple
as we pass it to a function.

Filename: src/main.rs

```rust
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-07/src/main.rs}}
```

Listing 18-7: A function with parameters that destructure
a tuple

This code prints `Current location: (3, 5)`. The values `&(3, 5)` match the
pattern `&(x, y)`, so `x` is the value `3` and `y` is the value `5`.

We can also use patterns in closure parameter lists in the same way as in
function parameter lists, because closures are similar to functions, as
discussed in Chapter 13.

At this point, you’ve seen several ways of using patterns, but patterns don’t
work the same in every place we can use them. In some places, the patterns must
be irrefutable; in other circumstances, they can be refutable. We’ll discuss
these two concepts next.

[ignoring-values-in-a-pattern]:
ch18-03-pattern-syntax.html#ignoring-values-in-a-pattern

repository: rust-lang-cn/book-cn

gha_language: Rust

repo_name: rust-lang-cn/book-cn


text:
# Tango Card RaaS API Client for v2

[![GoDoc](https://godoc.org/github.com/saadullahsaeed/go-tangocard?status.svg)](https://godoc.org/github.com/saadullahsaeed/go-tangocard/lib)

Golang client for the Tangocard RaaS API v2.

This is a Work in Progress and I've so far only implemented the methods I needed for my project.

repository: saadullahsaeed/go-tangocard

repo_name: saadullahsaeed/go-tangocard


text:
---
title: Screen recording of Android UI testing using Script Steps
redirect_from:
- ''
date: 2019-01-14 12:57:07 +0000
published: false

---
You can run your UI test specific to your app and have the whole process screen recorded using one Bitrise workflow. Let's see how to put together a workflow using our `AVD Manager`, `Wait for Android Emulator` and `Script` Steps! Here is an example workflow containing the steps we will use in this guide:

![](/img/screenrecording-workflow-avd.png)

1. Add the `AVD Manager` Step at the beginning of your workflow (as a first step) to create and run an Android Virtual Device.
2. Add the `Wait for Android Emulator` Step after the `AVD Manager` Step. This Step makes sure that the Android emulator has finished booting before the screen recording would start.
3. Add a `Script` Step after the `Wait for Android Emulator` Step. (We're renaming this `Script` Step as `Start screen recording` Step to distinguish the functional difference between the 3 `Script` Steps in this workflow.)
   * Insert the following commands to the `Script content` input field:

          $ANDROID_HOME/platform-tools/adb shell "screenrecord /sdcard/video.mp4 --verbose" &> $BITRISE_DEPLOY_DIR/logs.txt &
          disown

          $ANDROID_HOME/platform-tools/adb shell "screencap -p /sdcard/screen.png" &> $BITRISE_DEPLOY_DIR/logs.txt &
          disown

   `Start screen recording` Step kills two birds with one stone:
   * starts screen recording before UI test is running
   * captures a screenshot of the emulator screen BEFORE UI tests would start
4. Add another `Script` Step after the `Start screen recording` Step. (We will call it `Run UI test` Step.)
   * Add your script (for example, Maven, npm or Appium tests) in the `Script content` input field to call and run your UI test.
5. Insert the third `Script` Step (`Stop Screen recording,get file`) after the `Run UI tests` Step.
   * Add the following script to the `Script content` input field.

          $ANDROID_HOME/platform-tools/adb shell "killall -INT screenrecord"
          sleep 10
          $ANDROID_HOME/platform-tools/adb pull /sdcard/video.mp4 $BITRISE_DEPLOY_DIR/video.mp4
          adb pull /sdcard/screen.png $BITRISE_DEPLOY_DIR/

          $ANDROID_HOME/platform-tools/adb shell "screencap -p /sdcard/screen2.png" &> $BITRISE_DEPLOY_DIR/logs.txt &
          disown
          adb pull /sdcard/screen2.png $BITRISE_DEPLOY_DIR/

   As the title suggests, this Step:
   * stops the screen recoding,
   * gets the screen recording,
   * gets those Emulator screenshots that were taken before UI tests had started
   * gets the final screenshot of the Emulator screen/ from the Emulator and places The Step places these files in  `BITRISE_DEPLOY_DIR` path.

No such process and Encoder failed (err=-38). If you get below error messages `Stop Screen recording,get file` Step, the screen resolution of the screen recording and the device does not match.

       /opt/android-sdk-linux/platform-tools/adb shell 'killall -INT screenrecord' killall: screenrecord: No such process

       Encoder failed (err=-38)

You can fix it:

* Check if you have the right resolution set in the `Resolution` field of the `AVD Manager` Step. ![](/img/screen-resolution-avd-manager.png)
* If you're not using the `AVD Manager` Step and start the emulator with a `Script` Step, then you can fix the screen size conflict in the `Script content` field of the `Start screen recording` Step with this short addition:

      --size <WIDTHxHEIGHT>

1. Add the `Deploy to Bitrise.io - Apps, Logs, Artifacts` Step to your workflow to export all files stored in the BITRISE_DEPLDIR (If you did not place the files in this directory, they will not be deployed to the APPS & ARTIFACTS tab of your Build's page.)

repository: ryujiowan/devcenter

repo_name: ryujiowan/devcenter


text:
# RAIIGen
Scan Vulkan, OpenCL, OpenGLES and OpenVX headers and generate useful C++11 RAII classes.

Experimental project to experiment a bit with libclang and generate some useful RAII classes.
The main goal of this is to experiment and see whats possible, so nothing has been polished. The end goal is just to have something that is 'good enough'.

All forked versions of the code must include the original "##AG_TOOL_STATEMENT##" line in the generated code.
This means that all generated code contains a line like this:

// Auto-generated OpenCL 1.1 C++11 RAII classes by RAIIGen (https://github.com/Unarmed1000)

The exact format depends on which API and tool version was used.

All released auto generated files must include the corrosponding 'RAIIGenVersion.txt' file.
All forked versions of the code must leave the original first line of 'RAIIGenVersion.txt' intact, but are free to add additional lines to the file.

LICENSE: BSD 3-Clause License


text:
[![Gem Version](https://badge.fury.io/rb/scoreboard.svg)](https://badge.fury.io/rb/scoreboard) [![Code Climate](https://codeclimate.com/github/jbavari/scoreboard-cli/badges/gpa.svg)](https://codeclimate.com/github/jbavari/scoreboard-cli) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jbavari/scoreboard-cli/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jbavari/scoreboard-cli/?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/grade/ed148b6b39084a2d980fa41d721b4e49)](https://www.codacy.com/app/jbavari/scoreboard-cli) [![Build Status](https://scrutinizer-ci.com/g/jbavari/scoreboard-cli/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jbavari/scoreboard-cli/build-status/master)

# Scoreboard

Install the gem: `gem install scoreboard`.

## Dive in the code

To get started, clone this repo.

```
bundle install
bundle exec bin/scoreboard
```

Score your teams.

## API

The API server sits separately from this repo, and lives [scoreboard-api repo](https://github.com/jbavari/scoreboard-api).

## Dashboard

There is an accompanying dashboard that gets data from this tool, see the [scoreboard-dashboard](https://github.com/jbavari/scoreboard-dashboard).

repository: jbavari/scoreboard-cli

repo_name: jbavari/scoreboard-cli


text:
---
path: "/tips/post-9"
date: "2019-07-11"
title: "Using CSS Media Queries to target different browsers and different devices"
languages: ['CSS']
img: 'https://res.cloudinary.com/duejrcpct/image/upload/q_auto/f_auto/w_1000/v1586600478/tips/9-1_zqr1tb.jpg'
description: 'Creating CSS Media Queries to target different browsers and different devices'
number: 9
status: true
---

Media queries are awesome. They basically allow you to use some CSS if only specific criteria are being met. The most common use, at least for me, is when dealing with responsive web design - you can apply specific CSS rules only for smaller screens, for example.
That being said, there are lot more types of media queries. Here i'll just show you the ones i use the most.

 ```css
/* STYLES WILL BE APPLIED IF BROWSER VIEWPORT HAS A MAXIMUM WIDTH OF 800PX */

@media only screen and (max-width: 800px){
    p{
        color:brown;
    }
}

/* STYLES WILL BE APPLIED IF BROWSER VIEWPORT HAS A MAXIMUM HEIGHT OF 600PX */

@media only screen and (max-height: 600px){
    p{
        color:violet;
    }
}

/* STYLES WILL BE APPLIED IF BROWSER VIEWPORT HAS A MAXIMUM HEIGHT OF 600PX AND
A MAXIMUM WIDTH OF 800PX*/

@media only screen and (max-height: 600px) and (max-width:600px){
    p{
        color:green;
    }
}

/* STYLES WILL BE APPLIED IF BROWSER VIEWPORT HAS A MAXIMUM WIDTH OF 600PX
OR A MINIMUM WIDTH OF 1000PX */

@media only screen and (max-width: 600px), (min-width:1000px){
    p{
        color:lightblue;
    }
}
 ```

Most media queries follow this structure : '@media only screen and ([YOUR RULE]){ CSS HERE }'. You can add more rules and combine them to suit your needs.

 ```css

/* STYLES WILL BE APPLIED IF BROWSER IS CHROME (29+) */

@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
    p{
        color:red;
    }
}

/* STYLES WILL BE APPLIED IF BROWSER IS SAFARI (10.1+) */

@media not all and (min-resolution:.001dpcm) {
    p{
        color:pink;
    }
}

/* STYLES WILL BE APPLIED IF WEBPAGE IS BEING PRINTED */

@media print {
    p{
        color:black;
    }
}

 ```

Look at the media queries in this post and you'll se how to use them for: . setting CSS for responsive concerns; . setting CSS for specific browsers; . setting CSS only when the website is in 'printing' mode;

gha_language: JavaScript


text:
---
sku: 1017008
name: Game Board
---

## ***Introduction***

![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/game-board.png)

The Open Game Station Player kit contains all the parts you need to build an Arduboy game controller.

### ***Kit Contents***
* Game board
* Carduino 32U4
* Buzzer card
* AAA battery card
* OLED display card
* Acrylic spacer plate
* Screws and standoffs

### ***Required Accessories***
* Two AAA batteries (alkaline or rechargable)

### ***Assembly Tools***
* 3mm Allen Wrench (hex key)

## ***Game Board***
The game board provides the base for the game board controller and features all the control buttons that can be found on the original Arduboy game controller. Following figure shows the things you can see on the front of the game board.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/game-board-parts.png)

* Edge connector slots: Allow to plug cards such as Carduino, buzzer card, OLED display card, AAA battery card.
* Joystick buttons
* Control buttons

The cards provided with the game board kit features following:

* Carduino 32U4: This is the microcontroller of the game board and powered with the Arduino Leonardo bootloader. You can upload any Arduboy game into the Carduino.
* Buzzer card: Provides sounds for game events
* AAA battery card: Provides portable power to your game controller
* OLED display card: This is the gaming screen.

### ***Assembly***
This section will guide you to through assembling the Open Game Station Player Kit into a complete Arduboy game controller.

* Take the  acrylic spacer plate. If you want, peel the protective paper masking off both sides of the acrylic spacer plate. Alternatively, you can leave the masking on for additional thickness.

* Attach the four brass standoffs onto the acrylic spacer plate. The standoffs should be screwed into the holes from the bottom of the plate.

* Place the game board on top of the brass standoffs. The standoffs should be screwd into the holes from the top of the game board.

* Take the AAA battery card, insert two AAA batteries, and plug it in to a vertically mounted edge connector slot as shown in the following figure. The white arrow head printed on the card should be pointing toward the white arrow head printed near the edge connector. Make sure you have the battery card switched to the OFF position.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/20190502_075315.jpg)

* Take the Buzzer card and plug it into a vertically mounted edge connector slot.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/20190502_075355.jpg)

* Take the Carduino 32U4 card and plug it into a vertically mounted edge connector slot. Slide the switch on the Carduino to the D7 / 8 (game board) position.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/20190502_075426.jpg)

* Take the OLED display card. Remove the protective film by gently pull up on the tab.

* Plug the OLED display card into the horizontally mounted edge connector slot on the game board.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/20190502_075503.jpg)

Following figure shows the completed assembly of the Arduboy Game Controller.

## ***Installing the Arduboy Uploader***
> **_NOTE:_**  This installation guide is applicable to the Windows operating system.

Arduboy Uploader simplifies uploading new game to your Carduino 32U4.

* First, install the Arduino software on your computer to get the requied USB drivers. You can download the Arduino software from https://www.arduino.cc/en/Main/Software#download.
* Then download the Arduboy Uploader from https://github.com/eried/ArduboyUploader/releases/tag/1.3.1. At the time of this writing, the Arduboy Uploader version is 1.3.1. You can choose between the Installer (.exe) and the Zip packages.

### ***Installer***
We suggest you use the installer that installs directly everything you need to use the Arduboy Uploader.

* Click on the ArduboyUploader_setup.exe.

 ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-1.png)

* After downloading the setup, run the installer from your computer.

* Click I accept the agreement and then click Next.

 ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-2.png)

* Choose all the additional tasks and then click Next.

![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-3.png)

* Click Install.

 ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-4.png)

* Click Yes to associate the .hex files with Arduboy Uploader.

 ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-5.png)

* Click Yes to associate the .arduboy files with the Arduboy Uploader.

 ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-6.png)

* Click Yes to associate the arduboy protocol with the Arduboy Uploader.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-7.png)

* All done. Click Finsh to close the wizard.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-8.png)

* Don’t run the Arduboy Uploader yet.

### ***Zip package***
The Zip file is useful if you want to create a portable installation.

* Click on the abupload_nosetup.zip.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-9.png)

* After downloading, extract the zip file into your hard drive.

* Next, run the Register associations as Adminstrator.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-10.png)

* You will get the following output on command window.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-11.png)

* Click Yes to associate the .hex files with Arduboy Uploader.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-5.png)

* Click Yes to associate the .arduboy files with the Arduboy Uploader.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-6.png)

* Click Yes to associate the arduboy protocol with the Arduboy Uploader.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-7.png)

* All done. Now you can close the command window.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-installer-12.png)

* Don’t run the Arduboy Uploader yet.

## ***Uplaoding a Game to the Carduino***
You will be uploading the game, Blackjack from the Erwin's Arduboy Collection. You can use one of the following options to upload the game.

* Directly from the website with a single click.
* Using hex file of the game.

### ***Directly from the Website***
* Connect the Carduino 32U4 to your computer using a Type-C USB cable.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/usb-connect.png)

* Go to the https://arduboy.ried.cl/ . Scroll down the page until you find the game, Blackjack.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/blackjack-1.png)

* Click Upload to my Arduboy.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/blackjack-2.png)

* During the transferring of the game to your Carduino, the Arduboy Uploder shows the following animation on your computer.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-msg-1.png)

* Once uploaded, you can see the following animation on your computer.

### ***Using hex File of the Game***
You can upload a game to the Carduino using the hex file of the game with Arduboy Uploader.

* Download the hex file of the game. Right-click on the Download hex button and from the short-cut menu, click Save link as… Then save the file on your computer’s hard drive.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/blackjack-3.png)

* Run the Arduboy uploader from the desktop (for installer) or run the abupload (for zip package).

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-1.png)

* Choose the downloaded hex file of your game and click Open.

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-2.png)

* During the transferring of the game to your Carduino, the Arduboy Uploder shows the following animation on your computer.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-msg-2.png)

* Once uploaded, you can see the following animation on your computer.

## ***Get Ready for Gaming***
* First, remove the Type-C USB cable from the Carduino.

* Then slide the power switch of the AAA battery card to the ON position.

* Woohoo! Press Play to start the game.

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/game-screen-1.png)

## ***Useful Messages***
* Searching for an Arduboy game controller

* Uploading a game to Arduboy

  ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-msg-1.png)

* No Arduboy found error

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-msg-3.png)

* Input file is invalid

* Error transferring the file

   ![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1017008/abu-msg-4.png)

## ***Resources***
* Eagle Files: https://github.com/Longan-Labs/EagleFile_Cards/tree/master/1016008_Game_Board
* The official Arduboy web site: https://arduboy.com/

gha_language: SCSS


text:
#### Estimation in T-Shirt Sizes

T-Shirt sizing has one major advantage, that it can help avoid overly solutioning the Epics.  Therefore, it can be quicker.  It also has less baggage in terms of timeline as it does not have one (though we'll teach you how to do ne later).

In this method we have 5 size categories;

- XS - Extra Small
- S - Small
- M - Medium
- L - Large
- XL - Extra Large

Similar to the above a great way to estimate and create size lanes for Epic index cards as above, only using the T-Shirt size categories.

The hardest thing about T-Shirt estimates is getting started, so here's some techniques that help us;

- Scan the Epic list and find the smallest potential Epic.  That's an XS (Extra Small).  If you find that there are even smaller Epics, then consider rescaling (mode XS to S, S to M, M to L, etc)
- Pick any Epic and make that a M (Medium).  Then size all other Epics relative to that one.  If we find Epics are piling up to the left or right ot the first medium, then we might want to shift the scale.

As with estimating in developer days, reflect often, does the scale need to change, are previous assumptions still valid, do all the Mediums all look around the same size.  Remember, whatever answer you give will likely be wrong, don't sweat it, the errors will average out and the velocity we calculate later will provide a truer guide.

[TODO] Image

**What if I have an Epic that's off the scale**

Consider 1 of 2 things

 1) Break it into smaller Epics

 2) Move the scale

We'll talk more about how to turn these estimates into a roadmap later.

url: https://raw.githubusercontent.com/garygreenBAD/RRPD-2/cfd15fe25aaf328b28a03747df87fba5e87c0c21/08 Deliver/01 Inception/03 Epic Estimation/02 T-Shirt Sizes.md

filename: 02 T-Shirt Sizes.md


text:
cocos2dx-win8
---------------------

cocos2dx-win8 is a branch of [cocos2d-x][1] and licensed under MIT. It allows you create or port cocos2d Windows8 metro style games easily and quickly.

System requirments
---------------------

**Supported operating systems:**

Windows 8 RP Build 8400 x86/x64, **ARM** is not supported now.

**Visual Studio:**

Visual Studio 2012 RC

SimpleGame
--------------------

Here is a [simpleGame][3] on github.

Document
---------------------

   * Website: www.cocos2d-x.org
   * [Online API References][2]

Contact us
---------------------

   * Forum: http://forum.cocos2d-x.org

[1]: http://www.cocos2d-x.org "cocos2d-x"
[2]: http://www.cocos2d-x.org/embedded/cocos2d-x/classes.html "API References"
[3]: https://github.com/lihex/SimpleGameCocos2dxWin8 "SimpleGame"


text:
### [CVE-2016-9446](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9446)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The vmnc decoder in the gstreamer does not initialize the render canvas, which allows remote attackers to obtain sensitive information as demonstrated by thumbnailing a simple 1 frame vmnc movie that does not draw to the allocated render canvas.

### POC

#### Reference
- http://www.openwall.com/lists/oss-security/2016/11/18/12
- http://www.openwall.com/lists/oss-security/2016/11/18/13
- https://bugzilla.gnome.org/show_bug.cgi?id=774533
- https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst/vmnc/vmncdec.c?id=4cb1bcf1422bbcd79c0f683edb7ee85e3f7a31fe
- https://scarybeastsecurity.blogspot.de/2016/11/0day-poc-risky-design-decisions-in.html

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
## this

When a function is invoked an execution context is created.
It contains information about:
1. Where the function was called from (the call-stack)
1. How the function was invoked
1. What parameters were passed, ...

One of the properties of this record is the ```this``` reference,
which will be used for the duration of that function's execution.

## 4 rules of call-site:

### 1. Default Binding:
```this``` inside of function:

1.1 ```strict mode```: ```this``` is set to ```undefined```

1.2 otherwise ```this``` is refers to ```window```

### 2.Implicit Binding:

```this``` inside of function refers to contained object:
```js
function foo() {
	console.log( this.a );
}

var obj = {
	a: 2,
	foo: foo
};

obj.foo(); // 2
```

Related to ```Implicitly Lost```, when inner function is assigned to another var as ref and lost context,
like with ```setTimeout``` problem.

### Explicit Binding:

1. ```call(..)```
1. ```apply(..)```
1. ```bind(..)```

bind(..) returns a new function that is hard-coded to call the original function
with the this context set as you specified:

```js
function bind(fn, obj) {
	return function() {
		return fn.apply( obj, arguments );
	};
}
```

### ```new``` Binding:

```js
function foo(a) {
	this.a = a;
}

var bar = new foo( 2 );
console.log( bar.a ); // 2
```

! Arrow functions adopts the ```this``` binding from the enclosing (function or global) scope.

repository: PavlyukVadim/javascript-dictionary

path: /JS Core/This.md

repo_name: PavlyukVadim/javascript-dictionary


text:
I built a project for this problem with React.js and Youtube Data API v3.
**Here is what you need and its open source !!!**

# ⛓ How does work ?

This project powered by Youtube Data API v3. In `'src/components/navbar/navbar.jsx'` you can see what i did for api [#25].

## ✍🏼 Client Side

My client side powered by `react-bootstrap`, for communication with API i used `axios`.So quite understandable i think.

## ⚙ Server Side

🛠 Server side is still in work in process but i'll write it with `Node.js`, `Fastify` and `Socket.io` 🛠

# How to install ?

```sh
npm install
```
> Then...
```sh
npm start
```
**Its done ! 🎉**

# 🔎 Is there a mistake or a line that you can make better quality?

repository: Magicianred/watch-video-together

repo_name: Magicianred/watch-video-together


text:
# Code

## Step 1: Add the Kitronik package

Kitronik published a set of blocks to use their motor driver. We need to add it to our project.

* Click on **Advanced**
* Click **Add Package**
* Type ``kitronik``, press **Enter**
* Select the **kitronik-motor-driver** package

After the package gets loaded, you should see a new **Kitronik" category in the toolbox.

## Step 2: Round and round we go!

https://youtu.be/pD6tM1nXCPA

The first program will have the car drive in a circle for 5 seconds when the user presses button ``A``.
This is simply done by turning both motor controllers on for 5 seconds.

```blocks-ignore
input.onButtonPressed(Button.A, () => {
    basic.showIcon(IconNames.Happy)
    kitronik.motorOn(kitronik.Motors.Motor1, kitronik.MotorDirection.Reverse, 100)
    kitronik.motorOn(kitronik.Motors.Motor2, kitronik.MotorDirection.Forward, 100)
    basic.pause(5000)
    kitronik.motorOff(kitronik.Motors.Motor1)
    kitronik.motorOff(kitronik.Motors.Motor2)
    basic.showIcon(IconNames.SmallDiamond)
})
```

### ~ hint

Make sure to unplug the @boardname@ from the Edge connector while your are connecting it to your computer to avoid any kind of electrical problem.

### ~

Depending on how you've connected your cables to the motor driver, your car may be going backward instead of forward.
You can either swap the cables or change your code to account for that.

## Step 3: Figure Eight

https://youtu.be/agor9wtiAkE

Instead of stopping after 5 seconds, we reverse the steering motor to turn the other direction. This will create a figure eight trajectory.

```blocks-ignore
input.onButtonPressed(Button.A, () => {
    basic.showIcon(IconNames.Happy)
    kitronik.motorOn(kitronik.Motors.Motor1, kitronik.MotorDirection.Reverse, 100)
    kitronik.motorOn(kitronik.Motors.Motor2, kitronik.MotorDirection.Forward, 100)
    basic.pause(3500)
    kitronik.motorOn(kitronik.Motors.Motor2, kitronik.MotorDirection.Reverse, 100)
    basic.pause(3500)
    kitronik.motorOff(kitronik.Motors.Motor1)
    kitronik.motorOff(kitronik.Motors.Motor2)
    basic.showIcon(IconNames.SmallDiamond)
})
```

Great! It's now time to use another @boardname@ to remove control the car.

### ~button /projects/rc-car/connect

Connect

### ~

```package
pxt-kitronik-motor-driver=github:kitronikltd/pxt-kitronik-motor-driver#v0.0.3
```

repository: comeoneileen/pxt-microbit

repo_name: comeoneileen/pxt-microbit


text:
Storing data and configuration according to Apple's guideline is crucial for your app's lifecycle, in particular when it comes to iCloud sync, upgrading to a new phone and restoring a phone from a backup.

Make sure to follow Apple's official [iOS Data Storage Guidelines](https://developer.apple.com/documentation/foundation/optimizing_your_app_s_data_for_icloud_backup):

- `Documents`: Use this directory for user-generated content, it will be backed up
- `Caches`: Use this directory for data that can be regenerated
- `tmp`: Use this directory for temporary files
- Make use of the `do not back up` attribute for files

Never store sensitive user-information (like passwords or sessions) in those directories. Instead use the Keychain API.

The Keychain API gives you control of how data is being stored on device. Make sure you have a good understanding of how the [various attributes](https://developer.apple.com/documentation/security/keychain_services/keychain_items/item_attribute_keys_and_values) affect the lifecycle of your app.

One often overlooked question you should ask yourself: When the user upgrades to a new iOS device, should the data (e.g. login session) be migrated as well?

If you use [`kSecAttrAccessibleWhenUnlockedThisDeviceOnly`](https://developer.apple.com/documentation/security/ksecattraccessiblewhenunlockedthisdeviceonly) the data won't be included in the iCloud or iTunes backup, meaning the user will lose the data when they upgrade their device.


text:
# Test Results

In general, any number you see has been divided by the time that Monotonic Allocator took.

So a Number like "15" means that the given allocator took 15 times longer than Monotonic took.

The summary lays it all out, but doesn't say it explictly: Monotonic is faster than any other allocation system out there. Yes, it has it limitations. You can't free Monotonic allocations. But that's not what it's for. It's for per-frame or per-second throw-away allocations. And it does that *fast*.

repository: cschladetsch/Monotonic

repo_name: cschladetsch/Monotonic


text:
# Eschewed Features

For a bigger picture about why kustomize
does some things and not others, see the
glossary entry for [DAM].

## Removal directives

`kustomize` supports configurations that can be reasoned about as
_compositions_ or _mixins_ - concepts that are widely accepted as
a best practice in various programming languages.

To this end, `kustomize` offers various _addition_ directives.  One
can add labels, annotations, patches, resources and bases.
Corresponding _removal_ directives are not offered.

Removal semantics would introduce many possibilities for
inconsistency, and the need to add code to detect, report and
reject it.  It would also allow, and possibly encourage,
unnecessarily complex configuration layouts.

When faced with a situation where removal is desirable, it's
always possible to remove things from a base like labels and
annotations, and/or split multi-resource manifests into individual
resource files - then add things back as desired via the
[kustomization].

If the underlying base is outside of one's control, an [OTS
workflow] is the recommended best practice.    As often as desired, use _git rebase_ to
capture improvements from the upstream base.

## Build-time side effects from CLI args or env variables

`kustomize` supports the best practice of storing one's
entire configuration in a version control system.

Changing `kustomize build` configuration output as a result
of additional arguments or flags to `build`, or by
consulting shell environment variable values in `build`
code, would violate that goal.

`kustomize` insteads offers [kustomization] file `edit`
commands.  Like any shell command, they can accept
environment variable arguments.

For example, to set the tag used on an image to match an
environment variable, run

```
kustomize edit set imagetag nginx:$MY_NGINX_VERSION
```

as part of some encapsulating work flow executed before
`kustomize build`.

## Globs in kustomization files

`kustomize` supports the best practice of storing one's
entire configuration in a version control system.

Globbing the local file system for files not explicitly
declared in the [kustomization] file at `kustomize build` time
would violate that goal.

Allowing globbing in a kustomization file would also introduce
the same problems as allowing globbing in [java import]
declarations or BUILD/Makefile dependency rules.

`kustomize` will instead provide kustomization file editting
commands that accept globbed arguments, expand them at _edit
time_ relative to the local file system, and store the resulting
explicit names into the kustomization file.

In this way the resources, patches and bases used at _build time_
remain explicitly declared in version control.

[DAM]: glossary.md#declarative-application-management
[base]: glossary.md#base
[kustomization]: glossary.md#kustomization
[OTS workflow]: workflows.md#off-the-shelf-configuration
[java import]: https://www.codebyamir.com/blog/pitfalls-java-import-wildcards

repository: camilosampedro/kustomize

repo_name: camilosampedro/kustomize


text:
# A10 Libraries

These libraries provide the core functionality for the Nokia Attestation Engine.

The instructions here are to be used while developing and testing. To run in a production/sane environment use docker-compose.

## Build and Install Locally
Run the commands below together as follows. There's also a command included to remove pyc files and the pycache folder just in case because these have a nasty habit of hanging around and causing really odd bugs such as missing attributes and modules even though the files are really there!

```bash
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
sudo pip3 uninstall a10
sudo python3 setup.py sdist bdist_wheel
sudo python3 setup.py install
```

## Upload to Artifactory

Edit `~/.pypirc' as follows:

```
[distutils]
index-servers = local
[local]
repository: https://artifactory-espoo2.int.net.nokia.com/artifactory/api/pypi/nbl-nae-pypi-local
username: ioliver
password: (see artifactor SETUP page for the hashed password)
```

Then

```bash
sudo -E python3 setup.py sdist bdist_wheel upload -r local
```

## Documentation

Generated using sphinx

To generate the API documents:

```bash
cd doc
sphinx-apidoc -f -o source/ ../a10/
make html
```

NB: this leaves stuff around which sphinx-build picks up on, eg: old files etc. Will have to find out how to properly clean this directory. Using `make clean` didn't seem to help.

### Some Sphinx stuff for reference
For reference the conf.py file contains the lines

```python
import os
import sys
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../../a10'))
print("SPHINX PATH=",sys.path)
```

This worked on Sphinx 1.8.5 .. the `needs_sphinx` entry should be updated to reflect this.

The extensions required are:

```python
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.todo',
]
```

If the RTD theme is used:

```bash
pip3 install sphinx-rtd-theme
```

The entry in the conf.py is

```
html_theme = "sphinx_rtd_theme"
```

repository: KlenJavor/AttestationEngine

repo_name: KlenJavor/AttestationEngine


text:
---
id: 5900f4181000cf542c50ff2a
title: >-
  Problem 171: Finding numbers for which the sum of the squares of the digits is
  a square
challengeType: 5
forumTopicId: 301806
dashedName: >-
  problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square
---

# --description--

For a positive integer n, let f(n) be the sum of the squares of the digits (in base 10) of n, e.g.

f(3) = 32 = 9,

f(25) = 22 + 52 = 4 + 25 = 29,

f(442) = 42 + 42 + 22 = 16 + 16 + 4 = 36

Find the last nine digits of the sum of all n, 0 < n < 1020, such that f(n) is a perfect square.

# --hints--

`euler171()` should return 142989277.

```js
assert.strictEqual(euler171(), 142989277);
```

# --seed--

## --seed-contents--

```js
function euler171() {
  return true;
}

euler171();
```

# --solutions--

```js
// solution required
```


text:
# git-log-calendar-teams
The tool generates git calendar logs depending on teams' activities

## Hot to install

```
npm i -g git-log-calendar-teams
```

Or open releases and download executable file

## How to run

```
git-log-calendar-teams report clean collect
```

or by default `collect`

```
git-log-calendar-teams
```

repository: makamekm/git-log-calendar-teams

repo_name: makamekm/git-log-calendar-teams


text:
### Notes: viewing Firefox command line options/switches

* ###### | 2021.09.09 (first 2021.08.22) | https://github.com/icpantsparti/browser-bits/blob/main/firefox-info/command-line-options.md | License (MIT): https://raw.githubusercontent.com/icpantsparti/browser-bits/main/LICENSE | Disclaimer: Use with care at your own risk, and verify any results |

---

#### Windows

From command prompt (cmd.exe), for some reason it does not show unless piped or redirected:

* Output by page

    ```
    "C:\Program Files\Mozilla Firefox\firefox.exe" -h | more
    ```

    (press 'Enter' key to read the next page)

* Output all

    ```
    "C:\Program Files\Mozilla Firefox\firefox.exe" -h | findstr /N /I /R ".*"
    ```

    (findstr: /N show line numbers, /I ignore case, /R regex, ".*" search term)

* Output to a file, then output the file

    ```
    "C:\Program Files\Mozilla Firefox\firefox.exe" -h >> firefox-help.txt
    type firefox-help.txt
    ```

---

#### Linux

From a terminal command line:

* Output all

    ```
    firefox -h
    ```

* Output by page

    ```
    firefox -h | more
    ```

    (press: 'Space' key to read the next page, 'Enter' key to read line by line)

* Output and view

    ```
    firefox -h | less -NJIS
    ```

    (less: -N show line numbers, -J show status column, -I search ignores case, -S no wrap)

* Output to a file, then output the file

    ```
    firefox -h >> firefox-help.txt ; cat firefox-help.txt
    ```

---

repository: icpantsparti/browser-bits

repo_name: icpantsparti/browser-bits


text:
## Usage on Linux Host ##

### Start Database ###

    sudo docker run --name flowsim-postgres flowgrammable/flowsim-postgres -d

### Start Flowsim Development and Connect to database ###

    sudo docker run --name flowsim-dev -v ~/flowsim:/flowsim -p 8080:8080 -p 9000:9000 -p 35729:35729 -p 2022:22 -t --link flowsim-postgres:postgres -d flowgrammable/flowsim-dev

user: flowsim/flowsim
shared volume: /flowsim

## Usage on Mac OSX and Windows Host##

`Note: If you are using Boot2Docker, your Docker daemon only has limited access to your OSX/Windows filesystem. Boot2Docker tries to auto-share your /Users (OSX) or C:\Users (Windows) directory - and so you can mount files or directories using docker run -v /Users/<path>:/<container path> ... (OSX) or docker run -v /c/Users/<path>:/<container path ... (Windows). All other paths come from the Boot2Docker virtual machine's filesystem`

## Post install steps ##

1. Login to flowsim-dev

    ssh flowsim@localhost -p2022

2. Dovnload develop branch from flowsim git and download dependencies

Download

    cd /flowsim
    git clone https://github.com/flowgrammable/flowsim.git --branch develop

Build back

    cd flowsim/backend
    npm install
    grunt

Build front.

    cd /flowsim/flowsim/flowsim-ui
    npm install
    bower install
    grunt

Modify config.json, change host attribute to 'postgres'. By linking flowsim-dev with flowsim-postgres, hosts file will contain an entry for database host

    "database": {
        "database": "flowsim",
        "host": "postgress",
        "user": "flogdev",
        "pwd": "flogdev"
      },
Change server address to <IP_ADDRESS>

    "server": {
        "address": "<IP_ADDRESS>",

3. Start Back server

cd /flowsim/flowsim/backend
node src/index -c /flowsim/flowsim/config.json -d /flowsim/flowsim/flowsim-ui/dist

4. Start front server in development mode

cd /flowsim/flowsim/flowsim-ui/
grunt serve:local

5. Connect to http://localhost:9000/
6. You can edit files on the shared volume of your host using your favorite editor, and changes will be picked by livereload

### Development image ###
Development image content:

* Ubuntu 14.04
* java-8-oracle
* python
* node.js
* vim git sudo zip bzip2 fontconfig curl
* build-esential
* bower
* grunt-cli
* yo
* yo:generator-angular
* sshd

By default image runs sshd server so we can connect to this image from multiple sessions.

Pull the Flowsim Docker image:

    sudo docker pull flowgrammable/flowsim-dev

Create a "flowsim" folder in your home directory:

    mkdir ~/flowsim

Run The docker image, with the following options:

The Docker "/flowsim" folder is shared to the local "~/flowsim" folder

Forward all ports exposed by docker (8080 for Back server, 9000 for the "grunt serve" task, 35729 for the live reload with grunt-contrib-watch and 22 for SSHD).

In the following example we forward the container 22 port to the host 2022 port, to prevent some port conflicts:

This is just an example of runing image standalone

    sudo docker run -v ~/flowsim:/flowsim -p 8080:8080 -p 9000:9000 -p 35729:35729 -p 2022:22 -t flowgrammable/flowsim-dev

repository: Kartikdubey/flowbuild

branch_name: refs/heads/vahid

repo_name: Kartikdubey/flowbuild


text:
# 17. Letter Combinations of a Phone Number

<https://leetcode.com/problems/letter-combinations-of-a-phone-number/>

Difficulty: Medium

Tags: String, Backtracking

### Description
```plain
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.

A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.

IMAGE

Example:

Input: "23"
Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
Note:

Although the above answer is in lexicographical order, your answer could be in any order you want.
```
![](https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Telephone-keypad2.svg/200px-Telephone-keypad2.svg.png)

### Solution 1
Simply use backtracking to enumerate all possibilities. NOTE: when input is empty, output should be empty array.

Time Complexity: $O(4^n)$

Space Complexity: $O(n)$

##### Code (C++)
```cpp
class Solution {
public:
    const string letters[8] = {"abc", "def", "ghi", "jkl",
                               "mno", "pqrs", "tuv", "wxyz"};
    int len;

    void backtrack(int i, string &comb, string &digits, vector<string> &ans)
    {
        if (i == len)
        {
            ans.push_back(comb);
            return;
        }
        comb.push_back(' ');
        for (char c : letters[digits[i] - '2'])
        {
            comb[i] = c;
            backtrack(i + 1, comb, digits, ans);
        }
        comb.pop_back();
    }

    vector<string> letterCombinations(string digits) {
        vector<string> ans;
        len = digits.size();
        if (len == 0)
        {
            return ans;
        }
        string comb;
        backtrack(0, comb, digits, ans);
        return ans;
    }
};
```

repository: lkct/leetcode

repo_name: lkct/leetcode


text:
# Contributing

Before proceeding please read section ["Setting up the project"](README.md#setting-up-the-project) if you haven't yet.

It's strongly recommended to get familiar with [IntelliJ Platform SDK documentation](https://plugins.jetbrains.com/docs/intellij/welcome.html). \
It contains most of the information required to develop IntelliJ-based plugins.
In case of any questions you are welcome on our [discord channel](https://discord.gg/aUKpZzeHCK), we will be glad to answer your questions.

### Useful links:
- [How to contribute to IntelliJ Scala plugin](https://blog.jetbrains.com/scala/2016/04/21/how-to-contribute-to-intellij-scala-plugin/) (includes YouTube video)
- [Building IntelliJ IDEA plugins in Scala by Igal Tabachnik: Scala in the City Conference](https://www.youtube.com/watch?v=IPO-cY_giNA) (YouTube video)
- [Glossary of IntelliJ Platform](https://plugins.jetbrains.com/docs/intellij/glossary.html)
- [Explore the IntelliJ Platform API](https://plugins.jetbrains.com/docs/intellij/explore-api.html)
- [PSI Viewer](https://www.jetbrains.com/help/idea/psi-viewer.html) is an essential tool to dig into the structure of a source code.
- [Useful links in IntelliJ docs](https://plugins.jetbrains.com/docs/intellij/useful-links.html)

### Some guidelines for code, commits and pull requests:
- Make sure your modifications are covered by tests
- Make sure you have a YouTrack issue number before you start working
- Every commit message should reference the YouTrack issue number in format `#SCL-XXXXX`
  - Place primary issue number in the end of the first message line
  - If you have multiple equally-important related issues place them in the end of the first message line
  - If you have some non-primary, but related issues you can reference them in the commit message body.
  - In the last commit of a series which fixes an issue, append `#SCL-XXXXX fixed` to the end of the first message line
    issue which is fixed. This will close the YouTrack issues automatically when the change is merged into main branch.
- Use short subsystem prefix in your commits. We don't have a fixed set of such prefixes. Use common sense and at least same prefix for a related group of commits
- Try to provide any extra helpful information in the commit message body
- Try to keep commits focused to help reviewers

#### Examples of commit messages:

>sbt shell: delete SigIntAction #SCL-14369 #SCL-16727 #SCL-12030
>
> It's not actual after #SCL-15583:
> we now have a common shortcut for "Stop" action (see tooltip over the "stop" button)

> annotator: dont annotate ConstructorInvocation in definitions (#SCL-20540, #SCL-20737) fixed
>
> also related #SCL-20185

Happy coding !

### Writing tests
Please get familiar with docs [Testing Overview](https://plugins.jetbrains.com/docs/intellij/testing-plugins.html)

For most of the subsystems there are already some tests written
and all you need is to find an appropriate test class/base test class and add a new test case/test class.
However, quite frequently finding the suitable test class might be quite tricky.
In most cases there is no 1-1 correspondence between class name and test class names. \
There are multiple ways how to find the correct test suite:
1. Use "Go To Class" or "Go To File" action in combination with fuzzy search for the subsystem. \
   For example, if you search "ScalaDocFormatTest" you will find `ScalaDocFormatterTest.scala` and `ScalaDocFormatterTest2.scala`
2. Search for the edited test files in similar changes.\
   When you make changes in some files you can browse commit history of the files
   using [git blame](https://www.jetbrains.com/help/idea/investigate-changes.html#annotate_blame) or [file history](https://www.jetbrains.com/help/idea/investigate-changes.html#file-history). In that commit history you might see related test files. One of them might be the one you need.
3. If you struggle to find any suitable test you can ask for help in our [discord channel](https://discord.gg/aUKpZzeHCK)

repository: JetBrains/intellij-scala

gha_language: Scala

repo_name: JetBrains/intellij-scala


text:
# Pomodoro Clock
### fcc JavaCSript Front-End Libraries Project

#### Run webpack server
```
npm run server
```
and then click on ```dist```

#### Build compiled js
```
npm run build
```
It will build ```bundle.js``` inside ```./dist/```

[Codepen](https://codepen.io/heisenberg-pb/full/NBaZGy) link of the project

repository: pijushbarik/react-pomodoro-clock

repo_name: pijushbarik/react-pomodoro-clock


text:
### [CVE-2023-38997](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-38997)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

A directory traversal vulnerability in the Captive Portal templates of OPNsense before 23.7 allows attackers to execute arbitrary system commands as root via a crafted ZIP archive.

### POC

#### Reference
- https://logicaltrust.net/blog/2023/08/opnsense.html

#### Github
No PoCs found on GitHub currently.


text:
# Reddit Comments Analyzer
[![Build Status](https://travis-ci.org/dillonmabry/youtube-sentiment-helper.svg?branch=master)](https://travis-ci.org/dillonmabry/reddit-comments-tool)
[![Python 3.4](https://img.shields.io/badge/python-3.4-blue.svg)](https://www.python.org/downloads/release/python-340/)
[![Python 3.5](https://img.shields.io/badge/python-3.5-blue.svg)](https://www.python.org/downloads/release/python-350/)
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

General package for reddit comments analysis, data manipulation, and other areas

## Install Instructions
```
pip install .
```
or for released version:
```
pip install reddit-extract
```

## How to Use
Required:
- Reddit Client ID
- Reddit Client Secret
- Reddit User Agent
- Subreddit
- List of Thread IDs for bulk extract of multiple Reddit threads
- Dictionary (Should match your regex search pattern, otherwise your headers will not match the data retrieved, for example: a defined copy/paste form for a reddit thread that users reply to, aka "Megathreads")
- Regex Pattern (for csv)

Extracting all comments for list of threads to csv with defined headers and search pattern:
```
import reddit_extract
reddit_extract.extract_comments_csv_bulk(<Reddit ClientID>, <Reddit ClientSecret>, <Reddit User Agent>, <Subreddit>, <Thread IDs>, <Dictionary Headers>)
```

Extracting all comments for list of threads to txt:
```
import reddit_extract
reddit_extract.extract_comments_txt_bulk(<Reddit ClientID>, <Reddit ClientSecret>, <Reddit User Agent>, <Subreddit>, <Thread IDs>)
```

Example:
```
import reddit_extract
threads = ['aw79c5', 'b7x7n1', 'am5uk7', 'bji681', 'abv2gl', '9klf8e']
search_pattern = r'Form: (.*)\n*Entity: (.*)\n*Pending: (.*)\n*Approved: (.*)\n*Standardized wait: (.*)\n*STATE: (.*)'
headers = {'Form': 'Form', 'Entity': 'Entity', 'Pending': 'Pending', 'Approved': 'Approved', 'Standardized Wait': 'Standardized Wait', 'STATE': 'STATE'}
reddit_extract.extract_comments_csv_bulk(<client_id>, <client_secret>, <user_agent>, 'nfa', threads, headers, search_pattern)
```

## Tests
```
python setup.py test
```

repository: dillonmabry/reddit-comments-tool

repo_name: dillonmabry/reddit-comments-tool


text:
# Apple M1 Software Engineer Compatibility
Compatibility for languages and tools on Apple's new M1 hardware

## Language Support
* JavaScript/Node.js/Python/Ruby
* PHP
* [Java, Scala, Groovy](https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk)
* [.NET Core](https://github.com/dotnet/runtime/issues/43313)
* C, C++, Obj-C and Swift
* Go Lang
* [Rust](https://www.reddit.com/r/rust/comments/hlu1yi/rustc_works_on_apple_silicon_dtk/)

## IDE
* Xcode
* VSCode - native insiders edition
* Android Studio/Jet Brains

## Virtualization and Emulation
* [VMWare Fusion](https://appleinsider.com/articles/20/11/11/parallels-confirms-apple-m1-support-amid-silence-from-other-virtualization-companies)
* [Parallels Desktop](https://appleinsider.com/articles/20/11/11/parallels-confirms-apple-m1-support-amid-silence-from-other-virtualization-companies)
* [Docker](https://www.docker.com/blog/apple-silicon-m1-chips-and-docker/)

## Frameworks
* Electron - [beta support](https://www.electronjs.org/blog/apple-silicon)
* Chromium ?

## Tools
* LLVM
* GCC
* [Homebrew](https://osxdaily.com/2020/11/18/how-run-homebrew-x86-terminal-apple-silicon-mac/)
* eGPU
* Bootcamp - Gone!


text:
# THREE.Interactive

[![NPM Package](https://img.shields.io/npm/v/three.interactive.svg?style=flat)](https://www.npmjs.com/package/three.interactive)

Fast and simple interaction manager for [THREE.js](https://github.com/mrdoob/three.js/) for enabling mouse and touch events on 3D objects.

Intersections are sorted by distance to the camera and the events are dispatched in that order (closest first). If InteractiveEvent.stopPropagation() is called, the event won't fire again on other objects.

Alternative to [three.interaction](https://github.com/jasonChen1982/three.interaction.js).

Collaborations and improvements are welcome.

### Examples ####

* [Simple](https://dev.markuslerner.com/three.interactive/examples/simple.html): Basic example
* [Depth](https://dev.markuslerner.com/three.interactive/examples/depth.html): Overlapping objects example
* [glTF](https://dev.markuslerner.com/three.interactive/examples/gltf.html): Hover/click gltf objects example

### Usage ####

1. Include script:

```
import { InteractionManager } from "three.interactive";
```

2. Create an InteractionManager instance

```
const interactionManager = new InteractionManager(
  renderer,
  camera,
  renderer.domElement
);
```

3. Add object to InteractionManager

```
interactionManager.add(cube);
```

4. Add event listener to object

```
cube.addEventListener("click", (event) => {
});
```

5. Call InteractionManager.update() on each render

```
interactionManager.update();
```

### Simple example ####

```
import * as THREE from "three";
import { InteractionManager } from "three.interactive";

const container = document.createElement("div");
container.setAttribute("id", "container");
document.body.appendChild(container);

const renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
container.appendChild(renderer.domElement);

const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0.0, 0.0, 10.0);

const interactionManager = new InteractionManager(
  renderer,
  camera,
  renderer.domElement
);

const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial();

const cube = new THREE.Mesh(geometry, material);
cube.addEventListener("mouseover", (event) => {
  event.target.material.color.set(0xff0000);
  document.body.style.cursor = "pointer";
});
cube.addEventListener("mouseout", (event) => {
  event.target.material.color.set(0xffffff);
  document.body.style.cursor = "default";
});
cube.addEventListener("mousedown", (event) => {
  event.target.scale.set(1.1, 1.1, 1.1);
});
cube.addEventListener("click", (event) => {
  event.target.scale.set(1.0, 1.0, 1.0);
});
scene.add(cube);
interactionManager.add(cube);

const animate = (time) => {
  requestAnimationFrame(animate);

  interactionManager.update();

  renderer.render(scene, camera);
};

animate();
```

### API ###

#### InteractionManager class ####

```new InteractionManager(renderer, camera, renderer.domElement)``` – constructor InteractionManager instance

**Members:**

```treatTouchEventsAsMouseEvents``` (boolean) – wether touch events should fire as mouse events, default: true

**Methods:**

```interactionManager.add(object, childNames = [])``` – add object(s), optionally select only child objects by names

```interactionManager.remove(object, childNames = [])``` – remove object(s)

```interactionManager.update()``` – update InteractionManager on each render

```interactionManager.dispose()``` – dispose InteractionManager

#### InteractiveEvent class ####

**Members:**

```cancelBubble``` (boolean) – wether events should continue to bubble, default: false

```coords``` (THREE.Vector2) – Mouse/touch coords

```distance``` (number) – Distance of intersected point from camera

```intersected``` (boolean) – Whether object is still intersected

```originalEvent``` (Event object) – Original event, if available (mouse, touch)

```target``` (THREE.Object3D) – Target object

```type``` (string) – event type: 'click', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend'

**Methods:**

```stopPropagation``` – stop bubbling of event (cancelBubble), e.g. when only the object closest to the camera is supposed to fire an event

#### License ####

MIT licensed

Copyright (C) 2020 Markus Lerner, http://www.markuslerner.com


text:
I have lost ***33lbs*** since April, 2013. I use to weigh ***165lbs***, currently I weigh ***132lbs***. I was not particularly healthy to begin with. I went to numerous doctors, went through various physiological tests, I am perfectly fine health-wise. So somebody pointed out that my muscle atrophy and weight loss can be attributed to my sedentary nature of my work. I am a PhD candidate at UPenn, and my work schedule requires me to sit at my workstation for 8 hours on an average day. To make up for that, I knew I had to workout a little, but never got around doing it.

I have a certain apathy towards gym. I am not one of the athletic types. Whenever it comes to sports or physically challenging workouts, I fail, and those failures accumulated over time resulting in the current state of my body.

Anyways, I got myself registered as a member at my local gym. It has a good set of tools and workout machines which I do not hope to use, but reckon my trainer will force me to use those sometime in the near future. As long as I can get some added stamina for my day-to-day life, I will be more than happy. And in the process, I hope to regain some of my lost weight. I have heard, working out releases Oxycontin in the brain, well if that happens for me in the coming days, it will be a welcoming change.

I have never worked out much as a young adult. Now that I have started, it will be a good idea to keep track of my workout. I log everything I do in the gym in a Microsoft Excel Worksheet- from individual exercise time to the weight of the dumbbells I am currently using, though not all the data are useful, a few data visualization tricks give me the ability to better understand my performance, point out my weaknesses and drive me towards particular exercises that will help me perform better in my weak areas.

 The first chart is the most important one. The stacked Area Chart shows my combined **Day-to-Day** performance, which is a useful indicator to check out whether my overall performance is increasing or decreasing. The valleys in the chart represent days I have taken off days. I call this chart important as it provides me with a slope that lets me determine the overall aspects of my performance regardless of the performances in individual exercises. An increasing slope is always a good sign and highly expected. The second chart shows my areas of strength. The third graph chart the overall performance and the relations between different exercises in my exercise regiment. These graphs are generated using a `.vb` script.

Performance Overview: Strengths and Trends

These charts may change their appearances in the coming days depending on my workout plan.


text:
# Curl
1-1 class mapping of the cURL library so it can be mocked / stubbed

Sometimes, you just want to use cURL and not some abstracted class like guzzle. This is a simple wrapper for cURL so you can do that and still write meaningful tests.

# Usage
 ```PHP
class SomeClassThatUsesCurl {

    protected $curl;

    public function __construct(WillWashburn\Curl $curl) {

        $this->curl = $curl;

    }

    public function someMethodThatMakesARequest() {

        // Use curl like normal but also be able to test!
        $ch = $this->curl->curl_init($url);
        $this->curl->curl_setopt($ch, CURLOPT_HEADER, true);

    }

}
```

# Installation
Use composer

```composer require willwashburn/curl```

Alternatively, add ```"willwashburn/curl": "1.0"``` to your composer.json

repository: willwashburn/curl

repo_name: willwashburn/curl


text:
# template: disk.ovc

## Description:

This actor template represents a disk in ovc to be used later on by other services.

## Schema:
 - size: disk size in GB.
 - type: type of disk boot or normal.
 - description: description of disk.
 - maxIOPS: max inputs outputs per second.
 - devicename: device name (leave empty).
 - ssdSize: ssd size always available , will default to 10
 - location: location of the resource on cloud (i.e du-conv-2)
 - totalBytesSec: ''
 - readBytesSec: ''
 - writeBytesSec: ''
 - totalIopsSec: ''
 - readIopsSec: ''
 - writeIopsSec: ''
 - totalBytesSecMax: ''
 - readBytesSecMax: ''
 - writeBytesSecMax: ''
 - totalIopsSecMax: ''
 - readIopsSecMax: ''
 - writeIopsSecMax: ''
 - sizeIopsSec: ''
 - diskId: Id of disk.

Disk name will be service name.

## Example for creating disks
```yaml
g8client__env:
    url: '<env_url>'
    login: '<login>'
    password: '<password>'
    account: '<account>'

disk.ovc__disk1:
    size: <disk size>
    g8client: 'env'
    description: '<Description of the disk>'
    type: '<B or D. B for Boot and D for Data>'
    location: '<location of the disk>'

actions:

  - action: install
    actor: g8client
    service: env

  - action: create
    actor: disk.ovc
    service: disk1
```

## Example for deleting disks
```yaml
g8client__env:
    url: '<env_url>'
    login: '<login>'
    password: '<password>'
    account: '<account>'

disk.ovc__disk1:

actions:

  - action: install
    actor: g8client
    service: env

  - action: delete
    actor: disk.ovc
    service: disk1
```

## Example for limit IO for disks you can only limit disks that are attached to a vm, which is done using node.ovc service.
(note that the disk MUST be attached to a machine)
```yaml
g8client__env:
    url: '<env_url>'
    login: '<login>'
    password: '<password>'
    account: '<account>'

disk.ovc__disk1:
    maxIOPS: 100
    readBytesSec: 6500000
    writeBytesSec: 6500000

actions:

  - action: install
    actor: g8client
    service: env

  - action: limit_io
    actor: disk.ovc
    service: disk1
```

## Example for using disk with other services:

```yaml
sshkey__demo:

g8client__env1:
    # url: 'du-conv-3.demo.greenitglobe.com'
    url: '<env url>'
    login: '<login>'
    password: '<password>'
    account: '<account name>'

vdcfarm__vdcfarm1:

vdc__scality:
    vdcfarm: 'vdcfarm1'
    g8client: 'env1'
    location: '<location>'

disk.ovc__disk1:
  size: 1000

s3__demo:
    vdc: 'scality'
    disk:
      - 'disk1'
    domain: 'mystorage.com'
```


text:
---
layout: post
title:  "A Canine Curiosity"
date:   2010-10-13 19:00:00
categories: Pets
tags: [pets]
---

Noisette, our dog, has now been in the Netherlands for 2 and a half months, and has settled in quite nicely. She is enjoying discovering the new smells, new parks, and the new dogs.

There is a strange thing that happens every night though.

In the evenings, Noisette’s favourite thing to do is to snuggle up under her blanket on “her” chair and doze off, experiencing the occasional doggie dream along way.

Each night though, between 9 and 10pm, she wakes up from her sleep, dashes to the window and starts barking, and going crazy. The object of her excitement – a small grey dog (I think a Bishon).

 In addition to this she has never actually met this dog face to face.

Most nights, she is also at the window barking, while the dog is still a block away from our house, and not once have I ever actually heard any noise from the dog or its owner. The only way I know they are walking past is because Noisette goes so mad.

So then, why on earth does Noisette dislike this particular dog so much? And how does she know when this dog is coming past? Does she hear or smell something that I don’t?

I can’t answer any of these questions, but I do get time every night to ponder them.