text:
'use strict';

exports.__esModule = true;
exports['default'] = windowToggle;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var _Subscriber4 = require('../Subscriber');

var _Subscriber5 = _interopRequireDefault(_Subscriber4);

var _Subject = require('../Subject');

var _Subject2 = _interopRequireDefault(_Subject);

var _Subscription = require('../Subscription');

var _Subscription2 = _interopRequireDefault(_Subscription);

var _utilTryCatch = require('../util/tryCatch');

var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch);

var _utilErrorObject = require('../util/errorObject');

function windowToggle(openings, closingSelector) {
    return this.lift(new WindowToggleOperator(openings, closingSelector));
}

var WindowToggleOperator = (function () {
    function WindowToggleOperator(openings, closingSelector) {
        _classCallCheck(this, WindowToggleOperator);

        this.openings = openings;
        this.closingSelector = closingSelector;
    }

    WindowToggleOperator.prototype.call = function call(subscriber) {
        return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector);
    };

    return WindowToggleOperator;
})();

var WindowToggleSubscriber = (function (_Subscriber) {
    _inherits(WindowToggleSubscriber, _Subscriber);

    function WindowToggleSubscriber(destination, openings, closingSelector) {
        _classCallCheck(this, WindowToggleSubscriber);

        _Subscriber.call(this, destination);
        this.openings = openings;
        this.closingSelector = closingSelector;
        this.contexts = [];
        this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this)));
    }

    WindowToggleSubscriber.prototype._next = function _next(value) {
        var contexts = this.contexts;
        var len = contexts.length;
        for (var i = 0; i < len; i++) {
            contexts[i].window.next(value);
        }
    };

    WindowToggleSubscriber.prototype._error = function _error(err) {
        var contexts = this.contexts;
        while (contexts.length > 0) {
            contexts.shift().window.error(err);
        }
        this.destination.error(err);
    };

    WindowToggleSubscriber.prototype._complete = function _complete() {
        var contexts = this.contexts;
        while (contexts.length > 0) {
            var context = contexts.shift();
            context.window.complete();
            context.subscription.unsubscribe();
        }
        this.destination.complete();
    };

    WindowToggleSubscriber.prototype.openWindow = function openWindow(value) {
        var closingSelector = this.closingSelector;
        var closingNotifier = _utilTryCatch2['default'](closingSelector)(value);
        if (closingNotifier === _utilErrorObject.errorObject) {
            this.error(closingNotifier.e);
        } else {
            var context = {
                window: new _Subject2['default'](),
                subscription: new _Subscription2['default']()
            };
            this.contexts.push(context);
            this.destination.next(context.window);
            var subscriber = new WindowClosingNotifierSubscriber(this, context);
            var subscription = closingNotifier._subscribe(subscriber);
            this.add(context.subscription.add(subscription));
        }
    };

    WindowToggleSubscriber.prototype.closeWindow = function closeWindow(context) {
        var window = context.window;
        var subscription = context.subscription;

        var contexts = this.contexts;
        contexts.splice(contexts.indexOf(context), 1);
        window.complete();
        this.remove(subscription);
        subscription.unsubscribe();
    };

    return WindowToggleSubscriber;
})(_Subscriber5['default']);

var WindowClosingNotifierSubscriber = (function (_Subscriber2) {
    _inherits(WindowClosingNotifierSubscriber, _Subscriber2);

    function WindowClosingNotifierSubscriber(parent, windowContext) {
        _classCallCheck(this, WindowClosingNotifierSubscriber);

        _Subscriber2.call(this, null);
        this.parent = parent;
        this.windowContext = windowContext;
    }

    WindowClosingNotifierSubscriber.prototype._next = function _next() {
        this.parent.closeWindow(this.windowContext);
    };

    WindowClosingNotifierSubscriber.prototype._error = function _error(err) {
        this.parent.error(err);
    };

    WindowClosingNotifierSubscriber.prototype._complete = function _complete() {
        this.parent.closeWindow(this.windowContext);
    };

    return WindowClosingNotifierSubscriber;
})(_Subscriber5['default']);

var WindowToggleOpeningsSubscriber = (function (_Subscriber3) {
    _inherits(WindowToggleOpeningsSubscriber, _Subscriber3);

    function WindowToggleOpeningsSubscriber(parent) {
        _classCallCheck(this, WindowToggleOpeningsSubscriber);

        _Subscriber3.call(this);
        this.parent = parent;
    }

    //# sourceMappingURL=windowToggle.js.map

    WindowToggleOpeningsSubscriber.prototype._next = function _next(value) {
        this.parent.openWindow(value);
    };

    WindowToggleOpeningsSubscriber.prototype._error = function _error(err) {
        this.parent.error(err);
    };

    WindowToggleOpeningsSubscriber.prototype._complete = function _complete() {
        // noop
    };

    return WindowToggleOpeningsSubscriber;
})(_Subscriber5['default']);

module.exports = exports['default'];
//# sourceMappingURL=windowToggle.js.map


text:
$(document).ready(function(){
	$("#submit_login").on('click', function(e){
		e.preventDefault();
		handleLogin();
	});
});

