text:
require "time"

module Artifactory
  class Resource::BuildComponent < Resource::Base
    class << self
      #
      # Search for all compoenents for which build data exists.
      #
      # @param [Hash] options
      #   the list of options
      #
      # @option options [Artifactory::Client] :client
      #   the client object to make the request with
      #
      # @return [Array<Resource::BuildComponent>]
      #   the list of builds
      #
      def all(options = {})
        client = extract_client!(options)
        client.get("/api/build")["builds"].map do |component|
          from_hash(component, client: client)
        end.compact.flatten
      rescue Error::HTTPError => e
        # Artifactory returns a 404 instead of an empty list when there are no
        # builds. Whoever decided that was a good idea clearly doesn't
        # understand the point of REST interfaces...
        raise unless e.code == 404
        []
      end

      #
      # Find (fetch) data for a particular build component
      #
      # @example Find a particular build component
      #   BuildComponent.find('wicket') #=> #<BuildComponent name: 'wicket' ...>
      #
      # @param [String] name
      #   the name of the build component
      # @param [Hash] options
      #   the list of options
      #
      # @option options [Artifactory::Client] :client
      #   the client object to make the request with
      #
      # @return [Resource::BuildComponent, nil]
      #   an instance of the build component that matches the given name,
      #   or +nil+ if one does not exist
      #
      def find(name, options = {})
        client = extract_client!(options)
        all.find do |component|
          component.name == name
        end
      end

      #
      # @see Artifactory::Resource::Base.from_hash
      #
      def from_hash(hash, options = {})
        super.tap do |instance|
          # Remove the leading / from the `uri` value. Converts `/foo` to `foo`.
          instance.name = instance.uri.slice(1..-1)
          instance.last_started = Time.parse(instance.last_started) rescue nil
        end
      end
    end

    attribute :uri
    attribute :name, -> { raise "Name missing!" }
    attribute :last_started

    #
    # The list of build data for this component.
    #
    # @example Get the list of artifacts for a repository
    #   component = BuildComponent.new(name: 'wicket')
    #   component.builds #=> [#<Resource::Build>, ...]
    #
    # @return [Collection::Build]
    #   the list of builds
    #
    def builds
      @builds ||= Collection::Build.new(self, name: name) do
        Resource::Build.all(name)
      end
    end

    #
    # Remove this component's build data stored in Artifactory
    #
    # @option options [Array<String>] :build_numbers (default: nil)
    #   an array of build numbers that should be deleted; if not given
    #   all builds (for this component) are deleted
    # @option options [Boolean] :artifacts (default: +false+)
    #   if true the component's artifacts are also removed
    # @option options [Boolean] :delete_all (default: +false+)
    #   if true the entire component is removed
    #
    # @return [Boolean]
    #   true if the object was deleted successfully, false otherwise
    #
    def delete(options = {})
      params = {}.tap do |param|
        param[:buildNumbers] = options[:build_numbers].join(",") if options[:build_numbers]
        param[:artifacts]    = 1 if options[:artifacts]
        param[:deleteAll]    = 1 if options[:delete_all]
      end

      endpoint = api_path + "?#{to_query_string_parameters(params)}"
      client.delete(endpoint, {})
      true
    rescue Error::HTTPError => e
      false
    end

    #
    # Rename a build component.
    #
    # @param [String] new_name
    #   new name for the component
    #
    # @return [Boolean]
    #   true if the object was renamed successfully, false otherwise
    #
    def rename(new_name, options = {})
      endpoint = "/api/build/rename/#{url_safe(name)}" + "?to=#{new_name}"
      client.post(endpoint, {})
      true
    rescue Error::HTTPError => e
      false
    end

    private

    #
    # The path to this build component on the server.
    #
    # @return [String]
    #
    def api_path
      "/api/build/#{url_safe(name)}"
    end
  end
end


text:
package mil.darpa.xdata.louvain.mapreduce;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableUtils;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Writable class to represent community information for compressing a graph
 * by its communities.
 */
public class LouvainVertexWritable implements Writable {

	long weight;
	Map<String,Long> edges;

	@Override
	public void readFields(DataInput in) throws IOException {
		weight = in.readLong();
		int edgeSize = in.readInt();
		edges = new HashMap<String,Long>(edgeSize);
		for (int i =0; i< edgeSize; i++){
			edges.put(WritableUtils.readString(in), in.readLong());
		}

	}

	@Override
	public void write(DataOutput out) throws IOException {
		out.writeLong(weight);
		out.writeInt(edges.size());
		for (Map.Entry<String,Long> entry : edges.entrySet()){
			WritableUtils.writeString(out, entry.getKey());
			out.writeLong(entry.getValue());
		}
	}

	public static LouvainVertexWritable fromTokens(String weight,String edges){

		LouvainVertexWritable vertex = new LouvainVertexWritable();
		vertex.weight = Long.parseLong(weight);
		Map<String,Long> edgeMap = new HashMap<String,Long>();
		if (edges.length() > 0){
			for (String edgeTuple: edges.split(",")){
				String[] edgeTokens = edgeTuple.split(":");
				edgeMap.put(edgeTokens[0], Long.parseLong(edgeTokens[1]));
			}
		}
		vertex.edges = edgeMap;
		return vertex;
	}

}

redpajama_set_name: RedPajamaGithub


text:
class Post < ActiveRecord::Base
  has_many  :answers
  can_count :answers
  has_many  :authors, through: :answers
  can_count :authors
  belongs_to :author
end

class Answer < ActiveRecord::Base
  belongs_to  :post
  belongs_to :author
end

class Author < ActiveRecord::Base
  has_many :posts
  has_many :answers
end


text:
using Detached.Annotations;
using Detached.Mappers;
using System.ComponentModel.DataAnnotations.Schema;
using Xunit;

namespace Detached.Mappers.Tests.Mapping
{
    public class NotMappedPropertyTests
    {
        readonly Mapper _mapper = new Mapper();

        [Fact]
        public void IgnoreNotMapped()
        {
            Entity source = new Entity
            {
                Text1 = "target_text1",
                Text2 = "target_text2"
            };

            Entity target = new Entity
            {
                Text1 = "source_text1",
                Text2 = "source_text2"
            };

            var mapped =_mapper.Map(source, target);

            Assert.Equal("target_text1", mapped.Text1);
            Assert.Equal("source_text2", mapped.Text2);
        }

        public class Entity
        {
            public string Text1 { get; set; }

            [NotMapped]
            public string Text2 { get; set; }
        }
    }
}


text:
/************************************************************************************************
 * File name		: TestCases4classes.h
 * Description		: Design test cases to validate the module "classes".
 * Creator			: XU ZAN
 * Creation date	: Fri. Feb. 06, 2015
 * Copyriight(C)	2015	All rights reserved.
 *
 ************************************************************************************************/

