text:
CKEDITOR.plugins.add( 'vvq',
{
	init : function( editor )
	{
		// Register the toolbar buttons.
		editor.ui.addButton( 'VVQYoutube',
			{
				label : 'Insert Youtube Video',
				icon : this.path + 'images/youtube.png',
				toolbar: 'wordpress,100',
				command : 'vvqyoutube'
			});
		editor.ui.addButton( 'VVQGoogleVideo',
			{
				label : 'Insert Google Video',
				icon : this.path + 'images/googlevideo.png',
				toolbar: 'wordpress,100',
				command : 'vvqgooglevideo'
			});
		editor.ui.addButton( 'VVQDailyMotion',
			{
				label : 'Insert DailyMotion Video',
				icon : this.path + 'images/dailymotion.png',
				toolbar: 'wordpress,100',
				command : 'vvqdailymotion'
			});
		editor.ui.addButton( 'VVQVimeo',
			{
				label : 'Insert Vimeo Video',
				icon : this.path + 'images/vimeo.png',
				toolbar: 'wordpress,100',
				command : 'vvqvimeo'
			});
		editor.ui.addButton( 'VVQVeoh',
			{
				label : 'Insert Veoh Video',
				icon : this.path + 'images/veoh.png',
				toolbar: 'wordpress,100',
				command : 'vvqveoh'
			});
		editor.ui.addButton( 'VVQViddler',
			{
				label : 'Insert Viddler Video',
				icon : this.path + 'images/viddler.png',
				toolbar: 'wordpress,100',
				command : 'vvqviddler'
			});
		editor.ui.addButton( 'VVQMetacafe',
			{
				label : 'Insert Metacafe Video',
				icon : this.path + 'images/metacafe.png',
				toolbar: 'wordpress,100',
				command : 'vvqmetacafe'
			});
		editor.ui.addButton( 'VVQBlipTV',
			{
				label : 'Insert BlipTV Video',
				icon : this.path + 'images/bliptv.png',
				toolbar: 'wordpress,100',
				command : 'vvqbliptv'
			});
		editor.ui.addButton( 'VVQFlickrVideo',
			{
				label : 'Insert FlickrVideo',
				icon : this.path + 'images/flickrvideo.png',
				toolbar: 'wordpress,100',
				command : 'vvqflicrvideo'
			});
		editor.ui.addButton( 'VVQSpike',
			{
				label : 'Insert Spike Video',
				icon : this.path + 'images/spike.png',
				toolbar: 'wordpress,100',
				command : 'vvqspike'
			});
		editor.ui.addButton( 'VVQMySpace',
			{
				label : 'Insert MySpace Video',
				icon : this.path + 'images/myspace.png',
				toolbar: 'wordpress,100',
				command : 'vvqmyspace'
			});
		editor.ui.addButton( 'VVQFLV',
			{
				label : 'Insert FLV',
				icon : this.path + 'images/flv.png',
				toolbar: 'wordpress,100',
				command : 'vvqflv'
			});
		editor.ui.addButton( 'VVQQuicktime',
			{
				label : 'Insert Quicktime Video',
				icon : this.path + 'images/quicktime.png',
				toolbar: 'wordpress,100',
				command : 'vvqquicktime'
			});
		editor.ui.addButton( 'VVQVideoFile',
			{
				label : 'Insert Video File',
				icon : this.path + 'images/videofile.png',
				toolbar: 'wordpress,100',
				command : 'vvqvideofile'
			});

		// Register the commands.
		editor.addCommand( 'vvqyoutube',
		{
			exec : function()
			{
				window.VVQButtonClick('youtube');
			}
		} );
		editor.addCommand( 'vvqgooglevideo',
		{
			exec : function()
			{
				window.VVQButtonClick('googlevideo');
			}
		} );
		editor.addCommand( 'vvqdailymotion',
		{
			exec : function()
			{
				window.VVQButtonClick('dailymotion');
			}
		} );
		editor.addCommand( 'vvqvimeo',
		{
			exec : function()
			{
				window.VVQButtonClick('vimeo');
			}
		} );
		editor.addCommand( 'vvqveoh',
		{
			exec : function()
			{
				window.VVQButtonClick('veoh');
			}
		} );
		editor.addCommand( 'vvqviddler',
		{
			exec : function()
			{
				window.VVQButtonClick('viddler');
			}
		} );
		editor.addCommand( 'vvqmetacafe',
		{
			exec : function()
			{
				window.VVQButtonClick('metacafe');
			}
		} );
		editor.addCommand( 'vvqbliptv',
		{
			exec : function()
			{
				window.VVQButtonClick('bliptv');
			}
		} );
		editor.addCommand( 'vvqflickrvideo',
		{
			exec : function()
			{
				window.VVQButtonClick('flickrvideo');
			}
		} );
		editor.addCommand( 'vvqspike',
		{
			exec : function()
			{
				window.VVQButtonClick('spike');
			}
		} );
		editor.addCommand( 'myspace',
		{
			exec : function()
			{
				window.VVQButtonClick('myspace');
			}
		} );
		editor.addCommand( 'vvqflv',
		{
			exec : function()
			{
				window.VVQButtonClick('flv');
			}
		} );
		editor.addCommand( 'vvqquicktime',
		{
			exec : function()
			{
				window.VVQButtonClick('quicktime');
			}
		} );
		editor.addCommand( 'vvqvideofile',
		{
			exec : function()
			{
				window.VVQButtonClick('videofile');
			}
		} );
	}
});

redpajama_set_name: RedPajamaGithub


text:
CLI tool with sensical defaults and useful options for grepping in Rails projects.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'grepr'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install grepr

## Usage

```sh
$ grepr -h
  Usage:
    $ grepr full_name --log

  Options:

    -l, --log                        include log directory
    -d, --db                         include db directory
```

## License

MIT

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

***

> Crafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).


text:
module Main where

import Control.Monad.Trans
import System.Console.Haskeline

import Syntax
import Parser
import Pretty

process :: String -> IO ()
process line =
  case parseExpr line of
    Left err -> print err
    Right ex -> do
      case typecheck ex of
        Nothing -> putStrLn "Typecheck failed."
        Just t  -> do
          putStr "type is "
          print t
          putStrLn $
            case eval ex of
              Nothing  -> "Cannot evaluate."
              Just val -> ppexpr val

main :: IO ()
main = runInputT defaultSettings loop
  where
  loop = do
    minput <- getInputLine "Repl> "
    case minput of
      Nothing  -> outputStrLn "Goodbye."
      Just val -> (liftIO $ process val) >> loop


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@color/default_trans" android:state_pressed="true"/> <!-- pressed -->
    <item android:drawable="@color/default_trans" android:state_focused="true"/> <!-- focused -->
    <item android:drawable="@color/trans"/> <!-- default -->

</selector>


text:
package com.google.dto;

import java.io.Serializable;

public class ImageDTO implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -7773184780447011734L;

	private String url;

	private Boolean isDefault;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}
}


text:
package com.vip.sdk.base.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SHAUtil {

    /**
     * 生成sha校验码
     *
     * @param srcContent 需要加密的数据
     * @return 加密后的sha校验码。出错则返回null。
     */
    public static String makeShaSum(byte[] srcContent) {
        if (srcContent == null) {
            return null;
        }

        String strDes = null;

        try {
            MessageDigest sha = MessageDigest.getInstance("SHA1");
            sha.update(srcContent);
            strDes = bytes2Hex(sha.digest()); // to HexString
        } catch (NoSuchAlgorithmException e) {
            return null;
        }
        return strDes;
    }

    /**
     * bytes2Hex方法
     */
    private static String bytes2Hex(byte[] byteArray) {
        StringBuffer strBuf = new StringBuffer();
        int bytelength = byteArray.length;
        for (int i = 0; i < bytelength; i++) {
            if (byteArray[i] >= 0 && byteArray[i] < 16) {
                strBuf.append("0");
            }
            strBuf.append(Integer.toHexString(byteArray[i] & 0xFF));
        }
        return strBuf.toString();
    }
}


text:
module Groupify
  module Mongoid

    module MemberScopedAs
      extend ActiveSupport::Concern

      module ClassMethods
        def as(membership_type)
          criteria = self.criteria

          return criteria unless membership_type.present?

          group_ids = criteria.selector["group_ids"]
          named_groups = criteria.selector["named_groups"]

          # If filtering by groups or named groups, merge into the group membership criteria
          if group_ids || named_groups
            elem_match = {as: membership_type}
            elem_match.merge!(group_ids: group_ids) if group_ids
            elem_match.merge!(named_groups: named_groups) if named_groups

            criteria = where(:group_memberships.elem_match => elem_match)
            criteria.selector.delete("group_ids")
            criteria.selector.delete("named_groups")
          else
            criteria = where(:"group_memberships.as" => membership_type)
          end

          criteria
        end
      end
    end
  end
end


text:
externip=$(/bin/curl icanhazip.com)
ipfile=/var/externip
oldip=$(cat $ipfile)
pushapi=your pushbullet api

# check if your ip is changed
touch $ipfile
cat $ipfile > fileip
echo "$externip" > currentip

# if so, exectute below code.
DIFF=$(diff fileip currentip)
if [ "$DIFF" != "" ]
then
  curl https://api.pushbullet.com/v2/pushes \
  -u $pushapi: \
  -d type="note" \
  -d title="External ip modified" \
  -d body="Old ip: $oldip, new ip: $externip" \
  -X POST
  echo "$externip" > $ipfile
fi


text:
Meteor.startup(function(){
    Meteor.methods({
        clearChannels: function(){
            Channels.remove({});
        }
    });
});


text:
/**
 * Created by netanel on 09/01/15.
 */
