text:
package st.brothas.mtgoxwidget;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.widget.RemoteViews;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import st.brothas.mtgoxwidget.net.HttpManager;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

import static st.brothas.mtgoxwidget.CurrencyConversion.VirtualCurrency.LITECOIN;

/**
 *
 */
public class MtGoxWidgetProvider extends AppWidgetProvider {
    public static final String LOG_TAG = "MtGox";
	private static final SimpleDateFormat dateFormat = new SimpleDateFormat("E HH:mm");
    private static final int DATA_IS_CONSIDERED_OLD_AFTER_MINUTES = 60;

    private enum WidgetColor {Warning, StartValue, Increase, Decrease, Normal}

    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        updateAppWidgetAsync(context, appWidgetManager, appWidgetIds);
    }

    public static void updateAppWidgetAsync(final Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
        updateAppWidgetAsync(context, appWidgetManager, new int[] { appWidgetId });
    }

    public static void updateAppWidgetAsync(final Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        new UpdateAsyncTask(context, appWidgetManager, appWidgetIds).execute();
    }

    private static void updateAppWidget(final Context context, AppWidgetManager appWidgetManager, int appWidgetId) {

        WidgetPreferences preferences = MtGoxPreferencesActivity.getWidgetPreferences(context, appWidgetId);

        if (preferences == null) {
            // Don't do anything unless the rate service has been chosen.
            // Show a "please remove this widget and add a new one"
            appWidgetManager.updateAppWidget(appWidgetId,
                    new RemoteViews(context.getPackageName(), R.layout.appwidget_replace_me));
            return;
        }

        boolean isOnLockScreen = isWidgetShownOnLockScreen(appWidgetManager, appWidgetId);

        RemoteViews views;
        if (isOnLockScreen) {
            views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_lock_screen);
        } else {
            views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider);
        }

        Intent clickIntent = new Intent(context, GraphPopupActivity.class);
        clickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
        clickIntent.setAction("dummyAction"); // Needed to get the extra variables included in the call
        // Note: the appWidgetId needs to be sent in the pendingIntent as request code, otherwise only ONE
        //       cached intent will be used for all widget instances!
        PendingIntent pendingIntent = PendingIntent.getActivity(context, appWidgetId, clickIntent, 0);
        views.setOnClickPendingIntent(R.id.appwidget_box, pendingIntent);
        views.setTextViewText(R.id.appwidget_service_name, preferences.getRateService().getName());

        MtGoxDataOpenHelper dbHelper = new MtGoxDataOpenHelper(context);
        MtGoxTickerData prevData = dbHelper.getLastTickerData(preferences);

        MtGoxTickerData newData;
        String latestQuote = getLatestQuote(preferences);
        if (latestQuote != null && !latestQuote.equals("")) {
            newData = preferences.getRateService().parseJSON(latestQuote);
            newData.setCurrencyConversion(preferences.getCurrencyConversion());
            storeLastValueIfNotNull(dbHelper, newData);
            updateViews(views, prevData, newData, preferences);
        } else if (prevData != null) {
            newData = prevData;
            updateViews(views, prevData, newData, preferences);
        } else {
            updateViewsWithError(views, preferences);
        }
        appWidgetManager.updateAppWidget(appWidgetId, views);
   }

    private static boolean isWidgetShownOnLockScreen(AppWidgetManager appWidgetManager, int appWidgetId) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            // The below functionality was introduced in API version 16 (Jelly Bean)
            Bundle myOptions = appWidgetManager.getAppWidgetOptions(appWidgetId);

            // Get the value of OPTION_APPWIDGET_HOST_CATEGORY
            int category = myOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, -1);

            // If the value is WIDGET_CATEGORY_KEYGUARD, it's a lockscreen widget
            return category == AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD;
        }
        return false;
    }

    private static void updateViews(RemoteViews views, MtGoxTickerData prevData, MtGoxTickerData newData,
                                    WidgetPreferences preferences) {
        String updated = "@ " + dateFormat.format(newData.getTimestamp());
        String lastRounded = round(newData.getLast());
        String lowRounded = round(newData.getLow());
        String highRounded = round(newData.getHigh());

        views.setTextViewText(R.id.appwidget_last, preferences.getCurrencyConversion().symbol + lastRounded);
        views.setTextColor(R.id.appwidget_updated, getColor(preferences.getColorMode(), WidgetColor.Normal));
        if (newData.getTimestamp().before(getDateMinutesAgo(DATA_IS_CONSIDERED_OLD_AFTER_MINUTES))) {
            // Data is old, show it by "old" and "warning" colors
            views.setTextColor(R.id.appwidget_last, Color.GRAY);
            views.setTextColor(R.id.appwidget_updated, getColor(preferences.getColorMode(), WidgetColor.Warning));
        } else if (prevData != null) {
            // We have previous data, compare to get the color
            views.setTextColor(R.id.appwidget_last, getColorFromValueChange(prevData.getLast(),
                    newData.getLast(), preferences.getColorMode()));
        } else {
            // No previous data, set standard color
            views.setTextColor(R.id.appwidget_last, getColor(preferences.getColorMode(), WidgetColor.StartValue));
        }
        views.setTextViewText(R.id.appwidget_high, highRounded);
        views.setTextViewText(R.id.appwidget_low, lowRounded);
        views.setTextViewText(R.id.appwidget_updated, updated);

        // Set Litecoin logo if that is the chosen currency.
        switch (preferences.getCurrencyConversion().virtualCurrency) {
            case LITECOIN:
                views.setImageViewResource(R.id.appwidget_logo, R.drawable.lc_logo_30);
                break;
            case QUARK:
                views.setImageViewResource(R.id.appwidget_logo, R.drawable.qrk_logo_30);
                break;
            // The Bitcoin logo is default in the layout.
        }
    }

    private static void updateViewsWithError(RemoteViews views, WidgetPreferences preferences) {
        views.setTextViewText(R.id.appwidget_last, "N/A");
        views.setTextColor(R.id.appwidget_last, getColor(preferences.getColorMode(), WidgetColor.Warning));
        views.setTextViewText(R.id.appwidget_updated, "@ " + dateFormat.format(new Date()));
        views.setTextColor(R.id.appwidget_updated, getColor(preferences.getColorMode(), WidgetColor.Normal));
    }

    private static int getColor(ColorMode colorMode, WidgetColor widgetColor) {
        if (colorMode.equals(ColorMode.Default)) {
            switch(widgetColor) {
                case Warning:
                    return Color.parseColor("#ff3030");
                case StartValue:
                    return Color.YELLOW;
                case Normal:
                    return Color.LTGRAY;
                case Increase:
                    return Color.GREEN;
                case Decrease:
                    return Color.parseColor("#ff3030");
                default:
                    throw new IllegalArgumentException("No color defined for " + widgetColor);
            }
        } else if (colorMode.equals(ColorMode.Grayscale)) {
            switch(widgetColor) {
                case Warning:
                    return Color.WHITE;
                case StartValue:
                    return Color.LTGRAY;
                case Normal:
                    return Color.LTGRAY;
                case Increase:
                    return Color.WHITE;
                case Decrease:
                    return Color.GRAY;
                default:
                    throw new IllegalArgumentException("No color defined for " + widgetColor);
            }
        } else {
            throw new IllegalArgumentException("No color mode defined for " + colorMode);
        }
    }

    private static Date getDateMinutesAgo(int minutes) {
        return new Date(System.currentTimeMillis() - (minutes*60*1000));
    }

    private static String round(Double value) {
        if (value == null) {
            return "N/A";
        }

        int decimals = 2;
        if (value >= 1000) {
            decimals = 0;
        } else if (value >= 100) {
            decimals = 1;
        } else if (value < 10) {
            decimals = 3;
        }

        return BigDecimal.valueOf(value).setScale(decimals, BigDecimal.ROUND_HALF_UP).toString();
    }

    private static int getColorFromValueChange(Double prevValue, Double nowValue, ColorMode colorMode) {
    	if (prevValue == null || nowValue == null || prevValue.equals(nowValue)) {
    		return getColor(colorMode, WidgetColor.StartValue);
    	} else if (prevValue < nowValue) {
    		return getColor(colorMode, WidgetColor.Increase);
    	} else {
    		return getColor(colorMode, WidgetColor.Decrease);
    	}
	}

	private static void storeLastValueIfNotNull(MtGoxDataOpenHelper dbHelper, MtGoxTickerData data) {
		if (data != null) {
			dbHelper.storeTickerData(data);
			dbHelper.cleanUp();
       }
	}

    private static String getLatestQuote(WidgetPreferences preferences) {
        HttpGet httpget = new HttpGet(preferences.getRateService().getTickerUrl(preferences.getCurrencyConversion()));
        HttpResponse response;
        try {
            response = HttpManager.execute(httpget);
            HttpEntity entity = response.getEntity();
            String responseString = "";
            if (entity != null) {
                InputStream inStream = entity.getContent();
                responseString = convertStreamToString(inStream);
                inStream.close();
            }
            return responseString;
        } catch (ClientProtocolException e) {
            Log.e(LOG_TAG, "Error when getting JSON", e);
        } catch (IOException e) {
            Log.e(LOG_TAG, "Error when getting JSON: " + e.getMessage());
        }
        return null;
    }

    private static String convertStreamToString(InputStream inStream) {
        BufferedReader rd = new BufferedReader(new InputStreamReader(inStream), 4096);
        String line;
        StringBuilder sb =  new StringBuilder();
        try {
            while ((line = rd.readLine()) != null) {
                sb.append(line);
            }
            rd.close();
        } catch (IOException e) {
            Log.e(LOG_TAG, "Error when converting inputstream to string", e);
        }
        return sb.toString();
    }
    @Override
    public void onDeleted(Context context, int[] appWidgetIds) {
        // When the user deletes the widget, delete the preference associated with it.
        for (int appWidgetId : appWidgetIds) {
            MtGoxPreferencesActivity.deletePrefs(context, appWidgetId);
        }
    }

    public static void updateAppWidgetWithWaitMessage(Context context,
                                                      AppWidgetManager appWidgetManager,
                                                      int appWidgetId) {
        appWidgetManager.updateAppWidget(appWidgetId,
                new RemoteViews(context.getPackageName(), R.layout.appwidget_loading));
    }

    /**
     * Class for updating the widget(s) asynchronously (not on main thread).
     */
    private static class UpdateAsyncTask extends AsyncTask<Void, Void, Void> {
        private Context context;
        private AppWidgetManager appWidgetManager;
        private int[] appWidgetIds;

        public UpdateAsyncTask(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
            this.context = context;
            this.appWidgetManager = appWidgetManager;
            this.appWidgetIds = appWidgetIds;
        }

        @Override
        protected Void doInBackground(Void... bla) {
            for (int appWidgetId : appWidgetIds) {
                updateAppWidget(context, appWidgetManager, appWidgetId);
            }
            return null;
        }
    }
}


text:
package com.gs.collections.impl.multimap.set.strategy;

import com.gs.collections.api.multimap.MutableMultimap;
import com.gs.collections.impl.block.factory.HashingStrategies;
import com.gs.collections.impl.multimap.MutableMultimapSerializationTestCase;

