text:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <xtables.h>
#include <linux/netfilter/xt_string.h>

enum {
	O_FROM = 0,
	O_TO,
	O_ALGO,
	O_ICASE,
	O_STRING,
	O_HEX_STRING,
	F_STRING     = 1 << O_STRING,
	F_HEX_STRING = 1 << O_HEX_STRING,
	F_OP_ANY     = F_STRING | F_HEX_STRING,
};

static void string_help(void)
{
	printf(
"string match options:\n"
"--from                       Offset to start searching from\n"
"--to                         Offset to stop searching\n"
"--algo                       Algorithm\n"
"--icase                      Ignore case (default: 0)\n"
"[!] --string string          Match a string in a packet\n"
"[!] --hex-string string      Match a hex string in a packet\n");
}

#define s struct xt_string_info
static const struct xt_option_entry string_opts[] = {
	{.name = "from", .id = O_FROM, .type = XTTYPE_UINT16,
	 .flags = XTOPT_PUT, XTOPT_POINTER(s, from_offset)},
	{.name = "to", .id = O_TO, .type = XTTYPE_UINT16,
	 .flags = XTOPT_PUT, XTOPT_POINTER(s, to_offset)},
	{.name = "algo", .id = O_ALGO, .type = XTTYPE_STRING,
	 .flags = XTOPT_MAND | XTOPT_PUT, XTOPT_POINTER(s, algo)},
	{.name = "string", .id = O_STRING, .type = XTTYPE_STRING,
	 .flags = XTOPT_INVERT, .excl = F_HEX_STRING},
	{.name = "hex-string", .id = O_HEX_STRING, .type = XTTYPE_STRING,
	 .flags = XTOPT_INVERT, .excl = F_STRING},
	{.name = "icase", .id = O_ICASE, .type = XTTYPE_NONE},
	XTOPT_TABLEEND,
};
#undef s

static void string_init(struct xt_entry_match *m)
{
	struct xt_string_info *i = (struct xt_string_info *) m->data;

	i->to_offset = UINT16_MAX;
}

static void
parse_string(const char *s, struct xt_string_info *info)
{
	/* xt_string does not need \0 at the end of the pattern */
	if (strlen(s) <= XT_STRING_MAX_PATTERN_SIZE) {
		strncpy(info->pattern, s, XT_STRING_MAX_PATTERN_SIZE);
		info->patlen = strnlen(s, XT_STRING_MAX_PATTERN_SIZE);
		return;
	}
	xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
}

static void
parse_hex_string(const char *s, struct xt_string_info *info)
{
	int i=0, slen, sindex=0, schar;
	short hex_f = 0, literal_f = 0;
	char hextmp[3];

	slen = strlen(s);

	if (slen == 0) {
		xtables_error(PARAMETER_PROBLEM,
			"STRING must contain at least one char");
	}

	while (i < slen) {
		if (s[i] == '\\' && !hex_f) {
			literal_f = 1;
		} else if (s[i] == '\\') {
			xtables_error(PARAMETER_PROBLEM,
				"Cannot include literals in hex data");
		} else if (s[i] == '|') {
			if (hex_f)
				hex_f = 0;
			else {
				hex_f = 1;
				/* get past any initial whitespace just after the '|' */
				while (s[i+1] == ' ')
					i++;
			}
			if (i+1 >= slen)
				break;
			else
				i++;  /* advance to the next character */
		}

		if (literal_f) {
			if (i+1 >= slen) {
				xtables_error(PARAMETER_PROBLEM,
					"Bad literal placement at end of string");
			}
			info->pattern[sindex] = s[i+1];
			i += 2;  /* skip over literal char */
			literal_f = 0;
		} else if (hex_f) {
			if (i+1 >= slen) {
				xtables_error(PARAMETER_PROBLEM,
					"Odd number of hex digits");
			}
			if (i+2 >= slen) {
				/* must end with a "|" */
				xtables_error(PARAMETER_PROBLEM, "Invalid hex block");
			}
			if (! isxdigit(s[i])) /* check for valid hex char */
				xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i]);
			if (! isxdigit(s[i+1])) /* check for valid hex char */
				xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i+1]);
			hextmp[0] = s[i];
			hextmp[1] = s[i+1];
			hextmp[2] = '\0';
			if (! sscanf(hextmp, "%x", &schar))
				xtables_error(PARAMETER_PROBLEM,
					"Invalid hex char `%c'", s[i]);
			info->pattern[sindex] = (char) schar;
			if (s[i+2] == ' ')
				i += 3;  /* spaces included in the hex block */
			else
				i += 2;
		} else {  /* the char is not part of hex data, so just copy */
			info->pattern[sindex] = s[i];
			i++;
		}
		if (sindex > XT_STRING_MAX_PATTERN_SIZE)
			xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
		sindex++;
	}
	info->patlen = sindex;
}

static void string_parse(struct xt_option_call *cb)
{
	struct xt_string_info *stringinfo = cb->data;
	const unsigned int revision = (*cb->match)->u.user.revision;

	xtables_option_parse(cb);
	switch (cb->entry->id) {
	case O_STRING:
		parse_string(cb->arg, stringinfo);
		if (cb->invert) {
			if (revision == 0)
				stringinfo->u.v0.invert = 1;
			else
				stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT;
		}
		break;
	case O_HEX_STRING:
		parse_hex_string(cb->arg, stringinfo);  /* sets length */
		if (cb->invert) {
			if (revision == 0)
				stringinfo->u.v0.invert = 1;
			else
				stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT;
		}
		break;
	case O_ICASE:
		if (revision == 0)
			xtables_error(VERSION_PROBLEM,
				   "Kernel doesn't support --icase");

		stringinfo->u.v1.flags |= XT_STRING_FLAG_IGNORECASE;
		break;
	}
}

static void string_check(struct xt_fcheck_call *cb)
{
	if (!(cb->xflags & F_OP_ANY))
		xtables_error(PARAMETER_PROBLEM,
			   "STRING match: You must specify `--string' or "
			   "`--hex-string'");
}

/* Test to see if the string contains non-printable chars or quotes */
static unsigned short int
is_hex_string(const char *str, const unsigned short int len)
{
	unsigned int i;
	for (i=0; i < len; i++)
		if (! isprint(str[i]))
			return 1;  /* string contains at least one non-printable char */
	/* use hex output if the last char is a "\" */
	if ((unsigned char) str[len-1] == 0x5c)
		return 1;
	return 0;
}

/* Print string with "|" chars included as one would pass to --hex-string */
static void
print_hex_string(const char *str, const unsigned short int len)
{
	unsigned int i;
	/* start hex block */
	printf("\"|");
	for (i=0; i < len; i++) {
		/* see if we need to prepend a zero */
		if ((unsigned char) str[i] <= 0x0F)
			printf("0%x", (unsigned char) str[i]);
		else
			printf("%x", (unsigned char) str[i]);
	}
	/* close hex block */
	printf("|\" ");
}

static void
print_string(const char *str, const unsigned short int len)
{
	unsigned int i;
	printf(" \"");
	for (i=0; i < len; i++) {
		if ((unsigned char) str[i] == 0x22)  /* escape any embedded quotes */
			printf("%c", 0x5c);
		printf("%c", (unsigned char) str[i]);
	}
	printf("\"");  /* closing quote */
}

static void
string_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
	const struct xt_string_info *info =
	    (const struct xt_string_info*) match->data;
	const int revision = match->u.user.revision;
	int invert = (revision == 0 ? info->u.v0.invert :
				    info->u.v1.flags & XT_STRING_FLAG_INVERT);

	if (is_hex_string(info->pattern, info->patlen)) {
		printf(" STRING match %s", invert ? "!" : "");
		print_hex_string(info->pattern, info->patlen);
	} else {
		printf(" STRING match %s", invert ? "!" : "");
		print_string(info->pattern, info->patlen);
	}
	printf(" ALGO name %s", info->algo);
	if (info->from_offset != 0)
		printf(" FROM %u", info->from_offset);
	if (info->to_offset != 0)
		printf(" TO %u", info->to_offset);
	if (revision > 0 && info->u.v1.flags & XT_STRING_FLAG_IGNORECASE)
		printf(" ICASE");
}