angular.module('angularCesium').directive('acLabel', function() {
  return {
    restrict : 'E',
    require : '^acLabelsLayer',
    scope : {
      color : '&',
      text : '&',
      position : '&'
    },
    link : function(scope, element, attrs, acLabelsLayerCtrl) {
      var labelDesc = {};

      var position = scope.position();
      labelDesc.position = Cesium.Cartesian3.fromDegrees(Number(position.longitude) || 0, Number(position.latitude) || 0, Number(position.altitude) || 0);

      var color = scope.color();
      if (color) {
        labelDesc.color = color;
      }

      labelDesc.text = scope.text();

      var label = acLabelsLayerCtrl.getLabelCollection().add(labelDesc);

      scope.$on('$destroy', function() {
        acLabelsLayerCtrl.getLabelCollection().remove(label);
      });
    }
  }
});


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>

    <style name="LoginTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimaryDark">@android:color/black</item>
    </style>

</resources>


text:
node-yts
========

YTS API Wrapper for Node.js


text:
"use strict";

const childProcess = require("child_process");
const temp = require("temp");
const shelljs = require("shelljs");
const getShellVars = require("get-shell-vars");
const path = require("path");
const Sudoer = require("electron-sudo").default;
const fs = require("fs");

const doctor = {};//require("nativescript-doctor");
const semver = require("semver");
const https = require("https");
const zlib = require("zlib");

const homebrewNodeFormulaRegex = /^homebrew\/versions\/node(\d+)/;

let env = getShellVars.getEnvironmentVariables();

env.PATH += ":/usr/local/bin";

const sudoer = new Sudoer({ name: "Fusion"});

// env.HOMEBREW_GITHUB_API_TOKEN = <your access token>;
// process.env.HOMEBREW_GITHUB_API_TOKEN = <your access token>;

const execSync = (command) => {
    return (childProcess.execSync(command, { env }) || "").toString();
};

// MOCK
doctor.getSupportedNodeVersions = () => {
    return Promise.resolve(">=4.1.0 <6.0.0");
}

// Delete temp dirs after process exits.
temp.track();

const getNodeVersion = () => {
    return execSync("node --version");
};

const getMaxSatisfyingNodeVersion = (nodeVersionRange) => {
    const gitHubNodeTagsAddress = "https://api.github.com/repos/nodejs/node/tags?per_page=100&access_token=<<your access token>>";

    return new Promise((resolve, reject) => {
        const urlParts = url.parse(gitHubNodeTagsAddress);

        let options = {
            method: "GET"
        };

        if (urlParts.protocol) {
            options.proto = urlParts.protocol.slice(0, -1);
        }

        options.host = urlParts.hostname;
        options.port = urlParts.port;
        options.path = urlParts.path;
        options.headers = {};

        let headers = options.headers;

        headers["User-Agent"] = "Icenium-Fusion";

        let request = https.get(options, response => {

            let data = [];

            response.on("data", (chunk) => {
                data.push(chunk);
            });

            response.on("error", (err) => reject(err));

            response.on("end", () => {
                const responseData = data.join("");
                const versionsData = JSON.parse(responseData);
                resolve(semver.maxSatisfying(versionsData.map(v => v.name), nodeVersionRange));
            });
        });
    });
};

const getNodeBrewFormulaForVersion = (requiredNodeVersion) => {
    execSync("brew update");

    const versions = getNodeBrewFormulas("search node");

    const requiredMajorVersion = semver.major(requiredNodeVersion).toString()

    let selectedFormula = "node";
    _.each(versions, version => {
        const matchFormula = version.match(homebrewNodeFormulaRegex);

        if (matchFormula && matchFormula[1].toString() === requiredMajorVersion) {
            selectedFormula = version;
            return false;
        }
    });

    // If no matching version found, return "node", so we'll execute `brew install node`
    return selectedFormula;
};

const updateNodeWithBrew = (nodeVersion) => {
    const brewFormula = getNodeBrewFormulaForVersion(nodeVersion);

    const pathToNode = getPathToNode();

    const currentLinkedFormulaMatch = pathToNode.match(/\/Cellar\/(.+?)\//);

    if (currentLinkedFormulaMatch) {
        execSync(`brew unlink ${currentLinkedFormulaMatch[1]}`);
    }

    // now get all brew formulas and find the matching one
    execSync(`brew install ${brewFormula}`);

    execSync(`brew link --overwrite ${brewFormula}`);
};

const getNodeBrewFormulas = (brewCommand) => {
    return execSync(`brew ${brewCommand}`)
        .split(/\s|\n/)
        .map(formula => formula.trim())
        .filter(formula => {
            return formula === "node" || homebrewNodeFormulaRegex.test(formula);
        });
};

const getPathToNode = () => {
    return execSync("ls -l `which node`");
};

const isNodeInstalledWithBrew = () => {
    try {
        const pathToNode = getPathToNode();
        return pathToNode.indexOf("/Cellar/") !== -1;
    } catch (err) {
        // Ignore the error. Log it with some logger.
    }

    return false;
};

const installNodeWithBrew = () => {
     // we need to install brew first
    // brew requires sudo permissions, so use electron-sudo to ask for permissions

    const installBrewCommand = `sudo su ${env.USER} -c 'curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install | ruby'`;

    const brewInstallScript = temp.path({suffix: '.sh'});

    fs.writeFileSync(brewInstallScript, installBrewCommand);

    shelljs.chmod("+x", brewInstallScript);

    sudoer.exec(brewInstallScript)
        .then((res) => {
            try {
                const installNodeCommand = "/usr/local/bin/brew install node";
                console.log(execSync(installNodeCommand));
            } catch (err) {
                console.log("Unable to install node.", err);

                throw err;
            }

            try {
                const installCLICommand = "/usr/local/bin/npm install -g nativescript --ignore-scripts";
                console.log(execSync(installCLICommand));
            } catch (err) {
                console.log("Unable to install NativeScript CLI.", err);

                throw err;
            }
        }).catch(err =>  console.log("Error during setup: ", err));
}

const downloadNodeFromNodejsOrg = (nodeVersion) => {
    return new Promise((resolve, reject) => {
        const nodeAddress = `https://nodejs.org/dist/${nodeVersion}/node-${nodeVersion}.pkg`;

        https.get(nodeAddress, function (response) {
            var downloadPath,
                writableStream;

            downloadPath = temp.path({ suffix: '.pkg' });

            try {
                writableStream = fs.createWriteStream(downloadPath);
                response.pipe(writableStream);

                writableStream.on("finish", function () {
                    resolve(downloadPath);
                }).on("error", function (error) {
                    reject(error);
                });

            } catch (error) {
                reject(error);
            }
        }).on("error", function (error) {
            reject(error);
        });
    });

}
const installNodeFromNodejsOrg = () => {
    return doctor.getSupportedNodeVersions()
            .then(nodeVersionRange => getMaxSatisfyingNodeVersion(nodeVersionRange))
            .then(nodeVersion => {
                return downloadNodeFromNodejsOrg(nodeVersion);
            })
            .then(pathToPkg => {
                return sudoer.exec(`installer -pkg ${pathToPkg}  -target /`);
            })
            .then(res => console.log(res))
            .catch(err => console.log(err));
}

const updateNodeVersion = (nodeVersionRange) => {
    return getMaxSatisfyingNodeVersion(nodeVersionRange)
            .then(nodeVersion => {

                if (nodeVersion) {
                    if (isNodeInstalledWithBrew()) {
                        return updateNodeWithBrew(nodeVersion);
                    }

                    // TODO: if node is installed with nvm, from nodejs.org, etc.
                }
            });
};

try {
    const whichNode = execSync("which node");

    if (!whichNode) {
        // no node, but which does not fail... strange
        throw new Error("An error has occured.");
    }

    const nodeVersion = getNodeVersion();

    doctor.getSupportedNodeVersions()
        .then(nodeVersionRange => {
            const isVersionSupported = semver.satisfies(nodeVersion, nodeVersionRange);

            if (!isVersionSupported) {
                return updateNodeVersion(nodeVersionRange);
            }
        });

} catch (err) {
    // no node, let's install

    // installNodeWithBrew();
    installNodeFromNodejsOrg();
}


text:
.. _renderers:

=========
Renderers
=========

Pyblosxom supports multiple renderers and comes with two by default:
debug and blosxom.

blosxom renderer
================

You can set which renderer to use in your ``config.py`` file like
this::

    py["renderer"] = "blosxom"

.. Note::

    If you don't specify the ``renderer`` configuration variable,
    Pyblosxom uses the blosxom renderer.

The blosxom renderer is named as such because it operates similarly to
blosxom.  Read the chapter on :ref:`flavours and templates
<flavours-and-templates>`.

debug renderer
==============

The debug renderer outputs your blog in a form that makes it easy to
see the data generated when handling a Pyblosxom request.  This is
useful for debugging plugins, working on blosxom flavours and
templates, and probably other things as well.

To set Pyblosxom to use the debug renderer, do this in your
``config.py`` file::

    py["renderer"] = "debug"

Other renderers
===============

If you want your blog rendered by a different renderer, say one that
uses a different template system like Jinja or Cheetah, then you will
need to install a plugin that implements the ``renderer`` callback.


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: org.apache.http.conn.scheme.SchemeRegistry
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_DECL
#define J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace util { class Map; } } }
namespace j2cpp { namespace java { namespace util { class List; } } }
namespace j2cpp { namespace org { namespace apache { namespace http { class HttpHost; } } } }
namespace j2cpp { namespace org { namespace apache { namespace http { namespace conn { namespace scheme { class Scheme; } } } } } }

#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
#include <java/util/List.hpp>
#include <java/util/Map.hpp>
#include <org/apache/http/HttpHost.hpp>
#include <org/apache/http/conn/scheme/Scheme.hpp>

namespace j2cpp {

namespace org { namespace apache { namespace http { namespace conn { namespace scheme {

	class SchemeRegistry;
	class SchemeRegistry
		: public object<SchemeRegistry>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)

		explicit SchemeRegistry(jobject jobj)
		: object<SchemeRegistry>(jobj)
		{
		}

		operator local_ref<java::lang::Object>() const;

		SchemeRegistry();
		local_ref< org::apache::http::conn::scheme::Scheme > getScheme(local_ref< java::lang::String >  const&);
		local_ref< org::apache::http::conn::scheme::Scheme > getScheme(local_ref< org::apache::http::HttpHost >  const&);
		local_ref< org::apache::http::conn::scheme::Scheme > get(local_ref< java::lang::String >  const&);
		local_ref< org::apache::http::conn::scheme::Scheme > register_(local_ref< org::apache::http::conn::scheme::Scheme >  const&);
		local_ref< org::apache::http::conn::scheme::Scheme > unregister(local_ref< java::lang::String >  const&);
		local_ref< java::util::List > getSchemeNames();
		void setItems(local_ref< java::util::Map >  const&);
	}; //class SchemeRegistry

} //namespace scheme
} //namespace conn
} //namespace http
} //namespace apache
} //namespace org

} //namespace j2cpp