#ifndef TEST_CASES_4_CLASSES_H
#define TEST_CASES_4_CLASSES_H

	void TestCase4_Use_PrivateDataMember(void);
	void TestCase4_Conversion_PrivateDataMember(void);

	void TestCase4_ConversionFunc(void);

#endif	/*  TEST_CASES_4_CLASSES_H  */


text:
Classes
=======

This is a complete list of available classes:

- [`Phine\Accessor\Type\AbstractNullableType`](Phine/Accessor/Type/AbstractNullableType.md) — The basis for a nullable type class.
- [`Phine\Accessor\Type\ArrayType`](Phine/Accessor/Type/ArrayType.md) — A type class for the array value type.
- [`Phine\Accessor\Type\BooleanType`](Phine/Accessor/Type/BooleanType.md) — A type class for the boolean value type.
- [`Phine\Accessor\Type\CallableType`](Phine/Accessor/Type/CallableType.md) — A type class for a callable value.
- [`Phine\Accessor\Type\FloatType`](Phine/Accessor/Type/FloatType.md) — A type class for the float value type.
- [`Phine\Accessor\Type\InstanceType`](Phine/Accessor/Type/InstanceType.md) — A type class for instances of a specific class or interface.
- [`Phine\Accessor\Type\IntegerType`](Phine/Accessor/Type/IntegerType.md) — A type class for the integer value type.
- [`Phine\Accessor\Type\MixedType`](Phine/Accessor/Type/MixedType.md) — A type class for any value type.
- [`Phine\Accessor\Type\ObjectType`](Phine/Accessor/Type/ObjectType.md) — A type class for the object value type.
- [`Phine\Accessor\Type\ResourceType`](Phine/Accessor/Type/ResourceType.md) — A type class for the resource value type.
- [`Phine\Accessor\Type\StringType`](Phine/Accessor/Type/StringType.md) — A type class for the string value type.


text:
echo 'UseDNS no' >> /etc/ssh/sshd_config

yum -y update
yum -y install gcc make gcc-c++ kernel-headers kernel-devel-`uname -r` zlib-devel openssl-devel
yum -y install build-essential readline-devel sqlite-devel nfs-utils wget dkms perl acpid bzip2

wget -O /etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem


text:
//initialize jsonQ
;(function(undefined) {

    var jsonQ = function(json) {
        //return a jsonQ object
        return new jsonQ.fn.init(json);
    },
        //plugin variable and methods
        error = function(msg) {
            throw msg;
        },
        stringify = JSON.stringify,
        parse = JSON.parse;

    //global settings
    jsonQ.settings = {
        sort: {
            "order": "ASC",
            "logic": function(val) {
                return val;
            },
            "caseIgnore": true,
            "allLevel": true //to sort all level if true and if false only lowest level
        }
    };

    /*****private functions for internal use only*******/

    //to check weather path b is subset of path a
    function matchPath(a, b) {
        var regex = new RegExp('^' + a.join('~~'), 'i');
        return regex.test(b.join('~~'));
    }

    //function to create new format
    function newFormat(option) {
        //parameter change
        var keyAdded = option.keyAdded || [],
            json = option.json,
            path = option.path,
            newJson = option.newJson;
        //add to new json

        jsonQ.each(json, function(k, val) {
            var lvlpath = path ? JSON.parse(JSON.stringify(path)) : [];
            lvlpath.push(k);

            //to add a new direct access for each key in json so we get the path of that key easily
            if (objType(json) == 'object') {
                if (keyAdded.indexOf(k) == -1) {
                    keyAdded.push(k);
                    newJson[k] = [];
                }

                newJson[k].push({
                    path: lvlpath
                });
            }
            //if value is json or array go to further level
            var type = objType(val);
            if (type == 'object' || type == 'array') {
                newFormat({
                    'json': val,
                    'newJson': newJson,
                    'path': lvlpath,
                    'keyAdded': keyAdded
                });
            }

        });

        return newJson;
    }

    //traverse functions
    var tFunc = {
        //search on top level
        topLevel: function(option) {
            var current = this.jsonQ_current,
                newObj = this.cloneObj(jsonQ()),
                newCurrent = newObj.jsonQ_current = [],
                prevPathStr = '',
                key = option.key,
                method = option.method;

            for (var i = 0, ln = current.length; i < ln; i++) {
                var pathC = current[i].path,
                    pathStr,
                    outofBound = false,
                    parPath = pathC.concat([]);

                //to run callback to apply top traverse logic
                if (method == 'parent') {
                    if (parPath.length === 0) {
                        outofBound = true;
                    } else {
                        parPath.pop();
                    }
                } else {
                    var keyIndex = parPath.lastIndexOf(key);
                    if (keyIndex == -1) {
                        outofBound = true;
                    } else {
                        parPath = parPath.slice(0, keyIndex + 1);
                    }
                }

                pathStr = JSON.stringify(parPath);

                if (prevPathStr != pathStr && !outofBound) {
                    newCurrent.push({
                        path: parPath
                    });
                }

                prevPathStr = pathStr;
            }

            //set other defination variables
            newObj.length = newCurrent.length;
            //to add selector
            newObj.selector.push({
                method: method,
                key: key
            });

            return newObj;
        },
        //travese which have qualifiers mainly on bottom and sibling method
        qualTrv: function(option) {
            var current = this.jsonQ_current,
                newObj = this.cloneObj(jsonQ()),
                newCurrent = newObj.jsonQ_current = [],

                //key element (an array of paths with following key)
                key = option.key,
                //dont work with original object clone it and if undefined than make as empty array
                elm = jsonQ.clone(this[key]) || [],
                //qualifier
                qualifier = option.qualifier,
                qType = objType(qualifier),
                //travese method
                method = option.method,
                find = method == "find" ? true : false;

            for (var i = 0, ln = current.length; i < ln; i++) {
                var pathC = current[i].path,
                    found = false;

                if (!find) {
                    //if it is top level continue the loop. This case comes when we do sibling method called on initial object
                    if (pathC.length === 0) {
                        continue;
                    }

                    var pathCTemp = pathC.concat([]);
                    pathCTemp.pop();
                }

                //make a loop on element to match the current path and element path
                for (var j = 0; j < elm.length; j++) {
                    var pathE = elm[j].path,
                        condition;
                    if (find) {
                        condition = matchPath(pathC, pathE);
                    } else {
                        var pathETemp = pathE.concat([]);
                        //to pop last element
                        pathETemp.pop();
                        condition = pathCTemp.join() == pathETemp.join();
                    }

                    if (condition) {
                        //code to check qualifier need to be written this on is only when quantifier when it is function in other case it will be applied on last

                        var qTest = tFunc.qTest.call(this, qType, qualifier, pathE, newCurrent);

                        if (qTest) {
                            //to remove element which is already added
                            elm.splice(j, 1);
                            j--;
                        }

                        //make found flag true
                        found = true;
                    }
                    //break if path doesent match in next sequence and for one element is already there.
                    else if (found) {
                        break;
                    }
                }
            }

            //to apply qualifier if it is string . its mainly for array kind of qualifier
            if (qType == "string") {
                newObj = this.filter.call(newObj, qualifier);
            }

            //set other defination variables
            newObj.length = newObj.jsonQ_current.length;

            //to add selector
            newObj.selector.push({
                method: method,
                key: key,
                qualifier: qualifier
            });

            return newObj;
        },
        qTest: function(qType, qualifier, path, array) {
            var qTest = qType == 'function' ? qualifier.call(this.pathValue(path)) : qType == 'object' ? jsonQ.checkKeyValue(this.pathValue(path), qualifier) : true;

            //if it is key value pair than also we can check here.
            if (qTest) {
                array.push({
                    path: path
                });
            }
            return qTest;
        }

    };

    //functions involved on sorting
    var sortFunc = {
        baseConv: function(type, val, settings) {
            if (type == 'string') {
                if (settings.caseIgnore) {
                    return val.toLowerCase();
                }
            } else if (type == 'array') {
                return val.join();
            } else if (type == 'object') {
                return stringify(jsonQ.order(val));
            }

            return val;
        },
        sortAry: function(array, logic, settings) {
            array.sort(function(a, b) {
                var compA = logic(a);
                var compB = logic(b);
                return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
            });

            //to display on decending order
            if (settings.order.toLowerCase() == "desc") {
                array.reverse();
            }
            return array;
        }
    };

    jsonQ.fn = jsonQ.prototype = {
        init: function(json) {
            var type;

            //to return if no parameter is passed

            if (!json) return this;

            type = objType(json);
            if (type == 'string') {
                try {
                    json = JSON.parse(json);
                } catch (e) {
                    error('Not a valid json string.');
                }
            } else if (type != 'object' && type != 'array') {
                error('Not a valid json object.');
                return json;
            }

            //to set initial values
            this.jsonQ_root = json;
            this.jsonQ_current = [{
                path: []
            }];

            //to get other keys
            newFormat({
                json: json,
                newJson: this,
                refresh: true
            });

            //set jsonQ defination variables
            this.length = this.jsonQ_current.length;
            this.selector = [];

            return this;

        },

        //to get value at specific path from root
        pathValue: function(path) {
            return jsonQ.pathValue(this.jsonQ_root, path);
        },
        setPathValue: function(path, value) {
            jsonQ.setPathValue(this.jsonQ_root, path, value);
            return this;
        },
        clone: function() {
            return parse(stringify(this.jsonQ_current));
        },
        cloneObj: function(newObj) {
            var obj = this;

            newObj = newObj || {};

            jsonQ.each(obj, function(k, v) {
                newObj[k] = v;
            });

            //to make a different copy of selector otherwise selector will be same on all object.
            newObj.selector = jsonQ.merge([], newObj.selector);

            return newObj;
        },
        value: function(value, clone) {
            var json = this.jsonQ_current;

            clone = clone === false ? false : true;

            //to return value if called as getter (ie value is undefined)
            if (!value) {
                var newArray = [];
                //create a new set of values
                this.each(function(idx, path, val) {
                    newArray.push(val);
                });

                return newArray;
            }
            //value as setter. value can be the exact value which you want to set or can be a callback. In callback pathvalue will be first argument.
            else {
                var type = objType(value);
                for (var i = 0, ln = json.length; i < ln; i++) {
                    var path = json[i].path,
                        val;
                    if (type == 'function') {
                        var prevVal = this.pathValue(path);
                        val = clone ? jsonQ.clone(value(prevVal)) : value(prevVal);
                    } else {
                        val = clone ? jsonQ.clone(value) : value;
                    }
                    //to set value on json
                    this.setPathValue(path, val);
                }

                return this;
            }

        },
        //clone parameter is for if you want to append any object so append exact object or create clone of object and append
        //to append in last of values of current
        append: function(valObj, clone) {
            return this.appendAt("last", valObj, clone);
        },
        //to append in first of values of current
        prepend: function(valObj, clone) {
            return this.appendAt("first", valObj, clone);
        },
        //to append at specific index of values of current
        appendAt: function(index, valObj, clone) {
            var current = this.jsonQ_current;
            //return if incorrect index is given
            if (isNaN(index) && index != "first" && index != "last") {
                error(index + 'is not a valid index.');
                return this;
            }

            for (var i = 0, ln = current.length; i < ln; i++) {
                var pathC = current[i].path.concat([]),
                    lastKey = pathC.pop(),
                    parRef = this.pathValue(pathC),
                    type = objType(parRef[lastKey]),
                    objLn = parRef[lastKey].length;

                //to limit index
                var idx = index < 0 || index == "first" ? 0 : index > objLn || index == "last" ? objLn : index;

                //if array push
                if (type == 'array') {
                    valObj = clone ? jsonQ.clone(valObj) : valObj;

                    parRef[lastKey].splice(idx, 0, valObj);
                }

                //if string concatinate , if number add
                else if (type == 'string') {
                    var str = parRef[lastKey];
                    parRef[lastKey] = str.substring(0, idx) + valObj + str.substring(idx, objLn);
                }

            }
            return this;

        },
        filter: function(qualifier) {
            var current = this.jsonQ_current,
                newObj = this.cloneObj(jsonQ()),
                newCurrent = newObj.jsonQ_current = [],
                qType = objType(qualifier);

            if (!qualifier) return;

            for (var i = 0, ln = current.length; i < ln; i++) {
                var pathC = current[i].path;

                //code to check qualifier need to be written this on is only when quantifier when it is function or json in other case it will be applied on last
                tFunc.qTest.call(this, qType, qualifier, pathC, newCurrent);
            }

            //to apply qualifier if it is string . its mainly for array kind of qualifier
            if (qType == 'string') {
                //to check string for nth and eq
                var regex = /(nth|eq)\((.+)\)/,
                    matched = regex.exec(qualifier);
                if (matched) {
                    newCurrent = jsonQ.nthElm(current, matched[2], true);
                } else {
                    newCurrent = jsonQ.nthElm(current, qualifier, true);
                }
                //to store it back on newObj
                newObj.jsonQ_current = newCurrent;
            }

            //set other defination variables
            newObj.length = newCurrent.length;

            //to add selector
            newObj.selector.push({
                method: 'filter',
                qualifier: qualifier
            });

            return newObj;

        },
        //first argument is key in which you want to search, second key is qualifier of it.
        find: function(key, qualifier) {
            return tFunc.qualTrv.call(this, {
                method: "find",
                key: key,
                qualifier: qualifier
            });
        },
        sibling: function(key, qualifier) {
            return tFunc.qualTrv.call(this, {
                method: "sibling",
                key: key,
                qualifier: qualifier
            });
        },
        parent: function() {
            return tFunc.topLevel.call(this, {
                method: "parent"
            });
        },
        closest: function(key) {
            return tFunc.topLevel.call(this, {
                method: "closest",
                key: key
            });
        },
        //return path of first element found through selector
        path: function() {
            return this.jsonQ_current[0].path;
        },
        //some time we can only return the value of the first element in current
        firstElm: function() {
            return this.pathValue(this.jsonQ_current[0].path);
        },
        lastElm: function() {
            return this.pathValue(this.jsonQ_current[this.length - 1].path);
        },
        nthElm: function(pattern, arrayReturn) {
            return jsonQ.nthElm(this.value(), pattern, arrayReturn);
        },
        index: function(elm, isQualifier) {
            return jsonQ.index(this.value(), elm, isQualifier);
        },
        createXML: function() {
            return jsonQ.createXML(this.value());
        },

        //function to sort array objects
        sort: function(key, settings) {
            //merge global setting with local setting
            settings = jsonQ.merge({}, jsonQ.settings.sort, settings);
            var jobj = this.find(key),
                current = jobj.clone(),
                sortStack = [],
                i, ln,
                sortedPath = [],
                type = objType(jobj.pathValue(current[0].path)),
                //function to get value which is an array from pathKey traversing from right.
                getClosestArray = function(key) {
                    while (key.length !== 0) {
                        var lastKey = key.pop();
                        if (!isNaN(lastKey)) {
                            var val = jobj.pathValue(key);
                            if (objType(val) == 'array') {
                                return val;
                            }
                        }
                    }
                    return null;
                };

            //initialize sort stack
            for (i = 0, ln = current.length; i < ln; i++) {
                sortStack.push({
                    pathHolder: current[i].path.concat([]),
                    current: current[i].path.concat([])
                });
            }

            //to run the loop untill all ar sorted
            var alpha = 0,

                // function to remove element if sorting is done for that path
                spliceElm = function(i) {
                    sortStack.splice(i, 1);
                    return --i;
                };
            while (sortStack.length !== 0) {
                alpha++;
                for (i = 0; i < sortStack.length; i++) {
                    var cur = sortStack[i].current,
                        pH = sortStack[i].pathHolder,
                        //to get the closest array in the current path. This will also change value of current path variable.
                        ary = getClosestArray(cur),
                        pathStr = cur.join();

                    //to remove from sort stack if no array is left on key or if that is already sorted
                    if (cur.length === 0 || sortedPath.indexOf(pathStr) != -1) {
                        i = spliceElm(i);
                    }

                    //to sort if array found
                    else {
                        //logic path is path which we add in on condition to find the element value according to which we are sorting
                        var logicPath = pH.slice(cur.length + 1, pH.length),

                            logic = function(a) {
                                var val = jsonQ.pathValue(a, logicPath);

                                //to convert val to be compared
                                val = sortFunc.baseConv(type, val, settings);
                                return settings.logic(val);
                            };

                        //to sort the root json
                        sortFunc.sortAry(ary, logic, settings);

                        //if multilevel sort is true
                        if (settings.allLevel) {
                            //to maintain the path which is already sorted and change pathHolder to point first element of sorted array
                            pH[cur.length] = 0;
                            sortedPath.push(pathStr);
                        } else {
                            //remove sorted path
                            i = spliceElm(i);
                        }
                    }

                }
            }

            return jsonQ(jobj.jsonQ_root).find(key);
        },
        //to make loop on current
        each: function(callback) {
            var current = this.jsonQ_current;
            for (var i = 0, ln = current.length; i < ln; i++) {
                callback(i, current[i].path, this.pathValue(current[i].path));
            }
            return this;
        },
        //to return unique value of current
        unique: function() {
            return jsonQ.unique(this.value());
        },
        refresh: function() {
            var selector = this.selector;

            var jObj = jsonQ(this.jsonQ_root);
            for (var i = 0, ln = selector.length; i < ln; i++) {
                var curSel = selector[i],
                    args = [];

                if (curSel.key) args.push(curSel.key);
                if (curSel.qualifier) args.push(curSel.qualifier);

                jObj = jObj[curSel.method].apply(jObj, args);
            }

            //to store value back on this
            this.cloneObj.call(jObj, this);

            return this;
        },
        prettify: function(htmlReturn) {
            return jsonQ.prettify(this.value(), htmlReturn);
        }
    };

    //super exposed functions
    //jsonQ each
    jsonQ.each = function(json, callback) {
        for (var key in json) {
            if (json.hasOwnProperty(key)) {
                callback(key, json[key]);
            }
        }
    };

    //to find object type of any object
    var objType = jsonQ.objType = (function() {
        var map = {
            '[object Array]': 'array',
            '[object Object]': 'object',
            '[object String]': 'string',
            '[object Number]': 'number',
            '[object Boolean]': 'boolean',
            '[object Null]': 'null',
            '[object Function]': 'function'
        };

        return function(obj) {
            var type = Object.prototype.toString.call(obj);
            return map[type];
        };
    }());

    //to merge all the objects in argument to the first argument.
    //idea taken by jquery extend.

    //deep parameter is required if a person want to merge a json in all level recursively
    jsonQ.merge = function() {
        var arg = arguments,
            deepType = objType(arg[0]),
            i = 1,
            ln = arg.length,
            deep = false,
            target = arg[0];
        if (ln === 0 || (deepType == "boolean" && ln == 1)) {
            return;
        }
        //to get the target object where all merge will be done
        if (deepType == "boolean") {
            target = arg[1];
            i = 2;
            deep = arg[0];
        }

        //callback function to recursiveliy merge
        var eachCallback = function(k, v) {
            var type = objType(v),
                tarType = objType(target[k]);

            if (deep && (type == "array" || type == "object")) {
                target[k] = type == tarType && (tarType == "array" || tarType == "object") ? target[k] : type == "array" ? [] : {};

                //to merge recursively
                jsonQ.merge(deep, target[k], v);
            } else {
                target[k] = v;
            }
        };

        for (; i < ln; i++) {

            jsonQ.each(arg[i], eachCallback);
        }
        return target;
    };

    jsonQ.merge(jsonQ, {
        sort: function(ary, settings) {
            settings = jsonQ.merge({}, jsonQ.settings.sort, settings);

            if (objType(ary) != 'array') {
                error('Only array is allowed to sort');
                return;
            }

            var convLogic = function(val) {

                var type = objType(val);
                val = sortFunc.baseConv(type, val, settings);

                return settings.logic(val);
            };

            //to return sorted array
            return sortFunc.sortAry(ary, convLogic, settings);
        },
        order: function(json) {

            //to return if json type is not an object type
            if (typeof json != 'object') {
                return json;
            }

            var logic = function(val) {
                //if a json is an array alike and keys are numbers as string type ("1","2" instad of 1,2) convert them to integer.
                if (!isNaN(val)) val = parseInt(val);
                return val;
            },

                func = function(jsonVal) {
                    var jsonType = objType(jsonVal),
                        keys = Object.keys(jsonVal);

                    if (jsonType == 'object') {
                        keys.sort(function(a, b) {
                            var compA = logic(a);
                            var compB = logic(b);
                            return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
                        });
                    }
                    //to order
                    for (var i = 0, ln = keys.length; i < ln; i++) {
                        var key = keys[i],
                            val = jsonVal[key],
                            type = objType(val);

                        //to go to next level if value is json type
                        if (type == 'object' || type == "array") {
                            func(val);
                        }

                        //to order
                        if (jsonType == 'object') {
                            delete jsonVal[key];
                            jsonVal[key] = val;
                        }
                    }
                };

            //initialize
            func(json);

            return json;
        },
        clone: function(json) {
            var type = objType(json);
            return type == 'object' || type == 'array' ? parse(stringify(json)) : json;
        },
        //to find index of an element in set of element
        index: function(list, elm, isQualifier) {
            var type = objType(elm),
                ln = list.length,
                //check that elm is a object or not that is taken by refrence
                refObj = type == "object" || type == "array" || type == "function" ? true : false;

            //if elm is a function consider it as a qualifier
            if (type == "function") {
                isQualifier = true;
            }

            if (refObj && !isQualifier) {
                //convert object to string so that they can be compared.
                var jsonStr = stringify(jsonQ.order(elm));
            }

            for (var i = 0; i < ln; i++) {
                var cur = list[i];
                if (refObj) {
                    var lType = objType(cur);
                    if (lType != type && !isQualifier) continue;

                    //to compare
                    if (!isQualifier) {
                        if (stringify(jsonQ.order(cur)) == jsonStr) {
                            return i;
                        }

                        //if element is a qualifier
                    } else {
                        var test;
                        if (type == 'function') {
                            test = elm.call(cur);
                        } else if (type == "object" && lType == "object") {
                            test = jsonQ.checkKeyValue(cur, elm);
                        } else if (lType == "array") {
                            if (type == "array") {
                                for (var j = 0, elmLn = elm.length; j < elmLn; j++) {
                                    test = jsonQ.index(cur, elm[j]) != -1;
                                    if (!test) break;
                                }
                            } else {
                                test = jsonQ.index(cur, elm) != -1;
                            }
                        }

                        //return index if it passes the test
                        if (test) return i;

                    }

                } else if (elm == cur) {
                    return i;
                }
            }
            return -1;
        },
        //to check an array contains a specfic element or not . an element can be aaray or json.
        contains: function(array, elm, isQualifier) {
            return jsonQ.index(array, elm, isQualifier) != -1;
        },
        //function to check an json object contains a set of key value pair or not
        checkKeyValue: function(json, keyVal) {
            for (var k in keyVal) {
                if (keyVal.hasOwnProperty(k))
                    if (!jsonQ.identical(keyVal[k], json[k])) return false;
            }
            return true;
        },

        nthElm: function(array, arg, aryRetrn) {
            var result;
            if (array[arg]) {
                result = array[arg];
            } else if (arg == 'last') {
                result = array[array.length - 1];
            } else if (arg == 'first') {
                result = array[0];
            } else if (arg == 'random') {
                var rand = Math.floor(Math.random() * array.length);
                result = array[rand];
            } else if (arg == 'even') {
                result = jsonQ.nthElm(array, '2n');
            } else if (arg == 'odd') {
                result = jsonQ.nthElm(array, '2n+1');
            }
            //to return sequence
            else {
                try {
                    var newArray = [],
                        ln = array.length;

                    if (!arg.match(/^[0-9n*+-\/]+$/)) throw ('');

                    arg = arg.replace(/([0-9])n/g, function($0, $1) {
                        return $1 ? $1 + '*n' : $0;
                    });

                    for (var n = 0; n < ln; n++) {
                        var index = eval(arg);
                        if (index > ln - 1) {
                            break;
                        }
                        newArray.push(array[index]);
                    }
                    result = newArray;
                } catch (error) {
                    //if no correct option return whole array
                    result = array;
                }
            }
            result = result || array;
            return objType(result) != 'array' && aryRetrn ? [result] : result;
        },
        prettify: function(obj, htmlReturn) {

            if (typeof obj != 'object') {
                throw ('Only valid json object is allowed.');
            }

            //to return prtified. If htmlReturn false add 3 spaces else add
            if (htmlReturn) {
                return JSON.stringify(obj, null, '\t').replace(/\n/g, '</br>').replace(/\t/g, '      ');
            }
            return JSON.stringify(obj, null, 3);

        },

        //need to modify it little bit
        //By Chris O'Brien, prettycode.org
        identical: function(a, b) {

            function sort(object) {
                if (typeof object !== "object" || object === null) {
                    return object;
                }

                return Object.keys(object).sort().map(function(key) {
                    return {
                        key: key,
                        value: sort(object[key])
                    };
                });
            }

            return JSON.stringify(sort(a)) === JSON.stringify(sort(b));
        },
        //Return the union of arrays in new array
        union: function() {
            var arg = arguments,
                target = [],
                ln = arg.length;

            for (var i = 0; i < ln; i++) {
                var aryLn = arg[i].length;
                for (var j = 0; j < aryLn; j++) {
                    var itm = arg[i][j];
                    if (jsonQ.index(target, itm) == -1) {
                        target.push(itm);
                    }
                }

            }
            return target;
        },
        //return intersection of array in new array
        intersection: function() {
            var arg = arguments,
                target = [],
                flag,
                ln = arg.length;

            if (ln == 1) {
                target = arg[0];
            } else {
                for (var j = 0, aryLn = arg[0].length; j < aryLn; j++) {
                    var elm = arg[0][j];
                    flag = 1;
                    for (var i = 1; i < ln; i++) {
                        if (jsonQ.index(arg[i], elm) == -1) {
                            flag = 0;
                            break;
                        }
                    }
                    if (flag == 1) {
                        target.push(elm);
                    }

                }
            }
            return target;
        },
        //suffle the order of elements in a array. returns the same array.
        suffle: function(array) {
            for (var i = 1, ln = array.length; i < ln; i++) {
                var j = Math.floor(Math.random() * (i + 1)),
                    tmp = array[i];
                array[i] = array[j];
                array[j] = tmp;
            }

            return array;

        },
        //return a new array list of unuiqe(distinct) elements of an array
        unique: function(array) {
            var ln = array.length,
                newAry = [];
            for (var i = 0; i < ln; i++) {
                if (jsonQ.index(newAry, array[i]) == -1) {
                    newAry.push(array[i]);
                }
            }
            return newAry;
        },
        //to get value at specific path in a json
        pathValue: function(json, path) {
            var i = 0,

                ln = path.length;

            if (json === null) {
                return null;
            }
            while (i < ln) {
                if (json[path[i]] === null) {
                    json = null;
                    return;
                } else {
                    json = json[path[i]];
                }
                i = i + 1;
            }
            return json;
        },
        setPathValue: function(json, path, value) {
            var i = 0,
                tempJson = json,
                ln = path.length;
            if (json === null) {
                return null;
            }
            while (i < ln) {
                if (typeof tempJson[path[i]] != 'object') {
                    tempJson[path[i]] = objType(path[i + 1]) == 'number' ? [] : {};
                }
                if (i == path.length - 1) {
                    tempJson[path[i]] = value;
                }
                tempJson = tempJson[path[i]];
                i = i + 1;
            }
            return json;
        },
        createXML: function(json) {
            var jsonToXML = function(json, xmlAry) {
                xmlAry = xmlAry || [];
                var start = xmlAry.length === 0 ? true : false,
                    type = objType(json);
                if (start) {
                    xmlAry.push('<?xml version="1.0" encoding="ISO-8859-1"?><jsonXML>');
                }

                //to make loop on array or object;
                jsonQ.each(json, function(k, val) {
                    var tag = type == 'array' ? 'arrayItem' : k,
                        elmType = objType(val);
                    xmlAry.push('<' + tag + ' type="' + elmType + '">');
                    if (elmType == 'object' || elmType == 'array') {
                        jsonToXML(val, xmlAry);
                    } else {
                        xmlAry.push('<![CDATA[' + val + ']]>');

                    }
                    xmlAry.push('</' + tag + '>');
                });

                if (start) {
                    xmlAry.push('</jsonXML>');
                    return xmlAry.join('');
                } else {
                    return xmlAry;
                }

            };
            return jsonToXML(json);
        },
        //append functions

        //to append in last of values of array or string
        append: function(target, val, clone) {
            return jsonQ.appendAt(target, "last", val, clone);
        },
        //to append in first of values of array or string
        prepend: function(target, val, clone) {
            return jsonQ.appendAt(target, "first", val, clone);
        },
        //to append at specific index of values of array or string
        appendAt: function(target, index, val, clone) {

            if (isNaN(index) && index != "first" && index != "last") {
                error(index + 'is not a valid index.');
                return;
            }

            var type = objType(target),
                length = target.length;

            //to limit index
            var idx = index < 0 || index == "first" ? 0 : index > length || index == "last" ? length : index;

            //if array push
            if (type == 'array') {
                val = clone ? jsonQ.clone(val) : val;
                target.splice(idx, 0, val);
            }

            //if string concatinate , if number add
            else if (type == 'string') {
                target = target.substring(0, idx) + val + target.substring(idx, length);
            }

            return target;

        }

    });

    //to assign jsonQ prototypes to init function
    jsonQ.fn.init.prototype = jsonQ.fn;

    //to export jsonQ
    module.exports = jsonQ;

}());


