text:
<!doctype html>

  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Buffer (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <meta charset="utf8">

      Closure Library API Documentation

        Go to class or file:
        <input type="text" id="ac">

        format.HtmlPrettyPrinter.Buffer
        Extends

            Object

    This class is a buffer to which we push our output. It tracks line breaks to
make sure we don't add unnecessary ones.

Useful links

Source Code

Inheritance

Object
     goog.format.HtmlPrettyPrinter.Buffer

Constructor

    goog.format.HtmlPrettyPrinter.Buffer()

Instance Methods

        Public
        Protected
        Private

         Defined in

              goog.format.HtmlPrettyPrinter.Buffer

        lineBreak()

       No description.

     code »

        pushToken(breakBefore, token, breakAfter)

       Adds token and necessary line breaks to output buffer.

    <! -- Method details -->

        Arguments:

        breakBefore
        :
boolean

If true, add line break before token if necessary.

        token
        :
string

Token to push.

        breakAfter
        :
boolean

If true, add line break after token if necessary.

     code »

        toString()

        ⇒
string

       No description.

    <! -- Method details -->

        Returns:
string

            String representation of tokens.

     code »

Instance Properties

         Defined in

              goog.format.HtmlPrettyPrinter.Buffer

        breakCount
        :
number

       Tracks number of line breaks added.

     Code »

        isBeginningOfNewLine_
        :
boolean

       Tracks if we are at the start of a new line.

     Code »

        needsNewLine_
        :
boolean

       Tracks if we need a new line before the next token.

     Code »

Package format

Package Reference


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="100dp"
    android:layout_height="150dp"
    android:background="#000000"
    android:alpha="0.8"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/more_ly"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:background="@drawable/more_menu_bg"
        android:text="留    言"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/more_sx"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:text="私    信"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/more_dx"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:text="短    信"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/more_dh"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:text="电    话"
        android:textSize="18sp" />

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
warning: 'This file is auto generated by `npm run web:inject`, do not edit by hand'
examples:
  - 'strspn(''42 is the answer, what is the question ...'', ''1234567890'')'
  - 'strspn(''foo'', ''o'', 1, 2)'
estarget: es5
returns:
  - '2'
  - '2'
dependencies: []
authors:
  original by:
    - Valentina De Rosa
  improved by:
    - 'Brett Zamir (https://brett-zamir.me)'
notes: []
type: function
layout: function
title: PHP's strspn in JavaScript
description: >-
  Here's what our current JavaScript equivalent to PHP's strspn looks
  like.
function: strspn
category: strings
language: php
permalink: php/strings/strspn/
alias:
  - /functions/php/strspn/
  - /functions/strings/strspn/
  - /php/strspn/
  - /functions/strspn/
---
{% codeblock lang:javascript %}module.exports = function strspn (str1, str2, start, lgth) {
  //  discuss at: https://locutus.io/php/strspn/
  // original by: Valentina De Rosa
  // improved by: Brett Zamir (https://brett-zamir.me)
  //   example 1: strspn('42 is the answer, what is the question ...', '1234567890')
  //   returns 1: 2
  //   example 2: strspn('foo', 'o', 1, 2)
  //   returns 2: 2

  var found
  var stri
  var strj
  var j = 0
  var i = 0

  start = start ? (start < 0 ? (str1.length + start) : start) : 0
  lgth = lgth ? ((lgth < 0) ? (str1.length + lgth - start) : lgth) : str1.length - start
  str1 = str1.substr(start, lgth)

  for (i = 0; i < str1.length; i++) {
    found = 0
    stri = str1.substring(i, i + 1)
    for (j = 0; j <= str2.length; j++) {
      strj = str2.substring(j, j + 1)
      if (stri === strj) {
        found = 1
        break
      }
    }
    if (found !== 1) {
      return i
    }
  }

  return i
}
{% endcodeblock %}


text:
namespace Figlut.Server.Toolkit.Data
{
    #region Using Directives

    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Text;
    using System.Collections;
    using System.IO;
    using System.Reflection;
    using System.Data;
    using Figlut.Server.Toolkit.Data.CSV;
    using Figlut.Server.Toolkit.Utilities;
    using Figlut.Server.Toolkit.Utilities.Serialization;

    #endregion //Using Directives

    public class EntityCache : IEnumerable
    {
        #region Constructors

        public EntityCache(Type entityType)
        {
            Type type = this.GetType();
            _name = DataShaper.ShapeCamelCaseString(type.Name);
            _defaultFilePath = Path.Combine(Information.GetExecutingDirectory(), string.Format("{0}.xml", type.Name));
            _entityType = entityType;

            _entities = new List<object>();
            _addedEntities = new List<object>();
            _deletedEntities = new List<object>();
        }

        public EntityCache(string name, string defaultFilePath, Type entityType)
        {
            _name = name;
            _defaultFilePath = defaultFilePath;
            _entityType = entityType;

            _entities = new List<object>();
            _addedEntities = new List<object>();
            _deletedEntities = new List<object>();
        }

        #endregion //Constructors

        #region Fields

        protected string _name;
        protected string _defaultFilePath;
        protected List<object> _entities;
        protected List<object> _addedEntities;
        protected List<object> _deletedEntities;
        protected Type _entityType;

        #endregion //Fields

        #region Properties

        public string Name
        {
            get { return _name; }
        }

        public string DefaultFilePath
        {
            get { return _defaultFilePath; }
        }

        public List<object> AddedEntities
        {
            get { return _addedEntities; }
        }

        public List<object> DeletedEntities
        {
            get { return _deletedEntities; }
        }

        public int Count
        {
            get { return _entities.Count; }
        }

        #endregion //Properties

        #region Indexers Region

        public object this[int index]
        {
            get
            {
                if (index >= _entities.Count)
                {
                    return null;
                }
                return _entities[index];
            }
        }

        #endregion //Indexers Region

        #region Methods

        private void ValidateEntityType(object e)
        {
            if (e.GetType() != _entityType)
            {
                throw new ArgumentException(string.Format(
                    "Expected entity of type {0} and received entity of type.",
                    _entityType.FullName,
                    e.GetType().FullName));
            }
        }

        public virtual void OverrideFromList(IList entities)
        {
            List<object> result = new List<object>();
            foreach (object e in entities)
            {
                ValidateEntityType(e);
                result.Add(e);
            }
            Clear();
            _entities = null;
            _entities = result;
        }

        public virtual void OverrideFromDataTable(DataTable table)
        {
            List<object> result = new List<object>();
            foreach (DataRow row in table.Rows)
            {
                object e = EntityReader.PopulateFromDataRow(Activator.CreateInstance(_entityType), row);
                result.Add(e);
            }
            Clear();
            _entities = null;
            _entities = result;
        }

        public virtual void Add(object e)
        {
            ValidateEntityType(e);
            _entities.Add(e);
            _addedEntities.Add(e);
        }

        public virtual void Delete(object e)
        {
            if (!_entities.Contains(e))
            {
                throw new NullReferenceException(string.Format(
                    "Could not find entity {0} of type {1} in this collection to be deleted.",
                    e.ToString(),
                    e.GetType().FullName));
            }
            _entities.Remove(e);
            if (_addedEntities.Contains(e))
            {
                _addedEntities.Remove(e);
            }
            else
            {
                _deletedEntities.Add(e);
            }
        }

        public virtual bool Exists(object e)
        {
            return _entities.Contains(e);
        }

        public virtual void Clear()
        {
            _entities.Clear();
            _addedEntities.Clear();
            _deletedEntities.Clear();
            GC.Collect();
        }

        public virtual object GetEntityByProperty(string propertyName, object propertyValue, bool exactMatch)
        {
            Dictionary<string, object> properties = new Dictionary<string, object>();
            properties.Add(propertyName, propertyValue);
            List<object> result = GetEntitiesByProperties(properties, exactMatch);
            return result.Count < 1 ? null : result[0];
        }

        public virtual List<object> GetEntitiesByProperties(Dictionary<string, object> properties, bool exactMatch)
        {
            List<object> result = new List<object>();
            if (properties == null) //Return all the items.
            {
                _entities.ForEach(p => result.Add(p));
                return result;
            }
            List<PropertyInfo> propertyList = new List<PropertyInfo>();
            foreach (string propertyName in properties.Keys)
            {
                PropertyInfo p = _entityType.GetProperty(propertyName);
                if (p == null)
                {
                    throw new NullReferenceException(string.Format(
                        "Could not find property with name {0} on entity type {1}.",
                        propertyName,
                        _entityType.FullName));
                }
                propertyList.Add(p);
            }
            if (exactMatch)
            {
                foreach (object e in _entities)
                {
                    bool include = true;
                    foreach (PropertyInfo p in propertyList)
                    {
                        object entityProvidedValue = p.GetValue(e, null);
                        object providedPropertyValue = properties[p.Name];
                        if (entityProvidedValue == null)
                        {
                            if (providedPropertyValue == null)
                            {
                                continue;
                            }
                            else
                            {
                                include = false;
                                break;
                            }
                        }
                        if (!entityProvidedValue.Equals(providedPropertyValue))
                        {
                            include = false;
                            break;
                        }
                    }
                    if (include)
                    {
                        result.Add(e);
                    }
                }
            }
            else
            {
                foreach (object e in _entities)
                {
                    bool include = true;
                    foreach (PropertyInfo p in propertyList)
                    {
                        object entityProvidedValue = p.GetValue(e, null);
                        object providedPropertyValue = properties[p.Name];
                        if (entityProvidedValue == null)
                        {
                            if (providedPropertyValue == null)
                            {
                                continue;
                            }
                            else
                            {
                                include = false;
                                break;
                            }
                        }
                        if (p.PropertyType == typeof(string)) //String (contains) comparison only on strings.
                        {
                            string entityValueStr = entityProvidedValue == null ? string.Empty : entityProvidedValue.ToString().ToLower();
                            if (!entityValueStr.Contains(providedPropertyValue.ToString().ToLower()))
                            {
                                include = false;
                                break;
                            }
                        }
                        else //Object comparison on anything else
                        {
                            if (!entityProvidedValue.Equals(providedPropertyValue))
                            {
                                include = false;
                                break;
                            }
                        }
                    }
                    if (include)
                    {
                        result.Add(e);
                    }
                }
            }
            return result;
        }

        public virtual List<object> GetEntitiesByWildCardSearch(object wildCardSearchValue, bool exactMatch)
        {
            List<object> result = new List<object>();
            if (wildCardSearchValue == null ||
                (wildCardSearchValue.GetType() == typeof(string) && string.IsNullOrEmpty(wildCardSearchValue.ToString()))) //Return all the items.
            {
                _entities.ForEach(p => result.Add(p));
                return result;
            }
            string wildCardSearchValueLower = wildCardSearchValue.ToString().ToLower();
            List<PropertyInfo> propertyList = _entityType.GetProperties().ToList();
            if (exactMatch)
            {
                foreach (object e in _entities)
                {
                    bool include = false;
                    foreach (PropertyInfo p in propertyList)
                    {
                        object entityProvidedValue = p.GetValue(e, null);
                        if (entityProvidedValue.Equals(wildCardSearchValue))
                        {
                            include = true;
                            break;
                        }
                    }
                    if (include)
                    {
                        result.Add(e);
                    }
                }
            }
            else
            {
                foreach (object e in _entities)
                {
                    bool include = false;
                    foreach (PropertyInfo p in propertyList)
                    {
                        object entityProvidedValue = p.GetValue(e, null);
                        if (p.PropertyType == typeof(string)) //String (contains) comparison only on strings.
                        {
                            string entityValueStr = entityProvidedValue == null ? string.Empty : entityProvidedValue.ToString().ToLower();
                            if (entityValueStr.Contains(wildCardSearchValueLower))
                            {
                                include = true;
                                break;
                            }
                        }
                        else if(entityProvidedValue != null) //Object comparison on anything else
                        {
                            if (entityProvidedValue.Equals(wildCardSearchValue))
                            {
                                include = true;
                                break;
                            }
                        }
                    }
                    if (include)
                    {
                        result.Add(e);
                    }
                }
            }
            return result;
        }

        public virtual bool PropertyValueExists(string propertyName, object propertyValue)
        {
            PropertyInfo p = _entityType.GetProperty(propertyName);
            if (p == null)
            {
                throw new NullReferenceException(string.Format(
                    "Could not find property with name {0} on entity type {1}.",
                    propertyName,
                    _entityType.FullName));
            }
            foreach (object e in _entities)
            {
                object value = p.GetValue(e, null);
                if (propertyValue.Equals(value))
                {
                    return true;
                }
            }
            return false;
        }

        public virtual DataTable GetDataTable(Dictionary<string, object> properties, bool exactMatch, bool shapeColumnNames)
        {
            DataTable result = EntityReader.GetDataTable(shapeColumnNames, _entityType);
            List<object> entities = GetEntitiesByProperties(properties, exactMatch);
            foreach (object e in entities)
            {
                DataRow row = EntityReader.PopulateDataRow(e, result.NewRow(), shapeColumnNames, _entityType);
                result.Rows.Add(row);
            }
            return result;
        }

        public virtual DataTable GetDataTable(object wildCardSearchValue, bool exactMatch, bool shapeColumnNames)
        {
            DataTable result = EntityReader.GetDataTable(shapeColumnNames, _entityType);
            List<object> entities = GetEntitiesByWildCardSearch(wildCardSearchValue, exactMatch);
            foreach (object e in entities)
            {
                DataRow row = EntityReader.PopulateDataRow(e, result.NewRow(), shapeColumnNames, _entityType);
                result.Rows.Add(row);
            }
            return result;
        }

        public virtual List<object> DataTableToList(DataTable table)
        {
            List<object> result = new List<object>();
            foreach (DataRow row in table.Rows)
            {
                object e = EntityReader.PopulateFromDataRow(Activator.CreateInstance(_entityType), row);
                result.Add(e);
            }
            return result;
        }

        public virtual void ExportToCsv(
            string filePath,
            Dictionary<string, object> properties,
            bool exactMatch,
            bool shapeColumnNames)
        {
            CsvWriter.WriteToFile(
                GetDataTable(properties, exactMatch, shapeColumnNames),
                true,
                true,
                filePath,
                null);
        }

        public virtual StringWriter ExportToStringWriter(
            Dictionary<string, object> properties,
            bool exactMatch,
            bool shapeColumnNames)
        {
            StringWriter result = new StringWriter();
            CsvWriter.WriteToStream(
                result,
                GetDataTable(properties, exactMatch, shapeColumnNames),
                true,
                true,
                null);
            return result;
        }

        public virtual MemoryStream ExportToStream(
            Dictionary<string, object> properties,
            bool exactMatch,
            bool shapeColumnNames)
        {
            return new MemoryStream((new ASCIIEncoding()).GetBytes(
                ExportToStringWriter(properties, exactMatch, shapeColumnNames).GetStringBuilder().ToString()));
        }

        public virtual void ImportFromCsv(string filePath, bool shapeColumnNames)
        {
            _entities = DataTableToList(CsvParser.ParseFromFile(
                filePath,
                true,
                EntityReader.GetDataTable(shapeColumnNames, _entityType).Columns.Count));
        }

        public virtual bool RefreshFromServer()
        {
            UIHelper.DisplayInformation(string.Format(
                "{0} has no implementation for saving to server.",
                this.GetType().Name));
            return true;
        }

        public virtual bool SaveToServer()
        {
            UIHelper.DisplayInformation(string.Format(
                "{0} has no implementation for saving to server.",
                this.GetType().Name));
            return true;
        }

        public virtual void LoadFromFile(string filePath)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                if (string.IsNullOrEmpty(_defaultFilePath))
                {
                    throw new NullReferenceException("File path not specified for entity cache.");
                }
                filePath = _defaultFilePath;
            }
            if (!File.Exists(filePath))
            {
                SaveToFile(filePath);
            }
            EntityCache entities =
                (EntityCache)GOC.Instance.GetSerializer(SerializerType.XML).DeserializeFromFile(this.GetType(), filePath);
            Clear();
            foreach (object e in entities)
            {
                Add(e);
            }
        }

        public virtual void SaveToFile(string filePath)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                if (string.IsNullOrEmpty(_defaultFilePath))
                {
                    throw new NullReferenceException("File path not specified for entity cache.");
                }
                filePath = _defaultFilePath;
            }
            GOC.Instance.GetSerializer(SerializerType.XML).SerializeToFile(this, filePath);
        }

        public IEnumerator GetEnumerator()
        {
            return _entities.GetEnumerator();
        }

        #endregion //Methods
    }
}


