text:
    <material-whiteframe class="material-whiteframe-z1 emdp-alertlist" layout="vertical" layout-sm="vertical">
        <material-list class="emdp-alertlist-list">
            <material-item ng-repeat="item in data.myevents " class="emdp-myevent-item">
                <material-item-content layout="vertical" layout-sm="horizontal">

{{item.NombreEvento}}

{{item.DescripcionEvento}}

{{item.fecha}}

{{item.DetalleTexto}}

                        <material-button
                            class="material-button-fab emdp-fab emdp-fab-delete"
                            aria-label="Delete"
                            ng-click="methods.delete(item)">
                            <material-icon icon="img/svg/close_wht.svg" style="width: 24px; height: 24px;"></material-icon>
                            <material-tooltip>Eliminar</material-tooltip>
                        </material-button>
                        <material-button
                                class="material-button-fab emdp-fab emdp-fab-profile"
                                aria-label="New document"
                                ng-click="methods.getEvent(item)">
                            <material-icon icon="img/svg/arrow-right_wht.svg" style="width: 24px; height: 24px;"></material-icon>
                            <material-tooltip>Editar</material-tooltip>
                        </material-button>

                </material-item-content>
                <material-divider class="emdp-divider" ng-hide="$last"></material-divider>
            </material-item>
        </material-list>
    </material-whiteframe>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>{{page.title}} · Spotnik Street Wear</title>
  <meta name="description" content="{{page.meta}}">
  <meta name="handheldfriendly" content="true">
  <meta name="mobileoptimized" content="240">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <link href='http://fonts.googleapis.com/css?family=ABeeZee|Advent+Pro' rel='stylesheet' type='text/css'>
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
	<link rel="icon" href="/favicon.ico" type="image/x-icon">
  <link rel="stylesheet" href="{{site.baseurl}}/css/spotnik.css">

						<form method="get" action="{{site.baseurl}}/search/" class="search-box " role="search">
						Search on page
							<input type="search" id="search"
							name="search" placeholder="search">
							<button type="submit">

							</button>
							</form>

							Home

							About

							Products

		{% if page.showbanner %}

{{page.bannertext}}

		{% endif %}

			{{content}}

Pages

Home

About

Products

Categories

Accessories

Bottoms

Outer Wear

Footwear

Tops

Get in touch

Facebook

Twitter

Instagram

 © 2014 Spotnik Street Wear

redpajama_set_name: RedPajamaGithub


text:
package com.rarchives.ripme.ripper.rippers;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jsoup.HttpStatusException;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import com.rarchives.ripme.ripper.AlbumRipper;
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
import com.rarchives.ripme.utils.Http;
import org.jsoup.select.Elements;

public class FineboxRipper extends AlbumRipper {

    private static final String DOMAIN = "finebox.co",
                                DOMAIN_OLD = "vinebox.co",
                                HOST = "finebox";

    public FineboxRipper(URL url) throws IOException {
        super(url);
    }

    @Override
    public boolean canRip(URL url) {
        return url.getHost().endsWith(DOMAIN) || url.getHost().endsWith(DOMAIN_OLD);
    }

    @Override
    public URL sanitizeURL(URL url) throws MalformedURLException {
        return new URL("http://"+DOMAIN+"/u/" + getGID(url));
    }

    @Override
    public void rip() throws IOException {
        int page = 0;
        Document doc;
        Boolean hasPagesLeft = true;
        while (hasPagesLeft) {
            page++;
            String urlPaged = this.url.toExternalForm() + "?page=" + page;
            logger.info("Retrieving " + urlPaged);
            sendUpdate(STATUS.LOADING_RESOURCE, urlPaged);
            try {
                doc = Http.url(this.url).get();
            } catch (HttpStatusException e) {
                logger.debug("Hit end of pages at page " + page, e);
                break;
            }
            Elements videos = doc.select("video");
            for (Element element : videos) {
                String videourl = element.select("source").attr("src");
                if (!videourl.startsWith("http")) {
                    videourl = "http://" + DOMAIN + videourl;
                }
                logger.info("URL to download: " + videourl);
                if (!addURLToDownload(new URL(videourl))) {
                   hasPagesLeft = false;
                   break;
                }
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                logger.error("[!] Interrupted while waiting to load next page", e);
                break;
            }
        }
        waitForThreads();
    }

    @Override
    public String getHost() {
        return HOST;
    }