public class UnifiedSetWithHashingStrategyMultimapSerializationTest
        extends MutableMultimapSerializationTestCase
{
    @Override
    protected String getSerializedForm()
    {
        return "rO0ABXNyAFNjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5tdWx0aW1hcC5zZXQuc3RyYXRlZ3kuVW5p\n"
                + "ZmllZFNldFdpdGhIYXNoaW5nU3RyYXRlZ3lNdWx0aW1hcAAAAAAAAAABDAAAeHBzcgBHY29tLmdz\n"
                + "LmNvbGxlY3Rpb25zLmltcGwuYmxvY2suZmFjdG9yeS5IYXNoaW5nU3RyYXRlZ2llcyREZWZhdWx0\n"
                + "U3RyYXRlZ3kAAAAAAAAAAQIAAHhwdwQAAAACdAABQXcEAAAAAnEAfgAEdAABQnEAfgAFdwQAAAAB\n"
                + "cQB+AAR4";
    }

    @Override
    protected MutableMultimap<String, String> createEmpty()
    {
        return new UnifiedSetWithHashingStrategyMultimap<String, String>(HashingStrategies.<String>defaultStrategy());
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace ktt
{

template <typename T, typename Filter>
bool ContainsElementIf(const std::vector<T>& vector, const Filter& filter);

template <typename T>
bool ContainsElement(const std::vector<T>& vector, const T& element);

template <typename T>
bool ContainsUniqueElements(const std::vector<T>& vector);

template <typename T, typename Filter>
size_t EraseIf(std::vector<T>& vector, const Filter& filter);

template <typename Key, typename Value>
bool ContainsKey(const std::map<Key, Value>& map, const Key& key);

template <typename Key, typename Value>
bool ContainsValue(const std::map<Key, Value>& map, const Value& value);

template <typename Key>
bool ContainsKey(const std::set<Key>& set, const Key& key);

template <typename Key, typename Value, typename Filter>
size_t EraseIf(std::map<Key, Value>& map, const Filter& filter);

} // namespace ktt

#include <Utility/StlHelpers.inl>


text:
sap.ui.define([
	"./testfwk",
	"jquery.sap.sjax",
	"sap/base/strings/escapeRegExp",
	"sap/ui/core/Core",
	"sap/ui/util/Storage",
	"test-resources/sap/ui/core/qunit/test/starter/find/discovery",
	"sap/base/util/isEmptyObject"
], function(testfwk, jQuery, escapeRegExp, oCore, Storage, discovery, isEmptyObject) {
	"use strict";

	oCore.attachInit(function onLoadPage() {
		document.getElementById("filter").focus();
		setTimeout(loadSamples, 10);
	});

	function showBusyIndicators() {
		document.getElementById("library-tests").innerHTML = "";
		document.getElementById("application-pages").innerHTML = "";
	}

	function loadSamples(forceRefresh) {
		document.getElementById("samples").style.opacity = "0.2";
		document.getElementById("samples").style.cursor = "wait";
		showBusyIndicators();
		return Promise.all([
			discoverAppPages(),
			fetchTestsFromDiscoveryService(),
			fetchTestsFromTestStarterDiscovery(forceRefresh)
		]).finally(function() {
			document.getElementById("samples").style.opacity = "";
			document.getElementById("samples").style.cursor = "";
		});
	}

	function refreshSamples(oEvent) {
		loadSamples(true);
	}

	function getLibForElement(oElem) {
		while (oElem && !oElem.dataset.libname) {
			oElem = oElem.parentNode;
		}
		if (oElem) {
			return oElem.dataset.libname;
		} else {
			return null;
		}
	}

	function getThemesForElement(oElem) {
		var libName = getLibForElement(oElem);
		if (libName) {
			var themes = testfwk.LIBRARY_THEMES[libName]; // try to get theme information for the current library
			return themes || testfwk.LIBRARY_THEMES["all"]; // return the found config - or "all themes" if nothing was found
		} else {
			return null;
		}
	}

	function triggerLink(oEvent) {
		var oLink = oEvent.target;
		var sRef = oLink.dataset.href;

		//allow all themes for application or custom pages
		var oThemeConstraints;
		if (oLink.parentNode.parentNode.id === "application-pages"
			|| oLink.parentNode.parentNode.id === "custom-tests") {
			oThemeConstraints = testfwk.LIBRARY_THEMES["all"];
		} else {
			oThemeConstraints = getThemesForElement(oLink);
		}

		// trigger testfwk (which is responsible for displaying the page)
		testfwk.setContentURL(sRef, oThemeConstraints, getLibForElement(oLink));

		oEvent.preventDefault();
		return false;
	}

	function mouseDownLink(oEvent) {
		if ( oEvent.target.nodeName === "A" ) {
			// update local link for "copy shortcut"
			var oLink = oEvent.target;
			var oThemeConstraints = getThemesForElement(oLink);
			var sOriginalHref = oLink.dataset.href;
			oLink.href = testfwk.addSettingsToURL(sOriginalHref, oThemeConstraints);
		}
	}

	function keydownUrl(evt) {
		if ( evt.keyCode == 13 ) {
			addSampleUrl();
		}
	}

	function addSampleUrl(oEvent) {
		var oInput = document.getElementById("sampleurl");
		var sUrl = oInput.value;
		var oResult = jQuery.sap.sjax({type : 'HEAD', url : sUrl});
		if ( !oResult.success ) {
			/* eslint-disable no-alert */
			alert(sUrl + " does not exist (" + oResult.error + ")");
			/* eslint-enable no-alert */
			return;
		}

		var oEmptynessHint = document.getElementById("#custom-tests-empty");
		if ( oEmptynessHint ) {
			oEmptynessHint.parentNode.removeChild(oEmptynessHint);
		}

		var oCustomSample = document.createElement("div");
		oCustomSample.className = "leaf";
		var oNewSampleDomRef = document.createElement("a");
		oNewSampleDomRef.href = sUrl;
		oNewSampleDomRef.dataset.href = sUrl;
		oNewSampleDomRef.target = "sap-ui-ContentWindow";
		oNewSampleDomRef.title = sUrl;
		var sText = sUrl;
		if ( sText.length > 40 && sText.lastIndexOf('/') >= 0 ) {
			sText = "..." + sText.slice(sText.lastIndexOf('/'));
		}
		oNewSampleDomRef.textContent = sText;
		oCustomSample.appendChild(oNewSampleDomRef);
		var oCustomTests = document.getElementById("custom-tests");
		oCustomTests.insertBefore(oCustomSample, oCustomTests.firstChild);
		triggerLink(oNewSampleDomRef);
		document.getElementById("samples").scrollTop = document.getElementById("samples").scrollHeight;
	}

	function toggleNode(oEvent) {
		var oNode;
		if ( oEvent.target.nodeName === "A" ) {
			triggerLink(oEvent);
			return;
		}
		if ( oEvent.target.classList.contains("caption") ) {
			oNode = oEvent.target.parentNode;
		} else if ( oEvent.target.parentNode.classList.contains("caption") ) {
			oNode = oEvent.target.parentNode.parentNode;
		}
		if ( oNode ) {
			if (oNode.classList.contains("expanded")) {
				oNode.classList.add("collapsed");
				oNode.classList.remove("expanded");
			} else {
				oNode.classList.add("expanded");
				oNode.classList.remove("collapsed");
			}
		}
		oEvent.stopPropagation();
	}

	function renderLeaf(content, url, name, level) {
		content.push("
");
		content.push("");
		content.push(name);
		content.push("
");
	}

	function renderNodeBegin(content, parentPath, name, level) {
		content.push("
");

		// caption
		content.push("
");
		if ( level == 0 ) {
			content.push("&#xe080");
		}
		content.push("", name, "");
		content.push("");
		content.push("
");

		// children
		content.push("
");
	}

	function renderNodeEnd(content) {
		content.push("
");
		content.push("
");
	}

	function renderTreeRecursion(content, parentPath, nodeName, node, level) {
		if (typeof node.lib === "string") {
			// node is a test
			renderLeaf(content, node.url, nodeName, level);
		} else if (node.entry) {
			// node is an app page;
			// the passed url is relative to <context-path>/test-resources/testsuite/testframe.html
			renderLeaf(content, "../../" + node.entry, nodeName, level);
		} else {
			// node is an inner tree node (no leaf)

			renderNodeBegin(content, parentPath, nodeName, level);

			var newParentPath = (parentPath === "") ? nodeName : parentPath + '/' + nodeName;
			var newLevel = level + 1;
			for (var newNodeName in node) {
				renderTreeRecursion(content, newParentPath, newNodeName, node[newNodeName], newLevel);
			}

			renderNodeEnd(content);
		}
	}

	function renderTree(targetId, tree) {
		var content = [];
		for (var folder in tree) {
			renderTreeRecursion(content, "", folder, tree[folder], 0);
		}
		var target = document.getElementById(targetId);
		target.innerHTML = content.join("");
	}

	function createTreeRecursion(tree, leaf, name) {
		var index = name.indexOf('/');
		if (index == -1) {
			tree[name] = leaf;
		} else {
			var folder = name.substring(0, index);
			var rest = name.substring(index + 1);
			var node = tree[folder];
			if (node == null) {
				tree[folder] = node = {};
			}
			createTreeRecursion(node, leaf, rest);
		}
	}

	function createTestTree(testArray) {
		var tree = {};
		testArray.forEach(function(test) {
			var lib = test.lib;
			var node = tree[lib];
			if (node == null) {
				tree[lib] = node = {};
			}
			createTreeRecursion(node, test, test.name);
		});
		return tree;
	}

	function createAppPagesTree(pagesArray) {
		var tree = {};
		pagesArray.forEach(function(page) {
			var folder = page.entry;
			var index = folder.indexOf('/');
			if (index >= 0) {
				folder = folder.slice(0, index);
			}

			var node = tree[folder];
			if (node) { /* TODO: why this check? (node && folder!=e) */
				tree[folder] = node = {};
			}
			createTreeRecursion(node ? node : tree, page, page.entry);
		});
		return tree;
	}

	function isEmpty(oTree) {
		return !oTree || isEmptyObject(oTree);
	}

	function compare(v1, v2) {
		if ( v1 !== v2 ) {
			return v1 < v2 ? -1 : 1;
		}
		return 0;
	}

	function fetchJSON(sUrl) {
		return Promise.resolve(
			jQuery.ajax({
				url: sUrl,
				dataType : "json"
			})
		);
	}

	var testsFromDiscoveryService;
	var testsFromTestStarterDiscovery;
	var filteredTestsFromTestStarterDiscovery;

	// A) request list of test pages (*.html) from discovery service
	function fetchTestsFromDiscoveryService() {
		fetchJSON("../../discovery/all_tests")
			.then(function(oResult) {
				testsFromDiscoveryService = oResult.all_tests;
				renderAllTests();
			})
			.catch(renderAllTestsError);
	}

	// B) analyze testsuites on client side to identify test starter tests (*.qunit.js)
	// As this is very time consuming, the result is cached in the local storage
	// and only refreshed every 3 days
	// The structure in the local storage is the same as the one written by the 'find.html' app

	var SCHEMA_VERSION = "0.0.3";
	var ENTRY_PAGE = "test-resources/qunit/testsuite.qunit.html";
	var MAX_AGE = 3 * 24 * 60 * 60 * 1000; // 3 days (in milliseconds)
	var store = new Storage(Storage.Type.local, "sap-ui-find-tests");

	function restoreData(maxAge) {
		maxAge = maxAge === undefined ? MAX_AGE : maxAge * 1000;
		var data = store.get("data");
		if ( data && data.entryPage === ENTRY_PAGE && data._$schemaVersion === SCHEMA_VERSION
			 && Date.now() < data.timeOfLastUpdate + maxAge ) {
			testsFromTestStarterDiscovery = data.tests;
			return true;
		}
		return false;
	}

	function saveData() {
		store.put("data", {
			_$schemaVersion: SCHEMA_VERSION,
			entryPage: ENTRY_PAGE,
			timeOfLastUpdate: Date.now(),
			tests: testsFromTestStarterDiscovery,
			testCount: testsFromTestStarterDiscovery.length,
			filteredTestCount: testsFromTestStarterDiscovery.length
		});
	}

	function fetchTestsFromTestStarterDiscovery(forceRefresh) {

		var whenLoaded = Promise.resolve();

		if ( forceRefresh || !restoreData() ) {

			whenLoaded = discovery.findTests(sap.ui.require.toUrl(ENTRY_PAGE)).then(function(aTests) {
				/*
				 * Remove duplicates and sort by fullpage
				 * Note: the semantic of this step must be kept in sync with the test starter's 'find.html' application
				 */
				var uniquePages = new Set();
				testsFromTestStarterDiscovery = aTests.filter(function(oEntry) {
					if ( !uniquePages.has(oEntry.fullpage) ) {
						uniquePages.add(oEntry.fullpage);
						return true;
					}
				}).sort(function(oEntry1, oEntry2) {
					return compare(oEntry1.fullpage, oEntry2.fullpage);
				});

				// save the result in the local storage
				saveData();
			});
		}

		return whenLoaded.then(function() {

			/*
			 * TODO should validate agains ta list of known libs (e.g. from sap-ui-version.json)
			 */
			function findLibPrefix(sPath) {
				return sPath;
			}

			/*
			 * Find those tests that execute a single module.
			 *
			 * Execution in the testsuite app is not limited to such single module tests,
			 * but only for them we can produce a name that matches the user's expectations.
			 */
			filteredTestsFromTestStarterDiscovery = testsFromTestStarterDiscovery.map(function(oTestConfig) {
				if ( typeof oTestConfig.module !== "string" ) {
					return;
				}
				var match = /^test-resources\/(.*)\/qunit\/(.*)$/.exec(oTestConfig.module);
				if ( match ) {
					var libPrefix = findLibPrefix(match[1]);
					var name = oTestConfig.module.slice("test-resources\/".length + libPrefix.length + 1) + ".js";
					return {
						lib: libPrefix.replace(/\//g, "."),
						name: name,
						url: "../.." + oTestConfig.fullpage
					};
				}
			}).filter(Boolean);

			renderAllTests();
		}).catch(renderAllTestsError);

	}

	function renderAllTestsError(oError) {
		document.getElementById("library-tests").innerHTML = "failed to load tests: " + (oError.message ? oError.message : oError) + "";
	}

	function renderAllTests() {

		var tests = [];
		if ( Array.isArray(testsFromDiscoveryService) ) {
			tests = tests.concat(testsFromDiscoveryService);
		}
		if ( Array.isArray(filteredTestsFromTestStarterDiscovery) ) {
			tests = tests.concat(filteredTestsFromTestStarterDiscovery);
		}

		// Sort TestCases by Library and Name, sap.ui.core is always the first library
		tests.sort(function sortByLibAndName(test1, test2) {
			if ( test1.lib == "sap.ui.core" && test2.lib != "sap.ui.core" ) {
				return -1;
			}
			if ( test1.lib != "sap.ui.core" && test2.lib == "sap.ui.core" ) {
				return 1;
			}
			return compare(test1.lib, test2.lib) || compare(test1.name, test2.name);
		});

		// build a tree from the test cases
		var tree = createTestTree(tests);

		// render it
		if ( isEmpty(tree) ) {
			document.getElementById("library-tests").innerHTML = "none";
		} else {
			renderTree("library-tests", tree);
		}

	}

	function discoverAppPages() {
		return fetchJSON("../../discovery/app_pages")
			.then(function(oResult) {
				renderAppPages(oResult.app_pages);
			}).catch(renderAppPagesError);
	}

	function renderAppPages(aPages) {
		// Sort App Pages by name/URL
		aPages.sort(function sortByEntry(page1, page2) {
			return compare(page1.entry, page2.entry);
		});

		// create a tree from it
		var tree = createAppPagesTree(aPages);

		// render the tree
		if ( isEmpty(tree) ) {
			document.getElementById("application-pages").innerHTML = "none";
		} else {
			renderTree("application-pages", tree);
		}
	}

	function renderAppPagesError(oError) {
		document.getElementById("application-pages").innerHTML = "failed to load application pages: " + (oError.message ? oError.message : oError) + "";
	}

	/**
	 * Converts a simple string (search term) into a RegExp that behaves like Eclipse class search:
	 * - camel case words are matched by any search term consisting of prefixes of each word in the same order as in the word
	 *   e.g.
	 *      CB   matches: CheckBox, ComboBox
	 *      CoB  only matches ComboBox
	 * - additionally, each term is added "as is" (case insensitive) so
	 *      cb   also matches   MacBook
	 *
	 * @param {string} term Term to convert
	 * @returns {RegExp} Regular Expression created from term
	 * @private
	 */
	function makeRegExp(term) {

		var l = term.length,
			s1 = '',
			s2 = '',
			i,c;

		for ( i = 0; i < l; i++ ) {
			c = term[i];
			if ( c >= 'A' && c <= 'Z' && i > 0 ) {
				s1 += "[a-z]*";
			}
			s1 += escapeRegExp(c);
			if ( c.toUpperCase() !== c.toLowerCase() ) {
				s2 += '[' + escapeRegExp(c.toUpperCase() + c.toLowerCase()) + ']';
			} else {
				s2 += escapeRegExp(c);
			}
		}

		// Log.debug("converted '" + term + "' to /" + s1 + '|' + s2 + "/");

		return new RegExp(s1 + '|' + s2);
	}

	var oTimerId;

	function setSampleFilter(oEvent) {
		if ( oTimerId ) {
			clearTimeout(oTimerId);
			oTimerId = undefined;
		}
		var oInputField = oEvent.target;
		var fnFilter;
		if ( oInputField.value ) {
			var rRegExp = makeRegExp(oInputField.value);
			fnFilter = function(sText) {
				return sText && rRegExp.test(sText);
			};
		}
		oTimerId = setTimeout(function() {
			applyFilter(fnFilter);
		}, 200);
	}

	function makeNodeVisible(oDomNode, bVisible) {
		oDomNode.style.display = bVisible ? '' : 'none';
		var oChildren = oDomNode.nextElementSibling;
		if ( oChildren ) {
			oChildren.style.display = bVisible ? '' : 'none';
		}
	}

	function clearFilter() {
		document.getElementById("filter").value = '';
		applyFilter(undefined);
	}

	function applyFilter(fnFilter) {
		var oDomNode = document.getElementById("library-tests-node");
		if ( !oDomNode ) {
			return false;
		}
		_applyFilter(fnFilter, oDomNode);
	}

	function _applyFilter(fnFilter, oDomNode) {

		var oChildren = oDomNode.querySelector(".children");
		if ( !oChildren ) {
			return false;
		}

		var iMatches = 0;
		var oChild = oChildren.firstElementChild;
		while ( oChild ) {
			if ( oChild.classList.contains("node") ) {
				iMatches = iMatches + _applyFilter(fnFilter, oChild);
			} else if ( oChild.classList.contains("leaf") ) {
				var bMatches = !fnFilter || fnFilter(oChild.innerText || oChild.innerHTML);
				oChild.style.display = bMatches ? '' : 'none';
				if ( bMatches ) {
					iMatches++;
				}
			}
			oChild = oChild.nextElementSibling;
		}

		var oMatchesText = oDomNode.querySelector(".matches");
		if ( oMatchesText ) {
			oMatchesText.textContent = (fnFilter && iMatches > 0) ? "(" + iMatches + ")" : "";
		}

		makeNodeVisible(oDomNode, oDomNode.classList.contains("section") || iMatches > 0);

		return iMatches;
	}

	showBusyIndicators();
	document.getElementById("clearFilter").addEventListener("click", function(oEvent) {
		oEvent.preventDefault();
		clearFilter();
	});
	document.getElementById("refreshTests").addEventListener("click", refreshSamples);
	document.getElementById("filter").addEventListener("keyup", setSampleFilter);
	document.getElementById("samples").addEventListener("click", toggleNode);
	document.getElementById("samples").addEventListener("mousedown", mouseDownLink);
	document.getElementById("sampleurl").addEventListener("keydown", keydownUrl);
	document.getElementById("add-sampleurl").addEventListener("click", addSampleUrl);
});


text: CKEDITOR.plugins.setLang("codesnippet","ku",{button:"تیتکی کۆد دابنێ",codeContents:"Code content",emptySnippetError:"A code snippet cannot be empty.",language:"Language",title:"Code snippet"});


text:
package org.apache.tuscany.sdo.test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

import org.apache.tuscany.sdo.api.SDOUtil;

import commonj.sdo.DataObject;
import commonj.sdo.Property;
import commonj.sdo.Sequence;
import commonj.sdo.Type;
import commonj.sdo.helper.DataFactory;
import commonj.sdo.helper.HelperContext;
import commonj.sdo.helper.TypeHelper;
import commonj.sdo.helper.XMLDocument;
import commonj.sdo.helper.XMLHelper;
import commonj.sdo.helper.XSDHelper;

public class DefineTypeTestCase extends TestCase
{
  private static final String CUSTOMER1_XML = "/customer1.xml";
  private static final String CUSTOMER2_XML = "/customer2.xml";
  private static final String OPEN_XML = "/open2.xml";
  private static final String MIXED_XML = "/mixed2.xml";
  private static final String MIXEDOPEN_XML = "/mixedopen.xml";

  HelperContext hc;

  protected void setUp() throws Exception {
    super.setUp();
    hc = SDOUtil.createHelperContext();
  }

  public void testDefineTypeRoundTrip() throws Exception {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type intType = types.getType("commonj.sdo", "Int");
    Type stringType = types.getType("commonj.sdo", "String");

    Property xmlElementProp = hc.getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);

    // create a new Type for Customers
    DataObject customerType = factory.create("commonj.sdo",
    "Type");
    customerType.set("uri", "http://example.com/customer");
    customerType.set("name", "Customer");

    // create a customer number property as an XSD attribute
    DataObject custNumProperty = customerType.createDataObject("property");
    custNumProperty.set("name", "custNum");
    custNumProperty.set("type", intType);
    custNumProperty.setBoolean(xmlElementProp, false);

    // create a first name property as an XSD attribute
    DataObject firstNameProperty =
    customerType.createDataObject("property");
    firstNameProperty.set("name", "firstName");
    firstNameProperty.set("type", stringType);
    firstNameProperty.setBoolean(xmlElementProp, false);

    // create a last name property as an XSD attribute
    DataObject lastNameProperty = customerType.createDataObject("property");
    lastNameProperty.set("name", "lastName");
    lastNameProperty.set("type", stringType);
    lastNameProperty.setBoolean(xmlElementProp, false);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(customerType, "commonj.sdo", "type", baos);

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    XMLDocument xdoc = xmlHelper.load(bais);

    customerType = xdoc.getRootObject();

    // now define the Customer type so that customers can be made
    types.define(customerType);

    DataObject customer1 = factory.create("http://example.com/customer",
    "Customer");

    customer1.setInt("custNum", 1);
    customer1.set("firstName", "John");
    customer1.set("lastName", "Adams");
    DataObject customer2 = factory.create("http://example.com/customer",
    "Customer");
    customer2.setInt("custNum", 2);
    customer2.set("firstName", "Jeremy");
    customer2.set("lastName", "Pavick");

    assertNotNull(customer1);
    Type type = customer1.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    assertNotNull(customer2);
    type = customer2.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));

    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
          new ByteArrayInputStream(baos.toByteArray()),
          getClass().getResource(CUSTOMER2_XML)));
  }

  public void testDefineType() throws Exception
  {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type intType = types.getType("commonj.sdo", "Int");
    Type stringType = types.getType("commonj.sdo", "String");

    Property xmlElementProp = hc.getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);

    // create a new Type for Customers
    DataObject customerType = factory.create("commonj.sdo",
    "Type");
    customerType.set("uri", "http://example.com/customer");
    customerType.set("name", "Customer");

    // create a customer number property
    DataObject custNumProperty = customerType.createDataObject("property");
    custNumProperty.set("name", "custNum");
    custNumProperty.set("type", intType);
    custNumProperty.setBoolean(xmlElementProp, false);

    // create a first name property
    DataObject firstNameProperty =
    customerType.createDataObject("property");
    firstNameProperty.set("name", "firstName");
    firstNameProperty.set("type", stringType);
    firstNameProperty.setBoolean(xmlElementProp, false);

    // create a last name property
    DataObject lastNameProperty = customerType.createDataObject("property");
    lastNameProperty.set("name", "lastName");
    lastNameProperty.set("type", stringType);
    lastNameProperty.setBoolean(xmlElementProp, false);

    // now define the Customer type so that customers can be made
    types.define(customerType);

    DataObject customer1 = factory.create("http://example.com/customer",
    "Customer");

    customer1.setInt("custNum", 0);
    assertTrue(customer1.isSet("custNum"));

    customer1.setInt("custNum", 1);
    customer1.set("firstName", "John");
    customer1.set("lastName", "Adams");
    DataObject customer2 = factory.create("http://example.com/customer",
    "Customer");
    customer2.setInt("custNum", 2);
    customer2.set("firstName", "Jeremy");
    customer2.set("lastName", "Pavick");

    assertNotNull(customer1);
    Type type = customer1.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    assertNotNull(customer2);
    assertNotNull(types.getOpenContentProperty("http://example.com/customer", "customer"));

    type = customer2.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));

    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
          new ByteArrayInputStream(baos.toByteArray()),
          getClass().getResource(CUSTOMER2_XML)));
  }

  public void testDefineDataType() throws Exception
  {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();
    XSDHelper xsdHelper = hc.getXSDHelper();

    Property xmlElementProp = hc.getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);
    Property javaClassProperty = xsdHelper.getGlobalProperty("commonj.sdo/java", "javaClass", false);

    // create a data types
    DataObject intType = factory.create("commonj.sdo", "Type");
    intType.set("uri", "http://example.com/customer");
    intType.set("name", "MyIntType");
    intType.setBoolean("dataType", true);
    intType.set(javaClassProperty, "int");

    DataObject stringType = factory.create("commonj.sdo", "Type");
    stringType.set("uri", "http://example.com/customer");
    stringType.set("name", "MyStringType");
    stringType.setBoolean("dataType", true);
    stringType.set(javaClassProperty, "java.lang.String");

    // create a new Type for Customers
    DataObject customerType = factory.create("commonj.sdo",
    "Type");
    customerType.set("uri", "http://example.com/customer");
    customerType.set("name", "Customer");

    // create a customer number property
    DataObject custNumProperty = customerType.createDataObject("property");
    custNumProperty.set("name", "custNum");
    custNumProperty.set("type", intType);
    custNumProperty.setBoolean(xmlElementProp, false);

    // create a first name property
    DataObject firstNameProperty =
    customerType.createDataObject("property");
    firstNameProperty.set("name", "firstName");
    firstNameProperty.set("type", stringType);
    firstNameProperty.setBoolean(xmlElementProp, false);

    // create a last name property
    DataObject lastNameProperty = customerType.createDataObject("property");
    lastNameProperty.set("name", "lastName");
    lastNameProperty.set("type", stringType);
    lastNameProperty.setBoolean(xmlElementProp, false);

    // now define the Customer type so that customers can be made
    types.define(customerType);

    DataObject customer1 = factory.create("http://example.com/customer",
    "Customer");

    customer1.setInt("custNum", 1);
    customer1.set("firstName", "John");
    customer1.set("lastName", "Adams");
    DataObject customer2 = factory.create("http://example.com/customer",
    "Customer");
    customer2.setInt("custNum", 2);
    customer2.set("firstName", "Jeremy");
    customer2.set("lastName", "Pavick");

    assertNotNull(customer1);
    Type type = customer1.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));

    type = type.getProperty("custNum").getType();
    assertEquals(type.getURI(), "http://example.com/customer");
    assertEquals(type.getName(), "MyIntType");
    assertTrue(type.isDataType());

    assertNotNull(customer2);
    assertNotNull(types.getOpenContentProperty("http://example.com/customer", "customer"));

    type = customer2.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));

    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
          new ByteArrayInputStream(baos.toByteArray()),
          getClass().getResource(CUSTOMER2_XML)));
  }

  public void testFastDefineType() throws Exception
  {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type intType = types.getType("commonj.sdo", "Int");
    Type stringType = types.getType("commonj.sdo", "String");

    // create a new Type for Customers
    Type customerType = SDOUtil.createType(hc, "http://example.com/customer", "Customer", false);

    // create a customer number property
    Property custNumProperty = SDOUtil.createProperty(customerType, "custNum", intType);
    SDOUtil.setPropertyXMLKind(custNumProperty, false);

    // create a first name property
    Property firstNameProperty = SDOUtil.createProperty(customerType, "firstName", stringType);
    SDOUtil.setPropertyXMLKind(firstNameProperty, false);

    // create a last name property
    Property lastNameProperty = SDOUtil.createProperty(customerType, "lastName", stringType);
    SDOUtil.setPropertyXMLKind(lastNameProperty, false);

    DataObject customer1 = factory.create("http://example.com/customer",
    "Customer");
    customer1.setInt("custNum", 1);
    customer1.set("firstName", "John");
    customer1.set("lastName", "Adams");
    DataObject customer2 = factory.create("http://example.com/customer",
    "Customer");
    customer2.setInt("custNum", 2);
    customer2.set("firstName", "Jeremy");
    customer2.set("lastName", "Pavick");

    assertNotNull(customer1);
    Type type = customer1.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    assertNotNull(customer2);
    type = customer2.getType();
    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));

    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
          new ByteArrayInputStream(baos.toByteArray()),
          getClass().getResource(CUSTOMER2_XML)));
  }

  public void testDefineSequencedType() throws Exception
  {

    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type stringType = types.getType("commonj.sdo", "String");
    Type decimalType = types.getType("commonj.sdo", "Decimal");

    // Define a new mixed type - MixedQuote
    DataObject mixedQuoteType = factory.create("commonj.sdo", "Type");
    mixedQuoteType.set("uri", "http://www.example.com/mixed");
    mixedQuoteType.set("name", "MixedQuote");
    mixedQuoteType.set("sequenced", Boolean.TRUE);

    DataObject symbolProperty = mixedQuoteType.createDataObject("property");
    symbolProperty.set("name", "symbol");
    symbolProperty.set("type", stringType);

    DataObject companyNameProperty = mixedQuoteType.createDataObject("property");
    companyNameProperty.set("name", "companyName");
    companyNameProperty.set("type", stringType);

    DataObject priceProperty = mixedQuoteType.createDataObject("property");
    priceProperty.set("name", "price");
    priceProperty.set("type", decimalType);

    DataObject quotesProperty = mixedQuoteType.createDataObject("property");
    quotesProperty.set("name", "quotes");
    quotesProperty.set("type", mixedQuoteType);
    quotesProperty.set("many", Boolean.TRUE);
    quotesProperty.set("containment", Boolean.TRUE);

    types.define(mixedQuoteType);

    DataObject quote = factory.create("http://www.example.com/mixed", "MixedQuote");

    assertTrue(quote.getType().isSequenced());

    Sequence sequence = quote.getSequence();

    sequence.addText("\n  ");

    quote.setString("symbol", "fbnt");

    sequence.addText("\n  ");

    quote.setString("companyName", "FlyByNightTechnology");

    sequence.addText("\n  some text\n  ");

    DataObject child = quote.createDataObject("quotes");
    child.setBigDecimal("price", new BigDecimal("2000.0"));

    sequence.addText("\n  more text\n  ");

    // quote.setBigDecimal("price", new BigDecimal("1000.0"));
    sequence.add("price", new BigDecimal("1000.0"));

    sequence.addText("\n");

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(quote, "http://www.example.com/mixed", "mixedStockQuote", baos);
    assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXED_XML)));
  }

  public void testDefineSequencedOpenType() throws Exception
  {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type stringType = types.getType("commonj.sdo", "String");
    Type decimalType = types.getType("commonj.sdo", "Decimal");

    // Define a new mixed type - MixedQuote
    DataObject mixedQuoteType = factory.create("commonj.sdo", "Type");
    mixedQuoteType.set("uri", "http://www.example.com/mixed");
    mixedQuoteType.set("name", "MixedOpenQuote");
    mixedQuoteType.set("sequenced", Boolean.TRUE);
    mixedQuoteType.set("open", Boolean.TRUE);

//    DataObject symbolProperty = mixedQuoteType.createDataObject("property");
//    symbolProperty.set("name", "symbol");
//    symbolProperty.set("type", stringType);

    DataObject companyNameProperty = mixedQuoteType.createDataObject("property");
    companyNameProperty.set("name", "companyName");
    companyNameProperty.set("type", stringType);

    DataObject priceProperty = mixedQuoteType.createDataObject("property");
    priceProperty.set("name", "price");
    priceProperty.set("type", decimalType);

    DataObject quotesProperty = mixedQuoteType.createDataObject("property");
    quotesProperty.set("name", "quotes");
    quotesProperty.set("type", mixedQuoteType);
    quotesProperty.set("many", Boolean.TRUE);
    quotesProperty.set("containment", Boolean.TRUE);

    types.define(mixedQuoteType);

    // Define a global type
    DataObject globalType = factory.create("commonj.sdo", "Type");
    globalType.set("uri", "http://www.example.com/open");
    // Don't set the type's name - null is used for types containing global properties.

    DataObject symbolProperty = globalType.createDataObject("property");
    symbolProperty.set("name", "symbol");
    symbolProperty.set("type", stringType);
    symbolProperty.set("containment", Boolean.TRUE);

    types.define(globalType);

    DataObject quote = factory.create("http://www.example.com/mixed", "MixedOpenQuote");

    assertTrue(quote.getType().isSequenced());

    Sequence sequence = quote.getSequence();

    sequence.addText("\n  ");

    Type definedGlobalType = types.getType("http://www.example.com/open", "DocumentRoot");

    Property definedSymbolProperty = definedGlobalType.getProperty("symbol");
    quote.setString(definedSymbolProperty, "fbnt");

    sequence.addText("\n  ");

    quote.setString("companyName", "FlyByNightTechnology");

    sequence.addText("\n  some text\n  ");

    DataObject child = quote.createDataObject("quotes");
    child.setBigDecimal("price", new BigDecimal("2000.0"));

    sequence.addText("\n  more text\n  ");

    // quote.setBigDecimal("price", new BigDecimal("1000.0"));
    sequence.add("price", new BigDecimal("1000.0"));

    sequence.addText("\n");

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(quote, "http://www.example.com/mixed", "mixedOpenStockQuote", baos);
    assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXEDOPEN_XML)));
  }

  public void testDefineOpenType() throws Exception
  {
    TypeHelper types = hc.getTypeHelper();
    DataFactory factory = hc.getDataFactory();
    XMLHelper xmlHelper = hc.getXMLHelper();

    Type stringType = types.getType("commonj.sdo", "String");
    Type decimalType = types.getType("commonj.sdo", "Decimal");

    Property xmlElementProp = hc.getXSDHelper().getGlobalProperty("commonj.sdo/xml", "xmlElement", false);

    // Define a new open type - OpenQuote
    DataObject openQuoteType = factory.create("commonj.sdo", "Type");
    openQuoteType.set("uri", "http://www.example.com/open");
    openQuoteType.set("name", "OpenQuote");
    openQuoteType.set("open", Boolean.TRUE);
    openQuoteType.setBoolean("open", true);

    types.define(openQuoteType);

    // Define new type - CompanyType
    DataObject companyType = factory.create("commonj.sdo", "Type");
    companyType.set("uri", "http://www.example.com/open");
    companyType.set("name", "CompanyType");

    // Create CompanyType property - "name" as an XSD attribute
    DataObject nameProperty = companyType.createDataObject("property");
    nameProperty.set("name", "name");
    nameProperty.set("type", stringType);
    nameProperty.set("containment", Boolean.TRUE);
    nameProperty.setBoolean(xmlElementProp, false);

    types.define(companyType);

    // Define open content property - company
    DataObject symbolProperty = factory.create("commonj.sdo", "Property");
    symbolProperty.set("name", "symbol");
    symbolProperty.set("type", stringType);
    types.defineOpenContentProperty("http://www.example.com/open", symbolProperty);

    // Define open content property - company
    DataObject companyProperty = factory.create("commonj.sdo", "Property");
    companyProperty.set("name", "company");
    companyProperty.set("type", companyType);
    companyProperty.set("containment", Boolean.TRUE);
    types.defineOpenContentProperty("http://www.example.com/open", companyProperty);

    // Define open content property - price
    DataObject priceProperty = factory.create("commonj.sdo", "Property");
    priceProperty.set("name", "price");
    priceProperty.set("type", decimalType);
    types.defineOpenContentProperty("http://www.example.com/open", priceProperty);

    // Create DataObject instances
    DataObject openQuote = factory.create("http://www.example.com/open", "OpenQuote");
    assertTrue(openQuote.getType().isOpen());

    Property definedSymbolProperty = types.getOpenContentProperty("http://www.example.com/open", "symbol");
    openQuote.set(definedSymbolProperty, "s1");

    Property definedCompanyProperty = types.getOpenContentProperty("http://www.example.com/open", "company");
    DataObject company = openQuote.createDataObject(definedCompanyProperty);
    company.setString("name", "FlyByNightTechnology");

    Property definedPriceProperty = types.getOpenContentProperty("http://www.example.com/open", "price");
    openQuote.setBigDecimal(definedPriceProperty, new BigDecimal("1000.0"));

    assertEquals(definedPriceProperty.getType(), decimalType);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      openQuote,
      "http://www.example.com/open",
      "openStockQuote", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(OPEN_XML)));
  }