static void string_save(const void *ip, const struct xt_entry_match *match)
{
	const struct xt_string_info *info =
	    (const struct xt_string_info*) match->data;
	const int revision = match->u.user.revision;
	int invert = (revision == 0 ? info->u.v0.invert :
				    info->u.v1.flags & XT_STRING_FLAG_INVERT);

	if (is_hex_string(info->pattern, info->patlen)) {
		printf("%s --hex-string", (invert) ? " !" : "");
		print_hex_string(info->pattern, info->patlen);
	} else {
		printf("%s --string", (invert) ? " !": "");
		print_string(info->pattern, info->patlen);
	}
	printf(" --algo %s", info->algo);
	if (info->from_offset != 0)
		printf(" --from %u", info->from_offset);
	if (info->to_offset != 0)
		printf(" --to %u", info->to_offset);
	if (revision > 0 && info->u.v1.flags & XT_STRING_FLAG_IGNORECASE)
		printf(" --icase");
}

static struct xtables_match string_mt_reg[] = {
	{
		.name          = "string",
		.revision      = 0,
		.family        = NFPROTO_UNSPEC,
		.version       = XTABLES_VERSION,
		.size          = XT_ALIGN(sizeof(struct xt_string_info)),
		.userspacesize = offsetof(struct xt_string_info, config),
		.help          = string_help,
		.init          = string_init,
		.print         = string_print,
		.save          = string_save,
		.x6_parse      = string_parse,
		.x6_fcheck     = string_check,
		.x6_options    = string_opts,
	},
	{
		.name          = "string",
		.revision      = 1,
		.family        = NFPROTO_UNSPEC,
		.version       = XTABLES_VERSION,
		.size          = XT_ALIGN(sizeof(struct xt_string_info)),
		.userspacesize = offsetof(struct xt_string_info, config),
		.help          = string_help,
		.init          = string_init,
		.print         = string_print,
		.save          = string_save,
		.x6_parse      = string_parse,
		.x6_fcheck     = string_check,
		.x6_options    = string_opts,
	},
};

void _init(void)
{
	xtables_register_matches(string_mt_reg, ARRAY_SIZE(string_mt_reg));
}


text:
ActiveRecord::Schema.define(version: 20150509155953) do

  create_table "tweets", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.text     "body"
    t.integer  "user_id"
  end

  create_table "users", force: :cascade do |t|
    t.string   "provider"
    t.string   "uid"
    t.string   "name"
    t.string   "token"
    t.string   "secret"
    t.string   "profile_image"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
  end

end

redpajama_set_name: RedPajamaGithub


text:
require 'uri'
require 'open-uri'
require 'posix/spawn'