    @Override
    public String getGID(URL url) throws MalformedURLException {
        Pattern p = Pattern.compile("^https?://(www\\.)?(v|f)inebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
        Matcher m = p.matcher(url.toExternalForm());
        if (!m.matches()) {
            throw new MalformedURLException("Expected format: http://"+DOMAIN+"/u/USERNAME");
        }
        return m.group(m.groupCount());
    }

}


text:
$:.unshift(File.expand_path("../../../samples", __FILE__))

require 'aws_iot_device'
require 'config_shadow'

filter_callback = Proc.new do |message|
  puts "Executing the specific callback for topic: #{message.topic}\n##########################################\n"
end

mqtt_client = setting_mqtt_client
client = setting_action_manager(mqtt_client)

client.register_shadow_delta_callback(filter_callback)
timeout = 5

n = 1
5.times do
  json_payload = "{\"state\":{\"desired\":{\"property\":\"RubySDK\",\"count\":#{n}}}}"
  client.shadow_update(json_payload, timeout, filter_callback)
  n += 1
end

sleep timeout

mqtt_client.disconnect


text:
package org.camelcookbook.extend.produce;

public interface ProxyPojo {
    String sayHello(String name);
}


text:
<?php

require __DIR__ . '/../vendor/autoload.php';

$data = json_decode(file_get_contents('data.json'));

// Validate
$validator = new JsonSchema\Validator();
$validator->check($data, (object) array('$ref' => 'file://' . realpath('schema.json')));

if ($validator->isValid()) {
    echo "The supplied JSON validates against the schema.\n";
} else {
    echo "JSON does not validate. Violations:\n";
    foreach ($validator->getErrors() as $error) {
        echo sprintf("[%s] %s\n", $error['property'], $error['message']);
    }
}


text:
#ifndef Print_h
#define Print_h

#include <inttypes.h>
#include <stdio.h> // for size_t

#include "WString.h"
#include "Printable.h"

#define DEC 10
#define HEX 16
#define OCT 8
#define BIN 2

class Print
{
  private:
    int write_error;
    size_t printNumber(unsigned long, uint8_t);
    size_t printFloat(double, uint8_t);
  protected:
    void setWriteError(int err = 1) { write_error = err; }
  public:
    Print() : write_error(0) {}

    int getWriteError() { return write_error; }
    void clearWriteError() { setWriteError(0); }

    virtual size_t write(uint8_t) = 0;
    size_t write(const char *str) {
      if (str == NULL) return 0;
      return write((const uint8_t *)str, strlen(str));
    }
    virtual size_t write(const uint8_t *buffer, size_t size);
    size_t write(const char *buffer, size_t size) {
      return write((const uint8_t *)buffer, size);
    }

    size_t print(const __FlashStringHelper *);
    size_t print(const String &);
    size_t print(const char[]);
    size_t print(char);
    size_t print(unsigned char, int = DEC);
    size_t print(int, int = DEC);
    size_t print(unsigned int, int = DEC);
    size_t print(long, int = DEC);
    size_t print(unsigned long, int = DEC);
    size_t print(double, int = 2);
    size_t print(const Printable&);

    size_t println(const __FlashStringHelper *);
    size_t println(const String &s);
    size_t println(const char[]);
    size_t println(char);
    size_t println(unsigned char, int = DEC);
    size_t println(int, int = DEC);
    size_t println(unsigned int, int = DEC);
    size_t println(long, int = DEC);
    size_t println(unsigned long, int = DEC);
    size_t println(double, int = 2);
    size_t println(const Printable&);
    size_t println(void);