#endif //J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_IMPL
#define J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_IMPL

namespace j2cpp {

org::apache::http::conn::scheme::SchemeRegistry::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

org::apache::http::conn::scheme::SchemeRegistry::SchemeRegistry()
: object<org::apache::http::conn::scheme::SchemeRegistry>(
	call_new_object<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(0),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(0)
	>()
)
{
}

local_ref< org::apache::http::conn::scheme::Scheme > org::apache::http::conn::scheme::SchemeRegistry::getScheme(local_ref< java::lang::String > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(1),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(1),
		local_ref< org::apache::http::conn::scheme::Scheme >
	>(get_jobject(), a0);
}

local_ref< org::apache::http::conn::scheme::Scheme > org::apache::http::conn::scheme::SchemeRegistry::getScheme(local_ref< org::apache::http::HttpHost > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(2),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(2),
		local_ref< org::apache::http::conn::scheme::Scheme >
	>(get_jobject(), a0);
}

local_ref< org::apache::http::conn::scheme::Scheme > org::apache::http::conn::scheme::SchemeRegistry::get(local_ref< java::lang::String > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(3),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(3),
		local_ref< org::apache::http::conn::scheme::Scheme >
	>(get_jobject(), a0);
}

local_ref< org::apache::http::conn::scheme::Scheme > org::apache::http::conn::scheme::SchemeRegistry::register_(local_ref< org::apache::http::conn::scheme::Scheme > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(4),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(4),
		local_ref< org::apache::http::conn::scheme::Scheme >
	>(get_jobject(), a0);
}

local_ref< org::apache::http::conn::scheme::Scheme > org::apache::http::conn::scheme::SchemeRegistry::unregister(local_ref< java::lang::String > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(5),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(5),
		local_ref< org::apache::http::conn::scheme::Scheme >
	>(get_jobject(), a0);
}

local_ref< java::util::List > org::apache::http::conn::scheme::SchemeRegistry::getSchemeNames()
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(6),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(6),
		local_ref< java::util::List >
	>(get_jobject());
}

void org::apache::http::conn::scheme::SchemeRegistry::setItems(local_ref< java::util::Map > const &a0)
{
	return call_method<
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_CLASS_NAME,
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_NAME(7),
		org::apache::http::conn::scheme::SchemeRegistry::J2CPP_METHOD_SIGNATURE(7),
		void
	>(get_jobject(), a0);
}

J2CPP_DEFINE_CLASS(org::apache::http::conn::scheme::SchemeRegistry,"org/apache/http/conn/scheme/SchemeRegistry")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,0,"<init>","()V")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,1,"getScheme","(Ljava/lang/String;)Lorg/apache/http/conn/scheme/Scheme;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,2,"getScheme","(Lorg/apache/http/HttpHost;)Lorg/apache/http/conn/scheme/Scheme;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,3,"get","(Ljava/lang/String;)Lorg/apache/http/conn/scheme/Scheme;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,4,"register","(Lorg/apache/http/conn/scheme/Scheme;)Lorg/apache/http/conn/scheme/Scheme;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,5,"unregister","(Ljava/lang/String;)Lorg/apache/http/conn/scheme/Scheme;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,6,"getSchemeNames","()Ljava/util/List;")
J2CPP_DEFINE_METHOD(org::apache::http::conn::scheme::SchemeRegistry,7,"setItems","(Ljava/util/Map;)V")

} //namespace j2cpp

#endif //J2CPP_ORG_APACHE_HTTP_CONN_SCHEME_SCHEMEREGISTRY_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const { environment } = require('@rails/webpacker')
module.exports = environment.toWebpackConfig()


text:
//  Controller also used by handleEventTest:handlesEventsABApp, handleEventTest:multipleHandlersForEvent
({
    handleA : function(cmp, evt){
        var src = evt.getSource();
        if (src == undefined)
            src = cmp;
        src.find("events").getElement().innerHTML += "A";
    },

    handleB : function(cmp, evt){
        var src = evt.getSource();
        if (src == undefined)
            src = cmp;
        src.find("events").getElement().innerHTML += "B";
    },

    handleC : function(cmp, evt){
        var src = evt.getSource();
        if (src == undefined)
            src = cmp;
        src.find("events").getElement().innerHTML += "C";
    }
})


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>My first Post!</title>
  <meta name="description" content="Hey guys this is my first blog-post in my website..">
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/main.css">
  <link rel="canonical" href="http://localhost:4000/jekyll/update/2015/05/21/my-first-post.html">
  <link rel="alternate" type="application/rss+xml" title="Praveen Billa" href="http://localhost:4000/feed.xml" />
  <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,700' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="/css/animate.css">

        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          Toggle navigation

        </button>

          Praveen Billa

Skills

My first Post!

May 21, 2015

    Hey guys this is my first blog-post in my website..

  © 2016 - Praveen Billa


text:
<?php
/**
 * Created by PhpStorm.
 * User: Russ
 * Date: 13/06/2015
 * Time: 12:01
 */

namespace Meldon\WotRBundle\Form\Type;

use Meldon\WotRBundle\Entity\Game;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityManager;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;

class AttackingUnitsWithLeaderType extends AttackingUnitsType {
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(
            array('constraints' => new Callback(array($this,'checkLeaderSelected')))
        );
    }
    public function checkLeaderSelected($data, ExecutionContextInterface $context)
    {
        $leaderSelected = false;
        /** @var Unit $u */
        foreach( $data['units'] as $u ) {
            if ( $u->isLeader($this->game) ) {
                $leaderSelected = true;
                break;
            }
        }
        if ( !$leaderSelected ) {
            $context->buildViolation('You must choose at least one leader to attack with.')
                ->addViolation();
        }
    }
    public function getName()
    {
        return 'AttackingUnitsWithLeaderType';
    }

}


text:
#include <dae.h>
#include <dae/daeDom.h>
#include <dom/domGles_sampler_state.h>
#include <dae/daeMetaCMPolicy.h>
#include <dae/daeMetaSequence.h>
#include <dae/daeMetaChoice.h>
#include <dae/daeMetaGroup.h>
#include <dae/daeMetaAny.h>
#include <dae/daeMetaElementAttribute.h>

daeElementRef
domGles_sampler_state::create(DAE& dae)
{
	domGles_sampler_stateRef ref = new domGles_sampler_state(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "gles_sampler_state" );
	meta->registerClass(domGles_sampler_state::create);

	daeMetaCMPolicy *cm = NULL;
	daeMetaElementAttribute *mea = NULL;
	cm = new daeMetaSequence( meta, cm, 0, 1, 1 );

	mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
	mea->setName( "wrap_s" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemWrap_s) );
	mea->setElementType( domGles_sampler_state::domWrap_s::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
	mea->setName( "wrap_t" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemWrap_t) );
	mea->setElementType( domGles_sampler_state::domWrap_t::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
	mea->setName( "minfilter" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMinfilter) );
	mea->setElementType( domGles_sampler_state::domMinfilter::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 );
	mea->setName( "magfilter" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMagfilter) );
	mea->setElementType( domGles_sampler_state::domMagfilter::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 );
	mea->setName( "mipfilter" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipfilter) );
	mea->setElementType( domGles_sampler_state::domMipfilter::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 5, 0, 1 );
	mea->setName( "mipmap_maxlevel" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipmap_maxlevel) );
	mea->setElementType( domGles_sampler_state::domMipmap_maxlevel::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementAttribute( meta, cm, 6, 0, 1 );
	mea->setName( "mipmap_bias" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipmap_bias) );
	mea->setElementType( domGles_sampler_state::domMipmap_bias::registerElement(dae) );
	cm->appendChild( mea );

	mea = new daeMetaElementArrayAttribute( meta, cm, 7, 0, -1 );
	mea->setName( "extra" );
	mea->setOffset( daeOffsetOf(domGles_sampler_state,elemExtra_array) );
	mea->setElementType( domExtra::registerElement(dae) );
	cm->appendChild( mea );

	cm->setMaxOrdinal( 7 );
	meta->setCMRoot( cm );

	//	Add attribute: sid
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "sid" );
		ma->setType( dae.getAtomicTypes().get("xsNCName"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state , attrSid ));
		ma->setContainer( meta );

		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domWrap_s::create(DAE& dae)
{
	domGles_sampler_state::domWrap_sRef ref = new domGles_sampler_state::domWrap_s(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domWrap_s::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "wrap_s" );
	meta->registerClass(domGles_sampler_state::domWrap_s::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("Gles_sampler_wrap"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domWrap_s , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domWrap_s));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domWrap_t::create(DAE& dae)
{
	domGles_sampler_state::domWrap_tRef ref = new domGles_sampler_state::domWrap_t(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domWrap_t::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "wrap_t" );
	meta->registerClass(domGles_sampler_state::domWrap_t::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("Gles_sampler_wrap"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domWrap_t , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domWrap_t));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domMinfilter::create(DAE& dae)
{
	domGles_sampler_state::domMinfilterRef ref = new domGles_sampler_state::domMinfilter(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domMinfilter::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "minfilter" );
	meta->registerClass(domGles_sampler_state::domMinfilter::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domMinfilter , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domMinfilter));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domMagfilter::create(DAE& dae)
{
	domGles_sampler_state::domMagfilterRef ref = new domGles_sampler_state::domMagfilter(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domMagfilter::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "magfilter" );
	meta->registerClass(domGles_sampler_state::domMagfilter::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domMagfilter , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domMagfilter));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domMipfilter::create(DAE& dae)
{
	domGles_sampler_state::domMipfilterRef ref = new domGles_sampler_state::domMipfilter(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domMipfilter::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "mipfilter" );
	meta->registerClass(domGles_sampler_state::domMipfilter::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipfilter , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domMipfilter));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domMipmap_maxlevel::create(DAE& dae)
{
	domGles_sampler_state::domMipmap_maxlevelRef ref = new domGles_sampler_state::domMipmap_maxlevel(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domMipmap_maxlevel::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "mipmap_maxlevel" );
	meta->registerClass(domGles_sampler_state::domMipmap_maxlevel::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("xsUnsignedByte"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipmap_maxlevel , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domMipmap_maxlevel));
	meta->validate();

	return meta;
}

daeElementRef
domGles_sampler_state::domMipmap_bias::create(DAE& dae)
{
	domGles_sampler_state::domMipmap_biasRef ref = new domGles_sampler_state::domMipmap_bias(dae);
	return ref;
}

daeMetaElement *
domGles_sampler_state::domMipmap_bias::registerElement(DAE& dae)
{
	daeMetaElement* meta = dae.getMeta(ID());
	if ( meta != NULL ) return meta;

	meta = new daeMetaElement(dae);
	dae.setMeta(ID(), *meta);
	meta->setName( "mipmap_bias" );
	meta->registerClass(domGles_sampler_state::domMipmap_bias::create);

	meta->setIsInnerClass( true );
	//	Add attribute: _value
	{
		daeMetaAttribute *ma = new daeMetaAttribute;
		ma->setName( "_value" );
		ma->setType( dae.getAtomicTypes().get("xsFloat"));
		ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipmap_bias , _value ));
		ma->setContainer( meta );
		meta->appendAttribute(ma);
	}

	meta->setElementSize(sizeof(domGles_sampler_state::domMipmap_bias));
	meta->validate();

	return meta;
}


