text:
---
title: Conditionally rendering React components
description: Conditionally rendering React components
header: Conditionally rendering React components
categories: [code]
published: true
crosspost_to_medium: true
---
Sometimes you want to optionally render a React component based upon some condition.

Let's say you have a component, `MyComponent`, that takes 3 props, isLoggedIn, isDevEnv, and name.

This component is going to say "hello" to the user when the user is logged in.
If the user is not logged in, they will see a different component, `AuthButtons`.

This is a new, risky, experimental feature, so it's feature flagged- we will only display the `SayHello` component if the `isDevEnv` prop is true.

```
const SayHello = ({ name }) => <h1>Hello, {name}!</h1>;

const MyComponent = ({ isLoggedIn, isDevEnv, name }) => (
  <div>
    {isDevEnv && isLoggedIn ? <SayHello name={name} /> : <AuthButtons />}
  </div>
);
```
This implementation isn't bad, but having conditional operators like the ternary or short-circuit can make components hard to read.

This becomes a large problem when feature flags occur in large containers with multiple react-router components.

Other trouble spots where conditionals can get nasty are desktop and mobile specific components such as a mobile drawer or desktop nav bar.

Here's a desktop nav bar that should only appear if we are on the dev or testing environment, if it is _not_ mobile, and if the user is logged in -
```
class SomeComponent extends Component {
  render () {
    return (
      {(isDevEnv || isTestEnv) &&
        !isMobile &&
        isSignedIn && (
          <DesktopNavigation
            // props
          />
      )}
    )
  }
}
```

Now imagine if the DesktopNavigation component had children. This can all turn into a deeply nested mess very quickly.

