text:
/* 65C02 symbolic (dis)assembler with monitor commands for minimOS
 * last modified 20151120-1002
 * (c) 2015-2022 Carlos J. Santisteban
 * */

#include <stdio.h>

/* Function prototypes */
void getNextChar(void);		// get next valid character in input
void getListChar(void);		// get next valid character in opcode list
void hex2nibble(void);		// convert one hex cipher into nibble (should be repeated)
void hex2byte(void);		// convert a pair of hex ciphers into byte (calls hex2nibble)
void checkEnd(void);		// check whether there's no more in the input line
void fetchWord(void);		// advance to the next two bytes, convert into tmp[0...1]
void disassemble(void);		// disassemble for one opcode

/* Global variables */
	unsigned char rom[1500];
	unsigned char ram[65536];

	FILE* arch;

	unsigned char b, i, j, c, x, value;
	unsigned char lines = 4;					// number of lines #u to display
	unsigned char areg, xreg, yreg, psr, sp;	// 6502 registers
	char buf[80];								// input buffer
	int ptr=0, dir, count, tmp[3], scan, oldscan, cursor;
	int siz;	// temporarily for opcode list loading, later #n

//char undef=0, undfr=0, empty=0;	// *** uncomment if no symbolic assembler is used ***

/* ***for symbolic assembler only*** */
	unsigned char sym[256];		// symbol table: up to 6 chars, 2 of pointer
								// if bit7 of byte0, non-defined label, byte 6 points (+1) to linked list of previous references
								// byte 7 points (+1) to linked list of previous RELATIVE references
								// byte0.bit7 and any of bytes6-7 at 0 means no such kind of reference used
	unsigned char ref[256];		// linked list of undefined references
								// [n]=link to next+1, the pointer itself (or 0), [n+1,n+2] = address of reference
	unsigned char rrf[256];		// linked list of undefined RELATIVE references
								// [n]=link to next (or 0), [n+1,n+2] = address of reference
	unsigned char empty = 0;	// first empty entry in symbol table
	unsigned char lref  = 0;	// last undefined reference offset
	unsigned char lrrf  = 0;	// last undefined RELATIVE reference offset
	unsigned char undef = 0;	// undefined references
	unsigned char undfr = 0;	// undefined RELATIVE references

/* Main programme */
int main(void) {

/* ***initialize symbol table, if available*** */
	for(scan=0;scan<256;scan+=8) {	// one entry each 8 bytes
		sym[scan]=0;				// terminate string
		sym[scan+6]=0;				// reset link and pointer
		sym[scan+7]=0;
	}
	for (scan=0;scan<256;scan++) {	// clear whole reference list
		ref[scan]=0;
		rrf[scan]=0;
	}

/* ***fake symbols for testing*** */
sym[0]='a'+128;	//undefined test entry
sym[1]='x';
sym[2]=0;

sym[7]=1;		//first (and only) RELATIVE reference

rrf[1]=0x05;	//referenced at $0405 (relative)
rrf[2]=0x04;
lrrf=3;			//offset for future next relative undefined reference
undfr=1;		//one relative undefined reference, if goes down to zero should reset lrrf!
				//ditto with undef resetting lref!

sym[8]='l';		//test entry
sym[9]='o';
sym[10]='o';
sym[11]='p';
sym[12]=0;
sym[14]=0x34;
sym[15]=0x12;
empty=16;		// two entries
/* end of testing block */

// load files
	arch=fopen("65C02.bin","rb");	// opcode list
	if (arch==NULL) {				// not found?
		printf("\n***Problem opening Opcode List '65C02.bin'!***\n");
		return -1;					// ABORT
	}
	fseek(arch,0,SEEK_END);			// go to end
	siz=ftell(arch);				// get length
	fseek(arch,0,SEEK_SET);			// back to start
	fread(rom,siz,1,arch);			// read all

// start up things
	printf("minimOS 0.5 Symbolic 65C02 Assembler/Monitor\n");
	printf("(c)2015 Carlos J. Santisteban\n");
	ptr = 0x400;					// set initial address
	do {							// main loop
		printf("%04x: ", ptr);		// prompt
		gets(buf);					// read input buffer
		scan=0;			// reset indexes
		oldscan=0;
		cursor=0;
		tmp[2] = 0;		// reset opcode to be detected
		getNextChar();	// get first valid character in input
// check for pseudo-opcodes
		if (b=='.') {			// pseudo-opcode
			cursor++;			// skip dot
			getNextChar();		// get the command itself
			cursor++;			// ready to get operand
			switch(b) {		// identify command
				case 'A':		// set accumulator as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					areg = value;	// store byte
					break;
				case 'B':		// store byte $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					ram[ptr++] = value;		// store byte
					break;
				case 'C':		// call $aaaa*
					if (undef|undfr) {		// some pending definition
						printf("***UNDEFINED LABELS***\n");
					} else {
						fetchWord();			// get next two bytes in tmp[]
						dir = tmp[1] + 256*tmp[0];	// compute address
						printf("[JSR $%04x]\n", dir);
					}
					break;
				case 'D':		// disassemble #u lines from $aaaa
					fetchWord();			// get next two bytes in tmp[]
					dir = tmp[1] + 256*tmp[0];	// compute base address
					for (i=0; i<lines; i++) {	// will show #u lines
						disassemble();			// decode one opcode
					}
					break;
				case 'E':		// dump #u lines from $aaaa
					fetchWord();			// get next two bytes in tmp[]
					dir = tmp[1] + 256*tmp[0];	// compute base address
					for (i=0; i<lines; i++) {	// will show #u lines
						printf("%04x [ ", dir);	// start address
						for (j=0; j<8; j++) {	// eight bytes per line
							printf("%02x ", ram[dir++]);	// show one byte
						}
						printf("] ");			// end hex dump, now in ascii
						for (j=8;j>0;j--) {		// rescan downwards
							c = ram[dir-j];		// gey byte again
							if (c<' ') {		// non-printable
								printf("·");	// interpunct as substitute
							} else {
								printf("%c", c);	// place ascii
							}
						}
						printf("\n");			// new line
					}
					break;
				case 'F':		// force cold boot
					printf("\n---[forced cold boot]---\n");
					return 0;	// go away!
					break;
				case 'G':		// set SP as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					sp = value;	// store byte
					break;
				case 'H':		// show command list
					printf("\nCommand list:\n");
					// ...
					break;
				case 'I':		// show symbol table
/* ***only if symbolic assembler*** */
					printf("Symbol table:\n");
					i = 0;
					while(sym[i] && i!=1) {			// review all entries
						while(sym[i] && (i&7)<6) {	// read whole name
							c = sym[i] & 127;		// filter character
							if (!(i&7))	{			// first character
								x = sym[i] & 128;	// detect undefined
							}
							printf("%c", c);		// put filtered character
							i++;					// next character
						}
						while((i&7)<6) {			// fill remaining space
							printf(" ");
							i++;
						}
						i &= 0xF8;					// filter lower bits
						i |= 6;						// go to offset 6
						if (x) {					// undefined
							printf(" = ?\n");
						} else {					// show value
							printf(" = $%02x%02x\n", sym[i+1], sym[i]);	// little endian
						}
						i += 2;						// next entry
						if (!i) {					// wrapped to zero?
							i = 1;					// special exit value
						}
					}
/* end of symbol table display */
					printf("------\n");
					break;
				case 'J':		// jump to $aaaa*
					if (undef|undfr) {		// some pending definition
						printf("***UNDEFINED LABELS***\n");
					} else {
						fetchWord();			// get next two bytes in tmp[]
						dir = tmp[1] + 256*tmp[0];	// compute address
						printf("[JMP $%04x]\n", dir);
					}
					break;
				case 'K':		// set external device as $dd

					break;
				case 'L':		// load #n bytes at $aaaa
					fetchWord();			// get next two bytes in tmp[]
					dir = tmp[1] + 256*tmp[0];			// compute destination address
					oldscan = dir;
					for (count=0; count<siz; count++) {	// load #n bytes
						// load byte @dir++...
					}
					printf("---$%04x bytes loaded at $%04x---\n", siz, oldscan);	// show results
					break;
				case 'M':		// copy #n bytes from current to $aaaa
					fetchWord();			// get next two bytes in tmp[]
					dir = tmp[1] + 256*tmp[0];			// compute destination address
					oldscan = dir;						// save initial value
					scan = ptr;							// copy source address
					for (count=0; count<siz; count++) {	// copy #n bytes
						ram[dir++] = ram[scan++];		// copy from current to destination
					}
					printf("---$%04x bytes copied at $%04x---\n", siz, oldscan);	// show results
					break;
				case 'N':		// set #n as $dddd
					fetchWord();			// get next two bytes in tmp[]
					siz = tmp[1] + 256*tmp[0];	// compute number of bytes #n
					break;
				case 'O':		// set current address as $aaaa
					fetchWord();			// get next two bytes in tmp[]
					ptr = tmp[1] + 256*tmp[0];	// compute new address
					break;
				case 'P':		// set PSR as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					psr = value;	// store byte
					break;
				case 'Q':		// quit or poweroff*
					if (undef|undfr) {		// some pending definition
						printf("***UNDEFINED LABELS***\n");
					} else {
						return 0;	// go away!
					}
					break;
				case 'R':		// reboot*
					if (undef|undfr) {		// some pending definition
						printf("***UNDEFINED LABELS***\n");
					} else {
						printf("\n---[system reboot]---\n");
						ptr = 0x400;	// apparent reset
						continue;
					}
					break;
				case 'S':		// store immediate raw string until EOL
					while(c=buf[cursor++]) {	// get raw char until terminator
						ram[ptr++]=c;			// store in place
					}
					break;
				case 'T':		// save #n bytes from $aaaa
					fetchWord();			// get next two bytes in tmp[]
					dir = tmp[1] + 256*tmp[0];			// compute source address
					oldscan = dir;						// save for later
					for (count=0; count<siz; count++) {	// save #n bytes
						// save byte @dir++...
					}
					printf("---$%04x bytes saved from $%04x---\n", siz, oldscan);	// show results
					break;
					break;
				case 'U':		// set #u as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					lines = value;	// will show #u lines
					break;
				case 'V':		// view registers
					printf("\nPC:  A: X: Y: S: NV·bDIZC\n");
					printf("%04x %02x %02x %02x %02x 11·11111\n", ptr, areg, xreg, yreg, sp);
					// ...
					break;
				case 'W':		// store word $dddd
					fetchWord();			// get next two bytes in tmp[]
					ram[ptr++] = tmp[1];	// store LSB
					ram[ptr++] = tmp[0];	// store MSB
					break;
				case 'X':		// set X as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					xreg = value;	// store byte
					break;
				case 'Y':		// set Y as $dd
					getNextChar();	// advance to operand
					hex2byte();		// convert to number
					yreg = value;	// store byte
					break;
				case 'Z':		// poweroff or suspend
					printf("\n---suspend---\n\n");
					break;
				default:
					printf("***Bad command***\n");
			}
			continue;			// command ended, ask for another
		} //else printf("***Missing module***\n");	// *** REMOVE else with assembler
/* *** for symbolic assembler only *** */
		if (b=='_') {			// a label is being defined
//			printf("[label definition]\n");	//***placeholder
			cursor++;			// get to first character
			getNextChar();		// load it
			oldscan = cursor;	// remember position in order to return
			scan = 0;			// initial entry
			while(scan<empty) {		// read all existing entries
				while(b|32 == sym[scan]) {	// match
					scan++;					// next char
					if (scan&7<6) {			// not yet 6 chars
						cursor++;
						getNextChar();		// read next
					} else break;
				}
			}
				//************************************???????????????

			continue;			// get another input
		}
/* end of symbol definition */
/* ***disable if no assembler module is used*** */
		do {		// start processing line
// get next valid character in opcode list
			getListChar();
// check out what to look for
			switch(c) {
// keep C-comment here to disable operand read
				case '@':		// get one byte
					hex2byte();				// get whole number
					tmp[1] = value;			// store converted value
					scan++;
					checkEnd();				// check whether there's no more in the input line
					break;
				case '&':		// get two bytes
					for(i=0;i<2;i++) {		// do couple of bytes
						hex2byte();			// get whole byte
						tmp[i] = value;		// store converted value
					}
					scan++;
					checkEnd();				// check whether there's no more in the input line
					break;
// this C-comment will resume operation if operand fetch is disabled
				default:		// normal check
					if (b!=c) {				// difference found
// wrong, try next opcode
						while (rom[scan++]<128);	// seek terminator in opcode list
						oldscan=scan;	// point to start
						tmp[2]++;		// try next opcode
						if (tmp[2]>255) {	// checked all of them
							x = 1;			// special exit, no more opcodes
						} else {
							cursor = 0;		// reset index
							x = 0;			// don't exit yet!
						}
					} else {
// right, continue checking line
						cursor++;		// advance to next character
						scan++;
						checkEnd();		// check whether there's no more in the input line
					}
			}
			getNextChar();				// get next valid character in input
		} while (!x);					// until match found or all opcodes compared
		if (x==128) {					// valid opcode found
				oldscan--;
				count = 1;					// bytes to be advanced for next opcode
				printf("[%02x] ", tmp[2]);	// prints opcode hex
				do {
					c = rom[++oldscan] & 127;	// get char from opcode list
					switch(c) {
						case '@':
							printf("$%02x", tmp[1]);
							count++;			// two-byte instruction
							break;
						case '&':
							printf("$%02x%02x", tmp[0], tmp[1]);
							count += 2;			// three-byte instruction
							break;
						default:
							printf("%c", c);	// print chars in opcode list
					}
				} while (rom[oldscan]<128);		// until terminator is found
		} else {
			count = 0;					// stay here
			printf("***ERROR***");		// invalid string
		}
// should "poke" tmp[2], tmp[1], tmp[0] at ptr...ptr+2
		for(i=0;i<count;i++) {
			ram[ptr+i] = tmp[2-i];		// poke values
		}
		printf("\n");
		ptr += count;					// advance address
/* *** end of assembler module *** */
	} while (-1);

	return 0;
}

