text:
---
title: 'ID Inspiration: Dash by General Assembly'
path: "/blog/id-inspiration-dash-by-general-assembly"
date: '2015-03-23'
featured: "../featured/Dash-by-GA.png"
categories: ["Coding", "Design", "elearning"]
tags: ["coding", "inspiration", "project-based learning"]
---

As I wrote last week, I've been handling my personal learning by just trying to do a little bit everyday. So far, it's been working pretty well. As a part of that, I do one coding lesson a day, currently using [FreeCodeCamp](http://www.freecodecamp.com/ "FreeCodeCamp"). Strangely, I think I enjoy their setup a little bit more than even Treehouse, which I have also signed up for. FreeCodeCamp is designed such that they link out to free lessons in a variety of places. They've obviously taken care with their choices; all of the lessons have been solidly designed and really useful. One of my favorites has been the lessons from [Dash by General Assembly](https://dash.generalassemb.ly/projects "Dash by General Assembly").

## Instructional Design

The Dash lessons are separated into projects first, and then into smaller steps within each project. Within each lesson, there is a really well-done presentation and an interactive code editor below. You can view the changes you make to the code in the responsive preview to the right.

<figure>
  <img
    sizes="(max-width: 810px) 100vw, 810px"
    srcset="https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_203/v1530396697/blog/DashLessonDesign.png 203w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_405/v1530396697/blog/DashLessonDesign.png 405w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_810/v1530396697/blog/DashLessonDesign.png 810w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_1215/v1530396697/blog/DashLessonDesign.png 1215w"
    src="https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_810/v1530396697/blog/DashLessonDesign.png"
    alt="Dash lesson UI" />
  <figcaption>Dash Lesson design</figcaption>
</figure>

## Challenge

Dash is a wonderful introduction to the basic web languages: HTML, CSS, and JavaScript. It's meant to be a teaser to get you interested in learning more about coding for the web, in general, and in learning through General Assembly, in particular. The level of challenges is perfect for the target audience. The slides do a great job of explaining coding concepts in context (say that 3 times fast!) and providing examples of how your code should look. There's never a time where even the most beginning coder should feel overly frustrated.

## Context

The projects GA has designed are immediately relevant to anyone looking to get into web development: a basic landing page website, a blog, a basic restaurant site, and interactive animations. Anyone looking for a inspiration on microlessons or chunking would do well to check out the way Dash is designed. They also created an interactive code editor that provides a real-life context for what a web developer would look at all day.

<figure>
  <img
    sizes="(max-width: 810px) 100vw, 810px"
    srcset="https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_203/v1530396697/blog/DashbyGA.png 203w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_405/v1530396697/blog/DashbyGA.png 405w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_810/v1530396697/blog/DashbyGA.png 810w,
            https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_1215/v1530396697/blog/DashbyGA.png 1215w"
    src="https://res.cloudinary.com/dhdaswa6t/image/upload/f_auto,q_60,w_810/v1530396697/blog/DashbyGA.png"
    alt="Jeff's Blog lesson" />
  <figcaption>Lesson from Dash/figcaption>
</figure>

## Activity

Depending on the lesson, your activity is to complete a particular project. By the end of the lesson you will have built actual websites. Dash goes the extra step, giving you access to the code and allowing you to host it with them, come back and experiment, and show off your achievement. Again, activities are broken down into smaller activities so, checking for understanding with hands-on coding practice.

## Motivation

The instructional design of these lessons is really on-point. They give you a project, show you the end game, and then give you mini-tasks to complete all through an engaging (if sometimes silly) story. You can see the results of your coding (and coding errors) immediately, providing intrinsic feedback. The lessons also encourage social learning by providing access to  a community group to ask for help (it's Facebook, though, which doesn't work for me, but I didn't need the extra assistance).

## Overall

I often look back on my learning career and wish that I had gotten into coding as an undergrad. However, I know that instructional design like Dash was mostly unavailable. I really think that they have created really effective instructional design over a topic that many people fear (or at least fear will be boring and bland). It gets two paws up. If you're interested in coding at all, I suggest you give it a try!

repository: anthkris/portfolio-site

repo_name: anthkris/portfolio-site


text:
# [Bootstrap Snippets for Brackets](https://github.com/acbarbosa1964/acb-bootstrap-snippets)

A collection of [Bootstrap](http://getbootstrap.com/) snippets for [Brackets](http://brackets.io/) editor.

![Screenshot](https://github.com/acbarbosa1964/acb-sample-gifs/blob/master/images/acb-bootstrap-snippets.gif?raw=true)

## Install

#### Git Clone

1. Under main menu select **Help > Show Extensions Folder**
2. Git clone this repository inside the folder user.

#### Extension Manager

1. Under main menu select **File > Extension Manager...**
2. Search for "ACB Bootstrap snippets"
3. Click "Install"

## How to use

1. **Enable ACB Bootstrap Snippets**<br/>
   Under main menu select **Edit > Enable ACB Bootstrap Snippets**
2. Starting typing "bs3" you'll see the snippets list (code hint provider), just pick a snippet and press ENTER, or
3. Enter a snippet and hit the **Tab** key (Alternatively you can also hit the key **DOWN**).

 Easily include them all, or one by one.

    Author: Arnold Daniels -<EMAIL_ADDRESS>    URL: http://www.jasny.net/
    Project: https://github.com/jasny/bootstrap
### Jasny CDN
    bs3jsncdncss
    bs3jsncdnjs

### Bootstrap Minimum Jasny Templates
    bs3jsnhtml
    bs3jsnhtmlnavbar
    bs3jsnhtmlnavbaroffcanvas

### Container
Added .container-smooth a container to use the same max-width for all viewport sizes. This means that the container size won't jump at media query breakpoints.
    bs3jsncontainer

### Buttons
Standard button with label

    bs3jsnbtnleft

Standard button with label on the right side

    bs3jsnbtnright

Success button with label

    bs3jsnbtnsuccess

Danger button with label

    bs3jsnbtndanger

### Navmenu
Body padding required!!
The fixed navmenu will overlay your other content, unless you add padding to the left or right of the <body>. Try out your own values or use our snippet below. Tip: By default, the navmenu is 300px wide.

     @media (min-width: 992px) {
       body {
         padding-left: 300px;
      }
     }
### Navmenu bs3 commands

#### Media Query

    bs3jsnnavmenumediaquery

#### Navmenu

    bs3jsnnavmenu

### Navmenu - Fixed to left or right
Add either .navmenu-fixed-left or .navmenu-fixed-right.

    bs3jsnnavmenufixedleft
    bs3jsnnavmenufixedright
    bs3jsnnavmenuoffcanvasreveal
    bs3jsnnavmenuoffcanvaspush

### Alerts
Fixed to top / bottom. Add .alert-fixed-top top stick the alert on top of your page. Use .alert-fixed-bottom for the bottom.
    bs3jsnalerttop
    bs3jsnalertbottom

    bs3jsnalertdangertop
    bs3jsnalertdangerbottom

    bs3jsnalertwarningtop
    bs3jsnalertwarningbottom

    bs3jsnalertinfotop
    bs3jsnalertinfobottom

    bs3jsnalertsuccesstop
    bs3jsnalertsuccessbottom

### Table - ROWLINK

    bs3jsntablerowlink

### Data Entry Mask

    bs3jsninputmask
    bs3jsnfileselect
    bs3jsnbtnfileselect
    bs3jsnuploadimag

---

To get supplementary files and assets for Animated Portfolio Sample check [Bootstrap Portfolio Project](https://github.com/acbarbosa1964/light-wave-bootstrap-portfolio-sample)

### Notes

** v0.0.14 - Now with 601 bs3 commands and Bootstrap 3 including media query default sizes and Jasny!!! (More info check bs-func.txt and snippet.js files)

### Credits
---

- Bootstrap Framework - http://getboostrap.com
- jQuery JavaScript Library v1.11.1 - jQuery Foundation, Inc. and other contributors
- Portfolio Snippets based on http://www.designbootstrap.com themes.
- Snippets based on Bootstrap 3 Sublime Plugin - Thanks Jason Morton - Twitter @JasonMortonNZ
- Images provided by http://www.publicdomainpictures.net
- Animate.css - http://daneden.me/animate
- Animations v2.1, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/
- Font Awesome 4.3.0 by @davegandy - http://fontawesome.io
- Ionicons, v2.0.0 - Created by Ben Sperry - http://ionicons.com/
- jQuery.appear - Michael Hixson and Alexander Brovikov - https://github.com/bas2k/jquery.appear/
- jQuery Easing v1.3 - Robert Penner- http://gsgd.co.uk/sandbox/jquery/easing/
- Isotope v1.5.25 - David DeSandro / Metafizzy - http://isotope.metafizzy.co
- WOW - v1.1.2 - Matthieu Aussaguel - http://mynameismatthieu.com/WOW/
- Source-code editor used in this project - Brackets - http://www.brackets.io
- Bootsketch - https://github.com/Yago/Bootsketch
- Bootswatch - Copyright 2014 Thomas Park - http://bootswatch.com/
- Jasny Bootstrap - Arnold Daniels -<EMAIL_ADDRESS>- https://github.com/jasny/bootstrap

Thank you all!!!

### License
---

[MIT](https://raw.githubusercontent.com/acbarbosa1964/acb-bootstrap-snippets/master/LICENSE) for this project.

Copyright (c) 2015 Antonio Carlos Barbosa
Released under the MIT license

license: MIT

repository: trjstewart/BracketsSync

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: trjstewart/BracketsSync


text:
# Unsupervised Graph Alignment with Wasserstein Distance Discriminator

```
@inproceedings{walign_kdd21,
title = {Unsupervised Graph Alignment with Wasserstein Distance Discriminator},
author = {Ji Gao and Xiao Huang and Jundong Li},
booktitle = {Proceedings of the 27th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD)},
year = {2021}
}
```

links
- [preprint](http://www.cs.virginia.edu/~jg6yd/papers/WAlign.pdf)


text:
# Functions
Functions new to __Luna 1.0__ are currenlty missing from this documentation, stay tuned.

## Functions available everywhere
These function are in common.php and functions.php.

### `get_microtime()`
Returns the time in milliseconds.

### `check_cookie(&$luna_user)`
Takes $luna_user, and populates it with the user data.

### `escape_cdata($str)`
Takes a string with CDATA for scripts in it, and escapes it for HTML.

```php
$str = '<script type="text/javascript">	//<![CDATA[	alert('foo');	//]]>';
echo escape_cdata($str);
```

### `authenticate_user($user, $password)`
Authenticates the provided username and password against the user database.

### `prune($forum_id, $prune_pinned, $prune_date)`
Delete threads from $forum_id that are "older than" $prune_date.

### `get_current_url($max_length)`
This gets the URL, and returns null if the URL is longer than $max_length. If $max_length is left out, then it will return the current URL regardless of length.

### `get_current_protocol()`
Returns the protocol being used to access the server ('http' or 'https');.

### `get_base_url($support_https)`
This returns the base URL of the forum (i.e. what was set up in the configuration), and if $support_https is set to true, it will return it in HTTP or HTTPS, depending on how the page is accessed.

### `get_admin_ids()`
Fetches admin IDs.

### `set_default_user()`
This sets $luna_user to the defaults for a guest.

### ` forum_hmac($data, $key, $raw_output)`
A hash function, no better description at this time.

### `luna_setcookie($user_id, $password_hash, $expire)`
Sets a cookie for the current user, based on the settings you put in the parameters.

### `luna_cookiebarcookie()`
Sets a cookie for the cookie bar.

### `forum_setcookie($name, $value, $expire)`
This is simply a wrapper for setcookie.

### `check_bans()`
This gets the bans and puts them into $luna_bans, and will check for expired ones.

### `check_username($username, $exclude_id)`
Checks whether or not the given username is allowed.

### `update_users_online()`
Updates the database table containing the users online.

### `generate_avatar_markup($user_id)`
Generates the HTML to display the avatar for the user sent in $user_id. Deprecated.

### `draw_user_avatar($user_id, $responsive, $class)`
Same function as generatie_avatar_markup() but allows you to choose wether or not the avatar should be responsive and add additional classes.

### `check_avatar($user_id)`
Checks if the given user has an avatar.

### `generate_page_title($page_title)`
Sets the title for the page you are on.

### `set_tracked_threads($tracked_threads)`
No description at this time.

### `get_tracked_threads()`
No description at this time.

### `update_forum($forum_id)`
Updates the database entries for the last commenter and last comment in a forum.

### `delete_avatar($user_id)`
Deletes the avatar for the user with ID $user_id.

### `delete_thread($thread_id)`
Deletes a thread and all of __its__ replies.

### `delete_comment($comment_id, $thread_id)`
Deletes the comment specified.

### `forum_clear_cache()`
Deletes all cached date (i.e. bans, config, etc.).

### `censor_words($text)`
Runs the censoring filter on the text sent in $text, and returns the censored version.

### `get_title($user)`
Gets the user title of the user sent in $user. $user must contain:

```php
array (
	'title' => '*custom user title*',
	'username' => '*username*',
	'g_user_title' => '*default user group title*'
)
```

### ` paginate($num_pages, $cur_page, $link)`
Generates the page links (i.e. page 1, page 2, next page, previous page, etc.).

### `simple_paginate($num_pages, $cur_page, $link)`
Same function as paginate, but for inline.

### ` message($message, $no_back_link = false, $http_status = null)`
This displays a message to the user and stops the current script. If $no_back_link is left out, then a back link won't be displayed.

### `message_backstage($message, $no_back_link = false, $http_status = null)`
Same as above, but fo Backstage

### `is_subforum($id, $self_subforum = '0')`
Checks if a forum is a subforum.

### ` format_time($timestamp, $date_only = false, $date_format = null, $time_format = null, $time_only = false, $no_text = false)`
Formats the time for the user (depending on the user's formatting preferences).

### `forum_number_format($number, $decimals = 0)`
No description at this time.

### `random_key($len, $readable = false, $hash = false)`
No description at this time.

### `confirm_referrer($scripts, $error_msg = false)`
Make sure that HTTP_REFERER matches base_url/script.

### `random_pass($len)`
Generates a random password of length $len.

### `luna_hash($str)`
A wrapper for the SHA-1 function.

### `luna_sha2($str, $salt)`
A wrapper for the SHA-512 function and its salt.

### `luna_csrf_token()`
Compute a random hash used against CSRF attacks.

### `check_csrf($token)`
Check if the CSRF hash is correct.

### `get_remote_address()`
Returns the IP address of the current user.

### `luna_htmlspecialchars($str)`
Returns $str with all HTML stripped.

### `luna_htmlspecialchars_decode($str)`
Calls htmlspecialchars_decode with a few options already set.

### `luna_strlen($str)`
Returns the UTF-8 length of a string.

### `luna_linebreaks($str)`
Converts linkbreaks to the standard UNIX style.

### `luna_trim($str, $charlist = false)`
No description at this time.

### `is_all_uppercase($string)`
Checks if a string is all uppercase.

### `array_insert(&$input, $offset, $element, $key = null)`
Inserts $element into $input at $offset. If $key is set, it is used for setting the key for adding into an array where the keys are strings.

### `maintenance_message()`
Displays a maintenance message when the board is in maintenance mode.

### `redirect($destination_url, $message)`
Redirects the user to $destination_url with $message.

### `error($message, $file = null, $line = null, $db_error = false)`
Clears all output and displays an error message.

```php
$result = $db->query('SELECT id FROM users WHERE id=' . $luna_user['id']) or error('Could not select user ID', __FILE__, __LINE__, $db->error());
```

### `forum_unregister_globals()`
Unset any variables created as a result of register_globals.

### `forum_remove_bad_characters()`
Removes any characters that can cause undesired result or are invisible from text.

### `remove_bad_characters($array)`
Removes "bad" characters from the array.

### `file_size($size)`
Converts a file size in bytes into a more human version (e.g. 1024 B changed into 1 KiB).

### `forum_list_styles()`
Returns a list of the styles.

### `forum_list_accents()`
Returns a list of the accents.

### `forum_list_langs()`
Returns a list of the available languages.

### `generate_stopwords_cache_id()`
No description at this time.

### `forum_list_plugins($is_admin)`
Generates a list of the plugins available for the forum.

### `split_text($text, $start, $end, $retab = true)`
No description at this time.

### `extract_blocks($text, $start, $end, $retab = true)`
No description at this time.

### `url_valid($url)`
Checks if $url is a valid URL.

### `ucp_preg_replace($pattern, $replace, $subject)`
Replace string matching regular expression.

### `ucp_preg_replace_callback($pattern, $replace, $subject)`
A wrapper for ucp_preg_replace.

### `strip_bad_multibyte_chars($str)`
Strips all characters that are multiple bytes.

### `forum_is_writable($path)`
Checks whether $path is writable.

### `display_saved_queries()`
Displays all executed queries, if it is enabled.

### `dump()`
Shows all variables.

### `get_template_path($tpl_file)`
Get the template that is required.

### `get_view_path($object)`
Get the object that is required.

### `load_page($page)`
Get the view that is required.

### `load_css()`
Get the styles that are required.

### `load_meta()`
Get the meta tags that are required.

### `check_style_mode()`
Check wheter or not to enable night mode and force the accent.

### `delete_all($path)`
Delete all content in a folder but not the htaccess-file.

### `validate_redirect($redirect_url, $fallback_url)`
Validate the given redirect URL, use the fallback otherwise.

### `num_users_online()`
Fetch online users.

### `num_guests_online()`
Number of guests online.

### `get_forum_id($comment_id)`
Get forum_id by comment_id.

### `decrease_comment_counts($comment_ids)`
Decrease user comment counts (used before deleting comments).

### `build_config($status, $config_key, $config_valua = NULL)`
Create or delete configuration items.

repository: GetLuna/Documentation

gha_license_id: MIT

repo_name: GetLuna/Documentation


text:
# pyWindowPositionSaver

Python script that monitors number of screens present on the system and adjusts position of opened windows whenever any screen is detached and reattached to the system (eg. when a DisplayPort monitor is turned off and back on).

branch_name: refs/heads/main


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

vimwiki-to-web

    Publish your vimwiki go Gemini!

Write what you know. That should leave you with a lot of free time.

        &emdash; Howard Nemerov

    Explore the docs »

    ·
    Report Features & Bug

## About The Project

This project allows you to export your vimwiki (written in Markdown) to Gemini `.gmi` files for sharing on `gemini://`.

You can visit my site for an example (bare in mind, I just started my vimwiki):

gemini://gemini.alexanderbrevig.com

### Built With

* [Go](https://golang.org/)

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

* golang

### Installation and Use

1. Clone the repo
   ```sh
   git clone https://github.com/alexanderbrevig/vimwiki-to-web.git
   ```
2. Run the program
   ```sh
   # This will render ~/vimwiki to ~/gemini, recursively
   go run ./cmd/vimwiki-to-web -vimwiki ~/vimwiki -file / -gmiout ~/gemini
   ```
3. Install if you want
   ```sh
   GOBIN=/usr/local/bin/ go install ./cmd/vwtw
   ```

#### Usage

   ```
   > vwtw -h[elp]
   Usage of vwtw:
        -file string
            Path to your file (default "/index.md")
        -gmiout string
            Path to your output folder (default "/home/$(whoami)/vimwiki-gemini")
        -vimwiki string
            Path to your vimwiki (default "/home/$(whoami)/vimwiki")
   ```

## Roadmap

See the [open issues](https://github.com/alexanderbrevig/vimwiki-to-web/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contribuions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Alexander Brevig - [@alexanderbrevig](https://twitter.com/alexanderbrevig) -<EMAIL_ADDRESS>
Project Link: [https://github.com/alexanderbrevig/vimwiki-to-web](https://github.com/alexanderbrevig/vimwiki-to-web)

## Acknowledgements

* [Amazing Go Markdown Library](github.com/gomarkdown/markdown)

[contributors-shield]: https://img.shields.io/github/contributors/alexanderbrevig/vimwiki-to-web.svg?style=for-the-badge
[contributors-url]: https://github.com/alexanderbrevig/vimwiki-to-web/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/alexanderbrevig/vimwiki-to-web.svg?style=for-the-badge
[forks-url]: https://github.com/alexanderbrevig/vimwiki-to-web/network/members
[stars-shield]: https://img.shields.io/github/stars/alexanderbrevig/vimwiki-to-web.svg?style=for-the-badge
[stars-url]: https://github.com/alexanderbrevig/vimwiki-to-web/stargazers
[issues-shield]: https://img.shields.io/github/issues/alexanderbrevig/vimwiki-to-web.svg?style=for-the-badge
[issues-url]: https://github.com/alexanderbrevig/vimwiki-to-web/issues
[license-shield]: https://img.shields.io/github/license/alexanderbrevig/vimwiki-to-web.svg?style=for-the-badge
[license-url]: https://github.com/alexanderbrevig/vimwiki-to-web/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/alexanderbrevig

repository: AlexanderBrevig/vimwiki-to-web

gha_language: Go

repo_name: AlexanderBrevig/vimwiki-to-web


text:
# Ajuste Final
"Ajuste Final" is a student platformer game focused on narrative and puzzle solving with time limit. The game was developed using Unity Game Engine.

- Inside Unity, you can press Ctrl + O and open the scene "MenuScene.unity" under "AjusteFinal\Ajuste Final\Assets\Scenes" to start the game.

You can fully modify the project if you want, it would be great to see other people adding ideas to the game.

repository: tiagosabbioni/AjusteFinal

repo_name: tiagosabbioni/AjusteFinal


text:
# My Portfolio Landing Page

#### Epicodus Intro To Programming - Git, HTML and CSS Code Review

## By Collin Chapman

### Description

This portfolio page will tell you a little bit about me while illustrating what I have learned in Git, HTML and CSS. The website includes and 'About Me' section, a photo, my background, my interests, and links to my existing projects.

### Setup

Create the inital index.html page in HTML, style it using CSS, track and commit progress through Git.

### Technologies Used

HTML

Git

CSS

### Link

https://colchapm.github.io/Portfolio-Landing-Page/

### Legal

Copyright (c) 2020 Collin Chapman

This software is licensed under the MIT license.

repository: colchapm/Portfolio-Landing-Page

repo_name: colchapm/Portfolio-Landing-Page


text:
A configurable and extensible library for converting data into SimpleFeatures.

## Overview

Converters for various different data formats can be configured and instantiated using the
```SimpleFeatureConverters``` factory and a target ```SimpleFeatureType```. Currently available converters are:

 * delimited text
 * fixed width
 * avro
 * json
 * xml

The converter allows the specification of fields extracted from the data and transformations on those fields.  Syntax of
transformations is very much like ```awk``` syntax.  Fields with names that correspond to attribute names in the
```SimpleFeatureType``` will be directly populated in the result SimpleFeature.  Fields that do not align with
attributes in the ```SimpleFeatureType``` are assumed to be intermediate fields used for deriving attributes.  Fields
can reference other fields by name for building up complex attributes.

## Example Usage

Suppose you have a ```SimpleFeatureType``` with the following schema: ```phrase:String,dtg:Date,geom:Point:srid=4326```
and comma-separated data as shown below.

    first,hello,2015-01-01T00:00:00.000Z,45.0,45.0
    second,world,2015-01-01T00:00:00.000Z,45.0,45.0

The first two fields should be concatenated together to form the phrase, the third field should be parsed as a date, and
the last two fields should be formed into a ```Point``` geometry.  The following configuration file defines an
appropriate converter for taking this csv data and transforming it into our ```SimpleFeatureType```.

     {
      type         = "delimited-text",
      format       = "CSV",
      id-field     = "md5($0)",
      fields = [
        { name = "phrase", transform = "concatenate($1, $2)" },
        { name = "lat",    transform = "$4::double" },
        { name = "lon",    transform = "$5::double" },
        { name = "dtg",    transform = "dateHourMinuteSecondMillis($3)" },
        { name = "geom",   transform = "point($lon, $lat)" }
      ]
     }

The ```id``` of the ```SimpleFeature``` is formed from an md5 hash of the entire record (```$0``` is the original data)
and the other fields are formed from appropriate transforms.

## Transformation Functions

Provided transformation functions are listed below.

### Control Functions
* ```try```

### String Functions
 * ```stripQuotes```
 * ```length```
 * ```trim```
 * ```capitalize```
 * ```lowercase```
 * ```regexReplace```
 * ```concatenate```
 * ```substring```
 * ```toString```

### Date Functions
 * ```now```
 * ```date```
 * ```dateTime```
 * ```basicDate```
 * ```basicDateTime```
 * ```basicDateTimeNoMillis```
 * ```dateHourMinuteSecondMillis```
 * ```millisToDate```
 * ```secsToDate```

### Geometry Functions
  * ```point```
  * ```linestring```
  * ```polygon```
  * ```geometry```

### ID Functions
 * ```stringToBytes```
 * ```md5```
 * ```uuid```
 * ```base64```

### Type Conversions
 * ```::int``` or ```::integer```
 * ```::long```
 * ```::float```
 * ```::double```
 * ```::boolean```
 * ```::r```
 * ```stringToInt``` or ```stringToInteger```
 * ```stringToLong```
 * ```stringToFloat```
 * ```stringToDouble```
 * ```stringToBoolean```

### List and Map Parsing
 * ```parseList```
 * ```parseMap```

### Functions defined using scripting languages

You can define functions using scripting languages that support
JSR-223.  This is currently tested with Javascript only as it is
natively supported in all JREs via the Nashorn extension.  To define
a javascript function for use in the converter framework, either put
the file in ```geomesa-convert-scripts``` on the classpath or set the
system property ```geomesa.convert.scripts.path``` to be a comma-separated
list of paths to load functions from.  Then, any function you define in a
file in one of those paths will be available in a convert definition with
a namespace prefix.  For instance, if you have defined a function such as

```javascript
function hello(s) {
   return "hello: " + s;
}
```

you can reference that function in a transform expression as ```js:hello($2)```

### CQL Functions

Most of the basic CQL functions are available as transformations. To use one,
invoke it like a regular function, prefixed with the `cql` namespace. For example,
you can use the CQL buffer function to turn a point into a polygon:

```
cql:buffer($1, 2.0)
```

For more information on the various CQL functions, see the GeoServer
[filter function reference](http://docs.geoserver.org/stable/en/user/filter/function_reference.html#filter-function-reference).

### JSON/Avro Transformations

See Parsing Json and Parsing Avro sections

## Transformation Function Usage

### Control Functions

#### try

Description: Execute another function - if it fails, instead use a default value

Usage: ```try($1, $2)```

Example: ```try("1"::int, 0) = 1```

Example: ```try("abcd"::int, 0) = 0```

### String Functions

#### stripQuotes

Description: Remove double quotes from a string.

Usage: ```stripQuotes($1)```

Example: ```stripQuotes('fo"o') = foo```

#### length

Description: Returns the length of a string.

Usage: ```length($1)```

Example: ```length('foo') = 3```

#### trim

Description: Trim whitespace from around a string.

Usage: ```trim($1)```

Example: ```trim('  foo ') = foo```

#### capitalize

Description: Capitalize a string.

Usage: ```capitalize($1)```

Example: ```capitalize('foo') = Foo```

#### lowercase

Description: Lowercase a string.

Usage: ```lowercase($1)```

Example: ```lowercase('FOO') = foo```

#### uppercase

Description: Uppercase a string.

Usage: ```uppercase($1)```

Example: ```uppercase('foo') = FOO```

#### regexReplace

Description: Replace a given pattern with a target pattern in a string.

Usage: ```regexReplace($regex, $replacement, $1)```

Example: ```regexReplace('foo'::r, 'bar', 'foobar') = barbar```

#### concatenate

Description: Concatenate two strings.

Usage: ```concatenate($0, $1)```

Example: ```concatenate('foo', 'bar') = foobar```

#### substring

Description: Return the substring of a string.

Usage: ```substring($1, $startIndex, $endIndex)```

Example: ```substring('foobarbaz', 2, 5) = oba```

#### toString

Description: Convert another data type to a string.

Usage: ```toString($0)```

Example: ```concatenate(toString(5), toString(6)) = '56'```

### Date Functions

#### now

Description: Use the current system time.

Usage: ```now()```

#### date

Description: Custom date parser.

Usage: ```date($format, $1)```

Example: ```date('YYYY-MM-dd\'T\'HH:mm:ss.SSSSSS', '2015-01-01T00:00:00.000000')```

#### dateTime

Description: A strict ISO 8601 Date parser for format ```yyyy-MM-dd'T'HH:mm:ss.SSSZZ```.

Usage: ```dateTime($1)```

Example: ```dateTime('2015-01-01T00:00:00.000Z')```

#### basicDate

Description: A basic date format for ```yyyyMMdd```.

Usage: ```basicDate($1)```

Example: ```basicDate('20150101')```

#### basicDateTime

Description: A basic format that combines a basic date and time for format ```yyyyMMdd'T'HHmmss.SSSZ```.

Usage: ```basicDateTime($1)```

Example: ```basicDateTime('20150101T000000.000Z')```

#### basicDateTimeNoMillis

Description: A basic format that combines a basic date and time with no millis for format ```yyyyMMdd'T'HHmmssZ```.

Usage: ```basicDateTimeNoMillis($1)```

Example: ```basicDateTimeNoMillis('20150101T000000Z')```

#### dateHourMinuteSecondMillis

Description: Formatter for full date, and time keeping the first 3 fractional seconds for format ```yyyy-MM-dd'T'HH:mm:ss.SSS```.

Usage: ```dateHourMinuteSecondMillis($1)```

Example: ```dateHourMinuteSecondMillis('2015-01-01T00:00:00.000')```

#### millisToDate

Description: Create a new date from a long representing milliseconds since January 1, 1970.

Usage: ```millisToDate($1)```

Example: ```millisToDate('1449675054462'::long)```

#### secsToDate

Description: Create a new date from a long representing seconds since January 1, 1970.

Usage: ```secsToDate($1)```

Example: ```secsToDate(1449675054)```

### Geometry Functions

#### point

Description: Parse a Point geometry from lon/lat or WKT.

Usage: ```point($lon, $lat)``` or ```point($wkt)```

Note: Ordering is important here...GeoMesa defaults to longitude first

Example: Parsing lon/lat from JSON:

Parsing lon/lat

    # config
    { name = "lon", json-type="double", path="$.lon" }
    { name = "lat", json-type="double", path="$.lat" }
    { name = "geom", transform="point($lon, $lat)" }

    # data
    {
        "lat": 23.9,
        "lon": 24.2,
    }

Example: Parsing lon/lat from text without creating lon/lat fields:

    # config
    { name = "geom", transform="point($2::double, $3::double)"

    # data
    id,lat,lon,date
    identity1,23.9,24.2,2015-02-03

Example: Parsing WKT as a point

    # config
    { name = "geom", transform="point($2)" }

    # data
    ID,wkt,date
    1,POINT(2 3),2015-01-02

#### linestring

Description: Parse a linestring from a WKT string.

Usage: ```linestring($0)```

Example: ```linestring('LINESTRING(102 0, 103 1, 104 0, 105 1)')```

#### polygon

Description: Parse a polygon from a WKT string.

Usage: ```polygon($0)```

Example: ```polygon('polygon((100 0, 101 0, 101 1, 100 1, 100 0))')```

#### geometry

Description: Parse a geometry from a WKT string or GeoJson.

Example: Parsing WKT as a geometry

    # config
    { name = "geom", transform="geometry($2)" }

    # data
    ID,wkt,date
    1,POINT(2 3),2015-01-02

Example: Parsing GeoJson geometry

    # config
    { name = "geom", json-type = "geometry", path = "$.geometry" }

    # data
    {
        id: 1,
        number: 123,
        color: "red",
        "geometry": {"type": "Point", "coordinates": [55, 56]}
    }

### ID Functions

#### stringToBytes

Description: Converts a string to a UTF-8 byte array.

#### md5

Description: Creates an MD5 hash from a byte array.

Usage: ```md5($0)```

Example: ```md5(stringToBytes('row,of,data'))```

#### uuid

Description: Generates a random UUID.

Usage: ```uuid()```

#### base64

Description: Encodes a byte array as a base-64 string.

Usage; ```base64($0)```

Example: ```base64(stringToBytes('foo'))```

### Type Conversions

#### ::int or ::integer

Description: Converts a string into an integer. Invalid values will cause the record to fail.

Example: ```'1'::int = 1```

#### ::long

Description: Converts a string into a long. Invalid values will cause the record to fail.

Example: ```'1'::long = 1L```

#### ::float

Description: Converts a string into a float. Invalid values will cause the record to fail.

Example: ```'1.0'::float = 1.0f```

#### ::double

Description: Converts a string into a double. Invalid values will cause the record to fail.

Example: ```'1.0'::double = 1.0d```

#### ::boolean

Description: Converts a string into a boolean. Invalid values will cause the record to fail.

Example: ```'true'::boolean = true```

#### ::r

Description: Converts a string into a Regex object.

Example: ```'f.*'::r = f.*: scala.util.matching.Regex```

#### stringToInt or stringToInteger

Description: Converts a string into a integer, with a default value if conversion fails.

Usage; ```stringToInt($1, $2)```

Example: ```stringToInt('1', 0) = 1```

Example: ```stringToInt('', 0) = 0```

#### stringToLong

Description: Converts a string into a long, with a default value if conversion fails.

Usage; ```stringToLong($1, $2)```

Example: ```stringToLong('1', 0L) = 1L```

Example: ```stringToLong('', 0L) = 0L```

#### stringToFloat

Description: Converts a string into a float, with a default value if conversion fails.

Usage; ```stringToFloat($1, $2)```

Example: ```stringToFloat('1.0', 0.0f) = 1.0f```

Example: ```stringToFloat('not a float', 0.0f) = 0.0f```

#### stringToDouble

Description: Converts a string into a double, with a default value if conversion fails.

Usage; ```stringToDouble($1, $2)```

Example: ```stringToDouble('1.0', 0.0) = 1.0d```

Example: ```stringToDouble(null, 0.0) = 0.0d```

#### stringToBoolean

Description: Converts a string into a boolean, with a default value if conversion fails.

Usage; ```stringToBoolean($1, $2)```

Example: ```stringToBoolean('true', false) = true```

Example: ```stringToBoolean('55', false) = false```

### List and Map Parsing

#### parseList

Description: Parse a ```List[T]``` type from a string.

If your SimpleFeatureType config contains a list or map you can easily configure a transform function to parse it using
the ```parseList``` function which takes either 2 or 3 args

 1. The primitive type of the list (int, string, double, float, boolean, etc)
 2. The reference to parse
 3. Optionally, the list delimiter (defaults to a comma)

Here's some sample CSV data:

    ID,Name,Age,LastSeen,Friends,Lat,Lon
    23623,Harry,20,2015-05-06,"Will, Mark, Suzan",-100.236523,23
    26236,Hermione,25,2015-06-07,"Edward, Bill, Harry",40.232,-53.2356
    3233,Severus,30,2015-10-23,"Tom, Riddle, Voldemort",3,-62.23

For example, an SFT may specific a field:

    { name = "friends", type = "List[String]" }

And a transform to parse the quoted CSV field:

    { name = "friends", transform = "parseList('string', $5)" }

#### parseMap

Description: Parse a ```Map[T,V]``` type from a string.

Parsing Maps is similar. Take for example this CSV data with a quoted map field:

    1,"1->a,2->b,3->c,4->d",2013-07-17,-90.368732,35.3155
    2,"5->e,6->f,7->g,8->h",2013-07-17,-70.970585,42.36211
    3,"9->i,10->j",2013-07-17,-97.599004,30.50901

Our field type is:

    numbers:Map[Integer,String]

Then we specify a transform:

    { name = "numbers", transform = "parseMap('int -> string', $2)" }

Optionally we can also provide custom list/record and key-value delimiters for a map:

    { name = "numbers", transform = "parseMap('int -> string', $2, ',', '->')" }

## Parsing JSON

The JSON converter defines the path to a list of features as well as json-types of each field:

    {
      type         = "json"
      id-field     = "$id"
      feature-path = "$.Features[*]"
      fields = [
        { name = "id",     json-type = "integer",  path = "$.id",               transform = "toString($0)" }
        { name = "number", json-type = "integer",  path = "$.number",                                      }
        { name = "color",  json-type = "string",   path = "$.color",            transform = "trim($0)"     }
        { name = "weight", json-type = "double",   path = "$.physical.weight",                             }
        { name = "geom",   json-type = "geometry", path = "$.geometry",                                    }
      ]
    }

#### JSON Geometries

Geometry objects can be represented as either WKT or GeoJSON and parsed with the same config:

Config:

     { name = "geom", json-type = "geometry", path = "$.geometry", transform = "point($0)" }

Data:

    {
       DataSource: { name: "myjson" },
       Features: [
         {
           id: 1,
           number: 123,
           color: "red",
           geometry: { "type": "Point", "coordinates": [55, 56] }
         },
         {
           id: 2,
           number: 456,
           color: "blue",
           geometry: "Point (101 102)"
         }
       ]
    }

Remember to use the most general Geometry type as your ```json-type``` or SimpleFeatureType field type. Defining a type
```Geometry``` allows for polygons, points, and linestrings, but specifying a specific geometry like point will only
 allow for parsing of points.

## Parsing Avro

The Avro parsing library is similar to the JSON parsing library. For this example we'll use the following avro schema
in a file named ```/tmp/schema.avsc```:

    {
      "namespace": "org.locationtech",
      "type": "record",
      "name": "CompositeMessage",
      "fields": [
        { "name": "content",
          "type": [
             {
               "name": "DataObj",
               "type": "record",
               "fields": [
                 {
                   "name": "kvmap",
                   "type": {
                      "type": "array",
                      "items": {
                        "name": "kvpair",
                        "type": "record",
                        "fields": [
                          { "name": "k", "type": "string" },
                          { "name": "v", "type": ["string", "double", "int", "null"] }
                        ]
                      }
                   }
                 }
               ]
             },
             {
                "name": "OtherObject",
                "type": "record",
                "fields": [{ "name": "id", "type": "int"}]
             }
          ]
       }
      ]
    }

This schema defines an avro file that has a field named ```content``` which has a nested object which is either of type
```DataObj``` or ```OtherObject```. As an exercise...using avro tools we can generate some test data and view it:

    java -jar /tmp/avro-tools-1.7.7.jar random --schema-file /tmp/schema -count 5 /tmp/avro

    $ java -jar /tmp/avro-tools-1.7.7.jar tojson /tmp/avro
    {"content":{"org.locationtech.DataObj":{"kvmap":[{"k":"thhxhumkykubls","v":{"double":0.8793488185997134}},{"k":"mlungpiegrlof","v":{"double":0.45718223406586045}},{"k":"mtslijkjdt","v":null}]}}}
    {"content":{"org.locationtech.OtherObject":{"id":-86025408}}}
    {"content":{"org.locationtech.DataObj":{"kvmap":[]}}}
    {"content":{"org.locationtech.DataObj":{"kvmap":[{"k":"aeqfvfhokutpovl","v":{"string":"kykfkitoqk"}},{"k":"omoeoo","v":{"string":"f"}}]}}}
    {"content":{"org.locationtech.DataObj":{"kvmap":[{"k":"jdfpnxtleoh","v":{"double":0.7748286862915655}},{"k":"bueqwtmesmeesthinscnreqamlwdxprseejpkrrljfhdkijosnogusomvmjkvbljrfjafhrbytrfayxhptfpcropkfjcgs","v":{"int":-1787843080}},{"k":"nmopnvrcjyar","v":null},{"k":"i","v":{"string":"hcslpunas"}}]}}}

Here's a more relevant sample record:

    {
      "content" : {
        "org.locationtech.DataObj" : {
          "kvmap" : [ {
            "k" : "lat",
            "v" : {
              "double" : 45.0
            }
          }, {
            "k" : "lon",
            "v" : {
              "double" : 45.0
            }
          }, {
            "k" : "prop3",
            "v" : {
              "string" : " foo "
            }
          }, {
            "k" : "prop4",
            "v" : {
              "double" : 1.0
            }
          } ]
        }
      }
    }

Let's say we want to convert our avro array of kvpairs into a simple feature. We notice that there are 4 attributes:

 * lat
 * lon
 * prop3
 * prop4

We can define a converter config to parse the avro:

    {
      type        = "avro"
      schema-file = "/tmp/schema.avsc"
      sft         = "testsft"
      id-field    = "uuid()"
      fields = [
        { name = "tobj", transform = "avroPath($1, '/content$type=DataObj')" },
        { name = "lat",  transform = "avroPath($tobj, '/kvmap[$k=lat]/v')" },
        { name = "lon",  transform = "avroPath($tobj, '/kvmap[$k=lon]/v')" },
        { name = "geom", transform = "point($lon, $lat)" }
      ]
    }

### AvroPath

GeoMesa Convert allows users to define "avropaths" to the data similar to a jsonpath or xpath. This AvroPath allows you
to extract out fields from avro records into SFT fields.

#### avroPath

Description: Extract values from nested Avro structures.

Usage: ```avroPath($ref, $pathString)```

* ```$ref``` - a reference object (avro root or extracted object)
* ```pathString``` - forward-slash delimited path strings. paths are field names with modifiers:
  * ```$type=<typename>``` - interpret the field name as an avro schema type
  * ```[$<field>=<value>]``` - select records with a field named "field" and a value equal to "value"

## Extending the Converter Library

There are two ways to extend the converter library - adding new transformation functions and adding new data formats.

### Adding New Transformation Functions

To add new transformation functions, create a ```TransformationFunctionFactory``` and register it in
```META-INF/services/org.locationtech.geomesa.convert.TransformationFunctionFactory```.  For example, here's how to add
a new transformation function that computes a SHA-256 hash.

```scala
import org.locationtech.geomesa.convert.TransformerFunctionFactory
import org.locationtech.geomesa.convert.TransformerFn

class SHAFunctionFactory extends TransformerFunctionFactory {
  override def functions = Seq(sha256fn)
  val sha256fn = TransformerFn("sha256") { args =>
    Hashing.sha256().hashBytes(args(0).asInstanceOf[Array[Byte]])
  }
}
```

The ```sha256``` function can then be used in a field as shown.

```
   fields: [
      { name = "hash", transform = "sha256(stringToBytes($0))" }
   ]
```

### Adding New Data Formats

To add new data formats, implement the ```SimpleFeatureConverterFactory``` and ```SimpleFeatureConverter``` interfaces
and register them in ```META-INF/services``` appropriately.  See
```org.locationtech.geomesa.convert.avro.Avro2SimpleFeatureConverter``` for an example.

## Example Using GeoMesa Tools

The following example can be used with GeoMesa Tools:

    geomesa ingest -u <user> -p <pass> -i <instance> -z <zookeepers> -s renegades -C renegades-csv  example.csv

Sample csv file: ``example.csv``:

    ID,Name,Age,LastSeen,Friends,Lat,Lon
    23623,Harry,20,2015-05-06,"Will, Mark, Suzan",-100.236523,23
    26236,Hermione,25,2015-06-07,"Edward, Bill, Harry",40.232,-53.2356
    3233,Severus,30,2015-10-23,"Tom, Riddle, Voldemort",3,-62.23

The "renegades" SFT and "renegades-csv" converter should be specified in
the GeoMesa Tools configuration file (``$GEOMESA_HOME/conf/application.conf``).
By default, SimpleFeatureTypes (SFTs) should be loaded at the path ``geomesa.sfts``
and converters should be loaded at the path ``geomesa.converters``. Each converter
and SFT definition is keyed by the name that can be referenced in the converter
and SFT loaders.

Use ``geomesa env`` to confirm that ``geomesa ingest`` can properly read the
updated file.

``$GEOMESA_HOME/conf/application.conf``:

    geomesa = {
      sfts = {
        # other sfts
        # ...
        "renegades" = {
          attributes = [
            { name = "id",       type = "Integer",      index = false                             }
            { name = "name",     type = "String",       index = true                              }
            { name = "age",      type = "Integer",      index = false                             }
            { name = "lastseen", type = "Date",         index = true                              }
            { name = "friends",  type = "List[String]", index = true                              }
            { name = "geom",     type = "Point",        index = true, srid = 4326, default = true }
          ]
        }
      }
      converters = {
        # other converters
        # ...
        "renegades-csv" = {
          type = "delimited-text",
          format = "CSV",
          options {
            skip-lines = 1
          },
          id-field = "toString($id)",
          fields = [
            { name = "id",       transform = "$1::int"                 }
            { name = "name",     transform = "$2::string"              }
            { name = "age",      transform = "$3::int"                 }
            { name = "lastseen", transform = "date('YYYY-MM-dd', $4)"  }
            { name = "friends",  transform = "parseList('string', $5)" }
            { name = "lon",      transform = "$6::double"              }
            { name = "lat",      transform = "$7::double"              }
            { name = "geom",     transform = "point($lon, $lat)"       }
          ]
        }
      }
    }

## Loading Converters and SFTs at Runtime

If you have defined converters or SFTs in typesafe config you can place them on the classpath or load them with a
ConverterConfigProvider or SimpleFeatureTypeProvider via Java SPI loading. By default, classpath and URL providers are
provided. Placing a typesafe config file named ``reference.conf`` containing properly formatted converters and SFTs
(see example application.conf above) in a jar file on the classpath will enable the reference of the converters and SFTs
using the public loader API:

```scala
// ConverterConfigLoader.scala
// Public API
def listConverterNames: List[String] = confs.keys.toList
def getAllConfigs: Map[String, Config] = confs
def configForName(name: String) = confs.get(name)

// SimpleFeatureTypeLoader.scala
// Public API
def listTypeNames: List[String] = sfts.map(_.getTypeName)
def sftForName(n: String): Option[SimpleFeatureType] = sfts.find(_.getTypeName == n)
```

The [GeoMesa gm-data project](https://github.com/geomesa/gm-data) contains common data formats packaged in jar files
that can be placed on the classpath of your project.

repository: yufangsnow/geomesa

repo_name: yufangsnow/geomesa


text:
# Guide Book

The **Guide Book** Generator for Style Guides.

----------------------------

## How it works:

The **Guide Book** goal is to look for the predefined pattern, [showing here](#how-to-use), and use it to generate an HTML page showing the Categories, Elements, and Modules of your Style Guide.

----------------------------

## How to use

First of all on your **Source Files** (SCSS/SASS/STYLUS/LESS) use the below pattern:
```
/*GUIDE

<CATEGORY>|<SECTION>

<HTML>

*/
```

### Where
| PLACEBOLDER         | Description                            |
|---------------------|----------------------------------------|
| `<CATEGORY>`        | Category of the Example                |
| `<SECTION>`         | Sections of the example                |
| `<HTML>`            | Some HTML Elements                     |

----------------------------

## How to Setup

To setup the **Guide Book** create a JS file at main folder of your project, using as reference the below code:

```
const GuideBook = require('guide-book-generator');

const settings = {
  style: <BUILT_CSS_FILE>,
  source: <SOURCE_FOLDER>,
  output: <OUTPUT>,
}

const guideBook = new GuideBook();
guideBook.generate(settings);
```

### Where
| PLACEBOLDER         | Type            | Description                                                |   Example                 |
|---------------------|-----------------|------------------------------------------------------------|---------------------------|
| `<BUILT_CSS_FILE>`  | String          | The built style css file                                   | 'build/style.min.css'     |
| `<SOURCE_FOLDER>`   | String          | The Source Files (SCSS,STYLUS,LESS,...)                    | 'source/css'              |
| `<OUTPUT>`          | String          | The **folder** or **file** to generate the **Guide Book**  | 'guidebook/guide.html'    |

----------------------------

## Examples

To see examples access this Repository [Guide-Book-Example](https://github.com/kelvinbiffi/Guide-Book-Example)

----------------------------

## Requirements Version

- Node `v12.18.1`
- NPM  `6.14.5`

----------------------------

## Dependences

- [PrismJS](https://prismjs.com/)

----------------------------

## LICENCE

This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE.md) file for details

repository: kelvinbiffi/Guide-Book

repo_name: kelvinbiffi/Guide-Book


text:
# Express In Netlify - By Jon D Jones 💥

This is a base project that spins up a simple Express.js server that can be used within Netlify  using serverless-http.  This project has two routes:

```bash
/
/alternative
```

The routing works in netlify using the index.html and alternative.jt,l files found in the route.  This could be swapped for a better Javascript solution.

## 👾 How To Use ☄

To debug locally use:

```bash
npm run start-api
```

This will allow you to debug on port 3000.  You can also debug the express server directly, using nodemon.

```bash
npm run start
```

## 👻 Live Site URL & Status 👺

[https://express-in-netlify.netlify.app/](https://express-in-netlify.netlify.app/)

[![Netlify Status](https://api.netlify.com/api/v1/badges/06440163-f575-4937-be4d-82c88abeb12a/deploy-status)](https://app.netlify.com/sites/express-in-netlify/deploys)

repository: jondjones-poc/express-in-netlify

repo_name: jondjones-poc/express-in-netlify


text:
# VisioForge Media Player SDK .Net

## Memory Playback Demo (C#/WinForms)

The demo app shows a video/audio playback from a memory buffer/stream.

[Visit the product page.](https://www.visioforge.com/media-player-sdk-net)

path: /Media Player SDK/WinForms/CSharp/Memory Stream/readme.md


text:
# 2020-07-04 - Extreme Environmental Change Sweep Experiments

More focused iteration of the 2020-05-18--env-chg-sweep experiment. Only include the most extreme change rates.

- Seed offset: 950000
- Gradient Change rates (x8):
  - drift, 2/1, 4/1, 8/1, 16/1, 32/1, 64/1, 128/1
- NK change rates (x8):
  - drift, 512, 1024, 2048, 4096, 8192, 16384, 32768

repository: amlalejini/Aagos

repo_name: amlalejini/Aagos


text:
---
layout: page
title: 'Intro to R'
visible: true
tags:
  - r
  - beginner
---

 - **Authors**: Ahmed Hasan and James Santangelo
 - **Research field**: Biology
 - **Lesson topic**: Introduction to R (with a focus on `dplyr` and `ggplot`)
 - **Lesson content URL**: <https://github.com/utm-coders/studyGroup/tree/gh-pages/lessons/r/intro>

## Preface: ##

This is a very basic introduction to the R programming language with a
particular focus on the `dplyr` and `ggplot` packages.  It is based partially
on openly available material from [Data Carpentry][data-carpentry] and
[EEB313][rcourse].  Instead of covering more advanced statistical methods, this
lesson aims to provide an understanding of fundamental data manipulation and
visualiztion operations in R.

We will be working through the material together in RStudio [rstudio] using the
R Notebook [r-notebook] file format. To use RStudio, you will also have to download
standalone R [here][r-install].

Please make sure to have `dplyr`, `readr`, `knitr`, and `ggplot2` installed:

```R
install.packages('dplyr')
install.packages('readr')
install.packages('knitr')
install.packages('ggplot2')
```

To install `dplyr`, `readr`, and `ggplot2` all at once alongside
other useful R packages:

```R
install.packages('tidyverse')
```

## Lesson Overview: ##

The lesson covers:

* The R/RStudio interface and R Notebooks
* Objects and functions
* Data frames
* The `dplyr` package
* Reading and writing files in R
* Introductory plotting with `ggplot2`
* Knitting Rmd files

[data-carpentry]: https://datacarpentry.org/R-ecology-lesson/
[rcourse]: https://uoftcoders.github.io/rcourse/
[rstudio]: https://www.rstudio.com/products/rstudio/download/
[r-install]: https://cran.r-project.org/bin/
[r-notebook]: https://bookdown.org/yihui/rmarkdown/notebook.html

repository: utm-coders/studyGroup

branch_name: refs/heads/gh-pages

gha_language: Jupyter Notebook

repo_name: utm-coders/studyGroup


text:
---
title: databank.newSeries
---

# `databank.newSeries` ^^(+databank)^^

{== Create new empty series in a databank ==}

## Syntax

    outputDb = databank.newSeries(inputDb, list)

## Input arguments

__`inputDb`__ [ struct | Dictionary ]
>
> Input databank within which new time series will be created.
>

__`list`__ [ string ]
>
> List of new time series names; if the already exists in the databank,
> they will be simply assigned a new empty time series and the previous
> content will be removed.
>

## Output arguments

__`outputDb`__ [ struct | Dictionary ]
>
> Output databank with the new time series added.
>

repository: IRIS-Solutions-Team/IRIS-Toolbox

branch_name: refs/heads/bleeding

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: IRIS-Solutions-Team/IRIS-Toolbox


text:
# Netlify Git API

Turn your Git repository into a REST API.

## Installation

Grab the binary from your platform from the [latest release](https://github.com/netlify/netlify-git-api/releases) and place it somewhere in your PATH.

## Usage

```bash
cd my-project
netlify-git-api users add
netlify-git-api serve
```

This will add a new user and start serving an API for your repo.

## Options

See `netlify-git-api help` for options and sub commands.

## Using with netlify CMS

Make sure to configure the `backend` in your `config.yml` like this:

```yaml
backend:
  name: netlify-api
  url: localhost:8080
```

## License

The MIT License (MIT)

Copyright (c) 2015 MakerLoop Inc

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

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

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


text:
## C0330 (bad-continuation)

### :x: Problematic code:

```python
# to be addded
```

### :heavy_check_mark: Correct code:

```python
# to be added
```

### Rationale:

Wrong indentation.

### Related resources:

- [Issue Tracker](https://github.com/PyCQA/pylint/issues?q=is%3Aissue+%22bad-continuation%22+OR+%22C0330%22)

repository: aidenmitchell/pylint-errors-simplified

repo_name: aidenmitchell/pylint-errors-simplified


text:
The AMEE category
/business/energy/stationaryCombustion/epa/ch4andn2ofactors contains data
on the emissions of CH4 and N2O associated with stationary fuel
combustion, sourced from the US Environmental Protection Agency's
[Climate Leaders](Climate_Leaders) initiative.

This category is used as a lookup reference for the specific fuel
sub-categories within the
[/business/energy/stationaryCombustion/epa](EPA_stationary_combustion)
category. Profile items cannot be created within this category.

repository: thegreenwebfoundation/datasets

gha_language: JavaScript

repo_name: thegreenwebfoundation/datasets


text:
# 1.1.0

## Features

* Add pauses to Install and Update batch files to better debug errors if any.
* [Doc] Warn that paths have to contain only ASCII characters.
* [Doc] Explain how to install Modsvaskr as a Mod Organizer executable.
* Adapted the default yaml file to the new Modsvaskr's version (v0.1.7).

## Bug fixes

* Use antislashes instead of slashes in paths as some Windows versions don't accept them.

# 1.0.1

* Bug correction: missing modsvaskr.yaml in the archive

# 1.0.0

* Initial release.

repository: getsmartt/Modsvaskr-app

repo_name: getsmartt/Modsvaskr-app


text:
# Infrastructure

There are data centers in Availability Zones (AZ) and AZs within Regions. Both AZs and Regions have **redundancies**.

## Regions

Region is a cluster of data centers, or Availability Zones. We should choose regions based on the following, with compliance being the priority.

AWS Regions are independent from one another. This means that your data is not replicated from one Region to another, without your explicit consent and authorization.

| Considerations | Desc |
|-|-|
| Compliance | with data governance & legal requirements |
| Latency | hosted proximity to consumer |
| Pricing | varies with regions due to, e.g. tax structure |
| Available Services | not all services within a region |

Regions are represented by codes e.g. Singapore is `ap-southeast-1`.

In the management console, we can choose the region at the top right corner of the screen.

Note that there are some services which are global by nature, while others are region specific. For example, switching to another region, you can still see the same IAM service with your data as it is a global service, while your EC2 instances will not appear as it is region specific.

## Availability Zones

AZ(s) or Availability Zones individual data centres within a region, but have redundancy from each other.

## Edge Locations

Edge Locations are **Content Delivery Network** (CDN) endpoints of CloudFront.

## Interacting with AWS API

There are 3 ways which we can interact with AWS services, which include the AWS Management Console, AWS Command Line Interface (AWS CLI), and AWS Software Development Kits (AWS SDKs).

repository: mapattacker/aws

repo_name: mapattacker/aws


text:
# keycloak-login-recaptcha

By default Keycloak (up to 8.0.2) only supports ReCaptcha for Regsitration, not login. so we created a simple module for activating recaptcha for login

#		How to use
for building you need to run `mvn clean install`.  it will produce a jar `target/recaptcha-login.jar`.
for making it accessible in Keycloak you should copy this jar into keycloaks `standalone/deployment/` directory.
just it.
if you're using it in docker environment you should mount it in `/opt/jboss/keycloak/standalone/deployment/recaptcha-login.jar`
for example in my docker compose file:
```
...
keycloak:
	image: jboss/keycloak:8.0.2
	.
	.
	.
	volumes:
		- ./realm-config:/opt/jboss/keycloak/realm-config
		- ./my-theme/:/opt/jboss/keycloak/themes/my-theme/
		- ./kc-recaptcha-module/target/recaptcha-login.jar:/opt/jboss/keycloak/standalone/deployments/recaptcha-login.jar
...
```
and in your theme file you should add this piece of code in your `login.ftl` template file:
```
<#if recaptchaRequired??>
<div class="form-group">
	<div class="${properties.kcInputWrapperClass!}">
		<div class="g-recaptcha" data-size="compact" data-sitekey="${recaptchaSiteKey}">
		</div>
	</div>
</div>
</#if>
```
you should past it inside your login `<form></form>` in your login template (`login.ftl`)

And finally you should enable external origin `https://google.com` like the way in keycloaks'  [Recaptcha Documentation](https://www.keycloak.org/docs/latest/server_admin/index.html#_recaptcha) mentioned.

# Thanks

Thanks to [@jabolina](github.com/jabolina) for fixing unsuccessful login problem.

repository: codependent/keycloak-login-recaptcha

repo_name: codependent/keycloak-login-recaptcha


text:
Bitcore Library
=======
THIS REPO HAVE BEEN MOVED TO BITCORE's MONO REPO. Check:

https://github.com/bitpay/bitcore/tree/v8.0.0/packages/bitcore-lib


text:
# Coverage Maps

Velox includes a subset of scalar and aggregate Presto functions.
velox_prestosql_coverage utility is used to generate a list of available
functions and coverage maps showing which subset of all and most used functions
is available. The output uses reStructured text format suitable for use in
Velox documenation.

> velox_prestosql_coverage

Generates a list of Presto functions available in Velox. The output
to be copy-pasted into velox/docs/functions.rst file.

> velox_prestosql_coverage --all

Generates coverage map using all Presto functions. The output to be copy-pasted
into velox/docs/coverage.rst file. The functions appear in alphabetical order.

The list of all scalar and aggregate Presto functions comes from
data/all_scalar_functions.txt and data/all_aggregate_functions.txt files respectively.

These files were created using output of SHOW FUNCTIONS Presto command.

> velox_prestosql_coverage --most_used

Generates coverage map using a subset of most used Presto functions. The output
to be copy-pasted into velox/docs/most_used_coverage.rst file. The functions
appear in order from most used to least used.

The list of most used Presto functions comes from data/most_used_functions.txt file
which contains a mix of scalar and aggregate function names in the order from
most used to least used.


text:
# Docker Apache NiFi
This is an unofficial [Apache NiFi](https://nifi.apache.org/) Docker image

## Base image
Since Apache NiFi requires a Java runtime, the [java/8](https://hub.docker.com/_/java/) image is used as the base image

## Docker Hub
This image is available on Docker Hub at [mkobit/nifi](https://hub.docker.com/r/mkobit/nifi/).

## How to use this image
### Testing out NiFi
To run this image and play around with NiFi:

1. Pull `latest` image

    ```console
    docker pull mkobit/nifi
    ```

2. Run image and expose default ports.

    ```console
    # --rm : remove container on exit
    # -i : interactive
    # -t : allocate TTY
    # -p : publish each container port to host port. format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
    docker run -it --rm -p 8080-8081:8080-8081 mkobit/nifi
    ```

3. Go to default local NiFi endpoint in browser - [http://localhost:8080/nifi/](http://localhost:8080/nifi/)

### Extending
This can easily be used as a base image to create NiFi applications.

### Volumes
Each of these volumes is exposed. These are the default locations as specified by the Apache NiFi properties. You can find more information about these on the [System Administration Guide](https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html)

- `$NIFI_HOME/database_repository` - user access and flow controller history
- `$NIFI_HOME/flowfile_repository` - FlowFile attributes and current state in the system
- `$NIFI_HOME/content_repository` - content for all the FlowFiles in the system
- `$NIFI_HOME/provenance_repository` - information related to Data Provenance

## Official Apache NiFi Documentation and Guides

* [Overview](https://nifi.apache.org/docs.html)
* [User Guide](https://nifi.apache.org/docs/nifi-docs/html/user-guide.html)
* [Expression Language](https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html)
* [Development Quickstart](https://nifi.apache.org/quickstart.html)
* [Developer's Guide](https://nifi.apache.org/developer-guide.html)
* [System Administrator](https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html)

## ListenHTTP Processor
The standard library has a built-in processor for an HTTP endpoint listener. That processor is named [`ListenHTTP`](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.ListenHTTP/index.html). You should set the **Listening Port** to 8081 if you follow the instructions above to run this image.

## Usage
This image will typically be used as a base image for other NiFi based images. Most people will develop their own NARs as well as their own configuration

## Issues
If you have any problems, comments, or questions with this image, feel free to reach out at [mkobit/docker-nifi](https://github.com/mkobit/docker-nifi). If you have Apache NiFi specific questions or concerns you can reach out on one of the [community mailing lists](https://nifi.apache.org/mailing_lists.html).

## Contributing to this repository
Contributing changes to this repository is extremely welcome. If it is a larger change, it is usually best to discuss your plans first. Please see the [Github issues](https://github.com/mkobit/docker-nifi/issues) to see if a similar issue already exists.

## Contributing to NiFi
The Apache NiFi source code can be found on Github at [apache/nifi](https://github.com/apache/nifi). You can browse issues related to the project on the [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI/).

repository: CognitiveScale/docker-nifi

repo_name: CognitiveScale/docker-nifi


text:
# dodax-comparator-chrome-extension
Chrome extension to compare prices across all Dodax sites

## TODO

### Improvements
- Translate into english
- Make the extension available in multiple languages: https://developer.chrome.com/extensions/i18n
- Improve look
- Maybe order the results by price

### Bugs
- None...?

## Authors

* **Gorka Armentia** - *Initial work* - [Joruus](https://github.com/Joruus)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

* Inspired by other Dodax comparator online


text:
# Auth0 Webtask Widget

## Usage

```js
// Get a reference to an existing HTMLElement instance
var containerEl = document.getElementById('container');

// Create a webtask widget in the element with id `container`.
// The webtask widget will prompt the user for their phone # or email address
// the first time they visit the page. Because `storeProfile` is enabled,
// the user's credentials will be saved locally for the next time they visit.
var editor = webtaskWidget.createEditor({
    mount: containerEl,
    storeProfile: true,
});

// The returned editor object is an instance of an A0EditorWidget class that
// emits certain events and gives programmatic access to some of the underlying
// functionality of the widget.
editor.on('save', function (webtask) {
    console.log('I just saved a webtask that can be accessed at', webtask.url);
});
```

## API

## Functions

showCronListing([options])

Create a widget that lists cron jobs associated with the active profile

showEditor([options])

Create a widget that lets users create or edit Webtasks and Cron Jobs

showLogin([options])

Create a widget that allows users to obtain Sandbox credentials

showLogs([options])

Create a widget that streams logs for a container

## showCronListing([options])
Create a widget that lists cron jobs associated with the active profile

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| [options] | Object | Customize the behaviour and appearance of the widget |
| [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. |
| [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. |
| [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. |
| [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. |
| [options.readProfile] | function | A function that should return a `Object` or a `Promise` for an object with `url`, `token` and `container` properties. |
| [options.writeProfile] | function | A function that will be called with the resolved `Profile` that should return a `Promise` that resolves once the profile has been written. |
| [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you *do not* use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

## showEditor([options])
Create a widget that lets users create or edit Webtasks and Cron Jobs

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| [options] | Object | Customize the behaviour and appearance of the widget |
| [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. |
| [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. |
| [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. |
| [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. |
| [options.code] | String | Initial code to be shown in the code editor of the widget. This will be ignored when the `edit` option is used. |
| [options.cron] | Boolean | Flag indicating whether the widget should be in cron or normal webtask mode. If cron is true and edit is a String then the value of edit will be taken as the name of a cron job instead of a simple webtask. |
| [options.edit] | String | The name of the webtask or cron job that you would like to edit. Can also be a `sandboxjs` `CronJob` or `Webtask` instance. |
| [options.name] | String | The default name for a new webtask or cron job. This will be ignored when the `edit` option is used. |
| [options.pane] | String | The name of the sidebar pane to show by default. Can be any of: `code`, `history`, `logs`, `schedule`, `secrets`, `settings` |
| [options.secrets] | Object | Object mapping secret keys to secret values that will be exposed via the webtask token secrets mechanism. This will be ignored when the `edit` option is used. |
| [options.readProfile] | function | A function that should return a `Object` or a `Promise` for an object with `url`, `token` and `container` properties. |
| [options.writeProfile] | function | A function that will be called with the resolved `Profile` that should return a `Promise` that resolves once the profile has been written. |
| [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you *do not* use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

## showLogin([options])
Create a widget that allows users to obtain Sandbox credentials

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| [options] | Object | Customize the behaviour and appearance of the widget |
| [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. |
| [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. |
| [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. |
| [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. |

## showLogs([options])
Create a widget that streams logs for a container

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| [options] | Object | Customize the behaviour and appearance of the widget |
| [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. |
| [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. |
| [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. |
| [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. |
| [options.readProfile] | function | A function that should return a `Object` or a `Promise` for an object with `url`, `token` and `container` properties. |
| [options.writeProfile] | function | A function that will be called with the resolved `Profile` that should return a `Promise` that resolves once the profile has been written. |
| [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you *do not* use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

## Build

### Development workflow

```shell
git clone git@github.com:auth0/auth0-webtask-widget.git
cd auth0-webtask-widget
npm install
npm run develop
```

This starts `webpack-dev-server` at [http://localhost:8080](http://localhost:8080).
The script will watch all dependencies and recompile on changes. Everything is
served from memory with source-maps.

### Production build

```shell
npm run build
```

This creates builds in the `./dist` folder.

Two builds are created:

1. `webtask.js` - Production bundle.
1. `webtask.min.js` - Development bundle.

## Concepts

### Profile

A profile represents a user's claim to create and run webtasks on a webtask cluster as defined by [sandboxjs](https://github.com/auth0/sandboxjs#Profile):

Profiles are the combination of:

1. `url` - The url of the webtask cluster
2. `container` - The container in which the webtask will be run
3. `token` - The user's webtask [Token](#token)

### Token

A webtask token is a JSON Web Token that encodes a user's claims to perform actions on a webtask cluster. See: [the webtask documentation](https://webtask.io/docs/how) for details on how this works.

### Webtask

A webtask is a claim to run code at a url where that code will have access to any secrets embedded in the webtask.
Webtask objects [expose several properties and methods](https://github.com/auth0/sandboxjs).

## Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.

## Author

[Auth0](https://auth0.com)

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.


text:
# grass
Implementation of GRASS (GRep AS a Service) for CS-412

# Team
- Benjamin Délèze<EMAIL_ADDRESS>GitHub: BenjaminDeleze
- Cedric Maire<EMAIL_ADDRESS>GitHub: CedMaire
- Mathilde Raynal<EMAIL_ADDRESS>GitHub: PizzaWhisperer

# Usage
Once you are in the grass folder, run `make` to build the executables.
The configuration file `grass.conf` should be structured as follow :
```
base [base_dir]

port [port_number]

user [user1] [pass1]
user [user2] [pass2]
# ...
user [userN] [passN]
```
[`grass.conf`](https://github.com/CedMaire/grass/blob/master/grass.conf) can be used as example.

## Start the server
```bash
./bin/server
```
uses the configuration file to set up the users' folders (each user is working on their own directory and has access to their files only) and launches the server.

## Start the client
The client can be started in two different modes, manual or automatic. In both modes, the server ip address and the port number specified in the configuration file have to be entered as arguments.
```bash
./bin/client [server ip] [port]
```
launches the client in manual mode, meaning it prints a prompt ">>>" and the client has to enter by hand each command and receives feedback from the server on the same terminal.
```bash
./bin/client [server ip] [port] [input file] [output file]
```
launches the client in automatic mode. Instead of reading the user input from a shell, it reads the commands written on the file `[input file]` and writes the server's feedback on `[output file]`.

## Functions
The client has access to the following set of functions :

 - `login [user]` The login command starts authentication. The username must be one of the allowed usernames in the configuration file.
 - `pass [password]` The pass command must directly follow the login command. The password must match the password for the earlier specified user. If the password matches, the user is successfully authenticated.
 - `ping [host]` The server will respond with the output of the Unix command ping $HOST -c 1.
 - **`ls`** The ls command lists the available files in the current working directory in the format as reported by ls -l.
 - **`cd [dir name]`** The cd command changes the current working directory to the specified one.
 - **`mkdir [dir name]`** The mkdir command creates a new directory with the specified name in the current working direc- tory.
 - **`rm [name]`** The rm command deletes the file or directory with the specified name in the current working directory.
 - **`get [filename]`** The get command retrieves a file from the current working directory.
 - **`put [filename] [size]`** The put command sends the specified file from the current local working directory to the server.

*Notes: the commands get and put can be executed in parallel. Also, it may take some time before the new files are shown when running the `ls` command.*
 - **`date`** The date command returns the output from the Unix date command.
 - **`grep [regex]`** The grep command searches every file in the current directory and its subdirectory for the requested pattern. The pattern follows the Regular Expressions [rules](https://www.gnu.org/software/grep/manual/html_node/Fundamental-Structure.html).
 - **`whoami`** The whoami command returns the name of the currently logged in user.
 - **`w`** The w command returns a list of each logged in user on a single line space separated.
 - **`logout`** The logout command logs the user out of their session.
 - `exit`

A bold command means that this command may only be executed after a successful authentication.

Some exploits were intentionally put in the programs. Please refer to [exploits_README.md](https://github.com/CedMaire/grass/blob/master/Exploits_README.md) to learn more about them.
Password for the zip-file: `_gXPR@ek&ukj!B5n_T!-fU7KKFz#A9u&Raqe!sCxdFHf?K#GYJP=xKQK2TjQvmYZ`

repository: CedMaire/grass

repo_name: CedMaire/grass


text:
@@@ index

- [Versions](versions.md)
- [Quick Start Guide](getting-started/index.md)
- [Releases](releases/index.md)
- [Roadmap](roadmap.md)
- [Nexus Fusion](fusion/index.md)
- [Nexus Forge](forge.md)
- [Nexus Delta](delta/index.md)
- [Utilities](utilities/index.md)
- [FAQ](faq.md)

@@@

# Blue Brain Nexus

Blue Brain Nexus is an ecosystem that allows you to organize and better leverage your data through the use of a
Knowledge Graph. In addition to the products listed here, you’ll find a rich ecosystem of libraries and tools.

## Products

The Blue Brain Nexus ecosystem encompasses a broad range of capabilities that are brought to you across three
complementary products and a suite of utilities.

### Nexus Fusion

*Enabling Collaborative Data and Knowledge Discovery*

Fusion is our extensible web application. It hosts different apps to accommodate various use cases. It comes by default
with Studios (where you work with data), Admin (for managing the Nexus instance), and will soon support
to organise your data activities. It runs on top of the Delta web services, and integrates neatly with our Forge python
framework.

@ref:[Read more about Fusion](fusion/index.md)

### Nexus Forge

*Building and Using Knowledge Graphs Made Easy*

Nexus Forge is a domain-agnostic, generic and extensible Python framework enabling non-expert users to create and manage
knowledge graphs.

@ref:[Read more about Forge](forge.md)

### Nexus Delta

*Managing the Data and Knowledge Graph Lifecycle*

A scalable and secure service to store and leverage all your data, neatly organised in a Knowledge Graph. It offers an
API to perform all your data management operations, this way it can easily integrate with your software stack. Its
advanced indexing capabilities automatically build views from your metadata.

@ref:[Read more about Delta](delta/index.md)

### Utilities

The Nexus ecosystem leverages a set of smaller open-source utilities.

@ref:[Discover the utilities](utilities/index.md)

## Quick Start Guide

Do you know know what a knowledge graph is? Or want to deepen your understanding? Follow our
@ref:[introduction](getting-started/understanding-knowledge-graphs.md).

Want to get started with Nexus right away? We provide a @ref:[tutorial](getting-started/try-nexus.md) that uses our
@link:[sandbox](https://sandbox.bluebrainnexus.io/){ open=new } environment to let you try the functionalities.

Ready to deploy your own instance of Nexus? Follow our @ref:[guide](getting-started/running-nexus/index.md).

## Versions

Looking for docs for another release of Nexus ?

@ref:[List of versions](versions.md)

## Roadmap

Curious about our upcoming features? Read our @ref:[open Roadmap](roadmap.md) to find out more.

repository: samuel-kerrien/nexus

repo_name: samuel-kerrien/nexus


text:
---
layout: post
title:
---

SQL Database
===================

SQL Database stores data that your app manages. Specifically uses for  transactional purposes.

In Bluemix it is powered by DB2.

----------

Installing the Application
-------------
In this part we will be installing your the application by uploading it to bluemix.

 1. Clone the respository https://github.com/IamLance/sql-databases
> git clone https://github.com/IamLance/sql-databases

 2. Go to the directory where you cloned the repository
 3.  In the command prompt login to you bluemix account

> cf login -a https://api.ng.bluemix.net -s dev

 Then Push the App

    > cf push sqlTutorial-(your_name) -m 256M -p sql-databases/build/libs/sqlApp.war

Add a SQL Database Service
-------------
In this part we will be create a SQL Database Service and bind it our app

1. Login to your Bluemix account [Link](https://console.ng.bluemix.net/)
2.
3.  Under the Application look for the sqlTutorial-(your_name) and click it.
4.  Click add a Service or API and you will be redirected to the Catalog
5.  Under the catalog find the SQL Database and click it.
6.  Click create.
7. Restage Application

Code Analysis - Finding the Service
-------------
 The Application is coded in JSP.

1.  Examine the Database connection code. Go to DBHelper.java

Notice that with this line we get the system environment variables

    Map<String,String> env = System.getenv();

 Then we check if it contains a VCAP services

    if(env.containsKey("VCAP_SERVICES"))

If it does contain a VCAP services we then  put it in a JSON object since it is in JSON format.

      JSONObject vcap = (JSONObject)       parser.parse(env.get("VCAP_SERVICES"));

We then parse it and look for the SQL Database service hiding under the key ""sqldb"".

      for (Object key : vcap.keySet()) {
                String keyStr = (String) key;
                if (keyStr.toLowerCase().contains("sqldb")) {
                    service = (JSONObject) ((JSONArray) vcap.get(keyStr)).get(0);
                    break;
                }
            }
We then check if it was able to find the SQL Database service

     if (service != null)

and If it was able to find the service we then get the credentials we need to connect to the database

    JSONObject creds = (JSONObject) service.get("credentials");
                databaseHost = (String) creds.get("host");
                databaseName = (String) creds.get("db");
                port = (long) creds.get("port");
                user = (String) creds.get("username");
                password = (String) creds.get("password");
                url = (String) creds.get("jdbcurl");

Code Analysis - Connecting to the Database
-------------
To connect to the database we then input the credentials we parse earlier from the VCAP services and input in DB2SimpleDataSource to get a connection.

    DB2SimpleDataSource dataSource = new DB2SimpleDataSource();
                    dataSource.setServerName(databaseHost);
                    dataSource.setPortNumber((int) port);
                    dataSource.setDatabaseName(databaseName);
                    dataSource.setUser(user);
                    dataSource.setPassword(password);
                    dataSource.setDriverType(4);
                    this.con = dataSource.getConnection();

Code Analysis - SQL Statements
-------------
Code for creating a table

        private void createTable() {
        // create a table
        if (con != null) {
            try {
                stmt = con.createStatement();
                // Create the CREATE TABLE SQL statement and execute it
                sqlStatement = "CREATE TABLE IF NOT EXISTS " + tableName
                        + "(FNAME VARCHAR(20), LNAME VARCHAR(20))";
                writer.println("Executing: " + sqlStatement);
                stmt.executeUpdate(sqlStatement);
            } catch (SQLException e) {
                writer.println("Error creating table: " + e);
            }
        }

    }

Code for inserting data

     public String insertInto(Account bean) {
            if (con != null) {
                try {
                    sqlStatement = "INSERT INTO " + tableName
                            + "(FNAME,LNAME) VALUES (?,?)";
                    PreparedStatement preparedStatement = con.prepareStatement(sqlStatement);
                    preparedStatement.setString(1, bean.getFname());
                    preparedStatement.setString(2, bean.getLname());
                    writer.println("Executing: " + sqlStatement);
                    preparedStatement.executeUpdate();

                } catch (SQLException e) {
                    writer.println("Error " + e);
                }
                return selectSingle(bean.getFname());
            }
            return null;
        }

Code for Selecting data

    public ArrayList<Account> getAllAccount() {
            if (con != null) {
                try {
                    sqlStatement = "SELECT * FROM " + tableName;
                    ArrayList<Account> beans = new ArrayList<>();
                    ResultSet rs = stmt.executeQuery(sqlStatement);
                    writer.println("Executing: " + sqlStatement);
                    while (rs.next()) {
                        Account a = new Account();
                        a.setFname(rs.getString("fname"));
                        a.setLname(rs.getString("lname"));
                        beans.add(a);
                    }
                    return beans;
                } catch (SQLException e) {
                    writer.println("Error " + e);
                    return null;
                }
            }
            return null;
        }

Code for deleting data

     public void deleteAllAccount() {
            if (con != null) {
                try {
                    sqlStatement = "delete FROM " + tableName;
                    ArrayList<Account> beans = new ArrayList<>();
                    stmt.executeUpdate(sqlStatement);
                } catch (Exception e) {
                }
            }
        }

dashDB  VS SQL Database
===================
1. Login to your Bluemix account [Link](https://console.ng.bluemix.net/)
2.  Go to catalog and find dashdb and click it then  click create leave the service unbound.
3.  On the right side click the launch button.
4.  It will open another tab we will call this the dashdb console. Go back to the previous tab and go to dashboard.
5.  In the dashboard find the previous SQL Database service we have created in the SQL Database Tutotrial and click it.
6.  On the right side click launch. It will launch another tab and we will call this the SQL Database console.
7.  Exploring both you will notice that dashdb has more features than SQL Database.
8.  In the dashdb console click analytic on the left side then click R script.
9.  You will see the sample projects In-Application Analytics, In-Database Analytics and Data-Visualization all these not existing in SQL Databases.
10.  Click the Customer-Churn(Decision Tree) under the In-Database analytics.
11. You will see the sample script in the script tab. This is actually a R script that is mostly common use in data analysis and statistics.
12.  Click submit.
13.  In the Plot tab you will see the result of the R script code.
14.  Explore other features of dashdb by repeating steps from 10 to 13 except this time picking a different option.

----------

dashDB
===================
Is a data warehousing and also a data analytics tool for analysing data and creating deep insights.


text:
# fast-forward

[![Build Status](https://travis-ci.org/phparsenal/fast-forward.svg?branch=master)](https://travis-ci.org/phparsenal/fast-forward) [![Dependency Status](https://www.versioneye.com/user/projects/558dbe19316338002400001c/badge.svg?style=flat)](https://www.versioneye.com/user/projects/558dbe19316338002400001c)

**fast-forward** lets you remember, find and open your most used commands and folders.

* [fast-forward](#fast-forward)
    * [Setup](#setup)
        * [Windows](#windows)
        * [Linux](#linux)
        * [Mac](#mac)
    * [Usage](#usage)

## Setup

### Windows
1. Download and extract https://github.com/phparsenal/fast-forward/archive/master.zip
2. Install composer using the [Windows installer](https://getcomposer.org/Composer-Setup.exe)
3. Make sure dependencies are up to date:

        composer install

4. Edit the file `ff.bat` and change `ffpath` to the folder you put fast-forward in.
5. Copy `ff.bat` to a global path so that it is always available on the command line.

### Linux

1. Download the project:

        cd ~
        git clone https://github.com/phparsenal/fast-forward.git

2. [Install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx):

        curl -sS https://getcomposer.org/installer | php
        mv composer.phar /usr/local/bin/composer

3. Make sure dependencies are up to date:

        composer install

4. Afterwards make the `ff` command available globally by adding this to your `~/.bashrc` or `~/.bash_aliases`:

        alias ff='. /path/to/fast-forward/ff.sh'

### Mac
n/a

## Usage
Add a new command in one line:

    ff add [-c cmd] [-d desc] [-s shortcut]

List all available commands and execute the selection:

    ff

Searching for _htd*_
If the only result is _htd_ it will be executed, otherwise all matches will be displayed first.

    ff htd

repository: gitter-badger/fast-forward

branch_name: refs/heads/develop

gha_language: PHP

repo_name: gitter-badger/fast-forward