text:
local M = {}

M.setup = function()
  local signs = {
    { name = "DiagnosticSignError", text = "" },
    { name = "DiagnosticSignWarn", text = "" },
    { name = "DiagnosticSignHint", text = "" },
    { name = "DiagnosticSignInfo", text = "" },
  }

  for _, sign in ipairs(signs) do
    vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
  end

  local config = {
    virtual_text = true,
    -- show signs
    signs = {
      active = signs,
    },
    update_in_insert = true,
    underline = true,
    severity_sort = true,
    float = {
      focusable = false,
      style = "minimal",
      border = "rounded",
      source = "always",
      header = "",
      prefix = "",
    },
  }

  vim.diagnostic.config(config)

  vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
    border = "rounded",
  })

  vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
    border = "rounded",
  })
end

local function lsp_highlight_document(client)
  -- Set autocommands conditional on server_capabilities
  local status_ok, illuminate = pcall(require, "illuminate")
  if not status_ok then
    return
  end
  illuminate.on_attach(client)
  -- end
end

local function lsp_keymaps(bufnr)
  local opts = { noremap = true, silent = true }
  vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
  vim.api.nvim_buf_set_keymap(
    bufnr,
    "n",
    "gl",
    '<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>',
    opts
  )
  vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
  vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
  vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
end

M.on_attach = function(client, bufnr)
  client.resolved_capabilities.document_formatting = false
  lsp_keymaps(bufnr)
  lsp_highlight_document(client)
end

local capabilities = vim.lsp.protocol.make_client_capabilities()

local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not status_ok then
  return
end

M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)

return M


text:
$(document).ready(function(){

	$(window).bind('scroll', function() {
	   var navHeight = $( window ).height() - 0;
			 if ($(window).scrollTop() > navHeight) {
				 $('nav').addClass('fixed');
			 }
			 else {
				 $('nav').removeClass('fixed');
			 }
		});

	// $(window).bind('scroll', function() {
	//    var navHeight = $( window ).height() - 70;
	// 		 if ($(window).scrollTop() > navHeight) {
	// 			 $('.adminNav').addClass('fixed');
	// 		 }
	// 		 else {
	// 			 $('adminNav').removeClass('fixed');
	// 		 }
	// 	})

	$('.button-collapse').sideNav({
      closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor
    }
  );

	$('.tooltipped').tooltip({delay: 20});

	$('.dropdown-button').dropdown({
		constrain_width: false,
		gutter: 15,
		belowOrigin: true
	});

	$('.slider').slider();

	$("#guest").click(function() {
    	$('html,body').animate({
        	scrollTop: $(".checkoutForm").offset().top},
        	'slow');
	});

});

// $(function() {
// 		$('.slider').slider();
// 	});


text:
<?php

abstract class PhortuneCartController
  extends PhortuneController {

  protected function buildCartContents(PhortuneCart $cart) {

    $rows = array();
    $total = 0;
    foreach ($cart->getPurchases() as $purchase) {
      $rows[] = array(
        $purchase->getFullDisplayName(),
        PhortuneCurrency::newFromUSDCents($purchase->getBasePriceInCents())
          ->formatForDisplay(),
        $purchase->getQuantity(),
        PhortuneCurrency::newFromUSDCents($purchase->getTotalPriceInCents())
          ->formatForDisplay(),
      );

      $total += $purchase->getTotalPriceInCents();
    }

    $rows[] = array(
      phutil_tag('strong', array(), pht('Total')),
      '',
      '',
      phutil_tag('strong', array(),
        PhortuneCurrency::newFromUSDCents($total)->formatForDisplay()),
    );

    $table = new AphrontTableView($rows);
    $table->setHeaders(
      array(
        pht('Item'),
        pht('Price'),
        pht('Qty.'),
        pht('Total'),
      ));
    $table->setColumnClasses(
      array(
        'wide',
        'right',
        'right',
        'right',
      ));

    return id(new PHUIObjectBoxView())
      ->setHeaderText(pht('Cart Contents'))
      ->appendChild($table);
  }

}


text:
///<reference path="../../../typings/axios/axios.d.ts"/>
import axios = require('axios');

$(document).ready(() => {
    // request our model and set the controls
    axios.get<any>('/bloom/api/book/settings').then(result => {
        var settings = result.data;

        // Only show this if we are editing a shell book. Otherwise, it's already not locked.
        if (!settings.isRecordedAsLockedDown) {
            $(".showOnlyWhenBookWouldNormallyBeLocked").css("display", "none");
            $("input[name='isTemplateBook']").prop("checked", settings.isTemplateBook);
        }
        else {
            $(".showOnlyIfBookIsNeverLocked").css("display", "none");
            // enhance: this is just dirt-poor binding of 1 checkbox for now
            $("input[name='unlockShellBook']").prop("checked", settings.unlockShellBook);
        }
    });
});

export function handleBookSettingCheckboxClick(clickedButton: any) {
    // read our controls and send the model back to c#
    // enhance: this is just dirt-poor serialization of checkboxes for now
    var inputs = $("#bookSettings :input");
    var o = {};
    var settings = $.map(inputs, (input, i) => {
        o[input.name] = $(input).prop("checked");
        return o;
    })[0];
    axios.post("/bloom/api/book/settings", settings);
}

export function handleResetZoom(clickedButton: any) {
    var pageDom = <HTMLIFrameElement>parent.window.document.getElementById('page');
    var pageBody = $(pageDom.contentWindow.document.body);
    $(pageBody).find("div#page-scaling-container").css('transform', 'scale(1.0)');
}


text:
package com.microsoft.azure.storage.blob;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import com.microsoft.azure.storage.AccessCondition;
import com.microsoft.azure.storage.Constants;
import com.microsoft.azure.storage.DoesServiceRequest;
import com.microsoft.azure.storage.OperationContext;
import com.microsoft.azure.storage.StorageErrorCodeStrings;
import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.core.Base64;
import com.microsoft.azure.storage.core.Logger;
import com.microsoft.azure.storage.core.SR;
import com.microsoft.azure.storage.core.Utility;

/**
 * The class is an append-only stream for writing into storage.
 */
public final class BlobOutputStream extends OutputStream {

    /**
     * Holds the {@link AccessCondition} object that represents the access conditions for the blob.
     */
    private AccessCondition accessCondition;

    /**
     * Used for block blobs, holds the block id prefix.
     */
    private String blockIdPrefix;

    /**
     * Used for block blobs, holds the block list.
     */
    private ArrayList<BlockEntry> blockList;

    /**
     * The CompletionService used to await task completion for this stream.
     */
    private final ExecutorCompletionService<Void> completionService;

    /**
     * Holds the futures of the executing tasks. The starting size of the set is a multiple of the concurrent request
     * count to reduce the cost of resizing the set later.
     */
    private final Set<Future<Void>> futureSet;

    /**
     * Holds the write threshold of number of bytes to buffer prior to dispatching a write. For block blob this is the
     * block size, for page blob this is the Page commit size.
     */
    private int internalWriteThreshold = -1;

    /**
     * Holds the last exception this stream encountered.
     */
    private volatile IOException lastError = null;

    /**
     * Holds the reference to the MD5 digest for the blob.
     */
    private MessageDigest md5Digest;

    /**
     * Holds the OperationContext for the current stream.
     */
    private final OperationContext opContext;

    /**
     * Holds the options for the current stream.
     */
    private final BlobRequestOptions options;

    private long currentBlobOffset;

    /**
     * A private buffer to store data prior to committing to the cloud.
     */
    private volatile ByteArrayOutputStream outBuffer;

    /**
     * Holds the reference to the blob this stream is associated with.
     */
    private final CloudBlob parentBlobRef;

    /**
     * Determines if this stream is used against a page blob or block blob.
     */
    private BlobType streamType = BlobType.UNSPECIFIED;