/* Function definitions */
void getNextChar(void) {							// get next valid character in input
			while (buf[cursor]==' ' || buf[cursor]=='$')	cursor++;	// skip spaces AND RADIX in input
			b = buf[cursor];						// get char
			if (b>='a' && b<='z')		b &= 223;	// all uppercase
}

void getListChar(void) {							// get next valid character in opcode list
			while (rom[scan]==' ')		scan++;		// skip spaces in opcode list, last won't do anyway
			c = rom[scan] & 127;					// filtered from opcode list
			x = rom[scan] & 128;					// terminator
}

void hex2nibble(void) {		// convert one hex cipher into nibble (should be repeated)
						b -= '0';	// convert to number
						if (b>=0 && b<10) {			// already a valid number
							// nothing to do???
						} else {					// check whether alpha
							if (b>='A'-'0' && b<='F'-'0') {		// valid hex cipher
								b -= 'A'-'0'-10;				// add alpha cipher
							} else {
								//***ERROR, not valid cipher***
								b=255;		// exit value, will trigger break outside
								cursor--;	// try to reprocess this char
							}
						}
}

void hex2byte(void) {			// convert a pair of hex ciphers into byte (calls hex2nibble)
	int loop;

	value = 0;
	for (loop=0; loop<2; loop++) {			// two hex per byte
		hex2nibble();		// convert one hex cipher into nibble (should be repeated)
		if (b==255)
			break;			// 255 means there was no valid cipher
		// b is 0...15 unless wrong cipher
		value *= 16;		// older value was MSN
		value += b;			// add LSN
		cursor++;			// go for next hex
		getNextChar();
	}
}

void checkEnd(void) {			// check whether there's no more in the input line
					if (x==128) {			// opcode ended at list, but...
						while (buf[cursor]==' ' || buf[cursor]=='$')		cursor++;	// skip spaces in input
						if (buf[cursor]) {	// some chars remain in input, not this one
							oldscan=scan;	// point to start
							tmp[2]++;		// try next opcode
							cursor = 0;		// reset index
							x = 0;			// don't exit yet!
						}
					}
}

void fetchWord(void) {		// advance to the next two bytes, convert into tmp[0...1]
	getNextChar();			// advance to operand
	for(i=0;i<2;i++) {		// do couple of bytes
		hex2byte();			// get whole byte
		tmp[i] = value;		// store converted value
	}
}

void disassemble(void) {		// disassemble for one opcode
		tmp[2] = ram[dir];	// get opcode
		oldscan = dir;		// before increasing
		printf("%04x: ", dir);	// print initial address
		count = 0;			// skipped strings
		scan = 0;			// opcode list pointer
		while (tmp[2] != count && count<256) {
			while (rom[scan]<128)
				scan++;		// fetch next terminator
			scan++;			// go to next entry
			count++;		// another opcode skipped
		}
		siz = 1;			// bytes to be dumped
		do {
			x	= rom[scan] & 128;	// bit 7 will exit after processing
			c	= rom[scan] & 127;	// mask bit 7 out
			switch(c) {
				case '@':				// single byte operand
					printf("$%02x", ram[++dir]);				// print operand in hex
					siz = 2;			// 2-byte opcode
					break;
				case '&':				// word operand
					printf("$%04x", ram[++dir]+256*ram[++dir]);	// print address in hex
					siz = 3;			// 3-byte opcode
					break;
				default:				// generic character
					printf("%c", c);	// print it
			}							// end of switch
			scan++;						// next character!
		} while (!x);				// until terminator
		dir++;							// next opcode!
		printf("  [ ");					// tabulate!
		for (count=0; count<siz; count++) {
			printf("%02x ", ram[oldscan+count]);		// dump byte
		}
		printf("]\n");
}


text:
import {exactMatchOptions, subsetMatchOptions} from '../src/router';
import {containsTree, DefaultUrlSerializer} from '../src/url_tree';

