text:
---
layout: post
title:      "Test-driven Labs & OO Ruby"
date:       2018-07-25 03:01:53 +0000
permalink:  test-driven_labs_and_oo_ruby
---

This will be short but do you ever over-think the test failures in a lab? I do. Little key words can really throw me off when working these test-driven labs. Words like "has" over "initialize" seem to make my brain crazy. Simple confusion on my part but oh man. In short, "has a name" is definitely not "initialize with a name." Try not to overcode when working on test-driven labs.

That is all.


text:
# Corana

**Corana** is a Dynamic Symbolic Execution tool for ARM Cortex-M. It takes an ARM binary file as the input and outputs its precise Control Flow Graph (CFG) under the presence of obfuscations like indirect jumps. It is currently a preliminary version and is still being regularly improved, bugs may occur. The number of supported instructions is also limited.

## Installation

**Important note:** This installation is for Linux/MacOS only. For Windows, please take a look at the detailed instruction for each individual component.

### Java and File
**Corana** is written entirely in Java. Thus, make sure that you already installed Java (version 1.8+). In addition, **Corana** use `file` command to check the format of an input binary file. In fact, `file` is already installed by default in Linux/MacOS, but for Windows, please install it first.

### Capstone Engine
**Corana** utilizes Capstone as a single-step disassembler engine. It is worth noting that, we use the older version cloned by TRANScurity instead of the latest one since the maven library used in **Corana** is incompatible with newer releases. Please follow the installation below:
* Clone the Github repository: https://github.com/TRANScurity/capstone (or using the Capstone repository included in /libs)
* Build: `cd capstone; ./make.sh; sudo ./make.sh install`

### Z3 Solver
**Corana** uses Z3 as a back-end SMT Solver to check the satisfiability of path constraints. Z3 can be installed either from the source code or the command line.
* Using the command line: `sudo apt-get update -y; sudo apt-get install -y z3`
* From source code:  Please clone Z3 repository https://github.com/Z3Prover/z3 (or using the Z3 repository included in /libs) and follow its instruction.

### Build Corana
We provide a pre-built **Corana** as a `.jar` file. However, you can still rebuild it by simply creating a new artifact from sources. After successfully building, make sure that `corana.jar` is successfully generated.

## Execution
**Corana** inputs an ARM binary file and outputs its CFG. The CFG is represented as `.dot` file, thus you can arbitrarily further plot it in any graphic or data structure format as you want. Use this command to execute **Corana**:

     java -Xss16m -Xmx10240m -jar corana.jar -execute /path/to/input/file

where

 - `-Xss`: the maximum memory allocated for stack size. We recommend setting it to around 16MB or larger.
 - `-Xmx`: the maximum memory allocated for the execution. We recommend setting it as much as possible since the dynamic symbolic execution consumes a lot of memory.
 - `/path/to/input/file`: the path to the ARM binary file for analyzing.

If you want to specify an ARM variation, please append the variation name  (M0, M0_Plus, M3, M4, M7, M33) to the end of the command above. Otherwise, **Corana** runs with the general ARM configurations.

     java -Xss16m -Xmx10240m -jar corana.jar -execute /path/to/input/file M7

## Contact
Anh V. Vu - Project maintainer -<EMAIL_ADDRESS>
Nguyen Thi Van Anh (JAIST) - Project maintainer

## License
This project is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

## Acknowledgments