    /**
     * The ExecutorService used to schedule tasks for this stream.
     */
    private final ThreadPoolExecutor threadExecutor;

    /**
     * Initializes a new instance of the BlobOutputStream class.
     *
     * @param parentBlob
     *            A {@link CloudBlob} object which represents the blob that this stream is associated with.
     * @param accessCondition
     *            An {@link AccessCondition} object which represents the access conditions for the blob.
     * @param options
     *            A {@link BlobRequestOptions} object which specifies any additional options for the request.
     * @param opContext
     *            An {@link OperationContext} object which is used to track the execution of the operation.
     *
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    private BlobOutputStream(final CloudBlob parentBlob, final AccessCondition accessCondition,
            final BlobRequestOptions options, final OperationContext opContext) throws StorageException {
        this.accessCondition = accessCondition;
        this.parentBlobRef = parentBlob;
        this.parentBlobRef.assertCorrectBlobType();
        this.options = new BlobRequestOptions(options);
        this.outBuffer = new ByteArrayOutputStream();
        this.opContext = opContext;

        if (this.options.getConcurrentRequestCount() < 1) {
            throw new IllegalArgumentException("ConcurrentRequestCount");
        }

        this.futureSet = Collections.newSetFromMap(new ConcurrentHashMap<Future<Void>, Boolean>(
                this.options.getConcurrentRequestCount() == null ? 1 : this.options.getConcurrentRequestCount() * 2));

        if (this.options.getStoreBlobContentMD5()) {
            try {
                this.md5Digest = MessageDigest.getInstance("MD5");
            }
            catch (final NoSuchAlgorithmException e) {
                // This wont happen, throw fatal.
                throw Utility.generateNewUnexpectedStorageException(e);
            }
        }

        // V2 cachedThreadPool for perf.
        this.threadExecutor = new ThreadPoolExecutor(
                this.options.getConcurrentRequestCount(),
                this.options.getConcurrentRequestCount(),
                10,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>());
        this.completionService = new ExecutorCompletionService<Void>(this.threadExecutor);
    }

    /**
     * Initializes a new instance of the BlobOutputStream class for a CloudBlockBlob
     *
     * @param parentBlob
     *            A {@link CloudBlockBlob} object which represents the blob that this stream is associated with.
     * @param accessCondition
     *            An {@link AccessCondition} object which represents the access conditions for the blob.
     * @param options
     *            A {@link BlobRequestOptions} object which specifies any additional options for the request.
     * @param opContext
     *            An {@link OperationContext} object which is used to track the execution of the operation.
     *
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    protected BlobOutputStream(final CloudBlockBlob parentBlob, final AccessCondition accessCondition,
            final BlobRequestOptions options, final OperationContext opContext) throws StorageException {
        this((CloudBlob) parentBlob, accessCondition, options, opContext);

        this.blockList = new ArrayList<BlockEntry>();
        this.blockIdPrefix = UUID.randomUUID().toString() + "-";

        this.streamType = BlobType.BLOCK_BLOB;
        this.internalWriteThreshold = this.parentBlobRef.getStreamWriteSizeInBytes();
    }

    /**
     * Initializes a new instance of the BlobOutputStream class for a CloudPageBlob
     *
     * @param parentBlob
     *            A {@link CloudPageBlob} object which represents the blob that this stream is associated with.
     * @param length
     *            A long which represents the length of the page blob in bytes, which must be a multiple of
     *            512.
     * @param accessCondition
     *            An {@link AccessCondition} object which represents the access conditions for the blob.
     * @param options
     *            A {@link BlobRequestOptions} object which specifies any additional options for the request
     * @param opContext
     *            An {@link OperationContext} object which is used to track the execution of the operation
     *
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    @DoesServiceRequest
    protected BlobOutputStream(final CloudPageBlob parentBlob, final long length,
            final AccessCondition accessCondition, final BlobRequestOptions options, final OperationContext opContext)
            throws StorageException {
        this(parentBlob, accessCondition, options, opContext);
        this.streamType = BlobType.PAGE_BLOB;

        this.internalWriteThreshold = (int) Math.min(this.parentBlobRef.getStreamWriteSizeInBytes(), length);
    }

    /**
     * Initializes a new instance of the BlobOutputStream class for a CloudAppendBlob
     *
     * @param parentBlob
     *            A {@link CloudAppendBlob} object which represents the blob that this stream is associated with.
     * @param accessCondition
     *            An {@link AccessCondition} object which represents the access conditions for the blob.
     * @param options
     *            A {@link BlobRequestOptions} object which specifies any additional options for the request
     * @param opContext
     *            An {@link OperationContext} object which is used to track the execution of the operation
     *
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    @DoesServiceRequest
    protected BlobOutputStream(final CloudAppendBlob parentBlob, final AccessCondition accessCondition,
            final BlobRequestOptions options, final OperationContext opContext)
            throws StorageException {
        this((CloudBlob)parentBlob, accessCondition, options, opContext);
        this.streamType = BlobType.APPEND_BLOB;

        this.accessCondition = accessCondition != null ? accessCondition : new AccessCondition();
        if (this.accessCondition.getIfAppendPositionEqual() != null) {
            this.currentBlobOffset = this.accessCondition.getIfAppendPositionEqual();
        }
        else {
            // If this is an existing blob, we've done a downloadProperties to get the length
            // If this is a new blob, getLength will correctly return 0
            this.currentBlobOffset = parentBlob.getProperties().getLength();
        }

        this.internalWriteThreshold = this.parentBlobRef.getStreamWriteSizeInBytes();
    }

    /**
     * Helper function to check if the stream is faulted, if it is it surfaces the exception.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    private void checkStreamState() throws IOException {
        if (this.lastError != null) {
            throw this.lastError;
        }
    }

    /**
     * Closes this output stream and releases any system resources associated with this stream. If any data remains in
     * the buffer it is committed to the service.
     *
     * @throws IOException
     *             If an I/O error occurs.
     */
    @Override
    @DoesServiceRequest
    public synchronized void close() throws IOException {
        try {
            // if the user has already closed the stream, this will throw a STREAM_CLOSED exception
            // if an exception was thrown by any thread in the threadExecutor, realize it now
            this.checkStreamState();

            // flush any remaining data
            this.flush();

            // shut down the ExecutorService.
            this.threadExecutor.shutdown();

            // try to commit the blob
            try {
                this.commit();
            }
            catch (final StorageException e) {
                throw Utility.initIOException(e);
            }
        }
        finally {
            // if close() is called again, an exception will be thrown
            this.lastError = new IOException(SR.STREAM_CLOSED);

            // if an exception was thrown and the executor was not yet closed, call shutDownNow() to cancel all tasks
            // and shutdown the ExecutorService
            if (!this.threadExecutor.isShutdown()) {
                this.threadExecutor.shutdownNow();
            }
        }
    }