text:
package assignment;

//Importing various libraries
import processing.core.*;

//H_Pong class for the homescreen which extends the abstract class
public class H_Pong extends Obj
{
	//Fields
	float br = 10.0f;
	float speedx = 8.0f;
	float speedy = 8.0f;
	PApplet papplet;

	//Constructor to declare the starting point of the object
	public H_Pong(PApplet papplet, float startx, float starty)
	{
		super(papplet, startx, starty);
		this.papplet = papplet;
	}

	@Override
	//Method to set position and movement of the object
	void position()
	{
		//Statement which indicates what happens when the ball hits off the paddle for Player
	    if((pos.x >= wallx + br) && (pos.x <= (wallx + br) + w) && (pos.y >= papplet.mouseY))
	    {
	      speedx = -speedx;
	    }

	    //Statement so ball bounces off the walls
	    if(pos.y > 315)
	    {
	      speedy = -speedy;
	    }

	    //Statement so ball bounces off the walls
	    if(pos.y < 680)
	    {
	      speedy = -speedy;
	    }

	    //Statement so ball bounces off the walls
	    if(pos.x > 646)
	    {
	      speedx = -speedx;
	    }

	    //Statement so ball bounces off the walls
	    if(pos.x < 353)
	    {
	      speedx = -speedx;
	    }

	    if(papplet.mouseY < 295)
	    {
	      papplet.mouseY = 295;
	    }

	    //Error Check
	    if(papplet.mouseY > papplet.height)
	    {
	      papplet.mouseY = papplet.height;
	    }

	    pos.x = pos.x + speedx;
	    pos.y = pos.y + speedy;

	}