text:
package point;

import java.awt.Graphics;

public class Line {
    private Point[] points;

    public Point[] getPoints() {
        Point[] result = new Point[this.points.length];

        for (int i = 0; i < result.length; i++) {
            result[i] = new Point(this.points[i]);
        }

        return result;
    }

    public void setPoints(Point[] points) {
        if (points == null || points.length != 2) {
            this.points = new Point[] {new Point(), new Point()};
        } else {
            this.points = new Point[points.length];
            for (int i = 0; i < points.length; i++) {
                this.points[i] = new Point(points[i]);
            }
        }
    }

    public Line(Point[] points) {
        setPoints(points);
    }

    public Line() {
        this(new Point[] {new Point(), new Point(), new Point(), new Point()});
    }

    public Line(Rectangle q) {
        this(q.getPoints());
    }

    public void draw(Graphics g) {
        g.drawLine(points[0].getCords()[0],points[1].getCords()[0], points[0].getCords()[1], points[1].getCords()[1]);
    }

    @Override
    public String toString() {
        return String.format("{%s, %s}", points[0].toString(), points[1].toString());
    }
}


text:
package jsinterop.core.css.enums;

/**
 * Possible font style attributes
 */
public enum FontStyle {

                       NORMAL("normal"),
                       ITALIC("italic"),
                       OBLIQUE("oblique");

    private String value;

    private FontStyle(String value) {
        this.value = value;
    }

    public String getValue() {
        return this.value;
    }

