text:
package com.farmerbb.secondscreen.fragment;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.farmerbb.secondscreen.R;
import com.farmerbb.secondscreen.util.U;

import java.io.File;

// Fragment launched as part of MainActivity that shows a brief summary of a profile selected from
// ProfileListActivity. It also contains a button that will either: launch the ProfileLoadService
// if the profile is inactive, or launch the TurnOffService if the profile is active.
public final class ProfileViewFragment extends Fragment {

    String filename = "";
    String left;
    String right;
    int n;

    /* The activity that creates an instance of this fragment must
     * implement this interface in order to receive event call backs. */
    public interface Listener {
        void showDeleteDialog();
        void onLoadProfileButtonClick(String filename);
        void onTurnOffProfileButtonClick();
        String generateBlurb(String key, String value);
    }

    // Use this instance of the interface to deliver action events
    Listener listener;

    // Override the Fragment.onAttach() method to instantiate the Listener
    @SuppressWarnings("deprecation")
    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        // Verify that the host activity implements the callback interface
        try {
            // Instantiate the Listener so we can send events to the host
            listener = (Listener) activity;
        } catch (ClassCastException e) {
            // The activity doesn't implement the interface, throw exception
            throw new ClassCastException(activity.toString()
                    + " must implement Listener");
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_profile_view, container, false);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @SuppressWarnings("deprecation")
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        new Handler().post(this::showUI);
    }

    private void showUI() {
        // Set values
        setRetainInstance(true);
        setHasOptionsMenu(true);

        // Change window title
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
            getActivity().setTitle(getArguments().getString("title"));
        else
            getActivity().setTitle(" " + getArguments().getString("title"));

        // Show the Up button in the action bar.
        ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        // Animate elevation change
        if(getActivity().findViewById(R.id.layoutMain).getTag().equals("main-layout-large")
                && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            LinearLayout profileViewEdit = getActivity().findViewById(R.id.profileViewEdit);
            LinearLayout profileList = getActivity().findViewById(R.id.profileList);
            profileList.animate().z(0f);
            profileViewEdit.animate().z(getResources().getDimensionPixelSize(R.dimen.profile_view_edit_elevation));
        }

        // Get filename of saved note
        filename = getArguments().getString("filename");

        SharedPreferences prefSaved = U.getPrefSaved(getActivity(), filename);
        SharedPreferences prefCurrent = U.getPrefCurrent(getActivity());
        Button button = getActivity().findViewById(R.id.pvButton);
        TextView resolution = getActivity().findViewById(R.id.pvResolution);
        TextView density = getActivity().findViewById(R.id.pvDensity);
        TextView profileSettingsLeft = getActivity().findViewById(R.id.pvProfileSettingsLeft);
        TextView profileSettingsRight = getActivity().findViewById(R.id.pvProfileSettingsRight);

        // Change color and/or background of the Load/Turn Off button
        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
            button.setBackground(getResources().getDrawable(R.drawable.pl_button));
        else
            button.getBackground().setColorFilter(ContextCompat.getColor(getActivity(), R.color.pl_selected), PorterDuff.Mode.SRC);

        // Set listeners for Load/Turn Off button
        if("quick_actions".equals(prefCurrent.getString("filename", "0"))) {
            SharedPreferences prefQuick = U.getPrefQuickActions(getActivity());
            if(filename.equals(prefQuick.getString("original_filename", "0"))) {
                button.setText(getResources().getString(R.string.action_turn_off_alt, getArguments().getString("title")));
                button.setOnClickListener(view -> listener.onTurnOffProfileButtonClick());
            } else {
                button.setText(getResources().getString(R.string.action_load, getArguments().getString("title")));
                button.setOnClickListener(view -> listener.onLoadProfileButtonClick(filename));
            }
        } else if(filename.equals(prefCurrent.getString("filename", "0"))) {
            button.setText(getResources().getString(R.string.action_turn_off_alt, getArguments().getString("title")));
            button.setOnClickListener(view -> listener.onTurnOffProfileButtonClick());
        } else {
            button.setText(getResources().getString(R.string.action_load, getArguments().getString("title")));
            button.setOnClickListener(view -> listener.onLoadProfileButtonClick(filename));
        }

        // Generate a brief overview of this profile's settings to display within the fragment
        // NOTE:  these statements must remain in order
        resolution.setText(listener.generateBlurb("size", prefSaved.getString("size", "reset")));
        density.setText(listener.generateBlurb("density", prefSaved.getString("density", "reset")));

        left = "";
        right = "";
        n = 0;

        generateProfileSettings(prefSaved.getBoolean("bluetooth_on", false), R.string.profile_view_bluetooth_on);
        generateProfileSettings(prefSaved.getBoolean("chrome", false), R.string.quick_chrome);
        generateProfileSettings(prefSaved.getBoolean("clear_home", false), R.string.quick_clear_home);

        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
            generateProfileSettings(prefSaved.getBoolean("daydreams_on", false), R.string.profile_view_daydreams_on);

        generateProfileSettings(prefSaved.getBoolean("navbar", false), R.string.profile_view_navbar);
        generateProfileSettings(prefSaved.getBoolean("freeform", false), R.string.profile_view_freeform);

        switch(prefSaved.getString("hdmi_rotation", "landscape")) {
            case "portrait":
                generateProfileSettings(true, R.string.profile_view_hdmi_output);
                break;
        }

        if(U.canEnableOverscan())
            generateProfileSettings(prefSaved.getBoolean("overscan", false), R.string.quick_overscan);

        switch(prefSaved.getString("rotation_lock_new", "fallback")) {
            case "fallback":
                if(prefSaved.getBoolean("rotation_lock", false))
                    generateProfileSettings(true, R.string.profile_view_rotation_landscape);
                break;
            case "landscape":
                generateProfileSettings(true, R.string.profile_view_rotation_landscape);
                break;
            case "auto-rotate":
                generateProfileSettings(true, R.string.profile_view_rotation_autorotate);
                break;
            case "portrait":
                generateProfileSettings(true, R.string.profile_view_rotation_portrait);
                break;
        }

        generateProfileSettings(prefSaved.getBoolean("backlight_off", false), R.string.pref_title_backlight_off);
        generateProfileSettings(prefSaved.getBoolean("vibration_off", false), R.string.pref_title_vibration_off);

        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
            generateProfileSettings(prefSaved.getBoolean("daydreams_on", false), R.string.profile_view_daydreams_on);

        generateProfileSettings(prefSaved.getBoolean("show_touches", false), R.string.pref_title_show_touches);

        if(U.canEnableImmersiveMode()) {
            switch(prefSaved.getString("immersive_new", "fallback")) {
                case "fallback":
                    if(prefSaved.getBoolean("immersive", false))
                        generateProfileSettings(true, R.string.pref_title_immersive);
                    break;
                case "status-only":
                case "immersive-mode":
                    generateProfileSettings(true, R.string.pref_title_immersive);
                    break;
            }
        }

        generateProfileSettings(prefSaved.getBoolean("taskbar", false), R.string.quick_taskbar);

        switch(prefSaved.getString("screen_timeout", "do-nothing")) {
            case "always-on":
                generateProfileSettings(true, R.string.profile_view_screen_timeout_always_on);
                break;
            case "always-on-charging":
                generateProfileSettings(true, R.string.profile_view_screen_timeout_always_on_charging);
                break;
        }

        switch(prefSaved.getString("ui_refresh", "do-nothing")) {
            case "system-ui":
                if(getActivity().getPackageManager().hasSystemFeature("com.cyanogenmod.android")
                        && Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1)
                    generateProfileSettings(true, R.string.profile_view_ui_refresh_soft_reboot);
                else if(U.isInNonRootMode(getActivity()))
                    generateProfileSettings(true, R.string.profile_view_ui_refresh_systemui_alt);
                else
                    generateProfileSettings(true, R.string.profile_view_ui_refresh_systemui);
                break;
            case "activity-manager":
                if(U.isInNonRootMode(getActivity()))
                    generateProfileSettings(true, R.string.profile_view_ui_refresh_soft_reboot_alt);
                else
                    generateProfileSettings(true, R.string.profile_view_ui_refresh_soft_reboot);
                break;
        }

        generateProfileSettings(prefSaved.getBoolean("wifi_on", false), R.string.profile_view_wifi_on);

        if(!left.isEmpty())
            profileSettingsLeft.setText(left);

        if(!right.isEmpty())
            profileSettingsRight.setText(right);

        if(n == 0) {
            TextView header = getActivity().findViewById(R.id.pvHeaderProfileSettings);
            header.setText(" ");
            header.setBackgroundColor(Color.WHITE);
        }
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        inflater.inflate(R.menu.profile_view, menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                // Override default Android "up" behavior to instead mimic the back button
                onBackPressed();
                return true;

            // Edit button
            case R.id.action_edit:
                Bundle bundle = new Bundle();
                bundle.putString("filename", filename);

                Fragment fragment = new ProfileEditFragment();
                fragment.setArguments(bundle);

                getFragmentManager()
                        .beginTransaction()
                        .replace(R.id.profileViewEdit, fragment, "ProfileEditFragment")
                        .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
                        .commit();

                return true;

            // Delete button
            case R.id.action_delete_2:
                // Show toast if this is the currently active profile
                SharedPreferences prefCurrent = U.getPrefCurrent(getActivity());
                if("quick_actions".equals(prefCurrent.getString("filename", "0"))) {
                    SharedPreferences prefSaved = U.getPrefQuickActions(getActivity());
                    if(filename.equals(prefSaved.getString("original_filename", "0")))
                        U.showToast(getActivity(), R.string.deleting_current_profile);
                    else
                        listener.showDeleteDialog();
                } else if(filename.equals(prefCurrent.getString("filename", "0")))
                    U.showToast(getActivity(), R.string.deleting_current_profile);
                else
                    listener.showDeleteDialog();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    public void deleteProfile() {
        // Build the pathname to delete file, then perform delete operation
        File fileToDelete = new File(getActivity().getFilesDir() + File.separator + filename);
        fileToDelete.delete();

        File xmlFileToDelete = new File(getActivity().getFilesDir().getParent() + File.separator + "shared_prefs" + File.separator + filename + ".xml");
        xmlFileToDelete.delete();

        U.showToast(getActivity(), R.string.profile_deleted);

        // Cleanup
        SharedPreferences prefNew = U.getPrefNew(getActivity());
        SharedPreferences.Editor prefNewEditor = prefNew.edit();
        prefNewEditor.clear();
        prefNewEditor.apply();

        // Refresh list of profiles
        U.listProfilesBroadcast(getActivity());

        onBackPressed();
    }

    public void onBackPressed() {
        // Add ProfileListFragment or WelcomeFragment
        Fragment fragment;
        if(getActivity().findViewById(R.id.layoutMain).getTag().equals("main-layout-normal"))
            fragment = new ProfileListFragment();
        else {
            SharedPreferences prefMain = U.getPrefMain(getActivity());

            Bundle bundle = new Bundle();
            bundle.putBoolean("show-welcome-message", prefMain.getBoolean("show-welcome-message", false));

            fragment = new WelcomeFragment();
            fragment.setArguments(bundle);
        }

        getFragmentManager()
                .beginTransaction()
                .replace(R.id.profileViewEdit, fragment, "ProfileListFragment")
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
                .commit();
    }

    public String getFilename() {
        return getArguments().getString("filename");
    }

    private void generateProfileSettings(boolean optionIsSet, int text) {
        if(optionIsSet) {
            n++;
            if(n % 2 == 0)
                right = right + getResources().getString(R.string.bullet) + " " + getResources().getString(text) + "\n";
            else
                left = left + getResources().getString(R.string.bullet) + " " + getResources().getString(text) + "\n";
        }
    }
}


text:
import { createSelector } from '@ngrx/store';

import { ExamplesState, selectExamples } from '../examples.state';

export const selectFormState = createSelector(
  selectExamples,
  (state: ExamplesState) => state.form
);

redpajama_set_name: RedPajamaGithub


text:
'use strict';
const path = require('path');
const fs = require('fs');
const electron = require('electron');
const appMenu = require('./menu');
const tray = require('./tray');
const config = require('./config');

const app = electron.app;

require('electron-debug')();
require('electron-dl')();
require('electron-context-menu')();

let mainWindow;
let isQuitting = false;

const isAlreadyRunning = app.makeSingleInstance(() => {
	if (mainWindow) {
		if (mainWindow.isMinimized()) {
			mainWindow.restore();
		}

		mainWindow.show();
	}
});

if (isAlreadyRunning) {
	app.quit();
}

function createMainWindow() {
	const lastWindowState = config.get('lastWindowState');
	const isDarkMode = config.get('darkMode');
	const maxWindowInteger = 2147483647; // Used to set max window width/height when toggling fullscreen
	const maxWidthValue = 850;

	const win = new electron.BrowserWindow({
		title: app.getName(),
		show: false,
		x: lastWindowState.x,
		y: lastWindowState.y,
		width: lastWindowState.width,
		height: lastWindowState.height,
		icon: process.platform === 'linux' && path.join(__dirname, 'static/Icon.png'),
		minWidth: 340,
		maxWidth: maxWidthValue,
		minHeight: 260,
		titleBarStyle: 'hidden-inset',
		autoHideMenuBar: true,
		darkTheme: isDarkMode, // GTK+3
		backgroundColor: isDarkMode ? '#192633' : '#fff',
		webPreferences: {
			preload: path.join(__dirname, 'browser.js'),
			nodeIntegration: false,
			plugins: true
		}
	});

	if (process.platform === 'darwin') {
		win.setSheetOffset(40);
	}

	win.loadURL('https://mobile.twitter.com/login');

	win.on('close', e => {
		if (!isQuitting) {
			e.preventDefault();

			if (process.platform === 'darwin') {
				app.hide();
			} else {
				win.hide();
			}
		}
	});

	win.on('page-title-updated', e => {
		e.preventDefault();
	});

	win.on('enter-full-screen', () => {
		win.setMaximumSize(maxWindowInteger, maxWindowInteger);
	});

	win.on('leave-full-screen', () => {
		win.setMaximumSize(maxWidthValue, maxWindowInteger);
	});

	return win;
}

app.on('ready', () => {
	electron.Menu.setApplicationMenu(appMenu);
	mainWindow = createMainWindow();
	tray.create(mainWindow);

	const page = mainWindow.webContents;

	page.on('dom-ready', () => {
		page.insertCSS(fs.readFileSync(path.join(__dirname, 'browser.css'), 'utf8'));
		page.insertCSS(fs.readFileSync(path.join(__dirname, 'dark-mode.css'), 'utf8'));
		mainWindow.show();
	});

	page.on('new-window', (e, url) => {
		e.preventDefault();
		electron.shell.openExternal(url);
	});
});

app.on('activate', () => {
	mainWindow.show();
});

app.on('before-quit', () => {
	isQuitting = true;

	if (!mainWindow.isFullScreen()) {
		config.set('lastWindowState', mainWindow.getBounds());
	}
});


text:
window.addEventListener("DOMContentLoaded", () => {

    new Game('game-canvas');
});

class Game {
    constructor(canvasId) {

        let canvas          = document.getElementById(canvasId);
        this.engine         = new BABYLON.Engine(canvas, true);

        // Contains all loaded assets needed for this state
        this.assets         = [];

        // The state scene
        this.scene          = null;

        this.towers = [];

        this.enemies = [];

        this.enemiesToSend = 10;
        this.enemiesHealth = 10;

        // The cost of the base tower. You need at least this amount of gold to build it
        this.cost = 100;

        this.level = 0;

        this.gold = 300;

        // The tower that is currently selected
        this.selectedTower = null;

        // Resize window event
        window.addEventListener("resize", () => {
            this.engine.resize();
        });

        this.run();

    }

    _initScene() {
        let scene = new BABYLON.Scene(this.engine);

        // Hemispheric light to light the scene
        let h = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0,1,0), scene);
        //h.intensity = 0.4;

        let camera = new BABYLON.FreeCamera("camera",new BABYLON.Vector3(0,50,-10), scene);
        camera.setTarget(BABYLON.Vector3.Zero());
        camera.attachControl(scene.getEngine().getRenderingCanvas());

        return scene;
    }

    run() {

        this.scene = this._initScene();

        // The loader
        let loader =  new BABYLON.AssetsManager(this.scene);

        //let meshTask = loader.addMeshTask("bug", "", "./assets/bug/", "bug.babylon");
        //meshTask.onSuccess = (t) => {
        //    for (let m of t.loadedMeshes) {
        //        m.setEnabled (false);
        //    }
        //    this.assets['bug'] = {
        //        meshes : t.loadedMeshes
        //    }
        //};

        loader.onFinish = () => {

            this.scene.executeWhenReady(() => {

                this.engine.runRenderLoop(() => {
                    this.scene.render();
                });
            });

            // Load first level
            this._initGame();
            this.guiManager.updateGui();

        };

        loader.load();
    }

    _initGame() {

        let ground = BABYLON.Mesh.CreateGround('ground', 100, 100, 1, this.scene);
        ground.material = new BABYLON.StandardMaterial('', this.scene);
        ground.material.diffuseTexture = new BABYLON.Texture('assets/ground.jpg', this.scene);
        ground.material.diffuseTexture.uScale = 5;
        ground.material.diffuseTexture.vScale = 5;
        ground.material.specularColor = BABYLON.Color3.Black();
        ground.receiveShadows = true;

        // destination
        let s = BABYLON.Mesh.CreateSphere('', 10, 1, this.scene);
        s.position = new BABYLON.Vector3(20,0,20);

        this.guiManager = new GUIManager(this);

        // add action on pointer
        let eventPrefix = BABYLON.Tools.GetPointerPrefix();
        this.scene.getEngine().getRenderingCanvas().addEventListener(eventPrefix + "down", () => {

            let pickInfo = this.scene.pick(
                this.scene.pointerX,
                this.scene.pointerY);

            if (pickInfo.hit) {

                // If a tower has been selected
                if (this.selectedTower) {
                    this.selectedTower.unhighlight();
                }

                // If the picked mesh is a tower
                if (pickInfo.pickedMesh.parent &&
                    BABYLON.Tags.HasTags(pickInfo.pickedMesh.parent, 'tower')) {
                    this.selectedTower = pickInfo.pickedMesh.parent;
                    this.selectedTower.highlight();
                }

                // if the picked mesh is the ground
                if (pickInfo.pickedMesh.name == 'ground') {
                    let pos = pickInfo.pickedPoint;
                    if (this.gold - this.cost >= 0) {
                        this.gold -= this.cost;
                        let t = new Tower(this);
                        t.position = pos;
                        this.towers.push(t);
                    } else {
                        // not enough money
                    }
                }
            }
        });

        this.scene.debugLayer.show();

        this.sendWave();

        // Sort each enemy to the nearest tower
        this.scene.registerBeforeRender(() => {
            // For each towers
            for (let t of this.towers) {
                for (let e of this.enemies) {
                    if (t.isInRadius(e)) {
                        t.addToAttackList(e);
                    } else {
                        t.removeFromAttackList(e);
                    }

                }
            }
        });
    }

    removeEnemy(enemy) {
        // Add gold to the player
        this.gold += enemy.gold;

        // remove from tower
        for (let t of this.towers) {
            t.removeFromAttackList(enemy);
        }

        // remove from enemy list
        let index = this.enemies.indexOf(enemy);
        if (index > -1) {
            this.enemies.splice(index, 1);
        }
        if (this.enemies.length == 0) {
            this.sendWave();
        }

        this.guiManager.updateGui();
    }

    /**
     * Send a new wave
     */
    sendWave() {
        this.level++;

        // Update GUI
        this.guiManager.nextLevel();

        // increase minions health
        this.enemiesHealth += 20;

        // Increase enemies number
        //this.enemiesToSend += 10;

        // send X enemies
        for (let i = 0 ; i<this.enemiesToSend; i++) {
            let e = new Enemy(this, this.enemiesHealth);
            this.enemies.push(e);
        }

    }

    buyTower() {

    }

    /**
     * Returns an integer in [min, max[
     */
    static randomInt(min, max) {
        if (min === max) {
            return (min);
        }
        let random = Math.random();
        return Math.floor(((random * (max - min)) + min));
    }

    static randomNumber(min, max) {
        if (min === max) {
            return (min);
        }
        let random = Math.random();
        return (random * (max - min)) + min;
    }

    /**
     * Create an instance model from the given name.
     */
    createModel(name, parent) {
        if (! this.assets[name]) {
            console.warn('No asset corresponding.');
        } else {
            if (!parent) {
                parent = new GameObject(this);
            }

            let obj = this.assets[name];
            //parent._animations = obj.animations;
            let meshes = obj.meshes;

            for (let i=0; i<meshes.length; i++ ){
                // Don't clone mesh without any vertices
                if (meshes[i].getTotalVertices() > 0) {

                    let newmesh = meshes[i].clone(meshes[i].name, null, true);
                    parent.addChildren(newmesh);

                    if (meshes[i].skeleton) {
                        newmesh.skeleton = meshes[i].skeleton.clone();
                        this.scene.stopAnimation(newmesh);
                    }
                }
            }
        }
        return parent;
    }
}


