text:
using System;
using System.Collections.Generic;
using System.Threading;
using Castle.MicroKernel.Facilities;
using Castle.MicroKernel.Registration;
using Codestellation.Emisstar.Impl;

namespace Codestellation.Emisstar.CastleWindsor.Facility
{
    public class EmisstarFacility : AbstractFacility
    {
        private List<IRegistration> _dispatcherRegistrations;

        public EmisstarFacility()
        {
            _dispatcherRegistrations = new List<IRegistration>();
        }
        protected override void Init()
        {
            AddHandlersResolver();
            RegisterHandlerSources();
            RegisterDispatchers();
            RegisterPublisher();
            Clean();
        }

        private void Clean()
        {
            _dispatcherRegistrations = null;
        }

        private void AddHandlersResolver()
        {
            Kernel.Resolver.AddSubResolver(new PublisherSpecificCollectionResolver(Kernel));
        }

        protected virtual void RegisterHandlerSources()
        {
            Kernel.Register(
                Component
                    .For<CompositeHandlerSource, IHandlerSource>()
                    .LifestyleSingleton(),
                Component
                    .For<IHandlerSource>()
                    .ImplementedBy<WindsorSource>()
                    .LifestyleSingleton(),
                Component
                    .For<ISubscriber, IHandlerSource>()
                    .ImplementedBy<SimpleSubscriber>()
                    .LifestyleSingleton());
        }

        public EmisstarFacility UseSimpleDispatcher(params IDispatchRule[] rules)
        {
            return RegisterRuleBaseDispatcher<SimpleDispatcher>(rules);
        }

        public EmisstarFacility UseSynchronizationContextDispatcher<TSynchronizationContext>(params IDispatchRule[] rules)
            where TSynchronizationContext : SynchronizationContext, new()
        {
            return RegisterRuleBaseDispatcher<SynchronizationContextDispatcher<TSynchronizationContext>>(rules);
        }

        public EmisstarFacility UseSynchronizationContextDispatcher(Func<SynchronizationContext> contextFactory, params IDispatchRule[] rules)
        {
            var contextRegistration = Component
                .For<SynchronizationContext>()
                .UsingFactoryMethod(contextFactory);

            _dispatcherRegistrations.Add(contextRegistration);

            return RegisterRuleBaseDispatcher<SynchronizationContextDispatcher>(rules);
        }

        public EmisstarFacility RegisterRuleBaseDispatcher<TDispatcher>(params IDispatchRule[] rules)
            where TDispatcher : RuleBasedDispatcher
        {
            var componentRegistration =
                Component
                    .For<IDispatcher>()
                    .ImplementedBy<TDispatcher>()
                    .LifestyleSingleton();

            if (rules != null && rules.Length > 0)
            {
                componentRegistration
                    .DependsOn(Dependency.OnValue<IDispatchRule[]>(rules));
            }

            _dispatcherRegistrations.Add(componentRegistration);
            return this;
        }

        private void RegisterPublisher()
        {
            Kernel.Register(
                Component
                    .For<IPublisher>()
                    .ImplementedBy<Publisher>()
                    .LifestyleSingleton());
        }

        private void RegisterDispatchers()
        {
            if (_dispatcherRegistrations.Count == 0 && !Kernel.HasComponent(typeof(IDispatcher)))
            {
                UseSimpleDispatcher();
            }

            Kernel.Register(_dispatcherRegistrations.ToArray());
        }
    }
}


text:
"use strict";

require('chai')
    .use(require('./plugin/chai-math'))
    .should();

var Mathp = require('../index.js');

describe('General', function () {
    describe('#lerp()', function () {
        it('should make a proper linear interpolation', function () {
            Mathp.lerp(0, 10, 0.2).should.equal(2);
            Mathp.lerp(0, 10, 0).should.equal(0);
            Mathp.lerp(0, 10, 1).should.equal(10);
            Mathp.lerp(5, -5, 0.2).should.equal(3);
        });

        it('should never return a value outside of the bounds', function () {
            Mathp.lerp(0, 10, 100).should.equal(10);
            Mathp.lerp(0, 10, -100).should.equal(0);
        });
    });

    describe('#limit()', function () {
        it('should limit the given value to the bounds', function () {
            Mathp.limit(12, 10, 20).should.equal(12);
            Mathp.limit(1, 10, 20).should.equal(10);
            Mathp.limit(20.1, 10, 20).should.equal(20);
        });

        it('should accept any order for the bounds', function () {
            Mathp.limit(1, 10, 20).should.equal(10);
            Mathp.limit(1, 20, 10).should.equal(10);
        });
    });

    describe('#scale()', function () {
        it('should scale accordingly to the bounds', function () {
            Mathp.scale(0, 0, 1, -1, 1).should.equal(-1);
            Mathp.scale(0.5, 0, 1, -1, 1).should.equal(0);
            Mathp.scale(1, 0, 1, -1, 1).should.equal(1);
        });

        it('should never return a value outside of the destination bounds', function () {
            Mathp.scale(100, 0, 1, -1, 1).should.equal(1);
            Mathp.scale(-1, 0, 1, -1, 1).should.equal(-1);
        });

        it('should work with inverted min and max destination bounds', function () {
            Mathp.scale(1, 0, 1, 1, -1).should.equal(-1);
            Mathp.scale(0, 0, 1, 1, -1).should.equal(1);
        });

        it('should work with inverted min and max original bounds', function () {
            Mathp.scale(1, 1, 0, -1, 1).should.equal(-1);
            Mathp.scale(0, 1, 0, -1, 1).should.equal(1);
        });
    });

    describe('#sign1()', function () {
        it('should only returns values as 1, -1 or NaN', function () {
            Mathp.sign1(3).should.equal(1);
            Mathp.sign1(-3).should.equal(-1);
            Mathp.sign1("-3").should.equal(-1);
            Mathp.sign1(0).should.equal(1);
            Mathp.sign1(-0).should.equal(-1);
            Mathp.sign1(NaN).should.be.NaN;
            Mathp.sign1("foo").should.be.NaN;
            Mathp.sign1().should.be.NaN;
            Mathp.sign1(Infinity).should.equal(1);
            Mathp.sign1(-Infinity).should.equal(-1);
        });
    });

    describe('#copySign()', function () {
        it('should return NaN if at least one argument is NaN', function () {
            Mathp.copySign(NaN, 1).should.be.NaN;
            Mathp.copySign(1, NaN).should.be.NaN;
            Mathp.copySign(NaN, NaN).should.be.NaN;
            Mathp.copySign('Toto', 1).should.be.NaN;
            Mathp.copySign(1, 'Toto').should.be.NaN;
        });

        it('should apply the sign of the second argument to the first arguments', function () {
            Mathp.copySign(2, 3).should.equal(2);
            Mathp.copySign(2, -3).should.equal(-2);
            Mathp.copySign(-2, 3).should.equal(2);
            Mathp.copySign(-2, -3).should.equal(-2);
        });

        it('should not return 0 when sign is 0 or -0', function () {
            Mathp.copySign(2, 0).should.equal(2);
            Mathp.copySign(2, -0).should.equal(-2);
            Mathp.copySign(-2, 0).should.equal(2);
            Mathp.copySign(-2, -0).should.equal(-2);
        });
    });

    describe('#smoothstep()', function () {
        it('should return NaN if at least one argument is NaN', function () {
            Mathp.smoothstep(NaN, 1, 1).should.be.NaN;
            Mathp.smoothstep(0, NaN, 1).should.be.NaN;
            Mathp.smoothstep(0, 1, NaN).should.be.NaN;
            Mathp.smoothstep('toto', 1, 1).should.be.NaN;
            Mathp.smoothstep(0, 'toto', 1).should.be.NaN;
            Mathp.smoothstep(0, 1, 'toto').should.be.NaN;
        });

        it('should apply the smoothstep correctly for the boundaries and the middle', function () {
            Mathp.smoothstep(0, 1, 0).should.equal(0);
            Mathp.smoothstep(0, 1, 0.5).should.equal(0.5);
            Mathp.smoothstep(0, 1, 1).should.equal(1);
        });

        it('should apply the smootherstep correctly', function () {
            Mathp.smoothstep(-10, 10, 7).should.equalFloat(0.9392499999999999);
            Mathp.smoothstep(-10, 10, -7).should.equal(0.06075);
        });

        it('should never return a value outside of the bounds', function () {
            Mathp.smoothstep(0, 1, 2).should.equal(1);
            Mathp.smoothstep(0, 1, -1).should.equal(0);
        });
    });

    describe('#smootherstep()', function () {
        it('should return NaN if at least one argument is NaN', function () {
            Mathp.smootherstep(NaN, 1, 1).should.be.NaN;
            Mathp.smootherstep(0, NaN, 1).should.be.NaN;
            Mathp.smootherstep(0, 1, NaN).should.be.NaN;
            Mathp.smootherstep('toto', 1, 1).should.be.NaN;
            Mathp.smootherstep(0, 'toto', 1).should.be.NaN;
            Mathp.smootherstep(0, 1, 'toto').should.be.NaN;
        });

        it('should apply the smootherstep correctly for the boundaries and the middle', function () {
            Mathp.smootherstep(0, 1, 0).should.equal(0);
            Mathp.smootherstep(0, 1, 0.5).should.equal(0.5);
            Mathp.smootherstep(0, 1, 1).should.equal(1);
        });

        it('should apply the smootherstep correctly', function () {
            Mathp.smootherstep(-10, 10, 7).should.equalFloat(0.9733881249999993);
            Mathp.smootherstep(-10, 10, -7).should.equalFloat(0.026611875);
        });

        it('should never return a value outside of the bounds', function () {
            Mathp.smootherstep(0, 1, 2).should.equal(1);
            Mathp.smootherstep(0, 1, -1).should.equal(0);
        });
    });

    describe('#step()', function () {
        it('should return NaN if at least one argument is NaN', function () {
            Mathp.step(NaN, 0).should.be.NaN;
            Mathp.step(0, NaN).should.be.NaN;
            Mathp.step('toto', 0).should.be.NaN;
            Mathp.step(0, 'toto').should.be.NaN;
        });

        it('should return 1 if value > step', function () {
            Mathp.step(0, 1).should.equal(1);
            Mathp.step(100, 110).should.equal(1);
        });

        it('should return 1 if value == step', function () {
            Mathp.step(0, 0).should.equal(1);
            Mathp.step(100, 100).should.equal(1);
        });

        it('should return 0 if value < step', function () {
            Mathp.step(0, -1).should.equal(0);
            Mathp.step(100, 90).should.equal(0);
        });
    });

    describe('#factorial()', function () {
        it('should return NaN if the argument is not a positive integer', function () {
            Mathp.factorial(NaN).should.be.NaN;
            Mathp.factorial('toto').should.be.NaN;
            Mathp.factorial(-1).should.be.NaN;
            Mathp.factorial(1.01).should.be.NaN;
        });

        it('should return the proper factorial for positive integers', function () {
            Mathp.factorial(0).should.equal(1);
            Mathp.factorial(1).should.equal(1);
            Mathp.factorial(2).should.equal(2);
            Mathp.factorial(3).should.equal(6);
            Mathp.factorial(10).should.equal(3628800);
        });
    });

    describe('#roundToPrecision()', function () {
        it('should return NaN if the first argument is not a number', function () {
            Mathp.roundToPrecision(NaN, 2).should.be.NaN;
            Mathp.roundToPrecision('toto', 2).should.be.NaN;
            Mathp.roundToPrecision(undefined, 2).should.be.NaN;
        });

        it('should round to precision as expected', function () {
            Mathp.roundToPrecision(1, 0).should.equal(1);
            Mathp.roundToPrecision(1.5, 0).should.equal(2);
            Mathp.roundToPrecision(1.58, 1).should.equal(1.6);
            Mathp.roundToPrecision(1.58, 1.9).should.equal(1.6);
            Mathp.roundToPrecision(-1.8888, 2).should.equal(-1.89);
        });
    });

    describe('#euclideanModulo()', function () {
        it('should return NaN if any of the argument is NaN', function () {
            Mathp.euclideanModulo().should.be.NaN;
            Mathp.euclideanModulo(1, NaN).should.be.NaN;
            Mathp.euclideanModulo(NaN, 1).should.be.NaN;
            Mathp.euclideanModulo(1, 'toto').should.be.NaN;
            Mathp.euclideanModulo('toto', 1).should.be.NaN;
        });

        it('should handle 0 and Infinity as a dividend or divisor', function () {
            Mathp.euclideanModulo(0, 3).should.equal(0);
            Mathp.euclideanModulo(0, 0).should.be.NaN;
            Mathp.euclideanModulo(Infinity, 0).should.be.NaN;
            Mathp.euclideanModulo(-Infinity, 55).should.be.NaN;
        });

        it('should return a positive value with a positive dividend and a positive divisor', function () {
            Mathp.euclideanModulo(5, 3).should.equal(2);
        });

        it('should return a positive value with a negative dividend and a positive divisor', function () {
            Mathp.euclideanModulo(-5, 3).should.equal(1);
        });

        it('should return a positive value with a positive dividend and a negative divisor', function () {
            Mathp.euclideanModulo(5, -3).should.equal(2);
        });

        it('should return a positive value with a negative dividend and a negative divisor', function () {
            Mathp.euclideanModulo(-5, -3).should.equal(1);
        });
    });

    describe('#flooredModulo()', function () {
        it('should return NaN if any of the argument is NaN', function () {
            Mathp.flooredModulo().should.be.NaN;
            Mathp.flooredModulo(1, NaN).should.be.NaN;
            Mathp.flooredModulo(NaN, 1).should.be.NaN;
            Mathp.flooredModulo(1, 'toto').should.be.NaN;
            Mathp.flooredModulo('toto', 1).should.be.NaN;
        });

        it('should return a positive value with a positive dividend and a positive divisor', function () {
            Mathp.flooredModulo(5, 3).should.equal(2);
        });

        it('should return a positive value with a negative dividend and a positive divisor', function () {
            Mathp.flooredModulo(-5, 3).should.equal(1);
        });

        it('should return a negative value with a positive dividend and a negative divisor', function () {
            Mathp.flooredModulo(5, -3).should.equal(-1);
        });

        it('should return a negative value with a negative dividend and a negative divisor', function () {
            Mathp.flooredModulo(-5, -3).should.equal(-2);
        });
    });

    describe('#truncatedModulo()', function () {
        it('should return NaN if any of the argument is NaN', function () {
            Mathp.truncatedModulo().should.be.NaN;
            Mathp.truncatedModulo(1, NaN).should.be.NaN;
            Mathp.truncatedModulo(NaN, 1).should.be.NaN;
            Mathp.truncatedModulo(1, 'toto').should.be.NaN;
            Mathp.truncatedModulo('toto', 1).should.be.NaN;
        });

        it('should return a positive value with a positive dividend and a positive divisor', function () {
            Mathp.truncatedModulo(5, 3).should.equal(2);
        });

        it('should return a negative value with a negative dividend and a positive divisor', function () {
            Mathp.truncatedModulo(-5, 3).should.equal(-2);
        });

        it('should return a positive value with a positive dividend and a negative divisor', function () {
            Mathp.truncatedModulo(5, -3).should.equal(2);
        });

        it('should return a negative value with a negative dividend and a negative divisor', function () {
            Mathp.truncatedModulo(-5, -3).should.equal(-2);
        });
    });

    describe('#fract()', function () {
        it('should return NaN if its argument is NaN', function () {
            Mathp.fract().should.be.NaN;
            Mathp.fract(NaN).should.be.NaN;
            Mathp.fract('toto').should.be.NaN;
        });

        it('should return NaN if its argument is Infinity', function () {
            Mathp.fract(Number.NEGATIVE_INFINITY).should.be.NaN;
            Mathp.fract(Number.POSITIVE_INFINITY).should.be.NaN;
        });

        it('should return the fractional part of the arguments', function () {
            Mathp.fract(5).should.be.equal(0);
            Mathp.fract(5.1).should.be.equalFloat(0.1);
            Mathp.fract(5.5).should.be.equalFloat(0.5);
            Mathp.fract(5.9).should.be.equalFloat(0.9);
        });

        it('should always return a positive value', function () {
            Mathp.fract(-5).should.be.equal(0);
            Mathp.fract(-5.1).should.be.equalFloat(0.9);
            Mathp.fract(-5.5).should.be.equalFloat(0.5);
            Mathp.fract(-5.9).should.be.equalFloat(0.1);
        });
    });
});

