text:
package br.unicamp.ic.sed.mobilemedia.album.impl;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.TextField;

/**
 * @author tyoung
 * This form is displayed when the user defines a new photo album (from the AlbumListScreen)
 * TODO: This feature is not fully implemented. The commands are in place to create
 * a new album, but currently it just creates a hard-coded album name for testing.
 *
 */
class NewAlbumScreen extends Form {

	TextField albumName = new TextField("Album Name", "", 15, TextField.ANY);

	Command ok;
	Command cancel;

	/**
	 * @param arg0
	 */
	public NewAlbumScreen(String name) {
		super(name); //System.out.println("NewAlbumScreen.NewAlbumScreen()");
		this.append(albumName);
		ok = new Command("Save", Command.SCREEN, 0);
		cancel = new Command("Cancel", Command.EXIT, 1);
		this.addCommand(ok);
		this.addCommand(cancel);

	}

	/**
	 * @param arg0
	 * @param arg1
	 */
	public NewAlbumScreen(String title, Item[] items) {
		super(title, items);
		//System.out.println("NewAlbumScreen.NewAlbumScreen()");
	}

	/**
	 * @return Returns the new Album Name.
	 */
	public String getAlbumName() { //System.out.println("NewAlbumScreen.getAlbumName()");
		return albumName.getString();
	}
}


text:
use strict;
use warnings;

use PostgresNode;
use TestLib;
use Test::More tests => 44;

program_help_ok('vacuumdb');
program_version_ok('vacuumdb');
program_options_handling_ok('vacuumdb');

my $node = get_new_node('main');
$node->init;
$node->start;

$node->issues_sql_like(
	[ 'vacuumdb', 'postgres' ],
	qr/statement: VACUUM.*;/,
	'SQL VACUUM run');
$node->issues_sql_like(
	[ 'vacuumdb', '-f', 'postgres' ],
	qr/statement: VACUUM \(FULL\).*;/,
	'vacuumdb -f');
$node->issues_sql_like(
	[ 'vacuumdb', '-F', 'postgres' ],
	qr/statement: VACUUM \(FREEZE\).*;/,
	'vacuumdb -F');
$node->issues_sql_like(
	[ 'vacuumdb', '-zj2', 'postgres' ],
	qr/statement: VACUUM \(ANALYZE\).*;/,
	'vacuumdb -zj2');
$node->issues_sql_like(
	[ 'vacuumdb', '-Z', 'postgres' ],
	qr/statement: ANALYZE.*;/,
	'vacuumdb -Z');
$node->issues_sql_like(
	[ 'vacuumdb', '--disable-page-skipping', 'postgres' ],
	qr/statement: VACUUM \(DISABLE_PAGE_SKIPPING\).*;/,
	'vacuumdb --disable-page-skipping');
$node->issues_sql_like(
	[ 'vacuumdb', '--skip-locked', 'postgres' ],
	qr/statement: VACUUM \(SKIP_LOCKED\).*;/,
	'vacuumdb --skip-locked');
$node->issues_sql_like(
	[ 'vacuumdb', '--skip-locked', '--analyze-only', 'postgres' ],
	qr/statement: ANALYZE \(SKIP_LOCKED\).*;/,
	'vacuumdb --skip-locked --analyze-only');
$node->command_fails(
	[ 'vacuumdb', '--analyze-only', '--disable-page-skipping', 'postgres' ],
	'--analyze-only and --disable-page-skipping specified together');
$node->command_ok([qw(vacuumdb -Z --table=pg_am dbname=template1)],
	'vacuumdb with connection string');

$node->command_fails(
	[qw(vacuumdb -Zt pg_am;ABORT postgres)],
	'trailing command in "-t", without COLUMNS');

# Unwanted; better if it failed.
$node->command_ok(
	[qw(vacuumdb -Zt pg_am(amname);ABORT postgres)],
	'trailing command in "-t", with COLUMNS');

$node->safe_psql(
	'postgres', q|
  CREATE TABLE "need""q(uot" (")x" text);
  CREATE TABLE vactable (a int, b int);
  CREATE VIEW vacview AS SELECT 1 as a;

  CREATE FUNCTION f0(int) RETURNS int LANGUAGE SQL AS 'SELECT $1 * $1';
  CREATE FUNCTION f1(int) RETURNS int LANGUAGE SQL AS 'SELECT f0($1)';
  CREATE TABLE funcidx (x int);
  INSERT INTO funcidx VALUES (0),(1),(2),(3);
  CREATE INDEX i0 ON funcidx ((f1(x)));
|);
$node->command_ok([qw|vacuumdb -Z --table="need""q(uot"(")x") postgres|],
	'column list');