describe('UrlTree', () => {
  const serializer = new DefaultUrlSerializer();

  describe('DefaultUrlSerializer', () => {
    let serializer: DefaultUrlSerializer;

    beforeEach(() => {
      serializer = new DefaultUrlSerializer();
    });

    it('should parse query parameters', () => {
      const tree = serializer.parse('/path/to?k=v&k/(a;b)=c');
      expect(tree.queryParams).toEqual({
        'k': 'v',
        'k/(a;b)': 'c',
      });
    });
  });

  describe('containsTree', () => {
    describe('exact = true', () => {
      it('should return true when two tree are the same', () => {
        const url = '/one/(one//left:three)(right:four)';
        const t1 = serializer.parse(url);
        const t2 = serializer.parse(url);
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(true);
        expect(containsTree(t2, t1, exactMatchOptions)).toBe(true);
      });

      it('should return true when queryParams are the same', () => {
        const t1 = serializer.parse('/one/two?test=1&page=5');
        const t2 = serializer.parse('/one/two?test=1&page=5');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(true);
      });

      it('should return true when queryParams are the same but with diffrent order', () => {
        const t1 = serializer.parse('/one/two?test=1&page=5');
        const t2 = serializer.parse('/one/two?page=5&test=1');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(true);
      });

      it('should return true when queryParams contains array params that are the same', () => {
        const t1 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=6');
        const t2 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=6');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(true);
      });

      it('should return false when queryParams contains array params but are not the same', () => {
        const t1 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=6');
        const t2 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=7');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return false when queryParams are not the same', () => {
        const t1 = serializer.parse('/one/two?test=1&page=5');
        const t2 = serializer.parse('/one/two?test=1');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(false);
      });

      it('should return false when queryParams are not the same', () => {
        const t1 = serializer.parse('/one/two?test=4&test=4&test=2');
        const t2 = serializer.parse('/one/two?test=4&test=3&test=2');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return true when queryParams are the same in different order', () => {
        const t1 = serializer.parse('/one/two?test=4&test=3&test=2');
        const t2 = serializer.parse('/one/two?test=2&test=3&test=4');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return true when queryParams are the same in different order', () => {
        const t1 = serializer.parse('/one/two?test=4&test=4&test=1');
        const t2 = serializer.parse('/one/two?test=1&test=4&test=4');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return false when containee is missing queryParams', () => {
        const t1 = serializer.parse('/one/two?page=5');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(false);
      });

      it('should return false when paths are not the same', () => {
        const t1 = serializer.parse('/one/two(right:three)');
        const t2 = serializer.parse('/one/two2(right:three)');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(false);
      });

      it('should return false when container has an extra child', () => {
        const t1 = serializer.parse('/one/two(right:three)');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(false);
      });

      it('should return false when containee has an extra child', () => {
        const t1 = serializer.parse('/one/two');
        const t2 = serializer.parse('/one/two(right:three)');
        expect(containsTree(t1, t2, exactMatchOptions)).toBe(false);
      });
    });

    describe('exact = false', () => {
      it('should return true when containee is missing a segment', () => {
        const t1 = serializer.parse('/one/(two//left:three)(right:four)');
        const t2 = serializer.parse('/one/(two//left:three)');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return true when containee is missing some paths', () => {
        const t1 = serializer.parse('/one/two/three');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return true container has its paths split into multiple segments', () => {
        const t1 = serializer.parse('/one/(two//left:three)');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return false when containee has extra segments', () => {
        const t1 = serializer.parse('/one/two');
        const t2 = serializer.parse('/one/(two//left:three)');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return false containee has segments that the container does not have', () => {
        const t1 = serializer.parse('/one/(two//left:three)');
        const t2 = serializer.parse('/one/(two//right:four)');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return false when containee has extra paths', () => {
        const t1 = serializer.parse('/one');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return true when queryParams are the same', () => {
        const t1 = serializer.parse('/one/two?test=1&page=5');
        const t2 = serializer.parse('/one/two?test=1&page=5');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return true when container contains containees queryParams', () => {
        const t1 = serializer.parse('/one/two?test=1&u=5');
        const t2 = serializer.parse('/one/two?u=5');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return true when containee does not have queryParams', () => {
        const t1 = serializer.parse('/one/two?page=5');
        const t2 = serializer.parse('/one/two');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return false when containee has but container does not have queryParams', () => {
        const t1 = serializer.parse('/one/two');
        const t2 = serializer.parse('/one/two?page=1');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return true when container has array params but containee does not have', () => {
        const t1 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=6');
        const t2 = serializer.parse('/one/two?test=a&test=b');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true);
      });

      it('should return false when containee has array params but container does not have', () => {
        const t1 = serializer.parse('/one/two?test=a&test=b');
        const t2 = serializer.parse('/one/two?test=a&test=b&pages=5&pages=6');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return false when containee has different queryParams', () => {
        const t1 = serializer.parse('/one/two?page=5');
        const t2 = serializer.parse('/one/two?test=1');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });

      it('should return false when containee has more queryParams than container', () => {
        const t1 = serializer.parse('/one/two?page=5');
        const t2 = serializer.parse('/one/two?page=5&test=1');
        expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false);
      });
    });

    describe('ignored query params', () => {
      it('should return true when queryParams differ but are ignored', () => {
        const t1 = serializer.parse('/?test=1&page=2');
        const t2 = serializer.parse('/?test=3&page=4&x=y');
        expect(containsTree(t1, t2, {...exactMatchOptions, queryParams: 'ignored'})).toBe(true);
      });
    });

    describe('fragment', () => {
      it('should return false when fragments differ but options require exact match', () => {
        const t1 = serializer.parse('/#fragment1');
        const t2 = serializer.parse('/#fragment2');
        expect(containsTree(t1, t2, {...exactMatchOptions, fragment: 'exact'})).toBe(false);
      });

      it('should return true when fragments differ but options ignore the fragment', () => {
        const t1 = serializer.parse('/#fragment1');
        const t2 = serializer.parse('/#fragment2');
        expect(containsTree(t1, t2, {...exactMatchOptions, fragment: 'ignored'})).toBe(true);
      });
    });

    describe('matrix params', () => {
      describe('ignored', () => {
        it('returns true when matrix params differ but are ignored', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;abc=123');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams: 'ignored'})).toBe(true);
        });
      });

      describe('exact match', () => {
        const matrixParams = 'exact';

        it('returns true when matrix params match', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;id=15;foo=foo');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams})).toBe(true);
        });

        it('returns false when matrix params differ', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;abc=123');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams})).toBe(false);
        });

        it('returns true when matrix params match on the subset of the matched url tree', () => {
          const t1 = serializer.parse('/a;id=15;foo=bar/c');
          const t2 = serializer.parse('/a;id=15;foo=bar');
          expect(containsTree(t1, t2, {...subsetMatchOptions, matrixParams})).toBe(true);
        });

        it('should return true when matrix params match on subset of urlTree match ' +
               'with container paths split into multiple segments',
           () => {
             const t1 = serializer.parse('/one;a=1/(two;b=2//left:three)');
             const t2 = serializer.parse('/one;a=1/two;b=2');
             expect(containsTree(t1, t2, {...subsetMatchOptions, matrixParams})).toBe(true);
           });
      });

      describe('subset match', () => {
        const matrixParams = 'subset';

        it('returns true when matrix params match', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;id=15;foo=foo');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams})).toBe(true);
        });

        it('returns true when container has extra matrix params', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;id=15');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams})).toBe(true);
        });

        it('returns false when matrix params differ', () => {
          const t1 = serializer.parse('/a;id=15;foo=foo');
          const t2 = serializer.parse('/a;abc=123');
          expect(containsTree(t1, t2, {...exactMatchOptions, matrixParams})).toBe(false);
        });

        it('returns true when matrix params match on the subset of the matched url tree', () => {
          const t1 = serializer.parse('/a;id=15;foo=bar/c');
          const t2 = serializer.parse('/a;id=15;foo=bar');
          expect(containsTree(t1, t2, {...subsetMatchOptions, matrixParams})).toBe(true);
        });

        it('should return true when matrix params match on subset of urlTree match ' +
               'with container paths split into multiple segments',
           () => {
             const t1 = serializer.parse('/one;a=1/(two;b=2//left:three)');
             const t2 = serializer.parse('/one;a=1/two');
             expect(containsTree(t1, t2, {...subsetMatchOptions, matrixParams})).toBe(true);
           });
      });
    });
  });
});

redpajama_set_name: RedPajamaGithub


text:
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 15 (filtered)">

Wednesday,
January 01, 2014

                Mae
still isn't feeling well.  I prepared breakfast of hot cakes and eggs for us.
After cleaning up the dishes I worked on my 2013 journal entries getting them
ready to print.  I bought a cord for the printer so that I could connect the
printer to my computer without having to move the computer to the printer, but
I think I will return it.  It costs $26.61 and I have a hard time spending that
much for it.  I bought a Sub-Way for our lunch.  I worked more on backing up
files and caring for Mae.  I am afraid that I lost some of Mae's picture and I
am not sure how.  I got dinner with Mae's help.  The day has sure gone by
fast.

Thursday,
January 02, 2014

                I
let Mae sleep in and I got myself off to work.  I woke shortly after 3AM and
couldn't go back to sleep.  My runs went well.  With my grade school children,
I asked two girls, Mattie and Hannah to be bus monitors for me.  We started
getting each child assigned to a seat, so that should help with bus discipline,
although I really don't have many problems with ether of my schools.  I took
almost an hour nap in-between my AM and PM runs.  I have worked on back-ups of
computer files and worked on my journals also today.  I watched a "Gun Smoke"
and "Bonanza" series while I made up some capsules.  I also finished up my Home
Teaching report before we went to bed.

Friday,
January 03, 2014

                Again
this morning Mae was under the weather.  My runs went well although I was quite
tired after the morning run.  When I got home I took care of the chickens and
then took a nap.  I got a call from the Dispatch office asking me to take a
mid-day run.  The only problem, they forgot to call me earlier, so when they
called me at 12:45 PM, I was supposed to have been at the school to pick-up the
children.  I was ½ hour late getting their and by that time most parents had
came and got their children.  We took the rest home and then I went back to the
compound and took my regular PM run.  After my run I came home.  I realized
that I had dropped my cell-phone somewhere.  I got Mae and we drove back to the
compound.  I found my phone by my bus.  We then drove out to Sandi and Nick's
so that we could visit with Shellie before she and Jase returns home tomorrow.
We had a good evening getting home about 11PM.  I didn't feel like going right
to bed so we watched a good movie on TV.

Saturday,
January 04, 2014

                 We
slept in until almost 11AM.  Mae is feeling a little better today.  I spent a
lot of time working on seating charts for my Elementary Bus Run.  I tried to
take care of Mae, although she feels some better I don't want her to get back
down.  This evening we watched a show on TV but we were disappointed in the
show.  I think that it was the first show staring Jimmy Stewart that I didn't
enjoy.  We have early meeting time this year, so that will be an adjustment.

Sunday,
January 05, 2014

                We
had to get up early this morning as we now have the early meeting schedule.  I
also have our High Priest Group Leadership meeting at 8AM, plus the High Priest
has the chairs to set up this week and next week.  Meetings went very well.  I
didn't think that Mae would be going as she still doesn't feel well, that's
really not true, because I know Mae and so it didn't surprise me, when I found
that she was there.  After meetings we both laid down in the recliners and
slept for a while.  When I got up I worked on my journals.  Mae did stay down a
little.  I cooked dinner for us, trying to keep Mae down as much as possible.
We had trout and hash brown yam.  They were very good.  I worked longer on my
journal getting another two pages typed.  We watched a show on DVD before going
to bed, that was sure good.

Monday,
January 06, 2014

                My
runs went well this morning.  I had some corrections to make on my bus seating
assignments but I think it is going to work quite well.  Mae still isn't
feeling well so I let her sleep in this morning.  Mae has tried to do some
things today but gets tired very fast.  When I came home from my PM runs, I
took care of the chickens.  Heather and her four children plus Jamie and her
son were upstairs visiting with Bob.  Bob knocked and asked us to come upstairs
to visit with them.  Mae and I went up for a little while then Mae came back
down to get our dinner.  I visited for a while and enjoyed being with them.  I
tried to explain Bob's condition with his hearing to Heather and she
understood.  It was good of them to come and visit their Grandfather.  Mae
cooked a very nice dinner, cooking cauliflower and making it taste like mashed
potatoes.  I cleaned up the dishes while Mae read from the book "Heroes from
the Book of Mormon" which is taken from many General Authorities.  We read the
first chapter by Russell M. Nelson.  I finished this entrance into my journal
and then we went to bed.

Tuesday, January
07, 2014

                I
woke early again this morning but was able to sleep in the recliner for a
while.  I let Mae sleep in again and I got myself off to work.  My runs went
well but I did get some changes to the seating arrangement again.  In between
the AM and PM runs I helped Mae get some of the Christmas cartons in so she
could pack the Christmas decorations and dishes put away.  I also got a short
nap.  I stopped at the store for a few items and returned the printer cord I
bought last week, it was too short.  I took the Christmas cartons back to the
shed and took care of the chickens before dinner.  We were going to start
watching the DVD set by Hugh Nibley, on the Pearl of Great Price but I spent
most of this evening working on my bus charts for the seating assignments for
the grade school.  This is taking more time than I thought it would but I think
it will be a good thing.

Wednesday,
January 08, 2014

                Mae