redpajama_set_name: RedPajamaGithub


text:
DRAGULAR

Angular drag&drop based on dragula.

Live examples in docs

Browser support includes every sane browser and **IE7+**. _(Granted you polyfill the functional `Array` methods in ES5)_

Inspiration

I am working on huge angular project and I am using several drag&drop libraries in it, one for UI, one for lists, etc.. I want to use one full-featured drag&drop library for whole project. As I could not find any suitable, I decided to create one. I have choosen great library dragula by Nicolas Bevacqua as my starting point, make it more angular and started to put features in it! If you wish light-weight angular version of dragula, there is official angular version of dragula.

Actual version 4.4.0 is based on dragula 3.6.3 and tested with angular 1.5.5.

Differences of dragular (against dragula)

replaced dragula crossvent with angulars event binding

replaced dragula contra.emitter with $scope.$emit if scope provided in options (options.scope)

provided as service or directive dragular where options can be passed via atribute dragular

automatic direction if not provided in options, instead of default vertical

accepting arraylike objects as containers array (jQuery, jQlite collections etc..)

accepting custom classes via option.classes

namespaced containers groups available via option.nameSpace (containers in same nameSpace cooperate)

boundingBox (dragging element can me moved only in specific area)

lockX/Y (dragging element can me moved only in specific direction)

DOM can be synced with scope model

support css selectors to define containers

added syntax highlighter to example codes

etc..

Todo

improve docs

Features

provided as service and also as directive

Super easy to set up

No bloated dependencies

Figures out sort order on its own

A shadow where the item would be dropped offers visual feedback

Touch events!

For installation, usage and examples go to docs


text:
package com.palmelf.eoffice.action.info;

import java.lang.reflect.Type;
import java.util.List;

import javax.annotation.Resource;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.palmelf.core.command.QueryFilter;
import com.palmelf.core.web.action.BaseAction;
import com.palmelf.core.web.paging.PagingBean;
import com.palmelf.eoffice.model.info.NewsType;
import com.palmelf.eoffice.service.info.NewsTypeService;

public class NewsTypeAction extends BaseAction {
	private NewsType newsType;

	@Resource
	private NewsTypeService newsTypeService;

	public void setNewsType(NewsType newsType) {
		this.newsType = newsType;
	}

	public NewsType getNewsType() {
		return this.newsType;
	}

	@Override
	public String list() {
		QueryFilter filter = new QueryFilter(this.getRequest());
		filter.addSorted("sn", "asc");
		List<NewsType> list = this.newsTypeService.getAll(filter);
		Type type = new TypeToken<List<NewsType>>() {
		}.getType();
		StringBuffer buff = new StringBuffer("{success:true,'totalCounts':'"
				+ filter.getPagingBean().getTotalItems() + "',result:");
		Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation()
				.create();
		buff.append(gson.toJson(list, type));
		buff.append("}");
		this.setJsonString(buff.toString());
		return "success";
	}

	public String tree() {
		List<NewsType> list = this.newsTypeService.getAllBySn();
		StringBuffer sb = new StringBuffer("[");
		String opt = this.getRequest().getParameter("opt");
		if ((opt == null) || (!opt.equals("treeSelector"))) {
			sb.append("{id:'0',text:'全部新闻',leaf:true,iconCls:'menu-news'},");
		}
		for (NewsType newsType : list) {
			sb.append("{id:'").append(newsType.getTypeId()).append("',text:'")
					.append(newsType.getTypeName())
					.append("',leaf:true,iconCls:'menu-news'},");
		}
		if (!list.isEmpty()) {
			sb.deleteCharAt(sb.length() - 1);
		}
		sb.append("]");
		this.setJsonString(sb.toString());
		return "success";
	}

	public String add() {
		Short top = this.newsTypeService.getTop();
		if (top == null) {
			top = Short.valueOf((short) 0);
		}

		if (this.newsType.getTypeId() == null) {
			this.newsType.setSn(Short.valueOf((short) (top.shortValue() + 1)));
		}
		this.newsTypeService.save(this.newsType);
		this.setJsonString("{success:true}");
		return "success";
	}

	public String remove() {
		Long typeId = Long.valueOf(this.getRequest().getParameter("typeId"));
		this.setNewsType(this.newsTypeService.get(typeId));
		if (this.newsType != null) {
			Short sn = this.newsType.getSn();
			this.newsTypeService.remove(typeId);

			Short top = this.newsTypeService.getTop();
			if ((top != null) && (top.shortValue() > sn.shortValue())) {
				for (int i = 0; i < top.shortValue() - sn.shortValue(); i++) {
					this.setNewsType(this.newsTypeService.findBySn(Short
							.valueOf((short) (sn.shortValue() + i + 1))));
					this.newsType
							.setSn(Short.valueOf((short) (sn.shortValue() + i)));
					this.newsTypeService.save(this.newsType);
				}
			}
		}
		return "success";
	}

	public String detail() {
		Long typeId = Long.valueOf(this.getRequest().getParameter("typeId"));
		this.setNewsType(this.newsTypeService.get(typeId));
		Gson gson = new Gson();
		StringBuffer sb = new StringBuffer("{success:true,data:[");
		sb.append(gson.toJson(this.newsType));
		sb.append("]}");
		this.setJsonString(sb.toString());
		return "success";
	}

	public String search() {
		PagingBean pb = this.getInitPagingBean();
		List<NewsType> list = this.newsTypeService.findBySearch(this.newsType,
				pb);
		Type type = new TypeToken<List<NewsType>>() {
		}.getType();
		StringBuffer buff = new StringBuffer("{success:true,'totalCounts':'"
				+ pb.getTotalItems() + "',result:");
		Gson gson = new Gson();
		buff.append(gson.toJson(list, type));
		buff.append("}");
		this.setJsonString(buff.toString());
		return "success";
	}

