text:
---
layout: post
comments: true
title: Viva L'Creative
tags:
 - Audio
 - Technology
---

So I went the latest **Creative Warehouse Sale** last Friday. And I was so excited! All the cool technology for me to touch and feel and listen to! Lemme do a summary of the stuff I saw there.

**-[The X-Fi.][0]** Creative's new flagship Sound Blaster. Really cool sound card for the semi-audiophiles out there. Has a really nice upconverting feature. _Upconverts_ from 16bit to 24bit as well as from 2.0 to 5.1! I really wanna know how they do it. I do know though that they need a really poweful DSP (which they sport, something with 10,000 MIPS!) for all the stuff they are doing.

**-[The HQ-2300D][1].** Really cool headphones. They have their own DAC and Amps in a small little box  That means nicer coupling and better sound! No more "_damn it i bought these cool guy headphones but there is impedence mismatch with my driver._" Also they support Dolby Digital or DTS inputs, by having its own decoder (inside that box)! This guy can optimise your 5.1 DTS or Dolby Digital for a headphone. Kinda like the Holophonic sound thingy. The best part is that if you dont't have 5.1 source, it can upconvert the 2.0 to 5.1 for you, just like the X-Fi!

-[**The Zen Vision M.** ][2]Saw the so called iPod killer. Have the agree that the UI is **not** as intutive as the iPod. Took me and TheWeed like 5mins to figure out how to use the scroll pad thingy. Oh and its huge! But still if I ever buy one, might go with Creative. It's the accessories and extra functions. Oh and also the codec support.

**-The Decoders and Mixers.** More like connectivity options for the various Creative devices that people own. Nice ideas, especially the fact that they have so many options.

**-The Creative In-ear headphones.** Keng bought one of those, says they are really as efficient as they promise to be! Have been thinking about those since I heard Robert Heron from DL.TV ranting about it!

**-The Creative Prodikeys and family.** Cool stuff, one day when I know more about music I'll think about these

**-The S$39 1st Gen mp3 players.** Would be fun just to open it up and see whats what!

**-The Creative Webcams.** Going at _insane prices_ !

