text:
# Common arguments
## Argument ```--verbose```
Make the operation more talkative. Can be set also via environment variable HYPERONE_CLI_VERBOSE.

#### Examples

##### Displays the URL of the request to the API

```bash
h1 image list --verbose
```
## Argument ```--no-wait```
In case of queued event do not wait for completion

It allows to perform operations asynchronously, which can be used to optimize the execution time of scripts.

#### Examples

##### Create virtual machine without waiting for the process to be completed
```bash
h1 vm create --name test-vm --os-disk ssd,10 --type a1.nano --image debian --ssh my-ssh --no-wait
```
## Argument ```--dry-run```
Dry run for the request

Try to perform operations without making any real changes:

```
h1 disk create --name xxxx.com --type ssd --size 25 --dry-run
```
## Argument ```--output```
Specify output format of command. Can be set also via environment variable HYPERONE_CLI_OUTPUT.

#### Available formats

* ```table``` - Simple results as tabular (default).
* ```list``` - Subsequent properties line by line.
* ```tsv``` - Mostly works like tabular format, but without the header row. Efficiently usable in ```awk``` and shell.
* ```json``` - Raw response of API
* ```yaml``` - Full response displayed as YAML
* ```id``` - Just resource ID line by line

##### Examples

###### View all disks in tsv format

```bash
h1 disk list -o tsv
```

###### View all networks in list format

```bash
h1 network list -o list
```

###### View all virtual machines in table format

```bash
h1 vm list -o table
```
## Argument ```--query```
 JMESPath query string

JMESPath is quite a powerful tool that allows to efficiently obtain specific information about resources.

See the documentation and examples published on [jmespath.org](https://jmespath.org) for details about syntax.

#### Examples

##### Calculates the total size of disks

```bash
h1 disk list -o json --query 'sum([].size)'
```

##### Summarize image size

```bash
h1 image list --query '[].{name:name,diskCount:length(disks),fileSize:fileSize}'
```

##### Attach all detached disk to VM

```bash
h1 disk list --query "[?state=='Detached'].{id:_id}" -o tsv | xargs -r -n 1 h1 vm disk attach --vm test-vm --disk
```

##### Stop all running virtual machines

```bash
h1 vm list --query "[?state=='Running'].{id:_id}" -o tsv | xargs -r -n 1 h1 vm stop --vm
```

##### Create new disk and attach to virtual machine

```
$ DISK_ID=$(h1 disk create --name my-ambigious-name --type ssd --size 10 -o tsv --query '[].[_id]')
$ h1 vm disk attach --vm test-vm --disk $DISK_ID
```

Note (1): In most cases, you can avoid using ID by naming resources uniquely.
## Argument ```--yes```
Perform action without additional confirmation

#### Examples

##### Remove disk without additional confirmation

```bash
h1 disk delete --disk test-disk --yes
```

Note (1): Pretty useful when writing automatic scripts.
## Argument ```--project-select```
Override current project on the request. Can be set also via environment variable HYPERONE_PROJECT.

A parameter intended for selecting an ad-hoc project for a single command.

#### Examples

##### List virtual machine on selected project

```bash
h1 vm list --output tsv --project-select MyProject
```


text:
<img src="cs171-logo.png" width="200">

# Session 07 | Lab

![Preview](img/final_result.png?raw=true "D3 Projections")

### Learning Objectives

- Understanding the basic idea of interactive DOM manipulation that JS allowed which was so
 groundbreaking.
- Getting familiar with JavaScript fundamentals:
    * Variables
    * Data Structures (Arrays, Objects, JSON)
    * Control Structures & Loops
    * Functions
    * Debugging (Web Console)
    * Filter, Sort, and Map

### Prerequisites

- You have downloaded and installed JetBrains WebStorm.

### Useful links

- https://getbootstrap.com/docs/4.5/  (bootstrap documentation)
- https://www.w3schools.com/ (great html, css and JS tutorials for beginners and intermediate web
 developers)
- https://css-tricks.com/ (great website to learn about the power of CSS - which everybody tends
 to underestimate)

----

## 0)  Understanding Session 6+

We will start today's session with a breakout room exercise.

 **Task 1:** Together with your teammates, open the solution for session 6 and check out the
  website and the code. Examine the code and come up with at least three questions that you have. Lastly, come up with one 'quiz' question where you test the HTML and CSS skills or your peers
  . It should be a question that they are able to answer based on yesterday's session.

**Task 2:** Explore how the carousel is working. Try to follow the code and come up with an
 explanation/description of how the different snippets of html css and js code work together.

-----

Now that we have created our grid and have sen some JS in action, it is time dive into the world
 of interactive DOM manipulation.

## 1) JavaScript

- JavaScript is the world's most popular programming language.

- JavaScript is the programming language of the Web.

- JavaScript is easy to learn.

#### a) Manipulating the DOM

with JavaScript, you can change HTML contents. More specifically, you can change the DOM and
 manipulate its elements. You can actually try that using the developer tools.

 **Task:** Inspect a random website and use the developer tools to change some elements & text.

  **Next Step:** Since we want to automatize this process rather than doing the manipulation
   manually we will need some sort of trigger. This is why JavaScript has `event listeners`!
   trigger.

#### b) Event Listener

HTML events are "things" that happen to HTML elements.

When JavaScript is used in HTML pages, JavaScript listens to these events and can "react" to
 these events.

 **Task:** create a new HTML file and include a button with an `onclick` event listener. Use the
  sample code below:

 ```html
<button onclick="console.log('button was clicked')">Click me</button>
```

  **Next Step:** As of now, we're just writing a message into the console. In order to manipulate
   the DOM, we will need to grab another HTML using `CSS-selectors` that we've learned about
    yesterday.

### c) Selecting & Manipulating

There are various methods in JS that allow us to grab a DOM element and manipulate it. The most
 prominent ones are the `.querySelector()` and the `getElementById()` method. Blow you can find
  the code snipped for the query selector (that works exactly like a CSS selector with tags
  , classes, and IDs). In addition, we also included an entire website example that has an event
   listener that fires 'on click' and selects a paragraph by ID and changes it. Feel free to
    create a new html file and copy-paste the code and try it out. Try to change the method in
     the code from the getElementById method to the querySelector method.

**CSS-selector | querySelector code snipped (recommended!)**

```javascript
document.querySelector("#my-text").innerHTML = 'changed the text';
```

**CSS-selector | getElementById example**

```html
<!DOCTYPE html>
<html>
<body>

<h2>What Can JavaScript Do?</h2>

<p id="demo">JavaScript can change HTML content.</p>

<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me!</button>

</body>
</html>

```

## 3) Lab & Tasks

*From now on, and in all upcoming labs we will use the common abbreviation JS for the term JavaScript.*

This lab includes three activities and covers JS basics. It is intended to solidify your understanding of JS so that you are able to write your own code in upcoming exercises. If you already know JS well, feel free to skim the text and jump right to the activites. However, if you are new to JS or need a refresher, make sure to read the text closely!

*The result of this lab may look like the following screenshot. Among other things, you will work with data from amusement parks and museums and do some array manipulations and filtering. At the end you will use JS to call a function that will render a pre-configured bar chart.*

![Lab 2 - Preview](week-03_lab_preview.png?raw=true "Lab 2 - Preview")

### A short reiteration of the basic concepts of JavaScript (JS)

We assume that you have completed the pre-reading on JS, so here we are only showing you some examples and use cases of JS basics.

#### Variables

```javascript
// Variables in JS are loosely typed

// String
let month = "February";

// Integer
let day = 4;

// Double
let temperature = 34.36;

// Boolean
let winter = true;
```

#### Data Structures

##### Arrays
* Arrays can store a sequence of values, and contain any type of data.
* Use bracket notation ```[]``` to define or access an array.

```javascript
// Array with integer values
let numbers = [1, 2, 3, 100, 500, 4];

// Array with strings
let fruits = ["Orange", "Banana", "Apple"];

// Empty array declaration
let names = [];

// Access the elements of an array
fruits[0]; 	// Returns: Orange
fruits[1]; 	// Returns: Banana

// Adding array elements
fruits.push("Mango");	// adds a new element to fruits

// Access the length of an array using the length attribute
let numberOfFruits = fruits.length;

// You can nest arrays (multidimensional)
let nestedNumbers = [[1, 2], [3, 4], [5, 6]];
```

> You can do much more with arrays than shown here. Again, check out the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) if you have no experience with JavaScript or difficulties with some concepts. Arrays are very important for data visualization, so take the time to go through this at home!

##### Objects

* Objects are the second type of compound data types in JS.
* Use curly brackets ```{}``` to define an object and list *properties* and *values*.

```javascript
// JS object with four properties
let course = {
	id: "CS171",
	name: "Visualization",
	students: 220,
	active: true
}

// Accessing an object via dot notation, specifying the name of the property
course.id; 		// Returns: CS171
course.students;	// Returns: 220

// We can include arrays in objects
let course = {
	id: "CS171",
	students: ["Michael", "Ann", "James", "Kathy"]
};

// And we can also create arrays of objects
let courses = [
	{ id: "CS171", name: "Visualization" },
	{ id: "CS50", name: "Introduction to Computer Science" }
];

// To access this data we just follow the trail of properties
courses[1].id; 	// Returns: CS50

// Keep in mind: [...] means array and {...} means object!
```

##### JSON (JavaScript Object Notation)

