text:
(() => {
  Benchmark.Add(new Benchmark(
    'VanillaPopulateThroughApp',
    975.21,
    'third_party/todomvc/vanilla-idb/index.html?open=0',
    [
      new BenchmarkStep(SetupRecreateDB),
      new BenchmarkStep(SetupApp),
      new BenchmarkStep(SetupRenavigate),
      new BenchmarkStep(OpenDatabase),
      new BenchmarkStep(CloseDatabase),
    ]));

  // Configuration.
  const numberOfItemsToAdd = 100;

  async function SetupRecreateDB(iframe) {
    await iframe.contentWindow.todo.storage.deleteDatabase();
    await iframe.contentWindow.todo.storage.open({ populated: false });

    return false;  // Do not count this step in the elapsed time.
  }

  async function SetupApp(iframe) {
    let newTodo = iframe.contentDocument.querySelector('.new-todo');
    let todoList = iframe.contentDocument.querySelector('.todo-list');
    if (!todoList) {
      throw new DOMException('missing .todo-list');
    }
    if (todoList.children.length > 0) {
      throw new DOMException('expected 0 children');
    }

    let numberOfItemsAdded = 0;
    while (todoList.children.length < numberOfItemsToAdd) {
      if (numberOfItemsAdded !== numberOfItemsToAdd &&
          todoList.children.length === numberOfItemsAdded) {
        // Add the next item.
        newTodo.value = `Something to do ${numberOfItemsAdded}`;
        newTodo.dispatchEvent(new Event('change'));
        sendEnterKeypress(newTodo);
        numberOfItemsAdded++;
      }
      // We're either waiting for the item we added in a
      // previous call or waiting for the item we just added.
      await waitForRequestAnimationFrame();
    }

    iframe.contentWindow.todo.storage.closeDatabase();

    return false;  // Do not count this step in the elapsed time.
  }

  async function SetupRenavigate(iframe) {
    await Benchmark.Navigate(
      'third_party/todomvc/vanilla-idb/index.html?open=0',
      async (iframe) => {
        await pageLoaded(iframe);
        await waitForIndexedDBShutdown();
      });

    return false;  // Do not count this step in the elapsed time.
  }

  async function OpenDatabase(iframe) {
    await iframe.contentWindow.todo.storage.open({ populated: false });
  }

  async function CloseDatabase(iframe) {
    iframe.contentWindow.todo.storage.closeDatabase();

    return false;  // Do not count this step in the elapsed time.
  }
})();


text:
<#
	===========================================================================
	 Created with: 	SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.115
	 Created on:   	2016-08-30 18:30
	 Created by:   	 Pär Hultman
	 Organization:
	 Filename:     	Test-CI.psm1
	-------------------------------------------------------------------------
	 Module Name: Test-CI
	===========================================================================
#>

function Write-HelloWorld
{
	Write-Host "Hello World"
	#Comment
}

Export-ModuleMember Write-HelloWorld

redpajama_set_name: RedPajamaGithub


text:
package reactify.group

import reactify.Val
import reactify.reaction.Reactions

case class ValGroup[T](items: List[Val[T]]) extends Val[T] with Group[T, Val[T]] {
  override lazy val reactions: Reactions[T] = new GroupReactions[T, Val[T]](this)

  override def and(that: Val[T]): Val[T] = ValGroup(items ::: List(that))

  override def get: T = items.head.get
}


text:
package io.agrest.runtime.constraints;

import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;

import javax.ws.rs.core.Response.Status;

import io.agrest.AgException;
import io.agrest.EntityConstraint;
import io.agrest.meta.AgAttribute;
import io.agrest.meta.AgEntity;
import io.agrest.meta.AgRelationship;

/**
 * @since 1.6
 */
abstract class EntityConstraintSource {

	private ConcurrentMap<String, EntityConstraint> constraints;

	EntityConstraintSource(ConcurrentMap<String, EntityConstraint> constraints) {
		this.constraints = constraints;
	}

	EntityConstraint getOrCreate(AgEntity<?> entity) {

		EntityConstraint c = constraints.get(entity.getName());

		if (c == null) {

			// even though we are using a concurrent map, use key
			// synchronization on write to avoid double compilation.. after all
			// this is an amortized cost (done only once)

			synchronized (entity) {
				c = constraints.get(entity.getName());
				if (c == null) {
					c = create(entity);
					constraints.put(entity.getName(), c);
				}
			}
		}

		return c;
	}

	protected abstract AnnotationData processAnnotation(Class<?> type);

	private EntityConstraint create(AgEntity<?> entity) {
		AnnotationData ad = processAnnotation(entity.getType());

		if (ad == null) {
			return AllowAllEntityConstraint.instance();
		}

		Set<String> attributes = new HashSet<>();
		Set<String> relationships = new HashSet<>();

		for (String p : ad.properties) {
			AgAttribute a = entity.getAttribute(p);
			if (a != null) {
				attributes.add(p);
				continue;
			}

			AgRelationship r = entity.getRelationship(p);
			if (r != null) {
				relationships.add(p);
				continue;
			}

			throw new AgException(Status.INTERNAL_SERVER_ERROR, "Invalid property: " + entity.getName() + "." + p);

		}

		boolean allowsAllAttributes = attributes.size() == entity.getAttributes().size();
		return new DefaultEntityConstraint(entity.getName(), ad.id, allowsAllAttributes, attributes, relationships);
	}

	class AnnotationData {
		boolean id;
		String[] properties;

		AnnotationData(boolean id, String[] properties) {
			this.id = id;
			this.properties = properties;
		}
	}

}


text:
class QZoneDessin : public QWidget
{
    Q_OBJECT

public:
    QZoneDessin(QWidget * parent);
    void resizeEvent(QResizeEvent * e);
    void paintEvent(QPaintEvent * e);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void clearDessin();
private:
    QImage * m_image;
    int m_actif;
    QPoint *m_position;

signals:
    void draw();

};

#endif


text:
package jeffaschenk.commons.frameworks.cnxidx.resiliency.jgroups;

import java.net.InetAddress;
import java.net.InetSocketAddress;

public class DiscoveryRequest extends DiscoveryPacket {
    InetSocketAddress sender_addr = null;

    DiscoveryRequest(InetAddress addr, int port) {
        sender_addr = new InetSocketAddress(addr, port);
    }

    public String toString() {
        return "DiscoveryRequest [sender_addr=" + sender_addr + ']';
    }

} ///:> End of DiscoveryRequest Class.