    /**
     * Commits the blob, for block blob this uploads the block list.
     *
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    @DoesServiceRequest
    private synchronized void commit() throws StorageException {
        if (this.options.getStoreBlobContentMD5()) {
            this.parentBlobRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest()));
        }

        if (this.streamType == BlobType.BLOCK_BLOB) {
            // wait for all blocks to finish
            final CloudBlockBlob blobRef = (CloudBlockBlob) this.parentBlobRef;
            blobRef.commitBlockList(this.blockList, this.accessCondition, this.options, this.opContext);
        }
        else if (this.options.getStoreBlobContentMD5()) {
            this.parentBlobRef.uploadProperties(this.accessCondition, this.options, this.opContext);
        }
    }

    /**
     * Dispatches a write operation for a given length.
     *
     * @param writeLength
     *            An int which represents the length of the data to write, this is the write threshold that
     *            triggered the write.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    @DoesServiceRequest
    private synchronized void dispatchWrite() throws IOException {
        final int writeLength = this.outBuffer.size();
        if (writeLength == 0) {
            return;
        }

        if (this.streamType == BlobType.PAGE_BLOB && (writeLength % Constants.PAGE_SIZE != 0)) {
            throw new IOException(String.format(SR.INVALID_NUMBER_OF_BYTES_IN_THE_BUFFER, writeLength));
        }

        Callable<Void> worker = null;

        if (this.threadExecutor.getQueue().size() >= this.options.getConcurrentRequestCount() * 2) {
            this.waitForTaskToComplete();
        }

        if (this.futureSet.size() >= this.options.getConcurrentRequestCount() * 2) {
            this.clearCompletedFutures();
        }

        final ByteArrayInputStream bufferRef = new ByteArrayInputStream(this.outBuffer.toByteArray());

        if (this.streamType == BlobType.BLOCK_BLOB) {
            final String blockID = this.getCurrentBlockId();

            this.blockList.add(new BlockEntry(blockID, BlockSearchMode.LATEST));

            worker = new Callable<Void>() {
                @Override
                public Void call() {
                    BlobOutputStream.this.writeBlock(bufferRef, blockID, writeLength);
                    return null;
                }
            };
        }
        else if (this.streamType == BlobType.PAGE_BLOB) {
            final long opOffset = this.currentBlobOffset;
            this.currentBlobOffset += writeLength;

            worker = new Callable<Void>() {
                @Override
                public Void call() {
                    BlobOutputStream.this.writePages(bufferRef, opOffset, writeLength);
                    return null;
                }
            };
        }
        else if (this.streamType == BlobType.APPEND_BLOB) {
            final long opOffset = this.currentBlobOffset;
            this.currentBlobOffset += writeLength;

            // We cannot differentiate between max size condition failing only in the retry versus failing in the
            // first attempt and retry even for a single writer scenario. So we will eliminate the latter and handle
            // the former in the append block method.
            if (this.accessCondition.getIfMaxSizeLessThanOrEqual() != null
                    && this.currentBlobOffset > this.accessCondition.getIfMaxSizeLessThanOrEqual()) {
                this.lastError = new IOException(SR.INVALID_BLOCK_SIZE);
                throw this.lastError;
            }

            worker = new Callable<Void>() {
                @Override
                public Void call() {
                    BlobOutputStream.this.appendBlock(bufferRef, opOffset, writeLength);
                    return null;
                }
            };
        }

        // Add future to set
        this.futureSet.add(this.completionService.submit(worker));

        // Reset buffer.
        this.outBuffer = new ByteArrayOutputStream();
    }

    private void writeBlock(ByteArrayInputStream blockData, String blockId, long writeLength) {
        final CloudBlockBlob blobRef = (CloudBlockBlob) this.parentBlobRef;

        try {
            blobRef.uploadBlock(blockId, blockData, writeLength, this.accessCondition, this.options, this.opContext);
        }
        catch (final IOException e) {
            this.lastError = e;
        }
        catch (final StorageException e) {
            this.lastError = Utility.initIOException(e);
        }
    }

    private void writePages(ByteArrayInputStream pageData, long offset, long writeLength) {
        final CloudPageBlob blobRef = (CloudPageBlob) this.parentBlobRef;

        try {
            blobRef.uploadPages(pageData, offset, writeLength, this.accessCondition, this.options, this.opContext);
        }
        catch (final IOException e) {
            this.lastError = e;
        }
        catch (final StorageException e) {
            this.lastError = Utility.initIOException(e);
        }
    }

    private void appendBlock(ByteArrayInputStream blockData, long offset, long writeLength) {
        final CloudAppendBlob blobRef = (CloudAppendBlob) this.parentBlobRef;
        this.accessCondition.setIfAppendPositionEqual(offset);

        int previousResultsCount = this.opContext.getRequestResults().size();
        try {
            blobRef.appendBlock(blockData, writeLength, this.accessCondition, this.options, this.opContext);
        }
        catch (final IOException e) {
            this.lastError = e;
        }
        catch (final StorageException e) {
            if (this.options.getAbsorbConditionalErrorsOnRetry()
                    && e.getHttpStatusCode() == HttpURLConnection.HTTP_PRECON_FAILED
                    && e.getExtendedErrorInformation() != null
                    && e.getExtendedErrorInformation().getErrorCode() != null
                    && (e.getExtendedErrorInformation().getErrorCode()
                            .equals(StorageErrorCodeStrings.INVALID_APPEND_POSITION) || e.getExtendedErrorInformation()
                            .getErrorCode().equals(StorageErrorCodeStrings.INVALID_MAX_BLOB_SIZE_CONDITION))
                    && (this.opContext.getRequestResults().size() - previousResultsCount > 1)) {

                // Pre-condition failure on a retry should be ignored in a single writer scenario since
                // the request succeeded in the first attempt.
                Logger.info(this.opContext, SR.PRECONDITION_FAILURE_IGNORED);
            }
            else {
                this.lastError = Utility.initIOException(e);
            }
        }
    }

    /**
     * Flushes this output stream and forces any buffered output bytes to be written out. If any data remains in the
     * buffer it is committed to the service.
     *
     * @throws IOException
     *             If an I/O error occurs.
     */
    @Override
    @DoesServiceRequest
    public void flush() throws IOException {
        this.checkStreamState();

        this.dispatchWrite();

        // Waits for all submitted tasks to complete
        Set<Future<Void>> requests = new HashSet<Future<Void>>(this.futureSet);
        for (Future<Void> request : requests) {
            // wait for the future to complete
            try {
                request.get();
            }
            catch (Exception e) {
                throw Utility.initIOException(e);
            }

            // If that task threw an error, fail fast
            this.checkStreamState();
        }
    }

    /**
     * Generates a new block ID to be used for PutBlock.
     *
     * @return Base64 encoded block ID
     * @throws IOException
     */
    private String getCurrentBlockId() throws IOException
    {
        String blockIdSuffix = String.format("%06d", this.blockList.size());

        byte[] blockIdInBytes;
        try {
            blockIdInBytes = (this.blockIdPrefix + blockIdSuffix).getBytes(Constants.UTF8_CHARSET);
        } catch (UnsupportedEncodingException e) {
            // this should never happen, UTF8 is a default charset
            throw new IOException(e);
        }

        return Base64.encode(blockIdInBytes);
    }

    /**
     * Waits for at least one task to complete.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    private void waitForTaskToComplete() throws IOException {
        boolean completed = false;
        while (this.completionService.poll() != null) {
            completed = true;
        }

        if (!completed) {
            try {
                this.completionService.take();
            }
            catch (final InterruptedException e) {
                throw Utility.initIOException(e);
            }
        }
    }

    /**
     * Removes futures which are done from the future set.
     */
    private void clearCompletedFutures() {
        for (Future<Void> request : this.futureSet) {
            if (request.isDone()) {
                this.futureSet.remove(request);
            }
        }
    }

    /**
     * Writes b.length bytes from the specified byte array to this output stream.
     *

     * If you are using {@link CloudAppendBlob} and are certain of a single writer scenario, please look at
     * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag to
     * true is acceptable for you.
     *
     * @param data
     *            A byte array which represents the data to write.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    @Override
    @DoesServiceRequest
    public void write(final byte[] data) throws IOException {
        this.write(data, 0, data.length);
    }

    /**
     * Writes length bytes from the specified byte array starting at offset to this output stream.
     *

     * If you are using {@link CloudAppendBlob} and are certain of a single writer scenario, please look at
     * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag to
     * true is acceptable for you.
     *
     * @param data
     *            A byte array which represents the data to write.
     * @param offset
     *            An int which represents the start offset in the data.
     * @param length
     *            An int which represents the number of bytes to write.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    @Override
    @DoesServiceRequest
    public void write(final byte[] data, final int offset, final int length) throws IOException {
        if (offset < 0 || length < 0 || length > data.length - offset) {
            throw new IndexOutOfBoundsException();
        }

        this.writeInternal(data, offset, length);
    }

    /**
     * Writes all data from the InputStream to the Blob.
     *

     * If you are using {@link CloudAppendBlob} and are certain of a single writer scenario, please look at
     * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag to
     * true is acceptable for you.
     *
     * @param sourceStream
     *            An {@link InputStream} object which species the data to write to the Blob.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     * @throws StorageException
     *             An exception representing any error which occurred during the operation.
     */
    @DoesServiceRequest
    public void write(final InputStream sourceStream, final long writeLength) throws IOException, StorageException {
        Utility.writeToOutputStream(sourceStream, this, writeLength, false, false, this.opContext, this.options);
    }

    /**
     * Writes the specified byte to this output stream. The general contract for write is that one byte is written to
     * the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits
     * of b are ignored.
     *

     * If you are using {@link CloudAppendBlob} and are certain of a single writer scenario, please look at
     * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag to
     * true is acceptable for you.
     *
     * @param byteVal
     *            An int which represents the bye value to write.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */
    @Override
    @DoesServiceRequest
    public void write(final int byteVal) throws IOException {
        this.write(new byte[] { (byte) (byteVal & 0xFF) });
    }

    /**
     * Writes the data to the buffer and triggers writes to the service as needed.
     *
     * @param data
     *            A byte array which represents the data to write.
     * @param offset
     *            An int which represents the start offset in the data.
     * @param length
     *            An int which represents the number of bytes to write.
     *
     * @throws IOException
     *             If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
     *             closed.
     */

    @DoesServiceRequest
    private synchronized void writeInternal(final byte[] data, int offset, int length) throws IOException {
        while (length > 0) {
            this.checkStreamState();

            final int availableBufferBytes = this.internalWriteThreshold - this.outBuffer.size();
            final int nextWrite = Math.min(availableBufferBytes, length);

            // If we need to set MD5 then update the digest accordingly
            if (this.options.getStoreBlobContentMD5()) {
                this.md5Digest.update(data, offset, nextWrite);
            }

            this.outBuffer.write(data, offset, nextWrite);
            offset += nextWrite;
            length -= nextWrite;

            if (this.outBuffer.size() == this.internalWriteThreshold) {
                this.dispatchWrite();
            }
        }
    }
}


text:
package aia.stream

import java.nio.file.{ Path, Paths }

object FileArg {
  def shellExpanded(path: String): Path = {
    if(path.startsWith("~/")) {
      Paths.get(System.getProperty("user.home"), path.drop(2))
    } else {
      Paths.get(path)
    }
  }
}


text:
/**
 * The ConvolutionFilter class applies a matrix convolution filter effect.
 * A convolution combines pixels in the input image with neighboring pixels to produce a new image.
 * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.
 * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.
 *
 * @class ConvolutionFilter
 * @extends AbstractFilter
 * @constructor
 * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array.
 * @param width {Number} Width of the object you are transforming
 * @param height {Number} Height of the object you are transforming
 */
PIXI.ConvolutionFilter = function(matrix, width, height)
{
    PIXI.AbstractFilter.call( this );

    this.passes = [this];

    // set the uniforms
    this.uniforms = {
        m : {type: '1fv', value: new PIXI.Float32Array(matrix)},
        texelSizeX: {type: '1f', value: 1 / width},
        texelSizeY: {type: '1f', value: 1 / height}
    };

    this.fragmentSrc = [
        'precision mediump float;',
        'varying mediump vec2 vTextureCoord;',
        'uniform sampler2D texture;',
        'uniform float texelSizeX;',
        'uniform float texelSizeY;',
        'uniform float m[9];',

        'vec2 px = vec2(texelSizeX, texelSizeY);',

        'void main(void) {',
            'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left
            'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center
            'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right

            'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left
            'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center
            'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right

            'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left
            'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center
            'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right

            'gl_FragColor = ',
            'c11 * m[0] + c12 * m[1] + c22 * m[2] +',
            'c21 * m[3] + c22 * m[4] + c23 * m[5] +',
            'c31 * m[6] + c32 * m[7] + c33 * m[8];',
            'gl_FragColor.a = c22.a;',
        '}'
    ];

};

PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter;

