text:
/*! \file */ // Copyright 2011-2020 Tyler Gilbert and Stratify Labs, Inc; see LICENSE.md for rights.
//Copyright 2011-2020 Tyler Gilbert and Stratify Labs, Inc

#include "sgfx/Vector.hpp"
#include "sys/Printer.hpp"
#include <cstdio>

using namespace sgfx;

sys::Printer& sys::operator << (sys::Printer& printer, const sgfx::Vector & a){
	return printer;
}

sys::Printer& sys::operator << (sys::Printer& printer, const sgfx::VectorPath & a){
	for(u32 i=0; i < a.icon_count(); i++){
		printer.print_open_object(printer.verbose_level(), var::String().format("[%d]", i).cstring());
		{
			printer << sgfx::VectorPathDescription(a.icon_list()[i]);
			printer.print_close_object();
		}
	}
	return printer;
}

sys::Printer& sys::operator << (sys::Printer& printer, const sgfx::VectorPathDescription & a){
	switch( a.type() ){
		case sgfx::VectorPathDescription::type_none:
			printer.key("type", "none");
			break;
		case sgfx::VectorPathDescription::type_move:
			printer.key("type", "move");
			printer.print_open_object(printer.verbose_level(), "point");
		{
			printer << a.to_move().point;
			printer.print_close_object();
		}
			break;
		case sgfx::VectorPathDescription::type_line:
			printer.key("type", "line");
			printer.print_open_object(printer.verbose_level(), "point");
		{
			printer << a.to_line().point;
			printer.print_close_object();
		}
			break;
		case sgfx::VectorPathDescription::type_quadratic_bezier:
			printer.key("type", "quadratic bezier");
			printer.print_open_object(printer.verbose_level(), "point");
		{
			printer << a.to_quadratic_bezier().point;
			printer.print_close_object();
		}

			printer.print_open_object(printer.verbose_level(), "control");
		{
			printer << a.to_quadratic_bezier().control;
			printer.print_close_object();
		}
			break;
		case sgfx::VectorPathDescription::type_cubic_bezier:
			printer.key("type", "cubic bezier");
			printer.print_open_object(printer.verbose_level(), "point");
		{
			printer << a.to_cubic_bezier().point;
			printer.print_close_object();
		}

			printer.print_open_object( printer.verbose_level(), "control0");
		{
			printer << sgfx::Point(a.to_cubic_bezier().control[0]);
			printer.print_close_object();
		}
			printer.print_open_object(printer.verbose_level(), "control1");
		{
			printer << sgfx::Point(a.to_cubic_bezier().control[1]);
			printer.print_close_object();
		}
			break;
		case sgfx::VectorPathDescription::type_close:
			printer.key("type", "close");
			break;
		case sgfx::VectorPathDescription::type_pour:
			printer.key("type", "pour");
			printer.print_open_object(printer.verbose_level(), "point");
		{
			printer << a.to_pour().point;
			printer.print_close_object();
		}
			break;
	}

	return printer;
}

VectorMap& VectorMap::set_region(const Region & region){
	m_value.region = region;
	return *this;
}

VectorMap& VectorMap::calculate_for_bitmap(const Bitmap & bitmap){
	return calculate_for_region(bitmap.region());
}

VectorMap& VectorMap::calculate_for_region(const Region & region){
	u32 max_width;
	u32 max_height;
	s32 tmp;
	max_width = (region.width()) * 1414UL / 1000UL ;
	max_height = (region.height()) * 1414UL / 1000UL;
	m_value.region.area.width = max_width;
	m_value.region.area.height = max_height;
	tmp = region.width() - max_width + 1;
	m_value.region.point.x = region.x() + tmp/2;
	tmp = region.height() - max_height + 1;
	m_value.region.point.y = region.y() + tmp/2;
	return *this;
}

