text:
package com.panda.videoliveplatform.chat;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Typeface;
import android.os.Build.VERSION;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.View;
import android.view.View.BaseSavedState;
import android.view.View.OnClickListener;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.android.volley.DefaultRetryPolicy;
import com.panda.videoliveplatform.R;
import java.util.Locale;

@SuppressLint({"NewApi"})
public class PagerSlidingTabStrip extends HorizontalScrollView {
    private static final int[] ATTRS = new int[]{16842901, 16842904};
    private int currentPosition;
    private float currentPositionOffset;
    private LayoutParams defaultTabLayoutParams;
    public OnPageChangeListener delegatePageListener;
    private int dividerColor;
    private int dividerPadding;
    private Paint dividerPaint;
    private int dividerWidth;
    private LayoutParams expandedTabLayoutParams;
    private int indicatorColor;
    private int indicatorHeight;
    private int lastScrollX;
    private Locale locale;
    private final PageListener pageListener;
    private ViewPager pager;
    private Paint rectPaint;
    private int scrollOffset;
    private boolean shouldExpand;
    private int tabBackgroundResId;
    private int tabCount;
    private int tabPadding;
    private int tabTextColor;
    private int tabTextSize;
    private Typeface tabTypeface;
    private int tabTypefaceStyle;
    private LinearLayout tabsContainer;
    private boolean textAllCaps;
    private int underlineColor;
    private int underlineHeight;

    public interface IconTabProvider {
        int getPageIconResId(int i);
    }

    static class SavedState extends BaseSavedState {
        public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
            public SavedState createFromParcel(Parcel in) {
                return new SavedState(in);
            }

            public SavedState[] newArray(int size) {
                return new SavedState[size];
            }
        };
        int currentPosition;

        public SavedState(Parcelable superState) {
            super(superState);
        }

        private SavedState(Parcel in) {
            super(in);
            this.currentPosition = in.readInt();
        }

        public void writeToParcel(Parcel dest, int flags) {
            super.writeToParcel(dest, flags);
            dest.writeInt(this.currentPosition);
        }
    }

    private class PageListener implements OnPageChangeListener {
        private PageListener() {
        }

        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
            PagerSlidingTabStrip.this.currentPosition = position;
            PagerSlidingTabStrip.this.currentPositionOffset = positionOffset;
            PagerSlidingTabStrip.this.scrollToChild(position, (int) (((float) PagerSlidingTabStrip.this.tabsContainer.getChildAt(position).getWidth()) * positionOffset));
            PagerSlidingTabStrip.this.invalidate();
            if (PagerSlidingTabStrip.this.delegatePageListener != null) {
                PagerSlidingTabStrip.this.delegatePageListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
            }
        }

        public void onPageScrollStateChanged(int state) {
            if (state == 0) {
                PagerSlidingTabStrip.this.scrollToChild(PagerSlidingTabStrip.this.pager.getCurrentItem(), 0);
            }
            if (PagerSlidingTabStrip.this.delegatePageListener != null) {
                PagerSlidingTabStrip.this.delegatePageListener.onPageScrollStateChanged(state);
            }
        }

        public void onPageSelected(int position) {
            if (PagerSlidingTabStrip.this.delegatePageListener != null) {
                PagerSlidingTabStrip.this.delegatePageListener.onPageSelected(position);
            }
        }
    }

    public PagerSlidingTabStrip(Context context) {
        this(context, null);
    }

    public PagerSlidingTabStrip(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public PagerSlidingTabStrip(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.pageListener = new PageListener();
        this.currentPosition = 0;
        this.currentPositionOffset = 0.0f;
        this.indicatorColor = -10066330;
        this.underlineColor = 436207616;
        this.dividerColor = 436207616;
        this.shouldExpand = false;
        this.textAllCaps = true;
        this.scrollOffset = 52;
        this.indicatorHeight = 8;
        this.underlineHeight = 2;
        this.dividerPadding = 12;
        this.tabPadding = 24;
        this.dividerWidth = 1;
        this.tabTextSize = 12;
        this.tabTextColor = -10066330;
        this.tabTypeface = null;
        this.tabTypefaceStyle = 1;
        this.lastScrollX = 0;
        this.tabBackgroundResId = R.drawable.background_tab;
        setFillViewport(true);
        setWillNotDraw(false);
        this.tabsContainer = new LinearLayout(context);
        this.tabsContainer.setOrientation(0);
        this.tabsContainer.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        addView(this.tabsContainer);
        DisplayMetrics dm = getResources().getDisplayMetrics();
        this.scrollOffset = (int) TypedValue.applyDimension(1, (float) this.scrollOffset, dm);
        this.indicatorHeight = (int) TypedValue.applyDimension(1, (float) this.indicatorHeight, dm);
        this.underlineHeight = (int) TypedValue.applyDimension(1, (float) this.underlineHeight, dm);
        this.dividerPadding = (int) TypedValue.applyDimension(1, (float) this.dividerPadding, dm);
        this.tabPadding = (int) TypedValue.applyDimension(1, (float) this.tabPadding, dm);
        this.dividerWidth = (int) TypedValue.applyDimension(1, (float) this.dividerWidth, dm);
        this.tabTextSize = (int) TypedValue.applyDimension(2, (float) this.tabTextSize, dm);
//        TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
//        this.tabTextSize = a.getDimensionPixelSize(0, this.tabTextSize);
//        a.recycle();
//      a = context.obtainStyledAttributes(attrs, R.styleable.PagerSlidingTabStrip);

//        this.indicatorColor = a.getColor(0, this.indicatorColor);
//        this.underlineColor = a.getColor(1, this.underlineColor);
//        this.dividerColor = a.getColor(2, this.dividerColor);
//        this.indicatorHeight = a.getDimensionPixelSize(3, this.indicatorHeight);
//        this.underlineHeight = a.getDimensionPixelSize(4, this.underlineHeight);
//        this.dividerPadding = a.getDimensionPixelSize(5, this.dividerPadding);
//        this.tabPadding = a.getDimensionPixelSize(6, this.tabPadding);
//        this.tabBackgroundResId = a.getResourceId(8, this.tabBackgroundResId);
//        this.shouldExpand = a.getBoolean(9, this.shouldExpand);
//        this.scrollOffset = a.getDimensionPixelSize(7, this.scrollOffset);
//        this.textAllCaps = a.getBoolean(10, this.textAllCaps);
        //a.recycle();
        this.rectPaint = new Paint();
        this.rectPaint.setAntiAlias(true);
        this.rectPaint.setStyle(Style.FILL);
        this.dividerPaint = new Paint();
        this.dividerPaint.setAntiAlias(true);
        this.dividerPaint.setStrokeWidth((float) this.dividerWidth);
        this.defaultTabLayoutParams = new LayoutParams(-2, -1);
        this.expandedTabLayoutParams = new LayoutParams(0, -1, 1);
        if (this.locale == null) {
            this.locale = getResources().getConfiguration().locale;
        }
    }

    public void setViewPager(ViewPager pager) {
        this.pager = pager;
        if (pager.getAdapter() == null) {
            throw new IllegalStateException("ViewPager does not have adapter instance.");
        }
        pager.setOnPageChangeListener(this.pageListener);
        notifyDataSetChanged();
    }

    public void setOnPageChangeListener(OnPageChangeListener listener) {
        this.delegatePageListener = listener;
    }

    public void notifyDataSetChanged() {
        this.tabsContainer.removeAllViews();
        this.tabCount = this.pager.getAdapter().getCount();
        for (int i = 0; i < this.tabCount; i++) {
            if (this.pager.getAdapter() instanceof IconTabProvider) {
                addIconTab(i, ((IconTabProvider) this.pager.getAdapter()).getPageIconResId(i));
            } else {
                addTextTab(i, this.pager.getAdapter().getPageTitle(i).toString());
            }
        }
        updateTabStyles();
        getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @SuppressLint({"NewApi"})
            public void onGlobalLayout() {
                if (VERSION.SDK_INT < 16) {
                    PagerSlidingTabStrip.this.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                } else {
                    PagerSlidingTabStrip.this.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                }
                PagerSlidingTabStrip.this.currentPosition = PagerSlidingTabStrip.this.pager.getCurrentItem();
                PagerSlidingTabStrip.this.scrollToChild(PagerSlidingTabStrip.this.currentPosition, 0);
            }
        });
    }

    private void addTextTab(int position, String title) {
        TextView tab = new TextView(getContext());
        tab.setText(title);
        tab.setGravity(17);
        tab.setSingleLine();
        addTab(position, tab);
    }

    private void addIconTab(int position, int resId) {
        ImageButton tab = new ImageButton(getContext());
        tab.setImageResource(resId);
        addTab(position, tab);
    }

    private void addTab(final int position, View tab) {
        tab.setFocusable(true);
        tab.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                PagerSlidingTabStrip.this.pager.setCurrentItem(position);
            }
        });
        tab.setPadding(this.tabPadding, 0, this.tabPadding, 0);
        this.tabsContainer.addView(tab, position, this.shouldExpand ? this.expandedTabLayoutParams : this.defaultTabLayoutParams);
    }

    private void updateTabStyles() {
        for (int i = 0; i < this.tabCount; i++) {
            View v = this.tabsContainer.getChildAt(i);
            v.setBackgroundResource(this.tabBackgroundResId);
            if (v instanceof TextView) {
                TextView tab = (TextView) v;
                tab.setTextSize(0, (float) this.tabTextSize);
                tab.setTypeface(this.tabTypeface, this.tabTypefaceStyle);
                tab.setTextColor(this.tabTextColor);
                if (this.textAllCaps) {
                    if (VERSION.SDK_INT >= 14) {
                        tab.setAllCaps(true);
                    } else {
                        tab.setText(tab.getText().toString().toUpperCase(this.locale));
                    }
                }
            }
        }
    }

    private void scrollToChild(int position, int offset) {
        if (this.tabCount != 0) {
            int newScrollX = this.tabsContainer.getChildAt(position).getLeft() + offset;
            if (position > 0 || offset > 0) {
                newScrollX -= this.scrollOffset;
            }
            if (newScrollX != this.lastScrollX) {
                this.lastScrollX = newScrollX;
                scrollTo(newScrollX, 0);
            }
        }
    }

    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (!isInEditMode() && this.tabCount != 0) {
            int height = getHeight();
            this.rectPaint.setColor(this.indicatorColor);
            View currentTab = this.tabsContainer.getChildAt(this.currentPosition);
            float lineLeft = (float) currentTab.getLeft();
            float lineRight = (float) currentTab.getRight();
            if (this.currentPositionOffset > 0.0f && this.currentPosition < this.tabCount - 1) {
                View nextTab = this.tabsContainer.getChildAt(this.currentPosition + 1);
                lineLeft = (this.currentPositionOffset * ((float) nextTab.getLeft())) + ((DefaultRetryPolicy.DEFAULT_BACKOFF_MULT - this.currentPositionOffset) * lineLeft);
                lineRight = (this.currentPositionOffset * ((float) nextTab.getRight())) + ((DefaultRetryPolicy.DEFAULT_BACKOFF_MULT - this.currentPositionOffset) * lineRight);
            }
            canvas.drawRect(lineLeft, (float) (height - this.indicatorHeight), lineRight, (float) height, this.rectPaint);
            this.rectPaint.setColor(this.underlineColor);
            canvas.drawRect(0.0f, (float) (height - this.underlineHeight), (float) this.tabsContainer.getWidth(), (float) height, this.rectPaint);
            this.dividerPaint.setColor(this.dividerColor);
            for (int i = 0; i < this.tabCount - 1; i++) {
                View tab = this.tabsContainer.getChildAt(i);
                canvas.drawLine((float) tab.getRight(), (float) this.dividerPadding, (float) tab.getRight(), (float) (height - this.dividerPadding), this.dividerPaint);
            }
        }
    }

    public void setIndicatorColor(int indicatorColor) {
        this.indicatorColor = indicatorColor;
        invalidate();
    }

    public void setIndicatorColorResource(int resId) {
        this.indicatorColor = getResources().getColor(resId);
        invalidate();
    }

    public int getIndicatorColor() {
        return this.indicatorColor;
    }

    public void setIndicatorHeight(int indicatorLineHeightPx) {
        this.indicatorHeight = indicatorLineHeightPx;
        invalidate();
    }

    public int getIndicatorHeight() {
        return this.indicatorHeight;
    }

    public void setUnderlineColor(int underlineColor) {
        this.underlineColor = underlineColor;
        invalidate();
    }

    public void setUnderlineColorResource(int resId) {
        this.underlineColor = getResources().getColor(resId);
        invalidate();
    }

    public int getUnderlineColor() {
        return this.underlineColor;
    }

    public void setDividerColor(int dividerColor) {
        this.dividerColor = dividerColor;
        invalidate();
    }

    public void setDividerColorResource(int resId) {
        this.dividerColor = getResources().getColor(resId);
        invalidate();
    }

    public int getDividerColor() {
        return this.dividerColor;
    }

    public void setUnderlineHeight(int underlineHeightPx) {
        this.underlineHeight = underlineHeightPx;
        invalidate();
    }

    public int getUnderlineHeight() {
        return this.underlineHeight;
    }

    public void setDividerPadding(int dividerPaddingPx) {
        this.dividerPadding = dividerPaddingPx;
        invalidate();
    }

    public int getDividerPadding() {
        return this.dividerPadding;
    }

    public void setScrollOffset(int scrollOffsetPx) {
        this.scrollOffset = scrollOffsetPx;
        invalidate();
    }

    public int getScrollOffset() {
        return this.scrollOffset;
    }

    public void setShouldExpand(boolean shouldExpand) {
        this.shouldExpand = shouldExpand;
        requestLayout();
    }

    public boolean getShouldExpand() {
        return this.shouldExpand;
    }

    public boolean isTextAllCaps() {
        return this.textAllCaps;
    }

    public void setAllCaps(boolean textAllCaps) {
        this.textAllCaps = textAllCaps;
    }

    public void setTextSize(int textSizePx) {
        this.tabTextSize = textSizePx;
        updateTabStyles();
    }

    public int getTextSize() {
        return this.tabTextSize;
    }

    public void setTextColor(int textColor) {
        this.tabTextColor = textColor;
        updateTabStyles();
    }

    public void setTextColorResource(int resId) {
        this.tabTextColor = getResources().getColor(resId);
        updateTabStyles();
    }

    public int getTextColor() {
        return this.tabTextColor;
    }

    public void setTypeface(Typeface typeface, int style) {
        this.tabTypeface = typeface;
        this.tabTypefaceStyle = style;
        updateTabStyles();
    }

    public void setTabBackground(int resId) {
        this.tabBackgroundResId = resId;
    }

    public int getTabBackground() {
        return this.tabBackgroundResId;
    }

    public void setTabPaddingLeftRight(int paddingPx) {
        this.tabPadding = paddingPx;
        updateTabStyles();
    }

    public int getTabPaddingLeftRight() {
        return this.tabPadding;
    }

    public void onRestoreInstanceState(Parcelable state) {
        SavedState savedState = (SavedState) state;
        super.onRestoreInstanceState(savedState.getSuperState());
        this.currentPosition = savedState.currentPosition;
        requestLayout();
    }

    public Parcelable onSaveInstanceState() {
        SavedState savedState = new SavedState(super.onSaveInstanceState());
        savedState.currentPosition = this.currentPosition;
        return savedState;
    }
}


