text:
# **SCC5830 Image Processing -- Final Project**

- **Author:** Erikson Julio de Aguiar (graduate student)
- **proposal objective:** Analyze the impacts of restoration and enhancement methods to improve images over the rescaling attack

## Abstract

Adversarial attacks insert perturbations on medical images may cause misclassifications in machine learning models. As a result, diseases are incorrectly classified forward to poor diagnosis and not assist physicians. Furthermore, malicious agents might generate perturbations and inserted them in images, producing noise to build adversarial features. One of these is the image scaling attacks aim to produce another image when resize the source image. Our proposal aims to develop a method to detect attacked images and restore them. We will use the difference between histograms to identify the malicious image and restoration methods to recovery affected pixels of the source image. In this project, we hope to improve image quality to protect against image scaling attacks. To evaluate, we will use as a source image a dataset from Kaggle with images of chest X-ray and target image. We will apply non-medical images to fool tools when there is resized.

- Keywords:
  - Main task: Image restoration and enhancement
  - Application: Medical images, adversarial attacks

**Rescaling attack overview:**

**Related papers:**

- Xiao, Q., Chen, Y., Shen, C., Jiaotong, X., Chen, Y., Cheng, P., Li, K."Seeing is not believing: Camouflage attacks on image scaling algorithms." 28th {USENIX} Security Symposium ({USENIX} Security 19). 2019.![https://www.usenix.org/conference/usenixsecurity19/presentation/xiao](https://www.usenix.org/conference/usenixsecurity19/presentation/xiao).
- Quiring, Erwin, et al. "Adversarial preprocessing: Understanding and preventing image-scaling attacks in machine learning." 29th {USENIX} Security Symposium ({USENIX} Security 20). 2020. ![https://www.usenix.org/conference/usenixsecurity20/presentation/quiring](https://www.usenix.org/conference/usenixsecurity20/presentation/quiring)

## Dataset

- Dataset contains 5,863 X-Ray images (JPEG) with 2 classes (Pneumonia/Normal). Dabaset is available on [Kaggle](https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia)

**Input images example:**

  P.s. Input image example can find on ![chest_images](https://github.com/eriksonJAguiar/scc5830_final_project/tree/main/images/chest_images)

 **Result image after attack**

 P.s. Attack images examples can find on ![attacks_experiments](https://github.com/eriksonJAguiar/scc5830_final_project/tree/main/images/attacks_experiments) (Nearest-neighbor interpolation), also others crafted images are available on ![attacks](https://github.com/eriksonJAguiar/scc5830_final_project/tree/main/images/attacks)  (different interpolations methods)

  **Restored image after attack**

 - Median filter:

 - Remove peaks:

 - Minimum filter:

## Experiments

- We suggest using our Jupyter Notebook available on ![Jupyter Notebook](https://github.com/eriksonJAguiar/scc5830_final_project/blob/main/image_scaling.ipynb) to reproduce experiments

## How to run?

### build environment
```pyhthon
    python3 -m venv attack-env
    pip3 install -r requiments.txt
```

### Modules available

**attack_module -> ImageScaling class: related to attack method:**

- Bileaner interpolation [b_resize]
- Neighbor-nearest interpolation [nn_resize]
-  Build attack [Build_attack](our implementation)
-  Build Attack with library built for ![Quiring (2020)](https://github.com/EQuiw/2019-scalingattack)
-  Build repository [build_repository] -> Create repository to load attack image
-  run experiments[run_experiments] -> run a batch of experiments
-  run expertiment one image [run_one_image] -> run experiments for one image

**defense_module -> Defense class: related to defesive method:***

- Median filter to restore image [restoration_image_median]
- Remove peaks and  to restore image [restoration_image_median]
- Minimum filter to detect attac image [restoration_image_median]
- Unshap mask to test high-pass filter [unsharp_mask]

## References

- Xiao, Q., Chen, Y., Shen, C., Jiaotong, X., Chen, Y., Cheng, P., Li, K."Seeing is not believing: Camouflage attacks on image scaling algorithms." 28th {USENIX} Security Symposium ({USENIX} Security 19). 2019.
- Quiring, Erwin, et al. "Adversarial preprocessing: Understanding and preventing image-scaling attacks in machine learning." 29th {USENIX} Security Symposium ({USENIX} Security 20). 2020.
- Quiring, E., Klein, D., Arp, D., Johns, M., Rieck, Konrad. "Backdooring and poisoning neural networks with image-scaling attacks." 2020 IEEE Security and Privacy Workshops (SPW). IEEE, 2020.
- Quiring, E., Klein, D., Arp, D., Johns, M., Rieck, Konrad. "Image-Scaling Attacks in Machine Learning", 2020.
- Qayyum, A., Qadir, J., Bilal, M., & Al-Fuqaha, A. (2021). Secure and Robust Machine Learning for Healthcare: A Survey. IEEE Reviews in Biomedical Engineering, 14, 156–180. https://doi.org/10.1109/RBME.2020.3013489
- Finlayson, S. G., Bowers, J. D., Ito, J., Zittrain, J. L., Beam, A. L., & Kohane, I. S. (2019). Adversarial attacks on medical machine learning. Science. https://doi.org/10.1126/science.aaw4399.


text:
# python-opencap

## Testing

```bash
python opencap_test.py
```

## Contribute

Submit PR's and, this repo is totally open source and we appreciate any help. Make sure that no logic that isn't directly related to OpenCAP is included here.

license: MIT

repository: opencap/python-opencap

branch_name: refs/heads/master

extension: md

gha_language: Python

gha_license_id: MIT

license_type: permissive

repo_name: opencap/python-opencap


text:
# Password-Generator

This is a password generator that creates a password from 8-20 characters long. It gives the user control as to how many characters they would like, as well as which chracters they would like to include (numbers,letters,special characters). With any combination of them all.

repository: ComeBacKyle/Password-Generator

branch_name: refs/heads/main

repo_name: ComeBacKyle/Password-Generator


text:
---
description: Apollo Elements lets you write reusable and interoperable GraphQL components once, then use them in any frontend framework or none. Share your work across teams or publish your company's web components for others to use.
tags:
  - graphql
  - webcomponents
  - interop
  - custom elements
published: true
generateSocialImage: true
date: 2021-01-01
updated: Last Modified
---

# GraphQL Components that Work in Every Framework

You know how it goes. You hear about the hot new framework everyone's posting about. Sooner or later the shine fades on your lame old app's front-end stack. You start dreaming about the next project, how you'll do things differently. Or maybe you commit to The Big Rewrite™, but it doesn't go as planned. Despairing, despondent, dejected, you wonder if there's any way to get off this churning treadmill.

Friend, let me tell you - there's a solution looking your right in the face. In fact that solution comes built in to the browser you're reading this post with. You can escape the hype cycle for good with web components.

## Framework Interoperability

One of the main advantages to web components is that they are just HTML DOM objects. That means they interface with each other and the rest of the app primarily via standards like HTML attributes, DOM properties, and Events.  If, down the line, you refactor `<spicy-input>` by writing it with a different custom-element base class (e.g. swapping `LitElement` for `FASTElement`) as long as the external API (attributes, properties, named slots, css custom properties or shadow parts, and events) stays the same, you don't have to change any other files.

If reading this gave you a sudden urge to implement that `<spicy-input>` element, then you're the hero we're waiting for, so get on it.

> With web components, the library or framework you build them with is an implementation detail, and you can swap them out piecemeal without changing the rest of your app.

This also means that you can use web components inside your old-school framework, or with other web-component libraries.

```html tab angular
<spicy-input (spicy-change)="onSpicyChange($event)" [value]="spicyValue"></spicy-input>
```

```jsx tab preact
return <spicy-input onspicy-change={onSpicyChange} value={spicyValue}></spicy-input>;
```

```jsx tab react
const spicyInputRef = createRef(null);
const onSpicyChange = e => setSpicyValue(e.target.value);
const [spicyValue, setSpicyValue] = useState('');
useEffect(() => spicyInputRef.current.addEventListener('spicy-change', onSpicyChange));
useEffect(() => (spicyInputRef.current.value = spicyValue), [spicyValue]);
return <spicy-input ref={spicyInputRef}></spicy-input>
```

```html tab svelte
<spicy-input on:spicy-change={onSpicyChange} value={spicyValue}></spicy-input>
```

```html tab vue
<spicy-input @spicy-change="onSpicyChange" :value="spicyValue"></spicy-input>
```

{% assign react_footnote = "Why all the extra code for React? As of this writing, [React has the poorest HTML and DOM support of any framework](https://custom-elements-everywhere.com/#react). Hopefully this will change soon. In the meantime there are a few [wrapper](https://www.npmjs.com/package/reactify-wc) libraries that make it easier to use web components in React by handling all this boilerplate for you." | markdown | replace: "
" , "" | replace: "
" , "" %}

> TL;DR: web components work in {% footnoteref "react" react_footnote %}all frameworks{% endfootnoteref %}, or none, since they're just HTML and the DOM.

## GraphQL Meets Web Components

So interop takes the pressure off "The Big Rewrite™" and helps us share our work across teams and apps, but web components have another super power which helps us get the job done: *encapsulation*.

A well-written web component keeps its insides in and its outsides out. By that, I mean that the internal implementation of the component is kept hidden while the external APIs remain stable and accessible.

In the world of GraphQL, that can mean associating a query with a component so that it's data and it's DOM structure are tightly linked. Apollo Elements lets us define query components that render their data to their private shadow DOM.

```ts copy
import { useQuery, html, component } from '@apollo-elements/haunted';
import { gql, TypedDocumentNode } from '@apollo/client/core';
import { PostsQuery } from './Posts.query.graphql';

function Posts({ limit, sort }) {
  const { data } = useQuery(PostsQuery, { variables: { limit, sort } });

  const posts = data?.posts ?? [];

  function onLike() {
    const { id } = event.target.closest('li');
    this.dispatchEvent(new CustomEvent('like-post', { detail: { id } }));
  }

  return html`
    <h2>Posts</h2>
    <ol>
      ${posts.map(({ id, coverImage, summary, title, url, liked }) => html`
      <li id="${id}">
        <a href="${url}"><img src="${coverImage}" role="presentation"/> ${title}</a>
        <p>${summary}</p>
        <button role="switch"
            aria-checked="${liked}"
            aria-label="toggle liked"
            @click="${onLike}">
          ${liked ? '💔' : '💓'}
        </button>
      </li>
      `)}
    </ol>
  `;
}

Posts.observedAttributes = ['limit', 'sort'];

customElements.define('posts-list', component(Posts));
```

In this code snippet, the `<posts-list>` component renders a list of post summaries, where each list-item bears the `id` of it's post. Ordinarily, we'd be reticent to use element IDs so dynamically, but with Shadow DOM, the internals of `<posts-list>` are isolated from the rest of the document, so we as the author have complete control of the shadow root and can do what we like there without worrying about whether it might negatively affect the rest of the page.

And since that internal DOM is so strongly encapsulated, our colleagues on the Angular team can import it into their app with confidence that indeed nothing will go wrong, even if down the line we change the internal structure of the component.

```html tab angular
<label>Posts per page
  <input type="number" step="10" [(ngModel)]="limit"/>
</label>

<label>Sort
  <select [(ngModel)]="sort">
    <option value="asc">Ascending</option>
    <option value="desc">Descending</option>
  </select>
</label>

<posts-list
    [limit]="limit"
    [sort]="sort"
    (like-post)="onLikePost($event)"
></posts-list>
```

```tsx tab preact
function PostContainer() {
  const [limit, setLimit] = useState(10);
  const [sort, setSort] = useState('asc');
  return (
    <label>Posts per page
      <input
          type="number"
          step="10"
          value={limit}
          onInput={e => setLimit(e.target.value)}/>
    </label>

    <label>Sort
      <select onInput={e => setSort(e.target.value)}>
        <option value="asc">Ascending</option>
        <option value="desc">Descending</option>
      </select>
    </label>

    <posts-list
        limit={limit}
        sort={sort}
        onlike-post={onLikePost}
    ></posts-list>
  );
}
```

```tsx tab react
function PostContainer() {
  const postsListRef = createRef(null);
  const [limit, setLimit] = useState(10);
  const [sort, setSort] = useState('asc');
  useEffect(() => postsListRef.current.addEventListener('like-post', onLikePost));
  useEffect(() => postsListRef.current.limit = limit, [limit]);
  useEffect(() => postsListRef.current.sort = sort, [sort]);

  return (
    <label>Posts per page
      <input
          type="number"
          step="10"
          value={limit}
          onInput={e => setLimit(e.target.value)}/>
    </label>

    <label>Sort
      <select onInput={e => setSort(e.target.value)}>
        <option value="asc">Ascending</option>
        <option value="desc">Descending</option>
      </select>
    </label>

    <posts-list ref={postsListRef}></posts-list>
  );
}
```

```html tab svelte
<label>Posts per page
  <input type="number" step="10" bind:value={limit}/>
</label>

<label>Sort
  <select bind:value={sort}>
    <option value="asc">Ascending</option>
    <option value="desc">Descending</option>
  </select>
</label>

<posts-list limit={limit} sort={sort} on:like-post={onLikePost}></posts-list>
```

```html tab vue
<label>Posts per page
  <input type="number" step="10" v-model="limit"/>
</label>

<label>Sort
  <select v-model="sort">
    <option value="asc">Ascending</option>
    <option value="desc">Descending</option>
  </select>
</label>

<posts-list limit="limit" sort="sort" @like-post="onLikePost"></posts-list>
```

You can write complex single-page apps with just Apollo Elements. Each component manages it's own internal state while using a templating system like `lit-html` or an old-school JavaScript framework to hook up properties and events, and the Apollo cache for [managing client-side state](https://apolloelements.dev/guides/usage/local-state/) more generally.

## Learn More
Interested to learn more? Read our [getting started guide](https://apolloelements.dev/guides/) to find out how your team can bring GraphQL to your web app one web component at a time. Or if you've already started, check out the [API docs](https://apolloelements.dev/api/) for the low-down on how components work using your favourite web component library.

So dive in, start building GraphQL and web components into your app today!

license: ISC

repository: apollo-elements/apollo-elements

gha_language: TypeScript

gha_license_id: ISC

repo_name: apollo-elements/apollo-elements


text:
# Federated Learning in TensorFlow.js

## *This is not an official federated learning framework for TensorFlow. This is an experimental library for TensorFlow.js that is currently ***unmaintained***. If you would like to use an official federated learning library, check out [tensorflow/federated](https://github.com/tensorflow/federated).*

This is the parent repository for an (experimental and demonstration-only)
implementation of [Federated
Learning](https://ai.googleblog.com/2017/04/federated-learning-collaborative.html)
in [Tensorflow.js](https://js.tensorflow.org/). Federated Learning is a
method for training machine learning models in a distributed fashion.
Although it involves a central server, that server never needs to see any
data or even compute a gradient. Instead, _clients_ perform all of the
inference and training locally (which they already do in Tensorflow.js), and
just periodically send the server updated weights (rather than data). The
server's only job is to aggregate and redistribute them, which means it can
be extremely lightweight!

## Basic Usage

On the server (NodeJS) side:

```js
import * as http from 'http';
import * as federated from 'federated-learning-server';

const INIT_MODEL = 'file:///initial/model.json';
const webServer = http.createServer(); // can also use https
const fedServer = new federated.Server(webServer, INIT_MODEL);

fedServer.setup().then(() => {
  webServer.listen(80);
});
```

On the client (browser) side:

```js
import * as federated from 'federated-learning-client';

const INIT_MODEL = 'http://my.initial/model.json';
const SERVER_URL = 'http://federated.learning.server'; // URL of server above
const client = new federated.Client(SERVER_URL, INIT_MODEL);

client.setup().then(() => {
  const yhat = client.predict(x); // make predictions!
  client.federatedUpdate(x, y);   // train and update the server!
});
```

## Documentation and Examples

See the [server](./src/server) and [client](./src/client)
READMEs for documentation, and the [emoji](./demo/emoji_hunt) or
[Hogwarts](./demo/audio) demos for more fully fleshed out examples.

repository: PAIR-code/federated-learning

repo_name: PAIR-code/federated-learning


text:
---
layout: post
title:  Longevity
subtitle: Can We Slow the Aging Process?
date:   2019-10-22 19:00:00
categories: Torben
tags: [Medicine/Health/Genetics]
bigimg: /img/longevity1.jpg
---
The fountain of youth is a dream that has inspired poets, has brought explorers to our coasts and has challenged science for generations. Why do we get older? Can we do anything about it? Is there a magic “cure” for aging, or is life just “a terminal disease?”

We will take a look at some of the aspects of this fascinating issue, where answers may still be on the horizon.

Join us and weigh in on the matter.

### Follow-Up

* [Presentation](/assets/present/2019/longevity.pdf) (PDF)

* Viola added that those interested in following the field of Longevity, may follow Dr. Bob Martin (Phoenix) on Facebook and  [doctorbob.com](http://doctorbob.com).  He also has a radioshow on Longevity every Saturday from 10 AM to 12 Noon and every Sunday from 5 - 8 PM. The station is AM 550 -  KFYI
* an article about the [original research into chronological vs biological age](
https://getpocket.com/explore/item/how-to-reverse-aging-and-become-whoever-you-want-to-be)

### Coming Up...

* November 7: Living on Mars (part1)
* November 21: Living on Mars (part2)

gha_language: HTML

gha_license_id: NOASSERTION


text:
# Introduction

ML Aide's purpose is making model management a joy for you!

## Key Benefits

ML Aide is designed and developed to be

- **Enterprise-ready: Identity, security and integrity** as first class citizen
- **Diverse: Supports every ML Library** for complete freedom
- **Transparent: Provided Open Source** for maximum transparency
- **Independent: Runs on every Cloud platform or On-Premises** for complete independence
- **Scalable: Scalable from single user to large enterprises** and ready for growing demands
- **Effective: Accelerates MLOps for more focus on** what really matters: **Your Business**

## Key Features

Track all relevant information of your machine learning models with ML Aide to manage your model lifecycle from training to retirement.

- **Experiment Tracking:** Track parameters, metrics and artifacts in your machine learning experiments that are organized through single runs.
- **Artifact Management:** Attach artifacts like code, configs or models to your experiment runs and reuse them in your next run.
- **Experiment Lineage:** Inspect your experiment with a visualized lineage representing the relationship between all runs and artifacts.
- **Model Staging:** Put your models under version control and stage them to obtain transparency and reproducibility in your operations.
- **Run Evaluation:** Evaluate your runs by viewing or comparing parameters and metrics to identify the best model for your machine learning product.
- **ML Library Integration:** Raising amount of integrated machine learning libraries for convenient tracking of parameters, metrics and models.
- **Access Management:** Manage access to your machine learning projects and collaborate with other members of your team.

## Getting Started

Run ML Aide on your local environment

[Start Now](start/quickstart.md){: .md-button}

## Tutorial

Walk through the model development process with ML Aide

[View Tutorial](tutorial/introduction.md){: .md-button}

## Essentials

Learn the essentials of ML Aide

[Learn More](essentials/index.md){: .md-button}

## API Reference

Explore the Python SDK or REST API Reference

[Explore API Reference](api-reference/python-sdk.md){: .md-button}

repository: nateraw/docs

repo_name: nateraw/docs


text:
# uovision-binary-decoder

[![Build Status](https://travis-ci.org/cpetrich/uovision-binary-decoder.svg?branch=master)](https://travis-ci.org/cpetrich/uovision-binary-decoder)

Python script to decode UOVision binary files to ASCII.

Decodes PROFILE.BIN generated for UOVision cameras including UM562, UM565, UM595-2G, and UM785-3G, and
LogFile.DAT generated by cameras including UM785-3G.

Tested on Python 2 and Python 3, cPython and PyPy.

repository: cpetrich/uovision-binary-decoder

repo_name: cpetrich/uovision-binary-decoder


text:
+++
title = "new technologies galore"
date = "2012-11-02"
slug = "2012/11/02/new-technologies-galore"
Categories = []
+++
*Most of the stuff is still under production, more details later*

Don't know why but these days I am hooked to Javascript. Perhaps that's coz I write way too much Javascript these days or maybe the world is really moving to the client side of things. Now I don't want to go into the details of the holy war of server side vs client side of things. However, I do find that client side stuff is very exciting not to mention that completely open.

For client side development I am using a host of technologies to work my way around. These are BackboneJS, ExpressJS, NodeJS and Redis.

## Food For Thought
Now you would be wondering how come so many *JS appended libraries. Man! if I had known myself I would tell but really don't know what is up with the JS convention anyways.

## NodeJS
To me nodejs seems pretty darn powerful when it comes to serving requests. With it's event driven framework to go around I am sure it's the language of the server in the times to come. Although I would like to step back and think that Javascript is not really a `language` but more like a `scripting language` but I guess the perceptions will change over time. To start a simple node js server all you need is to install [Node][node] first. My favorite for doing this is [Homebrew][homebrew]

``` bash
$ brew install node
```

Here is a sample `server.js` file which acts as a Node web server.

``` js server.js
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '<IP_ADDRESS>');
console.log('Server running at http://<IP_ADDRESS>:1337/');
```
To run this all you need to do is:

``` bash
$ node server.js
```

And voila goto `localhost:1337` and be greeted by a HTML page response. Cool isn't it?

## ExpressJS
Now we dive into a framework for creating web applications with Node. Why? Coz Frameworks rock and there is a clear well defined design strategy at work which frankly most of us would take a lot of time to devise. So why don't we use the community's advice and just do it!

[ExpressJS][express] makes the creation of web apps with Node such a breeze.

First you would need to install express. For this we would make use of the Node Package manager (NPM)

``` bash
$ npm install -g express
```

This would put a bunch of stuff in the directory of our node app. ExpressJS comes with a cool generator (aka rails style) and one can make use of it to create the next scaffold.

``` bash
$ express --sessions --css stylus --ejs myapp
```

So go ahead and start modifying code. Yay! Follow the guide at the [ExpressJS Docs][expressdoc]

## BackboneJS
Server side Javascript is fine but what about client side javascript. For this we have [BackboneJS][backbonejs], a client-side MVP (most people call it MVC or MV*) framework which organizes your code into awesome folders called `models`, `views` and `templates`. Find out more about it at the official website.

## Redis
And lastly for persistence, I am looking at [Redis][redis]. I am still looking at it. So i will update this once I have more information about it.

[homebrew]: http://mxcl.github.com/homebrew/
[node]: http://nodejs.org/
[express]: http://expressjs.com/
[expressdoc]: http://expressjs.com/guide.html
[backbonejs]: http://backbonejs.org/
[redis]: http://try.redis-db.com/

repository: creativepsyco/blog

repo_name: creativepsyco/blog


text:
Postgres Compatibility for Magento
========

### Motivation
Back in 2010 Magento 1.4->1.6 was rewritten to have Zend_Select everywhere.\
It was done as a project for compatibility with SQL Server and Oracle.\
Postgres was not in scope at that time. Even after Magento 2 moved to Github, it never came in.\
Adapter implementation is not there because of its low level and complexity.\
So this module provides baseline for further development.\

There were updates to Magento 2 that made some part incompatible but legacy of 2010 is still there.

### Current state of implementation

Current state is a `proof of concept` and checkout with simple products works.\
At this moment `bin/magento` works with some commands, \
like `store:list`,`store:website:list`,`config:show`.\
Login into admin works, homepage works, CMS Editing works.\
Visiting orders, invoices, shipments, settings.\
Catalog and Cart Rules, visited, but did not check in action.

Basic CRUD suppose to work fine.

### Pain points
[ ] DDL Cache (It used Redis) \
[x] Identities and autoincrements.(script in misc)\
[ ] Insert on duplicate.\
[x] Fancy catalog collection::getSize(); (`compatibility patch`)
[x] EAV Unions. (`compatibility patch`) \
[ ] Indexers and Reports.\
[ ] Magento relies on custom implementation of Material Views for Mysql.\
[ ] Time Zone, database uses GMT.\
[ ] Functions that do not exist in Postgres. added `getFieldSql()` with `compatibility patch` for sort calls.\
[x] Replace sequence_% tables with real sequences.

### Make it work

0. Prepare working Magento with MySQL database.
1. Use script misc/mysql_to_pgsql.sh as an example for migration of your database.
2. Use script `php convert_sequences.php` to restore identities/auto-increments for primary keys.
3. Apply some patches to the core from [Postgres Compatibility Branch](https://github.com/kirmorozov/magento2/tree/2.4-postgres-compatibility)
4. Change app/etc/env.php
5. Enjoy.
6. Fix  'Not implemented Morozov\PgCompat\DB\Adapter\Pdo\Postgres...' exception.
7. Go to 5 :)

### License
    Copyright 2021 Kirill Morozov<EMAIL_ADDRESS>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: kirmorozov/mage-postgres-compatibility

repo_name: kirmorozov/mage-postgres-compatibility


text:
# MNIST Example: A tutorial for beginners.

## Basic Usage:

Please make sure that you have set the OS environment variables according to the top-level installation introduction.

```
tart-train desc_mnist.py -d cpu
tart-demo desc_mnist.py -d cpu -w $TART_DUMP/mnist/mnist/snapshots/epoch_<eid>.snapshot.pkl
```

## Some details of the description files and scripts
As state in "design philosophy", all the experiments settings (including but not limited to network structures,
hyperparameters, data processing strategies...) should be included in a *SINGLE* `desc_*` file.
As we can see in the `desc_mnist.py`, it basically includes three parts, `make_network`, `make_optimizer`, and `__envs__`.

#### Environ (`__envs__`)
The `Environ` is just a single dict. It contains all the parameters/configurations you need to conduct your training process / inference / etc.
For example `envs['dir']['root']` is the root directory for this experiments, and thus all the models, logs of this experiment will be dumped into
that specific directory.

The reason to introduce a global Environ is that these configs can be accessed anywhere in TensorArtist, simply by using the function `get_env`.
You can easily add new settings to your program, and use it somewhere else. A worth-noting thing is that the function `get_env` provide simplified
access to cascaed dicts, i.e. `get_env('trainer.learning_rate')` is equivalent to `get_env('trainer')['learning_rate']`

#### Network making function (`make_network`)
In the network making function, you are given an `Env` (NOTE!! this object has noting to do with the `Environ` introduced before). An env is similar
to `tf.Graph` is design. If you want to derive more about the Env, feel free to take a look at `tartist/nn/graph/env.py` to find more details.

A worth noting thing in this function is the usage of `DataParallelController`, or abbr. `dpc`. It provides
an automatical way to perform data-parallel computation acrossing different GPUs. You can see the example
for MNIST to see the basic usage. We also include a very detailed explaination on how it works in `tartist/nn/graph/env.py`.

In this function, you can call `O.xxx` to build your computation graph. All O.xxx functions deals with `VarNode` (a wrapper of `tf.Tensor`),
and you can convert between them using `O.as_varnode` and `O.as_tftensor`. To find a complete list of available ops, see `tartist/nn/opr`.

#### Optimizer making function (`make_optimizer`)
When you want to train a neural network on some dataset, you also need to provide an optimizer. You can see the example to see how to add
grad processors.

#### Data provider
Another thing not explicitly included in the description file is how to provide the data for training. Actually we included this function from
`data_provider_mnist.py`. You can see it for detail. The high-level idea is that you need to provide an object called `DataFlow` in your function.
It is just a kind of generator from which we can get data.

#### Mainloop (`main_train`)
In this function, typically we first add some plugins to the trainer depending on our need, and then call `trainer.train`.

### Conclusion: a list of top-level functions / variables in a description file
+ `__envs__` used for environ setting
+ `make_network` used for computation graph building
+ `make_optimizer` used for setting optimizer
+ `make_dataflow_train` used for provide data for the trainer
+ `make_dataflow_inference` used for provide data for the inference plugin (e.g. it will be executed after every epoch to test the model on
the validation set)
+ `make_dataflow_demo` used for provide input data for the demo
+ `main_train` used to start the trainer, and register extensions for the trainer
+ `demo` used for demonstrate (typically show the image) the result
+ `main_demo` if this function is provided, `main_dataflow_demo` and `demo` will be ignored, you can run your own demo.

Finally, please feel free to check `scripts/train.py` and `scripts/demo.py` to see the detail. I promise they are simple and easy-to-read.


text:
# tmux

tmux is a process manager, normally quite difficult to use, we made ct as a easier to use front end for it.

```bash
ct tmux -h

  work with tmux

  Usage:

    ct tmux [cmd] [options]

  Options:

    -h, --help                       Show this help.

  Arguments:

    cmd      command to execute in the window

```

```bash
#will run cmd mc in session & window called default
ct tmux run 'mc'

#will run cmd mc in session & window called default
ct tmux run 'mc'

#will run cmd mc in session called test, the window is called 'mc'
ct tmux run 'mc' -n test -w mc

```

## stop

```bash
ct tmux stop -h

  stop a window or the fill session, if window not specified will kill the session

  Usage:

    ct tmux stop [options]

  Options:

    -n WORDS, --name=WORDS           Name of session [type:String] [default:""]
    -w WORDS, --window=WORDS         Name of window [type:String] [default:""]
```

> if not window or session specified, will kill all processes

## list

```bash
ct tmux list
```


text:
---
layout: post
title: "Base View Model in ASP.NET MVC"
description: "I needed to reference some user context variables from within my site master page that had some logic behind their retrieval. In this example I need to choose the display language for a user. Check cookie present indicating user's language prefere..."
date: 2010-11-08 00:00
comments: true
author: Adam
categories: [dev]
---

I needed to reference some user context variables from within my site master page that had some logic behind their retrieval.

In this example I need to choose the display language for a user.

Check cookie present indicating user's language preference

if not use HTTP language header

if not use the application default language

The pattern I've ended up using is to implement a base view model from which all my specific view models inherit as follows:

` `

` `

` `

public class BaseViewModel {
    public string UserLanguage
    {
       get
       {
           return HttpContext.Current.Request.Cookies["language"] != null
               ? HttpContext.Current.Request.Cookies["language"].Value
               : CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
        }
    }
}

I then use the generic class for the master page

`<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<BaseViewModel>" %>`

Which then allows me to reference the model in the master page and keep the logic for deciding the language to display centralised.

Not sure I'm wholly happy with the inheritance as it adds a level of dependencies which smells a bit off but in the small application I'm working in it was easy to implement and does what I need.

repository: adambird/adambird

extension: markdown

repo_name: adambird/adambird


text:
# 2015-loyalty-php

## Vagrant
This repo uses Vagrant for easy setup of a development environment.
Install Virtualbox and Vagrant, if you do not already have them.

### Basic Vagrant Commands
* Use `vagrant up` to start the virtual machine.
* Use `vagrant halt` to shut down the virtual machine.
* If you break your virtual machine, run `vagrant destroy` to remove it, and then `vagrant up` to recreate it.

After you have started the virtual machine, you can browse the site at: (http://<IP_ADDRESS>/).

### Other Useful commands
* `vagrant ssh -c 'composer_install'` Run this if the composer.json file changes.
* `vagrant ssh -c 'sudo tail -f /var/log/apache2/error.log'` Run this to see Apache/PHP errors in real time. Press `Ctrl-C` to stop.

gha_language: PHP


text:
# AvatarUnityPackageUrlObject

**Deprecation:** `Object` has unknown usage/fields, and is always empty. Use normal `Url` field instead.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**unityPackageUrl** | **String** |  |  [optional]

repository: GameKuchen/vrchatapi-java

repo_name: GameKuchen/vrchatapi-java


text:
# yalu103
incomplete iOS 10.3Betas jailbreak for 64 bit devices by qwertyoruiopz, marcograssi, and devapple (personal use)

## I am using Luca’s yalu code for my own use and will not release 10.2.x jailbreak of my own.

Please use the "Issues" tab for **code related** issues only. If you need support please search on [/r/jailbreak](https://reddit.com/r/jailbreak) before posting a question there.

## Supported Devices and iOS versions

| Device | Version | Other |
|---------|----------|---------|
| iPhone 7  | iOS 10.3Beta3 | KPP bypass |

### Planned Support:

In the near future, the jailbreak will support the following devices:

| Device | Version | Additions |
|---------|----------|----------|
| iPhone 6 | 10.3b3 | jb |
| iPhone SE | 10.3b3 | jb |
| iPhone 5S | 10.3b3 | jb |

**Note, the iPhone 7 is the only supported device on 10.3b3**
If you are already on iOS 10.3b with an any other device, **stay there**. The actual exploit behind this still works, but the KPP bypass does not.

## Warnings

This jailbreak is a work in progress. Some things do not work, but most things do.

Do not install things that are untested.

**AppSync and other unsupported and untested software will probably throw your device into a bootloop or do other bad things.** Do not open an issue complaining that your device has been bootlooped because you installed other software. You have been warned.

## Installing

This will be coming very soon!

| Version | Download |
|---------|----------|
| Beta 1 | Coming Soon |

## Substrate

On the iPhone 7 & Plus models the mobile substrate has been disabled due to a KPP misuse of function in the code, please respect this and do NOT get any repos that re-enable this, doing so may cause malfunction to your device.

license: Unlicense


text:
# ArrayWriter
Simple JavaScript class that writes the contents of an array to a webpage between specified tags.

This project was made to learn basic JavaScript and documentation practices. I would recommend using JQuery rather than base JavaScript.
## Documentation

### ArrayWriter
Class that writes the contents of an array to a webpage.

**Kind**: global class
**Author**: Michael Van Leeuwen<EMAIL_ADDRESS>
* [ArrayWriter](#ArrayWriter)
    * [new ArrayWriter(list)](#new_ArrayWriter_new)
    * [.list](#ArrayWriter+list) ⇒ Array
    * [.list](#ArrayWriter+list)
    * [.writeArray(startTag, endTag)](#ArrayWriter+writeArray)
    * [.writeArrayP()](#ArrayWriter+writeArrayP)
    * [.writeArrayClassP(eClass)](#ArrayWriter+writeArrayClassP)
    * [.writeArrayH(headerLevel)](#ArrayWriter+writeArrayH)
    * [.writeArrayClassH(headerLevel, eClass)](#ArrayWriter+writeArrayClassH)
    * [.writeArrayDiv()](#ArrayWriter+writeArrayDiv)
    * [.writeArrayClassDiv(eClass)](#ArrayWriter+writeArrayClassDiv)
    * [.writeArraySpan()](#ArrayWriter+writeArraySpan)
    * [.writeArrayClassSpan(eClass)](#ArrayWriter+writeArrayClassSpan)
    * [.writeArrayLI()](#ArrayWriter+writeArrayLI)
    * [.writeArrayClassLI(eClass)](#ArrayWriter+writeArrayClassLI)
    * [.writeArrayIDs(startTag, endTag, prefix)](#ArrayWriter+writeArrayIDs)
    * [.writeArrayConditional(startTagTrue, endTagTrue, startTagFalse, endTagFalse, boolFunction)](#ArrayWriter+writeArrayConditional)
    * [.writeArrayConditionalModifiable(startTagTrue, endTagTrue, startTagFalse, endTagFalse, boolFunction, modFuncTrue, modFuncFalse)](#ArrayWriter+writeArrayConditionalModifiable)

### new ArrayWriter(list)
Creates an instance of ArrayPrinter.

| Param | Type | Description |
| --- | --- | --- |
| list | Array | The desired array to fill the ArrayPrinter with. |

### arrayWriter.list ⇒ Array
Getter

**Kind**: instance property of [ArrayWriter](#ArrayWriter)
**Returns**: Array - The current array of this instance of ArrayWriter.

### arrayWriter.list
Setter

**Kind**: instance property of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| list | Array | The desired array to fill the ArrayPrinter with. |

### arrayWriter.writeArray(startTag, endTag)
Writes the contents of _list to the document between the entered tags.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| startTag | String | The desired start tag to write. |
| endTag | String | The desired end tag to write. |

### arrayWriter.writeArrayP()
Writes the contents of _list to the document in paragraph tags.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

### arrayWriter.writeArrayClassP(eClass)
Writes the contents of _list to the document in paragraph tags that are assigned to the specified class.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| eClass | String | The desired class to assign to all elements. |

### arrayWriter.writeArrayH(headerLevel)
Writes the contents of _list to the document in header tags at a specified level.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| headerLevel | Number | The desired header level to write (1-6). |

### arrayWriter.writeArrayClassH(headerLevel, eClass)
Writes the contents of _list to the document in header tags at a specified level that are assigned to the specified class.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| headerLevel | Number | The desired header level to write (1-6). |
| eClass | String | The desired class to assign to all elements. |

### arrayWriter.writeArrayDiv()
Writes the contents of _list to the document in divider tags.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

### arrayWriter.writeArrayClassDiv(eClass)
Writes the contents of _list to the document in divider tags that are assigned to the specified class.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| eClass | String | The desired class to assign to all elements. |

### arrayWriter.writeArraySpan()
Writes the contents of _list to the document in span tags.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

### arrayWriter.writeArrayClassSpan(eClass)
Writes the contents of _list to the document in span tags that are assigned to the specified class.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| eClass | String | The desired class to assign to all elements. |

### arrayWriter.writeArrayLI()
Writes the contents of _list to the document in list item tags.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

### arrayWriter.writeArrayClassLI(eClass)
Writes the contents of _list to the document in list item tags that are assigned to the specified class.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| eClass | String | The desired class to assign to all elements. |

### arrayWriter.writeArrayIDs(startTag, endTag, prefix)
Writes the contents of _list to the document between the entered tags in addition to adding an incrementing id based on the prefix. Removes last character of startTag under the assumption it's '>' in order to insert the id.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| startTag | String | The desired start tag to write. |
| endTag | String | The desired end tag to write. |
| prefix | String | The prefix for every element's id. |

### arrayWriter.writeArrayConditional(startTagTrue, endTagTrue, startTagFalse, endTagFalse, boolFunction)
Writes the contents of _list to to the document between two sets of entered tags determined by the evaluation of the passed boolean function for each element.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| startTagTrue | String | The desired start tag to write if the condition is true for the element. |
| endTagTrue | String | The desired end tag to write if the condition is true for the element. |
| startTagFalse | String | The desired start tag to write if the condition is false for the element. |
| endTagFalse | String | The desired end tag to write if the condition is false for the element. |
| boolFunction | function | The desired boolean function to be evaluated for each element. |

### arrayWriter.writeArrayConditionalModifiable(startTagTrue, endTagTrue, startTagFalse, endTagFalse, boolFunction, modFuncTrue, modFuncFalse)
Writes the contents of _list to to the document between two sets of entered tags determined by the evaluation of the pasModifies element based on the passed mod functions depending on the condition result for the element.

**Kind**: instance method of [ArrayWriter](#ArrayWriter)

| Param | Type | Description |
| --- | --- | --- |
| startTagTrue | String | The desired start tag to write if the condition is true for the element. |
| endTagTrue | String | The desired end tag to write if the condition is true for the element. |
| startTagFalse | String | The desired start tag to write if the condition is false for the element. |
| endTagFalse | String | The desired end tag to write if the condition is false for the element. |
| boolFunction | function | The desired boolean function to be evaluated for each element. |
| modFuncTrue | function | The desired function to modify element if the condition is true for the element. |
| modFuncFalse | function | The desired function to modify element if the condition is false for the element. |

## Usage
```JavaScript
<script src="https://rawgit.com/MJVL/ArrayWriter/master/arraywriter.js"></script>
```

repository: MJVL/ArrayWriter

repo_name: MJVL/ArrayWriter


text:
# Python in Tiny Places - An Introduction to IoT with MicroPython

Developing for microcontrollers was previously the domain of electrical engineers who used assembler and/or C/C++ with complicated toolchains and lengthy build processes. This changed radically with the introduction of Adruino, which radically simplified the coding and build process, and the provided a platform that made DIY electronics and prototyping accessible to a much wider audience. But you still had to learn to program in C/C++, which, while not terribly difficult, still presented a barrier for entry.

Python is one of the most popular languages, for good reason. It is clean and powerful, allowing developers to be very productive. Programmers get immediate feedback to their changes without having to wait for the code to compile and deploy. Need to quickly check if something would work as expected? Jump into the REPL, execute a few commands, and see their results immediately. What if you can have the power and simplicity of the Arduino platform, but with the rapid feedback loop and productivity of Python?

This is what MicroPython provides. In this course, we're going to learn about MicroPython, how to install it on Internet of Things (IoT) devices, see various development environment options, and build a working IoT application that transmits sensor readings over WiFi.

Let's get started!

- [Section 1- Intro and Setup](./section_1.md)

repository: cwirtanen/micropython-workshop

repo_name: cwirtanen/micropython-workshop


text:
# Hangman
Hangman is a simple guessing game.

### Tools
The game is made in Python. GUI is created with the standard GUI library for Python - Tkinter.

### How to play
Your goal is to guess the word. You try to guess it by clicking on letters. At the beginning you have 10 lives. The game ends when you fill in the whole word or lose all 10 lives.


text:
# BSMOTD Plus
Learn more about what's happening in the community! When you launch your game you're prompted with news posts from the community.

## Current Channels
* Modder News Central

## Wannabe News Providers
DM me (Auros#0001) on Discord to getting your news channel setup. It has to meet a certain standard.

## Other
There are no settings for this mod.

repository: Assistant/BSMOTD-Plus

repo_name: Assistant/BSMOTD-Plus


text:
---
title: Thought stream 20170328
layout: post
category: Stream
tags: [Software]
---
I faced a couple frustrating and complicated problems at work yesterday that left me feeling less than competant. Fortunately, I had the presence of mind to start working on my home coding project early enough in the evening to get a good two hours in--enough time to make significant leaps. OAuth should work in a couple days, and the base functionality for the tracker app will be done.

<!-- more -->

Additionally, I came to a conclusion on the morning bus that I'd like to put into words. I'm listening to Good to Great (Jim Collins) again and Jim recounted a conversation with Seth Godin that I will now butcher.

How do you make so much good content?

I also listened to an episode on Mixergy about an Arabic woman who found her voice by giving persuasion classes online. The less she sensored herself, the more free she was to let her real audience find her. I should have written it down yesterday becasue it wouldn't sound so scrambled, but I promise, my thoughts were clear.

And these are the actions that came out of the thought process:

  * Get rswhiting.com back up to date
  * Configure the blog to accept email submittals
  * Send all stream of concienous and story emails directly to the blog
  * Ask Becca nicely to proof them before publishing

The world appears to lack much honesty and transparency these days. Those qualities may come under fire, but people also tend to flock to individuals that express these things. I already create unpolished, honest content, why not put it out there for others to read.

Who knows? I may learn from it.


text:
# immudb-py [![License](https://img.shields.io/github/license/codenotary/immudb4j)](LICENSE)

[![CI](https://github.com/codenotary/immudb-py/actions/workflows/ci.yml/badge.svg)](https://github.com/codenotary/immudb-py/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/codenotary/immudb-py/badge.svg?branch=master)](https://coveralls.io/github/codenotary/immudb-py?branch=master)[![Slack](https://img.shields.io/badge/join%20slack-%23immutability-brightgreen.svg)](https://slack.vchain.us/)
[![Discuss at immudb@googlegroups.com](https://img.shields.io/badge/discuss-immudb%40googlegroups.com-blue.svg)](https://groups.google.com/group/immudb)

## Official [immudb] client for Python.

### Try it on the immudb Playground!

[![screenshot](playground.png)](https://play.codenotary.com)

[immudb]: https://immudb.io

## Contents

- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Supported Versions](#supported-versions)
- [Quickstart](#quickstart)
- [Step by step guide](#step-by-step-guide)
- [Creating a Client](#creating-a-client)

## Introduction

immu-py implements a [grpc] immudb client. A minimalist API is exposed for applications while cryptographic
verifications and state update protocol implementation are fully implemented by this client.
Latest validated immudb state may be kept in the local filesystem when using default `rootService`,
please read [immudb research paper] for details of how immutability is ensured by [immudb].

[grpc]: https://grpc.io/
[immudb research paper]: https://immudb.io/
[immudb]: https://immudb.io/

## Prerequisites

immu-py assumes there is an existing instance of the immudb server up and running.
Running `immudb` is quite simple, please refer to the
following link for downloading and running it: https://immudb.io/docs/quickstart.html

immudb-py requires python version 3.6 or greater.
If you are using 3.6, you'll need dataclasses package; on 3.7+,
dataclasses is part of the python distribution.

## Installation

You can install latest version cloning this repository, and then use the make command to install
prerequisites and the package itself:

```shell
    make init
    make install
```

Or, you can install latest stable version using pip:

```shell
    pip3 install immudb-py
```

Then, in you code, import the client library as as follows:

```python
    from immudb import ImmudbClient
```

*Note*: immudb-py need `grpcio` module from google. On Alpine linux, you need
 these packages in order to correctly build (and install) grpcio:
 - `linux-headers`
 - `python3-dev`
 - `g++`

## Supported Versions

immu-py supports the [latest immudb release].

[latest immudb release]: https://github.com/codenotary/immudb/releases/tag/v0.9.0

## Quickstart

[Hello Immutable World!] example can be found in `immudb-client-examples` repo.

[Hello Immutable World!]: https://github.com/codenotary/immudb-client-examples/tree/master/python

## Step by step guide

### Creating a Client

The following code snippets shows how to create a client.

Using default configuration:

```python
    client = ImmudbClient()
```

Setting `immudb` url and port:

```python

    client = ImmudbClient("mycustomurl:someport")
    client = ImmudbClient("<IP_ADDRESS>:8899")
```

### User sessions

Use `login` and `logout` methods to initiate and terminate user sessions:

```python
    client.login("usr1", "pwd1");

    // Interact with immudb using logged user

    client.logout();
```
### Encoding

Please note that, in order to provide maximum flexibility, all functions accept byte arrays as parameters.
Therefore, unicode strings must be properly encoded.
It is possible to store structured objects, but they must be serialized (e.g., with pickle or json).

### Creating a database

Creating a new database is quite simple:

```python
    client.createDatabase(b"db1");
```

### Setting the active database

Specify the active database with:

```python
    client.useDatabase(b"db1");
```
If not specified, the default databased used is "defaultdb".

### Traditional read and write

immudb provides read and write operations that behave as a traditional
key-value store i.e. no cryptographic verification is done. This operations
may be used when validations can be post-poned:

```python
    client.set(b"k123", b"value123");
    result = client.get(b"k123");
```

### Verified read and write

immudb provides built-in cryptographic verification for any entry. The client
implements the mathematical validations while the application uses as a traditional
read or write operation:

```python
    try:
        client.verifiedSet(b"k123", b"v123");
        results = client.verifiedGet(b"k123");
    Except VerificationException as e:
        # Do something
```

### Multi-key read and write

Transactional multi-key read and write operations are supported by immudb and immudb-py.
Atomic multi-key write (all entries are persisted or none):

```python
    normal_dictionary = {b"key1": b"value1", b"key2": b"value2"}
    client.setAll(normal_dictionary);
```

Atomic multi-key read (all entries are retrieved or none):

```python
    normal_dictionary = {b"key1": b"value1", b"key2": b"value2"}
    results_dictionary = client.getAll(normal_dictionary.keys())
    # Or manually
    client.get([b"key1", b"key2"])
```
## User management
Users can be added and granted access to databases.

### Adding a user
The ```createUser``` functions create a new users and grants the specified permission to a database.
```python
user='newuser'
password='Pw1:pasdfoiu'
permission=immudb.constants.PERMISSION_RW
database='defaultdb'

client.createUser(user, password, permission, database)
```

The database must exists at the time the user is created. The password must be between 8 and 32 characters in length, and must have at least one upper case letter, a symbol and a digit.

Permission are defined in immudb.constants and are:

- `PERMISSION_SYS_ADMIN`
- `PERMISSION_ADMIN`
- `PERMISSION_NONE`
- `PERMISSION_R`
- `PERMISSION_RW`

### Changin password
The user must must provide both old and new password:
```python
newPassword="pW1:a0s98d7gfy"
resp=client.changePassword(user, newPassword, oldPassword)
```
It is applied the same password policy of user creation.

### User list

To get the list of user created on immudb, simply call ```listUsers```:
```python
resp=client.listUsers()
print(users.userlist.users)
```

### Closing the client

To programatically close the connection with immudb server use the `shutdown` operation:

```python
    client.shutdown();
```

Note: after shutdown, a new client needs to be created to establish a new connection.

## State persistance

An important immudb feature is the ability for a client to check every transaction for tampering. In order to
be able to do that, it is necessary to persist client state (i.e., save it to disk) so that if some tampering
on the server happens between two runs, it is immediatly detected.

A `RootService` implements just that: it stores immudb client after every transaction, in order to be able to
use it afterward to check the server correctness.

### Using the Persistent Root Service

The default RootService, for simplicity, commits the state to RAM, and so it is unsuitable for real time safe
application. To have persistance, the application must instantiate a `PersistentRootService` object, which stores
its state to disk.

Let's see a simple example that uses state persistance:

```python
from immudb.client import ImmudbClient, PersistentRootService
client=ImmudbClient(rs=PersistentRootService())
client.login(username="immudb", password="immudb")
client.verifiedTxById(42)
client.verifiedGet(b"example")
```

In this example, the Root Service is saved to the disk after every verified transaction. As you can see, it is very
easy to use. Just create and use the PersistentRootService object in the client initialization.

### Process and threads

Please keep in mind that the implementation is not thread/process safe. If you are using a multi-process application,
it is advisable to use a different state file for every instance: just pass the filename as argument to the
PersistentRootService constructor:

```python
client = ImmudbClient(rs=PersistentRootService("rootfilename"))
```

Default rootfile is "~/.immudbRoot"

If needed/wanted, it is also easy to extend the default implementation adding synchronization primitives to the get/set methods.
In this way, more than one immudb client can share the same PersistentRootService instance without interering each other.

## Cryptographic state signing

To increase safety, it is possible to generate a private key and use it to sign every verification response. Clients can
then use the corresponding public key to check for response correctness.

### Key generation
You can use `openssl` to create a private key, and then extract the public key:
```sh
openssl ecparam -name prime256v1 -genkey -noout -out private_signing_key.pem
openssl ec -in private_signing_key.pem -pubout -out public_signing_key.pem
```

### Key usage (server side)
On immudb server, use `--signingKey private_signing_key.pem` to activate cryptographic signature.

### Key usage (client/SDK side)

On immudb python SDK, just pass the public key filename to the ImmudbClient constructor:
```python
client=ImmudbClient(publicKeyFile="/certs/public_signing_key.pem")
```
Every transaction will be then automatically checked. An exception is thrown if the cryptographic check fails.

## Contributing

We welcome contributions. Feel free to join the team!

To report bugs or get help, use [GitHub's issues].

[GitHub's issues]: https://github.com/codenotary/immudb-py/issues

repository: sasha-tkachev/immudb-py

repo_name: sasha-tkachev/immudb-py


text:
# Hill climber and Simulated annealing

## Introduction
This repository contains the implementation of the first two De Jong's functions - function 1 & 2 that are used to compare the performance of two Artificial Intelligence algorithms - Simulated Annealing and Hill Climber.

## Simulated annealing
Simulated Annealing is one of the probabilistic methods to search for global optimum (i.e. minimum and maximum values) of a given function. Simulated Annealing is often used when time of finding a value is more important than precision of a result.
During each iteration Simulated Annealing algorithm decides between staying in a state S, or moving to its neighbour S’. In most common implementations, this step is repeated until either:

1.	The state S is the best solution (either the best maximum or minimum of a function), or
2.	Computation budget (energy) has been fully used.

Paradoxically, Simulated Annealing accepts a better neighbour to find higher/lower value of a function, but it can lead to finding the best local optima, rather than global optima.
To overcome this issue, metaheuristics can also accept worse neighbour to discover other values and to avoid being stuck in local optima, doing so can potentially lead to finding global optima if run for a long enough time.
Probability whether transition from position S to position S’ will be made is defined by a function called Acceptance Probability Function (APF) that depends on the energy of movement to position S and S’ and global variable called Temperature. States that requires less energy to move to are considered better than those with greater energy required for transition. Although, even if energy required to move to state S is less than energy required to move to state S’ the APF needs to be greater than 0 – this will prevent from being stuck in local optima.

## Running the program
1.	Navigate into src/ folder
2.	javac Main.java
3.	java Main


text:
# IMPLEMENTATION
Users can get a ICapPublisher interface from the ASP.NET Core DI container to publish a message .It is initialized by  configurations in the `ConfigureServices` and `configure` method in the Startup.cs file,just like the way to initialize a `MiddleWare` in ASP.NET Core.

## Message Table

After initialized, CAP will create two tables in the client side,they are `Cap.Published` and `Cap.Received`. Please noted that different databases may deal letter case differently,if you do not explicitly specify the Schema or the TableName Prefix before project startup,the default names are the ones mentioned above.

**Cap.Published**：Used to store  messages(Published by the `ICapPublisher` service) that CAP published to the MQ(Message Queue)Client side

**Cap.Received**:Used to Store messages(subscribed by the `CapSubscribe[]`) subscribed by the MQ(message Queue) client side that CAP received.

> Before version 2.2 ：
 **Cap.Queue**：A temporary table that CAP used to deal with published and received messages,under most circumstances(there aren't any errors),it is an empty table.

Both `Published` and `Received` tables have a `StatusName` field,which is used to mark the status of the current message.Until now it has `Scheduled`，`Successed` and `Failed` statuses.

> Statuses before version 2.2：`Scheduled`，`Enqueued`，`Processing`，`Successed` and `Failed`.

In the process of dealing with messages,CAP will change the status from `Scheduled` to `Successed`(or `Failed` ).if the final status is `Successed`,it means that the message is sent to MQ successfully,and `Failed` means the message is failed to sent to MQ.

Version later than 2.2,  CAP will retry after 4 minutes if the status is `Scheduled` or `Failed`,the retry interval is default to 60 seconds.You can change it by modify `FailedRetryInterval` in `CapOptions`.

>Before version 2.2,CAP retry  100 times for `Failed` messages by default.

## Message format

CAP use JSON to transfer message,the following is CAP's messaging object model:

NAME | DESCRIPTION | TYPE
:---|:---|:---
Id | Message Id | int
Version | Message Version | string
Name | Name | string
Content | Content | string
Group | Group a message belongs to | string
Added |add time | DateTime
ExpiresAt | expire time | DateTime
Retries | retry times | int
StatusName | Status Name | string

>for `Cap.Received`,there is an extra `Group` filed to mark which group the mesage belongs to.

>for the `Content` property CAP will use a Messsage object to wrap all the contents.The following shows details of the Message Object:

NAME | DESCRIPTION | TYPE
:---|:---|:---
Id | Generated by CAP | string
Timestamp | message create time | string
Content | content | string
CallbackName | the subscriber which is used to call back | string

CAP use the same algorithms as MongoDB ObjectId's distributed Id  generation algorithms.

## EventBus

EventBus adopt the publish-subscribe messaging style to communicate with different components,and there is no need to register it in component explicitly.

![](http://images2017.cnblogs.com/blog/250417/201708/250417-20170804153901240-1774287236.png)

the diagram in the above link shows Eventbus's event flowchart,about EventBus,users can refer to other meterials to learn about it.

We say that CAP implement all the features in Eventbus,EventBus has two features:publish and subscribe,In CAP we implement them in an elegant way.Besides,CAP also has two very robust feature,they are message persistence and messaging reliability under any circumstances,But EventBus don't have such features.

![](https://camo.githubusercontent.com/452505edb71d41f2c1bd18907275b76291621e46/687474703a2f2f696d61676573323031352e636e626c6f67732e636f6d2f626c6f672f3235303431372f3230313730372f3235303431372d32303137303730353137353832373132382d313230333239313436392e706e67)

In CAP,send a message can be regarded as an "Event",When CAP is used in an ASP.NET Core applicaiton,the application has the ablity to publish as well as receive messages.

## Retry

Retry plays a very important role in CAP's infrastructure,CAP will retry for Failed messages.CAP has the following retry  strategies:

**1、 Retry on sending**

in the process of sending a message,when the Broker crashed or connection failed or exceptions are thrown,CAP will retry,it will retry 3 times for the first time,if still failed,then it will retry every 1 minute,the retry the retry count +1,when the retry count come to 50,CAP will not retry any more.

>You can modify `FailedRetryCount` in `CapOptions` to change the default retry count.

As metioned above,when the retry count comes to a certain number,CAP will not retry anymore,this time,you can find out the fail reason in the Dashboard and they deal with it manually.

**2、 Retry on Consuming**

When consumer received messages,specified method in the consumer will be executed,if exceptions are thrown during this course,CAP will retry,the retry  strategy is the same as above `Retry on sending`.

## Data clean out

table to store messages in database has an `ExpiresAt` field to mark the expiration time of the message. CAP will set `ExpiresAt` value as **1 hour** for  `Successed` messages and **15days** for `Failed` messages.

To avoid performance slow down caused by a large amount of data,CAP will delete expired data every hour by default,the deletion rule is that `ExpiresAt` field's value isn't null and samller than current time.That is, `Failed` messages(it has been retried  50 times by default),if you do not deal with it manually,will also be deleted after 15 days as well,you have to pay attention to it.


text:
# what-food

> Live at [what-food.surge.sh](https://what-food.surge.sh)!

Determine what food is in a given picture. Inspired by [Silcon Valley](https://www.youtube.com/watch?v=ACmydtFDTGs).

## How?

Using Microsoft's [customvision.ai](https://customvision.ai) service.

1) Train a customvision project on some food types (I used [these images](./ai_training))
2) Configure [bengreenier/customvision-micro](https://github.com/bengreenier/customvision-micro) and run/host it
3) Change `myPredictionServiceUrl` in [this search query](https://github.com/bengreenier/what-food/search?utf8=%E2%9C%93&q=myPredictionServiceUrl)
4) Run (`npm start`) or host (`npm run-script build && copy build/ your-location/`) this frontend
5) Use!

## Why?

Because the show Silicon Valley is awesome, and I recently joined the [PCT](https://github.com/catalystcode) team who specializes
in solving tricky problems, often with Microsoft tech. This project was a way to learn some new skills (customvision, react)
and make something pretty cool in the process.

## License

MIT

repository: bengreenier-archive/what-food

repo_name: bengreenier-archive/what-food


text:
YuMi Scheduler+ - A Dual Arm Robot Assembly Scheduler and Workspace Designer

A scheduler to manage a multi tool dual arm robot.

Due to workspace data and assumptions on tool configuration it is a ABB YuMi that is used, but the model is otherwise not bound to any specific robot.
It
* Assigns tasks agents,
* Orders task on agents,
* Assigns start/wait/end times,
* Assigns task locations

This model requires the user to install the MiniZinc compiler, which provides the Constraint Programming solver Gecode, which is the default solver for this project.
MiniZinc is developed at Monash University in collaboration with Data61 Decision Sciences.

## Table of Contents

* [About the Project](#about-the-project)
* [Regarding MiniZinc Challenge](#regarding-minizinc-challenge)
* [Getting Started](#getting-started)
  * [Installation](#installation-of-solver)
  * [Running Example](#running-example)
  * [Generating Assembly Instance Data Files Using Python](#generating-assembly-instance-data-files-using-python)
* [General Usage](#general-usage)
* [Running Tests](#running-tests)
* [Contact](#contact)

## About The Project

It is developed as a part of Johan Ludde Wessén's PhD project at KTH and ABB.

You can use the code by providing it with data files on the appropriate format.
It is also possible to extend the models with new and/or alternative model files.

The choice of modeling language allows for use of many different solvers distributed over many solving technologies, such as Constraint Programming, (Mixed) Integer Programming, SAT, and of course combinations thereof.

The model have been tested using the default solver "Gecode".
To use any other solver backend than Gecode, one must remove the "include "gecode.mzn";" line in the YuMiScheduler.mzn file.

## Regarding MiniZinc Challenge

If you would like this model properly annotated for MiniZinc challenge, and unnecessary python scripts removed, please use the sub-folder [minizinc-challenge](https://github.com/LuddeWessen/assembly-robot-manager-minizinc/tree/main/minizinc-challenge)

## Getting Started

To use the YuMiScheduler follow these simple steps.

### Installation of Solver

The recommended way to install _MiniZinc_ is by the use of the bundled binary
packages. These packages are available for machines running Linux, Mac, and
Windows.

The latest release can be found on [the MiniZinc
website](http://www.minizinc.org/software.html).

Once the MiniZinc bundle is installed on your machine, you can start using it.
For the FleetManager to work you need to have the `minizinc` executable available on your path.

### Running Example

Static collision avoidance:
 - With the `minizinc` executable available on your path: run `minizinc --solver Gecode YuMiScheduler.mzn collision_avoidance_resource_zones.mzn instance_data/example_instance_4_GS_SG.dzn robot_cell_data/yumi_grid_setup_3_3.dzn robot_cell_data/yumi_grid_setup_3_3_zones.dzn -s -a
`

Dynamic (spatio-temporal) collision avoidance:
- With the `minizinc` executable available on your path: run `minizinc --solver Gecode YuMiScheduler.mzn collision_avoidance_static_linear.mzn instance_data/example_instance_4_GS_SG.dzn robot_cell_data/yumi_grid_setup_3_3.dzn -s -a
`

### Generating Assembly Instance Data Files Using Python

To generate data files use the "problem_instance_generator.py" script in the "instance_data" folder as a template. Or simply run the script as-is to get the data files encoded within.

## General Usage

Any MiniZinc model needs model file (ends with .mzn). Typically we separate the data instances and put that into data files (ends with .dzn).

The combination `--solver Gecode` tells minizinc to use Gecode as solver.
The flags `-s` and `-a` tells the solver to output statistics after finishing the computations, and output all solutions, respectively.

There are many options to be found in the MiniZinc handbok, but a particularly useful command is `-t time-in-milliseconds` for instances when we cannot wait for all solutions.

### Model Files, or Model Modules

We separate the model into separate files, as we see these as separable modules. We hope to create alternatives to the last modules depending on assumptions during development.
The next to last is a separable module defining constraint on the locations, as there will be _some_ constraints on locations depending on the tasks.

In this case, we have separated the model into the following files, or modules:
* `YuMiScheduler.mzn` is the core model
* `collision_avoidance_static_linear.mzn` models collision avoidance by statically dividing the workspace, assigning each division to an arm
* `collision_avoidance_resource_zones.mzn` models collision avoidance as spatio-temporally booking (scheduling) of user provided zones, by the arms.

### Data Files

In the example we have separated the data into several files:
* `instance_data/*.dzn` - the assembly instance, i.e. definition of what to be done
* `workspace_data/XYZ.dzn` and `workspace_data/XYZ_zones.dzn`, where XYZ is the workspace generated separately.
* `workspace_data/XYZ_zones.dzn`, collision information of zones of the workspace generated separately. This is only needed if using the spatio-temporal collision avoidance model.

## Running Tests

We have not designed tests for the python code. This work for the future.

## Contact

🏛 Website: [https://www.kth.se/profile/jlwessen](https://www.kth.se/profile/jlwessen)


text:
# google-photos-vue

[Google Photos](https://www.google.com/photos/about/) album viewer built with [Vue.js](https://vuejs.org/).

## Features

### Formats

#### Photo

![Photo Format](https://i.imgur.com/tEYvtKb.png)

Conventional grid.

#### Text

![Text Format](https://i.imgur.com/dTq6KLU.png)

Justified layout highlighting the "quoted" word (i.e. theme) in each photo description.

### Contexts

#### Authenticated

The default state initializes [`gapi`](https://github.com/google/google-api-javascript-client). Once authenticated, the
user can select one of their albums, and its full contents is loaded.

#### Unauthenticated

[Vuex](https://vuex.vuejs.org/) application state JSON is exposed in the authenticated context. The state is modified
with relative base URLs that are compatible with the naming conventions of page assets when saved via Google Chrome.

When downloaded, served, and configured, i.e.

```html
<div id="app" data-external-state-path="365-2019-state.json"></div>
```

the Vue.js application functions in an unauthenticated context, initialized with this static state.

A working example of this context can be seen in the
[`gh-pages-src`](https://github.com/namoscato/google-photos-vue/compare/gh-pages-src) branch, which is built and served
via GitHub Pages.

### Analytics

Media clicks are instrumented with [Google Analytics Events](https://support.google.com/analytics/answer/1033068)
when configured.

## Usage

1. [Setup Google OAuth 2.0](https://support.google.com/googleapi/answer/6158849) and include your Client ID in
[`main.ts`](src/main.ts).

2. Optionally [setup Google Analytics](https://support.google.com/analytics/answer/1008080) and include your ID in
[`main.ts`](src/main.ts).

3. Build the application via:

    ```
    npm run serve
    ```

    or other [Vue CLI](https://cli.vuejs.org/guide/cli-service.html) commands.

repository: namoscato/google-photos-vue

gha_language: Vue

repo_name: namoscato/google-photos-vue


text:
# Effect of the Exposure Time in Laser Speckle Imaging for Improving Blood Vessels Localization: a Wavelet Approach

This repository has the functions to implement the methods described in the conference article:
[*"Effect of the Exposure Time in Laser Speckle Imaging for Improving Blood Vessels Localization: a Wavelet Approach"*](https://ieeexplore.ieee.org/abstract/document/9129242), developed as part of the project *"Visualization and localization of blood vessels"* at [INAOE](https://www.inaoep.mx).

## Abstract

The visualization and localization of blood vessels in Laser Speckle Contrast Imaging is an important task to determine the presence of blood vessels in the biological tissue. However, Laser Speckle Contrast Imaging has some drawbacks when the depth of the blood vessels increases. This work establishes a methodology based on a wavelet approach to improve the localization of blood vessels in *in-vitro* contrast images. It also determines a useful exposure time to improve the localization of blood vessels. The results show that the wavelet approach allows blood vessels to be located up to 510µm deep under a skin phantom. In addition, it states that high exposure times increase the percentage of similarity in traditional models and visualization enhancement models.

[[Paper]](https://ieeexplore.ieee.org/document/9129242)
[[Keynote]](https://www.researchgate.net/publication/341626117_Effect_of_the_Exposure_Time_in_Laser_Speckle_Imaging_for_Improving_Blood_Vessels_Localization_a_Wavelet_Approach)

## Contents

* [`f_i2mtc2020.m`](https://github.com/friscolt/i2mtc-2020/blob/master/f_i2mtc2020.m) -  Matlab script. The script  `f_i2mtc2020.m` contains 1 main function (`f_i2mtc2020`) and four auxiliary functions ( `f_skavg`, `f_denoising`, `f_clustering`, `f_randindex`) to implement the methods described in [this paper](https://ieeexplore.ieee.org/document/9129242).

* [`data.mat`](https://github.com/friscolt/i2mtc-2020/blob/master/data.mat) - MAT file. It contains a cell with two fields.
  *  `img`, contains a package of 30 *in-vitro* speckle images of a straight vessel at a depth of 0µm. The image is a 445x461x30 grayscale matrix.
  *  `gt`, contains the ground truth of the *in-vitro* speckle image of a straight vessel. The image is a 445x461 pixel logical type matrix.

* [`demo.mlx`](https://github.com/friscolt/i2mtc-2020/blob/master/main.mlx) - Matlab live script. It contains an example of the image processing available in [`data.mat`](https://github.com/friscolt/i2mtc-2020/blob/master/data.mat). This live script describes step by step the use of the auxiliary functions described in [`f_i2mtc2020.m`](https://github.com/friscolt/i2mtc-2020/blob/master/f_i2mtc2020.m)

## Organization

No additional content directories are declared.

## Contributors

Code for algorithms, applications and tools contributed by:

[F. Lopez-Tiro](https://scholar.google.es/citations?user=IlG06bYAAAAJ&hl=es), [H. Peregrina-Barreto](https://scholar.google.es/citations?user=Wh2blp0AAAAJ&hl=es), [J. Rangel-Magdaleno](https://scholar.google.es/citations?user=aBNkfEsAAAAJ&hl=es), [J. M. Ramirez-Cortes](https://scholar.google.es/citations?user=QzevLU0AAAAJ&hl=es), and [J. C. Ramirez-San-Juan](https://scholar.google.es/citations?user=xN03bqgAAAAJ&hl=es)

Please email us your comments, criticism, and questions at [`francisco.lopez@inaoe.mx`](mailto:francisco.lopez@inaoe.com?subject=[GitHub]%20i2mtc2020%20repository)

## Reference

If you use functions from this script in your work, please use the BibTex entry below for citation.

[[Paper]](https://ieeexplore.ieee.org/abstract/document/9129242)

```
@INPROCEEDINGS{9129242,
  author={F. {Lopez-Tiro} and H. {Peregrina-Barreto} and J. {Rangel-Magdaleno} and J. C. {Ramirez-San-Juan} and J. M. {Ramirez-Cortes}},
  booktitle={2020 IEEE International Instrumentation and Measurement Technology Conference (I2MTC)},
  title={Effect of the Exposure Time in Laser Speckle Imaging for Improving Blood Vessels Localization: a Wavelet Approach},
  year={2020},
  volume={},
  number={},
  pages={1-6},
  doi={10.1109/I2MTC43012.2020.9129242}}
```


text:
# co-mo-io [![DOI](https://zenodo.org/badge/368562780.svg)](https://zenodo.org/badge/latestdoi/368562780)

The effect of co-morbidities on immunotherapy response.

Analyses and visualizations to support the manuscript:

## Association of Medical Comorbidities and Cardiovascular Disease with Toxicity and Survival among Patients Receiving Checkpoint Inhibitor Immunotherapy

_Andrew C. Johns, M.D., Mike Yang, B.S., Lai Wei, Ph.D., Madison Grogan, B.A., Sandipkumar H. Pate, MBBS, Mingjia Li, M.D., Marium Husain, M.D., Kari L. Kendra, M.D., Ph.D., Gregory A. Otterson, M.D., Jarred T. Burkart, M.D., Daniel Spakowicz, Ph.D., Rebecca Hoyd, B.S., Dwight H. Owen, M.D., Carolyn J. Presley, M.D., M.H.S._

repository: spakowiczlab/co-mo-io

repo_name: spakowiczlab/co-mo-io


text:
# platform-qemu-cortex-m7f

Support files for building application to run on the QEMU "mps2-an500"
emulated board.

## Include folders

The following folders should be passed to the compiler during the build:

- none

## Source files

The source files to be added to user projects are:

- none

## Memory range

The applications are built for the following memory range:

- FLASH: 0x0000_0000-0x007F_FFFF (8 MB)
- RAM: 0x2000_0000-0x207F_FFFF (8 MB)
- HEAP: 0x6000_0000-0x60FF_FFFF (16 MB)
- stack: 0x6100_0000

The heap and stack are set automatically in `_startup()` to the values
returned by `SEMIHOSTING_SYS_HEAPINFO`.

## QEMU invocation

To run tests, pass the ELF file and the arguments:

```sh
qemu-system-arm --machine mps2-an500 --cpu cortex-m7 --nographic -d unimp,guest_errors --kernel "unit-test.elf" --semihosting-config enable=on,target=native,arg=test
```

For debug sessions start QEMU in GDB server mode by passing both `-s -S`:

```sh
qemu-system-arm --machine mps2-an500 --cpu cortex-m7 --nographic -d unimp,guest_errors -s -S --semihosting-config enable=on,target=native,arg=test
```

## Links

- [QEMU Arm](https://www.qemu.org/docs/master/system/target-arm.html)
- [virt](https://www.qemu.org/docs/master/system/arm/virt.html)

repository: micro-os-plus/micro-os-plus-iii

branch_name: refs/heads/xpack

repo_name: micro-os-plus/micro-os-plus-iii


text:
---
title: Clonliffe Harriers 2 Mile Road Race
location: Glasnevin
redirect_from:
  - /race/Clonliffe-Harriers-2-Mile-Road-Race/188/
---

| Category | Athlete             | Time    |
|:---------|:--------------------|:--------|
| M50      | Tom O'Connor        | 10m 08s |
| M        | Andy Nason          | 10m 10s |
| M35      | Ciaran Reilly       | 10m 15s |
| M        | Diarmaid O'Sullivan | 10m 17s |
| M45      | Gerry Daly          | 10m 24s |
| M        | Ray Boyle           | 10m 51s |
| M40      | Paul Balfe          | 11m 02s |
| M45      | Tony Dunne          | 11m 30s |
| F45      | Mairead Murphy      | 12m 00s |
| F35      | Lena Sinclair       | 12m 05s |
| M        | Jonathan Mullervy   | 12m 09s |
| M55      | Joe Cooper          | 12m 39s |
| M        | Aonghus Crean       | 12m 47s |
| M45      | Jimmy Monaghan      | 12m 56s |
| F35      | Christine Roche     | 12m 59s |
| M55      | Frank Novell        | 13m 07s |
| F        | Marj O'Connor       | 13m 14s |
| M60      | Paddy Reilly        | 13m 25s |
| F55      | Una Reilly          | 13m 27s |
| F40      | Linda Spratt        | 13m 28s |
| F        | Ger Feely           | 13m 29s |
| F        | Ciara O'Riordan     | 13m 51s |
| F45      | Hilary McDonnell    | 16m 22s |


text:
# Lab 16: AWS Cloud Servers

Deploy a Node.js server to AWS EC2

## Author: Carly Dekock

### Link to GitHub [repository](https://github.com/carlydekock/cloud-server.git)
### Link to PR [here](https://github.com/carlydekock/cloud-server/pull/1)

## Deployed Links
- GUI deployed server [here](http://testcloudserver-env.eba-tpuz2ds7.us-west-2.elasticbeanstalk.com/)
- CLI deployed server [here](http://cloud-server-env.eba-zyxidcat.us-west-2.elasticbeanstalk.com/)

## Processes
- Ensure you have AWS account
- Ensure you have access keys

### GUI deployed server
- Ensure repo has server setup but has no database
- PORT is set in .env file
- Zip all files together for application, except package-lock.json and node_modules folder
- In Elastic Beanstalk console - create new application
- Select create new application
- Give the application a name
- Select platform: Node.js
- Select upload your code, and upload the zipped file

### CLI deploy
- Ensure repo has server setup but has no database
- PORT is set in .env file
- In the terminal, run ```eb init```
- Select all relevant prompts
- Run the command ```eb create <env-name>```
- Run the command ```eb deploy```

## Credits and Collaborators
- Worked at lab table with Jason D, Jason Q, Nick M, and Seid
- Help from Jacob on GUI deployed server

repository: carlydekock/cloud-server

gha_language: JavaScript

repo_name: carlydekock/cloud-server


text:
---
layout: default
show_blog: false
---
What is the Corionis Service Manager?

The Corionis Service Manager (CSM) is a small Windows tray application that
monitors and manages a list of user-selected Windows services. The selected
services may be started, stopped, the start-up type changed, etc.

Most people who regularly monitor and manage Windows services are only
interested in a few. Because CSM is a Windows tray app it is always
available. The utility may be popped up or down by double-clicking the
tray icon. Notifications are displayed and logged when a
selected service's state changes.

Features

 * Monitors and manages a list of user-selected Windows services.
 * Monitored services may be reordered on the Monitor tab with drag 'n drop.
 * Monitored service names may be edited.
 * Monitor and Select lists have sortable columns.
 * Select tab shows all Windows services available on the system.
 * Logs running status changes of selected services.
 * Optional logging to a file.
 * Auto-updater.
 * Minify button to hide the menu and tabs, **new in release 2020.2.**


text:
---
title: ToCSS
linkTitle: Transpile Sass to CSS
description: Transpile Sass to CSS.
categories: [asset management]
keywords: []
menu:
  docs:
    parent: hugo-pipes
    weight: 30
weight: 30
signature: ["resources.ToCSS RESOURCE [OPTIONS]", "toCSS RESOURCE [OPTIONS]"]
toc: true
aliases: [/hugo-pipes/transform-to-css/]
---

## Usage

Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended edition, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.

```go-html-template
{{ $options := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
```

Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.

[scss]: https://sass-lang.com/documentation/syntax#scss
[indented]: https://sass-lang.com/documentation/syntax#the-indented-syntax

## Options

transpiler
: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.

targetPath
: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.

vars {{< new-in "0.109.0" >}}
: (`map`) A map of key/value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/).

```scss
// LibSass
@import "hugo:vars";

// Dart Sass
@use "hugo:vars" as v;
```

outputStyle
: (`string`) Output styles available to LibSass include `nested` (default), `expanded`, `compact`, and `compressed`. Output styles available to Dart Sass include `expanded` (default) and `compressed`.

precision
: (`int`) Precision of floating point math. Not applicable to Dart Sass.

enableSourceMap
: (`bool`) If `true`, generates a source map.

sourceMapIncludeSources {{< new-in "0.108.0" >}}
: (`bool`) If `true`, embeds sources in the generated source map. Not applicable to LibSass.

includePaths
: (`slice`) A slice of paths, relative to the project root, that the transpiler will use when resolving `@use` and `@import` statements.

```go-html-template
{{ $options := dict
  "transpiler" "dartsass"
  "targetPath" "css/style.css"
  "vars" site.Params.styles
  "enableSourceMap" (not hugo.IsProduction)
  "includePaths" (slice "node_modules/bootstrap/scss")
}}
{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
```

## Dart Sass

The extended version of Hugo includes [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].

Use the latest features of the Sass language by installing Dart Sass in your development and production environments.

### Installation overview

Dart Sass is compatible with Hugo v0.114.0 and later.

If you have been using Embedded Dart Sass[^1] with Hugo v0.113.0 and earlier, uninstall Embedded Dart Sass, then install Dart Sass. If you have installed both, Hugo will use Dart Sass.

If you install Hugo as a [Snap package] there is no need to install Dart Sass. The Hugo Snap package includes Dart Sass.

[^1]: In 2023, the Sass team deprecated Embedded Dart Sass in favor of Dart Sass.

### Installing in a development environment

When you install Dart Sass somewhere in your PATH, Hugo will find it.

OS|Package manager|Site|Installation
:--|:--|:--|:--
Linux|Homebrew|[brew.sh]|`brew install sass/sass/sass`
Linux|Snap|[snapcraft.io]|`sudo snap install dart-sass`
macOS|Homebrew|[brew.sh]|`brew install sass/sass/sass`
Windows|Chocolatey|[chocolatey.org]|`choco install sass`
Windows|Scoop|[scoop.sh]|`scoop install sass`

You may also install [prebuilt binaries] for Linux, macOS, and Windows.

Run `hugo env` to list the active transpilers.

### Installing in a production environment

For [CI/CD] deployments (e.g., GitHub Pages, GitLab Pages, Netlify, etc.) you must edit the workflow to install Dart Sass before Hugo builds the site[^2]. Some providers allow you to use one of the package managers above, or you can download and extract one of the prebuilt binaries.

[^2]: You do not have to do this if (a) you have not modified the assets cache location, and (b) you have not set `useResourceCacheWhen` to `never` in your [site configuration], and (c) you add and commit your resources directory to your repository.

#### GitHub Pages

To install Dart Sass for your builds on GitHub Pages, add this step to the GitHub Pages workflow file:

```yaml
- name: Install Dart Sass
  run: sudo snap install dart-sass
```

If you are using GitHub Pages for the first time with your repository, GitHub provides a [starter workflow] for Hugo that includes Dart Sass. This is the simplest way to get started.

#### GitLab Pages

To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file should look something like this:

```yaml
variables:
  HUGO_VERSION: 0.115.1
  DART_SASS_VERSION: 1.63.6
  GIT_DEPTH: 0
  GIT_STRATEGY: clone
  GIT_SUBMODULE_STRATEGY: recursive
  TZ: America/Los_Angeles
image:
  name: golang:1.20-buster
pages:
  script:
    # Install Dart Sass
    - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
    - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
    - cp -r dart-sass/* /usr/local/bin
    - rm -rf dart-sass*
    # Install Hugo
    - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
    - apt install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
    - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
    # Build
    - hugo --gc --minify
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
```

#### Netlify

To install Dart Sass for your builds on Netlify, the `netlify.toml` file should look something like this:

```toml
[build.environment]
HUGO_VERSION = "0.115.1"
DART_SASS_VERSION = "1.63.6"
TZ = "America/Los_Angeles"

[build]
publish = "public"
command = """\
  curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
  tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
  rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
  export PATH=/opt/build/repo/dart-sass:$PATH && \
  hugo --gc --minify \
  """
```

### Example

To transpile with Dart Sass, set `transpiler` to `dartsass` in the options map passed to `resources.ToCSS`. For example:

```go-html-template
{{ $options := dict "transpiler" "dartsass" "targetPath" "css/style.css" }}
{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
```

### Miscellaneous

If you build Hugo from source and run `mage test -v`, the test will fail if you install Dart Sass as a Snap package. This is due to the Snap package's strict confinement model.

[brew.sh]: https://brew.sh/
[chocolatey.org]: https://community.chocolatey.org/packages/sass
[ci/cd]: https://en.wikipedia.org/wiki/CI/CD
[dart sass]: https://sass-lang.com/dart-sass
[libsass]: https://sass-lang.com/libsass
[prebuilt binaries]: https://github.com/sass/dart-sass/releases/latest
[scoop.sh]: https://scoop.sh/#/apps?q=sass
[site configuration]: /getting-started/configuration/#configure-build
[snap package]: /installation/linux/#snap
[snapcraft.io]: https://snapcraft.io/dart-sass
[starter workflow]: https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml

repository: bep/hugo

gha_language: Go

repo_name: bep/hugo


text:
---
layout: default
---

# 1995-08-01 - Re: a hole in PGP

## Header Data

From<EMAIL_ADDRESS>(Bill Stewart)

To: "J. R. Valverde (EMBL Outstation: the EBI)"<EMAIL_ADDRESS>Message Hash: b574c26422610acb0d5b12dbce43a286f3437608f381f97d453893072275db43

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-08-01 21:50:17 UTC

Raw Date: Tue, 1 Aug 95 14:50:17 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Bill Stewart)
Date: Tue, 1 Aug 95 14:50:17 PDT
To: "J. R. Valverde (EMBL Outstation: the EBI)"<EMAIL_ADDRESS>Subject: Re: a hole in PGP
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>	Now, my knowledge, time and resources are limited. I see that MIT
>or whomever has made a program that, under test, is more secure than my
>XOR 00000000 implementation. I may not fully trust them but it is better
>than anything I could come out with.

Foo.  Clipper is better than anything I could come up with from scratch,
and it's provably untrustable.  (I could easily build better stuff out of
existing pieces like DES and IDEA, but that's a separate issue.)
Even Enigma's pretty strong, and look what it got its users...
Some of Dr. Fred's distrust is well-founded.

DES is also pretty good, and it's looking less and less likely that there's
a secret NSA backdoor in it (other than differential cryptanalysis
and maybe linear cryptanalysis), but it and IDEA and MD5 fundamentally depend on
messiness and obscurity for their security (plus elimination of obvious holes.)
Maybe the authors of IDEA are paid by the same space aliens who really run NSA?

RSA has some provable strength to it, though it's not totally risk-free.
(One Time Pads do too, and yet people manage to misunderstand and
misimplement them almost as much as they mishandle keys.)  If you want a
provably strong cryptosystem,
you could build one out of pure RSA, which would merely be painfully slow,
but could be usable.  Or you could build a Blum-Blum-Shub Random Number
generator,
and use it to generate one-time-pads (putting BBS into PGP version N+1 would be
interesting...)

However, the real weak point of PGP doesn't appear to be the algorithms, or
the implementation (except ease-of-use issues); it's attacks on the
computers themselves.
TEMPEST is fun, if difficult and expensive, black-bag-jobs on keyboards
are easy and effective if you're a good housebreaker, and you can always
try viruses and trojan horses to distribute keystroke-stealers.
I seem to remember that Dr. Fred was once a proponent of using viruses for
good purposes for propagation of information or whatever?  Anathema!
#---
#                                Thanks;  Bill
# Bill Stewart, Freelance Information Architect<EMAIL_ADDRESS># Phone +1-510-247-0664 Pager/Voicemail 1-408-787-1281
#---
# Crypto in 3-4 lines of perl --> http://dcs.ex.ac.uk/~aba/

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Bill Stewart)](/authors/stewarts_at_ix_netcom_com_bill_stewart_)"

+ 1995-08-01 (Tue, 1 Aug 95 14:50:17 PDT) - Re: a hole in PGP -<EMAIL_ADDRESS>(Bill Stewart)_


text:
Download ruby from [here](https://www.ruby-lang.org/en/downloads/)
Navigate inside the Ruby folder of this project and run the following command

``` ruby gol.rb```

gha_language: Ruby


text:
# anabel
A beautiful personal website template, built on TailwindCSS.

![Image of Anabel page](https://github.com/klickers/anabel/blob/master/dist/anabel.PNG)

## Usage
### CDN
Insert `before.css`, the main CSS file, into your page's `<head>`:
```
<link href =<EMAIL_ADDRESS>rel = "stylesheet" />
```

### Download
Download and extract the contents of this repository.  Inside the root directory, run:
````
> npm install
> npm start
````
*Note:  A production build is also available at `dist/`.*

That's it!  You're all set to go.

### Routify
You can also check out Anabel on Routify at [https://github.com/klickers/anabel-routify](https://github.com/klickers/anabel-routify).

## More Information

To customize the styling, edit `src/before.css` and then compile:
````
> parcel build src/index.html
````
The `/dist/` folder will contain the compiled files you need.  (Running `npm start` will give you similar results.)


text:
# GO-THRIFT-MOCK
![Test](https://github.com/chuan-yu/go-thrift-mock/actions/workflows/ci.yml/badge.svg)

`go-thrift-mock` is a thrift mock server written in `Go`. It can return any mock thrift response without a predefined IDL.

This project is inspired by [thrift-mock](https://github.com/didi/thrift-mock) project.

## Intallation
```
go get https://github.com/chuan-yu/go-thrift-mock
```

## Quick Start
### Start a mock server instance
```go
serverAddr := ":8888"
s := server.MustNewMockServer(serverAddr)

go func() {
    if err := s.Start(); err != nil {
        fmt.Printf("failed to start server: %s", err.Error())
        return
    }
}()

// wait for mock server to start properly
time.Sleep(1 * time.Second)
```
### Set expected return

Assume you have an IDL below.
```thrift
struct Request{
    1:optional string msg,
}

struct Response{
    1:required i32 code,
    2:required string responseMsg,
}

service HelloService {
    Response sayHello(1:required Request request);
}
```

To set the `sayHello` method to return a mock `Response` instance:
```go
result := Response{
    Code: 200,
    ResponseMsg: "mock message",
}
expectedReturn := server.ExpectedReturn{
    Response: &result,
}

s.SetExpectedReturn("sayHello", expectedReturn)
```
Now when a client calls the server, the above mock response is returned.

You can also mock an error response:
```go
expectedReturn = server.ExpectedReturn{
    Err: errors.New("mock error"),
}
s.SetExpectedReturn("sayHello", expectedReturn)
```
### Stop the mock server
```go
s.Stop()
```

## Example Code

See `example/main.go` for a working example

repository: junkings/go-thrift-mock

repo_name: junkings/go-thrift-mock