text:
set -ev
echo "Publishing docs."

if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then

# Generate doxygen files.
cd docs/;
doxygen Doxyfile;

# Publish html.
git config --global user.name "Travis-CI"
git config --global user.email ${GIT_EMAIL}

# rm -rf gh-pages || exit 0;
git clone --branch=gh-pages https://github.com/${TRAVIS_REPO_SLUG}.git gh-pages

# Copy the tagfile.
cp tagfile.xml gh-pages/

# Copy the documentation html.
cp -R html/* gh-pages/
(
	cd gh-pages;
	git add --all .;
	git commit -m "Travis ofxAddon documentation generation.";
	git remote set-url origin "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git"
#	git push -fq origin gh-pages > /dev/null 2>&1
    git push -fq origin gh-pages
)

cd ..

else
    echo "Skipping document generation since this is a pull request.";
fi


text:
var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
var egret;
(function (egret) {
    /**
     * @class egret.Bitmap
     * @classdesc
     * Bitmap 类表示用于表示位图图像的显示对象。
     * @extends egret.DisplayObject
     */
    var Bitmap = (function (_super) {
        __extends(Bitmap, _super);
        function Bitmap(texture) {
            _super.call(this);
            /**
             * 单个Bitmap是否开启DEBUG模式
             * @member {boolean} egret.Bitmap#debug
             * @private
             */
            this.debug = false;
            /**
             * debug边框颜色,默认值为红色
             * @member {number} egret.Bitmap#debugColor
             * @private
             */
            this.debugColor = 0xff0000;
            /**
             * 矩形区域,它定义位图对象的九个缩放区域。此属性仅当fillMode为BitmapFillMode.SCALE时有效。
             * scale9Grid的x、y、width、height分别代表九宫图中中间那块的左上点的x、y以及中间方块的宽高。
             * @member {egret.Texture} egret.Bitmap#scale9Grid
             */
            this.scale9Grid = null;
            /**
             * 确定位图填充尺寸的方式。
             * 设置为 BitmapFillMode.REPEAT时,位图将重复以填充区域;BitmapFillMode.SCALE时,位图将拉伸以填充区域。
             * 默认值:BitmapFillMode.SCALE。
             * @member {egret.Texture} egret.Bitmap#fillMode
             */
            this.fillMode = "scale";
            if (texture) {
                this._texture = texture;
                this._setSizeDirty();
            }
        }
        Object.defineProperty(Bitmap.prototype, "texture", {
            /**
             * 渲染纹理
             * @member {egret.Texture} egret.Bitmap#texture
             */
            get: function () {
                return this._texture;
            },
            set: function (value) {
                if (value == this._texture) {
                    return;
                }
                this._setSizeDirty();
                this._texture = value;
            },
            enumerable: true,
            configurable: true
        });
        Bitmap.prototype._render = function (renderContext) {
            var texture = this._texture;
            if (!texture) {
                this._texture_to_render = null;
                return;
            }
            this._texture_to_render = texture;
            var destW = this._hasWidthSet ? this._explicitWidth : texture._textureWidth;
            var destH = this._hasHeightSet ? this._explicitHeight : texture._textureHeight;
            Bitmap._drawBitmap(renderContext, destW, destH, this);
        };
        Bitmap._drawBitmap = function (renderContext, destW, destH, thisObject) {
            var texture = thisObject._texture_to_render;
            if (!texture) {
                return;
            }
            var textureWidth = texture._textureWidth;
            var textureHeight = texture._textureHeight;
            if (thisObject.fillMode == "scale") {
                var s9g = thisObject.scale9Grid || texture["scale9Grid"];
                if (s9g && textureWidth - s9g.width < destW && textureHeight - s9g.height < destH) {
                    Bitmap.drawScale9GridImage(renderContext, thisObject, s9g, destW, destH);
                }
                else {
                    var offsetX = texture._offsetX;
                    var offsetY = texture._offsetY;
                    var bitmapWidth = texture._bitmapWidth || textureWidth;
                    var bitmapHeight = texture._bitmapHeight || textureHeight;
                    var scaleX = destW / textureWidth;
                    offsetX = Math.round(offsetX * scaleX);
                    destW = Math.round(bitmapWidth * scaleX);
                    var scaleY = destH / textureHeight;
                    offsetY = Math.round(offsetY * scaleY);
                    destH = Math.round(bitmapHeight * scaleY);
                    Bitmap.renderFilter.drawImage(renderContext, thisObject, texture._bitmapX, texture._bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, destW, destH);
                }
            }
            else {
                Bitmap.drawRepeatImage(renderContext, thisObject, destW, destH, thisObject.fillMode);
            }
        };
        /**
         * 绘制平铺位图
         */
        Bitmap.drawRepeatImage = function (renderContext, data, destWidth, destHeight, repeat) {
            var texture = data._texture_to_render;
            if (!texture) {
                return;
            }
            var textureWidth = texture._textureWidth;
            var textureHeight = texture._textureHeight;
            var sourceX = texture._bitmapX;
            var sourceY = texture._bitmapY;
            var sourceWidth = texture._bitmapWidth || textureWidth;
            var sourceHeight = texture._bitmapHeight || textureHeight;
            var destX = texture._offsetX;
            var destY = texture._offsetY;
            var renderFilter = egret.RenderFilter.getInstance();
            renderFilter.drawImage(renderContext, data, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, repeat);
        };
        /**
         * 绘制九宫格位图
         */
        Bitmap.drawScale9GridImage = function (renderContext, data, scale9Grid, destWidth, destHeight) {
            var texture = data._texture_to_render;
            if (!texture || !scale9Grid) {
                return;
            }
            var renderFilter = egret.RenderFilter.getInstance();
            var textureWidth = texture._textureWidth;
            var textureHeight = texture._textureHeight;
            var sourceX = texture._bitmapX;
            var sourceY = texture._bitmapY;
            var sourceWidth = texture._bitmapWidth || textureWidth;
            var sourceHeight = texture._bitmapHeight || textureHeight;
            var destX = texture._offsetX;
            var destY = texture._offsetY;
            var texture_scale_factor = egret.MainContext.instance.rendererContext.texture_scale_factor;
            var s9g = egret.Rectangle.identity.initialize(scale9Grid.x - Math.round(destX), scale9Grid.y - Math.round(destX), scale9Grid.width, scale9Grid.height);
            var roundedDrawX = Math.round(destX);
            var roundedDrawY = Math.round(destY);
            destWidth -= textureWidth - sourceWidth;
            destHeight -= textureHeight - sourceHeight;
            //防止空心的情况出现。
            if (s9g.y == s9g.bottom) {
                if (s9g.bottom < sourceHeight)
                    s9g.bottom++;
                else
                    s9g.y--;
            }
            if (s9g.x == s9g.right) {
                if (s9g.right < sourceWidth)
                    s9g.right++;
                else
                    s9g.x--;
            }
            var sourceX2 = sourceX + s9g.x;
            var sourceX3 = sourceX + s9g.right;
            var sourceRightW = sourceWidth - s9g.right;
            var sourceY2 = sourceY + s9g.y;
            var sourceY3 = sourceY + s9g.bottom;
            var sourceBottomH = sourceHeight - s9g.bottom;
            var destX1 = roundedDrawX + s9g.x;
            var destY1 = roundedDrawY + s9g.y;
            var destScaleGridBottom = destHeight - (sourceHeight - s9g.bottom);
            var destScaleGridRight = destWidth - (sourceWidth - s9g.right);
            drawImage(renderContext, data, sourceX, sourceY, s9g.x, s9g.y, roundedDrawX, roundedDrawY, s9g.x, s9g.y);
            drawImage(renderContext, data, sourceX2, sourceY, s9g.width, s9g.y, destX1, roundedDrawY, destScaleGridRight - s9g.x, s9g.y);
            drawImage(renderContext, data, sourceX3, sourceY, sourceRightW, s9g.y, roundedDrawX + destScaleGridRight, roundedDrawY, destWidth - destScaleGridRight, s9g.y);
            drawImage(renderContext, data, sourceX, sourceY2, s9g.x, s9g.height, roundedDrawX, destY1, s9g.x, destScaleGridBottom - s9g.y);
            drawImage(renderContext, data, sourceX2, sourceY2, s9g.width, s9g.height, destX1, destY1, destScaleGridRight - s9g.x, destScaleGridBottom - s9g.y);
            drawImage(renderContext, data, sourceX3, sourceY2, sourceRightW, s9g.height, roundedDrawX + destScaleGridRight, destY1, destWidth - destScaleGridRight, destScaleGridBottom - s9g.y);
            drawImage(renderContext, data, sourceX, sourceY3, s9g.x, sourceBottomH, roundedDrawX, roundedDrawY + destScaleGridBottom, s9g.x, destHeight - destScaleGridBottom);
            drawImage(renderContext, data, sourceX2, sourceY3, s9g.width, sourceBottomH, destX1, roundedDrawY + destScaleGridBottom, destScaleGridRight - s9g.x, destHeight - destScaleGridBottom);
            drawImage(renderContext, data, sourceX3, sourceY3, sourceRightW, sourceBottomH, roundedDrawX + destScaleGridRight, roundedDrawY + destScaleGridBottom, destWidth - destScaleGridRight, destHeight - destScaleGridBottom);
            function drawImage(a, b, c, d, e, f, g, h, i, j) {
                renderFilter.drawImage(a, b, c / texture_scale_factor, d / texture_scale_factor, e, f, g, h, i, j);
            }
        };
        /**
         * @see egret.DisplayObject.measureBounds
         * @returns {egret.Rectangle}
         * @private
         */
        Bitmap.prototype._measureBounds = function () {
            var texture = this._texture;
            if (!texture) {
                return _super.prototype._measureBounds.call(this);
            }
            var x = texture._offsetX;
            var y = texture._offsetY;
            var w = texture._textureWidth;
            var h = texture._textureHeight;
            return egret.Rectangle.identity.initialize(x, y, w, h);
        };
        /**
         * 全部Bitmap是否开启DEBUG模式
         * @member {boolean} egret.Bitmap.debug
         * @private
         */
        Bitmap.debug = false;
        Bitmap.renderFilter = egret.RenderFilter.getInstance();
        return Bitmap;
    })(egret.DisplayObject);
    egret.Bitmap = Bitmap;
    Bitmap.prototype.__class__ = "egret.Bitmap";
})(egret || (egret = {}));


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVotingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('votings', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('community_id')->unsigned();
            $table->integer('poll_id')->unsigned();
            $table->longText('notes');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('votings');
    }
}


