text:
Here's a summary of all of our releases of Foundation so far.

***

### Got a Foundation Question?

Post your questions on the Foundation Forum! We have a strong community where you can:

Get helpful answers fast from avid Foundation fans and ZURBians.

Describe your code problem or response design question with text, code and imagery so the community can respond with appropriate advise or answers.

Follow posts and people to learn new things about Foundation.

Sign Up & Get Answers Now →

***

### 5.0.3- January 15, 2014

  * Uses `scale-color` instead of `darken` [#3287](https://github.com/zurb/foundation/pull/3827)
  * Add `reflow` to Orbit
  * Add missing large and xlarge visibility classes
  * Add missing variables to `_settings.scss` file
  * Abide checkbox validation [b5e8db5133](https://github.com/zurb/foundation/commit/b5e8db5133e56b83c5df3da46ec4cf8b7bb09523)
  * Fallback to default settings for alerts if no custom settings are provided [0261d71d9d](https://github.com/zurb/foundation/commit/0261d71d9d4b94216d0596966db041b834c8c483)
  * Setting active_class on Magellan fixed [f737212e47](https://github.com/zurb/foundation/commit/f737212e475226e7ddafcf85681626ca45dcc70f)
  * Fix FastClick header loading issues and Update FastClick [a4f88e1969](https://github.com/zurb/foundation/commit/a4f88e1969b76f70ff319d3c6832f8c2aaf03434)
  * Dropdown callbacks patched [fa89000ec2](https://github.com/zurb/foundation/commit/fa89000ec2eba15d9da6edeccb3c9db7174d4678)
  * Fix bug where joyride fails to scroll up for next tip [fa89000ec2](https://github.com/zurb/foundation/commit/fa89000ec2eba15d9da6edeccb3c9db7174d4678)
  * Joyride RTL fixes [99668af63d](https://github.com/zurb/foundation/commit/99668af63d6b85ea43842567864353b9702bcb1e)
  * Dropdowns now auto close [ff21a94199](https://github.com/zurb/foundation/commit/ff21a94199bc9ce66b050bdc8f42ba0b0c1f4538)
  * Fix Orbit click event to go to next slide [e6c4d0a30c](https://github.com/zurb/foundation/commit/e6c4d0a30cfb3c2fd66a92944947da8579140a11)
  * Clearing RTL improvements [d1f19f77b0](https://github.com/zurb/foundation/commit/d1f19f77b0f29f85ae4a18da96715929d706174b)
  * Fix Joyride Cookie Detection [357a365e1a](https://github.com/zurb/foundation/commit/357a365e1abe346886eca8fd9bedde559602cd32)
  * Fix to Interchange internal caching [66fc386503](https://github.com/zurb/foundation/commit/66fc386503d4fd13c4badfd85cc0daca13d87528)
  * Lots of bug and documentation fixes

You can compare the commits [here](https://github.com/zurb/foundation/compare/v5.0.2...v5.0.3)

### 5.0.2- November 22, 2013

  * Fix issue with clearing images not displaying

You can compare the commits [here](https://github.com/zurb/foundation/compare/v5.0.1...v5.0.2)

### 5.0.1- November 22, 2013

  * Fixes issue with breakpoint not being properly set on top bar instances
  * Adds em-calc() function back in, references rem-calc()
  * Allows open sans font include to be turned off

You can compare the commits [here](https://github.com/zurb/foundation/compare/v5.0.0...v5.0.1)

### 5.0.0- November 21, 2013

### 4.3.2- September 23, 2013

* Documentation updates
* When changing slides in Orbit all `data-orbit-link` will now get an active class
* Adds new `em-calc` function, old `emCalc` will automatically reference newly named function
* Lots of other bug fixes

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.3.1...v4.3.2).

### 4.3.1- July 23, 2013
* Fixes RTL animation issues in Orbit
* Addresses error class conflicts between Abide and general form styles
* Bug fixes

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.3.0...v4.3.1).

### 4.3- July 18, 2013
* Added [Abide](http://foundation.zurb.com/docs/components/abide.html), our new form validation plugin that works with simple data-attributes.
* Rewrote Orbit to include previous options and animations. We also made it possible to have variable height slides and separate animations.
* Top Bar JS updates to fix a scrollTop bug
* Fixed a positioning bug in custom forms when using the collapsed option
* Added custom section to custom forms
* Updated Interchange to support absolute URLs
* Updated the emCalc to be used unitlessly and with multiple values
* Created an early "opt-in" grid that we've built for Foundation 5. This includes 2 breakpoints and three grids (small, medium, large). Use this to start planning ahead to Foundation 5.
* Fixed a bug with Section deep linking in nested content
* Top Bar toggle bug fixes
* Fixed bugs with dropdown positioning and closing
* Updated visual style of bullets for Orbit
* General bug fixes, improvements and refinements.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.2.3...v4.3.0).

### 4.2.3- June 26, 2013
* Made it to where custom switches work inside custom forms.
* Small update to breadcrumb styling so that defaults don't get overridden.
* Fixed bugs with height of Top Bar.
* Added Middleman template to README
* Fixed a wrong selector in forms.js
* Bug fixes

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.2.2...v4.2.3).

### 4.2.2- June 11, 2013
* Added touch events to zepto core.
* Fixed a topbar scroll issue.
* Fixed a reveal scroll issue.
* Bumped jQuery to 1.10.1
* Added PHP template.
* Removed default webkit appearance on buttons.
* Updated placeholder.js to actually initiate properly, this should work just fine now.
* Added a "fixed" class to magellan for alternate styling.
* Fixed path to variables file for Compass upgrade path.
* Other small bug fixes.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.2.1...v4.2.2).

### 4.2.1- May 31, 2013
* Add missing `$experimental` Sass variable.
* Bug fixes for top bar in mobile view.
* Retina is now a default named media query for Interchange.
* Removes incompatible Zepto function used in custom forms.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.2.0...v4.2.1).

### 4.2- May 30, 2013
* Added new Interchange Plugin for handling responsive images.
* Made a variable for the "sticky" class on the top-bar.
* Changed media query variables to pixels for better consistency between font sizes.
* Fixed deep linking for foundation.section.js.
* Added data-options support to top-bar, you can now include "is_hover: false" to make it clickable.
* Each dropdown section of the top-bar for mobile now takes on its natural height rather than looking for the tallest and setting them all to that.
* Added data-options support for tool-tips.
* Added .large-uncentered for when you only want centered on small screens.
* Made block-grid spacing more like the normal grid.
* Fixed confusing comments in visibility classes SCSS file.
* Added AJAX support to Reveal.
* Added cursor variables.
* Fixed various typos in the documentation.
* Updated CONTRIBUTOR.md to include how to run the docs locally.
* Added Codekit instructions to documentation.
* Changed to a better method test for Zepto.
* Added hover support for dropdowns data-options by including "is_hover: true" to the options.
* Added the ability to use deep-linking inside nested Sections.
* Added the ability to use HTML in the data-caption for Clearing.
* Fixes problem with embedded Youtube videos inside of Reveal.
* Orbit now has pause/resume on hover/mouseout capability.
* Fixed Section vertical tabs on mobile.
* Lots of small bug fixes and improvements for many of the JS components.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.6...v4.2.0).

### 4.1.6- May 6, 2013
* Improved performance for custom select boxes.
* Bug fix for switches contained within custom forms.
* Bug fix for directly clicking on checkbox to toggle it
* Sections are now semantic.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.5...v4.1.6).

### 4.1.5- April 26, 2013
* Add support for `indexOf` in legacy browsers

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.4...v4.1.5).

### 4.1.4- April 26, 2013
* Fixes invalid Rails generator path

### 4.1.3- April 25, 2013

* Added _variables.scss, which holds default variables and creates the settings file for the gem
* Rearranged a few mixins in order to remove the confusing _foundation-globals.scss file
  * If you are getting errors after upgrade, just remove any reference to this file...
* Added reference to $base-line-height variables for those using Compass vertical rhythm
* Fixed issue with invalid css coming through into buttons
* Various bug fixes
* Adds support for infinite section nesting
* Updated top bar styles
* Support for data-options in Reveal

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.2...v4.1.3).

### 4.1.2- April 10, 2013

* Added Joyride expose functionality
* General bug fixes for regressions that came up with RTL release
* Section is now fully semantic
* Clicking on current thumbnail in Clearing now advances to next slide
* data-options support added to Clearing
* Addressed Foundation loader incompatibilities with non-jQuery and non-Zepto JS libraries
* Fixed Rails generator bug when using CoffeeScript files
* Added `reflow` to Section js plugin to support dynamic content

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.1...v4.1.2).

### 4.1.1- April 2, 2013
* Changed all references to the variable `$default-opposite` to `$opposite-direction`
* Added `dir` attribute to `html` tag
* Added direction variables to `foundation.dropdown.js`, `foundation.clearing.js`, `foundation.joyride.js`, `foundation.orbit.js`, `foundation.section.js`, `foundation.topbar.js` and `foundation.tooltips.js`.
* Updated customizer with text direction setting
* Added right-to-left text direction documentation

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.9...v4.1.1).

### 4.0.9- March 19, 2013
* Added `auto` option to `Foundation.section.js.
* Fixes dropdown positioning for split buttons.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.8...v4.0.9).

### 4.0.8- March 15, 2013
* Added paragraph `text-rendering` variable: `$paragraph-text-rendering`.
* Changed blockgrid to use clearfix instead of overflow.
* Fixed nested row margin inside forms.
* Fixed data_options function that caused booleans to be interpreted as numbers.
* Tabs no longer automatically convert to accordion on desktop.
* Sections with accordion class always remain accordions and sections with tab class always remain tabs.
* Vertical and horizontal navigation elements still become accordions on mobile

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.7...v4.0.8).

### 4.0.7- March 14, 2013
* Fixed problem with buggy pull request that made radius buttons look like ovals, sorry.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.6...v4.0.7).

---

### 4.0.6- March 14, 2013 (Yanked)
* Added modular HTML class variables to control whether or no those classes come through into your CSS.
* Changed global font size defaults to 100% to let browsers use their default zooming.
* Fixed bugs with top-bar bottom margin variables.
* Bug fixes for Reveal click event propagation.
* Bug fixes in the Dropdown plugins for positioning.
* Removed duplicate binding in sections.
* Changes all references to `$button-radius` to `$global-radius` to fix customizer blank css files.
* Updated customizer with better groupings in the checkbox section.
* Added data-options support to Orbit.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.5...v4.0.6).

---

### 4.0.5- March 8, 2013
* Custom classes added to custom forms now carry through to JS.
* Added `.horizontal-nav` to `foundation.section.js`.
* Fixed variables that weren't being inherited properly.
* Fixed a joyride mobile background issue.
* Updated Reveal docs to match 4.0.4 functionality.
* Updated to Zepto 1.0.
* Fixed bugs with visibility classes.
* Updated block-grid nth-of-type clear fix so that it actually works.
* All size block grids now have the same spacing.
* Made images `display: inline-block` by default to remove gap and not screw up layouts.
* Progress bars respect their color variables instead of global.
* Added variable for progress bar background color.
* Fixed inconsistency between side margins on unordered and ordered lists.
* Made it so you can set `custom_back_text` variable in top-bar to control if the back link is generic or specific.
* Updated visibility classes to work properly with table display properties.
* Helper classes like `.right, .left` now have `!important` so they don't get overriden on accident.
* Added a page to the docs that explains our use of [media queries](http://foundation.zurb.com/docs/media-queries.html).
* Removed default outline on a:focus elements that normalize adds.
* Fixed bug with custom checkboxes not clickable from the `<span>`.
* Added docs about using Sass standalone with Foundation.

You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.0.4...v4.0.5).

---

### 4.0.4
This patch fixes various bugs that have been submitted since release. We'll be more specific with changelog updates going forward.

---

### 4.0.3
Bug fixes

---

### 4.0.2
Bug fixes

---

### 4.0.1
Bug fixes

---

### **4.0**- February 28, 2013
Initial launch of Foundation 4, a rewritten, mobile-first implementation of the framework. Major enhancements include a mobile-first approach across the board, Scss tools to allow for all-semantic coding, and rewritten JS plugins for speed and ease of use. Marketing site updates, new docs, refined and simplified styles and more. Review the [migration guide](http://foundation.zurb.com/migration.php) for more information.

---

### 3.2.5
Bug fixes

---

### 3.2.4
Bug fixes

---

### 3.2.3
Bug fixes

---

### 3.2.2- November 10, 2012
This patch fixes a typo found in the tabs plugin.

---

### 3.2.1- November 9, 2012
This patch include bug fixes for various elements, such as:
* Adding a missing line for mqueries.scss into app.scss
* Height of fixed magellan element
* Update viewport tag with initial-scale
* Dropdown button fixes
* Clearing bug fixes
* Added a font-smoothing variable
* Added close support to accordions
* Removed deep linking hashes from tabs
* Topbar now resets on close for small layouts

---

### **3.2**- October 26, 2012
With this update we've revamped our documentation to be more organized and explain details regarding Scss, Compass and Javascripts.

The updates to Foundation itself are as follows:
* Added [Magellan](http://foundation.zurb.com/docs/magellan.php), a plugin for building design agnostic sticky navs that know where you are on the page.
* Added [Joyride](http://foundation.zurb.com/docs/joyride.php), our plugin for creating tours of your website or app.
* Added [Clearing](http://foundation.zurb.com/docs/clearing.php), our new responsive image gallery lightbox plugin.
* Cleaned up Orbit a bit. We now use opacity on each slide so you don't have stacking problems or different image size problems. You can now optionally stack slides on mobile. Orbit can now be swipeable on mobile as well.
* Updated Reveal
* Updated index files to use defined header and footer structure
* Cleaned up some Compass included
* RTL for ui and navbar.
* Tabs can now use unordered lists or definition lists, replacing the definition title with an li.section-title.
* Added definition list styles.
* Added mobile-#-up classes to use in conjunction with regular block-grid classes for a different mobile grid.
* Updated block grids to be really flexible and customizable based on a variable.
* Added better responsive styling for tooltips.
* Separated all media queries into their own file for easy dropping.
* Updated modular scale to use new functions, doesn't effect end-users.
* Updated visibility classes to use inherit instead of block to accommodate for spans.
* Removed HTML5 Shiv from header since its included in modernizr.
* Added [pricing tables](http://foundation.zurb.com/docs/elements.php#pricing-tables) UI element
* Added many new Scss variables to control styling for things like: topbar, clearing, joyride, pricing tables, etc.
* Bug fixes for Topbar.
* Added 5 [HTML templates](http://foundation.zurb.com/templates.php) to the add-ons section.

---

### 3.1.1- September 19, 2012
Updating Top Bar navigation implementation pattern to wrap `.contain-to-grid` and/or `.fixed` around the `nav` element to prevent horizontal scroll bars when using `.contain-to-grid`. Updated the topBar breakpoint option so users only need to update the Scss variable.

---

### **3.1**- September 14, 2012
Launched new features, a new Add-ons section to the marketing site, Right to left language support, and fixed bugs.

With this release of Foundation, we include:
* Downloadable HTML template pages that can be copy/pasted into an existing project or added to your project upon downloading from the customizer.
* The Add-on's section includes a round-up of all the playground pieces, etc that aren't officially included in Foundation, but built to work with it. This includes: [Templates](http://foundation.zurb.com/templates.php), [Icon Fonts](http://foundation.zurb.com/icon-fonts.php), [Off-Canvas Layouts](http://foundation.zurb.com/off-canvas.php), [Responsive Tables](http://foundation.zurb.com/responsive-tables.php), [SVG Social Icons](http://foundation.zurb.com/social-icons.php), and [Omnigraffle Stencils](http://foundation.zurb.com/stencils.php).
* Foundation now includes a [responsive top navigation](http://foundation.zurb.com/navigation.php) bar that lets you have control over when it responds and what you include in it. We've made it really easy to customize using Scss.
* Right-to-left language support straight out of the box. You can adjust this in the settings.scss file or upon downloading with the customizer.
* New UI Styles for Progress Bars and Image Thumbs.
* Updated to include jQuery 1.8.1
* Orbit thumbnail documentation.
* Better Reveal size documentation.

---

### 3.0.9- August 14, 2012
Bug fixes and locking down dependencies.

---

### 3.0.8- August 10, 2012
Numerous bugfixes. Added media query toggle plugin. Removed marketing site from repository and included a new `test/` directory to help contributors test patches.

New features: Media Query Toggler, block-grid mobile layouts, font-size customizer options and included modular scale gem as dependency for SCSS version.

---

### 3.0.7- July 30, 2012
Numerous JS bug fixes, added generators for Rails and refactored SCSS directory for better maintainability and scalability over time. CSS files weren't affected by this refactoring.

---

### 3.0.6- July 20, 2012
Numerous bugfixes including dropdown buttons on touch devices, Modernizr update with IE8Compat, split button colors, and more. Split out the functions in app.js to be part of the Gem and only initialized in app.js, so you can keep a clean distinction between your JS and Foundation's (if you want to). Added an [accordion](http://foundation.zurb.com/elements.php) element.

---

### 3.0.5- July 10, 2012
Fixed Compass performance issues by separating out each Foundation file and removing extraneous imports.

---

### 3.0.4- July 6, 2012
Fixed a number of bugs around the Sass/Gem installs and documentation. Some smaller items:
* Fixed a bug with dropdown buttons to allow clicking on their anchors again.
* Added styles for HTML5 (and other) input styles, not just text.
* Added error states back to the forms documentation.
* Flyouts in a nav bar can now expand up as well as down.
* In SCSS you can now set $base-size correctly, but we're still working to correct modifying the $ratio variable.

---

### 3.0.1 to 3.0.3- July 2 to July 4, 2012
Various bug fixes with the downloader, gem, and Sass install.

---

### **3.0**- June 30, 2012
Initial launch of Foundation 3, deprecating Foundation 2.2.1. Major enhancements include Sass/SCSS development, new grid system with box-sizing: border-box, new form styles, new UI elements, retooled download and install options, new docs, new marketing site.


text:
let ko = require('knockout')
require('knockout.validation') // No variable here is deliberate!

let ajax = require('../../../ajax')
let browser = require('../../../browser')
let querystring = require('../../../get-url-parameter')
let BaseViewModel = require('../../BaseViewModel')

import { buildModel, buildFeedback } from './review'

function Details () {
  const self = this

  const accomId = querystring.parameter('accom-id')
  const id = querystring.parameter('id')

  self.review = ko.observable()
  self.feedback = ko.observable()

  self.reviewListingUrl = ko.observable(`../?id=${accomId}`)

  const retrieveItems = () => {
    browser.loading()
    const endpoint = `${self.endpointBuilder.temporaryAccommodation(accomId).build()}/reviews/${id}`
    ajax
      .get(endpoint)
      .then((result) => {
        self.review(buildModel(result.data))
        self.feedback(buildFeedback(result.data))
        browser.loaded()
      }, () => {
        self.handleServerError()
      })
  }

  self.init = () => {
    retrieveItems()
  }

  self.init()
}

Details.prototype = new BaseViewModel()

module.exports = Details

redpajama_set_name: RedPajamaGithub


text:
author: robmyers
comments: true
date: 2006-05-28 06:06:32+00:00
layout: post
slug: minara-selection-buffer-code
title: minara - selection buffer code
wordpress_id: 948
categories:
- Generative Art
- Projects
---

The code that creates the selection buffer. This will act like a translucent drag or ghost drag rather than direct manipulation. Direct manipulation would be slow as we'd have to update the translation in the main buffer and render the whole thing each time. A minara written by a large team of programmers could split the buffer into layers of dragging and non dragging buffers then re-unite them after the drag (the main buffer must _always_ be coherent for other tools or for saving). But currently it's just me so we do it this way.

    (define (highlight-selection win)

(let ((highlight-buffer (ensure-window-buffer win "_highlight")))

(set-buffer-variable! highlight-buffer "x" 0.0)

(set-buffer-variable! highlight-buffer "y" 0.0)

(insert-buffer-text-undoable

highlight-buffer

"(translate (buffer-variable (current-buffer) \"x\") (buffer-variable (current-buffer) \"x\")")

(insert-buffer-text-undoable

highlight-buffer

"(set-colour 1.0 0.0 0.0 0.0)\n(set! old-set-colour set-colour)\n(set! set-colour (lambda (a b c d) #f)\n")

(copy-selection-ranges-to-buffer (main-buffer win) highlight-buffer)

(insert-buffer-text-undoable

highlight-buffer

"(set! set-colour old-set-colour)\n")))

Technorati Tags: [minara](http://www.technorati.com/tag/minara)


text:
<?xml version="1.0"?>
<ruleset name="ganglia-web">
 <description>standard for ganglia-web.</description>

 <!-- Ignore any minified files -->
 <exclude-pattern>*/css/*.min.css</exclude-pattern>
 <exclude-pattern>*/js/*.min.js</exclude-pattern>

 <!-- Ignore external libraries -->
 <exclude-pattern>*/lib/Services/*</exclude-pattern>
 <exclude-pattern>*/lib/Zend/*</exclude-pattern>
 <exclude-pattern>*/lib/Zend/Acl/*</exclude-pattern>

 <rule ref="Generic.Arrays.DisallowShortArraySyntax"/>
 <rule ref="Generic.Classes.DuplicateClassName"/>
 <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
 <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
 <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
 <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
 <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
 <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
 <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
 <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
 <rule ref="Generic.Commenting.DocComment"/>
 <rule ref="Generic.Commenting.Fixme"/>
 <rule ref="Generic.Debug.CSSLint"/>
 <!--rule ref="Generic.Debug.ClosureLinter"/-->
 <rule ref="Generic.Debug.JSHint"/>
 <rule ref="Generic.Files.ByteOrderMark"/>
 <rule ref="Generic.Files.EndFileNewline"/>
 <rule ref="Generic.Files.LineEndings"/>
 <rule ref="Generic.Files.OneClassPerFile"/>
 <rule ref="Generic.Files.OneInterfacePerFile"/>
 <rule ref="Generic.Files.OneTraitPerFile"/>
 <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
 <rule ref="Generic.Functions.CallTimePassByReference"/>
 <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
 <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
 <rule ref="Generic.NamingConventions.ConstructorName"/>
 <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
 <rule ref="Generic.PHP.ClosingPHPTag"/>
 <rule ref="Generic.PHP.DeprecatedFunctions"/>
 <rule ref="Generic.PHP.DisallowShortOpenTag"/>
 <rule ref="Generic.PHP.ForbiddenFunctions"/>
 <rule ref="Generic.PHP.LowerCaseKeyword"/>
 <rule ref="Generic.PHP.SAPIUsage"/>
 <rule ref="Generic.PHP.Syntax"/>
 <!--rule ref="Generic.VersionControl.SubversionProperties"/-->

</ruleset>


text:
import { ModuleWithProviders, NgModule } from "@angular/core";
import { Configuration } from "rollbar";
import { RollbarService, ROLLBAR_CONFIGURATION } from "./rollbar.service";

@NgModule({
  providers: [RollbarService],
})
/**
 * Rollbar Logging support for Angular 2.
 */
export class RollbarModule {
  /**
   *
   * Setup the module in your application's root bootstrap.
   *
   * @static
   * @param {RollbarConfig} config The configuration for Rollbar logging
   * @returns {ModuleWithProviders} The module ready for your bootstrap
   *
   * @memberOf RollbarModule
   */
  static forRoot(config: Configuration): ModuleWithProviders<RollbarModule> {
    return {
      ngModule: RollbarModule,
      providers: [{ provide: ROLLBAR_CONFIGURATION, useValue: config }],
    };
  }
}


text:
import urllib.request
import json

URL = 'https://www.tinkoff.ru/api/v1/currency_rates/'

response = urllib.request.urlopen(URL)
data = response.read().decode(response.headers.get_content_charset())
response.close()
parsedJson = json.loads(data)

def validate_code_vs_name(category_list, valid_code_name_pairs):
    valid_name_code_pairs = {v: k for k, v in valid_code_name_pairs.items()}  # for reversed Name vs Code check
    errors = []  # to collect wrong code<>currency mappings
    for category in category_list:
        validate_currency(category['fromCurrency'], valid_code_name_pairs, valid_name_code_pairs, errors)
        validate_currency(category['toCurrency'], valid_code_name_pairs, valid_name_code_pairs, errors)
    return errors

def validate_currency(currency, valid_code_name_pairs, valid_name_code_pairs, error_collector):
    # print currency
    code = currency['code']
    name = currency['name']
    if (code in valid_code_name_pairs and name != valid_code_name_pairs[code])\
            or (name in valid_name_code_pairs and code != valid_name_code_pairs[name]):
        error_collector.append("wrong currency code <> name mapping: " + str(currency))

valid_code_name_pairs = {643: 'RUB', 840: 'USD', 978: 'EUR', 826: 'GBP'}

errors = validate_code_vs_name(parsedJson['payload']['rates'], valid_code_name_pairs)

print("total errors: ", len(errors))
for err in errors:
    print(err)


text:
<?php

namespace Zend\Crypt\PublicKey\Rsa\Exception;

use Zend\Crypt\Exception;

/**
 * Invalid argument exception
 */
class InvalidArgumentException
    extends Exception\InvalidArgumentException
    implements ExceptionInterface
{
}


text:
package org.apache.cassandra.cql3;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.google.common.base.Objects;
import org.junit.Test;

import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.Keyspace;
import org.apache.cassandra.utils.FBUtilities;

import static org.junit.Assert.fail;

/* ViewComplexTest class has been split into multiple ones because of timeout issues (CASSANDRA-16670, CASSANDRA-17167)
 * Any changes here check if they apply to the other classes:
 * - ViewComplexUpdatesTest
 * - ViewComplexDeletionsTest
 * - ViewComplexTTLTest
 * - ViewComplexTest
 * - ViewComplexLivenessTest
 * - ...
 * - ViewComplex*Test
 */
public class ViewComplexTest extends ViewAbstractParameterizedTest
{
    @Test
    public void testNonBaseColumnInViewPkWithFlush() throws Throwable
    {
        testNonBaseColumnInViewPk(true);
    }

    @Test
    public void testNonBaseColumnInViewPkWithoutFlush() throws Throwable
    {
        testNonBaseColumnInViewPk(false);
    }

    private void testNonBaseColumnInViewPk(boolean flush) throws Throwable
    {
        createTable("create table %s (p1 int, p2 int, v1 int, v2 int, primary key (p1,p2))");

        Keyspace ks = Keyspace.open(keyspace());

        createView("create materialized view %s as select * from %s " +
                   "where p1 is not null and p2 is not null primary key (p2, p1) " +
                   "with gc_grace_seconds=5");
        ColumnFamilyStore cfs = ks.getColumnFamilyStore(currentView());
        cfs.disableAutoCompaction();

        updateView("UPDATE %s USING TIMESTAMP 1 set v1 =1 where p1 = 1 AND p2 = 1;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"), row(1, 1, 1, null));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"), row(1, 1, 1, null));

        updateView("UPDATE %s USING TIMESTAMP 2 set v1 = null, v2 = 1 where p1 = 1 AND p2 = 1;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, 1));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, 1));

        updateView("UPDATE %s USING TIMESTAMP 2 set v2 = null where p1 = 1 AND p2 = 1;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"));

        updateView("INSERT INTO %s (p1,p2) VALUES(1,1) USING TIMESTAMP 3;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, null));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, null));

        updateView("DELETE FROM %s USING TIMESTAMP 4 WHERE p1 =1 AND p2 = 1;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"));

        updateView("UPDATE %s USING TIMESTAMP 5 set v2 = 1 where p1 = 1 AND p2 = 1;");
        if (flush)
            FBUtilities.waitOnFutures(ks.flush());
        assertRowsIgnoringOrder(execute("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, 1));
        assertRowsIgnoringOrder(executeView("SELECT p1, p2, v1, v2 from %s"), row(1, 1, null, 1));
    }

    @Test
    public void testMVWithDifferentColumnsWithFlush() throws Throwable
    {
        testMVWithDifferentColumns(true);
    }

    @Test
    public void testMVWithDifferentColumnsWithoutFlush() throws Throwable
    {
        testMVWithDifferentColumns(false);
    }

    private void testMVWithDifferentColumns(boolean flush) throws Throwable
    {
        createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, f int, PRIMARY KEY(a, b))");

        List<String> viewNames = new ArrayList<>();
        List<String> mvStatements = Arrays.asList(
                                                  // all selected
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT * FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (a,b)",
                                                  // unselected e,f
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT a,b,c,d FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (a,b)",
                                                  // no selected
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT a,b FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (a,b)",
                                                  // all selected, re-order keys
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT * FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (b,a)",
                                                  // unselected e,f, re-order keys
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT a,b,c,d FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (b,a)",
                                                  // no selected, re-order keys
                                                  "CREATE MATERIALIZED VIEW %s AS SELECT a,b FROM %s WHERE a IS NOT NULL AND b IS NOT NULL PRIMARY KEY (b,a)");

        Keyspace ks = Keyspace.open(keyspace());

        for (int i = 0; i < mvStatements.size(); i++)
        {
            String name = createView(mvStatements.get(i));
            viewNames.add(name);
            ks.getColumnFamilyStore(name).disableAutoCompaction();
        }

        // insert
        updateViewWithFlush("INSERT INTO %s (a,b,c,d,e,f) VALUES(1,1,1,1,1,1) using timestamp 1", flush);
        assertBaseViews(row(1, 1, 1, 1, 1, 1), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 2 SET c=0, d=0 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, 0, 0, 1, 1), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 2 SET e=0, f=0 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, 0, 0, 0, 0), viewNames);

        updateViewWithFlush("DELETE FROM %s using timestamp 2 WHERE a=1 AND b=1", flush);
        assertBaseViews(null, viewNames);

        // partial update unselected, selected
        updateViewWithFlush("UPDATE %s using timestamp 3 SET f=1 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, null, null, null, 1), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 4 SET e = 1, f=null WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, null, null, 1, null), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 4 SET e = null WHERE a=1 AND b=1", flush);
        assertBaseViews(null, viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 5 SET c = 1 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, 1, null, null, null), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 5 SET c = null WHERE a=1 AND b=1", flush);
        assertBaseViews(null, viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 6 SET d = 1 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, null, 1, null, null), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 7 SET d = null WHERE a=1 AND b=1", flush);
        assertBaseViews(null, viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 8 SET f = 1 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, null, null, null, 1), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 6 SET c = 1 WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, 1, null, null, 1), viewNames);

        // view row still alive due to c=1@6
        updateViewWithFlush("UPDATE %s using timestamp 8 SET f = null WHERE a=1 AND b=1", flush);
        assertBaseViews(row(1, 1, 1, null, null, null), viewNames);

        updateViewWithFlush("UPDATE %s using timestamp 6 SET c = null WHERE a=1 AND b=1", flush);
        assertBaseViews(null, viewNames);
    }

    private void assertBaseViews(Object[] row, List<String> viewNames) throws Throwable
    {
        UntypedResultSet result = execute("SELECT * FROM %s");
        if (row == null)
            assertRowsIgnoringOrder(result);
        else
            assertRowsIgnoringOrder(result, row);
        for (int i = 0; i < viewNames.size(); i++)
            assertBaseView(result, execute(String.format("SELECT * FROM %s", viewNames.get(i))), viewNames.get(i));
    }

    private void assertBaseView(UntypedResultSet base, UntypedResultSet view, String mv)
    {
        List<ColumnSpecification> baseMeta = base.metadata();
        List<ColumnSpecification> viewMeta = view.metadata();

        Iterator<UntypedResultSet.Row> iter = base.iterator();
        Iterator<UntypedResultSet.Row> viewIter = view.iterator();

        List<UntypedResultSet.Row> baseData = com.google.common.collect.Lists.newArrayList(iter);
        List<UntypedResultSet.Row> viewData = com.google.common.collect.Lists.newArrayList(viewIter);

        if (baseData.size() != viewData.size())
            fail(String.format("Mismatch number of rows in view %s: <%s>, in base <%s>",
                               mv,
                               makeRowStrings(view),
                               makeRowStrings(base)));
        if (baseData.size() == 0)
            return;
        if (viewData.size() != 1)
            fail(String.format("Expect only one row in view %s, but got <%s>",
                               mv,
                               makeRowStrings(view)));

        UntypedResultSet.Row row = baseData.get(0);
        UntypedResultSet.Row viewRow = viewData.get(0);

        Map<String, ByteBuffer> baseValues = new HashMap<>();
        for (int j = 0; j < baseMeta.size(); j++)
        {
            ColumnSpecification column = baseMeta.get(j);
            ByteBuffer actualValue = row.getBytes(column.name.toString());
            baseValues.put(column.name.toString(), actualValue);
        }
        for (int j = 0; j < viewMeta.size(); j++)
        {
            ColumnSpecification column = viewMeta.get(j);
            String name = column.name.toString();
            ByteBuffer viewValue = viewRow.getBytes(name);
            if (!baseValues.containsKey(name))
            {
                fail(String.format("Extra column: %s with value %s in view", name, column.type.compose(viewValue)));
            }
            else if (!Objects.equal(baseValues.get(name), viewValue))
            {
                fail(String.format("Non equal column: %s, expected <%s> but got <%s>",
                                   name,
                                   column.type.compose(baseValues.get(name)),
                                   column.type.compose(viewValue)));
            }
        }
    }
}


text:
@font-face {
  font-family: 'Nexa Bold';
  src: url('/fonts/Nexa Bold.otf');
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}
a,
a:visited,
a:focus,
a:active {
  text-decoration: none;
}
html {
  height: 100%;
  font-size: 16px;
}
body {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
  -webkit-justify-content: flex-start;
  -moz-justify-content: flex-start;
  -ms-justify-content: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  font-weight: 400;
  /* font-family: 'Helvetica Neue', 'Arial', sans-serif; */
  color: #111111;
  line-height: 1.6;
  text-rendering: optimizeLegibility !important;
}
.icon {
  text-rendering: geometricPrecision !important;
}
section {
   -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  /* align-items: center; */
  -webkit-justify-content: center;
  -moz-justify-content: center;
  -ms-justify-content: center;
  justify-content: center;
  align-items: center;
  width: 100%;
  display: block;
  padding-bottom: 0px;
}

section.header .content {
  align-items: center;
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: table;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  width: 100%;
  /* text-align: center; */
}
section.header .logo {
  /* box-sizing: border-box; */
  /* max-width: 100px; */
  /* margin-left: -2em; */
}
section.header .name {
  /* padding-top: 20px; */
  font-size: 50px;
  font-family: 'Nexa Bold', 'Helvetica Neue', 'Arial', 'sans-serif';
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
  color: #333333;
  color: #555555;
}

.left-div
{
  display: table-cell;
  /* max-width: 300px; */
  text-align: right;
  vertical-align: middle;
  width:50vw;
}
.right-div
{
  display: table-cell;
  /* margin: auto 0; */
  text-align: left;
  width:50vw;
  vertical-align: middle;
 /* max-width: 300px; */
}

.navbar-default {
  background-color: transparent;
  border-color: transparent;
}

nav {
  width: 100%;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  /* align-items: center; */
  -webkit-justify-content: center;
  -moz-justify-content: center;
  -ms-justify-content: center;
  justify-content: center;
/* } */

/* nav { */
  /* margin-bottom: 16px; */
}

navi.ul {
  list-style: none;
  text-align: center;
  display: -webkit-inline-flex;
  display: -moz-inline-flex;
  display: -ms-inline-flexbox;
  display: -ms-inline-flex;
  display: inline-flex;
}
nav ul a {
  margin-left: 6px;
  margin-right: 6px;
}
nav ul a:first-child {
  margin-left: 0;
}
nav ul a:last-child {
  margin-right: 0;
}
nav ul li {
  color: #555555;
  font-weight: 400;
  font-size: 14px;
  text-transform: uppercase;
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  -webkit-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -moz-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -ms-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -o-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
nav ul li:hover {
  color: #111111;
}
section.footer  {
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  -ms-justify-content: center;
  justify-content: center;
  flex-direction: column-reverse;
  width: 100%;
  text-align: center;
}
section.footer  a {
  font-size: 14px;
  margin-left: 6px;
  margin-right: 6px;
  opacity: 0.6;
  -webkit-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -moz-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -ms-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -o-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
section.footer  a:first-child {
  margin-left: 0;
}
section.footer a:last-child {
  margin-right: 0;
}
section.footer a:hover {
  opacity: 0.8;
}
section.footer .icon {
  width: 16px;
  height: 16px;
}
section.footer  .copyright {
  flex-grow: 0.5;
  text-align: start;
}
section.footer  .icons {
  flex-grow: 0.5;
  text-align: end;
}
section.main .container {
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
  -webkit-justify-content: flex-start;
  -moz-justify-content: flex-start;
  -ms-justify-content: flex-start;
  justify-content: flex-start;
}
section.main .content {
  color: #111111;
  font-size: 16px;
}
section.main .content .title-container {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-justify-content: space-between;
  -moz-justify-content: space-between;
  -ms-justify-content: space-between;
  justify-content: space-between;
}

section.main .content .posts {
  margin-bottom: 4em;
}
section.main .content .page-heading {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  letter-spacing: -0.005rem;
  text-transform: uppercase;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
  color: #333333;
  margin-bottom: 16px;
}
section.main .content .front-matter .page-heading{
  margin-bottom: 0;
}

section.main .content .front-matter .updates-heading{
  font-size: 17px;
  text-transform: uppercase;
  font-weight: 600;
}
section.main .content .front-matter .update-content{
  font-size: 14px;
  color: rgb(121, 2, 2);
  margin-bottom: 30px;
}
section.main .content .front-matter .update-content li{
  margin-left: 20px;
  list-style-type: circle;
}

section.main .content .front-matter .meta {
  font-size: 14px;
  color: #666666;
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  margin-bottom: 10px;
}
section.main .content .front-matter .date,
section.main .content .front-matter .author,
section.main .content .front-matter .tags,
section.main .content .front-matter .word-count,
section.main .content .front-matter .reading-time .middot {
  display: none;
}
section.main .content .front-matter .middot {
  font-size: 6px;
  margin: 0 6px;
  display: inline;
  vertical-align: middle;
}
section.main .content .front-matter .middot:before {
  content: "•";
}
section.main .content .front-matter .tags ul {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-flex-direction: row;
  -moz-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
}
section.main .content .front-matter .tags ul li {
  -webkit-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -moz-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -ms-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -o-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
section.main .content .front-matter .tags ul li:hover {
  opacity: 0.7;
}
section.main .content .front-matter .tags ul li a {
  color: #666666;
}
section.main .container.f04 {
  -webkit-justify-content: center;
  -moz-justify-content: center;
  -ms-justify-content: center;
  justify-content: center;
}
section.main .container.f04 .content {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
}
section.main .container.f04 .content .num {
  margin: 30px 0px 30px 0;
  font-weight: 400;
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 50px;
}
section.main .container.f04 .content .detail {
  margin-bottom: 40px;
}
section.main .container .content .groupby {
  margin-top: 1em;
  padding-left: 0.5em;
}
section.main .container .content .post-item {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
  display: list-item;
  list-style: disc inside;
}
section.main .container .content .post-item .meta {
  font-size: 14px;
  color: #666666;
  display: none;
  min-width: 100px;
}
section.main .container .content .see-more {
  font-style: italic;
  float: right;
  font-size: 0.9em;
  margin-top: 2em;
  color: #313537;
}
section.main .container .content .see-more:hover {
  color: #666;
}
section {
  padding: 0 16px;
}
section.header-home {
  padding-top: 36px;
}
section.main {
  padding-top: 32px;
  display: block;
}
section.main .container .content .post-item .meta {
    display: block;
}
section.main .container .content .post-item {
    display: flex;
    list-style: none;
}
a {
  color: #428bca;
  -webkit-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -moz-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -ms-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
  -o-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
a:hover {
  color: #2a6496;
}
img {
  max-width: 100%;
}
section.coverimage {
  /* margin: auto; */
  width: 100%;
  max-width: 100%;
}
section.main .content {
    width: 100%;
    /* display: block; */
}
section.main .content .markdown {
  font-size: 1.1em;
  line-height: 1.75em;
  color: #313537;
  font-family: serif;
  font-weight: 300;
}
section.main .content .markdown h1,
section.main .content .markdown h2,
section.main .content .markdown h3,
section.main .content .markdown h4,
section.main .content .markdown h5,
section.main .content .markdown h6 {
  font-size: 22px;
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  letter-spacing: -0.005rem;
  font-weight: 700;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
  color: #333333;
  text-transform: none;
  margin-top: 1.75rem;
}
section.main .content .markdown h1 {
  font-size: 1.75rem;
  margin-bottom: 2rem;
}
section.main .content .markdown h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}
section.main .content .markdown h3 {
  font-size: 1em;
  margin-bottom: 1rem;
}
section.main .content .markdown h4,
section.main .content .markdown h5,
section.main .content .markdown h6 {
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: none;
}
section.main .content .markdown code,
section.main .content .markdown pre {
  font-family: 'Menlo', monospace;
  font-size: 0.98rem;
  background-color: #f7f7f7;
}
section.main .content .markdown code {
  /* enclosed by single backtick (`) */
  padding: .15em .5em;
  border-radius: 2px;
}
section.main .content .markdown pre {
  /* Hugo specific: consider using the 'highlight' shortcode */
  display: block;
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  line-height: 1.5em;
  white-space: pre;
  word-break: break-all;
  word-wrap: break-word;
}
@media (min-width: 769px) {
  section.main .content .markdown pre {
    width: 110%;
    margin-left: -4%;
  }
}
section.main .content .markdown pre code {
  /* enclosed by 4 backticks (````) */
  padding: 0;
  font-size: 0.9rem;
}
section.main .content .markdown a code {
  color: #428bca !important;
}
section.main .content .markdown a code:hover {
  text-decoration: underline;
}
section.main .content .markdown p {
  text-align: justify;
  margin-top: 0;
  margin-bottom: 1em;
}
section.main .content .markdown ul,
section.main .content .markdown ol,
section.main .content .markdown dl {
  margin-top: 1rem;
  margin-bottom: 2rem;
}
section.main .content .markdown dt {
  font-weight: bold;
}
section.main .content .markdown dd {
  margin-bottom: .5rem;
}
section.main .content .markdown ul {
  list-style-type: disc;
  list-style-position: outside;
  margin-bottom: 1.25rem;
}
section.main .content .markdown ol {
  list-style-type: decimal;
  margin-bottom: 1.25rem;
}
section.main .content .markdown li {
  margin-left: 2em;
}
section.main .content .markdown em {
  font-style: italic;
}
section.main .content .markdown strong {
  font-weight: 700;
}
section.main .content .markdown hr {
  position: relative;
  margin: 1.75rem 0;
  border: 0;
  border-top: 1px solid #808080;
  border-top: 1px solid #999999;
}
section.main .content .markdown abbr {
  font-size: 0.85rem;
  font-weight: bold;
  color: #666666;
  text-transform: uppercase;
}
section.main .content .markdown abbr[title] {
  cursor: help;
  border-bottom: 1px dotted #808080;
}
section.main .content .markdown blockquote {
  padding: .5rem 1rem;
  margin: .8rem 0;
  color: #7a7a7a;
  border-left: .25rem solid #e5e5e5;
}
section.main .content .markdown blockquote p:last-child {
  margin-bottom: 0;
}
section.main .content .markdown figure {
  width: 100%;
  background: #fff;
  margin-bottom: 1em;
}
section.main .content .markdown figure img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  position: static;
  margin: auto;
}
section.main .content .markdown table {
  margin-bottom: 1rem;
  width: 100%;
  border: 1px solid #e5e5e5;
  border-collapse: collapse;
}
section.main .content .markdown td,
section.main .content .markdown th {
  padding: .25rem .5rem;
  border: 1px solid #e5e5e5;
}
section.main .content .markdown tbody tr:nth-child(odd) td,
section.main .content .markdown tbody tr:nth-child(odd) th {
  background-color: #f7f7f7;
}
section.main .content .markdown .footnotes ol {
  list-style-type: decimal;
  margin-left: 16px;
}
section.main .content .markdown .footnotes li {
  list-style-type: unset;
}
section.main .content .markdown .footnote-ref {
  font-size: 0.7em;
}
section.main .content .navigation {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
}
section.main .content .navigation div {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: -ms-flex;
  display: flex;
  -webkit-flex-direction: row;
  -moz-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: center;
  -moz-align-items: center;
  -ms-align-items: center;
  align-items: center;
  margin-top: 1em;
}
section.main .content .navigation .icon {
  width: 16px;
  height: 16px;
}
section.main .content .navigation a {
  width: 250px;
  margin-left: 1em;
  text-align: center;
  font-style: italic;
  color: #313537;
}

/* Fonts */

.wf-raleway-n4-active body,
.wf-raleway-n4-active section.header nav ul li,
.wf-raleway-n7-active section.main .content .page-heading,
.wf-raleway-n2-active section.main .container.f04 .content .num,
.wf-raleway-n7-active section.main .content .markdown h1,
.wf-raleway-n7-active section.main .content .markdown h2,
.wf-raleway-n7-active section.main .content .markdown h3,
.wf-raleway-n7-active section.main .content .markdown h4,
.wf-raleway-n7-active section.main .content .markdown h5,
.wf-raleway-n7-active section.main .content .markdown h6 {
  font-family: 'Raleway';
}

.wf-merriweather-n3-active section.main .content .markdown {
  font-family: 'Merriweather';
}

.wf-ubuntu-mono-n4-active section.main .content .markdown code,
.wf-ubuntu-mono-n4-active section.main .content .markdown pre {
  font-family: 'Ubuntu Mono';
}

.no-padding{
  padding-left:0;
  padding-right:0;
  height: 200px;
}
<`2`><`2`>
<`2`><`2`>


text:
import os
from os import path as op

title = 'mne-python flow diagram'

font_face = 'Arial'
node_size = 12
node_small_size = 9
edge_size = 9
sensor_color = '#7bbeca'
source_color = '#ff6347'

legend = """
<

Sensor (M/EEG) space

Source (brain) space

>""" % (edge_size, sensor_color, source_color)
legend = ''.join(legend.split('\n'))

nodes = dict(
    T1='T1',
    flashes='Flash5/30',
    trans='Head-MRI trans',
    recon='Freesurfer surfaces',
    bem='BEM',
    src='Source space\nmne.SourceSpaces',
    cov='Noise covariance\nmne.Covariance',
    fwd='Forward solution\nmne.forward.Forward',
    inv='Inverse operator\nmne.minimum_norm.InverseOperator',
    stc='Source estimate\nmne.SourceEstimate',
    raw='Raw data\nmne.io.Raw',
    epo='Epoched data\nmne.Epochs',
    evo='Averaged data\nmne.Evoked',
    pre='Preprocessed data\nmne.io.Raw',
    legend=legend,
)

sensor_space = ('raw', 'pre', 'epo', 'evo', 'cov')
source_space = ('src', 'stc', 'bem', 'flashes', 'recon', 'T1')

edges = (
    ('T1', 'recon'),
    ('flashes', 'bem'),
    ('recon', 'bem'),
    ('recon', 'src', 'mne.setup_source_space'),
    ('src', 'fwd'),
    ('bem', 'fwd'),
    ('trans', 'fwd', 'mne.make_forward_solution'),
    ('fwd', 'inv'),
    ('cov', 'inv', 'mne.make_inverse_operator'),
    ('inv', 'stc'),
    ('evo', 'stc', 'mne.minimum_norm.apply_inverse'),
    ('raw', 'pre', 'raw.filter\n'
                   'mne.preprocessing.ICA\n'
                   'mne.preprocessing.compute_proj_eog\n'
                   'mne.preprocessing.compute_proj_ecg\n'
                   '...'),
    ('pre', 'epo', 'mne.Epochs'),
    ('epo', 'evo', 'epochs.average'),
    ('epo', 'cov', 'mne.compute_covariance'),
)

subgraphs = (
    [('T1', 'flashes', 'recon', 'bem', 'src'),
     ('<Structural information
'
      'Freesurfer / MNE-C>' % node_small_size)],
)

def setup(app):
    app.connect('builder-inited', generate_flow_diagram)
    app.add_config_value('make_flow_diagram', True, 'html')

def setup_module():
    # HACK: Stop nosetests running setup() above
    pass

def generate_flow_diagram(app):
    out_dir = op.join(app.builder.outdir, '_static')
    if not op.isdir(out_dir):
        os.makedirs(out_dir)
    out_fname = op.join(out_dir, 'mne-python_flow.svg')
    make_flow_diagram = app is None or \
        bool(app.builder.config.make_flow_diagram)
    if not make_flow_diagram:
        print('Skipping flow diagram, webpage will have a missing image')
        return

    import pygraphviz as pgv
    g = pgv.AGraph(name=title, directed=True)

    for key, label in nodes.items():
        label = label.split('\n')
        if len(label) > 1:
            label[0] = ('<' % node_size
                        + label[0] + '')
            for li in range(1, len(label)):
                label[li] = ('' % node_small_size
                             + label[li] + '')
            label[-1] = label[-1] + '>'
            label = '
'.join(label)
        else:
            label = label[0]
        g.add_node(key, shape='plaintext', label=label)

    # Create and customize nodes and edges
    for edge in edges:
        g.add_edge(*edge[:2])
        e = g.get_edge(*edge[:2])
        if len(edge) > 2:
            e.attr['label'] = ('<' +
                               '
'.join(edge[2].split('\n')) +
                               '
>')
        e.attr['fontsize'] = edge_size

    # Change colors
    for these_nodes, color in zip((sensor_space, source_space),
                                  (sensor_color, source_color)):
        for node in these_nodes:
            g.get_node(node).attr['fillcolor'] = color
            g.get_node(node).attr['style'] = 'filled'

    # Create subgraphs
    for si, subgraph in enumerate(subgraphs):
        g.add_subgraph(subgraph[0], 'cluster%s' % si,
                       label=subgraph[1], color='black')

    # Format (sub)graphs
    for gr in g.subgraphs() + [g]:
        for x in [gr.node_attr, gr.edge_attr]:
            x['fontname'] = font_face
    g.node_attr['shape'] = 'box'

    # A couple of special ones
    for ni, node in enumerate(('fwd', 'inv', 'trans')):
        node = g.get_node(node)
        node.attr['gradientangle'] = 270
        colors = (source_color, sensor_color)
        colors = colors if ni == 0 else colors[::-1]
        node.attr['fillcolor'] = ':'.join(colors)
        node.attr['style'] = 'filled'
    del node
    g.get_node('legend').attr.update(shape='plaintext', margin=0, rank='sink')
    # put legend in same rank/level as inverse
    l = g.add_subgraph(['legend', 'inv'], name='legendy')
    l.graph_attr['rank'] = 'same'

    g.layout('dot')
    g.draw(out_fname, format='svg')
    return g

# This is useful for testing/iterating to see what the result looks like
if __name__ == '__main__':
    from mne.io.constants import Bunch
    out_dir = op.abspath(op.join(op.dirname(__file__), '..', 'build', 'html'))
    app = Bunch(builder=Bunch(outdir=out_dir,
                              config=Bunch(make_flow_diagram=True)))
    g = generate_flow_diagram(app)


text:
<?php

namespace EOSAcl\Entity;
use Doctrine\ORM\EntityRepository;

/**
 * Description of PrivilegeRepository
 *
 * @author ennio
 */
class PrivilegeRepository extends EntityRepository
{

}


text:
namespace ozonewayland {

WaylandProxyDisplay::WaylandProxyDisplay(): screen_(NULL) {
  gfx::OzoneDisplay::SetInstance(this);
}

WaylandProxyDisplay::~WaylandProxyDisplay() {
}

// TODO(vignatti): GPU process conceptually is the one that deals with hardware
// details and therefore we assume that the window system connection should
// happen in there only. There's a glitch with Chrome though, that creates its
// frame contents requiring access to the window system, before the GPU process
// even exists. In other words, Chrome runs
// BrowserMainLoop::PreMainMessageLoopRun before GpuProcessHost::Get. If the
// assumption of window system connection belongs to the GPU process is valid,
// then I believe this Chrome behavior needs to be addressed upstream.
//
// For now, we create another window system connection to look ahead the needed
// output properties that Chrome (among others) need and then close right after
// that. I haven't measured how long it takes to open a Wayland connection,
// listen all the interface the compositor sends and close it, but _for_ _sure_
// it slows down the overall initialization time of Chromium targets.
// Therefore, this is something that has to be solved in the future, moving all
// Chrome tasks after GPU process is created.
//
void WaylandProxyDisplay::LookAheadOutputGeometry() {
  wl_display* display = wl_display_connect(NULL);
  if (!display)
    return;

  static const struct wl_registry_listener registry_output = {
    WaylandProxyDisplay::DisplayHandleOutputOnly
  };

  wl_registry* registry = wl_display_get_registry(display);
  wl_registry_add_listener(registry, &registry_output, this);

  if (wl_display_roundtrip(display) > 0) {
    while (screen_->Geometry().IsEmpty())
      wl_display_roundtrip(display);

    ui::EventFactoryOzoneWayland* event_factory =
        ui::EventFactoryOzoneWayland::GetInstance();
    DCHECK(event_factory->GetOutputChangeObserver());

    unsigned width = screen_->Geometry().width();
    unsigned height = screen_->Geometry().height();
    event_factory->GetOutputChangeObserver()->OnOutputSizeChanged(width,
                                                                  height);
  }

  if (screen_) {
    delete screen_;
    screen_ = NULL;
  }

  wl_registry_destroy(registry);
  wl_display_flush(display);
  wl_display_disconnect(display);
}

// static
void WaylandProxyDisplay::DisplayHandleOutputOnly(void *data,
                                             struct wl_registry *registry,
                                             uint32_t name,
                                             const char *interface,
                                             uint32_t version) {
  WaylandProxyDisplay* disp = static_cast<WaylandProxyDisplay*>(data);

  if (strcmp(interface, "wl_output") == 0) {
    WaylandScreen* screen = new WaylandScreen(registry, name);
    disp->screen_ = screen;
  }
}

}  // namespace ozonewayland


text:
"""
OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness
"""
from Tkinter import OptionMenu
from Tkinter import _setit
import copy

class DynOptionMenu(OptionMenu):
    """
    unlike OptionMenu, our kwargs can include highlightthickness
    """
    def __init__(self, master, variable, value, *values, **kwargs):
        #get a copy of kwargs before OptionMenu.__init__ munges them
        kwargsCopy=copy.copy(kwargs)
        if 'highlightthickness' in kwargs.keys():
            del(kwargs['highlightthickness'])
        OptionMenu.__init__(self, master, variable, value, *values, **kwargs)
        self.config(highlightthickness=kwargsCopy.get('highlightthickness'))
        #self.menu=self['menu']
        self.variable=variable
        self.command=kwargs.get('command')

    def SetMenu(self,valueList,value=None):
        """
        clear and reload the menu with a new set of options.
        valueList - list of new options
        value - initial value to set the optionmenu's menubutton to
        """
        self['menu'].delete(0,'end')
        for item in valueList:
            self['menu'].add_command(label=item,
                    command=_setit(self.variable,item,self.command))
        if value:
            self.variable.set(value)


text:
package org.jenkinsci.plugins.globalEventsPlugin.acceptance;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
        strict = false,
        plugin = {"pretty"},
        tags = {"@wip", "~@ignore"}
)
public class WipAcceptanceTests {
}


text:
Simple Wifi enabled Instant messaging platform for School

## Features ##
  - Global Chat-Room
  - Talk to people around the world in a single chat session
  - Encrypted Network traffic (Safe to use)
  - Completely annonymous (The app will work a lot like an IRC chat room; you choose a nickname and join a room full of completely annonymous clients.)

## TODO ##
  - Finish Design Mockups (Specifically for Chat-Room.PSD) - DONE
  - Build Layout for all Activities - DONE
  - Build Chatroom functionality - DONE (to an extent (limited by Server-side))
  - Add Setting to change Nickname while in chatroom - REWORKED --> DONE

## Contact ##
  1sykesben@hdsb.ca or bensykes12@gmail.com

## LISCENSE NOTE ##
  See the LICENSE file for Licensing information with regards to this Repository.


text:
namespace UglyToad.MakeMe.Internal
{
    using System;

    internal class MarsagliaPolar
    {
        private readonly Random random;
        private readonly int distributionMean;
        private readonly double distributionDeviation;

        private int spare;
        private bool isSpareReady;

        public MarsagliaPolar(int minimum, int maximum, Random random)
        {
            this.random = random;
            distributionMean = (((maximum - minimum) / 2) + minimum);
            distributionDeviation = (maximum - minimum) / 3.0;
        }

        /// <summary>
        /// Uses the Marsaglia polar method for generating random normal distributed integers.
        /// </summary>
        /// <returns>An integer in the range defined in the specification.</returns>
        public int GenerateNextInNormalDistribution()
        {
            if (isSpareReady)
            {
                isSpareReady = false;
                return spare;
            }

            double u;
            double v;
            double s;
            do
            {
                u = random.NextDouble() * 2.0 - 1.0;
                v = random.NextDouble() * 2.0 - 1.0;

                s = u * u + v * v;
            } while (s == 0 || s >= 1);

            s = Math.Sqrt((-2 * Math.Log(s)) / s);

            spare = (int)Math.Round((v * s) * distributionDeviation) + distributionMean;
            isSpareReady = true;
            return (int)Math.Round((u * s) * distributionDeviation) + distributionMean;
        }
    }
}


text:
package com.communote.server.persistence.user.group;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import com.communote.server.model.user.group.ExternalUserGroup;
import com.communote.server.model.user.group.ExternalUserGroupImpl;

/**
 *

 * Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
 * ExternalUserGroup.
 *

 *
 * @see ExternalUserGroup
 * @author Communote GmbH - http://www.communote.com/
 */
public abstract class ExternalUserGroupDaoBase extends
        org.springframework.orm.hibernate3.support.HibernateDaoSupport implements
        ExternalUserGroupDao {

    /**
     * @see ExternalUserGroupDao#create(Collection <ExternalUserGroup>)
     */
    @Override
    @SuppressWarnings({ "unchecked" })
    public Collection<ExternalUserGroup> create(final Collection<ExternalUserGroup> entities) {
        return create(TRANSFORM_NONE, entities);
    }

    /**
     * @see ExternalUserGroupDao#create(ExternalUserGroup)
     */
    @Override
    public ExternalUserGroup create(ExternalUserGroup externalUserGroup) {
        return (ExternalUserGroup) this.create(TRANSFORM_NONE, externalUserGroup);
    }

    /**
     * @see ExternalUserGroupDao#create(int, Collection<ExternalUserGroup>)
     */
    @Override
    public Collection<ExternalUserGroup> create(final int transform,
            final Collection<ExternalUserGroup> entities) {
        if (entities == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.create - 'entities' can not be null");
        }
        this.getHibernateTemplate().executeWithNativeSession(
                new org.springframework.orm.hibernate3.HibernateCallback<ExternalUserGroup>() {
                    @Override
                    public ExternalUserGroup doInHibernate(org.hibernate.Session session)
                            throws org.hibernate.HibernateException {
                        for (Iterator<ExternalUserGroup> entityIterator = entities.iterator(); entityIterator
                                .hasNext();) {
                            create(transform, entityIterator.next());
                        }
                        return null;
                    }
                });
        return entities;
    }

    /**
     * @see ExternalUserGroupDao#create(int transform, ExternalUserGroup)
     */
    @Override
    public Object create(final int transform, final ExternalUserGroup externalUserGroup) {
        if (externalUserGroup == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.create - 'externalUserGroup' can not be null");
        }
        this.getHibernateTemplate().save(externalUserGroup);
        return this.transformEntity(transform, externalUserGroup);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void evict(ExternalUserGroup entity) {
        this.getHibernateTemplate().evict(entity);
    }

    @Override
    public ExternalUserGroup findByAdditionalProperty(String additionalProperty,
            String externalSystemId) {
        if (additionalProperty == null) {
            throw new IllegalArgumentException("additionalProperty cannot be null");
        }
        if (externalSystemId == null) {
            throw new IllegalArgumentException("externalSystemId cannot be null");
        }
        return handleFindByAdditionalProperty(additionalProperty, externalSystemId);
    }

    /**
     * @see ExternalUserGroupDao#findByExternalId(String, String)
     */
    @Override
    public ExternalUserGroup findByExternalId(final String externalId, final String externalSystemId) {
        if (externalId == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroupDao.findByExternalId(String externalId, String externalSystemId) - 'externalId' can not be null");
        }
        if (externalSystemId == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroupDao.findByExternalId(String externalId, String externalSystemId) - 'externalSystemId' can not be null");
        }
        try {
            return this.handleFindByExternalId(externalId, externalSystemId);
        } catch (RuntimeException rt) {
            throw new RuntimeException(
                    "Error performing 'ExternalUserGroupDao.findByExternalId(String externalId, String externalSystemId)' --> "
                            + rt, rt);
        }
    }

    /**
     * @see ExternalUserGroupDao#findBySystemId(String)
     */
    @Override
    public List<ExternalUserGroup> findBySystemId(final String systemId) {
        if (systemId == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroupDao.findBySystemId(String systemId) - 'systemId' can not be null");
        }
        try {
            return this.handleFindBySystemId(systemId);
        } catch (RuntimeException rt) {
            throw new RuntimeException(
                    "Error performing 'ExternalUserGroupDao.findBySystemId(String systemId)' --> "
                            + rt, rt);
        }
    }

    /**
     * @see ExternalUserGroupDao#findLatestBySystemId(String, Long, int)
     */
    @Override
    public List<ExternalUserGroup> findLatestBySystemId(final String externalSystemId,
            final Long startId, final int maxCount) {
        if (externalSystemId == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroupDao.findLatestBySystemId(String externalSystemId, Long startId, int maxCount) - 'externalSystemId' can not be null");
        }
        if (startId == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroupDao.findLatestBySystemId(String externalSystemId, Long startId, int maxCount) - 'startId' can not be null");
        }
        try {
            return this.handleFindLatestBySystemId(externalSystemId, startId, maxCount);
        } catch (RuntimeException rt) {
            throw new RuntimeException(
                    "Error performing 'ExternalUserGroupDao.findLatestBySystemId(String externalSystemId, Long startId, int maxCount)' --> "
                            + rt, rt);
        }
    }

    abstract protected ExternalUserGroup handleFindByAdditionalProperty(String additionalProperty,
            String externalSystemId);

    /**
     * Performs the core logic for {@link #findByExternalId(String, String)}
     */
    protected abstract ExternalUserGroup handleFindByExternalId(String externalId,
            String externalSystemId);

    /**
     * Performs the core logic for {@link #findBySystemId(String)}
     */
    protected abstract List<ExternalUserGroup> handleFindBySystemId(String systemId);

    /**
     * Performs the core logic for {@link #findLatestBySystemId(String, Long, int)}
     */
    protected abstract List<ExternalUserGroup> handleFindLatestBySystemId(String externalSystemId,
            Long startId, int maxCount);

    /**
     * @see ExternalUserGroupDao#load(int, Long)
     */
    @Override
    public Object load(final int transform, final Long id) {
        if (id == null) {
            throw new IllegalArgumentException("ExternalUserGroup.load - 'id' can not be null");
        }
        final Object entity = this.getHibernateTemplate().get(ExternalUserGroupImpl.class, id);
        return transformEntity(transform, (ExternalUserGroup) entity);
    }

    /**
     * @see ExternalUserGroupDao#load(Long)
     */
    @Override
    public ExternalUserGroup load(Long id) {
        return (ExternalUserGroup) this.load(TRANSFORM_NONE, id);
    }

    /**
     * @see ExternalUserGroupDao#loadAll()
     */
    @Override
    @SuppressWarnings({ "unchecked" })
    public Collection<ExternalUserGroup> loadAll() {
        return (Collection<ExternalUserGroup>) this.loadAll(TRANSFORM_NONE);
    }

    /**
     * @see ExternalUserGroupDao#loadAll(int)
     */
    @Override
    public Collection<?> loadAll(final int transform) {
        final Collection<?> results = this.getHibernateTemplate().loadAll(
                ExternalUserGroupImpl.class);
        this.transformEntities(transform, results);
        return results;
    }

    /**
     * @see ExternalUserGroupDao#remove(Collection <ExternalUserGroup>)
     */
    @Override
    public void remove(Collection<ExternalUserGroup> entities) {
        if (entities == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.remove - 'entities' can not be null");
        }
        this.getHibernateTemplate().deleteAll(entities);
    }

    /**
     * @see ExternalUserGroupDao#remove(ExternalUserGroup)
     */
    @Override
    public void remove(ExternalUserGroup externalUserGroup) {
        if (externalUserGroup == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.remove - 'externalUserGroup' can not be null");
        }
        this.getHibernateTemplate().delete(externalUserGroup);
    }

    /**
     * @see ExternalUserGroupDao#remove(Long)
     */
    @Override
    public void remove(Long id) {
        if (id == null) {
            throw new IllegalArgumentException("ExternalUserGroup.remove - 'id' can not be null");
        }
        ExternalUserGroup entity = this.load(id);
        if (entity != null) {
            this.remove(entity);
        }
    }

    /**
     * Transforms a collection of entities using the {@link #transformEntity(int,ExternalUserGroup)}
     * method. This method does not instantiate a new collection.
     *

     * This method is to be used internally only.
     *
     * @param transform
     *            one of the constants declared in ExternalUserGroupDao
     * @param entities
     *            the collection of entities to transform
     * @see #transformEntity(int,ExternalUserGroup)
     */
    protected void transformEntities(final int transform, final Collection<?> entities) {
        switch (transform) {
        case TRANSFORM_NONE: // fall-through
        default:
            // do nothing;
        }
    }

    /**
     * Allows transformation of entities into value objects (or something else for that matter),
     * when the transform flag is set to one of the constants defined in
     * ExternalUserGroupDao, please note that the {@link #TRANSFORM_NONE} constant
     * denotes no transformation, so the entity itself will be returned.
     *
     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
     *
     * @param transform
     *            one of the constants declared in {@link ExternalUserGroupDao}
     * @param entity
     *            an entity that was found
     * @return the transformed entity (i.e. new value object, etc)
     * @see #transformEntities(int,Collection)
     */
    protected Object transformEntity(final int transform, final ExternalUserGroup entity) {
        Object target = null;
        if (entity != null) {
            switch (transform) {
            case TRANSFORM_NONE: // fall-through
            default:
                target = entity;
            }
        }
        return target;
    }

    /**
     * @see ExternalUserGroupDao#update(Collection <ExternalUserGroup>)
     */
    @Override
    public void update(final Collection<ExternalUserGroup> entities) {
        if (entities == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.update - 'entities' can not be null");
        }
        this.getHibernateTemplate().executeWithNativeSession(
                new org.springframework.orm.hibernate3.HibernateCallback<ExternalUserGroup>() {
                    @Override
                    public ExternalUserGroup doInHibernate(org.hibernate.Session session)
                            throws org.hibernate.HibernateException {
                        for (Iterator<ExternalUserGroup> entityIterator = entities.iterator(); entityIterator
                                .hasNext();) {
                            update(entityIterator.next());
                        }
                        return null;
                    }
                });
    }

    /**
     * @see ExternalUserGroupDao#update(ExternalUserGroup)
     */
    @Override
    public void update(ExternalUserGroup externalUserGroup) {
        if (externalUserGroup == null) {
            throw new IllegalArgumentException(
                    "ExternalUserGroup.update - 'externalUserGroup' can not be null");
        }
        this.getHibernateTemplate().update(externalUserGroup);
    }

}


text:
package io.innofang.autosms.module.search_message;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;

import io.innofang.autosms.R;
import io.innofang.autosms.base.BaseFragment;

public class SearchMessageFragment extends BaseFragment {

    private EditText mSearchView;

    public static SearchMessageFragment newInstance() {

        Bundle args = new Bundle();
        SearchMessageFragment fragment = new SearchMessageFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_search_message;
    }

    @Override
    protected void createView(View view, Bundle savedInstanceState) {
        mSearchView = (EditText) find(R.id.search_edit_text);

    }

    @Override
    protected void initEvent() {
        mSearchView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                Drawable drawable = mSearchView.getCompoundDrawables()[0];
                if (null == drawable) {
                    return false;
                }
                if (event.getAction() != MotionEvent.ACTION_UP) {
                    return false;
                }
                if (event.getX() < drawable.getIntrinsicWidth()) {
                    if (Build.VERSION.SDK_INT >= 21) {
                        getActivity().finishAfterTransition();
                    } else {
                        getActivity().finish();
                    }
                }
                return false;
            }
        });
    }

}