	public String sort() {
		Integer opt = Integer.valueOf(Integer.parseInt(this.getRequest()
				.getParameter("opt")));
		Long typeId = Long.valueOf(this.getRequest().getParameter("typeId"));
		this.setNewsType(this.newsTypeService.get(typeId));
		Short top = this.newsTypeService.getTop();
		Short sn = this.newsType.getSn();
		NewsType change = new NewsType();
		if ((opt.intValue() == 1) && (sn.shortValue() != 1)) {
			for (int i = 0; i < sn.shortValue() - 1; i++) {
				change = this.newsTypeService.findBySn(Short
						.valueOf((short) (sn.shortValue() - i - 1)));
				change.setSn(Short.valueOf((short) (sn.shortValue() - i)));
				this.newsTypeService.save(change);
			}
			this.newsType.setSn(Short.valueOf((short) 1));
			this.newsTypeService.save(this.newsType);
		}

		if ((opt.intValue() == 2) && (sn.shortValue() != 1)) {
			change = this.newsTypeService.findBySn(Short.valueOf((short) (sn
					.shortValue() - 1)));
			change.setSn(sn);
			this.newsTypeService.save(change);
			this.newsType.setSn(Short.valueOf((short) (sn.shortValue() - 1)));
			this.newsTypeService.save(this.newsType);
		}

		if ((opt.intValue() == 3) && (sn.shortValue() < top.shortValue())) {
			change = this.newsTypeService.findBySn(Short.valueOf((short) (sn
					.shortValue() + 1)));
			change.setSn(sn);
			this.newsTypeService.save(change);
			this.newsType.setSn(Short.valueOf((short) (sn.shortValue() + 1)));
			this.newsTypeService.save(this.newsType);
		}

		if ((opt.intValue() == 4) && (sn.shortValue() < top.shortValue())) {
			for (int i = 0; i < top.shortValue() - sn.shortValue(); i++) {
				change = this.newsTypeService.findBySn(Short
						.valueOf((short) (sn.shortValue() + i + 1)));
				change.setSn(Short.valueOf((short) (sn.shortValue() + i)));
				this.newsTypeService.save(change);
			}
			this.newsType.setSn(top);
			this.newsTypeService.save(this.newsType);
		}

		return "success";
	}
}