* JSON is a popular data-interchange format for APIs (application program interfaces) and therefore very important for our future tasks.
* It is basically a JS object, with the only difference being that the property names are surrounded by double quotation marks.

```javascript
// JSON object
let course = {
	"id": "CS171",
	"name": "Visualization",
	"students": 220,
	"active": true
}
```

-----

*For each individual activity below, create a separate html file.

#### Activity I

1. **Use the JavaScript Web Console**

	As we have already learned in the first lab, there are some developer tools in our web browsers that make programing a bit easier. Normally, we include JS code in HTML files and then open these files in the browser. But we can also use the *Console* to type JS code directy in the browser.

	* Open your developer-tools and switch to the tab ***Console***

	* Create a few variables and try out some mathematical operators to see how it works. The console accepts one line of code at a time.

	* Type in the examples below, line by line.

		Examples:

		```javascript
		(1) let message = "I am learning JS"
		(2) message

		(1) let cities = ["Tokio", "Berlin", "San Francisco"]
		(2) cities[0]
		(3) cities [2]

		(1) let numeric = 12
		(2) numeric / (1 + 2)
		```

	*If you need multiple lines (e.g. JSON object) you can write the code in an editor and copy it into the console. This is an easy and quick way to test out code. Furthermore, the console is an essential tool for debugging. We will give it a try soon, but first continue with step (2).*

2. **JS data structure**

	Now it is your turn to apply your acquired knowledge! Come up with a *proper compound JS data structure* to store the following information and make sure that its values are simple and efficient.

	We have data for **three attractions** in an amusement park that we want to store. Each amusement ride has several attributes:

	- ID
	- Name
	- Price in USD
	- List with opening days (some attractions are open only on specific days, like weekends)
	- Limited access for children (yes / no)

	*You can make up the actual values for each of those attributes. We are mainly interested in the following: How would you store this data in code? Which data structure(s) would you use?  We suggest that you start with pen and paper to design your data structure (or your local code editor). Which JS data structure would you use (basic data types, arrays, objects, etc.)? Which data types (string, boolean, etc.) would you use to represent the data? Once you know how you want to implement it, continue to step (3).*

3. **Create a new HTML file and JS file and implement the data structure**

	Name the HTML file `activity_one.html`. The JS file can be included directly in HTML or in a
	 separate
	 file with *.js* suffix and then
	 referenced. Generally, including JS in a separate file is the preferred method:

	```html
	// Included directly
	<script type="text/javascript">
		let message = "test";
	</script>

	// Referenced (at the bottom of the <body> tag, below other included javascript libraries)
	<script type="text/javascript" src="js/myscript.js"></script>
	```

	Make up some example data (3 amusement rides, with the above described attributes) and implement your data structure in JS.

4. **Write messages to the web console**

	The console is an essential tool for debugging. It shows logged security alerts, warnings, errors, informational messages etc. When you are creating scripts, you can write your own debug messages to the console:

	```javascript
	console.log("My debug message");

	let debugId = 12;
	console.log("Another debug message with id: " + debugId);
	```

	Use ```console.log()``` to print some information of your dataset:

	* Name of the first amusement ride
	* All days when the second attraction is open
	* First item of the list of opening days from the second amusement ride
	* There is a 50% discount for your third attraction! Print the reduced price.

-----

You should already be familiar with **control structures**, **loops** and **functions**. The following just shows some examples and the correct syntax for using those structures.

#### Control Structures & Loops

##### IF-STATEMENT

```javascript
let numericData = 10;

// Regular if statement
if (numericData >= 10) {
	console.log("Equal or greater than 10");
} else if (numericData > 0 && numericData < 10) {
	console.log("Between 0 and 10");
} else {
	console.log("Less than 1");
}

// The ternary operator can be used as a compact alternative to an if-statement
// CONDITION ? WHAT_HAPPENS_IF_TRUE : WHAT_HAPPENS_IF_FALSE
let result = (numericData >= 10) ? "greater than or equal to 10" : "less than 10";
let result = (numericData % 2 === 0) ? "even" : "odd";
```

##### FOR-LOOP

```javascript
// (1) Loop through a block of code 5 times (printing the value of i each time to the console)
for (let i = 0; i < 5; i++) {
	console.log(i);
}

// (2) Loop through each of the values in an array
let arrayWithNames = ["Jack", "Anna", "Mike", "Susan"];
for (let i = 0; i < arrayWithNames.length; i++) {
	console.log(arrayWithNames[i]);
}

// (3) Loop through the properties of an object
let person = { firstName: "John", lastName: "Doe", age: 24 };
for (let property in person) {
	console.log(property + ": " + person[property]);
}

// (4) The holy grail of JS loops:
// makink use of object oriented JS, the forEach loop is an array methode
// that iterates over all elements in the array. The index of the element
// and the element itself are available inside the loop via an anonymous callback function.
// That's definitely a lot to wrap your head around, but once you get used to it, this loop is pure magic.

# # # # # # # # # # # # # # # # # # # # # # # # # # #
arrayWithNames.forEach( (element, index) => {
	console.log(index + ": " + element);
});
# # # # # # # # # # # # # # # # # # # # # # # # # # #
```

*Result:*
![Lab 2 - For-Loops](cs171-for-loop-examples.png?raw=true "Lab 2 - For-Loops")

#### Functions

Here we list a few examples to show you the syntax for functions. In the following weeks you will learn more about anonymous functions, callbacks etc.

```javascript
// Call a function
toCelsius(34);

// Function (with input parameter and return value)
function toCelsius(fahrenheit) {
	return (5/9) * (fahrenheit-32);
}

// Another function call
console.log("Write something to the web console");

// Function used as a variable
let temperature = "Current temperature: " + toCelsius(34) + " Celsius";
```

> To create a **local variable**, use the keyword ```let```. *Local* refers to the current execution context. When used within a function these variables are **private to that function**, however, when they are declared outside a function they are global.

-----

#### Activity II

*In this exercise you should use your data structure from the previous activity (amusement rides) and add two short functions to the JS file.*

1. **Create a new function: doublePrices()**

	This function takes your data structure as an input variable. You should loop through all the amusement rides, and modify their prices (*2). (Note: You will be modifying the original data here, but that is fine. You do not need to create a deep copy of the data.)

	```javascript
	// Calling the function
	let amusementRidesDouble = doublePrices(amusementRides);

	// Implementation of the function
	function doublePrices(amusementRides) {

		// TODO: Modify data here ...

	}
	```

	You can add a ```console.log(amusementRidesDouble);``` at the end to look at the result of your code.

	> Pro tip: In JS, when you pass a primitive type variable (e.g., string or number) to a function, it is passed by value. On the other hand, if you pass an object, it is passed by reference. To try out the difference, check out this [JSFiddle code snippet](https://jsfiddle.net/ywn5vno5/). If you don't know the difference between pass-by-value and pass-by-reference, don't worry about it for now. But you might want to come back to this eventually.

2. **Modify the function doublePrices() to double all prices, except for the second item in your list of amusement rides**

3. **Create a second function: debugAmusementRides()**

	In this function, loop through the modified list of attractions and write the **name** and the new **price** for each item to the console.

	```javascript
	// The + operator can be used to concatenate strings/variables.
	let firstName = "John";
	let lastName = "Doe";
	let name = firstName + " " + lastName;

	console.log(name); 	// Returns: John Doe
	```

4. **Changing the DOM with JS**

	Now we want to display some attributes of our amusement rides directly on the website, not just the JS console. To do this, we first have to create a new HTML element and then fill the content of this element dynamically with JS.

	The easiest way to modify the content of an HTML element is by using its *innerHTML* property. This implies that you have to create a string for the HTML snippet you want to insert first, and then set the *innerHTML* property. For example, you can create a new string variable and extend it in a for-loop, before you assign it to the *innerHTML property*.

	Here is an example that you can copy and paste into your HTML file:

	```html
	<div id="content-1"></div>
	<div id="content-2"></div>

	<script type="text/javascript">
		// Write HTML with JS
		document.getElementById("content-1").innerHTML = '<h1>Headline</h1>...and some text';

		// Loop through array, build HTML block and finally display it on the page
		let fruits = ["Orange", "Banana", "Apple"];
		let result = '';
		for (let i = 0; i < fruits.length; i++) {
			result += fruits[i] + "<br/>";
		}
		document.getElementById("content-2").innerHTML = result;
	</script>
	```
	Note that this example includes the JS code directly in the HTML file. Usually it's preferrable to link to an external javascript file. Try it out!

	Now it's your turn! Update the HTML with the following content:

	* **Add a new HTML element to your document with a specific ID** (e.g. ```div```).
	* **Create a new function** or duplicate debugAmusementRides() that loops through all amusement rides and **displays the name and the new prices on the website**.

-----

### More JavaScript

Here we introduce some more advanced JavaScript concepts, that will be very important once we start working with D3. Don't worry, we will reiterate over them with more examples in the next labs in connection with D3.

#### Functions are Objects

In JavaScript, functions are objects which can be *called*. They take arguments and they return values. But because of their object-like characteristics, they are also just values that can be stored in variables and passed on.

There is an alternative way of defining functions:

```javascript
// We assign a function to the variable 'message'
let message = function(firstName) {
    return "Hello, I'm " + firstName + ".";
}

// We can call the function to get the expected message
console.log(message("Sarah"));	// Returns: Hello, I'm Sarah.
```
And a more advanced example:

```javascript
let person = { firstName: "Sarah", age: 24, profession: "Student" };

// Add a new variable to the class 'person' called 'message'. Store a function in 'message'.
person.message = function() {
	return "Hello, I'm " + this.firstName + "!";
}
console.log(person); // Returns your new person object

console.log(person.message()); // Returns: Hello, I'm Sarah.
```

In these examples, the current *scope* - the environment in which the function executes in - is important.

> The default scope for executing functions is the *Window Object* which is a browser level object representing the actual browser window/tab. Additionally, we have also used the keyword ```this```. In the global execution context (outside of the function) ```this``` refers to the global object. Inside a function, the value of ```this``` depends on how the function is called.

So that means, if you run the function in the person's scope (second example), you can access the first name via ```this```. If you use ```this.firstName``` in a function by itself (e.g. without the scope of the person object) it will give you an error, because your window object has no attribute ```firstName```.

If this still seems confusing to you, you can read up on this on the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this). We will also come back to this in later labs.