function handleLogin(){
	var formInfo = $('#login_form').serialize();
	if (validateForm('login_form')){
		$.post(
			$("#url").val()+"scripts/login.script.php",
			formInfo,
			function(data){
				if (data.success == 1){
					window.location.href = $("#url").val()+"home";
				}
				else {
					alert(data.message);
				}
			},
			"json"
		);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package configuration;

import static java.nio.file.LinkOption.NOFOLLOW_LINKS;
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.OVERFLOW;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.WatchEvent;
import java.nio.file.WatchEvent.Kind;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import com.thoughtworks.xstream.XStream;

/**
 *
 * @author Nathan Jarvis
 */
public class ServletMonitor implements Runnable {

	public interface IInitialParseCompleteListener {
		public void pluginsParsed();
	}

	private List<IPluginAddedListener> addedListeners;
	private List<IPluginRemovedListener> removedListeners;
	private static String extensionToUse = ".jar";
	private static final String CONFIG_FILE_NAME = "plugin.xml";

	private IInitialParseCompleteListener parseCompleteListener;

	private ArrayList<PluginData> plugins;

	public ServletMonitor(IInitialParseCompleteListener completeListener) {
		addedListeners = new ArrayList<IPluginAddedListener>();
		removedListeners = new ArrayList<IPluginRemovedListener>();
		plugins = new ArrayList<PluginData>();
		parseCompleteListener = completeListener;
	}

	public ArrayList<PluginData> getPlugins() {
		return plugins;
	}

	public void findExistingFiles(Path folder) {
		File dir = new File(folder.toString());
		File[] directoryListing = dir.listFiles();
		if (directoryListing != null) {
			for (File child : directoryListing) {
				// Do something with child
				if (child.toString().contains(extensionToUse)) {
					System.out.println(child);
					// Call to register the plugin
					this.readPluginConfig(child.toPath());
					// PluginManager.sharedInstance.registerPlugin(child.toPath());

				}
			}
		} else {
			// Handle the case where dir is not really a directory.
			// Checking dir.isDirectory() above would not be sufficient
			// to avoid race conditions with another process that deletes
			// directories.
		}

		if (parseCompleteListener != null) {
			parseCompleteListener.pluginsParsed();
		}
	}

	public void watchDirectoryPath(Path path) {
		// Sanity check - Check if path is a folder
		try {
			Boolean isFolder = (Boolean) Files.getAttribute(path,
					"basic:isDirectory", NOFOLLOW_LINKS);
			if (!isFolder) {
				throw new IllegalArgumentException("Path: " + path
						+ " is not a folder");
			}
		} catch (IOException ioe) {
			// Folder does not exists
			ioe.printStackTrace();
		}

		System.out.println("Watching path: " + path);

		// We obtain the file system of the Path
		FileSystem fs = path.getFileSystem();

		// We create the new WatchService using the new try() block
		try (WatchService service = fs.newWatchService()) {

			// We register the path to the service
			// We watch for creation events
			path.register(service, ENTRY_CREATE);

			// Start the infinite polling loop
			WatchKey key = null;
			while (true) {
				key = service.take();

				// Dequeueing events
				Kind<?> kind = null;
				for (WatchEvent<?> watchEvent : key.pollEvents()) {
					// Get the type of the event
					kind = watchEvent.kind();
					if (OVERFLOW == kind) {
						continue; // loop
					} else if (ENTRY_CREATE == kind) {
						// A new Path was created
						@SuppressWarnings("unchecked")
						Path newPath = ((WatchEvent<Path>) watchEvent)
								.context();
						// Output
						if (newPath.toString().contains(extensionToUse)) {
							System.out.println("New path created: " + newPath);
							// Read in config and notify listeners
							this.readPluginConfig(newPath);
						}
					}
				}

				if (!key.reset()) {
					break; // loop
				}
			}

		} catch (IOException ioe) {
			ioe.printStackTrace();
		} catch (InterruptedException ie) {
			ie.printStackTrace();
		}

	}

	public void readPluginConfig(Path newPath) {
		String filesystem = newPath.toAbsolutePath().getParent().toString();
		String filename = newPath.getFileName().toString();
		String path = "";
		// idk if right, but we need it right now
		if (filesystem.endsWith("plugins")) {
			path = filesystem + File.separator + filename;
		} else {
			path = filesystem + File.separator + "plugins" + File.separator
					+ filename;
		}

		JarFile pluginJar = null;
		try {
			pluginJar = new JarFile(path);
			Enumeration<JarEntry> entries = pluginJar.entries();

			JarEntry entry = null;
			while (entries.hasMoreElements()) {
				entry = entries.nextElement();

				String name = entry.getName();
				if (name.equals(CONFIG_FILE_NAME)) {
					try {
						InputStream inStream = pluginJar.getInputStream(entry);
						// Read in xml and register plugin.
						XStream streamer = new XStream();

						streamer.alias("plugin", PluginData.class);
						streamer.alias("servlets", List.class);
						streamer.alias("servlet", ServletData.class);
						streamer.alias("expectedMethods", List.class);

						Object result = streamer.fromXML(inStream);

						PluginData plugin = (PluginData) result;
						plugin.setJarPath(path.toString());

						this.plugins.add(plugin);

						// Notify all of the registered listeners about the
						// plugins
						for (int i = 0; i < addedListeners.size(); i++) {
							addedListeners.get(i).addPlugin(plugin);
						}

						inStream.close();
					} catch (IOException e) {
						throw new IllegalArgumentException(
								"Failed to read the config file.", e);
					}
				}
			}

		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} finally {
			try {
				if (pluginJar != null)
					pluginJar.close();
			} catch (IOException e) {
				// we tried
			}
		}
	}

	public void registerAddedListener(IPluginAddedListener listener) {
		this.addedListeners.add(listener);
	}

	public void unregisterAddedListener(IPluginAddedListener listener) {
		this.addedListeners.remove(listener);
	}

	public void registerRemovedListener(IPluginRemovedListener listener) {
		this.removedListeners.add(listener);
	}

	public void unregisterRemovedListener(IPluginRemovedListener listener) {
		this.removedListeners.remove(listener);
	}

	public void run() {
		// Folder to check for plugins
		Path folder = Paths.get("plugins");

		this.findExistingFiles(folder);
		this.watchDirectoryPath(folder);
	}
}


text:
package com.flipkart.connekt.commons.tests.services

import java.util.UUID

import com.fasterxml.jackson.databind.node.ObjectNode
import com.flipkart.connekt.commons.entities.Channel
import com.flipkart.connekt.commons.factories.ServiceFactory
import com.flipkart.connekt.commons.iomodels._
import com.flipkart.connekt.commons.tests.CommonsBaseTest
import com.flipkart.connekt.commons.utils.StringUtils._
import org.apache.commons.lang.StringUtils

class CallbackServiceTest extends CommonsBaseTest {
  val channel: String = "push"
  var mid = ""
  var callBackEvent = PNCallbackEvent(
    mid,
    clientId = StringUtils.EMPTY,
    deviceId = UUID.randomUUID().toString,
    eventType = UUID.randomUUID().toString,
    platform = UUID.randomUUID().toString,
    appName = UUID.randomUUID().toString,
    contextId = UUID.randomUUID().toString,
    cargo = UUID.randomUUID().toString,
    timestamp = 3245567
  )
  val data = "{        \"message\": \"Hello World\",        \"title\": \"Hello world\",        \"id\": \"pqwx2p2x321122228w2t1wxt\",        \"triggerSound\" : true,        \"notificationType\" : \"Text\"}"

  var pnInfo = ConnektRequest(
    mid,
    contextId = None,
    clientId = StringUtils.EMPTY,
    channel = "push",
    sla = "H",
    stencilId = Some(UUID.randomUUID().toString),
    scheduleTs = Some(System.currentTimeMillis()),
    expiryTs = Some(System.currentTimeMillis()),
    channelInfo = PNRequestInfo(platform = callBackEvent.platform,
      appName = callBackEvent.appName,
      deviceIds = Set[String](callBackEvent.deviceId),
      ackRequired = true,
      priority = Priority.NORMAL),
    channelData = PNRequestData(data = data.getObj[ObjectNode]),
    meta = Map()
  )

  "Callback Service" should "persist Callback Event" in {
    mid = ServiceFactory.getMessageService(Channel.PUSH).saveRequest(pnInfo, "fk-connekt-pn").get
    callBackEvent = callBackEvent.copy(messageId = mid)
    pnInfo = pnInfo.copy(id = mid)

    val callbackService = ServiceFactory.getCallbackService
    callbackService.persistCallbackEvents(Channel.PUSH, List(callBackEvent)).isSuccess shouldEqual true
  }

  "Callback Service" should "fetchCallbackEvent" in {
    val callbackService = ServiceFactory.getCallbackService
    val fetchCallBacks = callbackService.fetchCallbackEvent(callBackEvent.messageId, s"${callBackEvent.appName}${callBackEvent.deviceId}", Channel.PUSH)
    fetchCallBacks.isSuccess shouldEqual true
    fetchCallBacks.get.length shouldEqual 1
  }

  "Callback Service" should "fetch by contact id" in {
    val callbackService = ServiceFactory.getCallbackService
    val result = callbackService.fetchCallbackEventByContactId(s"${callBackEvent.appName}${callBackEvent.deviceId}", Channel.PUSH, System.currentTimeMillis() - 24 * 3600 * 1000, System.currentTimeMillis())
    result.isSuccess shouldEqual true
    result.get.size should be > 0
  }

  "Callback Service" should "fetch by message id" in {
    val callbackService = ServiceFactory.getCallbackService
    val result = callbackService.fetchCallbackEventByMId(callBackEvent.messageId, Channel.PUSH)
    result.isSuccess shouldEqual true
    result.get.size should be > 0
  }

  "Callback Service" should "fetch map by contact id" in {
    val callbackService = ServiceFactory.getCallbackService
    val result = callbackService.fetchEventsMapForContactId(s"${callBackEvent.appName}${callBackEvent.deviceId}", Channel.PUSH, System.currentTimeMillis() - 24 * 3600 * 1000, System.currentTimeMillis())
    result.isSuccess shouldEqual true
    result.get.size should be > 0
  }

  "Callback Servcie " should "delete " in {
    val callBackService = ServiceFactory.getCallbackService
    val events = callBackService.deleteCallBackEvent(mid, s"${callBackEvent.appName}${callBackEvent.deviceId}", Channel.PUSH)
    events.get.size == 1
  }
}


text:
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref

THREADS = 1
VREF = tests/vsynth1/00.pgm
AREF = tests/data/asynth1.sw

FATEW = 34
FATEH = 34

$(AREF): CMP=

ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
	@echo
	@echo "Unfortunately ffserver is broken and therefore its regression"
	@echo "test fails randomly. Treat the results accordingly."
	@echo
	$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf

OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs

$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
	$(M)./$< 'tests/vsynth1/'

$(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
	$(M)./$< $@

tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
	$(M)./$< $@ $(subst -, ,$*)

tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
	$(M)$< $@

tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
	$(M)$< $(SRC_PATH)/tests/reference.pnm $@

tests/data/vsynth_lena.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
	$(M)$< $(SAMPLES)/lena.pnm $@

tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data
	$(M)$< $@ $(FATEW) $(FATEH)

tests/test_copy.ffmeta: TAG = COPY
tests/test_copy.ffmeta: tests/data
	$(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta

tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) tests/test_copy.ffmeta
	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
        -f lavfi -i "aevalsrc=sin(400*PI*2*t):d=0.125[out0]; testsrc=d=0.125[out1]; testsrc=s=100x100:d=0.125[out2]" \
        -f ffmetadata -i $(TARGET_PATH)/tests/test_copy.ffmeta \
        -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
        -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \
        -vcodec rawvideo -acodec pcm_s16le \
        -y $(TARGET_PATH)/$@ 2>/dev/null

tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN

tests/data/filtergraphs/%: TAG = COPY
tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
	$(M)cp $< $@

RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))

# Check sanity of dependencies when running FATE tests.
ifneq (,$(RUNNING_FATE))
CHKCFG  = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
endif

ALLYES  = $(strip $(call XYES, $(1)))
XYES    = $(if $(strip $(1)),                                           \
               $(if $(call CHKCFG,CONFIG_$(firstword $(1))),            \
                    $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
               yes)

ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)

ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
                         $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)

DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)

DEMMUX  = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)

FILTERDEMDEC       = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
FILTERDEMDECMUX    = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)

PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)

include $(SRC_PATH)/tests/fate/acodec.mak
include $(SRC_PATH)/tests/fate/vcodec.mak
include $(SRC_PATH)/tests/fate/avformat.mak
include $(SRC_PATH)/tests/fate/seek.mak

include $(SRC_PATH)/tests/fate/aac.mak
include $(SRC_PATH)/tests/fate/ac3.mak
include $(SRC_PATH)/tests/fate/adpcm.mak
include $(SRC_PATH)/tests/fate/alac.mak
include $(SRC_PATH)/tests/fate/als.mak
include $(SRC_PATH)/tests/fate/amrnb.mak
include $(SRC_PATH)/tests/fate/amrwb.mak
include $(SRC_PATH)/tests/fate/atrac.mak
include $(SRC_PATH)/tests/fate/audio.mak
include $(SRC_PATH)/tests/fate/bmp.mak
include $(SRC_PATH)/tests/fate/cdxl.mak
include $(SRC_PATH)/tests/fate/cover-art.mak
include $(SRC_PATH)/tests/fate/demux.mak
include $(SRC_PATH)/tests/fate/dfa.mak
include $(SRC_PATH)/tests/fate/dpcm.mak
include $(SRC_PATH)/tests/fate/ea.mak
include $(SRC_PATH)/tests/fate/exif.mak
include $(SRC_PATH)/tests/fate/ffmpeg.mak
include $(SRC_PATH)/tests/fate/ffprobe.mak
include $(SRC_PATH)/tests/fate/filter-audio.mak
include $(SRC_PATH)/tests/fate/filter-video.mak
include $(SRC_PATH)/tests/fate/flac.mak
include $(SRC_PATH)/tests/fate/fft.mak
include $(SRC_PATH)/tests/fate/gif.mak
include $(SRC_PATH)/tests/fate/h264.mak
include $(SRC_PATH)/tests/fate/hevc.mak
include $(SRC_PATH)/tests/fate/image.mak
include $(SRC_PATH)/tests/fate/indeo.mak
include $(SRC_PATH)/tests/fate/libavcodec.mak
include $(SRC_PATH)/tests/fate/libavdevice.mak
include $(SRC_PATH)/tests/fate/libavformat.mak
include $(SRC_PATH)/tests/fate/libavresample.mak
include $(SRC_PATH)/tests/fate/libavutil.mak
include $(SRC_PATH)/tests/fate/libswresample.mak
include $(SRC_PATH)/tests/fate/lossless-audio.mak
include $(SRC_PATH)/tests/fate/lossless-video.mak
include $(SRC_PATH)/tests/fate/microsoft.mak
include $(SRC_PATH)/tests/fate/monkeysaudio.mak
include $(SRC_PATH)/tests/fate/mp3.mak
include $(SRC_PATH)/tests/fate/mpc.mak
include $(SRC_PATH)/tests/fate/mpeg4.mak
include $(SRC_PATH)/tests/fate/mxf.mak
include $(SRC_PATH)/tests/fate/opus.mak
include $(SRC_PATH)/tests/fate/pcm.mak
include $(SRC_PATH)/tests/fate/probe.mak
include $(SRC_PATH)/tests/fate/prores.mak
include $(SRC_PATH)/tests/fate/qt.mak
include $(SRC_PATH)/tests/fate/qtrle.mak
include $(SRC_PATH)/tests/fate/real.mak
include $(SRC_PATH)/tests/fate/screen.mak
include $(SRC_PATH)/tests/fate/subtitles.mak
include $(SRC_PATH)/tests/fate/utvideo.mak
include $(SRC_PATH)/tests/fate/video.mak
include $(SRC_PATH)/tests/fate/voice.mak
include $(SRC_PATH)/tests/fate/vorbis.mak
include $(SRC_PATH)/tests/fate/vpx.mak
include $(SRC_PATH)/tests/fate/vqf.mak
include $(SRC_PATH)/tests/fate/wavpack.mak
include $(SRC_PATH)/tests/fate/wma.mak
include $(SRC_PATH)/tests/fate/xvid.mak

FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)

FATE_SAMPLES_AVCONV           += $(FATE_SAMPLES_AVCONV-yes)
FATE_SAMPLES_FFMPEG           += $(FATE_SAMPLES_FFMPEG-yes)
FATE_EXTERN-$(CONFIG_FFMPEG)  += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFPROBE)
FATE_EXTERN += $(FATE_EXTERN-yes)