/**
 * Type T1 has property t1p of type T2, type T2 has property t2p of type T1.
 * Ensure that the typehelper can handle this circularity
 */
public void testInterdependentTypes()
  {
	    DataObject t1 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
	    DataObject t1p = DataFactory.INSTANCE.create("commonj.sdo", "Property");
	    DataObject t2 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
	    DataObject t2p = DataFactory.INSTANCE.create("commonj.sdo", "Property");

	    t1.set("name", "T1");
	    t1.set("uri", "foo");
	    t2.set("name", "T2");
	    t2.set("uri", "foo");

	    t1.getList("property").add(t1p);
	    t2.getList("property").add(t2p);
	    t1p.set("name", "t1p");
	    t1p.set("type", t2);
	    t2p.set("name", "t2p");
	    t2p.set("type", t1);

	    List ts = new ArrayList();
	    ts.add(t1);
	    ts.add(t2);
	    List types = hc.getTypeHelper().define(ts);

	    Type first = (Type)types.get(0);
	    Type second = (Type)types.get(1);

	    Type firstsPropsType = ((Property)first.getProperties().get(0)).getType();
	    Type secondPropsType = ((Property)second.getProperties().get(0)).getType();

	    assertNotNull(first);
	    assertNotNull(second);
	    assertEquals(first, secondPropsType);
	    assertEquals(second, firstsPropsType);

  }

}