text:
package com.vikingbrain.nmt.controller.impl;

import java.io.IOException;
import java.util.LinkedHashMap;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.vikingbrain.nmt.controller.RemoteHttpService;
import com.vikingbrain.nmt.operations.OperationType;
import com.vikingbrain.nmt.util.Constants;
import com.vikingbrain.nmt.util.exceptions.TheDavidBoxClientException;

/**
 *
 * @author vikingBrain
 */
public class RemoteHttpServiceImpl implements RemoteHttpService {

	/** Logger. */
	private static Logger logger = LoggerFactory.getLogger(RemoteHttpServiceImpl.class);

	/** The http client. */
	private HttpClient client;

	/**
	 * Constructor.
	 */
	public RemoteHttpServiceImpl() {
		client = new DefaultHttpClient();
	}

	/**
	 * It encodes special symbols in their valid representations
	 * for http requests.
	 * @param str the text to encode
	 * @return the text encoded for http
	 */
	private String encodeHttpParameter(String str){

		//It translates the empty space
		String encoded = str.replaceAll(" ", "%20");
		//It translates the & symbol
		encoded = encoded.replaceAll("&", "%26");

//		encoded = encoded.replaceAll("$", "%24");
//		encoded = encoded.replaceAll("`", "%60");
//		encoded = encoded.replaceAll(":", "%3A");
//		encoded = encoded.replaceAll("<", "%3C");
//		encoded = encoded.replaceAll(">", "%3E");
//		encoded = encoded.replaceAll("[", "%5B");
//		encoded = encoded.replaceAll("]", "%5D");
//		encoded = encoded.replaceAll("{", "%7B");
//		encoded = encoded.replaceAll("}", "%7D");

		return encoded;
	}

	/**
	 * It uses the parameters to build the http arguments with name and value.
	 * @param params all the parameters with name and value
	 * @return the stringbuffer with the http arguments ready to be added to a http request
	 */
	private StringBuffer buildEncodedParameters(LinkedHashMap<String, String> params) {
		StringBuffer parametersUrlGet = new StringBuffer("");

		if (null != params) {
			for (String key : params.keySet()) {

				String value = params.get(key);
				String encodedParameter = encodeHttpParameter(value);

				// It builds something like
				// "&param1=file%20name%26blues for entry "param1","file name&blues"
				parametersUrlGet.append("&").append(key).append("=").append(encodedParameter);
			}
		}
		return parametersUrlGet;
	}