text:
package com.amazonaws.services.kendra.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.kendra.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * DocumentAttributeTarget JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DocumentAttributeTargetJsonUnmarshaller implements Unmarshaller<DocumentAttributeTarget, JsonUnmarshallerContext> {

    public DocumentAttributeTarget unmarshall(JsonUnmarshallerContext context) throws Exception {
        DocumentAttributeTarget documentAttributeTarget = new DocumentAttributeTarget();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("TargetDocumentAttributeKey", targetDepth)) {
                    context.nextToken();
                    documentAttributeTarget.setTargetDocumentAttributeKey(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("TargetDocumentAttributeValueDeletion", targetDepth)) {
                    context.nextToken();
                    documentAttributeTarget.setTargetDocumentAttributeValueDeletion(context.getUnmarshaller(Boolean.class).unmarshall(context));
                }
                if (context.testExpression("TargetDocumentAttributeValue", targetDepth)) {
                    context.nextToken();
                    documentAttributeTarget.setTargetDocumentAttributeValue(DocumentAttributeValueJsonUnmarshaller.getInstance().unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return documentAttributeTarget;
    }

    private static DocumentAttributeTargetJsonUnmarshaller instance;

    public static DocumentAttributeTargetJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new DocumentAttributeTargetJsonUnmarshaller();
        return instance;
    }
}


text:
#include "postgres.h"

#include "libpq/pqsignal.h"

#ifdef HAVE_SIGPROCMASK
sigset_t	UnBlockSig,
			BlockSig,
			StartupBlockSig;
#else
int			UnBlockSig,
			BlockSig,
			StartupBlockSig;
#endif

/*
 * Initialize BlockSig, UnBlockSig, and StartupBlockSig.
 *
 * BlockSig is the set of signals to block when we are trying to block
 * signals.  This includes all signals we normally expect to get, but NOT
 * signals that should never be turned off.
 *
 * StartupBlockSig is the set of signals to block during startup packet
 * collection; it's essentially BlockSig minus SIGTERM, SIGQUIT, SIGALRM.
 *
 * UnBlockSig is the set of signals to block when we don't want to block
 * signals (is this ever nonzero??)
 */
void
pqinitmask(void)
{
#ifdef HAVE_SIGPROCMASK

	sigemptyset(&UnBlockSig);

	/* First set all signals, then clear some. */
	sigfillset(&BlockSig);
	sigfillset(&StartupBlockSig);

	/*
	 * Unmark those signals that should never be blocked. Some of these signal
	 * names don't exist on all platforms.  Most do, but might as well ifdef
	 * them all for consistency...
	 */
#ifdef SIGTRAP
	sigdelset(&BlockSig, SIGTRAP);
	sigdelset(&StartupBlockSig, SIGTRAP);
#endif
#ifdef SIGABRT
	sigdelset(&BlockSig, SIGABRT);
	sigdelset(&StartupBlockSig, SIGABRT);
#endif
#ifdef SIGILL
	sigdelset(&BlockSig, SIGILL);
	sigdelset(&StartupBlockSig, SIGILL);
#endif
#ifdef SIGFPE
	sigdelset(&BlockSig, SIGFPE);
	sigdelset(&StartupBlockSig, SIGFPE);
#endif
#ifdef SIGSEGV
	sigdelset(&BlockSig, SIGSEGV);
	sigdelset(&StartupBlockSig, SIGSEGV);
#endif
#ifdef SIGBUS
	sigdelset(&BlockSig, SIGBUS);
	sigdelset(&StartupBlockSig, SIGBUS);
#endif
#ifdef SIGSYS
	sigdelset(&BlockSig, SIGSYS);
	sigdelset(&StartupBlockSig, SIGSYS);
#endif
#ifdef SIGCONT
	sigdelset(&BlockSig, SIGCONT);
	sigdelset(&StartupBlockSig, SIGCONT);
#endif

/* Signals unique to startup */
#ifdef SIGQUIT
	sigdelset(&StartupBlockSig, SIGQUIT);
#endif
#ifdef SIGTERM
	sigdelset(&StartupBlockSig, SIGTERM);
#endif
#ifdef SIGALRM
	sigdelset(&StartupBlockSig, SIGALRM);
#endif
#else
	/* Set the signals we want. */
	UnBlockSig = 0;
	BlockSig = sigmask(SIGQUIT) |
		sigmask(SIGTERM) | sigmask(SIGALRM) |
	/* common signals between two */
		sigmask(SIGHUP) |
		sigmask(SIGINT) | sigmask(SIGUSR1) |
		sigmask(SIGUSR2) | sigmask(SIGCHLD) |
		sigmask(SIGWINCH) | sigmask(SIGFPE);
	StartupBlockSig = sigmask(SIGHUP) |
		sigmask(SIGINT) | sigmask(SIGUSR1) |
		sigmask(SIGUSR2) | sigmask(SIGCHLD) |
		sigmask(SIGWINCH) | sigmask(SIGFPE);
#endif
}


text:
require './config/boot'
require './config/environment'

require 'find'

require 'fileutils'

auction_configurations = AuctionConfiguration.all
i=0
for auction_configuration in auction_configurations
  products = Product.all
  for product in products
    isblank = AuctionConfigurationMembership.
            where(auction_configuration_id: auction_configuration.id).
            where(product_id: product.id).blank?
    if isblank
      i=i+1;
      AuctionConfigurationMembership.create!(auction_configuration_id: auction_configuration.id,
                                            product_id: product.id)
    end
  end
end

puts "#{i} Auktionkonfiguration zu Produkt hinzugefügt."


text:
@testset "Multigrid.Multigrid" begin
    @testset "testGMG.jl" begin
      include("testGMG.jl")
    end
    @testset "testGMGRAPforPoisson.jl" begin
       include("testGMGRAPforPoisson.jl")
    end
	@testset "testSAforDivSigGrad.jl" begin
		include("testSAforDivSigGrad.jl")
    end
    @testset "testLinSolveMGWrapper.jl" begin
        include("testLinSolveMGWrapper.jl")
    end
	@testset "testLinSolveAMGWrapper.jl" begin
        include("testLinSolveAMGWrapper.jl")
    end
	@testset "testGMGRAPforElasticity.jl" begin
       include("testGMGRAPforElasticity.jl")
    end

	@testset "testGMGforElasticity.jl" begin
       include("testGMGforElasticity.jl")
    end
    @testset "testGMGRAPforElasticityVanka.jl" begin
        include("testGMGRAPforElasticityVanka.jl")
    end
	@testset "testGMGforElasticityVanka.jl" begin
       include("testGMGforElasticityVanka.jl")
    end
	@testset "testHybridKaczmarz.jl" begin
       include("testHybridKaczmarz.jl")
    end
end


text:
package org.batfish.grammar.flattener;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NavigableMap;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import javax.annotation.Nonnull;

public final class FlattenerLineMap {
  public static final int UNMAPPED_LINE_NUMBER = -1;
  /**
   * Map of new line number to word map, where word map is map of a word's starting-position in
   * new/flattened line to original line number
   */
  private NavigableMap<Integer, NavigableMap<Integer, Integer>> _lineMap;

  private final Map<Integer, Set<Integer>> _extraLines;

  public FlattenerLineMap() {
    _lineMap = new TreeMap<>();
    _extraLines = new HashMap<>();
  }

  /**
   * Return original line number corresponding to the character at the specified position on the
   * specified new/flattened line. If there is no entry covering the specified position, the last
   * original line number associated with this flattened line is returned.
   */
  public int getOriginalLine(@Nonnull Integer newLineNumber, @Nonnull Integer newStartingPosition) {
    NavigableMap<Integer, Integer> wordMap = _lineMap.get(newLineNumber);
    if (wordMap == null) {
      /*
       * Result from looking up an unmapped line, this handles lines like the header inserted after
       * flattening
       */
      return UNMAPPED_LINE_NUMBER;
    } else {
      Entry<Integer, Integer> originalLineEntry = wordMap.floorEntry(newStartingPosition);
      /*
       * Default to the last entry if there is no corresponding entry (e.g. looking up original
       * line for a word like 'set' that did not exist in the original config should still give
       * useful output)
       */
      return (originalLineEntry == null)
          ? wordMap.lastEntry().getValue()
          : originalLineEntry.getValue();
    }
  }

  /**
   * Set the original line corresponding to the word starting at the specified position on the
   * specified new/flattened line
   */
  public void setOriginalLine(
      @Nonnull Integer newLineNumber,
      @Nonnull Integer newStartingPosition,
      @Nonnull Integer originalLineNumber) {
    SortedMap<Integer, Integer> wordMap =
        _lineMap.computeIfAbsent(newLineNumber, l -> new TreeMap<>());
    wordMap.put(newStartingPosition, originalLineNumber);
  }

  /**
   * Extra original lines associated with an original line. This mapping may be both incomplete and
   * an overapproximation. For every structure definition whose lines cannot be determined from the
   * flattened parse tree, the keys should include the original line of at least one surviving token
   * of that structure definition. The corresponding value should include at minimum all original
   * lines of the corresponding structure definition that cannot be determined from the flattened
   * parse tree. There may be extra key and value lines, but they will not cause an
   * overapproximation of the original lines associated with any structure.
   */
  public @Nonnull Map<Integer, Set<Integer>> getExtraLines() {
    return _extraLines;
  }

  /**
   * Associate some original line with some extra original lines. If the original line is part of a
   * structure definition, all extra lines to associate must be part of that definition.
   *
   * <p>Should only be called during preprocessing.
   */
  public void setExtraLines(int originalLine, Set<Integer> extraLines) {
    _extraLines.put(originalLine, extraLines);
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<Exports xmlns="http://schemas.itin.com/export/engine/2014/configuration/v1.0">

  <Global.Resources>
    <Hosts>
      <Host Key="xlsx">
        <Document Orientation="Landscape" Size="A3">
          <Metadata>
            <Author>Your Name</Author>
            <Company>Your Company</Company>
            <Comments>How to creates a column header fields</Comments>
            <Title>Sample03</Title>
          </Metadata>
          <Margins Bottom="10" Top="10" Right="10" Left="10" Units="Millimeters"/>
        </Document>
      </Host>
    </Hosts>
    <Groups>
      <Group Name="CustomerName">
        <Field Name="CUSTOMERFIRSTNAME" Separator=", "/>
        <Field Name="CUSTOMERLASTNAME"/>
      </Group>
    </Groups>

    </Styles>
  </Global.Resources>

  <Export Name="Sample03" Current="Yes">
    <Description>How to creates a column header fields</Description>

      <Exporter>
        <Writer Name="XlsxTabularWriter"/>
      </Exporter>
      <Headers>

      </Headers>
      <Fields>
        <Field Name="ID" Alias="Id">

          <Value Style="ValueNumericStyle"/>
        </Field>
        <Field Name="DATE" Alias="Date">

          <Value Style="ValueDatetimeStyle"/>
        </Field>
        <Group Name="CustomerName" Alias="Customer">

          <Value Style="ValueStringStyle"/>
        </Group>
        <Field Name="CUSTOMERPHONE" Alias="Phone">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="CUSTOMEREMAIL" Alias="Email">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="BILLINGADDRESS" Alias="Address">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="BILLINGCITY" Alias="City">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="BILLINGSTATE" Alias="State">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="BILLINGCOUNTRY" Alias="Country">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="BILLINGPOSTALCODE" Alias="Postal Code">

          <Value Style="ValueStringStyle"/>
        </Field>
        <Field Name="TOTAL" Alias="Total">

          <Value Style="ValueDecimalStyle"/>
        </Field>
      </Fields>
      <Output>
        <Path>~\output\writer\xlsx\ExportEngine\</Path>
        <File>sample03-from-config-file</File>
      </Output>

  </Export>

</Exports>


text:
package com.decker.parkingSearch;

import com.decker.parkingSearch.core.Controller;

public class EntryPoint {
    public static void main(String[] args) throws Exception {
        Controller.get_instance().start();
    }
}


text:
require_relative '../../puppet_x/puppetlabs/swagger/fuzzy_compare'

Puppet::Type.newtype(:kubernetes_azure_file_volume_source) do

  @doc = "AzureFile represents an Azure File Service mount on the host and bind mount to the pod."

  ensurable

  validate do
    required_properties = [

      secret_name,

      share_name,

    ]
    required_properties.each do |property|
      # We check for both places so as to cover the puppet resource path as well
      if self[property].nil? and self.provider.send(property) == :absent
        fail "You must provide a #{property}"
      end
    end
  end

  newparam(:name, namevar: true) do
    desc 'Name of the azure_file_volume_source.'
  end

      newproperty(:secret_name) do

        desc "the name of secret that contains Azure Storage Account Name and Key"

        def insync?(is)
          PuppetX::Puppetlabs::Swagger::Utils::fuzzy_compare(is, should)
        end
      end

      newproperty(:share_name) do

        desc "Share Name"

        def insync?(is)
          PuppetX::Puppetlabs::Swagger::Utils::fuzzy_compare(is, should)
        end
      end

      newproperty(:read_only) do

        desc "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."

        def insync?(is)
          PuppetX::Puppetlabs::Swagger::Utils::fuzzy_compare(is, should)
        end
      end

end


text:
package com.angkorteam.fintech.dto.constant;

public enum EntityAccountTypeEnum {

    Client("1", "Client"), Loan("2", "Loan"), Savings("3", "Savings"), Center("4", "Center"), Group("5", "Group"), Shares("6", "Shares");

    public static final String ID = "entity_account_type_enum";

    private final String literal;

    private final String description;

    private final Long enumType;

    EntityAccountTypeEnum(String literal, String description) {
        this(literal, description, 0l);
    }

    EntityAccountTypeEnum(String literal, String description, Long enumType) {
        this.literal = literal;
        this.description = description;
        this.enumType = enumType;
    }

    public String getLiteral() {
        return literal;
    }

    public String getDescription() {
        return description;
    }

    public Long getEnumType() {
        return enumType;
    }
}


text:
var struct_temperature_controller =
[
    [ "currentTemperature", "struct_temperature_controller.html#a312344cfcf54842935c4df4d67d24154", null ],
    [ "currentTemperatureC", "struct_temperature_controller.html#aaef2b12184c93d3d1e810e16b0622d70", null ],
    [ "heatManager", "struct_temperature_controller.html#ab7cf8def273bbe793b894087bc80ee5f", null ],
    [ "lastTemperatureUpdate", "struct_temperature_controller.html#aae9dbd112d23b40ee5f573e91a0e40ff", null ],
    [ "pidDGain", "struct_temperature_controller.html#a7146e3620b552f2e1933bada1dfc1157", null ],
    [ "pidDriveMax", "struct_temperature_controller.html#affe50befa6c77b58aecdf130a62b900a", null ],
    [ "pidDriveMin", "struct_temperature_controller.html#a04769ade1512e28f371e3c5bd9eb550f", null ],
    [ "pidIGain", "struct_temperature_controller.html#a088ae08937ece0b330031cc79f2ddd41", null ],
    [ "pidMax", "struct_temperature_controller.html#a4fd91b11a179cc44ad4e984143f33a94", null ],
    [ "pidPGain", "struct_temperature_controller.html#a59542e4cc766a6c11e07270d5245bfea", null ],
    [ "pwmIndex", "struct_temperature_controller.html#ac7ea110f24b180767e043e276dc21e90", null ],
    [ "sensorPin", "struct_temperature_controller.html#a79cafd445a67566e2713485ed87c1439", null ],
    [ "sensorType", "struct_temperature_controller.html#a3a5254ba393ca36615e9709981240ceb", null ],
    [ "targetTemperature", "struct_temperature_controller.html#a7dc7e4c0189d36e4d5c4e4aa41cec731", null ],
    [ "targetTemperatureC", "struct_temperature_controller.html#aa74b6e6ce4377461c89007835536d846", null ],
    [ "tempArray", "struct_temperature_controller.html#abbb5a6235e2715f2041319a467856f6d", null ],
    [ "tempIState", "struct_temperature_controller.html#a473cb0357a6e307081c09d62715507cf", null ],
    [ "tempIStateLimitMax", "struct_temperature_controller.html#a1c7d2c920a501e240e7cc3b3b6054ff4", null ],
    [ "tempIStateLimitMin", "struct_temperature_controller.html#a5b28147bc0ae29c5884be12d6128423b", null ],
    [ "tempPointer", "struct_temperature_controller.html#ae5a1b2708902480b80856dad81e08b43", null ]
];


text:
            <?php $this->load->view('users/widgets/breadcrumb'); ?>

                <?php $this->load->view('users/widgets/page-header'); ?>

                <?php $this->load->view('users/forms/contact-person-form'); ?>

<button onClick="location.href='<?php echo base_url(); ?>maintenance/contact-person/manage';" id="back-contact-person-btn" title="Back to Manage Accounts"  class="btn btn-float theme-bg-2 m-btn d-btn waves-effect waves-circle waves-float">

</button>

<button id="edit-contact-person-btn" title="Save Contact Person"  class="btn btn-float theme-bg-1 m-btn waves-effect waves-circle waves-float">

</button>


text:
package org.potmart.jgeo.thrift.client;

import org.apache.thrift.TException;
import org.apache.thrift.async.TAsyncClientManager;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.protocol.TProtocolFactory;
import org.apache.thrift.transport.*;
import org.potmart.jgeo.thrift.callback.MethodCallback;
import org.potmart.jgeo.thrift.service.Hello;

import java.io.IOException;

/**
 * Created by GOT.hodor on 2017/3/14.
 */
public class AsyncClient {

    public static void main(String[] args) {
        TTransport transport = null;
        try {
            /*
            TAsyncClientManager clientManager = new TAsyncClientManager();
            TNonblockingTransport transport = new TNonblockingSocket(
                    "localhost", 10005);
            TProtocolFactory protocol = new TBinaryProtocol.Factory();
            Hello.AsyncClient asyncClient = new Hello.AsyncClient(protocol,
                    clientManager, transport);
            System.out.println("Client calls .....");
            MethodCallback callBack = new MethodCallback();
            asyncClient.helloString("hello thrift", callBack);
            Object res = callBack.getResult();
            while (res == null) {
                res = callBack.getResult();
            }
            System.out.println(((Hello.AsyncClient.helloString_call) res)
                    .getResult());
                    */

            transport = new TFramedTransport(new TSocket("localhost",
                    10005, 30000));
            // 协议要和服务端一致
            TProtocol protocol = new TCompactProtocol(transport);
            Hello.Client client = new Hello.Client(
                    protocol);
            transport.open();
            String result = client.helloString("as so ?");
            System.out.println("Thrify client result =: " + result);

        } catch (TException e){
            e.printStackTrace();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="studio.androiddev.puzzle">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:name=".PuzzleApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".activity.MainActivity"
            android:theme="@style/AppTheme.NoActionBar"
            android:launchMode="singleTask"/>
        <activity
            android:name=".activity.LoginActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".activity.RegisterActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
        <activity
            android:name=".activity.UserInfoActivity"
            android:label="@string/title_activity_personal"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity android:name=".activity.ChangePwdActivity"
            android:label="@string/title_activity_change_pwd"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".activity.SettingActivity"
            android:label="@string/title_activity_setting"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name=".activity.RankActivity"
            android:label="@string/title_activity_rank"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name=".activity.GameActivity"
            android:label="@string/title_activity_game"
            android:theme="@style/AppTheme.NoActionBar" />

        <service android:name=".bgm.MusicServer" />

        <activity
            android:name=".activity.ChoosePicActivity"
            android:label="@string/title_activity_choose_pic"
            android:theme="@style/AppTheme.NoActionBar"/>
    </application>

</manifest>


text:
namespace fcv {
	typedef void* disposable_t;

	struct CameraView;

	enum CaptureMode {
		CAPTURE_MODE_PHOTO = 0,
		CAPTURE_MODE_VIDEO = 1,
	};

	enum CaptureState {
		CAPTURE_STATE_IDLE = 0,
		CAPTURE_STATE_CAPTURING_PHOTO = 1,
		CAPTURE_STATE_RECORDING_VIDEO = 2,
	};

	enum CameraFacing {
		CAMERA_FACING_FRONT = 0,
		CAMERA_FACING_BACK = 1,
	};

	enum FlashMode {
		FLASH_MODE_AUTO = AVCaptureFlashModeAuto,
		FLASH_MODE_ON = AVCaptureFlashModeOn,
		FLASH_MODE_OFF = AVCaptureFlashModeOff,
	};

	struct CameraInfo {
		CaptureMode captureMode;
		FlashMode flashMode;
		CameraFacing cameraFacing;
		NSArray<NSNumber*>* supportedFlashModes;
	};

	disposable_t loadCameraView(CameraPreview* cameraPreview, void(^onResolve)(void*), void(^onReject)(NSString*));
	void setCaptureMode(CameraView* cameraView, int captureMode, void(^onResolve)(int), void(^onReject)(NSString*));
	void capturePhoto(CameraView* cameraView, void(^onResolve)(void*,int), void(^onReject)(NSString*));
	void startRecording(CameraView* cameraView, void(^onResolve)(RecordingSession*), void(^onReject)(NSString*));
	void setCameraFacing(CameraView* cameraView, int cameraFacing, void(^onResolve)(int), void(^onReject)(NSString*));
	void setFlashMode(CameraView* cameraView, int flashMode, void(^onResolve)(int), void(^onReject)(NSString*));
	void getCameraInfo(CameraView* cameraView, void(^callback)(CameraInfo));
	void dispose(disposable_t disposable);
}

#endif


text:
function add(obj,H)
%UIPANELGROUP/ADD   Add subpanels
%   ADD(OBJ,H) adds HG panel objects given in H to a scalar
%   UIPANELGROUP object OBJ. If H must be supported panel type.
%
%   ADD(OBJ,UIPANELEXOBJ) adds the HG objects associated with a
%   UIPANELEX objects to OBJ.

narginchk(2,2);
if ~isscalar(obj)
   error('OBJ must be a scalar UIPANELGROUP object.');
end
if isempty(obj.hg)
   error('OBJ is not associated with any HG object.');
end

if isa(H,'uipanelex')
   % extract base HG objects from UIPANELEX objects
   H = H.hgbase();
elseif ~all(ishghandle(H)) || ~all(uipanelex.ispanel(H))
   error('H must be valid panel HG objects or UIPANELEX objects.');
end

% set OBJ.GraphicsHandle as their Parent
set(H,'Parent',obj.GraphicsHandle);


text:
<?php

defined('_JEXEC') or die('Restricted access');

class CWallTrigger
{
	public function onAfterWallDelete($id)
	{
		$db= JFactory::getDBO();

		$sql = 'DELETE FROM ' . $db->quoteName('#__community_activities')
			.' WHERE ' . $db->quoteName('cid') .' = '. $db->Quote($id)
			.' AND ' . $db->quoteName('app') .' = ' . $db->Quote('groups.wall');
		$db->setQuery($sql);
		$db->query();
	}

	public function onWallDisplay( $row )
	{
		//CFactory::load( 'helpers' , 'string' );
		CError::assert( $row->comment, '', '!empty', __FILE__ , __LINE__ );

		// @rule: Only nl2br text that doesn't contain html tags
		if( !CStringHelper::isHTML( $row->comment ) )
		{
			$row->comment	= CStringHelper::nl2br( $row->comment );
		}
	}

}


text:
.PHONY: all clean install

all: build

ffmpeg:
	git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git ffmpeg

install:
	make -C ffmpeg install

clean:
	make -C ffmpeg clean

build: ffmpeg
	cd ffmpeg; \
	./configure \
	    --prefix=/usr \
	    --libdir=/usr/lib \
	    --shlibdir=/usr/lib \
	    --disable-debug \
	    --enable-shared \
	    --enable-gpl \
	    --enable-version3 \
	    --enable-nonfree \
	    --enable-doc \
	    --enable-ffmpeg \
	    --disable-ffplay \
	    --disable-avisynth \
	    --enable-gray \
	    --enable-avdevice \
	    --enable-avcodec \
	    --enable-avformat \
	    --enable-avfilter \
	    --enable-postproc \
	    --enable-bzlib \
	    --enable-fontconfig \
	    --enable-libopus \
	    --enable-swresample \
	    --enable-swscale \
	    --disable-libopencore-amrnb \
	    --disable-libopencore-amrwb \
	    --disable-libopencv \
	    --disable-libdc1394 \
	    --enable-libfdk-aac \
	    --enable-libfreetype \
	    --enable-libgsm \
	    --enable-libmp3lame \
	    --enable-gnutls \
	    --enable-libopenjpeg \
	    --disable-librtmp \
	    --enable-libspeex \
	    --enable-libtheora \
	    --enable-libvidstab \
	    --enable-libvo-amrwbenc \
	    --enable-libvorbis \
	    --enable-libvpx \
	    --enable-libx264 \
	    --enable-libx265 \
	    --disable-libxavs \
	    --enable-zlib \
	|| exit 1
	make -j`nproc` -C ffmpeg || exit 1


text:
<!doctype html>

  <title>video events - timeupdate</title>

spec reference

  <video id="v" controls>
  </video>


text:
//
//  SNSDeviceFlickr.m
//  SNSServices
//
//  Created by Joohae Kim on 2016. 4. 7..
//  Copyright © 2016년 Joohae Kim. All rights reserved.
//

/*!
 You may need to register
    1. an account of Flickr Developer Account: https://www.flickr.com/services/developer
    2. an application: https://www.flickr.com/services/apps/create/apply/
 */

#import "SNSDeviceFlickr.h"
#import <AFNetworking/AFNetworking.h>
#import "NSDictionary+Helper.h"
#import "CryptoUtil.h"
#import "FlickrUtil.h"

static NSString *const FLICKR_API_BASE          = @"https://www.flickr.com/services";
static NSString *const KEY_FLICKR_ACCESS_TOKEN  = @"KEY_INSTAGRAM_ACCESS_TOKEN";
static NSString *const KEY_FLICKR_AUTH_TOKEN    = @"KEY_FLICKR_AUTH_TOKEN";
static NSString *const ERROR_DOMAIN             = @"kr.carrotbooks.SNSService.SNSDeviceFlickr";

//  Keys for accessing response data from Flickr
static NSString *const KEY_OAUTH_NONCE          = @"oauth_nonce";
static NSString *const KEY_OAUTH_TIMESTAMP      = @"oauth_timestamp";
static NSString *const KEY_OAUTH_CONSUMER_KEY   = @"oauth_consumer_key";
static NSString *const KEY_OAUTH_SIGNATURE_METHOD = @"oauth_signature_method";
static NSString *const KEY_OAUTH_VERSION        = @"oauth_version";
static NSString *const KEY_OAUTH_CALLBACK       = @"oauth_callback";
static NSString *const KEY_OAUTH_SIGNATURE      = @"oauth_signature";

static NSString *const KEY_OAUTH_TOKEN          = @"oauth_token";
static NSString *const KEY_OAUTH_TOKEN_SECRET   = @"oauth_token_secret";
static NSString *const KEY_OAUTH_CALLBACK_CONFIRMED = @"oauth_callback_confirmed";
static NSString *const KEY_OAUTH_VERIFIER       = @"oauth_verifier";

@interface SNSDeviceFlickr ()
{
    AuthenticationWVCFlickr *_webviewController;
}

@property (nonatomic) NSString *clientKey;
@property (nonatomic) NSString *clientSecret;
@property (nonatomic) NSString *clientCallback;
@property (nonatomic) NSString *clientAuthTokenSecret;
@property (nonatomic) NSString *clientAuthToken;
@property (nonatomic) NSString *accessToken;

@end

@implementation SNSDeviceFlickr
- (void) setClinetKey:(NSString *)clientKey secret:(NSString *)clientSecret andCallbackBase:(NSString *)callbackBase {
    _clientKey = clientKey;
    _clientSecret = clientSecret;
    _clientCallback = [NSString stringWithFormat:@"%@://auth", callbackBase];
    if (!_clientAuthTokenSecret) {
        _clientAuthTokenSecret = @"";
    }
}

- (BOOL) hasAuthentication {
    // Save the access token
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    _accessToken = [defaults objectForKey:KEY_FLICKR_ACCESS_TOKEN];
    _clientAuthToken = [defaults objectForKey:KEY_FLICKR_AUTH_TOKEN];

    return (_accessToken != nil && _clientAuthToken != nil);
}

/*!
 Request request media file list to SNSService
 */
- (void) requestFileList {
    if (![self hasAuthentication]) {
        // Step 1.
        [self requestRequestToken:^(NSString *response) {
            // Step 2. and 3.
            [self addAuthenticationViews];
        } failure:^(NSError *error) {
            if (self.delegate && [self.delegate respondsToSelector:@selector(SNSServiceError:)]) {
                [self.delegate SNSServiceError:error];
            }
        }];
        return;
    }

    NSLog(@"REQUESTING FILE LIST");

    [self doRequestFileList:[NSMutableArray<SNSImageSource *> new] ofPage:1];
}

-(void) doRequestFileList:(NSMutableArray<SNSImageSource *> *)imageList ofPage:(NSInteger) pageNo
{
    NSMutableDictionary *params = [self createRequestParam];
    [params setObject:@"flickr.photos.search" forKey:@"method"];
    [params setObject:@"me" forKey:@"user_id"];
    // refer https://www.flickr.com/services/api/flickr.photos.search.html for detail search options.
    [params setObject:@"date-posted-desc" forKey:@"sort"];
    [params setObject:@"photos" forKey:@"media"];
    [params setObject:@"url_t,url_o,description,date_upload,date_taken,last_update,media" forKey:@"extras"];
    [params setObject:@(pageNo) forKey:@"page"];

    NSString *baseString = [NSString stringWithFormat:@"%@/%@",FLICKR_API_BASE, @"rest"];
    NSString *signature = [self getSignatureOf:baseString params:params withTokenScret:_accessToken];

    [params setObject:signature forKey:KEY_OAUTH_SIGNATURE];

    NSString *urlString = [NSString stringWithFormat:@"%@?%@", baseString, [self convertDictionaryToUrlString:params withBaseUrl:baseString]];
    NSURL *URL = [NSURL URLWithString:urlString];

    [self requestWithURL:URL
          forResponsType:@"text/json"
                 success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                     NSDictionary *dict = responseObject;
                     for (NSDictionary *item in [dict objectForKeyPath:@"photos.photo"]) {
                         SNSImageSource *imageSource = [SNSImageSource new];

                         NSMutableString *titleText = [NSMutableString new];
                         [titleText appendFormat:@"%@: ", [item objectForKey:@"title"]];
                         if ([item objectForKeyPath:@"description._content"]) {
                             [titleText appendString:[item objectForKeyPath:@"description._content"]];
                         }
                         imageSource.text = [NSString stringWithString:titleText];

                         @try {
                             imageSource.createdEpoch = [[item objectForKey:@"date_upload"] integerValue];
                         }
                         @catch (NSException *ex){
                             imageSource.createdEpoch = [[NSDate new] timeIntervalSince1970];
                         }

                         imageSource.imageUrl        = [item objectForKeyPath:@"url_o"];
                         imageSource.imageWidth      = [[item objectForKeyPath:@"width_o"] doubleValue];
                         imageSource.imageHeight     = [[item objectForKeyPath:@"height_o"] doubleValue];;

                         imageSource.thumbnailUrl    = [item objectForKeyPath:@"url_t"];
                         imageSource.thumbnailWidth  = [[item objectForKeyPath:@"width_t"] doubleValue];
                         imageSource.thumbnailHeight = [[item objectForKeyPath:@"height_t"] doubleValue];;

                         [imageList addObject:imageSource];
                     }

                     NSInteger lastPage = [[dict objectForKeyPath:@"photos.pages"] integerValue];
                     if (pageNo < lastPage) {
                         [self doRequestFileList:imageList ofPage:pageNo+1];
                     } else {
                         if (self.delegate && [self.delegate respondsToSelector:@selector(SNSServiceFileListFetched:)]) {
                             [self.delegate SNSServiceFileListFetched:imageList];
                         }
                     }
                 } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                     if (imageList.count > 0) {
                         // Send collected image list
                         if (self.delegate && [self.delegate respondsToSelector:@selector(SNSServiceFileListFetched:)]) {
                             [self.delegate SNSServiceFileListFetched:imageList];
                         }
                     }
                     if (self.delegate && [self.delegate respondsToSelector:@selector(SNSServiceError:)]) {
                         [self.delegate SNSServiceError:error];
                     }
                     NSLog(@"Fetch file list failed: %@", error);
                 }];
}

-(void)requestWithURL:(NSURL *)URL
       forResponsType:(NSString *)responseType
              success:(void (^)(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject)) success
              failure:(void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error)) failure
{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    if ([responseType isEqualToString:@"text/json"]) {
        manager.responseSerializer = [AFJSONResponseSerializer serializer];
    } else {
        manager.responseSerializer = [AFHTTPResponseSerializer serializer];
        if ([responseType isEqualToString:@"text/xml"]) {
            manager.responseSerializer.acceptableContentTypes =  [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/xml"];
        } else {
            // else text/plain
        }
    }

    [manager GET:URL.absoluteString
      parameters:@{}
        progress:nil
         success:success
         failure:failure];
}

#pragma mark - Authentication
/*!
 Step 1. Signing Requests and Getting a Request Token
 */
- (void) requestRequestToken:(void (^)(NSString *)) success
                     failure:(void (^)(NSError *)) failure
{
    NSMutableDictionary *params = [self createBaseParam];
    [params setObject:[[CryptoUtil sharedManager] urlEncode:_clientCallback] forKey:KEY_OAUTH_CALLBACK];

    NSString *baseString = [NSString stringWithFormat:@"%@/%@",FLICKR_API_BASE, @"oauth/request_token"];
    NSString *signature = [self getSignatureOf:baseString params:params withTokenScret:@""];

    [params setObject:signature forKey:KEY_OAUTH_SIGNATURE];

    NSString *urlString = [NSString stringWithFormat:@"%@?%@", baseString, [self convertDictionaryToUrlString:params withBaseUrl:baseString]];
    NSURL *URL = [NSURL URLWithString:urlString];

    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    NSMutableDictionary *param = [NSMutableDictionary new];

    [manager GET:URL.absoluteString
      parameters:param progress:nil
         success:^(NSURLSessionTask *task, id responseObject) {
             NSError *error = nil;
             NSString *responseString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];

             NSDictionary *params = [FlickrUtil parseURLResponse:responseString];
             if ([params count] < 1) {
                 error = [NSError errorWithDomain:ERROR_DOMAIN
                                             code:kCFErrorHTTPParseFailure
                                         userInfo:@{
                                                    NSLocalizedDescriptionKey: @"Unable to parse response",
                                                    @"response": responseString
                                                    }];
                 failure(error);
                 return;
             }

             if (params[KEY_OAUTH_CALLBACK_CONFIRMED]
                 && [params[KEY_OAUTH_CALLBACK_CONFIRMED] isEqualToString:@"true"]
                 && params[KEY_OAUTH_TOKEN]) {
                 _clientAuthToken = params[KEY_OAUTH_TOKEN];
                 _clientAuthTokenSecret = params[KEY_OAUTH_TOKEN_SECRET];
                 success(_clientAuthToken);
             } else {
                 error = [NSError errorWithDomain:ERROR_DOMAIN
                                             code:kCFErrorHTTPParseFailure
                                         userInfo:@{
                                                    NSLocalizedDescriptionKey: @"Unable to fetch oauth_token",
                                                    @"response": responseString
                                                    }];
                 failure(error);
             }

         } failure:^(NSURLSessionTask *operation, NSError *error) {
             failure(error);
         }];
}

// TODO: This method could be refactoring, all the same methods SNSDevice* have the common codes.
/*!
 Step 2. Getting the User Authorization using web view
        The web view using delegates authenticationSuccess: and authenticationFailure:
 */
- (void) addAuthenticationViews {
    UIViewController *parentVC = [self.delegate SNSWebAuthenticationRequired];

    NSString *frameworkBundleID = @"kr.carrotbooks.SNSServices";
    NSBundle *frameworkBundle = [NSBundle bundleWithIdentifier:frameworkBundleID];

    _webviewController = [[AuthenticationWVCFlickr alloc]
                          initWithNibName:@"AuthenticationWebViewController"
                          bundle:frameworkBundle];
    [_webviewController setDelegate:self];
    [_webviewController setAuthToken:_clientAuthToken permission:FLICKR_PERMISSION_WRITE andCallbackBase:_clientCallback];

    [parentVC addChildViewController:_webviewController];
    _webviewController.view.frame = parentVC.view.frame;

    [parentVC.view addSubview:_webviewController.view];
    [_webviewController didMoveToParentViewController:parentVC];
}

- (void) removeAuthenticationViews {
    [_webviewController.view removeFromSuperview];
    [_webviewController removeFromParentViewController];
    _webviewController = nil;
}

/*!
 Step 3. Exchanging the Request Token for an Access Token
 NOTE: Step 2. is done in webview. refer addAuthenticationViews
 */
-(void) requestAccessTokenWith:(NSString *)requestToken
                      verifier:(NSString *)oauthVerifier
                       success:(void (^)(NSDictionary *)) success
                       failure:(void (^)(NSError *)) failure
{
    NSMutableDictionary *params = [self createBaseParam];
    [params setObject:oauthVerifier forKey:KEY_OAUTH_VERIFIER];
    [params setObject:_clientAuthToken forKey:KEY_OAUTH_TOKEN];

    NSString *baseString = [NSString stringWithFormat:@"%@/%@",FLICKR_API_BASE, @"oauth/access_token"];
    NSString *signature = [self getSignatureOf:baseString params:params withTokenScret:_clientAuthTokenSecret];

    NSLog(@"Client auth token secret: %@", _clientAuthTokenSecret);
    [params setObject:signature forKey:KEY_OAUTH_SIGNATURE];

    NSString *urlString = [NSString stringWithFormat:@"%@?%@", baseString, [self convertDictionaryToUrlString:params withBaseUrl:baseString]];
    NSURL *URL = [NSURL URLWithString:urlString];

    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    NSMutableDictionary *param = [NSMutableDictionary new];

    [manager GET:URL.absoluteString
      parameters:param progress:nil
         success:^(NSURLSessionTask *task, id responseObject) {
             NSError *error = nil;
             NSString *responseString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];

             NSDictionary *params = [FlickrUtil parseURLResponse:responseString];

             NSLog(@"Response of access_token: %@", responseString);

             if ([params count] < 1) {
                 error = [NSError errorWithDomain:ERROR_DOMAIN
                                             code:kCFErrorHTTPParseFailure
                                         userInfo:@{
                                                    NSLocalizedDescriptionKey: @"Unable to parse response",
                                                    @"response": responseString
                                                    }];
                 failure(error);
                 return;
             }
             success(params);
         } failure:^(NSURLSessionTask *operation, NSError *error) {
             failure(error);
         }];
}

#pragma mark Authentication Delegate Methods
- (void) authenticationSuccess:(NSDictionary *)response {
    NSLog(@"Authentication succeeded: %@", response);

    [self removeAuthenticationViews];

    if (response.count < 1
        || !response[KEY_OAUTH_TOKEN]
        || !response[KEY_OAUTH_VERIFIER]) {
        NSError *error;
        error = [NSError errorWithDomain:ERROR_DOMAIN
                                    code:kCFURLErrorCannotParseResponse
                                userInfo:@{
                                           NSLocalizedDescriptionKey: @"Unable to fetch oauth_token",
                                           @"response": @""
                                           }];
        return;
    }

    [self requestAccessTokenWith:response[KEY_OAUTH_TOKEN]
                        verifier:response[KEY_OAUTH_VERIFIER]
                         success:^(NSDictionary *response) {
                             NSLog(@"Got access token: %@", response);
                             /* A sample response
                             {
                                 fullname = "Joohae%20Kim";
                                 "oauth_token" = "00000000000000000-0000000000000000";
                                 "oauth_token_secret" = 00000000000000000;
                                 "user_nsid" = "00000000000";
                                 username = "Joohae%20Kim";
                             }

                              Note: You may need to unescape
                              */
                             _accessToken = response[KEY_OAUTH_TOKEN_SECRET]; // access token for the case
                             _clientAuthToken = response[KEY_OAUTH_TOKEN];

                             dispatch_async(dispatch_get_main_queue(), ^{
                                 if (_accessToken) {
                                     // Save the access token
                                     NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
                                     [defaults setObject:_accessToken forKey:KEY_FLICKR_ACCESS_TOKEN];
                                     [defaults setObject:_clientAuthToken forKey:KEY_FLICKR_AUTH_TOKEN];

                                     // Call the delegate method
                                     [self.delegate SNSWebAuthenticationSuccess];
                                 }
                             });
                         } failure:^(NSError *error) {
                             dispatch_async(dispatch_get_main_queue(), ^{
                                 if (self.delegate && [self.delegate respondsToSelector:@selector(SNSWebAuthenticationFailed:)]) {
                                     [self.delegate SNSWebAuthenticationFailed:error];
                                 } else {
                                     @throw [NSException exceptionWithName:NSInternalInconsistencyException
                                                                    reason:@"Delegation undefined and an error raised"
                                                                  userInfo:@{
                                                                             NSLocalizedDescriptionKey: error.localizedDescription
                                                                             }];
                                 }
                             });
                             return;
                         }];
}

- (void) authenticationFailure:(NSError *)error {
    dispatch_async(dispatch_get_main_queue(), ^{
        [self removeAuthenticationViews];
        [self.delegate SNSWebAuthenticationFailed:error];
    });
}

#pragma mark Private methods
/*!
 Create a NSMutableDictionary of common parameters for request
 */
- (NSMutableDictionary *) createBaseParam {
    NSMutableDictionary *response = [NSMutableDictionary new];
    [response setObject:[FlickrUtil createNonce] forKey:KEY_OAUTH_NONCE];
    [response setObject:[[CryptoUtil sharedManager] getTimeStampString] forKey:KEY_OAUTH_TIMESTAMP];
    [response setObject:_clientKey forKey:KEY_OAUTH_CONSUMER_KEY];
    [response setObject:@"HMAC-SHA1" forKey:KEY_OAUTH_SIGNATURE_METHOD];
    [response setObject:@"1.0" forKey:KEY_OAUTH_VERSION];
    return response;
}

- (NSMutableDictionary *) createRequestParam {
    NSMutableDictionary *response = [self createBaseParam];
    [response setObject:_clientAuthToken forKey:KEY_OAUTH_TOKEN];
    [response setObject:@"1" forKey:@"nojsoncallback"];
    [response setObject:@"json" forKey:@"format"];
    return response;
}

/*!
 Convert Dictionary to URL String
 @param params      parameter dictionary
 @param baseUrl     url as a prefix of URL string
 */
- (NSString *) convertDictionaryToUrlString:(NSDictionary *)params withBaseUrl:(NSString *)baseUrl {
    NSString *response;
    NSMutableString *baseString = [NSMutableString new];

    NSArray *keys = [[params allKeys] sortedArrayUsingSelector:@selector(compare:)];
    for (NSString *key in keys) {
        [baseString appendFormat:@"%@=%@&", key, [params objectForKey:key]];
    }

    if ([baseString length] > 0) {
        response = [baseString substringToIndex:[baseString length] - 1];
    }

    return response;
}

/*!
 Calculate Flickr signature
 @param baseUrl     url as a prefix of URL string
 @param params      parameter dictionary
 @param tokenSecret token secret
 */
- (NSString *) getSignatureOf:(NSString *)baseUrl params:(NSDictionary *)params withTokenScret:(NSString *)tokenSecret {
    NSString *response;

    NSString *encodedUrl = [[CryptoUtil sharedManager] urlEncode:baseUrl];
    NSString *baseData   = [[CryptoUtil sharedManager] urlEncode:[self convertDictionaryToUrlString:params withBaseUrl:baseUrl]];

    response = [NSString stringWithFormat:@"GET&%@&%@", encodedUrl, baseData];
    response = [[CryptoUtil sharedManager] hmacsha1:response secret:[NSString stringWithFormat:@"%@&%@", _clientSecret, tokenSecret]];
    response = [[CryptoUtil sharedManager] urlEncode:response];

    return response;
}
@end


text:
using System.Web.Mvc;

namespace Owin04_OAuthServer.Controllers {

    public class TokenController : Controller {

        public ActionResult Index() {
            return new EmptyResult();
        }

    }
}


text:
var router    = require('express').Router()

// Render Index from jade
router.get('/', function (req, res) {
  res.render('index')
})

// Render Partial from the ':name' parameter
router.get('/partials/:name', function (req, res) {
  res.render('partials/'+req.params.name)
})

router.get('/', function (req, res) {
	res.sendFile('./docs/index.html')
})

module.exports = router


text:
package gov.va.med.lom.avs.client.model;

import java.io.Serializable;

public class ClinicVisitedJson implements Serializable {

    private String date;
    private String time;
    private String clinic;
    private String provider;
    private String site;

    public String getClinic() {
      return clinic;
    }
    public void setClinic(String clinic) {
      this.clinic = clinic;
    }
    public String getProvider() {
      return provider;
    }
    public void setProvider(String provider) {
      this.provider = provider;
    }
    public String getDate() {
      return date;
    }
    public void setDate(String date) {
      this.date = date;
    }
    public String getTime() {
      return time;
    }
    public void setTime(String time) {
      this.time = time;
    }
    public String getSite() {
      return site;
    }
    public void setSite(String site) {
      this.site = site;
    }

}


text:
import Slate from 'slate'
import { Paragraph } from './Paragraph'
import getStyleData from '../utility/getStyleData'
import renderStyled from '../utility/renderStyled'
import { insertAfterAndMoveTo, insertBefore, insertBeforeAndMoveTo } from '../utility/insertAdjacent'

function onDelete(transform, event, state) {
  const hr = state.startBlock
  let sibling = state.document.getPreviousSibling(hr.key) ||
                state.document.getNextSibling(hr.key)

  let t = transform

  if (!sibling) {
    sibling = Paragraph.create()
    t = insertBefore(t, sibling, hr)
  }

  /* eslint-disable indent */
  return t.collapseToEndOf(sibling)
          .removeNodeByKey(hr.key)
          .apply()
  /* eslint-enable indent */
}
function onDown(transform, event, state) {
  const hr = state.startBlock
  const sibling = state.document.getNextSibling(hr.key)
  if (sibling) return undefined

  return insertAfterAndMoveTo(transform, Paragraph.create(), hr).apply()
}
function onUp(transform, event, state) {
  const hr = state.startBlock
  const sibling = state.document.getPreviousSibling(hr.key)
  if (sibling) return undefined

  return insertBeforeAndMoveTo(transform, Paragraph.create(), hr).apply()
}

export default {
  create() {
    return Slate.Block.create({ type: 'hr' })
  },

  schema: {
    nodes: {
      hr: ({ node }) => (
        renderStyled('hr', { data: node.data })
      ),
    },
  },

  serializers: [{
    deserialize(el) {
      if (el.tagName !== 'hr') return undefined
      return {
        kind:   'block',
        type:   'hr',
        data:   getStyleData(el),
        isVoid: true,
      }
    },
    serialize(object) {
      if (object.type !== 'hr') return undefined
      return renderStyled('hr', object.data)
    },
  }],

  onKeyDown: (event, data, state) => {
    if (state.startBlock.type !== 'hr') return undefined

    switch (data.key) {
      case 'backspace':
      case 'delete':
        return onDelete(state.transform(), event, state)
      case 'down':
        return onDown(state.transform(), event, state)
      case 'up':
        return onUp(state.transform(), event, state)
      default:
        return undefined
    }
  },
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model.HHZX;
using Model.HHZX.UserInfomation.CardUserInfo;

namespace DAL.IDAL.HHZX.UserInformation.CardUserInfo
{
    public interface IDepartmentMasterDA : IMainGeneralDA<DepartmentMaster_dpm_Info>
    {
    }
}


text:
<?php
use app\models\Post;
use app\helpers\Constants;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\helpers\ArrayHelper;
use app\helpers\Help;

/* @var $this \yii\web\View */
/* @var $user \app\models\User; */
/* @var $controller \app\controllers\MainController */
/* @var $posts \app\models\Post[] */
/* @var $comments \app\models\Comment[] */
/* @var $carouselPosts \app\models\Post[] */
/* @var $pages \yii\data\Pagination */
/* @var $type string */
/* @var $materialCount int */
/* @var $postCount int */

$controller = $this->context;
?>

                <?= $this->render('/common/_banners',['banners' => ArrayHelper::getValue($controller->banners,'TOP_BANNER')]); ?>

    <div id="owlTop" data-current-page="1" data-loading="<?= Url::to(['main/category-ajax','carousel' => 1]); ?>">
        <?= $this->render('/common/_carousel',['posts' => $carouselPosts]); ?>

                <?= $this->render('/common/_main_menu',[
                    'categories' => $controller->mainMenu,
                    'active' => null
                ]); ?>

Записи участника: <?= $user->name.' '.$user->surname; ?>

                        <a href="<?= Url::to(['main/profile','id' => $user->id]); ?>">Вернуться к профилю Показать
                        <select name="type" data-reloading-select="<?= Url::to(['main/profile-details','id' => $user->id]); ?>" class="ui-select">
                            <option <?= $type == 'posts' ? 'selected' : ''; ?> value="posts">Посты</option>
                            <option <?= $type == 'materials' ? 'selected' : ''; ?> value="materials">Материалы</option>
                            <option <?= $type == 'comments' ? 'selected' : ''; ?> value="comments">Комментарии</option>
                        </select>

                    <?php if(!empty($posts)): ?>
                        <?php foreach ($posts as $post): ?>

                                    <a href="<?= $post->getUrl(); ?>">
                                        <img class="img-fluid" src="<?= $post->getThumbnailUrl(484,276); ?>">

                                <?= $post->trl->name; ?>

<a class="content__card__title hidden-xs-down" href="<?= $post->getUrl(); ?>"><?= $post->trl->name; ?>

<?= $post->trl->small_text; ?>

                                        <?php if(!empty($post->author)): ?>
                                            <a href="<?= Url::to(['main/profile','id'=> $post->author_id]); ?>">
                                                <?= $post->author->name.' '.$post->author->surname; ?>

                                        <?php else: ?>
                                            <?= $post->author_custom_name; ?>
                                        <?php endif; ?>
                                         • <?= Help::datefmt($post->delayed_at); ?>

                                        <?php if($post->comment_count > 0): ?>

                                                <?= $post->comment_count; ?>

                                        <?php endif; ?>

                        <?php endforeach; ?>
                    <?php elseif ($type != 'comments'): ?>

Ничего не найдено

                    <?php endif;?>

                    <?php if(!empty($comments)): ?>

                                <?= $this->render('_load_comments',['comments' => $comments, 'viewOnly' => true, 'timeLine' => true]); ?>

                    <?php elseif ($type == 'comments'): ?>

Ничего не найдено

                    <?php endif;?>

                    <?= LinkPager::widget([
                        'pagination' => $pages,
                        'nextPageLabel' => '',
                        'nextPageCssClass' => 'last',
                        'prevPageLabel' => '',
                        'prevPageCssClass' => 'last',
                        'maxButtonCount' => 5
                    ]); ?>

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'CURRENCY')
                        ]); ?>