module AirbrakeApi
  class SourceMapConsumer
    class << self
      def process(backtrace_line)
        minified_url = backtrace_line['file']

        minified_url_path = file_name(minified_url)

        js_mapping = JsMapping.find_or_create(minified_url_path)

        unless js_mapping.source_map_url_path
          js_mapping.source_map_url_path = get_source_map_url(minified_url)
          js_mapping.save!

          download_map_file(asset_url(minified_url, js_mapping.source_map_url_path)) unless js_mapping.source_map_url_path == 'none'
        end

        if js_mapping.source_map_url_path == 'none'
          backtrace_line
        else
          map_file_path = file_path(file_name(js_mapping.source_map_url_path), maps_folder)
          map_line = backtrace_line['line']
          map_column = backtrace_line['column']

          # node_path = POSIX::Spawn::Child.new("which node").out.gsub(/\n/, '')
          node_path = '/home/deployer/.nvm/versions/node/v6.1.0/bin/node'

          string = "#{ node_path } node/map_consumer.js '#{ map_file_path }' #{ map_line } #{ map_column }"

          result = POSIX::Spawn::Child.new("#{ node_path } node/map_consumer.js '#{ map_file_path }' #{ map_line } #{ map_column }")
          parsed = JSON.parse(result.out)

          if parsed&.dig('line').blank?
            result = POSIX::Spawn::Child.new("#{ node_path } node/map_consumer.js '#{ map_file_path }' #{ map_column } #{ map_line }")
            parsed = JSON.parse(result.out)
          end

          if parsed&.dig('line').present?
            {
              'function' => parsed['name'],
              'file' =>   asset_url(minified_url, parsed['source']),
              'line' => parsed['line'],
              'column' => parsed['column']
            }
          else
            HoptoadNotifier.notify(Exception.new("Can't parse map"), {
              parameters: backtrace_line.merge({
                posix: result.out,
                posix_err: result.err,
                string: string,
                ex: %x{#{ string }}
              })
            })
            backtrace_line
          end
        end
      end

      private

      def asset_url(minified_url, path)
        url = URI.parse(minified_url)
        url.path = path
        url.to_s
      end

      def get_source_map_url(minified_url)
        minified_path = download_minified_file(minified_url)
        content = File.read(minified_path)
        mapping = content.match("//# sourceMappingURL=(.*)[\\s]*$")
        mapping&.size == 2 ? mapping[1] : 'none'
      end

      def download_minified_file(url)
        download_file(url, minified_folder)
      end

      def download_map_file(url)
        download_file(url, maps_folder)
      end

      def download_file(url, folder)
        file_name = file_name(url)
        file_path = file_path(file_name, folder)

        File.open(file_path, "wb") do |saved_file|
          open(url, "rb") do |read_file|
            saved_file.write(read_file.read)
          end
        end

        file_path
      end

      def file_name(url)
        uri = URI.parse(url)
        File.basename(uri.path)
      end

      def file_path(file_name, folder)
        File.join(folder, file_name)
      end

      def minified_folder
        @minified_folder ||= begin
          folder = File.join(Rails.root, 'tmp', 'minified_js')
          FileUtils.mkdir_p folder
          folder
        end
      end

      def maps_folder
        @maps_folder ||= begin
          folder = File.join(Rails.root, 'tmp', 'maps_js')
          FileUtils.mkdir_p folder
          folder
        end
      end
    end
  end
end


text:
package student;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;

public class StudentWindow extends Frame implements ActionListener
{
    private Button btnButton;

    private TextField tfStudentName = new TextField(20);
    private TextField tfID = new TextField(10);
    private TextField tfTest1 = new TextField(10);
    private TextField tfTest2 = new TextField(10);
    private TextField tfTest3 = new TextField(10);
    private TextField tfProject = new TextField(10);
    private TextField tfavg = new TextField(10);

    //Processing variable
    studentClass studentwindowtest = new studentClass();
    DataInputStream DataFile;

    public StudentWindow( )
    {
        setTitle ("Student Grades");
        setLayout ( new FlowLayout( ));

        add(new Label("Student Name:"));
        add( tfStudentName);
         add(new Label("StudentID"));
        add( tfID);
        add(new Label("Test1 "));
        add( tfTest1);
        add(new Label(" Test2 "));
        add( tfTest2);
        add(new Label(" Test3 "));
        add( tfTest3);
        add(new Label("Project "));
        add( tfProject);
        add(new Label("  AVG "));
        add( tfavg);

        btnButton = new Button("Get Student");
        add (btnButton);
        btnButton.addActionListener(new ButtonHandler(this));
        openFile();

	addWindowListener( new CloseWindow( ));
    }// public StudentWindow( )

    class ButtonHandler implements ActionListener
    {
        StudentWindow f;
        ButtonHandler(StudentWindow pf)
        { f = pf;}
        public void actionPerformed (ActionEvent event)
        {
              f.buttonMethod( );
              f.repaint( );
        }// actionPerformed (ActionEvent event)
    }// ButtonHandler

    void loadStudent()
    {

        String Name = null;
        String ID = null;
        int igrade1 = 0;
        int igrade2 = 0;
        int igrade3 = 0;

        String OneLine;
        StringTokenizer strtok ;
        try{
        OneLine = (String)DataFile.readLine();
    {
        strtok = new StringTokenizer(OneLine);
          while (strtok.hasMoreTokens())
          {

              Name = strtok.nextToken();
              ID = strtok.nextToken();
              igrade1 = Integer.parseInt(strtok.nextToken());
              igrade2 = Integer.parseInt(strtok.nextToken());
              igrade3 = Integer.parseInt(strtok.nextToken());

          }
	System.out.println("Line: " + OneLine);
    }//while
        }//try
    catch (Exception e)
    {System.out.println("Error Opening file");}

        studentwindowtest.setName(Name);
        studentwindowtest.setID(ID);
        studentwindowtest.setTestScore1(igrade1);
        studentwindowtest.setTestScore2(igrade2);
        studentwindowtest.setTestScore3(igrade3);

    }
    void displayStudent()
    {
        tfStudentName.setText(studentwindowtest.getName());
        tfID.setText(studentwindowtest.getID());
        tfTest1.setText(String.valueOf(studentwindowtest.getTestScore1()));
        tfTest2.setText(String.valueOf(studentwindowtest.getTestScore2()));
        tfTest3.setText(String.valueOf(studentwindowtest.getTestScore3()));
        tfProject.setText(String.valueOf(studentwindowtest.letter(studentwindowtest.average(studentwindowtest.getTestScore1(),studentwindowtest.getTestScore2(),studentwindowtest.getTestScore3()))));
        tfavg.setText(String.valueOf(studentwindowtest.average(studentwindowtest.getTestScore1(),studentwindowtest.getTestScore2(),studentwindowtest.getTestScore3())));

    }

    void buttonMethod( )
    {
        //What button does
        loadStudent();
        displayStudent();
    }// buttonMethod( )

     void openFile()
    {
            try
    {
      FileInputStream instream = new FileInputStream("/home/geass/grades.txt");
	 DataFile = new DataInputStream(instream);
            }//try
    catch (Exception e)
    {System.out.println("Error Opening file");}
    }

    public void actionPerformed (ActionEvent event)
    {
        repaint( );
    }// actionPerformed

    public class CloseWindow extends WindowAdapter
    {
        public void windowClosing(WindowEvent e)
        {
            System.exit(0);
        }
    }// CloseWindow
}// class StudentWindow


text:
from __future__ import print_function
import json
import sqlite3

db = sqlite3.connect("test.db")
cursor = db.cursor()

print("Creating tables")

cursor.execute('''
CREATE TABLE artist(
  artistid    INTEGER PRIMARY KEY AUTOINCREMENT,
  artistname  TEXT
);''')

cursor.execute('''
CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER     -- Must map to an artist.artistid!
);''')

print("Filling up values")

with open('artists.json') as f:
    data = json.loads(f.read())
    cursor.executemany('''
    insert into artist (artistid, artistname)
    values (:artistid, :artistname)
    ''', data)

with open('tracks.json') as f:
    data = json.loads(f.read())
    cursor.executemany('''
    insert into track (trackid, trackname, trackartist)
    values (:trackid, :trackname, :trackartist)
    ''', data)

db.commit()
cursor.close()
db.close()


text:
"""
This a nonuniform sampler with ANGIE sampling scheme. |br|

The modules samples the given signals nonuniformly. |br|
The sampling patterns are generated using ANGIE scheme.

The used ANGIE patterns generator is described further in
"Generation and Analysis of Constrained Random Sampling Patterns",
available in arXiv: http://arxiv.org/abs/1409.1002

*Examples*:
    Please go to the *examples/acquisitions* directory for examples on how to
    use the sampler. |br|

*Settings*:
    Parameters of the sampler are described below.

    Take a look on '__parametersDefine' function for more info on the
    parameters.

    Parameters of the sampler are attributes of the class which must/can
    be set before the sampler is run.

    Required parameters:

    - a. **mSig** (*Numpy array 2D*): Input signals

    - b. **tS** (*float*): time of input signals

    - d. **fR** (*float*): input signals' representation sampling frequency

    - d. **Tg** (*float*): patterns sampling grid

    - e. **fSamp** (*float*): the requested average sampling frequency of the sampling patterns

    Optional parameters:

    - f. **iSigma** (*float*):  variance of Gaussian random process
                                [default = 1]

    - g. **tMin** (*float*):    minimum allowed time between the sampling moments
                                [default = minium time not set]

    - h. **tMax** (*float*):    maximum allowed time between the sampling moments
                                [default = maximum time not set]

    - i. **bMute** (*int*):    mute the console output from the sampler [default = 0]

*Output*:
    Description of the sampler output is below.
    This is the list of attributes of the sampler class which are available
    after calling the 'run' method:

    Observed signals:
    - a. **mObSig** (*Numpy array 2D*): Observed sampled signals, one signal p. row
    - b. **lObSig** (List with Numpy arrays 1D)  Observed sampled signals, one signal p. list item.
                                                 Identical as mObSig.

    Sampling patterns:
    - b. **mPatts** (*Numpy array 2D*): Sampling patterns (as grid indices)
    - c. **lPatts** (*list with Numpy arrays 1D*):  List with sampling patterns (as grid indices).
                                                    One pattern p. list item

    - d. **mPattsRep** (*Numpy array 2D*):  Sampling patterns (as signal representaion points)
    - e. **lPattsRep** (*list with Numpy arrays 1D*):  List with sampling patterns (as signal representaion points).
                                                       One pattern p. list item

    - f. **mPattsT** (*Numpy array 2D*):   Sampling patterns (as time moments)
    - g. **lPattsT** (*list with Numpy arrays 1D*):  List with sampling patterns (as time moments).
                                                     One pattern p. list item

    Observation matrices:
    - h. **lPhi** (list)   List with observation matrices. One matrix p.
                           One matrix p. signal.

    Additional parameters of sampling patterns:
    - i. **nK_g**  (*int*): the number of grid points in the sampling pattern

    - j. **tTau_real** (*float*):   the real time of sampling patterns

    - k. **nK_s** (*int*):   the expected number of sampling points in a pattern

    - l. **f_s** (*float*):  the expected average sampling frequency

    - m. **nT** (*int*):   the expected average sampling period (as grid pts)

    - n  **tT_s**. (*float*):  the expected average sampling period

    - o. **nK_min** (*int*):   min t between the samp pts as the number of grid pts

    - q. **nK_max** (*int*):   max t between the samp pts as the number of grid pts

    - r. **tMin_real** (*float*):   the real minimum time between sampling points

    - s. **tMax_real** (*float*):   the real maximum time between sampling points

*Author*:
    Jacek Pierzchlewski, Aalborg University, Denmark. <jap@es.aau.dk>

*Version*:
    0.1    | 26-MAY-2014 :  *  Initial version. |br|
    0.2    | 27-MAY-2014 :  *  Docstrings added. |br|
    1.0    | 27-MAY-2014 :  *  Version 1.0 is ready. |br|
    1.1    | 11-JUN-2014 :  *  Observation matrices added to the output. |br|
    1.1r1  | 18-SEP-2014 :  *  Bug in checking time of patterns is fixed. |br|
    1.1r2  | 28-JAN-2015 :  *  Patterns generator adjusted to Numpy indexing. |br|
    2.0    | 13-AUG-2015 :  *  Objectified version (2.0) |br|
    2.1    | 17-AUG-2015 :  *  Observation matrices are gathered in list, not in 3D matrix |br|
    2.1r1  | 18-AUG-2015 :  *  Adjusted to RxCSObject v1.0 |br|
    2.2    | 24-AUG-2015 :  *  **lObSig**, **lPatts**, **lPattsRep**, **lPattsT** added to the output |br|
    2.2r1  | 20-JAN-2016 :  *  Grid / representation sampling frequency compatibility check is secured against
                               floating-point inaccuracy issues |br|

*License*:
    BSD 2-Clause
"""

from __future__ import division
import numpy as np
import math
import rxcs

class nonuniANGIE(rxcs._RxCSobject):

    def __init__(self, *args):
        rxcs._RxCSobject.__init__(self)    # Make it a RxCS object

        self.strRxCSgroup = 'Acquisition'       # Name of group of RxCS modules
        self.strModuleName = 'ANGIE sampler'    # Module name

        self.__inputSignals()          # Define input signals
        self.__parametersDefine()      # Define the parameters

    # Input signals
    def __inputSignals(self):

        # 1d/2d array with input signals, one signal p. row
        self.paramAddMan('mSig', 'Input signals')
        self.paramType('mSig', np.ndarray)
        self.paramTypeEl('mSig', (int, float))
        self.paramNDimLE('mSig', 2)

        # Time of input signals
        self.paramAddMan('tS', 'Time of input signals', unit='s')
        self.paramType('tS', (int, float))
        self.paramH('tS', 0)
        self.paramL('tS', np.inf)

        # Input signals representation sampling frequency
        self.paramAddMan('fR', 'Input signals representation sampling frequency', unit='Hz')
        self.paramType('fR', (int, float))
        self.paramH('fR', 0)
        self.paramL('fR', np.inf)

    # Define parameters
    def __parametersDefine(self):

        # Patterns sampling grid
        self.paramAddMan('Tg', 'Patterns sampling grid', unit='s')
        self.paramType('Tg', (int, float))   # Must be of int or float type
        self.paramH('Tg', 0)                 # Patterns sampling grid must be higher than zero
        self.paramL('Tg', np.inf)            # ...and lower than infinity

        # Requested sampling frequency
        self.paramAddMan('fSamp', 'Requested sampling frequency', unit='Hz')
        self.paramType('fSamp', (int, float))   # Must be of int or float type
        self.paramH('fSamp', 0)                 # Requested sampling frequency must be higher than zero
        self.paramL('fSamp', np.inf)            # ...and lower than infinity

        # Variance of Gaussian random process used by the pattern generator
        self.paramAddOpt('iSigma', 'Variance of Gaussian random process', default=1)
        self.paramType('iSigma', (int, float))   # Must be of int or float type
        self.paramH('iSigma', 0)                 # Variance must be higher than zero
        self.paramL('iSigma', np.inf)            # ...and lower than infinity

        # Minimum time between sampling points
        self.paramAddOpt('tMin', 'Minimum time between sampling points', default=np.nan, unit='s')
        self.paramType('tMin', (int, float))     # Must be of int or float type
        self.paramHE('tMin', 0)                  # Minimum time must be higher or equal to zero
        self.paramL('tMin', np.inf)              # ...and lower than infinity

        # Maximum time between sampling points
        self.paramAddOpt('tMax', 'Maximum time between sampling points', default=np.nan, unit='s')
        self.paramType('tMax', (int, float))     # Must be of int or float type
        self.paramH('tMax', 0)                   # Maximum time must be higher than zero

        # 'Mute the output' flag
        self.paramAddOpt('bMute', 'Mute the output', noprint=1, default=0)
        self.paramType('bMute', int)           # Must be of int type
        self.paramAllowed('bMute',[0, 1])      # It can be either 1 or 0

    # Run
    def run(self):

        self.parametersCheck()         # Check if all the needed partameters are in place and are correct
        self.parametersPrint()         # Print the values of parameters

        self.engineStartsInfo()  # Info that the engine starts
        self.__engine()          # Run the engine
        self.engineStopsInfo()   # Info that the engine ends
        return self.__dict__     # Return dictionary with the parameters

    # Engine of the function
    def __engine(self):

        self._computeParam()    # Compute parameters of sampling
        self._checkConf()       # Check configuration of sampling

        self._generatePatterns()     # Generate the sampling patterns
        self._sampleSignals()        # Sample the signals
        self._generObser()           # Generate the observation matrices
        return

    # Compute parameters
    def _computeParam(self):
        """
        This function computes parameters of sampling.

        Args:
            none

        Returns:
            none

            List of variables added by function to the object:

            nK_g (float):      the number of grid points in the sampling pattern
            tTau_real (float): the real time of sampling patterns
            nK_s (float):      the expected number of sampling points in a pattern
            f_s (float):       the expected average sampling frequency
            nT (float):        the expected average sampling period (as grid pts)
            tT_s (float):      the expected average sampling period
            nK_min (float):    min t between the samp pts as the number of grid pts
            nK_max (float):    max t between the samp pts as the number of grid pts
            tMin_real (float): the real minimum time between sampling points
            tMax_real (float): the real maximum time between sampling points
        """

        # Calculate the number of grid points in the sampling period
        nK_g = math.floor(self.tS / self.Tg)

        # Calculate the real time of sampling patterns
        tTau_real = nK_g * self.Tg

        # Calculate the expected number of sampling points in a pattern
        nK_s = int(round(tTau_real * self.fSamp))

        # Calculate the expected average sampling frequency
        f_s = nK_s / tTau_real

        # Calculate the expected average sampling period
        tT_s = 1 / f_s

        # Calculate the expected average sampling period and recalculate it to
        # the grid
        nT = int(math.ceil(1 / (f_s * self.Tg)))

        # Minimum time between the sampling points as the number of grid:
        if np.isnan(self.tMin):
            nK_min = 1
        else:
            nK_min = int(math.ceil(self.tMin / self.Tg))
        tMin_real = nK_min * self.Tg   # The real minimum time between sampling points

        # Maximum time between the sampling points as the number of grid:
        if np.isnan(self.tMax):
            nK_max = np.inf
        else:
            nK_max = int(math.floor(self.tMax / self.Tg))
        tMax_real = nK_max * self.Tg   # The real maximum time between sampling points

        self.nK_g = nK_g              # the number of grid points in the sampling pattern
        self.tTau_real = tTau_real    # the real time of sampling patterns
        self.nK_s = nK_s              # the expected number of sampling points in a pattern
        self.f_s = f_s                # the expected average sampling frequency
        self.nT = nT                  # the expected average sampling period (as grid pts)
        self.tT_s = tT_s              # the expected average sampling period
        self.nK_min = nK_min          # min t between the samp pts as the number of grid pts
        self.nK_max = nK_max          # max t between the samp pts as the number of grid pts
        self.tMin_real = tMin_real    # the real minimum time between sampling points
        self.tMax_real = tMax_real    # the real maximum time between sampling points
        return

    def _checkConf(self):
        """
        This function checks configuration of sampling

        Args:
            none

        Returns:
            none
        """

        # -----------------------------------------------------------------
        # Check if the number of grid points in patterns is higher than 0
        if not self.nK_g > 0:
            strError = ('Real number of grid points in patterns must be higher ')
            strError = strError + ('than zero')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the real time of patterns is higher than 0
        if not self.tTau_real > 0:
            strError = ('Real time of patterns must be higher than zero')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the expected number of sampling points is higher than 0
        if not self.nK_s > 0:
            strError = ('The expected number of sampling points in patterns ')
            strError = strError + ('must be higher than zero')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the time of patterns is equal to the time of signals to be
        # sampled
        if (self.tTau_real - self.tS) > self.tS/1e12:
            strError = ('The real time of patterns is different than the time ')
            strError = strError + ('of signals to be sampled')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the expected number of sampling points is lower or equal
        # to the number of grid points
        if not self.nK_g >= self.nK_s:
            strError = ('The real number of grid points in patterns must be ')
            strError = strError + ('higher or equal to the number of expected ')
            strError = strError + ('sampling points')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the minimum time between the sampling points is lower or
        # equal to the average sampling period
        if not self.nT >= self.nK_min:
            strError = ('The minimum time between the sampling points must be ')
            strError = strError + ('lower or equal to the expected average ')
            strError = strError + ('sampling period ')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the maximum time between the sampling points is higher or
        # equal to the average sampling period
        if not self.nK_max >= self.nT:
            strError = ('The maximum time between the sampling points must be ')
            strError = strError + ('higher or equal to the expected average ')
            strError = strError + ('sampling period ')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        # Check if the signal representation sampling frequency is compatible
        # with the sampling period
        if np.abs(np.round(self.Tg * self.fR) - (self.Tg * self.fR)) > 1e-6:
            strError = ('The chosen sampling grid period is incompatible with ')
            strError = strError + ('the signals representation sampling ')
            strError = strError + ('frequency')
            raise ValueError(strError)

        # -----------------------------------------------------------------
        return

    # Generate the sampling patterns
    def _generatePatterns(self):
        """
        This function generates the required number of sampling patterns.

        Args:
                none

        Returns:
                none

                List of variables added by function to the object:

                nSigs (number):       the number of input signals
                mPatts (matrix):      the sampling patterns (grid indices)
                lPatts (list):        list with the sampling patterns (grid indices)
                mPattsRep (matrix):   the sampling patterns (signal rep. sampling points)
                lPattsRep (list):     list with the sampling patterns (signal rep. sampling points)
                mPattsT (matrix):     the sampling patterns (time moments)
                lPattsT (list):       list with the sampling patterns (time moments)

        """

        # Make the matrix with signals 2 dim, if it is 1 dim
        self.mSig = self.makeArray2Dim(self.mSig)
        (nSigs, _) = self.mSig.shape          # The number of input signals

        # Allocate the matrix for all the sampling patterns
        mPatts = np.ones((nSigs, self.nK_s), dtype='int64')

        # Generate all the needed sampling patterns
        for inxP in np.arange(nSigs):

            # Generate a vector with a sampling pattern
            vPattern = self._angie_engine(self.nK_s, self.nK_g, self.nK_min, self.nK_max, self.iSigma)
            mPatts[inxP, :] = vPattern   # Store the generated pattern

        # The patterns engine generates patterns in range  <1 ; N>, where
        # N is the number of possible positions of a sampling points.
        # Because Numpy indexes arrays from 0, the patterns should be represented
        # in range from <0 ; N-1>
        mPatts = mPatts - 1

        # --------------------------------------------------------------

        # Compute the number of signal representation points which equals
        # one grid point
        iGridvsRep = int(np.round((self.Tg * self.fR)))

        # Recalculate the patterns to the signal representation sampling points
        mPattsRep = iGridvsRep * mPatts

        # --------------------------------------------------------------

        # Create the time vector of the input signal
        vTSig = (1 / self.fR) * np.arange(int(np.round(self.tTau_real * self.fR)))

        # Recalculate the patterns to the time moments
        mPattsT = vTSig[mPattsRep]

        self.nSigs = nSigs

        self.mPatts = mPatts
        self.lPatts = self.array2D2list1D(self.mPatts, remnan=0)

        self.mPattsRep = mPattsRep
        self.lPattsRep = self.array2D2list1D(self.mPattsRep, remnan=0)

        self.mPattsT = mPattsT
        self.lPattsT = self.array2D2list1D(self.mPattsT, remnan=0)
        return

    # Sample the signals
    def _sampleSignals(self):
        """
        This function samples signals using the previously generated
        sampling patterns.

        Args:
                none
        Returns:
                none

                List of variables added by function to the object:
                mObSig (matrix):  the observed signals
                lObSig (list):    list with the observed signals
        """

        self.mObSig = (self.mSig[np.arange(self.nSigs), self.mPattsRep.T]).T

        # Store the observed signals in a list
        self.lObSig = self.array2D2list1D(self.mObSig, remnan=0)

        return

    # Generate the observation matrices
    def _generObser(self):
        """
        This function generates the observation matrices.

        Args:
                none

        Returns:
                none

                List of variables added by function to the object:
                lPhi (list): observation matrices
        """

        nSmp = int(round(self.tS * self.fR))     # The number of representation samples in the input signals
        lPhi = []                                # Start a list with observation matrices
        mPhiEmpty = np.zeros((self.nK_s, nSmp))  # Start an empty observation matrix

        # Generate the observation matrices
        for inxPat in np.arange(self.nSigs):  # <- loop over all observation matrices

            vPatts = self.mPattsRep[inxPat, :]    # Get the current pattern
            mPhi = mPhiEmpty.copy()     # Make a new empty observation matrix

            # Fil up the current observation matrix
            inxRow = 0
            for iSamp in vPatts:    # <- loop over all samling points in pattern
                mPhi[inxRow, iSamp] = 1
                inxRow = inxRow + 1
            lPhi.append(mPhi)        # Add the current observation matrix to the list

        self.lPhi = lPhi
        return

    def _angie_engine(self, nK_s, K_g, K_min, K_max, sigma):
        """
        This function is the engine of ANGIE sampling generator.
        It generates one sampling pattern.

        Args:
            nK_s (float):  the number of sampling points in a pattern
            K_g (float):   the number of grid points in a pattern
            K_min (float): minimum distance between sampling points
            K_max (float): maximum distance between sampling points
            sigma (float): the sigma parameter

        Returns:
            vPattern (vector): vector with the sampling pattern
        """

        # Allocate the vector for the sampling points
        vPattern = np.nan*np.zeros(nK_s)

        # Reset the current sampling moment
        nk = 0

        # -----------------------------------------------------------------
        # Reset the minimum and maximum limits:

        # Reset the minimum the minimum limit
        nminus_k = 1

        # Reset the maximum limit
        nplus_k = K_g - K_min*(nK_s-1)

        # -----------------------------------------------------------------
        # Draw all the points
        for k in range(nK_s):    # <- Loop over all the expected points

            # -------------------------------------------------------------
            # The number of sampling points left
            nLeft = nK_s - k

            # -------------------------------------------------------------
            # Calculate the expected position of the sample:

            # Calculate the average sampling period for the rest of sampling
            # points (in the grid indices)
            nddag_k = round((K_g - nk) / (nLeft + 1))

            # Calculate the expected position (in the grid indices)
            Enk = nk + nddag_k

            # -------------------------------------------------------------
            # Distances between the expected position and the limits

            # Calculate distance to the minimum limit
            ndminus_k = abs(Enk - nminus_k)

            # Calculate distance to the maximum limit
            ndplus_k = nplus_k - Enk

            # Get the correct distance
            nd_k = min(ndminus_k, ndplus_k)

            # -------------------------------------------------------------
            # Draw the sampling point:

            # -------------------------------------------------------------
            # Soft start, if enabled
            # -------------------------------------------------------------
            # First sampling point is different, if soft start is enabled
            if k == 0:

                # Draw the sampling moment (uniformly)
                nk = math.ceil(np.random.rand()*nddag_k)
            # -------------------------------------------------------------
            # -------------------------------------------------------------

            else:
                # Draw Gaussian
                xk = np.random.randn()

                # Draw the sampling point
                nk = Enk + math.sqrt(sigma)*xk*nd_k
                nk = round(nk)

            # -------------------------------------------------------------
            # Check limits
            if nk < nminus_k:
                nk = nminus_k

            elif nk > nplus_k:
                nk = nplus_k

            # -------------------------------------------------------------
            # Store the drawn sampling point
            vPattern[k] = nk

            # -------------------------------------------------------------
            # Calculate the minimum and maximum limits:

            # Move the minimum limit forward (by the minimum distance)
            nminus_k = nk + K_min

            # Move the maximum limit forward
            nplus_k = K_g - K_min*(nLeft-2)

            nplus_k = min(nplus_k, nk + K_max)  # <- Add maximum limit (this line
                                                #    can be removed if there is no
                                                #    need for maximum limit)
                                                #
        # -----------------------------------------------------------------
        return vPattern


text:
import {CompareResult} from 'typescript-dotnet-commonjs/System/CompareResult';
import { compare } from 'typescript-dotnet-commonjs/System/Compare';

import { SimpleRule } from './SimpleRule';
import { RuleResult } from './RuleResult';
import { Primitive } from './Primitive';

/**
 * Use the [Min] rule to determine if the target value is equal to or greater than the minimum
 * allowed value [comparison].
 */
export class Min extends SimpleRule {
    target: Primitive;
    comparison: Primitive;
    prima

    /**
     * The constructor for the [Min] rule.
     * @param name: The name of the rule.
     * @param message: The message to display when the rule is violated.
     * @param target: The target that the rules are evaluated against.
     * @param comparison: The comparison target the rules are evaluated against.
     * @param isDisplayable: Indicates if the rule violation is displayble. Default value is [false].
    */
    constructor(name: string, message: string, target: Primitive, comparison: Primitive, isDisplayable: boolean = false) {
        super(name, message, isDisplayable);
        this.target = target;
        this.comparison = comparison;
    }

    render() {
        let compareResult = compare(this.target, this.comparison, true);
        if(compareResult === CompareResult.Less){
            this.isValid = false;//must be equal to or greater than the comparison value;
        }
        return new RuleResult(this, this.target);
    }
}


text:
import traceback

enabled = False

def not_impl(self, name=None):
    method = name or traceback.extract_stack()[-2][2]
    raise NotImplementedError("{}.{} not implemented".format(self.__class__.__name__, method))

class NullConnection:
    def write_line(self, line, split=True):
        pass

    def write_status(self, code, message):
        pass

    def write_text_end(self):
        pass

    def write_text(self, lines):
        pass

    def __getattr__(self, name):
        not_impl(self, name)


text:
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../common/tutorial/tutorial_device.h"

namespace embree {

struct Sphere
{
  ALIGNED_STRUCT_(16)
  Vec3fa p;                      //!< position of the sphere
  float r;                      //!< radius of the sphere
  unsigned int geomID;
  unsigned int num_time_steps;
};

struct TutorialData
{
  RTCScene g_scene;
  Vec3fa face_colors[12];
  float g_time;

  /* accumulation buffer */
  Vec3ff* g_accu;
  unsigned int g_accu_width;
  unsigned int g_accu_height;
  unsigned int g_accu_count;
  Vec3fa g_accu_vx;
  Vec3fa g_accu_vy;
  Vec3fa g_accu_vz;
  Vec3fa g_accu_p;

  RTCScene scene0;
  RTCScene scene1;
  RTCScene scene2;
  RTCScene scene3;
  Sphere* sphere0;
  Sphere* sphere1;
};

inline void TutorialData_Constructor(TutorialData* This)
{
  This->g_scene = nullptr;
  This->g_time = 0;
  This->g_accu = nullptr;
  This->g_accu_width = 0;
  This->g_accu_height = 0;
  This->g_accu_count = 0;
  This->g_accu_vx = Vec3fa(0.0f);
  This->g_accu_vy = Vec3fa(0.0f);
  This->g_accu_vz = Vec3fa(0.0f);
  This->g_accu_p  = Vec3fa(0.0f);

  This->scene0 = nullptr;
  This->scene1 = nullptr;
  This->scene2 = nullptr;
  This->scene3 = nullptr;
  This->sphere0 = nullptr;
  This->sphere1 = nullptr;
}

inline void TutorialData_Destructor(TutorialData* This)
{
  alignedFree(This->sphere0); This->sphere0 = nullptr;
  alignedFree(This->sphere1); This->sphere1 = nullptr;
  rtcReleaseScene(This->scene0); This->scene0 = nullptr;
  rtcReleaseScene(This->scene1); This->scene1 = nullptr;
  rtcReleaseScene(This->scene2); This->scene2 = nullptr;
  rtcReleaseScene(This->scene3); This->scene3 = nullptr;
  rtcReleaseScene (This->g_scene); This->g_scene = nullptr;
  alignedFree(This->g_accu); This->g_accu = nullptr;
  This->g_accu_width = 0;
  This->g_accu_height = 0;
  This->g_accu_count = 0;
}

} // namespace embree


text:
namespace AutoHotKey
{
    partial class AutoHotKeyForm
    {
        /// <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()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutoHotKeyForm));
            this.btnSwitch = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.txtKey = new System.Windows.Forms.TextBox();
            this.txtInterval = new System.Windows.Forms.TextBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.lnkHomePage = new System.Windows.Forms.LinkLabel();
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
            this.ctxTrayIcon = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.mnuRestore = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.mnuStart = new System.Windows.Forms.ToolStripMenuItem();
            this.mnuStop = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.mnuExit = new System.Windows.Forms.ToolStripMenuItem();
            this.tableLayoutPanel1.SuspendLayout();
            this.ctxTrayIcon.SuspendLayout();
            this.SuspendLayout();
            //
            // btnSwitch
            //
            resources.ApplyResources(this.btnSwitch, "btnSwitch");
            this.btnSwitch.Name = "btnSwitch";
            this.tableLayoutPanel1.SetRowSpan(this.btnSwitch, 2);
            this.btnSwitch.UseVisualStyleBackColor = true;
            this.btnSwitch.Click += new System.EventHandler(this.btnSwitch_Click);
            //
            // timer1
            //
            this.timer1.Interval = 1000;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // label1
            //
            resources.ApplyResources(this.label1, "label1");
            this.label1.Name = "label1";
            //
            // label2
            //
            resources.ApplyResources(this.label2, "label2");
            this.label2.Name = "label2";
            //
            // txtKey
            //
            resources.ApplyResources(this.txtKey, "txtKey");
            this.txtKey.Name = "txtKey";
            //
            // txtInterval
            //
            resources.ApplyResources(this.txtInterval, "txtInterval");
            this.txtInterval.Name = "txtInterval";
            //
            // tableLayoutPanel1
            //
            resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.btnSwitch, 2, 0);
            this.tableLayoutPanel1.Controls.Add(this.txtKey, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.txtInterval, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            //
            // lnkHomePage
            //
            resources.ApplyResources(this.lnkHomePage, "lnkHomePage");
            this.lnkHomePage.Name = "lnkHomePage";
            this.lnkHomePage.TabStop = true;
            this.lnkHomePage.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkHomePage_LinkClicked);
            //
            // notifyIcon1
            //
            this.notifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
            resources.ApplyResources(this.notifyIcon1, "notifyIcon1");
            this.notifyIcon1.ContextMenuStrip = this.ctxTrayIcon;
            this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
            //
            // ctxTrayIcon
            //
            resources.ApplyResources(this.ctxTrayIcon, "ctxTrayIcon");
            this.ctxTrayIcon.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.mnuRestore,
            this.toolStripSeparator2,
            this.mnuStart,
            this.mnuStop,
            this.toolStripSeparator1,
            this.mnuExit});
            this.ctxTrayIcon.Name = "ctxTrayIcon";
            this.ctxTrayIcon.Opening += new System.ComponentModel.CancelEventHandler(this.ctxTrayIcon_Opening);
            //
            // mnuRestore
            //
            resources.ApplyResources(this.mnuRestore, "mnuRestore");
            this.mnuRestore.Name = "mnuRestore";
            this.mnuRestore.Click += new System.EventHandler(this.mnuRestore_Click);
            //
            // toolStripSeparator2
            //
            resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            //
            // mnuStart
            //
            resources.ApplyResources(this.mnuStart, "mnuStart");
            this.mnuStart.Name = "mnuStart";
            this.mnuStart.Click += new System.EventHandler(this.mnuStart_Click);
            //
            // mnuStop
            //
            resources.ApplyResources(this.mnuStop, "mnuStop");
            this.mnuStop.Name = "mnuStop";
            this.mnuStop.Click += new System.EventHandler(this.mnuStop_Click);
            //
            // toolStripSeparator1
            //
            resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            //
            // mnuExit
            //
            resources.ApplyResources(this.mnuExit, "mnuExit");
            this.mnuExit.Name = "mnuExit";
            this.mnuExit.Click += new System.EventHandler(this.mnuExit_Click);
            //
            // AutoHotKeyForm
            //
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.lnkHomePage);
            this.Controls.Add(this.tableLayoutPanel1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "AutoHotKeyForm";
            this.Resize += new System.EventHandler(this.AutoHotKeyForm_Resize);
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ctxTrayIcon.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnSwitch;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtKey;
        private System.Windows.Forms.TextBox txtInterval;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.LinkLabel lnkHomePage;
        private System.Windows.Forms.NotifyIcon notifyIcon1;
        private System.Windows.Forms.ContextMenuStrip ctxTrayIcon;
        private System.Windows.Forms.ToolStripMenuItem mnuStart;
        private System.Windows.Forms.ToolStripMenuItem mnuStop;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripMenuItem mnuExit;
        private System.Windows.Forms.ToolStripMenuItem mnuRestore;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
    }
}