/**
 * An array of values used for matrix transformation. Specified as a 9 point Array.
 *
 * @property matrix
 * @type Array
 */
Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', {
    get: function() {
        return this.uniforms.m.value;
    },
    set: function(value) {
        this.uniforms.m.value = new PIXI.Float32Array(value);
    }
});

/**
 * Width of the object you are transforming
 *
 * @property width
 * @type Number
 */
Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', {
    get: function() {
        return this.uniforms.texelSizeX.value;
    },
    set: function(value) {
        this.uniforms.texelSizeX.value = 1/value;
    }
});

/**
 * Height of the object you are transforming
 *
 * @property height
 * @type Number
 */
Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', {
    get: function() {
        return this.uniforms.texelSizeY.value;
    },
    set: function(value) {
        this.uniforms.texelSizeY.value = 1/value;
    }
});


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IFeature.cs">
//   Copyright (c) by respective owners including Yahoo!, Microsoft, and
//   individual contributors. All rights reserved.  Released under a BSD
//   license as described in the file LICENSE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace VW.Serializer.Interfaces
{
    /// <summary>
    /// Intermediate representation of a property annotated as <see cref="Microsoft.Research.MachineLearning.Serializer.Attributes.FeatureAttribute"/>.
    /// </summary>
    public interface IFeature
    {
        /// <summary>
        /// The targeted namespace.
        /// </summary>
        string Namespace { get; }

        /// <summary>
        /// The targeted feature group.
        /// </summary>
        char? FeatureGroup { get; }

        /// <summary>
        /// The origin property name is used as the feature name.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// If true, features will be converted to string and then hashed.
        /// In VW line format: Age:15 (Enumerize=false), Age_15 (Enumerize=true)
        /// Defaults to false.
        /// </summary>
        bool Enumerize { get; }
    }

    /// <summary>
    /// The typed representation of the feature.
    /// </summary>
    /// <typeparam name="T">Type of feature value.</typeparam>
    public interface IFeature<out T> : IFeature
    {
        /// <summary>
        /// The actual value of the feature.
        /// </summary>
        T Value { get; }
    }
}


text:
UPDATE role SET role = 'Registered' WHERE role = 'User';

INSERT INTO role VALUES ( 6, 'Anonymous' );

TRUNCATE TABLE user_clustering_session CASCADE;
ALTER TABLE user_clustering_session
  DROP COLUMN is_anonymous,
  DROP COLUMN ip_address,
  ALTER COLUMN user_id SET NOT NULL;

# --- !Downs
TRUNCATE TABLE user_clustering_session CASCADE;
ALTER TABLE user_clustering_session
  ADD COLUMN is_anonymous BOOLEAN NOT NULL,
  ADD COLUMN ip_address TEXT,
  ALTER COLUMN user_id DROP NOT NULL;

UPDATE user_role SET role_id = 1 WHERE role_id = 6;
DELETE FROM role WHERE role = 'Anonymous';

UPDATE role SET role = 'User' WHERE role = 'Registered';


text:
* Increase the maximum multi-bulk reply depth to 8.

* Increase the read buffer size from 2k to 16k.

* Use poll(2) instead of select(2) to support large fds (>= 1024).

### 0.10.1

* Makefile overhaul. Important to check out if you override one or more
  variables using environment variables or via arguments to the "make" tool.

* Issue #45: Fix potential memory leak for a multi bulk reply with 0 elements
  being created by the default reply object functions.

* Issue #43: Don't crash in an asynchronous context when Redis returns an error
  reply after the connection has been made (this happens when the maximum
  number of connections is reached).

### 0.10.0

* See commit log.


text:
Pancake.js
=========

A mini-library for easily flattening SVG and Canvas elements into images on the fly.  For SVG elements, it relies on [canvg](https://code.google.com/p/canvg/) for the heavy lifting.

# When to use #

If you're drawing dynamic SVG or Canvas graphics, but you want to replace them with flat images in the browser.  This can also be done with server-side scripts or manually using things like [SVG Crowbar](http://nytimes.github.io/svg-crowbar/), but sometimes you want to cut out the middleman, y'know?

# How to use #

## Flavors ##

If you're only converting Canvas elements, there are no dependencies.  Just include the small JavaScript file:

If you're converting SVG elements, you need to include the canvg library too.  You can use the hosted version:

You can also use `pancake.stack.js` or `pancake.stack.min.js`, which combines them into a single file for the lazy:

## Making a pancake ##

To create a flat image based on an SVG or Canvas element, just call the constructor and pass either the element itself or the ID of the element.

	//Passing the element itself
	var flapjack = Pancake(svgElement);

	//Passing the element's ID
	var flapjack = Pancake("map");

You can also pass an optional image format.  If you don't pass one, it will default to PNG.

	//Make it a JPG instead of a PNG
	var flapjack = Pancake("map","jpg");

	//This works too.  We're not that picky
	var flapjack = Pancake("map","image/jpeg");

You can also pass any custom `<img>` attributes you want.

	//Pass in a special class and an alt for the image
	//You'll get back
	var flapjack = Pancake("map",{class: "imageClass", alt: "this is an image!"});

	//Pass in specific height/width
	//You'll get back
	var flapjack = Pancake("map",{height: 400, width: 200});

### Serving a pancake ###

Once you've created a pancake, access its `src` or `element` property to actually serve it to a user.  The `src` is a [data URI](https://developer.mozilla.org/en-US/docs/data_URIs); you can use it like you would any image URL.

	var flapjack = Pancake(someSortofSVG);

	//Use the .element property to get the image as a new  element
	gallery.append(flapjack.element);

	//Use the .src property if you just want the image src
	//Useful if you want to change an existing image element
	existingImage.src = flapjack.src;

	//Also useful for things like using it as a background image instead
	myDiv.style.backgroundImage = "url("+flapjack.src+"")";

	//You can also access the .width and .height properties, but they may not be reliable
	flapjack.height; //e.g. 480
	flapjack.width; //e.g. 320

If you want to replace a DOM element, use the `.replace()` method.  Like the constructor, this takes either a document element or the ID of the element.  This is useful if, say, you've drawn an SVG and then you want to replace the SVG with the image version.

	<svg id="myChart">...</svg>

	var flapjack = Pancake("myChart"); //Generate the image
	flapjack.replace("myChart"); //Replace the SVG with the image

	//You can pass the element too
	var el = document.getElementById("myChart");
	var flapjack = Pancake(el);
	flapjack.replace(el);

To trigger a download of the image, use the `.download()` method.  It accepts an optional filename for the download.

	var flapjack = Pancake("pieChart"); //Generate the image
	flapjack.download("blueberry.png"); //User will be prompted to download blueberry.png

## Reference ##

### Constructor ###

**Pancake([element],[format],[attributes])**

Returns a pancaked image and some other handy properties.

*element* can be a DOM element (either `<svg>` or `<canvas>`) or an element ID (like "myChartId").  Required.

*format* is an optional image format.  Accepted values are: `png`, `image/png`, `webp`, `image/webp`, `jpg`, `jpeg`, `image/jpg`, `image/jpeg`.  The default is `png`.

*attributes* is an optional list of extra attributes to give the resulting `<img>` element.  You can pass any number of attributes, like `class`, `id`, `style`, `alt`, etc.  Must be an object of the form `{attributeName: attributeValue, attributeName: attributeValue}`.  You can pass the image format in this object instead of as a separate argument if you feel like it.

    var p = Pancake("mySvg");
    var pJPG = Pancake("mySvg","jpg");
    var pAlsoJPG = Pancake("mySvg",{format: "jpg"});
    var pWithClass = Pancake("mySvg",{class: "syrupy"});
    var pJPGWithClass = Pancake("mySvg","jpg",{class: "syrupy"});
    var p50x50 = Pancake("mySvg","jpg",{height: 50, width: 50});

### Properties of a pancake ###

**p.src**