FATE += $(FATE-yes)

RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)

$(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(EXESUF)

$(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(EXESUF)

ifdef SAMPLES
FATE += $(FATE_FULL) $(FATE_FULL-yes)
FATE += $(FATE_EXTERN)
fate-rsync:
	rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
else
fate::
	@echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
fate-rsync:
	@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
$(FATE_EXTERN):
	@echo "$@ requires external samples and SAMPLES not specified"; false
endif

FATE_UTILS = base64 tiny_psnr tiny_ssim

TOOL = ffmpeg

fate:: $(FATE)

$(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
	@echo "TEST    $(@:fate-%=%)"
	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(TARGET_SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)' '$(GEN)'

fate-list:
	@printf '%s\n' $(sort $(FATE))

coverage.info: TAG = LCOV
coverage.info:
	$(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
	    sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
	$(M)lcov -q --remove $@ "/usr*" -o $@

lcov:  TAG = GENHTML
lcov: coverage.info
	$(M)genhtml -q -o $(CURDIR)/lcov $<

lcov-reset: TAG = LCOV
lcov-reset:
	$(M)lcov -d $(CURDIR) --zerocounters
	$(Q)$(RM) -f coverage.info

clean:: testclean

testclean:
	$(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(EXESUF)
	$(RM) $(CLEANSUFFIXES:%=tests/%)
	$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
	$(RM) tests/pixfmts.mak tests/test_copy.ffmeta

-include $(wildcard tests/*.d)

.PHONY: fate* lcov lcov-reset
.INTERMEDIATE: coverage.info


text:
Minitest + all the features you always wanted.

![Failure](assets/failure.png?raw=true)

Features
========
 - **Ctrl+c** stops tests and prints failures
 - **pastable rerun snippet** for failures (disabled/integrated on rails 5)
 - multiple before & after blocks
 - **around** blocks `around { |t| Dir.chdir(...) { t.call } }`
 - **red-green** output  (disabled/integrated on rails 5)
 - `mtest` executable to **run by line number** and by folder  (disabled/integrated on rails 5)
 - full backtrace for errors and assertions with verbose (`-v`)
 - `let!`
 - `let_all` execute once for all tests in a class and it's subclasses
 - `order_dependent!` to make your tests run in given order
 - `Maxitest.static_class_order = true` no longer sort tests class/sub-classes in random order
 - `context` for more expression
 - `pending { assert false }` is skip when it fails, but fails when it passes
 - implicit subject via `require 'maxitest/implicit_subject'`
 - `xit` to skip test (also does not call setup or teardown)
 - `require 'maxitest/timeout'` to make hanging tests fail after `Maxitest.timeout` seconds
 - `require 'maxitest/threads'` fail tests that leave extra threads running
 - `require 'maxitest/global_must'` (before autorun) disable deprecation on global `must_*` or [global_expectations](https://github.com/jeremyevans/minitest-global_expectations) gem

Install
=======

```Bash
gem install maxitest
```

Usage
=====

```Ruby
require "maxitest/autorun"

... normal tests ...
```

Development
===========
 - everything vendored into 1 gem to avoid dependency madness
 - tested via rspec to avoid messing up our own tests by accident
 - fixes should go back to the original libraries
 - restrictive minitest dependency so nothing breaks by accident
 - ruby >=2.6
 - `rake bundle` to update all vendored gems

Author
======
 - running by line number from [minitest-line](https://github.com/judofyr/minitest-line)
 - around from [minitest-around](https://github.com/splattael/minitest-around)
 - mtest from [testrbl](https://github.com/grosser/testrbl)
 - red-green from [minitest-rg](https://github.com/blowmage/minitest-rg)

[Michael Grosser](http://grosser.it)

michael@grosser.it

License: MIT

[![CI](https://github.com/grosser/maxitest/actions/workflows/actions.yml/badge.svg?branch=master)](https://github.com/grosser/maxitest/actions/workflows/actions.yml?query=branch%3Amaster)


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualScriptTypeCast" inherits="VisualScriptNode" category="Core" version="3.1">
	<brief_description>
	</brief_description>
	<description>
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
	</methods>
	<members>
		<member name="base_script" type="String" setter="set_base_script" getter="get_base_script">
		</member>
		<member name="base_type" type="String" setter="set_base_type" getter="get_base_type">
		</member>
	</members>
	<constants>
	</constants>
</class>


text:
<?php

namespace App\Http\Controllers\Api;

use App\Contracts\Repositories\TaskRepositoryContract;
use App\Exceptions\Task\TaskUpdateApiException;
use App\Http\Requests\TaskGroupRequest;
use App\Http\Requests\TaskRequest;
use App\Http\Resources\MyTaskCollection;
use App\Http\Resources\TaskResource;
use App\Http\Resources\TaskType;
use App\Http\Resources\UserResource;
use App\Project\Project;
use App\Task\Task;
use App\Task\TaskGroup;
use App\Http\Resources\TaskGroup as TaskGroupResource;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class TasksController extends Controller
{
    /**
     * 任务资源库.
     * @var TaskRepositoryContract
     */
    protected $taskRepository;

    /**
     * 构造器
     * 注入资源.
     *
     * TaskGroupController constructor.
     * @param TaskRepositoryContract $taskRepository
     */
    public function __construct(TaskRepositoryContract $taskRepository)
    {
        $this->taskRepository = $taskRepository;
    }

    /**
     * My Tasks
     * @param Request $request
     * @return MyTaskCollection
     */
    public function myTaskCollection(Request $request)
    {
        return new MyTaskCollection($request->user()->Tasks()
            ->with([
                'Type',
                'Status',
                'Group',
                'Priority',
                'Project',
                'Initiator',
                'User',
            ])
            ->orderBy('is_finish', 'asc')
            ->latest()
            ->orderBy('priority_id', 'desc')
            ->paginate(30));
    }

    /**
     * Group's Tasks
     * @param TaskGroup $taskGroup
     * @return MyTaskCollection
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function groupTaskCollection(TaskGroup $taskGroup)
    {
        $this->authorize('is_member', [$taskGroup->Project]);

        return new MyTaskCollection($taskGroup->Tasks()
            ->with([
                'Type',
                'Status',
                'Group',
                'Priority',
                'Project',
                'Initiator',
                'User',
            ])
            ->orderBy('is_finish', 'asc')
            ->latest()
            ->orderBy('priority_id', 'desc')
            ->paginate(30));
    }

    /**
     * Task Resource
     * @param Task $task
     * @return TaskResource
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function taskResource(Task $task)
    {
        $this->authorize('show', [$task]);

        $task->load([
            'Type',
            'Status',
            'Group',
            'Priority',
            'Project',
            'Initiator',
            'User',
            'SubTasks',
            'Activities' => function ($query) {
                $query->latest();
                $query->with(['User']);
            }
            ]);

        return new TaskResource($task);
    }

    /**
     * 編集資源
     * @param Project $project
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function editResource(Project $project)
    {
        $this->authorize('is_member', [$project]);

        $project->load([
            "Users",
            "ProjectLeader",
            "SubLeader",
            "TaskGroups",
            "TaskTypes",
        ]);

        $users = $project->Users;

        if ($project->ProjectLeader) {
            $users->push($project->ProjectLeader);
        }

        if ($project->SubLeader) {
            $users->push($project->SubLeader);
        }

        return response()->json([
            'users' => UserResource::collection($users),
            'groups' => TaskGroupResource::collection($project->TaskGroups),
            'open_groups' => TaskGroupResource::collection($project->TaskGroups()
                ->where('status_id', '<>', TaskGroup::CLOSE)
                ->latest()
                ->get()),
            'types' => TaskType::collection($project->TaskTypes),
        ], 200);
    }

    /**
     * Task Group Edit Resource Api
     * @param Project $project
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function groupEditResource(Project $project)
    {
        $this->authorize('is_member', [$project]);

        return response()->json([
            'types' => TaskType::collection($project->TaskTypes),
        ], 200);
    }

    /**
     * チケットを完了
     * @param Request $request
     * @param Task $task
     * @return \Illuminate\Http\JsonResponse
     * @throws TaskUpdateApiException
     * @throws \Illuminate\Auth\Access\AuthorizationException
     * @throws \Illuminate\Validation\ValidationException
     */
    public function completeTask(Request $request, Task $task)
    {
        $this->authorize('show', [$task]);

        $this->validate($request, [
            'is_finish' => 'required|boolean',
        ]);

        if ($task->is_finish === config('task.finished') and (int)$request->input('is_finish') === config('task.finished')) {
            TaskUpdateApiException::canNotEdit();
        }

        if ($task->progress !== 100) {
            TaskUpdateApiException::canNotEdit();
        }

        if ((int)$task->user_id === 0) {
            TaskUpdateApiException::canNotFinishNoneUserTask();
        }

        $task->is_finish = $request->input('is_finish');
        $task->color_id = config('color.success');
        $task->update();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.update-succeed')], 200);
    }

    /**
     * 更新API
     * @param TaskRequest $request
     * @param Task $task
     * @return \Illuminate\Http\JsonResponse
     * @throws TaskUpdateApiException
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function update(TaskRequest $request, Task $task)
    {
        $this->authorize('show', [$task]);

        if ($task->is_finish === config('task.finished')) {
            TaskUpdateApiException::canNotEdit();
        }

        $this->taskRepository->UpdateTask($request, $task)->update();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.update-succeed')], 200);
    }

    /**
     * 更新API
     * @param TaskRequest $request
     * @param Project $project
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function store(TaskRequest $request, Project $project)
    {
        $this->authorize('is_member', [$project]);

        $this->taskRepository->CreateTask($request, $project)->save();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.save-succeed')], 200);
    }

    /**
     * チケット削除
     * @param Task $task
     * @return \Illuminate\Http\JsonResponse
     * @throws TaskUpdateApiException
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function destroy(Task $task)
    {
        $this->authorize('show', [$task]);

        if ($task->is_finish === config('task.finished')) {
            TaskUpdateApiException::canNotEdit();
        }

        $task->delete();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.delete-succeed')], 200);
    }

    /**
     * チケットグループ 更新
     * @param TaskGroupRequest $request
     * @param TaskGroup $group
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function updateGroup(TaskGroupRequest $request, TaskGroup $group)
    {
        $this->authorize('is_member', [$group->Project]);

        $this->taskRepository->UpdateGroup($request, $group)->update();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.update-succeed')], 200);
    }

    /**
     * チケットグループ 作成
     * @param Project $project
     * @param TaskGroupRequest $request
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function storeGroup(Project $project, TaskGroupRequest $request)
    {
        $this->authorize('is_member', [$project]);

        $this->taskRepository->CreateGroup($request, $project)->save();

        return response()->json(['status' => 'OK', 'messages' => trans('errors.save-succeed')], 200);
    }
}


text:
package org.apache.felix.ipojo.test.scenarios.ps;

import java.util.Properties;

import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
import org.osgi.framework.ServiceReference;

public class DynamicProps extends OSGiTestCase {

	IPOJOHelper helper;

	public void setUp() {
	    helper = new IPOJOHelper(this);
		String type = "PS-FooProviderType-Dyn";
		helper.createComponentInstance(type, "FooProvider-1");

		Properties p2 = new Properties();
		p2.put("instance.name","FooProvider-2");
		p2.put("int", new Integer(4));
		p2.put("boolean", new Boolean(false));
		p2.put("string", new String("bar"));
		p2.put("strAProp", new String[] {"bar", "foo"});
		p2.put("intAProp", new int[] {1, 2, 3});
		helper.createComponentInstance(type, p2);

		String type2 = "PS-FooProviderType-Dyn2";
		Properties p3 = new Properties();
		p3.put("instance.name","FooProvider-3");
		p3.put("int", new Integer(0));
		p3.put("boolean", new Boolean(true));
		p3.put("string", new String(""));
		p3.put("strAProp", new String[0]);
		p3.put("intAProp", new int[0]);
		helper.createComponentInstance(type2, p3);

        Properties p4 = new Properties();
        p4.put("instance.name","FooProvider-4");
        helper.createComponentInstance(type2, p4);

	}

	public void tearDown() {
		helper.dispose();
	}

	public void testProperties1() {
		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-1");
		assertNotNull("Check the availability of the FS service", sr);

		// Check service properties
		Integer intProp = (Integer) sr.getProperty("int");
		Boolean boolProp = (Boolean) sr.getProperty("boolean");
		String strProp = (String) sr.getProperty("string");
		String[] strAProp = (String[]) sr.getProperty("strAProp");
		int[] intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
		assertNotNull("Check strAProp not nullity (1)", strAProp);
		String[] v = new String[] {"foo", "bar"};
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1)"); }
		}
		assertNotNull("Check intAProp not nullity", intAProp);
		int[] v2 = new int[] {1, 2, 3};
		for (int i = 0; i < intAProp.length; i++) {
			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1)"); }
		}

		// Invoke
		FooService fs = (FooService) getServiceObject(sr);
		assertTrue("invoke fs", fs.foo());

		// Re-check the property (change)
		intProp = (Integer) sr.getProperty("int");
		boolProp = (Boolean) sr.getProperty("boolean");
		strProp = (String) sr.getProperty("string");
		strAProp = (String[]) sr.getProperty("strAProp");
		intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality (2)", intProp, new Integer(3));
		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
		assertNotNull("Check strAProp not nullity (2)", strAProp);
		v = new String[] {"foo", "bar", "baz"};
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
		}
		assertNotNull("Check intAProp not nullity (2)", intAProp);
		v2 = new int[] {3, 2, 1};
		for (int i = 0; i < intAProp.length; i++) {
			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2)"); }
		}

		fs = null;
	}

	public void testProperties2() {
		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-2");
		assertNotNull("Check the availability of the FS service", sr);

		// Check service properties
		Integer intProp = (Integer) sr.getProperty("int");
		Boolean boolProp = (Boolean) sr.getProperty("boolean");
		String strProp = (String) sr.getProperty("string");
		String[] strAProp = (String[]) sr.getProperty("strAProp");
		int[] intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality", intProp, new Integer(4));
		assertEquals("Check longProp equality", boolProp, new Boolean(false));
		assertEquals("Check strProp equality", strProp, new String("bar"));
		assertNotNull("Check strAProp not nullity", strAProp);
		String[] v = new String[] {"bar", "foo"};
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
		}
		assertNotNull("Check intAProp not nullity", intAProp);
		int[] v2 = new int[] {1, 2, 3};
		for (int i = 0; i < intAProp.length; i++) {
			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
		}

		// Invoke
		FooService fs = (FooService) getServiceObject(sr);
		assertTrue("invoke fs", fs.foo());

		// Re-check the property (change)
		intProp = (Integer) sr.getProperty("int");
		boolProp = (Boolean) sr.getProperty("boolean");
		strProp = (String) sr.getProperty("string");
		strAProp = (String[]) sr.getProperty("strAProp");
		intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality", intProp, new Integer(3));
		assertEquals("Check longProp equality", boolProp, new Boolean(true));
		assertEquals("Check strProp equality", strProp, new String("foo"));
		assertNotNull("Check strAProp not nullity", strAProp);
		v = new String[] {"foo", "bar", "baz"};
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
		}
		assertNotNull("Check intAProp not nullity", intAProp);
		v2 = new int[] {3, 2, 1};
		for (int i = 0; i < intAProp.length; i++) {
			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
		}

		fs = null;
	}

	public void testProperties3() {
		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
		assertNotNull("Check the availability of the FS service", sr);

		// Check service properties
		Integer intProp = (Integer) sr.getProperty("int");
		Boolean boolProp = (Boolean) sr.getProperty("boolean");
		String strProp = (String) sr.getProperty("string");
		String[] strAProp = (String[]) sr.getProperty("strAProp");
		int[] intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality", intProp, new Integer(0));
		assertEquals("Check longProp equality", boolProp, new Boolean(true));
		assertEquals("Check strProp equality", strProp, new String(""));
		assertNotNull("Check strAProp not nullity", strAProp);
		String[] v = new String[0];
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
		}
		assertNotNull("Check intAProp not nullity", intAProp);
		int[] v2 = new int[0];
		for (int i = 0; i < intAProp.length; i++) {
			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
		}

		// Invoke
		FooService fs = (FooService) getServiceObject(sr);
		assertTrue("invoke fs", fs.foo());

		// Re-check the property (change)
		intProp = (Integer) sr.getProperty("int");
		boolProp = (Boolean) sr.getProperty("boolean");
		strProp = (String) sr.getProperty("string");
		strAProp = (String[]) sr.getProperty("strAProp");
		intAProp = (int[]) sr.getProperty("intAProp");

		assertEquals("Check intProp equality", intProp, new Integer(2));
		assertEquals("Check longProp equality", boolProp, new Boolean(true));
		assertEquals("Check strProp equality", strProp, new String("foo"));
		assertNotNull("Check strAProp not nullity", strAProp);
		v = new String[] {"foo", "bar"};
		for (int i = 0; i < strAProp.length; i++) {
			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
		}
		assertNull("Check intAProp hidding (no value)", intAProp);

		fs = null;
	}

    public void testProperties4() {
    	ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-4");
    	assertNotNull("Check the availability of the FS service", sr);

    	// Check service properties
    	Integer intProp = (Integer) sr.getProperty("int");
    	Object boolProp = sr.getProperty("boolean");
    	Object strProp = sr.getProperty("string");
    	Object strAProp = sr.getProperty("strAProp");
    	int[] intAProp = (int[]) sr.getProperty("intAProp");

    	assertEquals("Check intProp equality", intProp, new Integer(4)); // Set by the component type.
    	assertEquals("Check boolProp equality", boolProp, null);
    	assertEquals("Check strProp equality", strProp, null);
    	assertNull("Check strAProp  nullity", strAProp);
    	assertNotNull("Check intAProp not nullity", intAProp); // Set by the component type.
    	assertNotNull("Check intAProp not nullity", intAProp);
        int[] v2 = new int[] {1, 2, 3};
        for (int i = 0; i < intAProp.length; i++) {
            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
        }

    	// Invoke
    	FooService fs = (FooService) getServiceObject(sr);
    	assertTrue("invoke fs", fs.foo());

    	// Re-check the property (change)
    	intProp = (Integer) sr.getProperty("int");
    	boolProp = (Boolean) sr.getProperty("boolean");
    	strProp = (String) sr.getProperty("string");
    	strAProp = (String[]) sr.getProperty("strAProp");
    	intAProp = (int[]) sr.getProperty("intAProp");

    	assertEquals("Check intProp equality", intProp, new Integer(2));
    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
    	assertEquals("Check strProp equality", strProp, new String("foo"));
    	assertNotNull("Check strAProp not nullity", strAProp);
    	String[] v = new String[] {"foo", "bar"};
    	for (int i = 0; i < ((String[]) strAProp).length; i++) {
    		if(! ((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }
    	}
    	assertNull("Check intAProp hidding (no value)", intAProp);

    	fs = null;
    }

}


text:
/*
 * diagonalize.cc
 */

#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/ADT/ValueMap.h"
#include "llvm/Support/PatternMatch.h"
#include "llvm/Support/InstIterator.h"

#include <Eigen/Core>
#include <Eigen/Eigenvalues>

using namespace llvm;
using namespace PatternMatch;
using namespace Eigen;

#define OP_IN_RANGE(_op, _start, _end) \
    (_op >= Instruction:: _start && _op <= Instruction:: _end)

namespace
{

class ADPass : public LoopPass
{
    Loop* loop;
    DominatorTree* DT;
    ICmpInst* loop_cond;
    BasicBlock* loop_body;
    BasicBlock* exit_block;
    Value* nr_iters;
    BasicBlock* dgen;
    ConstantInt* start_iter;
    PHINode* iter_var;
    ValueMap<PHINode*, size_t> phis;

    /* Track linear combinations of state variables. */
    typedef ValueMap<PHINode*, double> Coefficients;

public:
    static char ID;

    ADPass() : LoopPass(ID) {}

    virtual void getAnalysisUsage(AnalysisUsage& AU) const {
        AU.addRequired<DominatorTree>();
    }

    /*
     * Drive the optimization pass.
     * Return true iff the optimization was applied.
     */
    virtual bool runOnLoop(Loop* L, LPPassManager&) {
        loop = L;
        DT = &getAnalysis<DominatorTree>();
        phis.clear();

        if (loop->getBlocks().size() != 1
            || !(loop_body = loop->getBlocks().front())
            || loop->getSubLoops().size()
            || !(exit_block = loop->getUniqueExitBlock())
            || !loopFilter()
            || !extractIterator())
        {
            return false;
        }

        /* Assign a dimension to each state variable. */
        size_t phi_index = 0;
        phis.erase(iter_var);
        for (auto kv = phis.begin(); kv != phis.end(); ++kv) {
            phis[kv->first] = phi_index++;
        }

        /* Find the initial state and all linear dependence relations. */
        size_t nr_phis = phis.size();

        MatrixXd InitialState(nr_phis, 1);
        MatrixXd TransformationMatrix(nr_phis, nr_phis);
        TransformationMatrix << MatrixXd::Zero(nr_phis, nr_phis);
        for (auto kv = phis.begin(); kv != phis.end(); ++kv) {
            PHINode* PN = kv->first;
            size_t phi_label = phis[PN];
            InitialState(phi_label, 0) = toDouble(getPhiConstVal(PN));

            Coefficients coeffs;
            if (!trackUpdates(getPhiFeedbackVal(PN), coeffs)) {
                return false;
            }
            for (auto ckv = coeffs.begin(); ckv != coeffs.end(); ++ckv) {
                size_t target_phi = phis[ckv->first];
                TransformationMatrix(phi_label, target_phi) = ckv->second;
            }
        }

        /* Diagonalize the transformation matrix. */
        EigenSolver<MatrixXd> EigSolver(TransformationMatrix);
        MatrixXcd P = EigSolver.eigenvectors();
        MatrixXcd D = EigSolver.eigenvalues().asDiagonal();
        MatrixXcd Pinv = P.inverse();
        if (!checkSystem(TransformationMatrix, P, D, Pinv)) {
            return false;
        }

        /* Emit instructions to compute the closed form in a new block. */
        LLVMContext& ctx = loop_body->getContext();
        Function* parentFunc = exit_block->getParent();

        Module* mod = parentFunc->getParent();
        dgen = BasicBlock::Create(ctx, "dgen", parentFunc, exit_block);
        Type* numTy = Type::getDoubleTy(ctx);
        Function* powf = NULL;
        if (!(powf = mod->getFunction("llvm.pow.f64"))) {
            std::vector<Type*> powProto(2, numTy);
            FunctionType* powType = FunctionType::get(numTy, powProto, false);
            powf = Function::Create(powType, GlobalValue::ExternalLinkage,
                "llvm.pow.f64", mod);
            powf->setCallingConv(CallingConv::C);
        }

        /* P(D^n) = r * λ^n : ∀(r) ∈ row(P) */
        Value** PDn = new Value*[nr_phis * nr_phis];
        Value* iexpt = BinaryOperator::Create(Instruction::Sub, nr_iters,
           start_iter, "iexpt", dgen);
        iexpt = BinaryOperator::Create(Instruction::Add, iexpt,
           ConstantInt::get(Type::getInt32Ty(ctx), 1), "iexpt_adj", dgen);
        Value* exponent = CastInst::Create(Instruction::UIToFP, iexpt, numTy,
            "fexpt", dgen);
        for (size_t j = 0; j < nr_phis; ++j) {
            /* λ[j]^n */
            Value* exptargs[] = {
                toConstantFP(ctx, std::real(D(j, j))), exponent
            };
            Value* eigvexpt = CallInst::Create(powf,
                ArrayRef<Value*>(exptargs, 2), "eigvexpt", dgen);

            /* PDn[i][j] = P[i][j] * λ[j]^n */
            for (size_t i = 0; i < nr_phis; ++i) {
                size_t index = i * nr_phis + j;
                PDn[index] = BinaryOperator::Create(Instruction::FMul,
                    toConstantFP(ctx, std::real(P(i, j))), eigvexpt, "pdn",
                                 dgen);
            }
        }

        /* xf = P(D^n) * Pinv * x0 */
        Value** soln = new Value*[nr_phis];
        Value* zero = toConstantFP(ctx, 0.0);
        for (size_t i = 0; i < nr_phis; ++i) {
            soln[i] = zero;
            for (size_t j = 0; j < nr_phis; ++j) {
                /* dotp = <a, b> : a ∈ row(P(D^n)), b ∈ col(Pinv) */
                Value* dotp = zero;
                for (size_t k = 0; k < nr_phis; ++k) {
                    Value* ik_kj = BinaryOperator::Create(Instruction::FMul,
                        PDn[i * nr_phis + k],
                        toConstantFP(ctx, std::real(Pinv(k, j))),
                        "ik_kj", dgen);
                    dotp = BinaryOperator::Create(Instruction::FAdd,
                        ik_kj, dotp, "dotp", dgen);
                }

                /* xf[i] = ∑ P(D^n)Pinv[i][j] * x0[j] */
                Value* xj_prod = BinaryOperator::Create(Instruction::FMul,
                    dotp, toConstantFP(ctx, InitialState(j)), "pdpxj",
                    dgen);
                soln[i] = BinaryOperator::Create(Instruction::FAdd,
                    xj_prod, soln[i], "xf", dgen);
            }
        }

        delete[] PDn;

        /* Rewire edges headed in and out of the loop. */
        for (inst_iterator II = inst_begin(parentFunc),
                           E = inst_end(parentFunc); II != E; ++II)
        {
            Instruction* instr = &*II;
            if (!isa<BranchInst>(instr)) {
                continue;
            }

            BranchInst* BI = cast<BranchInst>(instr);
            for (unsigned k = 0; k < BI->getNumSuccessors(); ++k) {
                if (BI->getSuccessor(k) == loop_body) {
                    BI->setSuccessor(k, dgen);
                }
            }
        }
        BranchInst::Create(exit_block, dgen);

        /* Replace values leading into phi nodes. */
        for (auto kv = phis.begin(); kv != phis.end(); ++kv) {
            PHINode* loopPhi = kv->first;
            Value* incoming = getPhiFeedbackVal(loopPhi);
            Value* target = soln[kv->second];
            rewriteLiveValues(incoming, target);
        }
        loop_body->replaceSuccessorsPhiUsesWith(dgen);

        /* Delete the old loop. */
        loop_body->eraseFromParent();

        delete[] soln;

        return true;
    }

private:
    /*
     * Check whether the loop is linearizale.
     */
    bool loopFilter() {
        loop_cond = NULL;
        for (auto II = loop_body->begin(); II != loop_body->end(); ++II) {
            Instruction* instr = II;
            if (isa<ICmpInst>(instr)) {
                if (loop_cond) {
                    return false;
                } else {
                    loop_cond = cast<ICmpInst>(instr);
                }
            } else if (isa<PHINode>(instr)) {
                PHINode* PN = cast<PHINode>(instr);
                if (PN->getNumIncomingValues() != 2
                    || !DT->dominates(PN->getIncomingBlock(0), loop_body))
                {
                    return false;
                }
                Value* inLhs = PN->getIncomingValue(0);
                Value* inRhs = PN->getIncomingValue(1);
                if (!isa<ConstantInt>(inLhs) && !isConstant(inRhs)) {
                    return false;
                } else {
                    phis[PN] = 0;
                }
            } else if (isa<BinaryOperator>(instr)) {
                BinaryOperator* binop = cast<BinaryOperator>(instr);
                if (!(OP_IN_RANGE(binop->getOpcode(), Add, FDiv))) {
                    return false;
                }
            } else if (!isa<BranchInst>(instr)) {
                return false;
            }
        }
        return loop_cond != NULL;
    }

    /*
     * Given a loop in canonical form, extract the loop condition and the
     * starting iteration. Return true iff basic sanity checks pass.
     */
    bool extractIterator() {
        Value* loop_var = NULL;
        ICmpInst::Predicate IPred;
        if (!match(loop_cond, m_ICmp(IPred, m_Value(loop_var),
                                            m_Value(nr_iters)))
            || IPred != CmpInst::Predicate::ICMP_EQ
            || !isa<PHINode>(loop_var))
        {
            return false;
        }

        iter_var = cast<PHINode>(loop_var);
        if (!match(getPhiConstVal(iter_var), m_ConstantInt(start_iter))) {
            return false;
        }

        bool foundIncr = false;
        for (auto II = loop_body->begin(); II != loop_body->end(); ++II) {
            Instruction* instr = II;
            if (!isa<BinaryOperator>(II)) {
                continue;
            }

            BinaryOperator* binop = cast<BinaryOperator>(instr);
            if (foundIncr &&
                (binop->getOperand(0) == iter_var
                || binop->getOperand(1) == iter_var))
            {
                return false;
            }

            if (binop->getOpcode() == Instruction::Add
                && ((binop->getOperand(0) == iter_var
                      && isa<ConstantInt>(binop->getOperand(1))
                      && toInt(binop->getOperand(1)) == 1) ||
                    (binop->getOperand(1) == iter_var
                      && isa<ConstantInt>(binop->getOperand(0))
                      && toInt(binop->getOperand(0)) == 1)))
            {
                foundIncr = true;
            }
        }
        return foundIncr;
    }

    Value* getPhiConstVal(PHINode* PN) {
      if (isConstant(PN->getIncomingValue(0))) {
        return PN->getIncomingValue(0);
      }
      return PN->getIncomingValue(1);
    }

    Value* getPhiFeedbackVal(PHINode* PN) {
      if (isConstant(PN->getIncomingValue(0))) {
        return PN->getIncomingValue(1);
      }
      return PN->getIncomingValue(0);
    }

    /*
     * Find a linear combination of state variables which generate @parent.
     * Return true iff a valid list of coefficients is found.
     */
    bool trackUpdates(Value* parent, Coefficients& coeffs, bool root = true) {
        if (isa<Constant>(parent)) {
            /*
             * If a state variable is set to a constant during each iteration,
             * the compiler should lift it out of the loop before we get here.
             */
            return !root;
        } else if (isa<PHINode>(parent)) {
            PHINode* PN = cast<PHINode>(parent);
            coeffs[PN] = 1;
            return phis.count(PN) == 1;
        } else if (isa<BinaryOperator>(parent)) {
            BinaryOperator* binop = cast<BinaryOperator>(parent);
            int opcode = binop->getOpcode();
            Value *LHS = binop->getOperand(0),
                  *RHS = binop->getOperand(1);

            Coefficients lhsCoeffs, rhsCoeffs;
            if (!trackUpdates(LHS, lhsCoeffs, false)
                || !trackUpdates(RHS, rhsCoeffs, false))
            {
                return false;
            }

            double scalar;
            if (OP_IN_RANGE(opcode, Add, FSub)) {
                /* Add instructions shouldn't operate on scalars. */
                if (isScalar(lhsCoeffs) || isScalar(rhsCoeffs)) {
                    return false;
                }
            } else {
                /* Mul instructions should only have one scalar operand. */
                if (!(isScalar(lhsCoeffs) ^ isScalar(rhsCoeffs))) {
                    return false;
                }

                /* Div instructions cannot have scalar numerators. */
                if (OP_IN_RANGE(opcode, UDiv, FDiv) && isScalar(lhsCoeffs)) {
                    return false;
                }

                scalar = toDouble(isScalar(lhsCoeffs) ? LHS : RHS);
            }

            /* Merge the two sets of coefficients. */
            for (auto kv = phis.begin(); kv != phis.end(); ++kv) {
                PHINode* PN = kv->first;
                double lcoeff = lhsCoeffs.lookup(PN);
                double rcoeff = rhsCoeffs.lookup(PN);

                /* Adding nil entries to 'coeffs' breaks isScalar(). */
                if (lcoeff == 0.0 && rcoeff == 0.0) {
                    continue;
                }

                if (OP_IN_RANGE(opcode, Add, FAdd)) {
                    coeffs[PN] = lcoeff + rcoeff;
                } else if (OP_IN_RANGE(opcode, Sub, FSub)) {
                    coeffs[PN] = lcoeff - rcoeff;
                } else if (OP_IN_RANGE(opcode, Mul, FMul)) {
                    coeffs[PN] = scalar * (lcoeff + rcoeff);
                } else {
                    coeffs[PN] = (1 / scalar) * (lcoeff + rcoeff);
                }
            }
            return true;
        }
        return false;
    }

    bool isConstant(Value* V) {
      return isa<ConstantInt>(V) || isa<ConstantFP>(V);
    }

    int64_t toInt(Value* V) {
        return cast<ConstantInt>(V)->getValue().getSExtValue();
    }

    double toDouble(Value* V) {
        if (isa<ConstantInt>(V)) {
            return double(toInt(V));
        } else if (isa<ConstantFP>(V)) {
            return cast<ConstantFP>(V)->getValueAPF().convertToDouble();
        }
        return 0.0;
    }

    Value* toConstantFP(LLVMContext& ctx, double n) {
        return ConstantFP::get(ctx, APFloat(n));
    }

    bool isScalar(Coefficients& coeffs) {
        return coeffs.size() == 0;
    }

    /*
     * Verify that A == PDP^-1 within an acceptable margin of error.
     */
    bool checkSystem(MatrixXd& A, MatrixXcd& P,
                     MatrixXcd& D, MatrixXcd& Pinv)
    {
        MatrixXcd PDPi = P*D*Pinv;
        const double epsilon = 25 * std::numeric_limits<double>::epsilon();
        for (int i = 0; i < P.rows(); ++i) {
            for (int j = 0; j < P.cols(); ++j) {
                if (std::imag(P(i, j)) != 0.0) {
                    return false;
                }
                if (std::abs(A(i, j) - PDPi(i, j)) > epsilon) {
                    return false;
                }
            }
        }
        return true;
    }

    /*
     * Some instructions may use the results of the loop. Rewire these
     * instructions so that they use the values from the @dgen basic block.
     */
    void rewriteLiveValues(Value* oldval, Value* target) {
        for (auto UI = oldval->use_begin(); UI != oldval->use_end(); ++UI) {
            User* user = *UI;

            /* Don't bother updating values in @loop_body. It dies soon. */
            if (isPartialComputation(user)) {
                continue;
            }

            if (isa<PHINode>(user)) {
                PHINode* userPhi = cast<PHINode>(user);
                for (unsigned i=0; i < userPhi->getNumIncomingValues(); ++i) {
                    if (userPhi->getIncomingValue(i) == oldval) {
                        userPhi->setIncomingValue(i, target);
                        userPhi->setIncomingBlock(i, dgen);
                    }
                }
                continue;
            }

            for (auto op = user->op_begin(); op != user->op_end(); ++op) {
                Use& phiUse = *op;
                Value* operand = phiUse.get();
                if (operand == oldval) {
                    phiUse.set(target);
                }
            }
        }
    }

    /*
     * Check if the target value is defined in the loop body.
     */
    bool isPartialComputation(Value* target) {
        for (auto II = loop_body->begin(); II != loop_body->end(); ++II) {
            Instruction* instr = II;
            if (instr == target) {
                return true;
            }
        }
        return false;
    }
};

char ADPass::ID = 0;

}

static RegisterPass<ADPass> X("auto-diagonalize",
    "Diagonalize linear dynamical systems", false, false);


text:
// Variables that are used on both client and server

SWEP.Base 				= "weapon_mad_base"

SWEP.ViewModelFOV			= 80
SWEP.ViewModel			= "models/items/v_medkit2.mdl"
SWEP.WorldModel			= "models/items/w_medkit.mdl"

SWEP.Spawnable			= true
SWEP.AdminSpawnable		= false

SWEP.Primary.Sound 		= Sound("HealthVial.Touch")
SWEP.Secondary.Sound 		= Sound("WeaponFrag.Throw")
SWEP.Primary.Recoil		= 0
SWEP.Primary.Damage		= 0
SWEP.Primary.NumShots		= 1
SWEP.Primary.Cone			= 0.075
SWEP.Primary.Delay 		= 2

SWEP.Primary.ClipSize		= 1					// Size of a clip
SWEP.Primary.DefaultClip	= 1					// Default number of bullets in a clip
SWEP.Primary.Automatic		= false				// Automatic/Semi Auto
SWEP.Primary.Ammo			= "none"

SWEP.Secondary.ClipSize		= -1					// Size of a clip
SWEP.Secondary.DefaultClip	= -1					// Default number of bullets in a clip
SWEP.Secondary.Automatic	= false				// Automatic/Semi Auto
SWEP.Secondary.Ammo		= "none"

SWEP.ShellEffect			= "none"				// "effect_mad_shell_pistol" or "effect_mad_shell_rifle" or "effect_mad_shell_shotgun"
SWEP.ShellDelay			= 0

SWEP.Pistol				= true
SWEP.Rifle				= false
SWEP.Shotgun			= false
SWEP.Sniper				= false

//SWEP.RunArmOffset 		= Vector (0.041, 0, 5.6778)
//SWEP.RunArmAngle 		= Vector (-17.6901, 0.321, 0)

SWEP.Power				= 0

/*---------------------------------------------------------
   Name: SWEP:Precache()
   Desc: Use this function to precache stuff.
---------------------------------------------------------*/
function SWEP:Precache()

    	util.PrecacheSound("items/smallmedkit1.wav")
    	util.PrecacheSound("weapons/slam/throw.wav")
end

/*---------------------------------------------------------
   Name: SWEP:PrimaryAttack()
   Desc: +attack2 has been pressed.
---------------------------------------------------------*/
cleanup.Register("Medic Kit")

function SWEP:PrimaryAttack()

	// Holst/Deploy your fucking weapon
	if (not self.Owner:IsNPC() and self.Owner:KeyDown(IN_USE)) then
		bHolsted = !self.Weapon:GetNetworkedBool("Holsted", false)
		self:SetHolsted(bHolsted)

		self.Weapon:SetNextPrimaryFire(CurTime() + 0.3)
		self.Weapon:SetNextSecondaryFire(CurTime() + 0.3)

		self:SetIronsights(false)

		return
	end

	if not IsFirstTimePredicted() then return end
	if self.ActionDelay > CurTime() then return end

	self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
	self.Weapon:SetNextSecondaryFire(CurTime() + self.Primary.Delay)
	self.ActionDelay = (CurTime() + self.Primary.Delay)

	self.Weapon:SendWeaponAnim(ACT_VM_HOLSTER) 			// View model animation

	timer.Simple(1, function()
		if (not self.Owner:Alive() or self.Weapon:GetOwner():GetActiveWeapon():GetClass() ~= "weapon_mad_medic" or not IsFirstTimePredicted()) then return end
		self.Weapon:SendWeaponAnim(ACT_VM_DRAW) 			// View model animation
	end)

	timer.Simple(0.75, function()
		self.Owner:SetAnimation(PLAYER_ATTACK1)				// 3rd Person Animation

		if (SERVER) then
			self.Weapon:EmitSound(self.Secondary.Sound)
		end

		if (CLIENT) then return end

		local health = ents.Create("ent_mad_medic")

		health.Owner = self.Owner

		local pos = self.Owner:GetShootPos() + self.Owner:GetUp() * -12.5
		health:SetPos(pos)

		health:SetAngles(self.Owner:GetAngles())
		health:Spawn()

		undo.Create("Medic Kit")
			undo.AddEntity(health)
			undo.SetPlayer(self.Owner)
		undo.Finish()

		self.Owner:AddCleanup("Medic Kit", health)

		local phys = health:GetPhysicsObject()
		phys:SetVelocity(self.Owner:GetAimVector() * 200)
	end)
end

/*---------------------------------------------------------
   Name: SWEP:SecondaryAttack()
   Desc: +attack1 has been pressed.
---------------------------------------------------------*/
function SWEP:SecondaryAttack()
end

/*---------------------------------------------------------
   Name: SWEP:Deploy()
   Desc: Whip it out.
---------------------------------------------------------*/
function SWEP:Deploy()

	self.Weapon:SendWeaponAnim(ACT_VM_DRAW)

	self.Weapon:SetNextPrimaryFire(CurTime() + self.DeployDelay)
	self.Weapon:SetNextSecondaryFire(CurTime() + self.DeployDelay)
	self.ActionDelay = (CurTime() + self.DeployDelay)

	return true
end

/*---------------------------------------------------------
   Name: SWEP:Reload()
   Desc: Reload is being pressed.
---------------------------------------------------------*/
function SWEP:Reload()
end


text:
package item_29;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

public class PrintAnnotation {
	//ʹÓÃasSubclass°²È«µØת»»ÎªÓнçÀàÐ͵ıê¼Ç
	static Annotation getAnnotation(AnnotatedElement element,
			String annotationTypeName) {
		Class<?> annotationType = null; //ÎÞÏÞÖÆÀàÐÍÁîÅÆ
		try {
			annotationType = Class.forName(annotationTypeName);
		} catch (Exception e) {
			// TODO: handle exception
			throw new IllegalArgumentException(e);
		}
		return element.getAnnotation(annotationType
				.asSubclass(Annotation.class));
	}

	public static void main(String[] args) {
		if (args.length != 2) {
			System.out
			.println("Usage: java PrintAnnotation <class> <annotation>");
			System.exit(1);
		}
		String className = args[0];
		String annotationTypeName = args[1];
		Class<?> klass;
		try {
			klass = Class.forName(className);
			System.out.println(getAnnotation(klass, annotationTypeName));
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}


text:
<!DOCTYPE html>

    <link type="text/css" rel="stylesheet" href="../stylesheets/blog-stylesheets.css">

    <title>Thinking Style</title>

            ABOUT

            BLOG

            PROJECTS

Thinking Style: Learning How to Learn

November 12, 2014

*   *   *

When I started blogging back in 2001 or so, at the young age of 13, tests--personality tests, IQ tests, behavioral assessments, Which-90's-Band-Are-You-? tests--were all the rage. There were so many of them, and each test claimed to be able to reveal more about myself then even I knew. My spiritual color is yellow, you say? Oh, that means that I am a person with a happy disposition blah blah blah...

I tell you this so you can understand that I was a little reluctant to take *gasp!* even more such tests as part of my first foray into Dev Bootcamp

I realize now that the important distinction that I did not make when I was much younger--other than the fact that a lot of those tests for bloggers were not at all scientifically backed--is that these tests were never designed to cover the entire spectrum of a person. People are simply too complex to be categorized so easily. Rather, such tests are meant to serve more as a guide, to help you figure out things like how you might learn better (as is the case here).

Note, for example, the photo above. Anthony Gregorc would classify me as a Concrete Random, according to the Mind Styles model that he created. I read through the list, and yeah, that sounds exactly like how I learn best. At the encouragement of Dev Bootcamp, I thought that I should really think about the implications of results like this more. How does this apply to me exactly? How can I utilize this knowledge to aid me in my learning?

I think about how I've tackled my experience with DBC so far, and this lists confirms to me that I have been confronting it the right way--with lots of experimentation, trial-and-error and a healthy dose of intuition and alone time. It doesn't hurt that there is a bit of classroom environment at DBC as well, however unconventional it might be.

In terms of avoiding factors that make learning challenging for me, well...I've always known that I've greatly disliked having to redo things. I guess the solution there is just to learn something or do something well enough the first time, so that I don't have to do it again. There are so many ways that I can use such results as a guide to aid me in my learning.

However, the test that really hit home was not the Mind Styles test, which only really told me things I already knew and was willing to admit to myself. Rather, the test that made an impact was having to categorize myself with a Fixed vs. Growth Mindset. It isn't your usual test--you don't tick boxes, or circle answers, or pick the photo that you find most compelling. In this test, you read through a list and figure out for yourself which camp you belong to based on the descriptions.

It pained me to note that I was more often than not in the Fixed Mindset camp.

Fortuntely, with this also comes acknowledgement. I was aghast! Now that I've figured out what was stopping my growth, it's time to change some things. Thankfully, Dev Bootcamp feels like a safe space, where I can feel like an idiot and yet not feel judged for it. I'm hoping that this environment will help me transition from more of a fixed mindset to one of growth, where I can take challenges head on, accept all kinds of constructive criticism, and persist despite any difficulties.

It's nice to take these tests every once in a while, especially when you use them properly, and let them assist you in making yourself better.

(c) 2014 M Clarisse Valera


text:
Visual pleasures

A room without character is just a waste of space. This is what motivated Vestalux to create objects that transform spaces to homes.

                more


text:
"""
@package mi.dataset.parser.test.test_wavss_a_dcl
@file mi/dataset/parser/test/test_hyd_o_dcl.py
@author Emily Hahn
@brief A test parser for the hydrogen series o instrument through a DCL
"""

__author__ = 'Emily Hahn'
__license__ = 'Apache 2.0'

import os
from nose.plugins.attrib import attr

from mi.core.exceptions import SampleException
from mi.dataset.test.test_parser import ParserUnitTestCase, BASE_RESOURCE_PATH
from mi.dataset.parser.hyd_o_dcl import HydODclParser

RESOURCE_PATH = os.path.join(BASE_RESOURCE_PATH, 'hyd_o', 'dcl', 'resource')

@attr('UNIT', group='mi')
class HydODclParserUnitTestCase(ParserUnitTestCase):

    def test_simple_telem(self):
        """
        Test a simple telemetered case
        """
        with open(os.path.join(RESOURCE_PATH, 'first.hyd1.log'), 'rU') as file_handle:
            parser = HydODclParser(file_handle, self.exception_callback, is_telemetered=True)

            particles = parser.get_records(8)

            self.assert_particles(particles, "first_telem.yml", RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

    def test_simple_recov(self):
        """
        Test a simple recovered case
        """
        with open(os.path.join(RESOURCE_PATH, 'first.hyd1.log'), 'rU') as file_handle:
            parser = HydODclParser(file_handle, self.exception_callback, is_telemetered=False)

            particles = parser.get_records(8)

            self.assert_particles(particles, "first_recov.yml", RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

    def test_long_telem(self):
        """
        Test with the full file and confirm the correct number of particles occurs
        """
        with open(os.path.join(RESOURCE_PATH, '20140904.hyd1.log'), 'rU') as file_handle:
            parser = HydODclParser(file_handle, self.exception_callback, is_telemetered=True)

            # there are 813 lines in the file, but 70 are ignored so we should get 743 particles
            particles = parser.get_records(813)
            self.assertEquals(len(particles), 743)

            self.assertEqual(self.exception_callback_value, [])

    def test_bad_format_telem(self):
        """
        Test a file with two lines not formatted properly
        """
        with open(os.path.join(RESOURCE_PATH, 'bad_format.hyd1.log'), 'rU') as file_handle:
            parser = HydODclParser(file_handle, self.exception_callback, is_telemetered=True)

            particles = parser.get_records(10)
            self.assertEquals(len(particles), 8)

            # particles in the file should still match the good data in first.hyd1.log, just skipping the bad lines
            self.assert_particles(particles, "first_telem.yml", RESOURCE_PATH)

            # confirm we get two exceptions, one for each bad line
            self.assertEqual(len(self.exception_callback_value), 2)
            self.assertIsInstance(self.exception_callback_value[0], SampleException)
            self.assertIsInstance(self.exception_callback_value[1], SampleException)

    def test_log_only(self):
        """
        Test with a file that only contains dcl logs, no data, and confirm no particles are returned
        """
        with open(os.path.join(RESOURCE_PATH, 'log_only.hyd1.log'), 'rU') as file_handle:
            parser = HydODclParser(file_handle, self.exception_callback, is_telemetered=True)

            particles = parser.get_records(10)
            self.assertEquals(len(particles), 0)

            self.assertEqual(self.exception_callback_value, [])


text:
lakeskysea.github.io
====================

A gift for the gifted


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Moments</title>
<meta name="date" content="2015-06-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.opencv.imgproc

Class Moments

java.lang.Object

org.opencv.imgproc.Moments

public class Moments
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

protected long
nativeObj

Constructor Summary

Constructors

Modifier
Constructor and Description

Moments()

protected
Moments(long addr)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

protected void
finalize()

double
get_m00()

double
get_m01()

double
get_m02()

double
get_m03()

double
get_m10()

double
get_m11()

double
get_m12()

double
get_m20()

double
get_m21()

double
get_m30()

double
get_mu02()

double
get_mu03()

double
get_mu11()

double
get_mu12()

double
get_mu20()

double
get_mu21()

double
get_mu30()

double
get_nu02()

double
get_nu03()

double
get_nu11()

double
get_nu12()

double
get_nu20()

double
get_nu21()

double
get_nu30()

void
set_m00(double m00)

void
set_m01(double m01)

void
set_m02(double m02)

void
set_m03(double m03)

void
set_m10(double m10)

void
set_m11(double m11)

void
set_m12(double m12)

void
set_m20(double m20)

void
set_m21(double m21)

void
set_m30(double m30)

void
set_mu02(double mu02)

void
set_mu03(double mu03)

void
set_mu11(double mu11)

void
set_mu12(double mu12)

void
set_mu20(double mu20)

void
set_mu21(double mu21)

void
set_mu30(double mu30)

void
set_nu02(double nu02)

void
set_nu03(double nu03)

void
set_nu11(double nu11)

void
set_nu12(double nu12)

void
set_nu20(double nu20)

void
set_nu21(double nu21)

void
set_nu30(double nu30)

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

nativeObj

protected final long nativeObj

Constructor Detail

Moments

protected Moments(long addr)

Moments

public Moments()

Method Detail

get_m00

public double get_m00()

set_m00

public void set_m00(double m00)

get_m10

public double get_m10()

set_m10

public void set_m10(double m10)

get_m01

public double get_m01()

set_m01

public void set_m01(double m01)

get_m20

public double get_m20()

set_m20

public void set_m20(double m20)

get_m11

public double get_m11()

set_m11

public void set_m11(double m11)

get_m02

public double get_m02()

set_m02

public void set_m02(double m02)

get_m30

public double get_m30()

set_m30

public void set_m30(double m30)

get_m21

public double get_m21()

set_m21

public void set_m21(double m21)

get_m12

public double get_m12()

set_m12

public void set_m12(double m12)

get_m03

public double get_m03()

set_m03

public void set_m03(double m03)

get_mu20

public double get_mu20()

set_mu20

public void set_mu20(double mu20)

get_mu11

public double get_mu11()

set_mu11

public void set_mu11(double mu11)

get_mu02

public double get_mu02()

set_mu02

public void set_mu02(double mu02)

get_mu30

public double get_mu30()

set_mu30

public void set_mu30(double mu30)

get_mu21

public double get_mu21()

set_mu21

public void set_mu21(double mu21)

get_mu12

public double get_mu12()

set_mu12

public void set_mu12(double mu12)

get_mu03

public double get_mu03()

set_mu03

public void set_mu03(double mu03)

get_nu20

public double get_nu20()

set_nu20

public void set_nu20(double nu20)

get_nu11

public double get_nu11()

set_nu11

public void set_nu11(double nu11)

get_nu02

public double get_nu02()

set_nu02

public void set_nu02(double nu02)

get_nu30

public double get_nu30()

set_nu30

public void set_nu30(double nu30)

get_nu21

public double get_nu21()

set_nu21

public void set_nu21(double nu21)

get_nu12

public double get_nu12()

set_nu12

public void set_nu12(double nu12)

get_nu03

public double get_nu03()

set_nu03

public void set_nu03(double nu03)

finalize

protected void finalize()
                 throws java.lang.Throwable

Overrides:

finalize in class java.lang.Object

Throws:

java.lang.Throwable

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
'use strict';

describe('Controller: EditorCtrl', function () {

  // load the controller's module
  beforeEach(window.angular.mock.module('SwaggerEditor'));

  var EditorCtrl,
    scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope) {
    scope = $rootScope.$new();
    EditorCtrl = $controller('EditorCtrl', {
      $scope: scope
    });
  }));

  it('should have a scope', function () {
    expect(!!scope).to.equal(true);
  });
});


text:
local sandbox_lib_detect_find_programver = sandbox_lib_detect_find_programver or {}

-- load modules
local os        = require("base/os")
local path      = require("base/path")
local table     = require("base/table")
local utils     = require("base/utils")
local option    = require("base/option")
local project   = require("project/project")
local sandbox   = require("sandbox/sandbox")
local raise     = require("sandbox/modules/raise")
local cache     = require("sandbox/modules/import/lib/detect/cache")

-- find program version
--
-- @param program   the program
-- @param opt       the options, .e.g {command = "--version", parse = "(%d+%.?%d*%.?%d*.-)%s", verbose = true, force = true, cachekey = "xxx"}
--                    - opt.command   the version command string or script, default: --version
--                    - opt.parse     the version parse script or lua match pattern
--
-- @return          the version string
--
-- @code
-- local version = find_programver("ccache")
-- local version = find_programver("ccache", {command = "-v"})
-- local version = find_programver("ccache", {command = "--version", parse = "(%d+%.?%d*%.?%d*.-)%s"})
-- local version = find_programver("ccache", {command = "--version", parse = function (output) return output:match("(%d+%.?%d*%.?%d*.-)%s") end})
-- local version = find_programver("ccache", {command = function () return os.iorun("ccache --version") end})
-- @endcode
--
function sandbox_lib_detect_find_programver.main(program, opt)

    -- init options
    opt = opt or {}

    -- init cachekey
    local cachekey = "find_programver"
    if opt.cachekey then
        cachekey = cachekey .. "_" .. opt.cachekey
    end

    -- attempt to get result from cache first
    local cacheinfo = cache.load(cachekey)
    local result = cacheinfo[program]
    if result ~= nil and not opt.force then
        return utils.ifelse(result, result, nil)
    end

    -- attempt to get version output info
    local ok = false
    local outdata = nil
    local command = opt.command
    if type(command) == "function" then
        ok, outdata = sandbox.load(command)
        if not ok and outdata and option.get("diagnosis") then
            utils.cprint("${color.warning}checkinfo: ${clear dim}" .. outdata)
        end
    else
        ok, outdata = os.iorunv(program, {command or "--version"})
    end

    -- find version info
    if ok and outdata and #outdata > 0 then
        local parse = opt.parse
        if type(parse) == "function" then
            ok, result = sandbox.load(parse, outdata)
            if not ok and result and option.get("diagnosis") then
                utils.cprint("${color.warning}checkinfo: ${clear dim}" .. result)
                result = nil
            end
        elseif parse == nil or type(parse) == "string" then
            result = outdata:match(parse or "(%d+%.?%d*%.?%d*.-)%s")
            if not result then
                result = outdata:match(parse or "(%d+%.?%d*%.?%d*.-)")
            end
        end
    end

    -- cache result
    cacheinfo[program] = utils.ifelse(result, result, false)

    -- save cache info
    cache.save(cachekey, cacheinfo)

    -- ok?
    return result
end

-- return module
return sandbox_lib_detect_find_programver


text:
package com.google.gapid.perfetto;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.gapid.perfetto.views.StyleConstants.Palette.BaseColor;

import org.eclipse.swt.graphics.RGBA;

import java.util.function.Supplier;

/**
 * Execution state a thread can be in.
 */
public class ThreadState {
  public static final ThreadState DEBUG = new ThreadState(
      "Debug", () -> BaseColor.MAGENTA.rgb, 9);
  public static final ThreadState EXIT_DEAD = new ThreadState(
      "Exit Dead", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState RUNNABLE = new ThreadState(
      "Runnable", () -> BaseColor.PACIFIC_BLUE.rgb, 1);
  public static final ThreadState RUNNING = new ThreadState(
      "Running", () -> BaseColor.GREEN.rgb, 0);
  public static final ThreadState SLEEPING = new ThreadState(
      "Sleeping", () -> BaseColor.GREY.rgb, 5);
  public static final ThreadState STOPPED = new ThreadState(
      "Stopped", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState TASK_DEAD = new ThreadState(
      "Task Dead", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState UNINTR_SLEEP = new ThreadState(
      "Uninterruptible Sleep", () -> BaseColor.MAGENTA.rgb, 6);
  public static final ThreadState UNINTR_SLEEP_WAKE_KILL = new ThreadState(
      "Uninterruptible Sleep | WakeKill", () -> BaseColor.MAGENTA.rgb, 7);
  public static final ThreadState UNINTR_SLEEP_WAKING = new ThreadState(
      "Uninterruptible Sleep | Waking", () -> BaseColor.MAGENTA.rgb, 7);
  public static final ThreadState UNINTR_SLEEP_IO = new ThreadState(
      "Uninterruptible Sleep - Block I/O", () -> BaseColor.ORANGE.rgb, 3);
  public static final ThreadState UNINTR_SLEEP_WAKE_KILL_IO = new ThreadState(
      "Uninterruptible Sleep | WakeKill - Block I/O", () -> BaseColor.ORANGE.rgb, 4);
  public static final ThreadState UNINTR_SLEEP_WAKING_IO = new ThreadState(
      "Uninterruptible Sleep | Waking - Block I/O", () -> BaseColor.ORANGE.rgb, 4);
  public static final ThreadState WAKE_KILL = new ThreadState(
      "Wakekill", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState WAKING = new ThreadState(
      "Waking", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState ZOMBIE = new ThreadState(
      "Zombie", () -> BaseColor.MAGENTA.rgb, 8);
  public static final ThreadState NONE = new ThreadState(
      "", () -> BaseColor.DARK_ORANGE.rgb, 10);

  public final String label;
  public final Supplier<RGBA> color;
  public final int mergePriority;

  private ThreadState(String label, Supplier<RGBA> color, int mergePriority) {
    this.label = checkNotNull(label);
    this.color = color;
    this.mergePriority = mergePriority;
  }

  public ThreadState merge(ThreadState other) {
    return (mergePriority <= other.mergePriority) ? this : other;
  }

  public static ThreadState of(String state) {
    switch (state) {
      case "D":
        return UNINTR_SLEEP;
      case "DK":
        return UNINTR_SLEEP_WAKE_KILL;
      case "DW":
        return UNINTR_SLEEP_WAKING;
      case "K":
        return WAKE_KILL;
      case "r":
        return RUNNING;
      case "R":
      case "R+":
        return RUNNABLE;
      case "S":
        return SLEEPING;
      case "t":
        return DEBUG;
      case "W":
        return WAKING;
      case "X":
        return EXIT_DEAD;
      case "x":
        return TASK_DEAD;
      case "Z":
        return ZOMBIE;
      default:
        return new ThreadState("Unknown (" + state + ")", () -> BaseColor.DARK_ORANGE.rgb, 10);
    }
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    } else if (!(obj instanceof ThreadState)) {
      return false;
    }
    return label.equals(((ThreadState)obj).label);
  }

  @Override
  public int hashCode() {
    return label.hashCode();
  }
}


text:
import {
  describe,
  ddescribe,
  it,
  iit,
  xit,
  xdescribe,
  expect,
  beforeEach,
  el,
  IS_DARTIUM
} from 'angular2/test_lib';

import {ProtoViewBuilder} from 'angular2/src/render/dom/view/proto_view_builder';
import {ASTWithSource, AST} from 'angular2/change_detection';
import {PropertyBindingType, ViewType} from 'angular2/src/render/api';

export function main() {
  function emptyExpr() { return new ASTWithSource(new AST(), 'empty', 'empty'); }

  describe('ProtoViewBuilder', () => {
    var builder;
    beforeEach(() => { builder = new ProtoViewBuilder(el('<div/>'), ViewType.EMBEDDED); });

    describe('verification of properties', () => {

      it('should throw for unknown properties', () => {
        builder.bindElement(el('<div/>')).bindProperty('unknownProperty', emptyExpr());
        expect(() => builder.build())
            .toThrowError(
                `Can't bind to 'unknownProperty' since it isn't a know property of the 'div' element and there are no matching directives with a corresponding property`);
      });

      it('should should allow unknown properties if a directive uses it', () => {
        builder.bindElement(el('<div/>')).bindProperty('unknownProperty', emptyExpr());
        expect(() => builder.build())
            .toThrowError(
                `Can't bind to 'unknownProperty' since it isn't a know property of the 'div' element and there are no matching directives with a corresponding property`);
      });

      it('should allow unknown properties on custom elements', () => {
        var binder = builder.bindElement(el('<some-custom/>'));
        binder.bindProperty('unknownProperty', emptyExpr());
        binder.bindDirective(0).bindProperty('someDirProperty', emptyExpr(), 'unknownProperty');
        expect(() => builder.build()).not.toThrow();
      });

      it('should throw for unkown properties on custom elements if there is an ng component', () => {
        var binder = builder.bindElement(el('<some-custom/>'));
        binder.bindProperty('unknownProperty', emptyExpr());
        binder.setComponentId('someComponent');
        expect(() => builder.build())
            .toThrowError(
                `Can't bind to 'unknownProperty' since it isn't a know property of the 'some-custom' element and there are no matching directives with a corresponding property`);
      });

    });

    describe('property normalization', () => {
      it('should normalize "innerHtml" to "innerHTML"', () => {
        builder.bindElement(el('<div/>')).bindProperty('innerHtml', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].property).toEqual('innerHTML');
      });

      it('should normalize "tabindex" to "tabIndex"', () => {
        builder.bindElement(el('<div/>')).bindProperty('tabindex', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].property).toEqual('tabIndex');
      });

      it('should normalize "readonly" to "readOnly"', () => {
        builder.bindElement(el('<input/>')).bindProperty('readonly', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].property).toEqual('readOnly');
      });

    });

    describe('property binding types', () => {
      it('should detect property names', () => {
        builder.bindElement(el('<div/>')).bindProperty('tabindex', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].type).toEqual(PropertyBindingType.PROPERTY);
      });

      it('should detect attribute names', () => {
        builder.bindElement(el('<div/>')).bindProperty('attr.someName', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].type)
            .toEqual(PropertyBindingType.ATTRIBUTE);
      });

      it('should detect class names', () => {
        builder.bindElement(el('<div/>')).bindProperty('class.someName', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].type).toEqual(PropertyBindingType.CLASS);
      });

      it('should detect style names', () => {
        builder.bindElement(el('<div/>')).bindProperty('style.someName', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].type).toEqual(PropertyBindingType.STYLE);
      });

      it('should detect style units', () => {
        builder.bindElement(el('<div/>')).bindProperty('style.someName.someUnit', emptyExpr());
        var pv = builder.build();
        expect(pv.elementBinders[0].propertyBindings[0].unit).toEqual('someUnit');
      });
    });

  });
}


text:
package com.intellij.tasks.generic;

import com.intellij.tasks.Comment;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskRepository;
import com.intellij.tasks.TaskType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Date;

public class GenericTask extends Task {
  private final String myId;
  private final String myDescription;
  private TaskRepository myRepository;

  public GenericTask(final String id, final String description, final TaskRepository repository) {
    myId = id;
    myDescription = description;
    myRepository = repository;
  }

  @NotNull
  @Override
  public String getId() {
    return myId;
  }

  @NotNull
  @Override
  public String getSummary() {
    return myDescription;
  }

  @Nullable
  @Override
  public String getDescription() {
    return null;
  }

  @NotNull
  @Override
  public Comment[] getComments() {
    return new Comment[0];
  }

  @NotNull
  @Override
  public Icon getIcon() {
    return myRepository.getRepositoryType().getIcon();
  }

  @NotNull
  @Override
  public TaskType getType() {
    return TaskType.OTHER;
  }

  @Nullable
  @Override
  public Date getUpdated() {
    return null;
  }

  @Nullable
  @Override
  public Date getCreated() {
    return null;
  }

  @Override
  public boolean isClosed() {
    return false;
  }

  @Override
  public boolean isIssue() {
    return true;
  }

  @Nullable
  @Override
  public String getIssueUrl() {
    return null;
  }

  @Nullable
  @Override
  public TaskRepository getRepository() {
    return myRepository;
  }
}


text:
import Keyv = require('keyv');
import KeyvMysql = require('@keyv/mysql');

new Keyv('mysql://user:pass@localhost:3306/dbname', { table: 'cache' });

new KeyvMysql('mysql://user:pass@localhost:3306/dbname');
new KeyvMysql({ uri: 'mysql://user:pass@localhost:3306/dbname' });
new KeyvMysql({ table: 'cache' });
new KeyvMysql({ keySize: 100 });

const mysql = new KeyvMysql({ uri: 'mysql://user:pass@localhost:3306/dbname' });
new Keyv({ store: mysql });