void VectorPath::shift(Point shift){
	u32 i;
	for(i=0; i < m_path.icon.count; i++){
		sg_vector_path_description_t * description = (sg_vector_path_description_t *)m_path.icon.list + i;
		switch(description->type){
			case SG_VECTOR_PATH_MOVE:
				description->move.point = Point(description->move.point) + shift;
				break;
			case SG_VECTOR_PATH_LINE:
				description->line.point = Point(description->line.point) + shift;
				break;
			case SG_VECTOR_PATH_POUR:
				description->pour.point = Point(description->pour.point) + shift;
				break;
			case SG_VECTOR_PATH_QUADRATIC_BEZIER:
				description->quadratic_bezier.control = Point(description->quadratic_bezier.control) + shift;
				description->quadratic_bezier.point = Point(description->quadratic_bezier.point) + shift;
				break;
			case SG_VECTOR_PATH_CUBIC_BEZIER:
				description->cubic_bezier.control[0] = Point(description->cubic_bezier.control[0]) + shift;
				description->cubic_bezier.control[1] = Point(description->cubic_bezier.control[1]) + shift;
				description->cubic_bezier.point = Point(description->cubic_bezier.point) + shift;
				break;
			case SG_VECTOR_PATH_CLOSE:
				break;
		}
	}
}

void VectorPath::scale(float x_scale, float y_scale){
	for(u32 i=0; i < m_path.icon.count; i++){
		sg_vector_path_description_t * description = (sg_vector_path_description_t *)m_path.icon.list + i;
		switch(description->type){
			case SG_VECTOR_PATH_MOVE:
				description->move.point.x = description->move.point.x * x_scale;
				description->move.point.y = description->move.point.y * y_scale;
				break;
			case SG_VECTOR_PATH_LINE:
				description->line.point.x = description->line.point.x * x_scale;
				description->line.point.y = description->line.point.y * y_scale;
				break;
			case SG_VECTOR_PATH_POUR:
				description->pour.point.x = description->pour.point.x * x_scale;
				description->pour.point.y = description->pour.point.y * y_scale;
				break;
			case SG_VECTOR_PATH_QUADRATIC_BEZIER:
				description->quadratic_bezier.control.x = description->quadratic_bezier.control.x * x_scale;
				description->quadratic_bezier.point.x = description->quadratic_bezier.point.x * x_scale;
				description->quadratic_bezier.control.y = description->quadratic_bezier.control.y * y_scale;
				description->quadratic_bezier.point.y = description->quadratic_bezier.point.y * y_scale;
				break;
			case SG_VECTOR_PATH_CUBIC_BEZIER:
				description->cubic_bezier.control[0].x = description->cubic_bezier.control[0].x * x_scale;
				description->cubic_bezier.control[1].x = description->cubic_bezier.control[1].x * x_scale;
				description->cubic_bezier.point.x = description->cubic_bezier.point.x * x_scale;
				description->cubic_bezier.control[0].y = description->cubic_bezier.control[0].y * y_scale;
				description->cubic_bezier.control[1].y = description->cubic_bezier.control[1].y * y_scale;
				description->cubic_bezier.point.y = description->cubic_bezier.point.y * y_scale;
				break;
			case SG_VECTOR_PATH_CLOSE:
				break;
		}
	}
}

void VectorPath::scale(float scale){
	u32 i;
	for(i=0; i < m_path.icon.count; i++){
		sg_vector_path_description_t * description = (sg_vector_path_description_t *)m_path.icon.list + i;
		switch(description->type){
			case SG_VECTOR_PATH_MOVE:
				description->move.point = Point(description->move.point) * scale;
				break;
			case SG_VECTOR_PATH_LINE:
				description->line.point = Point(description->line.point) * scale;
				break;
			case SG_VECTOR_PATH_POUR:
				description->pour.point = Point(description->pour.point) * scale;
				break;
			case SG_VECTOR_PATH_QUADRATIC_BEZIER:
				description->quadratic_bezier.control = Point(description->quadratic_bezier.control) * scale;
				description->quadratic_bezier.point = Point(description->quadratic_bezier.point) * scale;
				break;
			case SG_VECTOR_PATH_CUBIC_BEZIER:
				description->cubic_bezier.control[0] = Point(description->cubic_bezier.control[0]) * scale;
				description->cubic_bezier.control[1] = Point(description->cubic_bezier.control[1]) * scale;
				description->cubic_bezier.point = Point(description->cubic_bezier.point) * scale;
				break;
			case SG_VECTOR_PATH_CLOSE:
				break;
		}
	}
}

void Vector::draw(Bitmap & bitmap, VectorPath & path, const VectorMap & map){
	api()->vector_draw_path(bitmap.bmap(), &path.path(), &map.map());
}

sg_vector_path_description_t Vector::get_path_move(const Point & p){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_MOVE;
	ret.move.point = p;
	return ret;
}