text:
/*! @abstract CBStory forward class declaration. */
@class CBStory;

/*!
 @typedef NS_ENUM(NSUInteger, CBNewsfeedAnimationType)

 @abstract
 Use to control how the CBNewsfeedUI should animate its display or dismiss animation.
 */
typedef NS_ENUM(NSUInteger, CBNewsfeedAnimationType) {
    /*! Slide up from screen bottom. */
    CBNewsfeedAnimationTypeSlideFromBottom,
    /*! Slide down from screen top. */
    CBNewsfeedAnimationTypeSlideFromTop,
    /*! Slide out from screen left. */
    CBNewsfeedAnimationTypeSlideFromLeft,
    /*! Slide out from screen right. */
    CBNewsfeedAnimationTypeSlideFromRight,
    /*! No animation, just appear. */
    CBNewsfeedAnimationTypeNone
};

/*!
 @typedef NS_ENUM(NSUInteger, CBNewsfeedUIPosition)

 @abstract
 Use to control where the CBNewsfeedUI should position itself on the screen.
 */
typedef NS_ENUM(NSUInteger, CBNewsfeedUIPosition) {
    /*! Horizonatal and vertical center. */
    CBNewsfeedUIPositionCenter,
    /*! Anchor to top of screen. */
    CBNewsfeedUIPositionTop,
    /*! Anchor to bottom of screen. */
    CBNewsfeedUIPositionBottom,
    /*! Anchor to left of screen. */
    CBNewsfeedUIPositionLeft,
    /*! Anchor to right of screen. */
    CBNewsfeedUIPositionRight
};