	/** {@inheritDoc} */
	public String buildGetRequest(String remoteHost, OperationType operationType, LinkedHashMap<String, String> arguments) {
		String moduleName = operationType.getModuleName();
		String operationName = operationType.getOperationName();

		String urlGet = new StringBuffer("http://").append(remoteHost)
				.append(":").append(Constants.DAVIDBOX_PORT).append("/")
				.append(moduleName).append("?arg0=")
				.append(operationName).append(buildEncodedParameters(arguments))
				.toString();
		return urlGet;
	}

	/** {@inheritDoc} */
	public String sendGetRequest(String url) throws TheDavidBoxClientException {
		// throws ClientProtocolException, IOException{

		String response = "";

		HttpGet get = new HttpGet(url);

		logger.debug("GET Request: " + url);

		HttpResponse responseGet = null;
		try {
			responseGet = client.execute(get);
		} catch (ClientProtocolException e) {
			throw new TheDavidBoxClientException(e);
		} catch (IOException e) {
			throw new TheDavidBoxClientException(e);
		}
		HttpEntity resEntityGet = responseGet.getEntity();
		if (resEntityGet != null) {
			try {
				response = EntityUtils.toString(resEntityGet);
			} catch (ParseException e) {
				throw new TheDavidBoxClientException(e);
			} catch (IOException e) {
				throw new TheDavidBoxClientException(e);
			}
			logger.debug("Get Response: " + response);
		}
		return response;
	}

	/** {@inheritDoc} */
	public void setHttpClient(HttpClient client) {
		this.client = client;
	}

}


text:
package actions

import (
	"encoding/json"
	"log"
	"path"
	"runtime"
	"strings"

	"github.com/eikeon/hu"
	"github.com/nogiushi/marvin/nog"
)

var Root = ""

func init() {
	_, filename, _, _ := runtime.Caller(0)
	Root = path.Dir(filename)
}

type Sentence []hu.Term

func (sentence Sentence) String() string {
	var terms []string
	for _, term := range sentence {
		terms = append(terms, term.String())
	}
	return strings.Join(terms, " ")
}

type Actions struct {
	Actions map[string]string
}

func Handler(in <-chan nog.Message, out chan<- nog.Message) {
	out <- nog.Message{What: "started"}
	a := &Actions{}

	go func() {
		out <- nog.Template("actions")
	}()

	for m := range in {
		if m.Why == "statechanged" {
			dec := json.NewDecoder(strings.NewReader(m.What))
			if err := dec.Decode(a); err != nil {
				log.Println("actions decode err:", err)
			} else {
				if a.Actions == nil {
					a.Actions = make(map[string]string)
				}
			}
		}

		const DOACTION = "do "

		what := ""
		if strings.HasPrefix(m.What, DOACTION) {
			what = m.What[len(DOACTION):]
		}

		t, ok := a.Actions[what]
		if ok {
			reader := strings.NewReader(t)
			for {
				expression := hu.ReadSentence(reader)
				if expression == nil {
					break
				}
				m := Sentence(expression).String()
				out <- nog.Message{What: m}
			}
		}

		const SET = "set action "
		if strings.HasPrefix(m.What, SET) {
			e := strings.SplitN(m.What[len(SET):], " to ", 2)
			if len(e) == 2 {
				a.Actions[e[0]] = e[1]
			}
			if what, err := json.Marshal(a); err == nil {
				out <- nog.Message{What: string(what), Why: "statechanged"}
			} else {
				log.Println("StateChanged err:", err)
			}
		}
	}
	out <- nog.Message{What: "stopped"}
	close(out)
}


text:
package info.globalbus.blueprint.plugin.handlers;

import info.globalbus.blueprint.plugin.handlers.javax.Namespaces;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.apache.aries.blueprint.plugin.spi.BeanAnnotationHandler;
import org.apache.aries.blueprint.plugin.spi.BeanEnricher;
import org.apache.aries.blueprint.plugin.spi.BlueprintConfiguration;
import org.apache.aries.blueprint.plugin.spi.ContextEnricher;
import org.apache.aries.blueprint.plugin.spi.MethodAnnotationHandler;

import static info.globalbus.blueprint.plugin.handlers.javax.Namespaces.NS_TX_1_2_0;
import static info.globalbus.blueprint.plugin.handlers.javax.Namespaces.PATTERN_NS_TX1;
import static info.globalbus.blueprint.plugin.handlers.javax.Namespaces.PATTERN_NS_TX2;

@RequiredArgsConstructor
public abstract class TransactionBase<T extends Annotation> implements BeanAnnotationHandler<T>, MethodAnnotationHandler<T> {
    private static final String ENABLE_ANNOTATION = "transaction.enableAnnotation";

    protected abstract String getTransactionTypeName(T transactional);

    @Override
    public void handleMethodAnnotation(Class<?> clazz, List<Method> methods, ContextEnricher contextEnricher, BeanEnricher beanEnricher) {
        final String nsTx1 = Namespaces.getNamespaceByPattern(contextEnricher.getBlueprintConfiguration().getNamespaces(), PATTERN_NS_TX1);
        if (nsTx1 != null) {
            enableAnnotationTx1(contextEnricher, nsTx1);
            for (final Method method : methods) {
                final T transactional = method.getAnnotation(getAnnotation());
                final String transactionTypeName = getTransactionTypeName(transactional);
                final String name = method.getName();
                beanEnricher.addBeanContentWriter("javax.transactional.method/" + clazz.getName() + "/" + name + "/" + transactionTypeName, writer -> {
                    writer.writeEmptyElement("transaction");
                    writer.writeDefaultNamespace(nsTx1);
                    writer.writeAttribute("method", name);
                    writer.writeAttribute("value", transactionTypeName);
                });
            }
        }
        final String nsTx2 = Namespaces.getNamespaceByPattern(contextEnricher.getBlueprintConfiguration().getNamespaces(), PATTERN_NS_TX2);
        if ((nsTx2 != null) && getEnableAnnotationConfig(contextEnricher.getBlueprintConfiguration())) {
            insertEnableAnnotationTx2(contextEnricher, nsTx2);
        }
    }

    @Override
    public void handleBeanAnnotation(AnnotatedElement annotatedElement, String id, ContextEnricher contextEnricher, BeanEnricher beanEnricher) {
        final String nsTx1 = Namespaces.getNamespaceByPattern(contextEnricher.getBlueprintConfiguration().getNamespaces(), PATTERN_NS_TX1);
        if (nsTx1 != null) {
            enableAnnotationTx1(contextEnricher, nsTx1);
            final T transactional = annotatedElement.getAnnotation(getAnnotation());
            final String transactionTypeName = getTransactionTypeName(transactional);
            beanEnricher.addBeanContentWriter("javax.transactional.method/" + annotatedElement + "/*/" + transactionTypeName, writer -> {
                writer.writeEmptyElement("transaction");
                writer.writeDefaultNamespace(nsTx1);
                writer.writeAttribute("method", "*");
                writer.writeAttribute("value", transactionTypeName);
            });
        }
        final String nsTx2 = Namespaces.getNamespaceByPattern(contextEnricher.getBlueprintConfiguration().getNamespaces(), PATTERN_NS_TX2);
        if (nsTx2 != null && getEnableAnnotationConfig(contextEnricher.getBlueprintConfiguration())) {
            insertEnableAnnotationTx2(contextEnricher, nsTx2);
        }
    }

    private void enableAnnotationTx1(ContextEnricher contextEnricher, final String nsTx1) {
        // TX1 enable-annotation are valid only in 1.2.0 schema
        if (NS_TX_1_2_0.equals(nsTx1) && getEnableAnnotationConfig(contextEnricher.getBlueprintConfiguration())) {
            insertEnableAnnotationTx1(contextEnricher, nsTx1);
        }
    }

    private boolean getEnableAnnotationConfig(BlueprintConfiguration blueprintConfig) {
        String enableAnnotation = blueprintConfig.getCustomParameters().get(ENABLE_ANNOTATION);
        return enableAnnotation == null || Boolean.parseBoolean(enableAnnotation);
    }

    private void insertEnableAnnotationTx1(ContextEnricher contextEnricher, final String namespace) {
        contextEnricher.addBlueprintContentWriter("transaction/enable-annotation", writer -> {
            writer.writeEmptyElement("enable-annotations");
            writer.writeDefaultNamespace(namespace);
        });
    }

    private void insertEnableAnnotationTx2(ContextEnricher contextEnricher, final String namespace) {
        contextEnricher.addBlueprintContentWriter("transaction/enable-annotation", writer -> {
            writer.writeEmptyElement("enable");
            writer.writeDefaultNamespace(namespace);
        });
    }
}


text:
package dmtest

import java.io.{FileWriter, File}
import java.nio.file.{Files, Paths, Path}
import java.util.concurrent.atomic.AtomicLong

object TempFile {
  val POOLDIR = Paths.get("/mnt/dmtest")
  def mount(): Unit = {
    if (!Files.exists(POOLDIR)) {
      Files.createDirectory(POOLDIR)
    }
    Shell(s"mount -t ramfs -o size=256m ramfs ${POOLDIR}")
  }
  def umount(): Unit = {
    Shell(s"ls ${POOLDIR}")
    Shell(s"umount ${POOLDIR}")
    Files.deleteIfExists(POOLDIR)
  }
  private val i = new AtomicLong(0)
  def alloc(): Path =  {
    val p = Paths.get(s"${POOLDIR}/${i.getAndIncrement()}")
    p
  }
  def apply[A](fn: Path => A): A = {
    val p = alloc()
    try {
      fn(p)
    } finally {
      Files.deleteIfExists(p)
    }
  }
  def text(mkString: => String): Path = {
    val p = alloc()
    val writer = new FileWriter(p.toFile)
    try {
      writer.write(mkString)
    } finally {
      writer.close()
    }
    p
  }
}


text:
namespace NPOI.SS.Formula
{

    using System;

    using NPOI.SS.Formula.Eval;

    /**
     * Performance optimisation for {@link HSSFFormulaEvaluator}. This class stores previously
     * calculated values of already visited cells, To avoid unnecessary re-calculation when the
     * same cells are referenced multiple times
     *
     *
     * @author Josh Micich
     */
    internal class EvaluationCache
    {

        private PlainCellCache _plainCellCache;
        private FormulaCellCache _formulaCellCache;
        /** only used for testing. <c>null</c> otherwise */
        IEvaluationListener _evaluationListener;

        /* package */
        public EvaluationCache(IEvaluationListener evaluationListener)
        {
            _evaluationListener = evaluationListener;
            _plainCellCache = new PlainCellCache();
            _formulaCellCache = new FormulaCellCache();
        }