sg_vector_path_description_t Vector::get_path_line(const Point & p){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_LINE;
	ret.line.point = p;
	return ret;
}

sg_vector_path_description_t Vector::get_path_pour(const Point & p){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_POUR;
	ret.pour.point = p;
	return ret;
}

sg_vector_path_description_t Vector::get_path_quadratic_bezier(const Point & control, const Point & point){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_QUADRATIC_BEZIER;
	ret.quadratic_bezier.control = control;
	ret.quadratic_bezier.point = point;
	return ret;
}

sg_vector_path_description_t Vector::get_path_cubic_bezier(const Point & control0, const Point & control1, const Point & point){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_CUBIC_BEZIER;
	ret.cubic_bezier.control[0] = control0;
	ret.cubic_bezier.control[1] = control1;
	ret.cubic_bezier.point = point;
	return ret;
}

sg_vector_path_description_t Vector::get_path_close(){
	sg_vector_path_description_t ret;
	ret.type = SG_VECTOR_PATH_CLOSE;
	return ret;
}

Region Vector::find_active_region(const Bitmap & bitmap){
	sg_region_t region;
	sg_int_t right, bottom;

	region.point.x = find_left(bitmap);
	region.point.y = find_top(bitmap);

	right = find_right(bitmap);
	bottom = find_bottom(bitmap);

	region.area.width = right - region.point.x;
	region.area.height = bottom - region.point.y;

	return region;
}

sg_int_t Vector::find_top(const Bitmap & bitmap){
	sg_int_t x, y;
	sg_int_t y_min = bitmap.height();

	for(x = bitmap.margin_left(); x < bitmap.width() - bitmap.margin_left() - bitmap.margin_right(); x++){
		y = bitmap.margin_top();
		while( (bitmap.get_pixel(sg_point(x,y)) == 0) && (y < bitmap.height() - bitmap.margin_top() - bitmap.margin_bottom()) ){
			y++;
		}
		if( y < y_min ){
			y_min = y;
		}
	}
	return y_min;
}

sg_int_t Vector::find_bottom(const Bitmap & bitmap){
	sg_int_t x, y;
	sg_int_t y_max = 0;

	for(x = bitmap.margin_left(); x < bitmap.width() - bitmap.margin_left() - bitmap.margin_right(); x++){
		y = bitmap.height() - bitmap.margin_bottom() - bitmap.margin_top();
		do{
			y--;
		} while( (bitmap.get_pixel(sg_point(x,y)) == 0) && (y > bitmap.margin_top()) );

		if( y > y_max ){
			y_max = y;
		}
	}
	return y_max;
}

sg_int_t Vector::find_left(const Bitmap & bitmap){
	sg_int_t x, y;
	sg_int_t x_min = bitmap.width();

	for(y = 0; y < bitmap.height(); y++){
		x = bitmap.margin_left();
		while( (bitmap.get_pixel(sg_point(x,y)) == 0) && (x < bitmap.width() - bitmap.margin_left() - bitmap.margin_right()) ){
			x++;
		}
		if( x < x_min ){
			x_min = x;
		}
	}
	return x_min;
}

sg_int_t Vector::find_right(const Bitmap & bitmap){
	sg_int_t x, y;
	sg_int_t x_max = 0;

	for(y = 0; y < bitmap.height(); y++){
		x = bitmap.width() - bitmap.margin_left() - bitmap.margin_right();
		do{
			x--;
		} while( (bitmap.get_pixel(sg_point(x,y)) == 0) && (x > bitmap.margin_left()) );

		if( x > x_max ){
			x_max = x;
		}
	}
	return x_max;
}


text:
Rails.application.routes.draw do |map|
  get "courier_settings/set"
end

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <title>Online Help for the LAMMPS Shell App</title>
    <link rel="shortcut icon" href="lammps.ico">

      Back to LAMMPS Packages for Windows Overview

Online Help for the LAMMPS Shell App

      This page provides documentation and additional files to download
      for use with the LAMMPS Shell. The downloads are especially aimed
      at users that have

         installed LAMMPS on Windows 10 through
         Microsoft Store, since those are lacking those files.
      The alternative would be to download
        "complete" installer packages, however those are not
      cryptographically signed.  Those packages the only option when
      you want to use an MPI parallel version.

Please see the
        online version of the LAMMPS manual for documentation of the
      LAMMPS software itself.

The following archives are available for download:

LAMMPS example inputs and outputs:
        48MB .zip archive

LAMMPS potential files:
        15MB .zip archive

Overview

The LAMMPS Shell, lammps-shell is a
      program that functions very similar to the regular LAMMPS executable but
      has several modifications and additions that make it more powerful for
      interactive sessions, i.e. where you type LAMMPS commands from the
      prompt instead of reading them from a file.

It uses the readline and history libraries to provide command line
        editing and context aware TAB-expansion (details on that below).

When processing an input file with the "-in" or "-i" flag from the
        command line, it behaves similar to the Python interpreter, i.e. it
        does not exit at the end of that input file but rather stops at a
        prompt, so that additional commands can be issued interactively.

Errors will not abort the shell but return to the prompt.

It has additional commands aimed at interactive use (details
      below).

Interrupting a calculation with CTRL-C will not terminate the
        session but rather enforce a timer timeout to cleanly stop an
        ongoing run (more info on timeouts is in the documentation for
        the timer command documentation).

These enhancements makes the LAMMPS shell an
      attractive choice for interactive LAMMPS sessions in graphical
      desktop environments (e.g. Gnome, KDE, Cinnamon, XFCE,
      Windows).

TAB-expansion

When writing commands interactively at the shell
      prompt, you can hit the TAB key at any time to try and complete the
      text.  This completion is context aware and will expand any first word
      only to commands available in that executable.

For style commands it will expand to available styles of the
        corresponding category (e.g. pair styles after a
        pair_style command).

For compute, fix, or dump
        commands it will also expand only to already defined groups for
        the "group-ID" keyword.

For commands like compute_modify,
        fix_modify, or dump_modify it will expand
        to known compute/fix/dump IDs only.

When typing references to computes, fixes, or variables with a
        "c_", "f_", or "v_" prefix, respectively, then the expansion will
        be to known compute/fix IDs and variable names. Variable name
        expansion is also available for the ${name} variable syntax.

In all other cases TAB expansion will complete to names of files
        and directories.

Command line editing and history

      When typing commands, command line editing similar to what BASH
      provides is available.  Thus it is possible to move around the
      currently line and perform various cut and insert and edit operations.
      Previous commands can be retrieved by scrolling up (and down)
      or searching (e.g. with CTRL-r).

Also history expansion through using the exclamation mark "!"
      can be performed.  Examples: "!!" will be replaced with the previous
      command, "!-2" will repeat the command before that, "!30" will be
      replaced with event number 30 in the command history list, and
      "!run" with the last command line that started with run.  Adding
      a ":p" to such a history expansion will result that the expansion is
      printed and added to the history list, but NOT executed.
      On exit the LAMMPS shell will write the history list to a file
      .lammps_history in the current working directory.  If such a
      file exists when the LAMMPS shell is launched it will be read to
      populate the history list.

      This is realized via the readline library and can thus be customized
      with an .inputrc file in the home directory.  For application
      specific customization, the LAMMPS shell uses the name "lammps-shell".
      For more information about using and customizing an application using
      readline, please see the available documentation at:
      https://www.gnu.org/s/readline/#Documentation

Additional commands

The following commands are added to the LAMMPS shell
      on top of the regular LAMMPS commands:

help (or ?)    print a brief help message
history        display the current command history list
clear_history  wipe out the current command history list
save_history <range> <file>
               write commands from the history to file.
               The range is given as <from>-<to>, where <from> and <to>
               may be empty. Example: save_history 100- in.recent
source <file>  read commands from file (same as "include")
pwd            print current working directory
cd <directory> change current working directory (same as pwd if no directory)
mem            print current and maximum memory usage
|<command>     execute <command> as a shell command and return to the command prompt
exit           exit the LAMMPS shell cleanly (unlike the "quit" command)

Please note that some known shell operations are implemented in the LAMMPS
      shell command in a platform neutral fashion, while using the "|"
      character will always pass the following text to the operating system's shell
      command.

Readline customization

The behavior of the readline functionality can be customized in the
      ${HOME}/.inputrc file.  This can be used to alter the default
      settings or change the key-bindings.  The LAMMPS Shell sets the
      application name lammps-shell, so settings can be either applied
      globally or only for the LAMMPS shell by bracketing them between

$if lammps-shell
# disable "beep" or "screen flash"
set bell-style none
# bind the "Insert" key to toggle overwrite mode
"\e[2~": overwrite-mode
$endif