didn't sleep well so she had most of my breakfast out for me and I got myself
off to work.  It is snowing lightly today so the roads are somewhat bad.  My
runs went well this morning.  I took a nap after getting home.  I ordered some
Dr. Scholls sandals on the internet this morning.  I also called and ordered
some of my milk supplement from Nancy.  It will take a couple of days to get it
in.  I had tried to call Lee Brown before I went to work this afternoon but he
didn't get my message until I had left.  He did call and visit with Mae for a
few minutes.  My PM runs went well, but I was sure tired when I got home.  I
took care of the chickens and was going to clean off the snow from the walks
and driveway, but (I believe Glen Higgley) had plowed the driveway and
sidewalks.  Mae has been preparing all day for a Relief Society meeting
tonight.  She left about 6:30PM.  I watched the last half of two shows and
started a 3rd when Scott and his family came to return the picnic
tables they had borrowed.  Mae came home just as they were getting ready to
leave.  It was good to see them for a few minutes.  Mishelle is sure having
back problems.  I finished this entrance after they left and before we went to
bed.

Thursday,
January 09, 2014

                Mae
was sleeping in the recliner when I got up, so I had her get back in bed.  By
the time I had showered she had got up and got my breakfast.  After I went to
work she did go back to bed and sleep longer.  My bus runs went well although
it snowed and the roads were slippery in areas.  Mae was up when I got home and
had got started in a western show so we finished it together.

Friday,
January 09, 2014

                Work
went well this morning but the shop didn't get the extra things done that I
need on my bus.  After getting home and eating a little, I laid down for a
nap.  The dispatch called and asked me to take the mid-day run again.  Again I
was already late and when I asked why I wasn't notified earlier?  They said
that they had put the information in my box.  Any way I took it although there
were some upset mothers.  I stayed and took my PM runs and they went well.
After work I took Mae out to eat for her Birthday that we missed because she
was sick.  After eating we went to Jeff and Gail's.  Jeff has been trying to
change out his bathroom fixtures to bronze trim but has had trouble taking the
old bathtub drain.  I went in to see the problem.  The drain was just to set,
so I took a metal cutting blade in the sawsall and carefully made some cuts in
the fitting and then knocked the unit loose with a screwdriver and hammer.
Gail, Mae, Jeff and I then played a game of Hearts.  It was a long game this
time but Jeff finally won.  It was mid=night before we got home and went to
bed.

Saturday,
January 11, 2014

                Mae
had a Relief Society meeting to attend so I got up and fixed us some
breakfast.  I got some tools and went over to Jeff's and finished changing the
fixture trim for him.  He helped me until 11AM when he and his family went to a
show.  I finished up by noon and went home.  Mae had gone shopping for a few
items after her meeting so she jot home just before I did.  We got some lunch
and after cleaning up we took a nap.  I only slept for 20 minutes but I let Mae
sleep longer.  I worked the rest of the afternoon and evening on my personal
histories.

Sunday,
January 12, 2014

                It
was a regular Sunday schedule and our meeting went well.  We invited David and
his family to come for dinner with us.  Mae prepared a very nice chicken dinner
with all the trimmings.  David wasn't feeling the best so he took a short nape
after dinner.  We played a few games but at 5PM David had to leave for a Cub
Scout meeting that was to be held at their place.  Mae and I played a game of
Knock in which Mae beat me.  I then wrote a though for the Ward News Letter and
got it E-mailed to John Sliger.  I got my journal entry typed for today and
worked a little on my 1970 – 1974 Diary entrances before we went to bed.

Monday,
January 13, 2014

                Work
went well this morning although the master switch to the loading lights shorted
and caused sparks.  I left it on top to repair after the morning run.  When I
went in for the afternoon run the switch had been replaced.  When I got home
this afternoon, I took care of the chickens.  I need to do some work on the
feeder.  I did turn the chick box on its side and adjust the heat light.  This
way they will have more room to run.  We got 13 eggs today, that is the most we
have collected with these chickens in a day's time.  This evening we went over
to Smokey and Silvia Barns to visit and played games with them.  It was a great
evening even if Silvia won the games.  She might be losing her memory but she
can sure play games.  It is now 9:20PM so we had better go to bed.

Tuesday,
January 14, 2014

                When
I got home from the bus run this morning, Mae went to use her I-pad and
couldn't find it.  When she got worried I suggested that she call Mike.  I
think that Mike installed a search program that will find her I-pod's
location.  Before she did that she went in the bedroom for prayer.  When she
came out she called the Dr. Office where she had taken Sister Reed yesterday
and they had found it.  I took her over to get it.  We also stopped at Greens
Feed and bought some Laying Mash, and then we got the car washed.  My PM runs
went well.  I stopped at Mary's Health store and picked up some capsules.  I
then went over to the credit union and deposited a check for Mae.  Mae prepared
a nice dinner when I got home.  We then went up and watched a show that Bob had
recorded.  Today is Bob's Birthday and I think he wants the company.  The show
was "Mr. Lucky" with Cary Grant and Larine Day.  We had seen it before but a
long time ago so it was good to see it again.  Bob told us that Larine Day
worked in the Los Angeles Temple with Aunt Vida.  I had never heard that
before.  It is now almost 9 PM so we had better go to bed, morning comes fast.

Wednesday,
January 15, 2014

                I
woke at 3AM and Mae wasn't in bed.  I checked and she was the recliner
sleeping, so I went back to bed and slept for a couple more hours.  I was going
to get myself off to work but Mae woke and helped me get off.  My runs went well
and when I returned to the compound the bus wash was open, so I washed my bus.
Mae had a sandwich and protein drink ready for me when I got home.  I went up
to help Bob with some papers he needs to fill out.  We got watching a show and
finished it before doing the papers.  The papers were just to verify that he
was still occupying the home as his primary residency.  I wonder if it is in
the best interest for all concerned if plans weren't made for that to change.
That is one thing Mae and I don't see eye to eye on.  She feels we should just
wait until something happens on its own.  My pm run went well.  This evening I
worked on my Diary entrances.  Mae has been working on her personal history
quite a bit today.  We did watch a show on TV that was quite cute.  It's
getting late so we will quite for today and go to bed.

Thursday,
January 16, 2014

                Mae
had been up when I got up so I had her go back to bed.  She set me some cereal
and protein shake ready for my breakfast.  My AM runs went well and I fueled my
bus when I got back to the compound.  I had a light snake before Mae and I took
a nap.  I then started on my Diary entering.  It sometimes take me a while to
enter just a few days as I elaborate with much more detail, where I now have
room to explain some of those short entries.  My pm runs also went well.  When
I got home Mae's Visiting Teachers were here.  I fed the chickens and gathered
the eggs.  I brought in a squash to see if it was ok.  I believe they are so I
cut this one up, it looks and smells good.  I gave some to Mae's Visiting
Teachers and will take some to my Home Teaching Families also.  Bob and I went
home teaching to the Casey's.  We got the same short doorstep welcome and I
gave him some squash before we left.  We then had a nice visit with the
Johnston's.  Bob gave the lesson but he wasn't able to hear anything else that
was said.  When Mae and I were ready to go to bed, I had to go upstairs and
have him turn the volume on the TV down.  He didn't realize it way up.  His
hearing is really getting much worse.

Friday,
January 17, 2014

                Mae
got up with me and prepared hot cakes and eggs for breakfast before I left for
my bus runs.  My runs went well.  When I got back to the compound I checked
with Dispatch to see if they planned on me for the bus 98 mid-day run or not.
They said that they were not planning on me.  I was quite cold when I got home
so after a small snack, Mae and I laid down for a nap.  Mae put the electric
blanket over me and I finally got warn and slept.  My PM went well.  This
evening we went to Scott and Mishelle's and tended their children while they
went out.

Saturday,
January 18, 2014

                We
slept in until about 9AM and sure enjoyed that.  I prepared breakfast of egg
omelet, while Mae did her hair.  We attended the Bountiful Temple and although
the Temple was packed we only had to wait about an hour to get in a session.  I
took Mae out to eat at Sizzler, fowling the session.  After eating we went to
Costco for a few items.  We then stopped at the grocery store before going
home.  I then took care of the chickens.  It has been a very good day.

Sunday,
January 19, 2014

                I
did not sleep well last night.  I was in quite a lot of pain.  I noticed it
coming on while we were at Costco's.  I did eat one ½ slice of toast and had
Ranch Dressing on my salad, but that is the only thing that I can think of that
might have caused it.  I attended the High Priest leadership meeting and then
came home and slept for an hour.  I went back to Sacrament meeting.  Today was
our Ward conference.  Bishop Hatch and President Puffer were the speakers and
both gave very good talks.  Our Ward Choir sang "Praise to the Man" and
although we hadn't had a choir practice but just sang it from the Hymn Book, we
had a large number join in singing.  Mae and I had Temple Recommend interviews
with the Bishopric after meeting.  We didn't go Home Teaching or Visiting
Teaching as to Sister Fallis, as she isn't feeling well.    Scott and their
family came over for dinner and after eating we played some games.  After they
left, we relaxed and watched a TV show.  Because I don't have to work tomorrow
we watched a second movie that was totally a downer.

Monday,
January 20, 2014

                We
slept in this morning.  We did get several things done around the house, such
as the weekly washing, making the bed, Mae was busy with house work and cooking,
and I worked on the chicken feeder, the water purifier along with several other
small items.  I spent a lot of time working on correcting an error that
occurred on my 1974 journal.  I believe I was able to salvage 99 % of it so I
felt good about that.  Mae made turkey soup for dinner today.  We always save
the left over carcass of Thanksgiving turkeys, boiling then until the leftover
meat fell off.  Then the vegetables and seasoning are added to make a choice
soup.  Today's was no different and we enjoyed for our evening meal.  We
watched a "Gun Smoke" series and then read most of the first lesson from the
Relief Society and Melchizedek Priesthood manual.  We were late getting to bed.

Tuesday,
January 21, 2014

                I
woke at 4:40AM and Mae was not in bed.  She didn't sleep very well so I let her
go back to bed and I got myself off to work.  When I got into the bus compound
I realized that all the busses were still in the parking lot.  I was a little
early for work so I checked out and started my bus.  I then called into the
office and found out that today is also a day off.  I really don't understand
why but I came back home.  Mae was still asleep so I covered up on the recliner
and went back to sleep.  Mae got up at 8AM and came into the front room.
Seeing all my pocket items left on the cupboard top, she gasped in surprise.
That woke me and I said good morning.  I worked on my journal entries while she
took a shower and got dressed.  I prepared her some breakfast.  We texted David
and told him that I would be going to Vernal with him also.  He text back with
"J that sounds great".  I learned
something about my computer when I put the : - ) into my keyboard as it
automatically makes a J.  That is
cute.  We took the gifts that we had bought for Deven and Betsy's daughter with
us and stopped for a few minutes and gave them to Betsey.  We then drove on up
to David's.  We got to visited with Shawna for a few minutes before David
arrived home.  David, Mae and I then drove to Vernal where we watched Morgan
High vs Dushane High.  It was a very good game but the first quarter Dushane
kept the lead, then the second quarter it stayed almost even.  After returning
from the half time break Morgan kept the lead winning 68 to 48.  It was a good
game and Tyler played very well.  Although it was a long drive it was great
visiting and the time passed fast.  Mae and I got home about 8:30PM.  I filled
out my journal and we soon went to bed.

