text:
---
title: "Thanksgiving 2018"
date: 2018-11-20 23:18:28
draft: true
---

11/20/2018

It used to bewilder me why in China we don't seem to have a holiday dedicated to appreciating (the God and) those around us.
Perhaps we never celebrated a harvest, or the arrival of new immigrants, like the first Puritans did 400 years ago.
One so vital upon which the very survival of the colonies is contingent.

I've not been one to express gratitude verbally (or much to my distress, not many other positive feelings or compliments either for that matter).
Yet I do find myself constantly reflecting on the people and events of the past.
Usually no matter if those brought joy, anger or pain at the moment I experienced them, by the time of the reflection I feel gratitude: towards the much treasured memories we shared, or the bitter lessons they taught.

It is almost once again this time of the year, and in typing these down I would hope to make up for my lack of words.
No particular order would do these justice, perhaps the cliche alphabetical one is but the best I can do.

To Adam and Jochen, for their excellent advice on career, and on what I could have done better.

To Buyu, for putting up with my nonchalance and ambiguity, which I am now ashamed of.

To Chongshan, Dongjie, Zhongxia and Jian, for all the fun in our first reunion in four years.
And dragging me to a net cafe, not something I'm particularly proud of but another first nonetheless.

To Fei, Li, and Sergii, for their willingness to help and share their knowledge, and the time they generously invested in me.

To Janani, for always being encouraging and comforting to talk to.
Often times I don't see myself share this much with friends.
A change for the better, I suppose.

To Jiajun and Josh, for sharing their knowledge and motivating each other on the similar path we undertook.

To Jian, Ken, and others of Jump, for the many Friday nights we spent discussing papers / technologies of mutual interest.
Perhaps one of those was my finest moment this year.

To Joseph, David, Erin, Kevin, Kai, Kim and many others at HRT, for the fun interviews and events.
Also for inspiring me to keep improving, to remain humble and not get satisfied with my few achievements.

To Joseph, for being an outstanding conversationist and lunch pal.

To Nikhil and Shawn, for their encouragement and support on my decision to leave earlier.
A shame the way it turned out.

To Ning, for the gifts and few interactions in a foreign office.
In the past year, those days, if not now, were perhaps the ones during which I was most troubled.

To Nzo, for always being there to bounce ideas with.
Even those "evil", unethical and silly ones.
Perhaps not many are lucky enough to share such an acquaintance.

To Ponjo, for being a genuine friend, someone to share happiness, experience, or simply programming techniques with.

To Sam, Eduardo, Rayna, Jason and others who bombarded LinkedIn / Inbox, for reaching out and reminding me how much more there is to explore out there.

To Setty, for the day hikes we went on, the trips to Chicago and CDMX, the arguments we had, and the many sentiments we shared.
From my disappointment in Februrary, the anxiety in April and May, the exhilaration in July till September, and the deep concerns now.

To Sophia, for helping me realize how much I should treasure the opportunities now, and wanting to work harder to be worthy of what luck has graciously gifted me with.

To Yao, for keeping my ego in check at work.

To those I met in my travels this and the last year, for making me feel at home in foreign lands.

To my parents, always.

And to the many unnamed, for your kindness, patience, support, or simply your smile at a stranger in distress.

I was treated by this world with kindness, for that I constantly remind myself to pay it forward.

I find myself again at a crossroads, perhaps making questionable decisions.
Even if the path may turn out to be a dead end, work hard, learn, stay humble, and appreciate.


text:
# The **_FIFA_** Project
### Author: Helinski (Shubham Saha)

A simple terminal-based menu-driven program that fetches major FIFA data almost instantly.

The program is written in `Python 3` and utilizes the `Beautiful Soup` library to scrape data from the internet.

>Credits :

ESPN - http://www.espn.in

FIFA - http://www.fifa.com

## Usage
1. Clone the repository using the link: https://github.com/Helinskii/Project-FIFA.git
2. Install the required libraries using - `pip install -r requirements.txt`
3. Run command - `python main.py`
4. If your default environment is `Python 2`, then run - `python3 main.py`

## Screenshots
### _Menu + Schedule_
**Highlights all _Argentina_ matches**

*Can be changed in the source code*

![Menu + Schedule](screenshots/menu.jpg?raw=true "Menu")

### _Points Table_
![Points Table](screenshots/points.jpg?raw=true "Points Table")

### _Past Results_
![Past Results](screenshots/results.jpg?raw=true "Past Results")
### _Live Score coming up soon!_

license: MIT

repository: Helinskii/Project-FIFA

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Helinskii/Project-FIFA


text:
**This is the Awesome Page**

_Use single asterisks or underscores for italics_

```
# Cloning a github repo from the command line
mkdir <LOCAL-REPO-DIRECTORY>
cd <LOCAL-REPO-DIRECTORY>
git clone <GITHUB-URL>
```

For example, this project is at:
[https://github.com/georobGWJ/phase-0-gps-1](https://github.com/georobGWJ/phase-0-gps-1)

![Screencap!](./GPS_1.1_Screencap.tiff "Guided Pair Session Screen Capture")


text:
# Catalog Query Text

The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case.

## Structure

`Catalog Query Text`

## Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `keywords` | `List[str]` | Required | A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 characters are ignored. |

## Example (as JSON)

```json
{
  "keywords": [
    "keywords3",
    "keywords4"
  ]
}
```

repository: square/square-python-sdk

gha_language: Python

gha_license_id: NOASSERTION

repo_name: square/square-python-sdk


text:
---
title: Log Sessions to Local Database
slug: LogToLocalDB
publish: true
position: 4
---

Log Sessions to Local Database
==============================

1. [Add Rules to Fiddler][1] to create a new menu item as follows:

		// Log the currently selected sessions in the list to a database.
		// Note: The DB must already exist and you must have permissions to write to it.
		public static ToolsAction("Log Selected Sessions")
		function DoLogSessions(oSessions: Fiddler.Session[]){
		if (null == oSessions || oSessions.Length < 1){
		  MessageBox.Show("Please select some sessions first!");
		  return;
		}
		var strMDB = "C:\\log.mdb";
		var cnn = null;
		var sdr = null;
		var cmd = null;
		try
		{
		  cnn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strMDB);
		  cnn.Open();
		  cmd = new OleDbCommand();
		  cmd.Connection = cnn;

		  for (var x = 0; x < oSessions.Length; x++){
			var strSQL = "INSERT into tblSessions ([ResponseCode],[URL]) Values (" +
			oSessions[x].responseCode + ", '" + oSessions[x].url + "')";
			cmd.CommandText = strSQL;
			cmd.ExecuteNonQuery();
		  }
		}
		catch (ex){
		  MessageBox.Show(ex);
		}
		finally
		{
		  if (cnn != null ){
			cnn.Close();
		  }
		}
		}

2. List the new import at the top of your rules script as follows:

		import System.Data.OleDb;

+ **Note**: This example relies upon OLEDB 4.0 which is not available for 64bit processes. Either:

  + Select another data provider (for example, SQLServer); or
  + [Force Fiddler Classic to run in 32bit mode][2]

[1]: ../../Extend-Fiddler/AddRules
[2]: http://fiddler.wikidot.com/bitness

repository: telerik/fiddler-docs

gha_language: Ruby

repo_name: telerik/fiddler-docs


text:
# IdGenerator