The [data URI](https://developer.mozilla.org/en-US/docs/data_URIs) for a pancaked image.  This can be used just like an image URL.  Put it in the `src` of an existing image, or make it the `href` of a link, or set it as a background image.

**p.element**

An `<img>` element you can manipulate and/or add to the page.  Includes any custom attributes you passed to the constructor.  Treat it like any other element.

**p.format**

The format of the pancaked image.  Either `png`,`jpg`,`webp`.

**p.width and p.height**

The width and height of the pancaked image.  Probably not reliable.

### Methods of a pancake ###

**p.replace([elementToReplace])**

Replace the element on the page with the pancaked image.  *elementToReplace* can be either an element or the ID of an element.  It can be a `<div>`, another `<img>`, the original `<svg>` that created the image, or any other kind of element.  Be careful replacing something with unknown dimensions, though, it could mess up your layout.

**p.download([filename])**

Triggers a download of the original pancaked image.  If *filename* is supplied, that will be the default filename of the download.  Otherwise, it will guess a reasonable filename using the ID of the original `<svg>` or `<canvas>` element.  If there is no ID, it will default to `image.png`, `image.jpg`, or `image.webp` (depending on the format).

## To Dos ##

* Smarter width/height detection - although it's unclear if this even matters.
* The download() method works by creating an `<a>` element with the data URI as the `href` attribute, inserting it, and simulating a click.  This is not the most cross-browser-friendly thing.
* Not well set up for creating multiple copies of the same image using the .element property, would need to be done with .src instead
* Look into provided a nice download URL for the image itself, not just a download link (so far doesn't seem possible)
* Haven't tested this that much.  Should test it on more browsers and with unusual inputs.

## Other Resources ##

* [canvg](https://code.google.com/p/canvg/), for converting canvas elements to SVG
* [SVG Crowbar](http://nytimes.github.io/svg-crowbar/), for saving out an in-browser SVG as a .svg file with associated styles
* [Grumpicon](http://www.grumpicon.com/), for converting SVGs into fallback images, also available as a [command line utility](https://github.com/filamentgroup/grunticon).

## Questions/Comments/Suggestions ##
Noah Veltman
Web: http://noahveltman.com
Twitter: [@veltman](http://twitter.com/veltman)
Email: [noah@noahveltman.com](mailto:noah@noahveltman.com)


text:
package com.bccapi.bitlib.util;

import java.nio.charset.Charset;

import com.bccapi.bitlib.model.CompactInt;

final public class ByteWriter {

   private static final Charset UTF8_CHARSET = Charset.forName("UTF8");

   private byte[] _buf;
   private int _index;

   public ByteWriter(int capacity) {
      _buf = new byte[capacity];
      _index = 0;
   }

   public ByteWriter(byte[] buf) {
      _buf = buf;
      _index = buf.length;
   }

   final private void ensureCapacity(int capacity) {
      if (_buf.length - _index < capacity) {
         byte[] temp = new byte[_buf.length * 2 + capacity];
         System.arraycopy(_buf, 0, temp, 0, _index);
         _buf = temp;
      }
   }

   public void put(byte b) {
      ensureCapacity(1);
      _buf[_index++] = b;
   }

   public void putShortLE(short value) {
      ensureCapacity(2);
      _buf[_index++] = (byte) (0xFF & (value >> 0));
      _buf[_index++] = (byte) (0xFF & (value >> 8));
   }

   public void putIntLE(int value) {
      ensureCapacity(4);
      _buf[_index++] = (byte) (0xFF & (value >> 0));
      _buf[_index++] = (byte) (0xFF & (value >> 8));
      _buf[_index++] = (byte) (0xFF & (value >> 16));
      _buf[_index++] = (byte) (0xFF & (value >> 24));
   }

   public void putLongLE(long value) {
      ensureCapacity(8);
      _buf[_index++] = (byte) (0xFFL & (value >> 0));
      _buf[_index++] = (byte) (0xFFL & (value >> 8));
      _buf[_index++] = (byte) (0xFFL & (value >> 16));
      _buf[_index++] = (byte) (0xFFL & (value >> 24));
      _buf[_index++] = (byte) (0xFFL & (value >> 32));
      _buf[_index++] = (byte) (0xFFL & (value >> 40));
      _buf[_index++] = (byte) (0xFFL & (value >> 48));
      _buf[_index++] = (byte) (0xFFL & (value >> 56));
   }

   public void putBytes(byte[] value) {
      ensureCapacity(value.length);
      System.arraycopy(value, 0, _buf, _index, value.length);
      _index += value.length;
   }

   public void putBytes(byte[] value, int offset, int length) {
      ensureCapacity(length);
      System.arraycopy(value, offset, _buf, _index, length);
      _index += length;
   }

   public void putCompactInt(long value) {
      putBytes(CompactInt.toBytes(value));
   }

   public void putSha256Hash(Sha256Hash hash) {
      putBytes(hash.getBytes());
   }

   public void putSha256Hash(Sha256Hash hash, boolean reverse) {
      if (reverse) {
         putBytes(BitUtils.reverseBytes(hash.getBytes()));
      } else {
         putBytes(hash.getBytes());
      }
   }

   public void putString(String s) {
      byte[] bytes = s.getBytes(UTF8_CHARSET);
      putIntLE(bytes.length);
      putBytes(bytes);
   }

   public byte[] toBytes() {
      byte[] bytes = new byte[_index];
      System.arraycopy(_buf, 0, bytes, 0, _index);
      return bytes;
   }

   public int length() {
      return _index;
   }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.apache.jena.riot.thrift.wire.RDF_StreamRow (Apache Jena ARQ)</title>
<meta name="date" content="2014-10-02">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.jena.riot.thrift.wire.RDF_StreamRow

Packages that use RDF_StreamRow

Package
Description

org.apache.jena.riot.thrift

org.apache.jena.riot.thrift.wire

Uses of RDF_StreamRow in org.apache.jena.riot.thrift

Methods in org.apache.jena.riot.thrift with parameters of type RDF_StreamRow

Modifier and Type
Method and Description

static void
TRDF.visit(RDF_StreamRow row,
     VisitorStreamRowTRDF visitor)

Method parameters in org.apache.jena.riot.thrift with type arguments of type RDF_StreamRow

Modifier and Type
Method and Description

static void
BinRDF.apply(org.apache.thrift.protocol.TProtocol protocol,
     Action<RDF_StreamRow> action)

Send the contents of a RDF-encoded Thrift file to an "action"

Uses of RDF_StreamRow in org.apache.jena.riot.thrift.wire

Methods in org.apache.jena.riot.thrift.wire that return RDF_StreamRow

Modifier and Type
Method and Description

RDF_StreamRow
RDF_StreamRow.deepCopy()

static RDF_StreamRow
RDF_StreamRow.prefixDecl(RDF_PrefixDecl value)

static RDF_StreamRow
RDF_StreamRow.quad(RDF_Quad value)

static RDF_StreamRow
RDF_StreamRow.triple(RDF_Triple value)

Methods in org.apache.jena.riot.thrift.wire with parameters of type RDF_StreamRow

Modifier and Type
Method and Description

int
RDF_StreamRow.compareTo(RDF_StreamRow other)

boolean
RDF_StreamRow.equals(RDF_StreamRow other)

Constructors in org.apache.jena.riot.thrift.wire with parameters of type RDF_StreamRow

Constructor and Description

RDF_StreamRow(RDF_StreamRow other)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Licenced under the Apache License, Version 2.0


text:
// This file is automatically generated.

package adila.db;

/*
 * Motorola Moto E with 4G LTE (2nd Gen)
 *
 * DEVICE: surnia_cdma
 * MODEL: XT1528
 */
final class surnia5fcdma_xt1528 {
    public static final String DATA = "Motorola|Moto E with 4G LTE (2nd Gen)|";
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Description;
using Limpeza.Models;

namespace Limpeza.Controllers
{
    [RoutePrefix("api/ColetaLixo")]
    public class ColetaLixoController : ApiController
    {
        private static Random rnd;
        static ColetaLixoController()
        {
            rnd = new Random();
        }

        [Route("{logradouro:alpha}", Name = "GetColetaLixoByLogradouro")]
        [ResponseType(typeof(List<DiaColeta>))]
        public IHttpActionResult Get(string logradouro)
        {

            List<DiaColeta> diasColeta = new List<DiaColeta>();
            diasColeta.Add(new DiaColeta(logradouro, getDayRandom()));
            diasColeta.Add(new DiaColeta(logradouro, getDayRandom()));
            if (diasColeta == null)
            {
                return NotFound();
            }

            return Ok(diasColeta);
        }

        private string getDayRandom()
        {
            DayOfWeek dia = (DayOfWeek)rnd.Next(0, 6);
            return dia.ToString();
        }
    }
}


text:
package com.streamsets.pipeline.stage.destination.sdcipc;

import org.bouncycastle.x509.X509V1CertificateGenerator;
import org.h2.util.IOUtils;

import javax.security.auth.x500.X500Principal;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Date;

public class SSLTestUtils {

  public static X509Certificate generateCertificate(String dn, KeyPair keyPair, int days) throws Exception {

    Date from = new Date();
    Date to = new Date(from.getTime() + days * 86400000l);
    BigInteger sn = new BigInteger(64, new SecureRandom());
    X509V1CertificateGenerator certGen = new X509V1CertificateGenerator();
    X500Principal dnName = new X500Principal(dn);

    certGen.setSerialNumber(sn);
    certGen.setIssuerDN(dnName);
    certGen.setNotBefore(from);
    certGen.setNotAfter(to);
    certGen.setSubjectDN(dnName);
    certGen.setPublicKey(keyPair.getPublic());
    certGen.setSignatureAlgorithm("SHA1withRSA");

    return certGen.generate(keyPair.getPrivate());
  }

  public static KeyPair generateKeyPair() throws Exception {
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
    keyGen.initialize(1024);
    return keyGen.genKeyPair();
  }

  private static KeyStore createEmptyKeyStore() throws GeneralSecurityException, IOException {
    KeyStore ks = KeyStore.getInstance("JKS");
    ks.load(null, null); // initialize
    return ks;
  }

  private static void saveKeyStore(KeyStore ks, String filename, String password)  throws Exception {
    try (FileOutputStream out = new FileOutputStream(filename)) {
      ks.store(out, password.toCharArray());
    }
  }

  public static void createKeyStore(String filename, String password, String alias, Key privateKey, Certificate cert)
      throws Exception {
    KeyStore ks = createEmptyKeyStore();
    ks.setKeyEntry(alias, privateKey, password.toCharArray(), new Certificate[]{cert});
    saveKeyStore(ks, filename, password);
  }

  public static void createTrustStore(String filename, String password, String alias, Certificate cert)
      throws Exception {
    KeyStore ks = createEmptyKeyStore();
    ks.setCertificateEntry(alias, cert);
    saveKeyStore(ks, filename, password);
  }

  public static String getHostname() throws Exception {
    Process p = Runtime.getRuntime().exec("hostname");
    p.waitFor();
    return IOUtils.readStringAndClose(new InputStreamReader(p.getInputStream()), 1000).trim();
  }
}


text:
#include "HASH160.hpp"

#include <crypto/BLAKE.h>
std::vector<uint8_t> ledger::core::HASH160::hash(const std::vector<uint8_t> &data, const HashAlgorithm &hashAlgorithm) {
    return RIPEMD160::hash(hashAlgorithm.bytesToBytesHash(data));
}


text:
var util        = require('util'),
    Client      = require('./client').Client;

var ActivityStream = exports.ActivityStream = function (options) {
  this.jsonAPINames = [ 'activities', 'activity' ];
  Client.call(this, options);
};

// Inherit from Client base object
util.inherits(ActivityStream, Client);

// ######################################################## ActivityStream
// ====================================== Listing ActivityStream
ActivityStream.prototype.list = function (cb) {
  return this.requestAll('GET', ['activities'], cb);//all
};

// ====================================== Viewing ActivityStream

ActivityStream.prototype.show = function (activityID, cb) {
  return this.request('GET', ['activities', activityID], cb);
};