Погода в Турции

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'WEATHER')
                        ]); ?>

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'TOP_RIGHT_1')
                        ]); ?>

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'TOP_RIGHT_2')
                        ]); ?>

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'BOTTOM_RIGHT_1')
                        ]); ?>

                        <?= $this->render('/common/_banners',[
                            'imgAttributes' => ['class' => 'img-fluid'],
                            'banners' => ArrayHelper::getValue($controller->banners,'BOTTOM_RIGHT_2')
                        ]); ?>


text:
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Group Chat</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="description" content="NG6-Starter by @AngularClass">
    <link rel="icon" href="data:;base64,iVBORw0KGgo=">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <base href="/">
  </head>
  <body ng-app="app" ng-strict-di ng-cloak>

    <app>
      Loading...
    </app>
    <script>
      function onVidyoClientLoaded(status) {
        switch (status.state) {
          case "READY":
            var event = new CustomEvent('vidyoclient:ready', {detail: VC});
            document.dispatchEvent(event);
            break;
          case "RETRYING":     // The library operating is temporarily paused
            break;
          case "FAILED":       // The library operating has stopped
            break;
          case "FAILEDVERSION":
            break;
          case "NOTAVAILABLE": // The library is not available
            break;
        }

        return true; // Return true to reload the plugins if not available
      }
    </script>
  </body>