    /**
     * Parses the given value and returns the according FontStyle
     *
     * @param value The value to parse
     * @return The FontStyle for the given value
     */
    public static FontStyle fromString(String value) {
        FontStyle display = null;

        if (value != null) {
            for (FontStyle d : values()) {
                if (d.getValue().equalsIgnoreCase(value)) {
                    display = d;
                    break;
                }
            }
        }

        return display;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator

     Copyright (C) 2011 The Android Open Source Project
     Copyright (C) 2012 readyState Software Ltd

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<resources>

    <style name="Theme.AppTheme" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">
        <item name="android:actionBarItemBackground">@drawable/selectable_background</item>
        <item name="android:popupMenuStyle">@style/PopupMenu.AppTheme</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.AppTheme</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.AppTheme</item>
        <item name="android:actionDropDownStyle">@style/DropDownNav.AppTheme</item>
        <item name="android:actionBarStyle">@style/ActionBar.Solid.AppTheme</item>
        <item name="android:actionModeBackground">@drawable/cab_background_top</item>
        <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom</item>
        <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.AppTheme</item>

                <!-- Light.DarkActionBar specific -->
        <item name="android:actionBarWidgetTheme">@style/Theme.AppTheme.Widget</item>

    </style>

    <style name="ActionBar.Solid.AppTheme" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/ab_solid</item>
        <item name="android:backgroundStacked">@drawable/ab_stacked_solid</item>
        <item name="android:backgroundSplit">@drawable/ab_bottom_solid</item>
        <item name="android:progressBarStyle">@style/ProgressBar.AppTheme</item>
    </style>

    <style name="ActionBar.Transparent.AppTheme" parent="@style/Widget.AppCompat.ActionBar">
        <item name="android:background">@drawable/ab_transparent</item>
        <item name="android:progressBarStyle">@style/ProgressBar.AppTheme</item>
    </style>

    <!-- this style is only referenced in a Light.DarkActionBar based theme -->
    <style name="Theme.AppTheme.Widget" parent="@style/Theme.AppCompat">
        <item name="android:popupMenuStyle">@style/PopupMenu.AppTheme</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.AppTheme</item>
    </style>

</resources>


text:
import Ember from 'ember';

export default Ember.Controller.extend({
  session: Ember.inject.service(),
  notifications: Ember.inject.service(),

  actions: {
    addPortion(model) {
      const context = this;
      const account = context.get('session.account');
      const isManager = (context.get('session.account.id') === model.order.get('manager.id'));
      // const reloadedOrder = this.store.findRecord('order', model.order.id, { reload: true });

      this.store.findRecord('order', model.order.id, { reload: true }).then(function(reloadedOrder) {
        const portion = context.store.createRecord('portion', {
          text: ' ',
          cost: 0,
          owner: account,
          order: reloadedOrder,
          'portion-products': [],
          deleted: true
        });
        if (isManager) {
          portion.set('paid', true);
        }
        portion.save().then(() => {
          reloadedOrder.addPortion(portion).then(() => {
            context.get('notifications').subscribeOrderNotification(model.order.id);
            context.transitionToRoute('portion', portion.id);
          });
        });
      });
    }
  }
});


text:
#import "SESVerifyEmailAddressRequestMarshaller.h"

@implementation SESVerifyEmailAddressRequestMarshaller

+(AmazonServiceRequest *)createRequest:(SESVerifyEmailAddressRequest *)verifyEmailAddressRequest
{
    AmazonServiceRequest *request = [[SESRequest alloc] init];

    [request setParameterValue:@"VerifyEmailAddress"           forKey:@"Action"];
    [request setParameterValue:@"2010-12-01"   forKey:@"Version"];

    [request setDelegate:[verifyEmailAddressRequest delegate]];
    [request setCredentials:[verifyEmailAddressRequest credentials]];
    [request setEndpoint:[verifyEmailAddressRequest requestEndpoint]];
    [request setRequestTag:[verifyEmailAddressRequest requestTag]];

    if (verifyEmailAddressRequest != nil) {
        if (verifyEmailAddressRequest.emailAddress != nil) {
            [request setParameterValue:[NSString stringWithFormat:@"%@", verifyEmailAddressRequest.emailAddress] forKey:[NSString stringWithFormat:@"%@", @"EmailAddress"]];
        }
    }

    return [request autorelease];
}

@end


text:
package org.apache.axis.encoding.ser.castor;

import org.apache.axis.encoding.ser.BaseSerializerFactory;
import org.apache.axis.encoding.SerializerFactory;

import javax.xml.namespace.QName;

/**
 * SerializerFactory for Castor Enum Type objects
 *
 * @author Ozzie Gurkan
 */
public class CastorEnumTypeSerializerFactory extends BaseSerializerFactory {
    public CastorEnumTypeSerializerFactory(Class javaType, QName xmlType) {
        super(CastorEnumTypeSerializer.class, xmlType, javaType);
    }
    public static SerializerFactory create(Class javaType, QName xmlType) {
        return new CastorEnumTypeSerializerFactory(javaType, xmlType);
    }
}


text:
import { ISiteUserInfo } from "@pnp/sp/site-users/types";
import { WebPartContext } from "@microsoft/sp-webpart-base";

export interface IUserAndGroupInfoProps {
  context: WebPartContext;
}


text:
package br.edu.facear.model;

public class Empregador {

	private Integer id;
	private String nome;
	private String email;
	private String cpf;
	private String celular;
	private String idade;
	private String sexo;
	private String cidade;
	private String senha;

//////////////////////////////////////////////////

	public Empregador(Integer id, String nome, String email, String cpf, String celular, String idade, String sexo,
			String cidade, String senha) {
		super();
		this.id = id;
		this.nome = nome;
		this.email = email;
		this.cpf = cpf;
		this.celular = celular;
		this.idade = idade;
		this.sexo = sexo;
		this.cidade = cidade;
		this.senha = senha;
	}

	////////////////////////////////////////////

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getCpf() {
		return cpf;
	}
	public void setCpf(String cpf) {
		this.cpf = cpf;
	}
	public String getCelular() {
		return celular;
	}
	public void setCelular(String celular) {
		this.celular = celular;
	}
	public String getIdade() {
		return idade;
	}
	public void setIdade(String idade) {
		this.idade = idade;
	}
	public String getSexo() {
		return sexo;
	}
	public void setSexo(String sexo) {
		this.sexo = sexo;
	}
	public String getCidade() {
		return cidade;
	}
	public void setCidade(String cidade) {
		this.cidade = cidade;
	}
	public String getSenha() {
		return senha;
	}
	public void setSenha(String senha) {
		this.senha = senha;
	}

}


text:
' Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

Imports System.Composition
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.CodeFixes
Imports Roslyn.Diagnostics.Analyzers

Namespace Roslyn.Diagnostics.VisualBasic.Analyzers
    ''' <summary>
    ''' RS0023: Parts exported with MEFv2 must be marked as Shared
    ''' </summary>
    <ExportCodeFixProvider(LanguageNames.VisualBasic), [Shared]>
    Public NotInheritable Class BasicPartsExportedWithMEFv2MustBeMarkedAsSharedFixer
        Inherits PartsExportedWithMEFv2MustBeMarkedAsSharedFixer

    End Class
End Namespace


text:
from office365.runtime.client_value import ClientValue

class PostReference(ClientValue):
    """The SocialPostReference class specifies a reference to a post in another thread.  The referenced post can be a
    post with a tag, a post that is liked, a post that mentions a user, or a post that is a reply. Threads that contain
    a SocialPostReference in the PostReference property (see section 3.1.5.42.1.1.6) are threads with root posts that
    are generated on the server and not created by a client."""


text:
#import <iWorkImport/TSWPNumberAttachment.h>

// Not exported
@interface TSWPPageCountAttachment : TSWPNumberAttachment
{
}

- (_Bool)shouldArchiveStringEquivalent;
- (_Bool)changesWithPageCount;
- (int)elementKind;
- (id)stringWithPageNumber:(unsigned long long)arg1 pageCount:(unsigned long long)arg2 charIndex:(unsigned long long)arg3;
- (void)saveToArchiver:(id)arg1;

@end


text:
<tool id="Cluster1" name="Find clusters">
  <description>of regions within a Query</description>
  <command>galaxyOps3 $dbkey -chromCol=$input_chromCol -startCol=$input_startCol -stopCol=$input_endCol -strandCol=$input_strandCol $input -cluster -clusterSingle -clusterSize=$size -numRegion=$num -chrom=all -bed=$out_file1</command>
  <inputs>
    <param format="interval" name="input" type="data" help="Query missing? See TIP below">
      Cluster regions of Query
    </param>
    <param name="num" size="4" type="integer" value="2 ">
      Regions per cluster
    </param>
    <param name="size" size="4" type="integer" value="10 ">
      Within distance
    </param>
  </inputs>
  <outputs>
    <data format="input" name="out_file1" metadata_source="input"/>
  </outputs>
  <help>

.. class:: infomark

**TIP:** If your query does not appear in the pulldown menu -> it is not in interval format. Use "edit attributes" to set chromosome, start, end, and strand columns

-----

**Syntax**

This tool finds groups of regions from a single query that contain N or more regions within a M bp area.

- **Regions per cluster** sets the minimum number of regions to start a cluster
- **Within distance** sets the maximum separation (in base pairs) at which two regions are still considered to be within the same cluster

-----

**Image illustration**

Find clusters of at least 2 genomic elements within 10 bp of each other (each square in the figure below = 5 bp).  In the figure below this yields 2 clusters each containing 2 elements.

.. image:: ../static/operation_icons/cluster.png

scale: 1 square = 5 base pairs

-----

**Example**

- Input file::

    chr7	127475281	127475310
    chr7	127475300	127475406
    chr7	127475383	127475402
    chr7	127486011	127486166

- Find clusters of at least 2 genomic elements within 10 bp of each other::

    chr7	127475281	127475310
    chr7	127475300	127475406
    chr7	127475383	127475402

</help>
</tool>


text:
<?php

/**
 * @file
 * Contains Drupal\nodeinfo\Service\NodeinfoEntityService.php.
 */
namespace Drupal\nodeinfo\Service;

/**
 *
 */
class NodeinfoEntityService {

  /**
   *
   \Drupal::getContainer()->get('nodeinfo.entity.service')->nodeRepairInsertToCreateSupply($entity);
   */
  public function nodeRepairInsertToCreateSupply($node_entity = NULL) {
    if ($node_entity) {
      $parts_values = $node_entity->get('field_repair_partsnum')->getValue();

      if ($parts_values && is_array($parts_values)) {

        foreach ($parts_values as $parts_value) {

          if (isset($parts_value['parts_tid']) && $parts_value['parts_tid']) {
            $field_array = $this->generateSupplyfieldsValueForRepairInsert($node_entity, $parts_value);
            \Drupal::getContainer()->get('flexinfo.node.service')->entityCreateNode($field_array);
          }
        }
      }
    }
  }

  /**
   *
   */
  public function nodeRepairUpdateToUpdateSupply($node_entity = NULL) {
    if ($node_entity) {
      $parts_values = $node_entity->get('field_repair_partsnum')->getValue();

      if ($parts_values && is_array($parts_values)) {

        foreach ($parts_values as $parts_value) {

          if (isset($parts_value['parts_tid']) && $parts_value['parts_tid']) {
            $query_container = \Drupal::getContainer()->get('flexinfo.querynode.service');
            $query = $query_container->queryNidsByBundle('supply');

            $group = $query_container->groupStandardByFieldValue($query, 'field_supply_repairnode', $node_entity->id());
            $query->condition($group);

            $group = $query_container->groupStandardByFieldValue($query, 'field_supply_part', $parts_value['parts_tid']);
            $query->condition($group);

            $nids = $query_container->runQueryWithGroup($query);

            // update exist or insert new one
            if ($nids) {
              $nid = reset($nids);
              $supply_entity = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
              \Drupal::getContainer()->get('flexinfo.field.service')->updateFieldValue('node', $supply_entity, 'field_supply_number', $parts_value['parts_num']);
            }
            else {
              $field_array = $this->generateSupplyfieldsValueForRepairInsert($node_entity, $parts_value);
              \Drupal::getContainer()->get('flexinfo.node.service')->entityCreateNode($field_array);
            }
          }
        }
      }
    }
  }

  /**
   *
   */
  public function generateSupplyfieldsValueForRepairInsert($node_entity, $parts_value) {
    $entity_bundle = 'supply';
    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();

    $fields_value = array(
      'type' => $entity_bundle,
      'title' => 'Entity ' . $entity_bundle . ' created from repair',
      'langcode' => $language,
      'uid' => 1,
      'status' => 1,
    );

    $fields_value['field_supply_part'] = array($parts_value['parts_tid']);
    $fields_value['field_supply_number'] = array($parts_value['parts_num']);
    $fields_value['field_supply_repairnode'] = array($node_entity->id());

    return $fields_value;
  }

  /**
   *
   \Drupal::getContainer()->get('nodeinfo.entity.service')->nodeSupplyInsertToUpdateTermPartsFieldValue($entity);
   */
  public function nodeSupplyInsertToUpdateTermPartsFieldValue($entity) {
    if ($entity) {

      $term_part_tid = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstTargetId($entity, 'field_supply_part');
      $new_number = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstValue($entity, 'field_supply_number');

      if ($diff_number != 0) {
        if ($term_part_tid) {
          $term_entity = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($term_part_tid);
          $old_number = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstValue($term_entity, 'field_parts_inventory');

          $result_number = $old_number + $new_number;

          if ($term_entity) {
            \Drupal::getContainer()->get('flexinfo.field.service')->updateFieldValue('taxonomy_term', $term_entity, 'field_parts_inventory', $result_number);
          }
        }
      }
    }
  }

  /**
   *
   */
  public function nodeSupplyUpdateToUpdateTermPartsFieldValue($entity, $entity_original) {
    if ($entity) {

      $term_part_tid = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstTargetId($entity, 'field_supply_part');
      $new_number = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstValue($entity, 'field_supply_number');
      $original_number = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstValue($entity_original, 'field_supply_number');

      $diff_number = $new_number - $original_number;

      if ($diff_number != 0) {
        if ($term_part_tid) {
          $term_entity = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($term_part_tid);
          $old_number = \Drupal::getContainer()->get('flexinfo.field.service')->getFieldFirstValue($term_entity, 'field_parts_inventory');

          $result_number = $old_number + $diff_number;

          if ($term_entity) {
            \Drupal::getContainer()->get('flexinfo.field.service')->updateFieldValue('taxonomy_term', $term_entity, 'field_parts_inventory', $result_number);
          }
        }
      }
    }

  }

}


text:
package io.fixprotocol.silverflash.frame;

import java.nio.ByteBuffer;

/**
 * Encodes a frame to delimit a message
 *
 * @author Don Mendelson
 *
 */
public interface MessageFrameEncoder {

  /**
   * Returns a new MessageFrameEncoder of the same class
   * @return a new MessageFrameEncoder
   */
  MessageFrameEncoder copy();

  /**
   * Encode a header that delimits the beginning of a frame
   *
   * @return this MessageFrameEncoder
   */
  MessageFrameEncoder encodeFrameHeader();

  /**
   * Encode a trailer that delimits the end of a frame. Optional implementation, depending on
   * protocol.
   *
   * @return this MessageFrameEncoder
   */
  MessageFrameEncoder encodeFrameTrailer();

  /**
   * Returns the length of the message frame, including header and trailer
   *
   * @return the length of the frame
   */
  long getEncodedLength();

  /**
   * Returns the length of a frame header
   *
   * @return the length of a header
   */
  int getHeaderLength();

  /**
   * Sets the message length in the message frame header or trailer. Optional implementation,
   * depending on protocol. It is required if message length must be encoded in the header before
   * the message is encoded.
   *
   * @param messageLength size of the message contained by this frame
   * @return this MessageFrameEncoder
   */
  MessageFrameEncoder setMessageLength(long messageLength);

  /**
   * Attach a buffer to encode a message frame.
   * <p>
   * This encoder may use a different byte order than the contained message. Therefore, it must
   * restore the original byte order of the buffer after encoding the frame header and trailer.
   *
   * @param buffer buffer to populate.
   * @param offset index to start of frame in buffer
   * @return this MessageFrameEncoder
   */
  MessageFrameEncoder wrap(ByteBuffer buffer, int offset);
}


text:
            id
            Name
            Description

            {{$index}}
            {{data.alias}}
            {{data.description}}


text:
package javax.util.monad;

import java.util.function.Function;
import javax.util.functor.Functor;

public interface Monad<T> extends Functor<T> {
  public T unit();
  public <U> Monad<U> bind(Function<? super T, Monad<U>> f);
}


text:
package sysconf

import (
	"fmt"
	"runtime"
)

func sysconf(name int) (int64, error) {
	return -1, fmt.Errorf("unsupported on %s", runtime.GOOS)
}


text:
Boilerplate for Koa/Rethinkdb apps with:
- Prettier for code formatting
- Jest & SuperTest for testing and code coverage

## Development

- Install [Rethinkdb](https://www.rethinkdb.com/docs/install/)
- Run `rethinkdb` and create a development database
- Run `npm run dev` to start the server via nodemon

## Production

- Create production database
- Run `npm start`

## Testing

- Create test database
- Run `npm test` to run Jest test suite
- Run `npm run coverage` to test and produce code coverage report. Report is served and URL is copied to clipboard automatically.

## Formatting

- Prefer `const` over `let` wherever possible
- Run prettier (`npm run format`) to format all files. Recommend using an editor plugin to format files on save.


text:
/**
 * date utils
 */

const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

export const dayMonth = (str) => {
  const date = new Date(str);
  return `${date.getDate()} ${months[date.getMonth()]}`;
};

export const daysDiff = (str1, str2) => {
  if (!str1 || !str2) return '';
  const diff = new Date(str2) - new Date(str1);
  const diffDays = diff / 1000/ 60 / 60 / 24;
  return Math.floor(diffDays);
};


text:
var math = require('./modules/math.js');
var test = require('./test/test.js');


text:
[![NPM version](https://img.shields.io/npm/v/@fylgja/print)](https://www.npmjs.org/package/@fylgja/print)
![license](https://img.shields.io/github/license/fylgja/fylgja)

Print component will add solid foundation for printing.

## Installation

```bash
npm install @fylgja/print
```

Then include the component in to your code via;

```scss
@use "@fylgja/print";
// Or via PostCSS import
@import "@fylgja/print";
```

## How to use

No instruction are really needed.
The print styles are automatically added when loaded.

That said no site is the same.
And if you need more than this basis.
Then consider adding you own styles to improve on this basis.

## Config

Need to show color in printing.
Or don't like the link urls in your print.
You can do so via the following variables;

```scss
$enable-print-economic: true !default;
$enable-print-urls: true !default;
```


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

import java.util.ArrayList;

import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;

import com.amazonaws.services.elasticbeanstalk.model.*;
import com.amazonaws.transform.Unmarshaller;

import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;

/**
 * SolutionStackDescription StAX Unmarshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SolutionStackDescriptionStaxUnmarshaller implements Unmarshaller<SolutionStackDescription, StaxUnmarshallerContext> {

    public SolutionStackDescription unmarshall(StaxUnmarshallerContext context) throws Exception {
        SolutionStackDescription solutionStackDescription = new SolutionStackDescription();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument())
            targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument())
                return solutionStackDescription;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

                if (context.testExpression("SolutionStackName", targetDepth)) {
                    solutionStackDescription.setSolutionStackName(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("PermittedFileTypes", targetDepth)) {
                    solutionStackDescription.withPermittedFileTypes(new ArrayList<String>());
                    continue;
                }

                if (context.testExpression("PermittedFileTypes/member", targetDepth)) {
                    solutionStackDescription.withPermittedFileTypes(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return solutionStackDescription;
                }
            }
        }
    }

    private static SolutionStackDescriptionStaxUnmarshaller instance;

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


text:
App = Ember.Application.create();

App.Post = RL.Model.extend({
  slug: RL.attr('string'),
  title: RL.attr('string'),
  body: RL.attr('string'),
  tags: RL.hasMany('tag'),
  createdAt: RL.attr('date')
});

App.Tag = RL.Model.extend({
  name: RL.attr('string')
});

App.PostGroup = RL.Model.extend({
  featured: RL.hasMany('post'),
  popular: RL.hasMany('post', { readOnly: true })
});

App.Person = RL.Model.extend({
  slug: RL.attr('string'),
  name: RL.attr('string'),
  role: RL.attr('number')
});

App.Comment = RL.Model.extend({
  text: RL.attr('string'),
  post: RL.belongsTo('post'),
  author: RL.belongsTo('person'),
  likes: RL.hasMany('like')
});

App.Like = RL.Model.extend({
  username: RL.attr('string')
});

App.ClientAddress = RL.Model.extend();

App.Product = RL.Model.extend({
  name: RL.attr(),
  rating: RL.attr(),
  available: RL.attr(),
  createdAt: RL.attr(),
  seller: RL.belongsTo(App.Person)
});

App.Person.FIXTURES = [
  { id: 1, name: 'Garth', role: 3 },
  { id: 2, name: 'Tyler', role: 3 },
  { id: 3, name: 'Beth', role: 1 }
];


text:
// Global settings /////////////////////////////////////////////////////

/*global modules, BoxMorph, HandleMorph, PushButtonMorph, SyntaxElementMorph,
Color, Point, WatcherMorph, StringMorph, SpriteMorph, ScrollFrameMorph,
CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize,
MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph,
TableFrameMorph, TableMorph, Variable, isSnapObject*/

modules.lists = '2017-September-01';

var List;
var ListWatcherMorph;

// List ////////////////////////////////////////////////////////////////

/*
    I am a dynamic array data structure for SNAP!
    My index starts with 1

    I am a "smart" hybrid list, because I can be used as both a linked
    list and as a dynamic array

    public interface:

    setters (linked):
    -----------------
    cons                - answer a new list with the given item in front
    cdr                    - answer all but the first element

    setters (arrayed):
    ------------------
    add(element, index)    - insert the element before the given slot,
    put(element, index)    - overwrite the element at the given slot
    remove(index)        - remove the given slot, shortening the list
    clear()                - remove all elements

    getters (all hybrid):
    ---------------------
    length()            - number of slots
    at(index)            - element present in specified slot
    contains(element)    - <bool>

    conversion:
    -----------
    asArray()            - answer me as JavaScript array
    asText()            - answer my elements (recursively) concatenated
*/

// List instance creation:

function List(array) {
    this.type = null; // for UI lists, such as costumes, sounds, sprites
    this.contents = array || [];
    this.first = null;
    this.rest = null;
    this.isLinked = false;
    this.lastChanged = Date.now();
}

// List global preferences

List.prototype.enableTables = false; // default, to not confuse NYC teachers

// List printing

List.prototype.toString = function () {
    return 'a List [' + this.length + ' elements]';
};

// List updating:

List.prototype.changed = function () {
    this.lastChanged = Date.now();
};

// Linked List ops:

List.prototype.cons = function (car, cdr) {
    var answer = new List();
    if (!(cdr instanceof List || isNil(cdr))) {
        throw new Error("cdr isn't a list: " + cdr);
    }
    answer.first = isNil(car) ? null : car;
    answer.rest = cdr || null;
    answer.isLinked = true;
    return answer;
};

List.prototype.cdr = function () {
    var result, i;
    if (this.isLinked) {
        return this.rest || new List();
    }
    if (this.contents.length < 2) {
        return new List();
    }

    result = new List();
    for (i = this.contents.length; i > 1; i -= 1) {
        result = this.cons(this.at(i), result);
    }
    return result;
};

// List array setters:

List.prototype.add = function (element, index) {
/*
    insert the element before the given slot index,
    if no index is specifed, append the element
*/
    var idx = index || this.length() + 1,
        obj = isNil(element) ? null : element;

    this.becomeArray();
    this.contents.splice(idx - 1, 0, obj);
    this.changed();
};

List.prototype.put = function (element, index) {
    // exchange the element at the given slot for another
    var data = element === 0 ? 0
            : element === false ? false
                    : element || null;

    this.becomeArray();
    this.contents[index - 1] = data;
    this.changed();
};

List.prototype.remove = function (index) {
    // remove the given slot, shortening the list
    this.becomeArray();
    this.contents.splice(index - 1, 1);
    this.changed();
};

List.prototype.clear = function () {
    this.contents = [];
    this.first = null;
    this.rest = null;
    this.isLinked = false;
    this.changed();
};

// List getters (all hybrid):

List.prototype.length = function () {
    if (this.isLinked) {
        var pair = this,
            result = 0;
        while (pair && pair.isLinked) {
            result += 1;
            pair = pair.rest;
        }
        return result + (pair ? pair.contents.length : 0);
    }
    return this.contents.length;
};

List.prototype.at = function (index) {
    var value, idx = +index, pair = this;
    while (pair.isLinked) {
        if (idx > 1) {
            pair = pair.rest;
            idx -= 1;
        } else {
            return pair.first;
        }
    }
    value = pair.contents[idx - 1];
    return isNil(value) ? '' : value;
};

List.prototype.contains = function (element) {
    var pair = this;
    while (pair.isLinked) {
        if (snapEquals(pair.first, element)) {
            return true;
        }
        pair = pair.rest;
    }
    // in case I'm arrayed
    return pair.contents.some(function (any) {
        return snapEquals(any, element);
    });
};

// List table (2D) accessing (for table morph widget):

List.prototype.isTable = function () {
    return this.enableTables && (this.length() > 100 || this.cols() > 1);
};

List.prototype.get = function (col, row) {
    var r, len, cols;
    if (!col) {
        if (!row) {return [this.length()]; }
        if (row > this.rows()) {return null; }
        return this.rowName(row);
    } else if (!row) {
        if (this.cols() === 1) {return localize('items'); }
        return this.colName(col);
    }
    r = this.at(row);

    // encode "orphaned" as arrays and overshooting ones as Variables
    if (r instanceof List) {
        len = r.length();
        cols = this.cols();
        if (col > len) {
            return null;
        } else if (cols === 1 && len > 1) {
            return [r];
        } else if (col >= cols && len > cols) { // overshooting
            return new Variable(r.at(col));
        }
        return r.at(col);
    }
    if (col === 1 && row <= this.rows()) {
        return [r];
    }
    return null;
};

List.prototype.rows = function () {
    return this.length();
};

List.prototype.cols = function () {
    var r = (this.at(1));
    return r instanceof List ? r.length() : 1;
};

List.prototype.colName = function (col) {
    if (col > this.cols()) {return null; }
    return String.fromCharCode(64 + ((col % 26) || 26)).repeat(
        Math.floor((col - 1) / 26) + 1
    );
};

List.prototype.rowName = function (row) {
    return row;
};

List.prototype.columnNames = function () {
    return [];
};

List.prototype.version = function (startRow, rows) {
    var l = Math.min(startRow + rows, this.length()),
        v = this.lastChanged,
        r,
        i;
    for (i = startRow; i <= l; i += 1) {
        r = this.at(i);
        v = Math.max(v, r.lastChanged ? r.lastChanged : 0);
    }
    return v;
};

// List conversion:

List.prototype.asArray = function () {
    // for use in the evaluator
    this.becomeArray();
    return this.contents;
};

List.prototype.itemsArray = function () {
    // answer an array containing my elements
    // don't convert linked lists to arrays
    if (this.isLinked) {
        var next = this,
            result = [],
            i;
        while (next && next.isLinked) {
            result.push(next.first);
            next = next.rest;
        }
        if (next) {
            for (i = 1; i <= next.contents.length; i += 1) {
                result.push(next.at(i));
            }
        }
        return result;
    }
    return this.contents;
};

List.prototype.asText = function () {
    var result = '',
        length,
        element,
        pair = this,
        i;
    while (pair.isLinked) {
        element = pair.first;
        if (element instanceof List) {
            result = result.concat(element.asText());
        } else {
            element = isNil(element) ? '' : element.toString();
            result = result.concat(element);
        }
        pair = pair.rest;
    }
    length = pair.length();
    for (i = 1; i <= length; i += 1) {
        element = pair.at(i);
        if (element instanceof List) {
            result = result.concat(element.asText());
        } else {
            element = isNil(element) ? '' : element.toString();
            result = result.concat(element);
        }
    }
    return result;
};

List.prototype.becomeArray = function () {
    if (this.isLinked) {
        this.contents = this.itemsArray();
        this.isLinked = false;
        this.first = null;
        this.rest = null;
    }
};

List.prototype.becomeLinked = function () {
    var i, stop, tail = this;
    if (!this.isLinked) {
        stop = this.length();
        for (i = 0; i < stop; i += 1) {
            tail.first = this.contents[i];
            if (i < (stop - 1)) {
                tail.rest = new List();
                tail.isLinked = true;
                tail = tail.rest;
            }
        }
        this.contents = [];
        this.isLinked = true;
    }
};

// List testing

List.prototype.equalTo = function (other) {
    var myself = this, it = other, i, j, loopcount;
    if (!(other instanceof List)) {
        return false;
    }

    while (myself.isLinked && it.isLinked) {
        if (!snapEquals(myself.first, it.first)) {
            return false;
        }
        myself = myself.rest;
        it = it.rest;
    }

    if (it.isLinked) {
        i = it;
        it = myself;
        myself = i;
    }

    j = 0;
    while (myself.isLinked) {
        if (!snapEquals(myself.first, it.contents[j])) {
            return false;
        }
        myself = myself.rest;
        j += 1;
    }

    i = 0;
    if (myself.contents.length !== (it.contents.length - j)) {
        return false;
    }

    loopcount = myself.contents.length;
    while (loopcount > 0) {
        loopcount -= 1;
        if (!snapEquals(myself.contents[i], it.contents[j])) {
            return false;
        }
        i += 1;
        j += 1;
    }
    return true;
};

// ListWatcherMorph ////////////////////////////////////////////////////

/*
    I am a little window which observes a list and continuously
    updates itself accordingly
*/

// ListWatcherMorph inherits from BoxMorph:

ListWatcherMorph.prototype = new BoxMorph();
ListWatcherMorph.prototype.constructor = ListWatcherMorph;
ListWatcherMorph.uber = BoxMorph.prototype;

// ListWatcherMorph default settings

ListWatcherMorph.prototype.cellColor =
    SpriteMorph.prototype.blockColor.lists;

// ListWatcherMorph instance creation:

function ListWatcherMorph(list, parentCell) {
    this.init(list, parentCell);
}

ListWatcherMorph.prototype.init = function (list, parentCell) {
    var myself = this;

    this.list = list || new List();
    this.start = 1;
    this.range = 100;
    this.lastUpdated = Date.now();
    this.lastCell = null;
    this.parentCell = parentCell || null; // for circularity detection

    // elements declarations
    this.label = new StringMorph(
        localize('length: ') + this.list.length(),
        SyntaxElementMorph.prototype.fontSize,
        null,
        false,
        false,
        false,
        MorphicPreferences.isFlat ? new Point() : new Point(1, 1),
        new Color(255, 255, 255)
    );
    this.label.mouseClickLeft = function () {myself.startIndexMenu(); };

    this.frame = new ScrollFrameMorph(null, 10);
    this.frame.alpha = 0;
    this.frame.acceptsDrops = false;
    this.frame.contents.acceptsDrops = false;

    this.handle = new HandleMorph(
        this,
        80,
        70,
        3,
        3
    );
    this.handle.setExtent(new Point(13, 13));

    this.arrow = new ArrowMorph(
        'down',
        SyntaxElementMorph.prototype.fontSize
    );
    this.arrow.mouseClickLeft = function () {myself.startIndexMenu(); };
    this.arrow.setRight(this.handle.right());
    this.arrow.setBottom(this.handle.top());
    this.handle.add(this.arrow);

    this.plusButton = new PushButtonMorph(
        this.list,
        'add',
        '+'
    );
    this.plusButton.padding = 0;
    this.plusButton.edge = 0;
    this.plusButton.outlineColor = this.color;
    this.plusButton.drawNew();
    this.plusButton.fixLayout();

    ListWatcherMorph.uber.init.call(
        this,
        SyntaxElementMorph.prototype.rounding,
        1.000001, // shadow bug in Chrome,
        new Color(120, 120, 120)
    );

    this.color = new Color(220, 220, 220);
    this.isDraggable = false;
    this.setExtent(new Point(80, 70).multiplyBy(
        SyntaxElementMorph.prototype.scale
    ));
    this.add(this.label);
    this.add(this.frame);
    this.add(this.plusButton);
    this.add(this.handle);
    this.handle.drawNew();
    this.update();
    this.fixLayout();
};

// ListWatcherMorph updating:

ListWatcherMorph.prototype.update = function (anyway) {
    var i, idx, ceil, morphs, cell, cnts, label, button, max,
        starttime, maxtime = 1000;

    this.frame.contents.children.forEach(function (m) {
        if (m instanceof CellMorph) {
            if (m.contentsMorph instanceof ListWatcherMorph) {
                m.contentsMorph.update();
            } else if (isSnapObject(m.contents)) {
                m.update();
            }
        }
    });

    if (this.lastUpdated === this.list.lastChanged && !anyway) {
        return null;
    }

    this.updateLength(true);

    // adjust start index to current list length
    this.start = Math.max(
        Math.min(
            this.start,
            Math.floor((this.list.length() - 1) / this.range)
                * this.range + 1
        ),
        1
    );

    // refresh existing cells
    // highest index shown:
    max = Math.min(
        this.start + this.range - 1,
        this.list.length()
    );

    // number of morphs available for refreshing
    ceil = Math.min(
        (max - this.start + 1) * 3,
        this.frame.contents.children.length
    );

    for (i = 0; i < ceil; i += 3) {
        idx = this.start + (i / 3);

        cell = this.frame.contents.children[i];
        label = this.frame.contents.children[i + 1];
        button = this.frame.contents.children[i + 2];
        cnts = this.list.at(idx);

        if (cell.contents !== cnts) {
            cell.contents = cnts;
            cell.drawNew();
            if (this.lastCell) {
                cell.setLeft(this.lastCell.left());
            }
        }
        this.lastCell = cell;

        if (label.text !== idx.toString()) {
            label.text = idx.toString();
            label.drawNew();
        }

        button.action = idx;
    }

    // remove excess cells
    // number of morphs to be shown
    morphs = (max - this.start + 1) * 3;

    while (this.frame.contents.children.length > morphs) {
        this.frame.contents.children[morphs].destroy();
    }

    // add additional cells
    ceil = morphs; //max * 3;
    i = this.frame.contents.children.length;

    starttime = Date.now();
    if (ceil > i + 1) {
        for (i; i < ceil; i += 3) {
            if (Date.now() - starttime > maxtime) {
                this.fixLayout();
                this.frame.contents.adjustBounds();
                this.frame.contents.setLeft(this.frame.left());
                return null;
            }
            idx = this.start + (i / 3);
            label = new StringMorph(
                idx.toString(),
                SyntaxElementMorph.prototype.fontSize,
                null,
                false,
                false,
                false,
                MorphicPreferences.isFlat ? new Point() : new Point(1, 1),
                new Color(255, 255, 255)
            );
            cell = new CellMorph(
                this.list.at(idx),
                this.cellColor,
                idx,
                this.parentCell
            );
            button = new PushButtonMorph(
                this.list.remove,
                idx,
                '-',
                this.list
            );
            button.padding = 1;
            button.edge = 0;
            button.corner = 1;
            button.outlineColor = this.color.darker();
            button.drawNew();
            button.fixLayout();

            this.frame.contents.add(cell);
            if (this.lastCell) {
                cell.setPosition(this.lastCell.bottomLeft());
            } else {
                cell.setTop(this.frame.contents.top());
            }
            this.lastCell = cell;
            label.setCenter(cell.center());
            label.setRight(cell.left() - 2);
            this.frame.contents.add(label);
            this.frame.contents.add(button);
        }
    }
    this.lastCell = null;

    this.fixLayout();
    this.frame.contents.adjustBounds();
    this.frame.contents.setLeft(this.frame.left());
    this.updateLength();
    this.lastUpdated = this.list.lastChanged;
};

ListWatcherMorph.prototype.updateLength = function (notDone) {
    this.label.text = localize('length: ') + this.list.length();
    if (notDone) {
        this.label.color = new Color(0, 0, 100);
    } else {
        this.label.color = new Color(0, 0, 0);
    }
    this.label.drawNew();
    this.label.setCenter(this.center());
    this.label.setBottom(this.bottom() - 3);
};

ListWatcherMorph.prototype.startIndexMenu = function () {
    var i,
        range,
        myself = this,
        items = Math.ceil(this.list.length() / this.range),
        menu = new MenuMorph(
            function (idx) {myself.setStartIndex(idx); },
            null,
            myself
        );
    menu.addItem('1...', 1);
    for (i = 1; i < items; i += 1) {
        range = i * 100 + 1;
        menu.addItem(range + '...', range);
    }
    menu.popUpAtHand(this.world());
};

ListWatcherMorph.prototype.setStartIndex = function (index) {
    this.start = index;
    this.list.changed();
};

ListWatcherMorph.prototype.fixLayout = function () {
    if (!this.label) {return; }
    Morph.prototype.trackChanges = false;
    if (this.frame) {
        this.arrangeCells();
        this.frame.silentSetPosition(this.position().add(3));
        this.frame.bounds.corner = this.bounds.corner.subtract(new Point(
            3,
            17
        ));
        this.frame.drawNew();
        this.frame.contents.adjustBounds();
    }

    this.label.setCenter(this.center());
    this.label.setBottom(this.bottom() - 3);
    this.plusButton.setLeft(this.left() + 3);
    this.plusButton.setBottom(this.bottom() - 3);

    Morph.prototype.trackChanges = true;
    this.changed();

    if (this.parent && this.parent.fixLayout) {
        this.parent.fixLayout();
    }
};

ListWatcherMorph.prototype.arrangeCells = function () {
    var i, cell, label, button, lastCell,
        end = this.frame.contents.children.length;
    for (i = 0; i < end; i += 3) {
        cell = this.frame.contents.children[i];
        label = this.frame.contents.children[i + 1];
        button = this.frame.contents.children[i + 2];
        if (lastCell) {
            cell.setTop(lastCell.bottom());
        }
        if (label) {
            label.setTop(cell.center().y - label.height() / 2);
            label.setRight(cell.left() - 2);
        }
        if (button) {
            button.setCenter(cell.center());
            button.setLeft(cell.right() + 2);
        }
        lastCell = cell;
    }
    this.frame.contents.adjustBounds();
};

ListWatcherMorph.prototype.expand = function (maxExtent) {
    // make sure to show all (first 100) cells
    var fe = this.frame.contents.extent(),
        ext = new Point(fe.x + 6, fe.y + this.label.height() + 6);
    if (maxExtent) {
        ext = ext.min(maxExtent);
    }
    this.setExtent(ext);
    this.handle.setRight(this.right() - 3);
    this.handle.setBottom(this.bottom() - 3);
};

// ListWatcherMorph context menu

ListWatcherMorph.prototype.userMenu = function () {
    if (!List.prototype.enableTables) {
        return this.escalateEvent('userMenu');
    }
    var menu = new MenuMorph(this),
        myself = this;
    menu.addItem('table view...', 'showTableView');
    menu.addLine();
    menu.addItem(
        'open in dialog...',
        function () {
            new TableDialogMorph(myself.list).popUp(myself.world());
        }
    );
    return menu;
};

ListWatcherMorph.prototype.showTableView = function () {
    var view = this.parentThatIsAnyOf([
        SpriteBubbleMorph,
        SpeechBubbleMorph,
        CellMorph
    ]);
    if (!view) {return; }
    if (view instanceof SpriteBubbleMorph) {
        view.changed();
        view.drawNew(true);
    } else if (view instanceof SpeechBubbleMorph) {
        view.contents = new TableFrameMorph(new TableMorph(this.list, 10));
        view.contents.expand(this.extent());
        view.drawNew(true);
    } else { // watcher cell
        view.drawNew(true, 'table');
        view.contentsMorph.expand(this.extent());
    }
    view.fixLayout();
};

// ListWatcherMorph events:

ListWatcherMorph.prototype.mouseDoubleClick = function (pos) {
    if (List.prototype.enableTables) {
        new TableDialogMorph(this.list).popUp(this.world());
    } else {
        this.escalateEvent('mouseDoubleClick', pos);
    }
};

// ListWatcherMorph hiding/showing:

ListWatcherMorph.prototype.show = function () {
    ListWatcherMorph.uber.show.call(this);
    this.frame.contents.adjustBounds();
};

// ListWatcherMorph drawing:

ListWatcherMorph.prototype.drawNew = function () {
    WatcherMorph.prototype.drawNew.call(this);
    this.fixLayout();
};


text:
require "hirlite/version"
require "hirlite/rlite"


text:
var utils = require('./utils');

describe('test.make.subtool', function() {

  it('subtool-help', function(done) {
    utils.execute('make -f subtool.make subtool-help', function() {
      done();
    });
  });

  it('subtool-version', function(done) {
    utils.execute('make -f subtool.make subtool-version', function() {
      done();
    });
  });

});


text:
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS mpp21090_changedistpolicy_dml_pttab_interval;
CREATE TABLE mpp21090_changedistpolicy_dml_pttab_interval
(
    col1 interval,
    col2 interval,
    col3 char,
    col4 interval,
    col5 int
) DISTRIBUTED BY (col1) PARTITION BY RANGE(col2)(partition partone start('1 sec') end('1 min')  WITH (APPENDONLY=true, COMPRESSLEVEL=5, ORIENTATION=column),partition parttwo start('1 min') end('1 hour') WITH (APPENDONLY=true, COMPRESSLEVEL=5, ORIENTATION=row),partition partthree start('1 hour') end('12 hours'));

INSERT INTO mpp21090_changedistpolicy_dml_pttab_interval VALUES('10 secs','10 secs','a','10 secs',0);
SELECT * FROM mpp21090_changedistpolicy_dml_pttab_interval ORDER BY 1,2,3,4;

ALTER TABLE mpp21090_changedistpolicy_dml_pttab_interval DROP COLUMN col4;

INSERT INTO mpp21090_changedistpolicy_dml_pttab_interval VALUES('10 secs','10 secs','b',1);
SELECT * FROM mpp21090_changedistpolicy_dml_pttab_interval ORDER BY 1,2,3,4;

ALTER TABLE mpp21090_changedistpolicy_dml_pttab_interval SET DISTRIBUTED BY (col3);

INSERT INTO mpp21090_changedistpolicy_dml_pttab_interval SELECT '11 hours', '11 hours','c', 2;
SELECT * FROM mpp21090_changedistpolicy_dml_pttab_interval ORDER BY 1,2,3;

UPDATE mpp21090_changedistpolicy_dml_pttab_interval SET col3 ='c' WHERE col3 ='b';
SELECT * FROM mpp21090_changedistpolicy_dml_pttab_interval ORDER BY 1,2,3;

DELETE FROM mpp21090_changedistpolicy_dml_pttab_interval WHERE col3 ='c';
SELECT * FROM mpp21090_changedistpolicy_dml_pttab_interval ORDER BY 1,2,3;


text:
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script.  Only    //
// add custom code in the designated areas or it will be overwritten during  //
// the next update.                                                          //
//-----------------------------------NOTICE----------------------------------//

//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//

#include "../../include/FixLink.h"
#include "../../include/ObjectRegistry.h"
#include "../../include/NIF_IO.h"
#include "../../include/obj/NiPSysEmitterCtlrData.h"
#include "../../include/gen/KeyGroup.h"
using namespace Niflib;

//Definition of TYPE constant
const Type NiPSysEmitterCtlrData::TYPE("NiPSysEmitterCtlrData", &NiObject::TYPE );

NiPSysEmitterCtlrData::NiPSysEmitterCtlrData() : numVisibilityKeys_((unsigned int)0) {
	//--BEGIN CONSTRUCTOR CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

NiPSysEmitterCtlrData::~NiPSysEmitterCtlrData() {
	//--BEGIN DESTRUCTOR CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

const Type & NiPSysEmitterCtlrData::GetType() const {
	return TYPE;
}

NiObject * NiPSysEmitterCtlrData::Create() {
	return new NiPSysEmitterCtlrData;
}

void NiPSysEmitterCtlrData::Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ) {
	//--BEGIN PRE-READ CUSTOM CODE--//
	//--END CUSTOM CODE--//

	NiObject::Read( in, link_stack, info );
	NifStream( floatKeys_.numKeys, in, info );
	if ( (floatKeys_.numKeys != 0) ) {
		NifStream( floatKeys_.interpolation, in, info );
	};
	floatKeys_.keys.resize(floatKeys_.numKeys);
	for (unsigned int i1 = 0; i1 < floatKeys_.keys.size(); i1++) {
		NifStream( floatKeys_.keys[i1], in, info, floatKeys_.interpolation );
	};
	NifStream( numVisibilityKeys_, in, info );
	visibilityKeys_.resize(numVisibilityKeys_);
	for (unsigned int i1 = 0; i1 < visibilityKeys_.size(); i1++) {
		NifStream( visibilityKeys_[i1], in, info, 1 );
	};

	//--BEGIN POST-READ CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

void NiPSysEmitterCtlrData::Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const {
	//--BEGIN PRE-WRITE CUSTOM CODE--//
	//--END CUSTOM CODE--//

	NiObject::Write( out, link_map, missing_link_stack, info );
	numVisibilityKeys_ = (unsigned int)(visibilityKeys_.size());
	floatKeys_.numKeys = (unsigned int)(floatKeys_.keys.size());
	NifStream( floatKeys_.numKeys, out, info );
	if ( (floatKeys_.numKeys != 0) ) {
		NifStream( floatKeys_.interpolation, out, info );
	};
	for (unsigned int i1 = 0; i1 < floatKeys_.keys.size(); i1++) {
		NifStream( floatKeys_.keys[i1], out, info, floatKeys_.interpolation );
	};
	NifStream( numVisibilityKeys_, out, info );
	for (unsigned int i1 = 0; i1 < visibilityKeys_.size(); i1++) {
		NifStream( visibilityKeys_[i1], out, info, 1 );
	};

	//--BEGIN POST-WRITE CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

std::string NiPSysEmitterCtlrData::asString( bool verbose ) const {
	//--BEGIN PRE-STRING CUSTOM CODE--//
	//--END CUSTOM CODE--//

	stringstream out;
	unsigned int array_output_count = 0;
	out << NiObject::asString();
	numVisibilityKeys_ = (unsigned int)(visibilityKeys_.size());
	floatKeys_.numKeys = (unsigned int)(floatKeys_.keys.size());
	out << "  Num Keys:  " << floatKeys_.numKeys << endl;
	if ( (floatKeys_.numKeys != 0) ) {
		out << "    Interpolation:  " << floatKeys_.interpolation << endl;
	};
	array_output_count = 0;
	for (unsigned int i1 = 0; i1 < floatKeys_.keys.size(); i1++) {
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
			break;
		};
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			break;
		};
		out << "    Keys[" << i1 << "]:  " << floatKeys_.keys[i1] << endl;
		array_output_count++;
	};
	out << "  Num Visibility Keys?:  " << numVisibilityKeys_ << endl;
	array_output_count = 0;
	for (unsigned int i1 = 0; i1 < visibilityKeys_.size(); i1++) {
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
			break;
		};
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			break;
		};
		out << "    Visibility Keys?[" << i1 << "]:  " << visibilityKeys_[i1] << endl;
		array_output_count++;
	};
	return out.str();

	//--BEGIN POST-STRING CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

void NiPSysEmitterCtlrData::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ) {
	//--BEGIN PRE-FIXLINKS CUSTOM CODE--//
	//--END CUSTOM CODE--//

	NiObject::FixLinks( objects, link_stack, missing_link_stack, info );

	//--BEGIN POST-FIXLINKS CUSTOM CODE--//
	//--END CUSTOM CODE--//
}

std::list<NiObjectRef> NiPSysEmitterCtlrData::GetRefs() const {
	list<Ref<NiObject> > refs;
	refs = NiObject::GetRefs();
	return refs;
}

std::list<NiObject *> NiPSysEmitterCtlrData::GetPtrs() const {
	list<NiObject *> ptrs;
	ptrs = NiObject::GetPtrs();
	return ptrs;
}

/***Begin Example Naive Implementation****

KeyGroup<float > NiPSysEmitterCtlrData::GetFloatKeys_() const {
	return floatKeys_;
}

void NiPSysEmitterCtlrData::SetFloatKeys_( const KeyGroup<float > & value ) {
	floatKeys_ = value;
}

vector<Key<byte > > NiPSysEmitterCtlrData::GetVisibilityKeys_() const {
	return visibilityKeys_;
}

void NiPSysEmitterCtlrData::SetVisibilityKeys_( const vector<Key<byte > >& value ) {
	visibilityKeys_ = value;
}

****End Example Naive Implementation***/

//--BEGIN MISC CUSTOM CODE--//
//--END CUSTOM CODE--//


text:
namespace uc
{
    namespace uwp
    {
        template <typename f> inline void ui_run_sync( const winrt::Windows::UI::Core::CoreWindow& window, f update )
        {
			auto action = window.Dispatcher().RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, winrt::Windows::UI::Core::DispatchedHandler(update));

            while ( action.Status() != winrt::Windows::Foundation::AsyncStatus::Completed )
            {
                std::this_thread::yield();
            }

        }

        template <typename f> inline void ui_run_async(const winrt::Windows::UI::Core::CoreWindow& window, f update)
        {
			window.Dispatcher().RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, winrt::Windows::UI::Core::DispatchedHandler(update));
        }
    }

}


text:
<?php
session_name("Project");
session_start();
require_once('dbconn.php');
if(!checkUserSession($_SESSION["user"]))
{
	header("Location:login.php");
}
?>

<?php include 'header.php'; ?>

View Project Risks

<form name="projectListForm" >

		Customer :

			<?php include 'getcustomer.php'; ?>

		Project :

<input type="button"  value="Fetch" onClick="showDetails();">

</form>


text:
module Rails
  module Generators
    class TexterGenerator < NamedBase
      source_root File.expand_path("../templates", __FILE__)

      argument :actions, :type => :array, :default => [], :banner => "method method"
      check_class_collision

      def create_texter_file
        template "texter.rb", File.join('app/texters', class_path, "#{file_name}.rb")
      end

      hook_for :template_engine
    end
  end
end


text:
namespace Dropbox.Api.TeamLog
{
    using sys = System;
    using col = System.Collections.Generic;
    using re = System.Text.RegularExpressions;

    using enc = Dropbox.Api.Stone;

    /// <summary>
    /// <para>Changed team member admin role.</para>
    /// </summary>
    public class MemberChangeAdminRoleDetails
    {
        #pragma warning disable 108

        /// <summary>
        /// <para>The encoder instance.</para>
        /// </summary>
        internal static enc.StructEncoder<MemberChangeAdminRoleDetails> Encoder = new MemberChangeAdminRoleDetailsEncoder();

        /// <summary>
        /// <para>The decoder instance.</para>
        /// </summary>
        internal static enc.StructDecoder<MemberChangeAdminRoleDetails> Decoder = new MemberChangeAdminRoleDetailsDecoder();

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MemberChangeAdminRoleDetails" />
        /// class.</para>
        /// </summary>
        /// <param name="newValue">New admin role. This field is relevant when the admin role
        /// is changed or whenthe user role changes from no admin rights to with admin
        /// rights.</param>
        /// <param name="previousValue">Previous admin role. This field is relevant when the
        /// admin role is changed or when the admin role is removed.</param>
        public MemberChangeAdminRoleDetails(AdminRole newValue = null,
                                            AdminRole previousValue = null)
        {
            this.NewValue = newValue;
            this.PreviousValue = previousValue;
        }

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MemberChangeAdminRoleDetails" />
        /// class.</para>
        /// </summary>
        /// <remarks>This is to construct an instance of the object when
        /// deserializing.</remarks>
        [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
        public MemberChangeAdminRoleDetails()
        {
        }

        /// <summary>
        /// <para>New admin role. This field is relevant when the admin role is changed or
        /// whenthe user role changes from no admin rights to with admin rights.</para>
        /// </summary>
        public AdminRole NewValue { get; protected set; }

        /// <summary>
        /// <para>Previous admin role. This field is relevant when the admin role is changed or
        /// when the admin role is removed.</para>
        /// </summary>
        public AdminRole PreviousValue { get; protected set; }

        #region Encoder class

        /// <summary>
        /// <para>Encoder for  <see cref="MemberChangeAdminRoleDetails" />.</para>
        /// </summary>
        private class MemberChangeAdminRoleDetailsEncoder : enc.StructEncoder<MemberChangeAdminRoleDetails>
        {
            /// <summary>
            /// <para>Encode fields of given value.</para>
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="writer">The writer.</param>
            public override void EncodeFields(MemberChangeAdminRoleDetails value, enc.IJsonWriter writer)
            {
                if (value.NewValue != null)
                {
                    WriteProperty("new_value", value.NewValue, writer, global::Dropbox.Api.TeamLog.AdminRole.Encoder);
                }
                if (value.PreviousValue != null)
                {
                    WriteProperty("previous_value", value.PreviousValue, writer, global::Dropbox.Api.TeamLog.AdminRole.Encoder);
                }
            }
        }

        #endregion

        #region Decoder class

        /// <summary>
        /// <para>Decoder for  <see cref="MemberChangeAdminRoleDetails" />.</para>
        /// </summary>
        private class MemberChangeAdminRoleDetailsDecoder : enc.StructDecoder<MemberChangeAdminRoleDetails>
        {
            /// <summary>
            /// <para>Create a new instance of type <see cref="MemberChangeAdminRoleDetails"
            /// />.</para>
            /// </summary>
            /// <returns>The struct instance.</returns>
            protected override MemberChangeAdminRoleDetails Create()
            {
                return new MemberChangeAdminRoleDetails();
            }

            /// <summary>
            /// <para>Set given field.</para>
            /// </summary>
            /// <param name="value">The field value.</param>
            /// <param name="fieldName">The field name.</param>
            /// <param name="reader">The json reader.</param>
            protected override void SetField(MemberChangeAdminRoleDetails value, string fieldName, enc.IJsonReader reader)
            {
                switch (fieldName)
                {
                    case "new_value":
                        value.NewValue = global::Dropbox.Api.TeamLog.AdminRole.Decoder.Decode(reader);
                        break;
                    case "previous_value":
                        value.PreviousValue = global::Dropbox.Api.TeamLog.AdminRole.Decoder.Decode(reader);
                        break;
                    default:
                        reader.Skip();
                        break;
                }
            }
        }

        #endregion
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Toolkit.Common.Threading
{
    public static class ReaderWriterLockSlimExtensions
    {
        public static ScopedReaderWriterLock ScopedReadLock(this ReaderWriterLockSlim readerWriterLock)
        {
            return new ScopedReaderWriterLock(readerWriterLock);
        }

        public static ScopedReaderWriterLock ScopedWriteLock(this ReaderWriterLockSlim readerWriterLock)
        {
            return new ScopedReaderWriterLock(readerWriterLock, readOnly: false);
        }
    }
}


text:
I enjoyed designing this typeface because it was inspired by my little son
"Jonah," who is called by his friends "Joti." The type has the informality and
style of the cartoons which children watch. Its primary concept is top-heavy
stems with a slight sense of movement to further enhance the style. Joti is
ideal for composing headlines and short texts in sizes larger than 14
points.

To contribute to the project contact
Eduardo Tunni.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Zhuanlan.Droid.Model;

namespace Zhuanlan.Droid.UI.Views
{
    public interface IColumnView
    {
       void GetColumnFail(string msg);
        void GetColumnSuccess(ColumnModel column);
        void GetPostsFail(string msg);
        void GetPostsSuccess(List<PostModel> lists);
    }
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.impl.persistence.entity;

import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.User;
import org.activiti.engine.identity.UserQuery;
import org.activiti.engine.impl.Page;
import org.activiti.engine.impl.UserQueryImpl;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.db.DbSqlSession;
import org.activiti.engine.impl.db.PersistentObject;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.AbstractManager;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Tom Baeyens
 * @author Saeid Mirzaei
 * @author Joram Barrez
 */
public class UserEntityManager extends AbstractManager implements UserIdentityManager {

  public User createNewUser(String userId) {
    return new UserEntity(userId);
  }

  public void insertUser(User user) {
    getDbSqlSession().insert((PersistentObject) user);
  }

  public void updateUser(UserEntity updatedUser) {
    CommandContext commandContext = Context.getCommandContext();
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.update(updatedUser);
  }

  public UserEntity findUserById(String userId) {
    return (UserEntity) getDbSqlSession().selectOne("selectUserById", userId);
  }

  @SuppressWarnings("unchecked")
  public void deleteUser(String userId) {
    UserEntity user = findUserById(userId);
    if (user != null) {
      List<IdentityInfoEntity> identityInfos = getDbSqlSession().selectList("selectIdentityInfoByUserId", userId);
      for (IdentityInfoEntity identityInfo: identityInfos) {
        getIdentityInfoManager().deleteIdentityInfo(identityInfo);
      }
      getDbSqlSession().delete("deleteMembershipsByUserId", userId);

      user.delete();
    }
  }

  @SuppressWarnings("unchecked")
  public List<User> findUserByQueryCriteria(UserQueryImpl query, Page page) {
    return getDbSqlSession().selectList("selectUserByQueryCriteria", query, page);
  }

  public long findUserCountByQueryCriteria(UserQueryImpl query) {
    return (Long) getDbSqlSession().selectOne("selectUserCountByQueryCriteria", query);
  }

  @SuppressWarnings("unchecked")
  public List<Group> findGroupsByUser(String userId) {
    return getDbSqlSession().selectList("selectGroupsByUserId", userId);
  }

  public UserQuery createNewUserQuery() {
    return new UserQueryImpl(Context.getProcessEngineConfiguration().getCommandExecutor());
  }

  public IdentityInfoEntity findUserInfoByUserIdAndKey(String userId, String key) {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("userId", userId);
    parameters.put("key", key);
    return (IdentityInfoEntity) getDbSqlSession().selectOne("selectIdentityInfoByUserIdAndKey", parameters);
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  public List<String> findUserInfoKeysByUserIdAndType(String userId, String type) {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("userId", userId);
    parameters.put("type", type);
    return (List) getDbSqlSession().getSqlSession().selectList("selectIdentityInfoKeysByUserIdAndType", parameters);
  }

  public Boolean checkPassword(String userId, String password) {
    User user = findUserById(userId);
    if ((user != null) && (password != null) && (password.equals(user.getPassword()))) {
      return true;
    }
    return false;
  }

  @SuppressWarnings("unchecked")
  public List<User> findPotentialStarterUsers(String proceDefId) {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("procDefId", proceDefId);
    return  (List<User>) getDbSqlSession().selectOne("selectUserByQueryCriteria", parameters);

  }

  @SuppressWarnings("unchecked")
  public List<User> findUsersByNativeQuery(Map<String, Object> parameterMap, int firstResult, int maxResults) {
    return getDbSqlSession().selectListWithRawParameter("selectUserByNativeQuery", parameterMap, firstResult, maxResults);
  }

  public long findUserCountByNativeQuery(Map<String, Object> parameterMap) {
    return (Long) getDbSqlSession().selectOne("selectUserCountByNativeQuery", parameterMap);
  }

}


text:
import { LocalRun, LocalRunProcess } from '@heroku/functions-core';
import { Disposable } from 'vscode';
import { channelService } from '../../../channels';
import { nls } from '../../../messages';
import { notificationService } from '../../../notifications';
import { telemetryService } from '../../../telemetry';
import { FunctionService, functionType } from '../functionService';
import {
  FUNCTION_DEFAULT_DEBUG_PORT,
  FUNCTION_DEFAULT_PORT
} from '../types/constants';
import { ForceFunctionStartExecutor } from './ForceFunctionStartExecutor';

export class ForceFunctionContainerlessStartExecutor extends ForceFunctionStartExecutor {
  private process: LocalRunProcess | undefined | void;

  public async setupFunctionListeners(): Promise<void> {
    console.log('No listeners for containerless function.');
  }

  public async cancelFunction(
    registeredStartedFunctionDisposable: Disposable
  ): Promise<void> {
    if (this.process && !this.process.cancelled) {
      this.process.cancel();
      this.process = undefined;
    }
    registeredStartedFunctionDisposable.dispose();
  }

  public async buildFunction(): Promise<void> {
    console.log('No build for containerless function');
  }

  public async startFunction(functionName: string, functionDirPath: string): Promise<void> {
    const functionLanguage = FunctionService.instance.getFunctionType();
    channelService.appendLine(
      `Starting ${functionName} of type ${functionLanguage}`
    );

    const localRun = new LocalRun(functionLanguage, {
      path: functionDirPath,
      port: FUNCTION_DEFAULT_PORT,
      debugPort: FUNCTION_DEFAULT_DEBUG_PORT
    });

    const debugType = functionLanguage === functionType.JAVA ? 'java' : 'node';
    FunctionService.instance.updateFunction(functionDirPath, debugType, true);

    this.process = await localRun.exec()
      .catch((err: Error) => {
        const errorNotificationMessage = nls.localize(
          this.UNEXPECTED_ERROR_KEY
        );
        telemetryService.sendException(this.UNEXPECTED_ERROR_KEY, err.message);
        notificationService.showErrorMessage(errorNotificationMessage);
        channelService.appendLine(errorNotificationMessage);
        if (err.message) {
          channelService.appendLine(err.message);
        }
        channelService.showChannelOutput();
      });
  }
}


text:
I'm the root of Nautilus plugins. You can get the list of Nautilus plugin using the Plugin Manager that you can find in the window menu (right menu on the window itself) of the Nautilus browser window.

!! How to create Nautilus-Plugins

Here we will give some brief explanations on how to create your own plugin. There are only two requirements
to create a Nautilus-Plugin:

- the class should inherit from ==AbstractNautilusPlugin==
- it should implement the method ==registerTo: aModel==

[[[
AbstractNautilusPlugin
]]]

!!! Announcement subscription

The method ==registerTo:== is used by the plugin to register itself to aModel announcements.

[[[
MyPlugin>>registerTo: aModel

    aModel announcer
   	 when: NautilusKeyPressed
	 send: #keyPressed:
	 to: self
]]]

In this example, the instance of ==MyPlugin== subscribes itself to ==NautilusKeyPressed==, and
tell aModel's announcer to send the message  ==keyPressed== to the instance.

So each time a key will be pressed in a Nautilus window the method ==keyPressed:== will be called.

!!! Display
If you want your plugin to add a graphical widget to Nautilus you should override the ==display== method.
This method should return the Morphic element you want Nautilus to display. By default the method returns nil to
notify Nautilus not to display anything.

[[[
MyPlugin>>display
    morph := LabelMorph new contents: 'MyPlugin';
        enabled: false;
		vResizing: #shrinkWrap;
		hResizing: #spaceFill;
		yourself.
	^ morph
]]]

You can also redefine the following methods on the class side:

- ==defaultPosition== defines the default position of the morph. Possible values are =={#top, #middle, #bottom, #none}==. The default value is ==#none==.

- ==possiblePositions== answers a collection of the possible positions the widget could adopt.

!!! Describing your plugin

And finally you can redefine the ==pluginName== method to change the name displayed in the Nautilus Plugin Manager.

[[[
MyPlugin class>>description
	^ 'MyPlugin'
]]]

[[[
MyPlugin class>>description
	^ 'A super cool plugin'
]]]


text:
package org.apache.sling.distribution.monitor.impl;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
 * Test case for {@link UserCredentialsDistributionTransportSecretMBean}
 */
public class UserCredentialsDistributionTransportSecretMBeanTest {

    @Test
    public void verifyMBeanExposedValues() {
        UserCredentialsDistributionTransportSecretMBean mBean = new UserCredentialsDistributionTransportSecretMBeanImpl("user");
        assertFalse(mBean.useAdministrativeTransport());

        mBean = new UserCredentialsDistributionTransportSecretMBeanImpl("admin");
        assertTrue(mBean.useAdministrativeTransport());
    }

}