text:
layout: post
authors: ["Raniere Silva"]
title: "Software Carpentry workshop at Universidade Federal do Rio Grande do Sul"
date: 2014-08-30
time: "19:00:00"
category: ["Bootcamps", "UFRGS"]
---

At the end of this week Alex Viana and I taught a Software Carpentry workshop
at the Universidade Federal do Rio Grande do Sul. We had around 30 learners of
very different experience (from high school students to seniors professors of
the university) and took them through Bash, Git and Python over the course of
two days.

First of all I want to thank everyone who helped organize and run this workshop,
especially Rafael Pezzi and Lucas Leal. We held the workshop in a university
computer lab, so we used the lab's desktops with a virtual machine setup by our
host.

At the morning of the first day, I taught shell. Most of the students used
it before, at least once, but they like to discovery some new commands (e.g.
`find`) and that they can create shell scripts. At the afternoon, Alex taught
the introduction to Python covering variables, loops, conditions and functions.

At the morning of the second day, I taught Git. This was the session that most of
the students were waiting and they like it. (Instead of GitHub we used
GitLab as requested by our host.) At the afternoon,
Alex taught the basic of the Python scientific libraries (Numpy and
Matplotlib) and Pandas by rewriting the same example with all this libraries.
Students were amazing by how easy is to use Pandas for data analysis (we used
the data file
provided by our host).