text:
//
//  GHTest+JUnitXML.h
//  GHUnit
//
//  Created by Gabriel Handford on 6/4/10.
//  Copyright 2010. All rights reserved.
//
//  Permission is hereby granted, free of charge, to any person
//  obtaining a copy of this software and associated documentation
//  files (the "Software"), to deal in the Software without
//  restriction, including without limitation the rights to use,
//  copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following
//  conditions:
//
//  The above copyright notice and this permission notice shall be
//  included in all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//  OTHER DEALINGS IN THE SOFTWARE.
//

//! @cond DEV

#import "GHTest.h"

@interface GHTest(JUnitXML)

/*!
 Return test results in JUnit XML format for external parsing use
 (such as a Continuous Integration system like Hudson)
 */
- (NSString *)JUnitXML;

@end

//! @endcond


text:
/*------------------ all JS stuff is here ------------------*/
"use strict";

function pageInit() {

  classFiles = document.getElementById("idFiles").attributes.getNamedItem("class");
  classTasks = document.getElementById("idTasks").attributes.getNamedItem("class");
  classDivF = document.getElementById("idDivF").attributes.getNamedItem("class");
  classDivT = document.getElementById("idDivT").attributes.getNamedItem("class");

}

function openFList( newDir, d ) {

var tmpDir = "";
var tmpIndex = newDir.lastIndexOf("/");

  if ( d !== "dir" ) {
    window.alert("It's not MP4 file!");
    return;
  }

  if ( newDir !== "" ) {
    if ( newDir.slice(-2) === ".." ) {
      tmpDir = newDir.slice(prefLen, prefLen + newDir.slice(prefLen,-3).lastIndexOf("/"));
      tmpDir = reqDir + uriSlash + tmpDir;
    } else {
      tmpDir = reqDir + uriSlash + newDir.slice(prefLen);
    }
  } else {
    tmpDir = reqDir + charTilda;
  }

  w3Http( tmpDir, function () {
    if ( this.readyState == 4 && this.status == 200 ) {
      jsonObj = JSON.parse( this.responseText );
      dataConvert();
      w3DisplayData("idTbl", jsonObj );
    } else  if ( this.readyState == 4 && this.status != 200 ) {
        vlcFail( this );
    }
    function dataConvert() {
      var i;
      var indX = 0;
      var tmpExt = "";
      var tmpPath = "";

      for ( i in jsonObj["element"] ) {

        jsonObj["element"][i].click_type = "";

        if ( jsonObj["element"][i].type == "dir" ) {
          if ( jsonObj["element"][i].name == ".." ) {
            jsonObj["element"][i].icon_type = '';
          } else {
            jsonObj["element"][i].icon_type = '';
          }
          jsonObj["element"][i].click_type = "openFList('" + jsonObj["element"][i].uri + "','dir')";
          jsonObj["element"][i].path = "";
        } else {
          jsonObj["element"][i].icon_type = '';
          indX = jsonObj["element"][i].name.lastIndexOf(".");
          if ( indX !== -1 ) {
            tmpExt = jsonObj["element"][i].name.slice(indX +1).toLowerCase();
            var j;
            for ( j in extA ) {
              if ( extA[j] === tmpExt ) {
                jsonObj["element"][i].icon_type = '';
              }
            }
            for ( j in extV ) {
              if ( extV[j] === tmpExt ) {
                jsonObj["element"][i].icon_type = '';
                if ( j >= 0 && j <= 5 ) {
                  tmpPath = jsonObj["element"][i].path.replace( /\\/g, "\\\\" );
                  jsonObj["element"][i].click_type = "tryStream('" + tmpPath + "','" + jsonObj["element"][i].name + "')";
                } else {
                  jsonObj["element"][i].click_type = "";
                }
              }
            }
          }
        }
      }
    }
  } );

  document.getElementById("idMain").style.display = "none";
  document.getElementById("idSec").style.display = "block";

}