/*!
 @typedef NS_ENUM(NSUInteger, CBNotificationUIClickAction)

 @abstract
 Use to control how the Notification UI should respond when tapped.
 */
typedef NS_ENUM(NSUInteger, CBNotificationUIClickAction) {
    /*! Display the Newsfeed UI. */
    CBNotificationUIClickActionDisplayNewsfeedUI,
    /*! Perform link action. */
    CBNotificationUIClickActionPerformLink,
    /*! No action; just dismiss UI. */
    CBNotificationUIClickActionNone
};

/*!
 @protocol CBNewsfeedUIProtocol

 @abstract
 Provide an interface for implementing a custom Newsfeed UI to use with the Chartboost SDK.
 Implement this protocol in a class and assign it with [CBNewsfeed setUIClass:(Class)uiClass] to
 override the default Newsfeed UI.

 @discussion For more information on integrating and using the Chartboost SDK
 please visit our help site documentation at https://help.chartboost.com

 All of the delegate methods are required.
 */
@protocol CBNewsfeedUIProtocol

@required

/*!
 @abstract
 Display the Newsfeed UI.

 @discussion Implement your custom logic to display the Newsfeed UI.
 */
+ (void)displayNewsfeed;

/*!
 @abstract
 Dismiss the Newsfeed UI.

 @discussion Implement your custom logic to dismiss the Newsfeed UI.
 */
+ (void)dismissNewsfeed;

/*!
 @abstract
 Check if the Newsfeed UI is visible.

 @return YES if the UI is visible, NO otherwise.

 @discussion Implement your custom logic to check if the Newsfeed UI is visible.
 */
+ (BOOL)isNewsfeedUIVisible;

/*!
 @abstract
 Display the Notification UI.

 @discussion Implement your custom logic to display the Notification UI.
 */
+ (void)displayNotification;

/*!
 @abstract
 Display the Notification UI for a specific CBStory.

 @param story The CBStory to display.

 @discussion Implement your custom logic to display the Notification UI.
 */
+ (void)displayNotification:(CBStory *)story;

/*!
 @abstract
 Dismiss the Notification UI.

 @discussion Implement your custom logic to dismiss the Notification UI.
 */
+ (void)dismissNotification;

/*!
 @abstract
 Check if the Notification UI is visible.

 @return YES if the UI is visible, NO otherwise.

 @discussion Implement your custom logic to check if the Notification UI is visible.
 */
+ (BOOL)isNotificationUIVisible;

@end

/*!
 @class CBNewsfeedUI

 @abstract
 Default Newsfeed UI provided by the Chartboost SDK.

 Implements the CBNewsfeedUIProtocol.

 @discussion For more information on integrating and using the Chartboost SDK
 please visit our help site documentation at https://help.chartboost.com
 */
@interface CBNewsfeedUI : NSObject

/*!
 @abstract
 Get CGSize for Default NewsfeedUI.

 @return The CGSize of the parent frame for the default Newsfeed UI.

 @discussion You can use this to help size a custom header.
 */
+ (CGSize)getNewsfeedUISize;

#pragma mark - Setters

/*!
 @abstract
 Set anchor point for Newsfeed UI in portrait mode.

 @param position CBNewsfeedUIPosition

 @discussion Valid values located above in this file.

 Default is CBNewsfeedUIPositionBottom.
 */
+ (void)setNewsfeedUIPortraitPosition:(CBNewsfeedUIPosition)position;

/*!
 @abstract
 Set anchor point for Newsfeed UI in landscape mode.

 @param position CBNewsfeedUIPosition

 @discussion Valid values located above in this file.

 Default is CBNewsfeedUIPositionLeft.
 */
+ (void)setNewsfeedUILandscapePosition:(CBNewsfeedUIPosition)position;