text:
using System;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
using GitHub.Extensions;
using GitHub.Models;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Threading;
using Task = System.Threading.Tasks.Task;

namespace GitHub.Services
{
    /// <summary>
    /// Stores a collection of known local repositories.
    /// </summary>
    /// <remarks>
    /// The list of repositories exposed here is the list of local repositories known to Team
    /// Explorer.
    /// </remarks>
    [Export(typeof(ILocalRepositories))]
    public class LocalRepositories : ILocalRepositories
    {
        readonly IVSGitServices vsGitServices;

        [ImportingConstructor]
        public LocalRepositories(IVSGitServices vsGitServices, [Import(AllowDefault = true)] JoinableTaskContext joinableTaskContext)
        {
            this.vsGitServices = vsGitServices;
            JoinableTaskContext = joinableTaskContext ?? ThreadHelper.JoinableTaskContext;
        }

        /// <inheritdoc/>
        public async Task Refresh()
        {
            await TaskScheduler.Default;
            var list = vsGitServices.GetKnownRepositories();
            await JoinableTaskContext.Factory.SwitchToMainThreadAsync();

            repositories.Except(list).ToList().ForEach(x => repositories.Remove(x));
            list.Except(repositories).ToList().ForEach(x => repositories.Add(x));
        }

        readonly ObservableCollectionEx<LocalRepositoryModel> repositories
            = new ObservableCollectionEx<LocalRepositoryModel>();

        /// <inheritdoc/>
        public IReadOnlyObservableCollection<LocalRepositoryModel> Repositories => repositories;