	@Override
	//Abstract method to draw the object itself
	void thing()
	{
		//Draw the ball object
	    papplet.pushMatrix();
	    papplet.translate(pos.x, pos.y);
	    papplet.stroke(7, 29, 103);
	    papplet.fill(7, 29, 103);
	    papplet.ellipse(0, 0, br * 2, br * 2);
	    papplet.popMatrix();

	    //Draw the paddle object
	    papplet.stroke(245, 250, 20);
	    papplet.fill(245, 250, 20);
	    papplet.rect(wallx, papplet.mouseY, w, h);

	}

	//Abstract method to reset the variables
	void newgame()
	{

	}

}


text:
module Giternal
  class App
    def initialize(base_dir)
      @base_dir = base_dir
    end

    def update(*dirs)
      if dirs.empty?
        config.each_repo {|r| r.update }
      else
        dirs.each do |dir|
          if repo = config.find_repo(dir)
            repo.update
          end
        end
      end
    end

    def freezify(*dirs)
      if dirs.empty?
        config.each_repo {|r| r.freezify }
      else
        dirs.each do |dir|
          if repo = config.find_repo(dir)
            repo.freezify
          end
        end
      end
    end

    def unfreezify(*dirs)
      if dirs.empty?
        config.each_repo {|r| r.unfreezify }
      else
        dirs.each do |dir|
          if repo = config.find_repo(dir)
            repo.unfreezify
          end
        end
      end
    end

    def run(action, *args)
      case action
      when "freeze"
        freezify(*args)
      when "unfreeze"
        unfreezify(*args)
      else
        send(action, *args)
      end
    end

    def config
      return @config if @config

      config_file = ['config/giternal.yml', '.giternal.yml'].detect do |file|
        File.file? File.expand_path(@base_dir + '/' + file)
      end

      if config_file.nil?
        $stderr.puts "config/giternal.yml is missing"
        exit 1
      end

      @config = YamlConfig.new(@base_dir, File.read(config_file))
    end
  end