/*!
 @abstract
 Set display animation for Newsfeed UI in portrait mode.

 @param animation CBNewsfeedAnimationType

 @discussion Valid values located above in this file.

 Default is CBNewsfeedAnimationTypeSlideFromBottom.
 */
+ (void)setPortraitDisplayAnimation:(CBNewsfeedAnimationType)animation;

/*!
 @abstract
 Set dismiss animation for Newsfeed UI in portrait mode.

 @param animation CBNewsfeedAnimationType

 @discussion Valid values located above in this file.

 Default is CBNewsfeedAnimationTypeSlideFromBottom.
 */
+ (void)setPortraitDismissAnimation:(CBNewsfeedAnimationType)animation;

/*!
 @abstract
 Set display animation for Newsfeed UI in lanscape mode.

 @param animation CBNewsfeedAnimationType

 @discussion Valid values located above in this file.

 Default is CBNewsfeedAnimationTypeSlideFromLeft.
 */
+ (void)setLandscapeDisplayAnimation:(CBNewsfeedAnimationType)animation;

/*!
 @abstract
 Set dismiss animation for Newsfeed UI in landscape mode.

 @param animation CBNewsfeedAnimationType

 @discussion Valid values located above in this file.

 Default is CBNewsfeedAnimationTypeSlideFromLeft.
 */
+ (void)setLandscapeDismissAnimation:(CBNewsfeedAnimationType)animation;

/*!
 @abstract
 Controls what the Notification UI should attempt to do on click.

 @param action CBNotificationUIClickAction

 @discussion Valid values located above in this file.

 Default is CBNotificationUIClickActionDisplayNewsfeedUI.
 */
+ (void)setNotificationUIClickAction:(CBNotificationUIClickAction)action;

/*!
 @abstract
 Set Newsfeed UI background color.

 @param color UIColor

 @discussion Set Newsfeed UI background color.
 */
+ (void)setNewsfeedBackgroundColor:(UIColor *)color;

/*!
 @abstract
 Set Newsfeed UI message cell background color.

 @param color UIColor

 @discussion Set Newsfeed UI message cell background color.
 */
+ (void)setNewsfeedMessageCellBackgroundColor:(UIColor *)color;

/*!
 @abstract
 Set Newsfeed UI header cell background color.

 @param color UIColor

 @discussion Set Newsfeed UI header cell background color.
 */
+ (void)setNewsfeedHeaderCellBackgroundColor:(UIColor *)color;

/*!
 @abstract
 Set Newsfeed UI message cell text color.

 @param color UIColor

 @discussion Set Newsfeed UI message cell text color.
 */
+ (void)setNewsfeedMessageCellTextColor:(UIColor *)color;

/*!
 @abstract
 Set Newsfeed UI header cell background color.

 @param color UIColor

 @discussion Set Newsfeed UI header cell background color.
 */
+ (void)setNewsfeedHeaderCellTextColor:(UIColor *)color;

/*!
 @abstract
 Set Newsfeed UI header cell text.

 @param text NSString

 @discussion Set Newsfeed UI header cell text.
 */
+ (void)setNewsfeedHeaderCellText:(NSString *)text;

/*!
 @abstract
 Set Notification UI text color.

 @param color UIColor

 @discussion Set Notification UI text color.
 */
+ (void)setNotificationTextColor:(UIColor *)color;

/*!
 @abstract
 Set Notification UI background color.

 @param color UIColor

 @discussion Set Notification UI background color.
 */
+ (void)setNotificationBackgroundColor:(UIColor *)color;

/*!
 @abstract
 Set Notification UI text font.

 @param font UIFont

 @discussion Set Notification UI text font.
 */
+ (void)setNotificationTextFont:(UIFont *)font;

/*!
 @abstract
 Set a custom header UIView for the Newsfeed UI.

 @param view UIView

 @discussion Set a custom header UIView for the Newsfeed UI.
 */
+ (void)setCustomNewsfeedHeaderView:(UIView *)view;

#pragma mark - Getters

/*!
 @abstract
 Get Newsfeed UI background color.

 @return UIColor

 @discussion Get Newsfeed UI background color.
 */
+ (UIColor *)getNewsfeedBackgroundColor;

/*!
 @abstract
 Get Newsfeed UI message cell background color.

 @return UIColor

 @discussion Get Newsfeed UI message cell background color.
 */
+ (UIColor *)getNewsfeedMessageCellBackgroundColor;

/*!
 @abstract
 Get Newsfeed UI header cell background color.

 @return UIColor

 @discussion Get Newsfeed UI header cell background color.
 */
+ (UIColor *)getNewsfeedHeaderCellBackgroundColor;

/*!
 @abstract
 Get Newsfeed UI message cell text color.

 @return UIColor

 @discussion Get Newsfeed UI message cell text color.
 */
+ (UIColor *)getNewsfeedMessageCellTextColor;

/*!
 @abstract
 Get Newsfeed UI header cell text color.

 @return UIColor

 @discussion Get Newsfeed UI header cell text color.
 */
+ (UIColor *)getNewsfeedHeaderCellTextColor;

/*!
 @abstract
 Get Newsfeed UI header cell text.

 @return NSString

 @discussion Get Newsfeed UI header cell text.
 */
+ (NSString *)getNewsfeedHeaderCellText;

/*!
 @abstract
 Get Notification UI text color.

 @return UIColor

 @discussion Get Notification UI text color.
 */
+ (UIColor *)getNotificationTextColor;

/*!
 @abstract
 Get Notification UI background color.

 @return UIColor

 @discussion Get Notification UI background color.
 */
+ (UIColor *)getNotificationBackgroundColor;

/*!
 @abstract
 Get Notification UI text font.

 @return UIFont

 @discussion Get Notification UI text font.
 */
+ (UIFont *)getNotificationTextFont;

/*!
 @abstract
 Get a custom header UIView for the Newsfeed UI.

 @return UIView

 @discussion Get a custom header UIView for the Newsfeed UI.
 */
+ (UIView *)getCustomNewsfeedHeaderView;

/*!
 @abstract
 Get the orientation of the CBNewsfeedUI.

 @return UIInterfaceOrientation

 @discussion Get the orientation of the CBNewsfeedUI.
 */
+ (UIInterfaceOrientation)getOrientation;

@end


text:
layout: page
title: Blevins Research Dinner
date: 2016-05-24
author: Jeffrey Holden
tags: weekly links, java
status: published
summary: Mauris non tortor ex. Proin semper quam ex, vitae.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 01/30/2016
  endDate: 01/31/2016
  ctyhocn: GBGPAHX
  groupCode: BRD
published: true
---
Duis sed feugiat orci, pharetra ornare ipsum. Aliquam eget consectetur nunc. In consectetur semper ligula, vitae bibendum tortor ultricies vel. Maecenas pretium, lectus gravida mattis mattis, turpis erat mattis massa, a dictum mi justo a lectus. Morbi hendrerit interdum est ut rutrum. Proin in nunc est. Vivamus maximus magna dui, vel ultricies nunc pulvinar et. Praesent non dui eget risus condimentum egestas. Nullam cursus euismod metus non ullamcorper. Proin consectetur laoreet dolor, et consequat purus scelerisque et. Phasellus tempor leo id convallis placerat. Donec vel nunc sapien. Nam vulputate, mi quis bibendum convallis, lacus tellus feugiat magna, in mollis nulla elit nec orci.

* Pellentesque hendrerit orci vel felis lobortis feugiat
* Morbi id lorem at ex blandit feugiat
* Suspendisse in augue at sem facilisis finibus ac vel nisl
* Etiam euismod nisi vitae libero congue molestie
* Vestibulum tincidunt nisl et eros pretium rhoncus.

Ut faucibus dignissim elit, quis pulvinar turpis posuere quis. Curabitur ultrices ligula mattis lectus convallis luctus. Quisque blandit sapien nisi, non accumsan ex eleifend ut. Nullam nulla mi, bibendum ac tortor eu, faucibus finibus erat. Nunc aliquam tellus eu dolor maximus placerat. Cras interdum sollicitudin ex eget mattis. Sed sed tortor nulla. Praesent dignissim pretium pretium.
Mauris efficitur commodo auctor. Aliquam erat volutpat. Maecenas nisi enim, sagittis quis nisi dignissim, viverra vulputate nulla. Ut ut dolor at metus laoreet auctor ut id eros. Praesent tincidunt, sapien vel posuere laoreet, tellus lectus fermentum leo, et mollis ante mi et quam. Donec fermentum erat metus. Vivamus semper massa vel bibendum varius. Quisque non mi rhoncus, venenatis tellus vel, imperdiet velit. Nullam ac convallis ex. Pellentesque cursus lectus tincidunt, egestas nibh eu, fermentum eros. Sed in congue lorem. Vestibulum at malesuada felis, ut mattis orci.


text:
<?php

declare (strict_types=1);
namespace Ssch\TYPO3Rector\Rector\v8\v5;

use PhpParser\Node;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrayItem;
use PhpParser\Node\Stmt\Return_;
use Rector\Core\Rector\AbstractRector;
use Ssch\TYPO3Rector\Helper\TcaHelperTrait;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
 * @changelog https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.5/Deprecation-78524-TCAOptionVersioning_followPagesRemoved.html
 * @see \Ssch\TYPO3Rector\Tests\Rector\v8\v5\RemoveOptionVersioningFollowPagesRector\RemoveOptionVersioningFollowPagesRectorTest
 */
final class RemoveOptionVersioningFollowPagesRector extends \Rector\Core\Rector\AbstractRector
{
    use TcaHelperTrait;
    /**
     * @codeCoverageIgnore
     */
    public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
    {
        return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('TCA option versioning_followPages removed', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
return [
    'ctrl' => [
        'versioningWS' => 2,
        'versioning_followPages' => TRUE,
    ],
    'columns' => [
    ]
];
CODE_SAMPLE
, <<<'CODE_SAMPLE'
return [
    'ctrl' => [
        'versioningWS' => true,
    ],
    'columns' => [
    ]
];
CODE_SAMPLE
)]);
    }
    /**
     * @return array<class-string<Node>>
     */
    public function getNodeTypes() : array
    {
        return [\PhpParser\Node\Stmt\Return_::class];
    }
    /**
     * @param Return_ $node
     */
    public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
    {
        if (!$this->isFullTca($node)) {
            return null;
        }
        $ctrl = $this->extractCtrl($node);
        if (!$ctrl instanceof \PhpParser\Node\Expr\ArrayItem) {
            return null;
        }
        $ctrlItems = $ctrl->value;
        if (!$ctrlItems instanceof \PhpParser\Node\Expr\Array_) {
            return null;
        }
        $hasAstBeenChanged = \false;
        foreach ($ctrlItems->items as $fieldValue) {
            if (!$fieldValue instanceof \PhpParser\Node\Expr\ArrayItem) {
                continue;
            }
            if (null === $fieldValue->key) {
                continue;
            }
            if ($this->valueResolver->isValue($fieldValue->key, 'versioning_followPages')) {
                $this->removeNode($fieldValue);
                $hasAstBeenChanged = \true;
            } elseif ($this->valueResolver->isValue($fieldValue->key, 'versioningWS')) {
                $versioningWS = $this->valueResolver->getValue($fieldValue->value);
                if (!\is_bool($versioningWS)) {
                    $fieldValue->value = (bool) $versioningWS ? $this->nodeFactory->createTrue() : $this->nodeFactory->createFalse();
                    $hasAstBeenChanged = \true;
                }
            }
        }
        return $hasAstBeenChanged ? $node : null;
    }
}


