text:
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Button from 'material-ui/Button';

const styles = theme => ({
  button: {
    margin: theme.spacing.unit,
  },
});

function doSomething(event) {
  // eslint-disable-next-line no-console
  console.log(event.currentTarget.getAttribute('data-something'));
}

function FlatButtons(props) {
  const { classes } = props;
  return (
    <div>
      <Button className={classes.button}>Default</Button>
      <Button color="primary" className={classes.button}>
        Primary
      </Button>
      <Button color="secondary" className={classes.button}>
        Secondary
      </Button>
      <Button disabled className={classes.button}>
        Disabled
      </Button>
      <Button href="#flat-buttons" className={classes.button}>
        Link
      </Button>
      <Button disabled href="/" className={classes.button}>
        Link disabled
      </Button>
      <Button className={classes.button} onClick={doSomething} data-something="here I am">
        Does something
      </Button>
    </div>
  );
}

FlatButtons.propTypes = {
  classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(FlatButtons);


text:
<?php

namespace BitcoinVietnam\BitcoinVietnam\Request\Constants\Constraints;

use BitcoinVietnam\BitcoinVietnam\Request\RequestInterface;

class GetBankaccounts implements RequestInterface
{
    /**
     * @return string
     */
    public function getPath()
    {
        return '/constants/bankaccounts';
    }
}

redpajama_set_name: RedPajamaGithub


text:
This pack is designed to exercise ST2 for class room based training.

It contains a number of branches, each of which contain different things.

__master branch__

This contains the starting point for the class. In this branch is just this README.md.

__class branch__

This contains all of the classroom based artefacts including rules, actions, action-chains and Mistral workflows. If you want to cheat, use this branch. If you accidentally blow your environment away, this branch will trigger memories of the training.

__bob_one branch__
This branch contains the customer example for Bob.

Bob wants to use a vRouter API to get interface information and integrate with ChatOps.

This branch contains a workflow and a custom action parser for the API.

__bob_two branch__
Bob wants more (who would have thought).

Bob now wants to publish credentials into the workflow instead of someone passing them in.

This branch contains a new action which publishes credentials.

__alice_one branch__

Alice wants a place to create and delete VLANs using StackStorm.

This branch offers a sensor which is effectively a webserver.
This webserver offers POST, DELETE and GET verbs. Data created or deleted is via the KV store on StackStorm itself.

__alice_two branch__

Alice forgot, she wanted some rules to prove out the sensor is emitting triggers.

This branch includes rules!

__eve_one branch__

Eve wants to explore network automation specifically.

This branch contains a new workflow that uses components from the DC Fabrics pack.

This workflow specifically allows users of the Brocade VDX to create a point-to-point VNI and map to a VLAN. This VLAN is then presented to a trunked/not-trunked access port.

__eve_two branch__
Eve dropped the bombshell (shock horror) that she has CLI only devices in her network.
She wants to create a VLAN using Alice's sensor and have that push and validate a VLAN out to a Brocade MLXe.

This branch contains Eve's workflow for this. You will also need to install the CLICRUD pack and configure it appropriately for your environment.

#### Other Things

There is a directory containing experimental Python code snippets which may or may not be of use.

This directory is called `pythoncode`.

#### Usage

If you are using this pack, ensure that after each branch change, a reload of st2 is carried out.
`st2ctl reload`.

Some branches will also require a pack configuration step and a subsequent reload of st2 to put the configuration in to the database.


text:
Big Ass Resosource List!
=====================
This is an awesome this of the greatest resources on the web - it's bigger than your mamas arse 😉
Fork it and add your bits.

######Emoji Key:

❤ = my fave   |   🆓 = free   |   💰 = paid.
------------- | ------------- | ------------

##Code-Tools
__Brag, browse, build, demo, share, store test, create & collaborate with these code anywhere sick tools__

_Cool for sudden burst of inspiration, quick demos, storing code references, testing bits_

- [jsBin](http://jsbin.com)
- [jsFiddle](http://jsfiddle.com) ❤
- [codepen](https://Codepen.io)
- [gist](http://gist.github.com) ❤

##Full-Editors
_And these are the big boys for serious shit when your out and about_

- [Visual Studio Online]()
- [Telerik Platform]() ❤❤❤ *this Rocks! Let's me submit my apps to iTunesConnect even on a WINDOWS PC _Fuck Yeah!_*
- [Code Anywhere]() this is pretty good, but seems a little buggy
- [](http://www.blah.com/)

##Markdown and just plain old writing
- [Markable](http://markable.in/) ❤ *nice and easy to use, works even on my Windows Phone, and that is an achievement 🏆
- [Dillenger.io](http://Dillinger.io) *nice, but no flash on phone. Copy/select is dodgy on iPad.*

---

#Javascript Resources.

Click through to the [ JavaScript Extras](/big-ass-resource-list/JavaScript/javascript.md) page for a highly curated list of beginner to advance tutorials and learning resources. ❤

#### Libraries

- [jQuery](http://jquery.com) - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- [Backbone](http://backbonejs.org/) - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
- [AngularJS](http://angularjs.org/) - Conventions based MVC framework for HTML5 apps.
- [Underscore](http://underscorejs.org/) - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
- [lawnchair](http://brian.io/lawnchair/) - Key/value store adapter for indexdb, localStorage and more
- [Handlebars](http://handlebarsjs.com/) - Minimal semantic templating

## Plugins
- [jQueryUI](http://jqueryui.com/) - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.
- [Bootstrap](http://getbootstrap.com/javascript/) - Bring Bootstrap's components to life with over a dozen custom jQuery plugins. Easily include them all, or one by one.
- [Async.js](https://github.com/caolan/async) - Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with node.js, it can also be used directly in the browser. Also supports component.
- [timeago](http://timeago.yarp.com/) - Timeago is a jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
- [Chosen](https://github.com/harvesthq/chosen) - Chosen is a library for making long, unwieldy select boxes more friendly.
- [QTip2](http://qtip2.com/) - Second generation of the advanced tooltip plugin for jQuery
- [spin.js](http://fgnass.github.io/spin.js/) - JS replacement for gif loading spinners
- [Hotkeys](https://github.com/jeresig/jquery.hotkeys) - John Resig's plugin for adding/removing handlers for keyboard events
- [Linkify](https://github.com/uudashr/jquery-linkify) - jQuery plugin to format text containing URL or hashtag into clickable anchor tags.

## Tools
- [Bower](http://bower.io/) - Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
- [Grunt](http://gruntjs.com/) - Javascript Task Runner

## Guides
- [Jasmine](http://pivotal.github.io/jasmine/) - Jasmine is a behavior-driven development framework for testing JavaScript code.
- [Building a Chrome Extension](https://developer.chrome.com/extensions/getstarted.html) - Extensions allow you to add functionality to Chrome without diving deeply into native code. You can create new extensions for Chrome with those core technologies that you're already familiar with from web development: HTML, CSS, and JavaScript.
- [Backbone Tutorials](http://backbonetutorials.com/) - Backbone Tutorials is a collection of tutorials written by Thomas Davis.

---

#Ruby-Resources - Gems

## Gems
- [Bundler](http://bundler.io/) - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
- [rabl](https://github.com/nesquena/rabl) - General ruby templating with json, bson, xml, plist and msgpack support
- [Thin](http://code.macournoyer.com/thin/) - Very fast and lightweight Ruby web server
- [Unicorn](https://github.com/defunkt/unicorn) - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
- [SimpleCov](https://github.com/colszowka/simplecov) - SimpleCov is a code coverage analysis tool for Ruby 1.9.
- [Zeus](https://github.com/burke/zeus) - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
- [factory_girl](https://github.com/thoughtbot/factory_girl) - factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
- [Sass](https://github.com/rails/sass-rails) - This gem provides official integration for Ruby on Rails projects with the Sass stylesheet language.
- [ActiveAdmin](http://www.activeadmin.info/) - Ruby on Rails plugin for generating administration style interfaces
- [Delayed::Job](https://github.com/collectiveidea/delayed_job) - Database based asynchronous priority queue system -- Extracted from Shopify
- [Resque](https://github.com/resque/resque) - Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.

## Tools-and-Services
- [Heroku](https://www.heroku.com/) - Hosting provider for Ruby, Node.js, Clojure, Java, Python and Scala
- [Forward](https://forwardhq.com/) - Forward your localhost to a publicly-accessible url
- [Mandrill](https://mandrillapp.com/) - Transactional email based on MailChimp infrastructure
- [Jenkins](http://jenkins-ci.org/) - Open source continuous integration server
- [travis ci free](https://travis-ci.org/) - continuous integration for open source
- [travis ci ](https://travis-ci.com/) - continueou integration for private repos
- [Codeship](https://codeship.com/) - CODESHIP
- [David-dm](https://david-dm.org/)
- [Version Badge](http://badge.fury.io)
- [Sheilds](http://shields.io/) - ❤❤

## Guides
- [Ruby on Rails Guides](http://guides.rubyonrails.org/) - These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.
- [Better Specs](http://betterspecs.org/) - Collection of "best practices" that other developers learn through years of experience.

---

#Python Resources

## Packages
- [lxml](http://lxml.de/) - Pythonic binding for the C libraries libxml2 and libxslt.
- [boto](http://boto.readthedocs.org/en/latest/) - Python interface to Amazon Web Services
- [Django](https://www.djangoproject.com/) - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
- [Fabric](http://docs.fabfile.org/en/1.8/) - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
- [PyMongo](http://api.mongodb.org/python/current/) - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
- [Celery](https://pypi.python.org/pypi/celery/3.0.19) - Task queue to distribute work across threads or machines.
- [pytz](https://pypi.python.org/pypi/pytz/2013b) - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

## Guides
- [The Django Book](http://www.djangobook.com/en/2.0/index.html) - A free book about the Django Web framework for the Python programming language.
- [The Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/) - This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.

---

#Design Resources

##Icon, Icon Fonts, Web Fonts
- [Font Awesome](http://fontawesome) ❤ you already know!
- [Gylphicons]()
- [Icons8](http://icons8.com) ❤ 💰 🆓
- [Streamline Icons](http://www.streamlineicons.com/)💰 🆓
- [FlatIcons](http://www.flaticon.com/packs/)
- [Google Web Fonts]()
- [Adobe Edge Web Type]()
- [Typekit]()
- [Ico Moon](http://icomoon.com) *roll your own icon font*
- [Minicons](http://www.webalys.com/minicons/index.php) 💰 🆓

##Color:
[Adobe Color](http://color.adobe.com) ❤
[Color Lovers](http://colorlovers.com)

If those sites look a bit overwhelming with the millions of pallets, then check out some of these sites below. They make it a bit easier but not giving you too many choices. It's easy to be dazzled by all the pretty colours.

- [16-Bit Pallets]()
- [more]()
- [more]()

---

## Libraries
- [960 Grid System](http://960.gs/) - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- [Compass](http://compass-style.org/) - Open source CSS Authoring Framework.
- [Bootstrap](http://getbootstrap.com/) - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/) - The iconic font designed for Bootstrap.
- [Zurb Foundation](http://foundation.zurb.com/) - Framework for writing responsive web sites.
- [SASS](http://sass-lang.com/) - CSS extension language which allows variables, mixins and rules nesting.
- [Skeleton](http://www.getskeleton.com/) - Boilerplate for responsive, mobile-friendly development.

## Guides
- [Scalable and Modular Architecture for CSS](http://smacss.com/) - Learn how to structure your CSS to allow for flexibility and maintainability as your project and your team grows.
- [CSS Property Index](http://www.blooberry.com/indexdot/css/propindex/all.htm) - All properties in an easy-to-digest form.

---

#Game Stuff
- Games directory at http://roachhaus.com/games
- Hypnotic at http://games.roachhaus.com/hypnotic
- Pixel Shooter at http://games.roachhaus.com/8bitbang

---

#My Tools - but use the stuff above 👆 they're prob better.
- shrink pings [ting png](https://tinypng.com)
- Playground at http://play.roachhaus.com
- Bootstrapping themes and templates
- News  http://play.roachhaus.com/bootstrapping/news
- Story http://play.roachhaus.com/bootstrapping/story
- Tools http://play.roachhaus.com/bootstrapping/tools
- GreenLanding http://play.roachhaus.com/bootstrapping/GreenLanding
- PurpleLanding http://play.roachhaus.com/bootstrapping)
- Pratt http://play.roachhaus.com/bootstrapping/Pratt)
- BootBundle (http://play.roachhaus.com/bootstrapping/BootBundle)

---


text:
<?php

namespace Fluoresce\Svg\Element;

/**
 * Polygon with rounded corners
 *
 * @author Jaik Dean <jaik@fluoresce.co>
 */
class RoundedPolygon extends Polygon
{
    /**
     * @var float|int Radius
     */
    protected $radius;

    /**
     * @param float|int $radius
     *
     * @return RoundedPolygon
     */
    public function setCornerRadius($radius)
    {
        // TODO Validate the radius value
        $this->radius = $radius;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function draw()
    {
        $path = '';

        if (count($this->points) >= 3) {
            $this->points[] = $this->points[0];
            $pointCount = count($this->points);

            foreach ($this->points as $i => $point) {
                // Skip the first point, we need the calculation from the last point to place it
                if ($i == 0) {
                    continue;
                }

                $prevPoint = $this->points[$i - 1];
                $nextPoint = ($i == $pointCount - 1) ? $this->points[1] : $this->points[$i + 1];

                // Get the start and end points of the curve by getting points toward the previous and next points
                $curveStart = $this->moveTowards($point, $prevPoint);
                $curveEnd = $this->moveTowards($point, $nextPoint);

                // Get the curve control points
                $startControl = $this->moveTowardsFraction($curveStart, $point, 0.5);
                $endControl = $this->moveTowardsFraction($point, $curveEnd, 0.5);

                // Write the line
                $path .= " L {$curveStart[0]} {$curveStart[1]}";

                // Write the curve
                $path .= " C {$startControl[0]} {$startControl[1]} {$endControl[0]} {$endControl[1]} {$curveEnd[0]} {$curveEnd[1]}";
            }

            // Add the start point
            $path = "M {$curveEnd[0]} {$curveEnd[1]}" . $path;

            // Close back to the first point
            $path .= " Z";
        }

        $attr = $this->attributes;
        $attr['d'] = $path;

        return $this->writeTag('path', $attr);
    }

    /**
     * Move a given point towards another point by the defined radius
     *
     * @param array $coordinates        Origin coordinates
     * @param array $towardsCoordinates Coordinates to shift towards
     *
     * @return array
     */
    protected function moveTowards($coordinates, $towardsCoordinates)
    {
        $width = ($towardsCoordinates[0] - $coordinates[0]);
        $height = ($towardsCoordinates[1] - $coordinates[1]);

        $distance = max(1, sqrt($width * $width + $height * $height));

        return $this->moveTowardsFraction($coordinates, $towardsCoordinates, min(1, $this->radius / $distance));
    }

    /**
     * Move a given point a fraction towards another point
     *
     * @param array $coordinates        Origin point
     * @param array $towardsCoordinates Coordinates to shift towards
     * @param float $fraction           Fraction to move by. If 1, the point will be moved all the way.
     *
     * @return array
     */
    protected function moveTowardsFraction($coordinates, $towardsCoordinates, $fraction)
    {
        return [
            $coordinates[0] + ($towardsCoordinates[0] - $coordinates[0]) * $fraction,
            $coordinates[1] + ($towardsCoordinates[1] - $coordinates[1]) * $fraction
        ];
    }
}


text:
#include <stack>
#include "CCLibxml2.h"
#include "CCString.h"
#include "CCSAXParser.h"
#include "support/zip_support/unzip.h"

#include "CCFileUtils.h"
#include "CCDirector.h"

namespace cocos2d {

	typedef enum
	{
		SAX_NONE = 0,
		SAX_KEY,
		SAX_DICT,
		SAX_INT,
		SAX_REAL,
		SAX_STRING,
		SAX_ARRAY
	}CCSAXState;

	static const DWORD dwKey = 0x20100812;
	static const DWORD dwKernel = 0x20120607;

	class CCDictMaker : public CCSAXDelegator
	{
	public:
		CCDictionary<std::string, CCObject*> *m_pRootDict;
		CCDictionary<std::string, CCObject*> *m_pCurDict;
		std::stack<CCDictionary<std::string, CCObject*>*> m_tDictStack;
		std::string m_sCurKey;///< parsed key
		CCSAXState m_tState;
		CCMutableArray<CCObject*> *m_pArray;

		std::stack<CCMutableArray<CCObject*>*> m_tArrayStack;
		std::stack<CCSAXState>  m_tStateStack;

	public:
		CCDictMaker()
			: m_pRootDict(NULL),
			m_pCurDict(NULL),
			m_tState(SAX_NONE),
			m_pArray(NULL)
		{
		}

		virtual ~CCDictMaker()
		{
		}

		CCDictionary<std::string, CCObject*> *dictionaryWithContentsOfFile(const char *pFileName)
		{
			CCSAXParser parser;

			if (false == parser.init("UTF-8"))
			{
				return NULL;
			}
			parser.setDelegator(this);

			parser.parse(pFileName);
			return m_pRootDict;
		}

		void startElement(void *ctx, const char *name, const char **atts)
		{
			CC_UNUSED_PARAM(ctx);
			CC_UNUSED_PARAM(atts);
			std::string sName((char*)name);
			if (sName == "dict")
			{
				m_pCurDict = new CCDictionary<std::string, CCObject*>();
				if (!m_pRootDict)
				{
					// Because it will call m_pCurDict->release() later, so retain here.
					m_pRootDict = m_pCurDict;
					m_pRootDict->retain();
				}
				m_tState = SAX_DICT;

				CCSAXState preState = SAX_NONE;
				if (!m_tStateStack.empty())
				{
					preState = m_tStateStack.top();
				}

				if (SAX_ARRAY == preState)
				{
					// add the dictionary into the array
					m_pArray->addObject(m_pCurDict);
				}
				else if (SAX_DICT == preState)
				{
					// add the dictionary into the pre dictionary
					CCAssert(!m_tDictStack.empty(), "The state is wrong!");
					CCDictionary<std::string, CCObject*>* pPreDict = m_tDictStack.top();
					pPreDict->setObject(m_pCurDict, m_sCurKey);
				}

				m_pCurDict->release();

				// record the dict state
				m_tStateStack.push(m_tState);
				m_tDictStack.push(m_pCurDict);
			}
			else if (sName == "key")
			{
				m_tState = SAX_KEY;
			}
			else if (sName == "integer")
			{
				m_tState = SAX_INT;
			}
			else if (sName == "real")
			{
				m_tState = SAX_REAL;
			}
			else if (sName == "string")
			{
				m_tState = SAX_STRING;
			}
			else if (sName == "array")
			{
				m_tState = SAX_ARRAY;
				m_pArray = new CCMutableArray<CCObject*>();

				CCSAXState preState = m_tStateStack.empty() ? SAX_DICT : m_tStateStack.top();
				if (preState == SAX_DICT)
				{
					m_pCurDict->setObject(m_pArray, m_sCurKey);
				}
				else if (preState == SAX_ARRAY)
				{
					CCAssert(!m_tArrayStack.empty(), "The state is worng!");
					CCMutableArray<CCObject*>* pPreArray = m_tArrayStack.top();
					pPreArray->addObject(m_pArray);
				}
				m_pArray->release();
				// record the array state
				m_tStateStack.push(m_tState);
				m_tArrayStack.push(m_pArray);
			}
			else
			{
				m_tState = SAX_NONE;
			}
		}

		void endElement(void *ctx, const char *name)
		{
			CC_UNUSED_PARAM(ctx);
			CCSAXState curState = m_tStateStack.empty() ? SAX_DICT : m_tStateStack.top();
			std::string sName((char*)name);
			if (sName == "dict")
			{
				m_tStateStack.pop();
				m_tDictStack.pop();
				if (!m_tDictStack.empty())
				{
					m_pCurDict = m_tDictStack.top();
				}
			}
			else if (sName == "array")
			{
				m_tStateStack.pop();
				m_tArrayStack.pop();
				if (!m_tArrayStack.empty())
				{
					m_pArray = m_tArrayStack.top();
				}
			}
			else if (sName == "true")
			{
				CCString *str = new CCString("1");
				if (SAX_ARRAY == curState)
				{
					m_pArray->addObject(str);
				}
				else if (SAX_DICT == curState)
				{
					m_pCurDict->setObject(str, m_sCurKey);
				}
				str->release();
			}
			else if (sName == "false")
			{
				CCString *str = new CCString("0");
				if (SAX_ARRAY == curState)
				{
					m_pArray->addObject(str);
				}
				else if (SAX_DICT == curState)
				{
					m_pCurDict->setObject(str, m_sCurKey);
				}
				str->release();
			}
			m_tState = SAX_NONE;
		}

		void textHandler(void *ctx, const char *ch, int len)
		{
			CC_UNUSED_PARAM(ctx);
			if (m_tState == SAX_NONE)
			{
				return;
			}

			CCSAXState curState = m_tStateStack.empty() ? SAX_DICT : m_tStateStack.top();
			CCString *pText = new CCString();
			pText->m_sString = std::string((char*)ch,0,len);

			switch(m_tState)
			{
			case SAX_KEY:
				m_sCurKey = pText->m_sString;
				break;
			case SAX_INT:
			case SAX_REAL:
			case SAX_STRING:
				{
					CCAssert(!m_sCurKey.empty(), "not found key : <integet/real>");

					if (SAX_ARRAY == curState)
					{
						m_pArray->addObject(pText);
					}
					else if (SAX_DICT == curState)
					{
						m_pCurDict->setObject(pText, m_sCurKey);
					}
					break;
				}
			default:
				break;
			}
			pText->release();
		}
	};

	std::string& CCFileUtils::ccRemoveHDSuffixFromFile(std::string& path)
	{
#if CC_IS_RETINA_DISPLAY_SUPPORTED

		if (CC_CONTENT_SCALE_FACTOR() == 2)
		{
			std::string::size_type pos = path.rfind("/") + 1; // the begin index of last part of path

			std::string::size_type suffixPos = path.rfind(CC_RETINA_DISPLAY_FILENAME_SUFFIX);
			if (std::string::npos != suffixPos && suffixPos > pos)
			{
				CCLog("cocos2d: FilePath(%s) contains suffix(%s), remove it.", path.c_str(),
					CC_RETINA_DISPLAY_FILENAME_SUFFIX);
				path.replace(suffixPos, strlen(CC_RETINA_DISPLAY_FILENAME_SUFFIX), "");
			}
		}

#endif // CC_IS_RETINA_DISPLAY_SUPPORTED

		return path;
	}

	CCDictionary<std::string, CCObject*> *CCFileUtils::dictionaryWithContentsOfFile(const char *pFileName)
	{
		CCDictionary<std::string, CCObject*> *ret = dictionaryWithContentsOfFileThreadSafe(pFileName);
		ret->autorelease();

		return ret;
	}

	CCDictionary<std::string, CCObject*> *CCFileUtils::dictionaryWithContentsOfFileThreadSafe(const char *pFileName)
	{
		CCDictMaker tMaker;
		return tMaker.dictionaryWithContentsOfFile(pFileName);
	}

	unsigned char* CCFileUtils::getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize)
	{
		unsigned char * pBuffer = NULL;
		unzFile pFile = NULL;
		*pSize = 0;

		do
		{
			CC_BREAK_IF(!pszZipFilePath || !pszFileName);
			CC_BREAK_IF(strlen(pszZipFilePath) == 0);

			pFile = unzOpen(pszZipFilePath);
			CC_BREAK_IF(!pFile);

			int nRet = unzLocateFile(pFile, pszFileName, 1);
			CC_BREAK_IF(UNZ_OK != nRet);

			char szFilePathA[260];
			unz_file_info FileInfo;
			nRet = unzGetCurrentFileInfo(pFile, &FileInfo, szFilePathA, sizeof(szFilePathA), NULL, 0, NULL, 0);
			CC_BREAK_IF(UNZ_OK != nRet);

			nRet = unzOpenCurrentFile(pFile);
			CC_BREAK_IF(UNZ_OK != nRet);

			pBuffer = new unsigned char[FileInfo.uncompressed_size];
			int nSize = 0;
			nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size);
			CCAssert(nSize == 0 || nSize == (int)FileInfo.uncompressed_size, "the file size is wrong");

			*pSize = FileInfo.uncompressed_size;
			unzCloseCurrentFile(pFile);
		} while (0);

		if (pFile)
		{
			unzClose(pFile);
		}

		return pBuffer;
	}

	//////////////////////////////////////////////////////////////////////////
	// Notification support when getFileData from invalid file path.
	//////////////////////////////////////////////////////////////////////////
	static bool s_bPopupNotify = true;

	void CCFileUtils::setIsPopupNotify(bool bNotify)
	{
		s_bPopupNotify = bNotify;
	}

	bool CCFileUtils::getIsPopupNotify()
	{
		return s_bPopupNotify;
	}

	//////////////////////////////////////////////////////////////////////////
	// Get file data.
	//////////////////////////////////////////////////////////////////////////
	static bool s_bPackage = false;
	static std::string s_strResourcePath = "";
	static std::string s_strResourceSubPath = "";

	void CCFileUtils::setResourcePath(const char *pszResourcePath, const char *pszResourceSubPath, bool bPackage)
	{
		s_bPackage = bPackage;
		s_strResourcePath = pszResourcePath;
		s_strResourceSubPath = pszResourceSubPath;
	}

	const char* CCFileUtils::getResourcePath(void)
	{
		return s_strResourcePath.c_str();
	}

	const char* CCFileUtils::getResourceSubPath(void)
	{
		return s_strResourceSubPath.c_str();
	}

	bool CCFileUtils::isResourcePackage(void)
	{
		return s_bPackage;
	}

	const char* CCFileUtils::fullPathFromRelativePath(const char *pszRelativePath)
	{
		CCString * pRet = new CCString();
		pRet->autorelease();

		if (s_bPackage)
		{
			pRet->m_sString = s_strResourceSubPath;
			pRet->m_sString += pszRelativePath;
		}
		else
		{
			pRet->m_sString = s_strResourcePath;
			pRet->m_sString += pszRelativePath;
		}

		return pRet->m_sString.c_str();
	}

	const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
	{
		std::string relativeFile = pszRelativeFile;
		CCString *pRet = new CCString();
		pRet->autorelease();
		pRet->m_sString = relativeFile.substr(0, relativeFile.rfind('/')+1);
		pRet->m_sString += pszFilename;
		return pRet->m_sString.c_str();
	}

	unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
	{
		unsigned char * pData = 0;

		if ((! pszFileName) || (! pszMode))
		{
			return 0;
		}

		if (s_bPackage)
		{
			pData = getFileDataFromZip(s_strResourcePath.c_str(), pszFileName, pSize);
		}
		else
		{
			do
			{
				FILE *fp = fopen(pszFileName, pszMode);
				CC_BREAK_IF(!fp);

				unsigned long size;
				fseek(fp, 0, SEEK_END);
				size = ftell(fp);
				fseek(fp, 0, SEEK_SET);
				pData = new unsigned char[size];
				size = fread(pData, sizeof(unsigned char), size, fp);
				fclose(fp);

				if (pSize)
				{
					*pSize = size;
				}
			} while (0);
		}

		if (!pData)
		{
			if (getIsPopupNotify())
			{
				std::string title = "Notification";
				std::string msg = "Get data from file(";
				msg.append(pszFileName).append(") failed!");
				CCMessageBox(msg.c_str(), title.c_str());
			}
		}
#ifndef _DEV_
		else
		{
			DWORD dwRandom = dwKey*dwKernel;
			for (unsigned long index = 0; index < *pSize; index++)
			{
				pData[index] -= (unsigned char)dwRandom;
			}
		}
#endif

		return pData;
	}

	void CCFileUtils::setResource(const char* pszZipFileName)
	{
		CCAssert(0, "Have not implement!");
	}

	int CCFileUtils::ccLoadFileIntoMemory(const char *filename, unsigned char **out)
	{
		CCAssert(0, "Have not implement!");
		return 0;
	}

	std::string CCFileUtils::getWriteablePath()
	{
		CCAssert(0, "Have not implement!");
		return "";
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">DaggerExample</string>
    <string name="info">This is an example using Dagger for Dependency Injection. The TimeService is injected into MainActivity.</string>
    <string name="action_settings">Settings</string>
    <string name="time_now">Time now:</string>
    <string name="time_tomorrow">This time tomorrow:</string>
    <string name="refresh_time">Refresh Time</string>
    <string name="go_to_next_activity">Go to next Activity</string>
    <string name="title_activity_multiple_dependency">MultipleDependencyActivity</string>
    <string name="hello_world">Hello world!</string>
    <string name="go_back">Go Back</string>
    <string name="new_string">Generate New String</string>

</resources>


text:
using System;
using SemanticComparison;
using Xunit;

namespace SemanticComparisonUnitTest
{
    public class ProxyCreationExceptionTest
    {
        [Fact]
        public void SutIsException()
        {
            // Fixture setup
            // Exercise system
            var sut = new ProxyCreationException();
            // Verify outcome
            Assert.IsAssignableFrom<Exception>(sut);
            // Teardown
        }

        [Fact]
        public void SutHasDefaultConstructor()
        {
            // Fixture setup
            // Exercise system and verify outcome
            Assert.Null(Record.Exception(() =>
                new ProxyCreationException()));
            // Teardown
        }

        [Fact]
        public void InitializedWithDefaultConstructorHasMessage()
        {
            // Fixture setup
            var sut = new ProxyCreationException();
            // Exercise system
            var result = sut.Message;
            // Verify outcome
            Assert.False(string.IsNullOrEmpty(result));
            // Teardown
        }

        [Fact]
        public void InitializedWithMessageHasCorrectMessage()
        {
            // Fixture setup
            var expectedMessage = Guid.NewGuid().ToString();
            var sut = new ProxyCreationException(expectedMessage);
            // Exercise system
            var result = sut.Message;
            // Verify outcome
            Assert.Equal(expectedMessage, result);
            // Teardown
        }

        [Fact]
        public void InitializedWithMessageAndInnerExceptionHasCorrectMessage()
        {
            // Fixture setup
            var expectedMessage = Guid.NewGuid().ToString();
            var dummyException = new Exception();
            var sut = new ProxyCreationException(expectedMessage, dummyException);
            // Exercise system
            var result = sut.Message;
            // Verify outcome
            Assert.Equal(expectedMessage, result);
            // Teardown
        }

        [Fact]
        public void InitializedWithMessageAndInnerExceptionHasInnerException()
        {
            // Fixture setup
            var dummyMessage = "Anonymous text";
            var expectedException = new Exception();
            var sut = new ProxyCreationException(dummyMessage, expectedException);
            // Exercise system
            var result = sut.InnerException;
            // Verify outcome
            Assert.Equal(expectedException, result);
            // Teardown
        }
    }
}


text:
package com.github.anba.es6draft.runtime.objects;

import com.github.anba.es6draft.runtime.Realm;
import com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject;

/**
 *
20 Numbers and Dates

 *
20.3 Date Objects

 *

 *
20.3.5 Properties of Date Instances
 *

 */
public final class DateObject extends OrdinaryObject {
    /** [[DateValue]] */
    private double dateValue;

    private boolean initialised = false;

    public DateObject(Realm realm) {
        super(realm);
    }

    public boolean isInitialised() {
        return initialised;
    }

    /**
     * [[DateValue]]
     */
    public double getDateValue() {
        return dateValue;
    }

    /**
     * [[DateValue]]
     */
    public void setDateValue(double dateValue) {
        this.initialised = true;
        this.dateValue = dateValue;
    }
}


text:
id: 587d7b7e367417b2b2512b22
title: Use the parseInt Function with a Radix
challengeType: 1
videoUrl: 'https://scrimba.com/c/c6K4Kh3'
forumTopicId: 301182
---

## Description

The parseInt() function parses a string and returns an integer. It takes a second argument for the radix, which specifies the base of the number in the string. The radix can be an integer between 2 and 36.
The function call looks like:
parseInt(string, radix);
And here's an example:
var a = parseInt("11", 2);
The radix variable says that "11" is in the binary system, or base 2. This example converts the string "11" to an integer 3.

## Instructions

Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it.

## Tests

```yml
tests:
  - text: <code>convertToInteger</code> should use the <code>parseInt()</code> function
    testString: assert(/parseInt/g.test(code));
  - text: <code>convertToInteger("10011")</code> should return a number
    testString: assert(typeof(convertToInteger("10011")) === "number");
  - text: <code>convertToInteger("10011")</code> should return 19
    testString: assert(convertToInteger("10011") === 19);
  - text: <code>convertToInteger("111001")</code> should return 57
    testString: assert(convertToInteger("111001") === 57);
  - text: <code>convertToInteger("JamesBond")</code> should return NaN
    testString: assert.isNaN(convertToInteger("JamesBond"));

```

## Challenge Seed

```js
function convertToInteger(str) {

}

convertToInteger("10011");
```

## Solution

```js
function convertToInteger(str) {
  return parseInt(str, 2);
}
```


text:
package org.lwjgl.examples.spaceinvaders;

import static org.lwjgl.opengl.GL11.*;

/**
 * A texture to be bound within OpenGL. This object is responsible for
 * keeping track of a given OpenGL texture and for calculating the
 * texturing mapping coordinates of the full image.
 *
 * Since textures need to be powers of 2 the actual texture may be
 * considerably bigged that the source image and hence the texture
 * mapping coordinates need to be adjusted to matchup drawing the
 * sprite against the texture.
 *
 * @author Kevin Glass
 * @author Brian Matzon
 */
public class Texture {

	/** The GL target type */
	private int		target;

	/** The GL texture ID */
	private int		textureID;

	/** The height of the image */
	private int		height;

	/** The width of the image */
	private int		width;

	/** The width of the texture */
	private int		texWidth;

	/** The height of the texture */
	private int		texHeight;

	/** The ratio of the width of the image to the texture */
	private float	widthRatio;

	/** The ratio of the height of the image to the texture */
	private float	heightRatio;

	/**
	 * Create a new texture
	 *
	 * @param target The GL target
	 * @param textureID The GL texture ID
	 */
	public Texture(int target, int textureID) {
		this.target = target;
		this.textureID = textureID;
	}

	/**
	 * Bind the specified GL context to a texture
	 */
	public void bind() {
		glBindTexture(target, textureID);
	}

	/**
	 * Set the height of the image
	 *
	 * @param height The height of the image
	 */
	public void setHeight(int height) {
		this.height = height;
		setHeight();
	}

	/**
	 * Set the width of the image
	 *
	 * @param width The width of the image
	 */
	public void setWidth(int width) {
		this.width = width;
		setWidth();
	}

	/**
	 * Get the height of the original image
	 *
	 * @return The height of the original image
	 */
	public int getImageHeight() {
		return height;
	}

	/**
	 * Get the width of the original image
	 *
	 * @return The width of the original image
	 */
	public int getImageWidth() {
		return width;
	}

	/**
	 * Get the height of the physical texture
	 *
	 * @return The height of physical texture
	 */
	public float getHeight() {
		return heightRatio;
	}

	/**
	 * Get the width of the physical texture
	 *
	 * @return The width of physical texture
	 */
	public float getWidth() {
		return widthRatio;
	}

	/**
	 * Set the height of this texture
	 *
	 * @param texHeight The height of the texture
	 */
	public void setTextureHeight(int texHeight) {
		this.texHeight = texHeight;
		setHeight();
	}

	/**
	 * Set the width of this texture
	 *
	 * @param texWidth The width of the texture
	 */
	public void setTextureWidth(int texWidth) {
		this.texWidth = texWidth;
		setWidth();
	}

	/**
	 * Set the height of the texture. This will update the
	 * ratio also.
	 */
	private void setHeight() {
		if (texHeight != 0) {
			heightRatio = ((float) height) / texHeight;
		}
	}

	/**
	 * Set the width of the texture. This will update the
	 * ratio also.
	 */
	private void setWidth() {
		if (texWidth != 0) {
			widthRatio = ((float) width) / texWidth;
		}
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <title>MS-GFDB Modification File Example</title>
    <link type="text/css" rel="stylesheet" href="style.css" />

MS-GFDB Modification File Example

      Added by Sangtae Kim, last edited by Sangtae Kim on May 17, 2011

    MS-GF+ Documentation home
    MS-GFDB help page

# This file is used to specify modifications

      # # for comments

      #

      # Max Number of Modifications per peptide (default 2). If this value is large, the search takes long.

      NumMods=2

# To input a modification, use the following command:

      # Mass or CompositionStr, Residues, ModType, Position, Name (all the five fields are required).

      # CompositionStr (C[Num]H[Num]N[Num]O[Num]S[Num]P[Num])

      #     - C (Carbon), H (Hydrogen), N (Nitrogen), O (Oxygen), S (Sulfer) and P (Phosphorus) are allowed.

      #     - Atom can be omitted. The sequence of atoms must be followed.

      #     - Negative numbers are allowed.

      #     - E.g. C2H2O1 (valid), H2C1O1 (invalid)

      # Mass can be used instead of CompositionStr. It is important to specify accurate masses (integer masses are insufficient).

      #     - E.g. 15.994915

      # Residues: affected amino acids (must be upper letters)

      #     - Must be uppor letters or *

      #     - Use * if this modification is applicable to any residue.

      #     - * should not be "anywhere" modification (e.g. "15.994915, *, opt, any, Oxidation" is not allowed.)

      #     - E.g. NQ, *

      # ModType: "fix" for fixed modifications, "opt" for variable modifications (case insensitive)

      # Position: position in the peptide where the modification can be attached.

      #     - One of the following five values should be used:

      #     - any (anywhere), N-term (peptide N-term), C-term (peptide C-term), Prot-N-term (protein N-term), Prot-C-term (protein C-term)

      #     - Case insensitive

      #     - "-" can be omitted

      #     - E.g. any, Any, Prot-n-Term, ProtNTerm => all valid

      # Name: name of the modification

      #     - E.g. Oxidation

C2H3N1O1,C,fix,any,Carbamidomethylation     # Fixed Carbamidomethyl C

# Variable Modifications (default: none)

      O1,M,opt,any,Oxidation                # Oxidation M

      #15.994915,M,opt,any,Oxidation            # Oxidation M (mass is used instead of CompositionStr)

      #H-1N-1O1,NQ,opt,any,Deamidation        # Negative numbers are allowed.

      #C2H3NO,*,opt,N-term,Carbamidomethylation    # Variable Carbamidomethyl N-term

      #H-2O-1,E,opt,N-term,Pyro-glu            # Pyro-glu from E

      #H-3N-1,Q,opt,N-term,Pyro-glu            # Pyro-glu from Q

      #C2H2O,*,opt,Prot-N-term,Acetylation        # Acetylation Protein N-term

      #C2H2O1,K,opt,any,Acetylation            # Acetylation K

      #CH2,K,opt,any,Methylation            # Methylation K

      #H3O4P,STY,opt,any,Phosphorylation        # Phosphorylation STY


text:
package org.gdg.frisbee.android.eventseries;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import org.gdg.frisbee.android.Const;
import org.gdg.frisbee.android.app.App;
import org.gdg.frisbee.android.app.OrganizerChecker;

public class TaggedEventSeriesNotificationService extends Service implements OrganizerChecker.Callbacks {

    private static final int NOTIFICATION_ID = 1;
    private Intent intent;

    public TaggedEventSeriesNotificationService() {
    }

    @Override
    public void onCreate() {
        super.onCreate();
        App.from(this).checkOrganizer(this);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        this.intent = intent;
        return START_STICKY;
    }

    @Override
    public void onOrganizerResponse(boolean isOrganizer) {
        if (isOrganizer || intent.getBooleanExtra(Const.EXTRA_ALARM_FOR_ALL, true)) {
            TaggedEventSeries eventSeries = intent.getParcelableExtra(Const.EXTRA_TAGGED_EVENT);
            NotificationHandler notificationHandler = new NotificationHandler(this, eventSeries);
            Notification notification = notificationHandler.createNotification();

            NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
            nm.notify(NOTIFICATION_ID, notification);
        }

        stop();
    }

    @Override
    public void onErrorResponse() {
        stop();
    }

    private void stop() {
        stopSelf();
        NotificationReceiver.completeWakefulIntent(intent);
    }
}


text:
var conf = require('../config.json');
var gulp = require('gulp');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync').create();

gulp.task('browser-sync:build', function() {
  'use strict';
  browserSync.init({
    server: {
      baseDir: conf.base.build
    },
    reloadDebounce: 2000
  });
});

gulp.task('browser-sync:compile', function() {
  'use strict';
  browserSync.init({
    server: {
      baseDir: conf.base.compile
    },
    reloadDebounce: 2000
  });
});

gulp.task('watch', function () {
  'use strict';
  gulp.watch(conf.base.src + conf.path.sass + conf.files.sassAll, ['sass', browserSync.reload]);
  gulp.watch(conf.base.src + conf.path.js + conf.files.js, ['js:build', browserSync.reload]);
  gulp.watch(conf.base.src + conf.path.js + conf.files.ts, ['ts:build', browserSync.reload]);
  gulp.watch(conf.base.src + conf.files.pug, ['pug:build', browserSync.reload]);
  gulp.watch([conf.base.src + conf.files.html, conf.base.src + conf.files.tmpl], ['html:build', browserSync.reload]);
});


text:
__Compote__ is a prototype tool for manipulating _Parameterised Graphs_ (PGs) algebraically. The tool is written mostly in Haskell with some inclusions of C++ code.

## Documentation

You can find some relevant papers in the __/doc/papers__ folder.

More details to come :-)


text:
<!DOCTYPE html>

        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta name="theme-color" content="#C60000">
        <meta property="og:locale" content="en_US"/>
        <meta property="og:site_name" content="Ubeat"/>
        <meta property="og:title" content="Ubeat"/>
        <meta property="og:type" content="website"/>
        <meta property="og:url" content="http://miramo.github.io/Ubeat/"/>
        <meta property="og:image" content="http://miramo.github.io/Ubeat/img/logo/logo-Ubeat.png"/>
        <meta property="og:image:width" content="1500"/>
        <meta property="og:image:height" content="600"/>
        <meta property="og:description" content="Ubeat is free music and so much more."/>
        <title ng-bind="sharedPagesStatus.getTitle() ? sharedPagesStatus.getTitle() + ' - Ubeat' : 'Ubeat'">Ubeat</title>
        <link rel="shortcut icon" type="image/x-icon" href="img/logo/logo.png"/>
        <link rel="image_src" href="http://miramo.github.io/Ubeat/img/logo/logo-Ubeat.png"/>
        <link rel="stylesheet" href="stylesheets/app.css"/>

        <headroom tolerance='2' offset='48' classes="{pinned:'headroom--pinned',unpinned:'headroom--unpinned',initial:'headroom'}">

        </headroom>

            <loader ng-hide="sharedPagesStatus.getIsPageLoaded()"></loader>

                <error-msg error-nb="Error {{sharedPagesStatus.getErrorStatus()}}" msg="{{sharedPagesStatus.getErrorMessage()}}"></error-msg>


text:
/*jslint node: true*/
'use strict';

var async = require('async');
var filemanDateUtil = require('../../utils/filemanDateUtil');
var getVistaRpcConfiguration = require('../../utils/rpc/rpcUtil').getVistaRpcConfiguration;
var mathjs = require('mathjs');
var nullChecker = require('../../utils/nullchecker/nullchecker');
var paramUtil = require('../../utils/paramUtil');
var rdk = require('../../rdk/rdk');
var VistaJS = require('../../VistaJS/VistaJS');
var format = require('util').format;

var errorVistaJSCallback = 'VistaJS RPC callback error: ';
var errorMessage = 'There was an error processing your request. The error has been logged.';

var params = {
    post: {
        dfn: {
            required: true,
            description: 'the patient IEN'
        },
        duz: {
            required: true,
            description: 'the user duz (IEN) adding a new vital'
        },
        locIEN: {
            required: true,
            description: 'the location (visit) IEN'
        },
        vitals: {
            required: true,
            description: 'an array of vital objects',
            vital: {
                fileIEN: {
                    required: true,
                    description: 'a required variable of a vital object; the vital IEN'
                },
                reading: {
                    required: true,
                    description: 'a required variable of a vital object; the vital reading value'
                },
                flowRate: {
                    required: false,
                    description: 'an optional variable of the vital object; the Pulse Oximetry flow rate integer value as a string'
                },
                o2Concentration: {
                    required: false,
                    description: 'an optional variable of the vital object; the Pulse Oximetry percentage value represented as an integer as a string, i.e. 90 for 90%'
                },
                unit: {
                    required: false,
                    description: 'valid units are "C" for Celsius, "cm" for centimeters, "kg" for kilogram, "mmHG" for millimeter of mercury, this unit value can be blank for default values'
                },
                qualifiers: {
                    required: false,
                    description: 'an array of qualifiers IENs'
                }
            }
        }
    }
};

function getResourceConfig() {
    return [{
        name: '',
        path: '',
        post: writeBackVitals,
        parameters: params,
        description: {
            post: 'Adds vitals to a patient'
        },

        interceptors: {
            audit: true,
            metrics: true,
            authentication: true,
            pep: true,
            operationalDataCheck: true,
            synchronize: true,
            jdsFiler: true
        },
        healthcheck: {
            dependencies: ['jds', 'solr', 'jdsSync', 'authorization']
        },
        permissions: ['add-patient-vital']
    }];
}

/**
 *  Performs the vitals write back to VistA. The post req expects a param variable with a JSON object
 *  in the format below. Uses the site id that is stored in the user session.
 *
 *  param = {
 *      dateTime: 'YYYYMMDD HHmm'
 *      dfn: 'dfn',
 *      duz: 'duz',
 *      locIEN: 'location',
 *      vitals: [{
 *          fileIEN: 'fileIEN',
 *          reading: 'reading',
 *          flowRate: 'flowRate', //integer as string
 *          o2Concentration: 'o2Concentration', //percentage represented as integer as string, i.e. 90 for 90%
 *          unit: 'C' || 'cm' || 'kg' || 'mmHG' || <blank>,
 *          qualifiers: ['qualifierIEN1', 'qualifierIEN2', ...]
 *      }
 *  }
 *
 *
 *  {
    "param" :
    {
        "dateTime": "20150502",
        "dfn":"3", "duz"
    :
        "10000000224", "locIEN"
    :
        "67", "vitals"
    :
        [{"fileIEN": "1", "reading": "80/20", "qualifiers": ["23", "59", "100"]}, {
            "fileIEN": "3",
            "reading": "57",
            "qualifiers": ["47", "50"]
        }]
    }
}
 */
function writeBackVitals(req, res) {
    req.logger.info('perform vitals write back');

    var userSession;
    var originatorIEN;
    var site;

    try {
        userSession = req.session.user;
        site = userSession.site;
        originatorIEN = userSession.duz[site];
    } catch (e) {
        res.status(rdk.httpstatus.internal_server_error).send('Required authentication data is not present in request.');
        return;
    }

    var input = req.body.param;
    var checkedInput = verifyInput(input);
    if (!checkedInput.valid) {
        req.logger.error(checkedInput.errMsg);
        res.status(rdk.httpstatus.internal_server_error).send(checkedInput.errMsg);
        return;
    }

    req.logger.debug(format('passed in parameters are: %j', input));

    var eventDateTimeMoment = paramUtil.convertWriteBackInputDate(input.dateTime);
    var eventFilemanYear = filemanDateUtil.getFilemanDateWithArgAsStr(eventDateTimeMoment.format(paramUtil.WRITEBACK_INPUT_DATE_FORMAT));
    if (eventFilemanYear === -1) {
        var errorMessage = 'DateTime is not a valid date: ' + input.dateTime;
        req.logger.error(errorMessage);
        res.status(rdk.httpstatus.internal_server_error).send(errorMessage);
        return;
    }

    var currentTime = eventFilemanYear + '.' + eventDateTimeMoment.format(paramUtil.WRITEBACK_INPUT_TIME_FORMAT);
    var vitals = [];
    input.vitals.forEach(function(element) {
        var rpcArray = [];
        rpcArray.push(currentTime, input.dfn);

        var vitalRPCDelimitedStr = '';
        vitalRPCDelimitedStr += element.fileIEN + ';';

        var reading = element.reading;

        if (nullChecker.isNotNullish(element.unit)) {
            if (element.unit.toUpperCase() === 'C') {
                reading = paramUtil.celsiusToFahrenheit(reading);
            }

            if (element.unit.toUpperCase() === 'CM') {
                var cmUnit = mathjs.unit(parseFloat(reading), 'cm');
                reading = cmUnit.toNumber('inch');
            }

            if (element.unit.toUpperCase() === 'KG') {
                var kgUnit = mathjs.unit(parseFloat(reading), 'kg');
                reading = kgUnit.toNumber('lb');
            }

            if (element.unit.toUpperCase() === 'MMHG') {
                reading = paramUtil.mmHGToCmH2O(reading);
            }
        }

        var flowRate = '';

        if (nullChecker.isNotNullish(element.flowRate)) {
            flowRate = element.flowRate + ' l/min';
        }

        var o2Concentration = '';

        if (nullChecker.isNotNullish(element.o2Concentration)) {
            if (nullChecker.isNotNullish(flowRate)) {
                o2Concentration = ' ' + element.o2Concentration + '%';
            } else {
                o2Concentration = element.o2Concentration + '%';
            }
        }

        vitalRPCDelimitedStr += reading + ';' + flowRate + o2Concentration;
        rpcArray.push(vitalRPCDelimitedStr);
        rpcArray.push(input.locIEN);

        //var qualifiersRPCDelimitedStr = input.duz + '*';
        var qualifiersRPCDelimitedStr = originatorIEN + '*';
        qualifiersRPCDelimitedStr += paramUtil.convertArrayToRPCParameters(element.qualifiers, ':');
        rpcArray.push(qualifiersRPCDelimitedStr);
        vitals.push(rpcArray);
    });

    async.each(vitals,
        function(vital, callback) {
            var rpcDelimitedStr = paramUtil.convertArrayToRPCParameters(vital);
            req.logger.debug(format('adding vital: %j', vital));
            req.logger.debug(format('rcpDelimitedStr: %j', rpcDelimitedStr));

            VistaJS.callRpc(req.logger, getVistaRpcConfiguration(req.app.config, req.session.user.site), 'GMV ADD VM', rpcDelimitedStr, function(error, result) {
                req.logger.info('Writeback result: ' + result);
                callback(error);
            });
        },
        function(error) {
            if (error) {
                req.logger.error(errorVistaJSCallback + error);
                res.status(rdk.httpstatus.internal_server_error).send(errorMessage);
            } else {
                req.logger.info('Successfully wrote back to VistA.');
                res.status(rdk.httpstatus.ok).send(new paramUtil.returnObject([]));
            }
        });
}

/**
 *  Verifies the JSON object passed from the front-end to ensure that all necessary data
 *  is complete.
 */
function verifyInput(input) {
    var retObj = {
        'valid': true,
        'errMsg' : ''
    };

    if (nullChecker.isNullish(input.dateTime)) {
        retObj.errMsg += 'The patient dateTime is required.\n';
        retObj.valid = false;
    }

    if (nullChecker.isNullish(input.dfn)) {
        retObj.errMsg += 'The patient dfn (localId) is required.\n';
        retObj.valid = false;
    }

    if (nullChecker.isNullish(input.duz)) {
        retObj.errMsg += 'The duz is required.\n';
        retObj.valid = false;
    }

    if (nullChecker.isNullish(input.locIEN)) {
        retObj.errMsg += 'The location is required.\n';
        retObj.valid = false;
    }
    if (nullChecker.isNullish(input.vitals)) {
        retObj.errMsg += 'vitals is required.\n';
        retObj.valid = false;
    } else {
        input.vitals.forEach(function(element, index) {
            if (nullChecker.isNullish(element.fileIEN)) {
                retObj.errMsg += 'The vital IEN is required for vital in index ' + index + '.\n';
                retObj.valid = false;
            }

            if (nullChecker.isNullish(element.reading)) {
                retObj.errMsg += 'The vital reading is required for vital in index ' + index + '.\n';
                retObj.valid = false;
            }
        });
    }

    return retObj;
}

module.exports.getResourceConfig = getResourceConfig;
module.exports.writeBackVitals = writeBackVitals;
module.exports.verifyInput = verifyInput;


text:
package cn.diaovision.omnicontrol.core.model.device.matrix.io;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import cn.diaovision.omnicontrol.core.model.device.State;

/**
 * Channel on solo matrix
 * Created by liulingfeng on 2017/3/2.
 */

public class Channel {
    public static final int CHN_VIDEO = 0;

    public static final int MOD_NORMAL = 0; //1对1通道
    public static final int MOD_STITCH = 1; //拼接通道

    public int inputIdx = -1;

    public int[] outputIdx;

    public Map<String, Object> properties; //通道属性: 分辨率,明暗, 音量,色饱和度

    public int type = 0;
    public int mode = MOD_NORMAL;
    public int state = State.ON; //状态

    String alias = ""; //别名

    public Channel(int type, int inputIdx, int[] outputIdx) {
        this.type = type;
        this.inputIdx = inputIdx;
        this.outputIdx = outputIdx;
        this.properties = new HashMap<>();
    }

    @Override
    public int hashCode() {
        if (outputIdx != null) {
            int val[] = new int[1 + outputIdx.length];
            val[0] = inputIdx;
            System.arraycopy(outputIdx, 0, val, 1, outputIdx.length);
            int hash = 1;
            for (int v : val){
                hash += v*31+1;
            }
            return hash;
        }
        else {
            return inputIdx;
        }
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public void setProperty(String name, Object val){
        properties.put(name, val);
    }

    public Object getProperty(String name){
        Object val = properties.get(name);
        if (val == null){
            return new Object();
        }
        else {
            return val;
        }
    }

    public int getInputIdx() {
        return inputIdx;
    }

    public void setInputIdx(int inputIdx) {
        this.inputIdx = inputIdx;
    }

    public int[] getOutputIdx() {
        return outputIdx;
    }

    public void setOutputIdx(int[] outputIdx) {
        this.outputIdx = outputIdx;
    }

    public boolean containOutputIdx(int idx){
        boolean containIdx = false;
        for (int i : outputIdx){
            if (idx == i) {
                containIdx = true;
                break;
            }
        }
        return containIdx;
    }

}


text:
import React from 'react'
import { Icon, Image as ImageComponent, Item } from 'stardust'

const { Content, Description, Extra, Group, Header, Image } = Item
const paragraph = <ImageComponent src='http://semantic-ui.com/images/wireframe/short-paragraph.png' />

const ExtraContent = () => (
  <Group>
    <Item>
      <Image size='small' src='http://semantic-ui.com/images/wireframe/image.png' />

      <Content>
        Cute Dog
        <Description>{paragraph}</Description>
        <Extra>
          <Icon name='green check' /> 121 Votes
        </Extra>
      </Content>
    </Item>

    <Item>
      <Image size='small' src='http://semantic-ui.com/images/wireframe/image.png' />

      <Content>
        Cute Dog
        <Description>{paragraph}</Description>
        <Extra content='121 Votes' />
      </Content>
    </Item>

    <Item>
      <Image size='small' src='http://semantic-ui.com/images/wireframe/image.png' />
      <Content header='Cute Dog' extra='121 Votes' />
    </Item>
  </Group>
)

export default ExtraContent


text:
@interface CommonTableViewController ()
@property(nonatomic, assign) UITableViewStyle style;
@end

@implementation CommonTableViewController

#pragma mark - init

- (id)init
{
    return [self initWithStyle:UITableViewStylePlain];
}

- (id)initWithStyle:(UITableViewStyle)style
{
    if (self = [super init])
    {
        _style = style;
    }
    return self;
}

- (void)initSubviews
{
    [super initSubviews];
    [self initTableview];
}

- (void)initTableview
{
    if (IOS_VERSION >= 7) {
        _tableView = [[CommonTableView alloc] initWithFrame:CGRectMakeWithSize(CGSizeMake(CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame))) style:self.style];
    } else {
        _tableView = [[CommonTableView alloc] initWithFrame:CGRectMakeWithSize(CGSizeMake(CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - NAVIGATIONBAR_HEIGHT - CGRectGetHeight(self.tabBarController.tabBar.frame))) style:self.style];
    }
    self.tableView.delegate = self;
    self.tableView.dataSource = self;

    [self.view addSubview:self.tableView];
}

#pragma mark - TableViewDelegate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
//{
//    if (IOS_VERSION >= 7) {
//        return 0.0f;
//    }
//    return 30;
//}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return @"删除";
}

#pragma mark - 生命周期

- (void)viewDidLoad
{
    [super viewDidLoad];
    if (self.tableView.style == UITableViewStylePlain) {
        self.view.backgroundColor = [UIColor whiteColor];
    } else {
        self.view.backgroundColor = UIColorMake(240, 240, 240);
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

@end


text:
package org.springframework.cloud.dataflow.rest.client;

import org.junit.Test;

import org.springframework.cloud.dataflow.rest.client.support.VersionUtils;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author Mark Pollack
 */
public class VersionUtilsTests {

	@Test
	public void testNullAndBlank() {
		String threePartVersion = VersionUtils.getThreePartVersion(null);
		assertThat(threePartVersion).isEmpty();

		threePartVersion = VersionUtils.getThreePartVersion("");
		assertThat(threePartVersion).isEmpty();

		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(null,null)).isFalse();
		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("","")).isFalse();
	}

	@Test
	public void badFormat() {
		String threePartVersion = VersionUtils.getThreePartVersion("1.3");
		assertThat(threePartVersion).isEmpty();

		threePartVersion = VersionUtils.getThreePartVersion("1.3.4.5");
		assertThat(threePartVersion);

		threePartVersion = VersionUtils.getThreePartVersion("1.3.4");
		assertThat(threePartVersion).isEqualTo("1.3.4");

		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.3","1.5")).isFalse();
		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.4.5.4","1.5")).isFalse();
		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.5","1.5.3.4")).isFalse();
	}

	@Test
	public void testValid() {

		String threePartVersion = VersionUtils.getThreePartVersion("1.3.4");
		assertThat(threePartVersion).isEqualTo("1.3.4");

		threePartVersion = VersionUtils.getThreePartVersion("1.3.4.6");
		assertThat(threePartVersion).isEqualTo("1.3.4");

		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.6.0","1.6.0")).isTrue();
		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.7.0","1.6.0")).isTrue();
		assertThat(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion("1.6.0","1.7.0")).isFalse();
	}

}


text:
namespace Students_and_courses
{
    using System.Collections.Generic;

    public class School
    {
        public School(ICollection<Student> students, ICollection<Course> courses)
        {
            this.Students = students;
            this.Courses = courses;
        }

        public ICollection<Student> Students { get; set; }
        public ICollection<Course> Courses { get; set; }
    }
}