We can use a [Higher-Order Component](https://reactjs.org/docs/higher-order-components.html), `conditionalRender`, to convert all those conditionals into a prop.
```
const ConditionalDesktopNavigation = conditionalRender(DesktopNavigation)

class SomeComponent extends Component {
  render () {
    return (
      <ConditionalDesktopNavigation
        condition={[(isDevEnv || isTestEnv), !isMobile, isSignedIn]}
        // other props
      />
    )
  }
}
```

What is this this amazing `conditionalRender` function?

I'm glad you asked!
With a couple functions from `recompose` and `ramda`, we can do this-
```
import {
  branch,
  renderNothing,
  renderComponent,
  setPropTypes,
} from "recompose";
import { identity, compose, is, ifElse } from "ramda";

export const isArray = is(Array);
export const toArray = ifElse(isArray, identity, a => [a]);

export const every = array => array.every(i => i);
export const all = compose(
  every,
  toArray,
);

const conditionalRender = component =>
  branch(
    ({ condition }) => all(condition),
    renderComponent(component),
    renderNothing,
  )(component);

export default compose(
  setPropTypes({
    condition: PropTypes.oneOfType([PropTypes.array, PropTypes.bool])
      .isRequired,
  }),
  conditionalRender,
);
```

To make a component conditional, simply wrap it in this conditionalRender function and add the condition prop.

If there are multiple conditions, use an array.

If you don't like the single use `ConditionalDesktopNavigation` variable in the example above,
just `export default conditionalRender(DesktopNavigation)` in the DesktopNavigation file.

`DesktopNavigation` only appears in Desktop Browsers, so IMO this naming scheme is justifiable.

Currently this conditionalRender [HOC](https://reactjs.org/docs/higher-order-components.html) only has one prop, `condition`, which is either an array or a bool.

I'm considering changing that to take three optional props-
`condition`- one bool.
`everyCondition`- an array where every bool must be true to render the child.
`anyCondition`- an array where any bool must be true to render the child.

These decisions are hard.

Let me know what you think.

View the code at-

https://github.com/LifewayIT/react-conditional-render


text:
# Ballin Neighbors

A web app made to connect and grow neighborhoods by building sports teams.

## Tech Utilized

* Vue - JS framework
* Vuex  - State and central store
* Vuetify - styling and responsiveness.
* Firebase - Store data

license: MIT

repository: bhankee/Ballin-Neighbors

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: bhankee/Ballin-Neighbors


text:
---
title: Complex Applications
date: 2022-10-21T05:27:37+10:00
weight: 5
summary: "We will run full-fledged applications on top of Unikraft (nginx, redis, sqlite). Expected time: 75min."
---

## Overview

### Support Files

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_Support-Files.md" markdown="true" >}}

### Useful scripts

#### Qemu Wrapper

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_00.-Qemu-Wrapper.md" markdown="true" >}}

#### Wrappers to quickly setup and run the applications

In this session, we will do a step by step tutorial about how to set up from scratch some of the most popular applications that runs on top of Unikraft.
However, if you  want a **head start**, you can use one of the scripts from [github.com/unikraft-scripts](https://github.com/unikraft-upb/scripts).

First of all, you have to clone the repo:

```
$ git clone https://github.com/unikraft-upb/scripts.git unikraft-scripts
$ cd unikraft-scripts
```

If you want to start, for example,  the `nginx` application on Unikraft, you can run the following commands:

1. Getting all required resources to run the application

```
$ ./do-unikraft-nginx setup
```

2. Building the image for the application

```
$ ./do-unikraft-nginx build
```

3. Running the application

```
$ ./do-unikraft-nginx run
```

The script can be run from anywhere, as it would create a conventional local file hierarchy for building the Unikraft image.

### 01. SQLite

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_01.-SQLite-(Tutorial).md" markdown="true" >}}

### 02. SQLite New Filesystem

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_02.-SQLite-New-Filesystem-(Tutorial).md" markdown="true" >}}

### 03. Redis

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_03.-Redis-(Tutorial).md" markdown="true" >}}

### 04. Nginx

{{< readfile file="/community/hackathons/sessions/complex-applications/content/Work-Items_06.-Nginx.md" markdown="true" >}}

repository: hlef/docs

branch_name: refs/heads/main

gha_license_id: NOASSERTION

repo_name: hlef/docs


text:
## TaskMan

A simple MacOS task and time keeping manager.

The goal of this project is to provide a useful, intuitive and simple way of keeping track of time performing tasks by means of recording running segment of times performing such tasks.
In the future, I'll add means to save the recorded tasks and their time segments in CoreData/external file format.

I currently use this to keep track of time performing tasks at my current job.

This may or may not be useful to you, as well.

### Requirements

- Xcode 8.1
- MacOS 10.11 (El Capitan) or higher
- [Cocoapods 1.1.1](http://cocoapods.org/) (for package management; dependencies are already integrated in repository)

Screenshot:

![](http://i.imgur.com/3CAqCbK.png)

I accept issues and pull requests, if they feel like they contribute to the goal of the project state above.

repository: LuizZak/TaskMan

repo_name: LuizZak/TaskMan


text:
# Quick Serve

This is a very small little app to statically serve directories over
HTTPS without any setup.  It will generate self-signed https cert and
key on run, by default it will serve the current directory.

## Why?

Because serving directories over HTTP(s) is often the least painful way
to quickly share something on a local network.  I use it mostly as a
quick and dirty way to stream stuff to my tablets from my main desktop.

I got sick of writing little "serve.go" files that just had

    ...
    func main() {
            ...
            panic(http.ListenAndServe(":8080", http.FileServer(http.Dir("."))))
    }

inside them that I would run with "go run serve.go"

## Binaries

If you don't want to install Go in order to build this yourself, feel free to grab
your platform specific binary from the releases section

- https://github.com/robertmeta/quickserve/releases

## Examples

- quickserve :: will serve the current directory
- quickserve -d /some/directory/to/serve -d other/local/directory :: will serve those two directories

## Usage of quickserve

- -a="localhost": The address to serve https on
- -c="cert.pem": The name of the cert to use or generate
- -d=[]: List of directories to serve (use multiple -d flags)
- -k="key.pem": The name of the key to use or generate
- -n=false: Force generation of new certs
- -po=443: The port to serve https on

## TODO

- Tests
- Add BasicAuth

repository: robertmeta/quickserve

repo_name: robertmeta/quickserve


text:
# UntitledWordGame

![title screen screenshot](./screenshot.png)
Word game similar to [Cards Against Humanity](https://www.cardsagainsthumanity.com/), except all answers are written by player. Built in go and svelte to try them out in something more complex. Uses websockets to communicate, stores almost no data on the server.

## Building
- Build the frontend
  1. In the frontend directory run `npm i` then `npm run build`, you will end up with a frontend build in the public directory.
  2. Copy the contents of public directory to `cmd/fgame/web/`
- Build the game
  1. Provide your own questions in `./internal/server/data.txt`
  2. In the root directory run `go build ./cmd/fgame/`.

## Server flags
```
  -addr string
        http service address (default "localhost:8080")
  -maxPlayers int
        maximum number of players in room (default 10)
  -maxScore int
        maximum score for player (default 10)
  -timeoutMultiplier int
        timeout multiplier for debugging (default 1)
```

repository: karasevm/UntitledWordGame

repo_name: karasevm/UntitledWordGame


text:
# CrysaliCSS
A component library template to store your CSS code

---

#### Installation

To install **CrysaliCSS** just clone it:

```
git clone https://github.com/ideatosrl/crysalicss.git component-library && rm -rf component-library/.git
```

This script will create a folder named `component-library` where the template is ready to be used to host your CSS components. This also removes the `.git` folder to ensure it is correctly tracked into your project.

Then install it's node packages:

```
npm install
```

---

#### Development

To test locally the component library usually at [this address](http://localhost:3000):

```
npm run dev
```

This script will run watchers and **browser sync** to ensure everything you update will be detected, so `twig` templates, `sass` styles, `md` posts, `js` scripts, assets and also `metalsmith.js` and `metalsmith.yml` files.

If you are working with a **virtual machine** and you don't need **browser sync**, you can run watchers only with this:

```
npm run watch
```

---

To build your library without run any watchers / HTTP servers:

```
npm run build
```

The library will be built inside `build` folder with relative paths, this means it should run without the HTTP server.

---

#### Configuration

This is the configuration of **CrysaliCSS** component library ONLY.

To let your **CSS source** run inside the component library, you'll need to customize the `source-styles` npm script [stored here][source_css_path].

| File | Description |
|-|-|
| `metalsmith.yml` | This is the main **Metalsmith** configuration used inside `metalsmith.js`, there is background and viewports configuration, then all the stuff you need to customize. Be sure your [CSS source is correctly set here][source_css_name]. The **icons** are based on [Material design icons][material] codes. |

Some info about the project folders

| Folder | Description |
|-|-|
| `assets` | Where all images are stored. |
| `js` | Where all **JavaScript** files are stored, like iframe nav or clipboard interaction. |
| `posts` | Where all **Markdown** documentation posts are stored. You will add HTML components and how they work with [markdown syntax][markdown]. |
| `sass` | The component library styles, you can customize it's [main colors here][theme_colors] in combination with the [selected logo][logo]. |
| `src` | Just source files, not used inside the build. |
| `twig` | The **HTML templates** written with [Twig][twig]. |

---

#### Writing markdown pages

You should put your CSS documentation inside `posts` folder, in the code below you'll see how a page should be written.

Front matter structure

| Variable | Optional | Description |
|-|:-:|-|
| `collection` | **✗** | Used to **group** components. |
| `date` | ✓ | The **date** of the documentation page created. |
| `title` | **✗** | The **title** of the documentation page created. |
| `view` | **✗** | The template page used, it should be used with `example.twig` template. |
| `snippets` | ✓ | An array of code snippets, used to display all the components of this page. |
| `snippets[0].title` | ✓ | A title of the component. |
| `snippets[0].text` | ✓ | A description of the component (markdown is supported). |
| `snippets[0].cover` | ✓ | Used to choose which snippet is showed on index page. |
| `snippets[0].code` | **✗** | The code snippet of the component, will be copied in the clipboard and rendered on the page if `render` is not defined. |
| `snippets[0].render` | ✓ | The rendered HTML of the component's code snippet, this is used just to improve render with additional html which should be not copied as code snippet. |
| `snippets[0].syntax` | ✓ | Defines the language used by `code` to be properly colored. The file `metalsmith.yml` contains the defined available languages for `prismjs` which is used to color your code. Find `prism.languages` and check if your languages are included. You can checkout the available [list of languages][primsjs-syntax] used in the [prismjs website][primsjs]. |

A template page as example:

```yaml
---
collection: buttons
date: 2018-09-13T10:29
title: Button
view: example.twig

snippets:
  -
    title: 'The main buttons'
    text: 'A basic button, used all around the app.'
    code: |
      <a href="#" class="button">
        A simple button
      </a>
  -
    title: 'The main buttons'
    text: 'You can define color syntax like in this example.'
    cover: true
    code: |
      <a href="#" className="button">
        A simple button
      </a>
    syntax: haml
    render: |
    <a href="#" class="button">
      A simple button
    </a>
  -
    text: 'Button used to cancel actions. You can use `render` field to display a different content to make better explanations on how components are displayed.'
    code: |
      <a href="#" class="button button--cancel">
        Cancel
      </a>
    render: |
      <div style="display: flex;">
        <a href="#" class="button button--cancel">
          Cancel
        </a>
        <a href="#" class="button">
          Do it!
        </a>
      </div>
---

This is the optional markdown block with additional documentation.

```
---

[CrysaliCSS](https://github.com/ideatosrl/crysalicss) is made with ❤ by [vitto](https://github.com/vitto/) @ [ideato](https://www.ideato.it).

[logo]: https://github.com/ideatosrl/crysalicss/blob/master/metalsmith.yml#L8
[markdown]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
[material]: https://material.io/icons/
[source_css_name]: https://github.com/ideatosrl/crysalicss/blob/master/metalsmith.yml#L7
[source_css_path]: https://github.com/ideatosrl/crysalicss/blob/master/package.json#L17
[theme_colors]: https://github.com/ideatosrl/crysalicss/blob/master/sass/_config/vars.scss
[twig]: https://twig.symfony.com/
[primsjs-syntax]: https://prismjs.com/#languages-list
[primsjs]: https://prismjs.com/

repository: flowingis/crysalicss

repo_name: flowingis/crysalicss


text:
+++
title = "Tech Skillz"
subtitle = ""

date = 2016-04-20T00:00:00
lastmod = 2018-01-13T00:00:00
draft = false

# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = []

tags = ["Tech Skillz", "Process maps", "Wireframes", "User Stories", "Acceptance Criteria", "Product", "Roadmaps", "Statistics"]
summary = " "

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["deep-learning"]` references
#   `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
# projects = ["internal-project"]

# Featured image
# To use, add an image named `featured.jpg/png` to your project's folder.
[image]
  # Caption (optional)
  # caption = ""

  # Focal point (optional)
  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
  focal_point = ""

  # Show image only in page previews?
  preview_only = false

+++

## Audio Video GFX

1. [Adobe Photoshop](https://www.adobe.com/in/products/photoshop.html) [Intermediate] - GFX
2. [Adobe Illustrator](https://www.adobe.com/in/products/illustrator.html) [Intermediate] - GFX
3. [Adobe Aftereffects](https://www.adobe.com/in/products/aftereffects.html) [Intermediate] -  GFX
4. [Sony Soundforge](https://www.magix.com/in/music/sound-forge/) [Intermediate] - Audio
5. [FL Studio](https://www.image-line.com/flstudio/) + VST's [Intermediate] - DAW (Digital Audio Workstation)
6. Native Instruments - [Traktor](https://www.native-instruments.com/en/products/traktor/dj-software/traktor-pro-3/) [Novice] - DJ Software
7. [Autodesk 3dsMax](https://www.autodesk.in/products/3ds-max/overview) [Novice] - 3d Modelling
8. [Autodesk Mays](https://www.autodesk.in/products/maya/overview) - 3d Modelling
9. [Cinema4d](https://www.maxon.net/en/) - 3d Modelling

## Data Science / Statistics

1. R via [R-Studio](https://www.rstudio.com/) [Intermediate] - Statistical Analysis
2. [SPSS](https://www.ibm.com/analytics/spss-statistics-software) [Intermediate] - Statistical Analysis
3. Python [Novice] - Data viz

## Operating Systems

1. Windows Based - Win 7, Win XP, Win 10 , Win Server [Expert]
2. Apple - Mac OS [Expert]
3. *Nix - Ubuntu [Expert] , Kali [Intermediate]

## Productivity

1. Office - 2010, 2016, 265 (Word[Expert], Excel[Intermediate], Powerpoint[Expert], Access[Intermediate], Publisher[Intermediate])

## Process Maps / UML

1. Microsoft Visio [Expert]
2. [PlantUML](http://plantuml.com/) - Code Driven Diagramming tool [Intermediate]
3. [GraphViz](http://www.graphviz.org/) - Via Plantuml - Code Driven Diagramming Tool [Intermediate]
4. [Draw.io](https://www.draw.io/) - Cloud based free digramming tool [Expert]

## User Stories / Product

1. [GitHub](https://github.com/) [Intermediate] - User Stories Repository
2. [GitLab](https://about.gitlab.com/) [Novice] - User Stories Repository
3. [JIRA](https://www.atlassian.com/software/jira) [Intermediate] - User Stories Repository
4. [AHA](https://www.aha.io/) - Product Roadmaps
5. [Netlify](https://www.netlify.com/) - This website is hosted and built on this service

## Wireframing

1. [Balsamiq](https://balsamiq.com/) [Intermediate] - Windows / MacOs based wireframing tool
2. [Sketch](https://www.sketchapp.com/) [Novice] - MacOS Exclusive Wireframing Tool
3. [Figma](https://www.figma.com/) [Intermediate] - Cloud based Wireframing Tool
4. [InVision](https://www.invisionapp.com/) [Intermediate] - Prototyping Tool
5. [Axure](https://www.axure.com/) [Novice] - Wireframing & Prototyping Tool

repository: msagitw/ak

repo_name: msagitw/ak


text:
[![Published on NPM](https://img.shields.io/npm/v/@fooloomanzoo/number-input.svg)](https://www.npmjs.com/package/@fooloomanzoo/number-input)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/@fooloomanzoo/number-input)

_[API & Demo](https://fooloomanzoo.github.io/number-input)_

## \<number-input\>

An input for numeric values.

### Motivation

The normal `input` with `type="number"` is fairly good to use, but it has some flaws, because it should if wanted e.g.:

* prevent non numeric input
* guarantee **live**-data to be valid
* use the local decimal separator
* pad a value with `0` (to a specific length)
* size the input (according to it's length)
* overflow to minimum or underflow to maximum
* saturate to minimum or to maximum
* display a specified unit
* display a specified currencies
* can use percentage values and do have automatically the correct decimal value

This element wants to achieve that, by using the [Intl.NumberFormat API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat). A more simpler element \<integer-input\> just uses integer values and doesn't use units or percent values.

![img](https://github.com/fooloomanzoo/number-input/raw/master/docs/number-input.gif "Demo")

### Example
```html
<span>using units: </span><number-input min="-150" step="0.15" max="300" pad-length="3" default="15" unit="°C"></number-input><br>
<span>in percent: </span><number-input min="-1" step="0.15" max="3" start-at="1" default="1" number-style="percent"></number-input><br>
<span>using currencies: </span><number-input min="0" step="0.01" always-sign start-at="1000" default="1000" use-grouping number-style="currency" currency="EUR"></number-input><br>
<span>as integer: </span><integer-input min="-150" step="15" max="300" default="15"></integer-input>
```

### Styling
Have a look at [input-picker-pattern#input-shared-style](https://github.com/fooloomanzoo/input-picker-pattern#input-shared-style) to see how to style the element.

### Installation
```
npm i @fooloomanzoo/number-input
```

### License
[MIT](https://github.com/fooloomanzoo/number-input/blob/master/LICENSE.txt)

repository: fooloomanzoo/number-input

repo_name: fooloomanzoo/number-input


text:
---
layout: page
title: Publications
permalink: /publications/
---

Check out [Scholar](https://scholar.google.com/citations?user=l5T9RtcAAAAJ) or this [BibTeX](../assets/bibtex/Fayek.bib) file for a complete list of publications.
<!-- [ORCID](https://orcid.org/0000-0002-1840-7605) | -->

### Papers

#### 2023

Rinaldo Gagiano, Haytham M. Fayek, Maria Myung-Hee Kim, Jennifer Biggs, and Xiuzhen Zhang.
**IberLEF 2023 AuTexTification: Automated Text Identification Shared Task – Team OD-21.**
Iberian Languages Evaluation Forum (IberLEF), 2023.
[bib](../assets/bibtex/Gagiano2023.bib)

Nannan Huang, Lin Tian, Haytham M. Fayek, and Xiuzhen Zhang.
**Examining Bias in Opinion Summarisation through the Perspective of Opinion Diversity.**
13th Workshop on Computational Approaches to Subjectivity, Sentiment & Social Media Analysis (WASSA), 2023.
[pdf](https://arxiv.org/pdf/2306.04424.pdf)
[arxiv](https://arxiv.org/abs/2306.04424)
[bib](../assets/bibtex/Huang2023.bib)

Yameng Peng, Andy Song, Vic Ciesielski, Haytham M. Fayek, and Xiaojun Chang.
**Fast Evolutionary Neural Architecture Search by Contrastive Predictor with Linear Regions.**
In Genetic and Evolutionary Computation Conference (GECCO), Lisbon, Portugal, Jul 2023.
[link](https://dl.acm.org/doi/10.1145/3583131.3590452)
[bib](../assets/bibtex/Peng2023a.bib)

Jarry Chen and Haytham M. Fayek.
**The Structurally Complex with Additive Parent Causality (SCARY) Dataset.**
In 2nd Conference on Causal Learning and Reasoning (CLeaR), 2023.
[pdf](https://www.cclear.cc/2023/AcceptedDatasets/chen23a.pdf)
[arxiv](https://arxiv.org/abs/2304.14109)
[bib](../assets/bibtex/Chen2023.bib)

Kathiravan Thangavel, Dario Spiller, Roberto Sabatini, Stefania Amici, Nicolas Longepe, Pablo Servidia, Pier Marzocca, Haytham M. Fayek, and Luigi Ansalone.
**Trusted Autonomous Operations of Distributed Satellite Systems Using Optical Sensors.**
Sensors, vol. 23, no. 6, 2023.
[link](https://www.mdpi.com/1424-8220/23/6/3344)
[bib](../assets/bibtex/Thangavel2023b.bib)

Emma Jane Pretty, Haytham M. Fayek, and Fabio Zambetta.
**A Case for personalised non-player character companion design.**
International Journal of Human-Computer Interaction, pp.1-20, 2023.
[link](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4123761)
[preprint](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4123761)
[bib](../assets/bibtex/Pretty2023a.bib)

Kathiravan Thangavel, Pablo Servidia, Roberto Sabatini, Pier Marzocca, Haytham M. Fayek, Santiago Husain Cerruti, Martin España, and Dario Spiller.
**A distributed satellite system for multibaseline at-InSAR: Constellation of formations for maritime domain awareness using autonomous orbit control.**
Aerospace, vol. 10, no. 2, 2023.
[link](https://www.mdpi.com/2226-4310/10/2/176)
[bib](../assets/bibtex/Thangavel2023a.bib)

Emma Jane Pretty, Renan Martins Guarese, Haytham M. Fayek, and Fabio Zambetta.
**Replicability and transparency for the creation of public human user video game datasets.**
2nd Workshop DATA4XR, IEEE Virtual Reality (IEEEVR), 2023.
[pdf](https://arxiv.org/pdf/2304.02861.pdf)
[arXiv](https://arxiv.org/abs/2304.02861)
[bib](../assets/bibtex/Pretty2023.bib)

Renan Martins Guarese, Emma Jane Pretty, Haytham M. Fayek, Fabio Zambetta, and Ron Van Schyndel.
**Evoking empathy with visually impaired people through an augmented reality embodiment experience.**
IEEE Virtual Reality (IEEEVR), 2023.
[pdf](https://arxiv.org/abs/2302.00211.pdf)
[arXiv](https://arxiv.org/abs/2302.00211)
[bib](../assets/bibtex/Guarese2023.bib)
**In memory of [Ron van Schyndel](https://scholar.google.com.au/citations?user=Ahvs0CsAAAAJ&hl=en).**

Kathiravan Thangavel, Dario Spiller, Roberto Sabatini, Stefania Amici, Sarathchandrakumar Thottuchirayil Sasidharan, Haytham Fayek, and Pier Marzocca.
**Autonomous satellite wildfire detection using hyperspectral imagery and neural networks: A case study on australian wildfire.**
Remote Sensing, vol. 15, no. 3, 2023.
[link](https://www.mdpi.com/2072-4292/15/3/720)
[bib](../assets/bibtex/Thangavel2023.bib)

Yameng Peng, Andy Song, Vic Ciesielski, Haytham M. Fayek, and Xiaojun Chang.
**PRE-NAS: Evolutionary neural architecture search with predictor.**
IEEE Transactions on Evolutionary Computation, vol. 27, no. 1, pp. 26-36, Feb 2023.
[link](https://ieeexplore.ieee.org/document/9975797)
[bib](../assets/bibtex/Peng2023.bib)

Oleg Levinski, Wim J.C. Verhagen, Vincenzo Muscarello, Michael J. Scott, Haytham M. Fayek, and Pier Marzocca.
**An innovative high-fidelity approach to structural health monitoring.**
In 20th Australian International Aerospace Congress (AIAC), Melbourne, Australia, 2023.
[bib](../assets/bibtex/Levinski2023.bib)

Halide G. Aydogan, Haytham M. Fayek, Xiuzhen Zhang, Kate E. Niessen, Daniel O. Franke, and Pier Marzocca.
**Transfer learning for flight loads estimation by load calibration test data.**
In 20th Australian International Aerospace Congress (AIAC), Melbourne, Australia, 2023.
[bib](../assets/bibtex/Aydogan2023a.bib)

Halide G. Aydogan, Haytham M. Fayek, Xiuzhen Zhang, Michael Scott, Pier Marzocca and Kate E. Niessen, Daniel O. Franke, and Oleg Levinski.
**Loads estimation from calibration test with machine learning.**
In AIAA Scitech 2023 Forum, 2023.
[link](https://arc.aiaa.org/doi/10.2514/6.2023-1707)
[bib](../assets/bibtex/Aydogan2023.bib)

#### 2022

Nermine Hendy, Haytham M. Fayek, and Akram Al-Hourani.
**Deep learning approaches for air-writing using single UWB radar.**
IEEE Sensors Journal, May 2022.
[link](https://ieeexplore.ieee.org/document/9768813)
[data](https://figshare.com/articles/dataset/Dataset_for_Air-writing_recognition_based_on_Ultra-wide_band_Radar_Sensor/20225907)
[bib](../assets/bibtex/Hendy2022.bib)

Yameng Peng, Andy Song, Vic Ciesielski, Haytham M. Fayek, and Xiaojun Chang.
**PRE-NAS: Predictor-assisted evolutionary neural architecture search.**
In Genetic and Evolutionary Computation Conference (GECCO), Boston, USA, pp. 1066--1074, Jul 2022.
[link](https://dl.acm.org/doi/10.1145/3512290.3528727)
[pdf](https://arxiv.org/pdf/2204.12726.pdf)
[arXiv](https://arxiv.org/abs/2204.12726)
[bib](../assets/bibtex/Peng2022.bib)

Saisubramaniam Gopalakrishnan, Pranshu Ranjan Singh, Haytham M. Fayek, Savitha Ramasamy, and Arulmurugan Ambikapathi.
**Knowledge capture and replay for continual learning.**
In IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Waikoloa, USA, pp. 337–345, Jan 2022.
[link](https://openaccess.thecvf.com/content/WACV2022/html/Gopalakrishnan_Knowledge_Capture_and_Replay_for_Continual_Learning_WACV_2022_paper.html)
[pdf](https://openaccess.thecvf.com/content/WACV2022/papers/Gopalakrishnan_Knowledge_Capture_and_Replay_for_Continual_Learning_WACV_2022_paper.pdf)
[arXiv](https://arxiv.org/abs/2012.06789)
[bib](../assets/bibtex/Gopalakrishnan2022.bib)

Michael Candon, Marco Esposito, Haytham M. Fayek, Oleg Levinski, Stephan Koschel, Nish Joseph, Robert Carrese, and Pier Marzocca.
**Advanced multi-input system identification for next generation aircraft loads monitoring using linear regression, neural networks and deep learning.**
Mechanical Systems and Signal Processing, Jan 2022.
[link](https://www.sciencedirect.com/science/article/abs/pii/S0888327022000085)
[bib](../assets/bibtex/Candon2022a.bib)

Michael Candon, Haytham M. Fayek, Oleg Levinski, Stephan Koschel, and Pier Marzocca.
**Recent developments in the implementation of a bidirectional LSTM deep neural network for aircraft operational loads monitoring.**
In AIAA SciTech Forum, San Diego, USA, Jan 2022.
[link](https://arc.aiaa.org/doi/abs/10.2514/6.2022-2132)
[bib](../assets/bibtex/Candon2022.bib)

Stephan Koschel, Robert Carrese, Michael Candon, Haytham M. Fayek, Pier Marzocca, and Oleg Levinski.
**Data-driven flight load prediction using modal decomposition techniques.**
In AIAA SciTech Forum, San Diego, USA, Jan 2022.
[link](https://arc.aiaa.org/doi/abs/10.2514/6.2022-2130)
[bib](../assets/bibtex/Koschel2022.bib)

#### 2021

Haytham M. Fayek, Michael Candon, Oleg Levinski, Stephan Koschel, and Pier Marzocca
**Deep learning airframe load prediction: A data-driven system for aircraft structural health management.**
In 19th Australian International Aerospace Congress (AIAC), Melbourne, Australia, Nov 2021.
[link](https://search.informit.org/doi/10.3316/informit.414000320822264)
[pdf](https://search.informit.org/doi/epdf/10.3316/informit.414000320822264)
[bib](../assets/bibtex/Fayek2021.bib)

Stephan Koschel, Robert Carrese, Haytham M. Fayek, Pier Marzocca, and Oleg Levinski.
**Buffet load prediction via frequency response functions.**
In 19th Australian International Aerospace Congress (AIAC), Melbourne, Australia, Nov 2021.
[link](https://search.informit.org/doi/10.3316/informit.313997164079504)
[pdf](https://search.informit.org/doi/epdf/10.3316/informit.313997164079504)
[bib](../assets/bibtex/Koschel2021.bib)

#### 2020

Haytham M. Fayek and [Justin Johnson](https://web.eecs.umich.edu/~justincj/).
**Temporal reasoning via audio question answering.**
IEEE/ACM Transactions on Audio, Speech, and Language Processing, Jul 2020.
[link](https://ieeexplore.ieee.org/abstract/document/9145807)
[arXiv](https://arxiv.org/abs/1911.09655)
[code](https://github.com/facebookresearch/daqa)
[bib](../assets/bibtex/Fayek2020b.bib)

Haytham M. Fayek and [Anurag Kumar](https://anuragkr90.github.io).
**Large scale audiovisual learning of sounds with weakly labeled data.**
In 29th International Joint Conference on Artificial Intelligence (IJCAI), Yokohama, Japan, Jul 2020.
[link](https://www.ijcai.org/Proceedings/2020/78)
[pdf](https://www.ijcai.org/Proceedings/2020/0078.pdf)
[arXiv](https://arxiv.org/abs/2006.01595)
[bib](../assets/bibtex/Fayek2020.bib)

Haytham M. Fayek, Lawrence Cavedon, and Hong Ren Wu.
**Progressive learning: A deep learning framework for continual learning.**
Neural Networks, vol. 128, pp. 345--357, May 2020.
[link](https://www.sciencedirect.com/science/article/pii/S0893608020301817)
[bib](../assets/bibtex/Fayek2020a.bib)

#### 2019

[Sharath Adavanne](https://www.aane.in), Haytham M. Fayek, and Vladimir Tourbabin.
**Sound event classification and detection with weakly labeled data.**
In 4th Workshop on Detection and Classification of Acoustic Scenes and Events (DCASE), New York, USA, pp. 15--19, Oct 2019.
[pdf](http://dcase.community/documents/workshop2019/proceedings/DCASE2019Workshop_Adavanne_45.pdf)
[bib](../assets/bibtex/Adavanne2019.bib)

#### 2018

Haytham M. Fayek, Lawrence Cavedon, and Hong Ren Wu.
**On the transferability of representations in neural networks between datasets and tasks.**
In Continual Learning Workshop, 32nd Neural Information Processing Systems (NeurIPS), Montréal, Canada, Dec 2018.
[pdf](https://marcpickett.com/cl2018/CL-2018_paper_19.pdf)
[arXiv](https://arxiv.org/abs/1811.12273)
[bib](../assets/bibtex/Fayek2018.bib)

#### 2017

Haytham M. Fayek.
**MatDL: A lightweight deep learning library in MATLAB.**
The Journal of Open Source Software, vol. 2, no. 19, pp. 413, Nov 2017.
[link](https://doi.org/10.21105/joss.00413)
[pdf](http://www.theoj.org/joss-papers/joss.00413/10.21105.joss.00413.pdf)
[code](https://github.com/haythamfayek/MatDL)
[bib](../assets/bibtex/Fayek2017b.bib)

Haytham M. Fayek, [Laurens van der Maaten](https://lvdmaaten.github.io), Griffin D. Romigh, and [Ravish Mehra](http://drravishmehra.com).
**On data-driven approaches to head-related transfer function personalization.**
In Audio Engineering Society (AES) Convention 143, New York, USA, Oct 2017.
[link](http://www.aes.org/e-lib/browse.cfm?elib=19287)
[pdf](https://www.dropbox.com/s/2se7pqvt9ubr5pd/19287.pdf?dl=0)
[bib](../assets/bibtex/Fayek2017a.bib)

Haytham M. Fayek, Margaret Lech, and Lawrence Cavedon.
**Evaluating deep learning architectures for speech emotion recognition.**
Neural Networks, vol. 92, pp. 60--68, Aug 2017.
[link](http://doi.org/10.1016/j.neunet.2017.02.013)
[bib](../assets/bibtex/Fayek2017.bib)

#### 2016

Haytham M. Fayek.
**A deep learning framework for hybrid linguistic-paralinguistic speech systems.**
In 2nd Doctoral Consortium at Interspeech, Berkeley, USA, Sep 2016.
[link](http://www.isca-students.org/?q=node/4809)
[pdf](http://www.isca-students.org/sites/default/files/2ndDC_paper_2.pdf)
[bib](../assets/bibtex/Fayek2016b.bib)

Haytham M. Fayek, Margaret Lech, and Lawrence Cavedon.
**On the correlation and transferability of features between automatic speech recognition and speech emotion recognition.**
In 17th Annual Conference of the International Speech Communication Association (Interspeech), San Francisco, USA, pp. 3618--3622, Sep 2016.
[link](http://www.isca-speech.org/archive/Interspeech_2016/abstracts/0868.html)
[pdf](http://www.isca-speech.org/archive/Interspeech_2016/pdfs/0868.PDF)
[slides](../assets/presentations/Fayek_is16.pdf)
[bib](../assets/bibtex/Fayek2016a.bib)

Haytham M. Fayek, Margaret Lech, and Lawrence Cavedon.
**Modeling subjectiveness in emotion recognition with deep neural networks: Ensembles vs soft labels.**
In International Joint Conference on Neural Networks (IJCNN), Vancouver, Canada, pp. 566--570, Jul 2016.
[link](http://ieeexplore.ieee.org/abstract/document/7727250/)
[poster](../assets/presentations/Fayek_ijcnn16.pdf)
[bib](../assets/bibtex/Fayek2016.bib)

#### 2015

Haytham M. Fayek, Margaret Lech, and Lawrence Cavedon.
**Towards real-time speech emotion recognition using deep neural networks.**
In 9th International Conference on Signal Processing and Communication Systems (ICSPCS), Cairns, Australia, pp. 1--5, Dec 2015.
[link](http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7391796&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7391796)
[bib](../assets/bibtex/Fayek2015.bib)

#### 2014

P. N. Q. Nhon, Irraivan Elamvazuthi, Haytham M. Fayek, S. Parasuraman, and M.K.A. Ahamed Khan.
**Intelligent control of rehabilitation robot: Auto tuning PID controller with interval type 2 fuzzy for DC servomotor.**
Procedia Computer Science, vol. 42, Medical and Rehabilitation Robotics and Instrumentation (MRRI2013), pp. 183--190, Dec 2014.
[link](https://doi.org/10.1016/j.procs.2014.11.050)
[bib](../assets/bibtex/Nhon2014.bib)

Haytham M. Fayek, Irraivan Elamvazuthi, N. Perumal, and Bala Venkatesh.
**A controller based on optimal type-2 fuzzy logic: Systematic design, optimization and real-time implementation.**
ISA Transactions, vol. 53(5), pp. 1583--1591, Sep 2014.
[link](http://doi.org/10.1016/j.isatra.2014.06.001)
[bib](../assets/bibtex/Fayek2014a.bib)

Haytham M. Fayek, Irraivan Elamvazuthi, N. Perumal, and Bala Venkatesh.
**The impact of DFIG and FSIG wind farms on the small signal stability of a power system.**
In 5th International Conference on Intelligent and Advanced Systems (ICIAS), Kuala Lumpur, Malaysia, pp. 1--6, Jun 2014.
[link](http://ieeexplore.ieee.org/document/6869505/)
[slides](../assets/presentations/Fayek_icias16.pdf)
[bib](../assets/bibtex/Fayek2014.bib)

#### 2013

Haytham M. Fayek and Irraivan Elamvazuthi.
**Real-time implementation of a type-2 fuzzy logic controller to control a DC servomotor with different defuzzification methods.**
In 18th International Conference on Methods and Models in Automation and Robotics (MMAR), Miedzyzdroje, Poland, pp. 86--91, Aug 2013.
[link](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6669886)
[bib](../assets/bibtex/Fayek2013.bib)
**Runner up Best Young Author.**

#### 2012

Haytham M. Fayek and Irraivan Elamvazuthi.
**Type-2 fuzzy logic PI (T2FLPI) based DC servomotor control.**
Journal of Applied Sciences Research, vol. 8(5), pp. 2564–-2574, 2012.
[bib](../assets/bibtex/Fayek2012a.bib)

### Theses

Haytham M. Fayek.
**Continual deep learning via progressive learning.**
PhD Thesis, RMIT University, 2019.
[**link**](https://researchrepository.rmit.edu.au/esploro/outputs/9921864066401341)
[**pdf**](https://www.dropbox.com/s/a3insiefrgypbf8/Fayek.pdf?dl=0)
[**bib**](../assets/bibtex/Fayek2019.bib)

Haytham M. Fayek.
**Systematic design of optimal type II fuzzy logic controllers with applications to wind power.**
MSc Thesis, Petronas University, 2014.
[**bib**](../assets/bibtex/Fayek2014b.bib)

Haytham M. Fayek.
**Fuzzy logic based motor control.**
BEng Thesis, Petronas University, 2012.
[**bib**](../assets/bibtex/Fayek2011.bib)

### Patents

Haytham M. Fayek A. A. Abokela and Antonio John Miller.
**Systems and methods for hearing assessment and audio adjustment.**
Patent No.: US 11,575,999 B2, 7 Feb 2023.
[**pdf**](https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf/11575999)
[**bib**](../assets/bibtex/Abokela2023.bib)

Irraivan Elamvazuthi and Haytham M. Fayek.
**Method for controlling a high speed DC servomotor that controls a robotic arm for the PCB industry (FT2RC).**
Patent Filing No. PI2012700978, Nov 2012.
[**bib**](../assets/bibtex/Fayek2012.bib)

gha_language: TeX

gha_license_id: MIT


text:
 Personal_Infotag🧑

> This is the personal profile in a social media .

### 🏠 [Homepage](index.js)

### Check Your Environment

```sh
flutter doctor
```

## Run

```sh
flutter run
```

## Author

👤 **Elias John**

* Twitter:(https://twitter.com/ellyjony)
* LinkedIn:(https://linkedin.com/in/ellyjonny)

## Show Your Support🚀
## For the ❤ of flutter

license: ISC


text:
---
title: "Package Dependencies"
description: "Some description ..."
authors: ["lek-tin"]
tags: ["leetcode", "dfs", "directed-graph"]
categories: ["algorithm"]
date: 2020-01-02T18:19:16-08:00
lastmod: 2020-01-02T18:19:16-08:00
draft: false
archive: false
---
### Solution

```python
def package_dependencies(dependencies):
  result = []
  visiting = set([])
  visited = set([])

  def dfs(node):
    if node in visited:
      return

    visiting.add(node)

    for dependency in node.dependencies:
      if dependency in visiting:
        raise Exception("Have cycle in dependency graph.")
      if dependency not in visited:
        dfs(dependency)

    visiting.remove(node)
    visited.add(node)
    result.add(node)

  for node in dependencies:
    dfs(node)

  return result
```

repository: lek-tin/hashnopolis

branch_name: refs/heads/dev

gha_language: CSS

repo_name: lek-tin/hashnopolis


text:
---
title: Getting Started
category: overview
layout: guide
---

The following is a crash course in setting up Wasabi. If you already understand prototypal inheritance and network game programming, it should be fairly intuitive.

Adding A Class
---

To begin replicating a class with Wasabi, you will need to write a `serialize` method and call `Wasabi.addClass` on the class's constructor. Here is a minimal Player class:

{%highlight javascript%}

// Just a normal constructor function.
function Player () {
    this.x = 0;
    this.y = 0;
}

// serialize methods tell Wasabi about the replicated properties
// of your classes, including their types and the number of bits
// used to encode them.
Player.prototype.serialize = function (desc) {
    desc.uint('x', 16); // a 16 bit unsigned integer named x
    desc.uint('y', 16); // a 16 bit unsigned integer named y
};

// don't forget to register your class with Wasabi!
Wasabi.addClass(Player);

{%endhighlight%}

Note that this code will need to be executed on both the client and the server. Typically all of this code will go in a file called `player.js`. You can read more about `serialize` functions in the Concepts section of the guide.

Connecting A Client And Server
---

Wasabi supports WebSockets as well as socket.io out of the box. You can use anything that conforms to the WebSockets interface (has a `send` method and an `onmessage` callback). Setting up a server using Node.js and the `ws` module looks like this:

{% highlight javascript %}

// Create the server socket
var serverSock = new WebSocket.Server({port:1234}, function() {
    // Start your hosting loop
    // ...
});

serverSock.on('connection', function(clientSock) {
    var conn = Wasabi.addClient(clientSock);
});

{% endhighlight %}

Then, on the client side:

{% highlight javascript %}

// connect to the server
var sock = new WebSocket('ws://' + window.location.hostname + ':1234');

sock.onopen = function() {
    Wasabi.addServer(sock);
    // start the client's loop
    // ...
}

{% endhighlight %}

Next, you'll want to create some objects to replicate.

Creating An Object
---

When you want to replicate an instance of the Player class, you can simply do:

{%highlight javascript%}

var player = new Player();
Wasabi.addObject(player);

{%endhighlight%}

Objects should only be manually created on the server. Wasabi will automatically manage the creation and destruction of objects on the client, as shown in the next section.

Synchronizing Servers and Clients
---

This is where all the magic happens. Once you've registered your class, connected your server and client, and added an object on the server. All you have to do is call `processConnections`:

{% highlight javascript %}
Wasabi.processConnections();
{% endhighlight %}

That's it! Just call that in a loop on both the client and server, and the client's copy will be updated to match the servers automatically.

Next Steps
---
If you have a fairly good grasp on the content of this guide, you might want to read more about the concepts in Wasabi in the Concepts section. You can also look at [an example game](https://github.com/kaen/wasabi_example) to see Wasabi in action, or the [API docs]({{ site.baseurl }}/doc/) if you're ready to dive right in.

repository: bkconrad/wasabi

gha_language: JavaScript

repo_name: bkconrad/wasabi


text:
---
layout: default
---

# 1997-12-02 - Re: PGP bought by McAfee

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: ea92e5d72d2b9411dd9e9170529b77ec3d3b305324a0268018c4f7f6375275d1

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-12-02 03:54:19 UTC

Raw Date: Tue, 2 Dec 1997 11:54:19 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Tue, 2 Dec 1997 11:54:19 +0800
To<EMAIL_ADDRESS>Subject: Re: PGP bought by McAfee
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On 1 Dec 1997 21:30:35 -0600, steve<EMAIL_ADDRESS>wrote:

>
>>"Network Associates, Inc.
>>(Nasdaq: NETA, commencing Dec. 2), formerly McAfee Associates
>>(Nasdaq: MCAF), announced today that it has a signed a definitive
>>agreement to acquire privately-held Pretty Good Privacy, Inc. (PGP)."
>
>Varous Questions, comments rants, etc.:
>
>Does anyone know how this will affect PGP's:
>security, commitment to no-GAK, Founder (P. Zimmerman), the continuation
>of the PGP product line?
>
>I heard that McAfee's PCCrypto product will still be sold by NETA as a
>retail product, (are they considering
>incorperating the 2 together and just using PGP's team for R&D?)
>
>steve

Even more basic questions:  Will NETA release source code?  Will they
continue to develop freeware versions of PGP?  What conections does NETA
have to S/MIME?  What happens to licensing of things like PGPsdk and the
freeware versions of PGP?  Will PGP be seen as a "dead-end" product by
potential new users.  What will happen to Open-PGP email encryption
standard?

This is not good.

-- Phelix

{% endraw %}
```

## Thread

+ Return to [December 1997](/archive/1997/12)

+ Return to "[phelix@vallnet.com](/authors/phelix_at_vallnet_com)"
+ Return to "[steve <xxxxxx@ix.netcom.com>](/authors/steve_xxxxxx_at_ix_netcom_com_)"
+ Return to "["William H. Geiger III" <whgiii@invweb.net>](/authors/william_h_geiger_iii_whgiii_at_invweb_net_)"

+ 1997-12-02 (Tue, 2 Dec 1997 08:47:04 +0800) - [PGP bought by McAfee](/archive/1997/12/0ee9118d21e90798196765953f65afa71143c5a4cde5af97d26c32cd39319e3d) - _steve<EMAIL_ADDRESS>  + 1997-12-02 (Tue, 2 Dec 1997 11:48:21 +0800) - [Re: PGP bought by McAfee](/archive/1997/12/0043abbbcf739e0f07a1f40a35afe0f38e24f4a96d1168923e5dd24204097ad0) - _"William H. Geiger III"<EMAIL_ADDRESS>  + 1997-12-02 (Tue, 2 Dec 1997 11:54:19 +0800) - Re: PGP bought by McAfee -<EMAIL_ADDRESS>


text:
# Read_ini_Files_with_Javascript
Project with the intention of making a javascript that reads .ini files.

Author: Leo Arantes.
GitHub: LeoArantes.

File and functions created by Leo Arantes to make it possible to read an .ini file through a Javascript file.

To make this code work, Google Chrome must be initialized with the argument "--allow-file-access-from-files";


text:
# Websocket Messages

### `POST /messages`

```json
[
  $$XIN:message$$
]
```

A maximum of 100 messages can be sent in batch each time, and the message body cannot exceed 128Kb. It is recommended to limit the size of a single message, for example:

```
$$XIN:curl$$ "https://api.mixin.one/attachments" -XPOST
```

```
// Sample Response
{ }
```


text:
# dev

  Inspect objects associated to DOM elements in web inspector.

  ![](https://dsz91cxz97a03.cloudfront.net/iXpnS5fQAW.png)

## Installation

    $ component install component/dev

## Usage

  When enabled via `localStorage.dev = true` the object
  is assigned as `_` on the element for inspection in the
  "properties" panel. This means when the element is selected
  `$._` is also available. A name may be passed instead of `_`,
  however `_` is nice as it will display early in the properties list.

## API

### inspect(el, obj, [name])

  Associate `obj` with `el` as `name` defaulting to "_".

## License

  MIT

repository: component/dev

repo_name: component/dev


text:
Created by: Angelo Jacobo
Date: June 13,2021

# Inside the src folder are:
* fifo.v -> FiFo buffer BUT WITH BLOCK RAM
* fifo_test_vector.v -> Module where all test inputs will come from.
* fifo_monitor.v -> Monitors the input and resulting output. Outputs "ERROR" when the real output and the desired output is not equal
* fifo_TB.v -> See"fifo_TB_RESULT.txt" for the result of this testbench

Note: This code is for simulation-purpose only and is not yet synthesized to any FPGA.
Note: Notice that the result is exactly the same results as 7.7.7 Testbench_For_FiFo_Buffer. The first block of errors are due to uninitialize fifo module. The second and third block of errors are just due to the  asynchronous read operation during empty or full state and can be ignored.

# TASK:
**12.6.1 Block-RAM-based FIFO**

In Section 4.5.3, we design a FIFO buffer that uses a register file for storage. To increase its
capacity, we can replace the register file with a block RAM-based dual-port RAM module.
Derive the HDL code for the new design. Synthesize the verification circuit with the new FIFO buffer
and verify its operation. Note that due to the synchronous read, the behavior of the new FIFO
is not completely identical to that of the original FIFO

path: /12.6.1 Block_RAM_Based_FiFo/ReadMe.md


text:
# Kernel Reinforcement Learning

## Dependencies
- Python 2 or 3
- OpenAI Gym, version 0.11.0
- SciPy
- MatPlotLib

## Available algorithms

- Kernel Q-Learning with:
    - Continuous states / discrete actions
    - Continuous states and actions from [ACC 2018](https://arxiv.org/pdf/1804.07323.pdf)

- Kernel Normalized Advantage Functions in continuous action spaces from [IROS 2018](https://katetolstaya.github.io/files/c_2018_tolstaya_etal_b.pdf)

## To run

Kernel Q-Learning with Pendulum with prioritized experience replay
~~~~
python rlcore.py cfg/kq_pendulum_per.cfg
~~~~

Kernel NAF with Continuous Mountain Car
~~~~
python rlcore.py cfg/knaf_mcar.cfg
~~~~

Other options of configuration files are
- Kernel Q-Learning for Cont. Mountain Car: `cfg/kq_cont_mcar.cfg`
- Kernel Q-Learning for Pendulum: `cfg/kq_pendulum.cfg`
- Kernel Q-Learning for discrete-action Cartpole: `cfg/kq_cartpole.cfg`
- Kernel NAF for Pendulum: `cfg/knaf_pendulum.cfg`

## Composing policies

The `compose` folder contains the code for composing two or more trained policies as described in the IROS 2018 paper.

## Tuning parameters
To tune learning rates and other parameters, adjust the corresponding parameters in the `.cfg` file.

## Contributors

This software was created by [Ekaterina Tolstaya](mailto:eig@seas.upenn.edu), [Ethan Stump](mailto:ethan.a.stump2.civ@mail.mil), and [Garrett Warnell](mailto:garrett.a.warnell.civ@mail.mil).

repository: katetolstaya/kernelrl

repo_name: katetolstaya/kernelrl


text:
# Blender App Templates Add-On
Blender Add-On to enable users to create their own app templates

This add-on makes it easy to create new app templates by adding an option to the File -> New menu in the top app bar.

![New Template Menu Item](https://github.com/mac-mm/blenderapptemplates/blob/main/assets/Images/Menu.png)

repository: pmmucsd/blenderapptemplates

repo_name: pmmucsd/blenderapptemplates


text:
# GitHub Trending (2020-09-03)

![](https://img.shields.io/badge/C-New%20484-green?style=flat-square&logo=appveyor)
- [htop-dev/htop](https://github.com/htop-dev/htop): htop - an interactive process viewer

![](https://img.shields.io/badge/Solidity-New%2083-green?style=flat-square&logo=appveyor)
- [sushiswap/sushiswap](https://github.com/sushiswap/sushiswap): 🍣 SushiSwap smart contracts

![](https://img.shields.io/badge/Rust-New%20458-green?style=flat-square&logo=appveyor)
- [bottlerocket-os/bottlerocket](https://github.com/bottlerocket-os/bottlerocket): An operating system designed for hosting containers

![](https://img.shields.io/badge/Go-New%20147-green?style=flat-square&logo=appveyor)
- [go-gorm/gorm](https://github.com/go-gorm/gorm): The fantastic ORM library for Golang, aims to be developer friendly

![](https://img.shields.io/badge/Python-New%20300-green?style=flat-square&logo=appveyor)
- [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python): All Algorithms implemented in Python

![](https://img.shields.io/badge/Python-New%2024-green?style=flat-square&logo=appveyor)
- [pypa/setuptools](https://github.com/pypa/setuptools): Official project repository for the Setuptools build system

![](https://img.shields.io/badge/C%23-New%2050-green?style=flat-square&logo=appveyor)
- [Azure/bicep](https://github.com/Azure/bicep):

![](https://img.shields.io/badge/none-New%20290-green?style=flat-square&logo=appveyor)
- [ritchieng/the-incredible-pytorch](https://github.com/ritchieng/the-incredible-pytorch): The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

![](https://img.shields.io/badge/Python-New%20115-green?style=flat-square&logo=appveyor)
- [cleardusk/3DDFA_V2](https://github.com/cleardusk/3DDFA_V2): The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV, 2020

![](https://img.shields.io/badge/HTML-New%20103-green?style=flat-square&logo=appveyor)
- [abhivaikar/howtheytest](https://github.com/abhivaikar/howtheytest): A collection of public resources about how software companies test their software

![](https://img.shields.io/badge/none-New%2075-green?style=flat-square&logo=appveyor)
- [shubheksha/companies-sponsoring-visas](https://github.com/shubheksha/companies-sponsoring-visas): A list of companies that sponsor employees from other countries.

![](https://img.shields.io/badge/Java-New%20169-green?style=flat-square&logo=appveyor)
- [h2pl/Java-Tutorial](https://github.com/h2pl/Java-Tutorial): 【Java工程师面试复习指南】本仓库涵盖大部分Java程序员所需要掌握的核心知识，整合了互联网上的很多优质Java技术文章，力求打造为最完整最实用的Java开发者学习指南，如果对你有帮助，给个star告诉我吧，谢谢！

![](https://img.shields.io/badge/none-New%20592-green?style=flat-square&logo=appveyor)
- [kamranahmedse/developer-roadmap](https://github.com/kamranahmedse/developer-roadmap): Roadmap to becoming a web developer in 2020

![](https://img.shields.io/badge/JavaScript-New%20151-green?style=flat-square&logo=appveyor)
- [portainer/portainer](https://github.com/portainer/portainer): Making Docker management easy.

![](https://img.shields.io/badge/Kotlin-New%2026-green?style=flat-square&logo=appveyor)
- [THLfi/koronavilkku-android](https://github.com/THLfi/koronavilkku-android):

![](https://img.shields.io/badge/Java-New%2051-green?style=flat-square&logo=appveyor)
- [hollischuang/toBeTopJavaer](https://github.com/hollischuang/toBeTopJavaer): To Be Top Javaer - Java工程师成神之路

![](https://img.shields.io/badge/none-New%20130-green?style=flat-square&logo=appveyor)
- [danistefanovic/build-your-own-x](https://github.com/danistefanovic/build-your-own-x): 🤓 Build your own (insert technology here)

![](https://img.shields.io/badge/C%2B%2B-New%2013-green?style=flat-square&logo=appveyor)
- [OSGeo/gdal](https://github.com/OSGeo/gdal): GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.

![](https://img.shields.io/badge/Ruby-New%2022-green?style=flat-square&logo=appveyor)
- [ruby/ruby](https://github.com/ruby/ruby): The Ruby Programming Language [mirror]

![](https://img.shields.io/badge/JavaScript-New%20108-green?style=flat-square&logo=appveyor)
- [30-seconds/30-seconds-of-code](https://github.com/30-seconds/30-seconds-of-code): Short JavaScript code snippets for all your development needs

![](https://img.shields.io/badge/PowerShell-New%2012-green?style=flat-square&logo=appveyor)
- [MicrosoftDocs/azure-docs](https://github.com/MicrosoftDocs/azure-docs): Open source documentation of Microsoft Azure

![](https://img.shields.io/badge/Jupyter%20Notebook-New%2010-green?style=flat-square&logo=appveyor)
- [maratonadev-br/desafio-6-2020](https://github.com/maratonadev-br/desafio-6-2020):

![](https://img.shields.io/badge/Python-New%2036-green?style=flat-square&logo=appveyor)
- [testerSunshine/12306](https://github.com/testerSunshine/12306): 12306智能刷票，订票

![](https://img.shields.io/badge/none-New%20184-green?style=flat-square&logo=appveyor)
- [sindresorhus/awesome](https://github.com/sindresorhus/awesome): 😎 Awesome lists about all kinds of interesting topics

![](https://img.shields.io/badge/Jupyter%20Notebook-New%2024-green?style=flat-square&logo=appveyor)
- [justmarkham/scikit-learn-tips](https://github.com/justmarkham/scikit-learn-tips): 🤖⚡ Daily scikit-learn tips

repository: Hsins/Daily-GitHub-Trending

repo_name: Hsins/Daily-GitHub-Trending


text:
[Documentation Home](readme.md)

# Getting Started
The easiest way to learn the metalus library is to run an existing example. The following instructions will run the
[application example](application-example.md). This example will load an example order file, split each record into
different DataFrames containing product, customer, credit card and order data. The data will be written to a Mongo data
store (named _application_examples_) in different collections. The example requires [metalus-common](../metalus-common/readme.md),
[metalus-mongo](../metalus-mongo), [metalus-examples](../metalus-examples/readme.md) [step libraries](step-libraries.md)
and the self-contained [metalus application](metalus-application.md) jar.

## Build Metalus
Below are the basic build commands required to build the Metalus libraries:

|Spark Version|Scala Version|Command|
|-------------|-------------|-------|
|2.4          |2.11         |mvn clean install|
|3.0          |2.12         |mvn -P spark_3.0 clean install|

## Mongo Setup
This example requires a local Mongo instance to be running. A free version can be downloaded
[here](https://www.mongodb.com/download-center/community).

## Spark Setup
Download the desired version of [Spark](http://spark.apache.org/downloads.html) and unpack. Metalus supports versions
2.4 or 3.0.

Start the spark server from the unpacked directory with the following commands:

```shell script
cd <SPARK_INSTALL_DIR>
export SPARK_LOCAL_IP=<IP_ADDRESS>
sbin/start-master.sh -h localhost -p 7077
sbin/start-slave.sh localhost:7077 -h localhost
```

Stopping Spark requires the following commands:

```shell script
cd <SPARK_INSTALL_DIR>
sbin/stop-slave.sh
sbin/stop-master.sh
```

The console will be available here: http://localhost:8080/

## Run the application
Commands to run this application are available [here](application-example.md#Running)

repository: dafreels/metalus

branch_name: refs/heads/develop

gha_language: Scala

repo_name: dafreels/metalus


text:
# GitHub Actions Runner for Docker and Kubernetes

![Build](https://github.com/juselius/kubernetes-actions-runner/workflows/Build/badge.svg)

Self-hosted GitHub Actions runner for deployment in Kubernetes. The runner can
also be run locally, connected directly to the host docker daemon.

## Prerequisites

1. The runner automatically requests runner tokens via the GitHub APIs:
    1. For personal repositories, you must create a GitHub Personal Access
    Token (PAT) with _repo access_ permissons to the runner, and configure
    separate runners for each repository.
    2. For Organization you must create a GitHub App with read access to _
    organization self hosted runners_, and record the AppId. You must then
    create and download a private key for the App. Finally you must install
    the newly created App in GitHub, reload the browser and record the
    installation id from the browser location (see GitHub documentation for
    more information).
2. For Kubernets, `kubectl` must be configured to access the appropriate cluster
   context (in ~/.kube/config)

## TL;DR

### Run locally in docker with Personal Access Token

1. Copy `Auth/auth.json` and edit the `PersonalAccessToken`.

```sh
./deploy-actions-runner --config auth.json --owner you \
  --repository your/repo --docker | bash
```

### Deploy to Kubernetes

1. Copy `Auth/auth.json` and edit `AppId` and `InstallationId`
2. `Owner` should be set to the Organization wher the App is installed.
3. `PrivateKeyPath` should be left unchanged.

```sh
./deploy-actions-runner --config auth.json --owner acme | kubectl apply -f -
```

## Authentication

Runner tokens generated by GitHub are only valid for 60 minutes. New runner
tokens must in practice be generated every time a new runner is
started.

The project includes a small tool to get runner tokens from GitHub.
It can authenticate either using PATs or as a GitHub App. In App mode, it can
be used to start organization wide runners.

## Build

The provided Dockerfile will build a docker image with the authentication tool
and actions runnner installed.

### Plain runner

To build a minimal Docker image, with just the runner and authentication tool:

```sh
docker build -t actions-runner:latest --target runner .
```

### Runner with .NET Core 3.1, Node 12, yarn and headless Chrome

To build a runner image for use with the F# SAFE-Template for web
development:

```sh
docker build -t actions-runner-safe:latest .
```

## Motivation

The self hosted GitHub Actions runner is designed to run in a VM or directly on
a host OS. In order to run on on Kubernetes we must containerize the runner. In
itself, this is pretty simple. But complications arise when we want to support
runnering containers on the runner. This is necessary for two reasons: 1) Many
Marketplace actions run in containers 2) consistent build environments using
containers.

This project tries to hide most of the complications, but still
requires a bit of systems knowledge, and some basic Kubernetes skills.

The project also makes it easy to run GitHub Actions in a container locally.

## Implementation

Running containers in a container can be achieved using Docker-in-Docker (dind).
However, this is complicated by the the need to share volumes from within the
"parent" container. The dind instance is running on top of a local dockerd,
which knows nothing of the interal structure inside the container. A "child"
continer started within a container, is actually not a child, but a sibling.
Both containers run side by side on the same system level `dockerd`. Thus, in
order to share volumes, the volume must be created and shared at the systems
level. This complicated things somewhat.

Another complication is that the action runner runs with UID 1000, but any
containers it starts, might run as root. This can easily mess up file
permissions on shared volumes, so please make sure to reset permissions before
exit.

### Kubernetes

The Kubernetes deployment relies on `kubectl` being configured correctly on the
executing system. The provided YAML objects are customized using a Kustomization
object.

The Deployment object uses Kubernetes lifecycle management with a preStop hook
to cleanly remove runners.

#### Helm deployments to Kubernetes

You can manage deployments to Kubernetes using Helm and a self-hosted runner,
using the following Workflow recipe:

```yaml
deploy-staging:
  container: dtzar/helm-kubectl:latest
  runs-on: self-hosted
  needs: release
  env:
    KUBE_INSTANCE: cluster1
    KUBE_NAMESPACE: default
    DEPLOY_NAME: myapp
  steps:
  - uses: actions/checkout@v2
  - name: Deploy
    run: |
      mkdir -p $HOME/.kube
      echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config
      kubectl config use-context $KUBE_INSTANCE
      kubectl get pods -n $KUBE_NAMESPACE
      helm list -n $KUBE_NAMESPACE
      cmd=upgrade && helm list -q -n $KUBE_NAMESPACE | grep -q "$DEPLOY_NAME" || cmd=install
      echo "helm $cmd $DEPLOY_NAME"
      helm $cmd -f ./charts/values.yaml \
          --namespace $KUBE_NAMESPACE \
          $DEPLOY_NAME ./charts
  - name: Cleanup
    run: |
      chown -R 1000:1000 .
```

## Security

The Kubernetes Deployment runs a `dind` side-car container in privileged mode,
to support running docker commands and containerized actions in a container.
*This has security implications, which should be considered and understood
before use!*

## Note on local docker instances

The runners can easily be run locally on any host with runing `dockerd`. Please
note that you might have to pass in an environment variable `HOST_DOCKER_GID`
with the GID of the docker socket, in order to have access permissions within
the container.

repository: juselius/kubernetes-actions-runner

repo_name: juselius/kubernetes-actions-runner


text:
# Incremental Design

* [A conversation between a designer and a
  developer](incremental-design-with-designer.md)
* [Can all design changes happen in
  CSS?](incremental-design-css.md)

---

* [Cleaning up your views with Decorators & Helpers](https://docs.google.com/presentation/d/1aCJ8GZaQdE8MvzShu3la30h38zkgl2hlSnNXcgoaEWU/edit#slide=id.p)
* [HowAboutWe for Couple: Overview of Views/Servers](shttps://docs.google.com/presentation/d/19sCjDi2Omm-Arv7glvhzXflIJs3PUxp73ImjDXfiuYU/edit#slide=id.p)

repository: rmw/talks

repo_name: rmw/talks


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [ember-asset-size-report](./ember-asset-size-report.md) > [BaseSize](./ember-asset-size-report.basesize.md) > [size](./ember-asset-size-report.basesize.size.md)

## BaseSize.size property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

original (un-minified) size

<b>Signature:</b>

```typescript
size: number;
```

repository: mike-north/ember-asset-size-report

gha_language: TypeScript

repo_name: mike-north/ember-asset-size-report


text:
# Vehicle Types

| ID   | Type Name             |
| ---- | --------------------- |
| 0    | AUTOMOBILE            |
| 1    | PLANE                 |
| 2    | TRAILER               |
| 3    | QUAD_BIKE             |
| 4    | SUBMARINE_CAR         |
| 5    | AMPHIBIOUS_AUTOMOBILE |
| 6    | AMPHIBIOUS_QUAD_BIKE  |
| 7    | HELI                  |
| 8    | BLIMP                 |
| 9    | AUTOGYRO              |
| 10   | BIKE                  |
| 11   | BMX                   |
| 12   | BOAT                  |
| 13   | TRAIN                 |
| 14   | SUBMARINE             |

repository: altmp-csharp/docs

repo_name: altmp-csharp/docs


text:
---
title: Prefixing cache
weight: 5
---

You might want to use separate caches for each different tenant. The `Spatie\Multitenancy\Tasks\PrefixCacheTask` allows you to do just that. This task only works for memory based caches, such as APC and Redis.

To use this task, you should add it to the `switch_tenant_tasks` key in the `multitenancy` config file.

```php
// in config/multitenancy.php

'switch_tenant_tasks' => [
    \Spatie\Multitenancy\Tasks\PrefixCacheTask::class,
    // other tasks
],
```

When this task is installed, cache will behave like this

```php
cache()->put('key', 'original-value');

$tenant->makeCurrent();
cache('key') // returns null;
cache()->put('key', 'value-for-tenant');

$anotherTenant->makeCurrent();
cache('key') // returns null;
cache()->put('key', 'value-for-another-tenant');

Tenant::forgetCurrent();
cache('key') // returns 'original-value';

$tenant->makeCurrent();
cache('key') // returns 'value-for-tenant'

$anotherTenant->makeCurrent();
cache('key') // returns 'value-for-another-tenant'
```

Behind the scenes, this works by dynamically changing the `cache.prefix` in the `cache` config file whenever another tenant is made current.

If you want to make the cache tenant aware in another way, you should [create your own task](/docs/laravel-multitenancy/v3/using-tasks-to-prepare-the-environment/creating-your-own-task/). You can take a look at the source code of `PrefixCacheTask` for inspiration.

repository: spatie/laravel-multitenancy

gha_language: PHP

repo_name: spatie/laravel-multitenancy


text:
# References

Work from the following papers has been implemented in Dragonfly.

```
@article{kandasamy2019tuning,
  title={Tuning Hyperparameters without Grad Students: Scalable and Robust Bayesian Optimisation with Dragonfly},
  author={Kandasamy, Kirthevasan and Vysyaraju, Karun Raju and Neiswanger,
  Willie and Paria, Biswajit and Collins, Christopher R. and Schneider, Jeff and
  Poczos, Barnabas and Xing, Eric P},
  journal={arXiv preprint arXiv:1903.06694},
  year={2019}
}
```

```
@article{kandasamy2017tuning,
  title={Tuning Hyper-parameters without Grad Students: Scaling up Bandit Optimisation},
  author={Kandasamy, Kirthevasan},
  year={2017}
}
```

```
@inproceedings{kandasamy2018neural,
  title={Neural architecture search with bayesian optimisation and optimal transport},
  author={Kandasamy, Kirthevasan and Neiswanger, Willie and Schneider, Jeff and Poczos, Barnabas and Xing, Eric P},
  booktitle={Advances in Neural Information Processing Systems},
  pages={2020--2029},
  year={2018}
}
```

```
@article{paria2018flexible,
  title={A Flexible Multi-Objective Bayesian Optimization Approach using Random Scalarizations},
  author={Paria, Biswajit and Kandasamy, Kirthevasan and Poczos, Barnabas},
  journal={arXiv preprint arXiv:1805.12168},
  year={2018}
}
```

```
@inproceedings{kandasamy2018parallelised,
  title={Parallelised bayesian optimisation via thompson sampling},
  author={Kandasamy, Kirthevasan and Krishnamurthy, Akshay and Schneider, Jeff and Poczos, Barnabas},
  booktitle={International Conference on Artificial Intelligence and Statistics},
  pages={133--142},
  year={2018}
}
```

```
@inproceedings{kandasamy2017multi,
  title={Multi-fidelity bayesian optimisation with continuous approximations},
  author={Kandasamy, Kirthevasan and Dasarathy, Gautam and Schneider, Jeff and Poczos, Barnabas},
  booktitle={Proceedings of the 34th International Conference on Machine Learning-Volume 70},
  pages={1799--1808},
  year={2017},
  organization={JMLR. org}
}
```

```
@inproceedings{kandasamy2016multi,
  title={The multi-fidelity multi-armed bandit},
  author={Kandasamy, Kirthevasan and Dasarathy, Gautam and Poczos, Barnabas and Schneider, Jeff},
  booktitle={Advances in Neural Information Processing Systems},
  pages={1777--1785},
  year={2016}
}
```

```
@inproceedings{kandasamy2016gaussian,
  title={Gaussian process bandit optimisation with multi-fidelity evaluations},
  author={Kandasamy, Kirthevasan and Dasarathy, Gautam and Oliva, Junier B and Schneider, Jeff and Poczos, Barnabas},
  booktitle={Advances in Neural Information Processing Systems},
  pages={992--1000},
  year={2016}
}
```

```
@inproceedings{kandasamy2015high,
  title={High dimensional Bayesian optimisation and bandits via additive models},
  author={Kandasamy, Kirthevasan and Schneider, Jeff and Poczos, Barnabas},
  booktitle={International Conference on Machine Learning},
  pages={295--304},
  year={2015}
}
```

repository: pyadmell/dragonfly

repo_name: pyadmell/dragonfly


text:
# Dependency Tracker

Dependency Tracker is a system that tracks library dependencies across languages.
This system provides a storage backend so that dependencies can be stored, indexed, and queried.

## Support

![GitHub](https://img.shields.io/github/license/depscloud/tracker.svg)
![branch](https://github.com/depscloud/tracker/workflows/branch/badge.svg?branch=main)
![Google Analytics](https://www.google-analytics.com/collect?v=1&cid=555&t=event&ec=repo&ea=open&dp=depscloud%2Ftracker&dt=depscloud%2Ftracker&tid=UA-143087272-2)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdepscloud%2Ftracker.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdepscloud%2Ftracker?ref=badge_shield)

## Getting Started

For more information on how to get started, see the [documentation](https://deps.cloud/docs/).

## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdepscloud%2Ftracker.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdepscloud%2Ftracker?ref=badge_large)

repository: dwtcourses/tracker

repo_name: dwtcourses/tracker


text:
# SAM.cpp

Inference of Meta's [Segment Anything Model](https://github.com/facebookresearch/segment-anything/) in pure C/C++

## Description

The example currently supports only the [ViT-B SAM model checkpoint](https://huggingface.co/facebook/sam-vit-base).

## Next steps

- [X] Reduce memory usage by utilizing the new ggml-alloc
- [ ] Remove redundant graph nodes
- [ ] Make inference faster
- [X] Fix the difference in output masks compared to the PyTorch implementation
- [X] Filter masks based on stability score
- [ ] Add support for user input
- [ ] Support F16 for heavy F32 ops
- [ ] Test quantization
- [X] Support bigger model checkpoints
- [ ] GPU support

## Quick start
```bash
git clone https://github.com/ggerganov/ggml
cd ggml

# Install Python dependencies
python3 -m pip install -r requirements.txt

# Convert PTH model to ggml
python convert-pth-to-ggml.py examples/sam/sam_vit_b_01ec64.pth 1

# Build ggml + examples
mkdir build && cd build
cmake .. && make -j4

# run inference
./bin/sam -t 16 -i ../img.jpg -m ../examples/sam/ggml-model-f16.bin
```

## Downloading and converting the model checkpoints

You can download a [model checkpoint](https://github.com/facebookresearch/segment-anything/tree/main#model-checkpoints) and convert it to `ggml` format using the script `convert-pth-to-ggml.py`:

```
# Convert PTH model to ggml
python convert-pth-to-ggml.py examples/sam/sam_vit_b_01ec64.pth 1
```

## Example output
```
$ ./bin/sam -t 16 -i ../img.jpg -m ../examples/sam/ggml-model-f16.bin
main: seed =<PHONE_NUMBER>
main: loaded image '../img.jpg' (680 x 453)
sam_image_preprocess: scale = 0.664062
main: preprocessed image (1024 x 1024)
sam_model_load: loading model from '../examples/sam/ggml-model-f16.bin' - please wait ...
sam_model_load: n_enc_state      = 768
sam_model_load: n_enc_layer      = 12
sam_model_load: n_enc_head       = 12
sam_model_load: n_enc_out_chans  = 256
sam_model_load: n_pt_embd        = 4
sam_model_load: ftype            = 1
sam_model_load: qntvr            = 0
operator(): ggml ctx size = 202.32 MB
sam_model_load: ...................................... done
sam_model_load: model size =   185.05 MB / num tensors = 304
point: 624.500000 245.593750

main:     load time =    88.36 ms
main:    total time =  5697.57 ms
```

Input point is (414.375, 162.796875) (currently hardcoded)

Input image:

![llamas](https://user-images.githubusercontent.com/8558655/261301565-37b7bf4b-bf91-40cf-8ec1-1532316e1612.jpg)

Output mask:

![mask_glasses](https://user-images.githubusercontent.com/8558655/261301844-9fc2dbbc-5fd6-42ce-af69-643df9e6fad1.png)

## References

- [ggml](https://github.com/ggerganov/ggml)
- [SAM](https://segment-anything.com/)
- [SAM demo](https://segment-anything.com/demo)

repository: ggerganov/ggml

gha_language: C

repo_name: ggerganov/ggml


text:
# Lifesaving information every Git user should know
1. Removing sensitive data in previous commit from a repository
`https://help.github.com/articles/removing-sensitive-data-from-a-repository/`

2. Markdown Cheatsheet
`https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet`

3. Splitting a subfolder out into a new repository
`https://help.github.com/articles/splitting-a-subfolder-out-into-a-new-repository/`

4. Resolving a merge conflict
`https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/`


text:
---
layout: docs
authors:
  - blairanderson
date: 2014-08-12 22:22:22
title: .trigger() in Javascript - without jQuery
description: Execute all handlers and behaviors attached to the matched elements for the given event type.
method: trigger
href: "docs/trigger.html"
status: "inactive"
---

#### Sorry, we do not have code examples for implementing [trigger](http://api.jquery.com/trigger/) in vanilla javascript.

It would be great if you submitted code on [github](https://github.com/blairanderson/without-jquery/blob/master/docs/trigger.md)

### Example:

```javascript
  //jQuery
  var i = trigger(taco);

  //Javascript
  var i = document[somethingOtherThantrigger](taco);

```

**REASONS:**
> Faster, and creates an event upon xyz

*example is computer generated, obviously not real.*

repository: blairanderson/without-jquery

repo_name: blairanderson/without-jquery


text:
## Crunch :o:

|          |                        |
| -------- | ---------------------- |
| title    | Crunch                 |
| status   | 10                     |
| section  | Workflow-Orchestration |
| keywords | Workflow-Orchestration |

Arvados Crunch is a containerized workflow engine for running complex,
multi-part pipelines or workflows in a way that is flexible, scalable,
and supports versioning, reproducibility, and provenance while running
in virtualized computing environments [@www-arvados]. The Arvados
Crunch framework is designed to support processing very large data
batches (gigabytes to terabytes)
efficiently [@www-crunch]. Arvados Crunch increases concurrency by
running tasks asynchronously, using many CPUs and network interfaces
at once (especially beneficial for CPU-bound and I/O-bound tasks
respectively). Crunch also tracks inputs, outputs, and settings so you
can verify that the inputs, settings, and sequence of programs you
used to arrive at an output is really what you think it was. Crunch
ensures that your programs and workflows are repeatable with different
versions of your code, OS updates, etc. and allows you to interrupt
and resume long-running jobs consisting of many short tasks and
maintains timing statistics automatically.

gha_language: Jupyter Notebook


text:
Readme for the Abella Scripts for My Ph.D. Thesis
======

Required Version
------
A forked Abella v2.0.7-dev,
in the master branch of its GitHub repository: <https://github.com/JimmyZJX/abella>.

How to Build Abella
------
The official description is in the *Download* section of its project webpage: <http://abella-prover.org>.

But we give another step-by-step instruction here, in case the reader is not familiar with Ocaml.

- A Linux machine is preferred due to the convenience on package management
- Install Ocaml with OPAM: <https://opam.ocaml.org/doc/Install.html>
- Install [findlib](http://projects.camlcity.org/projects/findlib.html) (via opam or manual build)
    and [ocamlbuild](https://github.com/ocaml/ocamlbuild) (via opam)
- Build and install Abella (master branch of the git repo: <https://github.com/JimmyZJX/abella>)
- Run the abella executable and you should see: `Welcome to Abella 2.0.7-dev.`

How to Compile/Re-check the Proofs
------
- Execute `abella` in the `src/Subtyping` folder (or `src/\Subtyping_mono_restriction` for the system that comes with rank-1 restriction)
- Enter the command `Import "completeness".` as the last file in our development which depends on every other scripts, and wait for Abella to compile all the dependencies
- Success with no errors indicates that the proofs are accepted
- Use `Quit.` to exit the interactive program.
- The shell command `grep "skip" *.thm` further confirms that no theorems/lemmas are assumed but not proven.

Explore Around the Proofs
------
- The reader is expected to be familiar with Abella or similar system with HOAS representations. Experiences on other proof assistants definitely helps, but the proofs might look different and thus difficult to understand some critical details.
- `typing.thm` is the starting point that defines all the types, terms, declarative rules and algorithmic rules.
- `trans.thm` defines worklist instantiation(`tex`) and declarative transfer (`dc`)
- `declTyping.thm` argues the equivalence of the original declarative system and the non-overlapping variant
- `soundness.thm` contains a lot of uninteresting lemmas on the shape invariance during worklist instantiation
- `dcl.thm` introduces another equivalent definition `dcl` to declarative transfer `dc`, which encodes the non-overlapping declarative worklist with a step-by-step style, used for the induction of the complteness theorem.
- `scheme.thm` formalizes the rank-1 restriction.
- `completeness.thm` also contains a lot of uninteresting lemmas as soundness do.

repository: JimmyZJX/Dissertation

repo_name: JimmyZJX/Dissertation


text:
<img src="https://github.com/bhashkar007/guest-entries-notification/blob/master/src/icon.svg" width="128">

# Guest Entries Notification Overview

This plugin sends a notification when a guest creates an entry through guest-entry plugin.

## Requirements

This plugin requires Craft CMS 3 and the [Guest Entries](https://github.com/craftcms/guest-entries) plugin.

## Installation

Install this plugin through the Plugin Store or follow these instructions.

1. Open your terminal and go to your Craft project:

        cd /path/to/project

2. Then tell Composer to load the plugin:

        composer require by/guest-entries-notification

3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Contact Form Extensions.

## Configuring Guest Entries Notification

Guest Entries Notification have following setting fields:
- **From Email**

    Used to set Sender Email. By default **System Email Address** will be used.

- **From Name**

    Used to set Sender Email. By default **Sender Name** will be used.

- **Email**

    Used to set Recevier Email. By default **System Email Address** will be used.

- **Email Subject**

    Used to set Email Subject.

- **Set the template for the email**

    Used to override Email template. The template will receive a `entry` variable through which all entry data can be used. By default template from [templates/notification](/src/templates/notification.twig) will be used.

Brought to you by [Bhashkar Yadav](https://360adaptive.com)

gha_language: HTML


text:
Grove I2C ADC
==============
Raspberry Pi Python i2c library for Grove I2C ADC (http://www.seeedstudio.com/depot/Grove-I2C-ADC-p-1580.html)

Grove - I2C ADC is a 12-bit precision ADC module based on ADC121C021. It helps you increase the accuracy of value collected from analog sensor by providing a constant reference voltage. Because its address is changeable, you can use up to 9 I2C ADC at the same time at most

repository: DexterInd/GrovePi

gha_language: Python

repo_name: DexterInd/GrovePi


text:
# Receipt-Text-Recognition-App

A simple boring app that detects the total cost of a receipt

Check out Figma designs [here](https://www.figma.com/file/3Tj4CA1v35Fys5QGKY4mSz/Receipt-Text-Recognition-App?node-id=0%3A1) 🎨

## Demos

Success | Failure
------------ | -------------
 |

## Built-With

- [Firebase ML](https://firebase.google.com/)
- [Retrofit](https://square.github.io/retrofit/)
- [Android Jetpack Components (Navigation, CameraX)](https://developer.android.com/jetpack/?gclid=CjwKCAjwldHsBRAoEiwAd0JybTG_zEnM0YG2eQRWFpgvDILuP1tGH5VIM-reIThtR7Dd4zGs-SFsaxoCbjsQAvD_BwE)
- [Glide](https://github.com/bumptech/glide)
- [Giphy API](https://developers.giphy.com/)

## Installation
Before installation, you must have installed the latest version of [Android Studio](https://developer.android.com/studio) for this project to works on your machine

### Cloning
After the installations, clone this repo to your local machine using `https://github.com/jama5262/Receipt-Text-Recognition-App.git`
```
git clone https://github.com/jama5262/Receipt-Text-Recognition-App.git
```
After clonning open it on Android Studio

Great the project has been setup 👍

## Usage

To start using the app, simply connect you physical device to your machine or an emulator and run the app

## Support

Reach out to me at one of the following places!

- Email at<EMAIL_ADDRESS>- Twitter [timedjama5262](https://twitter.com/timedjama5262)

## License

```
MIT License

Copyright (c) 2020 Jama Mohamed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```


text:
# Android Sensors for Unity

## Overview

Want to get the light sensor output or other cool stuff of your Android smartphone? This package provide you an easy access to the Android _Sensor Manager_. You can get a full list of possible sensors on this [page](https://developer.android.com/guide/topics/sensors/sensors_overview). Each output get stored in a smart variable.

Inspired by the talk of Ryan Hipple's ([twitter](https://twitter.com/roboryantron) | [github](https://github.com/roboryantron)) amazing talk from Unite Austin 2017, you can find part of that in the unity [blog post](https://unity3d.com/how-to/architect-with-scriptable-objects), I wrote a simple event system based on _Scriptable Objects_. These system allows you to drag & drop variables and events around.
## Installation

* Grab unityAndroidSensors.unitypackage from the Releases page for everything you need!
* OR, use the git repository.
* Tested with Unity 2018.3 (New Prefab Workflow) or above.

## What you get

Firstly, You have access to every sensor value of the Android _Sensor Manager_.
Secondly, You get a simple extentable event system which allows you to create _SmartEvents_ and _SmartVars_ in the project view.

## Events and Variables

To create a new _SmartEvent_ or a _SmartVar_ you can use the _Create->SensorPlugin->SmartData_ context menu in the project view.

Events are accessible via the ListenSmartEvent Component

Here you can listen to _SmartEvent_'s. If a event gets fired all callbacks get invoked.

These are particularly useful for game-level events, such as starting, pausing the game, a player dying etc.

## Variables

Variables are just container of data, with the advantage that you can drag & drop them around like the events.

## Comparators

Float- and IntVars can be compared by the _Float_- or _IntVarComparator_. You can choose to compare with a constant or another smart variable.

### Unity Sensor Plugin

The heart of the plugin is the _UnitySensorPlugin_ class. You need the class just once in your scene to get the connection to your Android phone. All sensor readers communicate with the _UnitySensorPlugin_ to get the sensor data as a float[3] array.

### Sensor Reader

The *Sensor Reader* provides you with some option to choose the right sensor, the output type and the update interval (per frame). The output is stored in a _SmartVar_. This can be of type float, int or Vector3.

If you choose int or float you have the option to select the specific axis of the output value, otherwise you get all axis as a _Vector3Var_.

## Modifier

If you want to modifiy the output of a sensor before it is written into a _SmartVar_ you can create a modifier which can manipulate the raw float[3] array from the sensor.

An example of a modifier is in the Modifier folder.
It is applied to the pre-configured acceleration sensor.

## New Unity Input System (Update 2019-10-15)
Hey guys with the new input system the plugin is obsolet<EMAIL_ADDRESS>

repository: lightyeah/unityAndroidSensors

repo_name: lightyeah/unityAndroidSensors


text:
---
labels: ['typescript', 'utils', 'network']
description: 'An http/s agent factory with proxy support'
---

A wrapper over the [http agent used by pnpm](https://bit.cloud/pnpm/network/agent).

Create an http/s agent from uri and options.
This support http/s proxy server with different configuration.

In case there is matching proxy option that matching the uri protocol (`httpProxy` for `http:` uri and `httpsProxy` for `https:` uri), and the uri is not excluded by the `noProxy` config, it will create a proxy agent.
To read more about the proxy agent, read the docs of the [`proxy-agent`](https://bit.cloud/pnpm/network/proxy-agent) component.

API:

```js
function getAgent(uri: string, opts: AgentOptions)
```

Available configuration (AgentOptions):

```js
  /**
   * A proxy server for out going network requests by the package manager
   * Used for both http and https requests (unless the httpsProxy is defined)
   */
  httpProxy?: string;

  /**
   * A proxy server for outgoing https requests by the package manager (fallback to proxy server if not defined)
   * Use this in case you want different proxy for http and https requests.
   */
  httpsProxy?: string;

  /**
   * A path to a file containing one or multiple Certificate Authority signing certificates.
   * allows for multiple CA's, as well as for the CA information to be stored in a file on disk.
   */
  ca?: string;

  /**
   * A path to a file containing one or multiple Certificate Authority signing certificates.
   * Similar to the ca setting, but allows for multiple CAs, as well as for the CA information to be stored in a file
   * instead of being specified via CLI.
   */
  cafile?: string;

  /**
   * Whether or not to do SSL key validation when making requests to the registry via https
   */
  strictSSL?: string;

  /**
   * A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
   * cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
   * It is not the path to a certificate file (and there is no "certfile" option).
   */
  cert?: string;

  /**
   * A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\n". For example:
   * key="<REDACTED_PRIVATE_KEY>"
   * It is not the path to a key file (and there is no "keyfile" option).
   */
  key?: string;

  /**
   * A comma-separated string of domain extensions that a proxy should not be used for.
   */
  noProxy?: string;

  /**
   * The IP address of the local interface to use when making connections to the npm registry.
   */
  localAddress?: string;
```

repository: teambit/bit

repo_name: teambit/bit


text:
---
layout: post
title: How can the blind read something other than Braille? #Design&Visual
---
This is a reading assistance tool for blind people. Our team won the 2010 Reddot Award with this design, but it stays in concept. No one has turned it into a real product due to immature of student team and miniaturization difficulty.

![alt text](https://rawgit.com/jinzhenfan/jinzhenfan.github.io/master/images/Reddot/touch reader1.jpg "Flyer")
![alt text](https://rawgit.com/jinzhenfan/jinzhenfan.github.io/master/images/Reddot/touch reader2.jpg "Demon")
![alt text](https://rawgit.com/jinzhenfan/jinzhenfan.github.io/master/images/Reddot/touch reader3.jpg "Design")

path: /_posts/2010-10-01-Conceptual Design #1 Touch Reader.md


text:
# SVGBar
> Animated progress bars with variable widths and non-linear paths (i.e. squiggly).

Great for animating and controlling SVG progress bars with any of the following:
- variable widths along their profile
- non-linear paths (see the worms)
- an animation path defined separately from the progress bar shape
- multiple progress bars sharing the same mask

PlainJS - no dependencies!

See it in action here: **[Demo page](https://play.interactionmagic.com/svg-bar/example-everything.html)**!

![Wiggly worms](https://play.interactionmagic.com/svg-bar/worms.gif)

## Getting started

Include the SVGBar.js file in the head of the page:
```html
<script src="/path/to/SVGBar.min.js"></script>
```

Add your SVG to the body of your page, for example:
```html
<svg version="1.1" x="0px" y="0px" width="400px" height="200px" viewBox="0 0 400 200">
    <path class="mask" d="M375,150H25V50h350V150z"/>
    <path class="progress_path" d="M25,100h350"/>
</svg>
```

and then call:

```javascript
var mySVGBar = new SVGBar();
```

This will initialise the SVGBar with the default options:

- The first `<svg>` tag on the page will be used
- The first `<path class='mask'>` inside the svg will be used as the mask
- All of the `<path class='progress_path'>` paths will be used to create progress bars with the mask

The script will take care of building the progress bars and all other masks.

### Styling

You should add some CSS styles for the mask and progress_paths to the page so you can see something.
You can also style the '.path_line' class which will enable you to toggle on/off a view of the path line.
Here's some styles to get started:

```css
.mask{
    fill:#B5B5B5;
    stroke:none;
}
.progress_path{
    fill:none;
    stroke-linecap:butt;
    stroke-width:500;
    stroke:#5EB902;
}
.path_line{
    fill:none;
    stroke-linecap:round;
    stroke-width:2;
    stroke:#666666;
    stroke-dasharray: 5, 5;
}
```

## How it works

The progress bar uses a couple of different techniques:

- Dashed-line and dashed-offset CSS effect to create an animation along a path
- CSS clippath reference to inline SVG
- Dynamic creation and injection of CSS keyframe animations

The styling on `.progress_path` should include a stroke-width which is wider than the possible maximum width of the progress bar, to ensure the colour fill is good enough.

## Options

To configure with some options, pass a plain object to the options argument of the constructor like this:

```javascript
var svg_obj = document.getElementById('mysvg');
var mySVGBar = new SVGBar({
    svg:                svg_obj,
    mask:               svg_obj.getElementById('my_mask'),
    progress_path:      svg_obj.querySelectorAll('.paths_for_progress'),
    animation_length:   3000,
    track_mouse:        'x'
});
```

| Option | Description |
| --- | --- |
| svg | The DOM element containing the SVG |
| mask | The DOM element inside the SVG element which is the path to use for masking |
| progress_path | A NodeList or HTMLCollection all `<path>` elements in the SVG element which should be used in conjunction with the mask. Can also accept a single item. |
| animation_length | Length for the animation in milliseconds. Default is 5000. |
| track_mouse | Use this to enable a mouse handler for the svg, which will tie the movement of the mouse within the svg tag to the progress of the progress bar. Possible values are: 'x', 'y', '-x', '-y'.  |

## Methods

See **[example-minimal.html](https://play.interactionmagic.com/svg-bar/example-minimal.html)** for a demo of the basic features.

### setProgress(percent)
Sets the position of the progress bar as a percentage from 0 -> 1.
Useful to put inside a handler on the page for keyboard presses, AJAX calls, mouse movement etc.
```javascript
mySVGBar.setProgress(0.4);
```
Chainable (returns object).

### displayPathLine(will_show)
Show or hide an outline of the path the progress bar is following (great for debugging)
```javascript
mySVGBar.displayPathLine(true);
```
Chainable (returns object).

### togglePathLine()
Toggle visiblity of path line
```javascript
mySVGBar.togglePathLine();
```
Returns true or false depending on new state of path line visibility.

### setAnimationState(will_show)
Start or stop animating the progress bar back and forth from 0 -> 100%
```javascript
mySVGBar.setAnimationState(true);
```
Chainable (returns object).

### toggleAnimationState()
Toggle play/stop state of animation
```javascript
mySVGBar.toggleAnimationState();
```
Returns true or false depending on new state of animation playback.

### setPath()
Set the visible progress bar to a given element. This element must have been passed to the constructor initially in the `progress_path` option.
```javascript
mySVGBar.setPath(document.getElementById('path1'));
```
Returns true if path could be set.

## Events

See **[example-everything.html](https://play.interactionmagic.com/svg-bar/example-everything.html)** for a demo of the progressChanged event.

### progressChanged
Will fire on a progress bar `path` node every time the progress changes. Read in the `detail.progress` value to get the current progress bar position.
```javascript
document.addEventListener("progressChanged",function(e){
    console.log(e.detail.progress);
});
```

## Future extensions

- Improve passing of masks and progress paths to couple them together more closely
- Better getter/setter methods
- Functions should return sensible values
- Colour transition for progress bar between two values
- Add function to return current animation position

repository: gcsalzburg/svg-bar

repo_name: gcsalzburg/svg-bar


text:
# hacking-java

This is the code base for the conference talk "Hacking Java" by Sean Patrick Floyd

The Talk deals with different topics where Java doesn't provide any satifactory mechanism out of the box.
Each section then highlights a few different technologies that offer solutions for these problems.

Currently, the sections are:

- [Value Objects](1_valueobjects) (Creating value objects in Java is a very tedious and error-prone manual process)
- [Patching a third party library](2_patching) in an automated way
- [Build-time defect analysis](3_defect-analysis)

This project contains generated code in some modules. If your IDE reports compilation errors, run `mvn clean install`
from the command line and then re-import or refresh the project in your IDE.

repository: balijepalli/hacking-java

repo_name: balijepalli/hacking-java


text:
# Sample dashboards for Liberty
This repository contains sample dashboards for monitoring Liberty in the following products:

- [IBM Cloud Private version <IP_ADDRESS>](./IBMCloudPrivate_<IP_ADDRESS>)