        public void NotifyUpdateCell(int bookIndex, int sheetIndex, IEvaluationCell cell)
        {
            FormulaCellCacheEntry fcce = _formulaCellCache.Get(cell);

            int rowIndex = cell.RowIndex;
            int columnIndex = cell.ColumnIndex;
            Loc loc = new Loc(bookIndex, sheetIndex, cell.RowIndex, cell.ColumnIndex);
            PlainValueCellCacheEntry pcce = _plainCellCache.Get(loc);

            if (cell.CellType == NPOI.SS.UserModel.CellType.FORMULA)
            {
                if (fcce == null)
                {
                    fcce = new FormulaCellCacheEntry();

                    if (pcce == null)
                    {
                        if (_evaluationListener != null)
                        {
                            _evaluationListener.OnChangeFromBlankValue(sheetIndex, rowIndex,
                                    columnIndex, cell, fcce);
                        }
                        UpdateAnyBlankReferencingFormulas(bookIndex, sheetIndex, rowIndex, columnIndex);
                    }
                    _formulaCellCache.Put(cell, fcce);
                }
                else
                {
                    fcce.RecurseClearCachedFormulaResults(_evaluationListener);
                    fcce.ClearFormulaEntry();
                }
                if (pcce == null)
                {
                    // was formula cell before - no Change of type
                }
                else
                {
                    // changing from plain cell To formula cell
                    pcce.RecurseClearCachedFormulaResults(_evaluationListener);
                    _plainCellCache.Remove(loc);
                }
            }
            else
            {
                ValueEval value = WorkbookEvaluator.GetValueFromNonFormulaCell(cell);
                if (pcce == null)
                {
                    if (value != BlankEval.instance)
                    {
                        pcce = new PlainValueCellCacheEntry(value);
                        if (fcce == null)
                        {
                            if (_evaluationListener != null)
                            {
                                _evaluationListener.OnChangeFromBlankValue(sheetIndex, rowIndex,
                                        columnIndex, cell, pcce);
                            }
                            UpdateAnyBlankReferencingFormulas(bookIndex, sheetIndex, rowIndex, columnIndex);
                        }
                        _plainCellCache.Put(loc, pcce);
                    }
                }
                else
                {
                    if (pcce.UpdateValue(value))
                    {
                        pcce.RecurseClearCachedFormulaResults(_evaluationListener);
                    }
                    if (value == BlankEval.instance)
                    {
                        _plainCellCache.Remove(loc);
                    }
                }
                if (fcce == null)
                {
                    // was plain cell before - no Change of type
                }
                else
                {
                    // was formula cell before - now a plain value
                    _formulaCellCache.Remove(cell);
                    fcce.SetSensitiveInputCells(null);
                    fcce.RecurseClearCachedFormulaResults(_evaluationListener);
                }
            }
        }

        internal class EntryOperation : IEntryOperation
        {
            BookSheetKey bsk;
            int rowIndex, columnIndex;
            IEvaluationListener evaluationListener;

            public EntryOperation(BookSheetKey bsk,
                int rowIndex, int columnIndex, IEvaluationListener evaluationListener)
            {
                this.bsk = bsk;
                this.evaluationListener = evaluationListener;
                this.rowIndex = rowIndex;
                this.columnIndex = columnIndex;
            }

            public void ProcessEntry(FormulaCellCacheEntry entry)
            {
                entry.NotifyUpdatedBlankCell(bsk, rowIndex, columnIndex, evaluationListener);
            }
        }

        private void UpdateAnyBlankReferencingFormulas(int bookIndex, int sheetIndex,
                int rowIndex, int columnIndex)
        {
            BookSheetKey bsk = new BookSheetKey(bookIndex, sheetIndex);
            _formulaCellCache.ApplyOperation(new EntryOperation(bsk,rowIndex,columnIndex,_evaluationListener));
        }

        public PlainValueCellCacheEntry GetPlainValueEntry(int bookIndex, int sheetIndex,
                int rowIndex, int columnIndex, ValueEval value)
        {

            Loc loc = new Loc(bookIndex, sheetIndex, rowIndex, columnIndex);
            PlainValueCellCacheEntry result = _plainCellCache.Get(loc);
            if (result == null)
            {
                result = new PlainValueCellCacheEntry(value);
                _plainCellCache.Put(loc, result);
                if (_evaluationListener != null)
                {
                    _evaluationListener.OnReadPlainValue(sheetIndex, rowIndex, columnIndex, result);
                }
            }
            else
            {
                // TODO - if we are confident that this sanity check is not required, we can Remove 'value' from plain value cache entry
                if (!AreValuesEqual(result.GetValue(), value))
                {
                    throw new InvalidOperationException("value changed");
                }
                if (_evaluationListener != null)
                {
                    _evaluationListener.OnCacheHit(sheetIndex, rowIndex, columnIndex, value);
                }
            }
            return result;
        }
        private bool AreValuesEqual(ValueEval a, ValueEval b)
        {
            if (a == null)
            {
                return false;
            }
            Type cls = a.GetType();
            if (cls != b.GetType())
            {
                // value type is changing
                return false;
            }
            if (a == BlankEval.instance)
            {
                return b == a;
            }
            if (cls == typeof(NumberEval))
            {
                return ((NumberEval)a).NumberValue == ((NumberEval)b).NumberValue;
            }
            if (cls == typeof(StringEval))
            {
                return ((StringEval)a).StringValue.Equals(((StringEval)b).StringValue);
            }
            if (cls == typeof(BoolEval))
            {
                return ((BoolEval)a).BooleanValue == ((BoolEval)b).BooleanValue;
            }
            if (cls == typeof(ErrorEval))
            {
                return ((ErrorEval)a).ErrorCode == ((ErrorEval)b).ErrorCode;
            }
            throw new InvalidOperationException("Unexpected value class (" + cls.Name + ")");
        }

        public FormulaCellCacheEntry GetOrCreateFormulaCellEntry(IEvaluationCell cell)
        {
            FormulaCellCacheEntry result = _formulaCellCache.Get(cell);
            if (result == null)
            {

                result = new FormulaCellCacheEntry();
                _formulaCellCache.Put(cell, result);
            }
            return result;
        }

        /**
         * Should be called whenever there are Changes To input cells in the evaluated workbook.
         */
        public void Clear()
        {
            if (_evaluationListener != null)
            {
                _evaluationListener.OnClearWholeCache();
            }
            _plainCellCache.Clear();
            _formulaCellCache.Clear();
        }
        public void NotifyDeleteCell(int bookIndex, int sheetIndex, IEvaluationCell cell)
        {

            if (cell.CellType == NPOI.SS.UserModel.CellType.FORMULA)
            {
                FormulaCellCacheEntry fcce = _formulaCellCache.Remove(cell);
                if (fcce == null)
                {
                    // formula cell Has not been evaluated yet
                }
                else
                {
                    fcce.SetSensitiveInputCells(null);
                    fcce.RecurseClearCachedFormulaResults(_evaluationListener);
                }
            }
            else
            {
                Loc loc = new Loc(bookIndex, sheetIndex, cell.RowIndex, cell.ColumnIndex);
                PlainValueCellCacheEntry pcce = _plainCellCache.Get(loc);

                if (pcce == null)
                {
                    // cache entry doesn't exist. nothing To do
                }
                else
                {
                    pcce.RecurseClearCachedFormulaResults(_evaluationListener);
                }
            }
        }
    }
}


text:
<?php
$lang['privacy_title10'] = 'Pemisiunile albumului';
$lang['privacy_title11'] = 'Pemisiunile albumului';
$lang['privacy_title12'] = 'Pemisiunile albumului';
$lang['privacy_title15'] = 'Varf';
$lang['privacy_title17'] = 'Grupuri';
$lang['privacy_title18'] = 'Grupuri';
$lang['privacy_title19'] = 'Utilizatori';
$lang['privacy_title20'] = 'Fotografii publice';
$lang['privacy_title21'] = 'Fotografii publice';
$lang['privacy_title24'] = 'Ne-am simtit minunat';
$lang['privacy_title3'] = 'Permisiuni';
$lang['privacy_title4'] = 'Permisiuni';
$lang['privacy_title5'] = 'Permisiuni>Grupuri';
$lang['privacy_title6'] = 'Nivel de intimitate';
$lang['privacy_title7'] = 'Nivel de intimitate';
$lang['privacy_title8'] = 'Nivel de intimitate';
$lang['privacy_title9'] = 'Nivel de intimitate';


text:
package org.apache.directory.server.core.authn;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.LdapPrincipalSerializer;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

/**
 *
 * Test the LdapPrincipal class
 *
 * @author Apache Directory Project
 */
@Execution(ExecutionMode.CONCURRENT)
public class LdapPrincipalTest
{
    /** The schema manager instance */
    private static SchemaManager schemaManager;

    @BeforeAll
    public static void setUp() throws Exception
    {
        schemaManager = new DefaultSchemaManager();
    }

    /**
     * Test the serialization of an empty LdapPrincipal
     */
    @Test
    public void testStaticSerializeEmptyLdapPrincipal() throws Exception
    {
        LdapPrincipal principal = new LdapPrincipal( schemaManager );

        try ( ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream( baos ) )
        {

            LdapPrincipalSerializer.serialize( principal, out );
            out.flush();

            byte[] data = baos.toByteArray();
            ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) );

            LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( schemaManager, in );
            assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel() );
            assertEquals( principal.getName(), readPrincipal.getName() );
        }
    }

    /**
     * Test the serialization of an empty LdapPrincipal
     */
    @Test
    public void testStaticSerializeLdapPrincipalWithSchemaManager() throws Exception
    {
        LdapPrincipal principal = new LdapPrincipal( schemaManager, new Dn( schemaManager, "uid=admin,ou=system" ),
            AuthenticationLevel.STRONG );

        try ( ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream( baos ) )
        {

            LdapPrincipalSerializer.serialize( principal, out );
            out.flush();

            byte[] data = baos.toByteArray();
            ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) );

            LdapPrincipal readPrincipal = LdapPrincipalSerializer.deserialize( schemaManager, in );
            assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel() );
            assertEquals( principal.getName(), readPrincipal.getName() );
        }
    }
}