text:
module Palaver

  class BaseForm < Palaver::Base
    def initialize(dialogcmd, options)
      super(options)
      @dialogcmd = dialogcmd
      @entries = []
      @form_height = nil
      @simple_display_width = nil
      @simple_text_length = nil
    end

    def show
      text_width = @entries.map { |e| e.text_width }.max
      @entries.each { |e| e.update_value_x text_width }

      cmd_intro = "dialog #@common_options --#@dialogcmd '#@text' #@height #@width #@form_height "
      cmd_entries = @entries.map { |e| e.to_cmd_s }.join(' ')

      result = nil
      with_tempfile do |tfpath|
        cmd = "#{cmd_intro} #{cmd_entries} 2> #{tfpath}"
        success = system cmd
        result = read_dialog_output tfpath
      end

      return result
    end

    private

    class Entry
      attr_reader :field_id, :text

      def initialize(id, text, text_y, text_x, default_value, value_y, value_x, field_length, input_length)
        @field_id = id
        @text = text
        @text_y = text_y
        @text_x = text_x
        @default_value = default_value
        @value_y = value_y
        @value_x = value_x
        @field_length = field_length
        @input_length = input_length
      end

      def text_width
        @text.length + 2
      end

      def update_value_x(min)
        @value_x = [ @value_x ? @value_x : 0, min ].max
      end

      def to_cmd_s
        "'#@text' #@text_y #@text_x '#@default_value' #@value_y #@value_x #@field_length #@input_length"
      end
    end

    def read_dialog_output(fname)
      lines = File.read(fname).split("\n")
      result = {}
      lines.each_with_index { |l,i| result[@entries[i].field_id] = l }
      return result
    end

    def form_height(val)
      @form_height = val
    end

    def entry(id, title, text_y, text_x, default_value, value_y, value_x, field_length, input_length)
      newentry = Entry.new(id, title, text_y, text_x, default_value, value_y, value_x, field_length, input_length)
      @entries.push newentry
    end

    def simple_display_width(width)
      @simple_display_width = width
    end

    def simple_text_length(length)
      @simple_text_length = length
    end

    def simple_entry(id, title, default_value)
      @simple_next_y = 1 if not @simple_next_y
      newentry = Entry.new(id, title, @simple_next_y, 0, default_value, @simple_next_y, nil, @simple_display_width, @simple_text_length)
      @entries.push newentry
      @simple_next_y = @simple_next_y + 1
    end

  end

end


text:
package dao

import (
	"fmt"
	"time"

	"github.com/astaxie/beego/orm"
	"github.com/vmware/harbor/src/common/models"
)

// AddRepository adds a repo to the database.
func AddRepository(repo models.RepoRecord) error {
	o := GetOrmer()
	sql := "insert into repository (owner_id, project_id, name, description, pull_count, star_count, creation_time, update_time) " +
		"select (select user_id as owner_id from user where username=?), " +
		"(select project_id as project_id from project where name=?), ?, ?, ?, ?, ?, NULL "

	_, err := o.Raw(sql, repo.OwnerName, repo.ProjectName, repo.Name, repo.Description,
		repo.PullCount, repo.StarCount, time.Now()).Exec()
	return err
}

// GetRepositoryByName ...
func GetRepositoryByName(name string) (*models.RepoRecord, error) {
	o := GetOrmer()
	r := models.RepoRecord{Name: name}
	err := o.Read(&r, "Name")
	if err == orm.ErrNoRows {
		return nil, nil
	}
	return &r, err
}

// GetAllRepositories ...
func GetAllRepositories() ([]models.RepoRecord, error) {
	o := GetOrmer()
	var repos []models.RepoRecord
	_, err := o.QueryTable("repository").All(&repos)
	return repos, err
}

// DeleteRepository ...
func DeleteRepository(name string) error {
	o := GetOrmer()
	_, err := o.QueryTable("repository").Filter("name", name).Delete()
	return err
}

// UpdateRepository ...
func UpdateRepository(repo models.RepoRecord) error {
	o := GetOrmer()
	repo.UpdateTime = time.Now()
	_, err := o.Update(&repo)
	return err
}

// IncreasePullCount ...
func IncreasePullCount(name string) (err error) {
	o := GetOrmer()
	num, err := o.QueryTable("repository").Filter("name", name).Update(
		orm.Params{
			"pull_count":  orm.ColValue(orm.ColAdd, 1),
			"update_time": time.Now(),
		})
	if num == 0 {
		err = fmt.Errorf("Failed to increase repository pull count with name: %s %s", name, err.Error())
	}
	return err
}

//RepositoryExists returns whether the repository exists according to its name.
func RepositoryExists(name string) bool {
	o := GetOrmer()
	return o.QueryTable("repository").Filter("name", name).Exist()
}

// GetRepositoryByProjectName ...
func GetRepositoryByProjectName(name string) ([]*models.RepoRecord, error) {
	sql := `select * from repository
		where project_id = (
			select project_id from project
			where name = ?
		)`
	repos := []*models.RepoRecord{}
	_, err := GetOrmer().Raw(sql, name).QueryRows(&repos)
	return repos, err
}

//GetTopRepos returns the most popular repositories
func GetTopRepos(count int) ([]models.TopRepo, error) {
	topRepos := []models.TopRepo{}

	repositories := []*models.RepoRecord{}
	if _, err := GetOrmer().QueryTable(&models.RepoRecord{}).
		OrderBy("-PullCount", "Name").Limit(count).All(&repositories); err != nil {
		return topRepos, err
	}

	for _, repository := range repositories {
		topRepos = append(topRepos, models.TopRepo{
			RepoName:    repository.Name,
			AccessCount: repository.PullCount,
		})
	}

	return topRepos, nil
}

// GetTotalOfRepositories ...
func GetTotalOfRepositories(name string) (int64, error) {
	qs := GetOrmer().QueryTable(&models.RepoRecord{})
	if len(name) != 0 {
		qs = qs.Filter("Name__contains", name)
	}
	return qs.Count()
}

// GetTotalOfPublicRepositories ...
func GetTotalOfPublicRepositories(name string) (int64, error) {
	params := []interface{}{}
	sql := `select count(*) from repository r
		join project p
		on r.project_id = p.project_id and p.public = 1 `
	if len(name) != 0 {
		sql += ` where r.name like ?`
		params = append(params, "%"+escape(name)+"%")
	}

	var total int64
	err := GetOrmer().Raw(sql, params).QueryRow(&total)
	return total, err
}

// GetTotalOfUserRelevantRepositories ...
func GetTotalOfUserRelevantRepositories(userID int, name string) (int64, error) {
	params := []interface{}{}
	sql := `select count(*)
		from repository r
		join (
			select p.project_id, p.public
				from project p
				join project_member pm
				on p.project_id = pm.project_id
				where pm.user_id = ?
		) as pp
		on r.project_id = pp.project_id `
	params = append(params, userID)
	if len(name) != 0 {
		sql += ` where r.name like ?`
		params = append(params, "%"+escape(name)+"%")
	}

	var total int64
	err := GetOrmer().Raw(sql, params).QueryRow(&total)
	return total, err
}


text:
from alembic import op
import sqlalchemy as sa

"""virtual_machine

Revision ID: 37f924a78337
Revises: bea3ba88c73
Create Date: 2015-06-24 17:26:36.552058
"""

# revision identifiers, used by Alembic.
revision = '37f924a78337'
down_revision = 'bea3ba88c73'

def upgrade():
    op.create_table('virtual_machines',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('name', sa.String(), nullable=True),
                    sa.Column('ip', sa.String(), nullable=True),
                    sa.Column('mac', sa.String(), nullable=True),
                    sa.Column('platform', sa.String(), nullable=True),
                    sa.Column('ready', sa.Boolean(), nullable=True),
                    sa.Column('checking', sa.Boolean(), nullable=True),
                    sa.Column('deleted', sa.Boolean, nullable=True),
                    sa.Column('created', sa.Float, nullable=True),
                    sa.PrimaryKeyConstraint('id'))

    op.add_column('sessions', sa.Column('vm_id', sa.Integer(), nullable=True))

def downgrade():
    op.drop_column('sessions', 'vm_id')
    op.drop_table('virtual_machines')