text:
$packageName = 'rufus.portable'
$packageVersion = '2.0'
$url = 'http://rufus.akeo.ie/downloads/rufus-2.0p.exe'
$checksum = '9cc2d6c8f169b1652a2744ce5560be35403c28ca'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
try {
  Get-ChocolateyWebFile -PackageName "$packageName" `
                        -FileFullPath "$installFile" `
                        -Url "$url" `
                        -Checksum "$checksum" `
                        -ChecksumType "$checksumType"
  Set-Content -Path ("$installFile.gui") `
              -Value $null

} catch {
  throw $_.Exception
}


text:
from fixture.orm import ORMFixture
import pymysql.cursors
from model.group import Group

db = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")

try:
    l = db.get_contacts_in_group(Group(id="55"))
    for item in l:
        print(item)
    print(len(l))
finally:
    pass # db.destroy()

try:
    l = db.get_contacts_not_in_group(Group(id="55"))
    for item in l:
        print(item)
    print(len(l))
finally:
    pass  # db.destroy()


text:
old_dashw = $-w
$-w = false
require 'gst'
Gst.init if not Gst.respond_to?(:initialized?) or not Gst.initialized?
$-w = old_dashw
CrispCam.require('crispcam/util')

module CrispCam

  # Self-contained GStreamer-based video sink for streaming h.264 video from a Crispcam::CameraSource.
  class Sink
    @pipeline = nil
    @source = nil
    @main_loop = nil
    @thread = nil

    def initialize()
      @main_loop = nil
      @thread = nil

      @pipeline, vars = build_pipeline([ ['udpsrc', :source],
                                         ['capsfilter', { :caps => Gst::Caps.from_string('application/x-rtp, media=(string)video, encoding-name=(string)H264, payload=(int)127') } ],
                                         'rtph264depay',
                                         'avdec_h264',
                                         'autovideosink'
                                       ])
      vars.each_pair { |k, v| instance_variable_set(('@' + k.to_s).intern, v) }
    end

    def run(_port = nil)
      @source.port = _port if not _port.nil?
      run_main
    end
    def stop
      @main_loop.quit if running?
      @main_loop = nil
    end
    def running?
      @thread.alive?
    end

    def start(_port = nil)
      @source.port = _port if not _port.nil?
      @thread = Thread.new { run_main }
    end

    private
    def run_main
      @main_loop = GLib::MainLoop.new

      # Set up the message handler.
      @pipeline.bus.add_watch do |bus, message|
        case message.type
        when Gst::MessageType::EOS
          @main_loop.quit
        when Gst::MessageType::ERROR
          p message.parse_error
          @main_loop.quit
        when Gst::MessageType::INFO
          p message.parse_info
        when Gst::MessageType::WARNING
          p message.parse_warning
        end
        true
      end

      FlyTrap.trap(:INT) { $stderr.puts "Caught interrupt: exiting main loop."; @main_loop.quit }

      # start playing
      @pipeline.play
      begin
        @main_loop.run
      rescue Interrupt
      ensure
        @pipeline.stop
        @main_loop.quit
      end
    end

  end
end


text:
package executor

import (
	"bufio"
	"fmt"
	"io"
	"io/ioutil"
	"regexp"
	"os"
	"os/exec"
	"os/user"
	"path/filepath"
	"runtime"
	"strconv"
	"strings"
	"time"

	"github.com/ocadaruma/go-javactl/logger"
	"github.com/ocadaruma/go-javactl/option"
	"github.com/ocadaruma/go-javactl/setting"
)

type Executor struct {
	Logger *logger.Logger
	Setting *setting.Setting
	Opts *option.JavactlOpts
}

func NewExecutor(log *logger.Logger, sett *setting.Setting, opts *option.JavactlOpts) (result *Executor) {
	result = &Executor{
		Logger: log,
		Setting: sett,
		Opts: opts,
	}

	return
}

func (this *Executor) CheckRequirement() (err error) {
	err = this.checkUser()
	if err != nil { return }

	err = this.checkJavaVersion()

	return
}

func (this *Executor) checkUser() (err error) {
	actual, _ := user.Current()
	expect := this.Setting.OS.User

	if actual.Username != expect {
		err = fmt.Errorf("This application must be run as '%s', but you are '%s'.", expect, actual.Username)
	}
	return
}

func (this *Executor) checkJavaVersion() (err error) {
	var out []byte
	out, err = exec.Command(this.Setting.Java.GetExecutable(), "-version").CombinedOutput()
	if err != nil { return }

	versionString := fmt.Sprintf("%.1f", this.Setting.Java.Version)
	matches := regexp.MustCompile(`java version "(\d+[.]\d+)[.]\d+_\d+"`).FindStringSubmatch(string(out))

	if matches == nil || len(matches) < 2 || versionString != matches[1] {
		err = fmt.Errorf("Unexpected Java version: expect='%s', actual='%s'.", versionString, matches[1])
	}

	return
}

func (this *Executor) CheckDuplicateProcess() (err error) {
	if !this.Setting.App.IsDuplicateAllowed() {
		// check pid file existence
		_, e := os.Stat(this.Setting.App.PidFile)

		if e == nil {
			var content []byte
			content, err = ioutil.ReadFile(this.Setting.App.PidFile)
			if err != nil { return }

			var pid int
			pid, err = strconv.Atoi(string(content))
			if err != nil { return }

			_, err = os.FindProcess(pid)
			if err == nil {
				this.Logger.Info(
					fmt.Sprintf("%s is already running. Skipped: config=%s",
						this.Setting.App.Name, this.Opts.ConfigPath))
				return fmt.Errorf("%s is already running.", this.Setting.App.Name)
			}
		}
	}
	return
}

func (this *Executor) CreateDirectories() (err error) {
	if this.Setting.Log == nil { return }

	log := *this.Setting.Log

	var consoleLogDir string
	if log.ConsoleLog != nil && log.ConsoleLog.Prefix != "" {
		consoleLogDir = filepath.Dir(log.ConsoleLog.Prefix)
	}

	var gcLogDir string
	if log.GCLog != nil && log.GCLog.Prefix != "" {
		gcLogDir = filepath.Dir(log.GCLog.Prefix)
	}

	var dumpPrefix string
	if log.Dump != nil { dumpPrefix = log.Dump.Prefix }

	var errorLogDir string
	if log.ErrorLog != nil && log.ErrorLog.Path != "" {
		errorLogDir = filepath.Dir(log.ErrorLog.Path)
	}

	for _, dir := range []string{consoleLogDir, gcLogDir, dumpPrefix, errorLogDir} {
		if dir != "" {
			if this.Opts.DryRun {
				fmt.Printf("Would create directory: %s\n", dir)
			} else {
				_, statErr := os.Stat(dir)
				if statErr != nil {
					fmt.Printf("Creating directory: %s\n", dir)
					err = os.MkdirAll(dir, 0744)
					if err != nil { return }
				}
			}
		}
	}

	return
}

func (this *Executor) CleanOldLogs(now time.Time) (err error) {
	if log := this.Setting.Log; log != nil {
		// clear console logs
		if console := log.ConsoleLog; console != nil {
			if console.Prefix != "" && console.Preserve > 0 {
				err = this.deleteFiles(console.Prefix, now, console.Preserve)
				if err != nil { return }
			}
		}
		// clear gc logs
		if gc := log.GCLog; gc != nil {
			if gc.Prefix != "" && gc.Preserve > 0 {
				err = this.deleteFiles(gc.Prefix, now, gc.Preserve)
				if err != nil { return }
			}
		}
	}
	return
}

func (this *Executor) deleteFiles(prefix string, now time.Time, preserve int) (err error) {
	var files []string
	files, err = filepath.Glob(prefix + "*")

	if err != nil { return }

	for _, path := range files {
		var fileinfo os.FileInfo
		fileinfo, err = os.Stat(path)
		if err != nil { return }

		mtime := fileinfo.ModTime()
		if mtime.Before(now.Add(-time.Duration(preserve) * 24 * time.Hour)) {
			if this.Opts.DryRun {
				fmt.Printf("Would delete file: %s\n", path)
			} else {
				fmt.Printf("Deleting file: %s\n", path)
				err = os.Remove(path)
				if err != nil { return }
			}
		}
	}

	return
}

func (this *Executor) Execute(now time.Time) error {
	allErrors := []error{}

	var err error
	err = this.executeCommands(this.Setting.PreCommands, now)
	if err != nil { allErrors = append(allErrors, err) }

	if err == nil {
		err = this.executeApplication(now)
		if err != nil { allErrors = append(allErrors, err) }
	}

	err = this.executeCommands(this.Setting.PostCommands, now)
	if err != nil { allErrors = append(allErrors, err) }

	errStrings := []string{}
	for _, e := range allErrors {
		errStrings = append(errStrings, fmt.Sprintf("  - %v", e))
	}

	if len(errStrings) > 0 {
		return fmt.Errorf("Failed to execute. errors: [\n%s\n]\n", strings.Join(errStrings, "\n"))
	} else {
		return nil
	}
}

func (this *Executor) executeApplication(now time.Time) (err error) {
	this.Logger.Info(
		fmt.Sprintf("%s started: config=%s, args=%s",
			this.Setting.App.Name, this.Opts.ConfigPath, this.Opts.ExtraArgs))

	startTime := time.Now()
	if this.Opts.DryRun {
		var args, env []string
		indentation := "  "
		for _, arg := range this.Setting.GetArgs(this.Opts.ExtraArgs, now) {
			args = append(args, indentation + arg)
		}
		for _, e := range this.Setting.GetEnviron(now) {
			env = append(env, indentation + e)
		}
		var output string
		if this.Setting.Log != nil && this.Setting.Log.ConsoleLog != nil {
			output = this.Setting.Log.ConsoleLog.GetPath(now)
		} else {
			output = "stdout"
		}
		fmt.Printf("Would execute: cwd=%s, cmd=[\n%s\n], env={\n%s\n}, output=%s\n",
			this.Setting.App.Home,
			strings.Join(args, "\n"),
			strings.Join(env, "\n"),
			output)
	} else {
		var stdout, stderr io.Writer
		if this.Setting.Log != nil && this.Setting.Log.ConsoleLog != nil {
			outpath := this.Setting.Log.ConsoleLog.GetPath(now)
			var maxBytes int64
			if this.Setting.Log.ConsoleLog.MaxSize != nil {
				maxBytes = this.Setting.Log.ConsoleLog.MaxSize.Bytes()
			}
			out := logger.NewConsoleLogger(outpath, maxBytes, this.Setting.Log.ConsoleLog.Backup)
			defer out.Close()
			stdout = out
			stderr = out
		} else {
			stdout = os.Stdout
			stderr = os.Stderr
		}
		env := make(map[string]string)
		for k, v := range osEnviron() {
			env[k] = v
		}
		for k, v := range this.Setting.GetEnviron(now) {
			env[k] = v
		}
		args := subprocessArgs{
			shell: false,
			args: this.Setting.GetArgs(this.Opts.ExtraArgs, now),
			cwd: this.Setting.App.Home,
			pidFile: this.Setting.App.PidFile,
			env: env,
			stdin: os.Stdin,
			stdout: stdout,
			stderr: stderr,
		}
		err = callSubprocess(&args)
	}
	elapsed := time.Now().Sub(startTime)

	if err != nil {
		this.Logger.Error(
			fmt.Sprintf("%s ended with error: error=%v, elapsed=%fs",
				this.Setting.App.Name, err, elapsed.Seconds()))
	} else {
		this.Logger.Info(
			fmt.Sprintf("%s ended successfully: elapsed=%fs",
				this.Setting.App.Name, elapsed.Seconds()))
	}

	return
}

// execute commands sequentially.
// attempt to execute all commands even if some command fails.
func (this *Executor) executeCommands(commands []string, now time.Time) error {
	allErrors := []error{}

	for _, cmd := range commands {
		if this.Opts.DryRun {
			fmt.Printf("Would execute: %s\n", cmd)
		} else {
			args := subprocessArgs{
				shell: true,
				args: []string{cmd},
				cwd: this.Setting.App.Home,
				env: this.Setting.GetEnviron(now),
			}
			err := callSubprocess(&args)

			if err != nil {
				this.Logger.Error(fmt.Sprintf("Failed to execute: app=%s, cmd=%s, error: %v",
					this.Setting.App.Name, cmd, err))
				allErrors = append(allErrors, err)
			}
		}
	}

	if len(allErrors) > 0 {
		return fmt.Errorf("some commands failed. %v", allErrors)
	} else {
		return nil
	}
}

type subprocessArgs struct {
	shell bool
	args []string
	cwd string
	pidFile string
	env map[string]string
	stdin io.Reader
	stdout io.Writer
	stderr io.Writer
}

func callSubprocess(args *subprocessArgs) (err error) {
	var wd string
	wd, err = os.Getwd()
	if err != nil { return }

	defer os.Chdir(wd)

	// if cwd is specified, exec command in cwd.
	if args.cwd != "" {
		err = os.Chdir(args.cwd)
		if err != nil { return }
	}

	var cmd *exec.Cmd
	if args.shell {
		osname := runtime.GOOS
		if osname == "windows" {
			shell := os.Getenv("COMSPEC")
			cmd = exec.Command(shell, append([]string{"/c"}, args.args...)...)
		} else {
			shell := os.Getenv("SHELL")
			cmd = exec.Command(shell, append([]string{"-c"}, args.args...)...)
		}
	} else {
		if len(args.args) < 1 {
			err = fmt.Errorf("args must not be empty. args: %v", args.args)
			return
		}
		cmd = exec.Command(args.args[0], args.args[1:]...)
	}

	var envPairs []string
	for key, value := range args.env {
		envPairs = append(envPairs, fmt.Sprintf("%s=%s", key, value))
	}
	if len(envPairs) > 0 { cmd.Env = envPairs }

	if args.stdout == nil {
		cmd.Stdout = os.Stdout
	} else {
		var reader io.ReadCloser
		reader, err = cmd.StdoutPipe()
		if err != nil { return }

		go func() {
			scanner := bufio.NewScanner(reader)
			for scanner.Scan() { args.stdout.Write([]byte(scanner.Text())) }
			reader.Close()
		}()
	}

	if args.stderr == nil {
		cmd.Stderr = os.Stderr
	} else {
		var reader io.ReadCloser
		reader, err = cmd.StderrPipe()
		if err != nil { return }

		go func() {
			scanner := bufio.NewScanner(reader)
			for scanner.Scan() { args.stderr.Write([]byte(scanner.Text())) }
			reader.Close()
		}()
	}

	if args.stdin != nil { cmd.Stdin = args.stdin }

	if args.pidFile == "" {
		err = cmd.Run()
	} else {
		err = cmd.Start()
		if err != nil { return }

		pid := cmd.Process.Pid
		defer os.Remove(args.pidFile)

		err = ioutil.WriteFile(args.pidFile, []byte(strconv.Itoa(pid)), 0644)
		if err != nil { return }

		err = cmd.Wait()
	}

	return
}

func osEnviron() map[string]string {
	items := make(map[string]string)
	entries := os.Environ()

	for _, entry := range entries {
		split := strings.SplitN(entry, "=", 2)
		items[split[0]] = split[1]
	}

	return items
}


text:
namespace Microsoft.Azure.Management.Security
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for SubAssessmentsOperations.
    /// </summary>
    public static partial class SubAssessmentsOperationsExtensions
    {
            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a
            /// subscription scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            public static IPage<SecuritySubAssessment> ListAll(this ISubAssessmentsOperations operations, string scope)
            {
                return operations.ListAllAsync(scope).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a
            /// subscription scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<SecuritySubAssessment>> ListAllAsync(this ISubAssessmentsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListAllWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            /// <param name='assessmentName'>
            /// The Assessment Key - Unique key for the assessment type
            /// </param>
            public static IPage<SecuritySubAssessment> List(this ISubAssessmentsOperations operations, string scope, string assessmentName)
            {
                return operations.ListAsync(scope, assessmentName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            /// <param name='assessmentName'>
            /// The Assessment Key - Unique key for the assessment type
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<SecuritySubAssessment>> ListAsync(this ISubAssessmentsOperations operations, string scope, string assessmentName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(scope, assessmentName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Get a security sub-assessment on your scanned resource
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            /// <param name='assessmentName'>
            /// The Assessment Key - Unique key for the assessment type
            /// </param>
            /// <param name='subAssessmentName'>
            /// The Sub-Assessment Key - Unique key for the sub-assessment type
            /// </param>
            public static SecuritySubAssessment Get(this ISubAssessmentsOperations operations, string scope, string assessmentName, string subAssessmentName)
            {
                return operations.GetAsync(scope, assessmentName, subAssessmentName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get a security sub-assessment on your scanned resource
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='scope'>
            /// Scope of the query, can be subscription
            /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
            /// (/providers/Microsoft.Management/managementGroups/mgName).
            /// </param>
            /// <param name='assessmentName'>
            /// The Assessment Key - Unique key for the assessment type
            /// </param>
            /// <param name='subAssessmentName'>
            /// The Sub-Assessment Key - Unique key for the sub-assessment type
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<SecuritySubAssessment> GetAsync(this ISubAssessmentsOperations operations, string scope, string assessmentName, string subAssessmentName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(scope, assessmentName, subAssessmentName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a
            /// subscription scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<SecuritySubAssessment> ListAllNext(this ISubAssessmentsOperations operations, string nextPageLink)
            {
                return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a
            /// subscription scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<SecuritySubAssessment>> ListAllNextAsync(this ISubAssessmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<SecuritySubAssessment> ListNext(this ISubAssessmentsOperations operations, string nextPageLink)
            {
                return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Get security sub-assessments on all your scanned resources inside a scope
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<SecuritySubAssessment>> ListNextAsync(this ISubAssessmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using Pentia.Views;
using System.ComponentModel;
using System.Windows.Threading;
using System.Windows.Input;
using Pentia.Models;
using Pentia.Utilities;

namespace Pentia.Controllers {
    public interface IGameController {
        void Initialize(GamePage page);
        void Terminate();
        bool Start();
        bool Stop();
        void OnTick(object sender, EventArgs e);
    }

    public interface IUpdatable {
        void Update();
        void Reset();
    }

    public class GameController : IGameController, IUpdatable, INotifyPropertyChanged {
        private static GameController instance = new GameController();
        public static GameController GetInstance() { return GameController.instance; }
        private GameController() {;}

        private GamePage page;

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string name) {
            if (PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }
        }

        private DispatcherTimer timer;

        private Board board;
        public Board Board { get { return board; } }
        private Recorder recorder;
        public Recorder Recorder { get {return recorder;} }

        private Binding initBinding(Binding binding, object souce, string property,
            string format = null, BindingMode bindingMode = BindingMode.TwoWay) {
            binding.Source = souce;
            binding.Path = new PropertyPath(property);
            if (format != null) { binding.StringFormat = format; }
            binding.Mode = bindingMode;
            return binding;
        }

        private void setResources() {
            if (ImageLoader.IsRegistered("Cells") == false) {
                ImageLoader.AddImage("Cells", new Uri(Properties.Resources.Cells, UriKind.Relative));
            }

            if (AudioPlayer.IsRegistered("Pause") == false) {
                AudioPlayer.AddSource("Pause", new Uri(Properties.Resources.Pause, UriKind.Relative));
            }
            if (AudioPlayer.IsRegistered("Restart") == false) {
                AudioPlayer.AddSource("Restart", new Uri(Properties.Resources.Restart, UriKind.Relative));
            }
            if (AudioPlayer.IsRegistered("GameOver") == false) {
                AudioPlayer.AddSource("GameOver", new Uri(Properties.Resources.GameOver, UriKind.Relative));
            }
            if (AudioPlayer.IsRegistered("DeleteRows") == false) {
                AudioPlayer.AddSource("DeleteRows", new Uri(Properties.Resources.DeleteRows, UriKind.Relative));
            }
            if (AudioPlayer.IsRegistered("BGM") == false) {
                AudioPlayer.AddSource("BGM", new Uri(Properties.Resources.BGM, UriKind.Relative));
            }
        }

        private void releaseResources() {
            ImageLoader.RemoveImage("Cells");

            AudioPlayer.RemoveSource("Pause");
            AudioPlayer.RemoveSource("Restart");
            AudioPlayer.RemoveSource("GameOver");
            AudioPlayer.RemoveSource("DeleteRows");
            AudioPlayer.RemoveSource("BGM");
        }

        private void setBinding() {
            var binding = initBinding(new Binding(), recorder, "Score", "{0, 8}", BindingMode.OneWay);
            page.tbScore.SetBinding(TextBlock.TextProperty, binding);

            binding = initBinding(new Binding(), recorder, "Level", "{0, 8}", BindingMode.OneWay);
            page.tbLevel.SetBinding(TextBlock.TextProperty, binding);

            binding = initBinding(new Binding(), recorder, "Lines", "{0, 8}", BindingMode.OneWay);
            page.tbLines.SetBinding(TextBlock.TextProperty, binding);
        }

        public void Initialize(GamePage page) {
            this.page = page;

            setResources();

            this.timer = new DispatcherTimer();
            timer.Tick += this.OnTick;
            timer.Interval = new TimeSpan(days: 0, hours: 0, minutes: 0, seconds: 1, milliseconds: 0);

            this.page.MainWnd.KeyDown += this.OnKeyDown;

            // Generate model objects
            var field = new Field(this.page.cvField, cols:12, rows:24,
                yOffset: Piece.PC_SIZE / 2, wallThickness: Piece.PC_SIZE / 2, dispWallThickness: 1);
            var nextField = new Field(this.page.cvNextField, cols: Piece.PC_SIZE, rows: Piece.PC_SIZE);
            board = new Board(field, nextField);

            recorder = new Recorder();

            setBinding();

            this.Reset();
        }

        public void Terminate() {
            this.Stop();
            releaseResources();
            this.page.MainWnd.KeyDown -= this.OnKeyDown;
            this.board = null;
            this.recorder = null;
        }

        public bool Start() {
            if (timer.IsEnabled == false) {
                timer.Start();
                if (page.IsBgmOn) { AudioPlayer.Play("BGM"); }
                return true;
            }
            return false;
        }

        public bool Stop() {
            if (timer.IsEnabled) {
                timer.Stop();
                if (page.IsBgmOn) { AudioPlayer.Stop("BGM"); }
                return true;
            }
            return false;
        }

        public void OnTick(object sender, EventArgs e) {
            this.Update();
        }

        public void OnKeyDown(object sender, KeyEventArgs e) {
            if (board.IsGameOver == false && (e.Key == Key.P || e.Key == Key.Q)) {
                if (this.Stop()) {
                    if (page.IsSoundOn) { AudioPlayer.Play("Pause", 1); }
                } else {
                    if (page.IsSoundOn) { AudioPlayer.Play("Restart", 1); }
                    this.Start();
                }
            }

            if (timer.IsEnabled == false) { return; }

            switch (e.Key) {
                case Key.J: case Key.S: board.MovePiece(Direction.Left); break;
                case Key.L: case Key.F: board.MovePiece(Direction.Right); break;
                case Key.N: case Key.V: board.MovePiece(Direction.Down); break;
                case Key.K: case Key.D: board.RotatePiece(RtDirection.Clockwise); break;
                case Key.I: case Key.E: board.RotatePiece(RtDirection.CtrClockwise); break;
            }
        }

        public void Update() {
            board.Update();

            if (0 < board.DeletedRowNum) {
                recorder.Update(board.DeletedRowNum);
                this.timer.Interval = recorder.TickInterval;

                if (page.IsSoundOn) { AudioPlayer.Play("DeleteRows", board.DeletedRowNum); }
            }

            if (board.IsGameOver) {
                if (page.IsSoundOn) { AudioPlayer.Play("GameOver", 1); }
                this.Stop();
                showGameOver();
                if (recorder.IsNewRecord) { showNameInput(); }
            }
        }

        public void Reset() {
            this.Stop();
            board.Reset();
            recorder.Reset();
            hideNameInput();
            hideGameOver();
        }

        private void showNameInput() {
            page.spNameInput.Visibility = Visibility.Visible;
        }

        private void hideNameInput() {
            page.spNameInput.Visibility = Visibility.Hidden;
        }

        private void showGameOver() {
            page.tbGameOver.Visibility = Visibility.Visible;
        }

        private void hideGameOver() {
            page.tbGameOver.Visibility = Visibility.Hidden;
        }
    }
}


text:
using System;
using System.Linq;
using System.Reflection;
using Xunit;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Code;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;

namespace BenchmarkDotNet.Tests
{
    public class CodeGeneratorTests
    {
        [Fact]
        public void AsyncVoidIsNotSupported()
        {
            var asyncVoidMethod =
                typeof(CodeGeneratorTests)
                    .GetTypeInfo()
                    .GetMethods()
                    .Single(method => method.Name == "AsyncVoidMethod");

            var target = new Target(typeof(CodeGeneratorTests), asyncVoidMethod);
            var benchmark = new Benchmark(target, Job.Default, null);

            Assert.Throws<NotSupportedException>(() => CodeGenerator.Generate(benchmark));
        }

#pragma warning disable CS1998

        [Benchmark]
        public async void AsyncVoidMethod() { }
    }
}


text:
class Device < ActiveRecord::Base
  validates :system, :registration_id, presence: true, length: { minimum: 4 }
  before_create :ensure_have_unique_uid

  def ensure_have_unique_uid
    while true
      self.uid = SecureRandom.hex
      break if Device.where(uid: self.uid).size == 0
    end
  end
end


text:
namespace CS410Project
{
    partial class MainWindow
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
            this.RemoteDirectory = new System.Windows.Forms.ListBox();
            this.RemoteParentButton = new System.Windows.Forms.Button();
            this.PutFileButton = new System.Windows.Forms.Button();
            this.CreateRemoteDirButton = new System.Windows.Forms.Button();
            this.RemoteDeleteFileButton = new System.Windows.Forms.Button();
            this.RemoteRenameFileButton = new System.Windows.Forms.Button();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
            this.LocalDirectory = new System.Windows.Forms.ListBox();
            this.GetFile = new System.Windows.Forms.Button();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.logOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.changeFontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.changeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.githubReadmeOpensWebBrowserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fontWindow = new System.Windows.Forms.FontDialog();
            this.RemoteLabel = new System.Windows.Forms.Label();
            this.RemoteTree = new System.Windows.Forms.ListBox();
            this.LocalTree = new System.Windows.Forms.ListBox();
            this.DiffButton = new System.Windows.Forms.Button();
            this.LocalLabel = new System.Windows.Forms.Label();
            this.RemoteNewFileButton = new System.Windows.Forms.Button();
            this.LocalParentDirectoryButton = new System.Windows.Forms.Button();
            this.LocalNewFileButton = new System.Windows.Forms.Button();
            this.LocalRenameFileButton = new System.Windows.Forms.Button();
            this.CreateLocalDirButton = new System.Windows.Forms.Button();
            this.backWorkProgBar = new System.ComponentModel.BackgroundWorker();
            this.progressBar = new System.Windows.Forms.ProgressBar();
            this.lblStatus = new System.Windows.Forms.Label();
            this.LocalSearchBox = new System.Windows.Forms.TextBox();
            this.LocalSearchButton = new System.Windows.Forms.Button();
            this.backWorkGetProg = new System.ComponentModel.BackgroundWorker();
            this.RemoteSearchBox = new System.Windows.Forms.TextBox();
            this.RemoteSearchButton = new System.Windows.Forms.Button();
            this.hideLogInWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // RemoteDirectory
            //
            this.RemoteDirectory.FormattingEnabled = true;
            this.RemoteDirectory.Location = new System.Drawing.Point(138, 70);
            this.RemoteDirectory.Name = "RemoteDirectory";
            this.RemoteDirectory.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
            this.RemoteDirectory.Size = new System.Drawing.Size(544, 134);
            this.RemoteDirectory.TabIndex = 5;
            this.RemoteDirectory.DoubleClick += new System.EventHandler(this.RemoteDirectory_DoubleClick);
            //
            // RemoteParentButton
            //
            this.RemoteParentButton.Location = new System.Drawing.Point(138, 41);
            this.RemoteParentButton.Name = "RemoteParentButton";
            this.RemoteParentButton.Size = new System.Drawing.Size(92, 23);
            this.RemoteParentButton.TabIndex = 6;
            this.RemoteParentButton.Text = "Parent Directory";
            this.RemoteParentButton.UseVisualStyleBackColor = true;
            this.RemoteParentButton.Click += new System.EventHandler(this.ParentButton_Click);
            //
            // PutFileButton
            //
            this.PutFileButton.Location = new System.Drawing.Point(302, 207);
            this.PutFileButton.Name = "PutFileButton";
            this.PutFileButton.Size = new System.Drawing.Size(75, 23);
            this.PutFileButton.TabIndex = 13;
            this.PutFileButton.Text = "Put File ↑";
            this.PutFileButton.UseVisualStyleBackColor = true;
            this.PutFileButton.Click += new System.EventHandler(this.PutFile_Click);
            //
            // CreateRemoteDirButton
            //
            this.CreateRemoteDirButton.Location = new System.Drawing.Point(398, 41);
            this.CreateRemoteDirButton.Name = "CreateRemoteDirButton";
            this.CreateRemoteDirButton.Size = new System.Drawing.Size(106, 23);
            this.CreateRemoteDirButton.TabIndex = 15;
            this.CreateRemoteDirButton.Text = "Create Remote Dir";
            this.CreateRemoteDirButton.UseVisualStyleBackColor = true;
            this.CreateRemoteDirButton.Click += new System.EventHandler(this.CreateRemoteDir_Click);
            //
            // RemoteDeleteFileButton
            //
            this.RemoteDeleteFileButton.Location = new System.Drawing.Point(383, 207);
            this.RemoteDeleteFileButton.Name = "RemoteDeleteFileButton";
            this.RemoteDeleteFileButton.Size = new System.Drawing.Size(75, 23);
            this.RemoteDeleteFileButton.TabIndex = 17;
            this.RemoteDeleteFileButton.TabStop = false;
            this.RemoteDeleteFileButton.Text = "Delete File X";
            this.RemoteDeleteFileButton.UseVisualStyleBackColor = true;
            this.RemoteDeleteFileButton.Click += new System.EventHandler(this.DeleteFile_Click);
            //
            // RemoteRenameFileButton
            //
            this.RemoteRenameFileButton.Location = new System.Drawing.Point(317, 41);
            this.RemoteRenameFileButton.Name = "RemoteRenameFileButton";
            this.RemoteRenameFileButton.Size = new System.Drawing.Size(75, 23);
            this.RemoteRenameFileButton.TabIndex = 18;
            this.RemoteRenameFileButton.Text = "Rename File";
            this.RemoteRenameFileButton.UseVisualStyleBackColor = true;
            this.RemoteRenameFileButton.Click += new System.EventHandler(this.RenameFile_Click);
            //
            // openFileDialog1
            //
            this.openFileDialog1.FileName = "openFileDialog1";
            //
            // LocalDirectory
            //
            this.LocalDirectory.FormattingEnabled = true;
            this.LocalDirectory.Location = new System.Drawing.Point(138, 236);
            this.LocalDirectory.Name = "LocalDirectory";
            this.LocalDirectory.Size = new System.Drawing.Size(544, 134);
            this.LocalDirectory.TabIndex = 24;
            this.LocalDirectory.DoubleClick += new System.EventHandler(this.LocalDirectory_DoubleClick);
            //
            // GetFile
            //
            this.GetFile.Location = new System.Drawing.Point(219, 207);
            this.GetFile.Name = "GetFile";
            this.GetFile.Size = new System.Drawing.Size(77, 23);
            this.GetFile.TabIndex = 7;
            this.GetFile.Text = "Get File ↓ ";
            this.GetFile.UseVisualStyleBackColor = true;
            this.GetFile.Click += new System.EventHandler(this.getFile_Click);
            //
            // menuStrip1
            //
            this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem,
            this.editToolStripMenuItem,
            this.viewToolStripMenuItem,
            this.helpToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(843, 24);
            this.menuStrip1.TabIndex = 26;
            this.menuStrip1.Text = "menuStrip1";
            //
            // fileToolStripMenuItem
            //
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.logOutToolStripMenuItem,
            this.exitToolStripMenuItem});
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
            this.fileToolStripMenuItem.Text = "File";
            //
            // logOutToolStripMenuItem
            //
            this.logOutToolStripMenuItem.Name = "logOutToolStripMenuItem";
            this.logOutToolStripMenuItem.Size = new System.Drawing.Size(115, 22);
            this.logOutToolStripMenuItem.Text = "Log out";
            this.logOutToolStripMenuItem.Click += new System.EventHandler(this.logOutToolStripMenuItem_Click);
            //
            // exitToolStripMenuItem
            //
            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.Size = new System.Drawing.Size(115, 22);
            this.exitToolStripMenuItem.Text = "Exit";
            this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
            //
            // editToolStripMenuItem
            //
            this.editToolStripMenuItem.Name = "editToolStripMenuItem";
            this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
            this.editToolStripMenuItem.Text = "Edit";
            //
            // viewToolStripMenuItem
            //
            this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.changeFontToolStripMenuItem,
            this.changeColorToolStripMenuItem,
            this.hideLogInWindowToolStripMenuItem});
            this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
            this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
            this.viewToolStripMenuItem.Text = "View";
            //
            // changeFontToolStripMenuItem
            //
            this.changeFontToolStripMenuItem.Name = "changeFontToolStripMenuItem";
            this.changeFontToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
            this.changeFontToolStripMenuItem.Text = "Change Font";
            this.changeFontToolStripMenuItem.Click += new System.EventHandler(this.changeFontToolStripMenuItem_Click);
            //
            // changeColorToolStripMenuItem
            //
            this.changeColorToolStripMenuItem.Name = "changeColorToolStripMenuItem";
            this.changeColorToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
            this.changeColorToolStripMenuItem.Text = "Change Color";
            this.changeColorToolStripMenuItem.Click += new System.EventHandler(this.changeColorToolStripMenuItem_Click);
            //
            // helpToolStripMenuItem
            //
            this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.aboutToolStripMenuItem,
            this.githubReadmeOpensWebBrowserToolStripMenuItem});
            this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
            this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
            this.helpToolStripMenuItem.Text = "Help";
            //
            // aboutToolStripMenuItem
            //
            this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(273, 22);
            this.aboutToolStripMenuItem.Text = "About";
            this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
            //
            // githubReadmeOpensWebBrowserToolStripMenuItem
            //
            this.githubReadmeOpensWebBrowserToolStripMenuItem.Name = "githubReadmeOpensWebBrowserToolStripMenuItem";
            this.githubReadmeOpensWebBrowserToolStripMenuItem.Size = new System.Drawing.Size(273, 22);
            this.githubReadmeOpensWebBrowserToolStripMenuItem.Text = "Github Readme (Opens Web Browser)";
            this.githubReadmeOpensWebBrowserToolStripMenuItem.Click += new System.EventHandler(this.githubReadmeOpensWebBrowserToolStripMenuItem_Click);
            //
            // RemoteLabel
            //
            this.RemoteLabel.AutoSize = true;
            this.RemoteLabel.Location = new System.Drawing.Point(12, 41);
            this.RemoteLabel.Name = "RemoteLabel";
            this.RemoteLabel.Size = new System.Drawing.Size(44, 13);
            this.RemoteLabel.TabIndex = 27;
            this.RemoteLabel.Text = "Remote";
            //
            // RemoteTree
            //
            this.RemoteTree.FormattingEnabled = true;
            this.RemoteTree.Location = new System.Drawing.Point(0, 70);
            this.RemoteTree.Name = "RemoteTree";
            this.RemoteTree.Size = new System.Drawing.Size(132, 134);
            this.RemoteTree.TabIndex = 28;
            //
            // LocalTree
            //
            this.LocalTree.FormattingEnabled = true;
            this.LocalTree.Location = new System.Drawing.Point(0, 236);
            this.LocalTree.Name = "LocalTree";
            this.LocalTree.Size = new System.Drawing.Size(132, 134);
            this.LocalTree.TabIndex = 29;
            //
            // DiffButton
            //
            this.DiffButton.Location = new System.Drawing.Point(138, 207);
            this.DiffButton.Name = "DiffButton";
            this.DiffButton.Size = new System.Drawing.Size(75, 23);
            this.DiffButton.TabIndex = 30;
            this.DiffButton.Text = "Diff";
            this.DiffButton.UseVisualStyleBackColor = true;
            //
            // LocalLabel
            //
            this.LocalLabel.AutoSize = true;
            this.LocalLabel.Location = new System.Drawing.Point(12, 212);
            this.LocalLabel.Name = "LocalLabel";
            this.LocalLabel.Size = new System.Drawing.Size(33, 13);
            this.LocalLabel.TabIndex = 31;
            this.LocalLabel.Text = "Local";
            //
            // RemoteNewFileButton
            //
            this.RemoteNewFileButton.Location = new System.Drawing.Point(236, 41);
            this.RemoteNewFileButton.Name = "RemoteNewFileButton";
            this.RemoteNewFileButton.Size = new System.Drawing.Size(75, 23);
            this.RemoteNewFileButton.TabIndex = 32;
            this.RemoteNewFileButton.Text = "New File";
            this.RemoteNewFileButton.UseVisualStyleBackColor = true;
            this.RemoteNewFileButton.Click += new System.EventHandler(this.RemoteNewFile_Click);
            //
            // LocalParentDirectoryButton
            //
            this.LocalParentDirectoryButton.Location = new System.Drawing.Point(138, 376);
            this.LocalParentDirectoryButton.Name = "LocalParentDirectoryButton";
            this.LocalParentDirectoryButton.Size = new System.Drawing.Size(92, 23);
            this.LocalParentDirectoryButton.TabIndex = 33;
            this.LocalParentDirectoryButton.Text = "Parent Directory";
            this.LocalParentDirectoryButton.UseVisualStyleBackColor = true;
            this.LocalParentDirectoryButton.Click += new System.EventHandler(this.LocalParentDirectory_Click);
            //
            // LocalNewFileButton
            //
            this.LocalNewFileButton.Location = new System.Drawing.Point(236, 376);
            this.LocalNewFileButton.Name = "LocalNewFileButton";
            this.LocalNewFileButton.Size = new System.Drawing.Size(75, 23);
            this.LocalNewFileButton.TabIndex = 34;
            this.LocalNewFileButton.Text = "New File";
            this.LocalNewFileButton.UseVisualStyleBackColor = true;
            //
            // LocalRenameFileButton
            //
            this.LocalRenameFileButton.Location = new System.Drawing.Point(317, 376);
            this.LocalRenameFileButton.Name = "LocalRenameFileButton";
            this.LocalRenameFileButton.Size = new System.Drawing.Size(75, 23);
            this.LocalRenameFileButton.TabIndex = 35;
            this.LocalRenameFileButton.Text = "Rename File";
            this.LocalRenameFileButton.UseVisualStyleBackColor = true;
            this.LocalRenameFileButton.Click += new System.EventHandler(this.LocalRenameFileButton_Click);
            //
            // CreateLocalDirButton
            //
            this.CreateLocalDirButton.Location = new System.Drawing.Point(398, 376);
            this.CreateLocalDirButton.Name = "CreateLocalDirButton";
            this.CreateLocalDirButton.Size = new System.Drawing.Size(106, 23);
            this.CreateLocalDirButton.TabIndex = 36;
            this.CreateLocalDirButton.Text = "Create Local Dir";
            this.CreateLocalDirButton.UseVisualStyleBackColor = true;
            this.CreateLocalDirButton.Click += new System.EventHandler(this.CreateLocalDir_Click);
            //
            // backWorkProgBar
            //
            this.backWorkProgBar.WorkerReportsProgress = true;
            this.backWorkProgBar.WorkerSupportsCancellation = true;
            this.backWorkProgBar.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
            this.backWorkProgBar.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
            this.backWorkProgBar.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
            //
            // progressBar
            //
            this.progressBar.Location = new System.Drawing.Point(464, 207);
            this.progressBar.Name = "progressBar";
            this.progressBar.Size = new System.Drawing.Size(186, 23);
            this.progressBar.TabIndex = 37;
            //
            // lblStatus
            //
            this.lblStatus.AutoSize = true;
            this.lblStatus.Location = new System.Drawing.Point(655, 211);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new System.Drawing.Size(21, 13);
            this.lblStatus.TabIndex = 38;
            this.lblStatus.Text = "0%";
            //
            // LocalSearchBox
            //
            this.LocalSearchBox.Location = new System.Drawing.Point(510, 379);
            this.LocalSearchBox.Name = "LocalSearchBox";
            this.LocalSearchBox.Size = new System.Drawing.Size(172, 20);
            this.LocalSearchBox.TabIndex = 39;
            //
            // LocalSearchButton
            //
            this.LocalSearchButton.Location = new System.Drawing.Point(688, 379);
            this.LocalSearchButton.Name = "LocalSearchButton";
            this.LocalSearchButton.Size = new System.Drawing.Size(75, 23);
            this.LocalSearchButton.TabIndex = 40;
            this.LocalSearchButton.Text = "Search";
            this.LocalSearchButton.UseVisualStyleBackColor = true;
            this.LocalSearchButton.Click += new System.EventHandler(this.LocalSearchButton_Click);
            //
            // backWorkGetProg
            //
            this.backWorkGetProg.WorkerReportsProgress = true;
            this.backWorkGetProg.WorkerSupportsCancellation = true;
            this.backWorkGetProg.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backWorkGetProg_DoWork);
            this.backWorkGetProg.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
            this.backWorkGetProg.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
            //
            // RemoteSearchBox
            //
            this.RemoteSearchBox.Location = new System.Drawing.Point(511, 43);
            this.RemoteSearchBox.Name = "RemoteSearchBox";
            this.RemoteSearchBox.Size = new System.Drawing.Size(171, 20);
            this.RemoteSearchBox.TabIndex = 41;
            //
            // RemoteSearchButton
            //
            this.RemoteSearchButton.Location = new System.Drawing.Point(688, 43);
            this.RemoteSearchButton.Name = "RemoteSearchButton";
            this.RemoteSearchButton.Size = new System.Drawing.Size(75, 23);
            this.RemoteSearchButton.TabIndex = 42;
            this.RemoteSearchButton.Text = "Search";
            this.RemoteSearchButton.UseVisualStyleBackColor = true;
            this.RemoteSearchButton.Click += new System.EventHandler(this.RemoteSearchButton_Click);
            //
            // hideLogInWindowToolStripMenuItem
            //
            this.hideLogInWindowToolStripMenuItem.Name = "hideLogInWindowToolStripMenuItem";
            this.hideLogInWindowToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
            this.hideLogInWindowToolStripMenuItem.Text = "Hide/Show Log In Window";
            this.hideLogInWindowToolStripMenuItem.Click += new System.EventHandler(this.hideLogInWindowToolStripMenuItem_Click);
            //
            // MainWindow
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(843, 406);
            this.Controls.Add(this.RemoteSearchButton);
            this.Controls.Add(this.RemoteSearchBox);
            this.Controls.Add(this.LocalSearchButton);
            this.Controls.Add(this.LocalSearchBox);
            this.Controls.Add(this.lblStatus);
            this.Controls.Add(this.progressBar);
            this.Controls.Add(this.CreateLocalDirButton);
            this.Controls.Add(this.LocalRenameFileButton);
            this.Controls.Add(this.LocalNewFileButton);
            this.Controls.Add(this.LocalParentDirectoryButton);
            this.Controls.Add(this.RemoteNewFileButton);
            this.Controls.Add(this.LocalLabel);
            this.Controls.Add(this.DiffButton);
            this.Controls.Add(this.LocalTree);
            this.Controls.Add(this.RemoteTree);
            this.Controls.Add(this.RemoteLabel);
            this.Controls.Add(this.LocalDirectory);
            this.Controls.Add(this.RemoteRenameFileButton);
            this.Controls.Add(this.RemoteDeleteFileButton);
            this.Controls.Add(this.CreateRemoteDirButton);
            this.Controls.Add(this.PutFileButton);
            this.Controls.Add(this.GetFile);
            this.Controls.Add(this.RemoteParentButton);
            this.Controls.Add(this.RemoteDirectory);
            this.Controls.Add(this.menuStrip1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "MainWindow";
            this.Text = "The best FTP client ever made";
            this.Load += new System.EventHandler(this.MainWindow_Load);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_Exit);
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.ListBox RemoteDirectory;
        private System.Windows.Forms.Button RemoteParentButton;
        private System.Windows.Forms.Button PutFileButton;
        private System.Windows.Forms.Button CreateRemoteDirButton;
        private System.Windows.Forms.Button RemoteDeleteFileButton;
        private System.Windows.Forms.Button RemoteRenameFileButton;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
        private System.Windows.Forms.ListBox LocalDirectory;
        private System.Windows.Forms.Button GetFile;
        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem changeFontToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
        private System.Windows.Forms.FontDialog fontWindow;
        private System.Windows.Forms.ToolStripMenuItem changeColorToolStripMenuItem;
        private System.Windows.Forms.Label RemoteLabel;
        private System.Windows.Forms.ListBox RemoteTree;
        private System.Windows.Forms.ListBox LocalTree;
        private System.Windows.Forms.Button DiffButton;
        private System.Windows.Forms.Label LocalLabel;
        private System.Windows.Forms.Button RemoteNewFileButton;
        private System.Windows.Forms.Button LocalParentDirectoryButton;
        private System.Windows.Forms.Button LocalNewFileButton;
        private System.Windows.Forms.Button LocalRenameFileButton;
        private System.Windows.Forms.Button CreateLocalDirButton;
        private System.ComponentModel.BackgroundWorker backWorkProgBar;
        private System.Windows.Forms.ProgressBar progressBar;
        private System.Windows.Forms.Label lblStatus;
        private System.Windows.Forms.TextBox LocalSearchBox;
        private System.Windows.Forms.Button LocalSearchButton;
        private System.ComponentModel.BackgroundWorker backWorkGetProg;
        private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem githubReadmeOpensWebBrowserToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem logOutToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
        private System.Windows.Forms.TextBox RemoteSearchBox;
        private System.Windows.Forms.Button RemoteSearchButton;
        private System.Windows.Forms.ToolStripMenuItem hideLogInWindowToolStripMenuItem;
    }
}


text:
import { useCallback } from 'react';

import { getFullCalendar } from '@proton/shared/lib/api/calendars';
import createCache from '@proton/shared/lib/helpers/cache';
import { STATUS } from '@proton/shared/lib/models/cache';

import useApi from './useApi';
import useCache from './useCache';
import useCachedModelResult, { getPromiseValue } from './useCachedModelResult';

export const KEY = 'CALENDAR_BOOTSTRAP';

export const useGetCalendarBootstrap = () => {
    const api = useApi();
    const cache = useCache();
    const miss = useCallback(
        (calendarID: string) => {
            if (!calendarID) {
                return Promise.resolve();
            }
            return api(getFullCalendar(calendarID));
        },
        [api]
    );

    return useCallback(
        (calendarID: string) => {
            if (!cache.has(KEY)) {
                cache.set(KEY, createCache());
            }
            return getPromiseValue(cache.get(KEY), calendarID, miss);
        },
        [cache, miss]
    );
};

export const useReadCalendarBootstrap = () => {
    const cache = useCache();
    return useCallback(
        (calendarID: string) => {
            if (!cache.has(KEY)) {
                cache.set(KEY, createCache());
            }
            const oldRecord = cache.get(KEY).get(calendarID);
            if (!oldRecord || oldRecord.status !== STATUS.RESOLVED) {
                return;
            }
            return oldRecord.value;
        },
        [cache]
    );
};

export const useCalendarBootstrap = (calendarID?: string) => {
    const cache = useCache();
    const getCalendarBootstrap = useGetCalendarBootstrap();
    if (!cache.has(KEY)) {
        cache.set(KEY, createCache());
    }
    return useCachedModelResult(cache.get(KEY), calendarID, getCalendarBootstrap);
};

export default useGetCalendarBootstrap;


text:
package com.touchvie.sdkfront.ui.modules;

import com.touchvie.sdkfront.ui.Module;

/**
 *
 */
public class Relation extends Module {

    /**
     * Default constructor
     */
    public Relation() {
    }

}