text:
sap.ui.define([
	"sap/m/library",
	"sap/ui/core/Core",
	"sap/ui/core/theming/Parameters",
	"sap/m/IllustratedMessage",
	"sap/m/Button"
], function(MLibrary, Core, ThemeParameters, IllustratedMessage, Button) {
	"use strict";
	/*global Intl*/

	/**
	 * Provides utility functions for tables.
	 *
	 * @namespace
	 * @alias module:sap/m/table/Util
	 * @author SAP SE
	 * @version ${version}
	 * @since 1.96.0
	 * @private
	 * @ui5-restricted sap.fe, sap.ui.mdc, sap.ui.comp
	 */
	var Util = {};

	// local privates
	var sDefaultFont = "";
	var fBaseFontSize = parseFloat(MLibrary.BaseFontSize);
	var oSelectAllNotificationPopover = null;
	var pGetSelectAllPopover = null;
	/**
	 * Measures the given text width in a canvas and returns the value in rem.
	 *
	 * @param {string} sText The text to be measured
	 * @param {string} [sFont] The font. When not given, uses theme parameters: sapMFontMediumSize and sapUiFontFamily.
	 * @returns {float} The text width converted to rem
	 * @private
	 */
	Util.measureText = (function() {
		var fEpsilon = 0.05;
		var oCanvasContext = document.createElement("canvas").getContext("2d");
		var fnSetDefaultFont = function() {
			sDefaultFont = [
				parseFloat(ThemeParameters.get({ name: "sapMFontMediumSize" }) || "0.875rem") * fBaseFontSize + "px",
				ThemeParameters.get({ name: "sapUiFontFamily" }) || "Arial"
			].join(" ");
			return sDefaultFont;
		};

		Core.attachThemeChanged(fnSetDefaultFont);

		return function(sText, sFont) {
			oCanvasContext.font = sFont || sDefaultFont || fnSetDefaultFont();
			return oCanvasContext.measureText(sText || "").width / fBaseFontSize + fEpsilon;
		};
	})();

	/**
	 * Calculates the width of a given ODataType that is used in tables.
	 *
	 * @param {sap.ui.model.odata.type.ODataType} oType The ODataType instance
	 * @param {object} [mSettings] The settings object
	 * @param {int} [mSettings.maxWidth=19] The maximum content width of the field in rem
	 * @param {int} [mSettings.defaultWidth=8] The default column content width when type check fails
	 * @param {float} [mSettings.gap=0] The additional content width in rem
	 * @returns {float} The calculated width of the ODataType converted to rem
	 * @private
	 */
	Util.calcTypeWidth = (function() {
		var fBooleanWidth = 0;
		var aDateParameters = [2023, 9, 26, 22, 47, 58, 999];
		var oUTCDate = new Date(Date.UTC.apply(0, aDateParameters));
		var oLocalDate = new (Function.prototype.bind.apply(Date, [null].concat(aDateParameters)))();
		var mNumericLimits = { Byte: 3, SByte: 3, Int16: 5, Int32: 9, Int64: 12, Single: 6, Float: 12, Double: 13, Decimal: 15, Integer: 9 };
		Core.attachThemeChanged(function() { fBooleanWidth = 0; });

		return function(oType, mSettings) {

			var sType = oType.getMetadata().getName().split(".").pop();
			var iMaxWidth = mSettings && mSettings.maxWidth || 19;
			var iGap = mSettings && mSettings.gap || 0;
			var applySettings = function(fCalculatedWidth) {
				return Math.min(fCalculatedWidth + iGap, iMaxWidth);
			};

			if (sType == "Boolean") {
				if (!fBooleanWidth) {
					var oResourceBundle = Core.getLibraryResourceBundle("sap.ui.core");
					var fYesWidth = Util.measureText(oResourceBundle.getText("YES"));
					var fNoWidth = Util.measureText(oResourceBundle.getText("NO"));
					fBooleanWidth = Math.max(fYesWidth, fNoWidth);
				}
				return applySettings(fBooleanWidth);
			}

			if (sType == "String" || oType.isA("sap.ui.model.odata.type.String")) {
				var iMaxLength = parseInt(oType.getConstraints().maxLength) || 0;
				if (!iMaxLength || iMaxLength * 0.25 > iMaxWidth) {
					return iMaxWidth;
				}

				var fSampleWidth = Util.measureText("A".repeat(iMaxLength));
				if (iMaxLength < iMaxWidth || iMaxWidth < 10) {
					return applySettings(fSampleWidth);
				}

				var fWidth = Math.log(fSampleWidth - iMaxWidth * 0.16) / Math.log(iMaxWidth / 3) * (iMaxWidth / 2) * Math.pow(iMaxWidth / 19, 1 / fSampleWidth);
				return applySettings(Math.min(fWidth, fSampleWidth));
			}

			if (sType.startsWith("Date") || sType.startsWith("Time")) {
				var mFormatOptions = oType.getFormatOptions();
				var oDate = mFormatOptions.UTC ? oUTCDate : oLocalDate;
				var sSample = oDate.toLocaleDateString();

				if (sType == "TimeOfDay") {
					sSample = new Intl.DateTimeFormat("de", {hour: "numeric", minute: "numeric", second: "numeric"}).format(oDate);
					sSample = oType.formatValue(sSample, "string");
				} else if (oType.isA("sap.ui.model.odata.type.Time")) {
					sSample = oType.formatValue({ __edmType: "Edm.Time", ms: oUTCDate.valueOf() }, "string");
				} else {
					sSample = oType.formatValue(mFormatOptions.interval ? [oDate, new Date(oDate * 1.009)] : oDate, "string");
					((oType.oFormat && oType.oFormat.oFormatOptions && oType.oFormat.oFormatOptions.pattern) || "").replace(/[MELVec]{3,4}/, function(sWideFormat) {
						sSample += (sWideFormat.length == 4 ? "---" : "-");
					});
				}
				return applySettings(Util.measureText(sSample));
			}

			if (mNumericLimits[sType]) {
				var iScale = parseInt(oType.getConstraints().scale) || 0;
				var iPrecision = parseInt(oType.getConstraints().precision) || 20;
				iPrecision = Math.min(iPrecision, mNumericLimits[sType]);
				var sNumber = 2 * Math.pow(10, iPrecision - iScale - 1);
				sNumber = oType.formatValue(sNumber, "string");
				return applySettings(Util.measureText(sNumber));
			}

			return mSettings && mSettings.defaultWidth || 8;
		};

	})();

	/**
	 * Calculates the width of the column header width according to calculated cell content and min/max width restrictions.
	 *
	 * @param {string} sHeader The header text
	 * @param {float} [fContentWidth] The calculated width of the cell in rem
	 * @param {int} [iMaxWidth=19] The maximum header width in rem
	 * @param {int} [iMinWidth=2] The minimum header width in rem
	 * @returns {float} The calculated header width in rem
	 * @private
	 */
	Util.calcHeaderWidth = (function() {
		var sHeaderFont = "";
		var fnGetHeaderFont = function() {
			if (!sHeaderFont) {
				sHeaderFont = [ThemeParameters.get({ name: "sapUiColumnHeaderFontWeight" }) || "normal", sDefaultFont].join(" ");
			}
			return sHeaderFont;
		};

		Core.attachThemeChanged(function() { sHeaderFont = ""; });

		return function(sHeader, fContentWidth, iMaxWidth, iMinWidth) {
			var iHeaderLength = sHeader.length;
			iMaxWidth = iMaxWidth || 19;
			iMinWidth = iMinWidth || 2;

			if (fContentWidth > iMaxWidth) {
				return iMaxWidth;
			}
			if (iMinWidth > iHeaderLength) {
				return iMinWidth;
			}
			if (!fContentWidth) {
				return Util.measureText(sHeader, fnGetHeaderFont());
			}

			fContentWidth = Math.max(fContentWidth, iMinWidth);
			if (fContentWidth > iHeaderLength) {
				return fContentWidth;
			}

			var fOrigHeaderWidth = Util.measureText(sHeader, fnGetHeaderFont());
			fOrigHeaderWidth = Math.min(fOrigHeaderWidth, iMaxWidth * 0.7);

			var fContentHeaderRatio = Math.max(1, 1 - (Math.log(Math.max(fContentWidth - 1.7, 0.2)) / Math.log(iMaxWidth * 0.5)) + 1);
			var fMaxHeaderWidth = fContentHeaderRatio * fContentWidth;

			var fHeaderWidthDiff = Math.max(0, fOrigHeaderWidth - fMaxHeaderWidth);
			var fHeaderWidth = (fHeaderWidthDiff < 0.15) ? fOrigHeaderWidth : fMaxHeaderWidth + fHeaderWidthDiff * (1 - 1 / fContentWidth) / Math.E;
			return fHeaderWidth;
		};
	})();

	/**
	 * Calculates the width of a table column.
	 *
	 * @param {sap.ui.model.odata.type.ODataType[]} vTypes The ODataType instances
	 * @param {string} [sHeader] The header of the column
	 * @param {object} [mSettings] The settings object
	 * @param {int} [mSettings.minWidth=2] The minimum content width of the field in rem
	 * @param {int} [mSettings.maxWidth=19] The maximum content width of the field in rem
	 * @param {int} [mSettings.padding=1] The sum of column padding and border in rem
	 * @param {float} [mSettings.gap=0] The additional content width in rem
	 * @param {boolean} [mSettings.headerGap=false] Whether icons in the header should be taken into account
	 * @param {boolean} [mSettings.truncateLabel=true] Whether the header of the column can be truncated or not
	 * @param {boolean} [mSettings.verticalArrangement=false] Whether the fields are arranged vertically
	 * @param {boolean} [mSettings.required=false] Indicates the state of the column header as defined by the required property
	 * @param {int} [mSettings.defaultWidth=8] The default column content width when type check fails
	 * @returns {string} The calculated width of the column
	 * @private
	 * @ui5-restricted sap.fe, sap.ui.mdc, sap.ui.comp
	 * @since 1.101
	 */
	Util.calcColumnWidth = function(vTypes, sHeader, mSettings) {
		if (!Array.isArray(vTypes)) {
			vTypes = [vTypes];
		}

		mSettings = Object.assign({
			minWidth: 2,
			maxWidth: 19,
			defaultWidth: 8,
			truncateLabel: true,
			padding: 1.0625,
			gap: 0
		}, mSettings);

		var fHeaderWidth = 0;
		var iMinWidth = Math.max(1, mSettings.minWidth);
		var iMaxWidth = Math.max(iMinWidth, mSettings.maxWidth);

		var fContentWidth = mSettings.gap + vTypes.reduce(function(fInnerWidth, vType) {
			var oType = vType, oTypeSettings = {
				defaultWidth: mSettings.defaultWidth,
				maxWidth: mSettings.maxWidth
			};

			if (Array.isArray(vType)) {
				// for internal usage (mdc/Table) every field can provide own width settings
				// in this case we get [<TypeInstance>, <TypeSettings>][] instead of <TypeInstance>[]
				oType = vType[0];
				oTypeSettings = vType[1] || oTypeSettings;
			}

			var fTypeWidth = Util.calcTypeWidth(oType, oTypeSettings);
			return mSettings.verticalArrangement ? Math.max(fInnerWidth, fTypeWidth) : fInnerWidth + fTypeWidth + (fInnerWidth && 0.5);
		}, 0);

		if (sHeader) {
			fHeaderWidth = Util.calcHeaderWidth(sHeader, (mSettings.truncateLabel ? fContentWidth : 0), iMaxWidth, iMinWidth);
			fHeaderWidth += mSettings.headerGap ? (8 /* padding */ + 14 /* icon width */) / fBaseFontSize : 0;
			fHeaderWidth += mSettings.required ? parseFloat(ThemeParameters.get({ name: "sapMFontLargeSize" })) + 0.125 /* margin-left */: 0; // required marker
		}

		fContentWidth = Math.max(iMinWidth, fContentWidth, fHeaderWidth);
		fContentWidth = Math.min(fContentWidth, iMaxWidth);
		fContentWidth = Math.round(fContentWidth * 100) / 100;

		return fContentWidth + mSettings.padding + "rem";
	};

	/**
	 * Returns an instance of sap.m.IllustratedMessage in case there are no visible columns in the table.
	 *
	 * @returns {sap.m.IllustratedMessage} The message to be displayed when the table has no visible columns
	 * @param {function} [fnAddColumn] The handler to be executed when the additional add column button is pressed
	 * @private
	 */
	Util.getNoColumnsIllustratedMessage = function(fnAddColumn) {
		var oResourceBundle = Core.getLibraryResourceBundle("sap.m");

		var oIllustratedMessage = new IllustratedMessage({
			illustrationType: MLibrary.IllustratedMessageType.AddColumn,
			title: oResourceBundle.getText("TABLE_NO_COLUMNS_TITLE"),
			description: oResourceBundle.getText("TABLE_NO_COLUMNS_DESCRIPTION")
		});

		if (fnAddColumn) {
			var oAddButton = new Button({
				icon: "sap-icon://action-settings",
				press: fnAddColumn
			});
			oIllustratedMessage.addAdditionalContent(oAddButton);
		}

		return oIllustratedMessage;
	};

	/**
	 * Creates or returns the existing popover
	 *
	 * @returns {Promise} A promise that resolves when the popover is created
	 * @private
	 * @since 1.109
	 */
	Util.getSelectAllPopover = function() {
		if (pGetSelectAllPopover) {
			return pGetSelectAllPopover;
		}

		pGetSelectAllPopover = Promise.all(
            [new Promise(function(fnResolve) {
				sap.ui.require([
					"sap/m/Popover",
					"sap/m/Bar",
					"sap/m/HBox",
					"sap/m/Title",
					"sap/ui/core/library",
					"sap/m/Text"
				], function(Popover, Bar, HBox, Title, coreLib, Text) {
					fnResolve({
						Popover: Popover,
						Bar: Bar,
						HBox: HBox,
						Title: Title,
						coreLib: coreLib,
						Text: Text
					});
				});
			}),
            Core.getLibraryResourceBundle('sap.m', true)
		]).then(function(aResult) {
			var oModules = aResult[0];
			var oResourceBundle = aResult[1];
			var sIconColor = oModules.coreLib.IconColor.Critical,
			sTitleLevel = oModules.coreLib.TitleLevel.H2;

			oSelectAllNotificationPopover = new oModules.Popover({
				customHeader: new oModules.Bar({
					contentMiddle: [
						new oModules.HBox({
							items: [
								new oModules.coreLib.Icon({src: "sap-icon://message-warning", color: sIconColor})
									.addStyleClass("sapUiTinyMarginEnd"),
								new oModules.Title({text: oResourceBundle.getText("TABLE_SELECT_LIMIT_TITLE"), level: sTitleLevel})
							],
							renderType: "Bare",
							justifyContent: "Center",
							alignItems: "Center"
						})
					]
				}),
				content: [new oModules.Text()]
			}).addStyleClass("sapUiContentPadding");
			return {
				oSelectAllNotificationPopover: oSelectAllNotificationPopover,
				oResourceBundle: oResourceBundle
			};
		});
		return pGetSelectAllPopover;
	};

	/**
	 * Opens the Popover and sets the appropriate message.
	 *
	 * @param {int} iLimit The selectable items length
	 * @param {object} oSelectAllDomRef Control object where the popOver is opened
	 * @private
	 * @since 1.109
	 */
	Util.showSelectionLimitPopover = function(iLimit, oSelectAllDomRef) {
		Util.getSelectAllPopover().then(function(oResult) {
			var oPopover = oResult.oSelectAllNotificationPopover;
			var oResourceBundle = oResult.oResourceBundle;
			var sMessage = oResourceBundle.getText("TABLE_SELECT_LIMIT", [iLimit]);
			oPopover.getContent()[0].setText(sMessage); //Content contains a single text element
			if (oSelectAllDomRef) {
				oPopover.openBy(oSelectAllDomRef);
			}
		});
	};

	/**
	 * Closes the popover if opened
	 *
	 * @private
	 * @since 1.109
	 */
	Util.hideSelectionLimitPopover = function() {
		if (oSelectAllNotificationPopover && oSelectAllNotificationPopover.isOpen()) {
			oSelectAllNotificationPopover.close();
		}
	};

	return Util;

});