#### Array Manipulation with higher-order functions

JS offers several functions for fast array manipulation. These functions usually rely on concepts from functional programming and can be hard to grasp at the beginning. We will come back to them in more detail later, but below you find a first introduction.
If you want to read up on higher-order functions, here is a [link](http://eloquentjavascript.net/05_higher_order.html).

The ***filter()*** method creates a new array with the elements that meet a condition implemented by the provided function.

```javascript
// ---- Filter Example 1 - Get all cities except London ----

let cities = ["Vienna", "Paris", "London", "London"];

// Pass a function to cities.filter()
let filteredCities = cities.filter(checkCity);

// Implementation of passed function
function checkCity(value) {
  return value != "London";
}

filteredCities // Returns: ["Vienna", "Paris"]

console.log(filteredCities);

// ---- Filter Example 2 - Get all numbers which are >= 10 and have array indices > 3 ----

let numericData = [1, 20, 3, 40, 5, 60, 7, 80];

// Use an anonymous function in numericData.filter
// (the anonymous function takes the array element's current value and index as parameters)
let filteredNumericData = numericData.filter( (value, index) => {
	return (value >= 10) && (index > 3);
});

filteredNumericData // Returns: [60, 80]
console.log(filteredNumericData);

```

For more information on ***filter()*** you can take a look at [this tutorial](http://adripofjavascript.com/blog/drips/filtering-arrays-with-array-filter.html).

The ***sort()*** method sorts the items in an array. No new array object will be created during execution.

```javascript
// ---- Sort Example 1 - Filter array with strings (default sorting) ----

let cities = ["Vienna", "Paris", "London", "Munich", "Toronto"];
cities.sort();
cities 	// Returns: ["London", "Munich", "Paris", "Toronto", "Vienna"]
console.log(cities);

// ---- Sort Example 2 - Filter array with objects ----
// We are specifying a function that defines the sort order

let products = [
	{ name: "laptop", price: 800 },
	{ name: "phone", price:200},
	{ name: "tv", price: 1200}
];

// Sort ascending by the 'price' property
products.sort( (a, b) => {
	return a.price - b.price;
});

// Sort descending by the 'price' property
products.sort( (a, b) => {
	return b.price - a.price;
});
```
The ***map()*** method creates a new array with the results of calling a provided function on every element of the original array.

```javascript
// ---- Map Example 1 - Calculate the square root ----

let numericData = [1, 4, 9];
let roots = numericData.map(Math.sqrt);

roots	// Returns: [1, 2, 3]

// ---- Map Example 2 - Double the prices ----

let products = [
	{ name: "laptop", price: 800 },
	{ name: "phone", price:200},
	{ name: "tv", price: 1200}
];

let expensiveProducts = products.map(doublePrice);

function doublePrice(elem){
	elem.price = elem.price * 2;
	return elem;
}

expensiveProducts // Returns: [{ name: "laptop", price: 1600 }, { name: "phone", price:400}, { name: "tv", price: 2400}]
```

*You will learn more about other useful array manipulation methods (e.g. ```join()```, ```reduce()```, ...) in our next labs.*

-----

#### Activity III

This activity summarizes most of the learned concepts of the first two labs. It includes different aspects of HTML, CSS and JS and will result in a bar chart visualization.

We will provide a template with a basic *HTML structure*, a *dataset* (stored in a JSON array) and a *complete JS function* that renders a bar chart with D3. Your primary tasks are data filtering and controlling the workflow. In the following labs we will introduce D3 and show you how to create these visualizations yourself.

**Data:**

- The dataset (provided with the code template) consists of 60 attractions around the world. Each attraction has the following properties:
	-  ```Location``` *(name, city and country)*
	-  ```Category``` *(theme park | water park | museum)*
	-  ```Visitors``` *(annual visitors in 2013)*
	-  ```Entry``` *(paid | free)*
- The JSON array with objects is stored in the global variable ```attractionData```.
- Data Source: TEA/AECOM 2013 Theme Index and Museum Index

1. **Open the `Template` folder that was provided in the distribution code.**

2. **Familiarize yourself with the provided HTML document: ```index.html```**

	Look at the source code, its HTML elements, and which files (JS, CSS) are included.

3. **Array filtering**

	Open the JS file ```week03_lab.js``` (*js* folder). Most of the tasks you need to complete should be implemented in the function: *dataFiltering()*.

	We have included a template of the function, and have created a local variable ```attractions``` from the global variable and we have called the function right before. You should work with the local variable ```attractions``` - don't override the global one.

	→ ***Filter the array: top 5 global attractions (based on annual visitors)***

	We want to show the *top five global attractions* with the most annual visitors in a bar chart. There are 60 attractions in the dataset, so you have to create a new array or modify the variable ```attractions```. *Suggestion: sort the JSON array descending by ```Visitors``` and then filter the array to get the first five rows.*

4. **Call the function: renderBarChart(attractions)**

	- This function will automatically render a bar chart with the top attractions in the div-container with the id: ```#chart-area```.
	- You must include a JSON array with attractions as a parameter (array length: 5)
	- If there is a problem, check the web console and try to debug your code (e.g., by using ```console.log()``` statements)
	- If you are still in class, don't hesitate to ask TFs for help! Otherwise, you can use Piazza or office hours!

5. **Extend array filtering**

	As you might have seen already, there is a *select-box* in the HTML document. You can select different categories but right now, nothing happens.

	In the next task you should call a function *dataManipulation()* if someone changes the select-box and then, inside the function, filter the attractions by the selected category:

	* Add the attribute ```onchange="dataManipulation()"``` to the select-box (in the HTML file). The function ```dataManipulation()``` will be automatically called whenever the user changes the value of the select box. However, you will need to create that function!
	* In your JS file you can use the following code snippet to get the selected category. Make sure to change "SELECT-ID" to the ID of the select-box.

		```javascript
		let selectBox = document.getElementById("SELECT-ID");
		let selectedValue = selectBox.options[selectBox.selectedIndex].value;
		```
		Make sure this part is working, by printing out *selectedValue* in the console whenever the select-box selection has changed, before continuing.

	* Before searching for the top attractions and calling *renderBarChart()*: check if the selected category is "all", otherwise filter the attractions by category.

	*If everything has been configured correctly, the bar chart will be updated automatically after selecting a category.*

-----

####Bonus Activity (optional!)

- **Add custom styles (CSS)**

	We have included *Bootstrap* and a couple of CSS rules to style the bar chart. Add a new stylesheet or modify ```style.css``` to create an individual design.
	To change the style of the D3 components you will have to add new elements to your css. D3 uses ```<svg>``` tags in the DOM, and you might want to look up properties like *fill* or *stroke*. The tooltip has the class ```tooltip``` in the DOM.

-----

In the last activity you have implemented a function which reacts to the user input (changing a select-box value) and updates the chart immediately. So that means, you have done everything, apart from drawing the bars, to create an interactive data visualization. Next week, we will start with the JS library D3 and you will learn how to draw these SVG charts yourself.

-----

**Resources**

- Chapter 3 (p. 36-52) in *D3 - Interactive Data Visualization for the Web* (Second Edition) by Scott Murray
- [https://developer.mozilla.org/en-US/docs/Web](https://developer.mozilla.org/en-US/docs/Web)
- [http://dataviscourse.net/2015/lectures/lecture-javascript/](http://dataviscourse.net/2015/lectures/lecture-javascript/)
- [http://hangar.runway7.net/javascript/guide](http://hangar.runway7.net/javascript/guide)

-----

**Congratulations for finishing lab #7! See you tomorrow!**

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Toy Prolog Interpreter
This is a basic implementation of a [Prolog](http://www.swi-prolog.org/) interpreter in [OCaml](https://ocaml.org/) with REPL support.
The interpreter follows standard Prolog IO syntax where clauses, facts, rules and terms have their usual definition.

## Implementation
The implementation consists of a lexer `lexer.mll`, a parser `parser.mly`, an REP loop `toyprolog.ml` and the core unification and substitution engine `tree.ml`.

## How To
* The project contains a **makefile** that generates an executable **toyprolog**.
* The executable can be run as ` ./toyprolog inputfile` where `inputfile` should contain all facts and rules to be loaded before execution.
* The project also contains a sample prolog script based on the [Harry Potter](https://en.wikipedia.org/wiki/Harry_Potter) universe family trees. Its called `hogwarts.pl` and contains lots of interesting facts and rules.
* **NOTE**: For obvious reasons the resolution search for queries is depth limited to 100 post which search will terminate.

## An Example
```
make
./toyprolog hogwarts.pl
?-brother(X,ginnyWeasley).
X = ronWeasley;
X = georgeWeasley;
X = fredWeasley;
X = percyWeasley;
X = charlieWeasley;
X = billWeasley;
false.

?-ancestor(X,harryPotter).
X = doreaBlack;
X = charlusPotter;
X = violettaBulstrode;
X = cygnusBlack;
X = ursulaFlint;
X = phineasNigellusBlack;
X = lillyPotter;
X = jamesPotter;
false.
```

branch_name: refs/heads/master


text:
># Type Conversions

When you assign value of one data type to another, the two types might not be compatible with each other. If the data types are compatible, then Java will perform the conversion automatically known as Automatic Type Conversion and if not then they need to be casted or converted explicitly. For example, assigning an `int` value to a `long` variable.

## Widening or Automatic Type Conversion

Widening conversion takes place when two data types are automatically converted. This happens when:

* The two data types are compatible.
* When we assign value of a smaller data type to a bigger data type.

For Example, in java the numeric data types are compatible with each other but no automatic conversion is supported from numeric type to `char` or `boolean`. Also, `char` and `boolean` are not compatible with each other.

![](images/typeconversion_java.png)

##### [Example 01](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-01/)

```java
class Test{

	public static void main(String[] args){

		int i = 100;

		// automatic type conversion
		long l = i;

		// automatic type conversion
		float f = l;
		System.out.println("Int value "+i);
		System.out.println("Long value "+l);
		System.out.println("Float value "+f);
	}
}
```

##### Output

	Int value 100
	Long value 100
	Float value 100.0

## Narrowing or Explicit Conversion

If we want to assign a value of larger data type to a smaller data type we perform explicit type casting or narrowing.

* This is useful for incompatible data types where automatic conversion cannot be done.
* Here, target-type specifies the desired type to convert the specified value to.

![](images/typeconversion_second.png)

##### [Example 02](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-02/)

```java
//Java program to illustrate incompatible data

// type for explicit type conversion

public class Test{

	public static void main(String[] argv){
		char ch = 'c';
		int num = 88;
		ch = num;
	}
}
```

##### Output
	Error:

	7: error: incompatible types: possible lossy conversion from int to char

		ch = num;
			^
	1 error

### How to do Explicit Conversion?

##### [Example 03](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-03/)

```java
//Java program to illustrate explicit type conversion

class Test{
	public static void main(String[] args){

		double d = 100.04;

		//explicit type casting
		long l = (long)d;

		//explicit type casting
		int i = (int)l;
		System.out.println("Double value "+d);

		//fractional part lost
		System.out.println("Long value "+l);

		//fractional part lost
		System.out.println("Int value "+i);
	}
}
```

##### Output:

	Double value 100.04
	Long value 100
	Int value 100

While assigning value to `byte` type the fractional part is lost and is reduced to modulo 256 (range of byte).

##### [Example 04](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-04/)

```java
//  Java program to illustrate Conversion of int and double to byte

class Test{
	public static void main(String args[]){

		byte b;
		int i = 257;
		double d = 323.142;
		System.out.println("Conversion of int to byte.");

		//i%256
		b = (byte) i;
		System.out.println("i = " + i + " b = " + b);
		System.out.println("\nConversion of double to byte.");

		//d%256
		b = (byte) d;
		System.out.println("d = " + d + " b= " + b);
	}
}
```

##### Output:

	Conversion of int to byte.
	i = 257 b = 1
	Conversion of double to byte.
	d = 323.142 b = 67

## Type promotion in Expressions

While evaluating expressions, the intermediate value may exceed the range of operands and hence the expression value will be promoted. Some conditions for type promotion are:

* Java automatically promotes each `byte`, `short`, or `char` operand to `int` when evaluating an expression.
* If one operand is a `long`, `float` or `double` the whole expression is promoted to `long`, `float` or `double` respectively.

##### [Example 05](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-05/)

```java
//Java program to illustrate Type promotion in Expressions

class Test{
	public static void main(String args[]){

		byte b = 42;
		char c = 'a';
		short s = 1024;
		int i = 50000;
		float f = 5.67f;
		double d = .1234;

		// The Expression
		double result = (f * b) + (i / c) - (d * s);

		//Result after all the promotions are done
		System.out.println("result = " + result);
	}
}
```

##### Output:

	Result =<PHONE_NUMBER>484375

## Explicit type casting in Expressions

While evaluating expressions, the result is automatically updated to larger data type of the operand. But if we store that result in any smaller data type it generates compile time error, due to which we need to type cast the result.

##### [Example 06](../20-Examples/05-Variable/03-Type-Conversion-and-Casting/Example-06/)

```java
//Java program to illustrate type casting int to byte
class Test{

	public static void main(String args[]){
		byte b = 50;

		//type casting int to byte
		b = (byte)(b * 2);
		System.out.println(b);
	}
}
```

##### Output

    100

## External Resources

### Youtube Videos

* [Cave of Programming - Casting](https://www.youtube.com/watch?v=GqsTbuQwEBU&list=PL9DF6E4B45C36D411&index=28)
* [Cave of Programming - Upcasting and Downcasting](https://www.youtube.com/watch?v=Uj4JdvFKTNo&list=PL9DF6E4B45C36D411&index=29)
* [Alex Lee](https://www.youtube.com/watch?v=H0LNjF9PSeM&list=PL59LTecnGM1NRUyune3SxzZlYpZezK-oQ&index=21)

### More Examples and Practice Questions

Provided in the last chapter of current section.

repository: DevCANS/Java-A-to-Z-Resources

gha_language: Java

gha_license_id: MIT

repo_name: DevCANS/Java-A-to-Z-Resources


text:
# Absidia verticillata (Beauverie) Lendn., 1908 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mat. fl. crypt. Suisse 3(1): 131 (1908)

#### Original name
Mycocladus verticillata Beauverie, 1900

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Zygomycota/Mucorales/Mycocladaceae/Mycocladus/Mycocladus verticillata/ Syn. Absidia verticillata/README.md

repo_name: mdoering/backbone


text:
# PCF-Components

Here is a collection of components I have created using the [PowerApps Component Framework](https://docs.microsoft.com/en-us/powerapps/developer/component-framework/overview). These are just examples of what can be done usig the currently available tools. Big thanks to Andrew Ly ([@365lyf](https://twitter.com/365lyf)) for the sample code.

## Pre-requisites

In order to build and deploy these to your CDS instance you'll need the following:

- [NodeJS & npm](https://nodejs.org/en/)
- [The PCF CLI](https://docs.microsoft.com/en-us/powerapps/developer/component-framework/create-custom-controls-using-pcf)
- Either:
    - [Visual Studio Code](https://code.visualstudio.com/) (with [.NET Core SDK](https://dotnet.microsoft.com/download))
    - [Visual Studio](https://visualstudio.microsoft.com/) (2017 or later)

If you want to deploy this and test it you'll obviously need some sort of PowerApps/Dynamics 365 license and instance. Grab a trial from [here](https://trials.dynamics.com/).

## Building & Debugging

Once you've grabbed the code, navigate to the correct folder for the component you want, and run the following command from the terminal:

```shell
npm install
```

This will install all the dependencies (and make take a minute or two). Then run:

```shell
npm run start
```

This should bootstrap the component and run the harness to allow you to see the component running and debug if required.

# Components

## SpeechToText

![alt text](https://raw.githubusercontent.com/BenLBartle/PCF-Components/master/SpeechToText.png "Speech To Text Screenshot")

This is a component that uses the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API) to allow real-time text recognition to a CDS text field. This control supports the following CDS Field types:

- SingleLine.Text
- SingleLine.TextArea
- Multiple

It has no parameters.

> **Note**: Due to the delay of the Web Speech API being implemented in browsers, only Chrome supports this control OOTB. I believe Firefox can be configured to turn this on, but YMMV.

> ***More Important Note***: Currently Chrome will submit your audio for regognition to a server side API. This is abstracted from you and I have no idea where it is or whether it could change without notice. This also means it won't work offline.

### Usage
Once you've added this control to your field, it will appear as a standard multi-line text field but with the addition of a button above the `textarea`. If you click this button you will be prompted for permission to use your microphone, and once you've clicked 'Allow' it will start automatically recording what you say. After a period of time it will stop listening and the button will change back to its original state.

repository: VinnyDyn/PCF-Components

repo_name: VinnyDyn/PCF-Components


text:
---
layout: post
title: Twelve-Factor App Notes
---

I found a new terminology or a methodology called Twelve Factor App while reading an article about [The Process Module of Node.js](https://blog.risingstack.com/mastering-the-node-js-core-modules-the-process-module/). This post is a selfnote on the same.

<!--more-->

The twelve-factor app is a methodology for building software-as-a-service apps that:

* Use **declarative** formats for setup automation, to minimize time and cost for new developers joining the project;
* Have a **clean contract** with the underlying operating system, offering **maximum portability** between execution environments;
* Are suitable for **deployment** on modern **cloud platforms**, obviating the need for servers and systems administration;
* **Minimize divergence** between development and production, enabling **continuous deployment** for maximum agility;
* And can **scale up** without significant changes to tooling, architecture, or development practices.

The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of backing services (database, queue, memory cache, etc).

## The Twelve Factors

#### Codebase

* Always tracked in a version control system.
* A codebase is any single repo, or any set of repos who share a root commit.
* There is always one-to-one correlation b/w the codebase and the app.
* Multiple codebases are distributed systems not an app.
* Mutliple apps can not share code. Use/create libraries as a solution.
* Use dependency manager.
* Only one codebase per app, but many depolys of the app. A deploy is running instance of the app. For example, production sites, staging sites, dev1 site can be called deploys.

#### Dependencies

* A twelve-factor app never relies on implicit existence of system-wide packages/system tools like *ImageMagick* or *curl*.
* Explicit declaration of dependencies benefits new developers in setting up the app.

#### Config

Store config in the environment

* app's *config* is everything that can vary between deploys like Resource handles, Keys to third party services, per-deploy values such as hostname.
* storing config in the form of *Constant* in the code is a violation in TFA.
* advocates **strict separation of config from code**.
* codebase should be open-sourced at any point of time without compromising any credentials.
* The TFA stores config in environment variables.
* Env vars are easy to change b/w deploys, little chance of getting pushed to repo accidently.

#### Backing services

Treat backing services as attached resources

> A backing service is any service the app consumes over the network as part of its normal operation. Examples include datastores (such as MySQL or CouchDB), messaging/queueing systems (such as RabbitMQ or Beanstalkd), SMTP services for outbound email (such as Postfix), and caching systems (such as Memcached).

* The code for a twelve-factor app makes no distinction between local and third party services.
* A deploy of the twelve-factor app should be able to swap out a local service with one managed by a third party without any changes to the app’s code.
* Each distinct backing service is a resource.

> Resources can be attached and detached to deploys at will. For example, if the app’s database is misbehaving due to a hardware issue, the app’s administrator might spin up a new database server restored from a recent backup. The current production database could be detached, and the new database attached – all without any code changes.

#### Build, release, run

Strictly separate build and run stages

* A codebase is transformed into a (non-development) deploy through three stages: The *build stage*, The *release stage*, and The *run stage*.
* Every release should always have a unique release ID.
* Any change must create a new release.

#### Processes

Execute the app as one or more stateless processes

* Twelve-factor processes are stateless and share-nothing. Any data that needs to persist must be stored in a stateful backing service, typically a database.
* The twelve-factor app never assumes that anything cached in memory or on disk will be available on a future request or job.
* Sticky sessions are a violation of twelve-factor and should never be used or relied upon. Session state data is a good candidate for a datastore that offers time-expiration, such as Memcached or Redis.

#### Port binding

Export services via port binding

The [official document's explanation](https://12factor.net/port-binding) is unclear.  However, following excerpt from [stackoverflow question](https://stackoverflow.com/q/26491425) is a bit of help.

> Port binding exists to solve the problem of "port brokering" at the platform level. If every application worker listened on port 80 there would be conflicts. To solve this, port binding is a convention whereby the application listens on a port the platform has allocated -- and which is passed in as a $PORT environment variable. This ensures a) the application worker listens on the right port and b) the platform knows where to route traffic destined for that worker. [answer link](https://stackoverflow.com/a/27140353)

Another good read on Port Binding https://jiraaya.wordpress.com/2014/05/16/twelve-factor-port-binding.

#### Concurrency

Scale out via the process model

* In the twelve-factor app, processes are a first class citizen.
* Twelve-factor app processes should never daemonize or write PID files.

#### Disposability

Maximize robustness with fast startup and graceful shutdown

* Disposability means app's processes can be started or stopped really fast. It helps in rapid scaling and depolyment of code or config changes.
* Processes shut down gracefully when they receive a **SIGTERM** signal.
* Web process can achieve graceful shutdown by ceasing to listen on the service port, allowing any current requests to finish, and then exit.
* Worker process aheives graceful shutdown by moving the current job to the work queue.

#### Dev/prod parity

Keep development, staging, and production as similar as possible

* Keep the tool stack identical across the deploys. If you deploy your application on Linux, using Windows for development is not the right choice.

* Tiny incompatibilities in Dev and Prod environment hurts the Continuous Deployment cycle over the lifetime of an application.

#### Logs

* Logs provide visibility into the behaviour of a running app.
* Logs are texts, one event per line.

#### Admin processes

* Twelve-factor strongly favors languages which provide a REPL shell out of the box.

gha_language: CSS

gha_license_id: NOASSERTION


text:
---
layout: article
title: Brian's 2021 Year In Review
description: 2021, the Year of Restart
published: 2021-12-31
authors:
  - Brian
excerpt: First time doing one of these Years in Review! I'm subtitling 2021, "Restart".
---

First time doing one of these Years in Review! I'm subtitling 2021, "Restart".

## Life

COVID-19 was still a thing, but by the end of the year, it's direct effect on us was close to none. I continued to work from home, and now have an office!

I dropped my phone in a lawn mower and couldn't get it replaced for a couple months. It's a long story...but the upside is I broke the habit of checking my phone incessantly.

We moved from southern Alabama to northern Alabama. New church, new friends, new adventures.

I got heavy into Christian classical education as we started our first grade homeschool with Lydia.

## Articles I Wrote

Only wrote one article this year, based on a presentation I gave at work on [Astro static sites](https://koser.us/articles/2021/08/19/1/astro-static-sites-30/).

## Favorite Articles I Read
- [Thoughts on Narrative Framing Devices](https://koser.us/notes/20210325095900/) by Chris Gerwel
- [Which type of novelty-seeking web developer are you?](https://koser.us/notes/20210321171400/) by Baldur Bjarnason
- [How to Write Things people actually want to read](https://koser.us/notes/20210426160800/) by James Sinclair
- [Embrace the Grind](https://koser.us/notes/20210525172100/) by Jacob Kaplan-Moss
- [Own the Tools](https://koser.us/notes/20210704095700/) by David Cain
- [Fertility And Humanity’s Failure](https://koser.us/notes/20210922062215/) by Rod Dreher

## Notes
My biggest contribution to the world was [Koser's Theory of Leftovers](https://koser.us/notes/20210427131500/): At midnight, leftovers are redistributed evenly.

[I wrote some APIs, which were correct 200% of the time.](https://koser.us/notes/20211013111100/)

My broinlaw Josh introduced me to this [Starburst Berries and Cream](https://koser.us/notes/20210426153900/) ad. As much as I was in to silly commercials in college, I have no idea how this one escaped my notice.

## Books
Stay tuned for a podcast episode on my 2021 books (coming January)

## Film
Stay tuned for a podcast episode on our 2021 films (coming January)

## Podcasts
We recorded only 14 episodes for [Ten to One](https://tto.koser.us) this year, but we did appear on 10+ episodes of [The Sci-Fi Christian](http://thescifichristian.com/).

Listening-wise, I got into a bunch of classical Christian education podcasts: Consortium Podcast, The Everlasting Education, Digressio Podcast, and New Humanists. All recommended.

## Metrics
- Unique books read: 1173
- Books to read: 713
- Books to reread: 83
- Podcast episodes to listen to: 83
- Podcasts to start if I get caught up on the ones I'm already subscribed to: 12
- Github koser.us issues: 97

## 2022
I'm going to stop tracking metrics that, on reflection, I don't really care about, like how many to do tasks I'm accomplishing.

Fewer goals, but build some daily and weekly habits with longterm effects, like reading a poem every day.

Continue developing our homeschool curriculum, and create a web page for it.

Be more social. Basically I need to cultivate more male friendships to offset the upcoming addition of another baby girl to the house. :)

[Spend more time outside.](https://koser.us/notes/20210611110700/)

repository: briankoser/kodex

gha_language: PLpgSQL

repo_name: briankoser/kodex


text:
# Sticky Keys -> CMD

### Just to clarify: There is always a risk involved when messing arround with things in the system files. I take no responsibilities. This process is safe unless you mess with things you're not supposed to mess with.

1. Turn off @ startup.](img/1.png)

2. Start your PC again and choose the 'Launch Startup Repair' option.
![Startup repair](img/2.png)

3. Once Windows has loaded all the nececary files, you'll see this. This stage can take a while. Be patience.
![Chill](img/3.png)

4. When you see this, click on 'View problem details'. Clicking on anything else will result in a reboot and you'll have to redo everything.
![View problem details](img/4.png)

5. You'll now see some information about your OS, just ignore that and scroll to the bottom where you'll find a link to 'X:\windows\system32...'
![Privacy statement](img/5.png)

6. When you click on that link, it'll show you the document in Notepad. The document itself is not intresting. Click on File -> Save As..
![Save as](img/6.png)

7. Navigate to 'system32'.
![system32](img/7.png)

8. Change the 'Save as type' option to 'All files'. You should now see all files and folders in the system32 directory.
![All files](img/8.png)

9. Scroll down until you see a file with the name 'sethc'. Rename this file to 'sethc1'.
![sethc1](img/9.png)

10. Scroll back up until you see cmd. Rightclick then Copy. Once you've done that just paste it again. It'll have the name 'cmd - copy'. Rename that file to 'sethc'.
![sethc](img/10.png)

11. Once you're done, press 'Cancel', close the other windows and click 'Finish'.
![Finished](img/11.png)<br>
#### You should have the following files:
* cmd (A black icon)
* sethc (A black icon)
* sethc1 (A blue circular icon)

license: Unlicense

repository: olback/windows-things

repo_name: olback/windows-things


text:
---
layout: page
title:  "Using Ready-made View Controllers"
categories: ios-sdk
---

View Controllers are a staple in iOS development, and the iOS SDK provide view controllers for modules that Stellar Loyalty exposes.

Before using any view controller, it should be noted first that for these view controllers to work, the user must have logged in already. To learn more about the login view, go to our [previous article detailing about the login process].

## `SLViewController`

All view controllers exposed by the Stellar Loyalty iOS SDK are descendants of a super-class named `SLViewController`. The SLViewContoller provides basic helpers or convenience methods for regular `SLViewController` functionalities. More of this can be seen here: [`SLViewController`]({{site.baseurl}}).

## Anatomy of a Stellar Loyalty View Controller

The image beliow dissects a typical view controller's parts. As you can see, the view controller can be divided into two major components:

- Navigation Bar
- Content View

![]({{site.baseurl}}/img/sdk/ios/view_controllers/view_controller_anatomy.png)

### Navigation Bar

Having a navigation bar inside a Stellar Loyalty View Controller means the basic SDK View Controller depends on an encapsulating Navigation Controller (`UINavigationController`). That means whenever you have an iOS app being developed, either you use a navigation controller as your starting view controller (as illustrated below):

![]({{site.baseurl}}/img/sdk/ios/view_controllers/view_controller_navcontroller.png)

or

repository: jofell/stellar-dev

gha_language: HTML

repo_name: jofell/stellar-dev


text:
---
layout: kanji-remain
v4: 2559
kanji: 瑳
keyword: burnish
strokes: 14
on-yomi: サ
permalink: /rtk/瑳/
---

## Koohii stories:

1) [mantixen] 28-7-2009(17): The king appreciated the distinction of burnished jewels.

2) [chibimizuno] 5-8-2009(13): The king's servant got lazy and didn't thoroughly burnish some of the king's many jewels, thinking "he won't notice the difference." However, the king most certainly did notice the distinction between the burnished jewels and unburnished ones: "Off with his head!!".

3) [brendanmacdonald] 16-10-2008(4): The KING's BURNISHing skills earned him a DISTINCTION.

4) [kapalama] 25-11-2010(2): 切瑳 =切磋, 切瑳琢磨 =切磋琢磨, 瑳 burnish (#2559 瑳) サ( 左 ) ... Parts: 王 , 差 (cf 差別 distinction (#554 差)) ... Note: Name Kanji pronounced SA. Compounds usually use the non-RTK 磋Unicode-0x78cb (#30923 磋). .. Similars: 琢 hone (#2560 琢), 瑳 burnish (#2559 瑳) ... Story: I Burned the Left sleeve on my wife's Wool coat, and now I have to give her Jewelry to make up for it. Maybe that will Burnish my reputation with her.

5) [astridtops] 19-11-2006(1): He burnished his metal armor with lots of jewels so that he could wear it with distinction.


text:
# Dice Roller 🎲

![High Roller](https://i.makeagif.com/media/11-30-2014/N1pTto.gif)

[![Build Status](https://travis-ci.com/KFChinese/Dice-Roll.svg?branch=master)](https://travis-ci.com/KFChinese/Dice-Roll)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://kfchinese.mit-license.org/)

Play Dice Roller with as many dice and sides as needed.

If you love the repo, please :star2: it!  :heart:

## Roll Now! with Repl.it (No Installation Required)

[![Run on Repl.it](https://repl.it/badge/github/KFChinese/Hang-Emoji-with-Python)](https://Dice-Roll.kfchinese.repl.run)
> If the Console is stuck on "Connecting...", Please refresh the page. This is an ongoing issue with Repl.it.

## Installation to Local Computer
Requires Python3
and
Run:

    python main.py

 for the python script to work.

repository: KFChinese/Dice-Roll

repo_name: KFChinese/Dice-Roll


text:
# Mesophellia brevispora Trappe & Castellano, 1996 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Trappe, Castellano & Malajczuk, Aust. Syst. Bot. 9(5): 780 (1996)

#### Original name
Mesophellia brevispora Trappe & Castellano, 1996

### Remarks
null


text:
# Contribution Guidelines

## Code Formatting

This project uses the [Spotless Maven Plugin](https://github.com/diffplug/spotless/tree/HEAD/plugin-maven) to verify format of our code, as well as auto-format it after changes are made.

You can do this by running:

```sh
mvn spotless:apply
```

As part of your local testing, we recommend running the below, to make sure your code is conformant:

```sh
mvn clean spotless:apply package
```


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][] and this project adheres
to [Semantic Versioning][].

[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.5.3] - 2022-07-06

- Fix buffer overflows in find. (#55)

## [0.5.2] - 2022-05-08

- Support 32-bit code with SSE4.2. (#52)

## [0.5.1] - 2021-09-18

- Avoid accessing invalid memory when the search string isn't found
  and the haystack ends on a OS memory page. (#45)

## [0.5.0] - 2021-05-05

- Update minimum required Rust version to Rust 1.51. (#39)

## [0.4.3] - 2018-08-26

- Coalesce back-to-back instructions for small performance
  improvements. (#35)

## [0.4.3] - 2018-08-26

### Fixed

- Coalesce back-to-back instructions for small performance
  improvements. (#24)

### Changes

 - Library is now dual-licensed as MIT or APACHE-2. (#12)

## [0.4.2] - 2018-07-11

### Fixed

- No longer reports false positives in certain cases when input data
  is not aligned on a 16-byte boundary. (#19)

## [0.4.1] - 2018-07-07

### Added

- `Substring` support restored. (#20)

## [0.4.0] - 2018-05-13

### Changed

- Complete rewrite from inline assembly to stable compiler intrinsics.

### Added

- Directly searching through a slice of bytes is now supported.

### Removed

- `Substring` was removed during the rewrite.

repository: shepmaster/jetscii

gha_language: Rust

repo_name: shepmaster/jetscii


text:
# Our Shell
This is our project for Holberton; a small sample of the operation of a Shell where we are also applying the knowledge we have of the C language.

# Built in
The C Programming Language

# Environment
- Ubuntu 14.04 LTS
- Vagrant
- VirtualBox

# Output
Unless specified otherwise, your program must have the exact same output as sh (/bin/sh) as well as the exact same error output.
The only difference is when you print an error, the name of the program must be equivalent to your argv[0].

Example of error with sh:
```sh
$ echo "qwerty" | /bin/sh
/bin/sh: 1: qwerty: not found
$ echo "qwerty" | /bin/../bin/sh
/bin/../bin/sh: 1: qwerty: not found
$
```
Same error with your program hsh:
```sh
$ echo "qwerty" | ./hsh
./hsh: 1: qwerty: not found
$ echo "qwerty" | ./././hsh
./././hsh: 1: qwerty: not found
$
```
#  Example

## Interactive Mode
```sh
vagrant@vagrant-ubuntu-trusty-64:~/simple_shell$ ./hsh
($)ls
AUTHORS    _getenv.c   _realloc.c  _strcmp.c  _strlen.c   builtins.c		 hsh	man_1_simple_shell  read_command.c  split_into_arguments.c
README.md  _getline.c  _strcat.c   _strcpy.c  _strncmp.c  free_double_pointer.c  hsh.c	myshell_execute.c   shellheader.h   split_path.c
($)
```
## Non-interactive Mode

```sh
vagrant@vagrant-ubuntu-trusty-64:~/simple_shell$ echo "ls" | ./hsh
AUTHORS    _getenv.c   _realloc.c  _strcmp.c  _strlen.c   builtins.c		 hsh	man_1_simple_shell  read_command.c  split_into_arguments.c
README.md  _getline.c  _strcat.c   _strcpy.c  _strncmp.c  free_double_pointer.c  hsh.c	myshell_execute.c   shellheader.h   split_path.c
```

## Installing
To clone the repo (depending on whose repo):
```sh
https://github.com/sechchr22/simple_shell
```

# Compiler
```sh
gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
```

# Description of File Structure

| File | Description |
| ------ | ------ |
| builtins.c | Builtin functions |
| free_double_pointer.c | function to free a pointer to an array of string |
| _getenv.c | Function to get an environmnet variable |
| _getline.c | Our get_line function |
| hsh.c | Shell main function |
| myshell_execute.c | Shell execute |
| read_command.c | Read the command that the user will type |
| _realloc.c | Function to realloc space of memory |
| split_into_arguments.c | Function to split the line indexed |
| split_path.c | Function to split env variable PATH into tokens |
| _strcat.c | Function to happen when executable is not founded |
| _strcmp.c | Function to compare two strings lexicographically |
| _strcpy.c | Function to copi strings |
| _strlen.c | Run to lenght of the string |
| _strncmp.c | Function to compare strings until an  n index |
| wait_free_directories | Functions to wait an free a double pointer |

### Development

Sergio Rueda

Mary Serna

License
----
MIT


text:
# bakauditor - Backup Auditor

## What is this

**bakauditor** is an automatic backup auditor robot.

All of us have backups. Every day something is backing up on background of our
desktops and somewhere on our servers. But what if backup has been failed and
you haven't even received an alert about it? Probably you'll find you miss
important backups only when your system is crashed and you need them.

People, who faced this problem at least once in a life, usually manually audit
their backups from time to time. That's why I've decided to automate this
boring stuff once and forever and created **bakauditor**.

## What can it do

Currently, **bakauditor** supports backup audit via plugins:

* **file** check backup, stored in file (modification time, min. size etc.)

* **dir** get most recent file in directory and check it like **file** does

* **zfs** check if ZFS snapshots exists on local or remote system

* **borg** borg backup repositories, local or remote

## How to use

Just run

```shell
bakauditor
```

and it will show you list of all your backups and their status.

![colorized cols](https://github.com/divi255/bakauditor/blob/master/out.png?raw=true)

You may also run

```shell
bakauditor -x
```

In this case, only failed backups are printed, otherwise you get a message:

```
Checked: 14, failed: 0

All backups are fine
```

**bakauditor** process exits with code *0* when everything is fine, and with
error codes when something is wrong. So you may just get its output and send
via e-mail or what you prefer when something is wrong. And e.g. weekly receive
output even if everything is fine, to check **bakauditor** is running and all
your backups are safe.

## Installation

```shell
pip3 install bakauditor
```

## Configuration

Put configuration file to */usr/local/etc/bakauditor.yml*. This is YAML file
and it has the following sections.

### default section

```yaml
default:
    time: 2d
    min-size: 10000000
```

Options in this section apply to all backup configurations, unless overriden.

The size may be specified in bytes, you may also use suffix "K" for Kbytes
(kilobytes, not kibitytes, 1K = 1000 bytes), "M" for MBytes, "G" for Gbytes,
"T" for TBytes.

### file

Example:

```yaml
server1:
    type: file
    path: /export/backups/server1/server1.dump.gz
    time: 3d
    min-size: 10000000
```

In the above example, we ask **bakauditor** to check backup stored in the
specified file, the file should not be older than 3 days and have a minimal
size of 10 megabytes to be considered as good backup.

Options *time* and *min-size* are optional if specified in *default* section.

### directory

Example:

```yaml
server1:
    type: dir
    path: /export/backups/server1
    time: 3d
    min-size: 10000000
```

This example will to the same as previous, but automatically get the most
recent file in the specified directory and check it. Good, when you do e.g.
incremental backups.

### directory of directories

Example:
```yaml
server1:
    type: dod
    path: /export/backups/somebackup
    time: 3d
    min-size:
```

This example considers backups are stored in separate directories inside
"somebackup" directory. The program will find most recently created directory
and calculate its total size.

### zfs

Example:

```yaml
server1:
    type: zfs
    time-fmt: "snapshot-%Y-%m%-%d-%H:%M:%S"
    fs: bakpool/server1
```

Option *time-fmt* is used to get snapshot creation time from snapshot name.  We
can not determine when ZFS snapshot has been created (unless we perform *zfs
get creation* for every snapshot, which could be pretty slow), but if snapshot
name contains time, we can decode it and check.

Option *fs* specifies file system, where snapshots are located.

Optionally, you may ask **bakauditor** to analyze ZFS snapshot on remote server
via ssh, specifying *ssh* option:

```yaml
server1:
    type: zfs
    time-fmt: "snapshot-%Y-%m%-%d-%H:%M:%S"
    fs: bakpool/server1
    ssh<EMAIL_ADDRESS>```

This option is just converted to command *ssh <option_value> zfs list ...* so
you may specify any options for ssh program you like.

Note: *min-size* option for zfs snapshots is ignored.

### borg

Example:

```yaml
borg-local:
  type: borg
  repo: /bak
  password: 123
```

To check repo on remote system, add "ssh" option.

Note: plugin requires **borg** >= 1.1.0, for older version use *borg0* instead
(doesn't check backup size).

## TODO

plugins for

* bacula
* HP Data Protector
* VMWare DP
* Acronis
* etc.

gha_language: Python


text:
## Laravel PHP Framework

[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework)
[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework)
[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework)

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching.

Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked.

## Official Documentation

Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs).

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at<EMAIL_ADDRESS>All security vulnerabilities will be promptly addressed.

### License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

## Work Cover So Far
12.Setting Up for Forstersgym - 2015

13.Creating Schools Migration-Model-Populating - 2015

14.Creating Students Model and Relationships - 2015

15.Relationships With Models - 2015

16.Creating the Home Page - 2015

Marked by Stephen J 13/11/2015

17.Styling with Bootstrap - 2015

18.Using Layouts - 2015

19.Installing LaravelCollective - 2015

20.Displaying all the Schools - Part 1 - 2015

Marked By Stephen J. 20/11/2015


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Units of Measure to material schema.
- Standards from IPC 4103 for laminates ("PTFE/None", "PTFE/Ceramic", "Hydrocarbon/None", "Hydrocarbon/Ceramic").
- Ability to define materials as having the peelable_mask function.

### Changed

- Renamed soldermask finish option `semi_glossy` to `semi_matte`.

### Deprecated

### Fixed

### Removed

## [2.0.0] - 2019-04-08

### Added

- Document Versioning approach.
- Realistic example files.
- Board area to metrics section.
- UUIDs to layers and processes
- IMS to material groups.
- Unit of Measure to relevant attributes for products.
- `solder_paste` as a valid layer function.
- `additional`, `verified` and `ipc_standard` attributes to materials.
- `capped` and `covered` to hole processes.
- `ipc_a600_class` to standards section.
- `none` option to impedance testing.

### Changed

- Internal references to layers to use UUIDs instead of names.
- Limit number of materials to one except for final_finish layers.
- `ipc_slash_sheet` for materials to allow for multiple slash sheets.
- `copper_filled` to `filled` for hole processes.
- Renamed `dead_pad_removal` to `non_functional_pad_removal`.
- Changed `non_functional_pad_removal` from a boolean to a string enum.
- Generic IPC 6010 series properties into specific 6012 and 6013 properties.
- Renamed IPC 6012 and 6013 properties with `_level` suffix to `_class`.
- Changed data type for IPC 6012 and 6013 properties to string enum from integer.

### Deprecated

### Fixed

- Correct board area unit
- Spelling mistakes with property names.
- Specification of requirements.
- Specification for `layer_attributes`.

### Removed

- Unneeded attributes from layers and processes.
- Duplicate standard `ul`. This is the same as `ul94` and makes it consistent with how UL is named for materials.
- Breakaway method from board. This is present and only makes sense in the array section where it describes how boards within an array are separated from each other and the array itself.
- `v_cut` and `v_groove` from breakaway_method for array. These have the same meaning as `scoring` which is already present.

## [1.0.0] - 2018-03-12

repository: elmatica/CircuitData-Language

repo_name: elmatica/CircuitData-Language


text:
# Table of Contents

1.  [What does this even do](#org7c8bb54)
2.  [Why am I doing this?](#org000459e)
3.  [Distributed export](#orgb315082)

This is where I'll put my notes for creation

# What does this even do

This is a system for defining architecture as code. It allows us to define and manage
archeticture in a predicatable reproducable way.

# Why am I doing this?

I have the belief that architecture should be a distributed effort. Instead of one single person managing
all the architecture of a system (read: single source of failure) you can have many people managing their
specific pieces. A problem with traditional systems is people don't update them. With code, you can track
and make sure that people update them. This promoted keeping stuff up to date. It will also help because
a feature I am planning is a comparison tool. So that you can compare two output files which will tell
you what you need to do, to get from a to b.mm

# TODO Distributed export

Point the thing at several sources, and export them all together into Neo4j (do this over the weekend to start using at work monday.

repository: whynotavailable/ark

repo_name: whynotavailable/ark


text:
# server_pusher_reactvr_musical

A Node.js server that publishes events to a Pusher channel so [React VR clients](https://github.com/eh3rrera/reactvr_musical) can play sounds.

# Requirements

- [Pusher account](https://pusher.com/signup)

# Installation
1. Clone this repository and `cd` into it.
2. Create an app at https://dashboard.pusher.com and enter your Pusher info in `server.js`.
4. Execute `npm install` to download dependencies.
5. Execute `node server.js` to start the Node.js server.

# License
MIT


text:
# Rainbow [![codecov](https://codecov.io/gh/tn0502/rainbow/branch/master/graph/badge.svg)](https://codecov.io/gh/tn0502/rainbow)

Rainbow is a fast, scriptable, cross-platform, 2D game engine written in modern
C++.

Copyright © 2010-present Bifrost Entertainment AS and Tommy Nguyen.

Distributed under the MIT License (see accompanying file `LICENSE` or copy at
https://opensource.org/licenses/MIT). Licenses for third-party software can be
found in file `THIRDPARTY`.

- [Documentation](https://tido.bitbucket.io/rainbow/)
- [Roadmap](https://trello.com/b/r2TqudY6/rainbow)
- [Discussion](https://groups.google.com/forum/#!forum/rainbow-tech)

## Features

### Cross-platform

Rainbow runs on most popular operating systems:

| Android | iOS | Linux/macOS | Windows |
|:-------:|:---:|:-----------:|:-------:|
| ✓ | ✓ | [![Linux build Status](https://travis-ci.org/tn0502/rainbow.svg?branch=master)](https://travis-ci.org/tn0502/rainbow)<br />[![*nix build status](https://doozer.io/badge/tn0502/rainbow/buildstatus/master)](https://doozer.io/tn0502/rainbow) | [![Windows build status](https://ci.appveyor.com/api/projects/status/oajtxwu9d9lrayk0?svg=true)](https://ci.appveyor.com/project/Tommy/rainbow) |

### Audio

Rainbow integrates [FMOD Studio](https://www.fmod.org/), giving you access to
the same professional tools that AAA studios use. There is also an open source
alternative built on OpenAL. Audio format support depends on the platform.
Typically, MP3 and Ogg Vorbis on Android, and
[AAC, ALAC, and MP3](https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW33)
on iOS and macOS.

### Graphics

Rainbow is mostly built on
[OpenGL ES 2.0](https://www.khronos.org/opengles/2_X/) and features:

- Sprites-based rendering with explicit batching
- Animation with traditional sprite sheets, or…
- Skeletal animation imported directly from
  [Spine](http://esotericsoftware.com/)
- Text rendering (supports TrueType and OpenType via
  [FreeType](https://freetype.org/))
- Texture atlas
  ([DDS](https://msdn.microsoft.com/en-us/library/windows/desktop/bb943991(v=vs.85).aspx),
   [PNG](http://libpng.org/pub/png/libpng.html),
   [PVRTC](https://community.imgtec.com/developers/powervr/tools/pvrtextool/),
   and [SVG](https://www.w3.org/Graphics/SVG/))

### Input

- Accelerometer (Android and iOS)
- Keyboard and mouse (Linux/macOS/Windows)
- Microphone (Android and iOS)
- Touch (Android and iOS)

### And more…

- [Lua](https://www.lua.org/) scripting language with debugging console and hot
  reloading
- 2d rigid body physics provided by [Box2D](http://box2d.org/)

## Structure

	build/  # Build related files
	demos/  # Lua demos
	doc/    # Documentation
	lib/    # Third party libraries Rainbow depend on
	lua/    # Lua convenience libraries
	src/    # Rainbow source code
	tools/  # Tools such as the build script

## Building

First of all, clone the repository:

	git clone --recursive https://bitbucket.org/tido/rainbow.git

The repository only includes some of the libraries required to build Rainbow.
The remaining requisites are listed in each platform's section below. They must
be installed or copied into the repository before you can start building
Rainbow.

More details can be found in the
[documentation](https://tido.bitbucket.io/rainbow/#building-rainbow-for-pc).

### On Linux/macOS

Easiest way to build Rainbow is to use the provided build scripts:

	mkdir rainbow-build
	cd rainbow-build
	/path/to/rainbow/tools/build.sh [platform] [options]

Run `build.sh help` to get an overview of options and configurations. `platform`
can be omitted if compiling a native build (i.e. not cross-compiling).

If you have problems running `build.sh`, please make sure it has execution
permission:

	chmod +x /path/to/rainbow/tools/build.sh

### On Windows

Run the PowerShell script `tools\make.ps1` (right-click on it and select
_Run with PowerShell_). It will take you through the steps.

## Learning

Check out the [documentation here](https://tido.bitbucket.io/rainbow/) or under
`doc`, and the demos under `demos`. Note: In order to run a demo, you'll need to
copy some files from `lua` into the folder of the demo you want to run. It's
easier to copy all even if you won't need everything.

Some demos may use resources that (unfortunately) cannot be distributed with
Rainbow.

Once you've copied all the necessary files, run `rainbow` inside the folder:

	cd /path/to/demo
	rainbow

Or with the path as argument:

	rainbow /path/to/demo

repository: chargen/rainbow

repo_name: chargen/rainbow


text:
<!---
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

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

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

# [Apache Arrow](https://github.com/apache/arrow) in JS

[![Build Status](https://travis-ci.org/graphistry/arrow.svg?branch=master)](https://travis-ci.org/graphistry/arrow)
[![Coverage Status](https://coveralls.io/repos/github/graphistry/arrow/badge.svg)](https://coveralls.io/github/graphistry/arrow)

Loading big native dataframes in JavaScript is finally awesome. `apache-arrow` provides an easy, modern, and efficient zero-copy JS interface to parse, iterate, and access [Apache Arrow](https://github.com/apache/arrow) columnar data on CPUs (GPU support via [GoAI](http://gpuopenanalytics.com/) is occurring in parallel).

`apache-arrow` is tested on Apache's sample Arrow files and [MapD Core's](https://www.mapd.com/platform/core/) Arrow output, and powers much of [Graphistry's](https://www.graphistry.com) GPU visual analytics platform. It is in active development by Graphistry for its GPU client/cloud visual graph analytics platform.

***This project has been developed outside the Apache Software Foundation, but an effort to transfer IP and ownership to the ASF is underway.***

## install

`npm install apache-arrow`

# What's Arrow?

Apache Arrow is a columnar memory layout specification for encoding vectors and table-like containers of flat and nested data. The Arrow spec aligns columnar data in memory to maximize caches and take advantage of the latest SIMD (Single input multiple data) and GPU operations on modern processors.

Apache Arrow is the emerging standard for large in-memory columnar data ([Spark](https://spark.apache.org/), [Pandas](http://wesmckinney.com/blog/pandas-and-apache-arrow/), [Drill](https://drill.apache.org/), ...). By standardizing on a common interchange format, big data systems can reduce the costs and friction associated with cross-system communication.

# Related Projects

* [Apache Arrow](https://github.com/apache/arrow) -- Arrow columnar format
* [GoAI](http://gpuopenanalytics.com/) -- Arrow standard extensions for GPUs
* [rxjs-mapd](https://github.com/graphistry/rxjs-mapd) -- Library for querying MapD Core in node

# Examples

## Get a table from an Arrow file on disk

```es6
import { readFileSync } from 'fs';
import { Table } from 'apache-arrow';

const arrow = readFileSync('simple.arrow');
const table = Table.from(arrow);

console.log(table.toString());

/*
 foo,  bar,  baz
   1,    1,   aa
null, null, null
   3, null, null
   4,    4,  bbb
   5,    5, cccc
*/
```

## Create a Table when the Arrow file is split across buffers

```es6
import { readFileSync } from 'fs';
import { Table } from 'apache-arrow';

const table = Table.from(...[
    'latlong/schema.arrow',
    'latlong/records.arrow'
].map((file) => readFileSync(file)));

console.log(table.toString());

/*
        origin_lat,         origin_lon
35.393089294433594,  -97.6007308959961
35.393089294433594,  -97.6007308959961
35.393089294433594,  -97.6007308959961
29.533695220947266, -98.46977996826172
29.533695220947266, -98.46977996826172
*/
```

## Columns are what you'd expect

```es6
import { readFileSync } from 'fs';
import { Table } from 'apache-arrow';

const table = Table.from(...[
    'latlong/schema.arrow',
    'latlong/records.arrow'
].map(readFileSync));

const column = table.getColumn('origin_lat');
const typed = column.slice();

assert(typed instanceof Float32Array);

for (let i = -1, n = column.length; ++i < n;) {
    assert(column.get(i) === typed[i]);
}
```

## Use with MapD Core

```es6
import MapD from 'rxjs-mapd';
import { Table } from 'apache-arrow';

const port = 9091;
const host = `localhost`;
const encrypted = false;
const username = `mapd`;
const password = `HyperInteractive`;
const dbName = `mapd`, timeout = 5000;

MapD.open(host, port, encrypted)
    .connect(dbName, username, password, timeout)
    .flatMap((session) =>
        session.queryDF(`
            SELECT origin_city
            FROM flights
            WHERE dest_city ILIKE 'dallas'
            LIMIT 5`
        ).disconnect()
  )
  .map(([schema, records]) =>
      Table.from(schema, records))
  .subscribe((table) => console.log(
      table.toString({ index: true })));
/*
Index,   origin_city
    0, Oklahoma City
    1, Oklahoma City
    2, Oklahoma City
    3,   San Antonio
    4,   San Antonio
*/
```

# Contribute

See [develop.md](https://github.com/graphistry/arrow/blob/master/develop.md)

Please create an issue if you encounter any bugs!

PR's welcome! Here's some ideas:

* API docs
* More Tests/Benchmarks
* Performance optimizations
* Arrows from node-streams and async-iterators
* GPU Arrows from node-opencl and node-cuda buffers
* Bindings to [libgdf](https://github.com/gpuopenanalytics/libgdf)

### packaging
`apache-arrow` is written in TypeScript, but the project is compiled to multiple JS versions and common module formats. The base `apache-arrow` package includes all the compilation targets for convenience, but if you're conscientious about your `node_modules` footprint, don't worry -- we got you. The targets are also published under the `@apache-arrow` namespace:
```sh
npm install @apache-arrow/es5-cjs # ES5 CommonJS target
npm install @apache-arrow/es5-esm # ES5 ESModules target
npm install @apache-arrow/es5-umd # ES5 UMD target
npm install @apache-arrow/es2015-cjs # ES2015 CommonJS target
npm install @apache-arrow/es2015-esm # ES2015 ESModules target
npm install @apache-arrow/es2015-umd # ES2015 UMD target
npm install @apache-arrow/esnext-esm # ESNext CommonJS target
npm install @apache-arrow/esnext-esm # ESNext ESModules target
npm install @apache-arrow/esnext-umd # ESNext UMD target
```

### why do we package like this?
The JS community is a diverse group with a varied list of target environments and tool chains. Publishing multiple packages accommodates projects of all types. Friends targeting the latest JS runtimes can pull in the ESNext + ESM build. Friends needing wide browser support and small download size can use the UMD bundle, which has been run through Google's Closure Compiler with advanced optimizations.

If you think we missed a compilation target and it's a blocker for adoption, please open an issue. We're here for you ❤.

# License

[Apache 2.0](https://github.com/graphistry/arrow/blob/master/LICENSE)