function tryStream( curFilePath, curFileName ) {
var ulArr = document.getElementById("ulTasks").getElementsByTagName("li");
var ulArrLen = ulArr.length;
var k = 0;
  for (k; k<ulArrLen; k++) {
    ulArr[k].style.display = "none";
  }
  filePath = curFilePath;
  fileName = curFileName;
  document.getElementById("idTaskName").style.display = "block";
}

function tryStream2(tmpName) {
  if ( tmpName == null || tmpName == "" ) {
    return;
  }
  strmName = tmpName + " ";

  if ( addrLastByte < 254 ) {
    addrLastByte++;
  } else {
    addrLastByte = 1;
  }
var tmpByte = addrLastByte.toString();
var tmpCmd = vlmCmd + encodeURIComponent(cmdNew + strmName + strmMode + strmEn + strmLoop + strmIn + filePath + strmOut1 + mcastIp + tmpByte + strmOut2 + mcastPort + strmOut3 + fileName + strmOutEnd);

  w3Http( tmpCmd , function () {
      if ( this.readyState == 4 && this.status == 200 ) {
        if ( this.responseText.length == 84 ) {
          window.open("item.html?name=" + encodeURIComponent(tmpName));
        } else {
          xmlDoc = this.responseXML;
          errMsg = xmlDoc.getElementsByTagName("error")[0].childNodes[0].nodeValue;
          if ( errMsg.slice(-19) === "Name already in use" ) {
            fPath = filePath;
            addMoreFile();
          } else {
            window.alert( errMsg );
          }
        }
      } else  if ( this.readyState == 4 && this.status != 200 ) {
        vlcFail( this );
      }
    }
  );
}