	#include <stdarg.h>
#define PRINTF_BUF 80 // define the tmp buffer size (change if desired)
   void printf(const char *format, ...)
   {
   char buf[PRINTF_BUF];
   va_list ap;
        va_start(ap, format);
        vsnprintf(buf, sizeof(buf), format, ap);
        for(char *p = &buf[0]; *p; p++) // emulate cooked mode for newlines
        {
                if(*p == '\n')
                        write('\r');
                write(*p);
        }
        va_end(ap);
   }
#ifdef F // check to see if F() macro is available
   void printf(const __FlashStringHelper *format, ...)
   {
   char buf[PRINTF_BUF];
   va_list ap;
        va_start(ap, format);
#ifdef __AVR__
        vsnprintf_P(buf, sizeof(buf), (const char *)format, ap); // progmem for AVR
#else
        vsnprintf(buf, sizeof(buf), (const char *)format, ap); // for the rest of the world
#endif
        for(char *p = &buf[0]; *p; p++) // emulate cooked mode for newlines
        {
                if(*p == '\n')
                        write('\r');
                write(*p);
        }
        va_end(ap);
   }
#endif
};

#endif


text:
English / [日本語](../help-ja/features.md)

# Features

[Stylesheet](#stylesheet) |
[JavaScript](#javascript) |
[Web performance](#web-performance) |
[Automation](#automation) |
[Development server](#development-server)

## Stylesheet
### Sass
**[Sass](http://sass-lang.com/)** is a CSS extension lauguage for creating stylesheets more efficiently.
Sass was originally written in Ruby, however you don't need to install Ruby because rff-gulp uses [LibSass](http://sass-lang.com/libsass) which is a portable engine for Sass.

- [Sass basics](http://sass-lang.com/guide)
- [Sass documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html)

### stylelint
**[stylelint](http://stylelint.io/)** is a modern CSS linter that helps you enforce consistent conventions and avoid errors in your stylesheets.
Stylelint supports "shareable config" and rff-gulp adopts **[stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard)** as the default rules.

- [Stylelint rules](http://stylelint.io/user-guide/rules/)

### Autoprefixer
**[Autoprefixer](https://github.com/postcss/autoprefixer)** parses CSS and adds vendor prefixes to CSS rules using values from [Can I Use](http://caniuse.com/).
Now no need to worry about vendor prefixes: `-webkit-*`, `-moz-*` and `-ms-*`.

## JavaScript
### ESLint
**[ESLint](http://eslint.org/)** is a pluggable linting utility for JavaScript and JSX.
ESLint also [supports shareable config](http://eslint.org/docs/developer-guide/shareable-configs) and rff-gulp uses rules based on **[eslint-config-xo-space](https://github.com/sindresorhus/eslint-config-xo-space)** by default.

- [ESLint rules](http://eslint.org/docs/rules/)

### Browserify
**[Browserify](http://browserify.org/)** lets you `require('modules')` in the browser by bundling up all of your dependencies.
This enables you to modularize your scripts and also install libraries from [npm](https://www.npmjs.com/) smoothly.

## Web performance
### HTML/CSS/JS minification
HTML/CSS/JS files will be automatically minified and optimized for production by the build task.
rff-gulp uses **[html-minifier](https://github.com/kangax/html-minifier)**, **[cssnano](http://cssnano.co/)** and **[UglifyJS](http://lisperator.net/uglifyjs/)** for the minifier.

- [Disable HTML minification](disable-html-minification.md)
- [Disable CSS/JS minification](disable-css-js-minification.md)

### Image optimization
Build taks minifies PNG, JPEG, GIF and SVG images using **[imagemin](https://github.com/imagemin/imagemin)**.

### Static asset revisioning
Build task appends content hash to file names, like `main.css` -> `main-9429bd756b.css`.
rff-gulp uses **[gulp-rev](https://github.com/sindresorhus/gulp-rev)** and **[gulp-rev-replace](https://github.com/jamesknelson/gulp-rev-replace)** for this feature.

- [Disable asset revisioning](disable-revisioning.md)
- [Disable asset revisioning to specific files](disable-specific-revisioning.md)

## Automation
### CSS sprites generator
Images in "app/images/_sprites" will be converted to spritesheet and CSS.
rff-gulp uses **[gulp.spritesmith](https://github.com/twolfson/gulp.spritesmith)** which is a wrapper of **[spritesmith](https://github.com/Ensighten/spritesmith)** utility.

### Icon fonts generator
SVG icons in "app/fonts/_glyphs" will be converted to web fonts and CSS.
rff-gulp uses **[gulp-iconfont](https://github.com/nfroidure/gulp-iconfont)** and **[gulp-iconfont-css](https://github.com/backflip/gulp-iconfont-css)** for this feature.

### Deployment to Git repository
Built files can be uploaded to deployment branch by running a single command.
rff-gulp uses **[gulp-gh-pages](https://github.com/shinnn/gulp-gh-pages)** for this feature.

- [Create deployment branch](deploy-branch.md)

## Development server
### Browsersync
**[Browsersync](https://www.browsersync.io/)** is a web server which keeps multiple browsers & devices in sync during development.
Browsersync has many awesome features for frontend development, e.g. live-reloading, interaction sync, network throttle simulation, etc.

- [Browsersync options](https://www.browsersync.io/docs/options)

## See also
- [Compare with generator-rff](compare-rff.md)


text:
from contextlib import suppress

import numpy as np
import pytest

import xarray as xr
from xarray.coding import variables

from . import assert_equal, assert_identical, requires_dask

with suppress(ImportError):
    import dask.array as da

def test_CFMaskCoder_decode():
    original = xr.Variable(('x',), [0, -1, 1], {'_FillValue': -1})
    expected = xr.Variable(('x',), [0, np.nan, 1])
    coder = variables.CFMaskCoder()
    encoded = coder.decode(original)
    assert_identical(expected, encoded)

def test_CFMaskCoder_missing_value():
    expected = xr.DataArray(np.array([[26915, 27755, -9999, 27705],
                                      [25595, -9999, 28315, -9999]]),
                            dims=['npts', 'ntimes'],
                            name='tmpk')
    expected.attrs['missing_value'] = -9999

    decoded = xr.decode_cf(expected.to_dataset())
    encoded, _ = xr.conventions.cf_encoder(decoded, decoded.attrs)

    assert_equal(encoded['tmpk'], expected.variable)

    decoded.tmpk.encoding['_FillValue'] = -9940
    with pytest.raises(ValueError):
        encoded, _ = xr.conventions.cf_encoder(decoded, decoded.attrs)

@requires_dask
def test_CFMaskCoder_decode_dask():
    original = xr.Variable(('x',), [0, -1, 1], {'_FillValue': -1}).chunk()
    expected = xr.Variable(('x',), [0, np.nan, 1])
    coder = variables.CFMaskCoder()
    encoded = coder.decode(original)
    assert isinstance(encoded.data, da.Array)
    assert_identical(expected, encoded)

# TODO(shoyer): port other fill-value tests

# TODO(shoyer): parameterize when we have more coders
def test_coder_roundtrip():
    original = xr.Variable(('x',), [0.0, np.nan, 1.0])
    coder = variables.CFMaskCoder()
    roundtripped = coder.decode(coder.encode(original))
    assert_identical(original, roundtripped)

@pytest.mark.parametrize('dtype', 'u1 u2 i1 i2 f2 f4'.split())
def test_scaling_converts_to_float32(dtype):
    original = xr.Variable(('x',), np.arange(10, dtype=dtype),
                           encoding=dict(scale_factor=10))
    coder = variables.CFScaleOffsetCoder()
    encoded = coder.encode(original)
    assert encoded.dtype == np.float32
    roundtripped = coder.decode(encoded)
    assert_identical(original, roundtripped)
    assert roundtripped.dtype == np.float32


text:
{% extends 'news/base.html' %}

{% block content %}

Ghana News Explorer

Aggregating & Analyzing Ghana's news from top media houses.

                    7 days
                    30 days
                    6 months
                    Pick range

                    {% include "news/articles_cycle.html" %}

{% endblock %}


text:
module Jquery
  module Rails

    class Railtie < ::Rails::Railtie
      config.before_configuration do
        config.action_view.javascript_expansions[:defaults] |= ['bootstrap']
      end
    end

  end
end


text:
package net.floodlightcontroller.packet;

public enum SIPType {

	REQUEST,
	RESPONSE,
	JAK;
}


text:
package tools;

import java.io.Serializable;

public class DataPacket implements Serializable {

	//Numbers
	private static final long serialVersionUID = -7904588374320593571L;

	//Strings
	private String type;
	private String from;
	private String message;
	private String target;

	//Arrays
	private byte[] data;

	/**
	 * Constructs a new DataPacket with the given type, name, message, and data.
	 * @param type The type of data being sent: message, dlpacket, imgpacket, voicepacket, or command.
	 * @param from The name of the client sending the packet.
	 * @param target The name of the target client.
	 * @param message The message to include within the packet
	 * @param data The byte array to use as data within the packet. Only necessary for dlpackets, voicepackets, or imgpackets.
	 */
	public DataPacket(String type, String from, String target, String message, byte[] data) {
		this.type = type;
		this.from = from;
		this.message = message;
		this.data = data;
		this.target = target;
	}

	/**
	 * Gets the type of packet.
	 * @return A string representing the type of packet: message, dlpacket, imgpacket, voicepacket, or command.
	 */
	public String getType() {
		return type;
	}

	/**
	 * Gets the name of the client sending the packet.
	 * @return A string with the name.
	 */
	public String getFrom() {
		return from;
	}

	/**
	 * Gets the name of the packet target.
	 * @return A string with the name.
	 */
	public String getTarget() {
		return target;
	}

	/**
	 * Gets the message in the packet. Typically contains info such as target, data length, etc.
	 * @return A string with the message.
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * Gets the data for this packet. Used for dlpackets, voicepackets, and imgpackets for transfering bytes.
	 * @return The byte array containing the data.
	 */
	public byte[] getData() {
		return data;
	}

}


text:
#include <inttypes.h>
#include "Print.h"
#include <Wire.h>
import smbus
import time

## commands
LCD_CLEARDISPLAY = 0x01
LCD_RETURNHOME = 0x02
LCD_ENTRYMODESET  = 0x04
LCD_DISPLAYCONTROL = 0x08
LCD_CURSORSHIFT = 0x10
LCD_FUNCTIONSET = 0x20
LCD_SETCGRAMADDR = 0x40
LCD_SETDDRAMADDR = 0x80

## flags for display entry mode
LCD_ENTRYRIGHT = 0x00
LCD_ENTRYLEFT = 0x02
LCD_ENTRYSHIFTINCREMENT = 0x01
LCD_ENTRYSHIFTDECREMENT = 0x00

## flags for display on/off control
LCD_DISPLAYON = 0x04
LCD_DISPLAYOFF = 0x00
LCD_CURSORON = 0x02
LCD_CURSOROFF = 0x00
LCD_BLINKON = 0x01
LCD_BLINKOFF = 0x00

## flags for display/cursor shift
LCD_DISPLAYMOVE = 0x08
LCD_CURSORMOVE = 0x00
LCD_MOVERIGHT = 0x04
LCD_MOVELEFT = 0x00

## flags for function set
LCD_8BITMODE = 0x10
LCD_4BITMODE = 0x00
LCD_2LINE = 0x08
LCD_1LINE = 0x00
LCD_5x10DOTS = 0x04
LCD_5x8DOTS = 0x00

## flags for backlight control
LCD_BACKLIGHT = 0x08
LCD_NOBACKLIGHT = 0x00

En = 0b00000100  ## Enable bit
Rw = 0b00000010  ## Read/Write bit
Rs = 0b00000001  ## Register select bit

class LiquidCrystal_I2C:
    def __init__( self, lcd_addr, lcd_cols, lcd_rows ):
        self._Addr = lcd_addr
        ## self._displayfunction
        ## self._displaycontrol
        ## self._displaymode
        ## self._numlines
        self._cols = lcd_cols
        self._rows = lcd_rows
        self._backlightval = LCD_NOBACKLIGHT

    def begin( self, cols, lines, dotsize ) :
        if lines > 1:
            self._displayfunction = self._displayfunction | LCD_2LINE
        self._numlines = lines

        ## for some 1 line displays you can select a 10 pixel high font
        if dotsize != 0 and lines == 1 :
            self._displayfunction = self._displayfunction | LCD_5x8DOTS
        ## SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
        ## according to datasheet, we need at least 40ms after power rises above 2.7V
        ## before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
        time.sleep( 0.05 )

        ## Now we pull both RS and R/W low to begin commands
        self.expanderWrite( self._backlightval )
        time.sleep( 1 )

        ## put the LCD into 4 bit mode
        ## this is according to the hitachi HD44780 datasheet
        ## figure 24, pg 46

        ## we start in 8bit mode, try to set 4 bit mode
        self.write4bits( 0x03 << 4 )
        time.sleep( 0.0045 ); ## wait min 4.1ms

        ## second try
        self.write4bits(0x03 << 4)
        time.sleep( 0.0045 ); ## wait min 4.1ms

        ## third go!
        self.write4bits(0x03 << 4)
        time.sleep( 0.0015 );

        ## finally, set to 4-bit interface
        self.write4bits( 0x02 << 4 )

        ## set # lines, font size, etc.
        self.command( LCD_FUNCTIONSET | self._displayfunction )

        ## turn the display on with no cursor or blinking default
        self._displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF
        self.display()

        ## clear it off
        self.clear()

        ## Initialize to default text direction (for roman languages)
        self._displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT

        ## set the entry mode
        self.command( LCD_ENTRYMODESET | self._displaymode)

        self.home()

    def clear( self ):
        self.command(LCD_CLEARDISPLAY)  ##clear display, set cursor position to zero
        time.sleep(0.002) ## this command takes a long time!

    def home( self ):
        self.command(LCD_RETURNHOME)  ## set cursor position to zero
        time.sleep(0.002)  ## this command takes a long time!

    def noDisplay( self ) :
        self._displaycontrol = self._displaycontrol & (~LCD_DISPLAYON)
        self.command(LCD_DISPLAYCONTROL | self._displaycontrol);

    def display( self ):
        self._displaycontrol = self._displaycontrol | LCD_DISPLAYON
        self.command(LCD_DISPLAYCONTROL | self._displaycontrol)

    def noBlink( self ):
        self._displaycontrol = self._displaycontrol & ( ~LCD_BLINKON )
        self.command(LCD_DISPLAYCONTROL | self._displaycontrol)
    def blink( self ):
        self._displaycontrol = self._displaycontrol | LCD_BLINKON
        self.command(LCD_DISPLAYCONTROL | self._displaycontrol)

    def noCursor( self ):
        self._displaycontrol = self._displaycontrol & ( ~LCD_CURSORON )
        self.command(LCD_DISPLAYCONTROL | self._displaycontrol)

    def cursor( self ):
        self._displaycontrol = self._displaycontrol | LCD_CURSORON
        self.command( LCD_DISPLAYCONTROL | self._displaycontrol);

    def scrollDisplayLeft( self ):
        self.command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT)

    def scrollDisplayRight(self):
        self.command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT)

    def leftToRight( self ):
        self._displaymode = self._displaymode | LCD_ENTRYLEFT;
        self.command(LCD_ENTRYMODESET | self._displaymode)

    def rightToLeft( self ):
        self._displaymode = self._displaymode & ( ~LCD_ENTRYLEFT )
        self.command(LCD_ENTRYMODESET | self._displaymode)

    def noBacklight( self ):
        self._backlightval=LCD_NOBACKLIGHT
        self.expanderWrite(0)

    def backlight( self ):
        self._backlightval=LCD_BACKLIGHT;
        self.expanderWrite(0)

    def autoscroll( self ) :
        self._displaymode = self._displaymode | LCD_ENTRYSHIFTINCREMENT
        self.command( LCD_ENTRYMODESET | self._displaymode )

    def noAutoscroll( self ):
        self._displaymode = self._displaymode & ( ~LCD_ENTRYSHIFTINCREMENT )
        self.command( LCD_ENTRYMODESET | self._displaymode )

    def createChar( self, location , charmap ):
        location = location & 0x7; ## we only have 8 locations 0-7
        self.command( LCD_SETCGRAMADDR | (location << 3))
        for i in range[7]:
            self.send( charmap[i], Rs )

    def setCursor( self, col , row ) :
        row_offsets = ( 0x00, 0x40, 0x14, 0x54 )
        if  row > self._numlines :
            row = self._numlines-1;    ## we count rows starting w/0

        self.command( LCD_SETDDRAMADDR | (col + row_offsets[row]) )

    def command( self, value ):
        self.send(value, 0)

    def init( self ):
        self.init_priv()

    def init_priv( self ):
        self.bus = smbus.SMBus(1)
        self._displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS
        self.begin( self._cols, self._rows, 0 )

    def send(self, value , mode ):
        highnib = value & 0xf0
        lownib = ( value<<4 ) & 0xf0
        self.write4bits((highnib) | mode)
        self.write4bits((lownib) | mode)

    def write4bits( self, value ):
        self.expanderWrite(value)
        self.pulseEnable(value)

    def expanderWrite(self, _data ):
        self.bus.write_byte( self._Addr, _data | self._backlightval )

    def pulseEnable( self, _data ):
        self.expanderWrite( _data | En )    ## En high
        time.sleep(0.000001)        ## enable pulse must be >450ns

        self.expanderWrite( _data & ~En )   ## En low
        time.sleep(0.00005 )        ## commands need > 37us to settle

    def write( self, value ):
        self.send( value, Rs )

    def printstr( self, _data ):
        for s in range(len(_data)):
            _byteV = ord( _data[s] )
            self.write( _byteV )


text:
hancock
=======

It's like your [John Hancock][johnhancock] for all of your company's apps.

A lot of this is extracted from our internal single sign on server at [Engine
Yard][ey].  You can easily add this middleware to authenticate your
users with existing models.

Features
========
An [OpenID][openid] based [Single Sign On][sso] server that provides:

* a single source for user authentication using openid
* integration with ruby frameworks via [rack][hancock_examples].

How it Works
============
![SSO Handshake](http://img.skitch.com/20090719-j3f895hp7h9dnkpjwc8ycqg29e.jpg)

This handshake seems kind of complex but it only happens when you need to
validate a user session on the consumer.

Testing/Developing Locally
==========================
You need the [Bundler][bundler] to function.

    % gem install bundler
    % bundle install
    % bundle exec rake

Deployment Setup
================

Ideally you just drop the middleware into your existing application.

TBD

Guidance
========
* http://openid.net/specs/openid-authentication-2_0.html
* http://wiki.openid.net/OpenID_Authentication_2.0
* http://jystewart.net/process/2007/10/a-ruby-on-rails-openid-server/
* http://lists.openidenabled.com/pipermail/dev/2007-March/000347.html

Feedback
========
* [Github Issues][githubissues]

Sponsored By
============
* [Engine Yard][ey]

[johnhancock]: http://www.urbandictionary.com/define.php?term=john+hancock
[ey]: http://www.engineyard.com/
[sr]: http://github.com/sr
[atmos]: http://github.com/atmos
[halorgium]: http://github.com/halorgium
[adelcambre]: http://github.com/adelcambre
[srfork]: http://github.com/sr/webrat/tree/sinatra
[webrat]: http://github.com/brynary/webrat
[hancock_examples]: http://github.com/atmos/hancock-client/tree/98aae96077a8fbfa0097f33ec3ecd628fc549c54/examples/dragon
[datamapper]: http://datamapper.org
[openid]: http://openid.net/
[sso]: http://en.wikipedia.org/wiki/Single_sign-on
[whitelist]: http://en.wikipedia.org/wiki/Whitelist
[oauth]: http://oauth.net/
[sreg]: http://openid.net/specs/openid-simple-registration-extension-1_0.html#response_format
[simpledb]: http://aws.amazon.com/simpledb/
[googlegroup]: http://groups.google.com/group/hancock-users
[githubissues]: http://github.com/atmos/hancock/issues
[bundler]: http://gembundler.com


text:
/** The interface for user input when generating a hlo graph */
export declare interface GraphConfigInput {
  selectedModule: string;
  opName: string;
  graphWidth: number;
  showMetadata: boolean;
  mergeFusion: boolean;
}

/** The query parameter object for route navigation and xhr */
export declare interface GraphViewerQueryParams {
  node_name: string;
  module_name: string;
  graph_width: number;
  show_metadata: boolean;
  merge_fusion: boolean;
}


text:
<div class="writing block" data-href="<?php the_permalink() ?>">

          Writing:
          <?php the_writing_title() ?>

          <?php the_content() ?>

    <?= get_template_part('templates/related-posts') ?>
    <?= get_template_part('templates/counter') ?>


text:
package org.jbb.lib.restful.error.notreadable;

import org.jbb.lib.restful.error.ErrorResponse;

public interface NotReadableExceptionHandler<T extends Throwable> {

    Class<T> getSupportedClass();

    ErrorResponse handle(T ex);

}


text:
from __future__ import print_function, division, absolute_import

import numpy as np
from matplotlib.patches import Polygon

from astropy import units as u
from astropy.coordinates.representation import UnitSphericalRepresentation, CartesianRepresentation
from astropy.coordinates.angles import rotation_matrix

__all__ = ['SphericalCircle']

def _transform_cartesian(representation, matrix):

    # Get xyz once since it's an expensive operation
    xyz = representation.xyz

    # Since the underlying data can be n-dimensional, reshape to a
    # 2-dimensional (3, N) array.
    vec = xyz.reshape((3, xyz.size // 3))

    # Do the transformation
    vec_new = np.dot(np.asarray(matrix), vec)

    # Reshape to preserve the original shape
    subshape = xyz.shape[1:]
    x = vec_new[0].reshape(subshape)
    y = vec_new[1].reshape(subshape)
    z = vec_new[2].reshape(subshape)

    # Make a new representation and return
    return CartesianRepresentation(x, y, z)

def _rotate_polygon(lon, lat, lon0, lat0):
    """
    Given a polygon with vertices defined by (lon, lat), rotate the polygon
    such that the North pole of the spherical coordinates is now at (lon0,
    lat0). Therefore, to end up with a polygon centered on (lon0, lat0), the
    polygon should initially be drawn around the North pole.
    """

    # Create a representation object
    polygon = UnitSphericalRepresentation(lon=lon, lat=lat)

    # Determine rotation matrix to make it so that the circle is centered
    # on the correct longitude/latitude.
    m1 = rotation_matrix(-(0.5 * np.pi * u.radian - lat0), axis='y')
    m2 = rotation_matrix(-lon0, axis='z')
    transform_matrix = m2 * m1

    # Apply 3D rotation
    polygon = polygon.to_cartesian()

    try:
        polygon = polygon.transform(transform_matrix)
    except:  # TODO: remove once Astropy 1.1 is no longer supported
        polygon = _transform_cartesian(polygon, transform_matrix)

    polygon = UnitSphericalRepresentation.from_cartesian(polygon)

    return polygon.lon, polygon.lat

class SphericalCircle(Polygon):
    """
    Create a patch representing a spherical circle - that is, a circle that is
    formed of all the points that are within a certain angle of the central
    coordinates on a sphere. Here we assume that latitude goes from -90 to +90

    This class is needed in cases where the user wants to add a circular patch
    to a celestial image, since otherwise the circle will be distorted, because
    a fixed interval in longitude corresponds to a different angle on the sky
    depending on the latitude.

    Parameters
    ----------
    center : tuple or `~astropy.units.Quantity`
        This can be either a tuple of two `~astropy.units.Quantity` objects, or
        a single `~astropy.units.Quantity` array with two elements.
    radius : `~astropy.units.Quantity`
        The radius of the circle
    resolution : int, optional
        The number of points that make up the circle - increase this to get a
        smoother circle.
    vertex_unit : `~astropy.units.Unit`
        The units in which the resulting polygon should be defined - this
        should match the unit that the transformation (e.g. the WCS
        transformation) expects as input.

    Notes
    -----
    Additional keyword arguments are passed to `~matplotlib.patches.Polygon`
    """

    def __init__(self, center, radius, resolution=100, vertex_unit=u.degree, **kwargs):

        # Extract longitude/latitude, either from a tuple of two quantities, or
        # a single 2-element Quantity.
        longitude, latitude = center

        # Start off by generating the circle around the North pole
        lon = np.linspace(0., 2 * np.pi, resolution + 1)[:-1] * u.radian
        lat = np.repeat(0.5 * np.pi - radius.to(u.radian).value, resolution) * u.radian

        lon, lat = _rotate_polygon(lon, lat, longitude, latitude)

        # Extract new longitude/latitude in the requested units
        lon = lon.to(vertex_unit).value
        lat = lat.to(vertex_unit).value

        # Create polygon vertices
        vertices = np.array([lon, lat]).transpose()

        super(SphericalCircle, self).__init__(vertices, **kwargs)


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.loadtestservice.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.loadtestservice.fluent.QuotasClient;
import com.azure.resourcemanager.loadtestservice.fluent.models.CheckQuotaAvailabilityResponseInner;
import com.azure.resourcemanager.loadtestservice.fluent.models.QuotaResourceInner;
import com.azure.resourcemanager.loadtestservice.models.QuotaBucketRequest;
import com.azure.resourcemanager.loadtestservice.models.QuotaResourceList;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in QuotasClient. */
public final class QuotasClientImpl implements QuotasClient {
    /** The proxy service used to perform REST calls. */
    private final QuotasService service;

    /** The service client containing this operation class. */
    private final LoadTestClientImpl client;

    /**
     * Initializes an instance of QuotasClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    QuotasClientImpl(LoadTestClientImpl client) {
        this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for LoadTestClientQuotas to be used by the proxy service to perform REST
     * calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "LoadTestClientQuotas")
    private interface QuotasService {
        @Headers({"Content-Type: application/json"})
        @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<QuotaResourceList>> list(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("location") String location,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas"
                + "/{quotaBucketName}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<QuotaResourceInner>> get(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("location") String location,
            @QueryParam("api-version") String apiVersion,
            @PathParam("quotaBucketName") String quotaBucketName,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post(
            "/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas"
                + "/{quotaBucketName}/checkAvailability")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<CheckQuotaAvailabilityResponseInner>> checkAvailability(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("location") String location,
            @QueryParam("api-version") String apiVersion,
            @PathParam("quotaBucketName") String quotaBucketName,
            @BodyParam("application/json") QuotaBucketRequest quotaBucketRequest,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<QuotaResourceList>> listNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<QuotaResourceInner>> listSinglePageAsync(String location) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .list(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            location,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<QuotaResourceInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<QuotaResourceInner>> listSinglePageAsync(String location, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .list(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                location,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<QuotaResourceInner> listAsync(String location) {
        return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink));
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<QuotaResourceInner> listAsync(String location, Context context) {
        return new PagedFlux<>(
            () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context));
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<QuotaResourceInner> list(String location) {
        return new PagedIterable<>(listAsync(location));
    }

    /**
     * Lists all the available quota per region per subscription.
     *
     * @param location The name of Azure region.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<QuotaResourceInner> list(String location, Context context) {
        return new PagedIterable<>(listAsync(location, context));
    }

    /**
     * Get the available quota for a quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the available quota for a quota bucket per region per subscription along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<QuotaResourceInner>> getWithResponseAsync(String location, String quotaBucketName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        if (quotaBucketName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .get(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            location,
                            this.client.getApiVersion(),
                            quotaBucketName,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the available quota for a quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the available quota for a quota bucket per region per subscription along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<QuotaResourceInner>> getWithResponseAsync(
        String location, String quotaBucketName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        if (quotaBucketName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .get(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                location,
                this.client.getApiVersion(),
                quotaBucketName,
                accept,
                context);
    }

    /**
     * Get the available quota for a quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the available quota for a quota bucket per region per subscription on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<QuotaResourceInner> getAsync(String location, String quotaBucketName) {
        return getWithResponseAsync(location, quotaBucketName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get the available quota for a quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the available quota for a quota bucket per region per subscription along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<QuotaResourceInner> getWithResponse(String location, String quotaBucketName, Context context) {
        return getWithResponseAsync(location, quotaBucketName, context).block();
    }

    /**
     * Get the available quota for a quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the available quota for a quota bucket per region per subscription.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public QuotaResourceInner get(String location, String quotaBucketName) {
        return getWithResponse(location, quotaBucketName, Context.NONE).getValue();
    }

    /**
     * Check Quota Availability on quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param quotaBucketRequest Quota Bucket Request data.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return check quota availability response object along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<CheckQuotaAvailabilityResponseInner>> checkAvailabilityWithResponseAsync(
        String location, String quotaBucketName, QuotaBucketRequest quotaBucketRequest) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        if (quotaBucketName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null."));
        }
        if (quotaBucketRequest == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketRequest is required and cannot be null."));
        } else {
            quotaBucketRequest.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .checkAvailability(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            location,
                            this.client.getApiVersion(),
                            quotaBucketName,
                            quotaBucketRequest,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Check Quota Availability on quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param quotaBucketRequest Quota Bucket Request data.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return check quota availability response object along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<CheckQuotaAvailabilityResponseInner>> checkAvailabilityWithResponseAsync(
        String location, String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (location == null) {
            return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
        }
        if (quotaBucketName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null."));
        }
        if (quotaBucketRequest == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter quotaBucketRequest is required and cannot be null."));
        } else {
            quotaBucketRequest.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .checkAvailability(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                location,
                this.client.getApiVersion(),
                quotaBucketName,
                quotaBucketRequest,
                accept,
                context);
    }

    /**
     * Check Quota Availability on quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param quotaBucketRequest Quota Bucket Request data.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return check quota availability response object on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<CheckQuotaAvailabilityResponseInner> checkAvailabilityAsync(
        String location, String quotaBucketName, QuotaBucketRequest quotaBucketRequest) {
        return checkAvailabilityWithResponseAsync(location, quotaBucketName, quotaBucketRequest)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Check Quota Availability on quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param quotaBucketRequest Quota Bucket Request data.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return check quota availability response object along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<CheckQuotaAvailabilityResponseInner> checkAvailabilityWithResponse(
        String location, String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context) {
        return checkAvailabilityWithResponseAsync(location, quotaBucketName, quotaBucketRequest, context).block();
    }

    /**
     * Check Quota Availability on quota bucket per region per subscription.
     *
     * @param location The name of Azure region.
     * @param quotaBucketName Quota Bucket name.
     * @param quotaBucketRequest Quota Bucket Request data.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return check quota availability response object.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public CheckQuotaAvailabilityResponseInner checkAvailability(
        String location, String quotaBucketName, QuotaBucketRequest quotaBucketRequest) {
        return checkAvailabilityWithResponse(location, quotaBucketName, quotaBucketRequest, Context.NONE).getValue();
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<QuotaResourceInner>> listNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<QuotaResourceInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of quota bucket objects along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<QuotaResourceInner>> listNextSinglePageAsync(String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }
}


text:
/**
 * @file Helper to bootstrap methods
 */
/*#ifndef(UMD)*/
"use strict";
/*global _gpfContext*/ // Resolve contextual string
/*exported _gpfGetBootstrapMethod*/ // Create a method that contains a bootstrap (called only once)
/*#endif*/

/**
 * Create a method that is replaced on first call with a new one generated by a factory
 *
 * @param {String} path method path
 * @param {Function} methodFactory Must return a function (it receives the path as parameter)
 * @gpf:closure
 */
function _gpfGetBootstrapMethod (path, methodFactory) {
    var pathList = path.split("."),
        name = pathList.pop(),
        namespace = _gpfContext(pathList, true),
        method;
    // If someone stores the initial member, the factory will be called every time (simpler)
    namespace[name] = function () {
        method = methodFactory(path);
        namespace[name] = method;
        return method.apply(this, arguments);
    };
}

/*#ifndef(UMD)*/

gpf.internals._gpfGetBootstrapMethod = _gpfGetBootstrapMethod;

/*#endif*/


text:
<?php

namespace ChurchCRM;

use ChurchCRM\Base\UserConfig as BaseUserConfig;

/**
 * Skeleton subclass for representing a row from the 'userconfig_ucfg' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 */
class UserConfig extends BaseUserConfig
{
}


text: {{ formattedCoords }}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
    <property name="mediumtext" value="TEXT" dbms="postgresql" />
    <property name="mediumtext" value="MEDIUMTEXT" />
    <changeSet author="cjellick (generated)" id="1444429809024-1" >
        <createTable tableName="external_event">
            <column autoIncrement="true" name="id" type="BIGINT">
                <constraints primaryKey="true"/>
            </column>
            <column name="account_id" type="BIGINT"/>
            <column name="kind" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="uuid" type="VARCHAR(128)">
                <constraints nullable="false"/>
            </column>
            <column name="state" type="VARCHAR(128)">
                <constraints nullable="false"/>
            </column>
            <column name="created" type="datetime"/>
            <column name="data" type="TEXT"/>
            <column name="external_id" type="VARCHAR(255)"/>
            <column name="event_type" type="VARCHAR(255)"/>
            <column name="reported_account_id" type="BIGINT"/>
        </createTable>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-2">
        <addColumn tableName="storage_pool">
            <column name="external_id" type="VARCHAR(128)"/>
        </addColumn>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-3">
        <addColumn tableName="volume">
            <column name="external_id" type="VARCHAR(128)"/>
        </addColumn>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-4">
        <addUniqueConstraint columnNames="uuid" constraintName="idx_external_event_uuid" deferrable="false" disabled="false" initiallyDeferred="false" tableName="external_event"/>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-5">
        <addForeignKeyConstraint baseColumnNames="account_id" baseTableName="external_event" constraintName="fk_external_event__account_id" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="id" referencedTableName="account"/>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-6">
        <addForeignKeyConstraint baseColumnNames="reported_account_id" baseTableName="external_event" constraintName="fk_external_event__reported_account_id" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="id" referencedTableName="account"/>
    </changeSet>
    <changeSet author="cjellick (generated)" id="1444429809024-7">
        <createIndex indexName="idx_external_event_state" tableName="external_event" unique="false">
            <column name="state"/>
        </createIndex>
    </changeSet>
</databaseChangeLog>


text:
package com.github.ambry.utils;

import java.io.File;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;

/**
 * Tests for file lock
 */
public class FileLockTest {
  @Test
  public void testFileLock() throws IOException {
    File file = File.createTempFile("temp", "1");
    file.deleteOnExit();
    FileLock lock = new FileLock(file);
    lock.lock();
    Assert.assertFalse(lock.tryLock());
    lock.unlock();
    Assert.assertTrue(lock.tryLock());
    lock.unlock();
    lock.destroy();
  }
}