Although the good feedbacks that we had (e.g. "Thought the lessons well
organized and the instructors well prepared and worried so we learn the
knowledge.") students complained about:

small time available for the lessons,

lack of the last command typed due the output of it be larger than the screen,

need of more exercises.

Alex and I will try to address this complains in our two workshop at
University of São Paulo next week.


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MouseEventsMainView.xaml.cs" author="Marko Marković">
//   Copyright (c) 2015
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace WpfApp.MouseEvents
{
    using System.Windows;

    public partial class MouseEventsMainView : Window
    {
        public MouseEventsMainView()
        {
            this.InitializeComponent();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

module.exports = {
    app: {
        title: 'MEAN.JS',
        description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js',
        keywords: 'mongodb, express, angularjs, node.js, mongoose, passport'
    },
    port: process.env.PORT || 3000,
    templateEngine: 'swig',
    sessionSecret: 'My4Little$ecrets',
    sessionCollection: 'sessions',
    assets: {
        lib: {
            css: [
                'public/lib/bootstrap/dist/css/bootstrap.css',
                'public/lib/bootstrap/dist/css/bootstrap-theme.css'
            ],
            js: [
                'public/lib/angular/angular.js',
                'public/lib/angular-resource/angular-resource.js',
                'public/lib/angular-animate/angular-animate.js',
                'public/lib/angular-ui-router/release/angular-ui-router.js',
                'public/lib/angular-ui-utils/ui-utils.js',
                'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
                'public/lib/angular-translate/angular-translate.js',
                'public/lib/messageformat/messageformat.js',
                'public/lib/angular-translate-interpolation-messageformat/angular-translate-interpolation-messageformat.js',
            ]
        },
        css: [
            'public/modules/**/css/*.css'
        ],
        js: [
            'public/config.js',
            'public/application.js',
            'public/modules/*/*.js',
            'public/modules/*/*[!tests]*/*.js'
        ],
        tests: [
            'public/lib/angular-mocks/angular-mocks.js',
            'public/modules/*/tests/*.js'
        ]
    }
};


text:
SpecBegin(KFRFuzzyDateTranslator)

describe(@"KFRFuzzyDateTranslator", ^{

    __block KFRFuzzyDateTranslator *instance;
    __block NSString *string;
    __block id date;
    __block NSString *expetedDateString;
    __block NSDate *expetedDate;

    beforeEach(^{

        instance = [[KFRFuzzyDateTranslator alloc] initWithRelevantDate:@"29-FEB-16"];
        string = [[NSString alloc] init];
        date = nil;
        expetedDateString = [[NSString alloc] init];
        expetedDate = [[NSDate alloc] init];

    });

    describe(@"default initializer", ^{
        it(@"defalut calendar should be set to nil", ^{

            expect(instance.calendar).toNot.beNil();
        });
    });

    describe(@"testing -datesGeneral- properties translator for the February 29th, 2016 leap year", ^{
        it(@"should return torromorow", ^{
            string = @"I will do the thing tomorrow!";
            date = [instance dateFromString:string];
            expetedDateString = @"01-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return yesterday", ^{
            string = @"I did the thing yesterday...";
            date = [instance dateFromString:string];
            expetedDateString = @"28-FEB-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return today", ^{
            string = @"I'm doing that today?";
            date = [instance dateFromString:string];
            expetedDateString = @"29-FEB-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });
    });

    describe(@"testing -next datesSpecificWeek- properties translator for the February 29th, 2016 leap year", ^{
        it(@"should return next week", ^{
            string = @"I should do the thing next week.";
            date = [instance dateFromString:string];
            expetedDateString = @"7-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Monday", ^{
            string = @"I should do the thing next Monday.";
            date = [instance dateFromString:string];
            expetedDateString = @"7-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Tuesday", ^{
            string = @"I should do the thing next Tuesday.";
            date = [instance dateFromString:string];
            expetedDateString = @"01-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Wednesday", ^{
            string = @"I should do the thing next Wednesday";
            date = [instance dateFromString:string];
            expetedDateString = @"02-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Thursday", ^{
            string = @"I should do the thing next Thursday.";
            date = [instance dateFromString:string];
            expetedDateString = @"03-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Friday", ^{
            string = @"I should do the thing next Friday.";
            date = [instance dateFromString:string];
            expetedDateString = @"04-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Saturday", ^{
            string = @"I should do the thing next Saturday.";
            date = [instance dateFromString:string];
            expetedDateString = @"05-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return next Sunday", ^{
            string = @"I should do the thing next Sunday.";
            date = [instance dateFromString:string];
            expetedDateString = @"06-MAR-16";
            expetedDate =[instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });
    });

    describe(@"testing -last datesSpecificWeek- properties translator for the February 29th, 2016 leap year", ^{
        it(@"should return last week", ^{
            string = @"I did the thing last week.";
            date = [instance dateFromString:string];
            expetedDateString = @"28-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Monday", ^{
            string = @"I did the thing last Monday.";
            date = [instance dateFromString:string];
            expetedDateString = @"22-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Tuesday", ^{
            string = @"I did the thing last Tuesday.";
            date = [instance dateFromString:string];
            expetedDateString = @"23-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Wednesday", ^{
            string = @"I did the thing last Wednesday";
            date = [instance dateFromString:string];
            expetedDateString = @"24-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Thursday", ^{
            string = @"I did the thing last Thursday.";
            date = [instance dateFromString:string];
            expetedDateString = @"25-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Friday", ^{
            string = @"I did the thing last Friday.";
            date = [instance dateFromString:string];
            expetedDateString = @"26-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Saturday", ^{
            string = @"I did the thing last Saturday.";
            date = [instance dateFromString:string];
            expetedDateString = @"27-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return last Sunday", ^{
            string = @"I did the thing last Sunday.";
            date = [instance dateFromString:string];
            expetedDateString = @"28-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });
    });

    describe(@"testing -this datesSpecificWeek- properties translator for the February 29th, 2016 leap year", ^{
        it(@"should return this week", ^{
            string = @"I should do the thing this week.";
            date = [instance dateFromString:string];
            expetedDateString = @"01-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Monday", ^{
            string = @"I did the thing this Monday.";
            date = [instance dateFromString:string];
            expetedDateString = @"29-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Tuesday", ^{
            string = @"I will do the thing this Tuesday.";
            date = [instance dateFromString:string];
            expetedDateString = @"01-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Wednesday", ^{
            string = @"I will do the thing this Wednesday";
            date = [instance dateFromString:string];
            expetedDateString = @"02-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Thursday", ^{
            string = @"I will do the thing this Thursday.";
            date = [instance dateFromString:string];
            expetedDateString = @"03-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Friday", ^{
            string = @"I will do the thing this Friday.";
            date = [instance dateFromString:string];
            expetedDateString = @"04-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Saturday", ^{
            string = @"I will do the thing this Saturday.";
            date = [instance dateFromString:string];
            expetedDateString = @"05-MAR-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });

        it(@"should return this Sunday", ^{
            string = @"I will do the thing this Sunday.";
            date = [instance dateFromString:string];
            expetedDateString = @"28-FEB-16";
            expetedDate = [instance returnDateAtMidnight:expetedDateString];

            expect(date).to.beIdenticalTo(expetedDate);
        });
    });
});

SpecEnd


text:
const pages = {
    PLANNER: 'planner',
    RECIPES: 'recipes',
    PANTRY: 'pantry'
};

export default pages;


text:
title: still here
date: 2009-09-11 00:00:00 Z
permalink: "/2009/09/11/20090911still-here/"
categories:
- Jennifer
- Uncategorized
author: Jennifer
layout: post
---

I’m surprised it’s still hard to get through today… That’s not true, it’s not fair to say its hard, it should be, it helps keep things in perspective. All of a sudden the mishaps and drama that made up my life, don’t really add up to much – because we’re all still here!  We’re still together.  We’re a team and it’s that, that makes the difference.

Mom, I love you. I know you’ve lost, I know you hurt, but you’re still here for so many reasons!  You’re here to save lives, to leave flowers, to say your prayers.  You’re here to remind and remember, to create, to prepare, to defend no matter what comes. You’re here to love and shelter, to play, and to laugh, to teach and to lead.

YOU ARE HERE! I am so thankful for that. for you.


text:
@interface Common : NSObject

void drawLinearGradient(CGContextRef context, CGRect rect, CGColorRef startColor, CGColorRef endColor);
CGRect rectFor1PxStroke(CGRect rect);
void draw1PxStroke(CGContextRef context, CGPoint startPoint, CGPoint endPoint, CGColorRef color);

@end


text:
package tripit

import (
	"fmt"
	"time"
)

type TripitResponse struct {
	Timestamp int64 `json:"timestamp,string"`
	NumBytes  int64 `json:"num_bytes,string"`
	PageNum   int64 `json:"page_num,string"`
	PageSize  int64 `json:"page_size,string"`
	MaxPage   int64 `json:"max_page,string"`

	// If you have 1 Trip, the TripIt API does returns a single result and
	// not a list.
	Trip []Trip

	AirObject []AirObject
	// Other data includes: LodgingObject, WeatherObject, and Profile.
}

// Tripit brokenness: it will return a single Trip object (instead of
// list-of-Trips) if you have one trip upcoming. In some circumstances, it will
// return a single AirObject instead of a list. Sigh.
type TripitSingleTripResponse struct {
	Trip Trip
}
type TripitSingleAirObjectResponse struct {
	AirObject AirObject
}

type Trip struct {
	Id                     string `json:"id"`
	LastModified           int64  `json:"last_modified,string"`
	StartDate              string `json:"start_date"`
	EndDate                string `json:"end_date"`
	DisplayName            string `json:"display_name"`
	ImageUrl               string `json:"image_url"`
	IsPrivate              bool   `json:"is_private,string"`
	IsTraveler             bool   `json:"is_traveler,string"`
	PrimaryLocation        string `json:"primary_location_address"`
	PrimaryLocationAddress Address
	TripPurposes           TripPurpose

	// Set by fixStartAndEndDates.
	ActualStartDate time.Time `json:"-"`
	ActualEndDate   time.Time `json:"-"`
}

func (t *Trip) Start() (time.Time, error) {
	return time.Parse(time.RFC3339, t.StartDate+"T00:00:00Z")
}
func (t *Trip) End() (time.Time, error) {
	return time.Parse(time.RFC3339, t.EndDate+"T00:00:00Z")
}

type Address struct {
	Address   string
	City      string
	State     string
	Country   string
	Latitude  float32 `json:",string"`
	Longitude float32 `json:",string"`
}

type TripPurpose struct {
	IsAutoGenerated bool   `json:"is_auto_generated,string"`
	PurposeTypeCode string `json:"purpose_type_code"`
}

type AirObject struct {
	Id              string `json:"id"`
	TripId          string `json:"trip_id"`
	SupplierConfNum string `json:"supplier_conf_num"`

	// Tripit returns either a list of Segments or a single Segment inline.
	// The JSON unmarshaler will unmarshal this into a map[key]val or a [map[key]val]].
	Segment interface{}
}

func (ao *AirObject) Segments() []Segment {
	var ret []Segment
	switch ao.Segment.(type) {
	case map[string]interface{}:
		seg := ao.Segment.(map[string]interface{})
		ret = append(ret, newSegment(seg))

	case []interface{}:
		segs := ao.Segment.([]interface{})
		for _, kv := range segs {
			switch kv.(type) {
			case map[string]interface{}:
				seg := kv.(map[string]interface{})
				ret = append(ret, newSegment(seg))
			default:
				fmt.Printf("Unknown type in manyton: %T\n", kv)
			}
		}

	default:
		fmt.Printf("Unknown type for Segment: %T\n", ao.Segment)
		return nil
	}

	return ret
}

type Segment struct {
	StartDateTime    DateTime
	EndDateTime      DateTime
	StartAirportCode string
	EndAirportCode   string
}

func newSegment(kv map[string]interface{}) Segment {
	sd := kv["StartDateTime"].(map[string]interface{})
	ed := kv["EndDateTime"].(map[string]interface{})

	return Segment{
		StartDateTime:    newDateTime(sd),
		EndDateTime:      newDateTime(ed),
		StartAirportCode: kv["start_airport_code"].(string),
		EndAirportCode:   kv["end_airport_code"].(string),
	}
}

type DateTime struct {
	Date      string
	Time      string
	Timezone  string
	UtcOffset string `json:"utc_offset"`
}

func newDateTime(kv map[string]interface{}) DateTime {
	return DateTime{
		Date:      fmt.Sprintf("%v", kv["date"]),
		Time:      fmt.Sprintf("%v", kv["time"]),
		Timezone:  fmt.Sprintf("%v", kv["timezone"]),
		UtcOffset: fmt.Sprintf("%v", kv["utc_offset"]),
	}
}

func (dt *DateTime) Parse() (time.Time, error) {
	loc, err := time.LoadLocation(dt.Timezone)
	if err != nil {
		return time.Time{}, err
	}
	return time.ParseInLocation("2006-01-02 15:04:05", dt.Date+" "+dt.Time, loc)
}


text:
'''
   Utilities used for testing
'''

from FileVersion.versioned_file import VersionedFile
from Files.data_capture import DataCapture
from mysite import settings
from scisheets.ui.dt_table import DTTable
from scisheets.core.helpers import api_util
import column as cl
import contextlib
import numpy as np
import os
import subprocess
import StringIO
import sys

TEST_DIR = settings.SCISHEETS_TEST_DIR
TEST_TABLE = "TEST_TABLE"
TEST_FILENAME = "%s.%s" % (TEST_TABLE, settings.SCISHEETS_EXT)
TABLE_FILEPATH = os.path.join(TEST_DIR, TEST_FILENAME)
MAX_VERSIONS = 3

# Constants
COLUMN = "DUMMY_COLUMN"
COLUMN1 = "DUMMY1_COLUMN"
COLUMN2 = "DUMMY2_COLUMN"
COLUMN3 = "DUMMY3_COLUMN"
COLUMN4 = "DUMMY4_COLUMN"
COLUMN5 = "DUMMY5_COLUMN"
COLUMN2_INDEX = 1
TABLE_NAME = "DUMMY_TABLE"
SUBTABLE_NAME = "DUMMY_SUBTABLE"
LIST = [2.0, 3.0]
LIST2 = [3.0]
TABLE = 'DUMMY'
FORMULA = "A+B"
COLUMN1_CELLS = ["one", "two", "three"]
COLUMN2_CELLS = [10.1, 20.0, 30.0]
COLUMN5_CELLS = [100.0, 200.0, 300.0]

#############################
# Helper Functions
#############################
def getCapture(filename):
  dc = DataCapture(filename)
  return dc.getData()

def toList(val):
  """
  Converts a value to a list.
  :param val: value to convert
  :return: list
  """
  if isinstance(val, list):
    data_list = val
  elif isinstance(val, np.ndarray):
    data_list = val.tolist()
  else:
    data_list = [val]
  return data_list

def compareValues(val1, val2):
  """
  Compares two scalars or lists
  :param val1: first value to compare
  :param val2: secondvalue to compare
  :return: Boolean
  """
  list1 = toList(val1)
  list2 = toList(val2)
  if len(list1) != len(list2):
    return False
  is_equal = True
  for idx in range(len(list1)):
    is_equal = is_equal and (list1[idx] == list2[idx])
  return is_equal

def createColumn(name, data=np.array([]), table=None, formula=None):
  """
  :param name: str column name
  :param data: np.ndarray data values
  :param table: Table that reerences the column
  :param formula: formula in column
  :return: column object with data populated
  """
  aColumn = cl.Column(name)
  aColumn.addCells(data)
  aColumn.setTable(table)
  aColumn.setFormula(formula)
  return aColumn

def createTable(name, column_name=None, is_subtable=False):
  """
  :param str name: str table name
  :param str or list column_name: column(s) to create
  :param bool is_subtable: true if table is a subtable
  :return: Table object
  """
  if column_name is None:
    colnms = []
  elif isinstance(column_name, list):
    colnms = column_name
  else:
    colnms = [column_name]
  table = DTTable(name)
  factor = 1
  for colnm in colnms:
    column = cl.Column(colnm)
    values = [factor*n for n in range(5)]
    factor += 1
    column.addCells(values, replace=True)
    table.addColumn(column)
  if not is_subtable:
    versioned_file = VersionedFile(TABLE_FILEPATH, TEST_DIR, MAX_VERSIONS)
    table.setVersionedFile(versioned_file)
    api_util.writeObjectToFile(table, TABLE_FILEPATH)
  return table

def compareTableData(table1, table2, excludes=None):
  """
  Compares the data in the tables.
  :param Table table1, table2:
  :param list-of-int excludes: column indicies excluded from the comparison
  :return bool: True if comparison matches
  """
  if excludes is None:
    excludes = []
  if table1.numColumns() != table2.numColumns():
    return False
  for idx in range(table1.numColumns()):
    if not idx in excludes:
      data1 = table1.getColumns()[idx].getCells()
      data2 = table2.getColumns()[idx].getCells()
      if data1 != data2:
        return False
  return True

@contextlib.contextmanager
def stdoutIO(stdout=None):
  """
  Captures standard output when executing a python command
  :param stdout: where standard output is directed
  """
  # Captures standard output
  # Usage: with stdoutIO() as s:
  old = sys.stdout
  if stdout is None:
    stdout = StringIO.StringIO()
  sys.stdout = stdout
  yield stdout
  sys.stdout = old

def augmentPythonPath(thisFile):
  """
  Ensures that the python path includes the directory of the
  test file
  :param str thisFile: path to the file being tested.
  """
  if not isinstance(thisFile, list):
    filelist = [thisFile]
  else:
    filelist = thisFile
  for aFile in filelist:
    sys.path.append(os.path.dirname(aFile))

def setupTableInitialization(o):
  """
  Adds a table to the unittest object.
  """
  o.table = createTable(TABLE_NAME)
  num = 1  # Number of columns in o.table
  column1 = cl.Column(COLUMN1)
  column1.addCells(COLUMN1_CELLS)
  o.table.addColumn(column1)
  num += 1
  column2 = cl.Column(COLUMN2)
  column2.addCells(COLUMN2_CELLS)
  o.table.addColumn(column2)
  num += 1
  column5 = cl.Column(COLUMN5)
  column5.addCells(COLUMN5_CELLS)
  o.table.addColumn(column5)
  num += 1
  o.subtable = createTable(SUBTABLE_NAME, is_subtable=True)
  o.subtable_column1 = cl.Column(COLUMN1)
  o.subtable_column1.addCells(COLUMN1_CELLS)
  o.subtable.addColumn(o.subtable_column1)
  o.table.addChild(o.subtable)
  num += 2  # 'row' in SUBTALBE + column1
  o.num_columns = num

def runProcess(commands):
  """
  Runs the specified commands in a process.
  :param str commands:
  :return str: output from commands
  """
  process = subprocess.Popen(commands,
      stdout=subprocess.PIPE, shell=True)
  return process.communicate()[0].strip()

class TableFileHelper(object):
  """
  Creates and removes a dummy Table File
  """

  @classmethod
  def doesFilepathExist(cls, filepath):
    """
    Checks if the table file exists
    :param str filepath: filepath to check
    :return: boolean
    """
    return os.path.exists(filepath)

  @classmethod
  def doesTableFileExist(cls, table_filename, filedir):
    """
    Checks if the table file exists
    :param table_filename: table file name without extension
    :param table_filedir: directory for the table file
    :return: boolean
    """
    full_filename = "%s.%s" % (table_filename, settings.SCISHEETS_EXT)
    full_path = os.path.join(filedir, full_filename)
    return TableFileHelper.doesFilepathExist(full_path)

  def __init__(self, table_filename, table_filedir, table_name=None):
    """
    :param table_filename: name of the dummy table file
    :param table_filedir: directory for the table file
    """
    self.table = None
    self._table_filename = table_filename
    self._table_filedir = table_filedir
    self._full_path = os.path.join(table_filedir,
        "%s.%s" % (self._table_filename, settings.SCISHEETS_EXT))
    self._table_name = table_name
    if self._table_name is None:
      self._table_name = table_filename

  def create(self):
    """
    Creates Table file and the table
    """
    if os.path.exists(self._full_path):
      self.table = api_util.readObjectFromFile(self._full_path)
      self.table.setFilepath(self._full_path)  # Set before write
    else:
      self.table = DTTable(self._table_name)
      self.table.setFilepath(self._full_path)  # Set before write
      api_util.writeObjectToFile(self.table)

  def destroy(self):
    """
    Destroys a Table file
    """
    if TableFileHelper.doesTableFileExist(self._table_filename,
        self._table_filedir):
      os.remove(self._full_path)


text:
package com.sixthsolution.apex.nlp.persian.model;

import com.sixthsolution.apex.nlp.ner.ChunkedPart;
import com.sixthsolution.apex.nlp.persian.calendar.tools.JalaliCalendar;
import com.sixthsolution.apex.nlp.persian.event.PersianEventBuilder;
import org.threeten.bp.LocalDateTime;

/**
 * @author Saeed Masoumi (s-masoumi@live.com)
 */

public interface PersianExtractor {
    void extract(PersianEventBuilder builder, JalaliCalendar source, ChunkedPart chunkedPart);
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<wicket:head>

</wicket:head>

<wicket:panel>

      #

</wicket:panel>


text:
package com.idata.mq.base;

import java.io.UnsupportedEncodingException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.support.converter.AbstractMessageConverter;
import org.springframework.amqp.support.converter.MessageConversionException;

import com.alibaba.fastjson.JSON;

public class FastJsonMessageConverter extends AbstractMessageConverter {

    public static final String DEFAULT_CHARSET = "UTF-8";

    private volatile String defaultCharset = DEFAULT_CHARSET;

    private final static Logger LOGGER = LogManager.getLogger(FastJsonMessageConverter.class);

    public FastJsonMessageConverter() {
        super();

    }

    public void setDefaultCharset(String defaultCharset) {

        this.defaultCharset = (defaultCharset != null) ? defaultCharset

                : DEFAULT_CHARSET;

    }

    @Override
    public Object fromMessage(Message message)

            throws MessageConversionException {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("[][fromMessage][" + message + "]");
        }

        return null;

    }

    public <T> T fromMessage(Message message, T t) {

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("[][fromMessage to class][" + message + "]");
        }

        String json = "";
        try {
            json = new String(message.getBody(), defaultCharset);
        }
        catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return (T) JSON.parseObject(json, t.getClass());
    }

    @Override
    protected Message createMessage(Object objectToConvert, MessageProperties messageProperties)
            throws MessageConversionException {

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("[][createMessage][" + objectToConvert + "][" + messageProperties + "]");
        }

        byte[] bytes = null;
        try {
            String jsonString = JSON.toJSONString(objectToConvert);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("[][createMessage][jsonString:" + jsonString + "]");
            }
            bytes = jsonString.getBytes(this.defaultCharset);
        }
        catch (UnsupportedEncodingException e) {
            throw new MessageConversionException("Failed to convert Message content", e);
        }
        messageProperties.setContentType(MessageProperties.CONTENT_TYPE_JSON);
        messageProperties.setContentEncoding(this.defaultCharset);
        if (bytes != null) {
            messageProperties.setContentLength(bytes.length);
        }
        return new Message(bytes, messageProperties);
    }

}


text:
import * as React from 'react';
import Password from 'react-better-password';

interface PasswordState {
    password: string;
}

class ReactBetterPasswordTest extends React.Component<{}, PasswordState> {
    state = {
        password: "",
    };

    handlePw = (password: string) => {
        this.setState({ password });
    }

    render() {
        const { password } = this.state;
        return (
            <Password
                className="password"
                value={password}
                onChange={this.handlePw}
                placeholder="set a password"
            />
        );
    }
}
export default ReactBetterPasswordTest;


text:
<!doctype html>
<!--
Tests that WebXR doesn't update frame data when the tab is not focused
-->
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css">
  </head>
  <body>
    <canvas id="webgl-canvas"></canvas>
    <script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script>
    <script src="../resources/webxr_e2e.js"></script>
    <script src="../resources/webxr_boilerplate.js"></script>
    <script>
      setup({single_test: true});

      var pose = null;
      let counter = 0;

      function stepCheckFrameDataWhileFocusedTab() {
        function onAnimationFrame(session, frame) {
          // TODO(bsheedy): This is a workaround for crbug.com/787196. Either
          // remove the workaround once fixed or remove this todo.
          // Let several animation frames get triggered so we're sure to have a
          // pose
          if (counter <= 2) {
            counter++;
            return;
          }
          onMagicWindowXRFrameCallback = null;
          pose = frame.getViewerPose(sessionInfos[sessionTypes.MAGIC_WINDOW].currentRefSpace);
          assert_true(pose != null,
              "getViewerPose returned a non-null object");
          assert_true(pose instanceof XRViewerPose,
              "getViewerPose returned an XRViewerPose")
          finishJavaScriptStep();
        }
        // Make sure at least one rAF call has happened so we get valid data
        onMagicWindowXRFrameCallback = onAnimationFrame;
      }

      function stepCheckFrameDataWhileNonFocusedTab() {
        // Unlike WebVR, WebXR doesn't fire rAFs when in a different tab
        onMagicWindowXRFrameCallback = function() {
          assert_unreached("Magic window fired rAF while in a different tab");
        }
        window.setTimeout( () => {
          done();
        }, 1000);
      }
    </script>
  </body>
</html>


text:
/* -*- mode: C++; c-basic-offset: 4; -*- */
/* ex: set shiftwidth=4 tabstop=4 expandtab: */
/*
 * Copyright (c) 2015, Rice University
 * All rights reserved.
 *
 * Author(s): Neil T. Dantam <ntd@rice.edu>
 *
 *   Redistribution and use in source and binary forms, with or
 *   without modification, are permitted provided that the following
 *   conditions are met:
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above
 *     copyright notice, this list of conditions and the following
 *     disclaimer in the documentation and/or other materials provided
 *     with the distribution.
 *   * Neither the name of copyright holder the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 *   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 *   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 *   ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 *   POSSIBILITY OF SUCH DAMAGE.
 *
 */

#ifndef AMINO_SCENEGRAPH_INTERNAL_H
#define AMINO_SCENEGRAPH_INTERNAL_H

struct aa_rx_config_limits {
    double pos_min;
    double pos_max;

    double vel_min;
    double vel_max;

    double acc_min;
    double acc_max;

    double eff_min;
    double eff_max;

    unsigned has_pos : 1;
    unsigned has_vel : 1;
    unsigned has_acc : 1;
    unsigned has_eff : 1;
};

struct aa_rx_inertial {
    double inertia[9];
    double mass;
};

#ifdef __cplusplus

#include <vector>
#include <string>
#include <map>
#include <set>

namespace amino {

struct SceneFrame  {
    SceneFrame( enum aa_rx_frame_type type_,
                const char *parent,
                const char *name,
                const double q[4], const double v[3] );
    virtual ~SceneFrame() ;

    virtual void tf_rel( const double *q, double E[7] ) = 0;
    //virtual aa_rx_frame_type type() = 0;
    int in_global();

    enum aa_rx_frame_type type;
    struct aa_rx_inertial *inertial;

    /* Kinematic values */
    std::string name;
    std::string parent;
    aa_rx_frame_id frame_id;
    aa_rx_frame_id parent_id;
    double E[7];

    /* Geometry */
    std::vector<struct aa_rx_geom*> geometry;
};

struct SceneFrameFixed : public SceneFrame {
    SceneFrameFixed( const char *parent,
                     const char *name,
                     const double q[4], const double v[3] );
    virtual ~SceneFrameFixed();
    virtual void tf_rel( const double *q, double E[7] );
    //virtual aa_rx_frame_type type();
};

struct SceneFrameJoint : public SceneFrame {
    SceneFrameJoint( enum aa_rx_frame_type type,
                     const char *parent,
                     const char *name,
                     const double q[4], const double v[3],
                     const char *config_name,
                     double offset, const double axis[3] );
    virtual ~SceneFrameJoint();

    std::string config_name;
    size_t config_index;
    double offset;
    double axis[3];
};

struct SceneFramePrismatic : public SceneFrameJoint {
    SceneFramePrismatic( const char *parent,
                         const char *name,
                         const double q[4], const double v[3],
                         const char *config_name,
                         double offset, const double axis[3] );
    virtual ~SceneFramePrismatic();
    virtual void tf_rel( const double *q, double E[7] );
    //virtual aa_rx_frame_type type();
};

struct SceneFrameRevolute : public SceneFrameJoint {
    SceneFrameRevolute( const char *parent,
                        const char *name,
                        const double q[4], const double v[3],
                        const char *config_name,
                        double offset, const double axis[3] );
    virtual ~SceneFrameRevolute();
    virtual void tf_rel( const double *q, double E[7] );
    //virtual aa_rx_frame_type type();
};

struct SceneGraph  {
    SceneGraph();
    ~SceneGraph();

    int index();
    void add(SceneFrame *f);

    /** Map from frame name to frame */
    std::map<std::string,SceneFrame*> frame_map;

    /** Map from configuration name to configuration limits */
    std::map<std::string,struct aa_rx_config_limits*> limits_map;

    /** Array of frames */
    std::vector<SceneFrame*> frames;

    /** Array of configuration limits */
    std::vector<struct aa_rx_config_limits*> limits;

    /** Map from configuration name to configuration index */
    std::map<std::string,aa_rx_config_id> config_map;

    /** Map from configuration index to configuration name */
    std::vector<const char *> config_rmap;

    /** Number of configuration variables */
    size_t config_size;

    /** Set of allowable collision frames by name */
    std::set<std::pair<const char*,const char*> > allowed;

    /** List of allowable collisions by indices */
    std::vector<size_t> allowed_indices1;
    std::vector<size_t> allowed_indices2;

    void (*destructor)(void *);
    void *destructor_context;

    /** Are the indices invalid? */
    unsigned dirty_indices : 1;
    unsigned dirty_collision : 1;
    unsigned dirty_gl : 1;
};

}

struct aa_rx_sg {
    amino::SceneGraph *sg;
};

#endif /* __cplusplus */

AA_API void
aa_rx_sg_add_geom( struct aa_rx_sg *scene_graph, const char *frame,
                   struct aa_rx_geom *geom );

AA_API void
aa_rx_sg_dirty_geom( struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_ensure_clean_frames( const struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_clean_gl( struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_clean_collision( struct aa_rx_sg *scene_graph );

AA_API int
aa_rx_sg_is_clean( struct aa_rx_sg *scene_graph );

AA_API int
aa_rx_sg_is_clean_gl( struct aa_rx_sg *scene_graph );

AA_API int
aa_rx_sg_is_clean_collision( struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_ensure_clean_gl( const struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_ensure_clean_collision( const struct aa_rx_sg *scene_graph );

AA_API void
aa_rx_sg_set_destructor(
    const struct aa_rx_sg *scene_graph,
    void (*destructor)(void*),
    void *context );

#endif /*AMINO_SCENEGRAPH_H*/


text:
package org.scalaml.reinforcement.xcs

import org.scalaml.ga.GAConfig
import org.scalaml.reinforcement.qlearning.QLConfig
import org.scalaml.core.Design.Config

		/**
		 *
Class that defined the configuration parameters for the XCS algorithm.

		 * @constructor Create a configuration for the XCS algorithm
		 * @param gaConfig  Configuration of the Genetic Algorithm used in extracting the
		 * fittest rules or classifier
		 * @param qlConfig  Configuration parameters for the Q-learning algorithm.
		 *
		 * @author Patrick Nicolas
		 * @since March 22, 2014
		 * @note Scala for Machine Learning Chapter 11 Reinforcement learning /
		 * Extended learning classifier systems
		 */
final protected class XcsConfig(val gaConfig: GAConfig, val qlConfig: QLConfig) extends Config

// --------------------------  EOF ------------------------------------------------


text:
using content::RenderThread;
using blink::WebSpeechSynthesizerClient;
using blink::WebSpeechSynthesisUtterance;
using blink::WebSpeechSynthesisVoice;
using blink::WebString;
using blink::WebVector;

int TtsDispatcher::next_utterance_id_ = 1;

TtsDispatcher::TtsDispatcher(WebSpeechSynthesizerClient* client)
    : synthesizer_client_(client) {
  RenderThread::Get()->AddObserver(this);
}

TtsDispatcher::~TtsDispatcher() {
  RenderThread::Get()->RemoveObserver(this);
}

bool TtsDispatcher::OnControlMessageReceived(const IPC::Message& message) {
  IPC_BEGIN_MESSAGE_MAP(TtsDispatcher, message)
    IPC_MESSAGE_HANDLER(TtsMsg_SetVoiceList, OnSetVoiceList)
    IPC_MESSAGE_HANDLER(TtsMsg_DidStartSpeaking, OnDidStartSpeaking)
    IPC_MESSAGE_HANDLER(TtsMsg_DidFinishSpeaking, OnDidFinishSpeaking)
    IPC_MESSAGE_HANDLER(TtsMsg_DidPauseSpeaking, OnDidPauseSpeaking)
    IPC_MESSAGE_HANDLER(TtsMsg_DidResumeSpeaking, OnDidResumeSpeaking)
    IPC_MESSAGE_HANDLER(TtsMsg_WordBoundary, OnWordBoundary)
    IPC_MESSAGE_HANDLER(TtsMsg_SentenceBoundary, OnSentenceBoundary)
    IPC_MESSAGE_HANDLER(TtsMsg_MarkerEvent, OnMarkerEvent)
    IPC_MESSAGE_HANDLER(TtsMsg_WasInterrupted, OnWasInterrupted)
    IPC_MESSAGE_HANDLER(TtsMsg_WasCancelled, OnWasCancelled)
    IPC_MESSAGE_HANDLER(TtsMsg_SpeakingErrorOccurred, OnSpeakingErrorOccurred)
  IPC_END_MESSAGE_MAP()

  // Always return false because there may be multiple TtsDispatchers
  // and we want them all to have a chance to handle this message.
  return false;
}

void TtsDispatcher::updateVoiceList() {
  RenderThread::Get()->Send(new TtsHostMsg_InitializeVoiceList());
}

void TtsDispatcher::speak(const WebSpeechSynthesisUtterance& web_utterance) {
  int id = next_utterance_id_++;

  utterance_id_map_[id] = web_utterance;

  TtsUtteranceRequest utterance;
  utterance.id = id;
  utterance.text = web_utterance.text().utf8();
  utterance.lang = web_utterance.lang().utf8();
  utterance.voice = web_utterance.voice().utf8();
  utterance.volume = web_utterance.volume();
  utterance.rate = web_utterance.rate();
  utterance.pitch = web_utterance.pitch();
  RenderThread::Get()->Send(new TtsHostMsg_Speak(utterance));
}

void TtsDispatcher::pause() {
  RenderThread::Get()->Send(new TtsHostMsg_Pause());
}

void TtsDispatcher::resume() {
  RenderThread::Get()->Send(new TtsHostMsg_Resume());
}

void TtsDispatcher::cancel() {
  RenderThread::Get()->Send(new TtsHostMsg_Cancel());
}

WebSpeechSynthesisUtterance TtsDispatcher::FindUtterance(int utterance_id) {
  base::hash_map<int, WebSpeechSynthesisUtterance>::const_iterator iter =
      utterance_id_map_.find(utterance_id);
  if (iter == utterance_id_map_.end())
    return WebSpeechSynthesisUtterance();
  return iter->second;
}

void TtsDispatcher::OnSetVoiceList(const std::vector<TtsVoice>& voices) {
  WebVector<WebSpeechSynthesisVoice> out_voices(voices.size());
  for (size_t i = 0; i < voices.size(); ++i) {
    out_voices[i] = WebSpeechSynthesisVoice();
    out_voices[i].setVoiceURI(WebString::fromUTF8(voices[i].voice_uri));
    out_voices[i].setName(WebString::fromUTF8(voices[i].name));
    out_voices[i].setLanguage(WebString::fromUTF8(voices[i].lang));
    out_voices[i].setIsLocalService(voices[i].local_service);
    out_voices[i].setIsDefault(voices[i].is_default);
  }
  synthesizer_client_->setVoiceList(out_voices);
}

void TtsDispatcher::OnDidStartSpeaking(int utterance_id) {
  if (utterance_id_map_.find(utterance_id) == utterance_id_map_.end())
    return;

  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->didStartSpeaking(utterance);
}

void TtsDispatcher::OnDidFinishSpeaking(int utterance_id) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->didFinishSpeaking(utterance);
  utterance_id_map_.erase(utterance_id);
}

void TtsDispatcher::OnDidPauseSpeaking(int utterance_id) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->didPauseSpeaking(utterance);
}

void TtsDispatcher::OnDidResumeSpeaking(int utterance_id) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->didResumeSpeaking(utterance);
}

void TtsDispatcher::OnWordBoundary(int utterance_id, int char_index) {
  CHECK(char_index >= 0);

  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->wordBoundaryEventOccurred(
      utterance, static_cast<unsigned>(char_index));
}

void TtsDispatcher::OnSentenceBoundary(int utterance_id, int char_index) {
  CHECK(char_index >= 0);

  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  synthesizer_client_->sentenceBoundaryEventOccurred(
      utterance, static_cast<unsigned>(char_index));
}

void TtsDispatcher::OnMarkerEvent(int utterance_id, int char_index) {
  // Not supported yet.
}

void TtsDispatcher::OnWasInterrupted(int utterance_id) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  // The web speech API doesn't support "interrupted".
  synthesizer_client_->didFinishSpeaking(utterance);
  utterance_id_map_.erase(utterance_id);
}

void TtsDispatcher::OnWasCancelled(int utterance_id) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  // The web speech API doesn't support "cancelled".
  synthesizer_client_->didFinishSpeaking(utterance);
  utterance_id_map_.erase(utterance_id);
}

void TtsDispatcher::OnSpeakingErrorOccurred(int utterance_id,
                                            const std::string& error_message) {
  WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id);
  if (utterance.isNull())
    return;

  // The web speech API doesn't support an error message.
  synthesizer_client_->speakingErrorOccurred(utterance);
  utterance_id_map_.erase(utterance_id);
}


text:
namespace SrilankanTamilFingerSpelling.GUI
{
    partial class frmRegognition
    {
        /// <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();
            this.picSourceImage = new System.Windows.Forms.PictureBox();
            this.webCam = new WebCamUserController.WebCamVirtualDevice();
            this.lblResult = new System.Windows.Forms.Label();
            this.WordCreatorTimer = new System.Windows.Forms.Timer(this.components);
            this.WordCreatorTimer2 = new System.Windows.Forms.Timer(this.components);
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.button2 = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.picSourceImage)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // picSourceImage
            //
            this.picSourceImage.Location = new System.Drawing.Point(25, 21);
            this.picSourceImage.Name = "picSourceImage";
            this.picSourceImage.Size = new System.Drawing.Size(350, 350);
            this.picSourceImage.TabIndex = 0;
            this.picSourceImage.TabStop = false;
            //
            // webCam
            //
            this.webCam.CaptureHeight = 240;
            this.webCam.CaptureWidth = 320;
            this.webCam.FrameNumber = ((ulong)(0ul));
            this.webCam.Location = new System.Drawing.Point(0, 0);
            this.webCam.Name = "WebCamVirtualDevice";
            this.webCam.Size = new System.Drawing.Size(342, 252);
            this.webCam.TabIndex = 0;
            this.webCam.TimeToCapture_milliseconds = 100;
            this.webCam.ImageCaptured += new WebCamUserController.WebCamVirtualDevice.WebCamEventHandler(this.webCamera_ImageCaptured);
            //
            // lblResult
            //
            this.lblResult.AutoSize = true;
            this.lblResult.BackColor = System.Drawing.Color.Red;
            this.lblResult.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F);
            this.lblResult.Location = new System.Drawing.Point(164, 290);
            this.lblResult.Name = "lblResult";
            this.lblResult.Size = new System.Drawing.Size(0, 52);
            this.lblResult.TabIndex = 22;
            //
            // WordCreatorTimer
            //
            this.WordCreatorTimer.Enabled = true;
            this.WordCreatorTimer.Interval = 350;
            this.WordCreatorTimer.Tick += new System.EventHandler(this.WordCreatorTimer_Tick);
            //
            // WordCreatorTimer2
            //
            this.WordCreatorTimer2.Enabled = true;
            this.WordCreatorTimer2.Interval = 355;
            this.WordCreatorTimer2.Tick += new System.EventHandler(this.WordCreatorTimer2_Tick);
            //
            // textBox1
            //
            this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBox1.Location = new System.Drawing.Point(232, 390);
            this.textBox1.Multiline = true;
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(492, 142);
            this.textBox1.TabIndex = 23;
            //
            // groupBox1
            //
            this.groupBox1.BackColor = System.Drawing.Color.Transparent;
            this.groupBox1.Controls.Add(this.picSourceImage);
            this.groupBox1.Location = new System.Drawing.Point(275, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(401, 384);
            this.groupBox1.TabIndex = 24;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Video Stream";
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(843, 494);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 38);
            this.button2.TabIndex = 25;
            this.button2.Text = "Close";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // frmRegognition
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackgroundImage = global::SrilankanTamilFingerSpelling.Properties.Resources.MDIChild;
            this.ClientSize = new System.Drawing.Size(930, 539);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.lblResult);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Location = new System.Drawing.Point(0, 89);
            this.Name = "frmRegognition";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Srilankan Tamil Finger Spelling :: Regognition Phase";
            this.Load += new System.EventHandler(this.frmRegognition_Load);
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmRegognition_FormClosed);
            ((System.ComponentModel.ISupportInitialize)(this.picSourceImage)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.PictureBox picSourceImage;
        private WebCamUserController.WebCamVirtualDevice webCam;
        private System.Windows.Forms.Label lblResult;
        private System.Windows.Forms.Timer WordCreatorTimer;
        private System.Windows.Forms.Timer WordCreatorTimer2;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button button2;
    }
}


text:
//
//   Copyright 2018  SenX S.A.S.
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//

package io.warp10.script.functions;

import io.warp10.continuum.gts.GTSHelper;
import io.warp10.continuum.gts.GeoTimeSerie;
import io.warp10.script.GTSStackFunction;
import io.warp10.script.WarpScriptException;
import io.warp10.script.WarpScriptStack;

import java.util.HashMap;
import java.util.Map;

/**
 * Copy location/elevation from one GTS into others
 */
public class COPYGEO extends  GTSStackFunction  {

  private static final String PARAM_GEO_GTS = "geo.gts";

  public COPYGEO(String name) {
    super(name);
  }

  @Override
  protected Map<String, Object> retrieveParameters(WarpScriptStack stack) throws WarpScriptException {
    Object top = stack.pop();

    if (!(top instanceof GeoTimeSerie)) {
      throw new WarpScriptException(getName() + " expects a Geo Time Series on top of the stack.");
    }

    Map<String,Object> params = new HashMap<String, Object>();
    params.put(PARAM_GEO_GTS, top);
    return params;
  }

  @Override
  protected Object gtsOp(Map<String, Object> params, GeoTimeSerie gts) throws WarpScriptException {
    GeoTimeSerie from = (GeoTimeSerie) params.get(PARAM_GEO_GTS);
    GTSHelper.copyGeo(from, gts);
    return gts;
  }
}


text:
package org.apache.wicket.protocol.http.servlet;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.wicket.protocol.http.IMultipartWebRequest;
import org.apache.wicket.request.IRequestParameters;
import org.apache.wicket.request.Url;
import org.apache.wicket.util.upload.FileItem;

/**
 * Servlet specific WebRequest subclass for multipart content uploads.
 *
 * @author Matej Knopp
 */
public abstract class MultipartServletWebRequest extends ServletWebRequest
	implements
		IMultipartWebRequest
{

	/**
	 * Construct.
	 *
	 * @param httpServletRequest
	 * @param filterPrefix
	 */
	public MultipartServletWebRequest(HttpServletRequest httpServletRequest, String filterPrefix)
	{
		super(httpServletRequest, filterPrefix);
	}

	/**
	 * Construct.
	 *
	 * @param httpServletRequest
	 * @param filterPrefix
	 * @param url
	 */
	public MultipartServletWebRequest(HttpServletRequest httpServletRequest, String filterPrefix,
		Url url)
	{
		super(httpServletRequest, filterPrefix, url);
	}

	@Override
	public ServletWebRequest cloneWithUrl(Url url)
	{
		return new MultipartServletWebRequest(getContainerRequest(), getFilterPrefix(), url)
		{
			public List<FileItem> getFile(String fieldName)
			{
				return MultipartServletWebRequest.this.getFile(fieldName);
			}

			public Map<String, List<FileItem>> getFiles()
			{
				return MultipartServletWebRequest.this.getFiles();
			}

			@Override
			public IRequestParameters getPostParameters()
			{
				return MultipartServletWebRequest.this.getPostParameters();
			}
		};
	}
}


text:
package com.treode.cps.stub.io

import java.nio.ByteBuffer
import java.nio.channels._
import org.scalatest.{FlatSpec, PropSpec, Specs}
import org.scalatest.junit.JUnitRunner
import org.scalatest.prop.PropertyChecks
import scala.util.Random
import com.treode.cps.scalatest.{CpsFlatSpec, CpsPropSpec}
import com.treode.cps.io.{SocketBehaviors, SocketChecks}
import com.treode.cps.stub.scheduler.TestScheduler
import com.treode.cps.sync.Future

import Future.start

class SocketStubSpec extends Specs (SocketStubBehaviors, SocketStubProperties)

private object SocketStubBehaviors extends CpsFlatSpec with SocketBehaviors {

  class StubSpecKit extends SocketSpecKit {
    implicit val random = new scala.util.Random (0)
    implicit val scheduler = TestScheduler.sequential ()
    def newServerAddress() = SocketAddressStub ()
    def newSocket() = new SocketStub ()
    def newServerSocket() = new ServerSocketStub ()
  }

  "A server socket stub" should behave like aServerSocket (() => new StubSpecKit)

  "A socket stub" should behave like aSocket (() => new StubSpecKit)

  // We cannot force the kernel to pend connections on live sockets.
  it should "refuse connect when a connection is pending" in {
    val kit = new StubSpecKit
    import kit.{newServerAddress, newServerSocket, newSocket, scheduler}
    import kit.scheduler.spawn

    val server = newServerSocket
    server.bind (newServerAddress, 0)
    val address = server.localAddress.get
    spawn {
      val s = newSocket
      val thrown1 = start {
        val thrown = interceptCps [Exception] (s.connect (address))
        s.close ()
        thrown
      }
      val thrown2 = start {
        val thrown = interceptCps [Exception] (s.connect (address))
        s.close ()
        thrown
      }
      val e1 = thrown1.get
      val e2 = thrown2.get
      assert ((Seq (e1, e2) exists (_.isInstanceOf [ConnectionPendingException])))
      assert ((Seq (e1, e2) exists (_.isInstanceOf [AsynchronousCloseException])))
    }
    kit.run (false)
  }

  it should "throw an exception from connect when shutdown" in {
    val kit = new StubSpecKit
    import kit.{newServerAddress, newSocket}
    import kit.scheduler.spawn

    spawn {
      val s = newSocket
      interceptCps [AsynchronousCloseException] (s.connect (newServerAddress))
    }
    kit.run (false)
  }

  // This one hangs on Linux's live implementation, which is not helpful.
  it should "require connect before read" in {
    val kit = new StubSpecKit
    import kit.newSocket
    import kit.scheduler.spawn

    spawn {
      val s = newSocket
      interceptCps [NotYetConnectedException] (s.read (ByteBuffer.allocate (16)))
      s.close ()
    }
    kit.run (true)
  }

  // This one passes/fails in a flakey way on Linux's live implementation.
  it should "throw an exception from read when shutdown" in {
    val kit = new StubSpecKit
    import kit.{newServer, newSocket}
    import kit.scheduler.spawn

    val address = newServer ()
    spawn {
      val s = newSocket
      s.connect (address)
      interceptCps [AsynchronousCloseException] (s.read (ByteBuffer.allocate (16)))
    }
    kit.run (false)
  }}

private object SocketStubProperties extends CpsPropSpec with SocketChecks {

  class StubSpecKit (implicit random: Random) extends SocketSpecKit {
    implicit val scheduler = TestScheduler.random (random)
    def newServerAddress() = SocketAddressStub ()
    def newSocket() = new SocketStub ()
    def newServerSocket() = new ServerSocketStub ()
  }

  property ("SocketStubs open, connect, send and receive") {
    forAll (seeds) { seed: Long =>
      checkOpenConnectWriteRead (new StubSpecKit () (new Random (seed)))
    }}}


text:
/*
 * This class was automatically generated with
 * Castor 1.2, using an XML
 * Schema.
 * $Id: BusinessDataType.java,v 1.2 2010/07/29 02:41:59 back Exp $
 */

package org.ralasafe.db.sql.xml;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 *
 *
 * @version $Revision: 1.2 $ $Date: 2010/07/29 02:41:59 $
 */
public class BusinessDataType implements java.io.Serializable {

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _name.
     */
    private java.lang.String _name;

    /**
     * Field _isRawScript.
     */
    private boolean _isRawScript = false;

    /**
     * keeps track of state for field: _isRawScript
     */
    private boolean _has_isRawScript;

    /**
     * Field _defineVariableList.
     */
    private java.util.Vector _defineVariableList;

    /**
     * Field _exprGroup.
     */
    private org.ralasafe.db.sql.xml.ExprGroup _exprGroup;

    /**
     * Field _rawScript.
     */
    private org.ralasafe.db.sql.xml.RawScript _rawScript;

      //----------------/
     //- Constructors -/
    //----------------/

    public BusinessDataType() {
        super();
        this._defineVariableList = new java.util.Vector();
    }

      //-----------/
     //- Methods -/
    //-----------/

    /**
     *
     *
     * @param vDefineVariable
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addDefineVariable(
            final org.ralasafe.db.sql.xml.DefineVariable vDefineVariable)
    throws java.lang.IndexOutOfBoundsException {
        this._defineVariableList.addElement(vDefineVariable);
    }

    /**
     *
     *
     * @param index
     * @param vDefineVariable
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void addDefineVariable(
            final int index,
            final org.ralasafe.db.sql.xml.DefineVariable vDefineVariable)
    throws java.lang.IndexOutOfBoundsException {
        this._defineVariableList.add(index, vDefineVariable);
    }

    /**
     */
    public void deleteIsRawScript(
    ) {
        this._has_isRawScript= false;
    }

    /**
     * Method enumerateDefineVariable.
     *
     * @return an Enumeration over all
     * org.ralasafe.db.sql.xml.DefineVariable elements
     */
    public java.util.Enumeration enumerateDefineVariable(
    ) {
        return this._defineVariableList.elements();
    }

    /**
     * Method getDefineVariable.
     *
     * @param index
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     * @return the value of the org.ralasafe.db.sql.xml.DefineVariable
     * at the given index
     */
    public org.ralasafe.db.sql.xml.DefineVariable getDefineVariable(
            final int index)
    throws java.lang.IndexOutOfBoundsException {
        // check bounds for index
        if (index < 0 || index >= this._defineVariableList.size()) {
            throw new IndexOutOfBoundsException("getDefineVariable: Index value '" + index + "' not in range [0.." + (this._defineVariableList.size() - 1) + "]");
        }

        return (org.ralasafe.db.sql.xml.DefineVariable) _defineVariableList.get(index);
    }

    /**
     * Method getDefineVariable.Returns the contents of the
     * collection in an Array.
Note:  Just in case the
     * collection contents are changing in another thread, we pass
     * a 0-length Array of the correct type into the API call.
     * This way we know that the Array returned is of
     * exactly the correct length.
     *
     * @return this collection as an Array
     */
    public org.ralasafe.db.sql.xml.DefineVariable[] getDefineVariable(
    ) {
        org.ralasafe.db.sql.xml.DefineVariable[] array = new org.ralasafe.db.sql.xml.DefineVariable[0];
        return (org.ralasafe.db.sql.xml.DefineVariable[]) this._defineVariableList.toArray(array);
    }

    /**
     * Method getDefineVariableCount.
     *
     * @return the size of this collection
     */
    public int getDefineVariableCount(
    ) {
        return this._defineVariableList.size();
    }

    /**
     * Returns the value of field 'exprGroup'.
     *
     * @return the value of field 'ExprGroup'.
     */
    public org.ralasafe.db.sql.xml.ExprGroup getExprGroup(
    ) {
        return this._exprGroup;
    }

    /**
     * Returns the value of field 'isRawScript'.
     *
     * @return the value of field 'IsRawScript'.
     */
    public boolean getIsRawScript(
    ) {
        return this._isRawScript;
    }

    /**
     * Returns the value of field 'name'.
     *
     * @return the value of field 'Name'.
     */
    public java.lang.String getName(
    ) {
        return this._name;
    }

    /**
     * Returns the value of field 'rawScript'.
     *
     * @return the value of field 'RawScript'.
     */
    public org.ralasafe.db.sql.xml.RawScript getRawScript(
    ) {
        return this._rawScript;
    }

    /**
     * Method hasIsRawScript.
     *
     * @return true if at least one IsRawScript has been added
     */
    public boolean hasIsRawScript(
    ) {
        return this._has_isRawScript;
    }

    /**
     * Returns the value of field 'isRawScript'.
     *
     * @return the value of field 'IsRawScript'.
     */
    public boolean isIsRawScript(
    ) {
        return this._isRawScript;
    }

    /**
     * Method isValid.
     *
     * @return true if this object is valid according to the schema
     */
    public boolean isValid(
    ) {
        try {
            validate();
        } catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    }

    /**
     *
     *
     * @param out
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void marshal(
            final java.io.Writer out)
    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        Marshaller.marshal(this, out);
    }

    /**
     *
     *
     * @param handler
     * @throws java.io.IOException if an IOException occurs during
     * marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     */
    public void marshal(
            final org.xml.sax.ContentHandler handler)
    throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        Marshaller.marshal(this, handler);
    }

    /**
     */
    public void removeAllDefineVariable(
    ) {
        this._defineVariableList.clear();
    }

    /**
     * Method removeDefineVariable.
     *
     * @param vDefineVariable
     * @return true if the object was removed from the collection.
     */
    public boolean removeDefineVariable(
            final org.ralasafe.db.sql.xml.DefineVariable vDefineVariable) {
        boolean removed = _defineVariableList.remove(vDefineVariable);
        return removed;
    }

    /**
     * Method removeDefineVariableAt.
     *
     * @param index
     * @return the element removed from the collection
     */
    public org.ralasafe.db.sql.xml.DefineVariable removeDefineVariableAt(
            final int index) {
        java.lang.Object obj = this._defineVariableList.remove(index);
        return (org.ralasafe.db.sql.xml.DefineVariable) obj;
    }

    /**
     *
     *
     * @param index
     * @param vDefineVariable
     * @throws java.lang.IndexOutOfBoundsException if the index
     * given is outside the bounds of the collection
     */
    public void setDefineVariable(
            final int index,
            final org.ralasafe.db.sql.xml.DefineVariable vDefineVariable)
    throws java.lang.IndexOutOfBoundsException {
        // check bounds for index
        if (index < 0 || index >= this._defineVariableList.size()) {
            throw new IndexOutOfBoundsException("setDefineVariable: Index value '" + index + "' not in range [0.." + (this._defineVariableList.size() - 1) + "]");
        }

        this._defineVariableList.set(index, vDefineVariable);
    }

    /**
     *
     *
     * @param vDefineVariableArray
     */
    public void setDefineVariable(
            final org.ralasafe.db.sql.xml.DefineVariable[] vDefineVariableArray) {
        //-- copy array
        _defineVariableList.clear();

        for (int i = 0; i < vDefineVariableArray.length; i++) {
                this._defineVariableList.add(vDefineVariableArray[i]);
        }
    }

    /**
     * Sets the value of field 'exprGroup'.
     *
     * @param exprGroup the value of field 'exprGroup'.
     */
    public void setExprGroup(
            final org.ralasafe.db.sql.xml.ExprGroup exprGroup) {
        this._exprGroup = exprGroup;
    }

    /**
     * Sets the value of field 'isRawScript'.
     *
     * @param isRawScript the value of field 'isRawScript'.
     */
    public void setIsRawScript(
            final boolean isRawScript) {
        this._isRawScript = isRawScript;
        this._has_isRawScript = true;
    }

    /**
     * Sets the value of field 'name'.
     *
     * @param name the value of field 'name'.
     */
    public void setName(
            final java.lang.String name) {
        this._name = name;
    }

    /**
     * Sets the value of field 'rawScript'.
     *
     * @param rawScript the value of field 'rawScript'.
     */
    public void setRawScript(
            final org.ralasafe.db.sql.xml.RawScript rawScript) {
        this._rawScript = rawScript;
    }

    /**
     * Method unmarshal.
     *
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled org.ralasafe.db.sql.xml.BusinessDataType
     */
    public static org.ralasafe.db.sql.xml.BusinessDataType unmarshal(
            final java.io.Reader reader)
    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
        return (org.ralasafe.db.sql.xml.BusinessDataType) Unmarshaller.unmarshal(org.ralasafe.db.sql.xml.BusinessDataType.class, reader);
    }

    /**
     *
     *
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void validate(
    )
    throws org.exolab.castor.xml.ValidationException {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    }

}


text:
from controllers.reports.reports import Reports

Reports.send_report()


text:
package jetbrains.exodus.entitystore.iterate;

import jetbrains.exodus.entitystore.EntityId;
import jetbrains.exodus.entitystore.EntityIterableType;
import jetbrains.exodus.entitystore.PersistentEntityStore;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * Constant entity iterable handle corresponds to iterables not affected by transaction changes.
 */
@SuppressWarnings({"RawUseOfParameterizedType"})
public abstract class ConstantEntityIterableHandle extends EntityIterableHandleBase {

    protected ConstantEntityIterableHandle(@Nullable final PersistentEntityStore store,
                                           @NotNull final EntityIterableType type) {
        super(store, type);
    }

    // constant entity iterable handle never matches any changes
    @Override
    public boolean isMatchedEntityAdded(@NotNull final EntityId added) {
        return false;
    }

    @Override
    public boolean isMatchedEntityDeleted(@NotNull final EntityId deleted) {
        return false;
    }

    @Override
    public boolean isMatchedLinkAdded(@NotNull final EntityId source, final @NotNull EntityId target, final int linkId) {
        return false;
    }

    @Override
    public boolean isMatchedLinkDeleted(@NotNull final EntityId source, @NotNull final EntityId target, final int linkId) {
        return false;
    }

    @Override
    public boolean isMatchedPropertyChanged(@NotNull final EntityId id,
                                            final int propertyId,
                                            @Nullable final Comparable oldValue,
                                            @Nullable final Comparable newValue) {
        return false;
    }
}


text:
#pragma once

#include <Urho3D/Physics/CollisionShape.h>
#include <Urho3D/Physics/Constraint.h>

using namespace Urho3D;

/// Custom component that creates a ragdoll upon collision.
class CreateRagdoll : public Component
{
    URHO3D_OBJECT(CreateRagdoll, Component);

public:
    /// Construct.
    explicit CreateRagdoll(Context* context);

protected:
    /// Handle node being assigned.
    void OnNodeSet(Node* node) override;

private:
    /// Handle scene node's physics collision.
    void HandleNodeCollision(StringHash eventType, VariantMap& eventData);
    /// Make a bone physical by adding RigidBody and CollisionShape components.
    void CreateRagdollBone(const String& boneName, ShapeType type, const Vector3& size, const Vector3& position, const Quaternion& rotation);
    /// Join two bones with a Constraint component.
    void CreateRagdollConstraint(const String& boneName, const String& parentName, ConstraintType type, const Vector3& axis, const Vector3& parentAxis, const Vector2& highLimit, const Vector2& lowLimit, bool disableCollision = true);
};


text:
from __future__ import absolute_import

def get_package_data():
    return {'ginga.opencl': ['trcalc.cl']}


text:
package com.badlogic.gdx.math;

import java.io.Serializable;

/** A convenient 2D circle class.
 * @author mzechner */
public class Circle implements Serializable {
	public float x, y;
	public float radius;

	/** Constructs a new circle with all values set to zero */
	public Circle () {

	}

	public Circle (float x, float y, float radius) {
		this.x = x;
		this.y = y;
		this.radius = radius;
	}

	public Circle (Vector2 position, float radius) {
		this.x = position.x;
		this.y = position.y;
		this.radius = radius;
	}

	public void set (float x, float y, float radius) {
		this.x = x;
		this.y = y;
		this.radius = radius;
	}

	public void set (Circle circle) {
		x = circle.x;
		y = circle.y;
		radius = circle.radius;
	}

	/** Sets the x and y-coordinates of circle center from vector
	 * @param position The position vector */
	public void setPosition (Vector2 position) {
		this.x = position.x;
		this.y = position.y;
	}

	/** Sets the x and y-coordinates of circle center
	 * @param x The x-coordinate
	 * @param y The y-coordinate */
	public void setPosition (float x, float y) {
		this.x = x;
		this.y = y;
	}

	/** Sets the x-coordinate of circle center
	 * @param x The x-coordinate */
	public void setX (float x) {
		this.x = x;
	}

	/** Sets the y-coordinate of circle center
	 * @param y The y-coordinate */
	public void setY (float y) {
		this.y = y;
	}

	/** Sets the radius of circle
	 * @param radius The radius */
	public void setRadius (float radius) {
		this.radius = radius;
	}

	public boolean contains (float x, float y) {
		x = this.x - x;
		y = this.y - y;
		return x * x + y * y <= radius * radius;
	}

	public boolean contains (Vector2 point) {
		float dx = x - point.x;
		float dy = y - point.y;
		return dx * dx + dy * dy <= radius * radius;
	}

	/** @param c the other {@link Circle}
	 * @return whether this circle contains the other circle. */
	public boolean contains (Circle c) {
		float dx = x - c.x;
		float dy = y - c.y;
		// The distance to the furthest point on circle c is the distance
		// between the center of the two circles plus the radius.
		// We use the squared distance so we can avoid a sqrt.
		float maxDistanceSqrd = dx * dx + dy * dy + c.radius * c.radius;
		return maxDistanceSqrd <= radius * radius;
	}

	/** @param c the other {@link Circle}
	 * @return whether this circle overlaps the other circle. */
	public boolean overlaps (Circle c) {
		float dx = x - c.x;
		float dy = y - c.y;
		float distance = dx * dx + dy * dy;
		float radiusSum = radius + c.radius;
		return distance < radiusSum * radiusSum;
	}

	public String toString () {
		return x + "," + y + "," + radius;
	}
}


text:
    #include "../Core/WinAPI/IncludeWindows.h"
    #include "../Foreign/StackWalker/StackWalker.h"
#endif

    // We can't use the default initialisation method for easylogging++
    // because is causes a "LoaderLock" exception when used with C++/CLI dlls.
    // It also doesn't work well when sharing a single log file across dlls.
    // Anyway, the default behaviour isn't great for our needs.
    // So, we need to use "INITIALIZE_NULL" here, and manually construct
    // a "GlobalStorage" object below...
INITIALIZE_NULL_EASYLOGGINGPP

#if defined(_DEBUG)
    #define REDIRECT_COUT
#endif

#pragma warning(disable:4592)

//////////////////////////////////

static auto Fn_GetStorage = ConstHash64<'getl', 'ogst', 'orag', 'e'>::Value;
static auto Fn_CoutRedirectModule = ConstHash64<'cout', 'redi', 'rect'>::Value;
static auto Fn_LogMainModule = ConstHash64<'logm', 'ainm', 'odul', 'e'>::Value;
static auto Fn_GuidGen = ConstHash64<'guid', 'gen'>::Value;
static auto Fn_RedirectCout = ConstHash64<'redi', 'rect', 'cout'>::Value;

namespace ConsoleRig
{
    #if defined(REDIRECT_COUT)
        template <typename CharType>
            class StdCToXLEStreamAdapter : public std::basic_streambuf<CharType>
        {
        public:
            void Reset(std::shared_ptr<Utility::OutputStream> chain) { _chain = chain; }
            StdCToXLEStreamAdapter(std::shared_ptr<Utility::OutputStream> chain);
            ~StdCToXLEStreamAdapter();
        protected:
            std::shared_ptr<Utility::OutputStream> _chain;

            virtual std::streamsize xsputn(const CharType* s, std::streamsize count);
            virtual int sync();
        };

        template <typename CharType>
            StdCToXLEStreamAdapter<CharType>::StdCToXLEStreamAdapter(std::shared_ptr<Utility::OutputStream> chain) : _chain(chain) {}
        template <typename CharType>
            StdCToXLEStreamAdapter<CharType>::~StdCToXLEStreamAdapter() {}

        template <typename CharType>
            std::streamsize StdCToXLEStreamAdapter<CharType>::xsputn(const CharType* s, std::streamsize count)
        {
            assert(_chain);
            _chain->Write(s, int(sizeof(CharType) * count));
            return count;
        }

        template <typename CharType>
            int StdCToXLEStreamAdapter<CharType>::sync()
        {
            _chain->Flush();
            return 0;
        }

        std::shared_ptr<Utility::OutputStream>      GetSharedDebuggerWarningStream();

        static StdCToXLEStreamAdapter<char> s_coutAdapter(nullptr);
        static std::basic_streambuf<char>* s_oldCoutStreamBuf = nullptr;
    #endif

    static void SendExceptionToLogger(const ::Exceptions::BasicLabel&);

    void Logging_Startup(const char configFile[], const char logFileName[])
    {
        auto currentModule = GetCurrentModuleId();
        auto& serv = GlobalServices::GetCrossModule()._services;

            // It can be handy to redirect std::cout to the debugger output
            // window in Visual Studio (etc)
            // We can do this with an adapter to connect out DebufferWarningStream
            // object to a c++ std::stream_buf
        #if defined(REDIRECT_COUT)

            bool doRedirect = serv.Call<bool>(Fn_RedirectCout);
            if (doRedirect && !serv.Has<ModuleId()>(Fn_CoutRedirectModule)) {
                s_coutAdapter.Reset(GetSharedDebuggerWarningStream());
                s_oldCoutStreamBuf = std::cout.rdbuf();
                std::cout.rdbuf(&s_coutAdapter);

                serv.Add(Fn_CoutRedirectModule, [=](){ return currentModule; });
            }

        #endif

        using StoragePtr = decltype(el::Helpers::storage());

            //
            //  Check to see if there is an existing logging object in the
            //  global services. If there is, it will have been created by
            //  another module.
            //  If it's there, we can just re-use it. Otherwise we need to
            //  create a new one and set it up...
            //
        if (!serv.Has<StoragePtr()>(Fn_GetStorage)) {

            el::Helpers::setStorage(
                std::make_shared<el::base::Storage>(
                    el::LogBuilderPtr(new el::base::DefaultLogBuilder())));

            if (!logFileName) { logFileName = "int/log.txt"; }
            el::Configurations c;
            c.setToDefault();
            c.setGlobally(el::ConfigurationType::Filename, logFileName);

                // if a configuration file exists,
            if (configFile) {
                size_t configFileLength = 0;
                auto configFileData = LoadFileAsMemoryBlock(configFile, &configFileLength);
                if (configFileData && configFileLength) {
                    c.parseFromText(std::string(configFileData.get(), &configFileData[configFileLength]));
                }
            }

            el::Loggers::reconfigureAllLoggers(c);

            serv.Add(Fn_GetStorage, el::Helpers::storage);
            serv.Add(Fn_LogMainModule, [=](){ return currentModule; });

            auto& onThrow = GlobalOnThrowCallback();
            if (!onThrow)
                onThrow = &SendExceptionToLogger;

        } else {

            auto storage = serv.Call<StoragePtr>(Fn_GetStorage);
            el::Helpers::setStorage(storage);

        }
    }

    void Logging_Shutdown()
    {
        auto& serv = GlobalServices::GetCrossModule()._services;
        auto currentModule = GetCurrentModuleId();

        el::Loggers::flushAll();
        el::Helpers::setStorage(nullptr);

            // this will throw an exception if no module has successfully initialised
            // logging
        if (serv.Call<ModuleId>(Fn_LogMainModule) == currentModule) {
            serv.Remove(Fn_GetStorage);
            serv.Remove(Fn_LogMainModule);
        }

        #if defined(REDIRECT_COUT)
            ModuleId testModule = 0;
            if (serv.TryCall<ModuleId>(testModule, Fn_CoutRedirectModule) && (testModule == currentModule)) {
                if (s_oldCoutStreamBuf)
                    std::cout.rdbuf(s_oldCoutStreamBuf);
                serv.Remove(Fn_CoutRedirectModule);
            }
        #endif
    }

    #if PLATFORMOS_TARGET == PLATFORMOS_WINDOWS
        class StackWalkerToLog : public StackWalker
        {
        protected:
            virtual void OnOutput(LPCSTR) {}

            void OnCallstackEntry(CallstackEntryType eType, int frameNumber, CallstackEntry &entry)
            {
                    // We should normally have 3 entries on the callstack ahead of what we want:
                    //  StackWalker::ShowCallstack
                    //  ConsoleRig::SendExceptionToLogger
                    //  Utility::Throw
                if ((frameNumber >= 3) && (eType != lastEntry) && (entry.offset != 0)) {
                    if (entry.lineFileName[0] == 0) {
                        LogAlwaysError
                            << std::hex << entry.offset << std::dec
                            << " (" << entry.moduleName << "): "
                            << entry.name;
                    } else {
                        LogAlwaysError
                            << entry.lineFileName << " (" << entry.lineNumber << "): "
                            << ((entry.undFullName[0] != 0) ? entry.undFullName : ((entry.undName[0] != 0) ? entry.undName : entry.name))
                            ;
                    }
                }
            }
        };
    #endif

    static void SendExceptionToLogger(const ::Exceptions::BasicLabel& e)
    {
        TRY
        {
            if (!e.CustomReport()) {
                #if FEATURE_RTTI
                    LogAlwaysError << "Throwing Exception -- " << typeid(e).name() << ". Extra information follows:";
                #else
                    LogAlwaysError << "Throwing Exception. Extra information follows:";
                #endif
                LogAlwaysError << e.what();

                    // report this exception to the logger (including callstack information)
                #if PLATFORMOS_TARGET == PLATFORMOS_WINDOWS
                    static StackWalkerToLog walker;
                    walker.ShowCallstack(7);
                #endif
            }
        } CATCH (...) {
            // Encountering another exception at this point would be trouble.
            // We have to suppress any exception that happen during reporting,
            // and allow the exception, 'e' to be handled
        } CATCH_END
    }

    namespace Internal
    {
        static LogLevel AsLogLevel(el::Level level)
        {
            switch (level) {
            case el::Level::Fatal: return LogLevel::Fatal;

            default:
            case el::Level::Global:
            case el::Level::Debug:
            case el::Level::Trace:
            case el::Level::Error: return LogLevel::Error;
            case el::Level::Warning: return LogLevel::Warning;
            case el::Level::Verbose: return LogLevel::Verbose;
            case el::Level::Info: return LogLevel::Info;
            }
        }

        class LogHelper : public el::LogDispatchCallback
        {
        public:
            void SetUpstream(std::shared_ptr<LogCallback> upstream);
            LogHelper();
            ~LogHelper();
        private:
            virtual void handle(const el::LogDispatchData* handlePtr);
            std::weak_ptr<LogCallback> _upstream;
        };

        void LogHelper::handle(const el::LogDispatchData* handlePtr)
        {
            auto l = _upstream.lock();
            if (l) {
                LogLevel level = AsLogLevel(handlePtr->logMessage()->level());
                l->OnDispatch(level, handlePtr->logMessage()->message());
            }
        }
        void LogHelper::SetUpstream(std::shared_ptr<LogCallback> upstream)
        {
            _upstream = upstream;
        }
        LogHelper::LogHelper() {}
        LogHelper::~LogHelper() {}
    }

    void LogCallback::Enable()
    {
        auto storage = el::Helpers::storage();
        if (storage) {
            std::string guid = StringMeld<64>() << _guid;
            auto* helper = storage->logDispatchCallback<Internal::LogHelper>(guid);
            if (!helper) {
                storage->installLogDispatchCallback<Internal::LogHelper>(guid);
                helper = storage->logDispatchCallback<Internal::LogHelper>(guid);
                assert(helper);
                helper->SetUpstream(shared_from_this());
            }
        }
    }

    void LogCallback::Disable()
    {
        auto storage = el::Helpers::storage();
        if (storage) {
            storage->uninstallLogDispatchCallback<Internal::LogHelper>(
                std::string(StringMeld<64>() << _guid));
        }
    }

    LogCallback::LogCallback()
    {
        auto& serv = GlobalServices::GetCrossModule()._services;
        _guid = serv.Call<uint64>(Fn_GuidGen);
    }

    LogCallback::~LogCallback()
    {
        Disable();
    }
}

namespace LogUtilMethods
{

        //  note that we can't pass a printf style string to easylogging++ easily.
        //  but we do have some utility functions (like PrintFormatV) that can
        //  handle long printf's.
    static const unsigned LogStringMaxLength = 2048;

    void LogVerboseF(unsigned level, const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogVerbose(level) << buffer;
    }

    void LogInfoF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogInfo << buffer;
    }

    void LogWarningF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogWarning << buffer;
    }

    void LogAlwaysVerboseF(unsigned level, const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogAlwaysVerbose(level) << buffer;
    }

    void LogAlwaysInfoF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogAlwaysInfo << buffer;
    }

    void LogAlwaysWarningF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogAlwaysWarning << buffer;
    }

    void LogAlwaysErrorF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogAlwaysError << buffer;
    }

    void LogAlwaysFatalF(const char format[], ...)
    {
        char buffer[LogStringMaxLength];
        va_list args;
        va_start(args, format);
        _vsnprintf_s(buffer, _TRUNCATE, format, args);
        va_end(args);

        LogAlwaysFatal << buffer;
    }
}

#include "../Core/WinAPI/IncludeWindows.h"

namespace el { namespace base { namespace utils
{
#define _ELPP_OS_WINDOWS 1
#define ELPP_COMPILER_MSVC 1

#if _ELPP_OS_WINDOWS
    void DateTime::gettimeofday(struct timeval *tv) {
        if (tv != nullptr) {
#   if ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS)
            const unsigned __int64 delta_ = 11644473600000000Ui64;
#   else
            const unsigned __int64 delta_ = 11644473600000000ULL;
#   endif  // ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS)
            const double secOffSet = 0.000001;
            const unsigned long usecOffSet = 1000000;
            FILETIME fileTime;
            GetSystemTimeAsFileTime(&fileTime);
            unsigned __int64 present = 0;
            present |= fileTime.dwHighDateTime;
            present = present << 32;
            present |= fileTime.dwLowDateTime;
            present /= 10;  // mic-sec
           // Subtract the difference
            present -= delta_;
            tv->tv_sec = static_cast<long>(present * secOffSet);
            tv->tv_usec = static_cast<long>(present % usecOffSet);
        }
    }
#endif // _ELPP_OS_WINDOWS
}}}


text:
'use strict';

const express     = require('express');
const config      = require(`${__dirname}/../config`);
const Url         = require(`${__dirname}/../models/url`);
const handleError = require(`${__dirname}/../lib/handle-error`);
const utilities   = require(`${__dirname}/../lib/utilities`);
const urlRouter   = module.exports = express.Router();
const locale      = config.webhost;

urlRouter.post('/encode', (req, res) => {
  let url   = req.body.url;
  let short = '';

  Url.findOne({
    url : url
  }, (err, doc) => {
    if (doc) {
      short = config.webhost + utilities.encode(doc._id);
      res.send({'url' : short});
    } else {
      let newUrl = Url({
        url : url
      });

      newUrl.save((err) => {
        if (err) return handleError(err, res);

        short = `${config.webhost}${utilities.encode(newUrl._id)}`;
        res.send({'url': short});
      });
    }
  });
});

urlRouter.get('/:encoded_id', (req, res) => {
  let encodedId = req.params.encoded_id;
  let id        = utilities.decode(encodedId);

  Url.findOne({_id: id}, (err, doc) => {
    if (doc) {
      res.redirect(doc.url);
    } else {
      res.redirect(config.webhost);
    };
  })
});

urlRouter.post('/decode', (req, res) => {
  let encodedId = req.body.url.replace(locale, '');
  let id        = utilities.decode(encodedId);

  Url.findOne({
    _id: id
  }, (err, doc) => {
    if (doc) {
      res.json({
        success  : true,
        url : doc.url
      });
    } else {
      res.json({
        success : false,
        msg     : 'That path does not exist in the database.'
      })
    };
  })
});


text:
'use strict';

// Customers controller
angular.module('customers').controller('CustomersController', ['$scope', '$stateParams', '$location', 'Authentication', 'Customers', '$modal', '$log',
    function($scope, $stateParams, $location, Authentication, Customers, $modal, $log) {
        $scope.authentication = Authentication;

        // Create new Customer
        $scope.create = function() {
            // Create new Customer object
            var customer = new Customers({
                firstName: this.firstName,
                lastName: this.lastName,
                suburb: this.suburb,
                industry: this.industry,
                email: this.email,
                phone: this.phone,
                referred: this.referred,
                channel: this.channel,
                updated: Date.now
            });

            // Redirect after save
            customer.$save(function(response) {
                $location.path('customers/' + response._id);

                // Clear form fields
                $scope.firstName = '';
                $scope.lastName = '';
                $scope.suburb = '';
                $scope.industry = '';
                $scope.email = '';
                $scope.phone = '';
                $scope.referred = '';
                $scope.channel = '';
                $scope.updated = '';

            }, function(errorResponse) {
                $scope.error = errorResponse.data.message;
            });
        };

        // Remove existing Customer
        $scope.remove = function(customer) {
            if (customer) {
                customer.$remove();

                for (var i in $scope.customers) {
                    if ($scope.customers [i] === customer) {
                        $scope.customers.splice(i, 1);
                    }
                }
            } else {
                $scope.customer.$remove(function() {
                    $location.path('customers');
                });
            }
        };

        // Update existing Customer
        $scope.update = function() {
            var customer = $scope.customer;

            customer.$update(function() {
                $location.path('customers/' + customer._id);
            }, function(errorResponse) {
                $scope.error = errorResponse.data.message;
            });
        };

        // Find a list of Customers
        $scope.find = function() {
            $scope.customers = Customers.query();
        };

        // Find existing Customer
        $scope.findOne = function() {
            $scope.customer = Customers.get({
                customerId: $stateParams.customerId
            });
        };
    }
]);


text:
(function() {

  function SystemManager() {
    this.systems = [];
  }

  SystemManager.prototype.add = function(system) {
    this.remove(system);
    this.systems.push(system);
    system.initialize();
  };

  SystemManager.prototype.remove = function(system) {
    var i = this.systems.indexOf(system);
    if (i >= 0) {
      this.systems[i].destroy();
      this.systems.splice(i, 1);
    }
  };

  this.SystemManager = SystemManager;

})();


text:
class SystemNoteMetadata < ApplicationRecord
  # These notes's action text might contain a reference that is external.
  # We should always force a deep validation upon references that are found
  # in this note type.
  # Other notes can always be safely shown as all its references are
  # in the same project (i.e. with the same permissions)
  TYPES_WITH_CROSS_REFERENCES = %w[
    commit cross_reference
    close duplicate
    moved merge
    label milestone
  ].freeze

  ICON_TYPES = %w[
    commit description merge confidential visible label assignee cross_reference
    title time_tracking branch milestone discussion task moved
    opened closed merged duplicate locked unlocked
    outdated tag due_date pinned_embed
  ].freeze

  validates :note, presence: true
  validates :action, inclusion: { in: :icon_types }, allow_nil: true

  belongs_to :note
  belongs_to :description_version

  def icon_types
    ICON_TYPES
  end

  def cross_reference_types
    TYPES_WITH_CROSS_REFERENCES
  end
end

SystemNoteMetadata.prepend_if_ee('EE::SystemNoteMetadata')