function addMoreFile() {
var tmpCmd = vlmCmd + encodeURIComponent(cmdSetup + strmName + strmIn + fPath + '"');

  w3Http( tmpCmd , function () {
      if ( this.readyState == 4 && this.status == 200 ) {
        if ( this.responseText.length != 84 ) {
          xmlDoc = this.responseXML;
          window.alert( xmlDoc.getElementsByTagName("error")[0].childNodes[0].nodeValue );
        }
      } else  if ( this.readyState == 4 && this.status != 200 ) {
        vlcFail( this );
      }
    }
  );
  addrLastByte--;
}

function fashionExchange() {
var tmpValue = classFiles.value;
  classFiles.value = classTasks.value;
  classTasks.value = tmpValue;
}

function selectFiles() {
  if ( classDivF.value.indexOf("w3-hide") != -1 ) {
    clearInterval( pollVlm );
    classDivT.value = classDivT.value + " w3-hide";
    classDivF.value = classDivF.value.replace(" w3-hide", "");
    fashionExchange();
  }
}

function selectTasks() {
  if ( classDivT.value.indexOf("w3-hide") != -1 ) {
    taskList();
    pollVlm = setInterval( taskList, 5000 );
    classDivF.value = classDivF.value + " w3-hide";
    classDivT.value = classDivT.value.replace(" w3-hide", "");
    fashionExchange();
  }
}