end


text:
* Add support for query parameters in table function arguments. ({issue}`12910`)
* Update minimum required Java version to 11.0.15. ({issue}`12841`)
* Fix incorrect result for {func}`to_iso8601` when the timestamp is in the
  daylight savings transition region. ({issue}`11619`)

## CLI

* Fix query history not being stored when a query starts with whitespace. ({issue}`12847`)

## Delta Lake connector

* Record table size when analyzing a table. ({issue}`12814`)
* Enable the optimized Parquet writer by default. This can be disabled via the
  `parquet.experimental-optimized-writer.enabled` configuration property. ({issue}`12757`)
* Disallow adding a new column to a table that has been written with an
  unsupported writer. ({issue}`12883`)

## Hive connector

* Add support for ORC bloom filters on `varchar` columns. ({issue}`11757`)

## Iceberg connector

* Allow `OPTIMIZE` on a table partitioned on a `timestamp with time zone` column
  when using `CAST(timestamp_col AS date) >= DATE '...'` syntax. ({issue}`12362`)
* Allow `OPTIMIZE` with a predicate on a table that does not have identity
  partitioning. ({issue}`12795`)
* Improve performance of `DELETE` when deleting whole partitions from a table
  that does not have identity partitioning. ({issue}`7905`)
* Fix incorrect results when a query contains a filter on a `UUID` column. ({issue}`12834`)
* Fail queries that attempt to modify old snapshots. ({issue}`12860`)
* Deprecate using synthetic `@`-based syntax for Iceberg snapshot access in
  favor of the `AS OF` syntax. The old behavior can be restored by setting the
  `allow_legacy_snapshot_syntax` session property or
  `iceberg.allow-legacy-snapshot-syntax` configuration property. ({issue}`10768`)