text:
title: "Spotlight: Git rebase"
layout: post
tags:
 - Git
keywords:
 - git-rebase
 - git-merge
---
This article is about the common problem one faces, when working with feature branches.
At one point in time one wants to reintegrate a feature (branch) back into the current development branch (often called *master* or *development*).
Git offers two different approaches for this:
The simplest one is a `git merge` which creates a new commit containing the complete diff of the two branches.
The other but more complex one is a combination of `git rebase` and `git merge`.
These two commands in combination allows a user to merge not just only the file diffs but also preserves the complete history of the feature branch which may be helpful in most cases since the commit messages contain relevant information as well.

<!-- more -->

In order to set up a Git repository having two branches and some commits I have created a small bash script which creates some files and commits to the different branches.
Using this setup I have played around using `git rebase` command to illustrate how this command actually works. Figure 1 shows the commit graph which is the result when one executes the bash script.

{% include image.html file="initial-repo-structure.svg" caption="Fig. 1: Initial commit history of demo repository" %}

At this point we assume that the feature is fully implemented and is about to be reintegrated into the master branch.
The question now is: How does one have to call the `git rebase` command.
Figure 2 and Figure 3 show the different results depending on which branch the `rebase` command is applied.
When the `rebase` command is called, Git looks for a common ancestor in the commit graph and uses this as basis for merging all later commits.
In this example *M2* is the last common commit of both branches and will be used as starting point.
Now one has to know how `rebase` actually works:
`git rebase` always appends all commits of a branch to the end of commits of the branch which is currently checked out.
Hence, when one wants to reintegrate a feature branch, one has to checkout the feature branch first and then call `git rebase master`.
When I call the `rebase` command I add an imaginary "*to*" to the call: `git rebase (to master)` which makes the way `rebase` is working clearer.
The command tells Git onto which branch the current branch shall be applied (cf. Figure 3).

## git rebase feature
{% include image.html file="git-rebase-feature.svg" caption="Fig. 2: Rebase feature branch (to master)" %}
This example assumes, that the master branch is checked out.
Hence, the commits after *M2* are cut off and appended one by one to the very last commit of the feature branch.

## git rebase master
{% include image.html file="git-rebase-master.svg" caption="Fig. 3: Rebase master branch (to feature)" %}
In this example we assume, that the feature branch is checked out.
Thus, the commits of the feature branch made after *M2* are cut off and appended one after the other to the last commit of the master branch.

## Conclusion
Git's `rebase` command is a nice way to preserve commits of a feature branch and allows to add all commits to the development branch without loosing them.
This helps to reduce the amount of branches as rebased branches can be safely removed.
But using `rebase` might also mess up your history, since the whole history (at least the timestamps) are reset.
Thus, `rebase` is dangerous as well when used the wrong way.

Nevertheless, using `rebase` over `merge` (espacially a fast-forward merge) always depends on the current use-case.
In some cases it might be useful to preserve the branch commit history, then one should rely on `rebase`.
When the history is irrelevant or contains messages which should not be part of the later result, using `git merge` might be a better choice.

## Appendix: Bash script

{% gist 26e291331eb5eabb145b %}


text:
//
// Created by anshu-pc on 2020/7/31.
//

#include "_30_template.h"

//方法模板和类模板
/*
template <typename type> ret-type func-name(parameter list)
{
}

template <class type> class class-name {
}
 */
template <typename T>
class TemplateClass{

};


text:
layout: post
title: "this is not aesthetic (but it was good)"
excerpt: ""
date:  2017-09-13 5:46:00
tags: [food]
categories: [photos]
comments: true
image:
  feature: "https://farm5.staticflickr.com/4394/37061634146_087facedaf_o.jpg"
more: false
---

We finally found some vegetables. #five+aday #thereaintnootherway


text:
#ifndef __PASSWD_H__
#define __PASSWD_H__

#include "String.h"
#include "callsign.h"

class consolpw
{
 protected:

  unsigned int password_flags;
  bool ax25_flag;

  /* Die Passwort-Flags und ihre Bedeutung.
     .
     1 : Konsolenpasswort wird benutzt
     2 : Name als Initialpasswort
     4 : benutzer kann Passwort aendern.

  */

 public:
  consolpw( bool );
  inline bool use_pw( void )
    {
      return (password_flags & 1) != 0;
    }
  inline bool user_change( void )
    {
      return (password_flags & 4) != 0;
    }
  inline void set_ax25_flag( void )
    {
      ax25_flag = true;
    }
  inline bool ax25_connection( void )
    {
      return ax25_flag;
    }
  bool check_ax25password( const callsign &, char *, const String & );
  bool check_password( const callsign&, const String& );
  bool change_password( const callsign&, const String&, const String& );
  bool set_password( const callsign&, const String& );
};

#endif // __PASSWD_H__


text:
/*!
 *  Copyright (c) 2017 by Contributors
 * \file codegen_source_base.cc
 */
#include "codegen_source_base.h"

namespace tvm {
namespace codegen {

void CodeGenSourceBase::ClearFuncState() {
  name_alloc_map_.clear();
  ssa_assign_map_.clear();
  var_idmap_.clear();
  scope_mark_.clear();
}

std::string CodeGenSourceBase::GetUniqueName(std::string prefix) {
  for (size_t i = 0; i < prefix.size(); ++i) {
    if (prefix[i] == '.') prefix[i] = '_';
  }
  auto it = name_alloc_map_.find(prefix);
  if (it != name_alloc_map_.end()) {
    while (true) {
      std::ostringstream os;
      os << prefix << (++it->second);
      std::string name = os.str();
      if (name_alloc_map_.count(name) == 0) {
        prefix = name;
        break;
      }
    }
  }
  name_alloc_map_[prefix] = 0;
  return prefix;
}

std::string CodeGenSourceBase::SSAGetID(std::string src, Type t) {
  if (name_alloc_map_.count(src)) return src;
  auto it = ssa_assign_map_.find(src);
  if (it != ssa_assign_map_.end()) {
    if (scope_mark_.at(it->second.scope_id)) {
      return it->second.vid;
    }
  }
  SSAEntry e;
  e.vid = GetUniqueName("_");
  e.scope_id = static_cast<int>(scope_mark_.size() - 1);
  ssa_assign_map_[src] = e;
  this->PrintIndent();
  PrintSSAAssign(e.vid, src, t);
  return e.vid;
}

std::string CodeGenSourceBase::AllocVarID(const Variable* v) {
  CHECK(!var_idmap_.count(v))
      << "Need input to be in SSA form dup " << v->name_hint;
  std::string key = v->name_hint;
  std::string vid = GetUniqueName(key);
  var_idmap_[v] = vid;
  return vid;
}

std::string CodeGenSourceBase::GetVarID(const Variable* v) const {
  auto it = var_idmap_.find(v);
  CHECK(it != var_idmap_.end())
      << "Find undefined Variable " << v->name_hint;
  return it->second;
}

void CodeGenSourceBase::PrintIndent() {
  for (int i = 0; i < indent_; ++i) {
    this->stream << ' ';
  }
}

void CodeGenSourceBase::MarkConst(std::string vid) {
  auto it = ssa_assign_map_.find(vid);
  if (it == ssa_assign_map_.end()) {
    SSAEntry e;
    e.vid = vid;
    e.scope_id = 0;
    ssa_assign_map_[vid] = e;
  } else {
    CHECK_EQ(it->second.vid, vid);
  }
}

int CodeGenSourceBase::BeginScope() {
  int sid = static_cast<int>(scope_mark_.size());
  scope_mark_.push_back(true);
  indent_ += 2;
  return sid;
}

void CodeGenSourceBase::EndScope(int scope_id) {
  scope_mark_[scope_id] = false;
  indent_ -= 2;
}

}  // namespace codegen
}  // namespace tvm


text:
\documentclass{article}

\begin{document}

This is a LaTeX document.

\end{document}


text:
pub mod dom;
pub mod drag;
pub mod focus;
pub mod gamepad;
pub mod history;
pub mod keyboard;
pub mod mouse;
pub mod pointer;
pub mod progress;
pub mod socket;
pub mod slot;
pub mod touch;


text:
package Entity.Enemies;

import Entity.*;
import TileMap.TileMap;

import java.awt.image.BufferedImage;
import java.awt.Graphics2D;

import javax.imageio.ImageIO;

public class Slugger extends Enemy {

	private BufferedImage[] sprites;