So what did I buy? **Nothing** :( What do I want? The X-Fi, the HQ-2300D and most importantly a **Job**!! Would be so cool to work with Creative! :D

[0]: http://en.wikipedia.org/wiki/Sound_Blaster_X-Fi
[1]: http://sg.creative.com/products/product.asp?category=437&subcategory=438&product=11430
[2]: http://sg.creative.com/products/product.asp?category=213&subcategory=214&product=14331

repository: notthetup/blog

branch_name: refs/heads/gh-pages

repo_name: notthetup/blog


text:
---
layout: post
title: "Syntax Directed Translator"
description: "Syntax Directed Translator"
categories: [Compiler]
tags: [Compiler]
redirect_from:
  - /2018/04/22/
---
## Syntax-Directed Translator
**syntax**: the proper form of its program -> context-free grammar or BNF(Backus-Naur Form)
**semantic**: meaning of the program

goal: syntax-directed translation of infix expressions to postfix form.
![image](/assets/images/1523682572902.png)
![image](/assets/images/1523682697277.png)

These are two intermediate representation forms.

### Syntax Definition
```
stmt -> if (expr) stmt else stmt
```
This is one **production**. In a production, lexical elements like the keyword **if** and the parentheses are called **terminals**. Variables like **expr** and **stmt** represent sequences of terminals and are called **nonterminals**.
**context-free grammar elements**
>  1. A set of terminal symbols(refered as tokens)
>  2. A set of nonterminals, sometimes called **syntactic variables**
>  3. A set of productions, where each production consists of a nonterminal, called the head or left side of the production, an arrow, and a sequence of terminals and/or nonterminals , called the body or right side of the production
>  4. A designation of one of the nonterminals as the **start** symbol.

#### Derivations
A grammar derives strings by beginning with the start symbol and repeatedly replacing a **nonterminal** by the body of a production for that nonterminal.
example for function call:
```
call -> id(optparams)
optparams -> params | epsilon
params -> params, param | param
```
`epsilon` represents empty string of symbols.
### Parse Trees
Parsing is the problem of taking a string of terminals and figuring out how to derive it from the start symbol of the grammar.
 ![image](/assets/images/1523683797606.png)

From left to right , the leaves of a parse tree form the **yield** of the tree, which is the string **derived** from the nonterminal at the root of the parse tree.
### Ambiguity
A grammar can have more than one parse tree generating a given string of terminals. Such a grammar is said to be **ambiguous**.
#### Operator Assocaitivity
Like `9 + 5 + 2`, this expression can be evaluated as `( 9 + 5 ) + 2` or `9 + (5 + 2)`. We
say that the operator + associates to the left, because an operand with plus signs on both sides of it belongs to the operator to its left.
**left-associative**: addition, subtraction, multiplication, division
**right-associative**: equal, exponentiation
strings like `a = b = c` can be generated by rules like
```
right -> letter = right | letter
letter -> a | b | ... | z
```
#### Operator Precedence
`*` has higher priority than `+`
```
term -> term * factor
		 | term / factor
		 | factor
expr -> expr + term
		| expr - term
		| term
factor -> digit | (expr)
```
factors are expression which cannot be "torn apart“ by any operator.
Terms is an expression that can be "torn apart" by operators of the higher precedence, but not by the lower precedence operators.
![image](/assets/images/1523684714372.png)

### Syntax-Directed Translation
Syntax-directed translation is done by attaching rules or program fragments to productions in a grammar.
**Attributes** An attribute is any quantity associated with a programming construct.
Examples of attributes are data types of expressions, the number of instructions in the generated code, or the location of the first instruction in the generated code for a construct , among many other possibilities.
**translation schemes** A translation scheme is a notation for attaching program fragments to the productions of a grammar. The program fragments are executed when the production is used during syntax analysis.
#### Synthesized Attributes
The idea of associating quantities with programming constructs -- for example, values and types with expressions --  can be expressed in terms of grammars.
A **syntax-directed definition** associates:
1. With each grammar symbol, a set of attributes, and
2. With each production, a set of **semantic rules** for computing the values of the attributes associated with the symbols appearing in the production.

![image](/assets/images/1523687837245.png)

![image](/assets/images/1523688227467.png)

The string representing the translation of the nonterminal at the head of each production is the concatenation of the translations of the nonterminals in the production body, in the same order as in the production, with some optional additional strings interleaved.
![image](/assets/images/1523816009378.png)

**Tree traversals** will be used for describing attribute evaluation and for specifying the execution of code fragments in a translation scheme.
```
DFS
procedure visit(N) {
	for (each child of N, from left to right) {
		visit(child);
	}
	evaluate rule at N;
}
```
If the action is done when we first visit a node, then we may refer to the traversal as a preorder traversal. Similarly, if the action is done just before we leave a node for the last time, then we say it is a postorder traversal of the tree.
A **syntax-directed translation**  scheme is a notation for specifying a translation by attaching program fragments to productions in a grammar.
**the order of evaluation of the semantic rules is explicitly specified**
Program fragments embedded within production bodies are called **semantic actions**. The position at which an action is to be executed is shown by enclosing it between curly braces and writing it within the production body
```
rest -> + term {print('+') } rest1
```
![image](/assets/images/1523817208488.png)

### Parsing
Parsing is the process of determining how a string of terminals can be generated by a grammar.
Parsing techniques : "top-down", "bottom-up"
#### Top-Down Parsing
![image](/assets/images/1523817869025.png)

1. At node N, labeled with nonterminal A, select one of the productions for A and construct children at N for the symbols in the production body.
2. Find the next node at which a subtree is to be constructed, typically the leftmost unexpanded nonterminal of the tree.
This method requires trail and error, and backtracking. May not be a good candidate
#### Predictive Parsing
**recursive-descent parsing** is a top-down approach. Here we consider one simple version--predictive parsing:
> The sequence of procedure calls during the analysis of an input string implicitly defines a parse tree for the input

```
void stmt () {
	switch ( lookahead ) {
	case expr:
		match (expr) ; match (' ; ') ; break;
	case if:
		match (if) ; match (' C'); match (expr) ; match (' ) ') ; stmt O ;
		break;
	case for:
		match (for) ; match (' C');
		optexpr O ; match (' ; ') ; optexprO ; match (' ; ') ; optexprO ;
		match (' ) ') ; stmt O ; break;
	case other;
		match (other) ; break;
	default:
		report ( " syntax error " );
}
void optexpr() {
	if ( lookahead = = expr ) match (expr) ;
}
void match (terminal t) {
	if ( lookahead = = t ) lookahead = nextTerminal;
	else report ( " syntax error " );
}
```
Predictive parsing relies on information about the first symbols that can be generated by a production body. Our predictive parser uses an E-production as a default when no other production
can be used.

let $\alpha$ be a string of grammar symbols (terminals and/or nonterminals). We define First($\alpha$) to be the set of terminals that appear as the first symbols of one or more strings of terminal generated from $\alpha$.
```
FIRST ( stmt) = { expr, if, for, other}
FIRST( expr ; ) = {expr}
```
A predictive parser is a program consisting of a procedure for every nonterminal. The procedure fot nonterminal A does two things:
1. It decides which A-production to use by examining the lookahead symbol. The production with body $\alpha$is used if the lookahead symbol is in FIRST ($\alpha$) .
2. The procedure then mimics the body of the chosen production.

#### Left-recursion
```
expr -> expr + term
```
It's possible for a recursive-descent parser to loop forever if the leftmost symbol is the same as head. Since the lookahead symbol changes only when a terminal in the body is matched, no change to the input took place between recursive calls of `expr`.
> A -> A$\alpha$ | $\beta$
> can be replaced by
> A -> $\beta$R
> R -> $\alpha$R | $\epsilon$

The first one is left-recursive, the second is right-recursive. But right recursive makes it hard to translate left-associate operators.
![image](/assets/images/1523820504263.png)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
hrs_structure:
  division: '4'
  volume: '13'
  title: '33'
  chapter: '626'
  section: '626:1-903'
type: hrs_section
tags:
  - Court
  - Judicial Proceeding
menu:
  hrs:
    identifier: HRS_0626-0001-0903
    parent: HRS0626
    name: Chapter 626 Hawaii Rules of Evidence
weight: 35395
title: Hawaii Rules of Evidence
full_title: Chapter 626 Hawaii Rules of Evidence
---
**Rule 903 Subscribing witness' testimony unnecessary.** The testimony of a subscribing witness is not necessary to authenticate a writing. [L 1980, c 164, pt of §1]

RULE 903 COMMENTARY

This rule is similar to Fed. R. Evid. 903, except that the present rule eliminates the clause, "unless required by the laws of the jurisdiction whose laws govern the validity of the writing." It supersedes a statute, Hawaii Rev. Stat. §622-1 (1976) (repealed 1980) (originally enacted as L 1876, c 32, §62; am L 1972, c 104, §2(a)), which provided: "It shall not be necessary to prove an instrument by the attesting witness if attestation was not required in order for the instrument to be valid...."

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# Node Foundation TSC Meeting 2015-09-02

## Links

* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-09-02
* **GitHub Issue**: https://github.com/nodejs/node/issues/2654
* **Minutes Google Doc**: https://docs.google.com/document/d/1rXBdtsD9PJTExNXgzNZ9bez9oOjW45kLPjun4zdt0dY
* _Previous Minutes Google Doc: <https://docs.google.com/document/d/1aB76ClCgdjZUw3p-gHq9j6YwU11zWgJ4pmYPEWk6gjE>_

## Agenda

Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting.

### nodejs/node

* deps: update v8 to <IP_ADDRESS> [#2632](https://github.com/nodejs/node/pull/2632)
* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546)
* Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522)
* doc: update COLLABORATOR_GUIDE.md [#2638](https://github.com/nodejs/node/pull/2638)

### nodejs/build

* Merge job overwrites metadata [#179](https://github.com/nodejs/build/issues/179)

## Minutes

### Present

* Rod Vagg (TSC)
* Brian White (TSC)
* Steven R Loomis (TSC)
* Fedor Indutny (TSC)
* Bert Belder (TSC)
* Colin Ihrig (TSC)
* Trevor Norris (TSC)
* James M Snell (TSC)
* Chris Dickinson (TSC)
* Jeremiah Senkpiel (TSC)

### Standup

* Rod Vagg (TSC): node v4 prep, new website
* Brian White (TSC): issue/PR reviewing, working on JS DNS implementation some more
* Steven R Loomis (TSC): syncing with james, creating text for renaming of language groups (#2525), intl triaging, commenting on joyent/node issues
* Bert Belder (TSC): indisposed until end of october
* Colin Ihrig (TSC): reviewing issues/prs
* Trevor Norris (TSC): prs/issues, finagling the new build pr landing tool
* James M Snell (TSC): old prs in joyent/node cleaned up (64 remaining, wow), citgm tool updates, child process arguments pr, nodeconf.eu
* Michael Dawson (TSC): AIX support PR, some triage with Devin, preparing for NodeConfEU
* Chris Dickinson (TSC): Static analysis work (ongoing), docs (slowly), npm
* Jeremiah Senkpiel (TSC): v4 release prep
* Fedor Indutny (TSC): v8 arraybuffer perf, patch landed on v8; reviewing PRs

### Jenkins merge jobs always overwrites PR-URL and Reviewed-By [#179](https://github.com/nodejs/build/issues/179)

Trevor: currently if you submit a job to land a pr, it will always remove all existing metadata and re-apply it based on the info passed to the jenkins build. from convo, good fix is to let old metadata persist & only append new metadata if it’s entered, if no metadata entered, nothing appended
Issue with current state: current system does not work for cherry-picks onto release branch — will wipe metadata and replace it
Goal: solidify with TSC that this is a good path forward

James: absolutely, +1

Jeremiah: clarification on which branches this applies to

Rod: cherry-picks are becoming increasingly difficult on iojs anyway, so the pr landing job may be master-specific

James: no mixing of “with pr tool” and “manually”, things go bad quickly that way

Trevor: cherry-pick PRs are accumulating too many cherry-picks; runnin it through the system manually doesn’t add useful info

Domenic: description of chromium
 - tests are run after landing
 - no one is allowed to land commits if the build is broken on a branch
 - sheriff of the day is responsible for fixing the issue
 - in practice it’s painful, but it’s important for keeping things sane

Trevor: this would make us better about flaky tests, also, admiration for how sporadically our flaky tests break

Jeremiah: trying to do this now before v4 seems like a bad idea

Rod: we’re smoothing out a little bit; circle back to original topic, we’re kind of talking about the larger issue, let the trial of the tool continue and come back to the discussion later. specifically: ask that metadata not be overridden in a github issue

Domenic: addressing jeremiah’s concern: should we not run the trial while releasing v4?

Trevor: agreement — have felt pain from this as we march to v4

Jeremiah: stuff that gets released to people is in the release branches, if we’re not using the pr tool on that branch, what is the point of using this tool?

Rod: this will become more of a problem as we have more extended and LTS

Domenic: clarification: intent of ci is to make sure tests pass everywhere

Trevor: this tool only runs a subset

Rod: since we branched 3.x there’s 4 commits in the tree that have faulty/missing metadata — like that the pr tool is enforcing this metadata, maybe move to using github status api for telling us whether the metadata is OK

Trevor: clarify: contributors have landed commits that lack metadata?

Rod: yep

Trevor: argh

Jeremiah: github suggested we use the status api

Trevor: status api autoruns?

Rod: you hook it up to webhooks, has in-progress and pass/fail

Trevor: TJ can verify that devs destroy jenkins (multiple force pushes explode the jenkins box with so many jobs)

Rod: we can cancel on force push (or add a “trevor is pushing, wait half an hour to run the tests” exception, har har)

Jeremiah: you can tell if it’s been run on the last commits

Rod: multiple statuses — up to 100? — “this pr is passing on these platforms! this pr has the right metadata. this pr lints well.”

Rod: let’s move on!

James: what’s the action item?

Rod: don’t feel that we should cancel the trial

Trevor: two prs that prevent segfaults because of other flaky tests that have to be reapplied

James: in the 4.x branch do we need to use test-pr job to land commits?

Rod: nope, cherry-pick onto those branches, only use the tool on master

Jeremiah: it’s weird to use it on the unstable branch. I guess we could make it better for release branches in the meantime
* ci-run middle of hte night us time this has a

Rod: vote for who whether we’d like to put this on hold

Jeremiah: +0 put on hold

Rod: who would like to continue it?

...crickets...

Trevor: give me another day

James: one PR took 8 hours to land last friday

Jeremiah: they take about an hour to land right now

Rod: they are getting quicker, adding raspberrypis to the cluster. good incentive to make node startup time quicker! arm startup times have gone down over the last month or so

Rod: let’s move on

### doc: update COLLABORATOR_GUIDE [#2638](https://github.com/nodejs/node/pull/2638)

Jeremiah: Alexis wanted to put the pr tool into the collaborator guide should punt on this right now notifying collaborators on issues is more effective messaging than the docs

Rod: let’s hold off

### deps: update v8 to <IP_ADDRESS> [#2632](https://github.com/nodejs/node/pull/2632)

Rod: looking at the possibility of jumping to 4.5 for the v4 release it’s ready to merge. ofrobots has been doing the work, it’s good to go, there are pros and cons whether we stick with 4.4 or 4.5 for this release & associated LTS has anyone done any work on testing NAN?

Bert: what breaks? what are the cons?

Domenic: looking at v8 by code inspection, there are no breakages, just new deprecations — should *in theory* work — I don’t think anyone’s been testing it though

Bert: can this v8 release be supported for LTS? we don’t know if this is better or worse than 4.4? maybe ask goog eng

Trevor: they will say “Stay current”

Bert: I think I agree with them — with no other info, picking the latest version seems best

Michael: Z targets 4.4 — just recently got it fully clean — a move to 4.5 would cause a delay on getting release to community

James: that’s just Z, not PPC, yes?

Rod: how much work?

Michael: going 4.3->4.4 took about a month

Jeremiah: 4.3->4.4 breakage delta was much bigger

Rod: that’s the external API though

Michael: 7-8 patches/week? if we have to upgrade it will be extra work + delay for us

James: if we’re sitll looking at LTS in early-mid oct, it’s going to give us a month to prove out v8 4.5

Domenic: we’ve been proving out 4.5 for 12 weeks

Rod: we’re talking node here, though we’d have google support for an extra month. my concern is: we need v4 out now, latest by monday, this is a quick change and there’s potential for breakage

James: we decided before that we weren’t going to make such a big change so quickly before a release. i agree with rod, but such a big change makes me nervous — making sure that nan et al works with 4.5 is a concern

Jeremiah: we’re not going to be the ones to find the flaws in 4.5; want clarification on nan major/minor/patch?

Rod: minor

Domenic: should require no changes

Rod: benjamin (kkoopa) is on the positive side of this, he wants to see us move to 4.5, and is willing to put in the work to do this

Trevor: not that it matters much, but node has taken a hit from v8 in terms of perf recently, 4.5 has some improvements, fedor wrote an easily backportable patch as well, there are perf advantages

James: it makes me nervous that we’ll have enough time to test things on the node side before LTS — if we’re comfortable saying we have a plan that we think exercises this before going LTS, I’m more ok

Jeremiah: technically we have over a month

Rod: vote

who is leaning sticking to 4.4

James + michael + steven

4.5:

fedor, colin, jeremiah, brian, chris

Rod: clarifying concerns

Michael: share concerns with james, but also Z

Rod: longer we have to support our own V8, the harder it is, and another 6 weeks of support would be great great

James: I’m -0

Rod: spending some time today testing some existing addons taht have upgraded to nan@2. if there’s breakage, that tells me nan’s not ready, and that should be taken into account

Domenic: if nan’s not ready, we don’t upgrade

Rod: heading for 4.5, but with final go/no-go coming from nan testing; where are you at on this bert?

Bert: I am happy to upgrade if you land it and nothing changes — which sounds like it might be the case (sans deprecation warnings)

Rod: want ben’s opinion, but there may be no chance of that?

Bert: it seems silly to go with a version that is almost already out of support, but OTOH, on the scale of LTS lifetime, 6 weeks is not really significant

I wouldn’t worry too much about actual bugs in v8, about as likely in 4.5 as in 4.4; LTS is not about “no bugs”, it’s about “We support it”

Rod: we want a **solid** release, though

Bert: the LTS will also have a beta for a while, yes?

Rod: the beta period for LTS is the stable line

James: first LTS will have a beta of a little over a month, in the future 6 months

Bert: realistically a month is a longer beta than we’ve ever had before

Rod: 0.12 had a beta of 2 years

{zing} :trollface:

Bert: a beta with a lot of api changes, which is explicitly what we’re not going to do

Bert: we need to move on

Jeremiah: 4.5 brings arrow functions and that will make many people very happy

Rod: it’s a good sales pitch!

Rod: I’ll make the call.

### Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522)

Rod: status update: v4 was to get out by Thurs, slipping on that, monday is the release date, cannot afford to slip any further

Jeremiah: what’s actually slipping other than mdb?

Rod: we’re not going to get mdb into v4, encourage before LTS, but that’s the best we can do, child process argument type checking where are we at on that?

Trevor: it’s not ready

James: working on that PR right now

Rod: great, that feels like a fairly light one, process.send is the other one; ben’s on holiday, where are we at with that pr of his

Jeremiah: multiple people have soft signed off on it

Colin: weren’t there some strange ci failures with it?

Rod: do not know, does someone want to put their hand up for that?

Trevor: what’s the PR number?

Jeremiah: #2620

Jeremiah: Trevor +1’d it

Jeremiah: OH! that’s the one with the weird test failures we could not reproduce the breakage

Rod: this seems like it can be run again and it won’t show flaky tests: maybe we should just re-run it

Trevor: that really sucks when you’re trying to land 3 tests

Rod: test runner should auto-rerun to make sure

Trevor: oh, gotcha

Rod: that’d be really quick for flaky tests

Trevor: I’ve already reviewed and LGTM’d it, I’ll look at running it through the land-ci job

James: looked at it earlier today, nothing concerning stood out

Rod: no RC’s are out! that’s a problem! we’ve renamed the executable. I wanted to have a period of time where folks could download (with a working node-gyp) — we need this period of time. I’ve been working on that, some bits and pieces to get things to the right place on the server. first build had a broken OS X installer. there are a few yaks yet to shave, so that’s why we can’t get this out by thursday

Rod: steven: could you confirm that 3.x has INTL enabled?

Steven: will look into, take as action item (confirmed!)

Rod: not going to tick that off till we confirm, but I _think_ that one’s done

Rod: how’s everyone with the timeline? rcs ASAP + release on monday

James: sounds reasonable, yes. will take as much time as possible on monday. several of us will be at nodeconf, so that complicates

Rod: I’m using monday in airquotes, it’ll be tuesday for me. other thing: smoke testing, citgm, I’ve been using it, and there are a lot of weird failures, after v4 we’re going to have to switch modes to make the ecosystem happy with it

Rod: let’s move ahead with that plan; nodeconf.eu is going to take up a lot of time for a lot of folk. congrats to everyone that contributed to new website, it seems really smooth

### Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546)

Rod: opened by member of v8 team, extracting debugger code from blink and making it so all embedded v8 projects can use it

Trevor: gist is: devtools team is considering pulling inspector out of blink into its own project so we could consume it; domenic can correct me wherever I’m wrong here,

Domenic: “making node work the same as android” able to point chrome dev tools at node processes to debug ‘em

???: only works with chrome

Trevor: OTW API we consume have remained fairly stable, even if the API does change, chrome dev tools is capable of pulling in a previous version, making sure it’s possible to use with LTS releases

OTW wire is generic, consumable by anyone, chrome dev tools is a key consumer, but anyone can consume (new consoles can compete!)

cons:

APIs going to need to be tightly integrated — needs to know about all async events
  add conditionals to e.g. nextTick + timers

Domenic: add something to MakeCallback?

Trevor: we have to add it to that + on the way back in

Domenic: this is for async stack traces

Trevor: we don’t have to have it

Bert: that’s awesome, because we have to grow a single entry point (opposite MakeCallback)

Trevor: not going touch nextTick/timers, though — need to wrap each (because those APIs don’t roundtrip to C++ for each callback)

Bert: we don’t have to do that immediately though, but eventually it’d be a good idea

Domenic: could also move to microtask for nexttick — integrating with domains sounds hard, then we get those events for us

Trevor: would you be able to do unhandledRejections?

Domenic: we already have this for promises

Rod: if we could use this as a good justification for removing domains, that’d be awesome

Trevor: next point is pro and con: importantly, we’d have to support websockets natively in node

Jeremiah: we could just keep ‘em private

Trevor: that would just anger people

Domenic: you could bundle them and hide them while you’re not clear on the api, iterate and expose later

Rod: that’s a good point

Trevor: the interesting flip to this: they need to be running off the main thread, in a debugger thread — it can all be written in C++

mscdex: any way to avoid websockets?

Trevor: no

Bert: is the protocol really that complicated? I don’t think so — especially sans full HTTP and WSS — just websockets though is probably not difficult

Trevor: necessary because it’s the protocol that chrome dev tools uses

Rod: decision points: are we being asked to get on board?

Trevor: them removing the inspector from blink depends on whether we’ll use it if they do it.

Rod: debugging in node sucks, we are shipping with substandard debugging in v4, we don’t have the contributors + collaborators to make this better, so if we can lean on v8 to do this, I’m +1

debugging is important enough to override “small core”

Bert: we’re not adding the full inspector, _just_ the protocol

Trevor: wasn’t completely clear on how much API we’d need to implement

Domenic: we should get clarification on this

Trevor: if we can implement this in segments — if we’re all +1 on this, we need to create a new isolate, but …

Domenic: would the workers pr solve this?

Trevor: probably overkill. I’m +1 on the debugger

Bert: I propose we don’t vote

{broad assent}

Rod: trevor + domenic: you’ve got enough input

Domenic: only worry is finding someone to devote some of their daytime hours to implement websockets

Rod: nodesource could contribute, related to our interests

Trevor: even if we don’t say yes today, taking inspector out of blink is a complicated process and will take time

Rod: anything else?

### Next Meeting

September 9th

branch_name: refs/heads/main

gha_license_id: MIT


text:
---
id: 12028
title: Walking to raise money
date: 2014-06-15T15:00:40+00:00
author: Ann
layout: post
guid: http://gofitgirl.com/?p=12028
permalink: /2014/06/15/walk/
sfw_pwd:
  - Y7qGYc5peK4M
categories:
  - general fitness
  - general health
tags:
  - fundraising
  - pancreatic cancer action network
  - walking
---

    I will be walking as a member of Team Goldman next Sunday. Here’s a link to my fundraising page.

Next Sunday I am getting up at an ungodly hour on my precious day off to head to San Francisco to walk with my friends/co-workers to raise money for the Pancreatic Cancer Action Network.
We are walking in honor of a great man who left this world too early a year ago today.
I was hoping to be No. 1 fundraiser on my team. So unless any of you want to donate 600 bucks I will have to settle for second place, which is pretty awesome, too.
But I have one week to continue raising money for this important cause.
If you would like to donate to me, please visit [my personal fundraising page](http://purplestride.kintera.org/faf/donorReg/donorPledge.asp?ievent=1089448&lis=1&kntae1089448=716ABE45F384412CA013B22E0B184852&supId=403701865).
And hey, besides raising money for something important I will also be walking about 3 miles (and hopefully on a gorgeous San Francisco day).

repository: cpoff/gofitgirl-jekyll

repo_name: cpoff/gofitgirl-jekyll


text:
# mmpkg - A Collection of scripts for mudlet, for use in Materia Magica

## Screenshots:
How it looks inside:
![](https://github.com/breakone9r/mmpkg/raw/master/Screenshot1.png)

How it looks outside:
![](https://github.com/breakone9r/mmpkg/raw/master/Screenshot2.png)

## Below you'll find mostly-up-to-date info on available commands and aliases.

 It works from any mapped room in the game.

**mapper goto** this command allows you to input either a room number, or a partial room name, and will in the case of the former, just run you to the room number specified, or in the case of the latter, run you to the closest room to match the partial room name.

**mapper path** will show you a printout of the exits needed to get to the room number, as well as highlight the path in the mapper.

**mapper find** this is to be used to find rooms in your current zone with specific flags or features, all room flags are supported (safe, high-regen, low-regen, etc) as well as shop, trainer, sign.

**mapper where** this can be used to locate rooms where the room name matches the provided option. example: (mapper where audience) will return all rooms with the word audience in the name. This can also be configured to only show rooms in your current area.

**mapper stop** stops any active speedwalks

**mapper clear** clears all highlighted rooms.

**mapper update** this will download and install the latest available maps. This WILL overwrite any areas you may have mapped, as well as any customization you may have done to your local map's layout. Use with care!

**mapper shop** Toggles the current room as a shop. If it's not known as a shop, it's set to one, if it is, then it's set to not a shop any more. This is used in conjunction with mapper find shop to list shops in your area. If you find a shop that isn't listed, you can use this command to fix it.

**mapper trainer** This does the same as the above command, but for trainers.

**Please note that rooms can be set to both shop and trainer, and the room color will be whichever was set last. Also, PK and Safe room colors will always override shop and trainer colors.**

### In addition to the mapper command, there is also mmpkg, which shows/controls configurations.

**mmpkg** by itself will give you a help screen.

**mmpkg update** will check for, and install the latest version.

**mmpkg pages** will show the pages window if you've closed it.

**mmpkg config** brings up a configuration screen.

**mmpkg sounds** Download and install official Materia Magica soundpack.

### There are also the following aliases set up:
**runeqm** speedwalk to Lord Agrippa in Runic Castle.

**sigqm** same for Lord Vendredi in Sigil.

**nrqm** Lord Vashir in New Rigel.

**xavqm** Lady Undya in Xaventry.

**tellqm** Lord Telleri in Tellerium.

**temqm** Lady Templeton in Templeton.

**keepqm** Lord Maldra in Maldra's Keep.

**These speedwalk aliases will work from virtually anywhere in the game world as long as you can reach the room via roads**

**bw** show - shows spells on your buffwatcher watch list

**bw** add spellname - add spellname to your buffwatcher watch list

**bw** remove spellname - removes spellname on your buffwatcher watch list

**Please note: Do not use quotes when adding 2 or 3 word spell names. Just type them normally.**

### Finally, there's a special alias:
**repos** This alias can be used to reposition, visually, rooms in your map. repos n will find the room to the north of your current location, and move it directly north of your room. same for all the other directions. Keep in mind that this can seriously mangle visual maps in areas where rooms arent necessarily where they appear to be: Example, the lake on Irda Isle, where some rooms are just randomly linked to rooms and even back to themselves.

### Other options include, settable via the mmpkg config window:
**timestamps** can be turned on/off for the chat window

**tabs** can be enabled/disabled for the chat window

**mapper where** can be set to only show rooms in your current zone

**chat logging** can be turned on/off

**Linkify** Will turn almost any web address mentions into a clickable website.

**Scan Helper** Hides all empty scan returns, as well as turning it from "A brief walk" etc into an actual number of rooms away.

**Smart Prompt** Adds some useful info to your prompt: LPK/NPK/CPK, Safe, Shop, Trainer, High and Low regen, plus buffs such as invisibility (green asterisk), pass door or equivalent (cyan asterisk), fire shield (red asterisk), sanctuary (white asterisk) and lightning shroud (blue asterisk)

**BuffWatcher** Adds M: (missing buff) to your SmartPrompt (requires SmartPrompt to be enabled)

If you are missing any of these options, then you're running an outdated package and should update ASAP.

Enjoy!

gha_language: Lua


text:
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/

title: "Stakeholders' Interpretations of Data for Equitable Computing Education"
authors: ["Benjamin Xie"]
date: 2021-12-15

# Schedule page publish date (NOT publication's date).
publishDate: 2021-12-15T13:49:23-08:00

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["7"]

# Publication name and optional abbreviated publication name.
# publication: "Learning @ Scale"
# publication_short: "L@S"

abstract: "Computing education has growing inclusion and equity challenges (e.g. exclusionary online learning experiences, biased assessments, inadequate student feedback mechanisms). Many groups experience minoritization in computing education, including students who are Black, Indigenous, and people of color (BIPOC), women, non-binary students, transfer students, international students, first-generation students, and students with disabilities. To ensure diverse students can realize their potential to participate in and challenge computing communities, we must enable stakeholders (e.g. students, teachers, curriculum designers) to take informed, timely, and equitable actions. This dissertation explores how to design interactions with data to inform stakeholders in support of such actions.

While data often perpetuates and exacerbates inclusion and equity challenges when improperly used, it can also support equity-oriented goals if properly contextualized for interpretation by stakeholders. I explored how stakeholders interpreted data in three contexts: 1) informing students of what to learn next in an adaptive, self-directed online learning experience; 2) informing curriculum designers with empirical evidence of assessment bias; 3) and informing teaching teams of inequities using contextualized student feedback. Through these studies, I identified how stakeholders' relationships with educational structures and systems impacted their interpretations of data for equity-oriented goals. These factors have implications to the research and practice of learning at scale, computing education, and human-computer interaction. Therefore, I claim the following thesis statement:

Interactions with data that consider prior knowledge, perceptions of power relationships, and cultural competency can enable computing education stakeholders to connect their interpretations of data with their domain expertise in service of equity-oriented goals."

# Summary. An optional shortened abstract.
summary: "Interactions with data that consider prior knowledge, perceptions of power relationships, and cultural competency can enable computing education stakeholders to connect their interpretations of data with their domain expertise in service of equity-oriented goals."

tags: []
categories: []
featured: false

# Custom links (optional).
#   Uncomment and edit lines below to show custom links.
# links:
# - name: Follow
#   url: https://twitter.com
#   icon_pack: fab
#   icon: twitter

links:
- name: summary (2 pgs)
  url: publication/dissertation/dissertation_summary.pdf
- name: extended abstract (10 pgs)
  url: publication/dissertation/dissertation_abstract.pdf

url_pdf:
url_code:
url_dataset:
url_poster:
url_project:
url_slides: publication/dissertation/dissertation_slides.pdf
url_source:
url_video:

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ""
  focal_point: ""
  preview_only: false

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

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
slides: ""
---

repository: bxie/bxie-academic

repo_name: bxie/bxie-academic


text:
proxy-server-ansible
====================

Proxy server for my home network.

Uses openresty + redis + lua

Deployment Configure
--------------------

Add a custom `hosts` file:

	[servers]
	<IP_ADDRESS> ansible_ssh_user=blah

Deploy
------

`bin/ap`

Enter your sudo password of your fresh Ubuntu 14.04 user

Configuration
-------------

Each application needs to be put into the redis database.

	redis-cli hset servers git.sbaronda.com <IP_ADDRESS>:3000

repository: silasb/proxy-server-ansible

repo_name: silasb/proxy-server-ansible


text:
> # ☀Sunny☀ ![Python](https://img.shields.io/badge/Python-3.8%2B-brightgreen.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5e417c4aec7b40efb8b82ae362e7ac77)](https://www.codacy.com/app/NiceAesth/Sunny?utm_source=github.com&utm_medium=referral&utm_content=NiceAesth/Sunny&utm_campaign=Badge_Grade)
> ## Sunny is a Discord music / moderation / osu! bot. I will not provide support to anyone attempting to self-host, but you are free to do so. If you wish to add this bot to your own server, click [here](https://discord.com/oauth2/authorize?client_id=376679719044907019&scope=bot)

<br>

### Requirements
****

> -   Lavalink Server
> -   mongoDB
> -   Redis
> -   osu! API Key (osu! Commands)

### Changelog *(as of 08/04/21)*
****

> `v1.5.0S080421` [( b89d2a )](https://github.com/NiceAesth/Sunny/commit/b89d2a76cbf6ba6f87007fdc54e51659dcf3107c)
> -   Add proper mute command (with task for unmute)
> -   Rewrite large part of osu! code
> -   Remove Enjuu, Akatsuki!RX
> -   Create classes for custom exceptions
> -   Handle exceptions properly
> -   Remove try/catch spam
> -   Add ensure_member function (ensures that a member object is obtained from cache or API)
> -   Add required intents
> -   Fixed image commands
> -   Improve regex performance
> -   Update music cog
>
> `v1.4.0S120320` [( ddcd60 )](https://github.com/NiceAesth/Sunny/commit/ddcd607e6c60b99f7719f1ea61bb263676d6f1f1)
> -   Add beatmap listener
> -   Rewrite large part of osu! code
> -   Add new osu! commands (score, pp, etc.)
> -   Add private servers
> -   Rewrite osu! API handler portion
> -   Create classes for all entities from the osu!API
> -   Add sentry error reporting
> -   Fix some issues
> -   Add owner permissions as config item
> -   Preserve API PP values if they are present
>
> `v1.3.2S110219` [( 505c5b )](https://github.com/NiceAesth/Sunny/commit/505c5ba11de11ed3673aad1416bc7a2f073cc0b4)
> -   Moved std PP calculations to pyttanko
> -   Implement speed rebalance and other PP changes
> -   Added ctb PP and SR calculations using catch-the-pp
> -   Removed old PP calculator
> -   Added pyttanko and aiofiles to requirements
>
> `v1.3.1S301218` [( 0c0292 )](https://github.com/NiceAesth/Sunny/commit/0c0292982722324f0d8ad8baac41d467499a6d9e)
> -   Stability improvements
> -   Bugfixes
>
> `v1.3.0E231018` [( 97ef66 )](https://github.com/NiceAesth/Sunny/commit/97ef668cc8c189d73e5b0473ac74d0e941911542)
> -   Added osu! commands
> -   Added PP calculation
> -   Updated config example
> -   Updated requirements
> -   Updated mongoDB to have osu! username
>
> `v1.2.0U061018` [( b3e41f )](https://github.com/NiceAesth/Sunny/commit/b3e41f27a720c818263b47d3f82137dc85e076ee)
> -   Added user/server information cog
>
> `v1.1.1U061018` [( d42399 )](https://github.com/NiceAesth/Sunny/commit/d423993c4cca02a2bc5dcb14f61919047ae9ae60)
> -   Simplified the updating command.
> -   Added shutdown command.

### Versioning
****
> #### Versioning is done this way
> `vX.Y.ZSDDMMYY`, where:
> -   `X` **marks a major change to the bot**
> -   `Y` **marks that minor changes or features were made**
> -   `Z` **marks bugfixes**
> -   `S` **marks the state of the version e.g. *E*xperimental / *U*nstable / *S*table**
> -   `DDMMYY` **marks the day, month and year of the change**
> -   example: `v1.2.3E010190`

repository: narashini/Sunny

repo_name: narashini/Sunny


text:
Title: kapp-controller Getting Started
Date: 2021-02-22
Category: howto

# Problem

As of today, there is no single answer to the question "_How do I deploy my workload?_". Helm Chart? A set of yaml files? _Templated_ yaml files?

And not just user-facing apps - how do I consistently deploy ingress controllers? K8s cluster user auth services? Diagnostics, metrics, and so forth?

We need one answer to this question. Enter `kapp` and `kapp-controller`.

In this post, we're going to focus on `kapp-controller` and show how to set up a reconciliation loop that gives you the ability to push a new version of your workload into your Kubernetes cluster with just a `git push` (hi Gitops!).

# Solution

[The Docs](https://github.com/vmware-tanzu/carvel-kapp-controller/tree/develop/docs) are going to do a better job than me but, in a sentence, kapp-controller is a small workload that looks for new "apps" in your Kubernetes cluster. Upon discovery of an app (or an update to an existing one), kapp-controller will deploy (or update) that workload. Also, feel free to give the walkthrough a quick spin. It's short and completely worth your time.

It looks something like this.

![kapp-controller]({filename}images/kapp-ctrl-gitops-workflow-700px.png)

I should note here that "app" is used very loosly. This is not just user-facing applications but, rather, any Kubernetes workload that you define. Examples include more complex workloads like a configured FluentBit deployment, an [Ingress Controller](https://projectcontour.io/), [inspection and diagnostics](https://sonobuoy.io/), and way, way more.

Let's walk through an example.

## Install kapp-controller

[Follow the docs](https://github.com/vmware-tanzu/carvel-kapp-controller/blob/develop/docs/install.md) (super simple) or just:

```
kapp deploy -a kc -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml

# Or if you don't have `kapp` handy and don't want to make the jump yet, you can kubectl it too.
# It just won't be as easily-removed or tracked.
kubectl apply -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml
```

## Allow kapp-controller to manage a namespace

This is done by creating a service account, role, and RoleBinding. In this example, we're sticking with the `default` namespace but you can choose what you want in your deployment.

The easy copy/paste is below:

```
kapp deploy -a default-ns-rbac -f https://raw.githubusercontent.com/vmware-tanzu/carvel-kapp-controller/develop/examples/rbac/default-ns.yml
```

As of this writing, that file looks like this:

```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: default-ns-sa
  namespace: default
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: default-ns-role
  namespace: default
rules:
- apiGroups: ["*"]
  resources: ["*"]
  verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: default-ns-role-binding
  namespace: default
subjects:
- kind: ServiceAccount
  name: default-ns-sa
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: default-ns-role
```

That's it! kapp-controller is installed and has permissions to work in the `default` namespace.

## Define Your Application

kapp-controller can fetch workloads (read: "apps") from a variety of sources: Git repos, plain http(s) endpoints, etc. See [the docs](https://github.com/vmware-tanzu/carvel-kapp-controller/blob/develop/docs/app-spec.md) for the options and configs.

For this example (and simplicity), we're fetching from an open Git repo. Let's see what that spec looks like:

```yaml
#
# simple-app.yml
#
apiVersion: kappctrl.k14s.io/v1alpha1

# We're defining an app...
kind: App
metadata:
  name: exposed-simple-app
  namespace: default
spec:

  # What service account will run this app?
  serviceAccountName: default-ns-sa

  # Where is the app coming from?
  fetch:
  - git:
      url: https://gitlab.com/drawsmcgraw/simple-kapp-deployment
      ref: origin/master

      # We have a directory, named 'app', in the root of our repo.
      # Files describing the app (i.e. pod, service) are in that directory.
      subPath: app

  # No templating yet...
  template:
  - ytt: {}
  deploy:
  - kapp: {}
```

That's the high-level abstraction, but what about the app itself? Let's do that right now.

```yaml
#!
#! app-spec.yml
#!
#@ load("@ytt:data", "data")

#@ def labels():
simple-app: ""
#@ end

---
apiVersion: v1
kind: Service
metadata:
  namespace: default
  name: simple-app
spec:
  type: LoadBalancer
  ports:
  - port: #@ data.values.svc_port
    targetPort: #@ data.values.app_port
  selector: #@ labels()
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  name: simple-app
spec:
  selector:
    matchLabels: #@ labels()
  template:
    metadata:
      labels: #@ labels()
    spec:
      containers:
      - name: simple-app
        image: docker.io/dkalinin/k8s-simple-app@sha256:4c8b96d4fffdfae29258d94a22ae4ad1fe36139d47288b8960d9958d1e63a9d0
        env:
        - name: HELLO_MSG
          value: #@ data.values.hello_msg
```

The astute reader will notice some templating in that file. Namely, the selectors, the ports for the service, and (notably) the message our app will use to greet our users (see the final line). The templating is also why we use `#!` for comments instead of `#`. So where do those values come from? From our values file:

```yaml
#!
#! app-values.yml
#!
#@data/values
---
svc_port: 80
app_port: 80
hello_msg: "kapp controller ftw"
```

That's all! Three files (and, of course, a container image that lives in a repo but that's a topic for another post).

## Create Your Git Repo

kapp-controller can fetch resources from a variety of sources but we're going with the Git repo option. That being the case, we need to make a Git repo.

Feel free to [fork my repo](https://gitlab.com/drawsmcgraw/simple-kapp-deployment) or start one of your own. What matters is that, for the examples in this blog post, it looks like this:

```text
simple-kapp-deployment/
├── app
│   ├── app-spec.yml    <-- kapp-controller will deploy this
│   └── app-values.yml  <-- and this
└── crd
    └── simple-app.yml  <-- You'll deploy this
```

## Deploy!

kapp-controller is deployed and given permissions to operate in your `default` namespace. Now let's deploy.

```
kapp deploy -a exposed-simple-app -f simple-app.yml
```

Upon successful deploy, you should see a pod and a `LoadBalancer` service created for you:

```
$ kubectl get pods
NAME                        READY   STATUS    RESTARTS   AGE
simple-app-76bd586c-5cn7f   1/1     Running   0          43m

$ kubectl get svc
NAME         TYPE           CLUSTER-IP    EXTERNAL-IP                                                              PORT(S)        AGE
simple-app   LoadBalancer   <IP_ADDRESS>   abbf47c4388bb4054cd0623201bf1623-982265869.us-east-2.elb.amazonaws.com   80:30216/TCP   51m
```

Fetch the external IP / FQDN and hit it with your browser or `curl`:

```

$ curl abbf47c4388bb4054cd0623201bf1623-982265869.us-east-2.elb.amazonaws.com
<h1>Hello kapp controller ftw!</h1>
```

Super simple, but neat, right?

## Change, Deploy and Observe

Let's change our deployment parameters. We could change anything about it - number of pods, type of service, etc. For this demo, though, we're going to make a simple, but noticeable change in the output. The app pulls the message from an environment variable, `HELLO_MSG`. If we change that, it will change the output.

Go back to `app-values.yml` and find the line for `hello_msg`. This is the value that's used when `app-spec.yml` gets rendered. So changing this changes the environment variable, which changes the output. Change that value to anything meaningful to you. For this example, let's go with `k8s rocks my socks`.

Here's a diff, for reference:

```
 ---
 svc_port: 80
 app_port: 80
-hello_msg: "kapp controller ftw"
+hello_msg: "k8s rocks my socks"
```

Once you've made changes, you can `git commit` and `git push`. But before you do that, tail the logs of `kapp-controller` so you can follow along:

```
# Tail kapp-controller's logs.
# Use `kubectl -n kapp-controller get pods` to get your exact pod name.
kubectl -n kapp-controller logs -f kapp-controller-5c94d969dc-45hhg
```

Now commit, push, and watch the logs:

```
{"level":"info","ts":1614022522.823228,"logger":"kc.controller.ar","msg":"Started deploy","request":"default/exposed-simple-app"}
{"level":"info","ts":1614022525.4390993,"logger":"kc.controller.ar","msg":"Updating status","request":"default/exposed-simple-app","desc":"flushing: flush all"}
{"level":"info","ts":1614022526.118631,"logger":"kc.controller.ar","msg":"Updating status","request":"default/exposed-simple-app","desc":"marking last deploy"}
{"level":"info","ts":1614022526.4596887,"logger":"kc.controller.ar","msg":"Updating status","request":"default/exposed-simple-app","desc":"marking inspect completed"}
{"level":"info","ts":1614022526.47044,"logger":"kc.controller.ar","msg":"Updating status","request":"default/exposed-simple-app","desc":"marking reconcile completed"}
{"level":"info","ts":1614022526.4801362,"logger":"kc.controller.ar","msg":"Completed deploy","request":"default/exposed-simple-app"}
{"level":"info","ts":1614022526.4801614,"logger":"kc.controller.pr","msg":"Requeue after given time","request":"default/exposed-simple-app","after":34.206580832}
{"level":"info","ts":1614022526.4841988,"logger":"kc.controller.ar","msg":"Reconcile noop","request":"default/exposed-simple-app"}
{"level":"info","ts":1614022526.4842331,"logger":"kc.controller.pr","msg":"Requeue after given time","request":"default/exposed-simple-app","after":31.408593131}
```

kapp-controller detected a change in the workload and redeployed it for us! Let's see the app now:

```
$ curl abbf47c4388bb4054cd0623201bf1623-982265869.us-east-2.elb.amazonaws.com
<h1>Hello k8s rocks my socks!</h1>
```

There's our new message!

## Why Does This Matter?

Okay, so changing an environment variable and redeploying isn't impressive. But what I need you to understand is that this applies to _so much more_ than just deploying/updating an application. This applies to anything you deploy with Kubernetes:

- standard logging solutions that you need on every k8s cluster (like a perfectly-manicured FluentBit deployment)
- value-add extentions that your users want (like federated user auth)
- even [more Kubernetes clusters](https://cluster-api.sigs.k8s.io/).
- etc...

This is what _state enforcement_ looks like. kapp-controller will be sure that your workloads are running _in the specific way you need them running_, and it will use your repo as a _source of truth_.

That last part is the big part - you can define your Kubernetes ecosystem as a rigidly-maintained repo, and kapp-controller will do the work of deploying those workloads for you. At this point, your only limitation is your own imagination.

Enjoy!

repository: drawsmcgraw/tacticalprogramming

gha_language: CSS

repo_name: drawsmcgraw/tacticalprogramming


text:
 Setting up Postgres in Ubuntu

It is highly recommended to use a virtualenv before getting started in any python project to familiarize oneself with pip and virtualenv. Link [http://stackoverflow.com/questions/4483888/what-are-the-benefits-of-pip-and-virtualenv] for more information.

We need to install dependencies for Postgresql first
     `sudo apt-get install libpq-dev python-dev`
     `sudo apt-get install postgresql postgresql-contrib`

After the installation is done run the following command

    `$ sudo service postgresql start`

it should display the following result

    _Starting PostgreSQL 9.3 database server_

    or you can even try to start postgresql by switching on to _postgres_ as a user
    `sudo -i -u postgres`
    That would change the username of the terminal and would read something like :
`postgres@system:-$`.

After the installation is done cd to the folder that contains the project

`path/to/fossevents.in`
`pip install -r requirements.txt`

extension: markdown


text:
---
layout: article_post
categories: article
title:  "Ruby Sinatra on AWS Lambda"
disq_id: 55
description:
  AWS Lambda now Supports Ruby natively. That means we can build
  serverless applications with the language we all love. Not only that
  doh. You can run small Sinatra microservices with AWS serverless
  approach and in this article we will have a look how/why
---

29.11.2018 [AWS Lambda announced official Ruby Support](https://aws.amazon.com/blogs/compute/announcing-ruby-support-for-aws-lambda/).
That means we all can build Serverless applications (or FaaS scripts)
with the language that we love.

AWS in the [same article](https://aws.amazon.com/blogs/compute/announcing-ruby-support-for-aws-lambda/)
also provided quite decent step by step manual for creating AWS Lambda
functions but also how to run [Sinatra](http://sinatrarb.com/)
application on AWS Lambda with a code sample project [AWS Lambda - serverless Sinatra app example](https://github.com/aws-samples/serverless-sinatra-sample)

In this article I will explain in more depth how this works and how it is even
possible to run Sinatra (and other small Rack applications) on AWS Lambda

> Originally I wanted to create step by step Sinatra - AWS Lambda manual from
> scratch but guys at AWS done really good job with the mentioned example repo. I couldn't produce
> anything that would add more value.

### AWS Lambda - how it works

[Lamda](https://aws.amazon.com/lambda/) is a product from AWS (Amazon
Web Services) in which you run code without provisioning or managing servers.
You pay only for the compute time you consume - there is no charge when your code is not running.

> I literally copy paste this definition from their website

So what it means is you write Ruby script, you load the code to AWS Lamda and
then when you trigger it.  In reality YOU are not spinning up anything as the AWS Lamda function is Function as a Service (FaaS)
> therefore provisioning is taken care of by AWS. All you need to do is invoke it. If no availible Lambda is up it will spin up ("cold start") automatically.

The price of execution depends of how much memory you allocate to the
Lambda execution and how long it will took to finish your code
execution. But generally we are talking about like $0.00001 per execution ([pricing](https://aws.amazon.com/lambda/pricing/))

> Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 100ms. The price depends on the amount of memory you allocate to  your function.

**If you need to run the same Lambda function simultaneously 10 times you have to
spin up 10 separate Lamba invocations** of the same functionality.

However next execution of AWS lamda function will be executed on waiting
AWS Lambda (no spin up is necessary you just invoke code/params on span-up one that is
not performing anything)

1. spin up Lambda function
2. call handler `#lambda_handler`- from this point is when you start being charged $$$
3. run your code
4. return value - from this point is when you stop being charged
5. call handler  `#lambda_handler`- from this point is when you start being charged $$$
6. run your code
7. return value - from this point is when you stop being charged
8. spin down Lamda (after some time of inactivity)

The important part is that you are not able guarantee that if you load something in the memory
for next execution, it will get picked up. So if you load bunch of
dependencies/configurations into the memory they may not be there for the next
invocation.

Therefore "cold start" of AWS Lambda may take some time if your code is
too heavy.

> Also this depends on what programming lang you use in AWS Lambda.
> Java, C#  would notice slower cold starts far more than  Python or Ruby.

Bare with me I'll get to the point why all this is important in a
minute.

> More details about this can be found in articles like [AWS Lambda cold starts](https://theburningmonk.com/2018/01/im-afraid-youre-thinking-about-aws-lambda-cold-starts-all-wrong/) or [keep your lambdas warm](https://serverless.com/blog/keep-your-lambdas-warm/)

### Plugging in API Gateway

AWS Lambda is just a engine. It only executes your Ruby script. There is
no routing inside as you would have in Ruby on Rails application.

What you need to do is to plug routing solution to your individual
Lambda Functions.

AWS provides another product called [AWS API Gateway](https://aws.amazon.com/api-gateway/) in which you define
what route will call what AWS Lambda / Lambdas

e.g.:

* GET `/users` => call `list_users` AWS Lambda function
* POST `/users` => call `create_user` AWS Lambda function and pass the JSON request body to it e.g `{"first_name": "Tomas"}`

But you can also configure proxy routes with `*` where anything
(POST/GET/PUT/DELETED can be directed to a particular Lambda Function

So technically speaking you can have

* `* /users/*` pointing to one AWS Lambda
* `* /products/*` pointing to another AWS Lambda
* `* /cusstomer_support/*` pointing to another AWS Lambda

### Sinatra

So now we understand how API Gateway and AWS Lambda works I can finally
explain how is it even possible that you can run Sinatra on AWS Lambda?

You need to realize that you are not actually running web-server (or App-server) like you would
normally do with Sinatra or Ruby on Rails.

When you for example run `rails server` in Ruby on Rails project on your laptop you actually start
Puma/Webrick app server that listens on a port (e.g. 3000 or 8080) and
when request hit's the server/localhost this app server will call the
[Rack](https://github.com/rack/rack) application == your Ruby code,
Ruby routes -> Ruby controllers -> Ruby Model -> ...

> Similar way Sinatra works. You call `ruby app.rb` you will start
> Webrick Ruby server. ->Browser->Webrick->Rack->Sinatra routes & code

Therefore in the [AWS Lambda Sinatra example](https://github.com/aws-samples/serverless-sinatra-sample)  you don't lunch any App server (no Puma, no Webrick). The
AWS API Gateway is your APP server.

**You just need to call the [Rack](https://github.com/rack/rack) part of Sinatra with your AWS Lambda function passing the request params/body from the AWS API Gateway**

That's being done [here](https://github.com/aws-samples/serverless-sinatra-sample/blob/master/lambda.rb#L45) in the source code ([mirror](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/lambda.rb#L45) )

> I'll describe the entire flow of the code at the bottom of this
> article

That Brings us to the main point of how this works:

**AWS API Gateway will proxy any/every request to this one AWS Lambda that will spin up and execute one route of the Sinatra application. Once the response is returned to the API Gateway Lambda will die.**

![](https://raw.githubusercontent.com/equivalent/equivalent.github.io/master/assets/2018/2018-12-aws-sinatra-lambda.jpg)

That means if this Sinatra app needs to receive 50 requests, it will
spin up 50 AWS Lambda Functions.

> And only next requests "may be" executed on loaded up Lambdas with
> Sinatra dependancies in memory.

If there are 1000 requests concurrently, AWS will try to run 1000
invocations for the same Lambda function. However, if it's 1000
requests/second, and each request only needs 200 ms to process, there could
only be 200 concurrent invocations at any point of time. [Reference](https://docs.aws.amazon.com/lambda/latest/dg/scaling.html)

> Thank you [Xiang Shen](https://github.com/aws-samples/serverless-sinatra-sample/pull/6#issuecomment-446622387) for pointing this out.

### Use case

So is this solution good ?

Well every tool has it's purpose. You will
use hammer to nail a nail to a wall but to fix your laptop hammer would
not be the best tool.

Originally this "run your webserver in Lambda" feature was introduced to
help web developers to migrate existing microservices to AWS without
the need of full rewrite to Lambda scripts

> Sinatra is not the first "tiny web server" that AWS Lambda introduced. You can do AWS Lambda [Expres JS](https://aws.amazon.com/blogs/compute/going-serverless-migrating-an-express-application-to-amazon-api-gateway-and-aws-lambda/) web apps for
> quite some time now.

So the feature was introduced more like a migration help HOWEVER when
used with caution it can be stable in production **for microcervices**.

And you can always mix and match with regular serverless flow of simple AWS Functions

e.g.:

* `post /users/` pointing to lambda function
* `put /users/123` pointing to different lambda function
* `* /products` pointing to one Sinatra Microservice on AWS Lambda function
* `* /basket` pointing to another Sinatra Microservice on AWS Lambda function
* `* /cusstomer_support` pointing to another Sinatra Microservice on AWS Lambda function

This brings us to to next big question:

### Can I run Ruby on Rails on AWS Lambda ?

Sinatra is build on top of Rack. [Rails](https://rubyonrails.org/) is build on top Rack. So there should not be any problem running entire Ruby on Rails project on AWS Lambda right ?

![](https://raw.githubusercontent.com/equivalent/myWallpapers/master/fun/its-a-trap.jpg)

You need to realize that serverless is next level of Microservices. It's
not designed for Monolith Applications. And although Rails can be used
to some degree in Microservices it's primary goal is Monolith ( e.g.: [Majestic Monolith by D.H.H](https://m.signalvnoise.com/the-majestic-monolith-29166d022228))

> I have entire 40 min talk about  [Monolith, Microservices & Serverless Ruby](https://skillsmatter.com/skillscasts/11594-lrug-march)

By definition Rails have lot of tools and dependencies that are freaking
awesome in long running Monolith but makes zero sense in Serverless.

If you manage to make AWS Lambda work with Rails you would discover that
every request is taking ridiculous amount of time because every request
would have to load entire Rails and your code to memory .

You need to have your Lambda functions load up fast otherwise you will
have slow response times and pay  more than you would with server
running 24h a day.

Same would apply for large Sinatra Applications.

If your Sinatra application has 5  - 10 routes  and maybe 5 small extra
gems then you are fine. If your Sinatra application is a monolith with like 100 routes
with 50 dependencies then you will have same problem as with Rails.

So no Rails is not Designed for this. Don't do it even if you
theoretically could.

### Full flow of AWS Sinatra Serverless example

We are done with the main article (you don't need to read this). This section is more for those who want
to try out the [example repo](https://github.com/aws-samples/serverless-sinatra-sample) and learn how it works step by step.

#### API Gateway is called

> During the time this article was being published author of
> [serverless-sinatra-sample](https://github.com/aws-samples/serverless-sinatra-sample) pushed support for AWS ALB (application  load balacer)  [commit](https://github.com/aws-samples/serverless-sinatra-sample/commit/d625fae3b0ba07b7f9c8a3b2f47020f4e1a17152) which is even cooler.
>
> I will update this article as soon as I can

1. Browser makes request to `https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/Prod/hello-world`
2. Global AWS recognize subdomain domain `xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com` and pass it to your AWS API Gateway product
3. AWS API Gatway see that you are using the `/Prod` pipeline  (as you can have /Stage or /Prod) so it will pass the request to the `Prod` stage
4. In `Prod` Stage will recognize you are calling `/hello-world` now the [project](https://github.com/aws-samples/serverless-sinatra-sample) has configured a API Gateway to pass all request `*` to AWS Lambda executing our Sinatra app. Therefore this Proxy will trigger our Sinatra AWS Lamda for any request (`/`, `/hello-world`, `/api/feedback`) any method (`GET`, `POST`,...)
5. AWS Lamda is executed.

#### AWS Lambda Execution

AWS lambda calls [lambda.rb](https://github.com/aws-samples/serverless-sinatra-sample/blob/master/lambda.rb) `#handler` method which does the following:

1. set Rack enviroment variables related to the replication of appserver call

```ruby
# ...
  env = {
    "REQUEST_METHOD" => event['httpMethod'],
    "SCRIPT_NAME" => "",
    "PATH_INFO" => event['path'] || "",
    "QUERY_STRING" => event['queryStringParameters'] || "",
    "SERVER_NAME" => "localhost",
    "SERVER_PORT" => 443,

    "rack.version" => Rack::VERSION,
    "rack.url_scheme" => "https",
    "rack.input" => StringIO.new(event['body'] || ""),
    "rack.errors" => $stderr,
    }
```

> [source](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/lambda.rb#L25)

form this the most important is the setting of the `PATH_INFO` => what will end up in Sinatra routing and the  `"rack.input"` => what will become our `params`

2. as aleady mentioned we call The Rack application

```ruby
# ...
    status, headers, body = $app.call(env)
# ...
```

> [source](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/lambda.rb#L45)

From this point the
[app/server.rb](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/app/server.rb)

3. Sinatra will carry on application execution as normal Sinatra webserver. That means it will find the [get '/hello-world'](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/app/server.rb#L22) route and execute the code.

One important point to mention here is the `before` block we do at the
top of the file ([here](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/app/server.rb#L4))

```ruby
before do
  if request.body.size > 0
    request.body.rewind
    @params = Sinatra::IndifferentHash.new
    @params.merge!(JSON.parse(request.body.read))
  end
end
```

As in first step we were setting the `ENV` variable `rack.input` with
the body of API Gateway, Sinatra would not effectively parse the body as
it would be in raw JSON format. That's why this block will parse the
JSON to hash as would Sinatra normally do with HTTP form params

This will be needed when you do `POST /api/feedback`

4. and finally `lambda.rb` will pass the response of the rack
   application back to API Gateway via return value
   [here](https://github.com/equivalent/serverless-sinatra-sample/blob/2018-12-eq8article-sinatra-on-aws-lambda/lambda.rb#L68)

### Links

* [Monolith, Microservices & Serverless Ruby](https://www.youtube.com/watch?v=fn17nojYa-I) [Mirror](https://skillsmatter.com/skillscasts/11594-lrug-march)
* <https://aws.amazon.com/blogs/compute/announcing-ruby-support-for-aws-lambda/>
* <https://github.com/aws-samples/serverless-sinatra-sample>
* <https://www.serverless-ruby.org/>

### Discussion:

* <http://www.rubyflow.com/p/hbi870-ruby-sinatra-on-aws-lambda>
* <https://www.reddit.com/r/ruby/comments/a5f7as/sinatra_on_aws_lambda/>

gha_language: SCSS


text:
# Locators

Locators are meant to provide a precise location in a publication in a format that can be stored and shared.

There are many different use cases for locators:

* reporting and saving the current progression
* bookmarks
* highlights & annotations
* search results
* human-readable (as-in shareable) references
* jumping to a location
* enhancing a table of contents

Each locator must contain a reference to a resource in a publication (`href` and `type`).
`href` must not point to the fragment of a resource.

It may also contain:

* a title (`title`)
* one or more locations in a resource (grouped together in `locations`)
* one or more text references, if the resource is a document (`text`)

## The `locator` Object

| Key  | Definition | Format | Required |
| ---- | ---------- | ------ | -------- |
| `href`  | The URI of the resource that the Locator Object points to. | URI | Yes |
| `type`  | The media type of the resource that the Locator Object points to. | Media Type | Yes |
| `title`  | The title of the chapter or section which is more relevant in the context of this locator.| String | No |
| `locations`  | One or more alternative expressions of the location. | [Location Object](#the-location-object) | No |
| `text`  |  Textual context of the locator.  | [Text Object](#the-text-object) | No |

## The `location` Object

| Key  | Definition | Format | Required |
| ---- | ---------- | ------ | -------- |
| `fragments` |  Contains one or more fragment in the resource referenced by the Locator Object.  | Array of strings | No |
| `progression`  | Progression in the resource expressed as a percentage.  | Float between 0 and 1 | No |
| `position`  | An index in the publication.  | Integer where the value is > 1 | No |
| `totalProgression` | Progression in the publication expressed as a percentage.  | Float between 0 and 1 | No |

Additional locations may also be included in this object, using an extension officially registered on this repository or a URI.

The following extensions are currently registered:

| Name  |  Description |
| ----- | ------------ |
| [HTML Extension](extensions/html.md) | Additional locations for HTML/XHTML documents. |

## The `text` Object

A Locator Text Object contains multiple text fragments, useful to give a context to the Locator or for highlights.

| Key  | Definition | Format | Required |
| ---- | ---------- | ------ | -------- |
| `after` | The text after the locator.| String | No |
| `before` | The text before the locator.  | String | No |
| `highlight` | The text at the locator.  | String | No |

## Fragments

Given the flexible nature of the Readium Web Publication Manifest, we need the ability to provide locations into all sorts of resources (text, audio, video, images).

Fragments are flexible enough to achieve that goal. They also provide a natural extension point for our locator model since any media-type can define its own fragment identifiers.

They're by nature media-specific and should always be understood in the context of the resource that the locator points to (by looking at `href` and `type`).

For this purpose, this document identifies the following specifications along with their scope:

| Specification | Scope | Examples |
| ------------- | ----- | ------- |
| [HTML](https://html.spec.whatwg.org/) | HTML or XHTML | `id` |
| [Media Fragment URI 1.0](https://www.w3.org/TR/media-frags/) | Audio, Video and Images | `t=67`, `xywh=160,120,320,240`|
| [PDF](http://tools.ietf.org/rfc/rfc3778) | PDF | `page=12`, `viewrect=50,50,640,480`|

## Examples

*Example 1: Pointing to the start of Pride and Prejudice*

```
{
  "href": "http://example.com/chapter1",
  "type": "text/html",
  "title": "Chapter 1",
  "locations": {
    "position": 4,
    "progression": 0.03401,
    "totalProgression": 0.01349
  },
  "text": {
    "after": "It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife."
  }
}
```

*Example 2: Pointing somewhere in the middle of an audiobook*

```
{
  "href": "http://example.com/track6",
  "type": "audio/ogg",
  "title": "Chapter 5",
  "locations": {
    "fragments": ["t=389.84"],
    "progression": 0.607379,
    "totalProgression": 0.50678
  }
}
```

*Example 3: Pointing to a rectangle in a page of a PDF*

```
{
  "href": "http://example.com/document",
  "type": "application/pdf",
  "title": "Page 5",
  "locations": {
    "fragments": ["page=5", "viewrect=50,50,640,480"],
    "progression": 0.12703,
    "totalProgression": 0.12703
  }
}
```

## Best Practices

In addition to defining the Locator model, the Readium community also strongly recommend all implementations to follow a number of best practices:

* [Best practices for locators per format](best-practices/format.md)
* Best practices for calculating locations

# Appendix A - JSON Schema

A reference JSON Schema is available under version control at: [https://github.com/readium/architecture/tree/master/schema/locator.schema.json](https://github.com/readium/architecture/tree/master/schema/locator.schema.json)

repository: readium/architecture

gha_language: JavaScript

repo_name: readium/architecture


text:
### On the Map

**On the Map** is simple application that lets Udacity students log in either with email and password or through Facebook and then they can access pins that other students have placed on a map at their location. The pins point to an interesting resource that the student wants to share with other students.

It showcases how to use **web APIs** and **authentication**, how to **geocode a location** based on a description and display that information on a map or a table view. Being able to access information through a web API and present it either in a table view or other method (here a map) is a basic skill. This can help others learn this.

#### Documentation

The code is well documented. More information can be found on the [project's page](http://hexaedre.com/apps/on-the-map/).

#### Install

1. Fork the repo (press the `Fork` button near the top right) to your account.
2. Clone the repo on your computer. You find the link in your own github repo then type `git clone <github link>`
3. Open the Xcode project file and run.

#### Swift and Xcode versions

This project is for **Swift version 2.2** and **Xcode version 7.3**.

#### More information

More information and screenshots can be found on the [project's page](http://hexaedre.com/apps/on-the-map/). If you have questions I'd be happy to help. Contact information can be found below or on the project's page.

#### How to contribute

I'm always happy to improve code and learn, so if you find thigs to improve please submit a pull request.

##### Here are some ways you can contribute:

* by reporting bugs
* by writing or editing documentation
* by writing code ( no patch is too small : fix typos, add comments, clean up * inconsistent whitespace )
* by refactoring code
* by closing issues
* by reviewing patches
* Submitting an Issue

I use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your Swift and Xcode version, and operating system. Ideally, a bug report should include a pull request with failing specs.

##### Submitting a Pull Request

1. Fork the repository.
1. Create a topic branch.
1. Implement your feature or bug fix.
1. Add, commit, and push your changes.
1. Submit a pull request.

This is based on [https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md](https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md)

#### License

On the Map is Copyright © 2016 Denis Ricard. It is free software, and may be redistributed under the terms specified in the LICENSE file.

#### About

I'm an iOS developer. You can find my web site at [hexaedre.com](http://hexaedre.com), find me on Twitter under [@hexaedre](http://twitter.com/hexaedre), or [contact me](http://hexaedre.com/contact/).

repository: dricard/OnTheMap

repo_name: dricard/OnTheMap


text:
# Handlemarj - Preview MJML+Handlebars Templates
This is a simple extension of the [Handlebars Preview plugin](https://github.com/johnknoop/vscode-handlebars-preview) that performs the additional step of an MJML to HTML transform after the rendering of an HB template (HB->MJML->HTML).

This is a convenient way to use the power of Handlebars features in an MJML workflow - great for data-driven HTML email production and the use of partials to avoid duplication of common email elements.

**Requirements**\
You will also need the MJML VS Code extension installed for .mjml extension support, syntax highlighting etc.

**How to use**\
Open an MJML+Handlebars file (with .mjml extension), select **Handlemarj: Preview** from the command menu **or** right click on the editor tab. This will show you a preview of the HTML email.

## Example
Here's a simple example using a Handlebars partial to take care of the common layout parts of an email. The partials path is relative to your VS Code workspace root. If the below template is named `invoice.mjml` then you can supply preview data in a JSON file named `invoice.mjml.json`

```handlebars
{{#> templates/partials/layout }}
    <mj-section>
        <mj-column>
            <mj-text align="left" padding="10px 25px">
                <h1>Your Tax Invoice</h1>
            </mj-text>
            <mj-text>
                <h3>{{invoice.reference}}</h3>
            </mj-text>
        </mj-column>
    </mj-section>
{{/templates/partials/layout}}
```

# Features (Taken Directly From Handlebars Preview)

✅ Image support\
✅ [Automatically scans your workspace folder(s) for partials and helpers](#partials)\
✅ [Auto-refresh](#auto-refresh)\
✅ [Generate context file from a template](#generate-context-file-from-template)

## Partials
Partials are automatically discovered and given names based off of the workspace folder root. So if these are the subfolders of the folder you've opened in VS Code:
```
.
└── 📁partials
    ├── 📁style
    │    └── dark.hbs
    └── footer.hbs
```
Then the two partials will be registered as `partials/footer` and `partials/style/dark` respectively.

## Helpers
Helpers can be defined as javascript modules and will be automatically discovered and registered. Helpers can be placed anywhere in the Workspace, as long as they use the double file extentions like: `.hbs.js` or `.handlebars.js`.

As an example, a typical helper file could look like this:
```js
// my_helpers.handlebars.js

module.exports = {
    toUpperCase: function (text) {
        return text.toUpperCase();
    },
    toLowerCase: function (text) {
        return text.toLowerCase();
    }
};
```
And could be used like this inside your Handlebars template to properly cast the `title` variable to upperCase:

```hbs
{{toUpperCase title}}
```

## Auto-refresh
Changes to Handlebars templates applied in real-time. Included partials need to be saved in order for the change to take effect.

## Generate context file from template
Right-click on a handlebars file in the sidebar or on the editor tab and select **Handlebars: Generate context file**.

A new file named `{yourfile}.json` will be created and populated with sample data.

> #### Current limitations of context generation:
> 🙁 [Block parameters](https://handlebarsjs.com/guide/block-helpers.html#block-parameters) in `each`-constructs are not supported\
> 🙁 Path segments (`../`) are currently not supported.
>
> If you're using any of these features in your template, the resulting json will need some manual fixing.
>
> Feel free to make a pull request if these limitations are bothering you.

repository: dbateman/vscode-handlemarj

repo_name: dbateman/vscode-handlemarj


text:
# README

INTRODUCTION
Thanks again for taking a look at my demo. This readme will give you some background on what I was thinking when I created this demo and some of the things I would have done given more time. I look forward to talking to you all about the code and getting your feedback!

FEATURES
* On the feature side my demo is adaptive to device, screen size and number of educators.
* The process of sorting the data happens in the back end using rails and the JavaScript contains the logic to size and place each data point while optimizing for vertical space by recognizing when more than one event can fit in a lane.
* I included logic that displays the bars of living people as continuous and the deceased as truncated.
GIVEN MORE TIME
* I would not show the year 2017.
* Make adjustment to bar height.
* Add new, create, and delete routes, to add and delete ‘people’.

EXTRAS
* Clean, easy to follow, clearly displays the lifespan of all educators.
* Fixed time line elements make it easy to compare dates.
* Hover effect on decades provides additional information without cluttering the screen when not needed.
GIVEN MORE TIME
* Display summary of individual when hovering over lifespan.

CODE LOCATIONS
heroku app can be found at: https://mannahs-alt-school-demo.herokuapp.com/
Data is seeded in: AltSchoolDemo/db/seeds.rb
time line controller is: AltSchoolDemo/app/controllers/timeline_controller.rb
time line view is: AltSchoolDemo/app/views/timeline/index.html.erb
life spans are generated: AltSchoolDemo/app/assets/javascripts/makeTimeline.js
style sheet is: AltSchoolDemo/app/assets/stylesheets/timeline.scss

repository: kenikall/AltSchoolDemo

gha_language: Ruby

repo_name: kenikall/AltSchoolDemo


text:
---
title: Remark Slides Starter
shareimage: "./sidebyside.png"
tags: [Remark, Presentation]
date: "2020-01-26T00:00:00.0Z"
# cSpell:ignore sidebyside remarkjs slideshows
---

After spending so long authoring technical blog posts/documentation in [Markdown], it's a jarring transition to get dropped back into PowerPoint or Keynote and produce a useful technical presentation...I found myself pasting a lot of _screenshots_ of code, or fighting with formatting. The good news is there are plenty of libraries out there which allow you to author in Markdown.

I start all my technical presentations with the [remark-slides-starter], that is built on [Remark], [DeckTape], and [Live Server]. If you want to get started right away:

```bash
git clone https://github.com/aedificatorum/remark-slide-starter.git new-slides
cd new-slides
npm install
npm run present
```

> You'll need nodejs installed for this to work. I recommend VS Code as the editor for your Markdown slides.

Otherwise read on for some details of the changes I made, and why I think this is a great default for your presentations.

## Author - Remark

[Remark] is an in-browser slideshow tool that is driven by Markdown, and supports a couple of enhancements to Markdown that fill in a few gaps that are needed for presentations (speaker notes, slide build, formatting and layout). Crucially for me, it also has great syntax highlighting out of the box.

The default remark setup has you paste the contents of your slides into a `textarea` - this works but it means you'll get no syntax highlighting, and large presentations can get pretty unwieldy.

To combat this I split my slides out into one (or more) Markdown files, and load them in with JavaScript. This has the added benefit of allowing slide re-use (import the fragment to multiple presentations):

```html
<!-- index.html -->
<body>
  <textarea id="source"></textarea>
  <script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
  <script>
    fetch("/slides.md").then((response) => {
      response.text().then((value) => {
        document.getElementById("source").innerHTML = value;
        window.slideshow = remark.create();
      });
    });
  </script>
</body>
```

As a result of this split you can use VS Code's preview functionality as you work on the slides:

![VS Code Markdown Preview](./sidebyside.png)

I'd encourage you to check out the [Remark Slideshow][remark] as well as the [Remark Wiki] to get an overview of all the functionality provided.

All styles and fonts overrides are contained in the `styles.css` file.

> Note that there is an incredibly popular library called remark (which lives in the GitHub org remarkJS) - it has _nothing_ to do with the remark library I'm discussing in this post. The fact that the Remark slide library owns the remarkjs.com domain name only adds to the confusion!

## Export - DeckTape

[DeckTape] provides PDF export functionality. In order to use you'll need to be serving your presentation, and then run the export command. DeckTape works by spinning up a headless Chrome instance and 'printing' the slides. The results are great, though it can take a little while if you have a very long presentation (50+ slides).

```bash
# In one terminal
npm run present

# In another terminal
npm run export
```

By default the slides will export to a file named `slides.pdf`.

## Present - Live Server

The starter uses [Live Server] to run the presentation. This will launch a web server that serves the contents of the `public` folder, and will be available by default on port 8080. Browse to [http://localhost:8080/index.html](http://localhost:8080/index.html) to see your presentation.

> If you need to customise the port, edit the `package.json` file

The great (greatest?) thing about Live Server is support for hot reload - as you edit any file (CSS, Markdown) the server will reload the file and you'll see your changes right away.

> Live Server is super-useful as a standalone tool - if you want to quickly serve any file or folder you can run `npx live-server file-or-folder`.

[Remark] has a few tricks up it's sleeve for presentation mode. Try pressing `P` to enable presenter mode, giving you access to speaker notes, and a view of the next slide. If you press `C` you'll launch a second window which mirrors the current slide, and allows you to effectively present on a second screen.

## I need more!

If [Remark] isn't enough for you, then there are quite a few options of Markdown-driven-slideshows out there. A good starting point is the list of [DeckTape examples] - it lists a few frameworks and links to live demos in addition to the exported PDF.

I'm really interested in [MDX Deck] as it allows for React components to be embedded in the presentation (via [MDX] - Markdown with JSX).

[remark-slides-starter]: https://github.com/aedificatorum/remark-slide-starter
[remark]: https://remarkjs.com
[remark wiki]: https://github.com/gnab/remark/wiki
[decktape]: https://github.com/astefanutti/decktape
[decktape examples]: https://github.com/astefanutti/decktape#examples
[live server]: https://github.com/tapio/live-server
[mdx deck]: https://github.com/jxnblk/mdx-deck
[mdx]: https://mdxjs.com/
[markdown]: https://www.markdownguide.org/

repository: taddison/personal-site

gha_language: Nunjucks

repo_name: taddison/personal-site


text:
##  GitHub Pages Test

You can use the [editor on GitHub](https://github.com/rsodre/GitPagesTest/edit/gh-pages/index.md) to maintain and preview the content for your website in Markdown files.

Check out our [documentation](https://docs.github.com/categories/github-pages-basics/)

### Jekyll Themes

Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/rsodre/GitPagesTest/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file.

This theme is based on [Midnight](https://pages-themes.github.io/midnight/) , with a customization guide on it's [repository](https://github.com/pages-themes/midnight).

### Testing locally

Check the [Testing your GitHub Pages site locally with Jekyll](https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll) article.

For macOS...

```shell
# Catalina 10.15.7 has Ruby, Gem and (outdated) Bundler
ruby -v
> ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
gem -v
> 3.0.3
bundle -v
> Bundler version 1.17.2

# Install Jekyll, must use XCode 11
# https://jekyllrb.com/docs/installation/macos/
sudo xcode-select -s /Applications/Xcode11.7.app/Contents/Developer/
sudo xcodebuild -license
gem update
gem install --user-install bundler jekyll github-pages
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/

# Add Ruby to PATH
vi ~/.zprofile
export PATH="~/.gem/ruby/2.6.0/bin:$PATH"

# Create/Edit the repo /Gemfile, with this:
gem "github-pages", group: :jekyll_plugins

# Run a Jekyll website from the repo folder
bundle exec jekyll serve

# Open the website on a web browser
# http://<IP_ADDRESS>:4000
```

##  Customization

[Test customization here](./customization.html).

### Things to customize

The theme core CSS is here...
[https://github.com/pages-themes/midnight/blob/master/_sass/jekyll-theme-midnight.scss](https://github.com/pages-themes/midnight/blob/master/_sass/jekyll-theme-midnight.scss)

license: Unlicense

repository: StudioAvante/TutoriaisMataleone

repo_name: StudioAvante/TutoriaisMataleone


text:
# magnet
Minecraft 1.13 vanilla magnet

Here's a simple magnet for vanilla Minecraft 1.13. When the player holds an item with the NBT data {magnet:1b}, it will pull the closest item toward the player. When the player picks up that item, it will then move to the next item. It has a range of 6 meters, but that's configurable in tick.mcfunction.

I'm really hoping to figure out a way to apply this magnetization to all items within range at once, but so far that knowledge is escaping me :)

Comments and critiques always welcome!

Cheers
mcskware
2019-02-04

repository: mcskware/magnet

repo_name: mcskware/magnet


text:
# How to contribute

We'd love for you to help support writing workshops and labs using Red Hat's Mobile Application Platform.  Here are a few guidelines on what's expected of you in order to get your contributions accepted.

## Documentation - Getting Started

Get the dependencies:

> gem instal jekyll

> git clone -b gh-pages https://github.com/dudash/rhmap-workshops.git

### How to run on a Mac
> jekyll serve --baseurl ''

> open http://<IP_ADDRESS>:4000/

### How to run on Linux
> jekyll serve --baseurl ''

In your preferred webbrowser open http://<IP_ADDRESS>:4000/

## Documentation - Workshop and Lab Structure
All workshop content resides in the docs folder nested in subfolders under 'www'.  The workshops and screenshots can be different for different versions of RHMAP so we have organized the subfolder according to RHMAP release versions (e.g. 3.14, 4.3, etc...).  Note that currently there are concurrent major version releases that are very similar.  3.x is hosted and 4.x is on-prem so they can share some screenshots.

Also, please prefix labs with 'lab' and workshop level files with 'workshop'.  And then inside them, make sure that the layout is set to use the correct layout of 'lab' or 'workshop'.

### Plugin Support
GitHub Pages is powered by Jekyll. However, all Pages sites are generated using the --safe option to disable custom plugins for security reasons. Unfortunately, this means our plugins won’t work when deploying to GitHub Pages.

We can still use GitHub Pages to publish the site, but we need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.  Support for this is a planned future enhancement - once the core content of the site is stable.

When we publish to another host, this shouldn't be an issue.

### Configuring Examples
The _data/code-config.yml file should be setup to select the proper github code and examples to populate the labs.  Please add variables there (and use in your lab.md files) as needed to ensure changing the "workshop-language" changes the lab code.  This will come in most handy if you need to change a git URL for the workshop depending on where you are running it (local laptop git vs github).

## Code
The code lives in the source folder and is used for workshop examples.  If you are creating a new workshop example or demo please put your code in it's own folder(s) within the source folder branch.

### Releases
Releases of code will be done anytime a major feature is added to any of the examples/demos.  As such, please document in your release notes what changes have been made AND in which sub project(s).  FYI, you can use double asterisk to highlight to **project name** in bold.

Please use [Semantic Versioning][4].

Releases [can be found here][5].

## Making Changes

* Major changes require a feature branch from where you want to base your work.
  * Only target release branches if you are certain your fix must be on that branch.
  * Make commits of logical units.
  * Please be specific in your commit messages

## Making Trivial Changes

* Trivial may be done directly on master

## Submitting Changes

* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to this repository and reference any github issues that are related
* The core team will try to address Pull Requests on a weekly basis - if your's is sitting for more than a week, please email<EMAIL_ADDRESS>* You might get feedback on your pull request that you need to address before it is accepted.  Please try to address it within two weeks. After two weeks we may close the pull request if it isn't showing any activity.

# Additional Info

* [Jekyll Structure][3].

[1]: http://jekyllrb.com/
[2]: https://jekyllrb.com/docs/plugins/
[3]: https://jekyllrb.com/docs/structure/
[4]: http://semver.org/
[5]: https://github.com/dudash/rhmap-workshops/releases

repository: RedHatGov/rhmap-workshops

repo_name: RedHatGov/rhmap-workshops