We thank JAIST for financially supporting our project and thank [Jan Willem Janssen](https://www.lxtreme.nl/) for his useful library for effectively parsing ELF binary files: https://github.com/jawi/java-binutils

license: MIT

repository: anhvvcs/corana

branch_name: refs/heads/master

extension: md

gha_language: C

gha_license_id: MIT

license_type: permissive

repo_name: anhvvcs/corana


text:
## Secured API

* Checkout tag `java-resource-security` or `kotlin-resource-security`
* Create a resource that publishes a team API that complies with [this spec](https://ms-doc.asm2.dxp.delivery/guide/training-teams).
    * Hint: Team creation endpoint is allowed only for 'DxpTenantUserBusinessContext.class' user type
    * Hint: Users' 'skills' and 'stats' fields should be displayed for 'DxpTenantUserBusinessContext.class' user types and hidden for 'DxpEndUserFromTenantBusinessContext.class'
* All tests should pass

repository: jntakpe/prez-dxp-practice

gha_language: JavaScript

repo_name: jntakpe/prez-dxp-practice


text:
# Recipe List
Android Kotlin ContentFul API sample

[APK Link (https://drive.google.com/file/d/1lHpgAixNPsk-dwVi8I_msLdweminSHUE/view?usp=sharing)](https://drive.google.com/file/d/1lHpgAixNPsk-dwVi8I_msLdweminSHUE/view?usp=sharing)

#### This project scope covers the substances below
* Kotlin
* Single activity multiple fragment approach
* Offline usage capability
* MVVM design parttern
* Fragment / Activity Scoped ViewModels
* Databinding, ViewBinding
* ROOM Databases
* Timber API for client side logging
* Navigation Component
* View Transitions in Navigation Component
* ContentFul API (includes Retrofit API)
* Kotlin coroutines
* Live Data
* Lottie animations
* Thrust Libraray for Assertions
* Dependency Injection (HILT)
* Suspend functions and LiveDataScopes
* RecylerView with ListAdapter and DiffUtil
* Facebook shimmer on listing page
* Glide for picture loading over internet
* Repository pattern for View Models
* MockK & JUnit5 for unit Testing
* JUnit4, HILT usage for integration tests

#### Possible future innovations after more functionality
* Search capability for recyclerList
* Paging for recyclerlist using JetPack Paging library

#### Application exposition
Main goal is creating a Recipe Listing page and also an another page so as to view some details about it.

Application initiates with a splash screen. After splash animation listing page has been shown.

Listing page has a list insfrastructure so as to display recipes. The data have been fetched via contentful api. Considering to network delay, list loading animation has been provided by facebook shimmer library.

Data is fetched from internet (this case from ContentFul API) and is shown in UI and also it is stored in ROOM databases on the phone. Listing rows shows recipe image and recipe name on the list.

In case of network error, data will be fetched from ROOM DB in order to ensure a offline usage for better user experience

Click action of each row navigates user to detail page of these recipes with view transion animation.

In Detail Page, user can view additional information about recipes (recipe name, recipe visuals, chef name, calories, some tags, description)

#### ScreenShoots

# License

The code is licensed as:

```
Copyright 2021 Attila Akıncı

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

branch_name: refs/heads/main


text:
# Code of Conduct Working Group

## Purpose

To provide guidance, recommendations and proposals to the OpenJS Foundation Cross Project Council on Code of Conduct related policies.

## Scope of Work
* Get agreement on minimum viable CoC process and get it landed
  *  How close is the current proposal to that and what needs to be adjusted to reach the MVP?

* What extensions would make sense, and do the projects agree to that. Discuss suggestions that have been made:
  * Foundation wide bans
  * Sharing information across projects
  * Escalation processes (particularly up to Foundation)
  * Processes to adjudicate disagreements between CPC and projects in moderation recommendations/steps

## Actions/Agenda

* Decision: Is this a valid MVP? https://github.com/openjs-foundation/cross-project-council/pull/379
    * If NO, what specific elements need to be addressed.
    * If YES, what if any steps are needed to begin implementation and enforcement.

* Question: Does this group need to meet again?

## Participants
  * Michael Dawson
  * Jordan Harband
  * Jory Burson
  * Joe Sepi
  * Anton Molleda
  * Eemeli Aro
  * Myles Borins
  * Matteo Collina
  * Ben Michel
  * Tobie Langel (stepping in for someone on the AMP CoC WG)
  * James Snell ?(based on those suggesting extensions to MVP or showing concerns in collab summit)

## Notes (2020-02-12 Call)

Present: Myles, Jory, Joe, Robin, Anton, Ben, Brian, Naina, Eemeli, Michael, Tobie

### Minutes
Jory: Does [pull request 379](https://github.com/openjs-foundation/cross-project-council/pull/379/files) go far enough for our first draft? If the answer is no, where do we go from here? If yes, what do we need to set up to make this an official policy?

Michael: Overall, there's 2 pieces: one describes the outside view, and the 2nd describes how we handle the reports internally. The main addition is we want to use one code of conduct across all the projects. The other is that it adds an escalation process. The escalation process provides a place that projects can report to if they're being treated unfairly. For the body handling these kinds of things we'll want broad representation across projects and disciplines. The CPC can make a subset that can be adopted by projects. They're required to use the CoC and have to follow the path of escalation as documented.

Jory: Naina gave helpful feedback early on this. I'm curious to hear from Naina about how she's thinking about this now regarding recent changes.

Naina: The proposal on our end seems good. My only concern is that in our work to change the contributor covenant – that's been moving pretty slowly. Is it usually this slow? Our ability to influence adoption is going to be limited if our progress is going to be slow withing the WG.

Michael: Is the concern that it's just taking a long time?

Naina: Yeah, it hasn't moved since January 10th.

Michael: I'd be more concerned if it wasn't open for discussion.

Naina: Not concerned with how we're doing it, that's going to be fine.

Jory: If upstream changes are going to take too long, we'll want to have a developed plan b.

>Possible Concern: The length of time that it takes to have PRs upstreamed into the Contributor Covenant
>* idea: float patch strategy

Joe: The last comments are in Nov. Yeah, been a while.

Michael: I'd start with how this was presented in the first place. If we think that things are going to take too long, we should get together with the group that started it. We should start to understand if it's going to be a one off.

Myles: The switch from 1.0 to 2.0 had unexpected changes. Secondly, there's no clear ownership here. There's no group that acutally owns the CoC or the group doing this and folks don't feel empowered to do this yet. Once that happens, this situation will probably be mitigated.

>Possible Need: Empowered CPC sub-team to monitor changes & speed

Michael: Agree. Once we get it bootstrapped, it should fall into place

Myles: We float changes on dependencies all the time on Node.js core. We should be able to update patches and float the patches and not be blocked upstream by this.

Brian: Looking at the merits of waiting for something to be upstream vs. something that's available now – there's a tremendous amount of value in place as soon as possible. All these things can be reviewed and revised over time.

Michael: For example, on V8 we send it upstream – but usually we float it. We should always be open to do this depending on how things are going.

Jory: Are there any thoughts from the Webhint or Electron side?

Anton: The CoC from the Electron team is very hard. It gives a lot of power to discipline if needed. My concern is that if we don't regularly update the CoC we request projects to adopt, they might be waiting for changes upstream.

>Possible Concern: Communicating patches/changes out to the projects. How does the group make sure these are updated (GH issue, etc)

Michael: Shouldn't be that common of a situation.

Anton: Let's see how fast upstream gets updated, and not overthink it.

Jory: So what I'm hearing is that there's a need to ensure there's a need to check in on a suggested change before it's accepted and distributed across the ecosystem.

Anton: There may be a parity problem if OpenJS updates thier CoC and each project has to change theirs accordingly.

Myles: OpenJS projects should be pointing at the OpenJS CoC vs. keeping a local copy.

Brian: Projects should only have their own if they plan on maintaining a more stringent CoC.

Myles: I'm not sure that's the way we're going to set this up. There needs to be a central authority for generating the CoC.

Michael: It's more work for maintainers to manually update, but worth it.

Myles: Tooling can help us. A github action for instance to keep repos in sync. It seems like an automatable problem.

Brian: I like that. That ensures that the same CoC is rolled out across all the repose with minial pain.

Eemeli: My recollection is in sync with Myles'. Rather than trying to resolve exactly what we end up with, it's best to cover our options at this stage in order to cement our CoC practices.

>Possible Need: Guidance and tooling for using things like a .gh repo to managing

Brian: How often are we expecting to change after the initial change. Do we need this right now?

Eemeli: If we want to track with the upstream's latest release, we'll likely be doing this once or twice a year.

Myles: A single module could work to handle that if it's once or twice a year.

Jory: This feels like a next order problem that we don't need to have the answer to right now in order to merge this PR.

Naina: I agree.

Jory: Jordan H has already approved the PR. Has consensus been reached that this is a viable MVP? Should we merge it?

All: No objections.

Jory: Then the answer is yes. Hooray!

Jory: Now we need to figure out how to create this empowered team. As a matter of process, we should likely open these things as separate issues. I definitely feel that at least we should capture everything as a summary as we do this.

Michael: As we start to work on this we can create separate sub-issues.

Jory: Does this specific group need to meet then? Has the need of the ad-hoc group been answered? Can we leave the rest to the new CoC task force?

Joe: Isn't the COCP team a moderation team?

Michael: Their scope is escalations. What we've agreed upon is that we have an MVP.

Brian: The MVP is an adopted CoC, and a default escalation path. We have to have this in place asap. There could be an issue tomorrow.

Robin: If we can time-block and get this in place as we build it that's best. We really need this in place.

Myles: Having a list of volunteers that is spun out of this group and on a mailing list would be beneficial today.

All: General agreement.

Tobie: Let's make sure that the COCP's membership is diverse.

Micheal: So we have to make sure we have a quorum of diversity now. A board member, a CPC member, top-level member, non-top level member, etc.

Brian: I can spin up a self nomination period, then we can take it to a vote.

Joe: What happens if we end up with a non diverse panel? If we land this, is it a hard stop? Can more people volunteer over time?

Robin: If you want diversity you have to reach out and invite them. I think it's important we do that.

Myles: People who're 'experts' is a bit ambiguous. Regarding the language here, doing another pass at it is probably appropriate. Should invites be done on a project by project basis? Also, what if someone we invite isn't comfortable about doing this?

>Probable Future Need: training for individuals serving on the moderation team

Eemeli: Doing a self nomintation and vote isn't likely as advantageous as doing an intentional reach out in the interest of actual diversity.

Michael: We should still land this so we can move forward in any regard.

Joe: So 'land' means moving the PR we're discussing to stage 3. Should we modify that language to not be so prescriptive before we move to stage 3?

Michael: We need to figure out that language now then. We don't want this to be halted again.

Myles: We can add a simply caveat to address this. We shouldn't theoretically be adding things right before a merge if it's not vetted by the CPC and board, but right now we can just add people to the list if we feel like we should do it. I'm concerned that we're going to get stuck in a process holding pattern, because we're getting stuck right now while discussing it in this call. Let's add everyone who's been on the call to this lest, land the PR, and iterate. Let's bootstrap this now with the people here – if they don't want to participate they can request to be removed. If we're not happy with what we have we can change it.

Myles: Is there any problem with bootstrapping it this way, now?

All: No.

Myles: Okay, let's do it! 🚀

Robin: One of the hard things about project leads is that they're mostly all men. It's not diverse. Folks in the marketing committee are on the ground where the bad stuff happens.

Myles: The marketing will have a very reasonable stake in maintaining the CoC.

Jory: Alright, we have a lot of great action items. We've reached a logical conclusion of this call.

Michael: I'll land this PR as stage 3, then we'll get board approval, then we can take actions to PR in a change representing the marketing committee. That's the first order for next steps, then we can discuss what's next when we meet?

Jory: Yes. Thank you all! 🙏

All: Cheers! 🍻

repository: openjs-foundation/cross-project-council

repo_name: openjs-foundation/cross-project-council


text:
# ComplexNumberJS

Z is a Javascript simple complex number helper class. It works with node.js as well as on all browser with js implementation.

Z Constructor
-------------

Z constructor can accept Z objects, String, and regular number (javascript primitive number or Number() objects).
Acceptable Strings can only contain "j", "<", "(", ")", ".", digits and whitespaces.

Constructor Usage Examples
---------------------------

General syntax

    var z = new Z(argument[, argument[, argument][, argument], ... ]);

1. Creating a "zero" complex number (0+j0)-

        var zeroZ = new Z();

    or

        var zeroZ = new Z(0);

2. Creating a a complex number in Rectangular form (3 - j4)-

        var z = new Z(3,-4);// with numbers as parameters

    or

        var temp = new Z("3-j4");//with string
        var z = new Z(temp);// with an object of Z

3. Encapsulating a javascript primitive number or Number() objects with the Z constructor;

        var z = new Z(180);// variable "z" is now 180 + j0 not 180 < 0

4. Creating a Z object as a sum of constructor-

        var z_par = new Z("j(-3)", "j3");// "z_par" equals 0 + j 0
        //falsy arguments values resolves to zero but logs warning.
        var z = new Z(undefined, 2, "-3.5j", "-2", z_par, null, "0+j3.5");//"z" equals 0 + j 0

5. Creating a Z object from an argument list containing polar form string of a complex number. Note that the argument must always be in degree (it just makes things easier for both of us)

        var z_par = new Z("1<180");// "z_par" equals 1 + j 0
        var z = new Z(null, "2",2, "-3.5j", "-2", z_par, "  0   +  j3.5", "1<180", );//"z" equals 0 + j 0, also notice the redundant whitespaces- the constructor still understands what you want

6. Performing addition operations in strings. Note that you can only do this in rectangular form-

        var z_par = new Z("    -j1 + 2 + j4 -2 +(-0 + j(-3))");// "z_par" equals 0 + j 0
        var z = new Z("    -j1 + 2 + j4 -2 +(-0 + j(-3))", "2",2, "-3.5j", "-2", z_par, "  0   +  j3.5", "1<180", );//"z" equals 0 + j 0, and yes! you can send in any number of arguments
        //NOTE!!! in polar form this functionality fails, try it out so you can recognize the error
        var z_par1 = new Z("1<180 180< 0");     // Really! what are you trying to do?
        var z_par2 = new Z("1<  180 <");        //We only did our best to process what we discussed so far
        var z_par3 = new Z("<  180");           //Come on! Computers are stupid, remember?
        var z_par4 = new Z("180<  ");           //I mean I'll will get confused myself
        var z_par5 = new Z("<180");             //Now I think you are trying to be malicious

    -Note For this version don't do any sort of multiplication in the constructor string parameter. This functionality may be handled in future versions

    This is just basis of this library's awesomeness. Read on to see more

Math Class Extension
--------------------

After this library is loaded your Math class definition would have experienced a little update. Don't worry, every behaviour remains unaltered even the behaviour of Math.sqrt(positiveRealNumber), i.e. it returns a real number and not one encapsulated in a Z object
You will now be able to find the square root of what I like to call the ancestor of all complex numbers, -1, as well as its decendants, objects of Z;

        var z = Math.sqrt(-1);

        if (z instanceof Z)
            console.log("Yaay! it returned a complex number object. see " + z.toString());
        else
            console.log("This will never print. Ah aha ...");

        z = Math.sqrt(z);

        if (z instanceof Z)
            console.log("Yippee! still returned a complex number object. see " + z.toString());
        else
            console.log("This will never print. Ah aha ...");
            //If I was so sure, why type it? Remember when programming you ca never be absolutely sure

        z = Math.sqrt(4);//"z" is now 2

        if (z instanceof Z)
            console.log("Aww! Somethings wrong, expected a primitive number and not a Z instance");
        else
            console.log("I told you not worry, I've got you covered.");

Error Handling
--------------

Hmm, I can hear Z.js screaming "Test me, make me fail. I wanted my developer(s) to make me better".

Z non-static methods
-------------------
Every method you would logically expect to return nothing returns "this" (this currently referenced object).
The parameter ARG could any thing that would pass as Z's constructor acceptable arguments- ie Z objects, String, and regular number (javascript primitive number or Number() objects)

        console.log(new Z());// to see a list of Z's non-static methods

| Name | Return type | Parameter list |
|------|-------------|----------------|
| isOpInRad | boolean | - |
| isInRectForm | boolean | - |
| doOpInPolForm | Z | - |
| doOpInRectForm | Z | - |
| doRepInRad | Z | - |
| toString | string | - |
| negate | Z | - |
| doInverse | Z | - |
| getAbs | number | - |
| getMod | number | - |
| getArg | number | - |
| getRe | number | - |
| getIm | number | - |
| multiplyBy | Z | ARG |
| divideBy | Z | ARG |
| addTo | Z | ARG |
| doPow | Z | number |
| doSqrt | Z | number |

All of the above stated Z method returning objects of type Z actually returns "this".

Z static methods
---------------
The parameter ARG could any thing that would pass as Z's constructor acceptable arguments- ie Z objects, String, and regular number (javascript primitive number or Number() objects)

        console.log(Z);// to see a list of Z's static methods

| Name | Return type | Parameter list |
|------|-------------|----------------|
| multiply | Z | ARG, ARG |
| divide | Z | ARG, ARG |
| add | Z | ARG, ARG |
| substract | Z | ARG, ARG |
| formatArg | number | number |
| sum | Z | ARG[, ARG[, ARG ...]] |
| doPow | Z | ARG, number |
| doSqrt | Z | ARG |

We care for masochist too
-------------------------
We provided all y'all with a variable that you could also use instead of Z.

Say hello to "ComplexNumber()"

        var z = new ComplexNumber("Hello");// that's not what I mean
        var z = new ComplexNumber();// "z" equals 0+j0

The other usages of Z also follows. A small caveat is in order- "ComplexNumber()" can't be used with node.js

A word (mostly likely more) of caution
--------------------------------------

Please do endeavour to always use

        //assuming z is a Z instance
        z.isInRectForm();
        z.isOpInRad();

 to ensure you'd be processing Z instances instates you'd be aware of. You don't want to be working in degrees and get angles in radians. Believe me, i've been there..g,

Now, go forth and enjoy these bytes of awesomeness!

repository: imohiosen/ComplexNumberJS

repo_name: imohiosen/ComplexNumberJS


text:
# 2D World Generator
A 2D world generator made in Unity.
Generates a Terraria like world based on the provided seed.
Has a simple player character to explore the world with an inventory.
Player can mine and place blocks.

Also on itch.io: https://jacri.itch.io/2d-world-generator


text:
### [CVE-2023-31587](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-31587)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Tenda AC5 router V<IP_ADDRESS> was discovered to contain a remote code execution (RCE) vulnerability via the Mac parameter at ip/goform/WriteFacMac.

### POC

#### Reference
- https://github.com/yanbushuang/CVE/blob/main/TendaAC5.md

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
It’s time to talk about equality in JavaScript! Here’s why it matters.

Imagine negotiating business deals at a masked carnival. You might talk to two people, and not realize that you really talked to the same person twice. Or you might _think_ you talked to one person but those were two different people!

![A pair of carnival masks](carnival-mask.png)

__If you don’t have a clear mental model of equality in JavaScript, every day is like a carnival – and not in a good way__. You’re never quite sure if you’re dealing with the same value, or with two different values. As a result, you’ll often make mistakes — like changing a value you didn’t intend to change.

Luckily, we’ve already done most of the work to establish the concept of equality in JavaScript. It fits into our mental model in a very natural way.

# Kinds of Equality

In JavaScript, there are several kinds of equality. If you’ve been writing JavaScript for a while, you’re probably familiar with at least two of them:

- __Strict Equality:__ `a === b` (triple equals).
- __Loose Equality:__ `a == b` (double equals).
- __Same Value Equality:__ `Object.is (a, b)`.

Most tutorials don’t mention the `Same Value Equality` at all. We’ll take a road less traveled, and explain it first. We can then use it to explain the other kinds.

## Same Value Equality: `Object.is(a, b)`

In JavaScript, `Object.is(a, b)` tells us if a and b are the same value:

```js
console.log(Object.is(2, 2)); // true
console.log(Object.is({}, {})); // false
```

This is called __Same Value Equality.__

What does “same value” means, exactly, in our mental model? You might already know this intuitively, but let’s verify your understanding.

## Check Your Intuition

Consider this example from the _Counting the Values_ exercises:

```js
let dwarves = 7;
let continents = '7';
let worldWonders = 3 + 4;
```

As a reminder, our sketch for this snippet looked like this:

![dwarves and worldWonders pointing to the 7 number value, continents pointing to the "7" string value](dwarves-continents.png)

Now try to answer these questions __using the diagram above:__

```js
console.log(Object.is(dwarves, continents)); // ?
console.log(Object.is(continents, worldWonders)); // ?
console.log(Object.is(worldWonders, dwarves)); // ?
```

Write down your answers and think about _how_ you would explain them.

__SPOILERS BELOW__

Don’t scroll further until you have finished writing.

...

...

This was not a trick question! Here are the answers:

1. `Object.is(dwarves, continents)` is __false__ because `dwarves` and `continents` __point at different values.__
2. `Object.is(continents, worldWonders)` is __false__ because `continents` and `worldWonders` __point at different values.__
3. `Object.is(worldWonders, dwarves)` is __true__ because `worldWonders` and `dwarves` __point at the same value.__

If two values are represented by a single shape on our diagram, it means that they aren’t really _two_ different values. They are the same one value! And that is the case for which `Object.is(a, b)` returns true.

In the previous module, we “counted” the values. But really, we were learning about what makes values distinct from one another. And as a result, we also learned the opposite — what it means for values to be the same.

If you struggle with this idea, you might want to revisit _Counting the Values_ and [work through the exercises for it again](https://eggheadio.typeform.com/to/STEeMy). It _will_ make sense, I promise!

##  But What About Objects?

By this point, you might be worried about objects. You might have heard that equality doesn’t work with objects, or that it compares “references”. __If you have existing intuitions like these, set them aside completely for a moment.__

Instead, look at this code snippet:

```js
let banana = {};
let cherry = banana;
let chocolate = cherry;
cherry = {};
```

Open a notepad or a [sketching app](https://excalidraw.com/) and draw a diagram of variables and values. You’ll want to draw it step by step, as it’s hard to do in your head.

Remember that`{}`always means “create a new object value”. Also remember that = means “connect the left side’s wire to the value on the right side”.

__After you finish drawing,__ write down your answers to these questions:

```js
console.log(Object.is(banana, cherry)); // ?
console.log(Object.is(cherry, chocolate)); // ?
console.log(Object.is(chocolate, banana)); // ?
```

Make sure to __use your diagram__ to answer them.

__SPOILERS BELOW__

Don’t scroll further until you have finished sketching and writing.

...

...

Your drawing process should have followed these steps:

![banana and chocolate pointing to an object value, cherry pointing to another object value](banana-cherry-chcolate.gif)

1. __let banana = {};__
    - Declare a banana variable.
    - Create a new object value {}.
    - Point banana variable’s wire to it.
2. __let cherry = banana;__
    - Declare a `cherry` variable.
    - Point `cherry`’s wire to where `banana` is pointing.
3. __let chocolate = cherry;__
    - Then, we declare a `chocolate` variable.
    - Point `chocolate`’s wire to where `cherry` is pointing.
4. __cherry = {};__
    - Create a new object value {}.
    - Point `cherry`’s wire to it.

After the last step, your diagram should look like this:

![banana and chocolate pointing to an object value, cherry pointing to another object value](pointing-to-an-object-value.png)

Now let’s check your answers:

1. `Object.is(banana, cherry)` is __false__ because banana and cherry __point at different values.__
2. `Object.is(cherry, chocolate)` is __false__ because cherry and chocolate __point at different values.__
3. `Object.is(chocolate, banana)` is __true__ because chocolate and banana __point at the same value.__

As you can see, we didn’t need any additional concepts to explain how __Same Value Equality__ works for objects. It naturally falls out of our mental model.

And that’s all there is to know about it!

## Strict Equality: a === b

You have probably used the __Strict Equality__ operator before:

```js
console.log(2 === 2); // true
console.log({} === {}); // false
```

There is also a corresponding opposite `!==` operator.

## Same Value Equality vs Strict Equality

So what’s the difference between `Object.is` and ===?

__Same Value Equality__ — `Object.is(a, b)` — has a direct meaning in our mental model. It corresponds to the idea of “the same value” in our universe.

In almost all cases, the same intuition works for __Strict Value Equaliy__ too. For example, 2 === 2 is `true` because 2 always “summons” the same value:

![Illustration of 2 === 2](Illustration-of-2---2.gif)

Conversely, {} === {} is `false` because each {} _creates_ a different value:

![Illustration of {} === {}](Illustration-of-{}-{}.gif)

In the above examples, `a === b` behaves the same way as `Object.is(a, b)`. However, there are __two rare cases__ where the behavior of === is different.

__Consider the cases below as exceptions to the rule__ — just like you had to memorize the irregular verbs when you were learning English. Both of these unusual cases involve “special numbers” that we discussed in the past:

1. __NaN === NaN is `false`__, although they are the same value.
2. __-0 === 0 and 0 === -0 are `true`__, although they are different values.

Although these cases are uncommon, we’ll take a closer look at both of them.

### First Special Case: `NaN`

As we’ve seen in _Counting the Values_, `NaN` is a special number that shows up when we do invalid math like 0 / 0:

```js
let width = 0 / 0; // NaN
```

Further calculations with NaN will give you NaN again:

```js
let height = width * 2; // NaN
```

You probably won’t do this intentionally, but it can happen when you work with incorrect data in the first place, or if your calculation contains a mistake.

__Remember that `NaN === NaN` is always `false`:__

```js
console.log(width === height); // false
```

However, `NaN` is the same _value _as `NaN`:

```js
console.log(Object.is(width, height)); // true
```

![width pointing to 0, and height pointing NaN](width-height-nan.png)

_That’s confusing._

The reason for `NaN === NaN` being `false` is largely historical so I suggest to acccept it as a fact of life. You might run into this if you try to write some code that checks a value for being `NaN` (for example, to print a warning).

```js
function resizeImage(size) {
  if (size === NaN) {
    // Doesn't work: the check is always false!
    console.log('Something is wrong.');
  }
  // ...
}
```

Instead, here’s a few ways (they all work!) to check if `size` is `NaN`:
    - __Number.isNaN(size)__
    - __Object.is(size, NaN)__
    - __size !== size__

The last one might be particularly surprising. Give it a few moments. If you don’t see how it detects `NaN`, try re-reading this section and thinking again.

(There’ll be an answer at the end of this module.)

### Second Special Case: -0

In regular math, there is no such concept as “minus zero”, but it exists in floating point math for [practical reasons](https://softwareengineering.stackexchange.com/questions/280648/why-is-negative-zero-important/280708#280708). Here’s an interesting fact about it.

__Both `0 === -0` and `-0 === 0` are always `true:`__

```
let width = 0; // 0
let height = -width; // -0
console.log(width === height); // true
```

However, `0` is a _different value_ from `-0`:

```js
console.log(Object.is(width, height)); // false
```

![width pointing to 0, and height pointing to -0](width-height-0.png)

_That’s confusing too._

In practice, I haven’t run into a case where this matters in my entire career.

### Coding Exercise

Now that you know how `Object.is` and === work, I have a small coding exercise for you.

__Write a function called `strictEquals(a, b)` that returns the same value as `a === b`. Your implementation must not use the === or !== operators.__

Here is [my answer](https://gist.github.com/gaearon/08a85a33e3d08f3f2ca25fb17bd9d638) if you want to check yourself. This function is utterly useless, but writing it helps make sense of ===.

### Don’t Panic

Hearing about these special numbers and how they behave can be overwhelming. Don’t stress too much about these special cases!

They’re not very common. Now that you know that they exist, you will recognize them in practice. And in most cases, our intuition about what “same value” means is useful for `both Object.is(a, b)` and `a === b`.

## Loose Equality

Finally, we get to the last kind of equality.

__Loose Equality__ (double equals) is the bogeyman of JavaScript.

Here’s just a couple of examples to make your skin crawl:

```js
console.log([[]] == ''); // true
console.log(true == [1]); // true
console.log(false == [0]); // true
```

[Wait, what?!](https://dorey.github.io/JavaScript-Equality-Table/)

The rules of __Loose Equality__ (also called “abstract equality”) are arcane and confusing. They are widely acknowledged as an early bad design decision. Many coding standards prohibit the use of == and != in code altogether.

Although Just JavaScript doesn’t take strong opinions on what features you should or shouldn’t use, we’re not going to cover __Loose Equality__ for now. It’s uncommon in modern codebases, and its rules don’t play a larger role in the language — or in our mental model. If you are curious, check out [how it works](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness?ck_subscriber_id=810733667#Loose_equality_using), but don’t feel pressured to memorize it. You’ll need memory for other topics!

There is one usage of it that is relatively common and is worth knowing:

```js
if (x == null) {
  // ...
}
```

This code is equivalent to writing:

```js
if (x === null || x === undefined) {
  // ...
}
```

However, even that usage of == might be controversial on some teams. It’s best to discuss as a team how much == is tolerated in your codebase first.

# Recap

- JavaScript has several kinds of equality. They include __Same Value Equality, Strict Equality, and Loose Equality.__
- __Same Value Equality,__ or `Object.is(a, b)`, matches the concept of the _sameness of values_ that we introduced in the previous module.
    - Understanding this kind of equality helps prevent bugs! You will often need to know when you’re dealing with the same value, and when you’re dealing with two different values.
    - When we draw a diagram of values and variables, the _same value cannot_ appear twice on it. `Object.is(a, b)` is true when variables a and b point to the same value on our diagram.
    - __Same Value Equality__ is the easiest to explain, which is why we started with it. However, it’s verbose and a bit annoying to write.
- In practice, you will use __Strict Equality__, or `a === b`, most often. It is equivalent to the Same Value Equality except for two rare special cases:
    - `NaN === NaN` is `false`, even though they are the same value.
    - `0 === -0` and `-0 === 0` is `true`, but they are different values.
- You can check whether x is NaN using Number.isNaN(x).
- __Loose Equality__ (==) is a set of arcane rules and is often avoided.

Finally, you might still be wondering why size `!==` size works as a way to detect when `size` is `NaN`. We said we’d revisit this question at the end of this module. This works because `NaN === NaN` is `false`, as we already learned. So the reverse `(NaN !== NaN)` must be true. Since `NaN `is the only value that’s not equal to itself, `size !== size` can only mean that `size is NaN.`
In fact, ensuring you can detect NaN this way was [one of the original reasons](https://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-comparisons-returning-false-for-ieee754-nan-values/1573715#1573715) for making `NaN === NaN` return `false`! This was decided before JavaScript even existed. This is a purely historical anecdote, but interesting nonetheless.

# Exercises

This module also has exercises for you to practice!

[__Click here__ to solidify this mental model with a few short exercises.](https://eggheadio.typeform.com/to/wpQKI4)

__Don’t skip them!__

Even though you’re probably familiar with the concept of equality, these exercises will help you cement the mental model we’re building. We need this foundation before we can get to more complex topics.

Once you've completed the exercises I will send you the next email.

Cheers,
Dan

repository: planetacomputer/just-javascript

repo_name: planetacomputer/just-javascript


text:
GitHub search download
======================

> Download matched files from a GitHub code search.

Description
-----------

This software written in Python allows to search for code on GitHub and
to download all the matched files in a tarball.

Dependencies
------------

* `python3`
  * `lxml`

Examples
--------

This is a kinda funny example, but if you want to get all the Sublime Text
licenses publicly hosted on GitHub in a tarball, you just have to run the
following.

```sh
github-search-dl '"sublime_license" in:path' licenses.tar.gz
```

license: Unlicense

repository: valeriangalliat/github-search-dl

repo_name: valeriangalliat/github-search-dl


text:
---
layout: post
title:  "The Blackest Black"
date:   2016-03-02 00:52:21 -0500
categories: color art ip
---
Vantablack asorbs 99.96% of visible light. British artist Anish Kapoor is the only artist that can use it.

Composed of vertical nanotubes, the 'paint' is tough:

> Very high thermal shock resistance - Repeatedly plunging a Vantablack coated substrate into liquid Nitrogen at -196°C and then transferring to a 300°C hot plate in air does not affect its properties.

More about the material here: [vantablack][vantablack]

[vantablack]: https://www.surreynanosystems.com/vantablack


text:
---
title: Creating new themes
sidebar: flexberry-ember-2_sidebar
keywords: Flexberry Ember Themes
toc: true
permalink: en/ef2_themes_creating.html
folder: products/ember-flexberry/themes/
lang: en
autotranslated: true
hash: 2d82c61d553d49ab93b2789f82824bf4f5873a636e0645f49475d09b16acf8e1
summary: Description of create new themes
---

## How to create new themes

As has already [been said](ef2_themes_structure.html), threads are implemented using Semantic-UI for their design is required to take into account the specifics of the semantics.
[Article on the official website of the framework](https://semantic-ui.com/usage/theming.html)

## The creation in the ember-flexberry

Creating topics with nachinaetsya override file `globals\site.variables` from the default theme. It is main used variables.
For existing components should also first pereprodaet their variables in the appropriate `.variables` files. If that's not enough, then you can rewrite the styles in `.overrides`.

When creating new components, styles to add to your existing theme files `default`, because Semantic-UI does not approve the import of third-party `.less` files, and do not forget to stylize components in other subjects, if required.

## The creation of the other Addons that are using ember-flexberry

As in ember-Addons flexberry need to use the same files `theme.config` and `theme.less` and directory themes.
However, the difference will be that they need to specify the import of the addon.

An example based on the [ember-flexberry-gis](https://github.com/Flexberry/ember-flexberry-gis):

In the file [theme.config](https://github.com/Flexberry/ember-flexberry-gis/blob/develop/theme.config) was added to the directory path to the addon:

```
/* Path to the ember-flexberry-gis theme packages */
@gisThemesFolder : 'addon/styles/themes';
```

And in the file [theme.less](https://github.com/Flexberry/ember-flexberry-gis/blob/develop/addon/styles/theme.less) added the name of the theme used from ember-flexberry:
`@flexberry-theme: 'blue-sky ;` and declared imports the files from your addon.

It is also important to note that if you use peremene files `.variables` themes `default`, you must specify them in the import file `addon.less` for files with the extension `.overrides` it does not apply. [Example](https://github.com/Flexberry/ember-flexberry-gis/blob/develop/addon/styles/addon.less)

In all other respects as well, the styles are overridden first in `.variables`, then `.overrides` and specifies the topic name for the elements used in the file `theme.config` .

gha_language: CSS


text:
#### [PATCH 1/2] KVM: use same boundary check for async_pf
##### From: Wei Yang<EMAIL_ADDRESS>
```c
Commit af585b921e5d ("KVM: Halt vcpu if page it tries to access is
swapped out") introduces async_pf.

The gfn hash table size is defined as:

	gfn_t gfns[roundup_pow_of_two(ASYNC_PF_PER_VCPU)];

And iterations in arch/x86/kvm/x86.c are checked with:

	i < roundup_pow_of_two(ASYNC_PF_PER_VCPU)

While the check in kvm_setup_async_pf() is:

	if (vcpu->async_pf.queued >= ASYNC_PF_PER_VCPU)

Generally this works good, while the check is not exact.

This patch adjust the check in kvm_setup_async_pf() to use the same
boundary as others.

Signed-off-by: Wei Yang<EMAIL_ADDRESS>---
 virt/kvm/async_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

```
#### [PATCH] KVM: x86: Remove KF() macro placeholder
##### From: Sean Christopherson<EMAIL_ADDRESS>
```c
Although well-intentioned, keeping the KF() definition as a hint for
handling scattered CPUID features may be counter-productive.  Simply
redefining the bit position only works for directly manipulating the
guest's CPUID leafs, e.g. it doesn't make guest_cpuid_has() magically
work.  Taking an alternative approach, e.g. ensuring the bit position
is identical between the Linux-defined and hardware-defined features,
may be a simpler and/or more effective method of exposing scattered
features to the guest.

Signed-off-by: Sean Christopherson<EMAIL_ADDRESS>---
 arch/x86/kvm/cpuid.c | 3 ---
 1 file changed, 3 deletions(-)

```
#### [PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
##### From: jiangyiwen<EMAIL_ADDRESS>
```c
In driver probing, if virtio has VIRTIO_VSOCK_F_MRG_RXBUF feature,
it will fill mergeable rx buffer, support for host send mergeable
rx buffer. It will fill a page everytime to compact with small
packet and big packet.

Signed-off-by: Yiwen Jiang<EMAIL_ADDRESS>---
 include/linux/virtio_vsock.h     |  3 ++
 net/vmw_vsock/virtio_transport.c | 72 +++++++++++++++++++++++++++++-----------
 2 files changed, 56 insertions(+), 19 deletions(-)

```
#### [PATCH 1/4] KVM: arm64: Rework detection of SVE, !VHE systems
##### From: Marc Zyngier<EMAIL_ADDRESS>
```c
An SVE system is so far the only case where we mandate VHE. As we're
starting to grow this requirements, let's slightly rework the way we
deal with that situation, allowing for easy extension of this check.

Signed-off-by: Marc Zyngier<EMAIL_ADDRESS>---
 arch/arm/include/asm/kvm_host.h   |  2 +-
 arch/arm64/include/asm/kvm_host.h |  7 ++-----
 virt/kvm/arm/arm.c                | 12 +++++++-----
 3 files changed, 10 insertions(+), 11 deletions(-)

```
#### [RFC PATCH v4 01/13] ktask: add documentation
##### From: Daniel Jordan<EMAIL_ADDRESS>
```c
Motivates and explains the ktask API for kernel clients.

Signed-off-by: Daniel Jordan<EMAIL_ADDRESS>---
 Documentation/core-api/index.rst |   1 +
 Documentation/core-api/ktask.rst | 213 +++++++++++++++++++++++++++++++
 2 files changed, 214 insertions(+)
 create mode 100644 Documentation/core-api/ktask.rst

```
#### [PATCH v3] vhost/vsock: fix use-after-free in network stack callers
##### From: Stefan Hajnoczi<EMAIL_ADDRESS>
```c
If the network stack calls .send_pkt()/.cancel_pkt() during .release(),
a struct vhost_vsock use-after-free is possible.  This occurs because
.release() does not wait for other CPUs to stop using struct
vhost_vsock.

Switch to an RCU-enabled hashtable (indexed by guest CID) so that
.release() can wait for other CPUs by calling synchronize_rcu().  This
also eliminates vhost_vsock_lock acquisition in the data path so it
could have a positive effect on performance.

Reported-and-tested-by<EMAIL_ADDRESS>Reported-by<EMAIL_ADDRESS>Reported-by<EMAIL_ADDRESS>Signed-off-by: Stefan Hajnoczi<EMAIL_ADDRESS>Acked-by: Jason Wang<EMAIL_ADDRESS>---
I have now manually tested the RCU hashtable fix and am happy with this
patch.

 drivers/vhost/vsock.c | 57 +++++++++++++++++++++++++------------------
 1 file changed, 33 insertions(+), 24 deletions(-)

```
#### [PATCH v4 1/8] iommu: Add APIs for multiple domains per device
##### From: Lu Baolu<EMAIL_ADDRESS>
```c
Sharing a physical PCI device in a finer-granularity way
is becoming a consensus in the industry. IOMMU vendors
are also engaging efforts to support such sharing as well
as possible. Among the efforts, the capability of support
finer-granularity DMA isolation is a common requirement
due to the security consideration. With finer-granularity
DMA isolation, all DMA requests out of or to a subset of
a physical PCI device can be protected by the IOMMU. As a
result, there is a request in software to attach multiple
domains to a physical PCI device. One example of such use
model is the Intel Scalable IOV [1] [2]. The Intel vt-d
3.0 spec [3] introduces the scalable mode which enables
PASID granularity DMA isolation.

This adds the APIs to support multiple domains per device.
In order to ease the discussions, we call it 'a domain in
auxiliary mode' or simply 'auxiliary domain' when multiple
domains are attached to a physical device.

The APIs includes:

* iommu_get_dev_attr(dev, IOMMU_DEV_ATTR_AUXD_CAPABILITY)
  - Represents the ability of supporting multiple domains
    per device.

* iommu_get_dev_attr(dev, IOMMU_DEV_ATTR_AUXD_ENABLED)
  - Checks whether the device identified by @dev is working
    in auxiliary mode.

* iommu_set_dev_attr(dev, IOMMU_DEV_ATTR_AUXD_ENABLE)
  - Enables the multiple domains capability for the device
    referenced by @dev.

* iommu_set_dev_attr(dev, IOMMU_DEV_ATTR_AUXD_DISABLE)
  - Disables the multiple domains capability for the device
    referenced by @dev.

* iommu_attach_device_aux(domain, dev)
  - Attaches @domain to @dev in the auxiliary mode. Multiple
    domains could be attached to a single device in the
    auxiliary mode with each domain representing an isolated
    address space for an assignable subset of the device.

* iommu_detach_device_aux(domain, dev)
  - Detach @domain which has been attached to @dev in the
    auxiliary mode.

* iommu_domain_get_attr(domain, DOMAIN_ATTR_AUXD_ID)
  - Return ID used for finer-granularity DMA translation.
    For the Intel Scalable IOV usage model, this will be
    a PASID. The device which supports Scalalbe IOV needs
    to writes this ID to the device register so that DMA
    requests could be tagged with a right PASID prefix.

Many people involved in discussions of this design.

Kevin Tian<EMAIL_ADDRESS>Liu Yi L<EMAIL_ADDRESS>Ashok Raj<EMAIL_ADDRESS>Sanjay Kumar<EMAIL_ADDRESS>Jacob Pan<EMAIL_ADDRESS>Alex Williamson<EMAIL_ADDRESS>Jean-Philippe Brucker<EMAIL_ADDRESS>
and some discussions can be found here [4].

[1] https://software.intel.com/en-us/download/intel-scalable-io-virtualization-technical-specification
[2] https://schd.ws/hosted_files/lc32018/00/LC3-SIOV-final.pdf
[3] https://software.intel.com/en-us/download/intel-virtualization-technology-for-directed-io-architecture-specification
[4] https://lkml.org/lkml/2018/7/26/4

Cc: Ashok Raj<EMAIL_ADDRESS>Cc: Jacob Pan<EMAIL_ADDRESS>Cc: Kevin Tian<EMAIL_ADDRESS>Cc: Liu Yi L<EMAIL_ADDRESS>Suggested-by: Kevin Tian<EMAIL_ADDRESS>Suggested-by: Jean-Philippe Brucker<EMAIL_ADDRESS>Signed-off-by: Lu Baolu<EMAIL_ADDRESS>---
 drivers/iommu/iommu.c | 52 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/iommu.h | 52 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+)

```
#### [PATCH] vhost/vsock: switch to a mutex for vhost_vsock_hash
##### From: Stefan Hajnoczi<EMAIL_ADDRESS>
```c
Now that there are no more data path users of vhost_vsock_lock, it can
be turned into a mutex.  It's only used by .release() and in the
.ioctl() path.

Depends-on<EMAIL_ADDRESS>Suggested-by: Jason Wang<EMAIL_ADDRESS>Signed-off-by: Stefan Hajnoczi<EMAIL_ADDRESS>Acked-by: Jason Wang<EMAIL_ADDRESS>---
Hi Jason,
Thanks for pointing out that spin_lock_bh() is no longer necessary.
Let's switch to a mutex.
---
 drivers/vhost/vsock.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

```


text:
# Blaupause
Is the missing template generator for creating VIPER, MVC, MVVM, etc. templates for your Projects.

## Installation

### Using pre build package
You find the latest build in `bin/Blaupause`. Please consider that you are downlaoding this from the master branch to get the newest stable binary file from Blaupause.

### Compiling from source
Blaupause is build via spm (swift package manager) if you checkout the sources just run
```shell
swift build -c release
```
And you can find it in `.build/release/Blaupause` to run it from there.

## Using
The usage is pretty simple just start
### Usage to create a new VIPER Module
```shell
Blaupause viper FooBar
```

### Usage to create a new MVC Module
```shell
Blaupause mvc FooBar
```

### Usage to create a new MVVM Module
```shell
Blaupause mvvm FooBar
```

### Usage to create a new structure from your template
```shell
Blaupause template FooBar
```
Searchs for a .blaupause.json file in the current path of Blaupause execution.

## JSON Templates
Blaupause has the ability to create your own custom templates. If you want to create your own implementation Blaupause always checks the current execution path for a `.blaupause.json` file with the current implementation for a Template. Two different types are supported `Folder` and `Files`.

The JSON must always start with an array.

### Folder
The Folder Type creates a Folder for you. Folder can hold children of different Folder and of Files.

#### JSON Notation
*Creating a Folder without Children*
```json
{
  "type": "folder",
  "name": "FolderName",
  "children": null
}
```
*Creating a Folder with Children*
```json
{
  "type": "folder",
  "name": "FolderName",
  "children": [
    {
    "type": "folder",
    "name": "FolderName",
    "children": null
    }
  ]
}
```

### Files
The Files Type creates a File for you. A File can't hold chilrens.

#### JSON Notation
*Creating a File*
```json
{
    "type": "file",
    "name": "FileName.fileEnding"
}
```

## ToDo
- [x] Creating MVC Command
- [x] Creating MVVM Command
- [x] Error Handling if the Folder is already there
- [x] JSON Parsing for template files
- [x] Add ability to parse .blaupause.json files to create custom template that can be provided
- [ ] Support for Template Files in your own .blaupause folder
- [ ] Unit Testing
- [ ] Create a wizard when starting without options
- [ ] Publish it to Homebrew

repository: mRs-/Blaupause

repo_name: mRs-/Blaupause


text:
---
title: Periodic Table of Scientists
subtitle: Periodic Table with Distinguished Scientists
summary: Periodic Table with Distinguished Scientists.
breadcrumbs: ["blog"]
date: "2020-07-28T00:00:00Z"
authors:
- rodrigo-alcaraz-de-la-osa
- jesica-sanchez-mazon
tags:
- periodic-table
categories:
- Physics
- Chemistry
image:
  preview_only: true
  placement: 3
#  caption: Tabla Periódica DC
#links:
#- icon_pack: fas
#  icon: file-download
#  name: PDF
#  url: pdf/periodic-table-scientists.pdf
---

Inspired by the [ Periodic Table]({{< ref "/post/tabla-periodica-DC/index.md" >}}), {{% mention "jesica-sanchez-mazon" %}} and myself present our version with **distinguished scientists**.

{{% callout note %}}
Each image is a **link** that takes you to the scientist's Wikipedia page. In addition, on the back (second page of the PDF) you can see both the **name** of each **element** and that of each **scientist** (both linked to Wikipedia).
{{% /callout %}}

## Notes
Some **notes** about the Table:

- As far as possible, we have chosen scientists (physicists/chemists and some mathematicians) whose surname reminds us of the element's name (both pronounced in English).
- Elements named after a scientist are associated with that scientist.

- When in doubt, the priority has been to choose the most important scientists and/or Nobel Prize winners.

{{% callout note %}}
If you like these ***special* Periodic Tables**, take a look at the versions with [**pictures**](https://elements.wlonk.com), []({{< ref "/post/tabla-periodica-DC/index.md" >}}), [](https://marvelperiodictable.blogspot.com/2020/07/1.html), [](https://kitchapman.co.uk/a-disney-periodic-table/), [](http://www.ndietrich.com/archives/950) or [](http://www.ndietrich.com/archives/955) **characters**. You also have a [**conventional version**]({{< ref "/post/tabla-periodica-elementos/index.md" >}}).
{{% /callout %}}

repository: DatWins/fisiquimicamente

repo_name: DatWins/fisiquimicamente


text:
# DCli Clean All

The `cleanall` command will delete all of the Virtual Projects under \`~/.dcli/cache and rebuild each of them.

Usage: `dcli cleanall`

Example:

```text
dcli cleanall
```

repository: graphicbeacon/dcli

repo_name: graphicbeacon/dcli


text:
# mysimplecompedium

<!-- badges: start -->
[![R build status](https://github.com/mshhh/mysimplecompedium/workflows/R-CMD-check/badge.svg)](https://github.com/mshhh/mysimplecompedium/actions)
<!-- badges: end -->

The goal of mysimplecompedium is to ...

## Installation

You can install the released version of mysimplecompedium from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("mysimplecompedium")
```

## Example

This is a basic example which shows you how to solve a common problem:

``` r
library(mysimplecompedium)
## basic example code
```


text:
* Reference: [Uploading a File to Amazon Web Services (AWS) S3 Bucket with Node.js
](https://medium.com/@Keithweaver_/uploading-a-file-to-amazon-web-services-aws-s3-bucket-with-node-js-133b0a1af2b9)
* Video tutorial to set up AWS IAM user and bucket policy here: [AWS S3 with Node.js - Amazon Web Services End to End Guide Dec 2017](https://www.youtube.com/watch?v=joXy_OTCO_E)

* Run command ```npm run start:dev```. This will start the server.
* Call api via postman with url: ```http://localhost:8080/api/upload``` and ```form-data``` in request body with parameters ```element1``` and ```element2```. Attach a file to value of ```element2```.

* Code written in ```server/routes/api/file.js```. Provide values of ```BUCKET_NAME```, ```IAM_USER_KEY``` and ```IAM_USER_SECRET```.


text:
[![Build Status](https://travis-ci.org/danielsdeboer/makeable.svg?branch=master)](https://travis-ci.org/danielsdeboer/makeable)
[![Latest Stable Version](https://poser.pugx.org/aviator/makeable/v/stable)](https://packagist.org/packages/aviator/makeable)
[![License](https://poser.pugx.org/aviator/makeable/license)](https://packagist.org/packages/aviator/makeable)

## Overview

This package provides a static constructor interface, and a trait that implements the interface.

### Installation

Via Composer:

```
composer require aviator/makeable
```

### Testing

Via Composer:

```
composer test
```

### Usage

Use the trait:

```php
class Something
{
    use MakeableTrait;
}
```

Then the class can be instantiated using `Class::make(...$args)`:

```php
$instance = Something::make($arg1, $arg2);
```

The interface is optional, though it can be useful in composite interfaces to specify that a static constructor should be present:

```php
interface SomeInterface extends Makeable, SomeOtherInterface
{
    /* ... etc */
}
```

Since the static constructor simply returns `new static(...$args)`, it can be used in abstract classes and parent classes without having to re-use it on child classes:

```php
abstract class Seuss
{
    use MakeableTrait;
}

class ThingOne extends Seuss {};
class ThingTwo extends ThingOne {};

// Get an instance of ThingOne
$instance = ThingOne::make();

// Get an instance of ThingTwo
$instance = ThingTwo::make();
```

## Other

### License

This package is licensed with the [MIT License (MIT)](LICENSE).

repository: danielsdeboer/makeable

repo_name: danielsdeboer/makeable


text:
---
title: Arrow Docs
header-image: /img/twitter-card.png
category: articles
tags: [core, optics, fx, incubator, meta]
link: https://arrow-kt.io/
---
Take a look at the Λrrow documentation [`Here`]({{ 'https://arrow-kt.io/docs/core/' | relative_url }}). Test and modify real-time code snippets.

repository: arrow-kt/arrow-media

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: arrow-kt/arrow-media


text:
# Angular + Bootstrap parking App

This is a angular + bootstrap parking App using CoreUI.

CoreUI is an Open Source Bootstrap Admin Template. But CoreUI is not just another Admin Template. It goes way beyond hitherto admin templates thanks to transparent code and file structure. And if that's not enough, let’s just add that CoreUI consists bunch of unique features and over 1000 high quality icons.

## Installation

### Clone repo

``` bash
# clone the repo
$ git clone https://github.com/neerajsu/parkingAppRepository.git parkingApp

# go into app's directory
$ cd parkingApp

# install app's dependencies
$ npm install
```

## Usage

``` bash
# serve with hot reload at localhost:4200.
$ ng serve

# build for production with minification
$ ng build
```

## What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

```
free-angular-admin-template/
├── e2e/
├── src/
│   ├── app/
│   ├── assets/
│   ├── environments/
│   ├── scss/
│   ├── index.html
│   └── ...
├── .angular-cli.json
├── ...
├── package.json
└── ...
```
## Creators

**Neeraj Subramaniyan**

* <https://github.com/neerajsu>
*

## Copyright and license

This is not for re-use. This is purely my personal app. If you want to create a similar app go to CoreUI website for more information. The documentation for the CoreUI Free Angularp Admin Template is hosted at the following website [CoreUI](https://coreui.io/angular/).

repository: neerajsu/parkingAppWebUI

repo_name: neerajsu/parkingAppWebUI


text:
---
title: Drift
description: The Drift migration tool guide.
extends: _layouts.documentation
section: content
---

# Drift

**WARNING: This is a 'work in progress'.**

Drift is a command-line tool to migrate your PHPUnit tests to Pest.

## Installation

Drift can be installed through Composer like all Pest components using the following command:

```bash
composer require pestphp/drift --dev --update-with-all-dependencies
```

Once installed, it provides a Composer binary that can be executed with `vendor/bin/drift`.

There are two main commands: `migrate` and `polish`

## Migrate

This command allows you to migrate your tests to the Pest syntax. Behind the scenes, Drift uses [Rector](https://github.com/rectorphp/rector), a tool for refactoring PHP code. Note, these do not follow a specific code style so may require formatting after using your own PHP code style tools.

To view the changes that would be made without applying them (dry-run), use the `--show` flag:

```bash
vendor/bin/drift migrate --show tests
```

Once you have confirmed that the changes are fine, run the command without the flag to apply the changes:

```bash
vendor/bin/drift migrate tests
```

You can then run `vendor/bin/pest` to verify that the changes run as expected.

## Polish

The Polish command will apply an additional set of changes to make sure your tests follow Pest best practices.

To view the changes that would be made without applying them (dry-run), use the `--show` flag:

```bash
vendor/bin/drift polish --show tests
```

Once you have confirmed that the changes are fine, run the command without the flag to apply the changes:

```bash
vendor/bin/drift polish tests
```

---

Next section: [Laravel →](/docs/guides/laravel)

repository: pestphp/website

gha_language: Blade

repo_name: pestphp/website


text:
# LifxHttpNet
.Net wrapper around the Lifx cloud HTTP API

* This library acts as a thin wrapper around the public Lifx HTTP API as described
  at http://developer.lifx.com
* All operations make use of the async Task APIs via
  [Refit](http://paulcbetts.github.io/refit/) for REST calls
* This library does not perform any caching or management of model objects other than to
  simplify accessing the API
* I hope that this library helps enthusiasts tinker with their Lifx lights, though much
  more backend code would be required for a full-featured Lifx client
* Use of this library requires a Personal Access token acquired from:
    https://cloud.lifx.com/settings
* Use of this library should only be in accordance to the terms at:
    http://developer.lifx.com/terms.html

repository: caleblanchard/LifxHttpNet

gha_language: C#

repo_name: caleblanchard/LifxHttpNet


text:
[](/data_science/index)

[](http://people.ischool.berkeley.edu/~ajacobson/final_project/)

## Who Are California's Anti-Vaxxers?
[**UC Berkeley | Data Visualization and Communication**](https://www.ischool.berkeley.edu/courses/datasci/209)

*Anna Jacobson and [Allison Godfrey](https://allison-godfrey.github.io/)*

---

#### Project Description
A data visualization project exploring anti-vaccination behaviors in California from 2000 to 2015. Includes a visual essay and a data dashboard.

#### Skills
Data Visualization, Written Communication, Web Design, Data Cleansing

#### Tools
Tableau, HTML/CSS, JavaScript, CodePen

---

#### Motivation

Vaccinations provide people the ability to develop immunity to particular diseases. When the majority of a population is vaccinated, “herd immunity” protects those who have not been vaccinated by blocking the spread of these diseases. However, the 21st century has seen worldwide concern over the safety of the Measles/ Mumps/Rubella (MMR) vaccine and other types of vaccines - despite the lack of scientific evidence to substantiate these fears.

This trend has been called vaccine hesitancy, anti-vaccination, or "anti-vax" for short. Anti-vax refers to a refusal or reluctance to have children vaccinated despite the overwhelming evidence that vaccines are safe and effective. This hesitancy may come from a misunderstanding of the ingredients in vaccines and how they work, mistrust of doctors and pharmaceutical companies, and/or belief in the unfounded associations of vaccines with other diseases and disorders such as autism.

Anti-vaccination was identified by the World Health Organization as one of top ten global health threats of 2019. In California, an alarming 15-year-long anti-vax trend led to Senate Bill 277, signed into law in 2015, which eliminated Personal Belief Exemptions for vaccinations of school-age children. California is currently one of only three states in the US with such a law.

In this project, we visualize anti-vaccination in California in the period from 2000 through the passage of Senate Bill 277 in 2015.

---

---

See the visual essay and the data dashboard.


text:
# ACTUS and Marlowe

This tutorial gives an introduction to the general idea of the ACTUS standards for the algorithmic representation of financial contracts, plus examples implemented in Marlowe.

## ACTUS

The ACTUS Financial Research Foundation [https://www.actusfrf.org](https://www.actusfrf.org) has created a standard for financial contracts, categorised by means of a [taxonomy](https://www.actusfrf.org/taxonomy) and described in a detailed [technical specification](https://www.actusfrf.org/algorithmic-standard).

The ACTUS standards build on the understanding that financial contracts are legal agreements between two
(or more) counterparties on the exchange of future cash flows. Historically, such legal agreements are described in natural language leading to ambiguity and artificial diversity. As a response, the ACTUS standards define financial contracts by means of a set of contractual terms and deterministic functions mapping these terms onto future payment obligations. Thereby, it is possible to describe the vast majority of financial instruments through a set of little more than 30 Contract Types or modular templates, respectively.

The ACTUS specifications provide a breadth of exercises for implementation in Marlowe, and we illustrate an approach to this in the following example.

## Simple Safe Zero Coupon Bond Example

A zero-coupon bond is a debt security that doesn't pay interest (a coupon)
but is traded at a deep discount, rendering profit at maturity
when the bond is redeemed for its full face value.

For example, an investor can buy a bond that costs 1000 Ada with 8% discount.
He pays 920 Ada to the bond issuer before _start date_.

Later, after _maturity date_, investor can exchange the bond for its full notional, i.e. 1000 Ada.

```haskell
zeroCouponBond :: Person -> Person -> Integer -> Integer -> Timeout -> Timeout -> Timeout -> Contract
zeroCouponBond creatorID counterpartyID notionalPrincipal premiumDiscount initialExchangeDate maturityDate gracePeriod =
    -- prepare money for zero-coupon bond, before it could be used
    Commit 1 1 counterpartyID (Constant (notionalPrincipal - premiumDiscount)) initialExchangeDate maturityDate
        -- issuer must commit a full notional value of a bond
        (Commit 2 2 creatorID (Constant notionalPrincipal) initialExchangeDate (maturityDate + gracePeriod)
            (When FalseObs initialExchangeDate Null
                -- after start date but before maturity date the issuer can receive the bond payment
                (Pay 3 1 creatorID (Committed 1) maturityDate
                    (When FalseObs maturityDate Null
                        -- after maturity date the investor can claim bond's full value
                        (Pay 4 2 counterpartyID (Committed 2)
                            (maturityDate + gracePeriod) Null Null)
                    )
                    Null
                )
            )
            Null
        )
        Null
````

This contract has a significant drawback requiring the issuer to commit the full bond notional value before _start date_, making the contract arguably useless.

There are at least two ways to solve this: we could trust our issuer and do not require him to commit beforehand, or we could ask a third party to be a guarantor of the deal.

> __Exercises__
>
> Give a variant of the `zeroCouponBond` contract in which it is not necessary for the bond creator to put the full payment up before the bond is issued.
>
> Give a variant of the `zeroCouponBond` contract which also includes a `guarantor` who puts up the full payment up before the bond is issued, and who will pay that counterparty if the issuer defaults; if the issuer does make the payment in time, then the guarantor should recover their money.

## Guaranteed Coupon Bond Example

This more complex bond involves a guarantor who puts up the notional principal value at the start of the contract. Repayments are calculated according to a schedule of every `slotCycle` slots until `maturityDate`. At each payment slot, the guarantor pays if (and only if) the issuer does not.

```haskell
couponBondGuaranteed :: Integer -> Integer -> Integer -> Integer -> Double
                     -> Timeout -> Timeout -> Timeout -> Timeout -> Contract
couponBondGuaranteed creatorID counterpartyID guarantor notionalPrincipal
                     nominalInterestRate initialExchangeDate slotCycle
                     maturityDate gracePeriod =
    -- counterpartyID commits a bond face value before initialExchangeDate
    Commit 1 0 counterpartyID (Constant notionalPrincipal) initialExchangeDate maturityDate
        -- guarantor commits a 'guarantee' before initialExchangeDate
        (Commit 2 1 guarantor (Constant totalPayment) initialExchangeDate (maturityDate + gracePeriod)
            (Both
                -- creatorID can receive the payment from counterpartyID
                (Pay 4 1 creatorID (Committed 0) maturityDate Null Null)
                -- schedule payments
                (Both payments finalPayment)
            )
            -- if no guarantee committed we abort contract and allow to redeem the counterpartyID's commit
            (Pay 3 0 counterpartyID (Committed 0) maturityDate Null Null)
        )
        Null
  where
    cycles = takeWhile (\i ->
            let paymentDate = initialExchangeDate + i * slotCycle
            in paymentDate < maturityDate
        ) [1..]

    -- calculate payment schedule
    paymentDates = map (\i -> initialExchangeDate + i * slotCycle) cycles

    coupon = round $ fromIntegral notionalPrincipal * nominalInterestRate

    -- calculate total amount of payments to be ensured by guarantor
    totalPayment = notionalPrincipal + coupon * genericLength cycles

    -- generate Commit/Pay for each scheduled payment
    payment amount (ident, paymentDate) =
        -- creatorID commits a coupon payment
        Commit baseActionId ident creatorID (Constant amount) paymentDate (maturityDate + gracePeriod)
            (When FalseObs paymentDate Null
                -- counterpartyID can claim the coupon after payment date
                (Pay (baseActionId + 1) ident counterpartyID (Committed ident) (maturityDate + gracePeriod) Null Null))
            -- in case creatorID did not commit on time the guarantor pays the coupon
            (Pay (baseActionId + 2) (ident + 1) counterpartyID (Constant amount) (maturityDate + gracePeriod) Null Null)
        where baseActionId = (5 + ((ident `div` 2) - 1) * 3)

    -- generate coupon payments for given schedule
    payments = foldr1 Both $ map (payment coupon) idsAndDates
        -- generate IdentCC/IdentPay identifiers for each payment date
        where idsAndDates = zip (map (2*) [1..]) paymentDates

    finalPayment = payment notionalPrincipal (2 * (1 + genericLength paymentDates), maturityDate)
```

IOHK plans to implement the full ACTUS standard using Marlowe and Plutus over the coming year.

### [Prev](./meadow-overview.md) [Up](./README.md) [Next](./marlowe-plutus.md)

repository: wadler/marlowe

repo_name: wadler/marlowe


text:
---
title: Spark for ETL
---

## Overview

Spark can be leveraged as an ETL tool in the cloud.  In fact, AWS Glue - which moves data from traditional databases to the cloud - is based upon Spark.  While Spark can also be used extensively for Data Science, this page intends to document portions of Spark that are particularly relevant to ETL.

## Architecture

At a high-level, many companies divide their data lake into 3 stages:

* Raw - Source data in whatever format it arrives (example: ".csv.gz")
* Stage - Data converted to standard format (parquet) but otherwise unchanged.
* Curated - Data transformed for a specific purpose.  This will impose a data model (at least in terms of naming consistency) and allow data to be easily understood and processed.

Spark jobs will be key in transforming the raw data to parquet format for staging.  They will also be central to the transformation process from stage to curated.  Techniques for accomplishing these transformations are discussed here.

## Sample Jobs

### Raw-to-Stage

The following code will read a CSV file and transform it to parquet.  The input file and output folder can be passed in as parameters (or specified manually via widgets for testing/debugging).  In this sample we append a new column named "cycle_ts" to capture the current timestamp and use this to partition the output.  Each run of this job will create a new output folder named "cycle_ts=..." underneath the parent output folder.

___File: raw-to-stage.py___

```
## Input Parameters

dbutils.widgets.removeAll()
dbutils.widgets.text("inputFile", "/raw/system/logs/log.20200216.csv", "Source File (Raw)")
dbutils.widgets.text("outputFolder", "/stage/system/logs", "Output Folder (Stage)")

INPUT_FILE = dbutils.widgets.get("inputFile")
OUTPUT_FOLDER = dbutils.widgets.get("outputFolder")

## Initialization

# TODO: These should be passed in or initialized some other way
STORAGE_ACCOUNT_NAME = "datalakestorage"
STORAGE_ACCOUNT_KEY = "secretkey"

RAW_URL = "wasbs://raw@{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME)
STAGE_URL = "wasbs://stage@{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME)

spark.conf.set(
  "fs.azure.account.key.{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME),
  STORAGE_ACCOUNT_KEY)

## Processing

df_item = spark.read.csv(RAW_URL + INPUT_FILE, header=True)

from pyspark.sql import functions as F
df_output = df_item.withColumn("cycle_ts", F.current_timestamp())

df_output.write.partitionBy("cycle_ts").format("parquet").save(STAGE_URL + OUTPUT_FOLDER, mode="append")
```

### Stage-to-Curated

The following code will read the file we just output to stage and do a simple aggregation on it before writing it out to curated.  Each job run will process data from a specific "cycle_ts" and output its results in a data set that is also partitioned by "cycle_ts".

___File: stage-to-curated.py___

```
## Input Parameters

dbutils.widgets.removeAll()
dbutils.widgets.text("inputFolder", "/stage/system/logs", "Source Folder (Stage)")
dbutils.widgets.text("cycle_ts", "2019-12-12 22:54:14.084", "Cycle Timestamp")
dbutils.widgets.text("outputFolder", "/curated/system/logs", "Output Folder (Curated)")

INPUT_FOLDER  = dbutils.widgets.get("inputFolder")
CYCLE_TS      = dbutils.widgets.get("cycle_ts")
OUTPUT_FOLDER = dbutils.widgets.get("outputFolder")

## Initialization

# TODO: These should be passed in or initialized some other way
STORAGE_ACCOUNT_NAME = "datalakestorage"
STORAGE_ACCOUNT_KEY = "secretkey"

STAGE_URL = "wasbs://stage@{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME)
CURATED_URL = "wasbs://curated@{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME)

spark.conf.set(
  "fs.azure.account.key.{}.blob.core.windows.net".format(STORAGE_ACCOUNT_NAME),
  STORAGE_ACCOUNT_KEY)

## Processing

df_item = spark.read.parquet(STAGE_URL + INPUT_FOLDER)

df_filtered = df_item.filter(df_item.cycle_ts == CYCLE_TS)

from pyspark.sql import functions as F
df_summary = df_filtered.groupBy(
  ...
).agg(
  F.sum('value').alias('value')
)

df_summary.write.partitionBy("cycle_ts").format("parquet").save(CURATED_URL + OUTPUT_FOLDER, mode="append")
```

## Running DataBricks Jobs through ADF

Once you have a DataBricks notebook in good shape, you can schedule it to run through ADF.  This is actually very simple to do.  Microsoft documentation is available here:

https://docs.microsoft.com/en-us/azure/data-factory/transform-data-using-databricks-notebook

You will need to:

1. Create a new connection to your DataBricks service
2. Create a new pipeline with just 1 activity: run DataBricks Notebook
3. Configure the activity (specifying the DataBricks connection and the path to your notebook)
4. Link up any parameters that you want to pass into the notebook

When creating the connection to the DataBricks service you will fill out a form that lets you provide:

* Connection name
* Description
* Integrated Runtime
* subscription
* DataBricks workspace
* Cluster Type (new, existing interactive cluster, existing instance pool)
* Access token

I like to use existing interactive clusters even though best pratice might be to spin up new ones for each job.  This is great for testing since you won't have to wait for the cluster to spin up to run your job.  It also gives you the option to pre-configure the cluster if you'd like (load libraries, mount file systems, or setup credentials to connect to other services).  If you'd like, you can spin up a new job cluster for each job.  You will need to specify all the configuration (number and type of nodes, Spark version, etc.), but it is completely customizable.

On your DataBricks Notebook activity, you can pass in parameters in the settings page.  The screenshot below shows 3 parameters.  The value of these parameters is being pulled from the pipeline parameters.

![Screenshot](assets/notebook-activity-params.png)

These could be passed into a notebook that defines the input parameters as widgets with:

```
dbutils.widgets.text("inputFolder", "", "Source Folder (Stage)")
dbutils.widgets.text("cycle_ts", "", "Cycle Timestamp")
dbutils.widgets.text("outputFolder", "", "Output Folder (Curated)")
```

In this example we have setup the parameters to reference the pipeline parameters.  These are defined at the pipeline level:

![Screenshot](assets/pipeline-parameters.png)

When you run the pipeline you will be prompted to enter values for these parameters.  This also makes it easier to inject the parameters into the pipeline if you run it automatically.  The parameters are passed down to the activity which passes them down into your notebook.

One really cool feature of ADF+DataBricks is that it saves a notebook for each activity run and lets you view it from ADF.  Clicking "details" by the pipeline run will bring up a link to the DataBricks notebook.  This will show you how long each cell took to execute, the output of each cell, and additional information such as the values of any parameters passed to the notebook.

## Best Practices for CI/CD Pipelines and Test-Ability

I won't pretend to have really figured out best practices yet, but I have found a lot of good resources with what appear to be good suggestions.  These are documented below.

### Separating "E", "T", and "L"

I don't know if it's a best practice, but I see a lot of references to the daria-spark library, and its EtlDefinition object.  This object is defined (in Scala) as:

```
case class EtlDefinition(
    sourceDF: DataFrame,
    transform: (DataFrame => DataFrame),
    write: (DataFrame => Unit)
) {

  def process(): Unit = {
    write(sourceDF.transform(transform))
  }

}
```

It lets you define your ETL job with:

```
val etl = new EtlDefinition(
  sourceDF = extractDF,
  transform = model(),
  write = exampleWriter()
)
```

and then run it with:

```
etl.process()
````

I don't think this is worth pulling the whole daria-spark library into your projects.  I'm not even sure I like using the EtlDefinition object.  But I do like the idea of:

* One function to read your data
* One function to transform your data
* One function to write your data

Building a separate function for each of these tasks will keep your code clean and even enable re-use of data sources and sinks.

### Idempotent Jobs

The CTO of Swoop gave a presentation at the 2016 and 2017 Spark Summit called "Bulletproof Spark Jobs".  Each talk is 30 minutes, and even though they had the same name the content differs slightly.  YouTube videos of his talk can be found at the links below:

* https://www.youtube.com/watch?v=uvAX7xmEprs
* https://www.youtube.com/watch?v=_VwyKCgG3mE

The speaker noted at over 90% of the problems with ETL jobs are "transient", meaning the problem goes away if you just wait and re-try the job later.  But he asks if your job can safely run a second time, or a third time if needed.  Idempotent jobs provide this capability: they will produce the same final state no matter how many times you run them.  In Spark, this is not straight-forward to achieve.  If you write files in "append" mode, you will add more and more records every time the job runs.  Instead, you have to write them in "overwrite" mode (or go manually delete all the data any prior runs before running).

The easiest way to get idempotent Spark jobs is to write your data to a specific partition and use "overwrite" mode.  For example, we ended up re-writing our "stage-to-curated" example to use the following code:

```
from pyspark.sql import functions as F

def read_stage_file(trn_dt, div_no):
    file_path = "{}/system/table/trn_dt={}/div_no={}".format(
        STAGE_URL, trn_dt, div_no
      )
    return spark.read.format("parquet") \
                .load(file_path)

def write_curated_file(df, trn_dt, div_no):
    out_file_path = "{}/system/table/trn_dt={}/div_no={}".format(
        CURATED_URL, trn_dt, div_no
      )

    print("Writing data to {}".format(out_file_path))
    df.write.format("parquet").save(out_file_path, mode="overwrite")

### Run #################################################################################

df_item = read_stage_file(TRN_DT, DIV_NO)

def transform(df_item):
    return df_item.groupBy(
        'div_no', 'trn_dt'
    ).agg(
        F.sum('value').alias('value')
    )

df_summary = transform(df_item).cache()

write_curated_file(df_summary, TRN_DT, DIV_NO)
```

Notice that when we read the staged data, we are reading from one specific partition ("trn_dt={}/div_no={}") and writing to one specific partition in curated ("trn_dt={}/div_no={}" again).  In this case we know our data files only contain information for a single division and transaction date.  Because mode is set to "overwrite", we can run this job as many times as we want and it will never duplicate any data.  We can still read these data sets without stepping down into the individual partition folders.  For example, we could read from:

```
{}/system/table
```

But we can't really write to the file using this path.  Doing so would force us to use "append" mode which would duplicate data each time we ran.  If we tried to use "overwrite" mode at this level it would delete the entire data set (all partitions) whenever we tried to write a single partition.

Writing jobs in this way is pretty cool, because it means you can recover from 90%+ of your problems by just running the job again.  The speaker also mentioned writing a framework that doesn't let your entire ETL job fail if only a few records are bad.  Instead, it pushes through the records it can and stores the errors in a separate location along with known error types and detailed stack traces.  He says that this has reduced troubleshooting time by 98%, making it much easier for data engineers to find out why particular jobs or records are failing in their ETL pipelines.

### Custom (Re-Usable) Libraries

The Microsoft CSE team recommends putting all your ETL code in Python/PySpark into a custom library that you reference in your DataBricks notebook.  The DataBricks notebook then just becomes a light-weight shell that marshals parameters into your code and returns results from it.  They said that this would make it easier to test your Python code (although we haven't actually done that yet).  We have seen that it helps with code re-use.  One function we wrote for our data transformation looked like this:

```
from pyspark.sql.types import LongType, StringType, StructField, StructType, BooleanType, ArrayType, IntegerType
from pyspark.sql import functions as F

def get_raw_file_path(cycle_date, div_no):
    return "{}/system/table/{}/file_{}_{}.csv.gz".format(
            RAW_URL, cycle_date, div_no, cycle_date)

def get_raw_file_schema():
    """Returns the schema for the raw file.  Since this is a CSV file (with
    no header) we have to specify everything explicitly.  All fields are loaded as
    strings.
    """
    cols = [
        ... about 35 different fields ...
    ]

    fields = list()
    for col in cols:
        fields.append(StructField(col, StringType(), True))

    return StructType(fields)

def load_raw_file(cycle_date, div_no):
    file_path = get_raw_file_path(cycle_date, div_no)
    schema = get_raw_file_schema()
    return spark.read.format("csv").schema(schema).load(file_path)
```

In this case we are reading a CSV file without a header, and we have to specify the entire schema (with all field names and optionally types) when we read it.  Imagine copying this code into each notebook that wants to read this file.  In this case it is much better to put functions like this in a library.  We did notice that our library couldn't access certain context objects like "spark" or "dbutils".  These had to be passed in to the classes/methods in our library.

Once you begin using libraries you will also have to figure out how/where to store those libraries and how to update and deploy new versions.  In our test we compiled the libraries into binary wheels and installed them on the DataBricks cluster manually.  It would be far better to setup a CI/CD pipeline to deploy your library artifacts somewhere (AzDO or Artifactory?) and then pull them into the cluster when the cluster is created.

### CI/CD Pipelines

The following page provides a good overview of how Microsoft recommends doing CI/CD deployments with Azure Data Factory jobs:

https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment

In brief:

* You develop pipelines in a development ADF environment that with Git mode
  * Git mode means that all your configuration and pipelines are stored in version-controlled files in git
  * GitFlow is recommended for development:
    * Make changes on your own separate branch
    * Submit these via pull requests to merge back into the master branch
* When ready: use the "publish" button to create an ARM template that deploys your entire ADF environment into a test environment in Azure
* When test pass: take the same ARM template you already published and tested and deploy ADF into your production environment

The ARM template ensure that both test and production get exact copies of your development environment with all of its pipelines, connections, and any other configuration.  Any configuration that differs between these environments can be injected into the ARM templates.

A co-worker provided this link for CI/CD best practices for DataBricks:

* https://thedataguy.blog/ci-cd-with-databricks-and-azure-devops/

This page shows how to check your DataBricks notebook code into a git repository (specifically AzDO Repository) and setup build pipelines to deploy the notebooks as artifacts.  You can then write a release pipeline that deploys these to various environments as you promote them to stage and eventually to prod.

Another specialist from DataBricks provided these two links as well:

* https://datathirst.net/blog/2019/9/20/series-developing-a-pyspark-application
* https://medium.com/@bedatse/azure-devops-ci-cd-with-azure-databricks-and-data-factory-part-1-c05a44536a8e

TODO: Wrap all this up into one big recommendation?

repository: bodhi-root/public-wiki

repo_name: bodhi-root/public-wiki


text:
# ebiten-signals
A very minimal signal pattern, built for ebiten

## Usage
```go
import signals "github.com/tducasse/ebiten-signals"

params := []interface{}{"string here", "a string"}
// emit a signal from anywhere in your game
signals.Emit("collided", params)

// connect to it somewhere else
signals.Connect("collided", func(i []interface{}) {
  message = ""
  for _, part := range i {
    message += part.(string) + " "
  }
})
```

repository: tducasse/ebiten-signals

repo_name: tducasse/ebiten-signals


text:
---
date: 2020-10-15
title: 'Reduce Clutter by Disabling Tools'
technologies: [go]
topics: ['ide']
author: dlsniper
subtitle: 'Save space by turning off various toolbars and Project Tool.'
seealso:
  - title: 'Configuring Menus and Toolbars'
    href: 'https://www.jetbrains.com/help/go/configuring-menus-and-toolbars.html'
thumbnail: ./thumbnail.png
cardThumbnail: ./card.png
shortVideo:
  poster: ./poster_short.png
  url: https://www.youtube.com/watch?v=Fwgc0rBenvc&list=PLM-t1Z4tbFfnXnghmtk6WVz10_pivOw25&index=3&t=0s
leadin: |
  *You don't have to use all those tools. Let's turn them off.*

  By default, GoLand has lots of features visible and available.
  As you learn your way around, you want to give more space to
  the editor and focus on your coding.

---


text:
# same-same: ignore the differences between a and Identity a.

[![Build Status](https://api.travis-ci.org/isovector/same-same.svg?branch=master)](https://travis-ci.org/isovector/same-same) | [Hackage][hackage]

[hackage]: https://hackage.haskell.org/package/same-same

## Dedication

> The ego is only an illusion, but a very influential one. Letting the
> ego-illusion become your identity can prevent you from knowing your true self.
> Ego, the false idea of believing that you are what you have or what you do, is
> a backwards way of assessing and living life.
>
> Wayne Dyer

## Synopsis

I think [higher-kinded data][hkd] is a pretty cool guy. eh reuses datatypes and
doesn't afraid of anything.  Armed with this proof, we're able
to get rid of the HKD type family, and thus regain our derived instances.

## Unsoundness

This plugin is a teensy little bit **completely unsound** and when used for
evil, is capable of producing `forall a b. a ~ b` proofs. Fortunately, you need
to be actively trying to accomplish such a feat, and so you're probably going to
be a-ok.

Modules that haven't loaded the plugin are not affected by this "feature."

## Example

```haskell
{-# OPTIONS_GHC -fplugin=Data.Functor.Identity.Plugin #-}

module Test where

import Data.Functor.Identity

data X f = X
  { foo :: f Int
  }

getFoo :: X Identity -> Int
getFoo = foo
```

## Contact

Please reports bugs and missing features at the [GitHub bugtracker][issues]. This is
also where you can find the [source code][source].

`same-same` was written by [Sandy Maguire][me] and is licensed under a
permissive MIT [license][lic].

[me]: http://reasonablypolymorphic.me
[lic]: https://github.com/isovector/same-same/blob/LICENSE
[issues]: https://github.com/isovector/same-same/issues
[source]: https://github.com/isovector/same-same

repository: pepeiborra/same-same

repo_name: pepeiborra/same-same


text:
# Welcome to Mathletes!

### Team Members:
- Amy Liao
- Corey Beck
- Matthew LeFurge

### MVP

The MVP for Mathletes was to create an application that allows a signed up user to test their math skills with pre-made flashcards. The user would then be able to see their scores at the end of the flashcards as well as any flashcards taken in the past.

### Trello Board & Wireframe

Our team used a [Trello][] board to obtain an agile workflow.

### Team Dynamic and Git workflow

The Git workflow was simple: each member would take on a task via [Trello][] and when it is completed, move it to the 'Completed' section. Teammates would review each other's pushed work to ensure all requirements are met before merging it master.

The members of Mathletes wokred close together during the project and kept the goal in mind by consistantly communicating the status of the project with each other. The team leaned on each other for helped and guidence which contributed to the sucess of the project.

[Trello]: https://trello.com/b/pzKC3ZWD/web-flash-cards

repository: amyhliao/math-flashcard

repo_name: amyhliao/math-flashcard


text:
# Analysis results

For the project, different panels have been created to answer certain analytical questions, such as :
- Top products
- Temporal evolution of prescriptions
- Medical Practices with more records
- Grouping of specifications by Postcode

To better exemplify the use of panels the analysis has focused on available products related to gluten.

### Products
#### Products prescribed by Postcode
From the set of zones ( postcode ) we filter the most prescribed products.
So, we can observe:
- which areas have the highest rate of patients with gluten problems.
- which products are the most prescribed.
and if we limit the filter to the types of food, we get which type of food is most consumed:
eggs, pasta, rice, flour, etc...
In the same way we can establish a seasonal filter and observe the behaviour of the results in the different months and years.

###### All Products >

###### Products related to gluten >

From the results we can observe that the top product is "Gluten free bread".

By filtering the search, we reduce the list of products to all those that contain the word 'gluten' in the name.

######  Evolution of the units prescribed by Year >

###### Total of the units prescribed by Month >

### Practices
These same data can be compared in another dashboard, focusing on medical practices:

In the filter have been applied the 4 highlighted products related to gluten and the period of most activity.
We obtain the practices that more prescriptions have made:
It is possible to delimit by ranges according to the number of units prescribed and distinguish between zones (Postcode).

By a timeline allows to observe the evolution of prescriptions by zone ( Postcode ).
The index of the horizontal axis corresponds to the index of the time interval, groupped by month and year.


text:
[![Build Status](https://travis-ci.org/F5Networks/f5-cloud-libs.svg?branch=master)](https://travis-ci.org/F5Networks/f5-cloud-libs)
[![Coverage Status](https://coveralls.io/repos/github/F5Networks/f5-cloud-libs/badge.svg)](https://coveralls.io/github/F5Networks/f5-cloud-libs)

# Library code and scripts for deploying BIG-IP in a cloud

This project consists of two main parts
+ scripts
    + Command line scripts for configuring BIG-IP
    + These are meant to be called either directly from the command line or from cloud deployment templates
    + See usage below

+ lib
    + Library code for controlling a BIG-IP
    + Called from the scripts

## See also
+ [Release notes](RELEASE_NOTES.md)
+ [Usage](USAGE.md)
+ [Contributing](CONTRIBUTING.md)