text:
# Hugo Curious

The official theme for [AICurious Blog](https://aicurious.io) based on [Hugo Clarity](https://github.com/vietanhdev/hugo-curious). See a live demo at **[hugo-curious.aicurious.io](hugo-curious.aicurious.io)** or **[aicurious.io](https://aicurious.io)**.

![Screenshot](images/screenshot.png)

## Features

* Blog with tagging and category options
* Deeplinks
* Native Image Lazy Loading
* Customizable (see config)
* Dark Mode (with UI controls for user preference setting)
* Toggleable table of contents
* Flexible image configuration
* Logo alignment
* Mobile support with configurable menu alignment
* Syntax Highlighting
* Rich code block functions
* Math typing using MathJax
* Auto TOC using tocbot
* Search page
* Contact form
* Subscription form

## Prerequisites

Firstly, __ensure you have installed the [extended version of Hugo](https://github.com/gohugoio/hugo/releases)__. See installation steps from [Hugo's official docs](https://gohugo.io/getting-started/installing/).

## Getting up and running

Read the [prerequisites](#prerequisites) above and verify you're using the extended version of Hugo.
### Option 1 (recommended)

Generate a new Hugo site and add this theme as a Git submodule inside your themes folder:

```bash
hugo new site yourSiteName
cd yourSiteName
git init
git submodule add https://github.com/vietanhdev/hugo-curious themes/hugo-curious
cp -a themes/hugo-curious/exampleSite/* .
```

Then run

```bash
hugo server
```

Hurray!

### Option 2 (Great for testing quickly)

You can run your site directly from the `exampleSite`. To do so, use the following commands:

```bash
git clone https://github.com/vietanhdev/hugo-curious themes/hugo-curious
cd hugo-curious/exampleSite/
hugo server --themesDir ../..
```

> Although, option 2 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes.

## Configuration

If set, jump over to the `config.toml` file and start [configuring](#configuration) your site.

This section will mainly cover settings that are unique to this theme. If something is not covered here (or elsewhere in this file), there's a good chance it is covered in [this Hugo docs page](https://gohugo.io/getting-started/configuration/#configuration-file).

### Global Parameters

These options set global values that some pages or all pages in the site use by default.

| Parameter | Value Type | Overridable on Page |
|:---- | ---- | ---- |
| author | string | no |
| twitter | string | no |
| largeTwitterCard | boolean | no |
| ga_analytics | string | no |
| baidu_analytics | string | no |
| plausible_analytics | boolean | no |
| description | string | yes |
| introDescription | string | no |
| introURL | string/false | no |
| numberOfTagsShown | integer | no |
| fallBackOgImage | file path (string) | no |
| codeMaxLines | integer | yes |
| codeLineNumbers | boolean | yes |
| mainSections | array/string | no |
| centerLogo | boolean | no |
| logo | file path (string) | no |
| iconsDir | dir path (string) | no |
| mobileNavigation | string | no |
| figurePositionShow | boolean | yes |
| customCSS | array of file path (string) | no |
| customJS | array of file path (string) | no |
| enforceLightMode | boolean | N/A |
| enforceDarkMode | boolean | N/A |
| titleSeparator| string | no |
| showShare | boolean | yes |
| comments | boolean | yes |
| numberOfRecentPosts | integer | no |
| numberOfFeaturedPosts | integer | no |
| dateFormat | string | no |
| enableMathNotation | boolean | yes |
| customFonts | boolean | no |
| since | integer | N/A |
| rss_summary | boolean | N/A |
| rss_summary_read_more_link | boolean | N/A |
| footerLogo | string | N/A |
| talkyardServerUrl | string | N/A |
| talkyardScriptUrl | string | N/A |
| contactFormSubmitUrl | string | N/A |
| mailChimpUrl | string | N/A |
### Page Parameters

These options can be set from a page [frontmatter](https://gohugo.io/content-management/front-matter#readout) or via [archetypes](https://gohugo.io/content-management/archetypes/#readout).

| Parameter | Value Type | Overrides Global |
|:---- | ---- | ---- |
| title | string | N/A |
| date | date | N/A |
| description | string | N/A |
| draft | boolean | N/A |
| featured | boolean | N/A |
| tags | array/string | N/A |
| categories | array/string | N/A |
| toc | boolean | N/A |
| thumbnail | file path (string) | N/A |
| featureImage | file path (string) | N/A |
| shareImage | file path (string) | N/A |
| codeMaxLines | integer | yes |
| codeLineNumbers | boolean | yes |
| comments | boolean | yes |
| enableMathNotation | boolean | yes |
| showDate | boolean | N/A |
| showShare | boolean | N/A |
| showReadTime | boolean | N/A |
| sidebar | boolean | N/A |
| singleColumn | boolean | N/A |
| math | boolean | no |

### Modify Menus

#### Main Menu

To add, remove, or reorganize top menu items, [edit the files here](https://github.com/vietanhdev/hugo-curious/tree/master/exampleSite/config/_default/menus). Specifically look for items with `[[main]]`.

If you prefer the more [traditional approach](https://gohugo.io/content-management/menus/#readout), delete `content\config` folder and enter a [main menu entry](https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menut) inside the `config.toml` file

#### Social media

To edit your social media profile links, edit the files referenced above. Specifically, look for items with `[[social]]`

If you wish to globally use a [large Twitter summary card](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image) when sharing posts, set the global parameter `largeTwitterCard` to `true`.

### Web site analytics

If using Google Analytics, configure the `ga_analytics` global parameter in your site with your ID.

If using Baidu Analytics, configure the `baidu_analytics` global parameter in your site with your ID.

If using Plausible Analytics, configure the `plausible_analytics` global parameters in your site with following.

`enable` To enable plausible analytics change to `true`.

`websiteDomain` Set domain name of your website, most cases same as your base URL this is required.

`plausibleDomain`  Default is set to plausible.io, this parameter is only required if plausible is self-hosted.

`scriptName`  Default is set to plausible, this parameter is only required if using a custom name for script.

### Blog directory

Edit `config.toml` and change the `mainSections` key. Values will be directories where the blogs reside.

```yaml
[params]
...
mainSections = ["posts", "docs", "blogs"]
...
```

For more info, see the [Hugo docs](https://gohugo.io/functions/where/#mainsections).

### Mobile menu positioning

The navigation menu when mobile browsing can be configured in `config.toml` to open right or left depending on preference. The "hamburger" menu icon will always display in the upper right hand corner regardless.

```yaml
[params]
...
mobileNavigation = "left" # Mobile nav menu will open to the left of the screen.
...
```

### Tags and Taxonomies

#### Show number of tags

The number of tags and taxonomies (including categories) that should be shown can be configured so that any more than this value will only be accessible when clicking the All Tags button. This is to ensure a large number of tags or categories can be easily managed without consuming excess screen real estate. Edit the `numberOfTagsShown` parameter and set accordingly.

```yaml
[params]
...
numberOfTagsShown = 14 # Applies for all other default & custom taxonomies. e.g categories, brands see https://gohugo.io/content-management/taxonomies#what-is-a-taxonomy
...
```

#### Number of tags example

![Tags](https://github.com/vietanhdev/hugo-curious/blob/master/images/tags.png)

#### Add classes to images

To add a class image to the left, append `::<classname>` to its alt text. You can also add multiple classes to an image separated by space. `::<classname1> <classname2>`.

#### Article thumbnail image

Blog articles can specify a thumbnail image which will be displayed to the left of the card on the home page. Thumbnails should be square (height:width ratio of `1:1`) and a suggested dimension of 150 x 150 pixels. They will be specified using a frontmatter variable as follows:

```yaml
...
thumbnail: "images/2020-04/capv-overview/thumbnail.jpg"
...
```

The thumbnail image will take precedence on opengraph share tags if the [shareImage](#share-image) parameter is not specified.

#### Article featured image

Each article can specify an image that appears at the top of the content. When sharing the blog article on social media, if a thumbnail is not specified, the featured image will be used as a fallback on opengraph share tags.

```yaml
...
featureImage: "images/2020-04/capv-overview/featured.jpg"
...
```

#### Share Image

Sometimes, you want to explicitly set the image that will be used in the preview when you share an article on social media. You can do so in the front matter.

```yaml
...
shareImage = "images/theImageToBeUsedOnShare.png"
...
```

Note that if a share image is not specified, the order of precedence that will be used to determine which image applies is `thumbnail` => `featureImage` => `fallbackOgImage`. When sharing a link to the home page address of the site (as opposed to a specific article), the `fallbackOgImage` will be used.

#### Align logo

You can left align or center your site's logo.

```yaml
...
centerLogo = true # Change to false to align left
...
```

If no logo is specified, the title of the site will appear in its place.

### Code

#### Display line numbers

Choose whether to display line numbers within a code block globally with the parameter `codeLineNumbers` setting to `true` or `false`.

```yaml
[params]
...
codeLineNumbers = true # Shows line numbers for all code blocks globally.
...
```

#### Limit code block height

You can globally control the number of lines which are displayed by default for your code blocks. Code which has the number of lines exceed this value will dynamically cause two code block expansion buttons to appear, allowing the user to expand to full length and contract. This is useful when sharing code or scripts with tens or hundreds of lines where you wish to control how many are displayed. Under params in `config.toml` file, add a value as follows:

```yaml
[params]
...
codeMaxLines = 10 # Maximum number of lines to be shown by default across all articles.
...
```

> If the value already exists, change it to the desired number. This will apply globally.

If you need more granular control, this parameter can be overridden at the blog article level. Add the same value to your article frontmatter as follows:

```yaml
...
codeMaxLines = 15 # Maximum number of lines to be shown in code blocks in this blog post.
...
```

If `codeMaxLines` is specified both in `config.toml` and in the article frontmatter, the value specified in the article frontmatter will apply to the given article. In the above example, the global default is `10` and yet the article value is `15` so code blocks in this article will auto-collapse after 15 lines.

If `codeMaxLines` is not specified anywhere, an internal default value of `100` will be assumed.

### Table of contents

Each article can optionally have a table of contents (TOC) generated for it based on top-level links. By configuring the `toc` parameter in the article frontmatter and setting it to `true`, a TOC will be generated only for that article. The TOC will then render under the featured image.

#### Table of contents (TOC) example

![Article table of contents](images/toc.png)

### Custom CSS and JS

To minimize HTTP requests per page, we would recommend loading CSS styles and JavaScript helpers in single bundles. That is to say, one CSS file and one JavaScript file. Using Hugo minify functions, these files will be minified to optimize the size.

Going by the above 👆🏻 reason, we recommend adding custom CSS and JS via these files:

1. [`_override.sass`](https://github.com/vietanhdev/hugo-curious/blob/master/assets/sass/_override.sass).
    This file should only be used to override sass & css variables e.g theme colors
2. [`_custom.sass`](https://github.com/vietanhdev/hugo-curious/blob/master/assets/sass/_custom.sass).
    This file should only be used to override everything else except sass & css variables.
3. [`custom.js`](https://github.com/vietanhdev/hugo-curious/blob/master/assets/js/custom.js).

> __Pro Tip__: Ensure that your changes are git trackable by creating these files outside the theme directory. That is, at the root level of your site's directory. See tree below.

```
├── yourSite
│   ├── archetypes
│   │   └── post.md
│   ├── assets
│   │   ├── js
│   │   │   └── custom.js
│   │   └── sass
│   │       ├── _custom.sass
│   │       └── _override.sass
│   ├── config
│   │   └── _default
│   │       ├── config.toml
│   │       ├── configTaxo.toml
│   │       ├── languages.toml
│   │       ├── markup.toml
│   │       ├── menus
│   │       │   ├── menu.en.toml
│   │       │   └── menu.pt.toml
│   │       └── params.toml
│   ├── content
│   │   ├── _index.md
```

However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to the `static` directory.

```yaml
[params]
...
customCSS = ["css/custom.css"] # Include custom CSS files
customJS = ["js/custom.js"] # Include custom JS files
...
```

### Forcing light or dark mode

By default, sites authored using Clarity will load in the browser with the user's system-wide settings. I.e., if the underlying OS is set to dark mode, the site will automatically load in dark mode. Regardless of the default mode, a UI control switch exists to override the theme mode at the user's discretion.

In order to override this behavior and force one mode or another, add either `enforceLightMode` or `enforceDarkMode` to your `config.toml` file. If neither value is present, add it.

To enforce Light Mode by default, turn `enforceLightMode`  to `true`.

To enforce Dark Mode by default, turn `enforceDarkMode`  to `true`

```yaml
[params]
...
enforceLightMode = true # Force the site to always load in light mode.
...
```

Please note that you cannot enforce both modes at the same time. It wouldn't make sense, would it?

> ⚠ Please also note that the mode toggle UI will remain in place. That way, if a user prefers dark mode, they can have their way. The best of both worlds.

### I18N

This theme supports Multilingual (i18n / internationalization / translations)

The `exampleSite` gives you some examples already.
You may extend the multilingual functionality by following the [official documentation](https://gohugo.io/content-management/multilingual/).

Things to consider in multilingual:

* **supported languages** are configured in [config/_default/languages.toml](./exampleSite/config/_default/languages.toml)
* **add new language support** by creating a new file inside [i18n](./i18n/) directory.
  Check for missing translations using `hugo server --i18n-warnings`
* **taxonomy** names (tags, categories, etc...) are translated in [i18n](./i18n/) as well (translate the key)
* **menus** are translated manually in the config files [config/_default/menus/menu.xx.toml](./exampleSite/config/_default/menus/)
* **menu's languages list** are semi-hardcoded. You may chose another text for the menu entry with [languageMenuName](./exampleSite/config/config.toml). Please, do better and create a PR for that.
* **content** must be translated individually. Read the [official documentation](https://gohugo.io/content-management/multilingual/#translate-your-content) for information on how to do it.

**note:** if you do NOT want any translations (thus removing the translations menu entry), then you must not have any translations.
In the exampleSite that's as easy as removing the extra translations from the `config/_default/...` or executing this one-liner:

```sh
sed '/^\[pt]$/,$d' -i config/_default/languages.toml && rm config/_default/menus/menu.pt.toml
```

To change the values of translatable text, such as `read_more` or `copyright`, edit the values in the language file you are using in the [`i18n`](i18n) directory. If you have no such directory, copy the one inside the theme to your root Hugo directory.

### Hooks

Clarity provides some hooks for adding code on a page.

If you need to add some code (CSS import, HTML meta or similar) to the head section on every page, add a partial to your project:

```
layouts/partials/hooks/head-end.html
```

Similar, if you want to add some code right before the body end (e.g fonts' links), create your own version of the following file:

```
layouts/partials/hooks/body-end.html
```

### Comments

I replace the default comment system with Talkyard. Configure the comment system using following variables in `config.toml`.

```
talkyardServerUrl = ""
talkyardScriptUrl = ""
```
### Contact form

This theme use [formspree.io](https://formspree.io/) as the contact form service. Update `contactFormSubmitUrl` to your form URL.
### Subscription form

This theme use [MailChimp](https://mailchimp.com/) for the subscription form. Update `mailChimpUrl` to your MailChimp URL.
### MathJax

To write Math equation, put `math: true` in the frontmatter of each post to enable MathJax.

repository: maaldheefee/melodic-hedgehog

repo_name: maaldheefee/melodic-hedgehog


text:
# Updating the Docker test images

cd .circleci/images

update builduploadall.sh with a new version (e.g., v4.4.0 -> v4.5.0)

--- a/.circleci/images/builduploadall.sh
+++ b/.circleci/images/builduploadall.sh
-VERSION=v4.4.0
+VERSION=v4.5.0

run that script. It may fail due to packages becoming unavailable
(e.g. python is always fun) but, if it works, the new docker
images will be uploaded.

Once this is done, update .circleci/config.yml to use the new container version

+++ .circleci/config.yml
@@ -104,7 +104,7 @@ jobs:
-      - image: uroottest/test-image-tamago:v4.4.0
+      - image: uroottest/test-image-tamago:v4.5.0
@@ -125,7 +125,7 @@ jobs:
-      - image: uroottest/test-image-tamago:v4.4.0
+      - image: uroottest/test-image-tamago:v4.5.0

Then make the commit and push the changes to these files.
See https://github.com/u-root/u-root/pull/2732 for an example.

## Updating tamago release
Sometimes you will need a new version of Tamago, in which case
you need to change the builduploadall.sh script as above, but also
specify a new Tamago version. You must also update the sha256sum
in the test-image-tamago/Dockerfile file.

Find the latest tamago release at https://github.com/usbarmory/tamago-go/
get that image, e.g.
TAMAGO_VERSION=1.20.6 wget -O tamago-go.tgz https://github.com/usbarmory/tamago-go/releases/download/tamago-go${TAMAGO_VERSION}/tamago-go${TAMAGO_VERSION}.linux-amd64.tar.gz
get the sha256sum:
sha256sum tamago-go.tgz

and update these two variables in .circleci/images/test-image-tamago/Dockerfile.

In this case, it looks like this:
--- a/.circleci/images/test-image-tamago/Dockerfile
+++ b/.circleci/images/test-image-tamago/Dockerfile
-ENV TAMAGO_VERSION="1.20.3"
-ENV TAMAGO_CHECKSUM="7657d39b8e062f85433a48367012d138ef5b928408b0b41e15384fe150495082"
+ENV TAMAGO_VERSION="1.20.6"
+ENV TAMAGO_CHECKSUM="6319b1778e93695b62bb63946c5dd28c4d8f3c1ac3c4bf28e49cb967d570dfd5"

Then follow the instructions, above, for updating the test images.

repository: u-root/u-root

branch_name: refs/heads/main

extension: md

gha_language: Go

license_type: permissive

repo_name: u-root/u-root


text:
### Description
==Description==
This script creates a vtkLine and deflects it using a vtkWarpVector. There is also a C++ version of this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/WarpVector

repository: MarchingGuy/VTKExamples

branch_name: refs/heads/master

repo_name: MarchingGuy/VTKExamples


text:
# SCRATCH_Analysis
A Web application for analyzing SCRATCH projects. An example of this project is being built at http://joneill1.ddns.net/SCRATCH/

license: MIT

repository: fenwickjb/SCRATCH

repo_name: fenwickjb/SCRATCH


text:
# AWS RDS READ REPLICAS

## Requirements
Automatic backups must be turned on
Can only be multi-az if the source database is set for Multi-AZ

## Creation
Instance size can be different from original
AZ can be different than current AZ

## Limitations
- up 5 Read Replicas of any databases
- you can have replicas of replicas but they can incur extra latency
- CANNOT take snapshots or automated backups of read replicas

## Data Transfer On Creation
Free!

## Use
Uses async replication
Good for read-heavy workloads
Used for Scaling
Each Replica has its own DNS end pont
Can be promoted to be their own databases, breaking the replication

## Regions
Read replica in a second region for MySQL and MariaDB

## Supports
MySQL Server
PostgreSQL
MariaDB

repository: evanharmon/eph-headspace

repo_name: evanharmon/eph-headspace


text:
# Cloudflare Summer Challenge

> https://challenge.developers.cloudflare.com/

## Setup

```sh
$ npm install
# or
$ pnpm install
# or
$ yarn install
```

## Development

The application is split into two separate components, (currently) requiring two separate development workflows:

***Client***

Ideal for HTML/CSS/JS development. Spawns a live-reload development server:

```sh
$ npm run html dev
```

This will watch the `/src` directory for any file changes, automatically reloading the `localhost:8080` server.

***Worker***

You should already have `wranger` installed. Start a development server via:

```sh
$ wrangler dev
```

This will watch the `/worker` directory for any file changes, automatically reloading the `localhost:8787` server. **Note:** Any changes to `/src` contents will not be reflected until `/worker` contents change.

## Deployment

Wrangler is already configured to build the HTML/client files before building the Worker itself. By default, everything will be built before uploading any assets to Cloudflare:

```sh
$ wrangler publish
```


text:
# javafx.demo
A very simple Java FX Demo

[![Build Status](https://travis-ci.com/StegmannSystems/javafx.demo.svg?branch=master)](https://travis-ci.com/StegmannSystems/javafx.demo)

## Running build on Windows and Linux environment (at least)

```
mvnw -B clean package
```

## Running the application

```
mwnw clean javafx:run
```

## Docker

**Please note**: Requires at least Java 11.

You also can use Docker on Windows for testing the Build under Linux

```
docker run --rm -v %CD%:/workspace -it adoptopenjdk/openjdk11-openj9 /workspace/build.sh
```

## Links

 - https://hub.docker.com/r/adoptopenjdk/openjdk11-openj9


text:
# Unity GPU Mesh Voxelizer Part 3
A GPU mesh voxelizer for Unity. Read the accompanying blog post [here](https://bronsonzgeb.com/index.php/2021/06/05/gpu-mesh-voxelizer-part-3-render-tons-of-voxels-with-drawmeshinstancedindirect/).

![Example](https://github.com/bzgeb/UnityGPUMeshVoxelizerPart3/blob/main/Screenshots/VoxelizedSuzanne.png)


text:
# User's Account Memberships

A list of memberships of accounts this user can access

## List Memberships

`GET` List memberships of accounts the user can access

> GET memberships

**Permission needed:** `None`

Available in:

## Membership Details

`GET` Get a specific membership

> GET memberships/:identifier

**Permission needed:** `None`

Available in:

## Update Membership

`PUT` Accept or reject this account invitation

> PUT memberships/:identifier

**Permission needed:** `None`

Available in:

## Delete Membership

`DELETE` Remove the associated member from an account

> DELETE memberships/:identifier

**Permission needed:** `None`

Available in:

repository: andridus/elixir-cloudflare-api-client

repo_name: andridus/elixir-cloudflare-api-client


text:
Pattern: Malformed indentation

Issue: -

## Description

This rules enforces indentation 2 spaces at a time.

## Further Reading

* [Google C++ Style Guide - Spaces vs. Tabs](https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs)

repository: Adroiti/docs-for-code-review-tools

repo_name: Adroiti/docs-for-code-review-tools


text:
# maze_image
Make a 2D maze out of an image file
# Usage
python maze_image.py **input_file** **output_file_name** --max-dimension **max_number_of_cells width or height**

"input_file" is the path and file name of a image file

"output_file_name" is the beginning of the maze image's file name (maze_image will save the maze as a .png file, and the solution as <output file>_solution.png)

--max_dimension is an optional argument, default if not supplied is 100. Mazes over 150 cells wide or high take a long time to create! Use wisely!

example: python ./maze_image.py /home/foo/Pictures/Aunt_Martha.jpg am --max_dimension 135

This would make a maze image 135 cells wide named am.png out of a picture of your Aunt Martha, and if there is a solution to get from the top left corner to the bottom right corner, it will also create a second image of the maze with a breadcrumb trail from top left to bottom right named am_solution.png


text:
---
layout: post
title: "Upload Documents"
description: ""
category: Services
tags: []
---
{% include JB/setup %}
We can keep the images of invoice for a particular service.

At the bottom of the details is :
![service log](/assets/images/tb/uplinv_01.png)
Click on **Upload a new file**.
Browse the file from your system and upload it and add in **Description** for the same.
![service log](/assets/images/tb/uplinv_02.png)


text:
Applicable to base bar charts and base bar charts, the Conversion Rate component allows the user to focus on the rate of change in the data.

<description>**optional** _object_ | _false_</description>

| Properties | Type            | Required | Default | Description                                              |
| ---------- | --------------- | -------- | ------- | -------------------------------------------------------- |
| size       | number          | No       | -       | Conversion rate Component dimensions                     |
| spacing    | number          | No       | -       | Component and column spacing                             |
| offset     | number          | No       | -       | Component and axis spacing                               |
| arrow      | ArrowCfg、false | No       | -       | Arrow shape configuration, false does not display arrows |
| text       | TextCfg、false  | No       | -       | Text configuration, false does not display text          |

ArrowCfg configuration is as follows:

| Properties | Type   | Required | Default | Description       |
| ---------- | ------ | -------- | ------- | ----------------- |
| headSize   | number | No       | -       | Size of the arrow |
| style      | object | No       | -       | Arrow style       |

TextCfg configuration is as follows:

| Properties | Type                                 | Required | Default | Description                        |
| ---------- | ------------------------------------ | -------- | ------- | ---------------------------------- |
| headSize   | number                               | No       | -       | Size of the arrow                  |
| style      | object                               | No       | -       | Arrow style                        |
| formatter  | (prev:number, next:number) => string | No       | -       | Custom conversion rate calculation |

Please refer to the style configuration [ShapeAttrs](/en/docs/api/graphic-style)

gha_license_id: MIT


text:
---
layout: single
title: Where are my tests?
date:   2017-05-10 20:36:02 +0200
categories: [dsp17, django, python]
excerpt: About some issues you may have with Django test framework
tags: [testing, django, python, quality, frisor]
header:
    teaser: /assets/images/cat_computer_wtf.jpg
---

I decided to add some tests to my **frisor** application, so that my
**Travis CI** could actually be useful. Testing *web applications* is very
annoying for me, I'm not sure what I should **test**. There are some *methods* or *views*,
which are really simple and I don't feel it's possible to write a meaningful
**test** for them. Anyway, as I played more with tests in my side project **frisor**
(more about it here:
[Introduction to frisor]({{ site.baseurl }}{% link _posts/2017-03-01-introduction_to_frisor.md %}))
here are some of my thoughts.

### Where are my tests?

My requirements for **testing** framework were at least:

* tests are in `tests` subdirectory in my application
* having more than one file with **tests**
* readable output with summary

In **Django** there is a builtin *testing* engine which does *test discovery* (so finds tests
locations) and runs tests. It uses `unittest` library for running tests.
To run tests use `manage.py` script with command `test`. When none of your tests will be
found, there can be a few reasons of it:

#### Running manage.py from invalid location

If you are running `manage.py` from invalid location, tests may not be run.
For example: I was running it from as `$ python frisor/manage.py test`,
so not in place where `manage.py` is located. There are two ways of fixing it:

1. use your application name (but it tests only for this application),
in my case:
> `$ python frisor/manage.py test frisor_urls`
2. run `manage.py` when being in place where it is located, so:
> `$ python manage.py test`

#### Subdirectory for tests should be a python package

If you are using `tests` subdirectory it's possible that you forgot to make it
**Python** *package* - this subdirectory has to contain `__init__.py` file as it defines a *package*.

#### Tests have a naming convention

All tests names should start from `test_` prefix to be found. If there are no **tests**
found, check if they are named properly and if your **test class**
derives from `django.test.TestCase`

### How to do something for all tests in class?

Let's say we want to have a default variables or do some actions before for each **test**,
for example I wanted to use the same url for **POST** requests in **all tests**
in my `AddUrlViewTest`:

{% highlight python %}
    class AddUrlViewTest(django.test.TestCase):

        def test_valid_url_form_is_saved_in_database(self):
            data = {
                'url': 'http://valid.se',
                'title': 'short title',
                'nick': 'short nick',
                'tags': 'tag1, tag2'
            }

            resp = self.client.post('/add_url', data=data)
            # I want to use /add_url in other tests too
            # ...

{% endhighlight %}

It can be done using two strategies:
1. running some method *before* **each test**
2. running some method *before* **all tests** (once)

Usually using the first one is better, because **tests** will be **independent**
from each other. When using the second one approach, there might appear some
**dependency** between tests - *you should avoid it at all costs*! When tests are
**dependent** on each other, they can't be run in **parallel**, they are also much harder
to **debug**.

#### Doing something before each test

Implementing `setUp` method can help you set up variables before each **test**,
so before every **test** you can have a fresh instance of variables - `setUp` method
is run before each **test**.

Here I added `setUp` method where I define `url_add_url` variable. I can use
it in all my **tests** to create a **POST** request to that url. It will be easy to change
it in the future.

{% highlight python %}
    class AddUrlViewTest(TestCase):

        def setUp(self):
            self.url_add_url = '/add_url'

        def test_valid_url_form_is_saved_in_database(self):
            data = {
                'url': 'http://valid.se',
                'title': 'short title',
                'nick': 'short nick',
                'tags': 'tag1, tag2'
            }

            resp = self.client.post(self.url_add_url, data=data)
{% endhighlight %}

Of course there is also a method which runs **after** each **test**, it's
called `tearDown`.

For example I wanted to create some urls for testing list view of urls
in my `UrlView`.

To achieve this it's enough to implement `setUpClass` method, but you have to remember
it's a `classmethod`, not an instance method. It will be run before **class**
instance creation. For example:

{% highlight python %}
    class UrlViewTest(django.test.TestCase):

        @classmethod
        def setUpClass(cls):
            cls.urls = []
            for i in range(0, 10):
                url = Url.create('http://valid' + str(i) + '.se',
                                 'title' + str(i),
                                 'nick' + str(i),
                                 range(0, i))
                url.save()
                cls.urls.append(url)

        @classmethod
        def tearDownClass(cls):
            for url in cls.urls:
                url.delete()

{% endhighlight %}

In example above I'm creating some urls before running other tests in
my application.
Method `tearDownClass` is run after all tests in **test class** are run.

There are also similar methods for whole modules (`setUpModule` and `tearDownModule`).

You can find my tests in my frisor **github**: [firsor tests](https://github.com/vevurka/frisor/blob/master/frisor/frisor_urls/tests/test_views.py).


text:
## Day 2 JS Challenge

Create a file called `Day2-task[x].js` where [x] is the task number. Implement your solution
and then run it the usual way in Node.js `node Day2-task[x].js`.

### Task 1

Create a program that when run will give the following output in the console:

![Task 1](task1.png)

### Task 2

Create a program that when run will give the following output in the console:

![Task 2](task2.png)

### Task 3

Create a program that when run will give the following output in the console:

![Task 3](task3.png)

### Task 4

What I want for Xmas? Chessboard! (Hint: try to use functions)

![Task 4](task4.png)

### Good luck folks!

repository: Michael-Antczak/daily-JS-challenge

path: /Day 2/README.md

gha_language: JavaScript

repo_name: Michael-Antczak/daily-JS-challenge


text:
This repository is based on https://wcota.me/covid19br

![App COVID-19 Brasil](https://i.imgur.com/WxmwIMk.jpg)

HOW TO USE:
- Donwload app-release.apk and install it or

1. Clone or download this repository
2. Run flutter pub get / flutter create .
3. Change Google Maps API_KEY on AndroidManifest.xml or info.plist for iOS.
4. Run project and test it.


text:
<!-- Book -->
## Book store

Practice the use of dynamically reserved and resizable tables of data structure elements. In this program, I create a simple database for storing books. Each record in the database follows the ```struct book``` structure, and the database consists of a dynamically allocated table, which has several ```struct book``` instances in a row. Whenever a new item is added to a table, it must be ensured that the table has enough memory to store the new item.

>```struct book```- Definition and descriptions of the fields can be found in the file [``book.h``](book.h). When defining the data structure, take into account which fields get the space they need as part of the data structure, and which fields need to be reserved separately. In this case, the author and title fields are strings for which it is needed to dynamically allocate the space required.

### Structs

Following the structs created for the program:

- Date:
```C
// Date in numeric format
struct date {
    unsigned char day;
    unsigned char month;
    int year;
};
```

- Book:
```C
// Single book entry
struct book {
	char id[10];
	char *title;
	char *author;
	struct date release_date;
};
```

### Functions

Following the functions created for the program:

- **init_book**:
```C
int init_book(struct book *p_book, const char *p_id, const char *p_title, const char * p_author, struct date p_release)
```
This function initializes a book structure on the basis of the parameters received from the ``p_book`` location. In this case, memory must be reserved for those fields in the structure that require space and that are not included in the book structure.

  The function returns:
   - A value of 1 if initialization was successful.
   - A value of 0 if it failed for some reason. For example, a function will fail if it is given an invalid id of more than 9 characters. Any 9-character (or shorter) string is an acceptable id.

- **add_to_collection**:
```C
struct book *add_to_collection(struct book *collection, unsigned int size, struct book new_book)
```
This function adds a new book data structure to the end of the dynamically allocated table, and if necessary, allocates more space to the table. The pointer starts at the beginning of the table in the function parameter collection, and the current table length in the size parameter. The information to add is given in the ``new_book`` parameter. It should be noted that the contents of ``new_book`` are copied to the table in the right place.

The function returns the pointer to the table after insertion.

### Running the program

Execute the following:
```bash
gcc -o main main.c book.c -Wvla -Wall -g -std=c99
./main
```


text:
# Hanami::Validations

Validations mixin for Ruby objects

## Status

[![Gem Version](https://badge.fury.io/rb/hanami-validations.svg)](https://badge.fury.io/rb/hanami-validations)
[![CI](https://github.com/hanami/validations/workflows/ci/badge.svg?branch=master)](https://github.com/hanami/validations/actions?query=workflow%3Aci+branch%3Amaster)
[![Test Coverage](https://codecov.io/gh/hanami/validations/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/validations)
[![Depfu](https://badges.depfu.com/badges/af6c6be539d9d587c7541ae7a013c9ff/overview.svg)](https://depfu.com/github/hanami/validations?project=Bundler)
[![Inline Docs](http://inch-ci.org/github/hanami/validations.svg)](http://inch-ci.org/github/hanami/validations)

## Contact

* Home page: http://hanamirb.org
* Community: http://hanamirb.org/community
* Guides: https://guides.hanamirb.org
* Mailing List: http://hanamirb.org/mailing-list
* API Doc: http://rdoc.info/gems/hanami-validations
* Bugs/Issues: https://github.com/hanami/validations/issues
* Support: http://stackoverflow.com/questions/tagged/hanami
* Chat: http://chat.hanamirb.org

## Rubies

__Hanami::Validations__ supports Ruby (MRI) 2.3+ and JRuby <IP_ADDRESS>+.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'hanami-validations'
```

And then execute:

```shell
$ bundle
```

Or install it yourself as:

```shell
$ gem install hanami-validations
```

## Usage

`Hanami::Validations` is a mixin that, once included by an object, adds lightweight set of validations to it.

It works with input hashes and lets us to define a set of validation rules **for each** key/value pair. These rules are wrapped by lambdas (or special DSL) that check the input for a specific key to determine if it's valid or not. To do that, we translate business requirements into predicates that are chained together with Ruby _faux boolean logic_ operators (eg. `&` or `|`).

Think of a signup form. We need to ensure data integrity for the  `name` field with the following rules. It is required, it has to be: filled **and** a string **and** its size must be greater than 3 chars, but lesser than 64. Here’s the code, **read it aloud** and notice how it perfectly expresses our needs for `name`.

```ruby
class Signup
  include Hanami::Validations

  validations do
    required(:name) { filled? & str? & size?(3..64) }
  end
end

result = Signup.new(name: "Luca").validate
result.success? # => true
```

There is more that `Hanami::Validations` can do: **type safety**, **composition**, **complex data structures**, **built-in and custom predicates**.

But before to dive into advanced topics, we need to understand the basics of _boolean logic_.

### Boolean Logic

When we check data, we expect only two outcomes: an input can be valid or not. No grey areas, nor fuzzy results. It’s white or black, 1 or 0, `true` or `false` and _boolean logic_ is the perfect tool to express these two states. Indeed, a Ruby _boolean expression_ can only return `true` or `false`.

To better recognise the pattern, let’s get back to the example above. This time we will map the natural language rules with programming language rules.

```
        A name must be filled  and be a string and its size must be included between 3 and 64.
           👇            👇    👇       👇    👇      👇                           👇    👇
required(:name)      { filled?  &       str?   &      size?                         (3 ..  64) }

```

Now, I hope you’ll never format code like that, but in this case, that formatting serves well our purpose to show how Ruby’s  simplicity helps to define complex rules with no effort.

From a high level perspective, we can tell that input data for `name` is _valid_ only if **all** the requirements are satisfied. That’s because we used `&`.

#### Logic Operators

We support four logic operators:

  * `&` (aliased as `and`) for _conjunction_
  * `|` (aliased as `or`) for _disjunction_
  * `>` (aliased as `then`) for _implication_
  * `^` (aliased as `xor`) for _exclusive disjunction_

#### Context Of Execution

**Please notice that we used `&` over Ruby's `&&` keyword.**
That's because the context of execution of these validations isn't a plain lambda, but something richer.

For real world projects, we want to support common scenarios without the need of reinventing the wheel ourselves. Scenarios like _password confirmation_, _size check_ are already prepackaged with `Hanami::Validations`.

⚠ **For this reason, we don't allow any arbitrary Ruby code to be executed, but only well defined predicates.** ⚠

### Predicates

To meet our needs, `Hanami::Validations` has an extensive collection of **built-in** predicates. **A predicate is the expression of a business requirement** (e.g. _size greater than_). The chain of several predicates determines if input data is valid or not.

We already met `filled?` and `size?`, now let’s introduce the rest of them. They capture **common use cases with web forms**.

### Array

It checks if the the given value is an array, and iterates through its elements to perform checks on each of them.

```ruby
required(:codes) { array? { each { int? } } }
```

This example checks if `codes` is an array and if all the elements are integers, whereas the following example checks there are a minimum of 2 elements and all elements are strings.

```ruby
required(:codes) { array? { min_size?(2) & each { str? } } }
```

#### Emptiness

It checks if the given value is empty or not. It is designed to works with strings and collections (array and hash).

```ruby
required(:tags) { empty? }
```

#### Equality

This predicate tests if the input is equal to a given value.

```ruby
required(:magic_number) { eql?(23) }
```

Ruby types are respected: `23` (an integer) is only equal to `23`, and not to `"23"` (a string). See _Type Safety_ section.

#### Exclusion

It checks if the input is **not** included by a given collection. This collection can be an array, a set, a range or any object that responds to `#include?`.

```ruby
required(:genre) { excluded_from?(%w(pop dance)) }
```

#### Format

This is a predicate that works with a regular expression to match it against data input.

```ruby
require 'uri'
HTTP_FORMAT = URI.regexp(%w(http https))

required(:url) { format?(HTTP_FORMAT) }
```

#### Greater Than

This predicate works with numbers to check if input is **greater than** a given threshold.

```ruby
required(:age) { gt?(18) }
```

#### Greater Than Equal

This is an _open boundary_ variation of `gt?`. It checks if an input is **greater than or equal** of a given number.

```ruby
required(:age) { gteq?(19) }
```

#### Inclusion

This predicate is the opposite of `#exclude?`: it verifies if the input is **included** in the given collection.

```ruby
required(:genre) { included_in?(%w(rock folk)) }
```

#### Less Than

This is the complement of `#gt?`: it checks for **less than** numbers.

```ruby
required(:age) { lt?(7) }
```

#### Less Than Equal

Similarly to `#gteq?`, this is the _open bounded_ version of `#lt?`: an input is valid if it’s **less than or equal** to a number.

```ruby
required(:age) { lteq?(6) }
```

#### Filled

It’s a predicate that ensures data input is filled, that means **not** `nil` or blank (`""`) or empty (in case we expect a collection).

```ruby
required(:name) { filled? }      # string
required(:languages) { filled? } # collection
```

#### Minimum Size

This verifies that the size of the given input is at least of the specified value.

```ruby
required(:password) { min_size?(12) }
```

#### Maximum Size

This verifies that the size of the given input is at max of the specified value.

```ruby
required(:name) { max_size?(128) }
```

#### None

This verifies if the given input is `nil`. Blank strings (`""`) won’t pass this test and return `false`.

```ruby
required(:location) { none? }
```

#### Size

It checks if the size of input data is: a) exactly the same of a given quantity or b) it falls into a range.

```ruby
required(:two_factor_auth_code) { size?(6) }     # exact
required(:password)             { size?(8..32) } # range
```

The check works with strings and collections.

```ruby
required(:answers) { size?(2) } # only 2 answers are allowed
```

This predicate works with objects that respond to `#size`. Until now we have seen strings and arrays being analysed by this validation, but there is another interesting usage: files.

When a user uploads a file, the web server sets an instance of `Tempfile`, which responds to `#size`. That means we can validate the weight in bytes of file uploads.

```ruby
MEGABYTE = 1024 ** 2

required(:avatar) { size?(1..(5 * MEGABYTE)) }
```

### Custom Predicates

We have seen that built-in predicates as an expressive tool to get our job done with common use cases.

But what if our case is not common? We can define our own custom predicates.

#### Inline Custom Predicates

If we are facing a really unique validation that don't need to be reused across our code, we can opt for an inline custom predicate:

```ruby
require 'hanami/validations'

class Signup
  include Hanami::Validations

  predicate :url?, message: 'must be an URL' do |current|
    # ...
  end

  validations do
    required(:website) { url? }
  end
end
```

#### Global Custom Predicates

If our goal is to share common used custom predicates, we can include them in a module to use in all our validators:

```ruby
require 'hanami/validations'

module MyPredicates
  include Hanami::Validations::Predicates

  self.messages_path = 'config/errors.yml'

  predicate(:email?) do |current|
    current.match(/.../)
  end
end
```

We have defined a module `MyPredicates` with the purpose to share its custom predicates with all the validators that need them.

```ruby
require 'hanami/validations'
require_relative 'my_predicates'

class Signup
  include Hanami::Validations
  predicates MyPredicates

  validations do
    required(:email) { email? }
  end
end
```

### Required and Optional keys

HTML forms can have required or optional fields. We can express this concept with two methods in our validations: `required` (which we already met in previous examples), and `optional`.

```ruby
require 'hanami/validations'

class Signup
  include Hanami::Validations

  validations do
    required(:email)    { ... }
    optional(:referral) { ... }
  end
end
```

### Type Safety

At this point, we need to explicitly tell something really important about built-in predicates. Each of them have expectations about the methods that an input is able to respond to.

Why this is so important? Because if we try to invoke a method on the input we’ll get a `NoMethodError` if the input doesn’t respond to it. Which isn’t nice, right?

Before to use a predicate, we want to ensure that the input is an instance of the expected type. Let’s introduce another new predicate for our need: `#type?`.

```ruby
required(:age) { type?(Integer) & gteq?(18) }
```

It takes the input and tries to coerce it. If it fails, the execution stops. If it succeed, the subsequent predicates can trust `#type?` and be sure that the input is an integer.

**We suggest to use `#type?` at the beginning of the validations block. This _type safety_ policy is crucial to prevent runtime errors.**

`Hanami::Validations` supports the most common Ruby types:

  * `Array` (aliased as `array?`)
  * `BigDecimal` (aliased as `decimal?`)
  * `Boolean` (aliased as `bool?`)
  * `Date` (aliased as `date?`)
  * `DateTime` (aliased as `date_time?`)
  * `Float` (aliased as `float?`)
  * `Hash` (aliased as `hash?`)
  * `Integer` (aliased as `int?`)
  * `String` (aliased as `str?`)
  * `Time` (aliased as `time?`)

For each supported type, there a convenient predicate that acts as an alias. For instance, the two lines of code below are **equivalent**.

```ruby
required(:age) { type?(Integer) }
required(:age) { int? }
```

### Macros

Rule composition with blocks is powerful, but it can become verbose.
To reduce verbosity, `Hanami::Validations` offers convenient _macros_ that are internally _expanded_ (aka interpreted) to an equivalent _block expression_

#### Filled

To use when we expect a value to be filled:

```ruby
# expands to
# required(:age) { filled? }

required(:age).filled
```

```ruby
# expands to
# required(:age) { filled? & type?(Integer) }

required(:age).filled(:int?)
```

```ruby
# expands to
# required(:age) { filled? & type?(Integer) & gt?(18) }

required(:age).filled(:int?, gt?: 18)
```

In the examples above `age` is **always required** as value.

#### Maybe

To use when a value can be nil:

```ruby
# expands to
# required(:age) { none? | int? }

required(:age).maybe(:int?)
```

In the example above `age` can be `nil`, but if we send the value, it **must** be an integer.

#### Each

To use when we want to apply the same validation rules to all the elements of an array:

```ruby
# expands to
# required(:tags) { array? { each { str? } } }

required(:tags).each(:str?)
```

In the example above `tags` **must** be an array of strings.

#### Confirmation

This is designed to check if pairs of web form fields have the same value. One wildly popular example is _password confirmation_.

```ruby
required(:password).filled.confirmation
```

It is valid if the input has `password` and `password_confirmation` keys with the same exact value.

⚠ **CONVENTION:** For a given key `password`, the _confirmation_ predicate expects another key `password_confirmation`. Easy to tell, it’s the concatenation of the original key with the `_confirmation` suffix. Their values must be equal. ⚠

### Forms

An important precondition to check before to implement a validator is about the expected input.
When we use validators for already preprocessed data it's safe to use basic validations from `Hanami::Validations` mixin.

If the data is coming directly from user input via a HTTP form, it's advisable to use `Hanami::Validations::Form` instead.
**The two mixins have the same API, but the latter is able to do low level input preprocessing specific for forms**. For instance, blank inputs are casted to `nil` in order to avoid blank strings in the database.

### Rules

Predicates and macros are tools to code validations that concern a single key like `first_name` or `email`.
If the outcome of a validation depends on two or more attributes we can use _rules_.

Here's a practical example: a job board.
We want to validate the form of the job creation with some mandatory fields: `type` (full time, part-time, contract), `title` (eg. Developer), `description`, `company` (just the name) and a `website` (which is optional).
An user must specify the location: on-site or remote. If it's on site, they must specify the `location`, otherwise they have to tick the checkbox for `remote`.

Here's the code:

```ruby
class CreateJob
  include Hanami::Validations::Form

  validations do
    required(:type).filled(:int?, included_in?: [1, 2, 3])

    optional(:location).maybe(:str?)
    optional(:remote).maybe(:bool?)

    required(:title).filled(:str?)
    required(:description).filled(:str?)
    required(:company).filled(:str?)

    optional(:website).filled(:str?, format?: URI.regexp(%w(http https)))

    rule(location_presence: [:location, :remote]) do |location, remote|
      (remote.none? | remote.false?).then(location.filled?) &
        remote.true?.then(location.none?)
    end
  end
end
```

We specify a rule with `rule` method, which takes an arbitrary name and an array of preconditions.
Only if `:location` and `:remote` are valid according to their validations described above, the `rule` block is evaluated.

The block yields the same exact keys that we put in the precondintions.
So for `[:location, :remote]` it will yield the corresponding values, bound to the `location` and `remote` variables.

We can use these variables to define the rule. We covered a few cases:

  * If `remote` is missing or false, then `location` must be filled
  * If `remote` is true, then `location` must be omitted

### Nested Input Data

While we’re building complex web forms, we may find comfortable to organise data in a hierarchy of cohesive input fields. For instance, all the fields related to a customer, may have the `customer` prefix. To reflect this arrangement on the server side, we can group keys.

```ruby
validations do
  required(:customer).schema do
    required(:email) { … }
    required(:name)  { … }
    # other validations …
  end
end
```

Groups can be **deeply nested**, without any limitation.

```ruby
validations do
  required(:customer).schema do
    # other validations …

    required(:address).schema do
      required(:street) { … }
      # other address validations …
    end
  end
end
```

### Composition

Until now, we have seen only small snippets to show specific features. That really close view prevents us to see the big picture of complex real world projects.

As the code base grows, it’s a good practice to DRY validation rules.

```ruby
class AddressValidator
  include Hanami::Validations

  validations do
    required(:street) { … }
  end
end
```

This validator can be reused by other validators.

```ruby
class CustomerValidator
  include Hanami::Validations

  validations do
    required(:email) { … }
    required(:address).schema(AddressValidator)
  end
end
```

Again, there is no limit to the nesting levels.

```ruby
class OrderValidator
  include Hanami::Validations

  validations do
    required(:number) { … }
    required(:customer).schema(CustomerValidator)
  end
end
```

In the end, `OrderValidator` is able to validate a complex data structure like this:

```ruby
{
  number: "123",
  customer: {
    email<EMAIL_ADDRESS>    address: {
      city: "Rome"
    }
  }
}
```

### Whitelisting

Another fundamental role that validators plays in the architecture of our projects is input whitelisting.
For security reasons, we want to allow known keys to come in and reject everything else.

This process happens when we invoke `#validate`.
Allowed keys are the ones defined with `.required`.

**Please note that whitelisting is only available for `Hanami::Validations::Form` mixin.**

### Result

When we trigger the validation process with `#validate`, we get a result object in return. It’s able to tell if it’s successful, which rules the input data has violated and an output data bag.

```ruby
result = OrderValidator.new({}).validate
result.success? # => false
```

#### Messages

`result.messages` returns a nested set of validation error messages.

Each error carries on informations about a single rule violation.

```ruby
result.messages.fetch(:number)   # => ["is missing"]
result.messages.fetch(:customer) # => ["is missing"]
```

#### Output

`result.output` is a `Hash` which is the result of whitelisting and coercions. It’s useful to pass it do other components that may want to persist that data.

```ruby
{
  "number"  => "123",
  "unknown" => "foo"
}
```

If we receive the input above, `output` will look like this.

```ruby
result.output
  # => { :number => 123 }
```

We can observe that:

  * Keys are _symbolized_
  * Only whitelisted keys are included
  * Data is coerced

### Error Messages

To pick the right error message is crucial for user experience.
As usual `Hanami::Validations` comes to the rescue for most common cases and it leaves space to customization of behaviors.

We have seen that builtin predicates have default messages, while [inline predicates](#inline-custom-predicates) allow to specify a custom message via the `:message` option.

```ruby
class SignupValidator
  include Hanami::Validations

  predicate :email?, message: 'must be an email' do |current|
    # ...
  end

  validations do
    required(:email).filled(:str?, :email?)
    required(:age).filled(:int?, gt?: 18)
  end
end

result = SignupValidator.new(email: 'foo', age: 1).validate

result.success?               # => false
result.messages.fetch(:email) # => ['must be an email']
result.messages.fetch(:age)   # => ['must be greater than 18']
```

#### Configurable Error Messages

Inline error messages are ideal for quick and dirty development, but we suggest to use an external YAML file to configure these messages:

```yaml
# config/messages.yml
en:
  errors:
    email?: "must be an email"
```

To be used like this:

```ruby
class SignupValidator
  include Hanami::Validations
  messages_path 'config/messages.yml'

  predicate :email? do |current|
    # ...
  end

  validations do
    required(:email).filled(:str?, :email?)
    required(:age).filled(:int?, gt?: 18)
  end
end

```

#### Custom Error Messages

In the example above, the failure message for age is fine: `"must be greater than 18"`, but how to tweak it? What if we need to change into something diffent? Again, we can use the YAML configuration file for our purpose.

```yaml
# config/messages.yml
en:
  errors:
    email?: "must be an email"

    rules:
      signup:
        age:
          gt?: "must be an adult"

```

Now our validator is able to look at the right error message.

```ruby
result = SignupValidator.new(email: 'foo', age: 1).validate

result.success?             # => false
result.messages.fetch(:age) # => ['must be an adult']
```

##### Custom namespace

⚠ **CONVENTION:** For a given validator named `SignupValidator`, the framework will look for `signup` translation key. ⚠

If for some reason that doesn't work for us, we can customize the namespace:

```ruby
class SignupValidator
  include Hanami::Validations

  messages_path 'config/messages.yml'
  namespace     :my_signup

  # ...
end
```

The new namespace should be used in the YAML file too.

```yaml
# config/messages.yml
en:
  # ...
    rules:
      my_signup:
        age:
          gt?: "must be an adult"

```

#### Internationalization (I18n)

If your project already depends on `i18n` gem, `Hanami::Validations` is able to look at the translations defined for that gem and to use them.

```ruby
class SignupValidator
  include Hanami::Validations

  messages :i18n

  # ...
end
```

```yaml
# config/locales/en.yml
en:
  errors:
    signup:
      # ...
```

## FAQs
### Uniqueness Validation

Uniqueness validation isn't implemented by `Hanami::Validations` because the context of execution is completely decoupled from persistence.
Please remember that **uniqueness validation is a huge race condition between application and the database, and it doesn't guarantee records uniqueness for real.** To effectively enforce this policy you can use SQL database constraints.

Please read more at: [The Perils of Uniqueness Validations](http://robots.thoughtbot.com/the-perils-of-uniqueness-validations).

## Acknowledgements

Thanks to [dry-rb](http://dry-rb.org) Community for their priceless support. ❤
`hanami-validations` uses [dry-validation](http://dry-rb.org/gems/dry-validation) as powerful low-level engine.

## Contributing

1. Fork it ( https://github.com/hanami/validations/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Copyright

Copyright © 2014-2021 Luca Guidi – Released under MIT License

This project was formerly known as Lotus (`lotus-validations`).

repository: smsdigital/hanami-validations

repo_name: smsdigital/hanami-validations


text:
---
layout: post
title: EFI investigation recepie
subtitle: How to get to the inside of you EFI BIOS
---

No, I am not Phineas Fisher, but I do think that good security education benefits everyone. Security through obscurity is only good
against the most lazy attacker, making it now, in the age of dedicated, well funded and even state sponsored adversaries, an increasingly dangerous attitude.

So, to get to the insides of your BIOS crypto, do this:

1. Download the EFI BIOS distribution for your motherboard from the vendor site. Most of them have BIOS's dating back several years.

2. The package you downloaded has the testing/flashing etc code built in. You need to extract the actual EFI code from the distribution.
Most of the time you could just use a standard archive extractor to get it out. Sometimes you need to search for archive identifier inside the package. Other times you might need a specialized extractor ("extract-hdr-from-exe")

3. Now unpack your EFI code with the UEFIExtract that is a part of the UEFITool

4.  Do a global search

5. These are standard ELF files.

6. If you get stuck, use UEFIReverse's EFI environment emulation to actually RUN the code on your platform. You can then debug the code in your favorite debugger, set watches and view states. The reversing galore!

Hopefully this helps vendors understand the issues they are facing (encrypt your binaries!), and gives security expects a couple of hints (EFI reversing is simple).


text:
# pai

The easy input wrapper for PHP.

> **Abandoned:** Use the `stdin` class of [Asyncore](https://github.com/hell-sh/Asyncore), instead.

## Why?

- Asynchronous input on Windows is only possible using workarounds. [This is a known issue but no one is interested in solving it.](https://bugs.php.net/bug.php?id=34972)
- STDIN is entirely broken on Windows [as of 7.4.](https://stackoverflow.com/questions/59092779/has-php-7-4-broken-fgetsstdin)

## When?

Whenever you need asynchronous or synchronous input of lines to work on all operating systems. If you need character-by-character input, I'm afraid your script will not work on Windows, regardless of what you do.

## Installation

pai has no prerequisites, you can simply `composer require hell-sh/pai` or copy the src folder and require the pai.php in there.

All functions on `hellsh\pai` are [documented here.](https://hell-sh.github.io/pai/classhellsh_1_1pai.html)

repository: hell-sh/pai

repo_name: hell-sh/pai


text:
# PatMat

## Prerequisities

* OS: Debian 6.0.10,  Ubuntu 18.04+ and CentOS 7.6 fully tested, other Linux releases should also work but not fully tested.
* Software: GLIBC_2.18 or higher version, Python 3 or higher version, openssh-server is correctly configured (check if `ssh localhost` works), time(/usr/bin/time) is installed.

## Configurations

The configuration folder is "conf", where there are three files to configure:

### params.ini

* workdir: The **absolute** directory of the working folder. It is the root directory of the data and temporary files. After configuring the workdir, your data should be placed at: $workdir/$graph_name/DATA/$prefix.
* number_workers: number of workers in each machine.
* number_machines: number of machines used in cluster.

### hosts

The host file used in Timely dataflow. Each line is in the form of:
       `host:port`, where host can be either host name or ip_addr, port can be any available port.

### graph_conf.json

* storage
  * $workdir: The **absolute** directory of the working folder. It is the root directory of the data and temporary files.
  * $persist_data: the graph dataset's name, which is put under the $workdir, and maintain as $workdir/$persist_data/DATA.
  * $temp_data: the temporary folder relative to $workdir, by default it is set as "temp".
* $is_directed: specify if the graph is directed or not.
* $label_type: the label type of graph, choose "Void" (no labels), "Simple" (unsigned int32), or "String". We use "Simple"
                      by default for labelled pattern matching.
* $graph_type: the graph storage type, "StaticGraph" (CSR format) or "GraphMap" (BTreeMap for structures). We use "StaticGraph"
                      by default.
* $prefix: the prefix of the file of the partitioned graph data.
* $tri_prefix: the prefix of the file of the triangle partitioned graph data..

## Data Storage & Preprocessing

The storage hierarchy used in the experiment looks like the following.

$workdir

---- $persist_data

-------- DATA

------------ $prefix

***
Note!!! In the experiment, we treat all data graphs as undirected graphs.
***

### One-stand preprocessing

We offer a tool to preprocess a raw graph file (in csv format) into the formatted graph used in the experiment.
Consider a graph stored as "dir/to/sample.csv", in which each line is in the form of

`src_id<separator>dst_id[<separator>edge_label]`

where the label part is optional, depending on whether it is a labelled graph or not. If it is a labelled graph, you should further provide a node label file, suppose is "/dir/to/sample_nl.csv",
and each line is in the form of:

`node_id<separator>node_label`  —— separator should be the same as the edge file.

Then you call the following for preprocessing:

`python3 preprocessing.py <graph_name> <edge_file> <sep[tab|comma|space]> <has_headers> <buffer_size> [node_file]`

where the <edge_file> and [node_file] should be the **absolute file path**, \<sep> specifies the separator in csv files(we support tab, comma or space separators), <has_headers> specifies if there exist headers in csv files, <buffer_size> is the number of lines to read from csv files each time.

For example, we can parse the unlabelled sample graph data in "csv/unlabelled/" via

`python3 preprocessing.py sampleUnlabelled /your-current-dir/csv/unlabelled/sample.csv comma false 100`

or we can parse the labelled sample graph data in "csv/labelled/" via

`python3 preprocessing.py sampleLabelled /your-current-dir/csv/labelled/edges.csv comma true 100 /your-current-dir/csv/labelled/nodes.csv`

***
Note!!! The above <graph_name> is specified by yourself, but it should be consistent in the following.
***

This will generate the following files under the folder: "$workdir/<graph_name>/DATA":
h1w3                          -- The hash partitions of the formatted static graph.
h1w3t                         -- The triangle partitions of the formatted static graph.

***
Note!!! The partition's prefix name is according to the $number_machines and $number_workers you
specified in "conf/params.ini"
***

Optional: If it is a labelled graph, there will be some label-related metadata.

### Detailed preprocessing steps

If you are interested in detailed preprocessing, please read this part. Otherwise, go to [Join Plans].

There are two steps of preprocessing, graph_part and tri_part, introduced as follows.

#### graph_part

After the preprocessing, we can call hash graph partition utility as:
`python3 graph_part.py <edge_file> <graph_name> <part_prefix> <sep> <buffer_size> <reorder> <has_headers> [node_file] [label_type]`

where the \<reorder> specifies if we reorder the node ids by their degree, we set this option by default to be true in our experiments, and the <part_prefix> can be specified with any easy-remembered name. We tend to use
h[$number_machines]w[$number_workers] as the $part_prefix.

For example, if you have 10 machines, and each runs 3 workers, and you specify $part_prefix as h10w3.
After <graph_part>, you should see that there are 10 partitions, each named h10w3 in the corresponding folders in each machine, that will be jointly accessed by all three workers in that machine.

#### tri_part

CliqueJoin(BinaryJoin using triangle indexing) relies on triangle partition, and <tri_part> does the job via:
`python3 tri_part.py <graph_name> <in_prefix> <out_prefix>`

Here, "h10w3" is the <in_prefix> you specified in `graph_part`, now there is an <out_prefix> and you should
set it differently from $prefix. For example, "h10w3t".

After <tri_part>, you should see that there are 10 partitions, each named h10w3t in the corresponding folders in each machine.

***
Note!!! In order to minimize memory usage, triangles will temporarily be stored on the disk under you "workdir/" before being merged into the triangle partition. It's safe to delete directories with names "temp.*" if the program exits unexpectedly.
***

## Join Plans

We offer the BinaryJoin and GenericJoin plans for all queries under `plans/` directory(generated by
compute_all_plans.py). You can generate all plans by calling:

`python3 compute_all_plans.py <is_labelled> <is_symm_break> <is_compress> <is_tri_indexing> [batches]`

where the <is_symm_break> specifies if the plan generates symmetry breaking (to assign partial order for query nodes), the <is_compress> specifies if the plan generates compression config, the <is_tri_indexing> specified if we want to generate join plans supporting triangle indexing (which is strongly recommended), and the [batches] specifies the batch size in each join.

We have already generated all join plans in `plans/BinaryJoin/` folder, they all support triangle indexing, compression and batching.

***
Note!!! Even you can generate plans with all optimizations: triangle indexing, compression and batching,
you can still configure whether to use them when running pattern matching in `patmat.py`.
***

We provide the query's json files in "query_json" folder. For the labelled queries, as we are using
label id instead of actual label in the data graph, we include a label_id map in "query_json/labelled".

The query's json file is quite straightforward, where you just need to specify nodes and edges. Please refer to the json files in "query_json" folder, take `query_json/labelled/q1.json` for example, we give some comments as follows:

```json
{
    "is_directed": false,
    "is_labelled": true,
    "vertices": [
        [0, 3], // node 0, label 3
        [1, 10],
        [2, 9]
    ],
    "edges": [
        [0, 1, null], // edge (0, 1), no label
        [1, 2, null]
    ],
    // currently you just set `partial_order` as null, you can generate it in join plan
    "partial_order": null
}
```

If you want to run other queries, you can generate the plan using the utilities we provided:
`bin/compute_join_plan <query_name> <query_file_path> <Algorithm[BinaryJoin|GenericJoin]> <output_dir>
<output_file> --is_compress <true|false> --trindex <true|false> --batches [batches]`

where $trindex specifies if we use triangle indexing(Again, we strongly recommend you to use triangle indexing to accelerate pattern matching). If [batches] is not specified, we set it to 128 by default. Note that even the batch size is set, you can always choose whether to use batching while running patmat.py.

We generate unlabelled query q8's BinaryJoin plan as an example. Note that the q8 can be replaced as any
query you want.

```bash
bin/compute_join_plan q8 query_json/unlabelled/q8.json BinaryJoin plans/BinaryJoin/unlabelled/ q8_plan.json
--batches 128 --compress true --trindex true
```

## Run the algorithms

After preparing everything above, it is easy to run the algorithms by calling:
`python3 patmat.py <algorithm> <query_name> <is_labelled> <plan_path> <graph_conf_path> <tri_index[true|false]> <is_compress[true|false]> [batches]`

Note that we only provide BinaryJoin and GenericJoin algorithms in the scripts. The others will be released
as source codes.

<plan_path> and <graph_conf_path> are provided in the form of relative path to current directory.

***
Note!!! Pay attention to $number_machines and $number_workers you specify in "conf/params.ini", you should use:
h[$number_machines]w[$number_workers] and h[$number_machines]w[$number_workers]t.

Also, the plan must be consistent with $trindex: if you set $trindex as true, you must use the plan generated
with $trindex as true. Further, if you do not specify $batches here, even it is configured in the join plan,
no batching will be applied.
***

Below we show the whole configurations of running our sample examples.
***
Note!!! Please change the following $workdir to your configured $workdir.
***

conf/hosts

```text
localhost:18888
```

conf/params.ini

```ini
[DEFAULT]
workdir=/your/dir/to/workdir
number_workers=3
number_machines=1
```

conf/graph_conf.json

```json
{
  "storage":{
    "workdir": "/your/dir/to/workdir",
    "persist_data": "sampleUnlabelled",
    "temp_data": "temp"
  },
  "is_directed": false,
  "label_type": "Simple",
  "graph_type": "StaticGraph",
  "prefix":"h1w3",
  "tri_prefix":"h1w3t"
}
```

If you want to run unlabelled query q5 using BinaryJoin algorithm with triangle indexing, compression and batching (for example, set batches to 128), just call:
`python3 patmat.py BinaryJoin q5 false plans/BinaryJoin/unlabelled/q5_plan.json conf/graph_conf.json true true 128`

The result of unlabelled q5 in unlabelled sample graph (data/sampleUnlabelled) should be 32679.

### Sample Graph Ground Truth

Unlabelled Sample Graph Ground Truth with symmetry breaking(we put it under data/sampleUnlabeleld):

|   q1   |   q2   |   q3   |   q4   |   q5   |   q6   |    q7    |   q8   |   q9   |
|--------|--------|--------|--------|--------|--------|----------|--------|--------|
|  7191  |  3975  |   170  | 121809 |  32679 |  4080  |  1353345 | 252699 | 126805 |

Labelled Sample Graph Ground Truth without symmetry breaking(we put it under data/sampleLabelled):

|   q1   |   q2   |   q3   |   q4   |    q5    |   q6   |   q7  |   q8   |   q9   |
|--------|--------|--------|--------|----------|--------|-------|--------|--------|
|  34445 |  40850 |  24632 |  22557 |  1789718 |  1076  |   6   |   16   |  2670  |

The queries (unlabelled and labelled) are listed according to our VLDB paper.

### Logs

All logs can be found in logs folder, with "logs/<algorithm>" and "logs/partition" indicate the algorithm running logs and partition logs respectively.

## Publications

* Longbin Lai et al., Distributed Subgraph Matching on Timely Dataflow. [VLDB 2019](http://www.vldb.org/pvldb/vol12/p1099-lai.pdf).
* Longbin Lai et al., A Survey and Experimental Analysis of Distributed Subgraph Matching in [arxiv](https://arxiv.org/abs/1906.11518). p.s. A full version of the VLDB submission

## Contributors

* "Longbin Lai<EMAIL_ADDRESS>* "Zhengyi Yang<EMAIL_ADDRESS>* "Zhu Qing<EMAIL_ADDRESS>* "Xin Jin<EMAIL_ADDRESS>* "Zhengmin Lai<EMAIL_ADDRESS>* "Ran Wang<EMAIL_ADDRESS>* "KongZhang Hao<EMAIL_ADDRESS>
## Acknowledgements
Special thanks to the following people and organizations for their supports to this work.
* "Xuemin Lin, Wenjie Zhang, CSE, UNSW Sydney<EMAIL_ADDRESS>* "Lu Qin, Ying Zhang, CAI, UTS Sydney, <{lu.qin<EMAIL_ADDRESS>* "Zhengping Qian, Jingren Zhou, Alibaba corporation, <{zhengping.qzp<EMAIL_ADDRESS>* "Zhejiang Lab, <http://en.zhejianglab.com/>"

## Issues

Please send to<EMAIL_ADDRESS><EMAIL_ADDRESS>for any further questions.

repository: hongtaicao/patmat-run

repo_name: hongtaicao/patmat-run


text:
# PyUltraLight
PyUltraLight Repository

# Installation
```
conda create -n pyultralight2 python=2

conda activate pyultralight2

conda install jupyter

python -m ipykernel install --user --name pyultralight2 --display-name "pyultralight2"

cd ~/opt/miniconda3/envs/pyultralight2/compiler_compat

mv ld ld.bak

pip install numpy numexpr numba h5py pyfftw matplotlib multiprocessing

cd ~/projects/working/

git clone https://github.com/bunnyandbear/PyUltraLight.git

pynote
```
# Prerequisites

In order to run the Jupyter notebook, a number of Python prerequisites must first be installed. The full list of modules required by the main code and the notebook is:

numpy, numexpr, numba, h5py, pyfftw, time, sys, os, matplotlib, math, multiprocessing.

Note: Errors may be encountered for older matplotlib versions. Please ensure you have the latest version:
pip install --upgrade matplotlib

# More information

Instructions on basic setup and usage can be found here:
http://cosmology.blogs.auckland.ac.nz/pyultralight/

The complete code release paper can be found here:
https://arxiv.org/pdf/1807.04037.pdf

repository: bunnyandbear/PyUltraLight

repo_name: bunnyandbear/PyUltraLight


text:
## items_cache.json
For the first iteration of this tool, items_cache.json will be the source of truth for items data without going through
Riot's API. Since this data gets manually updated per version, manual commits to Git are necessary for the time being.
Likewise, the image URL within reddit_bot.py needs to change to reflect the new data.

## custom_wiki_links_overrides.json
The majority of items named by Riot in their Items API can be translated directly to a wiki link by directly
appending the item's name to the end of the wiki/ url. There are some exceptions (such as "Blade of The Ruined King")
that need to be mapped manually. Additional testing is needed to ensure that all existing items will continue to map
to their respective wiki links.

## subreddits.txt
A list of valid subreddits to run the bot separated by newline delimeters.

## lolfetcher_done.txt
A list of completed comment and submission IDs where the LoLFetcher bot has already responded.


text:
---
title: Changing a select value programmatically
description: Changing a select value successfully using Selenium end to end tests
author: Phil Baker
date: 2019-01-18
dateModified: 2019-01-18
---
I ran into an issue recently where I needed an E2E test to choose an option from a select element and submit a form. This seems like a fairly easy thing to do but changing the the selected item with JavaScript did not work.

It turns out that the [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) needs to be dispatched after the value is changed. [Here's an example](https://codepen.io/philbaker/pen/RwNeemw).

branch_name: refs/heads/source


text:
---
layout: default
---

# 1994-08-10 - Re: e$

## Header Data

From<EMAIL_ADDRESS>(Duncan Frissell)

To<EMAIL_ADDRESS>Message Hash: 5303714df14a30cafe11c5e3e668e57a2b146390cd27f455e528fb3efa57bd76

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-08-10 18:10:18 UTC

Raw Date: Wed, 10 Aug 94 11:10:18 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Duncan Frissell)
Date: Wed, 10 Aug 94 11:10:18 PDT
To<EMAIL_ADDRESS>Subject: Re: e$
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 01:51 PM 8/9/94 -0400, Perry E. Metzger wrote:
>
>> > Yes it does. Bearer bonds are illegal in the US.

>If the check is written to "cash" and is used to avoid federal
>transfer reporting requirements, it is CURRENTLY illegal. I suspect
>that checks made out to "cash" would be illegal in all cases if they
>were widely used to avoid reporting requirements.
>
>Perry
>

Bearer bonds are not illegal in the US.

Under the Tax Equity and Fiscal Responsibility Act of 1982 (TEFRA), any
interest payments made on *new* issues of domestic bearer bonds are not
deductible as an ordinary and necessary business expense so none have been
issued since then.  At the same time, the Feds administratively stopped
issuing treasury securities in bearer form.  Old issues of government and
corporate debt in bearer form still exist and will exist and trade for 30 or
more years after 1982.  Additionally, US residents can legally buy foreign
bearer securities.

DCF

"Who promises the Black Caucus that if they will help kill the Crime Bill,
he will support affirmative action in executions -- starting with the White
Guys responsible for the Waco Massacre."

{% endraw %}
```

## Thread

+ Return to [August 1994](/archive/1994/08)

+ Return to<EMAIL_ADDRESS>(Duncan Frissell)](/authors/frissell_at_panix_com_duncan_frissell_)"
+ Return to "[prig0011@gold.tc.umn.edu](/authors/prig0011_at_gold_tc_umn_edu)"

+ 1994-08-10 (Wed, 10 Aug 94 11:10:18 PDT) - Re: e$ -<EMAIL_ADDRESS>(Duncan Frissell)_
  + 1994-08-10 (Wed, 10 Aug 94 12:11:54 PDT) - [Re: e$](/archive/1994/08/3e1e868f0ab6b4778621104c9494bedced9b9c5e1532e0fc6b61769b9580ea95) -<EMAIL_ADDRESS>


text:
fs-readdir-sync-with-file-types [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
=========
Node.js v10.10.0 [fs.readdirSync](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_readdirsync_path_options) [ponyfill](https://ponyfill.com) of `withFileTypes` option.

`options.withFileTypes` is always set to true and result contain objects similar to [fs.Dirent](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_class_fs_dirent).

## Install

```
npm i fs-readdir-sync-with-file-types
```

## API

- `path` `<string> | <Buffer> | <URL>`

Returns: <fs.Dirent[]>

Example:

```js
const readdirSync = require('fs-readdir-sync-with-file-types');

readdirSync('.');
// returns on node v10.10
Dirent { name: 'LICENSE', [Symbol(type)]: 1 },
Dirent { name: 'README.md', [Symbol(type)]: 1 },
Dirent { name: 'index.js', [Symbol(type)]: 1 },

// returns on node < v10.10

{ name: 'LICENSE',
isBlockDevice: [Function: bound ],
isCharacterDevice: [Function: bound ],
isDirectory: [Function: bound ],
isFIFO: [Function: bound ],
isFile: [Function: bound ],
isSocket: [Function: bound ],
isSymbolicLink: [Function: bound ] },

{ name: 'README.md',
isBlockDevice: [Function: bound ],
isCharacterDevice: [Function: bound ],
isDirectory: [Function: bound ],
isFIFO: [Function: bound ],
isFile: [Function: bound ],
isSocket: [Function: bound ],
isSymbolicLink: [Function: bound ] },

{ name: 'index.js',
isBlockDevice: [Function: bound ],
isCharacterDevice: [Function: bound ],
isDirectory: [Function: bound ],
isFIFO: [Function: bound ],
isFile: [Function: bound ],
isSocket: [Function: bound ],
isSymbolicLink: [Function: bound ] }
```

## Related

- [fs-copy-file](https://github.com/coderaiser/fs-copy-file "fs-copy-file") - Asynchronously copies src to dest.
- [fs-copy-file-sync](https://github.com/coderaiser/fs-copy-file-sync "fs-copy-file-sync") - Synchronously copies src to dest.
- [fs-readdir-with-file-types](https://github.com/coderaiser/fs-readdir-with-file-types "fs-readdir-with-file-types") - Asynchronousely read directory with file types.

## License
MIT

[NPMIMGURL]:                https://img.shields.io/npm/v/fs-readdir-sync-with-file-types.svg?style=flat&longCache=true
[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/fs-readdir-sync-with-file-types/master.svg?style=flat&longCache=true
[DependencyStatusIMGURL]:   https://img.shields.io/david/coderaiser/fs-readdir-sync-with-file-types.svg?style=flat&longCache=true
[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat&longCache=true
[CoverageIMGURL]:           https://coveralls.io/repos/coderaiser/fs-readdir-sync-with-file-types/badge.svg?branch=master&service=github
[NPMURL]:                   https://npmjs.org/package/fs-readdir-sync-with-file-types "npm"
[BuildStatusURL]:           https://travis-ci.org/coderaiser/fs-readdir-sync-with-file-types  "Build Status"
[DependencyStatusURL]:      https://david-dm.org/coderaiser/fs-readdir-sync-with-file-types "Dependency Status"
[LicenseURL]:               https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]:              https://coveralls.io/github/coderaiser/fs-readdir-sync-with-file-types?branch=master


text:
# Wordify Phone Number
#### Wordify is a Python package to wordify Phone numbers.

Main 3 functionalities are:

- number_to_words()

      takes a string representing phone number and returns wordified string.

- words_to_numbers()

      takes wordified string and returns phone number.

- all_wordifications()

      takes a string representing phone number and returns a list of all wordified numbers.

## Test
```python
pytest
```

## Usage

```python
from  algorithm.wordifier import Wordifier

wordifier = Wordifier()
wordifier.add_words_to_dictionary("data/google_10000_medium.txt")
number = "9878724665"
wordified_number = "9878SCHOOL"
response = wordifier.words_to_number(wordified_number) # returns phone number
response = wordifier.number_to_words(number) # returns wordified number
response = wordifier.all_wordifications(number) # returns list of woridifed number
```
#### Output:
```python
Words to number: Query:  9878SCHOOL Response:<PHONE_NUMBER>

Number to words: Query:<PHONE_NUMBER> Response:  9878SCHOOL

All wordification for Number:<PHONE_NUMBER>
['98STRAIN65', '987TRAIN65', '9878SCHOOL']
```
## Assumptions:
- The number contains 9 to 12 digit
- The number can't have 0 and 1 digit except for the initial two positions
- Initial two numbers are not used for wordification
- Dictionary may contain duplicate words

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: DenimPatel/wordify

repo_name: DenimPatel/wordify


text:
---
layout:     games
title:      'Rhino Rescue'
type:       game
image:      '/assets/images/rhino-rescue-play.jpg'
permalink:  '/games/rhino-rescue/'
logo:       '/assets/images/rhino-rescue-logo.png'
logo_small: '/assets/images/rhino-rescue-logo-small.png'
position:   7
color:      'orange'
summary:    'A cooperative game where players work together to rescue the last white rhino, for 3-6 players.'
youtube:
sellsheet:
pnp:
ages:       13+
players:    '3-6 players'
time:       '35-45 minutes'
---

The white rhino is in danger of extinction. You have traveled to an unexplored jungle to help rescue  one of the last survivors. Your team must explore the jungle and find a safe path for the rhino to follow to a wildlife sanctuary.

In Rhino Rescue, you play as one of many wilderness guides. You will swim mighty rivers, uncover traps, evade poachers, and find treasures. With limited resources, you must make the best decision to achieve your goals.

As you move through the jungle, you will mark a safe trail for the rhino to follow. Once the path is clear — or if you take too much time — the rhino will make a final run for safety.

Game board tiles are double sided. At the start, all tiles indicate green jungle, representing unexplored territory. The flip side of the tile represents its actual terrain. Some effects are positive, others negative.

Rhino Rescue is designed to foster discussion among groups and teams. It focuses on collaboration, empathy, and group problem solving. The game is used by Open Strategy Partners for corporate training.

gha_language: SCSS


text:
# Passiflora vitiensis (Seem.) Mast. SPECIES

#### Status
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Disemma vitiensis Seem.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)

[![GitHub license](https://img.shields.io/github/license/leits/MeetingBar.svg)](https://github.com/leits/MeetingBar/blob/master/LICENSE)
[![Translation state](https://hosted.weblate.org/widgets/meetingbar/-/app/svg-badge.svg)](https://hosted.weblate.org/engage/meetingbar/)
[![Github all releases](https://img.shields.io/github/downloads/leits/MeetingBar/total.svg)](https://GitHub.com/leits/MeetingBar/releases/)
[![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)

**MeetingBar** is a menu-bar app for your calendar meetings (macOS 10.15+).

Integrated with 50+ meeting services so you can quickly join meetings from an event or create ad-hoc meetings.

[![Download on the Mac App Store](mas_badge.png)](https://apps.apple.com/us/app/id1532419400)

## Features

* Show the next meeting in the system statusbar
  * Show upcoming meetings with name or icon
  * Shorten the meeting title to save space in the statusbar
  * Choose icon to show for the upcoming meeting, e.g. the MeetingBar icon or the meeting app icon
  * Show only meetings within a certain timeframe (e.g. show only meetings in the next 30 minutes)
* Show all upcoming events from today and tomorrow (optional) in the expanded system menubar
  * show or hide all-day events or show only all-day events with a meeting link
  * show or hide events without guests
  * show or hide declined events
  * show or hide meeting app icons
  * show or hide pending events
* Show events from all your macOS calendars incl. notes, location and attendees
* Open the event in macOS calendar or Fantastical 3 (if installed)
* Configure your favorite browser to use for joining meetings and new meetings
* Select for specific services like Zoom or MS Teams to open the meeting in the installed app or in the default web browser
* Attend a meeting with one click
* Join the next online meeting with a keyboard shortcut
* Create a new meeting in your favorite app with a keyboard shortcut
* Get macOS notifications for upcoming events
* Bookmark your favorite meeting, show it in the statusmenu and make it accessible with a shortcut
* Automatically launch the app at login
* Execute custom AppleScript, e.g. to pause music when joining a meeting

## Setup

1. Install either:

* From the [App Store](https://apps.apple.com/us/app/id1532419400)
* Using [Homebrew](https://brew.sh):

  ```bash
  brew install meetingbar
  ```

* Manually download the [latest version](https://github.com/leits/MeetingBar/releases/latest/download/MeetingBar.dmg)

1. Make sure your calendar is synchronized to the macOS Calendar app, or [add a calendar account](https://support.apple.com/guide/calendar/add-or-delete-calendar-accounts-icl4308d6701/mac). You can also use Google as a calendar provider.
2. Open the app and go through the onboarding.
3. Never miss your next meeting again! :tada:

If you experience problems with installation, or have any questions please check the [FAQ](../../wiki/FAQ) or [submit an issue](https://github.com/leits/MeetingBar/issues/new).

## Supported meeting services

MeetingBar supports more than 50 services, including Google Meet, Zoom, Microsoft Teams, GoToMeeting, Skype, WebEx, and Discord. [See the full list](https://github.com/leits/MeetingBar/discussions/108).

## Third-Party Integrations

* [Raycast commands](https://github.com/raycast/script-commands/tree/master/commands#meetingbar)

## Other similar apps

* NextMeeting - free, simpler
* Meeter - commercial solution, provides similar features and more regarding contacts

## Contribute

See [CONTRIBUTING.md](CONTRIBUTING.md) for more on how to contribute to MeetingBar.

## Support the project

❤ Love this project?

Support it on [Patreon](https://www.patreon.com/meetingbar) or via in-app purchases.

## Credits

MeetingBar is **stable** and in **active development** by [leits](https://github.com/leits). Written in Swift 5.0.

MeetingBar also uses these resources:

* [KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) for managing global keyboard shortcuts
* [Defaults](https://github.com/sindresorhus/Defaults) for managing user settings
* [SwiftyStoreKit](https://github.com/bizz84/SwiftyStoreKit) for patronage via in-app purchases

App logo made by [Miroslav Rajkovic](https://www.rajkovic.co/).

## Contributors ✨

Thanks goes to these wonderful people:

Andrii Leitsius
💻 🚧

Jens Goldhammer
💻 🚧

Max
💻

If you encounter any bugs or have a feature request, [add an issue](https://github.com/leits/MeetingBar/issues/new).

repository: leits/MeetingBar

gha_language: Swift

repo_name: leits/MeetingBar


text:
---
layout: documentation
title: Special features
permalink: /docs/engine/ra-optimisation/special-features
hide: true
root-page: Documentation
docu-section: CASTOR
docu-parent: CASTOR
order: 2
feature-img: "assets/img/farao3.jpg"
tags: [Docs, Search Tree RAO, CASTOR]
summary-hmax: 0
---

Several special features can be included in the RAO optimisation:
- limiting loop-flows on cross-zonal cnecs
- monitoring (rather than optimising) the flow on certain FlowCnecs (MNECs)
- not taking into account certain FlowCnecs - under specific conditions - for the computation of the minimum margin in the objective function

The objective function value is separated into two categories:
- the **functional** cost reflects the business value of the objective (i.e. the cost associated to the minimum margin and the business penalties on usage of remedial actions)
- the **virtual** cost reflects the violation of some special constraints. The first two special features (loop-flows & MNECs) are handled through the virtual cost.

gha_language: HTML


text:
# Readme Generator
### Welcome to my readme generator

## Description
This nodejs application will help you generate a simple yet enough basic information for your applications.

## Table of Contents
- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Contributing](#contributing)
- [Tests](#tests)
- [Questions](#questions)

## Installation
1. You can clone the folder from github
2. Run "npm i" in the terminal

## Usage
UCI bootcamp homework assignment

## License
![badge](https://img.shields.io/badge/license-MIT-blue.svg)
</br>
This application is licensed under the MIT license.

## Contributing
Bao Nguyen

## Tests
No tests are included

## Questions
Find me on github: [bnguyen467](https://github.com/bnguyen467)
</br>
Contact me through email<EMAIL_ADDRESS>
### This is how the application looks like in the VS Code terminal
**Follow the link to the video for more details:** https://www.youtube.com/watch?v=vxXWUsk2QVs

![Example Image](https://github.com/bnguyen467/readme-generator/blob/master/images/code-terminal.png)


text:
# Changelog

As this project is pre 1.0, breaking changes may happen for minor version bumps. A breaking change will get clearly notified in this log.

## 0.0.10

* Send only relevant data to compliance callbacks (#17).
* `hooks` are now called `callbacks` in `bridge` server.

## 0.0.9

* Transaction builder (#14)

## 0.0.8

* [Compliance protocol](https://www.stellar.org/developers/learn/integration-guides/compliance-protocol.html) support.
* Saving and reading memo preimage.
* This repo will now contain two apps: `bridge` (for building, submitting and monitoring transactions) and `compliance` (for Compliance protocol). Both are built in a single build process. Each app has it's own README file.
* Dependency injection is now done using [facebookgo/inject](https://godoc.org/github.com/facebookgo/inject).
* Handling and validation of requests and responses is now done in `protocols` package. This package contains methods for transforming `url.Values` from/to request structs and for marshalling responses. It also contains common errors (missing/invalid fields, internal server error, etc.) and all protocol-specific error responses. It also includes stellar.toml and federation resolving.
* New `net` and `server` packages that contain some helper network connected functions and structs.
* Improvements to `db` package.

## 0.0.7

* Add path payments,
* Change `config.toml` file structure,
* Partial implementation of Compliance Protocol.

## 0.0.6

* When there are no `ReceivePayment`s in database, payment listener will start with cursor `now`.
* Fix a bug in `db.Repository.GetLastCursorValue()`.

## 0.0.5

* Add `MEMO_HASH` support.

## 0.0.4

* Fixed bugs connected with running server using `postgres` DB (full refactoring of `db` package),
* Fixed starting a minimum server with a single endpoint: `/payment`.

## 0.0.3

* Send `create_account` operation in `/payment` if account does not exist.
* Fixed major bug in `PaymentListener`.
* Sending to Stellar address with memo in `/send`.
* Standardized responses.
* Updated README file.

## 0.0.2

* Added `/payment` endpoint.
* Now it's possible to start a server with parameter that are not required. Minimum version starts a server with a single endpoint: `/payment`.
* Added config parameters validation.
* Added `network_passphrase` config parameter.
* `postgres` migration files.
* Fixed sending to Stellar address.
* Fixed `horizon.AccountResponse.SequenceNumber` bug.
* Fixed minor bugs.
* Code refactoring.
* Added example config file to the release package
* Updated README file.

## 0.0.1

* Initial release.


text:
Static page
===========

![Integrity check](https://github.com/baraja-core/cms-static-page/workflows/Integrity%20check/badge.svg)

Basic static page editor.

📦 Installation
---------------

It's best to use [Composer](https://getcomposer.org) for installation, and you can also find the package on
[Packagist](https://packagist.org/packages/baraja-core/cms-static-page) and
[GitHub](https://github.com/baraja-core/cms-static-page).

To install, simply use the command:

```shell
$ composer require baraja-core/cms-static-page
```

You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.

📄 License
-----------

`baraja-core/cms-static-page` is licensed under the MIT license. See the [LICENSE](https://github.com/baraja-core/template/blob/master/LICENSE) file for more details.

repository: baraja-core/cms-static-page

gha_language: PHP

repo_name: baraja-core/cms-static-page