$node->command_fails(
	[qw|vacuumdb -Zt funcidx postgres|],
	'unqualifed name via functional index');

$node->command_fails(
	[ 'vacuumdb', '--analyze', '--table', 'vactable(c)', 'postgres' ],
	'incorrect column name with ANALYZE');
$node->issues_sql_like(
	[ 'vacuumdb', '--analyze', '--table', 'vactable(a, b)', 'postgres' ],
	qr/statement: VACUUM \(ANALYZE\) public.vactable\(a, b\);/,
	'vacuumdb --analyze with complete column list');
$node->issues_sql_like(
	[ 'vacuumdb', '--analyze-only', '--table', 'vactable(b)', 'postgres' ],
	qr/statement: ANALYZE public.vactable\(b\);/,
	'vacuumdb --analyze-only with partial column list');
$node->command_checks_all(
	[ 'vacuumdb', '--analyze', '--table', 'vacview', 'postgres' ],
	0,
	[qr/^.*vacuuming database "postgres"/],
	[qr/^WARNING.*cannot vacuum non-tables or special system tables/s],
	'vacuumdb with view');
$node->command_fails(
	[ 'vacuumdb', '--table', 'vactable', '--min-mxid-age', '0', 'postgres' ],
	'vacuumdb --min-mxid-age with incorrect value');
$node->command_fails(
	[ 'vacuumdb', '--table', 'vactable', '--min-xid-age', '0', 'postgres' ],
	'vacuumdb --min-xid-age with incorrect value');
$node->issues_sql_like(
	[
		'vacuumdb',   '--table', 'vactable', '--min-mxid-age',
		'2147483000', 'postgres'
	],
	qr/GREATEST.*relminmxid.*2147483000/,
	'vacuumdb --table --min-mxid-age');
$node->issues_sql_like(
	[ 'vacuumdb', '--min-xid-age', '2147483001', 'postgres' ],
	qr/GREATEST.*relfrozenxid.*2147483001/,
	'vacuumdb --table --min-xid-age');

redpajama_set_name: RedPajamaGithub


text:
//
//  Editor.cpp
//  Project: humid
//
//	All rights reserved. Use of this source code is governed by the
//	3-clause BSD License in LICENSE.txt.

#include <iostream>
#include <nanogui/widget.h>
#include <nanogui/theme.h>
#include <nanogui/screen.h>
#include <value.h>
#include <symboltable.h>
#include <fstream>
#include <boost/filesystem.hpp>
#include <nanogui/messagedialog.h>

#include "structure.h"
#include "draghandle.h"
#include "userwindow.h"
#include "editor.h"
#include "propertymonitor.h"
#include "helper.h"

extern std::list<Structure *>hm_structures;
extern std::list<StructureClass *> hm_classes;

Editor *Editor::_instance = 0;

Editor::Editor(EditorGUI *gui) :mEditMode(false), mCreateMode(false), screen(gui)  {
	_instance = this;
	drag_handle = new nanogui::DragHandle(screen, new PositionMonitor);
}

Editor *Editor::instance() {
	return _instance;
}

void Editor::setEditMode(bool which) {
	mEditMode = which;
	if (!mEditMode) {
		if (drag_handle) drag_handle->setVisible(false);
		screen->getUserWindow()->clearSelections();
	}
}

bool Editor::isEditMode() {
	return mEditMode;
}

bool Editor::isCreateMode() {
	return mCreateMode;
}

void Editor::setCreateMode(bool which) {
	mCreateMode = which;
}

void Editor::refresh(bool ) {
	if (screen) {
		if (screen->getUserWindow() ) {
			nanogui::Window *mainWindow = screen->getUserWindow()->getWindow();
			nanogui::Theme *theme = mainWindow->theme();
			theme->incRef();
			mainWindow->setTheme(new nanogui::Theme(screen->nvgContext()));
			mainWindow->setTheme(theme);
			if (screen->size().y() == mainWindow->size().y()) {
				theme->mWindowHeaderHeight = 0;
			}
			theme->decRef();
		}

		screen->performLayout();

	}
}

nanogui::DragHandle *Editor::getDragHandle() { return drag_handle; }

void Editor::load(const std::string &path) {
	using namespace nanogui;
	UserWindow *uw = screen->getUserWindow();
	if (uw) uw->load(path);
}

