text:
Obviously, this repo is no longer maintained.  However, if you still use jQuery UI, drop me a line and I might help.  In the meantime, check out my new carousel for React, Pure React Carousel [[github]](https://github.com/express-labs/pure-react-carousel#readme) [[demo]](https://express-labs.github.io/pure-react-carousel/)

# Responsive Carousel

A fully responsive carousel [jQuery UI widget](http://jqueryui.com/widget/ "jQuery UI widget documentation") that works on desktop browsers, iPhones, iPads, and even older Androids.* It can be configured to respond to touch events, mouse events, or both.  You can use the left and right arrows and/or use your finger or mouse to swipe the carousel left and right.   The code is currently is in the form of a jQuery UI widget and relies on hammer.js to handle the touch events.

### Stand-out Features:

- FAST.  Uses css transitions.  Code optimized to use as few redraws as possible.  Always getting faster.
- Continuous infinite scrolling.  Hold down a navigation arrow and keep holding it down. No need to keep clicking or tapping.
- You can have slide "units" of different widths!  Great for navigation menus.
- A callback function that lets you specify the number of units to show at different width
- Loose HTML. This doesn't force you to use certain HTML structures.  Your navigation can be anywhere in the DOM.
- Optionally works with the popular [Lazy Load jQuery Plugin](http://www.appelsiini.net/projects/lazyload) Images that are out of view are not loaded until the user interacts with the carousel.

You don't need all of jQuery UI or any of the theme assets (images, css, etc). All you need is the jQuery UI core and the widget factory.  Here is a [link](http://jqueryui.com/download/#!version=1.10.0&themeParams=none&components=1100000000000000000000000000000000 "jQuery UI with min needed options") to the download page with the minimum jQuery UI options checked for you. [LINK](http://jqueryui.com/download/#!version=1.10.0&themeParams=none&components=1100000000000000000000000000000000 "jQuery UI with min required options.")

See it in Action:

- [Example 1](http://matthewtoledo.com/creations/responsive-carousel/example/example-1.html) : A simulated product shelf.  The number and size of the boxes change based on the width of the window.
- [Example 2](http://matthewtoledo.com/creations/responsive-carousel/example/example-2.html) : A simulated hero slide show.  There is only one unit visible at a time.  Uses callbacks to add more functionality to the slideshow.
- [Example 3](http://matthewtoledo.com/creations/responsive-carousel/example/example-3.html) : Same as example 1 but with added infinite scrolling.
- [Example 4](http://matthewtoledo.com/creations/responsive-carousel/example/example-4.html) : A slideshow showing 2 slides at a time and featuring infinite scrolling.
- [Example 5](http://matthewtoledo.com/creations/responsive-carousel/example/example-5.html) : Horizontal navigation demo with units of different widths.

*The carousel animation runs a little slow on some older Androids that don't
support CSS3 transitions.  If Facebook's javascript API is also included on the page it will
further slow down older Androids because Facebook causes page reflows every few milliseconds.

## Supported Browsers
Please help me out by testing on other browsers so I can add to the support list. I have tested this on the following browsers:
- IE7 and higher
- Chrome 21 and higher
- Mobile Chrome Browser 20 and higher (Android 4.2 and higher)
- Safari 5.1.7 and higher
- Mobile Safari (iPhone / iPad) 5.1.7 and higher
- FireFox 14 and higher
- Android Browser (~Chrome 12-ish, Approximately, Android 4.0 to 4.1)

## Overhead
How many KB does it take to get your Note: These are non-gzipped sizes.  Using gzip compression on your server can decrease sizes even more.
- 32kb : jQuery
- 8kb : jQuery UI (you ONLY need the core and widget factory)
- 2kb : hammer.js
- 2.4kb : Modernizer (you only need the "CSS3 Transitions" test)
- 10kb : responsiveCarousel.min.js (note, when gzip compression is enabled on your server, the size is 3kb)

Total overhead (without gzip): **54.4kb** (However, you're already using jQuery on your site for other things, so the overhead is really **22.4kb**, and if you are already using jQuery UI, then overhead added by this script drops to **14.4kb**.)

## History

This code was born out of necessity. I needed a swipe-able carousel that would work on Androids* as well as iOS devices. There were a lot of responsive carousels, but none of the ones I found worked on older Androids.  If they did, they often had reduced functionality. They also usually added a lot of HTML that I couldn't easily alter.

I took care to minimize the number of reflows caused by the code.   I used the timeline tool in Chrome to find and eliminate all but the most-necessary
reflows. I also use fast CSS3 transitions that fall back to jQuery's default
$.animation() method.

## To Do List

- Make it so that you can choose which touch events library you want to use.  Right now it requires hammer.js, but lets say you preferr swipe.js.
- ~~Automatic slide show option.  Should be easy enough.~~ DONE!
- ~~get-able property with the currently left-most visible slide unit~~ DONE!
- ~~Infinite scroll / slide show  (Buggy beta version available in experimental branch.  Will most likely re-write infinite scroll with new approach.)~~ DONE!
- ~~slides of different widths~~ DONE!

## Known Bugs

Please report any bugs encountered!  I will fix em'

- none so far. Please notify me if some are found

## Config Options

Here are the default options:

```javascript
{
	options: {
	    arrowLeft: '.arrow-left',
	    arrowRight: '.arrow-right',
	    mask: '.slider-mask',
	    target: 'ul',
	    unitElement: 'li',
	    unitWidth: 'inherit',
	    responsiveUnitSize: null,
	    onRedraw: null,
	    ondragstart: null,
	    ondragend: null,
	    dragEvents: false,
	    easing: 'linear',
			speed: 400,
			slideSpeed: 2500,
			step: -1,
			responsiveStep: null,
	    onShift: null,
	    cssAnimations: Modernizr.csstransitions,
	    nudgeThreshold: 10,
	    infinite: false,
	    delta: 1,
	    dragVertical: false,
	    dragPreventDefault: false,
	    lazyload: false // work with lazyload.js plugin http://www.appelsiini.net/projects/lazyload
	},
}
```

#### arrowLeft  (css selector string)
A css selector representing the left arrow.  NOTE: This should be a span or other element instead of an anchor tag.  Our
responsiveCarousel script lets you hold down the arrow buttons for continuous scrolling.  If the arrows are anchor tags,
Android devices will prompt you to save the target URL for the anchor. It's impossible to turn this "feature" off. Don't
make the arrows anchors or buttons.  I recommend div or span elements. the script will attach the correct event
listeners.  You just need to add css so when the mouse hovers over your arrow element, it gets the same pointer as an
anchor tag.

Your arrow tags can be ANYWHERE on the page.  They do not need to be children of the DOM element where you attached
responsiveCarousel.  Heck, you can even attach the carousel to $(document) if you like. You can also set your select in
such a way that you can have multiple buttons that control the slider.

#### arrowRight (css selector string)
See above.

#### mask (css selector string)
A css selector representing the immediate parent of the the target element.  This element has visibility set to
"overflow hidden" and helps us give the illusion of a horizontal scroll. Do not give the mask CSS borders, margins or
padding.

#### target (css selector string)
A css selector representing the actual DOM element that will slide behind the masking dom element.  Usually this is an
unordered list containing list elements. Do not give CSS borders, margin, or padding to the target.

#### unitElement  (css selector string)
A css selector representing the child elements of target.  Usually, these are list elements.  Do not apply border,
margin, or padding to these elements. If you need spacing, add div's inside the unitElement and apply borders, padding,
and margins to the div.

#### unitWidth  (string)
__You're going to want to set this to 'compute' on responsive sites.__   'compute' relies on the responsiveUnitSize
function below to provide the number of units to show in the carousel at a particular width.
[See example 1](http://matthewtoledo.com/creations/responsive-carousel/example/example-1.html) for details.

 The default, 'inherit', inherits the width from your current CSS and is best suited for static, non-responsive sites.

 There is a new option added in 1.5, 'individual'.  This lets you have list elements of different (read: non-uniform)
 widths.  I created this so that I could have a horizontally scrolling navigation menu like some native mobile apps do.
 [See example 5](http://matthewtoledo.com/creations/responsive-carousel/example/example-5.html)

#### responsiveUnitSize (function)
This is only required if unitWidth is set to 'compute'.  See full details in the "Callback Options" section of the
documentation.

#### dragEvents (boolean)
Setting this to "true" enables touch & mouse drag events.  false turns them off.  Hint:  Modernizr's property,
Modernizr.touch, returns a boolean true or false.  You can enable "mousedrag" events on desktop computers if this is set
to true for non-touch devices.  Note:  mousedrag only works best on carousels that do not contain images or anchor tags,
as your browser lets you drag images and anchors to new tabs so you can open them.  This is built-in browser behavior
that is hard to prevent reliably across all browsers.

#### easing (string)
Used when "cssAnimations" option is set to boolean true. This is the same as the css-animation-timing property options
for CSS3 transitions.  To recap, they are: 'linear','ease','ease-in','ease-out','ease-in-out', and
'cubic-bezier(n,n,n,n)' [More details here](http://www.w3schools.com/cssref/css3_pr_animation-timing-function.asp)

#### speed   (integer)
Number milliseconds it takes to scroll one unitWidth to the left or right when you click on an arrow or during the slide
show.

#### slideSpeed  (integer)
Number of milliseconds to pause on each slide in a slideshow.

#### step (integer)
How many unitWidths to move to the left or right during a slide show.  -1 moves 1 unitWidth to the left. Positive
numbers move to the right. Hint:  You can go by groups of four or five.  Set this option to a function that returns an
integer for more dynamic / responsive results.

#### cssAnimations (boolean)
If the browser supports css3, then we use the much faster css3 transitions.  Otherwise, fall back to slower
(on older devices) jQuery animations.

#### nudgeThreshold (integer)
The minimum amount of pixels the user must drag the target before we force a slide one unit to the left or right.  If
your carousel scrolls too easily on mobile devices when you scroll the page vertically, you can increase this value.
Just make sure that it's generally less than 1/3 the minimum width you anticipate for each carousel unit element.

#### infinite (boolean)
Set this to true to have infinite scrolling. This means when you reach the ends of carousel, the carousel starts over
again.  Hint: Combine infinite with toggleSlideShow() to have an infinite slide show.
See [Example 3](http://matthewtoledo.com/creations/responsive-carousel/example/example-3.html "Example 2") and
[Example 4](http://matthewtoledo.com/creations/responsive-carousel/example/example-4.html "Example 4")

#### delta (integer)
A force-multiplier for dragging slides, like a lever, that increases the speed the carousel moves when you drag it
from side to side. The larger the number, the faster your slider will slide to the left or right when dragging.

#### lazyLoad (boolean)
Use the [Lazy Load](http://www.appelsiini.net/projects/lazyload) plugin for jQuery in combination with this plugin.
Carousels exist so they can contain a lot of information "above the fold" (I know, there is no fold on the Interwebz,
but clients still ask for stuff above it.)  As a result a lot of images can load that aren't even used unless the user
interacts with the carousel.  To use this option, include lazyLoad.js in your page and format your image tags according
to that plug-in's documentation.  When the carousel is created, all the visible images are loaded by default but
the images that are not visible are deferred until the user starts to interact with the carousel by pressing the
navigation arrows, moving their mouse over the carousel, or using their finger to drag the carousel.

    <img data-original=“img/example.jpg” src=“img/grey.gif”>

## Callback Options

#### responsiveUnitSize  (function)
Arguments passed to this function by responsiveCarousel are: $el, internal, options.  This is only used if your
unitWidth is set to 'compute'.  It is a callback function that should return an integer representing the number of
unitElements that should be visible in the carousel  at one time.  See the examples
([Example 1](http://matthewtoledo.com/creations/responsive-carousel/example/example-1.html), [Example 2](http://matthewtoledo.com/creations/responsive-carousel/example/example-2.html)) for more details.  Here is an example of usage below.

```javascript
    var winW;

    $(window).on('resize',function(){
        winW = $(window).width();
    });

	$elem.responsiveCarousel({
        infinite:       false,
        target:         '.slider-target',
        unitElement:    '.slider-target > li',
        mask:           '.slider-mask',
        arrowLeft:      '.arrow-left',
        arrowRight:     '.arrow-right',
        unitWidth:      'compute',

        dragEvents: Modernizr.touch,
        responsiveUnitSize: function () {
            var i = 4;
            if ( winW < 800 ) { i = 3; }
            if ( winW < 600 ) { i = 2; }
            if ( winW < 400 ) { i = 1; }
            return i;
        }
    });
```

#### onRedraw  (function)
A callback function that fires whenever something happens that would affect the size of stuff in the slider, e.g.
when the carousel is first created, after a window resize, after an image gets loaded in the carousel, etc.
Arguments passed to this function by responsiveCarousel are: $el, internal, options. Can be called manually to.
See examples. ([Example 1](http://matthewtoledo.com/creations/responsive-carousel/example/example-1.html),
[Example 2](http://matthewtoledo.com/creations/responsive-carousel/example/example-2.html))

#### ondragstart (function)
A callback function that is fired when dragging starts. Arguments passed to this function by responsiveCarousel are: options, internal.

#### ondragend (function)
A callback function that is fired when dragging ends. Arguments passed to this function by responsiveCarousel are: options, internal.

#### responsiveStep (function)
NOT IMPLEMENTED YET:  It will be a function that returns an integer representing the number of unitWidths to slide during a slide show or when arrows are pressed.

#### onShift  (function)
A callback function that is triggered after the carousel is moved to the left or right any amount of unitWidths.  Arguments passed to this function by responsiveCarousel are: i (the number of the current left-most visible slide starting from 0). Could for triggering other events on the page. based on the current left-most visible slide.  [See example 2](http://matthewtoledo.com/creations/responsive-carousel/example/example-2.html) to see this in use.  Note for IE8:  If you use custom web fonts (glyphs) in any of the slides, or for signposts (signposts = those dots in the slideshow example) then don't use [data-icon]:before to insert the glyphs.  It will cause onShift to seem like it's miss-firing.

## Methods

Since this is a jQuery UI widget, you can call these public methods like so:

```javascript
$([CSS Selector]).responsiveCarousel('[method name]', [arguments]);
```

#### startSlideShow()
Starts up the slide show.

#### stopSlideShow()
Derrrrrr. Stops the slide show.

#### toggleSlideShow()
Starts / stops the slide show. You might want a button or anchor tag someplace to turn on the slide show, or add it to a dom-ready event for an auto-start feature. Example of usage:

```javascript
$('#example-2').responsiveCarousel('toggleSlideShow');
```

#### redraw()
Force a redraw of the carousel.  THIS IS HANDY IF YOUR CAROUSEL WAS HIDDEN.  Elements that are hidden on page load have no dimensions.  You will need to call redraw once they become visible.  Example of usage:

```javascript
$('.some-button').toggle('#slider-wrap');
if ($('#slider-wrap').is(':visible')) {
  $('#example-2').responsiveCarousel('redraw');
}
```

#### goToSlide(i,a)
Jump to slide i (numbering starts at zero). Set "a" to true to use animation. Set "a" to false to just jump to the slide without animation.  If you leave out "a", it defaults to true.

#### destroy()
Clean up all event handlers and HTML added by this widget.

## Change Log

### Version 1.7.3 - 6/27/2013
- Bug fixes for the "individual" mode ("individual" is when slides in the carousel have different fixed widths)
- Further speed enhancements for "individual" mode by using reverse while loops

### Version 1.7.0 - 5/22/2013
- MAJOR bug fixes on all fronts due to tons of time spent Q.A.-ing the carousel for a major client.  Tons of updates in
speed, functionality, optimization, and improvements to the carousel when in 'individual' mode.

### Version 1.5.2 - 3/5/2013
- The latest update to Apple's OS introduced a scrolling bug that causes the carousels to become non-responsive.  Fixed.
- Fixed issues when a carousel is created in a hidden parent container.
- Various ie8, ie9, Apple fixes.  Please note: webfonts + [data-icon]:before = onShift callback FAIL!  Nothing I can do about this one, it's ie8.

### Version 1.5.1 - 2/15/2013
- Bugfix where internal.nudgeDirection was never reset to null between nudges causing unwanted slider advancement under certain conditions
- onShift function was returning fractions of pixels or NAN if the carousel was hidden.
- hammer.js "swipe" event was causing weirdness.  Disabled, as it is unnecessary for our needs.

### Version 1.5.0 - 2/11/2013
- I had to invest LOTS of time into getting this ready for a major Fortune 500 client.  It's no longer beta.  It's ready for the real world! (It better be, because it's going to be used a lot on that web site)

### Version 0.5.1 - 1/16/2013
- Bugfixes with nudgeThreshold option.  It was sometimes skipping a unit, going from 1 to 3 bypassing 2, for example. Fixed now.

### Version 0.5.0 - 1/15/2013
- New Feature: Infinite Scrolling!
- Bugfixes and speed enhancements

### Version 0.4.0 - 1/10/2013
- Bugfix. Script to determine vendor prefix for CSS transitions were not working on Firefox.  Switched to a new method.
- Added "nudgeThreshold" option so people can slide to the next slide with a little flick instead of dragging half the distance of the entire slide.  I think this improves the user experience.
- Updated example 1 so that people can use their mouse to drag the carousel on non-touch screens.


text:
# Media

## Responsive media

Media elements, including `img`, `embed`, `object`, and `video` are made responsive in HiQ by default. Their `max-width` is set to 100% of their container width.

## Images

`img` elements are given a border-radius by default. This can be altered with `--hiq-image-border-radius`.

![Image alt text](../assets/placeholder.svg)

<PropertiesTable category="images" />

## Figures

Anytime you need to display a piece of content like an image with an optional caption, consider using a `<figure>`. Some baseline styles are provided for the HTML5 `<figure>` and `<figcaption>` elements.

<CodeExample>

Here is a caption for this image.

</CodeExample>

```html
<figure>
    <img src="" alt="Image alt text">
    <figcaption>Here is a caption for this image.</figcaption>
</figure>
```

<PropertiesTable category="figures" />

## iFrames

By default, the border around `iframe`s is removed.

license: MIT

repository: datomar-labs-inc/hiq

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: datomar-labs-inc/hiq


text:
# Chroma

## Company blurb

Hi, we're Chroma. We build tools to help frontend developers build, test, and share UI components.

We maintain [Storybook](https://storybook.js.org/), the most popular open source tool for developing UI components. It’s used by thousands of companies like Lyft, Airbnb, and GitHub to engineer UIs for millions of people.

Chroma is run by Storybook core maintainers. We speak at conferences, write books, articles, and tutorials related to Component-Driven Development using Storybook.

To fuel our open source and community work we make [Chromatic](https://www.chromaticqa.com/), an industrial-grade visual testing service for UI components and libraries made for Storybook.

## Company size

7

## Remote status

We are a fully remote company currently in 6 timezones across the globe. We meet weekly in Zoom and use Slack for daily communication. All our work happens on GitHub. We try to plan a yearly company retreat although the last one was cancelled due to Corona.

## Region

We are US (Silicon Valley) based but have people in The Netherlands, Taiwan and Australia too. We are looking to expand in the US preferably.

## Office locations

We technically have an office in Silicon Valley but nobody really works from there. Some of us use a shared office space though.

## How to apply

[Chroma careers page](https://hichroma.com/careers)

repository: remoteintech/remote-jobs

branch_name: refs/heads/main

gha_language: JavaScript

repo_name: remoteintech/remote-jobs


text:
# nba_wl_model
For fun: analysis of 538's ELO model and others for predicting NBA game outcomes.

Idea based on Pat Schloss's evaluation of the MLB ELO model as part of the riffomonas project:

http://www.riffomonas.org/2018_asb/


text:
---
title: Getting started
---

There are several options for using TeaVM. One is a Maven build.
The easiest way to create a new TeaVM project is to type in this command:

```bash
mvn -DarchetypeCatalog=local \
  -DarchetypeGroupId=org.teavm \
  -DarchetypeArtifactId=teavm-maven-webapp \
  -DarchetypeVersion={{ site.teavm_version }} archetype:generate
```

Now you can execute `mvn clean package` and get the generated `war` file.
Deploy this `war` in Tomcat or another container, or simply unzip it and open the `index.html` page.

## Using the Flavour framework

Another option is to use Flavour by using another archetype:

```bash
mvn archetype:generate \
  -DarchetypeGroupId=org.teavm.flavour \
  -DarchetypeArtifactId=teavm-flavour-application \
  -DarchetypeVersion={{ site.flavour_version }}
```

This should generate a new minimal Flavour application.

You can build the generated project as usual by `mvn package`.
After successful build you should be able to open `target/hello-1.0-SNAPSHOT/index.html` in your browser.

## Further learning

You can learn more about TeaVM from these examples:

* [Application gallery](/gallery.html).
* [Samples from TeaVM repository](https://github.com/konsoletyper/teavm/tree/master/samples).
* [Flavour example application](https://github.com/konsoletyper/teavm-flavour/tree/master/example).

repository: azhouSummer/teavm-site

repo_name: azhouSummer/teavm-site


text:
# Running on GCE

To reduce MIPs usage the Mainframe Connector provides funtionalitites to use an intermediate GCE VM Instance to transcode COBOL binary, packed decimal and EBCDIC to partitioned ORC files in a streaming fashion and maximize computation offload from the mainframe.

The gszutil provides a gRPC server and client in order to delegate execution to remote server.

# Architecture
Commands are using a GRPC protocol to delegate execution to remote server. TLS/SSL encryption is provided by separate tools, AT-TLS from mainframe side and stunnel at Grecv server side.

Here is highlevel diagram how RPC call is performed for Export command.

![bq_export_rpc_call](../img/bq_export_rpc_call.png)

## Authentication
Mainframe Connector relies on TLS for security at two levels. Both the Stunnel and the Grcp connection are secured using TLS.

We recommend creating two separate sets of certificate files:
- To create TLS certificate files for the Stunnel you can follow [these steps](environment/create-server-cert.sh)
- To create TLS certificate files for the gRPC connection you can follow [these steps](https://github.com/grpc/grpc-java/blob/master/testing/src/main/resources/certs/README)

For more info on Authentication at Grpc level please refer to [this page](https://github.com/grpc/grpc-java/tree/master/examples/example-tls)

# Creating server instance (Grecv)

This section briefly describes how BMLU server (Grecv) instance template is created and what components it has.

## Instance Startup Script inside Instance Template

To build the server instance use the followinfg tempalte: [instance-template-init.sh](environment/instance-template-init.sh).

Once created, the new instance will run [startup-script.sh](environment/startup-script.sh) to install additional software and configuration.

## Steps to create instance template

- Run script for creating TLS certificate files [create-server-cert.sh](environment/create-server-cert.sh) and pass the flow

Configuration example:
```
Country Name (2 letter code) []:US
State or Province Name (full name) []:California
Locality Name (eg, city) []:Sacramento
Organization Name (eg, company) []:TestInc
Organizational Unit Name (eg, section) []:Development
Common Name (e.g. server FQDN or YOUR name) []:John Doe
Email Address<EMAIL_ADDRESS>```
- Upload TLS certificate files (*.cert & *.key) and application jar files to the Google Cloud Storage
- Update variables in the header block of [instance-template-init.sh](environment/instance-template-init.sh) file with your project settings & file URLs from previous step
- Run [instance-template-init.sh](environment/instance-template-init.sh)

Most of the environment variables in script are self-explanatory, but few are custom:

|Name|Description|
|---|---|
|_MACHINE_TYPE| Specifies the machine type used for the instances. To get a list of available machine types, run `gcloud compute machine-types list`. |
|_JAVA_XMS_GB| Is used to pass java `-Xms` to [startup-script.sh](environment/startup-script.sh). Should be less than total VM memory. See `_MACHINE_TYPE` to detect total VM size. |
|_JAVA_XMX_GB| Is used to pass java `-Xmx` to [startup-script.sh](environment/startup-script.sh). Should be less than total VM memory. See `_MACHINE_TYPE` to detect total VM size. |
|_APP_STORAGE_PATH| Is used to pass BMLU `app.jar` Cloud Storage path to [startup-script.sh](environment/startup-script.sh) |
|_DEPS_STORAGE_PATH| Is used to pass BMLU `dependencies.jar` Cloud Storage path to [startup-script.sh](environment/startup-script.sh) |
|_TLS_CERT_STORAGE_PATH| Is used to pass certificate/public key Cloud Storage path to [startup-script.sh](environment/startup-script.sh). Following [script](../certs/create-server-cert.sh) is used to create self-signed keypair.|
|_TLS_PKEY_STORAGE_PATH| Is used to pass private key Cloud Storage path to [startup-script.sh](environment/startup-script.sh). Following [script](../certs/create-server-cert.sh) is used to create self-signed keypair.|

To remove created template [instance-template-destroy.sh](./instance-template-destroy.sh) could be used.

## Startup script init steps

This sectione decribes at high level the steps executed by the [startup script](environment/startup-script.sh).

1. Update debian software repository and install [cURL](https://ru.wikipedia.org/wiki/CURL). To be able to download
   resources.
2. Install Google Cloud Monitoring agent to collect more metrics from VM (cpu,memory,network,disk I/O)
   . [Details here .](https://cloud.google.com/monitoring/agent/monitoring/installation#agent-install-latest-linux)
3. Add [AdoptOpenJDK](https://adoptopenjdk.net/) debian repository to be able to install java 8. Debian 10 has
   only `openjdk-11`, that is why this extra step is needed.
4. Install Java 8 from debian repository
5. Download BMLU `apt.jar` and `deps.jar` from paths that are mentioned
   inside [instance-template-init.sh](environment/instance-template-init.sh)
6. Create and start BMLU server systemd service
7. Install [stunnel](https://www.stunnel.org/) from debian repository
8. Download certificate and private key from paths that are mentioned
   inside  [instance-template-init.sh](environment/instance-template-init.sh)
9. Create and start `stunnel` systemd service

After init script run new instance will have new running 3 services on top of clean Debian 10 OS:

- Cloud Monitoring service
- gszutil server service (default port is 51771)
- stunnel service (default port is 52701)

gha_language: Python


text:
# Pong Demo

## What does it do?
It combines a lot of features of `tango`, to demonstrate the playing of a game of pong.

## What are important aspects of the code?
These things are key in this demo:

* Preloading files in `DefaultScene.Preload()`;
* The `SpeedSystem`, to make sure the ball increases speed gradually;
* The `ControlSystem`, to allow moving paddles up/down with WASD and arrow keys;
* The `BallSystem`, to keep track of the location of the ball, sending messages to the `ScoreSystem` when needed;
* The `ScoreSystem`, to keep track of the score of each player;
* Creating some `Entity`s and requiring the correct `System`s.

repository: inkeliz-technologies/tango

repo_name: inkeliz-technologies/tango


text:
Discord Bot Desposito

A little project I did for fun!

 If you have an idea or wish to make a recommendation, create an issue!

# About the project
I developed this project entirely by cell phone because I miss programming, since my computer burned. Some systems were inspired by some others, but everything was done my way and as I could. You can use whatever you want from my repository, but it would be really cool if you gave it a star or create a fork as a way to credit ~my poor~ work. Test before using, I do not guarantee to be error free.

## Colaborators

  WesleyWeber - Development

   Druzinhu - Tests and ideas


text:
# Description

This Cookbook adds the riemann-client (via gem) and installs the selected checks for :
- Riemann-Health
- Riemann-Nova (nova-manage service list)
- Riemann-Fixed (nova-manage fixed list)
- Riemann-KVMInstances

All checks are daemonized and integrated via runit and/or ruby-daemonize

Usage
===================
For Chef-Server:
Just deploy recipes for nodes and create at least one riemann-server via cookbook
(the clients find the ip of the server trough the node deployed with riemann-server recipe)

For Chef-Solo:
Adjust the paths to your environment and boot vagrant machines in combination with riemann-server

# Requirements

## Platform:

* Centos (>= 6.4)
* Ubuntu

## Cookbooks:

* runit
* rbenv

# Attributes

* `node['riemann']['tools_version']` - . Defaults to `0.1.3`.
* `node['riemann']['client_version']` - . Defaults to `0.2.2`.
* `node['riemann']['ruby_version']` - . Defaults to `1.9.3-p286`.
* `node['riemann']['ruby_shebang']` - . Defaults to `#!/opt/rbenv/shims/ruby`.
* `node['riemann']['ruby_exec']` - . Defaults to `/opt/rbenv/shims/ruby`.

# Recipes

* riemann-client::default - Installs the riemann-client (gem) and adds a user for `riemann`
* riemann-client::tools - Configures the riemann-tools (gem), a dependency of health and net
* riemann-client::health - Installs the health monitor
* riemann-client::net - Installs the net monitor
* riemann-client::nova - Installs a custom (bundled) Nova services monitor
* riemann-client::kvm - Installs a custom (bundled) KVM monitor
* riemann-client::fixed - Installs a custom (bundled) fixed IP monitor

# License and Maintainer

Maintainer:: cloudbau GmbH<EMAIL_ADDRESS>
License:: Apache v2.0

repository: tulp/chef-riemann-client

repo_name: tulp/chef-riemann-client


text:
---
username: codebasealpha
profile: ../img/members/codebasealpha.jpeg
twitter: codebasealpha
github: essenbee
youtube: https://www.youtube.com/channel/UCFFtfkaWjMb9UMDpPVnC1Sg
schedule:
  - Mondays 6:30pm UTC / 7:30pm BST
tags:
  - C#
  - F#
  - C++
  - GLSL Shaders
  - ASP.NET Core
  - Azure
  - .NET Core
  - Visual Studio
sites:
  - https://codebasealpha.dev
---

Hi, I'm Essenbee (aka Stu Bonham), host of the Codebase Alpha stream. I've been a developer or more years than I care to remember, and am currently a development manager who's very hands on with the code. My stream is beginner-friendly, by which I don't mean it has a "learn to code" agenda; but rather one that covers topics like creating a secure web API from scratch, creating a Spectrum 48K emulator, or coding an Alexa Skill, without assuming any prior knowledge of those topics. My main motivations for streaming are to challenge myself and to give something back to the developer community in my own small way. Although I mainly code using the Microsoft .NET stack, both professionally and on stream, the projects I tackle on Codebase Alpha are a world away from those I work on as a professional developer.

repository: livecoders/website

repo_name: livecoders/website


text:
[![Build Status](https://travis-ci.org/plus3it/splunkfowarder-windows-formula.svg?branch=master)](https://travis-ci.org/plus3it/splunkfowarder-windows-formula)

# splunkforwarder-windows-formula
Salt formula to install and configure the Splunk Universal Forwarder on
Windows. This formula requires a winrepo package definition containing the
specification for installing the splunkforwarder.

## Available States

- [splunkforwarder-windows](#splunkforwarder-windows)

### splunkforwarder-windows

Install and configure the Splunk Universal Forwarder for Windows.

## Configuration

This formula requires configuration via pillar. If the required parameters are
not configured in pillar, the formula will fail.

### splunkforwarder:lookup:deploymentclient

This parameter is a map containing the `source` and `source_hash` of the
deploymentclient.conf file.

>**Required**: `True`

**Example**:

```
splunkforwarder:
  lookup:
    deploymentclient:
      source: 'https://path/to/my/deploymentclient.conf'
      source_hash: 'https://path/to/my/deploymentclient.conf.HASH'
```

### splunkforwarder:lookup:log_local

This parameter is a map containing the `source` and `source_hash` of the
log-local.cfg file.

>**Required**: `True`

**Example**:

```
splunkforwarder:
  lookup:
    log_local:
      source: 'https://path/to/my/log-local.cfg'
      source_hash: 'https://path/to/my/log-local.cfg.HASH'
```

### splunkforwarder:lookup:package

The `package` parameter is the name of the package as defined in the winrepo
package definition.

>**Required**: `False`

>**Default**: `'splunkforwarder'`

**Example**:

```
splunkforwarder:
  lookup:
    package: 'splunkforwarder'
```

### splunkforwarder:lookup:service

The `service` parameter is the name of the Windows service for the Splunk
Universal Forwarder.

>**Required**: `False`

>**Default**: `'SplunkForwarder'`

**Example**:

```
splunkforwarder:
  lookup:
    service: 'SplunkForwarder'
```


text:
<!---
 Copyright 2018 herd-ui contributors

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

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

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

This module, `herd-ui-dist`, exposes Herd-UI's built dististribution as a dependency-free npm module.

For anything else, check the [Herd-UI](https://github.com/finraos/herd-ui) repository.

repository: FINRAOS/herd-ui

gha_language: TypeScript

repo_name: FINRAOS/herd-ui


text:
---
layout: post
title: Decommission nodes from Hortonworks HDP
category: Hortonworks
tags: Hortonworks
description: This page is going to talk about how to add volume on existing node in AWS and decommission nodes from Hortonworks HDP
---

## Why we need to do this?

The reason is because Hortonworks charged you based on node number. So if you have 10 data nodes(each has 3TB), It will be far expenisive than 1 data nodes(holds 10 3TB volume).

## 1.AWS Part
How to add volume to existing node?

1) Login to your AWS Account

2) Click Volumes under "ELASTIC BLOCK STORE"

3) Click Create Volume (Choose the type and size good for you. below just one example)

	Volume Type: General Purpose SSD(GP2)
	Size(GIB): 3000 (3TB for example)
	Availability Zone: eu-west-1a

4) After Volume created, Attached to existing Data node(If you don't have ec2 machine yet, create one).

## 2. Hortonworks Part
5) Initialize the volume

	Assume the new Volume is /dev/xvdi (This will change, check your volumn name)
	Login to the machine which has new volumn attached.
	sudo parted /dev/xvdi
		mklabel gpt
		mkpart primary ext4 0GB 4295GB
		quit
	sudo mkfs.ext4 /dev/xvdi -E lazy_itable_init
	sudo vi /etc/fstab (add below change)
		/dev/xvdi /mnt/data2 ext4 defaults 0 2
	sudo mkdir /mnt/data2
	sudo mount /mnt/data2

6) Update HDFS Config if the Data directory changed.

	Such as /mnt/data1/hadoop/hdfs/data,/mnt/data2/hadoop/hdfs/data

7) Repeat process to add more volumns

8) Decommission data nodes (Make sure there is space on existing data nodes)

9) Rebalance HDFS


text:
#SapientGuardian.MarathonClient

[![Build status](https://ci.appveyor.com/api/projects/status/ec10cdbuawbd119o?svg=true)](https://ci.appveyor.com/project/SapientGuardian/sapientguardian-MarathonClient)<br />
[![NuGet Package](https://img.shields.io/nuget/vpre/SapientGuardian.MarathonClient.svg)](https://www.nuget.org/packages/SapientGuardian.MarathonClient/)

## Description
SapientGuardian.MarathonClient is a client library for [Marathon](https://mesosphere.github.io/marathon/), a container orchestration platform for Mesos and DC/OS.
The API coverage is extremely minimal at this time, exposing only the functionality I need in my other projects, but you may find it useful too.

## How to use it

Call the static SapientGuardian.MarathonClient.ClientFactory.V2Client method with the URL of your V2 Marathon API (e.g. http://marathon.mycluster.local/v2/), and optionally provide an authorization token.
```C#
    var myClient = SapientGuardian.MarathonClient.ClientFactory.V2Client("http://marathon.mycluster.local/v2/");
    var awesomeApp = await myClient.Apps.get("/myApps/awesomeApp");
    awesomeApp.instances++;
    await myClient.Apps.Update(awesomeApp);
```

gha_language: C#


text:
# Cloud Foundry R Buildpack

Forked from [Heroku R buildpack](https://github.com/virtualstaticvoid/heroku-buildpack-r) to support Cloud Foundry. Works with R 3.3.1. Tested with Shiny.

9/6/2016: By default the buildpack uses [http://cloud.r-project.org/](http://cloud.r-project.org/) to download R packages. You can override that by defining an environment variable $CRAN_MIRROR in your `manifest.yml` to point to your CRAN mirror of choice (such as your local CRAN mirror). See `test/shiny` for an example.

## See it in action

Live demo (adapted from this [Shiny example](http://shiny.rstudio.com/gallery/kmeans-example.html)): [https://rshinyapp.cfapps.io:4443](https://rshinyapp.cfapps.io:4443)

Recorded demo: [[Youtube] Deploy a Cloud Foundry App with Customized R Buildpack](https://youtu.be/zDdU8_B2t8Y)

## Caveat
JDK / rJava is not supported. Cloud Foundry prefers JRE over JDK.

repository: dinodb/cf-buildpack-r

repo_name: dinodb/cf-buildpack-r


text:
---
layout: default
---

# 1996-09-17 - Re: The GAK Momentum is Building...

## Header Data

From: Lucky Green<EMAIL_ADDRESS>To: "Timothy C. May"<EMAIL_ADDRESS>Message Hash: 3c795d9825e156b0323af1278a2e5e3d5a2ce88446041b71c7af7eb3acb0649f

Message ID: \<Pine.3.89.9609162221.A17615-0100000@netcom14\>

Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-09-17 08:50:11 UTC

Raw Date: Tue, 17 Sep 1996 16:50:11 +0800

## Raw message

```
{% raw  %}From: Lucky Green<EMAIL_ADDRESS>Date: Tue, 17 Sep 1996 16:50:11 +0800
To: "Timothy C. May"<EMAIL_ADDRESS>Subject: Re: The GAK Momentum is Building...
In-Reply-To<EMAIL_ADDRESS>Message-ID: <Pine.3.89.9609162221.A17615-0100000@netcom14>
MIME-Version: 1.0
Content-Type: text/plain

On Mon, 16 Sep 1996, Timothy C. May wrote:
>
> -- the "Clipper IV" (or is it only Clipper III?) GAK announcement expected
> "soon"

Its Clipper IV. It will take the form of a bill introduced by the USG later
this Fall.

> It seems that several of these announcements are happening at the same
> time, which I doubt is coincidental.

Nothing coincidental about it. The USG, through its front man Al Gore,
has used time honored "divide and conquer" techniques to get the industry
leaders to support their fascist agenda by promising to let them off
easy under the future rules. For crying out loud, CyberCash, to give one
example, touts in all their recent presentations how they have compliance
with regulations that don't even exist yet built into their system.

Meanwhile, HP, TIS, IBM, and others have made a deal to sell their
children's birthright for fast track single DES export.

I read some five newspaper articles on export control/GAK in the last few
days. All mentioned as a matter of fact that GAK will be part of
lightened export controls. None questioned the connection between
domestic GAK and foreign exports. The worst of these articles, in the
Sunday SF Chronicle, mentioned as the only defenders of non-GAK
encryption hackers by the name of "Black Knight", etc. who were quoted as
having no explanation for the dichotomy between "information wants to be
free" and "I don't want the Feds to read my email".

It is a done deal,

--Lucky, who told you this three years ago.

{% endraw %}
```

## Thread

+ Return to [September 1996](/archive/1996/09)

+ Return to "[Lucky Green <shamrock@netcom.com>](/authors/lucky_green_shamrock_at_netcom_com_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_got_net_timothy_c_may_)"
+ Return to "["Vladimir Z. Nuri" <vznuri@netcom.com>](/authors/vladimir_z_nuri_vznuri_at_netcom_com_)"

+ 1996-09-17 (Tue, 17 Sep 1996 13:59:01 +0800) - [The GAK Momentum is Building...](/archive/1996/09/74c18dfd572ae98804f9649e1a0b65d7259d677778c91c81010529f300c79ceb) -<EMAIL_ADDRESS>(Timothy C. May)_
  + 1996-09-17 (Tue, 17 Sep 1996 16:50:11 +0800) - Re: The GAK Momentum is Building... - _Lucky Green<EMAIL_ADDRESS>    + 1996-09-18 (Wed, 18 Sep 1996 14:32:42 +0800) - [Re: The GAK Momentum is Building...](/archive/1996/09/b46e778a0c94037792cfe251f5784b44dca2340c8132d19624c6dae2f068c51c) - _"Vladimir Z. Nuri"<EMAIL_ADDRESS>


text:
---
id: virtual-devices
title: Appium Testing with Emulators and Simulators
sidebar_label: Virtual Devices
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

With Sauce Labs, you can run automated Appium tests for your native and hybrid mobile apps against many virtual OS and platform combinations with [Android emulators](https://developer.android.com/studio/run/emulator) and [iOS simulators](https://developer.apple.com/documentation/xcode/running_your_app_in_the_simulator_or_on_a_device).

## What You'll Need

* A Sauce Labs Account.
* The native or hybrid mobile app you want to test. If you don't have one on hand and want to test this functionality, try our [Sauce Labs demo mobile app](https://github.com/saucelabs/sample-app-mobile).
* Ensure that your system fulfills the project support and requirements prior to uploading your apps or leveraging device emulators and simulators. Review the [Automated Mobile App Testing Admin Guide](/mobile-apps/supported-devices) for further details.

## Upload Your App to Emulators and Simulators

1. To begin, you'll need to upload your app to a publicly available source. Accepted file types are *.zip iOS package files for simulators and *.apk Android package files for emulators. There are two ways you can upload your app for automated testing:

   * Sauce Labs App Storage
   * Install from a Remote Location

  For step-by-step instructions on uploading your app, see [App Storage](mobile-apps/app-storage.md).

## Set Your Test Credentials

2. After you've uploaded your app, open a new test script. Add your Sauce Labs credentials (`username` and `accessKey`). We also recommend [exporting your Sauce Labs credentials to environment variables](/basics/environment-variables).
  ```bash title="macOS/Linux Example"
  export SAUCE_USERNAME=********
  export SAUCE_ACCESS_KEY=*******
  ```

## Configuring Appium Test for Emulators and Simulators

3. The next step is to configure your app using Appium capabilities compatible with Sauce Labs emulators and simulators. Test configuration will depend on your testing use case.

  Authentication of the Sauce Labs platform, as well as advanced [Test Configuration Options](/dev/test-configuration-options), requires the use of the W3C WebDriver-compliant [`sauce:options`](/dev/w3c-webdriver-capabilities) capability. Here are some tips for configuring Appium for your tests:

### Set Your `appiumVersion`

4. Set the `appiumVersion` in your test script. While not required, if you omit this, your test will run with our default Appium version.

  We recommend specifying one of the newer Appium versions, which will provide a more extended API and fixes to known bugs.

### Check the Appium Version for Your Test

5. Check the Appium version for your test:
  * Log in to Sauce Labs.
  * Find and select the test that you ran using Appium to view the **Test Details** page.
  * Click the **Metadata** tab.
  * Look for the **Logs** row and select **Appium Log**. The first line should indicate the Appium version. For example:
    ```bash
    2014-05-05T17:45:07.541Z - info: Welcome to Appium v1.9.0.
    ```

### Set Browser Name

6. If you're testing a native mobile app, set the value for `browserName` as an empty string, for example:
  ```java
  caps.setCapability("browserName", "");
  ```

### Set the Location of Your Mobile App

7. If the app you want to test has been uploaded to a location other than our App Storage, you'll need to specify this location for `app`, and make sure that this location is accessible to Sauce Labs browsers. For example:
  ```java
  caps.setCapability("app","storage:filename=mapp.zip");
  ```

### Set `automationName` for Android Apps

8. If you're testing a native mobile app against Android versions 4.0 - 4.1, or a hybrid mobile against Android versions 4.0 - 4.2, you need to set the capability `"automationName","selendroid"`.

These Android versions are only supported via Appium’s bundled version of Selendroid, which utilizes [Instrumentation](http://developer.android.com/reference/android/app/Instrumentation.html). Later versions of Android are supported via Appium’s own UIAutomator library.

## Set Appium Capabilities for Emulators and Simulators

9. Before you running your test(s), you'll need to configure your Appium capabilities to communicate with the Sauce Labs virtual device cloud. Described below are required and optional Appium test capabilities and example scripts.

:::caution For Example Purposes Only

The code in these scripts is provided on an "AS-IS” basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. Your tests and testing environments may require you to modify these scripts. Issues regarding these scripts should be submitted through [GitHub](https://github.com/saucelabs-training). These scripts are not maintained by Sauce Labs Support.
:::

## iOS Code Snippets

Below are examples of an iPhone 8 project using iOS version 12.2:

<Tabs
  defaultValue="Java"
  values={[
    {label: 'Java', value: 'Java'},
    {label: 'Python', value: 'Python'},
    {label: 'Node.js', value: 'Node.js'},
    {label: 'Ruby', value: 'Ruby'},
    {label: 'C#', value: 'C#'},
  ]}>

<TabItem value="Java">

```java
DesiredCapabilities caps = DesiredCapabilities.iphone();
    caps.setCapability("appiumVersion", "1.13.0");
    caps.setCapability("deviceName","iPhone 8 Simulator");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("platformVersion","12.2");
    caps.setCapability("platformName", "iOS");
    caps.setCapability("browserName", "");
    caps.setCapability("app", "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.zip");
```

</TabItem>
<TabItem value="Python">

```py
caps['browserName'] = ""
caps['appiumVersion'] = "1.13.0"
caps['deviceName'] = "iPhone 8 Simulator"
caps['deviceOrientation'] = "portrait"
caps['platformVersion'] = "12.2"
caps['platformName'] = "iOS"
caps['app'] = "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.zip"
```

</TabItem>
<TabItem value="Node.js">

```js
caps['browserName'] = '';
caps['appiumVersion'] = '1.13.0';
caps['deviceName'] = 'iPhone 8 Simulator';
caps['deviceOrientation'] = 'portrait';
caps['platformVersion'] = '12.2';
caps['platformName'] = 'iOS';
caps['app'] = 'https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.zip';
```

</TabItem>
<TabItem value="Ruby">

```rb
caps = Selenium::WebDriver::Remote::Capabilities.iphone()
caps['appiumVersion'] = '1.13.0'
caps['deviceName'] = 'iPhone 8 Simulator'
caps['deviceOrientation'] = 'portrait'
caps['platformVersion'] = '12.2'
caps['platformName'] = 'iOS'
caps['browserName'] = ''
caps['app'] = 'https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.zip'
```

</TabItem>
<TabItem value="C#">

```Csharp
DesiredCapabilities caps = new DesiredCapabilities();
    caps.SetCapability("appiumVersion", "1.13.0");
    caps.SetCapability("deviceName", "iPhone 8 Simulator");
    caps.SetCapability("deviceOrientation", "portrait");
    caps.SetCapability("platformVersion", "12.2");
    caps.SetCapability("platformName", "iOS");
    caps.SetCapability("browserName", "");
    caps.SetCapability("app", "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.zip");
```

</TabItem>
</Tabs>

## Android Code Snippets

Below are examples of an Samsung Galaxy S9 Plus project using Android version 8.1:

<Tabs
  defaultValue="Java"
  values={[
    {label: 'Java', value: 'Java'},
    {label: 'Python', value: 'Python'},
    {label: 'Node.js', value: 'Node.js'},
    {label: 'Ruby', value: 'Ruby'},
    {label: 'C#', value: 'C#'},
  ]}>

<TabItem value="Java">

```java
DesiredCapabilities caps = DesiredCapabilities.android();
    caps.setCapability("appiumVersion", "1.9.1");
    caps.setCapability("deviceName","Samsung Galaxy S9 Plus FHD GoogleAPI Emulator");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("browserName", "");
    caps.setCapability("platformVersion","8.1");
    caps.setCapability("platformName","Android");
    caps.setCapability("app", "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/Android.SauceLabs.Mobile.Sample.app.2.2.0.apk");
```

</TabItem>
<TabItem value="Python">

```py
caps = {}
caps['appiumVersion'] = "1.9.1"
caps['deviceName'] = "Samsung Galaxy S9 Plus FHD GoogleAPI Emulator"
caps['deviceOrientation'] = "portrait"
caps['platformVersion'] = "8.1"
caps['platformName'] = "Android"
caps['app'] = "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/Android.SauceLabs.Mobile.Sample.app.2.2.0.apk"
```

</TabItem>
<TabItem value="Node.js">

```js
caps = {};
caps['appiumVersion'] = '1.9.1';
caps['deviceName'] = 'Samsung Galaxy S9 Plus FHD GoogleAPI Emulator';
caps['deviceOrientation'] = 'portrait';
caps['browserName'] = '';
caps['platformVersion'] = '8.1';
caps['platformName'] = 'Android';
caps['app'] = 'https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/Android.SauceLabs.Mobile.Sample.app.2.2.0.apk';
```

</TabItem>
<TabItem value="Ruby">

```rb
caps = Selenium::WebDriver::Remote::Capabilities.android()
caps['appiumVersion'] = '1.9.1'
caps['deviceName'] = 'Samsung Galaxy S9 Plus FHD GoogleAPI Emulator'
caps['deviceOrientation'] = 'portrait'
caps['browserName'] = ''
caps['platformVersion'] = '8.1'
caps['platformName'] = 'Android'
caps['app'] = 'https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/Android.SauceLabs.Mobile.Sample.app.2.2.0.apk'
```

</TabItem>
<TabItem value="C#">

```Csharp
DesiredCapabilities caps = new DesiredCapabilities();
    caps.SetCapability("appiumVersion", "1.9.1");
    caps.SetCapability("deviceName", "Samsung Galaxy S9 Plus FHD GoogleAPI Emulator");
    caps.SetCapability("deviceOrientation", "portrait");
    caps.SetCapability("browserName", "");
    caps.SetCapability("platformVersion", "8.1");
    caps.SetCapability("platformName", "Android");
    caps.SetCapability("app", "https://github.com/saucelabs/sample-app-mobile/releases/download/2.2.0/Android.SauceLabs.Mobile.Sample.app.2.2.0.apk");
```

</TabItem>
</Tabs>

<br/>

## Native Apps vs. Hybrid Apps Configuration

<Tabs
  defaultValue="iOS"
  values={[
    {label: 'iOS', value: 'iOS'},
    {label: 'Android', value: 'Android'},
  ]}>

<TabItem value="iOS">

iPhone Native App
```java
DesiredCapabilities caps = DesiredCapabilities.iphone();
caps.setCapability("appiumVersion", "1.9.0");
caps.setCapability("deviceName","iPhone 8");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion","14.3");
caps.setCapability("platformName", "iOS");
caps.setCapability("browserName", "");
caps.setCapability("app","storage:filename=mapp.zip");
```

iPad Native App
```java
DesiredCapabilities caps = DesiredCapabilities.iphone();
  caps.setCapability("appiumVersion", "1.9.0");
  caps.setCapability("deviceName","iPad Retina");
  caps.setCapability("deviceOrientation", "portrait");
  caps.setCapability("platformVersion","14.3");
  caps.setCapability("platformName", "iOS");
  caps.setCapability("browserName", "");
  caps.setCapability("app","storage:filename=myapp.zip");
```

iPhone Hybrid App,
```java
DesiredCapabilities caps = DesiredCapabilities.iphone();
    caps.setCapability("appiumVersion", "1.9.0");
    caps.setCapability("deviceName","iPhone Retina (4-inch 64-bit)");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("platformVersion","7.1");
    caps.setCapability("platformName", "iOS");
    caps.setCapability("browserName", "");
    caps.setCapability("app","storage:filename=myapp.zip");
```

</TabItem>
<TabItem value="Android">

Android Native App, Android version 4.3.

```java
DesiredCapabilities caps = DesiredCapabilities.android();
    caps.setCapability("appiumVersion", "1.9.0");
    caps.setCapability("deviceName","Samsung Galaxy S4 Emulator");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("browserName", "");
    caps.setCapability("platformVersion","4.3");
    caps.setCapability("platformName","Android");
    caps.setCapability("app","storage:filename=myapp.zip");
```

Android Hybrid App, Android version 4.1.

```java
DesiredCapabilities caps = DesiredCapabilities.android();
    caps.setCapability("appiumVersion", "1.9.0");
    caps.setCapability("deviceName","Android Emulator");
    caps.setCapability("deviceType","tablet");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("browserName", "");
    caps.setCapability("platformVersion","4.1");
    caps.setCapability("platformName","Android");
    caps.setCapability("app","storage:filename=myapp.zip");
    caps.setCapability("automationName","Selendroid");
```

</TabItem>
</Tabs>

## Example Appium Test Scripts

These Appium scripts for iOS and Android mobile app tests on emulators and simulators can help streamline your testing process. Below are links to the [Sauce Labs Training on GitHub](https://github.com/saucelabs-training) repository, where you'll find demo scripts for a variety of use cases to get you started with automated Appium testing:

* [Java](https://github.com/saucelabs-training/demo-java/tree/master/appium-examples)
* [JavaScript](https://github.com/saucelabs-training/demo-js)
* [Python](https://github.com/saucelabs-training/demo-python)
* [Ruby](https://github.com/saucelabs-training/demo-ruby/tree/master/appium-examples)
* [C#](https://github.com/saucelabs-training/demo-csharp)

## Additional Resources

Once you've been able to get a test running on Sauce, check out our best practices and available modifications you can make to your tests:

* [Best Practices for Running Tests](https://community.saucelabs.com/search?q=best+practice&search_type=tag).
* [Implement timeouts to control text execution times](https://docs.saucelabs.com/dev/test-configuration-options#virtual-device-capabilities-sauce-specific--optional).
*  [Annotating Tests with the Sauce Labs REST API](https://docs.saucelabs.com/basics/test-config-annotation/test-annotation#sauce-labs-rest-api).
* [Annotating Tests with Selenium's JavaScript Executor](https://docs.saucelabs.com/basics/test-config-annotation/test-annotation#selenium-javascript-executor).
* [Setting Test Status to Pass or Fail](/test-results/test-status).
* [Using Build IDs and tags to differentiate and identify test runs](/basics/test-config-annotation/test-annotation).
* [Create your own test script examples using our Platform Configurator](https://saucelabs.com/platform/platform-configurator#/).
* [Browse our full suite of test configuration options and advanced configurations](/dev/test-configuration-options).

## Training
Lean how to run Appium Android tests on an Emulator in the [Automation Quickstart Course](https://training.saucelabs.com/codelabs/Module2-Quickstart/index.html?index=..%2F..quickstart#0).

repository: mikedon/sauce-docs

repo_name: mikedon/sauce-docs


text:
---
layout:     post
title:      Image Slideshow using ViewPager with PagerAdapter
date:       2016-10-11 12:31:19
summary:    Perhaps you’ve seen some of the new user interface features available as part of the Android compatibility package. One such feature, image slideshow(horizontal view paging), allows for easy left and right swipes to load different screens (pages), controlled by a single Activity. This feature has been showcased in several high profile applications like the Android Market application and the Google+ Android client.
categories: jekyll pixyll
author:     A SAI RAHUL
permalink:  /image-slideshow-using-viewpager-with-pageadapter/
tags:
  - android-tag
---

![desk](https://cdn.rawgit.com/blogofcode/blogofcode.github.io/master/images/image-slideshow-using-viewpager-with-pageadapter/image_slideshow1.gif)

In this we are going to make a beautiful image slideshow using viewpager. For that first we need to setup the `MainActivity` in which you want to include the image slideshow.

### Setting Up ViewPager

Firstly, we need to have a `ViewPager` element in our `MainActivity` file located at `res/layout/content_main.xml`

In `content_main.xml`:
{% highlight xml %}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:id="@+id/relativeLayout">

    <android.support.v4.view.ViewPager
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="150dp">
    </android.support.v4.view.ViewPager>

</RelativeLayout>
{% endhighlight %}

Here I setup height of 150dp, if you want to fill the entire layout, update `android:layout_height="150dp"` to `android:layout_height="match_parent"`.

### Binding PagerAdapter to ViewPager

Next, in our `onCreate()` Activity method, we'll instantiate our custom `PagerAdapter` implementation and bind it to our `ViewPager` object.

In `MainActivity`:
{% highlight java %}
CustomPagerAdapter customPagerAdapter = new CustomPagerAdapter(this, resources);

ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
viewPager.setAdapter(customPagerAdapter);
{% endhighlight %}

### Image Drawable Resources

In our Activity, we'll have a images instance variable that'll have an array of drawable resource IDs.

In `MainActivity`:
{% highlight java %}
int[] resources = {
        R.drawable.one,
        R.drawable.two,
        R.drawable.three,
        R.drawable.four
};
{% endhighlight %}

Before this, I copied images named`one.jpg`, `two.jpg`, `three.jpg`, `four.jpg` to `res/drawable/`. Then I have these images' resource IDs in resources array, each one as `R.drawable.` name of image.

### Custom PagerAdapter

Finally, it's time to write our custom pager adapter implementation that'll populate the content pages within our `ViewPager`.

In `CustomPagerAdapter`:
{% highlight java %}
class CustomPagerAdapter extends PagerAdapter {

    Context context;
    LayoutInflater layoutInflater;
    int[] resources = {};

    public CustomPagerAdapter(Context context, int[] resources) {
        this.context = context;
        this.layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        this.resources = resources;
    }

    @Override
    public int getCount() {
        return resources.length;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == ((LinearLayout) object);
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        View itemView = layoutInflater.inflate(R.layout.pager_item, container, false);

        ImageView imageView = (ImageView) itemView.findViewById(R.id.imageView);
        imageView.setImageResource(resources[position]);

        container.addView(itemView);

        return itemView;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((LinearLayout) object);
    }
}
{% endhighlight %}

* `getCount()` - As name suggests, it returns the number of views available, i.e., number of pages to be displayed/created in the `ViewPager`.
* `instantiateItem()` - Here the page is created for the given `position` passed to it as an argument. We `inflate()` our layout resource(`R.layout.pager_item`) and then set resource for the `ImageView` in it. Finally, the inflated view is added to the container, which is the `ViewPager` and return it.
* `destroyItem()` - This method removes the page from container for the given position passed as `position` paramenter. We simply remove `object` using `removeView()` from the container to which we added in the last `instantiateItem()` method. We could also have used `removeViewAt()` by passing `position` as parameter.
* `isViewFromObject()` - Object returned by `instantiateItem()` is a key. This method checks whether the View/Page pssed to it is associated with that key or not. It is required by `PagerAdapter` to function properly. IN our example, we just compare the two instances and return the evaluated boolean.

### Pager Item

Here's how `res/layout/pager_item.xml` will look like which is inflated in the `CustomPagerAdapter` class.

In `pager_item.xml`:
{% highlight xml %}
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/imageView"
        android:scaleType="fitXY" />
</LinearLayout>
{% endhighlight %}

In this `pager_item.xml`, this is the simplest possible layout we can create. We can also add extra features to the view or the image like adding borders around images or posts(which I will discuss in other poast), adding `layout_margin` in image or post properties and make it beautiful and lookable image slideshow.

Hope you understand.

---


text:
# DSL::Maker

[![Gem Version](https://img.shields.io/gem/v/dsl_maker.svg)](https://rubygems.org/gems/dsl_maker)
[![Gem Downloads](https://img.shields.io/gem/dt/dsl_maker.svg)](https://rubygems.org/gems/dsl_maker)
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/robkinyon/ruby-dsl-maker)

[![Build Status](https://img.shields.io/travis/robkinyon/ruby-dsl-maker.svg)](https://travis-ci.org/robkinyon/ruby-dsl-maker)
[![Code Climate](https://img.shields.io/codeclimate/github/robkinyon/ruby-dsl-maker.svg)](https://codeclimate.com/github/robkinyon/ruby-dsl-maker)
[![Code Coverage](https://img.shields.io/codecov/c/github/robkinyon/ruby-dsl-maker.svg)](https://codecov.io/github/robkinyon/ruby-dsl-maker)
[![Inline docs](http://inch-ci.org/github/robkinyon/ruby-dsl-maker.png)](http://inch-ci.org/github/robkinyon/ruby-dsl-maker)

## TL;DR

```ruby
require 'dsl/maker'

Car = Struct.new(:maker, :engine)
Engine = Struct.new(:is_hemi)
Truck = Struct.new(:maker, :engine, :towing)

class Vehicle::DSL < DSL::Maker
  dsl_engine = generate_dsl({
    :hemi => Boolean,
  }) do
    Engine.new(hemi)
  end

  add_entrypoint(:car, {
    :maker => String,
    :engine => dsl_engine,
  }) do |*args|
    default(maker, args, 0)
    Car.new(maker, engine)
  end

  add_entrypoint(:truck, {
    :maker => String,
    :towing => Integer,
    :engine => dsl_engine,
  }) do |*args|
    default(maker, args, 0)
    Truck.new(maker, engine, towing)
  end

  add_verification(:car) do |item|
    return "Cars need engines" unless item.engine
  end
  add_verification(:truck) do |item|
    return "Trucks need engines" unless item.engine
    return "Trucks aren't wimps" unless item.towing > 1000
  end
end
```

Then, use it as so:

```ruby
#!/usr/bin/env ruby

require 'vehicle/dsl'

filename = ARGV.shift || raise 'No filename provided.'

# This raises the error
vehicles = Vehicle::DSL.parse_dsl(
  IO.read(filename),
)
```

with a file that could look like:

```ruby
car do
  make 'Honda Civic'
  engine {
    hemi no
  }
end

truck 'Ford F-150' do
  engine {
    hemi On
  }
end
```

## Rationale

Writing single-level Ruby-like DSLs is really easy. Ruby practically builds them
for you with a little meta-programming. [Docile](https://github.com/ms-ati/docile)
makes it ridiculously easy and there are nearly a dozen other modules to do so.

Unfortunately, writing multi-level DSLs becomes repetitive and overly complex.
Which is dumb. Multi-level DSLs are where the sweetness lives. We write DSLs in
order to make things simpler for ourselves, particularly when we want to have
less-experienced individuals able to make changes because they have the business
or domain knowledge. Limiting everything to single-level DSLs makes no sense.

`DSL::Maker` provides a quasi-DSL-like structure that allows you to easily build
multi-level DSLs and handle the output.

## Usage

### Single-level DSLs

In its documentation, [Docile](https://github.com/ms-ati/docile) has a DSL that
builds pizza. An example would look like:

```ruby
@sauce_level = :extra

pizza do
  cheese
  pepperoni
  sauce @sauce_level
end
#=> #<Pizza:0x00001009dc398 @cheese=true, @pepperoni=true, @bacon=false, @sauce=:extra>
```

The PizzaBuilder code (via Docile) looks like:

```ruby
Pizza = Struct.new(:cheese, :pepperoni, :bacon, :sauce)

class PizzaBuilder
  def cheese(v=true); @cheese = v; self; end
  def pepperoni(v=true); @pepperoni = v; self; end
  def bacon(v=true); @bacon = v; self; end
  def sauce(v=nil); @sauce = v; self; end
  def build
    Pizza.new(!!@cheese, !!@pepperoni, !!@bacon, @sauce)
  end
end
```

But, this doesn't actually implement the DSL. That is left for another snippet:

``` ruby
def pizza(&block)
  Docile.dsl_eval(PizzaBuilder.new, &block).build
end
```

And it's not quite clear where to actually put this code so that you can ship this
DSL like Chef or Sinatra.

You would implement the same DSL using DSL::Maker as so:

```ruby
class PizzaBuilder < DSL::Maker
  add_entrypoint(:pizza, {
    :cheese => Boolean,
    :pepperoni => Boolean,
    :bacon => Boolean,
    :sauce => String,
  }) do
    Pizza.new(cheese, pepperoni, bacon, sauce)
  end
end

pizzas = PizzaBuilder.parse_dsl("
  pizza {
    cheese yes
    pepperoni Yes
    bacon On
    sauce 'extra'
  }
")
```

Now, you accept the strings (possibly from `IO.read()`) and magically get the
result of your DSL.

(The PizzaBuilder is used in the test suite in `spec/single_level_spec.rb`.)

### Multi-level DSLs

So far, this isn't that impressive - slightly better type coercion and a method
for handling the parsing of a string isn't much to crow about.

```ruby
Person = Struct.new(:name, :mother, :father)

class FamilyTree < DSL::Maker
  add_entrypoint(:person, {
    :name => String,
    :mother => generate_dsl({
      :name => String,
    }) do
      Person.new(name, nil, nil)
    end,
    :father => generate_dsl({
      :name => String,
    }) do
      Person.new(name, nil, nil)
    end,
  }) do
    Person.new(name, mother, father)
  end
end

people = FamilyTree.parse_dsl("
  person {
    name 'John Smith'
    mother {
      name 'Mary Smith'
    }
    father {
      name 'Tom Smith'
    }
  }
")
john_smith = people[0]
```

Pretty easy. We can even refactor that a bit and end up with:

```ruby
class FamilyTree < DSL::Maker
  parent = generate_dsl({
    :name => String,
  }) do
    Person.new(name)
  end

  add_entrypoint(:person, {
    :name => String,
    :mother => parent,
    :father => parent,
  }) do
    Person.new(name, mother, father)
  end
end
```

There's no limit to the number of levels you can go define.

### Handling Arguments

We can improve the family tree DSL a bit by handling arguments. An example works
best to explain.

```ruby
Person = Struct.new(:name, :age, :mother, :father)
class FamilyTreeDSL < DSL::Maker
  parent = generate_dsl({
    :name => String,
    :age  => String,
  }) do |*args|
    default(:name, args)
    Person.new(name, age)
  end

  add_entrypoint(:person, {
    :name => String,
    :age  => String,
    :mother => parent,
    :father => parent,
  }) do |*args|
    default('name', args, 0)
    Person.new(name, age, mother, father)
  end
end

people = FamilyTreeDSL.parse_dsl("
  person 'John Smith' do
    age 20
    mother 'Mary Smith' do
      age 50
    end
    father {
      name 'Tom Smith'
      age 49
    }
  end
")
john_smith = people[0]
```

The result is exactly the same as before.

### Recursive DSLs

We're making an artificial distinction between `person` and `parent` in the
`FamilyTreeDSL` example above. Really, we want to say "A person can have a mother
and a father and those are also persons." So, let's say that.

```ruby
Person = Struct.new(:name, :age, :mother, :father)

class FamilyTreeDSL < DSL::Maker
  person_dsl = add_entrypoint(:person, {
    :name => String,
    :age  => String,
  }) do |*args|
    default(:name, args)
    Person.new(name, age mother, father)
  end

  build_dsl_element(person_dsl, :mother, person_dsl)
  build_dsl_element(person_dsl, :father, person_dsl)
end
```

Now, we can handle an arbitrarily-deep family tree. This is the DSL used in the
multi-level spec tests.

### Handling multiple items

You'll note we've been receiving an Array from `parse_dsl()`. This is because
DSL::Maker automagically handles files with multiple entries. Chef's recipe files
have many entries of different types in them. It doesn't do you any good if you
can't do the same thing.

```ruby
Car = Struct.new(:make, :model)
Truck = Struct.new(:make, :model)

class VehicleDSL < DSL::Maker
  add_entrypoint(:car, {
    :make => String,
    :model => String,
  }) {
    Car.new(make, model)
  }

  add_entrypoint(:truck, {
    :make => String,
    :model => String,
  }) {
    Truck.new(make, model)
  }
end

vehicles = VehicleDSL.parse_dsl("
  car {
    make 'Honda'
    model 'Civic'
  }

  truck {
    make 'Ford'
    model 'F150'
  }
")
```

`vehicles` is an `Array` with a `Car` and a `Truck` in it, in that order. If your
DSL snippet has only one item, you get back an Array with just that item. If it
has multiple items, you get back an `Array` with everything in the right order.

## API

### Class Methods

DSL::Maker provides seven class methods - five for constructing your DSL and two
for parsing your DSL.

* `add_entrypoint(Symbol, Hash={}, Block)`

This is used in defining your DSL class to create an entrypoint - the highest
level of your DSL. `add_entrypoint()` will create the right class methods for
Docile to use when `parse_dsl()` is called. It will also invoke `generate_dsl()`
with the Hash you give it to create the parsing.

* `entrypoint(Symbol)`

This returns the DSL defined by a previous call to `add_entrypoint()`.

This is primarily useful if you want to take a DSL class and use it within another
DSL class.

* `generate_dsl(Hash={}, Block)`

This is used in defining your DSL to describe the innards - the guts that actually
have meaning. Once this level has been completed, the Block will be called and the
return value provided back to the name.

* `build_dsl_element(Class, String, Type)`

This is normally called by `generate_dsl()` to actually construct the DSL element.
It is provided for you so that you can create recursive DSL definitions. Look at
the tests in `spec/multi_level_spec.rb` for an example of this.

* `add_type(Object, Block)`

This is used to create type coercions that are used when defining your DSL. These
are treated at the same level as the default type coercions described below.

This creates global type coercions that are available to every DSL definition.

* `add_helper(Symbol, Block)`

This is used to create helper methods (similar to `default`, described below) that
are used within the DSL.

This creates global helpers that are available at every level of your DSLs.

* `parse_dsl(String)` / `execute_dsl(&block)`

You call this on your DSL class when you're ready to invoke your DSL. It will
return an array containing whatever the block provided to `add_entrypoint()`
returns.

It returns an array for the case of multiple DSL entrypoints (for example, a
normal Chef recipe). The array will contain the values in the order they were
encountered.

### Type Coercions

There are five pre-defined standard type coercions available for `generate_dsl()`:

  Standard coercions:
    * Any - This takes whatever you give it and returns it back.
    * String - This takes whatever you give it and returns the string within it.
    * Integer - This takes whatever you give it and returns the integer within it.
    * Boolean - This takes whatever you give it and returns the truthiness of it.
    * Hash - This takes a block and returns a Hash of the method calls.

You can add additional standard type coercions using `add_type()` as described
above.

There are also three special type coercions that are not creatable with
`add_type()` because they do special manipulations within DSL::Maker.

  Special coercions:
    * `generate_dsl()` - This descends into another level of DSL.
    * ArrayOf[<type>] - This creates an array coerced as the <type>. Successive
      invocations are concatenated. <type> can be a DSL.
    * AliasOf(<name>) - this creates an additional name that is synonomous with
      the <name> item. You can use either this name or <name>.

These are special-cased within `build_dsl_element()`.

### Helpers

There is one pre-defined helper.

  * `default(String, Array, Integer=0)`

This takes a method name and the args provided to the block. It then ensures that
the method defaults to the value in the args at the optional third argument.

You can add additional helpers using `add_helper()` as described above.

## Installation

``` bash
$ gem install dsl_maker
```

## TODO

* Add support for generating useful errors (ideally with line numbers ... ?)
* Add support for auto-generating documentation
* Add default block that returns a Struct-of-Structs named after entrypoints
* Add example of binary to execute a DSL
* DSL for DSL construction
* Add "include" helper that loads another file and continues the execution
   * Should provide useful directory searching

## Links

* [Source](https://github.com/robkinyon/ruby-dsl-maker)
* [Documentation](http://rubydoc.info/gems/ruby-dsl-maker)
* [Bug Tracker](https://github.com/robkinyon/ruby-dsl-maker/issues)

## Status

Works on [all ruby versions since 1.9.3](https://github.com/robkinyon/ruby-dsl-maker/blob/master/.travis.yml), or so Travis CI [tells us](https://travis-ci.org/robkinyon/ruby-dsl-maker).

## Note on Patches/Pull Requests

  * Fork the project on GitHub.
  * Setup your development environment with:
      `gem install bundler; bundle install`
  * Make your feature addition or bug fix in a branch.
    * I will only accept PRs from branches, never master.
  * Add tests for it. This is important so I don't break it in a future version
      unintentionally. Plus, I maintain 100% code coverage.
  * Commit.
  * Send me a pull request.
    * I will only accept PRs from branches, never master.

## Copyright & License

Copyright (c) 2015 Rob Kinyon

repository: robkinyon/ruby-dsl-maker

repo_name: robkinyon/ruby-dsl-maker


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]

PenPost

    Real people, real postcards, real connections. PenPost allows you to send a PostCard to a friend with a click of a button. Snap an image, write a note, and we'll do all the work.

    Explore the docs »

    View Demo
    ·
    Report Bug
    ·
    Request Feature

Table of Contents

      About The Project

Built With

      Getting Started

Prerequisites

Installation

Usage

Roadmap

Contributing

License

Contact

Acknowledgements

## About The Project

This is the backend component of the PenPost service-oriented architecture. The React+Apollo front-end communicates with this back-end via an API. This repository utilizes GraphQL to expose that API to meet the front-end requirements.

### Built With

* [Circle CI](https://circleci.com/)
* [Github Projects](https://github.com/aetzion1/tweeter/projects/1)
* [GraphQL](https://graphql.org/)
* [Heroku](https://heroku.com/)
* [PostgreSQL](https://www.postgresql.org/)
* [Postman](https://www.postman.com/)
* [RSpec](https://github.com/rspec/rspec-rails)
* [Ruby on Rails](https://rubyonrails.org/)

## Getting Started

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

### Prerequisites

1. Ensure you have Ruby/Rails installed and set up
2. Ensure you have PostgreSQL installed

### Installation

1. Fork the repository and clone the repo
  ```sh
  git clone https://github.com/<USERNAME>/penpost-api.git
  ```
2. Run bundle install
  ```sh
   bundle install
   ```
3. Set up the databases
  ```sh
   rails db:{create,migrate}
   ```

## Usage

Users are able to log into their accounts and access their dashboard.

The dashboard will display a user's information (address, description) and allow them to edit this info.

The dashboard will also display the user's current PenPal's name and city - and an option to end the realtionship. If the user has no active PenPal there will be a button to create one!

The user can draft a postcard directly on the web app - and is able to preview the postcard prior to sending.

## Roadmap

 The app was developed with the help of a 5-person team, over the course of 10 days. The team began with an initial product brainstorm and wireframes.

Development was managed via a kandban-style [Github project board](https://github.com/orgs/penpost/projects/1).

Postman was utilized to test teh various graphql requests and responses. You can import the vairous calls [here](app/assets/resources/postman.json).

See the [open issues](https://github.com/penpost/penpost-api/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 contributions 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

Adam Etzion - [GitHub](https://github.com/aetzion1) [LinkedIn](https://www.linkedin.com/in/adametzion/)

Gabrielle - [GitHub]() [LinkedIn]()

Jeff - [GitHub]() [LinkedIn]()

Kelsie - [GitHub]() [LinkedIn]()

Yesi Meza - [GitHub](https://github.com/Yesi-MC) [LinkedIn](https://www.linkedin.com/in/yesimeza/)

Project Repository Link: [https://github.com/penpost/penpost-api](https://github.com/penpost/penpost-api)

## Acknowledgements

* [Img Shields](https://shields.io)
* [Pexels](https://www.pexels.com/) for above image
* [Miro](https://www.miro.com/) for whiteboard tools

[contributors-shield]: https://img.shields.io/github/contributors/penpost/penpost-api.svg?style=for-the-badge
[contributors-url]: https://github.com/penpost/penpost-api/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/penpost/penpost-api.svg?style=for-the-badge
[forks-url]: https://github.com/penpost/penpost-api/network/members
[stars-shield]: https://img.shields.io/github/stars/penpost/penpost-api.svg?style=for-the-badge
[stars-url]: https://github.com/penpost/penpost-api/stargazers
[issues-shield]: https://img.shields.io/github/issues/penpost/penpost-api.svg?style=for-the-badge
[issues-url]: https://github.com/penpost/penpost-api/issues
[license-shield]: https://img.shields.io/github/license/penpost/penpost-api.svg?style=for-the-badge
[license-url]: https://github.com/penpost/penpost-api/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/adametzion

repository: penpost/penpost-api

gha_language: Ruby

repo_name: penpost/penpost-api


text:
# docker-makefile

## What is Make?
Make is a small utility that will follow rules to compile and link programs from source. It is available on most Linux and Unix distributions (including Mac OS X) and is almost a necessity when working on large projects.
The make command, when invoked will read rules from a makefile and build your code using those rules.https://www.gnu.org/software/make/

## What is a Makefile?
A makefile is a simple text file with rules in it describing how to compile and link your program. A makefile can be extremely simple or very complex, depending on the project. For the things you do at school they will be fairly simple.

## Pre-requirements

**Linux OS and Mac OS X:**

To use a makefile to compile your input files, make sure that /usr/bin and /usr/local/bin are in your path.

Then you can compile as:

`$ make -f makefile`

where -f is the make command option to specify a particular makefile.

**Windows OS:**

To use a makefile to compile your input files, use the nmake command.

## Usage

`$ make help` for Help.

repository: rakauchuk/docker-makefile

repo_name: rakauchuk/docker-makefile


text:
---
layout: post
title: How to fool Windows and clean your C drive without deleting anything. Without Admin access.
---

If you are a Windows user, changes are you have had run out of space in C drive, at one point or another. This tutorial will help you clean-up C drive using directory links aka [NTFS junction point](https://en.wikipedia.org/wiki/NTFS_junction_point).

>This lets Windows and all other programs believe that the specified directory exists but actually it's just a pointer to the new path, which can also be on another drive.

It's like a shortcut but better.

## Steps
Without further ado, let's see the code.
1. Cut the folder which is taking up space. e.g.
````
C:\Satish\Some Folder
````
2. Paste it in another drive. e.g.
````
D:\Can be another Folder
````
3. Run following command in Command Prompt
````
mklink /J "C:\Satish\Some Folder" "D:\Can be another Folder"
````

This will create a directory junction which points to the new path.

Now when you navigate to ````C:\Satish\Some Folder````, it will actually show contents of ````D:\Can be another Folder````, but Windows and other programs will be oblivious about that.

## Limitations
Neither the Windows NT startup process nor the Windows Vista startup process support Junction points, so it's impossible to redirect certain system folders:

* folder containing ````hiberfil.sys```` (if it's configured to be outside root directory)
* ````\Windows````
* ````\Windows\System32````
* ````\Windows\Config````

However it is possible to redirect non-critical folders:

  * ````\Users````
  * ````\Documents and Settings````
  * ````\Program Files````
  * ````\Program Files (x86)````

## Warning

* Creating junctions for ````\Users```` and ````\ProgramData```` pointing to another drive is not recommended as it breaks updates and Windows Store Apps.[[1]]

* Creating junctions for ````\Users````, ````\ProgramData````, ````"\Program Files"```` or ````"\Program Files (x86)"```` pointing to other locations breaks installation resp. upgrade of Windows.[[2]]

* Creating junctions for ````"\Program Files"```` or ````"\Program Files (x86)"```` pointing to another drive breaks Windows' Component Based Servicing which hardlinks files from its repository ````\Windows\SxS```` to their installation directory.

[1]: https://support.microsoft.com/en-us/help/949977/relocation-of-the-users-directory-and-the-programdata-directory-to-a-d
[2]: https://support.microsoft.com/en-us/help/2876597/error-installing-windows-because-users-or-program-files-folder-redirec

gha_language: SCSS


text:
<!DOCTYPE html>

	<title>more-schemas</title>

Reflect

What is one-to-one Relationship

one-to-one relationships is a database is used when one thing in a one data table hs a releationship with another data table

When would you use a one-to-one database? (Think generally, not in terms of the example you created).

You would use it when ever you have information that can be organized in a data tabke

What is a many-to-many database?

many_to_many databases is where values from both tables can be related to each other in multiple different ways.

When would you use a many-to-many database? (Think generally, not in terms of the example you created).

 You would use a many to many database when many attributes from one table can be correlated with many attributes from another table.

What is confusing about database schemas? What makes sense?

Nothing is confusing about databases schemas but the only problem that i would have is thinking what I should name the tables

gha_language: HTML


text:
---
layout: post
title:  "JAXB and DeCapitalize"
description: java jaxb capitalize
date:   2020-09-24 00:10:00 +0530
categories: java jaxb
---

Recently, i need call another services with XML. And, using JAXB, i had the following problem:

The class name it's decapitalize. I will explain

```
public class MyClass
```

And, in XML:

```
    <myClass></myClass>
```

For me, it's a problem. And the detail it's, when your class it's not a root element, the JAXB decapitalize the name of element.
To solve this, just:

```
    @XmlElementRoot
    public class MyClass
```

Now, in the XML:

```
    <MyClass></MyClass>
```

and that's all folks!

If you have any doubts, problems or suggestions, just leave a message.

extension: markdown

gha_language: CSS


text:
---
title: Going to the Well
---

The following article written in 1984 is reproduced by kind permission of Yvonne Gilbert.

Pensilva almost 40 years ago - Going to the Well

![Going to the Well](./going-to-the-well/Yvonne_s_Articles_002.jpg)

Did you ever taste the water from the well in St. Ive Road? On the hottest summer day it was icy cold, and it had a delicious flavour better than any spring water I have ever tasted. When the mains water came, we were told the well water was unfit for human consumption. Yet healthy generations were reared on it. I'd fetch a jug of it for drinking if I could.

We used to carry several buckets of this sparkling wine each day. The pump was painted dark green, and it had a smooth iron handle. The water used to gush out of the spout and splash into the granite trough as my father pumped.

Twice a day we watered the cows at the red brick trough on the opposite side of the road. The cows used to stroll along (there were few cars or motor bikes in those days); my father turned a shiny brass handle above the spout. This diverted the water through a pipe under the road to the trough. He would pump furiously. The cows would drink until they were satisfied, and then continue their leisurely progress to the fields. This was fun in good weather, but, when it rained, we got very wet. There was no picturesque roof in those days.

Over forty households used the pump and its custodian was Mr. M. Body, the Postmaster. He was a tall, distinguished gentleman. He loved cricket and could always tell you the latest test score. One day he came to see me, "Are your mother and father away?" he enquired.
"Yes they've gone to London Airport to collect a friend, but they'll be home tonight"
"No they won't", he said, "the plane's been delayed for twenty four hours. Here's the telegram".

I never forgot his kindness. He bothered to come himself instead of sending the telegram boy. He knew telegrams usually signalled death or injury, and how frightened and worried I should have been before I opened it.

He collected the shilling (5p) per household per year which was paid for the use of the pump and its upkeep. My father paid two shillings (10p) for watering the cattle as well.

Mr. Frank Eva also paid this. He was a wonderful character. When my mother wished the mains water would come he said, "Don't wish for that. You'll have to pay a mint for it". How right he was!


text:
# Extended Kalman Filter Project
Self-Driving Car Engineer Nanodegree Program

[image1]: ./results/dataset1.png "Dataset 1 result"
[image2]: ./results/dataset2.png "Dataset 2 result"

## Main files
* README.md: Project Report
* src/FusionEKF.h(.cpp)
* src/kalman_filter.h(.cpp)
* src/tools.h(.cpp)
* And other source code files
* ProjectDescription.md: it was the README.md for the project provided by Udacity.

In this project, a kalman filter was used to estimate the state of a moving object of interest with noisy lidar and radar measurements.

This project involves a Simulator which can be downloaded [here](https://github.com/udacity/self-driving-car-sim/releases).

This repository includes two files that can be used to set up and install [uWebSocketIO](https://github.com/uWebSockets/uWebSockets) for either Linux or Mac systems. For windows you can use either Docker, VMware, or even [Windows 10 Bash on Ubuntu](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) to install uWebSocketIO. Please see the uWebSocketIO Starter Guide page in the classroom within the EKF Project lesson for the required version and installation scripts.

Once the install for uWebSocketIO is complete, the main program can be built and run by doing the following from the project top directory.

1. mkdir build
2. cd build
3. cmake ..
4. make
5. ./ExtendedKF

Here is the main protocol that main.cpp uses for uWebSocketIO in communicating with the simulator.

**INPUT**: values provided by the simulator to the c++ program

["sensor_measurement"] => the measurement that the simulator observed (either lidar or radar)

**OUTPUT**: values provided by the c++ program to the simulator

["estimate_x"] <= kalman filter estimated position x

["estimate_y"] <= kalman filter estimated position y

["rmse_x"]

["rmse_y"]

["rmse_vx"]

["rmse_vy"]

---

## Other Important Dependencies

* cmake >= 3.5
  * All OSes: [click here for installation instructions](https://cmake.org/install/)
* make >= 4.1 (Linux, Mac), 3.81 (Windows)
  * Linux: make is installed by default on most Linux distros
  * Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
  * Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
* gcc/g++ >= 5.4
  * Linux: gcc / g++ is installed by default on most Linux distros
  * Mac: same deal as make - [install Xcode command line tools](https://developer.apple.com/xcode/features/)
  * Windows: recommend using [MinGW](http://www.mingw.org/)

## Basic Build Instructions

1. Clone this repo.
2. Make a build directory: `mkdir build && cd build`
3. Compile: `cmake .. && make`
   * On windows, you may need to run: `cmake .. -G "Unix Makefiles" && make`
4. Run it: `./ExtendedKF `

## Code Style

Try to stick to [Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).

## Result
The RMSEs for X, Y, VX, VY are less than the required values [.11, .11, 0.52, 0.52].
![alt text][image1]
![alt text][image2]


text:
---
layout: default
---

# 1995-07-13 - Re: Anti-Electronic Racketeering Act of 1995 (fwd)

## Header Data

From<EMAIL_ADDRESS>(Marshall Clow)

To<EMAIL_ADDRESS>Message Hash: ee695af731ce10fbbe45cc6ea7e20518955c014a0f5cdd457b0df06de64fcfd4

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-07-13 17:25:40 UTC

Raw Date: Thu, 13 Jul 95 10:25:40 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Marshall Clow)
Date: Thu, 13 Jul 95 10:25:40 PDT
To<EMAIL_ADDRESS>Subject: Re: Anti-Electronic Racketeering Act of 1995 (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>    "Sec. 1030A.  Racketeering-related crimes involving computers
>      "(a) It shall be unlawful--
>   . . .
>         "(2) to distribute computer software that encodes or encrypts
>       electronic or digital communications to computer networks that the
>       person distributing knows, or reasonably should know, is accessible to
>       foreign nationals and foreign governments, regardless of whether such
>       software has been designated nonexportable."
>
So much for compression software, too. :-(
Pst! Anyone want a copy of gzip? PKZip? Drop*Stuff?

-- Marshall

Marshall Clow
Aladdin Systems
<EMAIL_ADDRESS>Warning: Objects in calendar are closer than they appear.

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Marshall Clow)](/authors/mclow_at_coyote_csusm_edu_marshall_clow_)"
+ Return to "["Rev. Ben" <samman@CS.YALE.EDU>](/authors/rev_ben_samman_at_cs_yale_edu_)"

+ 1995-07-13 (Thu, 13 Jul 95 10:25:40 PDT) - Re: Anti-Electronic Racketeering Act of 1995 (fwd) -<EMAIL_ADDRESS>(Marshall Clow)_
  + 1995-07-13 (Thu, 13 Jul 95 10:42:31 PDT) - [Re: Anti-Electronic Racketeering Act of 1995 (fwd)](/archive/1995/07/0e0fbdf4a3872e8f1eb044ba53cf3f4c5104c5fa4313eb57b4fdd83711bde0a3) - _"Rev. Ben"<EMAIL_ADDRESS>