</html>


text:
package org.apache.catalina.ant.jmx;

/**
 *
 * @author Peter Rossbach
 * @since 5.5.10
 */
public class Arg {
    /**
     * @deprecated  Use getter/setter
     */
    @Deprecated
    String type;
    /**
     * @deprecated  Use getter/setter
     */
    @Deprecated
    String value;

    public void setType( String type) {
        this.type=type;
    }
    public void setValue( String value ) {
        this.value=value;
    }
    /**
     * @deprecated  Use {@link #setValue(String)}
     */
    @Deprecated
    public void addText( String text ) {
        this.value=text;
    }

    public String getValue() {
        return value;
    }

    public String getType() {
        return type;
    }
}


text:
import maya.cmds as cmds
import maya.mel
import maya.OpenMaya

import IECore
import IECoreMaya

## Base class for objects which are able to create an Attribute Editor widget for a single IECore.Parameter
# held on an IECoreMaya.ParameterisedHolder node.
# \todo Separate control drawing from labelling and layout, so these classes just create the right
# hand side of what they're doing at the moment. Then we can use them in different layouts like spreadsheets
# and wotnot.
class ParameterUI( IECoreMaya.UIElement ) :

	textColumnWidthIndex = 145
	singleWidgetWidthIndex = 70
	sliderWidgetWidthIndex = 2 * 70

	handlers = {}

	## The parameterisedHolderNode is an MObject specifying the node holding the specified IECore.Parameter.
	# Derived class __init__ implementations must create a layout to hold all their contents and pass this
	# in the topLevelUI parameter (as for all UIElement derived classes).
	# \todo Document the meaning of the various keyword arguments - perhaps the names of these should be
	# prefixed with the name of the class which implements each argument so as to make it easier to find
	# the documentation too.
	def __init__( self, parameterisedHolderNode, parameter, topLevelUI, **kw ) :

		IECoreMaya.UIElement.__init__( self, topLevelUI )

		self.__node = maya.OpenMaya.MObjectHandle( parameterisedHolderNode )
		self.parameter = parameter #IECore.Parameter

		self.__labelWithNodeName = kw.get( "labelWithNodeName", False )
		self.__longParameterName = kw.get( "longParameterName", parameter.name )

	## Derived classes should override this method. The override should first call the base class method and
	# then reconnect all created widgets to the new node/parameter. The node and parameter arguments are as
	# for the __init__ function.
	def replace( self, node, parameter ) :

		self.__node = maya.OpenMaya.MObjectHandle( node )
		self.parameter = parameter

	## Returns the Maya node associated with this UI in the form of an OpenMaya.MObject
	def node( self ) :

		if not self.__node.isValid() :
			raise RuntimeError, "IECoreMaya.ParameterUI.node(): The requested node is not valid"

		return self.__node.object()

	## Returns an umambiguous full path for the Maya node associated with this UI.
	def nodeName( self ) :

		fnPH = IECoreMaya.FnParameterisedHolder( self.node() )
		return fnPH.fullPathName()

	## Returns the Maya plug associated with this UI in the form an OpenMaya.MPlug
	def plug( self ) :

		fnPH = IECoreMaya.FnParameterisedHolder( self.node() )
		return fnPH.parameterPlug( self.parameter )

	## Returns an unambiguous full path to the plug this ui represents.
	def plugName( self ) :

		fnPH = IECoreMaya.FnParameterisedHolder( self.node() )
		plug = fnPH.parameterPlug( self.parameter )
		return str( fnPH.fullPathName() + "." + plug.partialName() )

	def layout( self ) :

		return self._topLevelUI()

	## Computes a nice label for the ui.
	def label( self ):

		if self.__labelWithNodeName :

			n = self.nodeName() + "." + self.__longParameterName
			if not self.__longParameterName :
				# Top-level parameter comes through into here without a name
				n = self.nodeName() + ".parameters"

			return maya.mel.eval( "interToUI(\"" + n + "\")" )

		else :

			return maya.mel.eval( "interToUI(\"" + self.parameter.name + "\")" )

	## Computes a wrapped annotation/tooltip for the ui
	def description( self ):

		extended = "%s\n\n%s" % ( self.plugName().split(".")[1], self.parameter.description )
		return IECore.StringUtil.wrap( extended, 48 )

	@staticmethod
	def _defaultDragCallback( dragControl, x, y, modifiers, **kw ):

		# Pass the dictionary of arguments as a string so that it can be captured and eval'ed in the drop callback
		return [ 'ParameterUI', repr( kw ) ]

	def addDragCallback( self, ctrl, **kw ) :

		maya.cmds.control(
			ctrl,
			edit = True,
			dragCallback = IECore.curry( ParameterUI._defaultDragCallback, nodeName = self.nodeName(), layoutName = self.layout(), **kw )
		)

	## Can be called by derived classes to add a useful popup menu to the specified ui element. This
	# will replace any existing popup menus that are already there.
	## \todo Understand and document the available keyword arguments. I think the only one is "attributeName",
	# which is used to allow the name of specific elements of compound plugs to be specified to improve the box
	# and vector uis. That needs rethinking in any case, as we shouldn't be storing attribute names anywhere as it
	# makes us vulnerable to the names changing behind our backs.
	def _addPopupMenu( self, parentUI, **kw ) :

		existingMenus = maya.cmds.control( parentUI, query=True, popupMenuArray=True )
		if existingMenus :
			for m in existingMenus :
				maya.cmds.deleteUI( m, menu=True )

		IECoreMaya.Menu( definition = IECore.curry( self.__popupMenuDefinition, **kw ), parent = parentUI )

		if "button1" in kw and kw["button1"] :
			IECoreMaya.Menu( definition = IECore.curry( self.__popupMenuDefinition, **kw ), parent = parentUI, button = 1 )

	## Returns an IECore.MenuDefinition used to create a popup menu for the ParameterUI. This may
	# be overridden by derived classes to add their own menu items. In this case they should first
	# call the base class implementation before adding their items to the result.
	def _popupMenuDefinition( self, **kw ) :

		definition = IECore.MenuDefinition()

		if cmds.getAttr( kw['attributeName'], lock = True) == 0:

			settable = maya.cmds.getAttr( kw["attributeName"], settable=True )
			if settable :

				# make menu items for all presets and for the default value

				for k in self.parameter.presetNames() :
					definition.append( "/" + k, { "command" : IECore.curry( self.__selectValue, selection = k ) } )

				if len( self.parameter.presetNames() ) > 0 :
					definition.append( "/PresetDivider", { "divider" : True } )

				definition.append( "/Default", { "command" : IECore.curry( self.__selectValue, selection = self.parameter.defaultValue ) } )

				definition.append( "/ValueDivider", { "divider" : True } )

			attrType = cmds.getAttr( kw["attributeName"], type=True )
			if attrType in ( "float", "long" ) :

				if cmds.getAttr( kw['attributeName'], keyable=True) and settable :
					definition.append( "/Set Key", { "command" : IECore.curry( self.__setKey, **kw ) } )

				expressions = cmds.listConnections(
					kw['attributeName'],
					d = False,
					s = True,
					type = "expression"
				)

				if not expressions :

					hasConnections = self.__appendConnectionMenuDefinitions( definition, **kw )
					if not hasConnections and settable :
						definition.append( "/Create New Expression...", { "command" : IECore.curry( self.__expressionEditor, **kw ) } )

				else:

					definition.append( "/Edit Expression...", { "command" : IECore.curry( self.__expressionEditor, **kw ) } )
					definition.append( "/Delete Expression", { "command" : IECore.curry( self.__deleteNode, nodeName = expressions[0] ) } )

			else :

				self.__appendConnectionMenuDefinitions( definition, **kw )

			definition.append( "/ConnectionDivider", { "divider" : True } )

			definition.append( "/Lock Attribute", { "command" : IECore.curry( self.__lock, **kw ) } )

		else :

			definition.append( "/Unlock Attribute", { "command" : IECore.curry( self.__unlock, **kw ) } )

		return definition

	def __appendConnectionMenuDefinitions( self, definition, **kw ) :

		connections = cmds.listConnections(
			kw['attributeName'],
			d = False,
			s = True,
			plugs = True,
			connections = True,
			skipConversionNodes = True
		)

		definition.append( "/Connection Editor...", { "command" : IECore.curry( self.__connectionEditor ) } )

		if connections :

			definition.append( "/Open AE...",
				{ "command" : IECore.curry( self.__showEditor, attributeName = connections[1] ) }
			)

			definition.append( "/Break Connection",
				{
					"command" : IECore.curry(
						self.__disconnect,
						source = connections[1],
						destination = connections[0],
						refreshAE = self.nodeName()
					)
				}
			)

			return True

		else:

			return False

	def __popupMenuDefinition( self, **kw ) :

		# call the protected function which can be overridden by
		# derived classes. then let the callbacks do what they want.
		definition = self._popupMenuDefinition( **kw )
		for cb in self.__popupMenuCallbacks :
			cb( definition, self.parameter, self.node() )

		return definition

	def __showEditor( self, attributeName ) :

		split = attributeName.split('.', 1 )
		node = split[0]

		melCmd = 'showEditor "' + node + '"'

		maya.mel.eval( melCmd.encode('ascii') )

	def __deleteNode( self, nodeName = None ) :

		cmds.delete( nodeName )

	def __expressionEditor( self, attributeName = None ) :

		split = attributeName.split('.', 1 )
		node = split[0]
		attr = split[1]

		melCmd = 'expressionEditor EE "' + node + '" "' + attr + '"'

		maya.mel.eval( melCmd.encode('ascii') )

	def __connectionEditor( self ) :

		maya.mel.eval(
				str("ConnectionEditor;"+
				"nodeOutliner -e -replace %(right)s connectWindow|tl|cwForm|connectWindowPane|rightSideCW;"+
				"connectWindowSetRightLabel %(right)s;") % { 'right' : self.nodeName() } )

	def __disconnect( self, source = None, destination = None, refreshAE = None ) :

		cmds.disconnectAttr( source, destination )

		if refreshAE :
			maya.mel.eval( 'evalDeferred( "updateAE %s;")' % refreshAE )

	def __setKey( self, **kw ):

		cmds.setKeyframe(
			kw['attributeName']
		)

	def __lock( self, **kw ):

		cmds.setAttr(
			kw['attributeName'],
			lock = True
		)

	def __unlock( self, **kw  ):

		cmds.setAttr(
			kw['attributeName'],
			lock = False
		)

	def __selectValue( self, selection = None):

		self.parameter.setValue( selection )
		IECoreMaya.FnParameterisedHolder( self.node() ).setNodeValue( self.parameter )

	@staticmethod
	def registerUI( parameterTypeId, handlerType, uiTypeHint = None ):

		key = (parameterTypeId, uiTypeHint)
		if key in ParameterUI.handlers :
			IECore.msg( IECore.Msg.Level.Warning, "ParameterUI.registerUI", "Handler for %s already registered." % str( key ) )

		ParameterUI.handlers[key] = handlerType

	## Returns a new ParameterUI instance suitable for representing
	# the specified parameter on the specified parameterisedHolderNode.
	# The node may either be specified as an OpenMaya.MObject or as
	# a string or unicode object representing the node name.
	@staticmethod
	def create( parameterisedHolderNode, parameter, **kw ) :

		if not isinstance( parameterisedHolderNode, maya.OpenMaya.MObject ) :
			parameterisedHolderNode = IECoreMaya.StringUtil.dependencyNodeFromString( parameterisedHolderNode )

		if not parameter.isInstanceOf( IECore.Parameter.staticTypeId() ) :
			raise TypeError( "Parameter argument must derive from IECore.Parameter." )

		if parameter.presetsOnly and len( parameter.getPresets() ) :
			return IECoreMaya.PresetsOnlyParameterUI( parameterisedHolderNode, parameter, **kw )

		uiTypeHint = None
		try:
			uiTypeHint = parameter.userData()['UI']['typeHint'].value
		except:
			pass

		handlerType = None
		typeId = parameter.typeId()
		while typeId!=IECore.TypeId.Invalid :
			handlerType = ParameterUI.handlers.get( ( typeId, uiTypeHint ), None )
			if handlerType is not None :
				break
			handlerType = ParameterUI.handlers.get( ( typeId, None ), None )
			if handlerType is not None :
				break
			typeId = IECore.RunTimeTyped.baseTypeId( typeId )

		if handlerType is None :
			IECore.msg( IECore.Msg.Level.Warning, "ParameterUI.create", "No UI registered for parameters of type \"%s\"" % parameter.typeName() )
			return None

		if 'longParameterName' in kw and len( kw['longParameterName'] ) :
			kw['longParameterName'] += "." + parameter.name
		else :
			kw['longParameterName'] = parameter.name

		parameterUI = handlerType( parameterisedHolderNode, parameter, **kw )

		return parameterUI

	__popupMenuCallbacks = []
	## Registers a callback which is able to modify the popup menus associated
	# with ParameterUIs. The callback should have the following signature :
	#
	# callback( menuDefinition, parameter, holderNode ).
	@classmethod
	def registerPopupMenuCallback( cls, callback ) :

		cls.__popupMenuCallbacks.append( callback )