Wednesday, January
22, 2014

                Mae
got up with me and got me off to work.  My runs went well although one of my
grade school children got sick to her stomach and throw up.  I had to clean
that up.  When I returned to the compound I got more paper towels and garbage
sacks, before coming on home.  Mae fixed us a small snack before we laid down
and took a short nap.  I had trouble getting awake so slept for almost an hour.
I worked on my Diary transcribing but that has been slow because I have
expanded on the Short Dairy to give it meaning.  After my PM run I worked
longer on my Diary until I went visiting as the High Priest Group leadership
and the Bishopric.  I went with Bishop Hatch and we visit Sister Fernandez and
with Brother Tayler's wife and children.  After getting home, I worked a little
longer on my Diary and finished today's journal entry before going to bed.

Thursday,
January 23, 2014

                Mae
didn't sleep much last night so I had her go back to bed and I got myself off.
We had heavy fog this morning.  My runs went well.  I worked on my Diary most
of the time between runs.  After my PM run I just relaxed and watched 2 last
half TV shows.  I did that because there wasn't much else to watch.

Friday,
January 24, 2014

                My
sweetheart slept better last night and was up to get me off to work.  She sure
is special.  When I got home Mae had a snack for us and then I took a nap.  I
worked on my Diary again.  This afternoon's routs went well and I got home in
time to go with Mae to Tylor's basket ball game.  Morgan played Park City and
Morgan won 58 to 52.  It was a good game.  Mae and I then went to Jeff and
Gail's where we tended the children while Jeff and Gail went out to eat.  We
prepared dinner for us and the children.  After eating, Mae read scriptures
with the children while I cleaned up the dishes.  We then watched the movie
"Planes" with the children.  It was an animated movie of an airplane raise.
Jeff and Gail came home, just before the show ended so they watched the ending
with us.  They then put the children to bed and the four of us played some
games before we went home.

Saturday,
January 25, 2014

                We
spent a relaxing morning, not getting up until late.  This evening we went to a
movie at the Kaysville Theater.  We went to see the "Saraog Approach" but got
in the wrong theater and saw "The Book Thief" instead.  It also was a very good
movie.  We got home late and soon went to bed.

Sunday,
January 26, 2014

                Up
before 6AM and was soon off to meetings.  When we got home Mae prepared a nice
dinner and we then took a nap.  I did take care of the chickens while dinner
was cooking.  Bother Taylor and Korbin Rogers came Home Teaching at 3PM today.
Mae then went Visiting Teaching with Shirley Olsen to Sister Fallis at 4PM.
Bob and I went Home Teaching to sister Fallis at 4:30PM and had a nice visit
with her.  When we got home Mae had a light dinner prepared.  Irven and Sandy
came over this evening.  We just set and visited with each other until 9PM,
when we had to get ready for bed as work still is on for tomorrow.

Monday,
January 27, 2014

                Mae
got up with me and got me off to work.  My runs went well.  After getting home
I took a nap.  Due to the Elementary Schools having Parent – Teacher
Conferences, the grade schools are getting out early.  I have to go back for
the PM runs at 12:40PM.  This evening Mae had invited the Garf's to come for
dinner and to get acquainted.  Mae had a lovely dinner ready, so we ate and
visited.  We had a wonderful evening and hated to have it end.

Tuesday,
January 28, 2014

                My
AM runs went well.  I had just enough time after getting home to have a small
snack. Mae and I then went to an appointment with Doug Christensen, BC-HIS at
his Layton office.  He gave us hearing tests.  Mae was ok except he had to
clean her ear drum out.  My test defiantly indicates that I need a hearing
aid.  My big concern is the cost, $4,785.00 if we pay up front.  I just don't
feel that we can do that.  After leaving the office I have felt dizzy and light
headed.  I felt ok to drive my bus and so soon had to start my PM runs.  Mae
went up to Morgan to watch Tyler play basket ball this afternoon.  Morgan
played a team from Draper.  Mae said that she was almost sure the other team
would win but at the end Morgan won by 1 point.  Tyler played most of the game and
made several of the major plays and points. When I got home from the PM runs, I
went upstairs and watched a movie Bob had recorded.  This evening after eating
dinner, Mae and I watched some TV while we worked on our pills.  I am still
feeling a little woozy this evening.

Wednesday,
January 29, 2014

                Mae
didn't sleep very well last night but still got up and got me off to work.  She
then went back to bed.  My ears are still bothering me.  I am hearing strange
sounds and still feel some dizziness.  I took a short nap and when I went to
get up I almost fell with dizziness.  I checked with the Audiologist and he
said I should check with my M.D.  I called into the bus dispatch and they will
find a sub for my PM run.  Mae took me over to Dr. Lee's.  He checked my blood
pressure and said that no one knows what causes vertigo but he wants me to see
an Audiologist and an E.N.T., but that won't be for a week.  During the mean
time I should not drive unless the dizziness goes away.  I called back into
Rosa but it went to her answering machine.

Thursday,
January 30, 2014

                Well
I guess I goofed as they didn't cover my AM run as Rosa hadn't checked her
messages.  I was down all day.  I watched TV this afternoon and evening.  I did
call in to the Sub-Line this evening.

Friday,
January 31, 2014

                I
guess I got too much sleep yesterday because I didn't sleep last night.  I
slept quite a lot this morning.  Mae is sure special and does all she can for
me.  My eyes bother me, beside the dizziness so it make reading or working on
the computer uncomfortable.  Mae went to Jeff and Gail's to help with a
Birthday party for Rachel.  Bob took me into Dr. Toone's and he gave adjusted
my neck area and almost immediately the dizziness left and my sinuses started
to drain so that by the time we got home, I felt great.  I called the dispatch
and let them know that I am sure that I can be back to work on Monday.


text:
RockMUD
===============================

**RockMUD (0.3.0) is a WebSockets MUD server**

Try the latest on this Heroku hobby instance: http://rockmud.heroku.com. If you connect to the demo server type 'help commands' to get a full(ish) list of the current commands.

Goals:
* Full featured MUD experience from within the browser.
* Enable quick development.
* Empower client side scripting for GUI.
* DB agnostic -- GET/POST JSON to your defined service or save as a flat file.

Notes on dependencies:
* Socket.io 1.0 or greater is required.
* Development keeps up with latest node release.
* Default terminal loads Bootstrap from CDN.

##10000 feet:##
All design/data elements of RockMUD must be either valid JSON or .js files. Please look at the current code and make an effort to match the current style if you plan to submit a pull request.

###RockMUD development chat through gitter:###

https://gitter.im/rockmud/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link