function taskList() {
var brList;
  w3Http( vlmStatus , function () {
      if ( this.readyState == 4 && this.status == 200 ) {
        xmlDoc = this.responseXML;
        buildTaskList();
        w3DisplayData("tblTasks", tasksObj);
        w3DisplayData("ulTasks", tasksObj);
      } else  if ( this.readyState == 4 && this.status != 200 ) {
        vlcFail( this );
      }
      function buildTaskList() {
        var t, listLen;
        var strTasks = '{"task":[';

        brList = xmlDoc.getElementsByTagName("broadcast");
        listLen = brList.length;
        for ( t=0; t < listLen; t++ ) {
          strTasks += '{"name":"' + brList[t].attributes.getNamedItem("name").nodeValue + '"}';
          if ( t != listLen - 1 ) {
            strTasks += "," ;
          }
        }
        strTasks += ']}';
        tasksObj = JSON.parse(strTasks);
      }
    }
  );
}

function filterApp(inPut) {
var recOrds = document.getElementById("ulTasks").getElementsByTagName("li");
var arrLen = recOrds.length;
var whatFind = inPut.value.toLowerCase();
var l = 0;
  document.getElementById("ulTasks").style.display = "";
  if ( whatFind.length > 0 ) {
    for (l; l<arrLen; l++) {
      if ( recOrds[l].innerHTML.toLowerCase().indexOf(whatFind) > -1 ) {
        recOrds[l].style.display = "";
      } else {
        recOrds[l].style.display = "none";
      }
    }
  } else {
    for (l; l<arrLen; l++) {
      recOrds[l].style.display = "none";
    }
  }
}

function flushToInp(curIl) {
  document.getElementById("idInp").value = curIl.getElementsByTagName("b")[0].innerHTML;
  document.getElementById("ulTasks").style.display = "none";
}

function selectYes() {
var nameVal = document.getElementById("idInp").value;
  if ( nameVal === "" ) {
    tryStream2("Test");
  } else {
    tryStream2(nameVal);
  }
  document.getElementById("idTaskName").style.display="none";
}

function selectNo() {
  document.getElementById("idTaskName").style.display="none";
}

function closeFList() {
  document.getElementById("idSec").style.display = "none";
  document.getElementById("idMain").style.display = "block";
  document.getElementById("idInp").value = "";
}

function vlcFail( abc ) {
  window.alert("VLC can't do it!\nStatus: " + abc.status + " " + abc.statusText);
}


text:
title: How to host an Hour of Code - Organizations
layout: wide
nav: resources_nav
---

How to teach one Hour of Code