More details about this are in the readline documentation.

LAMMPS Shell tips and tricks

Enable tilde expansion

Adding set expand-tilde on to ${HOME}/.inputrc is recommended as
this will change the filename expansion behavior to replace any text
starting with "~" by the full path to the corresponding user's home
directory.  While the expansion of filenames will happen on all
arguments where the context is not known (e.g. ~/compile/lamm<TAB>
will expand to ~/compile/lammps/), it will not replace the tilde by
default.  But since LAMMPS does not do tilde expansion itself (unlike a
shell), this will result in errors.  Instead the tilde-expression should
be expanded into a valid path, where the plain "~/" stands for the
current user's home directory and "~someuser/" stands for
"/home/someuser" or whatever the full path to that user's home directory
is.

File extension association

Since the LAMMPS shell (unlike the regular LAMMPS executable) does not
exit when an input file is passed on the command line with the "-in" or
"-i" flag (the behavior is like for python -i <filename>), it makes
the LAMMPS shell suitable for associating it with input files based on
their filename extension (e.g. ".lmp").  Since lammps-shell is a
console application, you have to run it inside a terminal program with a
command line like this:

xterm -title "LAMMPS Shell" -e /path/to/lammps-shell -i in.file.lmp

Use history create input file

When experimenting with commands to interactively to figure out a
suitable choice of settings or simply the correct syntax, you may want
to record part of your commands to a file for later use.  This can be
done with the save_history commands, which allows to selectively
write a section of the command history to a file (Example:
save_history 25-30 in.run).  This file can be further edited
(Example: |vim in.run) and then the file read back in and tried out
(Example: source in.run).  If the input also creates a system box,
you first need to use the clear command command.

Last modified: Sat Oct 17 02:33:02 UTC 2020 by akohlmey


text:
from enum import Enum

class JumpStatementType(Enum):
    BREAK = 'break'
    CONTINUE = 'continue'
    RETURN = 'return'

    def __str__(self):
        return 'type(' + self.value + ')'


text:
/**
 * The data for this file was constructed from:
 * ```
 * cd ~/projects/clones/vscode/extensions
 * find . -type f -iname package.json -exec pcregrep -M '(?:"id":.*)|(?:"extensions":[^\]]+)' {} \; > ~/projects/cspell/src/languageIds.txt`
 * ```
 */

// cspell:ignore cljs cljx cson iname pcregrep fsscript gradle shtml xhtml mdoc aspx jshtm gitconfig bowerrc
// cspell:ignore jshintrc jscsrc eslintrc babelrc webmanifest mdown markdn psgi phtml pssc psrc gypi rhistory
// cspell:ignore rprofile cshtml gemspec cginc ebuild zshrc zprofile zlogin zlogout zshenv dsql ascx axml
// cspell:ignore bpmn csproj dita ditamap dtml fsproj fxml isml mxml adoc

export interface LanguageExtensionDefinition {
    id: string;
    /** List of extensions starting with '.' */
    extensions: string[];
    /** Filenames that do not have an extension or have a different type than their implied extension */
    filenames?: string[];
}
export type LanguageDefinition = LanguageExtensionDefinition;
export type LanguageDefinitions = LanguageDefinition[];
export type ExtensionToLanguageIdMapSet = Map<string, Set<string>>;
export type ExtensionToLanguageIdMap = Map<string, string[]>;