text:
![](http://linuxgizmos.com/files/google_aiyvisionkit-thm.jpg)
Google's $45 "AIY Vision Kit" for the Raspberry Pi Zero W performs TensorFlow-based vision recognition using a "VisionBonnet" board with a Movidius chip.

Google's AIY Vision Kit for on-device neural network acceleration follows an earlier [AIY Projects][7] voice/AI kit for the Raspberry Pi that shipped to MagPi subscribers back in May. Like the voice kit and the older Google Cardboard VR viewer, the new AIY Vision Kit has a cardboard enclosure. The kit differs from the [Cloud Vision API][8], which was demo'd in 2015 with a Raspberry Pi based GoPiGo robot, in that it runs entirely on local processing power rather than requiring a cloud connection. The AIY Vision Kit is available now for pre-order at $45, with shipments due in early December.

 [![](http://linuxgizmos.com/files/google_aiyvisionkit-sm.jpg)][9]   [![](http://linuxgizmos.com/files/rpi_zerow-sm.jpg)][10]
**AIY Vision Kit, fully assembled (left) and Raspberry Pi Zero W**
(click images to enlarge)

The kit's key processing element, aside from the 1GHz ARM11-based Broadcom BCM2836 SoC found on the required [Raspberry Pi Zero W][21] SBC, is Google's new VisionBonnet RPi accessory board. The VisionBonnet pHAT board uses a Movidius MA2450, a version of the [Movidius Myriad 2 VPU][22] processor. On the VisionBonnet, the processor runs Google's open source [TensorFlow][23]machine intelligence library for neural networking. The chip enables visual perception processing at up to 30 frames per second.

The AIY Vision Kit requires a user-supplied RPi Zero W, a [Raspberry Pi Camera v2][11], and a 16GB micro SD card for downloading the Linux-based image. The kit includes the VisionBonnet, an RGB arcade-style button, a piezo speaker, a macro/wide lens kit, and the cardboard enclosure. You also get flex cables, standoffs, a tripod mounting nut, and connecting components.

 [![](http://linuxgizmos.com/files/google_aiyvisionkit_pieces-sm.jpg)][12]   [![](http://linuxgizmos.com/files/google_visionbonnet-sm.jpg)][13]
**AIY Vision Kit kit components (left) and VisonBonnet accessory board**
(click images to enlarge)

Three neural network models are available. There's a general-purpose model that can recognize 1,000 common objects, a facial detection model that can also score facial expression on a "joy scale" that ranges from "sad" to "laughing," and a model that can identify whether the image contains a dog, cat, or human. The 1,000-image model derives from Google's open source [MobileNets][24], a family of TensorFlow based computer vision models designed for the restricted resources of a mobile or embedded device.

MobileNet models offer low latency and low power consumption, and are parameterized to meet the resource constraints of different use cases. The models can be built for classification, detection, embeddings, and segmentation, says Google. Earlier this month, Google released a developer preview of a mobile-friendly [TensorFlow Lite][14] library for Android and iOS that is compatible with MobileNets and the Android Neural Networks API.

 [![](http://linuxgizmos.com/files/google_aiyvisionkit_assembly-sm.jpg)][15]
**AIY Vision Kit assembly views**
(click image to enlarge)

In addition to providing the three models, the AIY Vision Kit provides basic TensorFlow code and a compiler, so users can develop their own models. In addition, Python developers can write new software to customize RGB button colors, piezo element sounds, and 4x GPIO pins on the VisionBonnet that can add additional lights, buttons, or servos. Potential models include recognizing food items, opening a dog door based on visual input, sending a text when your car leaves the driveway, or playing particular music based on facial recognition of a person entering the camera's viewpoint.

 [![](http://linuxgizmos.com/files/movidius_myriad2vpu_block-sm.jpg)][16]   [![](http://linuxgizmos.com/files/movidius_myriad2_reference_board-sm.jpg)][17]
**Myriad 2 VPU block diagram (left) and reference board**
(click image to enlarge)

The Movidius Myriad 2 processor provides TeraFLOPS of performance within a nominal 1 Watt power envelope. The chip appeared on early Project Tango reference platforms, and is built into the Ubuntu-driven [Fathom][25] neural processing USB stick that Movidius debuted in May 2016, prior to being acquired by Intel. According to Movidius, the Myriad 2 is available "in millions of devices on the market today."

**Further information**

The AIY Vision Kit is available for pre-order from Micro Center at $44.99, with shipments due in early December. More information may be found in the AIY Vision Kit [announcement][18], [Google Blog notice][19], and [Micro Center shopping page][20].

--------------------------------------------------------------------------------

via: http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/

作者:[ Eric Brown][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]:http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/
[1]:http://twitter.com/share?url=http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/&text=Google%20launches%20TensorFlow-based%20vision%20recognition%20kit%20for%20RPi%20Zero%20W%20
[2]:https://plus.google.com/share?url=http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/
[3]:http://www.facebook.com/sharer.php?u=http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/
[4]:http://www.linkedin.com/shareArticle?mini=true&url=http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/
[5]:http://reddit.com/submit?url=http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/&title=Google%20launches%20TensorFlow-based%20vision%20recognition%20kit%20for%20RPi%20Zero%20W
[6]:mailto:?subject=Google%20launches%20TensorFlow-based%20vision%20recognition%20kit%20for%20RPi%20Zero%20W&body=%20http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/
[7]:http://linuxgizmos.com/free-raspberry-pi-voice-kit-taps-google-assistant-sdk/
[8]:http://linuxgizmos.com/google-releases-cloud-vision-api-with-demo-for-pi-based-robot/
[9]:http://linuxgizmos.com/files/google_aiyvisionkit.jpg
[10]:http://linuxgizmos.com/files/rpi_zerow.jpg
[11]:http://linuxgizmos.com/raspberry-pi-cameras-jump-to-8mp-keep-25-dollar-price/
[12]:http://linuxgizmos.com/files/google_aiyvisionkit_pieces.jpg
[13]:http://linuxgizmos.com/files/google_visionbonnet.jpg
[14]:https://developers.googleblog.com/2017/11/announcing-tensorflow-lite.html
[15]:http://linuxgizmos.com/files/google_aiyvisionkit_assembly.jpg
[16]:http://linuxgizmos.com/files/movidius_myriad2vpu_block.jpg
[17]:http://linuxgizmos.com/files/movidius_myriad2_reference_board.jpg
[18]:https://blog.google/topics/machine-learning/introducing-aiy-vision-kit-make-devices-see/
[19]:https://developers.googleblog.com/2017/11/introducing-aiy-vision-kit-add-computer.html
[20]:http://www.microcenter.com/site/content/Google_AIY.aspx?ekw=aiy&rd=1
[21]:http://linuxgizmos.com/raspberry-pi-zero-w-adds-wifi-and-bluetooth-for-only-5-more/
[22]:https://www.movidius.com/solutions/vision-processing-unit
[23]:https://www.tensorflow.org/
[24]:https://research.googleblog.com/2017/06/mobilenets-open-source-models-for.html
[25]:http://linuxgizmos.com/usb-stick-brings-neural-computing-functions-to-devices/
[26]:http://linuxgizmos.com/google-launches-tensorflow-based-vision-recognition-kit-for-rpi-zero-w/


text:
typedef boost::asio::windows::stream_handle pipe_end;
#elif defined(BOOST_POSIX_API)
#   include <sys/wait.h>
#   include <unistd.h>
typedef boost::asio::posix::stream_descriptor pipe_end;
#endif

namespace fs = boost::filesystem;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( bind_stderr );

BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(2))
{
    using boost::unit_test::framework::master_test_suite;

    bp::ipstream is;

    std::error_code ec;
    bp::child c(
        master_test_suite().argv[1],
        bp::args={"test", "--echo-stderr", "hello"},
        bp::std_err>is,
        ec
    );
    BOOST_REQUIRE(!ec);

    std::string s;
    is >> s;
    BOOST_CHECK_EQUAL(s, "hello");
}

struct read_handler
{
    boost::asio::streambuf &buffer_;

    read_handler(boost::asio::streambuf &buffer) : buffer_(buffer) {}

    void operator()(const boost::system::error_code &ec, std::size_t size)
    {
        BOOST_REQUIRE(!ec);
        std::istream is(&buffer_);
        std::string line;
        std::getline(is, line);
        BOOST_CHECK(boost::algorithm::starts_with(line, "abc"));
    }
};

BOOST_AUTO_TEST_CASE(async_io, *boost::unit_test::timeout(2))
{
    using boost::unit_test::framework::master_test_suite;
    boost::asio::io_context io_context;

    bp::async_pipe p(io_context);
    std::error_code ec;
    bp::child c(
            bp::exe=master_test_suite().argv[1],
            bp::args+="test",
            bp::args+={"--echo-stderr", "abc"},
            bp::std_err>p,
            ec
        );
    BOOST_REQUIRE(!ec);

    boost::asio::streambuf buffer;
    boost::asio::async_read_until(p, buffer, '\n', read_handler(buffer));

    io_context.run();
}

BOOST_AUTO_TEST_CASE(nul, *boost::unit_test::timeout(2))
{
    using boost::unit_test::framework::master_test_suite;
    std::error_code ec;
    bp::child c(
        bp::exe(master_test_suite().argv[1]),
        bp::args+={"test", "--is-nul-stderr"},
        bp::std_err>bp::null,
        ec
    );
    BOOST_REQUIRE(!ec);

    c.wait();
    int exit_code = c.exit_code();
#if defined(BOOST_WINDOWS_API)
    BOOST_CHECK_EQUAL(EXIT_SUCCESS, exit_code);
#elif defined(BOOST_POSIX_API)
    BOOST_CHECK_EQUAL(EXIT_SUCCESS, exit_code);
#endif
}

BOOST_AUTO_TEST_CASE(file_io, *boost::unit_test::timeout(2))
{
    using boost::unit_test::framework::master_test_suite;

    fs::path pth =
            fs::path(master_test_suite().argv[1]).parent_path() / "std_err_log_file.txt";

    std::error_code ec;
    bp::child c(
        master_test_suite().argv[1],
        bp::args={"test", "--echo-stderr", "hello"},
        bp::std_err>pth,
        ec
    );
    BOOST_REQUIRE(!ec);

    c.wait();
    {
        fs::ifstream is{pth};

        std::string s;
        is >> s;
        BOOST_CHECK_EQUAL(s, "hello");
    }
    boost::filesystem::remove(pth);

}

BOOST_AUTO_TEST_SUITE_END();


text:
package cn.bishiti.base.service.Impl;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Set;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import cn.bishiti.base.service.RedisService;

@Service
public class RedisServiceImpl implements RedisService{

	 private static String redisCode = "utf-8";

	 @Resource
     private RedisTemplate<Serializable, Serializable> redisTemplate;

	    /**
	     * @param key
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public long del(final String... keys) {
	        return (Long) redisTemplate.execute(new RedisCallback() {
	            public Long doInRedis(RedisConnection connection) throws DataAccessException {
	                long result = 0;
	                for (int i = 0; i < keys.length; i++) {
	                    result = connection.del(keys[i].getBytes());
	                }
	                return result;
	            }
	        });
	    }

	    /**
	     * @param key
	     * @param value
	     * @param liveTime
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public void set(final byte[] key, final byte[] value, final long liveTime) {
	        redisTemplate.execute(new RedisCallback() {
	            public Long doInRedis(RedisConnection connection) throws DataAccessException {
	                connection.set(key, value);
	                if (liveTime > 0) {
	                    connection.expire(key, liveTime);
	                }
	                return 1L;
	            }
	        });
	    }

	    /**
	     * @param key
	     * @param value
	     * @param liveTime
	     */
	    public void set(String key, String value, long liveTime) {
	        this.set(key.getBytes(), value.getBytes(), liveTime);
	    }

	    /**
	     * @param key
	     * @param value
	     */
	    public void set(String key, String value) {
	        this.set(key, value, 0L);
	    }

	    /**
	     * @param key
	     * @param value
	     */
	    public void set(byte[] key, byte[] value) {
	        this.set(key, value, 0L);
	    }

	    /**
	     * @param key
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public String get(final String key) {
	        return (String) redisTemplate.execute(new RedisCallback() {
	            public String doInRedis(RedisConnection connection) throws DataAccessException {
	                try {
	                    return new String(connection.get(key.getBytes()), redisCode);
	                } catch (UnsupportedEncodingException e) {
	                    e.printStackTrace();
	                }
	                return "";
	            }
	        });
	    }

	    /**
	     * @param pattern
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public Set<byte[]> Setkeys(String pattern) {
	        return (Set) redisTemplate.keys(pattern);

	    }

	    /**
	     * @param key
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public boolean exists(final String key) {
	        return (Boolean) redisTemplate.execute(new RedisCallback() {
	            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
	                return connection.exists(key.getBytes());
	            }
	        });
	    }

	    /**
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public String flushDB() {
	        return (String) redisTemplate.execute(new RedisCallback() {
	            public String doInRedis(RedisConnection connection) throws DataAccessException {
	                connection.flushDb();
	                return "ok";
	            }
	        });
	    }

	    /**
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public long dbSize() {
	        return (Long) redisTemplate.execute(new RedisCallback() {
	            public Long doInRedis(RedisConnection connection) throws DataAccessException {
	                return connection.dbSize();
	            }
	        });
	    }

	    /**
	     * @return
	     */
	    @SuppressWarnings({ "unchecked", "rawtypes" })
		public String ping() {
	        return (String) redisTemplate.execute(new RedisCallback() {
	            public String doInRedis(RedisConnection connection) throws DataAccessException {

	                return connection.ping();
	            }
	        });
	    }

	    private RedisServiceImpl() {

	    }
}