text:
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
import { Subscription } from 'rxjs';

import { Angulartics2 } from 'angulartics2';

import { UserService } from 'app/shared/services/api';
import { ErrorHandlerService } from 'app/shared/interceptors/error-handler.service';
import { IUser } from 'app/model';
import { SEOService } from 'app/shared/services/seo.service';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit, OnDestroy {
  loginForm: FormGroup;
  _redirectTo = '/';
  get redirectTo() { return this._redirectTo; }
  set redirectTo(value) {
    this._redirectTo = (value === '/login' ? '/' : value);
  }
  queryParamsSubscription: Subscription;

  constructor(
    private fb: FormBuilder,
    private router: Router,
    private route: ActivatedRoute,
    private userService: UserService,
    private errorHandler: ErrorHandlerService,
    private meta: SEOService,
    private angulartics: Angulartics2
  ) { }

  ngOnInit() {
    this.meta.setTitle('Login', `Login to increase your privileges in the system`);
    const me = this;
    me.loginForm = me.fb.group({
      username: ['', [Validators.required]],
      password: ['', [Validators.required]]
    });
    me.queryParamsSubscription = me.route.queryParams.subscribe(params => {
      if (params.u) {
        me.redirectTo = decodeURIComponent(params.u);
      }
    });
  }

  ngOnDestroy() {
    this.queryParamsSubscription.unsubscribe();
  }

  login() {
    this.userService.login(this.loginForm.value).subscribe(
      (result: IUser) => {
        this.angulartics.eventTrack.next({ action: 'login', properties: { category: 'auth', label: 'login', value: result.name } });
        this.router.navigate([this.redirectTo]);
      },
      error => this.errorHandler.setError('Wrong username or password')
    );
  }
}