## 1) Try the tutorials:
We'll host a variety of fun, hour-long tutorials, created by a variety of partners. New tutorials are coming to kick off the Hour of Code before December 7-13.

**All Hour of Code tutorials:**

- Require minimal prep-time for organisers
- Are self-guided - allowing students to work at their own pace and skill-level

<a href="http://<%=codeorg_url() %>/learn"><img src="http://<%= codeorg_url() %>/images/tutorials.png">

## 2) Plan your hardware needs - computers are optional

The best Hour of Code experience will be with Internet-connected computers. But you don't need a computer for every participant, and can even do the Hour of Code without a computer at all.

- **Test tutorials on student computers or devices.** Make sure they work properly (with sound and video).
- **Preview the congrats page** to see what students will see when they finish.
- **Provide headphones for your group**, or ask students to bring their own, if the tutorial you choose works best with sound.

## 3) Plan ahead based on your technology available

- **Don't have enough devices?** Use [pair programming](http://www.ncwit.org/resources/pair-programming-box-power-collaborative-learning). When participants partner up, they help each other and rely less on the teacher.
- **Have low bandwidth?** Plan to show videos at the front of the class, so each student isn't downloading their own videos. Or try the unplugged / offline tutorials.

## 4) Inspire students - show them a video

Show students an inspirational video to kick off the Hour of Code. Examples:

- The original Code.org launch video, featuring Bill Gates, Mark Zuckerberg, and NBA star Chris Bosh (There are [1 minute](https://www.youtube.com/watch?v=qYZF6oIZtfc), [5 minute](https://www.youtube.com/watch?v=nKIu9yen5nc), and [9 minute](https://www.youtube.com/watch?v=dU1xS07N-FA) versions)
- The [Hour of Code 2013 launch video](https://www.youtube.com/watch?v=FC5FbmsH4fw), or the <% if @country == 'uk' %> [Hour of Code 2014 video](https://www.youtube.com/watch?v=96B5-JGA9EQ) <% else %> [Hour of Code 2014 video](https://www.youtube.com/watch?v=rH7AjDMz_dc&index=2&list=PLzdnOPI1iJNe1WmdkMG-Ca8cLQpdEAL7Q) <% end %>
- [President Obama calling on all students to learn computer science](https://www.youtube.com/watch?v=6XvmhE1J9PY)

**Get your students excited - give them a short intro**


text:
FROM ubuntu:trusty
MAINTAINER Jakub Warmuz <jakub@warmuz.org>
MAINTAINER William Budington <bill@eff.org>

# Note: this only exposes the port to other docker containers. You
# still have to bind to 443@host at runtime, as per the ACME spec.
EXPOSE 443

# TODO: make sure --config-dir and --work-dir cannot be changed
# through the CLI (letsencrypt-docker wrapper that uses standalone
# authenticator and text mode only?)
VOLUME /etc/letsencrypt /var/lib/letsencrypt

WORKDIR /opt/letsencrypt

# no need to mkdir anything:
# https://docs.docker.com/reference/builder/#copy
# If <dest> doesn't exist, it is created along with all missing
# directories in its path.

COPY bootstrap/ubuntu.sh /opt/letsencrypt/src/
RUN /opt/letsencrypt/src/ubuntu.sh && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* \
           /tmp/* \
           /var/tmp/*

# the above is not likely to change, so by putting it further up the
# Dockerfile we make sure we cache as much as possible

COPY setup.py README.rst CHANGES.rst MANIFEST.in /opt/letsencrypt/src/

# all above files are necessary for setup.py, however, package source
# code directory has to be copied separately to a subdirectory...
# https://docs.docker.com/reference/builder/#copy: "If <src> is a
# directory, the entire contents of the directory are copied,
# including filesystem metadata. Note: The directory itself is not
# copied, just its contents." Order again matters, three files are far
# more likely to be cached than the whole project directory

COPY letsencrypt /opt/letsencrypt/src/letsencrypt/
COPY acme /opt/letsencrypt/src/acme/
COPY letsencrypt-apache /opt/letsencrypt/src/letsencrypt-apache/
COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/

# requirements.txt not installed!
RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
    /opt/letsencrypt/venv/bin/pip install \
    -e /opt/letsencrypt/src/acme \
    -e /opt/letsencrypt/src \
    -e /opt/letsencrypt/src/letsencrypt-apache \
    -e /opt/letsencrypt/src/letsencrypt-nginx

# install in editable mode (-e) to save space: it's not possible to
# "rm -rf /opt/letsencrypt/src" (it's stays in the underlaying image);
# this might also help in debugging: you can "docker run --entrypoint
# bash" and investigate, apply patches, etc.

ENV PATH /opt/letsencrypt/venv/bin:$PATH

ENTRYPOINT [ "letsencrypt" ]


text:
rm -f out*.txt

# this should mirror the timeout in run_program
PROG_TIMEOUT=5

ulimit -t 60
ulimit -v 8000000
ulimit -m 8000000

# ${CSMITH_HOME}/driver/check_unique.pl XX_CRASHFILE XX_DIR XX_OPT "XX_COMMAND"

if
  clang -pedantic -Wall -O -fsanitize=undefined -fno-sanitize-recover small.c -o smallz >out_clang.txt 2>&1 &&\
  ! grep 'conversions than data arguments' out_clang.txt &&\
  ! grep 'incompatible redeclaration' out_clang.txt &&\
  ! grep 'ordered comparison between pointer' out_clang.txt &&\
  ! grep 'eliding middle term' out_clang.txt &&\
  ! grep 'end of non-void function' out_clang.txt &&\
  ! grep 'invalid in C99' out_clang.txt &&\
  ! grep 'specifies type' out_clang.txt &&\
  ! grep 'should return a value' out_clang.txt &&\
  ! grep 'uninitialized' out_clang.txt &&\
  ! grep 'incompatible pointer to' out_clang.txt &&\
  ! grep 'incompatible integer to' out_clang.txt &&\
  ! grep 'type specifier missing' out_clang.txt &&\
  RunSafely ${PROG_TIMEOUT} 1 /dev/null out_small1.txt ./smallz &&\
  gcc -Wall -Wextra -O1 small.c -o smallz >out_gcc.txt 2>&1 &&\
  ! grep 'uninitialized' out_gcc.txt &&\
  ! grep 'without a cast' out_gcc.txt &&\
  ! grep 'control reaches end' out_gcc.txt &&\
  ! grep 'return type defaults' out_gcc.txt &&\
  ! grep 'cast from pointer to integer' out_gcc.txt &&\
  ! grep 'useless type name in empty declaration' out_gcc.txt &&\
  ! grep 'no semicolon at end' out_gcc.txt &&\
  ! grep 'type defaults to' out_gcc.txt &&\
  ! grep 'too few arguments for format' out_gcc.txt &&\
  ! grep 'in format' out_gcc.txt &&\
  ! grep 'incompatible pointer' out_gcc.txt &&\
  ! grep 'ordered comparison of pointer with integer' out_gcc.txt &&\
  ! grep 'declaration does not declare anything' out_gcc.txt &&\
  ! grep 'expects type' out_gcc.txt &&\
  ! grep 'pointer from integer' out_gcc.txt &&\
  ! grep 'incompatible implicit' out_gcc.txt &&\
  ! grep 'excess elements in struct initializer' out_gcc.txt &&\
  ! grep 'comparison between pointer and integer' out_gcc.txt &&\
  XX_COMMAND XX_OPT small.c -o small1 > /dev/null 2>&1 &&\
  RunSafely ${PROG_TIMEOUT} 1 /dev/null out_small1.txt ./small1 &&\
  XX_COMMAND XX_GOOD small.c -o small2 > /dev/null 2>&1 &&\
  RunSafely ${PROG_TIMEOUT} 1 /dev/null out_small2.txt ./small2 &&\
  ! diff out_small1.txt out_small2.txt &&\
  # these options assume Frama-C Fluorine and a 64-bit machine
  frama-c -cpp-command 'gcc -C -Dvolatile= -E -I.' -val -no-val-show-progress -machdep x86_64 -obviously-terminates small.c > out_framac.txt 2>&1 &&\
  ! egrep -i '(user error|assert)' out_framac.txt >/dev/null 2>&1
then
  exit 0
else
  exit 1
fi