        JoinableTaskContext JoinableTaskContext { get; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

		<meta charset="utf-8">

		<title>AngularJS + Ionic - Amsterdam Conference</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/theme/default.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">
        <link rel="stylesheet" href="css/app.css">

        <link rel="stylesheet" href="bower_components/ionic/release/css/ionic.min.css"/>

Abstract

AngularJS is a Javascript framework for building amazing Web Applications (those called SPAs).

When it's needed to bring them to mobile devices, Cordova/PhoneGap helps the integration and Ionic, built on top of AngularJS, comes with a great set of CSS components and cool Javascript features!

$ whoami

Vincenzo Ferrari  >> Wilk

Fullstack Web Developer

Software Engineer at Ibuildings Italia

Open Source Supporter

Github

https://github.com/wilk

Contacts

Google+: +VincenzoFerrari

Twitter: @__wilky__

LinkedIn: Vincenzo Ferrari

Stackoverflow: wilk

Coderwall: wilk

                        thecodinglove.com

Motivation

Google

Vast community

bower.io/search/?q=angular : 4,991 matched results

ngmodules.org/ : 1,480 registered modules

stackoverflow.com/questions/tagged/angularjs : 102,280 questions tagged

google.com/#q=angularjs : 14,900,000 results

                Last update : 22 June 2015

Angular Overview

What's that?

AngularJS is a powerful JS framework for building advanced web applications and it comes with a lot of features:

It's highly modular: everything can be seen as a separated module!

It can be fully integrated with third party libraries

It was born as a MVC, MVVM, MVP framework

It's not meant to extend Javascript (you can continue develop with plain JS!)

What about extending the HTML vocabular instead?

Bootstrapping

// index.html
<!doctype html>
<html>
    <head>
        <script src="bower_components/angular/angular.js"></script>
        <script src="app/app.js"></script>
    </head>
    <body ng-app="module">
        {{10 + 20}}
    </body>
</html>
// app.js
angular.module('module', []);

One to Two-Way Data-Binding

Static DOM

Dynamic DOM

Template Engine

Why does Angular have a template engine?

                        RESTful single page web applications need to compile and render their markup.
                        This means that only raw data is sent/received to/from the network.

How does it work?

The template engine works in two phases:

Compile phase

Link phase

Compile Phase

The compiler ($compile) traverses the DOM and collects all of the directives. The result is a linking function

Link Phase

It combines the directives with a scope and produces a live view.

Code sample

// index.html
<html ng-app="MyModule">
    <body ng-controller="MyCtrl">
        <input ng-model="text" type="text" />
        <label>{{text}}</label>
        <button ng-click="templateSubmit()">{{btnText}}</button>
    </body>
</html>
// app.js
angular.module('MyModule', [])
    .controller('MyCtrl', ['$scope', function ($scope) {
        $scope.text = '';
        $scope.btnText = 'Submit';
        $scope.templateSubmit = function () {
            alert("text value is: " + $scope.text);
        };
}]);

                                    <input class="item item-input" ng-model="text" type="text" style="display: inline !important; margin-right: 15px;"/>
                                    [[text]]

                            <button class="button button-calm" ng-click="templateSubmit()">Submit</button>

Dependency Injection

What's DI?

                        Dependency Injection (DI) is a software design pattern that deals with how components get hold of their dependencies.

                        The Angular injector subsystem is in charge of creating components, resolving their dependencies, and providing them to other components as requested.

Dependencies

AngularJS lets you to inject various types of dependencies:

Angular built-in dependencies

Vendor dependencies

Personal dependencies

Code sample

                        Inline Array Annotation (preferred)

angular.controller('MyCtrl', ['$scope', '$location', function ($scope, $location) {
    // do something with $scope and $location services
}]);

                        $inject Property Annotation

var MyCtrl = function ($scope, $location) {
    // do something with $scope and $location services
};
MyCtrl.$inject = ['$scope', '$location'];
angular.controller('MyCtrl', MyCtrl);

                        Implicit Annotation

angular.controller('MyCtrl', function ($scope, $location) {
    // do something with $scope and $location services
});

Directives

What is a directive?

                        Directives are markers on a DOM element that tell AngularJS's HTML compiler to attach a specified behavior to that DOM element or even transform the DOM element and its children.

Built-in directives

Angular comes with several useful built-in directives, such as:

ngApp

ngController

ngModel

ngRepeat

ngClick

ngView

https://docs.angularjs.org/api/ng/directive

Built-in directives are identified by the ng namespace.

Built-in directives in detail - 1

ngClick | ngDblclick | ngInit

ngClick and ngDblclick attach a listener on click and dblclick event of the element, while ngInit is used to initialize a variable in the current scope.

<button ng-click="aCount = aCount + 1" ng-init="aCount = 10">Click me<button>
<button ng-dblclick="count = count + 1" ng-init="count = 0">Double click me<button>

                        <button class="button button-calm" style="width: 200px;" ng-click="singleCount = singleCount + 1" ng-init="singleCount = 10">Click me</button>
                        [[singleCount]]

                        <button class="button button-calm" style="width: 200px;" ng-dblclick="count = count + 1" ng-init="count = 0">Double click me</button>
                        [[count]]

Built-in directives in detail - 2

ngIf | ngSwitch

Some directives change the DOM structure based on a scope expression. ngIf removes or recreates a part of the DOM depending on the evaluation of the expression,
                    while the ngSwitch conditionally swap the DOM structure.

<input type="number" ng-model="value"/>
<small ng-if="value >= 0">Positive</small>

                        <input class="item item-input" style="display: inline !important;" type="number" ng-model="value"/>
                        = 0">Positive

<div ng-switch="selection">
    <div ng-switch-when="Go Lang">Go Lang</div>
    <div ng-switch-when="Dart">Dart</div>
    <div ng-switch-default>AngularJS</div>
</div>

                        <select ng-model="selection" ng-options="tool for tool in tools"></select>

                            Dart
                            Go Lang
                            AngularJS

Build your custom directives

https://docs.angularjs.org/guide/directive

                        One of the most powerful feature in AngularJS is the possibility to make custom directives.
                        Like other Angular components, a custom directive is just a module.

Code sample

angular.directive lets you to register a new custom directive:

angular.directive('myClock', ['$interval', 'dateFilter', function ($interval, dateFilter) {
    return {
        restrict: 'E',
        link: function (scope, element, attrs) {
            $interval(function () {
                element.text(dateFilter(new Date(), 'H:mm:ss'));
            }, 1000);
        }
    };
}]);
<my-clock></my-clock>

                    <my-clock></my-clock>

Filters

What is a filter?

                        A filter formats the value of an expression. They can be used in view templates, controllers or services and it is easy to define your own filter.

Built-in filters

AngularJS has several built-in filters:

currency

date

lowercase

uppercase

orderBy

https://docs.angularjs.org/api/ng/filter

Filters within templates

Filters can be applied to expressions in view templates using the following syntax:

{{ expression | filter }}

Filters may have arguments:

{{ expression | filter:argument1:argument2:... }}

It's possible to chain more filters:

{{ expression | filter1 | filter2 | ... }}

Filters within the application

Inject a dependency with the name <filterName>Filter to your controller/service/directive:

angular.controller('MyCtrl', ['dateFilter', function(dateFilter) {
    var date = dateFilter(new Date(), 'Ymd');
}]);

Built-in filters in detail - 1

Currency

Formats a number as a currency.

{{amount | currency:'€':2}} or currencyFilter(amount, '€', 2);
{{amount | currency:'$':2}} or currencyFilter(amount, '$', 2);
{{amount | currency:'£':2}} or currencyFilter(amount, '£', 2);

                            <input class="item item-input" style="margin: 0 auto !important; text-align: center;" type="number" ng-model="amount"/>
                            [[amount | currency:'€':2]]
                            [[amount | currency:'$':2]]
                            [[amount | currency:'£':2]]

Date

Formats date to a string based on the requested format.

{{today | date:'M/d/yyyy'}} or dateFilter(today, 'M/d/yyyy');

                            <input class="item item-input" style="margin: 0 auto !important;" type="date" ng-model="today"/>
                            [[today | date:'M/d/yyyy']]

Built-in filters in detail - 2

orderBy

Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers.

{{list | orderBy:predicate:reverse}} or orderByFilter(list, predicate, reverse);

                            <input type="checkbox" ng-model="reverse"/>
                            <select ng-model="predicate" ng-options="predicate for predicate in predicates"></select>

[[user.name]] - [[user.telephone]] - [[user.age]]

Define your custom filters

https://docs.angularjs.org/guide/filter

                        Writing your own filter is very easy: just register a new filter factory function with your module.
                        This factory function should return a new filter function which takes the input value as the first argument. Any filter arguments are passed in as additional arguments to the filter function.

Code sample

angular.filter lets you to register a new custom filter:

angular.filter('star', ['uppercaseFilter', function (uppercaseFilter) {
    return function (value, starNumber) {
        value = String(value);
        starNumber = starNumber || 0;
        var stars = '',
            result = [];

        for (var i = 0; i < starNumber; i++) stars += '*';
        result.push(stars);
        result.push(uppercaseFilter(value));
        result.push(stars);
        if (value && value.length > 0) return result.join(' ');
        else return '';
    };
}]);

<p>{{name | star:starNumber}}</p>

                            Stars: <input class="item item-input" style="display: inline !important;" type="number" ng-model="starNumber"/>
                            Name: <input class="item item-input" style="display: inline !important;" type="text" ng-model="name"/>

[[name | star:starNumber]]

Services

What's a service?

                        Angular services are substitutable objects that are wired together using dependency injection (DI). You can use services to organize and share code across your app.

Using a service

                        Angular has several built-in services and it's possible to use them with the Dependency Injection, like so:

angular.controller('MyCtrl', ['$http', function ($http) {
    $http.get('/user')
         .success(function (user) {
            // Use the user data
         })
         .error(function (err) {
            // Notify the error
         });
}]);

                        A service can be used where it's possible to use the DI: in other services, directives, controllers and filters.

Built-in services

AngularJS has several built-in services:

$http

$q

$location

$compile

$filter

https://docs.angularjs.org/api/ng/service

Built-in services in detail - 1

$http

The $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.

angular.controller('MyCtrl', ['$http', '$scope', function ($http, $scope) {
    $scope.getUser = function () {
        $http.get('/Users.json')
            .success(function (users) {
                $scope.users = users;
            });
    };
}]);

                        <button class="button button-calm" ng-click="getUsers()">Get Users</button>

                                Name
                                Telephone
                                Age

                                [[user.name]]
                                [[user.telephone]]
                                [[user.age]]

Built-in services in detail - 2

$location

The $location service parses the URL in the browser address bar (based on the window.location) and makes the URL available to your application. Changes to the URL in the address bar are reflected into $location service and changes to $location are reflected into the browser address bar.

angular.controller('MyCtrl', ['$scope', '$location', function ($scope, $location) {
    $scope.url = {};
    $scope.getUrl = function () {
        $scope.url.absUrl = $location.absUrl();
        $scope.url.url = $location.url();
        $scope.url.protocol = $location.protocol();
        $scope.url.host = $location.host();
        $scope.url.path = $location.path();
        $scope.url.port = $location.port();
    };
}]);

                        <button class="button button-calm" ng-click="getUrl()">Get Url</button>

[[url]]

Creating a custom service

                        angular.service allows to define a new service:

angular.service('Mario', ['$http', '$log', function ($http, $log) {
    this.salutation = function () {
        alert('Hi, I\'m Mario!');
    };
    this.findLuigi = function () {
        $http.get('/luigi')
            .success(function (luigi) {
                alert('I found you, Luigi!');
                $log.debug(luigi);
            });
    };
}])
.controller('MarioCtrl', ['Mario', function (Mario) {
    Mario.salutation();
    Mario.findLuigi();
}]);

                        <button class="button button-calm" ng-click="salutation()">Salutation</button>
                        <button class="button button-calm" ng-click="findLuigi()">Find Luigi</button>

Angular-UI

http://angular-ui.github.io/

Chemical Composition

Angular-UI is a suite that comes with a set of libraries for Angular:

UI Utils

UI Modules

UI Bootstrap

NG Grid

UI Router

UI Utils

http://angular-ui.github.io/ui-utils/

A utility package with no external dependencies: each module is contained in this package but can be included individually.

UI Modules

Standalone AngularUI modules with external dependencies:

ui-ace: Ace IDE module

ui-calendar: web calendar view module

ui-map: Google Maps module

ui-date: module for a date picker

UI Bootstrap

http://angular-ui.github.io/bootstrap/

                        Twitter Bootstrap written natively in AngularJS.
                        This repository contains a set of native AngularJS directives based on Bootstrap's markup and CSS.
                        As a result no dependency on jQuery or Bootstrap's JavaScript is required.

ngGrid

http://angular-ui.github.io/ng-grid/

                        Grid virtualization written natively in AngularJS and JQuery.
                        ngGrid comes as an attribute requiring a configuration object:

// views/grid.html
<div class="gridStyle" ng-grid="gridOptions"></div>

// app.js
angular.module('MyModule', ['ui.grid'])
    .controller('MyCtrl', ['$scope', function ($scope) {
        $scope.myData = [
            {name: "Moroni", age: 50},
            {name: "Tiancum", age: 43},
            {name: "Jacob", age: 27},
            {name: "Nephi", age: 29},
            {name: "Enos", age: 34}
        ];
        $scope.gridOptions = {data: 'myData'};
    }]);

Conclusion

Why Angular?

Open Source

Highly Modular

Multi Pattern (MVC, MVVM, MVP: MVW)

Template Engine (with custom filters)

Extend the HTML (directives)

Reuse code (services)

Built with testability in mind

Pure Javascript

Tons of modules and documentations

Best for single page web application

Ionic Framework

http://ionicframework.com/

What is it?

Free and open source, Ionic offers a library of mobile-optimized HTML, CSS and JS components, gestures, and tools for building highly interactive native/hybrid apps. Built with Sass and optimized for AngularJS.

What is it composed of?

It's composed of:

AngularJS: the Javascript part is satisfied by Angular

CSS/SASS: a set of CSS/SASS classes that can be overridden by new ones

Ionic Client: a tool built with NodeJS that helps you with your project

External features

The Ionic team is developing a set of useful services all around the platform:

Ionic Creator: a handy web UI designer

Ionic Push: a set of APIs for sending Push Notifications to every platform

Ionic Learn: videos, tutorials, and formulas built and maintained directly by the core team

Ionic View: test and share your applications without ever going through the App Store

Ionic.io: a web platform that contains all of these services

Components

Buttons

<button class="button button-block button-stable">
    button-stable
</button>

<button class="button button-block button-positive">
    button-positive
</button>

<button class="button button-block button-calm">
    button-calm
</button>

<button class="button button-block button-balanced">
    button-balanced
</button>

                                <button class="button button-block button-stable">button-stable</button>
                                <button class="button button-block button-positive">button-positive</button>
                                <button class="button button-block button-calm">button-calm</button>
                                <button class="button button-block button-balanced">button-balanced</button>
                                <button class="button button-block button-energized">button-energized</button>
                                <button class="button button-block button-assertive">button-assertive</button>
                                <button class="button button-block button-royal">button-royal</button>
                                <button class="button button-block button-dark">button-dark</button>

Lists

        Check mail

        Call Ma

        Record album

          Grammy

                                        Check mail

                                        Call Ma

                                        Record album

                                          Grammy

                                        Friends
                                        0

                                        Activities

                                        Breaking Bad

                                          Blue, yellow, pink

                                        Music

                                          JT

                                        Games

                                          Super Mario

                                        Shopping

Cards

Marty McFly

November 05, 1955

            This is a "Facebook" styled Card. The header is created from a Thumbnail List item,
            the content is from a card-body consisting of an image and paragraph text. The footer
            consists of tabs, icons aligned left, within the card-footer.

            1 Like
            5 Comments

            Like

            Comment

            Share

Forms

        First Name
        <input type="text" placeholder="John">

        Last Name
        <input type="text" placeholder="Suhr">

        Email
        <input type="text" placeholder="john@suhr.com">

        Age
        <input type="number" placeholder="27">

    <button class="button button-block button-positive">Create Account</button>

                                        First Name
                                        <input type="text" placeholder="John">

                                        Last Name
                                        <input type="text" placeholder="Suhr">

                                        Email
                                        <input type="text" placeholder="john@suhr.com">

                                        Age
                                        <input type="number" placeholder="27">

                                    <button class="button button-block button-positive">Create Account</button>

Components

http://ionicframework.com/docs/components/

Ionic comes with serveral useful components:

header and footer bars

buttons (with icons)

lists

cards

forms

HTML5 input types

tab panels

grids

Javascript and HTML Features

Popup

angular.module('app', ['ionic'])
    .controller('ctrl', ['$scope', '$ionicPopup', '$timeout', function ($scope, $ionicPopup, $timeout) {
        $scope.showPopup = function() {
            $scope.data = {};

            var myPopup = $ionicPopup.show({
                template: '<input type="password" ng-model="data.wifi">',
                title: 'Enter Wi-Fi Password',
                subTitle: 'Please use normal things',
                scope: $scope,
                buttons: [
                    { text: 'Cancel' },
                    {
                        text: 'Save',
                        type: 'button-positive',
                    }
                ]
            });

            $scope.showConfirm = function() {
                var confirmPopup = $ionicPopup.confirm({
                title: 'Consume Ice Cream',
                template: 'Are you sure you want to eat this ice cream?'
            });

            $scope.showAlert = function() {
                var alertPopup = $ionicPopup.alert({
                    title: 'Don\'t eat that!',
                    template: 'It might taste good'
                });
            };
        }]);

Tabs

angular.module('app', ['ionic'])
    .config(function($stateProvider, $urlRouterProvider) {
        $stateProvider
            .state('tabs', {
                url: "/tab",
                abstract: true,
                templateUrl: "templates/tabs.html"
            })
            .state('tabs.home', {
                url: "/home",
                views: {
                    'home-tab': {
                        templateUrl: "templates/home.html",
                        controller: 'HomeTabCtrl'
                    }
                }
            })
            .state('tabs.facts', {
                url: "/facts",
                views: {
                    'home-tab': {
                        templateUrl: "templates/facts.html"
                    }
                }
            })
            .state('tabs.facts2', {
                url: "/facts2",
                views: {
                    'home-tab': {
                        templateUrl: "templates/facts2.html"
                    }
                }
            })
            .state('tabs.about', {
                url: "/about",
                views: {
                    'about-tab': {
                        templateUrl: "templates/about.html"
                    }
                }
            })
            .state('tabs.navstack', {
                url: "/navstack",
                views: {
                    'about-tab': {
                        templateUrl: "templates/nav-stack.html"
                    }
                }
            })
            .state('tabs.contact', {
                url: "/contact",
                views: {
                    'contact-tab': {
                        templateUrl: "templates/contact.html"
                    }
                }
            });
            $urlRouterProvider.otherwise("/tab/home");
        })
        .controller('HomeTabCtrl', [function () {}]);

Features

http://ionicframework.com/docs/api/

CSS components are not the only important thing. Ionic has got lots of Javascript features:

action sheet

events

lists

gestures

navigation

utility

Ionic Client

                    https://github.com/driftyco/ionic-cli

What's provided?

Ionic Client provides a set of useful commands and makes it easy to start, build, run and emulate Ionic apps.

Current version: 1.5.5

Install it globally via NPM:

# npm install -g ionic

Features

Use it during development to avoid boilerplates and to setup the environment:

$ ionic start mySuperApp tabs
$ ionic serve

Use it to mobile support:

$ ionic platform add android
$ ionic build android
$ ionic emulate android

Getting started

Try it out!

$ sudo npm install -g cordova ionic
$ ionic start myAwesomeApp tabs
$ cd myAwesomeApp
$ ionic setup sass
$ ionic serve
$ ionic platform add android
$ ionic build android
$ ionic emulate android

ngCordova

Working with the OS

                        ngCordova is a collection of 63+ AngularJS extensions on top of the Cordova API that make it easy to build, test, and deploy Cordova mobile apps with AngularJS.

Available plugins

Following a list of available plugins:

Camera

Contacts

Geolocation

Preferences

Push Notifications

http://ngcordova.com/docs/plugins/

Getting started

Install it via bower:

$ bower install ngCordova

Include it in your index.html:

Then, use it in your application:

angular.module('mySuperApp', ['ionic', 'ngCordova']);
    .controller('aCtrl', ['$ionicPlatform', '$cordovaCamera', function ($ionicPlatform, $cordovaCamera) {
        $ionicPlatform.ready(function () {
            $cordovaCamera.getPicture(options).then(function(imageData) {
                var image = document.getElementById('myImage');
                image.src = "data:image/jpeg;base64," + imageData;
            });
        });
    }]);

Conclusion

Why Ionic?

Open Source

Built on top of AngularJS

It helps for creating native/hybrid mobile web apps

Highly integrated with Cordova

Huge features set (directives, services, providers)

It comes with handy tools

Tons of modules and documentations

Thank you!

Questions?


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.CardView
        android:id="@+id/cv_main"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/card_margin"
        style="@style/MainCardView" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/iv_poster"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:layout_centerInParent="true" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TextView
                    android:id="@+id/tv_poster_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:scrollHorizontally="true"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    style="@style/PosterTextAppearance" />

                <TextView
                    android:id="@+id/tv_rate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below= "@id/tv_poster_title"
                    android:textColor="@color/light_ratetext"
                    style="@style/PosterTextAppearance" />
            </RelativeLayout>
        </LinearLayout>
    </android.support.v7.widget.CardView>

</LinearLayout>


text:
import * as React from 'react';
import { Link } from 'react-router';

import * as css from './style.scss';

interface Props{};
interface State{};

class Logo extends React.Component<Props, State> {
  render() {
    return (
      <h1 className={css.logo}>
        <Link to="/">PyJobs</Link>
      </h1>
    );
  }
}

export default Logo;


text:
if [ ! -n "$1" ]; then
    echo -e "please input ali mirror code: like \[atnqc8bo\]"
    exit 1
fi

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/mirror.conf <<-'EOF'
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --registry-mirror=https://{$1}.mirror.aliyuncs.com
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker


text:
namespace realm {
namespace partial_sync {

// Enum describing the various states a partial sync subscription can have.
enum class SubscriptionState : int8_t {
    Error = -1,      // An error occurred while creating or processing the partial sync subscription.
    Creating = 2,    // The subscription is being created.
    Pending = 0,     // The subscription was created, but has not yet been processed by the sync server.
    Complete = 1,    // The subscription has been processed by the sync server and data is being synced to the device.
    Invalidated = 3, // The subscription has been removed.
};

}
}

#endif // REALM_OS_SUBSCRIPTION_STATE_HPP


text:
#ifndef CHAIDTREENODEDATA_H__
#define CHAIDTREENODEDATA_H__

#include <shogun/lib/config.h>

namespace shogun
{
/** @brief structure to store data of a node of
 * CHAID. This can be used as a template type in
 * TreeMachineNode class. CHAID algorithm uses nodes
 * of type CTreeMachineNode<CHAIDTreeNodeData>
 */
struct CHAIDTreeNodeData
{
	/** classifying attribute */
	int32_t attribute_id;

	/** distinct feature values possible for attribute_id */
	SGVector<float64_t> distinct_features;

	/** class to which each distinct feature type is assigned */
	SGVector<int32_t> feature_class;

	/** label representative of data in node */
	float64_t node_label;

	/** total weight of training samples passing through this node **/
	float64_t total_weight;

	/** total weight of misclassified samples in node **/
	float64_t weight_minus_node;

	/** constructor */
	CHAIDTreeNodeData()
	{
		attribute_id=-1;
		distinct_features=SGVector<float64_t>();
		feature_class=SGVector<int32_t>();
		node_label=-1.0;
		total_weight=0.;
		weight_minus_node=0.;
	}
};

template<class T>
constexpr void register_params(CHAIDTreeNodeData& n, T* o)
{
	o->watch_param("attribute_id", &n.attribute_id, AnyParameterProperties("classifying feature index"));
	o->watch_param("distinct_features", &n.distinct_features, AnyParameterProperties("distinct feature values possible for attribute_id"));
	o->watch_param("feature_class", &n.feature_class, AnyParameterProperties("class to which each distinct feature type is assigned"));
	o->watch_param("node_label", &n.node_label, AnyParameterProperties("node label"));
	o->watch_param("total_weight", &n.total_weight, AnyParameterProperties("total weight"));
	o->watch_param("weight_minus_node", &n.weight_minus_node,
		AnyParameterProperties("total weight of misclassified samples in node"));
}

} /* shogun */

#endif /* CHAIDTREENODEDATA_H__ */


text:
package br.com.integrador.backend.controller;

import br.com.integrador.backend.model.PersistableEntity;
import br.com.integrador.backend.service.AbstractService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.persistence.EntityNotFoundException;
import java.util.List;

public abstract class AbstractController<T extends PersistableEntity> implements RestCallable<T> {

    private AbstractService<T> service;

    public AbstractController(AbstractService<T> service) {
        this.service = service;
    }

    @Override
    public T saveOrUpdate(T entity, Errors errors) {
        return service.saveOrUpdate(entity, errors);
    }

    @Override
    public T findOne(Long id) {
        T found = service.findOne(id);
        if (found == null) throw new EntityNotFoundException();

        return found;
    }

    @Override
    public List<T> findAll() {
        return service.findAll();
    }

    @Override
    public void delete(Long id) {
        service.deleteOne(id);
    }

    @ExceptionHandler(EntityNotFoundException.class)
    ResponseEntity<String> handleNotFoundErrors(Exception e) {
        return new ResponseEntity<String>(e.getMessage(), HttpStatus.NOT_FOUND);
    }
}


text:
define(function() {
    return {
        dependencies: ['openseadragon']
    };
});


text:
<?php

namespace luya\theme;

use yii\base\InvalidConfigException;

/**
 * Extend the yii2 theme component and build up the `$pathMap` depends on given {{\luya\theme\ThemeConfig}} which include parents inheritance.
 *
 * @property string $layout
 * @property string $viewPath
 * @property string $layoutPath
 * @property string $resourcePath
 *
 * @see \luya\theme\ThemeConfig
 * @author Bennet Klarhoelter <boehsermoe@me.com>
 * @since 1.0.21
 */
class Theme extends \yii\base\Theme
{
    public const LAYOUTS_PATH = 'layouts';

    private $_config;

    /**
     * Theme constructor with a configuration as {{\luya\theme\ThemeConfig}} object.
     *
     * @param ThemeConfig $config configuration for this theme.
     */
    public function __construct(ThemeConfig $config)
    {
        $this->_config = $config;
        parent::__construct(['basePath' => $config->getBasePath()]);
    }

    /**
     * Initialize the theme.
     *
     * @throws InvalidConfigException
     */
    public function init()
    {
        if ($this->getBasePath() === null) {
            throw new InvalidConfigException("Property base path must be set");
        }

        $this->initPathMap($this->_config);

        parent::init();
    }

    /**
     * Init the path mapping include the parent themes
     */
    protected function initPathMap(ThemeConfig $themeConfig)
    {
        $pathMap = ['@app/views', $themeConfig->getViewPath()];

        $viewPath = $this->getViewPath();
        $this->pathMap[$viewPath] = &$pathMap;

        foreach ($themeConfig->getParents() as $parentConfig) {
            $pathMap[] = $parentConfig->getViewPath();
            $this->pathMap[$parentConfig->getViewPath()] = &$pathMap;
        }

        $additionalPathMap = $this->getAdditionalPathMap($themeConfig);
        foreach ($additionalPathMap as $from) {
            $this->pathMap[$from] = $pathMap;
        }

        $pos = strpos($viewPath, '/');
        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views');
        $this->pathMap[$rootPath] = $pathMap;

        $this->pathMap['@app/views'] = $pathMap;
    }

    protected $_layout = 'theme';

    /**
     * The name of the layout to be applied to this theme views.
     *
     * @return string Default `theme`
     */
    public function getLayout()
    {
        return $this->_layout;
    }

    /**
     * Path to the directory that contains the theme views.
     *
     * @return string
     */
    public function getViewPath()
    {
        return $this->getConfig()->getViewPath();
    }

    /**
     * Path to the directory that contains the theme layouts.
     *
     * @return string
     */
    public function getLayoutPath()
    {
        return $this->viewPath . '/' . self::LAYOUTS_PATH;
    }

    /**
     * Theme configuration that contains the base theme information.
     *
     * @return ThemeConfig
     */
    public function getConfig()
    {
        return $this->_config;
    }

    /**
     * @param ThemeConfig $themeConfig
     *
     * @return array
     * @throws InvalidConfigException
     * @throws \luya\Exception
     */
    protected function getAdditionalPathMap(ThemeConfig $themeConfig)
    {
        $pathMap = $themeConfig->pathMap;

        $parentConfig = $themeConfig->getParent();
        if ($parentConfig) {
            $pathMap = array_merge($pathMap, $this->getAdditionalPathMap($parentConfig));
        }

        return $pathMap;
    }
}


text:
<?php

namespace MonologModule\Handler\Options;

use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
use Monolog\Handler\HandlerInterface;

class FingersCrossedHandlerOptions extends CommonHandlerOptions
{
    /**
     * @var string|HandlerInterface
     */
    protected $handler;

    /**
     * @var int|string|ActivationStrategyInterface
     */
    protected $activationStrategy;

    /**
     * @var int
     */
    protected $bufferSize = 0;

    /**
     * @var bool
     */
    protected $stopBuffering = true;

    /**
     * @var int
     */
    protected $passthruLevel;

    /**
     * @param string $handler
     */
    public function setHandler($handler)
    {
        $this->handler = $handler;
    }

    /**
     * @return HandlerInterface|string
     */
    public function getHandler()
    {
        return $this->handler;
    }

    /**
     * @param string $activationStrategy
     */
    public function setActivationStrategy($activationStrategy)
    {
        $this->activationStrategy = $activationStrategy;
    }

    /**
     * @return string
     */
    public function getActivationStrategy()
    {
        return $this->activationStrategy;
    }

    /**
     * @param int $bufferSize
     */
    public function setBufferSize($bufferSize)
    {
        $this->bufferSize = $bufferSize;
    }

    /**
     * @return int
     */
    public function getBufferSize()
    {
        return $this->bufferSize;
    }

    /**
     * @param bool $stopBuffering
     */
    public function setStopBuffering($stopBuffering)
    {
        $this->stopBuffering = $stopBuffering;
    }

    /**
     * @return bool
     */
    public function getStopBuffering()
    {
        return $this->stopBuffering;
    }

    /**
     * @param int $passthruLevel
     */
    public function setPassthruLevel($passthruLevel)
    {
        $this->passthruLevel = $passthruLevel;
    }

    /**
     * @return int
     */
    public function getPassthruLevel()
    {
        return $this->passthruLevel;
    }
}


text:
#ifndef __BASE_PROCESSOR_HH__
#define __BASE_PROCESSOR_HH__

#include <map>
#include <iostream>
#include "bgcc.h"

#include "processor.h"
#include "exception.h"

namespace bgcc {

    class BaseProcessor : virtual public bgcc::IProcessor, public bgcc::Exception {
    public:
        BaseProcessor();

        virtual ~BaseProcessor(){};

        virtual int32_t process(
                char* request,
                int32_t request_len,
                SharedPointer<IProtocol> proto);
    protected:
        virtual int32_t do_function__(
                char* request,
                int32_t request_len,
                SharedPointer<IProtocol> proto,
                const std::string& fname,
                int32_t seqid);

    private:
        virtual std::string get_name() const;

        int32_t do___get_ticket_id(
                char* request,
                int32_t request_len,
                SharedPointer<IProtocol> proto,
                int32_t seqid);

        int32_t do___service_not_found(
                char* request,
                int32_t request_len,
                SharedPointer<IProtocol> proto,
                int32_t seqid);

        typedef int32_t (BaseProcessor::* do_function_ptr)(
                char* request,
                int32_t request_len,
                SharedPointer<IProtocol> proto,
                int32_t seqid);
        std::map<std::string, do_function_ptr> __fun_map;

	protected:
		const static char * PROXY_NAME;
		const static char * PEER_IP;
		const static char * PEER_PORT;
    };

} // namespace

#endif //__BASE_SERVICES_HH__


text:
package io.datakernel.examples;

import com.google.inject.*;
import com.google.inject.name.Named;
import io.datakernel.async.SettableStage;
import io.datakernel.async.Stage;
import io.datakernel.config.Config;
import io.datakernel.config.ConfigModule;
import io.datakernel.eventloop.Eventloop;
import io.datakernel.launcher.Launcher;
import io.datakernel.rpc.client.RpcClient;
import io.datakernel.rpc.server.RpcServer;
import io.datakernel.service.ServiceGraphModule;

import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;

import static io.datakernel.config.ConfigConverters.*;
import static io.datakernel.eventloop.FatalErrorHandlers.rethrowOnAnyError;
import static io.datakernel.rpc.client.sender.RpcStrategies.server;
import static java.util.Arrays.asList;

public class RpcBenchmark extends Launcher {

	private final static int MAX_REQUESTS = 1000000;
	private final static int WARMUP_ROUNDS = 1;
	private final static int BENCHMARK_ROUNDS = 3;
	private final static int SERVICE_PORT = 25565;
	private final static int REQUESTS_PER_TIME = 1000;
	private final static boolean GENERATE_FILE = false;

	@Inject
	private RpcClient rpcClient;

	@Inject
	@Named("client")
	private Eventloop eventloop;

	@Inject
	private Config config;

	@Override
	protected Collection<Module> getModules() {
		return asList(
				ConfigModule.create(Config.create()
						.with("rpc.server.port", "" + SERVICE_PORT)
						.with("benchmark.warmupRounds", "" + WARMUP_ROUNDS)
						.with("benchmark.benchmarkRounds", "" + BENCHMARK_ROUNDS)
						.with("benchmark.requestsPerTime", "" + REQUESTS_PER_TIME)
						.with("benchmark.maxRequests", "" + MAX_REQUESTS)
						.with("benchmark.generateFile", "" + GENERATE_FILE)
						.override(Config.ofProperties(System.getProperties()))),
				ServiceGraphModule.defaultInstance(),
				new AbstractModule() {
					@Provides
					@Singleton
					@Named("client")
					Eventloop eventloopClient() {
						return Eventloop.create()
								.withFatalErrorHandler(rethrowOnAnyError());
					}

					@Provides
					@Singleton
					@Named("server")
					Eventloop eventloopServer() {
						return Eventloop.create()
								.withFatalErrorHandler(rethrowOnAnyError());
					}

					@Provides
					@Singleton
					public RpcClient rpcClient(@Named("client") Eventloop eventloop, Config config) {
						return RpcClient.create(eventloop)
								.withMessageTypes(String.class)
								.withStrategy(server(new InetSocketAddress(config.get(ofInteger(), "rpc.server.port"))));
					}

					@Provides
					@Singleton
					public RpcServer rpcServer(@Named("server") Eventloop eventloop, Config config) {
						return RpcServer.create(eventloop)
								.withListenPort(config.get(ofInteger(), "rpc.server.port"))
								.withMessageTypes(String.class)
								.withHandler(String.class, String.class, req -> Stage.of("Returning: " + req));

					}
				}
		);
	}

	private boolean generateFile;
	private int warmupRounds;
	private int benchmarkRounds;
	private long maxRequests;
	private int requestsPerTime;
	private int treshold;

	@Override
	protected void onStart() {
		generateFile = config.get(ofBoolean(),"benchmark.generateFile");
		warmupRounds = config.get(ofInteger(), "benchmark.warmupRounds");
		benchmarkRounds = config.get(ofInteger(), "benchmark.benchmarkRounds");
		maxRequests = config.get(ofLong(), "benchmark.maxRequests");
		requestsPerTime = config.get(ofInteger(), "benchmark.requestsPerTime");
		treshold = config.get(ofInteger(), "benchmark.requestsPerTime");
		maxRequests = config.get(ofLong(), "benchmark.maxRequests");
	}

	@Override
	protected void run() throws Exception {
		PrintWriter resultsFile = null;
		long time = 0;
		long bestTime = -1;
		long worstTime = -1;

		if (generateFile) {
			resultsFile = new PrintWriter("benchmarkResult" + Timestamp.from(Instant.now()), "UTF-8");
			resultsFile.println("
");
			resultsFile.println("
");
			resultsFile.println("    ApacheBench parameters	");
			resultsFile.println("    Time	");
			resultsFile.println("    Average time	");
			resultsFile.println("    Best time	");
			resultsFile.println("    Worst time	");
			resultsFile.println("    Requests per second	");
			resultsFile.println("
");
		}

		if (warmupRounds > 0) {
			System.out.println("Warming up for " + warmupRounds + " rounds.");
		}

		for (int i = 0; i < warmupRounds; i++) {
			round();
		}

		System.out.println("Benchmarking...");
		long roundTime;

		for (int i = 0; i < benchmarkRounds; i++) {

			roundTime = round();

			time += roundTime;

			if (bestTime == -1 || roundTime < bestTime) {
				bestTime = roundTime;
			}

			if (worstTime == -1 || roundTime > worstTime) {
				worstTime = roundTime;
			}

			System.out.println("Round: " + (i + 1) + "; Round time: " + roundTime + "ms");
		}
		double avgTime = time / benchmarkRounds;
		long requestsPerSecond = (long) (maxRequests / avgTime * 1000);
		System.out.println("Time: " + time + "ms; Average time: " + avgTime + "ms; Best time: " +
				bestTime + "ms; Worst time: " + worstTime + "ms; Requests per second: " + requestsPerSecond);
		if (generateFile) {
			resultsFile.println("     -k -c " + requestsPerTime + "	");
			resultsFile.println("    " + avgTime + "	");
			resultsFile.println("    " + bestTime + "	");
			resultsFile.println("    " + worstTime + "	");
			resultsFile.println("    " + requestsPerSecond + "	");
			resultsFile.println("
");
			resultsFile.close();
			resultsFile.println("
");
		}
	}

	private long round() throws Exception {
		CompletableFuture<Long> future = eventloop.submit(this::benchmark);
		return future.get();
	}

	private static final class Counters {
		/**
		 * First counter represents amount of sent requests, so we know when to stop sending them
		 * Second counter represents amount of completed requests(in another words completed will be incremented when
		 * request fails or completes successfully) so we know when to stop round of benchmark
		 */
		int sent;
		int completed;
	}

	private Stage<Long> benchmark() {
		SettableStage<Long> stage = SettableStage.create();

		long start = System.currentTimeMillis();

		Counters counters = new Counters();

		for (int i = 0; i < treshold; i++) {
			sendRequest(stage, counters, maxRequests);
		}

		return stage.thenApply($ -> System.currentTimeMillis() - start);
	}

	private void sendRequest(SettableStage<Long> stage, Counters counters, long maxRequests) {
		// Stop when we sent required amount of requests
		if (counters.sent == maxRequests) {
			return;
		}

		++counters.sent;

		rpcClient.sendRequest("Hello world" + counters.sent, 1000)
				.whenComplete((res, exc) -> {
					++counters.completed;

					// Stop round
					if (counters.completed == maxRequests) {
						stage.set(null);
						return;
					}

					sendRequest(stage, counters, maxRequests);
				});
	}

	public static void main(String[] args) throws Exception {
		RpcBenchmark benchmark = new RpcBenchmark();
		benchmark.launch(true, args);
	}
}


text:
{% load static %}
{% get_static_prefix as STATIC_PREFIX %}
<!DOCTYPE html>

        <meta name="viewport" content="width=device-width" />
        <meta name="author" content="Rishabh Roy" />
        <meta name="description" content="The Block is a location-based social network that allows you to interact with the world around you in a new way. The Block allows you to make posts or create events for your local 'block' (the square mile around you). Everything is open: any post you make is visible by anyone, as is any event you make." />
        <link rel="icon" type="icon/png" href="{{ STATIC_PREFIX }}images/favicon.png" />
        <link rel="shortcut icon" href="{{ STATIC_PREFIX }}images/favicon.ico" />
        <link rel="image_src" href="{{ STATIC_PREFIX }}images/fb.png" />
        <link rel="stylesheet" href="{{ STATIC_PREFIX }}static/default.css?kkjfk" />
        <link rel="stylesheet" href="{{ STATIC_PREFIX }}static/bootstrap.min.css?kjdk" />

        {% block links %}{% endblock %}
        <title>{% block title %}The Block{% endblock %}</title>

                        {% if not request.user.is_authenticated %}

                        {% else %}

                        {% endif %}

                    The Block

                    The Block

                    {% if request.user.is_authenticated %}

                    {{ request.user.first_name }} {{ request.user.last_name }}

                        Account

                    {% endif %}

                        {% if not request.user.is_authenticated %}

                        <form class="navbar-search pull-right form-inline desktop_only" name="login" action="/desktop/users/login/" method="post">
                            <input type="email" class="span2" name="email" placeholder="Email" />
                            <input type="password" class="span2" name="password" placeholder="Password" />
                            <input type="submit" class="btn btn-success" value="Login" />
                        </form>
                        {% else %}
                        Logout
                        {% endif %}

            {% block content %}
            {{ error }}
            {% endblock %}

        Made by Rishabh Roy © 2014| Feedback


text:
<?php

use LaravelFlare\Flare\Admin\Admin;
use LaravelFlare\Flare\Tests\BaseTest;

class AbstractAdminTest extends BaseTest
{
    public function test_get_class_short_name()
    {
        $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

        $reflection = new ReflectionClass($stub);

        $this->assertEquals($stub->shortName(), $reflection->getshortName());
        $this->assertEquals($stub->shortName(), 'SampleClassName');
    }

    public function test_convert_classname_to_title_when_no_title_defined()
    {
        $testAndResultArray = [
                                'Admin' => 'Admin',
                                'lowercase' => 'Lowercase',
                                'SampleAdmin' => 'Sample Admin',
                                'UPPERCASE' => 'U P P E R C A S E',
                                'lowercaseClassName' => 'Lowercase Class Name',
                                'AnotherAdminSection' => 'Another Admin Section',
                                'snake_case_classname' => 'Snake Case Classname',
                                'snakes_and_CamelCase' => 'Snakes And  Camel Case',
                            ];

        foreach ($testAndResultArray as $testClassName => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], $testClassName);

            $this->assertEquals($stub->title(), $expectedResult);
        }
    }

    public function test_title_returns_defined_title_when_defined()
    {
        $testAndResultArray = [
                                '012' => '012',
                                'User' => 'User',
                                'Fish' => 'Fish',
                                'Admin' => 'Admin',
                                'Symbol & Space' => 'Symbol & Space',
                            ];

        foreach ($testAndResultArray as $testClassName => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('title');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $testClassName);

            $this->assertEquals($stub->title(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_classname_is_converted_to_title_and_is_returned_plural()
    {
        $testAndResultArray = [
                                'Users' => 'Users',
                                'Admin' => 'Admins',
                                'photo' => 'Photos',
                                'Photo' => 'Photos',
                                'Model' => 'Models',
                                'photos' => 'Photos',
                                'Photos' => 'Photos',
                                'Finance' => 'Finances',
                            ];

        foreach ($testAndResultArray as $testClassName => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], $testClassName);

            $this->assertEquals($stub->pluralTitle(), $expectedResult);
        }
    }

    public function test_plural_title_returns_defined_plural_title_when_defined()
    {
        $testAndResultArray = [
                                '012' => '012',
                                'Fish' => 'Fish',
                                'Users' => 'Users',
                                'Admins' => 'Admins',
                                'Finances' => 'Finances',
                                'Symbol & Space' => 'Symbol & Space',
                            ];

        foreach ($testAndResultArray as $definedPluralTitle => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('pluralTitle');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $definedPluralTitle);

            $this->assertEquals($stub->pluralTitle(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_classname_is_converted_to_title_and_is_returned_plurally_in_url_prefix()
    {
        $testAndResultArray = [
                                'Users' => 'users',
                                'Admin' => 'admins',
                                'photo' => 'photos',
                                'Photo' => 'photos',
                                'Model' => 'models',
                                'photos' => 'photos',
                                'Photos' => 'photos',
                                'Finance' => 'finances',
                                'SampleModel' => 'sample-models',
                                'SampleModels' => 'sample-models',
                                'lowercase_AndCamels' => 'lowercase-and-camels',
                            ];

        foreach ($testAndResultArray as $testClassName => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], $testClassName);

            $this->assertEquals($stub->urlPrefix(), $expectedResult);
        }
    }

    public function test_defined_plural_title_is_converted_to_url_prefix()
    {
        $testAndResultArray = [
                                'users' => 'users',
                                'Admins' => 'admins',
                                'Some Finance' => 'some-finance',
                                'somefinances' => 'somefinances',
                                'Some Finances' => 'some-finances',
                                'Symbol & Space' => 'symbol-space',
                            ];

        foreach ($testAndResultArray as $definedPluralTitle => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('pluralTitle');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $definedPluralTitle);

            $this->assertEquals($stub->urlPrefix(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_defined_url_prefix_is_returned_by_url_prefix()
    {
        $testAndResultArray = [
                                'Admin',
                                'users',
                                'Models',
                                'perhaps123',
                                'Another-Example',
                                'user-defined-prefix',
                                'mix-and_match_or-dont',
                                'several_different_separators',
                            ];

        foreach ($testAndResultArray as $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('urlPrefix');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $expectedResult);

            $this->assertEquals($stub->urlPrefix(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_full_url_is_returned_using_classname_to_generate_url_prefix()
    {
        $testAndResultArray = [
                                'Users' => 'users',
                                'Admin' => 'admins',
                                'photo' => 'photos',
                                'Photo' => 'photos',
                                'Model' => 'models',
                                'photos' => 'photos',
                                'Photos' => 'photos',
                                'Finance' => 'finances',
                                'SampleModel' => 'sample-models',
                                'SampleModels' => 'sample-models',
                                'lowercase_AndCamels' => 'lowercase-and-camels',
                            ];

        foreach ($testAndResultArray as $testClassName => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], $testClassName);

            $expectedResult = url(\Flare::config('admin_url').'/'.$expectedResult);

            $this->assertEquals($stub->url(), $expectedResult);
        }
    }

    public function test_full_url_is_returned_using_defined_plural_title_to_generate_url_prefix()
    {
        $testAndResultArray = [
                                'users' => 'users',
                                'Admins' => 'admins',
                                'Some Finance' => 'some-finance',
                                'somefinances' => 'somefinances',
                                'Some Finances' => 'some-finances',
                                'Symbol & Space' => 'symbol-space',
                            ];

        foreach ($testAndResultArray as $definedPluralTitle => $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('pluralTitle');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $definedPluralTitle);

            $expectedResult = url(\Flare::config('admin_url').'/'.$expectedResult);

            $this->assertEquals($stub->url(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_full_url_is_returned_using_defined_url_prefix()
    {
        $testAndResultArray = [
                                'Admin',
                                'users',
                                'Models',
                                'perhaps123',
                                'Another-Example',
                                'user-defined-prefix',
                                'mix-and_match_or-dont',
                                'several_different_separators',
                            ];

        foreach ($testAndResultArray as $expectedResult) {
            $stub = $this->getMockForAbstractClass(Admin::class, [], 'SampleClassName');

            $reflection = new ReflectionClass($stub);
            $reflection_property = $reflection->getProperty('urlPrefix');
            $reflection_property->setAccessible(true);
            $reflection_property->setValue($stub, $expectedResult);

            $expectedResult = url(\Flare::config('admin_url').'/'.$expectedResult);

            $this->assertEquals($stub->url(), $expectedResult);

            $reflection_property->setValue($stub, null); // Need to reset this afterwards.
        }
    }

    public function test_current_url()
    {
    }

    public function test_relative_current_url()
    {
    }
}


text:
<?php

$config = <<< END

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; Start a new pool named 'www'.
[${"app_name"}]

; Unix user/group of processes
user = ${"app_name"}
group = ${'phpfpm_group'}

listen = ${'phpfpm_fullsocketpath'}

; List of ipv4 addresses of FastCGI clients which are allowed to connect.
listen.allowed_clients = 127.0.0.1

listen.owner = blog
listen.group = ${'phpfpm_group'}
listen.mode = 0664

; Per pool prefix
;prefix = /path/to/pools/\$pool
;prefix = \$pool

request_slowlog_timeout = 10
slowlog = ${'php_log_directory'}/slow.\$pool.log

catch_workers_output = yes

request_terminate_timeout=500

pm = dynamic

pm.max_children = 20
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 10
pm.max_requests = 5000

; The URI to view the FPM status page.
pm.status_path = /blog-status

; Additional php.ini defines
php_admin_value[memory_limit] = ${'phpfpm_www_maxmemory'}
php_admin_value[error_log] = ${'php_errorlog_directory'}/\$pool-error.log

security.limit_extensions = .php

include = ${'blog_root_directory'}/autogen/php.fpm.ini

; env[foo] = \$bar

END;

return $config;


text:
/**
 * This class is generated by jOOQ
 */
package io.cattle.platform.core.model.tables.records;

/**
 * This class is generated by jOOQ.
 */
@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.3.0" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
@javax.persistence.Entity
@javax.persistence.Table(name = "config_item", schema = "cattle")
public class ConfigItemRecord extends org.jooq.impl.UpdatableRecordImpl<io.cattle.platform.core.model.tables.records.ConfigItemRecord> implements io.cattle.platform.db.jooq.utils.TableRecordJaxb, org.jooq.Record3<java.lang.Long, java.lang.String, java.lang.String>, io.cattle.platform.core.model.ConfigItem {

	private static final long serialVersionUID = 591222678;

	/**
	 * Setter for cattle.config_item.id.
	 */
	@Override
	public void setId(java.lang.Long value) {
		setValue(0, value);
	}

	/**
	 * Getter for cattle.config_item.id.
	 */
	@javax.persistence.Id
	@javax.persistence.Column(name = "id", unique = true, nullable = false, precision = 20)
	@Override
	public java.lang.Long getId() {
		return (java.lang.Long) getValue(0);
	}

	/**
	 * Setter for cattle.config_item.name.
	 */
	@Override
	public void setName(java.lang.String value) {
		setValue(1, value);
	}

	/**
	 * Getter for cattle.config_item.name.
	 */
	@javax.persistence.Column(name = "name", unique = true, nullable = false, length = 255)
	@Override
	public java.lang.String getName() {
		return (java.lang.String) getValue(1);
	}

	/**
	 * Setter for cattle.config_item.source_version.
	 */
	@Override
	public void setSourceVersion(java.lang.String value) {
		setValue(2, value);
	}

	/**
	 * Getter for cattle.config_item.source_version.
	 */
	@javax.persistence.Column(name = "source_version", nullable = false, length = 1024)
	@Override
	public java.lang.String getSourceVersion() {
		return (java.lang.String) getValue(2);
	}

	// -------------------------------------------------------------------------
	// Primary key information
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Record1<java.lang.Long> key() {
		return (org.jooq.Record1) super.key();
	}

	// -------------------------------------------------------------------------
	// Record3 type implementation
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Row3<java.lang.Long, java.lang.String, java.lang.String> fieldsRow() {
		return (org.jooq.Row3) super.fieldsRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Row3<java.lang.Long, java.lang.String, java.lang.String> valuesRow() {
		return (org.jooq.Row3) super.valuesRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.Long> field1() {
		return io.cattle.platform.core.model.tables.ConfigItemTable.CONFIG_ITEM.ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field2() {
		return io.cattle.platform.core.model.tables.ConfigItemTable.CONFIG_ITEM.NAME;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public org.jooq.Field<java.lang.String> field3() {
		return io.cattle.platform.core.model.tables.ConfigItemTable.CONFIG_ITEM.SOURCE_VERSION;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.Long value1() {
		return getId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value2() {
		return getName();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public java.lang.String value3() {
		return getSourceVersion();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ConfigItemRecord value1(java.lang.Long value) {
		setId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ConfigItemRecord value2(java.lang.String value) {
		setName(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ConfigItemRecord value3(java.lang.String value) {
		setSourceVersion(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ConfigItemRecord values(java.lang.Long value1, java.lang.String value2, java.lang.String value3) {
		return this;
	}

	// -------------------------------------------------------------------------
	// FROM and INTO
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void from(io.cattle.platform.core.model.ConfigItem from) {
		setId(from.getId());
		setName(from.getName());
		setSourceVersion(from.getSourceVersion());
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public <E extends io.cattle.platform.core.model.ConfigItem> E into(E into) {
		into.from(this);
		return into;
	}

	// -------------------------------------------------------------------------
	// Constructors
	// -------------------------------------------------------------------------

	/**
	 * Create a detached ConfigItemRecord
	 */
	public ConfigItemRecord() {
		super(io.cattle.platform.core.model.tables.ConfigItemTable.CONFIG_ITEM);
	}

	/**
	 * Create a detached, initialised ConfigItemRecord
	 */
	public ConfigItemRecord(java.lang.Long id, java.lang.String name, java.lang.String sourceVersion) {
		super(io.cattle.platform.core.model.tables.ConfigItemTable.CONFIG_ITEM);

		setValue(0, id);
		setValue(1, name);
		setValue(2, sourceVersion);
	}
}