###Installation###
* Install Node, npm, and Git
* Clone the repo
* cd RockMUD (to enter cloned repo)
* npm install (to install socket.io)
* npm start or node server.js to start the server (defaults to http://127.0.0.1:3000)


text:
class Categorization < ActiveRecord::Base
  belongs_to :category
  belongs_to :company

  #--- validations ---
  validates_presence_of :category_id
end


text:
function Anything(anything$){
  $init$Anything();
  if(anything$===undefined)throwexc(InvocationException$meta$model("Cannot instantiate abstract class"),'?','?')
  return anything$;
}
Anything.$crtmm$=function(){return{mod:$CCMM$,ps:[],of:[{t:$_Object},{t:Null}],pa:257,an:function(){return[doc$($CCMM$,'$:Anything'),by(["Gavin"].rt$({t:$_String}))];},d:['$','Anything']};};
ex$.Anything=Anything;
function $init$Anything(){
  if(Anything.$$===undefined){initTypeProto(Anything,'ceylon.language::Anything');}
  return Anything;
}
ex$.$init$Anything=$init$Anything;$init$Anything();
function Nothing(wat) {
    throw "Nothing";
}
initType(Nothing, 'ceylon.language::Nothing');
Nothing.$crtmm$=function(){return{ps:[],pa:1,mod:$CCMM$,d:['$','Nothing']};}
ex$.Nothing=Nothing;


text:
package zuo.biao.library.manager;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import zuo.biao.library.base.BaseApplication;
import zuo.biao.library.util.DataKeeper;
import zuo.biao.library.util.JSON;
import zuo.biao.library.util.Log;
import zuo.biao.library.util.StringUtil;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**磁盘缓存管理类
 * @author Lemon
 * @use CacheManager.getInstance().xxxMethod(...);具体参考.BaseListActivity
 */
public class CacheManager {
	private static final String TAG = "CacheManager";

	public static final String CACHE_PATH = DataKeeper.ROOT_SHARE_PREFS_ + "CACHE_PATH";

	private Context context;
	private CacheManager(Context context) {
		this.context = context;
	}

	private static CacheManager instance;
	public static CacheManager getInstance() {
		if (instance == null) {
			synchronized (CacheManager.class) {
				if (instance == null) {
					instance = new CacheManager(BaseApplication.getInstance());
				}
			}
		}
		return instance;
	}

	/**
	 * @param clazz
	 * @return
	 */
	public <T> String getClassPath(Class<T> clazz) {
		return clazz == null ? null : CACHE_PATH + clazz.getName();
	}
	/**
	 * @param clazz
	 * @return
	 */
	public <T> String getListPath(Class<T> clazz) {
		String classPath = getClassPath(clazz);
		return StringUtil.isNotEmpty(classPath, true) ? classPath + KEY_LIST : null;
	}
	/**
	 * @param clazz
	 * @param group
	 * @return
	 */
	public <T> String getGroupPath(Class<T> clazz) {
		String classPath = getClassPath(clazz);
		return StringUtil.isNotEmpty(classPath, true) == false ? null : classPath + KEY_GROUP;
	}

	private SharedPreferences getSharedPreferences(String path) {
		return StringUtil.isNotEmpty(path, true) == false
				? null : context.getSharedPreferences(StringUtil.getTrimedString(path), Context.MODE_PRIVATE);
	}

	/**
	 * 数据列表
	 */
	public static final String KEY_LIST = "LIST";

	/**
	 * 数据分组,自定义
	 */
	public static final String KEY_GROUP = "GROUP";
	/**
	 * 分组中列表每页最大数量
	 */
	public static final int MAX_PAGE_SIZE = 10;

	/**获取列表
	 * @param clazz
	 * @return
	 */
	public <T> List<T> getAllList(Class<T> clazz) {
		return getList(clazz, -1, 0);
	}
	/**获取列表
	 * @param clazz
	 * @param start
	 * @return
	 */
	public <T> List<T> getList(Class<T> clazz, int start, int pageSize) {
		return getList(clazz, null, start, pageSize);
	}
	/**获取列表
	 * @param clazz
	 * @param group
	 * @return
	 */
	public <T> List<T> getAllList(Class<T> clazz, String group) {
		return StringUtil.isNotEmpty(group, true) ? getList(clazz, group, -1, 0) : null;
	}
	/**获取列表
	 * @param clazz
	 * @param group == null ? all : in group
	 * @param start < 0 ? all in group : subList(start, end)
	 * @param count > 0 ? all in group : subList(start, end)
	 * @return
	 */
	public <T> List<T> getList(Class<T> clazz, String group, int start, int count) {
		Log.i(TAG, "\n\n<<<<<<<<<<<<<<<<\ngetList  group = " + group +"; start = " + start + "; count = " + count);
		if (count <= 0 || clazz == null) {
			Log.e(TAG, "getList  count <= 0 || clazz == null >> return null;");
			return null;
		}
		Cache<T> cacheList = new Cache<T>(clazz, context, getClassPath(clazz) + KEY_LIST);

		if (StringUtil.isNotEmpty(group, true) == false) {
			return cacheList == null ? null : cacheList.getValueList(start, start + count);
		}

		List<String> idList = getIdList(clazz, group);
		final int totalCount = idList == null ? 0 : idList.size();
		Log.i(TAG, "getList  idList.size() = " + totalCount);
		if (totalCount <= 0) {
			Log.e(TAG, "getList  totalCount <= 0 >> return null;");
			return null;
		}

		if (start >= 0) {
			Log.i(TAG, "getList  start >= 0 >> ");

			int end = start + count;
			if (end > totalCount) {
				end = totalCount;
			}
			Log.i(TAG, "getList  end = " + end);
			if (end <= start) {
				Log.e(TAG, "getList  end <= start >> return null;");
				return null;
			}

			if (start > 0 || end < totalCount) {
				Log.i(TAG, "getList  start > 0 || end < totalCount  >> idList = idList.subList(" + start + "," + end + "); >>");
				idList = idList.subList(start, end);
			}
		}

		List<T> list = new ArrayList<T>();
		T data;
		for (String id : idList) {
			data = cacheList.get(id);
			if (data != null) {
				list.add(data);
			}
		}

		Log.i(TAG, "getList  return list; list.size() = " + list.size() + "\n>>>>>>>>>>>>>>>>>>>>>>\n\n");

		return list;
	}

	/**获取单个值
	 * @param clazz
	 * @param id
	 * @return
	 */
	public <T> T get(Class<T> clazz, String id) {
		Cache<T> cacheList = clazz == null
				? null : new Cache<T>(clazz, context, getClassPath(clazz) + KEY_LIST);
		return cacheList == null ? null : cacheList.get(id);
	}

	/**获取id列表
	 * @param clazz
	 * @param group
	 * @return
	 */
	public <T> List<String> getIdList(Class<T> clazz, String group) {
		SharedPreferences sp = getSharedPreferences(
				getClassPath(clazz) + KEY_GROUP);
		return sp == null ? null : JSON.parseArray(sp.getString(StringUtil.getTrimedString(group), null), String.class);
	}

	/**保存列表
	 * @param clazz 类
	 * @param map 数据表
	 */
	public <T> void addList(Class<T> clazz, LinkedHashMap<String, T> map) {
		saveList(clazz, null, map, 0, 0);
	}
	/**添加列表
	 * @param clazz 类
	 * @param group 分组
	 * @param map 数据表
	 */
	public <T> void addList(Class<T> clazz, String group, LinkedHashMap<String, T> map) {
		addList(clazz, group, map, -1);
	}
	/**添加列表
	 * @param clazz 类
	 * @param group 分组
	 * @param map 数据表
	 * @param pageSize 每页大小
	 */
	public <T> void addList(Class<T> clazz, String group, LinkedHashMap<String, T> map, int pageSize) {
		if (StringUtil.isNotEmpty(group, true) == false) {
			Log.e(TAG, "addList  StringUtil.isNotEmpty(group, true) == false >> return;");
			return;
		}
		saveList(clazz, group, map, -1, pageSize);
	}
	/**保存列表
	 * @param clazz 类
	 * @param group 分组
	 * @param map 数据表
	 * @param start 存储起始位置,[start, start + map.size()]中原有的将被替换. start = start < 0 ? idList.size() : start;
	 * @param pageSize 每页大小
	 */
	public <T> void saveList(Class<T> clazz, String group, LinkedHashMap<String, T> map, int start, int pageSize) {
		Log.i(TAG, "\n\n <<<<<<<<<<<<<<<<<\nsaveList  group = " + group + "; start = " + start + "; pageSize = " + pageSize);
		if (clazz == null || map == null || map.size() <= 0) {
			Log.e(TAG, "saveList  clazz == null || map == null || map.size() <= 0 >> return;");
			return;
		}
		final String CLASS_PATH = getClassPath(clazz);

		if (StringUtil.isNotEmpty(group, true)) {
			group = StringUtil.getTrimedString(group);

			Log.i(TAG, "saveList  group = " + group + "; map.size() = " + map.size()
					+ "; start = " + start +"; pageSize = " + pageSize);
			List<String> newIdList = new ArrayList<String>(map.keySet());//用String而不是Long,因为订单Order的id超出Long的最大值

			Log.i(TAG, "saveList newIdList.size() = " + newIdList.size() + "; start save <<<<<<<<<<<<<<<<<\n ");

			//保存至分组<<<<<<<<<<<<<<<<<<<<<<<<<
			SharedPreferences sp = getSharedPreferences(CLASS_PATH + KEY_GROUP);
			//			sp.edit().putString(KEY_GROUP, group);
			Editor editor = sp.edit();

			Log.i(TAG, "\n saveList pageSize = " + pageSize + " <<<<<<<<");
			//列表每页大小
			if (pageSize > 0) {
				if (pageSize > MAX_PAGE_SIZE) {
					pageSize = MAX_PAGE_SIZE;
				}
			}
			Log.i(TAG, "\n saveList pageSize = " + pageSize + ">>>>>>>>>");

			//id列表
			List<String> idList = JSON.parseArray(sp.getString(group, null), String.class);
			if (idList == null) {
				idList = new ArrayList<String>();
			}
			if (start < 0) {
				start = idList.size();
			}
			Log.i(TAG, "\n saveList idList.size() = " + idList.size() + " <<<<<<<<");
			String id;
			for (int i = start; i < start + newIdList.size(); i++) {
				id = newIdList.get(i - start);
				if (id == null || id.isEmpty()) {
					continue;
				}
				if (idList.contains(id)) {
					idList.remove(id);//位置发生变化
				}
				if (i < idList.size()) {
					idList.set(i, id);
				} else {
					idList.add(id);
				}
			}
			editor.remove(group).putString(group, JSON.toJSONString(idList)).commit();

			Log.i(TAG, "\n saveList idList.size() = " + idList.size() + " >>>>>>>>");
		}

		//保存至分组>>>>>>>>>>>>>>>>>>>>>>>>>

		//保存所有数据<<<<<<<<<<<<<<<<<<<<<<<<<
		Cache<T> cache = new Cache<T>(clazz, context, CLASS_PATH + KEY_LIST);
		cache.saveList(map);
		//保存所有数据>>>>>>>>>>>>>>>>>>>>>>>>>

		Log.i(TAG, "saveList cache.getSize() = " + cache.getSize() + "; end save \n>>>>>>>>>>>>>>>>>> \n\n");
		//		}

	}

	/**保存
	 * 未完成
	 * @param clazz
	 * @param data 数据
	 * @param id
	 */
	public <T> void save(Class<T> clazz, T data, String id) {
		save(clazz, data, id, null);
	}
	/**ROOT
	 * 保存
	 * @param clazz
	 * @param data 数据
	 * @param id
	 * @param group 分组
	 */
	public <T> void save(Class<T> clazz, T data, String id, String group) {
		if (data == null || StringUtil.isNotEmpty(id, true) == false) {
			Log.e(id, "save  data == null || StringUtil.isNotEmpty(id, true) == false  >>  return;");
			return;
		}

		new Cache<T>(clazz, context, getListPath(clazz)).save(id, data);

		SharedPreferences sp = getSharedPreferences(getGroupPath(clazz));
		if (sp != null) {
			group = StringUtil.getTrimedString(group);

			Log.i(TAG, "save sp != null >> save to group");
			List<String> idList = getIdList(clazz, group);
			if (idList == null) {
				idList = new ArrayList<String>();
			}
			if (idList.contains(id) == false) {
				Log.i(TAG, "save idList.contains(id) == false >> add");
				idList.add(0, id);
				sp.edit().remove(group).putString(group, JSON.toJSONString(idList)).commit();
			}
		}
	}

	/**清空类
	 * @param <T>
	 * @param clazz
	 */
	public <T> void clear(Class<T> clazz) {
		clear(getSharedPreferences(getListPath(clazz)));
	}
	/**清空群组
	 * @param <T>
	 * @param clazz
	 * @param group
	 */
	public <T> void clear(Class<T> clazz, String group) {
		clear(clazz, group, false);
	}
	/**清空群组
	 * @param clazz
	 * @param group
	 * @param removeAllInGroup 删除群组内所有id对应数据
	 * @param <T>
	 */
	public <T> void clear(Class<T> clazz, String group, boolean removeAllInGroup) {
		Log.i(TAG, "clear  group = " + group + "; removeAllInGroup = " + removeAllInGroup);
		List<String> list = removeAllInGroup == false ? null : getIdList(clazz, group);
		if (list != null) {
			Cache<T> cache = new Cache<T>(clazz, context, getListPath(clazz));
			for (String id : list) {
				cache.remove(id);
			}
		}
		clear(getSharedPreferences(getGroupPath(clazz)));
	}
	/**清空
	 * @param sp
	 */
	public void clear(SharedPreferences sp) {
		if (sp == null) {
			Log.e(TAG, "clearList  sp == null >> return;");
			return;
		}
		sp.edit().clear().commit();
	}

	public <T> void remove(Class<T> clazz, String id) {
		if (clazz == null) {
			Log.e(TAG, "remove  clazz == null >> return;");
			return;
		}
		new Cache<T>(clazz, context, getListPath(clazz)).remove(id);
	}

}


text:
package com.jeequan.jeepay.pay.channel;

import com.jeequan.jeepay.core.entity.MchDivisionReceiver;
import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.core.entity.PayOrderDivisionRecord;
import com.jeequan.jeepay.core.entity.TransferOrder;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.rqrs.transfer.TransferOrderRQ;

import java.util.List;

/**
* 分账接口
*
* @author terrfly
* @site https://www.jeequan.com
* @date 2021/8/22 08:59
*/
public interface IDivisionService {

    /** 获取到接口code **/
    String getIfCode();

    /** 是否支持该分账 */
    boolean isSupport();

    /** 绑定关系 **/
    ChannelRetMsg bind(MchDivisionReceiver mchDivisionReceiver, MchAppConfigContext mchAppConfigContext);

    /** 单次分账 (无需调用完结接口,或自动解冻商户资金)  **/
    ChannelRetMsg singleDivision(PayOrder payOrder, List<PayOrderDivisionRecord> recordList, MchAppConfigContext mchAppConfigContext);

}


text:
/**
  @module ember-data
*/
export { belongsTo, hasMany } from './-private';


text:
/* linked.h */
struct cell{
  int value;
  struct cell *next;
};
int insert_cell(struct cell **pointer, int new_value);
void delete_cell(struct cell **pointer);


text:
package sign

import (
	"crypto/hmac"
	"encoding/hex"
	"errors"
	"fmt"
	"hash"
	"net/http"
	"sort"
	"strconv"
	"strings"
	"time"
)

const (
	// AuthorizationHeader represents the Authentication HTTP Header.
	AuthorizationHeader = "Authorization"
	// AuthorizationHeaderScheme is the Authentication scheme.
	AuthorizationHeaderScheme = "HHMAC"
	// AuthorizationHeaderHash is the authentication
	// parameter for the hash.
	AuthorizationHeaderHash = "hash"
	// AuthorizationHeaderTimestamp is the authentication
	// parameter for the timestamp.
	AuthorizationHeaderTimestamp = "time"
	// AuthorizationHeaderPublicKey is the authentication
	// parameter for the public key.
	AuthorizationHeaderPublicKey = "key"
)

var (
	ErrAuthorizationParameterInvalid = errors.New("Authorization header invalid")
	ErrMissingAuthorizationHeader    = errors.New("Missing Authorization Header")
	ErrNonHMACScheme                 = errors.New("Non HHMAC authorization")

	ErrAuthorizationParameterNotFound = errors.New("Autorization parameter not found")
)

// HashFunc represents a hash function.
type HashFunc func() hash.Hash

// AuthorizationParameters represents the header
// contained within a request.
type AuthorizationParameters struct {
	Hash      string
	Date      time.Time
	PublicKey string
}

// NewAuthorizationParametersFromString returns new parameter from string
func NewAuthorizationParametersFromString(str string) (*AuthorizationParameters, error) {
	authorization := strings.TrimSpace(str)

	if !strings.HasPrefix(authorization, AuthorizationHeaderScheme+" ") {
		return nil, ErrNonHMACScheme
	}

	parametersRaw := authorization[len(AuthorizationHeaderScheme)+1:]
	parameters := strings.Split(parametersRaw, ",")

	paramsMap := map[string]string{}

	for _, param := range parameters {
		param := strings.TrimSpace(param)
		k, v := keyValueFromString(param)
		paramsMap[k] = v
	}

	signParam, signCondition := paramsMap[AuthorizationHeaderHash]
	dateParam, dateCondition := paramsMap[AuthorizationHeaderTimestamp]
	keyParam, keyCondition := paramsMap[AuthorizationHeaderPublicKey]

	if !signCondition || !dateCondition || !keyCondition {
		return nil, ErrAuthorizationParameterInvalid
	}

	timestamp, err := strconv.ParseInt(dateParam, 10, 64)

	if err != nil {
		return nil, ErrAuthorizationParameterInvalid
	}

	authorizationParams := &AuthorizationParameters{
		Hash:      signParam,
		Date:      time.Unix(0, timestamp),
		PublicKey: keyParam,
	}
	return authorizationParams, nil

}

func keyValueFromString(str string) (string, string) {
	n := strings.Index(str, "=")
	if n < 0 {
		return "", ""
	}

	return str[0:n], str[n+2 : len(str)-1]
}

// Valid tells whether parameters are valid or not.
func (p *AuthorizationParameters) Valid() bool {
	return p.Hash != "" && len(p.PublicKey) > 0
}

// ReadParameters reads the parameters from
// an HTTP request.
func ReadParameters(r *http.Request) (*AuthorizationParameters, error) {

	authorization := r.Header.Get(AuthorizationHeader)

	if authorization == "" {
		return nil, ErrMissingAuthorizationHeader
	}

	return NewAuthorizationParametersFromString(authorization)
}

// Hash returns the hash of
// an HTTP request with the given key.
func Hash(r *http.Request, date time.Time, public, secret string, fn HashFunc) string {

	queryCharacteristic := QueryCharacteristic(r)
	dateString := strconv.FormatInt(date.UnixNano(), 10)
	publicKey := string(public)

	args := []string{queryCharacteristic, dateString, publicKey}
	signatureRaw := strings.Join(args, "_")

	mac := hmac.New(fn, []byte(secret))
	mac.Write([]byte(signatureRaw))
	return hex.EncodeToString(mac.Sum(nil))
}

// QueryCharacteristic returns the
// characteristic of the URL.
func QueryCharacteristic(r *http.Request) string {

	args := []string{strings.ToLower(r.Method), r.Host}

	args = append(args, strings.Split(r.URL.Path, "/")...)

	for key, arg := range r.URL.Query() {
		args = append(args, fmt.Sprintf("%s_%s", key, arg[0]))
	}

	args = filterNonEmpty(args)
	sort.Strings(args)
	return strings.Join(args, "_")
}

func filterNonEmpty(elements []string) []string {

	final := []string{}
	for _, element := range elements {
		if element != "" {
			final = append(final, element)
		}
	}
	return final
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="org.jivesoftware.smack.roster.rosterstore.DirectoryRosterStoreTest" tests="3" skipped="0" failures="0" errors="0" timestamp="2016-08-29T15:00:54" hostname="paridhika-Satellite-C55-C" time="0.02">
  <properties/>
  <testcase name="testStoreAddRemove" classname="org.jivesoftware.smack.roster.rosterstore.DirectoryRosterStoreTest" time="0.018"/>
  <testcase name="testStoreUninitialized" classname="org.jivesoftware.smack.roster.rosterstore.DirectoryRosterStoreTest" time="0.001"/>
  <testcase name="testStoreInitializedEmpty" classname="org.jivesoftware.smack.roster.rosterstore.DirectoryRosterStoreTest" time="0.001"/>
  <system-out><![CDATA[]]></system-out>
  <system-err><![CDATA[]]></system-err>
</testsuite>


text:
<!doctype html>

	<meta charset="UTF-8">
	<title>Registration Form</title>

	<form>

				Last Name
				<input style="display: inline-block; width: 240px;" id="last-name" type="text" required="required" />

				First Name
				<input style="display: inline-block; width: 240px;" id="first-name" type="text" required="required" />

				Address
				<textarea id="address" style="display: inline-block; width: 230px; height: 65px;"></textarea>

						City

					<input style="display: inline-block; width: 170px;" id="city" type="text" required="required" />
					State
					<input style="display: inline-block; width: 40px;" id="state" type="text" required="required" />

				ZIP/Postal Code
				<input type="text" id="postal-code" style="display: inline-block; width: 80px;" />

				Country

					<select name="country" id="country" style="width: 170px">
						<option value="Bulgaria" selected="selected">Bulgaria</option>
						<option value="Afganistan">Afghanistan</option>
						<option value="Albania">Albania</option>
						<option value="Algeria">Algeria</option>
						<option value="American Samoa">American Samoa</option>
						<option value="Andorra">Andorra</option>
						<option value="Angola">Angola</option>
						<option value="Anguilla">Anguilla</option>
						<option value="Antigua & Barbuda">Antigua & Barbuda</option>
						<option value="Argentina">Argentina</option>
						<option value="Armenia">Armenia</option>
						<option value="Aruba">Aruba</option>
						<option value="Australia">Australia</option>
						<option value="Austria">Austria</option>
						<option value="Azerbaijan">Azerbaijan</option>
						<option value="Bahamas">Bahamas</option>
						<option value="Bahrain">Bahrain</option>
						<option value="Bangladesh">Bangladesh</option>
						<option value="Barbados">Barbados</option>
						<option value="Belarus">Belarus</option>
						<option value="Belgium">Belgium</option>
						<option value="Belize">Belize</option>
						<option value="Benin">Benin</option>
						<option value="Bermuda">Bermuda</option>
						<option value="Bhutan">Bhutan</option>
						<option value="Bolivia">Bolivia</option>
						<option value="Bonaire">Bonaire</option>
						<option value="Bosnia & Herzegovina">Bosnia & Herzegovina</option>
						<option value="Botswana">Botswana</option>
						<option value="Brazil">Brazil</option>
						<option value="British Indian Ocean Ter">British Indian Ocean Ter</option>
						<option value="Brunei">Brunei</option>
						<option value="Burkina Faso">Burkina Faso</option>
						<option value="Burundi">Burundi</option>
						<option value="Cambodia">Cambodia</option>
						<option value="Cameroon">Cameroon</option>
						<option value="Canada">Canada</option>
						<option value="Canary Islands">Canary Islands</option>
						<option value="Cape Verde">Cape Verde</option>
						<option value="Cayman Islands">Cayman Islands</option>
						<option value="Central African Republic">Central African Republic</option>
						<option value="Chad">Chad</option>
						<option value="Channel Islands">Channel Islands</option>
						<option value="Chile">Chile</option>
						<option value="China">China</option>
						<option value="Christmas Island">Christmas Island</option>
						<option value="Cocos Island">Cocos Island</option>
						<option value="Colombia">Colombia</option>
						<option value="Comoros">Comoros</option>
						<option value="Congo">Congo</option>
						<option value="Cook Islands">Cook Islands</option>
						<option value="Costa Rica">Costa Rica</option>
						<option value="Cote DIvoire">Cote D'Ivoire</option>
						<option value="Croatia">Croatia</option>
						<option value="Cuba">Cuba</option>
						<option value="Curaco">Curacao</option>
						<option value="Cyprus">Cyprus</option>
						<option value="Czech Republic">Czech Republic</option>
						<option value="Denmark">Denmark</option>
						<option value="Djibouti">Djibouti</option>
						<option value="Dominica">Dominica</option>
						<option value="Dominican Republic">Dominican Republic</option>
						<option value="East Timor">East Timor</option>
						<option value="Ecuador">Ecuador</option>
						<option value="Egypt">Egypt</option>
						<option value="El Salvador">El Salvador</option>
						<option value="Equatorial Guinea">Equatorial Guinea</option>
						<option value="Eritrea">Eritrea</option>
						<option value="Estonia">Estonia</option>
						<option value="Ethiopia">Ethiopia</option>
						<option value="Falkland Islands">Falkland Islands</option>
						<option value="Faroe Islands">Faroe Islands</option>
						<option value="Fiji">Fiji</option>
						<option value="Finland">Finland</option>
						<option value="France">France</option>
						<option value="French Guiana">French Guiana</option>
						<option value="French Polynesia">French Polynesia</option>
						<option value="French Southern Ter">French Southern Ter</option>
						<option value="Gabon">Gabon</option>
						<option value="Gambia">Gambia</option>
						<option value="Georgia">Georgia</option>
						<option value="Germany">Germany</option>
						<option value="Ghana">Ghana</option>
						<option value="Gibraltar">Gibraltar</option>
						<option value="Great Britain">Great Britain</option>
						<option value="Greece">Greece</option>
						<option value="Greenland">Greenland</option>
						<option value="Grenada">Grenada</option>
						<option value="Guadeloupe">Guadeloupe</option>
						<option value="Guam">Guam</option>
						<option value="Guatemala">Guatemala</option>
						<option value="Guinea">Guinea</option>
						<option value="Guyana">Guyana</option>
						<option value="Haiti">Haiti</option>
						<option value="Hawaii">Hawaii</option>
						<option value="Honduras">Honduras</option>
						<option value="Hong Kong">Hong Kong</option>
						<option value="Hungary">Hungary</option>
						<option value="Iceland">Iceland</option>
						<option value="India">India</option>
						<option value="Indonesia">Indonesia</option>
						<option value="Iran">Iran</option>
						<option value="Iraq">Iraq</option>
						<option value="Ireland">Ireland</option>
						<option value="Isle of Man">Isle of Man</option>
						<option value="Israel">Israel</option>
						<option value="Italy">Italy</option>
						<option value="Jamaica">Jamaica</option>
						<option value="Japan">Japan</option>
						<option value="Jordan">Jordan</option>
						<option value="Kazakhstan">Kazakhstan</option>
						<option value="Kenya">Kenya</option>
						<option value="Kiribati">Kiribati</option>
						<option value="Korea North">Korea North</option>
						<option value="Korea Sout">Korea South</option>
						<option value="Kuwait">Kuwait</option>
						<option value="Kyrgyzstan">Kyrgyzstan</option>
						<option value="Laos">Laos</option>
						<option value="Latvia">Latvia</option>
						<option value="Lebanon">Lebanon</option>
						<option value="Lesotho">Lesotho</option>
						<option value="Liberia">Liberia</option>
						<option value="Libya">Libya</option>
						<option value="Liechtenstein">Liechtenstein</option>
						<option value="Lithuania">Lithuania</option>
						<option value="Luxembourg">Luxembourg</option>
						<option value="Macau">Macau</option>
						<option value="Macedonia">Macedonia</option>
						<option value="Madagascar">Madagascar</option>
						<option value="Malaysia">Malaysia</option>
						<option value="Malawi">Malawi</option>
						<option value="Maldives">Maldives</option>
						<option value="Mali">Mali</option>
						<option value="Malta">Malta</option>
						<option value="Marshall Islands">Marshall Islands</option>
						<option value="Martinique">Martinique</option>
						<option value="Mauritania">Mauritania</option>
						<option value="Mauritius">Mauritius</option>
						<option value="Mayotte">Mayotte</option>
						<option value="Mexico">Mexico</option>
						<option value="Midway Islands">Midway Islands</option>
						<option value="Moldova">Moldova</option>
						<option value="Monaco">Monaco</option>
						<option value="Mongolia">Mongolia</option>
						<option value="Montserrat">Montserrat</option>
						<option value="Morocco">Morocco</option>
						<option value="Mozambique">Mozambique</option>
						<option value="Myanmar">Myanmar</option>
						<option value="Nambia">Nambia</option>
						<option value="Nauru">Nauru</option>
						<option value="Nepal">Nepal</option>
						<option value="Netherland Antilles">Netherland Antilles</option>
						<option value="Netherlands">Netherlands (Holland, Europe)</option>
						<option value="Nevis">Nevis</option>
						<option value="New Caledonia">New Caledonia</option>
						<option value="New Zealand">New Zealand</option>
						<option value="Nicaragua">Nicaragua</option>
						<option value="Niger">Niger</option>
						<option value="Nigeria">Nigeria</option>
						<option value="Niue">Niue</option>
						<option value="Norfolk Island">Norfolk Island</option>
						<option value="Norway">Norway</option>
						<option value="Oman">Oman</option>
						<option value="Pakistan">Pakistan</option>
						<option value="Palau Island">Palau Island</option>
						<option value="Palestine">Palestine</option>
						<option value="Panama">Panama</option>
						<option value="Papua New Guinea">Papua New Guinea</option>
						<option value="Paraguay">Paraguay</option>
						<option value="Peru">Peru</option>
						<option value="Phillipines">Philippines</option>
						<option value="Pitcairn Island">Pitcairn Island</option>
						<option value="Poland">Poland</option>
						<option value="Portugal">Portugal</option>
						<option value="Puerto Rico">Puerto Rico</option>
						<option value="Qatar">Qatar</option>
						<option value="Republic of Montenegro">Republic of Montenegro</option>
						<option value="Republic of Serbia">Republic of Serbia</option>
						<option value="Reunion">Reunion</option>
						<option value="Romania">Romania</option>
						<option value="Russia">Russia</option>
						<option value="Rwanda">Rwanda</option>
						<option value="St Barthelemy">St Barthelemy</option>
						<option value="St Eustatius">St Eustatius</option>
						<option value="St Helena">St Helena</option>
						<option value="St Kitts-Nevis">St Kitts-Nevis</option>
						<option value="St Lucia">St Lucia</option>
						<option value="St Maarten">St Maarten</option>
						<option value="St Pierre & Miquelon">St Pierre & Miquelon</option>
						<option value="St Vincent & Grenadines">St Vincent & Grenadines</option>
						<option value="Saipan">Saipan</option>
						<option value="Samoa">Samoa</option>
						<option value="Samoa American">Samoa American</option>
						<option value="San Marino">San Marino</option>
						<option value="Sao Tome & Principe">Sao Tome & Principe</option>
						<option value="Saudi Arabia">Saudi Arabia</option>
						<option value="Senegal">Senegal</option>
						<option value="Serbia">Serbia</option>
						<option value="Seychelles">Seychelles</option>
						<option value="Sierra Leone">Sierra Leone</option>
						<option value="Singapore">Singapore</option>
						<option value="Slovakia">Slovakia</option>
						<option value="Slovenia">Slovenia</option>
						<option value="Solomon Islands">Solomon Islands</option>
						<option value="Somalia">Somalia</option>
						<option value="South Africa">South Africa</option>
						<option value="Spain">Spain</option>
						<option value="Sri Lanka">Sri Lanka</option>
						<option value="Sudan">Sudan</option>
						<option value="Suriname">Suriname</option>
						<option value="Swaziland">Swaziland</option>
						<option value="Sweden">Sweden</option>
						<option value="Switzerland">Switzerland</option>
						<option value="Syria">Syria</option>
						<option value="Tahiti">Tahiti</option>
						<option value="Taiwan">Taiwan</option>
						<option value="Tajikistan">Tajikistan</option>
						<option value="Tanzania">Tanzania</option>
						<option value="Thailand">Thailand</option>
						<option value="Togo">Togo</option>
						<option value="Tokelau">Tokelau</option>
						<option value="Tonga">Tonga</option>
						<option value="Trinidad & Tobago">Trinidad & Tobago</option>
						<option value="Tunisia">Tunisia</option>
						<option value="Turkey">Turkey</option>
						<option value="Turkmenistan">Turkmenistan</option>
						<option value="Turks & Caicos Is">Turks & Caicos Is</option>
						<option value="Tuvalu">Tuvalu</option>
						<option value="Uganda">Uganda</option>
						<option value="Ukraine">Ukraine</option>
						<option value="United Arab Erimates">United Arab Emirates</option>
						<option value="United Kingdom">United Kingdom</option>
						<option value="United States of America">United States of America</option>
						<option value="Uraguay">Uruguay</option>
						<option value="Uzbekistan">Uzbekistan</option>
						<option value="Vanuatu">Vanuatu</option>
						<option value="Vatican City State">Vatican City State</option>
						<option value="Venezuela">Venezuela</option>
						<option value="Vietnam">Vietnam</option>
						<option value="Virgin Islands (Brit)">Virgin Islands (Brit)</option>
						<option value="Virgin Islands (USA)">Virgin Islands (USA)</option>
						<option value="Wake Island">Wake Island</option>
						<option value="Wallis & Futana Is">Wallis & Futana Is</option>
						<option value="Yemen">Yemen</option>
						<option value="Zaire">Zaire</option>
						<option value="Zambia">Zambia</option>
						<option value="Zimbabwe">Zimbabwe</option>
					</select>

						Phone(country code,

							area code, number)

					(+<input style="display: inline-block; width: 50px;" id="phone" type="number" required="required" />)
					<input style="display: inline-block; width: 50px;" id="area-code" type="number" required="required" />
					<input style="display: inline-block; width: 100px;" id="number" type="number" required="required" />

				Email
				<input style="display: inline-block; width: 240px;" id="email" type="email" required="required" />

				Birth date
				<input style="display: inline-block; width: 240px;" id="birth-date" type="date" required="required" />

				Gender

					<select name="gender" id="gender" style="width: 70px">
						<option value="Male">Male</option>
						<option value="Female">Female</option>
					</select>

				Starting date

					<input name="starting-date" id="starting-date" type="radio" value="Spring 2015" />Spring 2015
					<input name="starting-date" id="starting-date" type="radio" value="Summer 2015" />Summer 2015

				Comments⁄Questions
				<textarea id="Comments-Questions" style="display: inline-block; width: 230px; height: 95px;"></textarea>

					<input type="button" id="submit-form" value="Submit" />
					<input type="reset" id="clean-form" value="Clean this form" />

	</form>


text:
__author__ = 'Zhanelya'
import web
from models.users import users_model

class spa:

    def GET(self):

        if web.input().get('action') == 'logout':
            users_model.session_login(0)

        return web.template.render('views/').index()