## Kudu connector

* Fix failure when inserting into a table with a `row_uuid` column. ({issue}`12915`)

## Pinot connector

* Add support for querying Pinot via the gRPC endpoint. ({issue}`9296 `)

## Redis connector

* Add support for predicate pushdown on columns of type `string`.  ({issue}`12218`)

## SPI

* Add information about query retry policy to `QueryCompletedEvent` and
  `QueryCreatedEvent`. ({issue}`12898`)


text:
<?php

namespace NCMF\DefaultBundle\Repository;

/**
 * InstanceRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class InstanceRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
import rabit
import numpy as np

rabit.init(lib='mock')
rank = rabit.get_rank()
n = 10
nround = 3
data = np.ones(n) * rank

version, model, local = rabit.load_checkpoint(True)
if version == 0:
    model = np.zeros(n)
    local = np.ones(n)
else:
    print '[%d] restart from version %d' % (rank, version)

for i in xrange(version, nround):
    res = rabit.allreduce(data + model+local, rabit.SUM)
    print '[%d] iter=%d: %s' % (rank, i, str(res))
    model = res
    local[:] = i
    rabit.checkpoint(model, local)

rabit.finalize()


text:
package tracer

func init() {
}


text:
'use strict';

var bluebird = require('bluebird');
var conf = require('../conf');
var client = conf.elasticsearch.newClient();
var logger = conf.logger;

function clean (done) {
  // This will only delete the indexes that our aliases point to. If your cluster has other indexes, or older versions
  // of fracas indexes, they will be left alone.
  var requests = [
    function (callback) {
      client.indices.delete({index: 'fracas_data'}, callback);
    },
    function (callback) {
      client.indices.delete({index: 'fracas_settings'}, callback);
    }
  ];

  // Use fancy promises so that parallel requests aren't killed if one encounters an error
  bluebird.settle(requests.map(function (r) {
    return bluebird.promisify(r)();
  }))
    .then(function (promiseInspections) {
      var errors = promiseInspections.filter(function (pi) {
        return pi.isRejected();
      }).map(function (pi) {
        return pi.error();
      });

      errors.forEach(function (e) {
        logger.error({err: e}, 'Error deleting index');
      });

      var numSuccesses = requests.length - errors.length;
      logger.info('Successfully deleted %d out of %d indices (%d errors)', numSuccesses, requests.length,
        errors.length);
    })
    .catch(function (e) {
      // this shouldn't ever happen, but in case it does we don't want to swallow errors
      logger.error({err: e}, 'Error deleting indices');
    })
    .finally(function () {
      client.close();
      done();
    });
}

if (module.parent) {
  module.exports = clean;
} else {
  clean(function (err) {
    if (err) {
      logger.error(err);
    }
  });
}


text:
package io.crate.sql.tree;

import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;

public class IndexColumnConstraint<T> extends ColumnConstraint<T> {

    private static final IndexColumnConstraint<?> OFF = new IndexColumnConstraint<>("OFF", GenericProperties.empty());

    public static <T> IndexColumnConstraint<T> off() {
        return (IndexColumnConstraint<T>) OFF;
    }

    private final String indexMethod;
    private final GenericProperties<T> properties;

    public IndexColumnConstraint(String indexMethod, GenericProperties<T> properties) {
        this.indexMethod = indexMethod;
        this.properties = properties;
    }

    public String indexMethod() {
        return indexMethod;
    }

    public GenericProperties<T> properties() {
        return properties;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        IndexColumnConstraint<?> that = (IndexColumnConstraint<?>) o;
        return Objects.equals(indexMethod, that.indexMethod) &&
               Objects.equals(properties, that.properties);
    }

    @Override
    public int hashCode() {
        return Objects.hash(indexMethod, properties);
    }

    @Override
    public String toString() {
        return "IndexColumnConstraint{" +
               "method='" + indexMethod + '\'' +
               ", properties=" + properties +
               '}';
    }

    @Override
    public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
        return visitor.visitIndexColumnConstraint(this, context);
    }

    @Override
    public <U> ColumnConstraint<U> map(Function<? super T, ? extends U> mapper) {
        return new IndexColumnConstraint<>(indexMethod, properties.map(mapper));
    }

    @Override
    public void visit(Consumer<? super T> consumer) {
        properties.properties().values().forEach(consumer);
    }
}


text:
package com.flipkart.foxtrot.server.auth.authprovider.impl;

import com.flipkart.foxtrot.server.auth.authprovider.AuthConfigVisitor;
import com.flipkart.foxtrot.server.auth.authprovider.AuthProviderConfig;
import com.flipkart.foxtrot.server.auth.authprovider.AuthType;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.net.Proxy;

/**
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class GoogleAuthProviderConfig extends AuthProviderConfig {
    @NotEmpty
    @NotNull
    private String clientId;

    @NotEmpty
    @NotNull
    private String clientSecret;

    private String loginDomain;

    @NotNull
    @NotEmpty
    private String server;

    @NotNull
    private boolean secureEndpoint;

    private Proxy.Type proxyType;

    private String proxyHost;

    private int proxyPort;

    @Builder
    public GoogleAuthProviderConfig(
            boolean enabled,
            String clientId,
            String clientSecret,
            String loginDomain,
            String server,
            boolean secureEndpoint,
            Proxy.Type proxyType,
            String proxyHost,
            int proxyPort) {
        super(AuthType.OAUTH_GOOGLE, enabled);
        this.clientId = clientId;
        this.clientSecret = clientSecret;
        this.loginDomain = loginDomain;
        this.server = server;
        this.secureEndpoint = secureEndpoint;
        this.proxyType = proxyType;
        this.proxyHost = proxyHost;
        this.proxyPort = proxyPort;
    }

    public GoogleAuthProviderConfig() {
        super(AuthType.OAUTH_GOOGLE);
    }

    @Override
    public <T> T accept(AuthConfigVisitor<T> visitor) {
        return visitor.visit(this);
    }
}


text:
 Java implementation

 with useful functions for the

 Easy Blockchain API

You can use this Java library to perform common functions for the [Easy Blockchain API](https://docs.sphereon.com/api/easy-blockchain/0.10/html)

## Key Features
* Determine Chain and Entry IDs before anchoring in the blockchain, see: [id calculation documentation](https://docs.sphereon.com/api/easy-blockchain/0.10/html#_id_calculation)
* Create hashes of content
* Create chain links to other chains, entries or contexts at any level, see: [chainlink documentation](https://docs.sphereon.com/api/easy-blockchain/0.10/html#_chain_links)

## How To Use
To clone and use this library application, you'll need [Git](https://git-scm.com), [Maven](https://maven.apache.org/) and your favorite Java IDE.
Of course we also provide releases in our maven repository

```bash
# Clone this repository
> git clone https://github.com/Sphereon-OpenSource/easy-blockchain-lib.git

# Go into the repository
> cd easy-blockchain-lib

# Build and install into your Maven repository
> mvn clean install

# Use the artifact in your Maven pom or Gralde build configuration
    <repositories>
        <repository>
            <id>sphereon-public</id>
            <name>Sphereon Public</name>
            <url>https://nexus.qa.sphereon.com/repository/sphereon-public/</url>
         </repository>
    </repositories>
...
    <dependency>
        <groupId>com.sphereon.public</groupId>
        <artifactId>easy-blockchain-lib-main</artifactId> <!-- Use easy-blockchain-lib-osgi for OSGI bundle  -->
        <version>0.1.3</version>
    </dependency>
```

#### License
[Apache2](https://www.apache.org/licenses/LICENSE-2.0)

---
Links
> [Documentation](https://docs.sphereon.com/api/easy-blockchain/0.10/html)  ·
> [SDKs](https://github.com/Sphereon-SDK/easy-blockchain-sdk)  ·
> [Java SDK](https://github.com/Sphereon-SDK/easy-blockchain-sdk/tree/develop/java8-okhttp-gson)  ·
> [Sphereon.com](https://www.sphereon.com)  ·


text:
/* global assert, process, setup, suite, test */
var entityFactory = require('../../helpers').entityFactory;
var utils = require('index').utils;