export const languageExtensionDefinitions: LanguageDefinitions = [
    { id: 'ada', extensions: ['.adb', '.ads'] },
    { id: 'apiblueprint', extensions: ['.apib', '.apiblueprint'] },
    { id: 'asciidoc', extensions: ['.adoc', '.asc', '.asciidoc'] },
    { id: 'bat', extensions: ['.bat', '.cmd'] },
    { id: 'clojure', extensions: ['.clj', '.cljs', '.cljx', '.clojure', '.edn'] },
    { id: 'coffeescript', extensions: ['.coffee', '.cson'] },
    { id: 'c', extensions: ['.c'] },
    {
        id: 'cpp',
        extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx', '.h', '.mm', '.ino', '.inl'],
    },
    { id: 'csharp', extensions: ['.cs'] },
    { id: 'css', extensions: ['.css'] },
    { id: 'diff', extensions: ['.diff', '.patch', '.rej'] },
    { id: 'dockerfile', extensions: ['.dockerfile'] },
    { id: 'elixir', extensions: ['.ex', '.exs'] },
    { id: 'fsharp', extensions: ['.fs', '.fsi', '.fsx', '.fsscript'] },
    { id: 'go', extensions: ['.go'] },
    { id: 'groovy', extensions: ['.groovy', '.gvy', '.gradle'] },
    { id: 'handlebars', extensions: ['.handlebars', '.hbs'] },
    { id: 'haskell', extensions: ['.hs', '.lhs'] },
    {
        id: 'html',
        extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm', '.volt', '.vue'],
    },
    { id: 'ini', extensions: ['.ini'] },
    { id: 'properties', extensions: ['.properties', '.gitconfig', '.cfg', '.conf'] },
    { id: 'jade', extensions: ['.jade', '.pug'] },
    { id: 'java', extensions: ['.java', '.jav'] },
    { id: 'javascriptreact', extensions: ['.jsx'] },
    { id: 'javascript', extensions: ['.js', '.mjs', '.es6', '.cjs'] },
    {
        id: 'json',
        extensions: ['.json', '.jsonc', '.bowerrc', '.jshintrc', '.jscsrc', '.eslintrc', '.babelrc', '.webmanifest'],
    },
    { id: 'jsonc', extensions: ['.jsonc'] },
    { id: 'jsonc', extensions: [], filenames: ['.code-workspace'] },
    { id: 'less', extensions: ['.less'] },
    { id: 'literate haskell', extensions: ['.lhs'] },
    { id: 'lua', extensions: ['.lua'] },
    { id: 'makefile', extensions: ['.mk'] },
    { id: 'markdown', extensions: ['.md', '.mdown', '.markdown', '.markdn'] },
    { id: 'mdx', extensions: ['.mdx'] },
    { id: 'objective-c', extensions: ['.m'] },
    { id: 'perl', extensions: ['.pl', '.pm', '.pod', '.t', '.PL', '.psgi'] },
    { id: 'perl6', extensions: ['.p6', '.pl6', '.pm6', '.nqp'] },
    { id: 'php', extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'] },
    { id: 'plaintext', extensions: ['.txt'] },
    { id: 'powershell', extensions: ['.ps1', '.psm1', '.psd1', '.pssc', '.psrc'] },
    { id: 'python', extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'] },
    { id: 'r', extensions: ['.r', '.rhistory', '.rprofile', '.rt'] },
    { id: 'razor', extensions: ['.cshtml'] },
    { id: 'ruby', extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.rake', '.ru'] },
    { id: 'ruby', extensions: [], filenames: ['Gemfile'] },
    { id: 'rust', extensions: ['.rs'] },
    { id: 'scala', extensions: ['.scala', '.sc'] },
    { id: 'scss', extensions: ['.scss'] },
    { id: 'shaderlab', extensions: ['.shader', '.cginc'] },
    {
        id: 'shellscript',
        extensions: [
            '.sh',
            '.bash',
            '.bashrc',
            '.bash_aliases',
            '.bash_profile',
            '.bash_login',
            '.ebuild',
            '.install',
            '.profile',
            '.bash_logout',
            '.zsh',
            '.zshrc',
            '.zprofile',
            '.zlogin',
            '.zlogout',
            '.zshenv',
            '.zsh-theme',
        ],
    },
    { id: 'sql', extensions: ['.sql', '.dsql'] },
    { id: 'swift', extensions: ['.swift'] },
    { id: 'toml', extensions: ['.toml'] },
    { id: 'typescript', extensions: ['.ts'] },
    { id: 'typescriptreact', extensions: ['.tsx'] },
    { id: 'vb', extensions: ['.vb', '.brs', '.vbs', '.bas'] },
    {
        id: 'xml',
        extensions: [
            '.ascx',
            '.atom',
            '.axml',
            '.bpmn',
            '.config',
            '.cpt',
            '.csl',
            '.csproj.user',
            '.csproj',
            '.dita',
            '.ditamap',
            '.dtd',
            '.dtml',
            '.ent',
            '.fsproj',
            '.fxml',
            '.iml',
            '.isml',
            '.jmx',
            '.launch',
            '.menu',
            '.mod',
            '.mxml',
            '.nuspec',
            '.opml',
            '.owl',
            '.proj',
            '.pt',
            '.pubxml.user',
            '.pubxml',
            '.rdf',
            '.rng',
            '.rss',
            '.shproj',
            '.storyboard',
            '.svg',
            '.targets',
            '.tld',
            '.tmx',
            '.vbproj.user',
            '.vbproj',
            '.vcxproj.filters',
            '.vcxproj',
            '.wsdl',
            '.wxi',
            '.wxl',
            '.wxs',
            '.xaml',
            '.xbl',
            '.xib',
            '.xlf',
            '.xliff',
            '.xml',
            '.xoml',
            '.xpdl',
            '.xsd',
            '.xul',
        ],
    },
    { id: 'xsl', extensions: ['.xsl', '.xslt'] },
    { id: 'yaml', extensions: ['.eyaml', '.eyml', '.yaml', '.yml'] },
    { id: 'latex', extensions: ['.tex'] },
    { id: 'map', extensions: ['.map'] },
    { id: 'pdf', extensions: ['.pdf'] },

    //
    // Special file types used to prevent spell checking.
    //
    { id: 'image', extensions: ['.jpg', '.png', '.jpeg', '.tiff', '.bmp', '.gif', '.ico'] },
    // cspell:ignore woff
    {
        id: 'binary',
        extensions: ['.gz', '.exe', '.dll', '.lib', '.obj', '.o', '.eot', '.cur', '.zip'],
    },
    {
        id: 'fonts',
        extensions: ['.ttf', '.woff', '.woff2'],
    },
    {
        id: 'video',
        extensions: ['.mov', '.mpg'],
    },
    {
        id: 'lock',
        extensions: ['.lock'],
        filenames: ['package-lock.json'],
    },
    {
        id: 'cache_files',
        extensions: [],
        // cspell:ignore eslintcache
        filenames: ['.cspellcache', '.DS_Store', '.eslintcache'],
    },
];

export type LanguageId = string;

export const binaryLanguages = new Set(['binary', 'image', 'video', 'fonts']);

export const generatedFiles = new Set([...binaryLanguages, 'map', 'lock', 'pdf', 'cache_files']);

export const languageIds: LanguageId[] = languageExtensionDefinitions.map(({ id }) => id);

const mapExtensionToSetOfLanguageIds: ExtensionToLanguageIdMapSet =
    buildLanguageExtensionMapSet(languageExtensionDefinitions);
const mapExtensionToLanguageIds: ExtensionToLanguageIdMap =
    buildExtensionToLanguageIdMap(mapExtensionToSetOfLanguageIds);

export function isBinaryExt(ext: string): boolean {
    return isBinary(getLanguagesForExt(ext));
}

export function isBinaryFile(basename: string): boolean {
    return isBinary(getLanguagesForFilename(basename));
}

export function isBinary(languageId: LanguageId | LanguageId[] | Iterable<LanguageId>): boolean {
    return doesSetContainAnyOf(binaryLanguages, languageId);
}

export function isGeneratedExt(ext: string): boolean {
    return isGenerated(getLanguagesForExt(ext));
}

export function isGeneratedFile(basename: string): boolean {
    return isGenerated(getLanguagesForFilename(basename));
}

export function isGenerated(languageId: LanguageId | LanguageId[] | Iterable<LanguageId>): boolean {
    return doesSetContainAnyOf(generatedFiles, languageId);
}

function doesSetContainAnyOf(
    setOfIds: Set<LanguageId>,
    languageId: LanguageId | LanguageId[] | Iterable<LanguageId>
): boolean {
    if (typeof languageId === 'string') {
        return setOfIds.has(languageId);
    }
    for (const id of languageId) {
        if (setOfIds.has(id)) {
            return true;
        }
    }
    return false;
}

export function buildLanguageExtensionMapSet(defs: LanguageDefinitions): ExtensionToLanguageIdMapSet {
    return defs.reduce((map, def) => {
        function getMapSet(value: string) {
            const found = map.get(value);
            if (found) return found;
            const s = new Set<string>();
            map.set(value, s);
            return s;
        }
        function addId(value: string) {
            getMapSet(value).add(def.id);
        }

        def.extensions.forEach(addId);
        def.filenames?.forEach(addId);
        return map;
    }, new Map<string, Set<string>>());
}

function buildExtensionToLanguageIdMap(map: ExtensionToLanguageIdMapSet): ExtensionToLanguageIdMap {
    return new Map([...map].map(([k, s]) => [k, [...s]]));
}

export function getLanguagesForExt(ext: string): string[] {
    return mapExtensionToLanguageIds.get(ext) || mapExtensionToLanguageIds.get('.' + ext) || [];
}

export function getLanguagesForFilename(basename: string): string[] {
    const found = mapExtensionToLanguageIds.get(basename);
    if (found) return found;
    const pos = basename.lastIndexOf('.');
    if (pos < 1) return [];
    return getLanguagesForExt(basename.slice(pos));
}


text:
package edu.cmu.ml.rtw.generic.task.classify.meta;

import java.util.Map;

import edu.cmu.ml.rtw.generic.data.annotation.DataSet;
import edu.cmu.ml.rtw.generic.data.annotation.Datum.Tools.DataSetBuilder;
import edu.cmu.ml.rtw.generic.data.annotation.DatumContext;
import edu.cmu.ml.rtw.generic.parse.AssignmentList;
import edu.cmu.ml.rtw.generic.parse.Obj;
import edu.cmu.ml.rtw.generic.task.classify.MethodClassification;
import edu.cmu.ml.rtw.generic.task.classify.TaskClassification;

public class DataSetBuilderMetaClassification extends DataSetBuilder<PredictionClassificationDatum<Boolean>, Boolean> {
	private TaskClassification<?, ?> task;
	private MethodClassification<?, ?> method;
	private String[] parameterNames = { "task", "method" };

	private Obj methodRef;
	private Obj taskRef;

	public DataSetBuilderMetaClassification() {

	}

	public DataSetBuilderMetaClassification(DatumContext<PredictionClassificationDatum<Boolean>, Boolean> context) {
		this.context = context;
	}

	@Override
	public String[] getParameterNames() {
		return this.parameterNames;
	}

	@Override
	public Obj getParameterValue(String parameter) {
		if (parameter.equals("task")) {
			return (this.task == null) ? null : this.taskRef;
		} else if (parameter.equals("method"))
			return (this.method == null) ? null : this.methodRef;
		else
			return this.method.getParameterValue(parameter);
	}

	@Override
	public boolean setParameterValue(String parameter, Obj parameterValue) {
		if (parameter.equals("task")) {
			this.taskRef = parameterValue;
			this.task = (parameterValue == null) ? null : this.context.getMatchClassifyTask(parameterValue);
		} else if (parameter.equals("method")) {
			this.methodRef = parameterValue;
			this.method = (parameterValue == null) ? null : this.context.getMatchClassifyMethod(parameterValue);
		} else
			return this.method.setParameterValue(parameter, parameterValue);
		return true;
	}

	@Override
	public DataSetBuilder<PredictionClassificationDatum<Boolean>, Boolean> makeInstance(DatumContext<PredictionClassificationDatum<Boolean>, Boolean> context) {
		return new DataSetBuilderMetaClassification(context);
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
	public DataSet<PredictionClassificationDatum<Boolean>, Boolean> build() {
		DataSet<PredictionClassificationDatum<Boolean>, Boolean> data = new DataSet<PredictionClassificationDatum<Boolean>, Boolean>(this.context.getDatumTools());

		Map<?, PredictionClassification> predictions = ((MethodClassification)this.method).predict(this.task);
		for (PredictionClassification prediction : predictions.values()) {
			if (prediction.getLabel() == null)
				continue;
			data.add(new PredictionClassificationDatum<Boolean>(
					this.context.getDataTools().getIncrementId(),
					prediction,
					prediction.getLabel().equals(prediction.getDatum().getLabel())
					));
		}

		return data;
	}

	@Override
	protected boolean fromParseInternal(AssignmentList internalAssignments) {
		return true;
	}

	@Override
	protected AssignmentList toParseInternal() {
		return null;
	}

	@Override
	public String getGenericName() {
		return "MetaClassification";
	}

}


text:
import { hooks } from 'botframework-webchat-component';
import React, { useCallback } from 'react';

const { useSendPostBack } = hooks;

const PostBackButton = ({ cardAction: { title, value } }) => {
  const sendPostBack = useSendPostBack();
  const handleClick = useCallback(() => sendPostBack(value), [value, sendPostBack]);

  return (
    <button
      // Web Chat does the heavylifting for us by exposing a "sendPostBack" function.
      onClick={handleClick}
      type="button"
    >
      PostBack: {title}
    </button>
  );
};

export default PostBackButton;