	public Slugger(TileMap tm) {

		super(tm);

		moveSpeed = 0.3;
		maxSpeed = 0.3;
		fallSpeed = 0.2;
		maxFallSpeed = 10.0;

		width = 30;
		height = 30;
		cwidth = 20;
		cheight = 20;

		health = maxHealth = 2;
		damage = 1;

		// load sprites
		try {

			BufferedImage spritesheet = ImageIO.read(
				getClass().getResourceAsStream(
					"/Sprites/Enemies/slugger.gif"
				)
			);

			sprites = new BufferedImage[3];
			for(int i = 0; i < sprites.length; i++) {
				sprites[i] = spritesheet.getSubimage(
					i * width,
					0,
					width,
					height
				);
			}

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

		animation = new Animation();
		animation.setFrames(sprites);
		animation.setDelay(300);

		right = true;
		facingRight = true;

	}

	private void getNextPosition() {

		// movement
		if(left) {
			dx -= moveSpeed;
			if(dx < -maxSpeed) {
				dx = -maxSpeed;
			}
		}
		else if(right) {
			dx += moveSpeed;
			if(dx > maxSpeed) {
				dx = maxSpeed;
			}
		}

		// falling
		if(falling) {
			dy += fallSpeed;
		}

	}

	public void update() {

		// update position
		getNextPosition();
		checkTileMapCollision();
		setPosition(xtemp, ytemp);

		// check flinching
		if(flinching) {
			long elapsed =
				(System.nanoTime() - flinchTimer) / 1000000;
			if(elapsed > 400) {
				flinching = false;
			}
		}

		// if it hits a wall, go other direction
		if(right && dx == 0) {
			right = false;
			left = true;
			facingRight = false;
		}
		else if(left && dx == 0) {
			right = true;
			left = false;
			facingRight = true;
		}

		// update animation
		animation.update();

	}

	public void draw(Graphics2D g) {

		//if(notOnScreen()) return;

		setMapPosition();

		super.draw(g);

	}

}


text:
/**
 * Created by st0001 on 2016/11/25.
 */
wangEditor.config.mapAk = 'EQRCjCyVfZ2rzY9CeM8GqVZe1cR1c2bv';
var editor = new wangEditor('editor');
editor.config.uploadImgUrl = '/editComment/upload';
editor.config.uploadParams = {
    '_token': $('meta[name="csrf-token"]').attr('content')
};
editor.config.uploadImgFileName = 'photo';

editor.create();

function submitComment() {
    var html = editor.$txt.html();
    $.ajax({
        type: 'POST',
        url: 'editComment/publish',
        data: {
            'content':html,
            '_token': $('meta[name="csrf-token"]').attr('content')
        },
        success:function () {
            window.location.replace('commentPage');
        }
    });

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>awscommons</artifactId>
        <groupId>de.butterworks</groupId>
        <version>1.5-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.butterworks.awscommons</groupId>
    <artifactId>lambdaweb</artifactId>
    <packaging>jar</packaging>

    <name>lambdaweb</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.9</version>
        </dependency>
        <dependency>
            <groupId>io.sentry</groupId>
            <artifactId>sentry</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.7</version>
        </dependency>
    </dependencies>
</project>


text:
<?php

namespace MNHcC\Zend3bcHelper\Helper {

    use MNHcC\Zend3bcHelper\Basic\Zend3bcHelperInterface;

    /**
     * Description of AbstractTypeHelper
     *
     * @author carschrotter
     */
    abstract class AbstractTypeHelper implements Zend3bcHelperInterface {

        /**
         * Check is a Removed Zend Class or Moved Namespace, reimplemented from Zend3bcHelper
         * Check whit instanceof Zend3bcHelperInterface or defined('SomeClass::IS_ZEND_3_BC_HELPER_CLASS')
         * @param string $class_or_object the class or object you would test
         * @return bool true is a reimplemented class
         * @throws \ReflectionException
         */
        public static function isZend3bcHelperClass($class_or_object) {
            $refl = new \ReflectionClass($class_or_object);
            return (bool) $refl->isSubclassOf(Zend3bcHelperInterface::class) || $refl->hasConstant(static::IS_ZEND_3_BC_HELPER_CLASS);
        }

        /**
         * return the mvc module minor version because in zf 3
         * exclude many things from default module
         * @staticvar int $version
         * @return int
         */
        public static function wichZendMvcMajor() {
            static $version;

            if ($version){
                return $version;
            }

            $version = false;
            if(!$version){
            switch (true) {
                /**
                 * check is not namespace \Zend\Mvc\Router\... because zend removed router from Mvc namspace
                 */
               case (!class_exists(\Zend\Mvc\Router\RouteInterface::class) && class_exists(\Zend\Router\RouteInterface::class)): //check is v3 MVC component
                    $version = 3;
                    break;
                /**
                 * check is the new sceleton aplication (used v3 component
                 */
                case ( (@defined('\Application\Module::VERSION') //check for new sceleton aplication
                && version_compare(\Application\Module::VERSION, '3.0.0dev', '>=')) ) :
                    $version = 3;
                    break;

                default :
                    $version = 2;
                    break;
            }}
            return $version;
        }

    }

}


text:
class CJLValue : public CJValue {
 public:
  explicit CJLValue(CJObjTypeP valueType);

  virtual ~CJLValue() { }

  virtual CJValueP value() const = 0;
  virtual void setValue(CJValueP value) = 0;

  virtual bool isWritable() const { return true; }
  virtual void setWritable(bool) { }
};

#endif


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

namespace TaskMaster
{
    public abstract class EventCallbackHandler
    {
        public object TargetObject { get; protected set; }
        public abstract void Execute(object argument);
    }

    public class ActionEventCallbackHandler<T> : EventCallbackHandler
    {
        public Action<T> Callback { get; private set; }

        public override void Execute (object argument)
        {
            if (argument is T)
                Callback((T)argument);
        }

        public ActionEventCallbackHandler(Action<T> callback)
        {
            Callback = callback;
            TargetObject = Callback;
        }
    }

    public class VoidActionEventCallbackHandler : EventCallbackHandler
    {
        public Action Callback { get; private set; }

        public override void Execute (object argument) { Callback(); }

        public VoidActionEventCallbackHandler(Action callback)
        {
            Callback = callback;
            TargetObject = Callback;
        }
    }

    public class EventHubSubscription
    {
        public EventHub Hub { get; private set; }

        public object EventKey { get; private set; }
        public object TargetObject { get; private set; }

        public bool Canceled { get; private set; }

        public void Cancel() { Hub.RemoveReceiver(EventKey, TargetObject); }

        public EventHubSubscription(EventHub hub, object key, object targetObject)
        {
            Hub = hub;
            EventKey = key;
            TargetObject = TargetObject;
        }
    }

    public class EventHubSubscriber
    {
        private List<EventHubSubscription> _subscriptions = new List<EventHubSubscription>();

        private void AddSubscription(EventHubSubscription subscription)
        {
            if (subscription != null)
            {
                lock (_subscriptions)
                    _subscriptions.Add(subscription);
            }
        }

        public void Unsubscribe(EventHub hub)
        {
            lock (_subscriptions)
            {
                _subscriptions.RemoveAll(subscription =>
                {
                    if (subscription.Hub == hub)
                    {
                        subscription.Cancel();
                        return true;
                    }
                    return false;
                });
            }
        }

        public void UnsubscribeAll()
        {
            lock (_subscriptions)
            {
                foreach (var subscription in _subscriptions)
                    subscription.Cancel();

                _subscriptions.Clear();
            }
        }

        public void AddReceiver(EventHub hub, object key, EventCallbackHandler callback) { AddSubscription(hub.AddReceiver(key, callback)); }
        public void AddReceiver<T>(EventHub hub, Action<T> callback) { AddSubscription(hub.AddReceiver<T>(callback)); }
        public void AddReceiver(EventHub hub, string eventName, Action callback) { AddSubscription(hub.AddReceiver(eventName, callback)); }
    }

    public class EventHub
    {
        private Dictionary<object, List<EventCallbackHandler>> _handlers = new Dictionary<object, List<EventCallbackHandler>>();

        public EventHubSubscription AddReceiver(object key, EventCallbackHandler callback)
        {
            if (callback != null && callback.TargetObject != null)
            {
                lock (_handlers)
                {
                    List<EventCallbackHandler> handlerList;
                    if (_handlers.TryGetValue(key, out handlerList))
                    {
                        foreach (var handler in handlerList)
                        {
                            if (callback.TargetObject == handler.TargetObject)
                                return null;
                        }
                    }
                    else
                    {
                        handlerList = new List<EventCallbackHandler>();
                        _handlers[key] = handlerList;
                    }

                    handlerList.Add(callback);
                    return new EventHubSubscription(this, key, callback.TargetObject);
                }
            }
            return null;
        }

        public void RemoveReceiver(object key, object targetObject)
        {
            if (key != null)
            {
                lock (_handlers)
                {
                    List<EventCallbackHandler> handlerList;
                    if (_handlers.TryGetValue(key, out handlerList))
                    {
                        handlerList.RemoveAll((handler) =>
                        {
                            return handler.TargetObject == targetObject;
                        });

                        if (handlerList.Count == 0)
                            _handlers.Remove(key);
                    }
                }
            }
        }

        public EventHubSubscription AddReceiver<T>(Action<T> callback) { return AddReceiver(typeof(T), new ActionEventCallbackHandler<T>(callback)); }
        public void RemoveReceiver<T>(Action<T> callback) { RemoveReceiver(typeof(T), callback); }

        public EventHubSubscription AddReceiver(string eventName, Action callback) { return AddReceiver(eventName, new VoidActionEventCallbackHandler(callback)); }
        public void RemoveReceiver(string eventName, Action callback) { RemoveReceiver(eventName, callback); }

        public bool Send(object key, object eventObject)
        {
            bool anyReceived = false;
            if (key != null)
            {
                List<EventCallbackHandler> handlerList;

                lock (_handlers)
                {
                    if (_handlers.TryGetValue(key, out handlerList))
                    {
                        foreach (var handler in handlerList)
                        {
                            try { handler.Execute(eventObject); }
                            catch (Exception e) { Log.Default.Exception(e); } //TODO: Engine independant exception logging. Maybe send off an exception event?
                        }
                    }
                }
            }
            return anyReceived;
        }

        public bool Send(object eventObject)
        {
            if (eventObject != null)
                return Send(eventObject.GetType(), eventObject);
            return false;
        }

        public bool Send<T>(T eventObject) { return Send(typeof(T), eventObject); }

        public void SendQueued(ActionQueue queue, object key, object eventObject) { queue.AddAction(() => { Send(key, eventObject); }); }

        public void SendQueued(ActionQueue queue, object eventObject)
        {
            if (eventObject != null)
                SendQueued(queue, eventObject.GetType(), eventObject);
        }

        public void SendQueued<T>(ActionQueue queue, T eventObject) { SendQueued(queue, typeof(T), eventObject); }
    }
}


text:
class IntroState : public State {
	public:
	IntroState();

	// Loop methods
	StateChange update(int event) override;

};

#endif


text:
package gov.nih.nci.system.client.util.xml;

public class XMLUtilityException extends Exception {

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private Exception rootException;

    public XMLUtilityException(String message, Throwable cause) {
        super(message);
        rootException = (Exception)cause;
    }

    public XMLUtilityException(String message) {
        super(message);
        rootException = null;
    }

    /**
     * Returns the root exception that caused the exception
     * in the xml serialization/deserialization routing.
     * Can also return the Exception from the underlying xml
     * serialization library.
     * @return root exception
     */
    public Exception getRootException() {
        return rootException;
    }

}