[![Build Status](https://travis-ci.org/matic-insurance/id_generator.svg?branch=master)](https://travis-ci.org/matic-insurance/id_generator)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ff827f62fb034d3b8ff71d69a9f0e233)](https://www.codacy.com/app/Matic/id_generator?utm_source=github.com&utm_medium=referral&utm_content=matic-insurance/id_generator&utm_campaign=Badge_Grade)

This gem provides uniq and random ids generation in distributed services
but at the same time gives some ordering (timestamp) and debug (context) information

The gem is inspired by [Twitter Snowflake](https://github.com/twitter-archive/snowflake/tree/snowflake-2010) and other algorithms.

The main difference is that ids generated by gem are not fully sequenced.
We want to have large random part that can be used as a simple guard against enumeration attack.

## Goals & Assumptions

While we designed format and gem we used these as requirements:

-   Every system should be able to independently (without coordination) generate id that will never (with reasonable chances) be duplicated
-   ID allows partial time ordering (timestamp in seconds)
-   ID has easy system identifier (context)
-   ID is human readable
-   ID size is not a concern
-   ID format should not be used for business/application logic - thus it remains flexible for future changes

## ID Format

Suggested algorithm is based on the Twitter snowflake and other similar alghorithms:

`TTTTTTTT-II-RRRRRRRRRRRRRRRRRRRRRR`

-   `TTTTTTTT` - time in seconds since 2000 (just cool number) represented as hex - Gives us ~150 years of uniq sequences
-   `II` - 1 byte for System Identification in hex
-   `RRRRRRRRRRRRRRRRRRRRRR` - 11 bytes secure random number as hex

Code to generate is pretty straightforward:

```ruby
time = format('%08x', Time.now.to_i - Time.new(2000).to_i)
id = '6a'
random = SecureRandom.hex(11)
id = "#{time}-#{id}-#{random}" # "21dc3680-6a-910df0665e5e29b9f89e21"
```

## Installation

Add gem to your application's Gemfile:

```ruby
gem 'id_generator'
```

## Usage

```ruby
# Somewhere during project start
context_id = 165 # value from 0 to 255
IdGenerator.configuration.context_id = context_id
# Or using block
IdGenerator.configure { |config| config.context_id = context_id }

#Inside of the actual code
IdGenerator.generate
```

## Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/matic-insurance/id_generator]().

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

gha_license_id: MIT


text:
# RSS Feed Reader Testing

1. In this project there's a given web-based application that reads RSS feeds.
2. The porject shows a basic test which was incomplete (had 1 test now has 7).
3. The test is using [Jasmine](http://jasmine.github.io/).

## Files System:

| Type          | Folder | Format         |
| :---------    | :----- | :------------- |
| Run test      | root   | index.html     |
| Given styles  | \css   | style.css      |
| Given fonts   | \fonts | icomoon.***    |
| Given web-app | \js    | app.js         |
| The test code | \jasmine\spec | feedreader.js |
| Markdown      | root   | `README.md`    |

## Tests Suits

**RSS Feeds**
- `are defined` : make sure that *allFeeds* is correctly defined
- `has a URL` : all feeds must contain a *url* property which is not empty
- `has a name` : all feeds must contain a *name* property which is not empty

**The menu**
- `is hidden by default` : hidden with the css class *menu-hidden*
- `change its visibility` : menu is dis/appearing if clicked

**Initial Entries**
- `has at least one entry in the feed after loading` : before the initial load the feed is empty, checks if afterwards there's at least one *entry* class element in the *feed* container

**New Feed Selection**
- `has the content changed` : compares the first child in the feed before and after each loading. Begins from `loadFeed(0)` and `loadFeed(1)`, and looping the *allFeeds* from 1 to its end (to avoid checking `loadFeed(length+1)`
- This suit runs asynchronous check with *done()*

repository: rotem-abir/Jasmine-RSS-Testing

repo_name: rotem-abir/Jasmine-RSS-Testing


text:
environment for FEP21 class

## environment installation

```
git clone https://github.com/spack/spack.git
cd spack
git checkout 61c1b71
git checkout -b v61c1b71_gcc910
git am /path/to/this/dir/*.patch
export SPACK_ROOT=$PWD
export PATH=$SPACK_ROOT/bin:$PATH
source $SPACK_ROOT/share/spack/setup-env.sh
spack env create v61c1b71_gcc910
spack env activate $_
cp /path/to/this/dir/ var/spack/environments/v61c1b71_gcc910
spack concretize -f #carefully check the output!
spack install
#create module files for system/external packages
spack module lmod refresh
```


text:
---
category: technology
title: 'Speaking at CodeStock'
date: 2009-06-22 00:00
tags:
- conferences
- .net
- build
- codestock
- moss
- teamsystem
- tfs
redirect_from:
- /blog/2009/6/22/speaking-at-codestock.html
- /2009/06/22/speaking-at-codestock/
---
I’m privileged to have been given the opportunity to speak at [CodeStock](http://codestock.org) (details below) this coming Friday. I’ll be speaking on the topic of Deploying and Packaging SharePoint solutions using TFS.

The abstract for my session is:

> Have you been using the VS Extensions for SharePoint to create SharePoint packages and found yourself wondering how best to integrate with your source control platform and build system? Consistent packaging of SharePoint solutions can be a challenge and is not for the faint of heart. Come to this session and learn how our team utilizes TFS, Team Build, SandCastle, SharePoint Installer, and STSDev in concert to produce consistent installation packages for our SharePoint/MOSS environment.

[CodeStock](http://codestock.org) is about Community. For Developers, by Developers (with love for SysAdmins and DBAs too!). Last year an idea started at CodeStock to mix Open Spaces within a traditional conference. This year we're going to crank things up to 11 and rip off the knob - and you're being drafted to help!

* Keynote by Microsoft RIA Architect Evangelist Josh Holmes
* From Developer to Business Owner roundtable with guest Nick Bradbury creator of HomeSite, TopStyle, and FeedDemon
* 50+ break out sessions + Open Spaces (self-organizing sessions)
* Grand Prize: VSTS 2008 Team Suite with MSDN Premium
* Virtual sessions with Jeffery Richter and John Robbins

Space is limited so register today at [CodeStock.org](http://codestock.org)


text:
# Machine code to bitcode: the life of an instruction

This document describes how machine code instructions are lifted into LLVM bitcode. It should provide a detailed, inside-out overview of how McSema performs binary translation. This document omits some important steps, so consulting the [Navigating the code](NavigatingTheCode.md) document will be helpful.

## Running example

This document will use the instructions in the following basic block as a running example.

![Sample basic block](images/instruction_life_block.png)

## Step 1: CFG protocol buffer representation

The first step to lifting involves getting the machine code instructions of some binary file into a format the McSema understands. These files are generated with the help of external tools for program disassembly (IDA Pro) so that McSema doesn't need to understand the many executable file formats.

The file format used by McSema is a [CFG protocol buffer](/mcsema/CFG/CFG.proto). This file is produced using the [`mcsema-disass`](/mcsema/tools/mcsema_disass) tool. The CFG file for the above code block contains the following data.

```protobuf
Module {
  funcs = [
    Function {
      ea = 0x804b7a3;
      blocks = [
          Block {
            ea = 0x804b7a3;
            block_follows = [ ];
            insts = [

              // mov    eax, 0x1
              Instruction {
                ea = 0x804b7a3;
                bytes = "\xb8\x01\x00\x00\x00";
              },

              // push   ebx
              Instruction {
                ea = 0x0804b7a8;
                bytes = "\x53";
              },

              // mov    ebx, dword [esp+0x8]
              Instruction {
                ea = 0x0804b7a9;
                bytes = "\x8b\x5c\x24\x08";
              },

              // int    0x80
              Instruction {
                ea = 0x0804b7ad;
                bytes = "\xcd\x80";
                local_noreturn = true;
              } ];
          } ];
    } ];
  ...
}
```

## Step 2: Lifting to bitcode

The second step, which is really a few steps, is to decode the CFG file and produce one LLVM bitcode function for every `Function` message into the CFG file. Below is a portion of the bitcode produced for the above function.

```llvm
; Function Attrs: noinline
define void @sub_804b7a3(%struct.State* dereferenceable(2688) %state2, i32 %pc, %struct.Memory* %memory1) #2 {
block_804b7a3:
  %0 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 6, i32 33, i32 0, i32 0
  %1 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 6, i32 1, i32 0, i32 0
  %2 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 6, i32 3, i32 0, i32 0
  %3 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 6, i32 13, i32 0, i32 0
  store i32 1, i32* %1        ; Move 1 into EAX
  %4 = load i32, i32* %2      ; Load EBX
  %5 = load i32, i32* %3      ; Load ESP
  %6 = add i32 %5, -4         ; Subtract 4 from ESP
  %7 = inttoptr i32 %6 to i32*; Cast ESP - 4 into a pointer
  store i32 %4, i32* %7       ; Store EBX into [ESP - 4]
  store i32 %6, i32* %3       ; ESP = ESP - 4  (complete the PUSH).
  %8 = add i32 %5, 4          ; Compute ESP + 8, (pre-decrement ESP + 4)
  %9 = inttoptr i32 %8 to i32*; Cast ESP + 8 into a pointer
  %10 = load i32, i32* %9     ; Load [ESP + 8]
  store i32 %10, i32* %2      ; Store [ESP + 8] into EBX
  %11 = add i32 %pc, 12       ; Increment the program counter by 12 bytes
  store i32 %11, i32* %0      ; Update EIP with the new program counter
  %12 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 0, i32 2
  store i32 128, i32* %12     ; Set the hyper call vector to 0x80
  %13 = getelementptr inbounds %struct.State, %struct.State* %state2, i32 0, i32 0, i32 0
  store i32 4, i32* %13       ; Set the hyper call number to kX86IntN

  ; Call the Remill `__remill_async_hyper_call` intrinsic function to
  ; model the system effects of the `int 0x80` interrupt instruction.
  %14 = tail call %struct.Memory* @__remill_async_hyper_call(%struct.State* nonnull %state2, i32 %11, %struct.Memory* %memory1)

  ret %struct.Memory* %14
}
```

The produced LLVM functions have a predictable structure. They are named according to the `ea` (effective address, or entry address) field in the `Function` message. The `ea` of our example function is `0x804b7a3`, and so the lifted function is named `sub_804b7a3`.

All lifted functions accept three arguments: a pointer to a [`State`](https://github.com/lifting-bits/remill/blob/master/remill/Arch/X86/Runtime/State.h#L520) structure, the current program counter, and an opaque pointer to a `Memory` structure. The lifted bitcode has a predictable structure. It emulates reads and writes of machine registers by using `load`s and `store`s to the `State` structure. It also emulates reads and writes to memory via `load`s and `store`s. To emulate memory differently, pass the `--keep_memops` option to `mcsema-lift-M.m`.

In this case, we see the use of some Remill intrinsic functions, but in practice those don't show up, because `int 0x80`s and their ilk are typically found in libraries that wrap system calls, and not directly in the binaries themselves.

repository: Sisyph/mcsema

repo_name: Sisyph/mcsema


text:
Synced Lyric on TouchBar

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/77de523131f9441997db18c608b3c54e)](https://app.codacy.com/manual/mouchenghao/touchbar-lyric?utm_source=github.com&utm_medium=referral&utm_content=ChenghaoMou/touchbar-lyric&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://travis-ci.com/ChenghaoMou/touchbar-lyric.svg?branch=master)](https://travis-ci.com/ChenghaoMou/touchbar-lyric)

Show synced lyric in the touch-bar with BetterTouchTool and NetEase APIs. Based on the idea of [Kashi](https://community.folivora.ai/t/kashi-show-current-song-lyrics-on-touch-bar-spotify-itunes-youtube/6301).

\#Note:
Only tested with Catalina. If you are on Mojave, please clone the repo and change the the following code:

edit `touchbar_lyric/__init__.py`
change the code in `get_info` (basically change `Music` to `iTunes`)

```python
else if application "Music" is running then
    tell application "Music"
        set currentInfo to {"Music", artist of current track, "###", name of current track, player position, player state, duration of current track}
    end tell
end if
```

to

```python
else if application "iTunes" is running then
    tell application "iTunes"
        set currentInfo to {"iTunes", artist of current track, "###", name of current track, player position, player state, duration of current track}
    end tell
end if
```

the execute the following command in the directory of the repo:

```bash
pip install --editable .
```

## Features

1.  Netease music web apis for **synced lyrics**;
2.  cachier to **cache** function calls and reduce the need to call webapis;
3.  Apple script for Spotify & iTunes/Music background track information;
4.  Support for **English/Chinese**;

## Instruction

### 1. Denpendencies

First check your python version, which should be 3.6+. All commands should be executed in your terminal.

```shell
python3 --version
```

#### pip

```shell
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
```

```Shell
python3 get-pip.py
```

You might want to restart your terminal.

```shell
pip3 install touchbar_lyric
```

### Python Path

Take a note for the python3 path. We will refer it as `${PYTHONPATH}`

```shell
whereis python3
```

### 2. Configuration in BetterTouchTool

Same as Kashi:

1.  Copy&paste the content in `lyric.json` in _Meun Bar > Touch Bar_;
2.  Change the python path `/Users/chenghaomou/Anaconda/bin/python` to your own python path in the script area;
3.  Optional: You can use pubproxy api to remedy netease's anti-crawler mechanism.

```shell
${PYTHONPATH} -m touchbar_lyric --api ${PUBPROXY_API}
```

Where `--api ${PUBPROXY_API}` is optional.

## Preview

![Preview](./preview1.png)
![Preview](./preview2.png)

Note: In case there is no synced lyric, each sentence will be displayed at an evenly time interval.

repository: moatazmomen/touchbar-lyric

repo_name: moatazmomen/touchbar-lyric


text:
---
layout: default
---

# 1995-07-25 - Anyone going to DEFCON

## Header Data

From: Dan Veeneman<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 56e775a8d204b205311a4099765067920eda2d876b9cf7f651a07c19b6aedb54

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-07-25 04:12:36 UTC

Raw Date: Mon, 24 Jul 95 21:12:36 PDT

## Raw message

```
{% raw  %}From: Dan Veeneman<EMAIL_ADDRESS>Date: Mon, 24 Jul 95 21:12:36 PDT
To<EMAIL_ADDRESS>Subject: Anyone going to DEFCON
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS>(MR ELDON B JENKINS) writes:

> I don't know if anyone else from this list is going but I will be
> there for the whole conference and wouldn't mind meeting up with some
> of the people from this list.

[...]

I am also planning on attending DefCon, and would be interested in meeting
up with some Cypherpunks.

> Eldon Jenkins

Dan

--
<EMAIL_ADDRESS>(Dan Veeneman)
Cryptography, Security, Privacy BBS  +1<PHONE_NUMBER>   Data/FAX

{% endraw %}
```

## Thread

+ Return to [July 1995](/archive/1995/07)

+ Return to "[Dan Veeneman <system@decode.com>](/authors/dan_veeneman_system_at_decode_com_)"

+ 1995-07-25 (Mon, 24 Jul 95 21:12:36 PDT) - Anyone going to DEFCON - _Dan Veeneman<EMAIL_ADDRESS>


text:
# Tic-Tac-Toe

This repository contains python based interactive Tic-Tac-Toe game.

## Running Tic-Tac-Toe:

```
git clone https://github.com/aqeelanwar/Tic-Tac-Toe.git
cd Tic-Tac-Toe
python main.py
```

## Screenshots

## Controls
1. Player X starts the game
2. Click on each grid to place symbol
3. The result of the game is displayed at the end of the game
4. A track of player scores is maintained
5. Click anywhere on the result screen to play again

## Author
[Aqeel Anwar](https://www.prism.gatech.edu/~manwar8)

repository: hritul-sharma/tic-tac-toe

branch_name: refs/heads/main

repo_name: hritul-sharma/tic-tac-toe


text:
<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-map-keys

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-map-keys)

```shell
npm install just-map-keys
```
```shell
yarn add just-map-keys
```

Map an object, predicate updates keys, receives (value, key, object)

```js
import map from 'just-map-keys';

// predicate updates keys, receives (value, key, object)
map({a: 'cow', b: 'sheep', c: 'pig'}, (value) => value);
  // {cow: 'cow', sheep: 'sheep', pig: 'pig'}
map([4, 5, 6], (value, key) => key + 1); // {1: 4, 2: 5, 3: 6}
map({a: 3, b: 5, c: 9}, (value, key) => key + value); // {a3: 3, b5: 5, c9: 9}
map({a: 3, b: 5, c: 9}, (value, key, obj) => obj.b + value + key);
  // {'8a': 3, '10b': 5, '14c': 9}
```

repository: angus-c/just

gha_language: JavaScript

repo_name: angus-c/just


text:
# Icon Search - 1.3

Now supports Cryptocoins

A Google Chrome extension that allows you to search, preview and choose icons across various opensource icon libraries. You can copy the selected icon as a HTML code / Unicode / various styles in one click.

##### Chrome web store

https://chrome.google.com/webstore/detail/icon-search/bkijbakibakefmcoobcnfdkfhhbmgiek

#### Powered by

[VueJS](https://vuejs.org/)  |  [Algolia](https://www.algolia.com/)  |   [Font Awesome V4.7.0](http://fontawesome.io/) | [Bulma](http://bulma.io/)

#### License

##### An Open Source Initiative

MIT License

Copyright 2017 Venkata Chandrasekhar Nainala

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

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

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


text:
---
layout: post
title: "UI/UX improvements"
---

This is a progress report for my GSoC project on [GPS Sharing](https://wiki.gnome.org/Outreach/SummerOfCode/2015/Projects/Ankit_GPSSharing).

#### What's done since the last blog post?

* UI/UX improvements in Android application.

* Fixes in Geoclue's Network NMEA source.

Android application now displays the level of accuracy provided by the device. It also displays the
number of clients connected to the android device at any point of time. The Android application
prompts the user to change location settings, if the GPS is not enabled.

{% include image.html url="/media/2015-08-03-ui-improvements/ui-comparison.png" description="Image showing mock-up and the actual UI side by side." %}

<br>

Note: This a work in progress and is not yet available in the main repository. Android application source can be accessed [here](https://github.com/ankitstarski/GeoclueShare). And Geoclue patches [here](https://bugs.freedesktop.org/show_bug.cgi?id=90974).


text:
# Freeing memory by assigning `null`

If you want to delete a property of a `Object` uses:

```js
var foo = { bar: 'hello world' }
foo.bar = null
```

Instead of:

```js
var foo = { bar: 'hello world' }
delete foo.bar
```

If you want do delete the `Object` entirely, then simply `foo = null`.

Garbage Collector are interested in `Object`'s that are not referenced by any other `Object`.

On the other hand, JavaScript engines can detect such *hot* `Object`'s and attempt to optimize them.

This is easier if the `Object`'s structure doesn’t heavily change over its lifetime and delete can trigger such changes.

This also is applicable to `Array`.

repository: Rossolson/js-mythbusters

repo_name: Rossolson/js-mythbusters


text:
# Python companion to Low Speed Aerodynamics

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://opensource.org/licenses/MIT)
![Visits](https://badges.pufler.dev/visits/alwinw/katzplotkinpy?style=flat-square&label=visits)
![GitHub last commit](https://img.shields.io/github/last-commit/alwinw/katzplotkinpy?style=flat-square)

[Low Speed Aerodynamics 2nd Edition](https://www.amazon.com/Low-Speed-Aerodynamics-Second-Cambridge-Aerospace/dp/0521665523) by Joseph Katz and Allen Plotkin

## Purpose

This is a project implements the FORTRAN computer programs listed in *Low Speed Aerodynamics (2nd Ed)* into a Python package and stand alone program(s). Additional features such as visualisation have been included.

Written permission provided by Professor Joseph Katz, San Diego State University, to recreate the original FORTRAN functionality in Python and/or C for this Open Source Software.

## Programs and Features

### Programs

The following table is a summary from Appendix D of *Low Speed Aerodynamics*. Each program will be recreated in Python.

|  No.  |   Name   |                  Program Description                  | Section | Status |
| :---: | :------: | :---------------------------------------------------: | :-----: | :----: |
|       |          |                **_2D Panel Methods_**                 |         |        |
|  1.   | `AFGEN`  |    Grid generator for van de Vooren airfoil shapes    |   6.7   |   ☑    |
|       |          |         **_2D: Neumann Boundary Condition_**          |         |        |
|  2.   | `VOR2D`  |           Discrete vortex, thin wing method           | 11.1.1  |   ☐    |
|  3.   | `SOR2DC` |            Constant strength source method            | 11.2.1  |   ☐    |
|  4.   | `DUB2DC` |           Constant strength doublet method            | 11.2.2  |   ☐    |
|  5.   | `VOR2DC` |            Constant strength vortex method            | 11.2.3  |   ☐    |
|  6.   | `SOR2DL` |             Linear strength source method             | 11.4.1  |   ☐    |
|  7.   | `VOR2DL` |             Linear strength vortex method             | 11.4.2  |   ☐    |
|       |          |        **_2D: Dirichlet Boundary Condition_**         |         |        |
|  8.   | `PHICD`  |           Constant strength doublet method            | 11.3.2  |   ☐    |
|  9.   | `PHICSD` |        Constant strength source/doublet method        | 11.3.1  |   ☐    |
|  10.  | `PHILD`  |            Linear strength doublet method             | 11.5.2  |   ☐    |
|  11.  | `PHIQD`  |           Quadratic strength doublet method           | 11.6.2  |   ☐    |
|       |          |                   **_3D Programs_**                   |         |        |
|  12.  | `DUB3DC` |     Influence of constant strength source/doublet     | 10.4.1  |   ☐    |
|  13.  | `VORING` |   VLM for rectilinear surfaces (with ground effect)   |  12.3   |   ☐    |
|  14.  | `PANEL`  | Constant strength sources and doublets (Dirichlet BC) |  12.5   |   ☐    |
|       |          |             **_Time Dependent Programs_**             |         |        |
|  15.  |  `WAKE`  |   Acceleration of flat plate using a lumped vortex    |  13.7   |   ☐    |
|  16.  |  `UVLM`  | Unsteady motion of a thin rectangular lifting surface |  13.12  |   ☐    |

## Installation and Usage

### Installation

Details to come

### Usage

A program can be used as a group of programs or individually.

```plaintext
katzplotkinpy [OPTIONS] {PROGRAM NAME} [PROGRAM OPTIONS]

Python companion to Low Speed Aerodynamics

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show the version and exit

programs:
  Programs from Appendix D of 'Low Speed Aerodynamics'

  {afgen,vor2d,sor2dc,dub2dc,vor2dc,sor2dl,vor2dl,phicd,phicsd,phild,phiqd,dub3dc,voring,panel,wake,uvlm}
    afgen               Grid generator for van de Vooren airfoil shapes
    vor2d               Discrete vortex, thin wing method
    sor2dc              Constant strength source method
    dub2dc              Constant strength doublet method
    vor2dc              Constant strength vortex method
    sor2dl              Linear strength source method
    vor2dl              Linear strength vortex method
    phicd               Constant strength doublet method
    phicsd              Constant strength source/doublet method
    phild               Linear strength doublet method
    phiqd               Quadratic strength doublet method
    dub3dc              Influence of constant strength source/doublet
    voring              VLM for rectilinear surfaces (with ground effect)
    panel               Constant strength sources and doublets (Dirichlet BC)
    wake                Acceleration of flat plate using a lumped vortex
    uvlm                Unsteady motion of a thin rectangular lifting surface

Source: https://github.com/AlwinW/KatzPlotkinPy
```

```plaintext
katzplotkinpy afgen [-h] [-v] [-d] [-s]

Grid generator for van de Vooren airfoil shapes

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  Increase log verbosity (max -vvv)
  -d, --debug    Show debugging messages (eqv. to -vv, overrides verbosity flag)
  -s, --silent   Suppress log warning and lower messages (overrides other verbosity flags)
```

### Running Tests

```sh
python3 -m unittest -v
#  or  #
coverage run -m unittest discover -v
coverage report -m
```

### Features

In addition to recreating the programs in Python, visualisation and other features have been added.

## Contributers

[@Alwin Wang](github.com/alwinw)

## Acknowledgement

Written consent given by the author to create this python port from the original Fortran code and algorithms presented in *Low Speed Aerodynamics 2nd Edition*.

repository: burakbayramli/books

gha_language: Jupyter Notebook

repo_name: burakbayramli/books


text:
# Server Side Rendering(SSR) with Angular Universal

### What is SSR?

<!-- Typical Angular application is a Single-Page Application (SPA) where the rendering happens on the client side(i.e., Browser). The process of rendering the application on the server is referred as Server Side Rendering(SSR). -->

A normal Angular application executes in the browser, rendering pages in the DOM in response to user actions. Angular Universal executes on the server, generating static application pages that later get bootstrapped on the client. This means that the application generally renders more quickly, giving users a chance to view the application layout before it becomes fully interactive.

### Why SSR?

There are three main reasons to create a Universal version of your app.

1. Facilitate web crawlers through search engine optimization (SEO)
2. Improve performance on mobile and low-powered devices
3. how the first page quickly with a first-contentful paint (FCP)

### Facilitate web crawlers (SEO)

Google, Bing, Facebook, Twitter, and other social media sites rely on web crawlers to index your application content and make that content searchable on the web. These web crawlers may be unable to navigate and index your highly interactive Angular application as a human user could do.

Angular Universal can generate a static version of your app that is easily searchable, linkable, and navigable without JavaScript. Universal also makes a site preview available since each URL returns a fully rendered page.

### Improve performance on mobile and low-powered devices

Some devices don't support JavaScript or execute JavaScript so poorly that the user experience is unacceptable. For these cases, you may require a server-rendered, no-JavaScript version of the app. This version, however limited, may be the only practical alternative for people who otherwise couldn't use the app at all.

### Show the first page quickly

Displaying the first page quickly can be critical for user engagement. Pages that load faster perform better, even with changes as small as 100ms.

With Angular Universal, you can generate landing pages for the app that look like the complete app. The pages are pure HTML, and can display even if JavaScript is disabled. The pages don't handle browser events, but they do support navigation through the site using routerLink.

In practice, you'll serve a static version of the landing page to hold the user's attention. At the same time, you'll load the full Angular app behind it. The user perceives near-instant performance from the landing page and gets the full interactive experience after the full app loads.

## Lets get started with SSR Implementation

**Step 1**

Let's create a new angular project, You can skip this step if you already have an existing project.

```
ng new angular-universal-project
```

**Step 2**

Adding angular universal to our application. `angular-universal-project` in the below CLI is your project name that you created in step1.

```
ng add @nguniversal/express-engine --clientProject angular-universal-project
```

You’ll notice this schematic made several changes to your app, modifying some files and adding some files. I’ll briefly go through these in no particular order.

1. `angular.json`: `projects.{{project-name}.architect.build.options.outputPath` changes to `“dist/browser”`; and a new `projects.{{project-name}}.architect` is added, called “server”. This lets the Angular CLI know about our server/Universal version of the Angular application.

2. `package.json`: besides adding a few new dependencies (to be expected), we also get a few new scripts: `“compile:server”`, `“server:ssr”`, `“build:ssr”`, `“build:client-and-server-bundles”`.

3. `server.ts`: this is the NodeJS Express server. Obviously, you don’t have to use this exact server setup as generated, although make note of the line `app.engine('html', ngExpressEngine({...'. ngExpressEngine` is a wrapper around `renderModuleFactory` which is the special sauce that makes Universal work. If you don’t use this exact server.ts file for your set-up, at least copy this part out and integrate it into yours.

4. `webpack.server.config.js`: the webpack configuration for bundling the Express/Universal server. Again, if you are integrating Universal in an existing app, you might be doing something different. However, since we’ve added our Universal module to the server, which has the whole dependency graph of Angular, this makes a tidy bundle of everything that’s needed for a production build. The configuration is used in conjunction with the new `package.json` script `“compile:server”`.

5. `main.ts`: this has been modified so that the browser version of the app won’t start bootstrapping until the Universal-rendered pages have been fully loaded.

6. `main.server.ts`: this new file basically only exports the `AppServerModule`, which is the entry point of the Universal version of the application. We’ll see this soon.
   `tsconfig.server.json`: this tells the Angular compiler where to find the entry module for the Universal application.

7. `app.module.ts`: modified to execute the static method `.withServerTransition` on the imported `BrowserModule`. This tells the browser version of the application that the client will be transitioning in from the server version at some point.

8. `app.server.module.ts`: this is the root module for the server version only. You can see it imports our `AppModule`, as well as the `ServerModule` from `@angular/platform-server`, and bootstraps the same `AppComponent` as `AppModule`. AppServerModule is the entry point of the Universal application.

**Step 3**

We have successfully added angular universal in our project. Now, lets try to run the application.

```
npm run build:ssr && npm run serve:ssr
```

Once the build is successful, you can view your application running in `http://localhost:4000` (or whatever port is configured for you).

## How to check SSR is working or not?
Assume that SSR is implemented and build happend without any issues and you could see the application running on the browser. But how do we know that the application running is actually SSR or angular default SPA one.

To check this, you should check the `Page Source`. How to see the `Page Source`, right click -> `View Page Source` simple as that.

Now

## Things you need to take care of
## Angular Universal "GOTCHAS"

### Sources

[Angular documentation](https://angular.io/guide/universal)

[alligator.io](https://alligator.io/angular/angular-universal/)

repository: imugunthanc/angular-universal

repo_name: imugunthanc/angular-universal


text:
# capistrano-simple_systemd

Capistrano tasks to control mutiple services with systemd

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'capistrano-simple_systemd'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install capistrano-simple_systemd

## Usage

Add this line to your Capfile:

```ruby
require "capistrano/simple_systemd"
```

Service files are defined as ERB templates ending with `.service.erb` in `config/systemd`.

Sample erb template
```
[Unit]
Description=SMS Service
After=network.target

[Service]
Type=simple
User=deploy
Environment=RACK_ENV=<%= fetch(:stage) %>
WorkingDirectory=<%= current_path %>
ExecStart=<%= "#{fetch(:home_dir)}/.rvm/bin/rvm #{fetch(:rvm_ruby_version)} do bundle exec #{current_path}/bin/sms_service"%>
TimeoutSec=10
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sms-service

[Install]
WantedBy=multi-user.target
```
PLEASE NOTE: Currently only files with the  `.service.erb` extension are considered as service file templates. Others like `.target.erb` aren't supported yet

The following tasks are provided out of the box
```ruby
cap systemd:reload-daemons
cap systemd:upload
```

The following tasks will be created for each service template detected in the `config/systemd` directory

```ruby
cap systemd:{service}:disable
cap systemd:{service}:enable
cap systemd:{service}:reload
cap systemd:{service}:reload-or-restart
cap systemd:{service}:restart
cap systemd:{service}:start
cap systemd:{service}:stop
```
Where `service` is the base name of the service template.

For example, placing `puma.service.erb` in the template directory will yield the following tasks
```ruby
cap systemd:puma:disable
cap systemd:puma:enable
cap systemd:puma:reload
cap systemd:puma:reload-or-restart
cap systemd:puma:restart
cap systemd:puma:start
cap systemd:puma:stop
```

Run
```ruby
cap {stage} systemd:upload
```
Or
```ruby
cap {stage} setup
```

to compile and upload the service files. Service files will be prefixed with whichever value is in `service_file_prefix` and uploaded to `/etc/systemd/system`. The variable `service_file_prefix` by default is set to whatever is in the `application` configuration variable.
So if `application` is set to `paypoint` then `puma.service.erb` will be uploaded to `/etc/systemd/system/paypoint-puma.service`.

`service_file_prefix` can be configured. E.g.
```ruby
set :service_file_prefix, 'paypoint-app'
```

Services are enabled after upload by invoking `systemd:{service}:enable`. This behaviour can be disabled by setting `enable_services_after_upload` to false.
```ruby
set :enable_services_after_upload, false
```

## Development

After checking out the repo, run `bundle`

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/darkwasp99/capistrano-simple_systemd.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).


text:
# DQN

Different versions of DQN for some of the OpanAI Gym environment.

#### To-Do
- [x] DQN implementation [1,2] [notebook](DQN_torch.ipynb)
- [x] Double Q-Learning [3]
- [ ] Dueling Network Architectures for DRL [4]
- [ ] Prioritized Experience Replay [5]

#### References
1. https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
2. https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf
3. https://arxiv.org/pdf/1509.06461.pdf
4. https://arxiv.org/pdf/1511.06581.pdf
5. https://arxiv.org/abs/1511.05952
6. https://github.com/udacity/deep-reinforcement-learning/tree/master/dqn


text:
# Supporto
Supporto is a simple Ticket-bot, with a small twist.
Instead of you having to type something like `/new <topic>` to create a ticket, Supporto simply lets you set a channel as a ticket-channel, where people can just type a message and the bot will make a new ticket.
The creator, people with the permission `manage server` or a set staff-role can then close the ticket, by simply clicking on the reaction of the first message and confirming the close.

Every participants in the ticket will receive a transcript of the chat in a DM.

## NOTES
People with `manage server` permission or a registered staff-role assigned **Can NOT** create a ticket like normal.
This was made to let people have a way, to make a message in their ticket-channel (e.g. for information).
If you still want to create a ticket, add a `!create` to the message.

## Commands
The default prefix for commands is `t_`.
To know, what prefix is used in a guild, simply mention the bot.

### Bot
General commands to get info about the bot.

#### Help
**Aliases**:
- Commands
- Command

Shows you all available commands.
You can provide a command after `Help` (f.e. `t_help settings`) to get info about the command.

#### Info
**Alias**:
- Information

Gives basic info for the bot.

#### Invite
**Aliases**:
- Link
- Links

Gives you the links, to invite the bot, join the guild, or to [the GitHub-repository](https://github.com/Andre601/Supporto).

#### Stats
**Aliases**:
- Stat
- Statistics

Gives you some statistics about the bot.

### Guild
This commands are for either getting some guild-info, or for changing stuff.

#### Guild
**Alias**:
- Server

Shows general info about the guild.

#### Roles
**Alias**:
- Role
- Listroles

Shows you a list of roles and their IDs in the guild.
Requires you to have `manage server` permission.

### Tickets
This commands can only be run inside a ticket.

#### Add
Lets you add a member or role to the ticket.

**Subcommands**:
- `member <memberID>` adds a member, if the ID is valid.
- `role <roleID>` adds a role, if the ID is valid.

#### Remove
Lets you remove a member or role from the ticket.

**Subcommands**:
- `member <memberID>` removes a member, if the ID is valid.
- `role <roleID>` removes a role, if the ID is valid.

#### Settings
**Alias**:
- Options

The settings command is the main-command for changing certain settings (obviously).
The syntax is `t_settings <subcommand>` where `<subcommand>` is one of the below options.

**Subcommands**:
- `prefix <set <prefix>|reset>` Set or reset the prefix.
- `channel <set <#channel>|reset>` Set or reset a channel as ticket-channel.
- `category <set <categoryID>|reset>` Set or reset a category for creating tickets in it.
- `role <set <roleID>|reset>` Set or reset a role, that should be able to close tickets.
- `log <set <#channel>|reset>` Set or reset a channel for logging ticket-actions (creating tickets, deleting tickets, etc.)
- `dm <on|off>` Enable/Disable sending the transcript in DM, when a ticket is closed (default is on)


text:
---
layout: post
title: "My Top 5 Triathlon Podcasts"
date: 2019-03-24 06:54:43 -0400
comments: true
categories: Triathlon
---

In my last article on podcast, I shared [my top 5 fav podcasts](http://rishisareen.com/podcasts/my-top-5-podcasts.html), I introduced podcasts and shared my top 5 favorite podcasts.

Continuing on the theme, I want to share few of my Triathlon focussed podcasts. While there are tons of Triathlon specific podcasts, some of them really resonates with my training philosophy. Here are few of them:
<!--more-->

## 1. [Purple Patch Fitness](https://purplepatchfitness.com/education/podcasts):

{% include image.html file="/images/podcast/PurplePatch.jpg" description=" Purple Patch Fitness"%}

Matt Dixon is one of the top coaches in the Triathlon world. He has a talent of reducing the complex topic to basics, and reducing it to "actionable advice". His coached triathletes have wom max podium finishes.
His podcasts are short (30min to an hour), and packed with actionable knowledge. Particularly his series on nutrition and hydration are just awesome.

## 2. [Pursuit of the Perfect Race](https://www.coachterrywilson.com/perfect)
{% include image.html file="/images/podcast/PerfectRace.jpg" description=" Pursuit of the Perfect Race"%}

Coach Terry describes his podcast as
> I love seeing, hearing, and experiencing the pure emotion of athletes when they overcome obstacles, challenges and hardships to accomplish the previously thought to be impossible.  Challenging athletes to be better, do better, and not make the mistakes of others is important to me. I network with athletes all over the world to discover their victories, challenges, disappointments, mistakes they made, and how they found what worked for them through a podcast.

He focus primarily on the race day -

- Details about the Race - Swim / Bike / Run Portion
- T1/T2 setup
- Support Arrangements
- What went right / wrong

He covers both professional triathletes and amateurs. Best part is the podcasts are arranged by races. So if you're going to race a particular Ironman, you can listen to that particular episode to get an idea of what to expect there.  I've already listened to his [Ironman Copenhegan](https://www.coachterrywilson.com/ironman-copenhagen) episode twice.

## 3. [That Triathlon Show](https://scientifictriathlon.com/that-triathlon-show/):

{% include image.html file="/images/podcast/ThatTriathlonShow.jpg" description=" That Triathlon Show"%}
This podcast is geared towards tips on swimming, running, cycling and nutrition. A wealth of knowledge. Mikael Eriksson, the host of the show, is himself a very good triathlete, who is improving very fast.

## 4. [Triathlon Taren](https://triathlontaren.com/topics/general/):

{% include image.html file="/images/podcast/Triathlon-Taren-Podcast.jpg" description=" Triathlon Taren Podcast"%}
Taren is an all around crazy, and fun guy. And is such a fabulous storehouse of knowledge. I've heard each one of his podcast, and learnt a ton. Along with podcast, he also have a [YouTube Channel](https://www.youtube.com/channel/UC1AKDrz2GvLxD29W9tow66g) where one can find a lot of useful triathlon learning videos.

## 5. [Tower 26](https://www.tower26.com/podcasts/):

{% include image.html file="/images/podcast/Tower26.png  Tower26"%}
Gerry Rodrigues, host of this show, is a towering figure in the world of Open Water Swimming and Triathlon swimming. Many professional triathletes rates him as the best swimming coach. This podcast is focussed more towards Triathlon Swimming, and many great episodes.

Honorary Mentions:
1. [Team Oxygen Addict](https://www.oxygenaddict.com/podcast)
2. [The Fat Black Podcast](http://www.trispecific.com/category/podcast/)

That's it, folks. If you're training for Triathlon, and love listening to podcasts, these are some very valuable and fun resources to get started. It is a good way to spend time during those long training rides.

extension: markdown

gha_language: SCSS


text:
# circle api

[![CircleCI](https://circleci.com/gh/heroku/java-getting-started.svg?style=svg)](https://circleci.com/gh/heroku/java-getting-started)

Circle API

Main functions

We can have one to many organizations per customer

Each org will have users
Each org will have circles
Circles can have members (each member is also a user)

Organizations

List
Add
Remove
Search

Users

List
Add
Remove
Search

Circles
List
Add
Remove
Search

I want to add my profile to universe

I want to browse circle
I want to search circle

I want to add myself to a circle

I create a new Circle


text:
Android DownloadableFonts Sample With Custom Source
===================================================

This sample demonstrates how to use the Downloadable Fonts feature introduced in Android O, with
a custom source for downloading them. This way, we can have private fonts (such as ProximaNova,
or the one you are paying for) instead of bundling it in the APK. This means, there is no need
to bundle the font as an asset.

This repository is just a POC showing how you can achieve it. By no means you should have this code
in production environments, since it's just a demonstration on how to achieve it. It's up to  you
to create a more robust API to handle your own source of fonts.

This project will contain inside Roboto, while we have used ProximaNova in the images shown.

How
===

The method is quite simple:
- We create our own ContentProvider (actually, a FileProvider)
  * We declare it in our manifest, being able to serve files in the path 'file' (since FontContract expects them there)
  * We declare it in our manifest, being able to grant permission to uris, since we will be working with font files
- We handle the query of our FileProvider
  * We should check that the uri matches the ones we support
  * We should check authorities match
  * We should validate the selection criteria they asked for, and find the appropiate font they have asked for. This might require us to download it from our private source.
  * We will have to create a cursor (preferably a MatrixCursor, for easy manipulation of contents)
  * We will have to fill the cursor with rows based on the query, taking into account the projections asked for
  * We will have to create a content uri serving the font file they asked for. Be careful the name of the font file should be its ID
  * Grant permissions to the content uri you have served. So they can read the fd.
- When declaring a font (either by request or by a family xml), be sure to use your package, authority of the provider and certificate signature you have signed the APK containing the provider with.

That's the whole process. Quite easy :)

Usage
=====

In this case, we have defined the font 'Lobster Two' as our own. We will be "downloading it" (we have it as an asset, but we will never expose it, just simulate we download it) and serving it from our own content-provider.

If you install the APK, you will see a second text using 'Lobster Two' right from the start of the app (it's actually ProximaNova), with our own provider.

If you select 'Lobster Two' from the list, and request it (thus, in the middle of the app flow) you will also see our 'Lobster Two' (ProximaNova) getting queried and shown.

### Actual Lobster Two looks like:

![](https://raw.githubusercontent.com/saantiaguilera/android-poc-CustomDownloadableFonts/master/screenshots/real_lobster_two.png)

### The Lobster Two we see both from start and via request (ProximaNova):

![](https://raw.githubusercontent.com/saantiaguilera/android-poc-CustomDownloadableFonts/master/screenshots/our_lobster_two.png)

Introduction
------------

There are two ways of requesting a font to download.
To request a font to download from Java code, you need to create a [FontRequest][1] class first like
this:
```java
FontRequest request = new FontRequest(
    authority,
    package,
    query,  // Query
    R.array.certificates); // Certificates
```
The parameters `ProviderAuthority`, `ProviderPackage` are given by a font provider, by default we
usually use the Google authority and package as they have their own FontProvider that can handle
the fonts shown in [link](fonts.google.com). In our case, we will be creating our own content provider
that will be able to serve fonts, but with our own authority, package and certificates.

The third parameter is a query string about the requested font. The syntax of the query is defined
by the font provider.

Pass the request instance to the `requestFont` method in the [FontsContractCompat][2].
```java
FontsContractCompat.requestFont(context, request, callback, handler);
```
The downloaded font or an error code if the request failed will be passed to the callback.
The example above assumes you are using the classes from the support library. There are
corresponding classes in the framework, but the feature is available back to API level 14 if you
use the support library.

You can declare a downloaded font in an XML file and let the system download it for you and use it
in layouts.
```xml
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
        app:fontProviderAuthority="com.google.android.gms.fonts"
        app:fontProviderPackage="com.google.android.gms"
        app:fontProviderQuery="Lobster Two"
        app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>
```
By defining the requested font in an XML file and putting the `preloaded_fonts` array and the
meta-data tag in the AndroidManifest, you can avoid the delay until the font is downloaded by the
first attempt.
```xml
<resources>
    <array name="preloaded_fonts" translatable="false">
        <item>@font/lobster_two</item>
    </array>
</resources>
```

```xml
<application >
    ...
    <meta-data android:name="preloaded_fonts" android:resource="@array/preloaded_fonts" />
    ...
</application>
```

[1]: https://developer.android.com/reference/android/support/v4/provider/FontRequest.html
[2]: https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.html

Pre-requisites
--------------

- Android SDK 27
- Android Build Tools v27.0.2
- Android Support Repository

Screenshots
-------------

<img src="screenshots/screenshot-1.png" height="400" alt="Screenshot"/>

Getting Started
---------------

This sample uses the Gradle build system. To build this project, use the
"gradlew build" command or use "Import Project" in Android Studio.

Support
-------

- Google+ Community: https://plus.google.com/communities/105153134372062985968
- Stack Overflow: http://stackoverflow.com/questions/tagged/android

If you've found an error in this sample, please file an issue:
https://github.com/googlesamples/android-DownloadableFonts

Patches are encouraged, and may be submitted by forking this project and
submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.

License
-------

Copyright 2017 The Android Open Source Project, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you 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.


text:
# ShuweeConfigBundle

[![Latest Stable Version](https://poser.pugx.org/wanjee/shuwee-config-bundle/v/stable)](https://packagist.org/packages/wanjee/shuwee-config-bundle)
[![Total Downloads](https://poser.pugx.org/wanjee/shuwee-config-bundle/downloads)](https://packagist.org/packages/wanjee/shuwee-config-bundle)
[![License](https://poser.pugx.org/wanjee/shuwee-config-bundle/license)](https://packagist.org/packages/wanjee/shuwee-config-bundle)

ShuweeConfigBundle is part of Shuwee project.  It manage configuration & unique variables your frontend could need.
As an example you will use this bundle to manage the title, description, meta of the site if the webmaster needs to be able to modify them.

Shuwee name comes from a Lakota word : čhuwí. It's defined as the upper back of the body.  It is aimed to manage single page applications.

## Install

Via Composer

``` bash
$ composer require wanjee/shuwee-config-bundle
```

## Usage

See [Documentation](doc/index.md)

## Testing

``` bash
$ phpunit
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please contact me directly instead of using the issue tracker.

## Credits

- [Wanjee](https://github.com/wanjee)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: wanjee/ShuweeConfigBundle

repo_name: wanjee/ShuweeConfigBundle


text:
# Tornado-Mail

A simple RESTful API based email client built using Tornado. It uses python's SMTP library to send email, IMAP library to receive emails. Tornado is used to serve the data to the reciever.

## Usage

First install Tornado by running `pip install tornado`, then change the configurations inside the `simple_mail.py`.

After that hit `python simple_mail.py`, and that should run the project.

To send email, make a post request with to `localhost:7777/sendmail` with perameters: 'to', 'body', 'message'.
To get emails, make a get request to `localhost:7777/getmail`.

repository: cesarserrano/Tornado-Mail

repo_name: cesarserrano/Tornado-Mail


text:
Tron - Batch Scheduling System
==============================

[![Build Status](https://travis-ci.org/Yelp/Tron.svg?branch=master)](https://travis-ci.org/Yelp/Tron)
[![Documentation Status](https://readthedocs.org/projects/tron/badge/?version=latest)](http://tron.readthedocs.io/en/latest/?badge=latest)

Tron is a centralized system for managing periodic batch processes
across a cluster. If you find [cron](http://en.wikipedia.org/wiki/Cron) or
[fcron](http://fcron.free.fr/) to be insufficient for managing complex work
flows across multiple computers, Tron might be for you.

Install with:

    > sudo pip install tron

Or look at the [tutorial](http://tron.readthedocs.io/en/latest/tutorial.html).

The full documentation is available [on ReadTheDocs](http://tron.readthedocs.io/en/latest/).

Versions / Roadmap
------------------

Tron is changing and under active development.

It is being transformed from an ssh-based execution engine to a [Mesos
framework](http://mesos.apache.org/documentation/latest/frameworks/).

Tron development is specifically targeting Yelp's needs and not designed to be
a general solution for other companies.

* <= v0.6.2 - Stable version, recommended for non-Yelp installations.
* >= v1.0.0 - Stable mesos-based version

Contributing
------------

Read [Working on Tron](http://tron.readthedocs.io/en/latest/developing.html) and
start sending pull requests!

Any issues should be posted [on Github](http://github.com/Yelp/Tron/issues).

BerkeleyDB on Mac OS X
----------------------

    $ brew install berkeley-db
    $ export BERKELEYDB_DIR=$(brew --cellar)/berkeley-db/<installed version>
    $ export YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION=1

repository: Yelp/Tron

repo_name: Yelp/Tron


text:
# react-with-styles-interface-css

Interface for [react-with-styles](https://www.npmjs.com/package/react-with-styles) that compiles CSS-in-js styles to static CSS classes with deterministic and human-friendly class names whose styles can be easily overridden.

## Usage

### Interface

A [react-with-styles](https://www.npmjs.com/package/react-with-styles) interface which is to be used along with [react-with-styles](https://www.npmjs.com/package/react-with-styles).

```javascript
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import CSSInterface, { registerCSSInterfaceNamespace } from 'react-with-styles-interface-css';

ThemedStyleSheet.registerInterface(CSSInterface);

// Optional: Prefix all class names in the output with 'MyPackageName__'
const namespace = 'MyPackageName';
registerCSSInterfaceNamespace(namespace);
```

### Styles
When writing styles, all classes throughout a project should be given unique names. Otherwise, class name collisions may result in unexpected and unwanted behavior.

### Overriding styles
The styles for a class can be overridden using the same name with which the class was defined. If the optional class name prefix was configured, the prefix should be used when overriding a class.

**Note:** In order to provide compatibility with [aphrodite](https://github.com/airbnb/react-with-styles-interface-aphrodite), the CSS output by this interface uses specifiers with varying levels of specificity. This allows for style resolution to be sensitive to the ordering of styles in calls to `css(...)`. However, these extra specifiers should not be overridden.

### Compile

The styles passed to `withStyles` in the source code are compiled to static CSS by the `react-with-styles-interface-css-compiler` package.

repository: airbnb/react-with-styles-interface-css

repo_name: airbnb/react-with-styles-interface-css


text:
---
title: TIDB_HOT_REGIONS
summary: Learn the `TIDB_HOT_REGIONS` information_schema table.
---

# TIDB_HOT_REGIONS

The `TIDB_HOT_REGIONS` table provides information about hotspot Regions.

{{< copyable "sql" >}}

```sql
USE information_schema;
DESC tidb_hot_regions;
```

```
+----------------+-------------+------+------+---------+-------+
| Field          | Type        | Null | Key  | Default | Extra |
+----------------+-------------+------+------+---------+-------+
| TABLE_ID       | bigint(21)  | YES  |      | NULL    |       |
| INDEX_ID       | bigint(21)  | YES  |      | NULL    |       |
| DB_NAME        | varchar(64) | YES  |      | NULL    |       |
| TABLE_NAME     | varchar(64) | YES  |      | NULL    |       |
| INDEX_NAME     | varchar(64) | YES  |      | NULL    |       |
| REGION_ID      | bigint(21)  | YES  |      | NULL    |       |
| TYPE           | varchar(64) | YES  |      | NULL    |       |
| MAX_HOT_DEGREE | bigint(21)  | YES  |      | NULL    |       |
| REGION_COUNT   | bigint(21)  | YES  |      | NULL    |       |
| FLOW_BYTES     | bigint(21)  | YES  |      | NULL    |       |
+----------------+-------------+------+------+---------+-------+
10 rows in set (0.00 sec)
```

The description of columns in the `TIDB_HOT_REGIONS` table is as follows:

* `TABLE_ID`: ID of located.
* `INDEX_ID`: ID of the table in which the hot Region is the index in which the hot Region is located.
* `DB_NAME`: The database name of the object in which the hot Region is located.
* `TABLE_NAME`: The name of the table in which the hot Region is located.
* `INDEX_NAME`: The name of the index in which the hot Region is located.
* `REGION_ID`: ID of the hot Region.
* `TYPE`: The type of the hot Region.
* `MAX_HOT_DEGREE`: The maximum hot degree of the Region.
* `REGION_COUNT`: The number of Regions in the instance.
* `FLOW_BYTES`: The number of bytes written and read in the Region.

repository: MartinNose/docs

gha_language: Shell

repo_name: MartinNose/docs


text:
# Humidity Sensor Solution

A basic wireless humidity sensor solution.  A work in progress.  Get your PCBs at https://www.pcbway.com/project/shareproject/W04152ASD12_humxmit_v2.html

Check out the writeup here:
https://skullspace.ca/2017/12/23/wireless-humidity-sensor-part-1-hardware-design/

## Hardware

Check out the KiCAD design files for the transmitter/sensor in 'tx\_pcb'

## Software

### Receiver

The receiver is based on an arduino mega (due to what I had laying around) and an nRF24L01+ module.  The sketch can be fond in 'hum\_sw/humrx'

### Transmitter

The transmitter is based on an attiny87, si7006, and nrf24L01+.  You can find it's source code in 'hum\_sw/humtx'.  It requires avrlibc and GNU make.  the 'prog' subdirectory contains a scrip that will flash the transmitter PCB via avrdude.  The included copy of avrdude is for my convenience, it is compiled for linux amd64

repository: trdenton/humsensor

repo_name: trdenton/humsensor


text:
---
layout: post
title: FilePathWrite.nk
published: true
category: nodes
tags: Image
---

###Intro
- Creates a proceedural UV map that can be used to check the UVs on any object. It is normalised in U and V so using a colour sample with allow you to\ncheck the UV location of any point on the model. it is STRONGLY recommended that you only output to Square formats (1:1 aspect ratio)

### Details
- "originalAuthor": "Rafal Kaniewski."
- "dateCreated": "01/01/2015"
- "status": "beta"
- "source": "https://github.com/openNuke/toolset/blob/master/uvTile.nk"
- "Licence": "[https://github.com/openNuke/toolset/blob/master/LICENCE]"

### Instructions
Please request someone to contribute instructions in comments below.


text:
# openresty docker

Basic docker image for openresty based on Ubuntu 16.04. The build is configured to be used as a reverse proxy for http requests, so protocols such as uwsgi and fastCGI have been disabled.

Nginx configuration is held under `/srv/nginx` as

    /srv
      /nginx
        /conf
        /lua
        /logs
        ...

## Usage

Simply make a Dockerfile as follows (note that the working directory is `/srv`:

    FROM talentappstore/openresty

    COPY /path/to/my/nginx nginx

In addition, the bash file `generate-dhparam.sh` is included to generate a 4096 bit Diffie Hellman parameter, placed in `/etc/ssl/certs/dhparam.pem`. If you wish to use this, you will have to run it yourself either in a `RUN` statement or as part of you command script. E.g.

    RUN ./generate-dhparam.sh

## Debugging

The docker image also contains the [stapxx](https://github.com/openresty/stapxx) and [FlameGraph](https://github.com/bredangregg/FlameGraph) projects. Example usage (could be improved):

    docker run -it -v /lib/modules:/lib/modules -v /usr/src/linux-headers-4.4.0-45-generic:/usr/src/linux-headers-4.4.0-45-generic -v /sys/kernel/debug:/sys/kernel/debug -v /usr/src/linux-headers-4.4.0-45:/usr/src/linux-headers-4.4.0-45 --privileged --pid=host --name otest21 talentappstore/openresty bash
    ps aux | grep nginx # find the worker process id
    lj-lua-stacks.xss -x 3124 --skip-badvars > a.bt

## Developement

Alternatively, to use a developement platform just add the relavent volumes:

    docker run \
        -d \
        -v /path/to/my/nginx/files:/srv/nginx \
        -p 80:80 \
        -p 443:443 \
        talentappstore/openresty

repository: gsick/openresty-docker

repo_name: gsick/openresty-docker


text:
# fingers
A Finger In Every Pi: Breadboard component examples built using Node.js and the Raspberry Pi Zero.

## Quick Start
* [Download the Latest Pi Image](https://www.google.com)
* Burn the Image onto a Micro SD card ([Etcher](https://www.balena.io/etcher/) recommended)
* Insert the Micro SD card and Connect to your Pi
* Clone the github [fingers](https://github.com/mhuensch/fingers.git) repository
* Build out the project [breadboard](readme/breadboard.md)
* Run the example [create an anchor](#anchors-in-markdown)

### Components
* [Raspberry Pi Zero W](https://www.amazon.com/gp/product/B0748MPQT4/ref=ox_sc_saved_title_3?smid=AHALS71WJO58T&psc=1)
* [Micro SD Card](https://www.amazon.com/gp/product/B0834R8CBQ/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&th=1)

### Workflow
On Mac: Go > Connect to Server ... > afp://fingers.local
// Use pi as user and same password as above

* Update the codebase to match the node version in .nvmrc
* git clone the latest code: git clone https://github.com/mhuensch/radio.git
* install the latest packages

* To see pins in terminal for ref run pinout in terminal.
* Run gpio readall to see current values

I2C Testing:
* lsmod | grep i2c_
* i2cdetect -y 1

### Wiring Setups
To drop 5V to 3.3V

5vPower > 2.2K resistor > output wire (will be 3.3V) > 3.3K resistor > ground
See voltage divider in readme/Voltage_Divider.svg

### Libraries
In the past I used onoff for node.  However onoff doesn't support more advanced functions like pwm etc.  So I switched to pigpio which is more specific to the pi.  However, this means that when using to restart any application you must release the lock on registered io's by calling:

const pigpio = require('pigpio')
process.on('SIGUSR2', () => {
  pigpio.terminate()
})

NOTE: terminate() will fail on a normal computer (Mac, PC, etc.) and will need to be wrapped in a try/catch when developing new applications there.  SEE: playbook/playbook.js for a good example.

dotenv has been implemented for process.env settings.  To override these settings create a .env
file at the root of this project with the following variables:
INTERACTIVE=true
ALLOW_VIRTUAL=true

PI Pinout: you can get the following information by
running 'pinout' on the Pi in a terminal:

01  3V3**    (1)   (2)   5V***
02  GPIO2**  (3)   (4)   5V***
03  GPIO3**  (5)   (6)   GND
04  GPIO4*   (7)   (8)   GPIO14
05  GND      (9)   (10)  GPIO15
06  GPIO17   (11)  (12)  GPIO18
07  GPIO27   (13)  (14)  GND
08  GPIO22   (15)  (16)  GPIO23
09  3V3**    (17)  (18)  GPIO24
10  GPIO10   (19)  (20)  GND
11  GPIO9    (21)  (22)  GPIO25
12  GPIO11   (23)  (24)  GPIO8*
13  GND      (25)  (26)  GPIO7*
14  GPIO0*   (27)  (28)  GPIO1*
15  GPIO5    (29)  (30)  GND
16  GPIO6    (31)  (32)  GPIO12
17  GPIO13   (33)  (34)  GND
18  GPIO19   (35)  (36)  GPIO16
19  GPIO26   (37)  (38)  GPIO20
20  GND      (39)  (40)  GPIO21

The pins marked with *'s are powered - by default -
when the Pi is powered and no application is connected.

  *   - low power (under 3v)
  **  - 3V of power
  *** - 5V of power

For this reason, you shouldn't connect indicators to these pins
as the indicators will be in powered state until connected
with this node.js application.

TODO: Improve menu and logging
TODO: Improve reloading
TODO: separate indicators and controls.  Indicators do not need to be Emitters
TODO: build the menu from controls that implement change and pass in a value with the selection
  i.e. power 0 -- or  --- power 1 to turn off and on the power
  Not sure how we would handle shave and a haircut in this case but it probably should be an
  override in the menu options for the chapter - not part of the control.
TODO: move GPOID registration into control and indicator but find some way to check unique assignment at playbook start

## Building the Raspberry Pi Image from Scratch
These are the instructions for building the Pi Image above.  If you use that image, there is no need to do these steps, however, I recognize you may need rebuild this image at some point or that you might want to know how the image was created.

#### Install Raspbian
1. Format at least an 8GB [Micro SD Card](https://www.amazon.com/gp/product/B0834R8CBQ/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&th=1) card as FAT/MSDOS (I recommend the 32GB card)
1. [Download](https://downloads.raspberrypi.org/NOOBS_lite_latest) NOOBS Lite
1. Unzip and copy folder contents to the root of the SD card
1. Plug-in Micro SD, HDMI cable, and Keyboard (with mouse attached to KB) to Pi
1. Attach power to the Pi from any 5v source (micro USB recommended)
1. Automatically BOOT into installer and connect to WIFI
1. Select desired OS (recommended Raspbian Lite)
1. Wait for install to finish and wait for auto restart
1. Default user: pi, password: raspberry
1. Find the IP by executing: sudo hostname -I
1. Open the Configuration Tool: sudo raspi-config
1. Change the password
1. Boot: Wait for Network > NO
1. Enable SSH: Interfacing Options > SSH > YES
1. Enable IC2: Interfacing Options > I2C > YES
1. Rename Host:  Network Options > Hostname > [project]
1. Save: FINISH
1. Reboot: sudo reboot
1. (Optional) Disconnect HDMI, Keyboard & Mouse

#### Install Software
1. Switch to main computer to continue ...
1. Connect to PI by starting SSH in Mac terminal: ssh pi@[ipaddress]
1. Enter your password
1. Update: sudo apt update
1. Upgrade: sudo apt upgrade
1. Install Git: sudo apt install git
1. Install IC2 Tools: sudo apt-get install -y python-smbus i2c-tools
1. Install PIGPIO: sudo apt-get install pigpio
1. Install Node.js: wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v.lts.sh | bash
1. Install Apple Filing Protocol: sudo apt install netatalk
1. Edit Apple Filing Protocal Config:
  * sudo nano /etc/netatalk/afp.conf
  * Uncomment and modify lines: [Homes] basedir regex = /home
1. Reboot: sudo reboot

#### Create Image
1. Power down Raspberry Pi
1. Connect Micro SD card to computer
1. Create image from SD card (Mac use Disk Utility > Right Click > Image)
1. Rename the file extension to .iso

#### Use Image
1. Download [Etcher](https://www.balena.io/etcher/)
1. Open etcher
1. Flash from file to target Micro SD card

-- You now have an image and a test Micro SD card!!

## Development
git config --global credential.helper store

## Reasoning
My goal with this project is to document explanations, wiring diagrams, code, and examples for all the most common components (i.e. fingers) I use in my projects.

I chose Node.js for my projects because it allows me to develop large codebases on a Mac (without a micro-controller) and then port that code to an external device.  Yes other languages would have supported this workflow as well, but javascript is available at all levels of the development stack - from web client to micro-controller - so it just made sense.

I chose the Raspberry Pi Zero based on it's form factor, flexibility, and price.  It's easy to setup, configure, deploy, and debug projects built on the Pi in a way that just wasn't possible using other alternatives (Arduino's and their clones etc.).  Even micro-controllers that supported javascript natively (Espruino and Neonious One), don't support a full feature set and come at a much higher price tag.  I've seen people make the argument that using the Rasberry Pi in this way is "overkill", but as a hobbyist, I think this argument is invalidated by the intersection of price and time to finish a project.  No other alternative even comes close.

As a software developer, I am accustom to starting from a project template and modifying/adapting/adding my own components to build out that project.  Think of Ember/Vue/Angular CLI tools, Bootstrap for CSS, etc.  In contrast, examples in the circuit/micro-controller space seem to fall into two categories - really simple blinking LEDs or specific and complicated full blown projects.  There aren't any equivalent "TODO List" projects that you can start from and build out from there.  This repository is my answer to that problem.

## References

* To learn pi/node programming: https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp

repository: mhuensch/fingers

repo_name: mhuensch/fingers


text:
# Course-Recommendation-Expert-System
An Expert system build in Prolog to recommend courses.
**Knowledge Domain**: Decision support to decide programme of study and career options.

`main.pl` = Without uncertainty

1. To start this prolog system, swi-prolog needed to be installed
2. Download swi-prolog from this [link](http://www.swi-prolog.org/Download.html)
3. Open the `main.pl` with the default editor.
4. Type in `main.` and press enter
5. The system is now started
6. Now, inputs the number of choice you are going to pick.
7. For example, there are two choices:

   0. XXXXXXXXXXX
   1. XXXXXXXXXXX

you needed to enter `0.` and press enter to choose the first option, and you needed to enter `1.` and press enter to choose the second option.

8) You should keep answering until the system ends.
9) After that, the system will print the results.


text:
# Function.prototype.name

A `Function` object's read-only `name` property indicates the function's name as specified when it was created, or it may be rather `anonymous` or `''` for functions created anonymously.

## Usage examples

```js
const func1 = function() {};
const object = {
  func2: function() {},
};
const func4 = function func3() {};

func1.name; // -> "func1"
object.func2.name; // -> "func2"
func4.name; // -> "func3"
```

---

[MDN reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name)

repository: melvincarvalho/js-tldr

repo_name: melvincarvalho/js-tldr


text:
# Provision Humio on Microsoft Azure

Requirements
* [Microsoft Azure](https://portal.azure.com) account, including
  * [Microsoft Azure CLI](https://github.com/Azure/azure-cli)
* [Terraform](https://www.terraform.io/intro/getting-started/install.html)
* [Ansible](https://docs.ansible.com/ansible/2.8/installation_guide/intro_installation.html)

## Getting started

Make sure you have logged in using the Azure CLI and the path to your SSH public key:

```bash
az login
az account set --subscription "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
export TF_VAR_ssh_key_data=$(< ~/.ssh/id_rsa.pub)
export TF_VAR_azure_resource_group=humio-ansible-demo
```

Initialise the workspace

```bash
terraform init
```

With that, Terraform is ready to spin up a new environment

```bash
terraform apply
```

In this demo we will configure the following parts
* Virtual network
* Two subnets
  * `frontend` for frontend IP of application gateway
  * `internal` for virtual machines
* Public IP's
  * `ui` for frontend IP of application gateway
  * `main`, one per virtual machine for providing SSH access everywhere
* Virtual machines
  * 3 primary nodes with Zookeeper, Kafka and Humio
  * (optional) 3 secondary nodes with Kafka and Humio
* Network security group
  * Assigned to all VM NIC's to only allow Kafka/Zookeeper traffic within the virtual network
* Application gateway
  * Exposes port 80 using round-robin load balancing with stickyness for accessing the UI.
  * Exposes port 8080 and 9200 using round-robin load balancing for data ingest

## Provisioning Humio

First, make sure you have the required Ansible Galaxy roles installed and the Azure SDK modules.

```bash
ansible-galaxy install --role-file=requirements.yml
pip install "ansible[azure]" azure-cli --user
```

Finally, the cluster can be provisioned with the `site.yml` playbook

```bash
ansible-playbook site.yml
```

Once the cluster is up and running, the Humio web interface should be available using the ui load balancer directly or the public IP's dedicated to each machine. Bare in mind it can take a few minutes before the nodes are deemed healthy by the probe defined on the application gateway.

```bash
open $(terraform output "humio_ui")
```

repository: humio/ansible-demo

repo_name: humio/ansible-demo


text:
lastfmbb
=======
`lastfmbb` is a Ruby gem that uses the Last.fm API to generate BBCode for pasting into your About Me section based on your top artists, albums or tracks.

Installation
------------
`lastfmbb` is available on [RubyGems] [1] and can be installed using the command:

```
gem install lastfmbb
```

Usage
-----
To use the gem, create a `Request` object with the required options:

* API Key: http://www.last.fm/api (required)
* Method: `user.getTopAlbums`, `user.getTopArtists`, `user.getTopTracks` (required)
* User: Last.fm user name (required)
* Time: `overall`, `7day`, `1month`, `3month`, `6month`, `12month` (Optional, defaults to overall)
* Limit: integer results per page (Optional, defaults to 50)
* Page: integer page number to return (Optional, defaults to 1)

Then, pass this object to the `load_and_gen` method, which returns generated BBCode.

Example
-------
```ruby
require 'lastfmbb'

api_key = ""                  # Use your own
method  = "user.getTopAlbums" # Albums, Artists, Tracks
user    = "nodonutweek"       # Last.fm user name
period  = "3month"            # overall, 7day, 3month, 6month, 12month (Optional, default overall)
limit   = 5                   # Results per page (Optional, default 50)
page    = 1                   # Page to return (Optional, default 1)

request = Request.new(api_key, method, user, period, limit, page)
bbcode = Lastfmbb.load_and_gen(request)
puts bbcode
```

License
-------
Copyright (c) 2012 Adam Lazzarato. Released under The MIT License.

[1]: https://rubygems.org/gems/lastfmbb

repository: adamlazz/lastfmbb

repo_name: adamlazz/lastfmbb


text:
---
title: Twicpics Provider
description: 'Nuxt Image internally use Twicpics as static provider.'
navigation:
  title: Twicpics
---

Integration between [Twicpics](https://www.twicpics.com) and the image module.

To use this provider you just need to specify the base url of your project in Twicpics.

```js{}[nuxt.config.js]
export default {
  image: {
    twicpics: {
      baseURL: 'https://nuxt-demo.twic.pics'
    }
  }
}
```

repository: apollonian/image

repo_name: apollonian/image


text:
> Fork of [macbook-lighter](https://github.com/harttle/macbook-lighter)

# macbook-lighter-nvidia

## Table of Contents

- [Description](#description)
- [Setup](#setup)
- [Usage](#usage)
- [Tested Versions](#tested%20versions)
- [License](#license)

## Description

MacBook keyboard and screen backlight adjust on the ambient light with nvidia graphic card.
Internally, macbook-lighter-nvidia reads the following files:

```bash
# /sys/devices/platform/applesmc.768/light
# /sys/class/backlight/nv_backlight/brightness
# /sys/class/backlight/nv_backlight/max_brightness
# /sys/class/leds/smc::kbd_backlight/brightness
# /sys/class/leds/smc::kbd_backlight/max_brightness
```

So you're expected to install corresponding Nvidia/Intel drivers first.

## Setup

### With `sudo`

> All commands including macbook-lighter-kbd, macbook-lighter-screen will be available with sudo privilege once macbook-lighter-nvidia finished install.

### Without `sudo`

__Method: 1__

To use in non-root environment such as [xbindkeys](https://wiki.archlinux.org/index.php/Xbindkeys),
it's recommended to setup an "udev" rule to allow users in the
"video" group to set the backlights.
Place a file /etc/udev/rules.d/90-backlight.rules containing:

```bash
SUBSYSTEM=="backlight", ACTION=="add", \
  RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness", \
  RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
```

And a file /etc/udev/rules.d/91-leds.rules containing:

```bash
SUBSYSTEM=="leds", ACTION=="add", \
  RUN+="/bin/chgrp video /sys/class/leds/%k/brightness", \
  RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"
```

__Method: 2__
Create/Add these commands to `/etc/rc.local` file to change the backlight file mode bits:

```bash
# /etc/rc.local
.
.
.
chmod 777 /sys/class/leds/smc::kbd_backlight/brightness
chmod 777 /sys/class/backlight/nv_backlight/brightness
.
.
. exit 0
```

> Note: If you dont have /etc/rc.local file and rc-local.service (Check by executing `sudo systemctl status rc-local`), follow these steps to create one or both files:

1. Create `/etc/rc.local` file by running `sudo vim /etc/rc.local` and paste these:

```bash
# /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# <Add terminal commands here without sudo>
chmod 777 /sys/class/leds/smc::kbd_backlight/brightness
chmod 777 /sys/class/backlight/nv_backlight/brightness

exit 0
```

2. Make the file executable using `sudo chmod +x /etc/rc.local`

3. If you don't have `rc-local` service too, then:

    a.  Create one by executing `sudo vim /etc/systemd/system/rc-local.service` and paste these

     ```bash
        # /etc/systemd/system/rc-local.service

        [Unit]
        Description=/etc/rc.local Compatibility
        ConditionPathExists=/etc/rc.local

        [Service]
        Type=forking
        ExecStart=/etc/rc.local start
        TimeoutSec=0
        StandardOutput=tty
        RemainAfterExit=yes
        SysVStartPriority=99

        [Install]
        WantedBy=multi-user.target

     ```
     b.  Enable it to start with system by running `sudo systemctl enable rc-local` and reboot. Check the status of your service file by executing `sudo systemctl status rc-local`.

## Usage

```bash
# Increase keyboard backlight by 50
macbook-lighter-kbd --inc 50
# Increase screen backlight by 50
macbook-lighter-screen --inc 50
# Set screen backlight to max
macbook-lighter-screen --max
# start auto adjust daemon
systemctl start macbook-lighter
# start auto adjust interactively, root previlege needed
macbook-lighter-ambient
```

## Tested Versions

* MacBook Pro Mid 2010 13" (7,1)

## License

[MIT License](/LICENSE)

repository: ashwamegh/macbook-lighter-nvidia

repo_name: ashwamegh/macbook-lighter-nvidia


text:
The test framework uses [Jest](https://jestjs.io/), a test framework by Facebook. This is utilised as it’s one of the more flexible and powerful testing frameworks around.

# Jest concepts

Jest is multi-process. There’s a main Jest process, which spawns a pool of workers that in turn execute the individual test suites (e.g. individual -test.js files). The environment of this main process is different to the worker, which can complicate getting information between the child process and the parent.

Jest internally uses a [fork](https://github.com/facebook/jest/tree/master/packages/jest-jasmine2) of [Jasmine](https://jasmine.github.io/). This is used as the test runner, and implements common test features such as `describe` and `it`.

# Logging/reporting pipeline

Jasmine and Jest are designed for binary test states: a test either passes or fails. OpenActive’s needs are a little different. More debugging level information is required to help booking system developers act on failures and there are different levels of failures (i.e. warnings, information, suggestions).

The process can be summarised as:

- [Jasmine reporter](test/test-framework/jasmine-state-reporter.js): provides state info
- [Logger](test/helpers/logger.js): uses state info, used by tests to record info
- [Jest reporter](test/reporter.js): used to capture test results, and kick off report generation
- [Report generator](test/report-generator.js): generates the reports in both markdown and for cli.

## Jasmine Reporter

This is a state tracker for internal use by the logger, this allows determining within tests the current running test and suite. Throughout execution, it keeps track of the ancestors which allows re-building the tree of parents, so that a full path can be returned at any time.

There is also an EventEmitter implemented in the helper, allowing the logger to listen for these same events, at present only the suite ended event is listened for - this is used as a hook to save files upon finishing.

## Logger

A logger component has been implemented. This is mostly a data collection tool which gathers the necessary info, and saves a log of it within JSON files. The JSON file is deterministically named based on the describe blocks, which allows picking it back up in a later phase.

This has helper methods for attaching info to the current running test:

- Request:
    - Saves request (payload, url)
    - Response (headers, status, response, response time)
    - Records whether a response was never received (i.e. timedout)
- Validation:
    - Validation responses from [https://github.com/openactive/data-model-validator](https://github.com/openactive/data-model-validator), the same library behind [https://validator.openactive.io/](https://validator.openactive.io/)
- Specs:
    - Spec result status, this is the result of each `it` test - note that this can’t happen during runtime and happens in the next phase.

## Jest reporter

The Jest reporter takes in the files produced by the logger, at this point we have the test statuses. The test statuses are added to the json file and re-saved. The Report Generator is kicked off.

## Report generator

This is mostly a wrapper around the logger. This implements the various templating methods such as JSON formatting, colour handling, status icons, etc.

In addition, the logger has helper methods to extract events of a particular type, and to iterate through suite names.

The report itself uses Handlebars (a Mustache influenced/compatible templating engine), this runs using the logger helper methods, in addition to the Handlebars helper methods added in the reporter.

# Request / Flow

The test framework uses a number of request helpers and state trackers to simplify implementation of tests.

These consist of:

- [Chakram](http://dareid.github.io/chakram/): This is a HTTP test framework designed for Mocha (however it works fine on Jest)
- [Request helper](test/helpers/request-helper.js): This makes requests, and records the request + response against the logger. There are methods to directly make requests, along with methods for each API endpoint.
- [Flow Stages](test/helpers/flow-stages/flow-stage.js): A part of the booking flow (e.g. the C1 request). Use it to call the relevant API endpoint. When called, it stores the results, which can then be applied to successive Flow Stages (e.g. C1 output can be used for the C2 request).
# Test flow

- [Feature helper](test/helpers/feature-helper.js): This wraps up the initialisation of the test, implementing the describe blocks and initialising the logger.

## Feature Helper

This is a class that abstracts away much of the above. This implements the `describe` blocks and initiates the logger.

i.e.

```
FeatureHelper.describeFeature(module, {
  testCategory: 'core',
  testFeature: 'availability-check',
  testFeatureImplemented: true,
  testIdentifier: 'availability-confirmed',
  testName: 'Occupancy in C1 and C2 matches feed',
  testDescription: 'Runs C1 and C2 for a known opportunity from the feed, and compares the results to those attained from the feed.',
  // The primary opportunity criteria to use for the primary OrderItem under test
  testOpportunityCriteria: 'TestOpportunityBookable',
  // The secondary opportunity criteria to use for multiple OrderItem tests
  controlOpportunityCriteria: 'TestOpportunityBookable',
},
function (configuration, orderItemCriteria, featureIsImplemented, logger) {
```

repository: openactive/openactive-test-suite

repo_name: openactive/openactive-test-suite


text:
---
parent: Administrator
version: 4.2
---

# Command Line Tools

If users do not already have the `oc` command line tool, they can download the version corresponding to the OpenShift cluster they are using from the Command Line Tools page. They can also download OpenShift do (`odo`) from this page. More command line tools will be added to this page over time.

## Help Menu
![dropdown](img/dropdown.png)
* The command line tools page will be accessible from the help menu.

## List view
![list](img/data-list.png)
* The command line tools page will be a full page list view. Each row will have the tool name, description, and download link.
* **Note**: These descriptions are placeholder and will be reviewed and updated if and when the tools are added in future.

repository: openshift/openshift-origin-design

repo_name: openshift/openshift-origin-design


text:
# Project Log

## 2020-11-21

### Raspberry Pi Upgrade

Installed RPi4 4GB.

Observed error:

```
mosquitto_1   |<PHONE_NUMBER>: Loading config file /mqtt/config/conf.d/websockets.conf
mosquitto_1   |<PHONE_NUMBER>: Error: Websockets support not available.
mosquitto_1   |<PHONE_NUMBER>: Error found at /mqtt/config/conf.d/websockets.conf:2.
mosquitto_1   |<PHONE_NUMBER>: Error found at /mqtt/config/mosquitto.conf:18.
```

Had to disable mosquitto websockets by commenting out the following in srv/mosquitto/config/conf.d/websockets.conf

Root cause not yet identified.

### v0.98

Built and installed v0.98, which consists of submodule updates to master, and built with ESP-IDF 3.3.

### v0.99

Address issue #3 [Inhibit Circulation Pump operation when purge pump is operating](https://github.com/DavidAntliff/esp32-poolmon/issues/3).

Built with ESP-IDF v3.3 and installed via OTA.

### v1.0

Address issue #4 [Prevent potential freezing in winter by running circulation pump when array temperature is below threshold](https://github.com/DavidAntliff/esp32-poolmon/issues/4).


text:
# Generate TV Script using an RNN (pytorch)

Overview of the Project:

1. Get the Data. In this case, parts of Scripts from the show Seinfeld are used.
2. Pre-Processing - cretating a vocabulary, vector embeddings, tokenizing, converting to lowercaseetc.
3. Building the RNN. Here, an LSTM cell is used.
4. Training the model on the train dataset.
5. Testing the model.
6. Generate TV script with a few lines of input from the original script.

repository: sumanth-vs/tv-script-generator

repo_name: sumanth-vs/tv-script-generator