var UI_CLASSES = ['.a-orientation-modal', '.a-enter-vr-button'];

suite('vr-mode-ui', function () {
  setup(function (done) {
    this.entityEl = entityFactory();
    var el = this.el = this.entityEl.parentNode;
    this.sinon.stub(utils.device, 'getVRDisplay').returns({
      requestPresent: function () {
        return Promise.resolve();
      }
    });
    el.addEventListener('loaded', function () { done(); });
  });

  test('appends UI', function () {
    var scene = this.el;
    UI_CLASSES.forEach(function (uiClass) {
      assert.equal(scene.querySelectorAll(uiClass).length, 1);
    });
  });

  test('can disable UI', function () {
    var scene = this.el;
    scene.setAttribute('vr-mode-ui', 'enabled', false);
    UI_CLASSES.forEach(function (uiClass) {
      assert.notOk(scene.querySelector(uiClass));
    });
  });

  test('hides on enter VR', function () {
    var scene = this.el;
    // mock camera
    scene.camera = {el: {object3D: {}}};
    scene.enterVR();
    UI_CLASSES.forEach(function (uiClass) {
      assert.ok(scene.querySelector(uiClass).className.indexOf('a-hidden'));
    });
  });

  test('shows on exit VR', function (done) {
    var scene = this.el;
    // mock camera
    scene.camera = {el: {object3D: {}, getAttribute: function () { return {spectator: false}; }}};
    scene.enterVR();
    scene.exitVR();

    process.nextTick(function () {
      assert.equal(scene.querySelector('.a-enter-vr-button').className.indexOf('a-hidden'),
                   -1);
      done();
    });
  });
});


text:
package com.mongodb.hvdf.oid;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.mongodb.hvdf.api.Sample;

public class SourceTimeDocumentId implements SampleId {

	private long time = 0;
	private Object source = null;
	private DBObject oid = null;

	public SourceTimeDocumentId(Object source, long timeStamp) {
		time = timeStamp;
	}

	public SourceTimeDocumentId(Object docId) {
		oid = (DBObject)docId;
	}

	@Override
	public boolean embedsTime() {
		return true;
	}

	@Override
	public boolean embedsSource() {
		return true;
	}

	@Override
	public long getTime() {

		// If the time is not known and the oid exists
		// extract the time from the oid
		if(time == 0 && oid != null){
			time = ((Long)oid.get(Sample.TS_KEY));
		}

		return time;
	}

	@Override
	public Object getSourceId() {
		if(source == null && oid != null){
			source = oid.get(Sample.SOURCE_KEY);
		}

		return source;
	}

	@Override
	public Object toObject() {

		if(oid == null){
			oid = new BasicDBObject(Sample.SOURCE_KEY, this.source).append(Sample.TS_KEY, time);
		}

		return oid;
	}

}


text:
package middleware_test

import (
	"net/http"

	apifakes "github.com/prodda/prodda/api/fakes"

	"github.com/prodda/prodda/api/middleware"
	"github.com/prodda/prodda/api/middleware/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Logger", func() {

	var dummyRequest *http.Request
	var err error

	var fakeResponseWriter http.ResponseWriter
	var fakeHandler *fakes.FakeHandler
	var fakeLogger *fakes.FakeLogger

	BeforeEach(func() {
		dummyRequest, err = http.NewRequest("GET", "/api/v0/tasks", nil)
		Expect(err).NotTo(HaveOccurred())
		dummyRequest.Header.Add("Authorization", "some auth")

		fakeResponseWriter = &apifakes.FakeResponseWriter{}
		fakeHandler = &fakes.FakeHandler{}
		fakeLogger = &fakes.FakeLogger{}
	})

	It("should not log credentials", func() {
		loggerMiddleware := middleware.NewLogger(fakeLogger)
		loggerHandler := loggerMiddleware.Wrap(fakeHandler)

		loggerHandler.ServeHTTP(fakeResponseWriter, dummyRequest)

		Expect(fakeLogger.InfoCallCount()).To(Equal(1))
		_, arg1 := fakeLogger.InfoArgsForCall(0)
		loggedRequest := arg1[0]["request"].(http.Request)
		Expect(loggedRequest.BasicAuth()).To(Equal(""))
	})

	It("should call next handler", func() {
		loggerMiddleware := middleware.NewLogger(fakeLogger)
		loggerHandler := loggerMiddleware.Wrap(fakeHandler)

		loggerHandler.ServeHTTP(fakeResponseWriter, dummyRequest)

		Expect(fakeHandler.ServeHTTPCallCount()).To(Equal(1))
		arg0, arg1 := fakeHandler.ServeHTTPArgsForCall(0)
		Expect(arg0).ToNot(BeNil())
		Expect(arg1).To(Equal(dummyRequest))
	})
})