void Editor::saveAs(const std::string &path) {

}
void Editor::save() {
	using namespace nanogui;
	using namespace boost::filesystem;
	UserWindow *uw = screen->getUserWindow();
	uw->clearSelections();
	//if (uw) uw->save(path);
	Structure *settings = EditorSettings::find("EditorSettings");
	assert(settings);
	const Value &base_v(settings->getProperties().find("project_base"));
	assert(base_v != SymbolTable::Null);
	std::string base_path_str = base_v.asString();
	path project_base_path(base_path_str);
	{
		std::string x = settings->getProperties().find("project_base").asString();
		assert(boost::filesystem::is_directory(x));
	}
	backup_humid_files(project_base_path);
	{
		std::string x = settings->getProperties().find("project_base").asString();
		assert(boost::filesystem::is_directory(x));
	}

	// collect a list of files to save to
	std::list<std::pair<NamedObject*, std::string>> structure_files;
	for (auto s : hm_classes) {
		assert(s);
		std::string fname = s->getName();
		fname += ".humid";

		Value filename(s->getProperties().find("file_name"));
		if (filename == SymbolTable::Null)
			filename = s->getInternalProperties().find("file_name");
		if (filename != SymbolTable::Null)
			fname = filename.asString();

		std::string file_path = base_path_str + "/" + fname;
		structure_files.push_back(make_pair(s,file_path));
	}
	for (auto s : hm_structures) {
		if (s->getOwner()) {
			std::cout << s->getName() << " is owned by " << s->getOwner()->getName() << "\n";
			continue;
		}
		Value filename = s->getValue("file_name");
		if (filename == SymbolTable::Null)
			filename = 	s->getInternalProperties().find("file_name");
		std::string fname(s->getName());
		fname += ".humid";
		if (filename != SymbolTable::Null) {
			fname = filename.asString();
		}

		std::cout << "filing structure " << s->getName() << " into " << base_v << "/"<< fname << "\n";

		std::string file_path(base_v.asString());
		file_path += "/" + fname;
		structure_files.push_back(make_pair(s,file_path));
	}
	// save to the files
	std::set<StructureClass*>saved_classes;
	for (auto item : structure_files) {
		Structure *s = dynamic_cast<Structure *>(item.first);
		StructureClass *sc = dynamic_cast<StructureClass *>(item.first);
		std::string fn = item.second;
		if (!s && sc && sc->isBuiltIn()) {
			continue; // skip saving builtin objects
		}
		if (s && s->getOwner()) {
			std::cout << "skipping save of owned structure " << s->getName() << "\n";
			continue; // skip items that are local to another structure
		}
		/*if (sc && findStructureFromClass(sc->getName()) == 0
				&& sc->getLocals().empty()
				&& sc->getProperties().begin() == sc->getProperties().end()) {
			std::cout << "skipping save of empty structure class " << sc->getName() << "\n";
			continue;
		}
		*/
		std::ofstream out;
		out.open(fn, std::ofstream::out | std::ofstream::app);
		if (out.fail()) {
			char buf[200];
			snprintf(buf, 200, "Could not open %s for write", fn.c_str());
			std::cerr << buf << "\n";
			continue;
		}
		if (sc) std::cout << "attempting to write structure class " << sc->getName() <<" to " << fn << "\n";
		if (sc && !sc->isBuiltIn() && !sc->save(out)) {
			char buf[200];
			snprintf(buf, 200, "error when writing structure class to %s", fn.c_str());
		}
		if (s) std::cout << "attempting to write structure instance " << s->getName() << "\n";
		if (s && !s->save(out,s->getName())) {
			char buf[200];
			snprintf(buf, 200, "Error writing %s to %s", s->getName().c_str(), fn.c_str());
			std::cerr << buf << "\n";
			std::cerr << buf << "\n";
		}
			//auto dlg = new MessageDialog(EDITOR->gui()->getUserWindow()->getWindow(),
			//		MessageDialog::Type::Warning, "Error saving file", buf);
            //dlg->setCallback([](int result) {
			//	std::cout << "Dialog result: " << result << std::endl;
			//});
		out.close();
	}

	{
		const Value &x = settings->getProperties().find("project_base");
		assert(x != SymbolTable::Null);
		std::string xs = x.asString();
		std::cout << "checking project base path: " << xs << "\n";
		assert(boost::filesystem::is_directory(xs));
	}
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using Jint.Expressions;
using System.Threading;
using System.Diagnostics;
using Antlr.Runtime;
using Jint.Native;
using Jint.Debugger;
using System.Security;
using System.Security.Permissions;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace Jint
{
    public class JintType
    {
        private Type _Type;
        public Type Type
        {
            get
            {
                return this._Type;
            }
        }

        private bool _Inherited;
        public bool Inherited
        {
            get
            {
                return this._Inherited;
            }
        }

        public JintType(Type type, bool inherited)
        {
            if(type == null) throw new ArgumentNullException("type");
            this._Type = type;
            this._Inherited = true;
        }

        public override string ToString()
        {
            return this._Type.ToString();
        }

        public static implicit operator JintType(Type type)
        {
            return new JintType(type, false);
        }

        public bool Test(Type targetType)
        {
            return this._Inherited ? this._Type.IsAssignableFrom(targetType) : this._Type == targetType;
        }
    }
    [Serializable]
    public class JintEngine
    {
        protected ExecutionVisitor visitor;

        [System.Diagnostics.DebuggerStepThrough]
        public JintEngine()
            : this(Options.Ecmascript5 | Options.Strict)
        {
        }

        [System.Diagnostics.DebuggerStepThrough]
        public JintEngine(Options options)
        {
            visitor = new ExecutionVisitor(options);
            AllowClr = true;
            permissionSet = new PermissionSet(PermissionState.None);
            MaxRecursions = 400;

            JsObject global = visitor.Global as JsObject;

            global["ToBoolean"] = visitor.Global.FunctionClass.New(new Func<object, Boolean>(Convert.ToBoolean));
            global["ToByte"] = visitor.Global.FunctionClass.New(new Func<object, Byte>(Convert.ToByte));
            global["ToChar"] = visitor.Global.FunctionClass.New(new Func<object, Char>(Convert.ToChar));
            global["ToDateTime"] = visitor.Global.FunctionClass.New(new Func<object, DateTime>(Convert.ToDateTime));
            global["ToDecimal"] = visitor.Global.FunctionClass.New(new Func<object, Decimal>(Convert.ToDecimal));
            global["ToDouble"] = visitor.Global.FunctionClass.New(new Func<object, Double>(Convert.ToDouble));
            global["ToInt16"] = visitor.Global.FunctionClass.New(new Func<object, Int16>(Convert.ToInt16));
            global["ToInt32"] = visitor.Global.FunctionClass.New(new Func<object, Int32>(Convert.ToInt32));
            global["ToInt64"] = visitor.Global.FunctionClass.New(new Func<object, Int64>(Convert.ToInt64));
            global["ToSByte"] = visitor.Global.FunctionClass.New(new Func<object, SByte>(Convert.ToSByte));
            global["ToSingle"] = visitor.Global.FunctionClass.New(new Func<object, Single>(Convert.ToSingle));
            global["ToString"] = visitor.Global.FunctionClass.New(new Func<object, String>(Convert.ToString));
            global["ToUInt16"] = visitor.Global.FunctionClass.New(new Func<object, UInt16>(Convert.ToUInt16));
            global["ToUInt32"] = visitor.Global.FunctionClass.New(new Func<object, UInt32>(Convert.ToUInt32));
            global["ToUInt64"] = visitor.Global.FunctionClass.New(new Func<object, UInt64>(Convert.ToUInt64));

            BreakPoints = new List<BreakPoint>();
        }

        public static readonly List<JintType> AllowNoPublicTypes = new List<JintType>();
        public static readonly List<JintType> AllowNoPublicFieldsTypes = new List<JintType>();

        /// <summary>
        /// A global object associated with this engine instance
        /// </summary>
        public IGlobal Global
        {
            get { return visitor.Global; }
        }

        /// <summary>
        /// Gets or sets whether script are allowed to access Clr classes. <value>True</value> by default.
        /// </summary>
        /// <remarks>
        /// Eventhough it's value is <value>true</value> by default, PermissionSet is set to None to run in a very secured environment.
        /// </remarks>
        public bool AllowClr
        {
            get { return visitor.AllowClr; }
            set { visitor.AllowClr = value; }
        }

        private PermissionSet permissionSet;

        public static Program Compile(string source, bool debugInformation)
        {
            Program program = null;
            if(!string.IsNullOrEmpty(source))
            {
                var lexer = new ES3Lexer(new ANTLRStringStream(source));
                var parser = new ES3Parser(new CommonTokenStream(lexer)) { DebugMode = debugInformation };

                program = parser.program().value;

                if(parser.Errors != null && parser.Errors.Count > 0)
                {
                    throw new JintException(String.Join(Environment.NewLine, parser.Errors.ToArray()));
                }
            }

            return program;
        }

        /// <summary>
        /// Pre-compiles the expression in order to check syntax errors.
        /// If errors are detected, the Error property contains the message.
        /// </summary>
        /// <returns>True if the expression syntax is correct, otherwiser False</returns>
        public static bool HasErrors(string script, out string errors)
        {
            try
            {
                errors = null;
                Program program = Compile(script, false);

                // In case HasErrors() is called multiple times for the same expression
                return program != null;
            }
            catch(Exception e)
            {
                errors = e.Message;
                return true;
            }
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="scriptPath">The script path to execute</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object RunAsPath(string scriptPath)
        {
            return Run(File.ReadAllText(scriptPath, Encoding.UTF8));
        }
        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="script">The script to execute</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(string script)
        {
            return Run(script, true);
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="program">The expression tree to execute</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(Program program)
        {
            return Run(program, true);
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="reader">The TextReader to read script from</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(TextReader reader)
        {
            return Run(reader.ReadToEnd());
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="reader">The TextReader to read script from</param>
        /// <param name="unwrap">Whether to unwrap the returned value to a CLR instance. <value>True</value> by default.</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(TextReader reader, bool unwrap)
        {
            return Run(reader.ReadToEnd(), unwrap);
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="script">The script to execute</param>
        /// <param name="unwrap">Whether to unwrap the returned value to a CLR instance. <value>True</value> by default.</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(string script, bool unwrap)
        {

            if(script == null)
                throw new
                    ArgumentException("Script can't be null", "script");

            Program program;

            try
            {
                program = Compile(script, DebugMode);
            }
            catch(Exception e)
            {
                throw new JintException("解析脚本失败!" + e.Message, e);
            }

            if(program == null)
                return null;

            return Run(program, unwrap);
        }

        /// <summary>
        /// Runs a set of JavaScript statements and optionally returns a value if return is called
        /// </summary>
        /// <param name="program">The expression tree to execute</param>
        /// <param name="unwrap">Whether to unwrap the returned value to a CLR instance. <value>True</value> by default.</param>
        /// <returns>Optionaly, returns a value from the scripts</returns>
        /// <exception cref="System.ArgumentException" />
        /// <exception cref="System.Security.SecurityException" />
        /// <exception cref="Jint.JintException" />
        public object Run(Program program, bool unwrap)
        {
            if(program == null)
                throw new
                    ArgumentException("Script can't be null", "script");

            visitor.DebugMode = this.DebugMode;
            visitor.MaxRecursions = this.MaxRecursions;
            visitor.PermissionSet = permissionSet;
            if(DebugMode)
            {
                visitor.Step += OnStep;
            }

            try
            {
                visitor.Visit(program);
            }
            catch(SecurityException)
            {
                throw;
            }
            catch(JsException e)
            {
                string message = e.Message;
                if(e.Value is JsError)
                    message = ((JsError)e.Value).Value.ToString();
                StringBuilder stackTrace = new StringBuilder();
                string source = String.Empty;

                if(DebugMode)
                {
                    while(visitor.CallStack.Count > 0)
                    {
                        stackTrace.AppendLine(visitor.CallStack.Pop());
                    }

                    if(stackTrace.Length > 0)
                    {
                        stackTrace.Insert(0, Environment.NewLine + "------ Stack Trace:" + Environment.NewLine);
                    }
                }

                if(visitor.CurrentStatement.Source != null)
                {
                    source = Environment.NewLine + visitor.CurrentStatement.Source.ToString()
                            + Environment.NewLine + visitor.CurrentStatement.Source.Code;
                }

                throw new JintException(message + source + stackTrace, e);
            }
            catch(Exception e)
            {
                StringBuilder stackTrace = new StringBuilder();
                string source = String.Empty;

                if(DebugMode)
                {
                    while(visitor.CallStack.Count > 0)
                    {
                        stackTrace.AppendLine(visitor.CallStack.Pop());
                    }

                    if(stackTrace.Length > 0)
                    {
                        stackTrace.Insert(0, Environment.NewLine + "------ Stack Trace:" + Environment.NewLine);
                    }
                }

                if(visitor.CurrentStatement != null && visitor.CurrentStatement.Source != null)
                {
                    source = Environment.NewLine + visitor.CurrentStatement.Source.ToString()
                            + Environment.NewLine + visitor.CurrentStatement.Source.Code;
                }

                throw new JintException(e.Message + source + stackTrace, e.InnerException);
            }
            finally
            {
                visitor.Step -= OnStep;
            }

            return visitor.Result == null ? null : unwrap ? visitor.Global.Marshaller.MarshalJsValue<object>(visitor.Result) : visitor.Result;
        }

        #region Debugger
        public event EventHandler<DebugInformation> Step;
        public event EventHandler<DebugInformation> Break;
        public List<BreakPoint> BreakPoints { get; private set; }
        public bool DebugMode { get; private set; }
        public int MaxRecursions { get; private set; }
        public List<string> WatchList { get; set; }

        public JintEngine SetDebugMode(bool debugMode)
        {
            DebugMode = debugMode;
            return this;
        }

        /// <summary>
        /// Defines the max allowed number of recursions in the script
        /// </summary>
        public JintEngine SetMaxRecursions(int maxRecursions)
        {
            MaxRecursions = maxRecursions;
            return this;
        }

        #endregion

        #region SetParameter overloads

        /// <summary>
        /// Defines an external object to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the object duting the execution of the script</param>
        /// <param name="value">Available object</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, JsInstance value)
        {
            visitor.GlobalScope[name] = value;
            return this;
        }
        /// <summary>
        /// Defines an external object to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the object duting the execution of the script</param>
        /// <param name="value">Available object</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, object value)
        {
            visitor.GlobalScope[name] = visitor.Global.WrapClr(value);
            return this;
        }

        /// <summary>
        /// Defines an external Double value to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the Double value during the execution of the script</param>
        /// <param name="value">Available Double value</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, double value)
        {
            visitor.GlobalScope[name] = visitor.Global.NumberClass.New(value);
            return this;
        }

        /// <summary>
        /// Defines an external String instance to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the String instance during the execution of the script</param>
        /// <param name="value">Available String instance</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, string value)
        {
            if(value == null)
                visitor.GlobalScope[name] = JsNull.Instance;
            else
                visitor.GlobalScope[name] = visitor.Global.StringClass.New(value);
            return this;
        }

        /// <summary>
        /// Defines an external Int32 value to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the Int32 value during the execution of the script</param>
        /// <param name="value">Available Int32 value</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, int value)
        {
            visitor.GlobalScope[name] = visitor.Global.WrapClr(value);
            return this;
        }

        /// <summary>
        /// Defines an external Boolean value to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the Boolean value during the execution of the script</param>
        /// <param name="value">Available Boolean value</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, bool value)
        {
            visitor.GlobalScope[name] = visitor.Global.BooleanClass.New(value);
            return this;
        }

        /// <summary>
        /// Defines an external DateTime value to be available inside the script
        /// </summary>
        /// <param name="name">Local name of the DateTime value during the execution of the script</param>
        /// <param name="value">Available DateTime value</param>
        /// <returns>The current JintEngine instance</returns>
        public JintEngine SetParameter(string name, DateTime value)
        {
            visitor.GlobalScope[name] = visitor.Global.DateClass.New(value);
            return this;
        }

        public JsInstance GetParameter(string name)
        {
            return visitor.CurrentScope[name];
        }

        #endregion

        public JintEngine AddPermission(IPermission perm)
        {
            permissionSet.AddPermission(perm);
            return this;
        }

        public JintEngine SetFunction(string name, JsFunction function)
        {
            visitor.GlobalScope[name] = function;
            return this;
        }

        public JsFunction FindFunction(string name)
        {
            var function = visitor.CurrentScope[name];
            if(JsUndefined.Instance.Equals(function))
                return null;
            return function as JsFunction;
        }

        public object CallFunction(string name, params object[] args)
        {
            return CallFunction((JsFunction)visitor.CurrentScope[name], args);
        }

        public object CallFunction(JsFunction function, params object[] args)
        {
            visitor.ExecuteFunction(function, null, Array.ConvertAll<object, JsInstance>(args, x => visitor.Global.Marshaller.MarshalClrValue<object>(x)));
            return visitor.Global.Marshaller.MarshalJsValue<object>(visitor.Returned);
        }

        public JintEngine SetFunction(string name, Delegate function)
        {
            visitor.GlobalScope[name] = visitor.Global.FunctionClass.New(function);
            return this;
        }

        /// <summary>
        /// Escapes a JavaScript string literal
        /// </summary>
        /// <param name="value">The string literal to espace</param>
        /// <returns>The escaped string literal, without sinlge quotes, back slashes and line breaks</returns>
        public static string EscapteStringLiteral(string value)
        {
            return value.Replace("\\", "\\\\").Replace("'", "\\'").Replace(Environment.NewLine, "\\r\\n");
        }

        protected void OnStep(object sender, DebugInformation info)
        {
            if(Step != null)
            {
                Step(this, info);
            }

            if(Break != null)
            {
                BreakPoint breakpoint = BreakPoints.Find(l =>
                {
                    bool afterStart, beforeEnd;

                    afterStart = l.Line > info.CurrentStatement.Source.Start.Line
                        || (l.Line == info.CurrentStatement.Source.Start.Line && l.Char >= info.CurrentStatement.Source.Start.Char);

                    if(!afterStart)
                    {
                        return false;
                    }

                    beforeEnd = l.Line < info.CurrentStatement.Source.Stop.Line
                        || (l.Line == info.CurrentStatement.Source.Stop.Line && l.Char <= info.CurrentStatement.Source.Stop.Char);

                    if(!beforeEnd)
                    {
                        return false;
                    }

                    if(!String.IsNullOrEmpty(l.Condition))
                    {
                        return Convert.ToBoolean(this.Run(l.Condition));
                    }

                    return true;
                });

                if(breakpoint != null)
                {
                    Break(this, info);
                }
            }
        }

        protected void OnBreak(object sender, DebugInformation info)
        {
            if(Break != null)
            {
                Break(this, info);
            }
        }

        public JintEngine DisableSecurity()
        {
            permissionSet = new PermissionSet(PermissionState.Unrestricted);
            return this;
        }

        public JintEngine EnableSecurity()
        {
            permissionSet = new PermissionSet(PermissionState.None);
            return this;
        }

        public void Save(Stream s)
        {
            BinaryFormatter formatter = new BinaryFormatter();
            formatter.Serialize(s, visitor);
        }

        public static void Load(JintEngine engine, Stream s)
        {
            BinaryFormatter formatter = new BinaryFormatter();
            var visitor = (ExecutionVisitor)formatter.Deserialize(s);
            engine.visitor = visitor;
        }

        public static JintEngine Load(Stream s)
        {
            JintEngine engine = new JintEngine();
            Load(engine, s);
            return engine;
        }
    }
}


text:
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Angular Multiselect Dropdown | Cuppa Labs</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="/angular2-multiselect-dropdown/assets/img/coffee11.png">
  <link rel="manifest" href="manifest.webmanifest">
  <meta name="theme-color" content="#1976d2">
  <meta name="description" content="Multiselect dropdown component library for Angular v11, 10, 9, 8, 6, 4 apps. Easy and simple to integrate. Powerful library by Cuppa Labs">
  <meta content='angular 11 multiselect, angular 2 dropdown, angular2 dropdown, angular 2 multiselect dropdown, angular 2 multiselect' name='keywords' />
  <meta property="og:description" content="Multiselect dropdown component library for Angular v11, 10, 9, 8, 6, 4 apps. Easy and simple to integrate. Powerful library by Cuppa Labs" />
  <meta property="og:url" content="https://cuppalabs.github.io/components/multiselectDropdown/" />
  <meta property="og:type" content="website" />
  <meta property="og:title" content="Angular MultiSelect Dropdown | Cuppa Labs" />
  <meta property="og:site_name" content="Cuppa Labs" />
  <meta property="article:publisher" content="https://www.facebook.com/cuppalabs/" />
  <meta property="article:author" content="https://www.facebook.com/pradeepkumar.terli" />
  <meta property="article:tag" content="Angular 2" />
  <meta property="article:tag" content="html5" />
  <meta property="article:tag" content="css3" />
  <meta property="og:image" content="https://cuppalabs.github.io/angular2-multiselect-dropdown/assets/img/multiselect.jpeg" />
</head>
<body>
  <app-root></app-root>
  <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  <script>
    (function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
      m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

    ga('create', 'UA-93566400-1', 'auto');
    ga('send', 'pageview');

</script>
  <script>
    window.ChatraSetup = {
        colors: {
            buttonText: '#ffffff', /* chat button text color */
            buttonBg: '#e9a142'    /* chat button background color */
        }
    };
    </script>
<script>
    (function(d, w, c) {
        w.ChatraID = 'JTyKDCouJ8iRGe4vb';
        var s = d.createElement('script');
        w[c] = w[c] || function() {
            (w[c].q = w[c].q || []).push(arguments);
        };
        s.async = true;
        s.src = 'https://call.chatra.io/chatra.js';
        if (d.head) d.head.appendChild(s);
    })(document, window, 'Chatra');
</script>
  <noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>


text:
def table_to_string(headers, table, align="", *, lines=("-", "-+-", " | ")):
  header_separator, header_junction, row_separator = lines
  align = ("{0:<<" + str(len(headers)) + "}").format(align or "")
  all_lens = [tuple(len(c) for c in r) for r in table]

  if headers:
    all_lens.append(tuple(len(h) for h in headers))

  max_lens = [max(r[i] for r in all_lens) for i in range(len(headers))]
  col_outs = ["{{{0}: {1}{2}}}".format(i, align[i], w) for i, w in enumerate(max_lens)]
  fmt_str = row_separator.join(col_outs)
  if headers:
    yield fmt_str.format(*headers)
    yield header_junction.join((header_separator * ml for ml in max_lens))
  for row in table:
    yield fmt_str.format(*row)


text:
<?php

class resthandler {
  private static $actions = [
     'GetAbsenzenTageProMonat'
  ];

  public function __construct() {

      include_once("../framework/lib/rest/AbstractRest.class.php");

      if (!isset($_SERVER['PHP_AUTH_USER'])) {
          header('WWW-Authenticate: Basic realm="REST API"');
          // header('HTTP/1.0 401 Unauthorized');

          $result = [
              'error' => 1,
              'errorCode' => '401',
              'errorText' => 'Auth Failed'
          ];

          $this->answer($result, 401);
          exit();
      }

      $headers = getallheaders();

      if($headers['ds2020-apirequest'] != true) {
          $result = [
              'error' => 1,
              'errorText' => 'ds2020-apirequest header not set. '
          ];
          $this->answer($result, 400);
      }

      $method = $_SERVER['REQUEST_METHOD'];

      $request = explode('/', trim($_SERVER['PATH_INFO'],'/'));

      $input = json_decode(file_get_contents('php://input'),true);

      if(sizeof($request) == 0) {
          $result = [
              'error' => 1,
              'errorText' => 'No Action given'
          ];
          $this->answer($result, 404);
      }

      if(in_array($request[0],self::$actions)) {

          include_once("../framework/lib/rest/Rest" . $request[0] . ".class.php");

          $classname = 'Rest' . $request[0];

          /**
           *
           * @var AbstractRest $action
           */
          $action = new $classname();

          if($method != $action->getAllowedMethod()) {
              $result = [
                  'error' => 1,
                  'errorText' => 'method not allowed'
              ];
              $this->answer($result, 405);
          }

                // Check Auth
            if ($action->needsSystemAuth()) {
                if ($_SERVER['PHP_AUTH_USER'] != DB::getGlobalSettings()->restApiUsername || $_SERVER['PHP_AUTH_PW'] != DB::getGlobalSettings()->restApiPassword) {
                    header('WWW-Authenticate: Basic realm="REST API"');
                    // header('HTTP/1.0 401 Unauthorized');

                    $result = [
                        'error' => 1,
                        'errorText' => 'Auth Failed'
                    ];

                    $this->answer($result, 401);
                    exit();
                }
            }
            else {
                if (!$action->checkAuth($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) {
                    header('WWW-Authenticate: Basic realm="REST API"');
                    // header('HTTP/1.0 401 Unauthorized');

                    $result = [
                        'error' => 1,
                        'errorText' => 'Auth Failed'
                    ];

                    $this->answer($result, 401);
                    exit();
                }
            }

          // Execute wurd nur aufgerufen, wenn die Authentifizierung erfolgreich war.
          $result = $action->execute($input, $request);

          if(!is_array($result)) {
              $result = [
                  'error' => 1
              ];
              if($action->getStatusCode() == 200) {
                  // Interner Fehler, da kein Status gesetzt wurde
                  $this->answer($result, 500);
              }
              else {
                  $this->answer($result, $action->getStatusCode());
              }

          }
          else {
              $this->answer($result,$action->getStatusCode());
          }
      }
      else {
          $result = [
              'error' => 1,
              'errorText' => 'Unknown Action'
          ];
          $this->answer($result, 404);
      }
  }

  private function answer($result, $statusCode) {
      header("Content-type: application/json");

      http_response_code($statusCode);

      print(json_encode($result));

      exit(0);
  }

}


text:
using Quilt4Net.Core.Interfaces;
using Tharga.Toolkit.Console.Commands.Base;

namespace Quilt4Net.Sample.Console.Commands.User
{
    internal class LoginUserCommand : ActionCommandBase
    {
        private readonly IQuilt4NetClient _client;

        public LoginUserCommand(IQuilt4NetClient client)
            : base("Login", "Login user")
        {
            _client = client;
        }

        public override bool CanExecute(out string reasonMessage)
        {
            reasonMessage = string.Empty;
            if (_client.Actions.User.IsAuthorized)
                reasonMessage = "Authorized";
            return !_client.Actions.User.IsAuthorized;
        }

        public override void Invoke(string[] param)
        {
            var username = QueryParam<string>("UserName", param);
            var password = QueryParam<string>("Password", param);
            _client.Actions.User.LoginAsync(username, password);
        }
    }
}