text:
CREATE OR REPLACE PROCEDURE EditorDelObject(ObjName varchar2, ObjType varchar2)
IS
	v_counter number := 0;
BEGIN
	IF ObjType = 'TABLE' then
		select count(*) into v_counter from user_tables where table_name = upper(ObjName);
		IF v_counter > 0 then
			EXECUTE IMMEDIATE 'drop table ' || ObjName || ' cascade constraints';
		END IF;
	END IF;
	IF ObjType = 'SEQUENCE' then
		select count(*) into v_counter from user_sequences where sequence_name = upper(ObjName);
			IF v_counter > 0 then
				EXECUTE IMMEDIATE 'DROP SEQUENCE ' || ObjName;
			END IF;
	END IF;
END;

BEGIN
	EditorDelObject('todo', 'TABLE');
	EditorDelObject('todo_seq', 'SEQUENCE');
END;

CREATE TABLE EDITOR.todo
(
    id INT PRIMARY KEY NOT NULL,
    item VARCHAR(200),
    done NUMBER(1) DEFAULT 0 NOT NULL,
    priority NUMBER(10) DEFAULT 1 NOT NULL
);

CREATE SEQUENCE todo_seq;

CREATE OR REPLACE TRIGGER todo_on_insert
	BEFORE INSERT ON todo
	FOR EACH ROW
BEGIN
	SELECT todo_seq.nextval
	INTO :new.id
	FROM dual;
END;

INSERT INTO todo (item, done, priority) VALUES ( 'Send business plan to clients', 1, 1 );
INSERT INTO todo (item, done, priority) VALUES ( 'Web-site copy revisions',       0, 2 );
INSERT INTO todo (item, done, priority) VALUES ( 'Review client tracking',        0, 2 );
INSERT INTO todo (item, done, priority) VALUES ( 'E-mail catchup',                0, 3 );
INSERT INTO todo (item, done, priority) VALUES ( 'Complete worksheet',            0, 4 );
INSERT INTO todo (item, done, priority) VALUES ( 'Prep sales presentation',       0, 5 );

--
-- Users table examples
--
BEGIN
	EditorDelObject('users', 'TABLE');
	EditorDelObject('dept', 'TABLE');
	EditorDelObject('permission', 'TABLE');
	EditorDelObject('sites', 'TABLE');
	EditorDelObject('files', 'TABLE');
	EditorDelObject('user_dept', 'TABLE');
	EditorDelObject('user_permission', 'TABLE');
	EditorDelObject('users_files', 'TABLE');

	EditorDelObject('users_seq', 'SEQUENCE');
	EditorDelObject('dept_seq', 'SEQUENCE');
	EditorDelObject('permission_seq', 'SEQUENCE');
	EditorDelObject('sites_seq', 'SEQUENCE');
	EditorDelObject('files_seq', 'SEQUENCE');
END;

CREATE TABLE users (
	id INT PRIMARY KEY NOT NULL,
	title VARCHAR(10),
	first_name VARCHAR(100),
	last_name VARCHAR(100),
	phone VARCHAR(100),
	city VARCHAR(200),
	zip VARCHAR(100),
	updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
	registered_date TIMESTAMP,
	active NUMBER(1) DEFAULT 0 NOT NULL,
	comments VARCHAR(2000),
	manager INT,
	site INT,
	image INT,
	shift_start VARCHAR(8),
	shift_end VARCHAR(8)
);

CREATE SEQUENCE users_seq;

CREATE OR REPLACE TRIGGER users_on_insert
	BEFORE INSERT ON users
	FOR EACH ROW
	BEGIN
		SELECT users_seq.nextval
		INTO :new.id
		FROM dual;
	END;

CREATE TABLE dept (
	id INT PRIMARY KEY NOT NULL,
	name VARCHAR(250)
);

CREATE SEQUENCE dept_seq;

CREATE OR REPLACE TRIGGER dept_on_insert
	BEFORE INSERT ON dept
	FOR EACH ROW
	BEGIN
		SELECT dept_seq.nextval
		INTO :new.id
		FROM dual;
	END;

CREATE TABLE permission (
	id INT PRIMARY KEY NOT NULL,
	name VARCHAR(250)
);

CREATE SEQUENCE permission_seq;

CREATE OR REPLACE TRIGGER permission_on_insert
	BEFORE INSERT ON permission
	FOR EACH ROW
	BEGIN
		SELECT permission_seq.nextval
		INTO :new.id
		FROM dual;
	END;

CREATE TABLE sites (
id INT PRIMARY KEY NOT NULL,
name VARCHAR(250)
);

CREATE SEQUENCE sites_seq;

CREATE OR REPLACE TRIGGER sites_on_insert
	BEFORE INSERT ON sites
	FOR EACH ROW
	BEGIN
		SELECT sites_seq.nextval
		INTO :new.id
		FROM dual;
	END;

CREATE TABLE files (
	id INT PRIMARY KEY NOT NULL,
	filename VARCHAR(1000),
	filesize int default 0,
	web_path VARCHAR(2000),
	system_path VARCHAR(2000)
);

CREATE SEQUENCE files_seq;

CREATE OR REPLACE TRIGGER files_on_insert
	BEFORE INSERT ON files
	FOR EACH ROW
	BEGIN
		SELECT files_seq.nextval
		INTO :new.id
		FROM dual;
	END;

CREATE TABLE user_dept (
	user_id int,
	dept_id int
);

CREATE TABLE user_permission (
	user_id int,
	permission_id int
);

CREATE TABLE users_files (
	user_id int NOT NULL,
	file_id int NOT NULL
);

INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Quynn',     'Contreras',    '1-971-977-4681', 'Slidell',               '81080',    '06-Apr-201218:53:00', '0', 1, 1, '08:00:00', '16:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mr',  'Kaitlin',   'Smith',        '1-436-523-6103', 'Orlando',               'U5G 7J3',  '20-Nov-2012 05:58:25', '1', 1, 2, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Cruz',      'Reynolds',     '1-776-102-6352', 'Lynn',                  'EJ89 9DQ', '31-Dec-2011 23:34:03', '0', 2, 3, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Dr',  'Sophia',    'Morris',       '1-463-224-1405', 'Belleville',            'T1F 2X1',  '04-Aug-2012 02:55:53', '0', 3, 4, '08:00:00', '15:30:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Kamal',     'Roberson',     '1-134-408-5227', 'Rehoboth Beach',        'V7I 6T5',  '23-Dec-2012 00:17:03', '1', 1, 5, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Dr',  'Dustin',    'Rosa',         '1-875-919-3188', 'Jersey City',           'E4 8ZE',   '05-Oct-2012 22:18:59', '0', 1, 6, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Dr',  'Xantha',    'George',       '1-106-884-4754', 'Billings',              'Y2I 6J7',  '25-Nov-2012 12:50:16', '0', 6, 1, '07:00:00', '15:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Bryar',     'Long',         '1-918-114-8083', 'San Bernardino',        '82983',    '14-May-2012 23:32:25', '0', 1, 2, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Kuame',     'Wynn',         '1-101-692-4039', 'Truth or Consequences', '21290',    '21-Jun-2011 16:27:07', '1', 2, 3, '06:00:00', '14:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Ms',  'Indigo',    'Brennan',      '1-756-756-8161', 'Moline',                'NO8 3UY',  '19-Feb-2011 12:51:08', '1', 5, 4, '12:00:00', '00:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Avram',     'Allison',      '1-751-507-2640', 'Rancho Palos Verdes',   'I7Q 8H4',  '30-Dec-2012 17:02:10', '0', 1, 5, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mr',  'Martha',    'Burgess',      '1-971-722-1203', 'Toledo',                'Q5R 9HI',  '04-Feb-2011 17:25:55', '1', 1, 6, '12:00:00', '00:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Lael',      'Kim',          '1-626-697-2194', 'Lake Charles',          '34209',    '24-Jul-2012 06:44:22', '1', 7, 1, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Dr',  'Lyle',      'Lewis',        '1-231-793-3520', 'Simi Valley',           'H9B 2H4',  '30-Aug-2012 03:28:54', '0', 1, 2, '00:00:00', '12:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Veronica',  'Marks',        '1-750-981-6759', 'Glens Falls',           'E3C 5D1',  '14-Aug-2012 12:09:24', '1', 2, 3, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Wynne',     'Ruiz',         '1-983-744-5362', 'Branson',               'L9E 6E2',  '06-Nov-2012 01:04:07', '0', 1, 4, '12:00:00', '00:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Ms',  'Jessica',   'Bryan',        '1-949-932-6772', 'Boulder City',          'F5P 6NU',  '01-Feb-2013 20:22:33', '0', 5, 5, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Ms',  'Quinlan',   'Hyde',         '1-625-664-6072', 'Sheridan',              'Y8A 1LQ',  '25-Oct-2011 16:53:45', '1', 1, 6, '08:00:00', '15:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Mona',      'Terry',        '1-443-179-7343', 'Juneau',                'G62 1OF',  '15-Jan-2012 09:26:59', '0', 1, 1, '08:30:00', '16:30:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Medge',     'Patterson',    '1-636-979-0497', 'Texarkana',             'I5U 6E0',  '20-Oct-2012 16:26:18', '1', 1, 2, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Perry',     'Gamble',       '1-440-976-9560', 'Arcadia',               '98923',    '06-Jun-2012 02:03:49', '1', 2, 3, '00:00:00', '12:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Pandora',   'Armstrong',    '1-197-431-4390', 'Glendora',              '34124',    '29-Aug-2011 01:45:06', '0', 7, 4, '21:00:00', '03:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mr',  'Pandora',   'Briggs',       '1-278-288-9221', 'Oneida',                'T9M 4H9',  '16-Jul-2012 08:44:41', '1', 4, 5, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Maris',     'Leblanc',      '1-936-114-2921', 'Cohoes',                'V1H 6Z7',  '04-May-2011 13:07:04', '1', 1, 6, '00:00:00', '12:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Ishmael',   'Crosby',       '1-307-243-2684', 'Midwest City',          'T6 8PS',   '02-Jul-2011 23:11:11', '0', 3, 1, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Quintessa', 'Pickett',      '1-801-122-7471', 'North Tonawanda',       '09166',    '05-Feb-2013 10:33:22', '1', 1, 2, '12:00:00', '00:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Miss','Ifeoma',    'Mays',         '1-103-883-0962', 'Parkersburg',           '87377',    '22-Aug-2011 12:19:09', '0', 1, 3, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Basia',     'Harrell',      '1-528-238-4178', 'Cody',                  'LJ54 1IU', '07-May-2012 14:42:55', '1', 1, 4, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Hamilton',  'Blackburn',    '1-676-857-1423', 'Delta Junction',        'X5 9HE',   '19-May-2011 07:39:48', '0', 6, 5, '10:00:00', '18:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Ms',  'Dexter',    'Burton',       '1-275-332-8186', 'Gainesville',           '65914',    '01-Feb-2013 16:21:20', '1', 5, 6, '21:00:00', '03:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Quinn',     'Mccall',       '1-808-916-4497', 'Fallon',                'X4 8UB',   '24-Mar-2012 19:31:51', '0', 1, 1, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mr',  'Alexa',     'Wilder',       '1-727-307-1997', 'Johnson City',          '16765',    '14-Oct-2011 08:21:14', '0', 3, 2, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Ms',  'Rhonda',    'Harrell',      '1-934-906-6474', 'Minnetonka',            'I2R 1H2',  '15-Nov-2011 00:08:02', '1', 1, 3, '12:00:00', '00:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Jocelyn',   'England',      '1-826-860-7773', 'Chico',                 '71102',    '31-May-2012 18:01:43', '1', 1, 4, '09:00:00', '17:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Dr',  'Vincent',   'Banks',        '1-225-418-0941', 'Palo Alto',             '03281',    '07-Aug-2011 07:22:43', '0', 1, 5, '18:00:00', '02:00:00');
INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end) VALUES ('Mrs', 'Stewart',   'Chan',         '1-781-793-2340', 'Grand Forks',           'L1U 3ED',  '01-Nov-2012 23:14:44', '1', 6, 6, '08:00:00', '16:00:00');

INSERT INTO dept (name) VALUES ( 'IT' );
INSERT INTO dept (name) VALUES ( 'Sales' );
INSERT INTO dept (name) VALUES ( 'Pre-Sales' );
INSERT INTO dept (name) VALUES ( 'Marketing' );
INSERT INTO dept (name) VALUES ( 'Senior Management' );
INSERT INTO dept (name) VALUES ( 'Accounts' );
INSERT INTO dept (name) VALUES ( 'Support' );

INSERT INTO permission (name) VALUES ( 'Printer' );
INSERT INTO permission (name) VALUES ( 'Servers' );
INSERT INTO permission (name) VALUES ( 'Desktop' );
INSERT INTO permission (name) VALUES ( 'VMs' );
INSERT INTO permission (name) VALUES ( 'Web-site' );
INSERT INTO permission (name) VALUES ( 'Accounts' );

INSERT INTO user_dept (user_id, dept_id) VALUES ( 1,  1 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 2,  4 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 3,  7 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 4,  3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 5,  2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 6,  6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 7,  2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 8,  1 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 9,  2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 10, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 11, 4 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 12, 5 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 13, 6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 14, 4 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 15, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 16, 6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 17, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 18, 7 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 19, 7 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 20, 1 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 21, 2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 22, 6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 23, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 24, 4 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 25, 5 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 26, 6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 27, 7 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 28, 2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 29, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 30, 1 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 31, 3 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 32, 4 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 33, 6 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 34, 7 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 35, 2 );
INSERT INTO user_dept (user_id, dept_id) VALUES ( 36, 3 );

INSERT INTO user_permission (user_id, permission_id) VALUES ( 1,  1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 1,  3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 1,  4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 2,  4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 2,  1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 4,  3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 4,  4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 4,  5 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 4,  6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 5,  2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 6,  6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 7,  2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 8,  1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 9,  2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 10, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 10, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 10, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 11, 4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 11, 6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 12, 5 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 12, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 12, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 13, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 13, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 13, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 13, 6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 18, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 18, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 18, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 20, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 20, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 20, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 21, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 21, 4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 22, 6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 22, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 22, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 30, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 30, 5 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 30, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 31, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 32, 4 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 33, 6 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 34, 1 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 34, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 34, 3 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 35, 2 );
INSERT INTO user_permission (user_id, permission_id) VALUES ( 36, 3 );

INSERT INTO sites (name) VALUES ( 'Edinburgh' );
INSERT INTO sites (name) VALUES ( 'London' );
INSERT INTO sites (name) VALUES ( 'Paris' );
INSERT INTO sites (name) VALUES ( 'New York' );
INSERT INTO sites (name) VALUES ( 'Singapore' );
INSERT INTO sites (name) VALUES ( 'Los Angeles' );

--
-- Reading list example table
--
BEGIN
	EditorDelObject('audiobooks', 'TABLE');
	EditorDelObject('audiobooks_seq', 'SEQUENCE');
END;

CREATE TABLE audiobooks (
	id INT PRIMARY KEY NOT NULL,
	title VARCHAR(1000),
	author VARCHAR(1000),
	duration INT DEFAULT 0,
	readingOrder INT DEFAULT 0
);

CREATE SEQUENCE audiobooks_seq;

CREATE OR REPLACE TRIGGER audiobooks_on_insert
	BEFORE INSERT ON audiobooks
	FOR EACH ROW
	BEGIN
		SELECT audiobooks_seq.nextval
		INTO :new.id
		FROM dual;
	END;

INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Final Empire: Mistborn', 'Brandon Sanderson', 1479, 1 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Name of the Wind', 'Patrick Rothfuss', 983, 2 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Blade Itself: The First Law', 'Joe Abercrombie', 1340, 3 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Heroes', 'Joe Abercrombie', 1390, 4 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Assassin''s Apprentice: The Farseer Trilogy', 'Robin Hobb', 1043, 5 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Eye of the World: Wheel of Time', 'Robert Jordan', 1802, 6 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Wise Man''s Fear', 'Patrick Rothfuss', 1211, 7 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Way of Kings: The Stormlight Archive', 'Brandon Sanderson', 2734, 8 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Lean Startup', 'Eric Ries', 523, 9 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'House of Suns', 'Alastair Reynolds', 1096, 10 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Lies of Locke Lamora', 'Scott Lynch', 1323, 11 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Best Served Cold', 'Joe Abercrombie', 1592, 12 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Thinking, Fast and Slow', 'Daniel Kahneman', 1206, 13 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Dark Tower I: The Gunslinger', 'Stephen King', 439, 14 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Theft of Swords: Riyria Revelations', 'Michael J. Sullivan', 1357, 15 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Emperor''s Blades: Chronicle of the Unhewn Throne', 'Brian Staveley', 1126, 16 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Magic of Recluce: Saga of Recluce', 'L. E. Modesitt Jr.', 1153, 17 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Red Country', 'Joe Abercrombie', 1196, 18 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Warbreaker', 'Brandon Sanderson', 1496, 19 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Magician', 'Raymond E. Feist', 2173, 20 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Blood Song', 'Anthony Ryan', 1385, 21 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Half a King', 'Joe Abercrombie', 565, 22 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Prince of Thorns: Broken Empire', 'Mark Lawrence', 537, 23 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Immortal Prince: Tide Lords', 'Jennifer Fallon', 1164, 24 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'Medalon: Demon Child', 'Jennifer Fallon', 1039, 25 );
INSERT INTO audiobooks (title, author, duration, readingOrder) VALUES  ( 'The Black Company: Chronicles of The Black Company', 'Glen Cook', 654, 26 );

--
-- Compound key examples
--
BEGIN
	EditorDelObject('users_visits', 'TABLE');
END;

CREATE TABLE users_visits (
    user_id INT NOT NULL,
    site_id INT NOT NULL,
    visit_date DATE DEFAULT NULL,
    CONSTRAINT users_visits_pkey PRIMARY KEY (user_id, visit_date)
);

INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 1, 1, '12-Aug-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 1, 4, '14-Aug-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 1, 7, '19-Aug-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 2, 3, '12-Jul-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 2, 2, '07-Jul-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 2, 6, '01-Jul-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 2, 1, '30-Jul-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 3, 1, '26-Jun-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 3, 2, '05-Dec-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 4, 3, '21-Nov-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 4, 4, '10-Oct-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 5, 5, '02-Aug-2016' );
INSERT INTO users_visits (user_id, site_id, visit_date) VALUES  ( 6, 6, '05-Aug-2016' );

COMMIT;
--
-- DataTables Ajax and server-side processing database (Oracle)
--
BEGIN
	EditorDelObject('datatables_demo', 'TABLE');
	EditorDelObject('datatables_demo_seq', 'SEQUENCE');
END;

CREATE TABLE datatables_demo (
	id INT PRIMARY KEY NOT NULL,
	first_name VARCHAR(250),
	last_name  VARCHAR(250),
	position   VARCHAR(250),
	email      VARCHAR(250),
	office     VARCHAR(250),
	start_date DATE,
	age        INT,
	salary     INT,
	seq        INT,
	extn       VARCHAR(8)
);

CREATE SEQUENCE datatables_demo_seq;

CREATE OR REPLACE TRIGGER datatables_demo_on_insert
	BEFORE INSERT ON datatables_demo
	FOR EACH ROW
	BEGIN
		SELECT datatables_demo_seq.nextval
		INTO :new.id
		FROM dual;
	END;
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Tiger', 'Nixon', 61, 'System Architect', 320800, '25-Apr-2011', 5421, 't.nixon@datatables.net', 'Edinburgh', 2 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Garrett', 'Winters', 63, 'Accountant', 170750, '25-Jul-2011', 8422, 'g.winters@datatables.net', 'Tokyo', 22 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Ashton', 'Cox', 66, 'Junior Technical Author', 86000, '12-Jan-2009', 1562, 'a.cox@datatables.net', 'San Francisco', 6 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Cedric', 'Kelly', 22, 'Senior Javascript Developer', 433060, '29-Mar-2012', 6224, 'c.kelly@datatables.net', 'Edinburgh', 41 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Airi', 'Satou', 33, 'Accountant', 162700, '28-Nov-2008', 5407, 'a.satou@datatables.net', 'Tokyo', 55 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Brielle', 'Williamson', 61, 'Integration Specialist', 372000, '02-Dec-2012', 4804, 'b.williamson@datatables.net', 'New York', 21 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Herrod', 'Chandler', 59, 'Sales Assistant', 137500, '06-Aug-2012', 9608, 'h.chandler@datatables.net', 'San Francisco', 46 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Rhona', 'Davidson', 55, 'Integration Specialist', 327900, '14-Oct-2010', 6200, 'r.davidson@datatables.net', 'Tokyo', 50 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Colleen', 'Hurst', 39, 'Javascript Developer', 205500, '15-Sep-2009', 2360, 'c.hurst@datatables.net', 'San Francisco', 26 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Sonya', 'Frost', 23, 'Software Engineer', 103600, '13-Dec-2008', 1667, 's.frost@datatables.net', 'Edinburgh', 18 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jena', 'Gaines', 30, 'Office Manager', 90560, '19-Dec-2008', 3814, 'j.gaines@datatables.net', 'London', 13 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Quinn', 'Flynn', 22, 'Support Lead', 342000, '03-Mar-2013', 9497, 'q.flynn@datatables.net', 'Edinburgh', 23 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Charde', 'Marshall', 36, 'Regional Director', 470600, '16-Oct-2008', 6741, 'c.marshall@datatables.net', 'San Francisco', 14 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Haley', 'Kennedy', 43, 'Senior Marketing Designer', 313500, '18-Dec-2012', 3597, 'h.kennedy@datatables.net', 'London', 12 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Tatyana', 'Fitzpatrick', 19, 'Regional Director', 385750, '17-Mar-2010', 1965, 't.fitzpatrick@datatables.net', 'London', 54 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Michael', 'Silva', 66, 'Marketing Designer', 198500, '27-Nov-2012', 1581, 'm.silva@datatables.net', 'London', 37 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Paul', 'Byrd', 64, 'Chief Financial Officer (CFO)', 725000, '09-Jun-2010', 3059, 'p.byrd@datatables.net', 'New York', 32 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Gloria', 'Little', 59, 'Systems Administrator', 237500, '10-Apr-2009', 1721, 'g.little@datatables.net', 'New York', 35 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Bradley', 'Greer', 41, 'Software Engineer', 132000, '13-Oct-2012', 2558, 'b.greer@datatables.net', 'London', 48 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Dai', 'Rios', 35, 'Personnel Lead', 217500, '26-Sep-2012', 2290, 'd.rios@datatables.net', 'Edinburgh', 45 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jenette', 'Caldwell', 30, 'Development Lead', 345000, '03-Sep-2011', 1937, 'j.caldwell@datatables.net', 'New York', 17 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Yuri', 'Berry', 40, 'Chief Marketing Officer (CMO)', 675000, '25-Jun-2009', 6154, 'y.berry@datatables.net', 'New York', 57 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Caesar', 'Vance', 21, 'Pre-Sales Support', 106450, '12-Dec-2011', 8330, 'c.vance@datatables.net', 'New York', 29 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Doris', 'Wilder', 23, 'Sales Assistant', 85600, '20-Sep-2010', 3023, 'd.wilder@datatables.net', 'Sidney', 56 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Angelica', 'Ramos', 47, 'Chief Executive Officer (CEO)', 1200000, '09-Oct-2009', 5797, 'a.ramos@datatables.net', 'London', 36 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Gavin', 'Joyce', 42, 'Developer', 92575, '22-Dec-2010', 8822, 'g.joyce@datatables.net', 'Edinburgh', 5 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jennifer', 'Chang', 28, 'Regional Director', 357650, '14-Nov-2010', 9239, 'j.chang@datatables.net', 'Singapore', 51 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Brenden', 'Wagner', 28, 'Software Engineer', 206850, '07-Jun-2011', 1314, 'b.wagner@datatables.net', 'San Francisco', 20 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Fiona', 'Green', 48, 'Chief Operating Officer (COO)', 850000, '11-Mar-2010', 2947, 'f.green@datatables.net', 'San Francisco', 7 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Shou', 'Itou', 20, 'Regional Marketing', 163000, '14-Aug-2011', 8899, 's.itou@datatables.net', 'Tokyo', 1 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Michelle', 'House', 37, 'Integration Specialist', 95400, '02-Jun-2011', 2769, 'm.house@datatables.net', 'Sidney', 39 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Suki', 'Burks', 53, 'Developer', 114500, '22-Oct-2009', 6832, 's.burks@datatables.net', 'London', 40 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Prescott', 'Bartlett', 27, 'Technical Author', 145000, '07-May-2011', 3606, 'p.bartlett@datatables.net', 'London', 47 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Gavin', 'Cortez', 22, 'Team Leader', 235500, '26-Oct-2008', 2860, 'g.cortez@datatables.net', 'San Francisco', 52 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Martena', 'Mccray', 46, 'Post-Sales support', 324050, '09-Mar-2011', 8240, 'm.mccray@datatables.net', 'Edinburgh', 8 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Unity', 'Butler', 47, 'Marketing Designer', 85675, '09-Dec-2009', 5384, 'u.butler@datatables.net', 'San Francisco', 24 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Howard', 'Hatfield', 51, 'Office Manager', 164500, '16-Dec-2008', 7031, 'h.hatfield@datatables.net', 'San Francisco', 38 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Hope', 'Fuentes', 41, 'Secretary', 109850, '12-Feb-2010', 6318, 'h.fuentes@datatables.net', 'San Francisco', 53 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Vivian', 'Harrell', 62, 'Financial Controller', 452500, '14-Feb-2009', 9422, 'v.harrell@datatables.net', 'San Francisco', 30 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Timothy', 'Mooney', 37, 'Office Manager', 136200, '11-Dec-2008', 7580, 't.mooney@datatables.net', 'London', 28 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jackson', 'Bradshaw', 65, 'Director', 645750, '26-Sep-2008', 1042, 'j.bradshaw@datatables.net', 'New York', 34 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Olivia', 'Liang', 64, 'Support Engineer', 234500, '03-Feb-2011', 2120, 'o.liang@datatables.net', 'Singapore', 4 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Bruno', 'Nash', 38, 'Software Engineer', 163500, '03-May-2011', 6222, 'b.nash@datatables.net', 'London', 3 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Sakura', 'Yamamoto', 37, 'Support Engineer', 139575, '19-Aug-2009', 9383, 's.yamamoto@datatables.net', 'Tokyo', 31 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Thor', 'Walton', 61, 'Developer', 98540, '11-Aug-2013', 8327, 't.walton@datatables.net', 'New York', 11 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Finn', 'Camacho', 47, 'Support Engineer', 87500, '07-Jul-2009', 2927, 'f.camacho@datatables.net', 'San Francisco', 10 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Serge', 'Baldwin', 64, 'Data Coordinator', 138575, '09-Apr-2012', 8352, 's.baldwin@datatables.net', 'Singapore', 44 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Zenaida', 'Frank', 63, 'Software Engineer', 125250, '04-Jan-2010', 7439, 'z.frank@datatables.net', 'New York', 42 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Zorita', 'Serrano', 56, 'Software Engineer', 115000, '01-Jun-2012', 4389, 'z.serrano@datatables.net', 'San Francisco', 27 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jennifer', 'Acosta', 43, 'Junior Javascript Developer', 75650, '01-Feb-2013', 3431, 'j.acosta@datatables.net', 'Edinburgh', 49 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Cara', 'Stevens', 46, 'Sales Assistant', 145600, '06-Dec-2011', 3990, 'c.stevens@datatables.net', 'New York', 15 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Hermione', 'Butler', 47, 'Regional Director', 356250, '21-Mar-2011', 1016, 'h.butler@datatables.net', 'London', 9 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Lael', 'Greer', 21, 'Systems Administrator', 103500, '27-Feb-2009', 6733, 'l.greer@datatables.net', 'London', 25 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Jonas', 'Alexander', 30, 'Developer', 86500, '14-Jul-2010', 8196, 'j.alexander@datatables.net', 'San Francisco', 33 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Shad', 'Decker', 51, 'Regional Director', 183000, '13-Nov-2008', 6373, 's.decker@datatables.net', 'Edinburgh', 43 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Michael', 'Bruce', 29, 'Javascript Developer', 183000, '27-Jun-2011', 5384, 'm.bruce@datatables.net', 'Singapore', 16 );
INSERT INTO datatables_demo ( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) VALUES ( 'Donna', 'Snider', 27, 'Customer Support', 112000, '25-Jan-2011', 4226, 'd.snider@datatables.net', 'New York', 19 );

COMMIT;


text:
Imports System.Text
Imports System.Web
Imports Scheduler

Public Class WebPage
    Inherits clsPageBuilder

    Public Sub New(ByVal pagename As String)
        MyBase.New(pagename)
    End Sub

    Public Overrides Function postBackProc(page As String, data As String, user As String, userRights As Integer) As String
        Dim parts As Collections.Specialized.NameValueCollection
        parts = HttpUtility.ParseQueryString(data)
        ' handle postbacks here
        ' update DIV'S with:
        'Me.divToUpdate.Add(DIV_ID, HTML_FOR_DIV)
        ' refresh a page (this page or other page):
        'Me.pageCommands.Add("newpage", url)
        ' open a dialog
        'Me.pageCommands.Add("opendialog", "dyndialog")
        If parts("id") = "b1" Then
            Me.divToUpdate.Add("current_time", "This div was just updated with this")
        End If
        If parts("action") = "updatetime" Then
            ' ajax timer has expired and posted back to us, update the time
            Me.divToUpdate.Add("current_time", DateTime.Now.ToString)
            If DateTime.Now.Second = 0 Then
                Me.divToUpdate.Add("updatediv", "job complete")
            ElseIf DateTime.Now.Second = 30 Then
                Me.divToUpdate.Add("updatediv", "working...")
            End If
        End If

        Return MyBase.postBackProc(page, data, user, userRights)
    End Function

    ' build and return the actual page
    Public Function GetPagePlugin(ByVal pageName As String, ByVal user As String, ByVal userRights As Integer, ByVal queryString As String) As String
        Dim stb As New StringBuilder

        Try
            Me.reset()

            ' handle any queries like mode=something
            Dim parts As Collections.Specialized.NameValueCollection = Nothing
            If (queryString <> "") Then
                parts = HttpUtility.ParseQueryString(queryString)
            End If

            ' add any custom menu items

            ' add any special header items
            'page.AddHeader(header_string)

            ' add the normal title
            Me.AddHeader(hs.GetPageHeader(pageName, "Sample Plugin", "", "", False, False))

            stb.Append(clsPageBuilder.DivStart("pluginpage", ""))

            ' a message area for error messages from jquery ajax postback (optional, only needed if using AJAX calls to get data)
            stb.Append(clsPageBuilder.DivStart("errormessage", "class='errormessage'"))
            stb.Append(clsPageBuilder.DivEnd)

            ' specific page starts here

            stb.Append("
" & DateTime.Now.ToString & "
" & vbCrLf)

            Dim b As New clsJQuery.jqButton("b1", "Button", IFACE_NAME, False)
            stb.Append(b.Build)
            stb.Append(clsPageBuilder.DivEnd)
            stb.Append("
pagename: " & pageName & "
")
            stb.Append("
This is instance: " & Instance & "
")

            Me.RefreshIntervalMilliSeconds = 2000
            stb.Append(Me.AddAjaxHandlerPost("action=updatetime", IFACE_NAME))

            ' add the body html to the page
            Me.AddBody(stb.ToString)

            Me.AddFooter(hs.GetPageFooter)
            Me.suppressDefaultFooter = True

            ' return the full page
            Return Me.BuildPage()
        Catch ex As Exception
            'WriteMon("Error", "Building page: " & ex.Message)
            Return "error"
        End Try
    End Function

End Class

redpajama_set_name: RedPajamaGithub


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const React = require("react");
const ReactDOM = require("react-dom");
const monadic_react_1 = require("../../src/monadic_react");
const button_1 = require("./samples/button");
const label_1 = require("./samples/label");
const selector_and_custom_class_1 = require("./samples/selector_and_custom_class");
const multiselector_1 = require("./samples/multiselector");
const menu_1 = require("./samples/menu");
const tabbed_menu_1 = require("./samples/tabbed menu");
const toggles_1 = require("./samples/toggles");
const moments_1 = require("./samples/moments");
const rich_text_1 = require("./samples/rich text");
const pagination_1 = require("./samples/pagination");
const list_1 = require("./samples/list");
const editable_list_1 = require("./samples/editable_list");
const link_1 = require("./samples/link");
const overlay_1 = require("./samples/overlay");
const context_1 = require("./samples/context");
const form_1 = require("./samples/form");
const promise_sample_1 = require("./samples/promise_sample");
const delay_wait_1 = require("./samples/delay_wait");
function HomePage(slug) {
    let all_samples = [
        monadic_react_1.mk_submenu_entry("controls", [
            monadic_react_1.mk_menu_entry({ sample: link_1.link_sample, description: "links" }),
            monadic_react_1.mk_menu_entry({ sample: label_1.label_sample, description: "label" }),
            monadic_react_1.mk_menu_entry({ sample: button_1.button_sample, description: "button" }),
            monadic_react_1.mk_menu_entry({ sample: rich_text_1.rich_text_sample, description: "rich text" }),
        ]),
        monadic_react_1.mk_submenu_entry("dataflows", [
            monadic_react_1.mk_menu_entry({ sample: selector_and_custom_class_1.selector_sample, description: "selector" }),
            monadic_react_1.mk_menu_entry({ sample: multiselector_1.multiselector_sample, description: "multi-selector" }),
            monadic_react_1.mk_menu_entry({ sample: moments_1.moments_sample, description: "dates and times" }),
            monadic_react_1.mk_menu_entry({ sample: toggles_1.toggles_sample, description: "coordinated toggles" }),
        ]),
        monadic_react_1.mk_submenu_entry("forms", [
            monadic_react_1.mk_menu_entry({ sample: form_1.course_form_with_autosave_sample, description: "simple form" }),
            monadic_react_1.mk_menu_entry({ sample: form_1.should_component_update_sample, description: "form with update control" })
        ]),
        monadic_react_1.mk_submenu_entry("lists", [
            monadic_react_1.mk_menu_entry({ sample: list_1.list_sample, description: "list" }),
            monadic_react_1.mk_menu_entry({ sample: pagination_1.pagination_sample, description: "pagination" }),
            monadic_react_1.mk_menu_entry({ sample: editable_list_1.editable_list_sample, description: "editable list" }),
        ]),
        monadic_react_1.mk_submenu_entry("menus", [
            monadic_react_1.mk_menu_entry({ sample: menu_1.menu_sample, description: "nested menu" }),
            monadic_react_1.mk_menu_entry({ sample: tabbed_menu_1.tabbed_menu_sample, description: "tabbed menu" })
        ]),
        monadic_react_1.mk_submenu_entry("other", [
            monadic_react_1.mk_menu_entry({ sample: context_1.context_sample, description: "context management" }),
            monadic_react_1.mk_menu_entry({ sample: overlay_1.overlay_sample, description: "overlay" }),
            monadic_react_1.mk_menu_entry({ sample: promise_sample_1.promise_sample, description: "promise" }),
            monadic_react_1.mk_menu_entry({ sample: delay_wait_1.delay_wait, description: "delay and wait" })
        ]),
    ];
    let edit_toggle = () => ({
        url: monadic_react_1.make_url(["edit_toggle_sample"]),
        page: _ => monadic_react_1.repeat("edit toggle sample")(monadic_react_1.any()([
            monadic_react_1.retract()(s => s.mode, s => m => (Object.assign({}, s, { mode: m })), mode => monadic_react_1.button("Toggle editing")(mode == "view" ? "edit" : "view")),
            state => monadic_react_1.retract()(s => s.text, s => t => (Object.assign({}, s, { text: t })), monadic_react_1.rich_text(state.mode))(state)
        ]))({ mode: "edit", text: "" }).ignore()
    });
    let sample_minipage = s => monadic_react_1.get_context().then(s.description, c => {
        let e = all_samples.find(e => e.children.findIndex(s1 => s1.value.description == s.description) != -1);
        return c.set_url({}, monadic_react_1.make_url([e.label.replace(/\s/g, "_"), s.description.replace(/\s/g, "_")])).then(`${s.description}_set_url`, _ => monadic_react_1.h2(s.description, "", s.description)(_ => s.sample)(null));
    });
    let menu_page = () => ({
        url: monadic_react_1.fallback_url(),
        page: (_) => monadic_react_1.simple_menu("side menu", s => s.description)(all_samples, s => {
            return sample_minipage(s);
        })
    });
    let sample_route = (e, s) => ({
        url: monadic_react_1.make_url([e.label.replace(/\s/g, "_"), s.description.replace(/\s/g, "_")]),
        page: (_) => monadic_react_1.simple_menu("side menu", s => s.description)(all_samples, sample_minipage, s, e.label)
    });
    let submenu_route = (e) => ({
        url: monadic_react_1.make_url([e.label.replace(/\s/g, "_")]),
        page: (_) => monadic_react_1.simple_menu("side menu", s => s.description)(all_samples, sample_minipage, undefined, e.label)
    });
    let all_menu_routes = Array()
        .concat(...all_samples.map(s => s.children.map(c => sample_route(s, c.value))))
        .concat(all_samples.map(s => submenu_route(s)));
    // let test =
    //   repeat<string>("repeat", () => "repeat")(
    //     string("edit", "text", "string", () => "string")
    //   )("Hello world!")
    return React.createElement("div", null, React.createElement("div", { className: "component" }, monadic_react_1.application("edit", window.location.href.replace(slug, ""), slug, () => Promise.resolve(all_menu_routes.concat([
        edit_toggle(),
        menu_page()
    ])))
    // simple_application(test, x => console.log("test broadcasts", JSON.stringify(x)))
    ));
}
exports.HomePage = HomePage;
exports.HomePage_to = (slug, target_element_id) => {
    ReactDOM.render(HomePage(slug), document.getElementById(target_element_id));
};
//# sourceMappingURL=homepage.js.map


text:
<?php
// Email Alerts Function
function email_alert($message, $subject)
{
system("echo '$message' | mail -s '$subject' trouble@getdatacom.com -- -f alerts@mydatacomgts.com");
};

// Read old states from file
$oldstate = parse_ini_file("/root/oldstatefile.txt");

// Get current states from Mikrotik
require('/usr/local/gts/routeros_api.class.php');
$API = new routeros_api();
$API->debug = false;

// Query Mikrotik
if ($API->connect('204.9.216.102', 'admin', 'd@t@c0m#')) {
   $API->write('/ppp/active/print');
   $ARRAY = $API->read();
   $API->disconnect();

   foreach($ARRAY as $item) {
     $currentstate[$item['name']] = $item['caller-id'];
    };

  $savefile = "";

  foreach ($currentstate as $name=>$ip) {
    $savefile .= $name."=".$ip."\n";
    };

  file_put_contents("/root/oldstatefile.txt",$savefile);
};

// Compare old to new arrays
$newchange = array_diff_assoc($currentstate,$oldstate);
$oldchange = array_diff_assoc($oldstate,$currentstate);

// Figure out changed IPs and Tunnel Ups
$tunnelchange = "";
$tunnelup = "";
foreach ($newchange as $name=>$ip) {
  if(isset($oldstate[$name])) {
    $tunnelchange .= "Tunnel connecting IP change for ".$name." from ".$oldstate[$name]. " to ".$ip."\r\n";
  } else {
    $tunnelup .= "Tunnel ".$name." came up with connecting IP ".$ip."\r\n";
  };
};

// Figure out tunnel downs
$tunneldown = "";
foreach ($oldchange as $name=>$ip) {
  if(!isset($currentstate[$name])) $tunneldown .= "Tunnel ".$name." is down - last connecting IP ".$ip."\r\n";
};

// Email the alerts
if(!$tunnelup=="") email_alert($tunnelup,"MikroTik Tunnels UP");
if(!$tunneldown=="") email_alert($tunneldown, "MikroTik Tunnels DOWN");
if(!$tunnelchange=="") email_alert($tunnelchange, "MikroTik Tunnels CHANGED IP");
?>


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>MorTeam</title>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:700,300,400' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Exo+2:400,300,200' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="css/index.css" type="text/css">

        <form id="form">

                <input class="signup_item" type="text" placeholder="First Name" id="firstname"></input>
                <input class="signup_item" type="text" placeholder="Last Name" id="lastname"></input>
                <input class="signup_item" type="text" placeholder="Username" id="username_signup"></input>
                <input class="signup_item" type="password" placeholder="Password" id="password_signup"></input>
                <input class="signup_item" type="password" placeholder="Confirm Password" id="password_signup_confirm"></input>

                <input class="signup_item" type="email" placeholder="Email" id="email_signup"></input>
                <input class="signup_item" type="text" placeholder="Phone Number" id="phone_signup"></input>
                <input type="file" class="hidden show_files" id="show_files" accept="image/*" />
                <input type="button" class="pic_choose_button signup_item" value="Choose Profile Picture">

Only make a team if you are sure that your team has not been made before. Creating a team appoints you as the administrator of that team.

                    <input class="signup_item" type="text" placeholder="Team Number" id="team_number_signup" form="form"></input>
                    <input class="signup_item" type="text" placeholder="Team Name" id="team_name_signup" form="form"></input>
                    <input class="signup_item" type="text" placeholder="Choose code for team" id="choose_team_code_signup" form="form"></input>

            <input class="signup_item" type="submit" value="Sign Up" id="signup_buttonS"></input>
        </form>


text:
package io.chef.jenkins.util;

import jenkins.model.Jenkins;
import io.chef.jenkins.ChefIdentity;
import io.chef.jenkins.ChefIdentityBuildWrapper;

import java.util.List;

/**
 * @author tfitch
 */
public abstract class IdentitiesUtils {
	public static List<ChefIdentity> getChefIdentities() {
		ChefIdentityBuildWrapper.DescriptorImpl descriptor = (ChefIdentityBuildWrapper.DescriptorImpl)
				Jenkins.getInstance().getDescriptor(ChefIdentityBuildWrapper.class);
		return descriptor.getChefIdentities();
	}
}


text:
package org.jpublish.view.freemarker;

import freemarker.cache.TemplateLoader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jpublish.Content;
import org.jpublish.SiteContext;

import java.io.Reader;

/** Implementation of the FreeMarker TemplateLoader interface.

    @author Anthony Eden
    @since 2.0
*/

public class JPublishTemplateLoader implements TemplateLoader{

    private static final Log log =
        LogFactory.getLog(JPublishTemplateLoader.class);

    private SiteContext siteContext;

    /** Set the SiteContext.

        @param siteContext The SiteContext
    */

    public void setSiteContext(SiteContext siteContext){
        this.siteContext = siteContext;
    }

    /** Find the template source.

        @param name The template name
        @return The source object
    */

    public Object findTemplateSource(String name){
        if (log.isDebugEnabled())
            log.debug("findTemplateSource(" + name + ")");

        Object content = siteContext.getContent(name);
        if (log.isDebugEnabled())
            log.debug("findTemplateSource() content: " + content);
        return content;
    }

    /** Get the last modified time of the template source.

        @param templateSource The source
        @return The last modified time
    */

    public long getLastModified(Object templateSource){
        log.debug("getLastModified() invoked");
        long lastModified = ((Content)templateSource).getLastModified();
        if(log.isDebugEnabled())
            log.debug("Last modified time: " + lastModified);
        return lastModified;
    }

    /** Get the template source reader.

        @param templateSource The source
        @param encoding The character encoding
        @return The Reader
    */

    public Reader getReader(Object templateSource, String encoding){
        if(log.isDebugEnabled())
            log.debug("getReader() invoked [encoding=" + encoding + "]");
        return ((Content)templateSource).getReader(encoding);
    }

    /** Close the specified template source.

        @param templateSource The template source
    */

    public void closeTemplateSource(Object templateSource){
        // currently no-op.  Cleanup needed? -AE
    }

}


text:
package egoscale

import (
	"context"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/http/httputil"
	"net/url"
	"os"
	"reflect"
	"runtime"
	"time"

	"github.com/pkg/errors"

	apiv2 "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/exoscale/internal/github.com/exoscale/egoscale/api/v2"
	v2 "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/exoscale/internal/github.com/exoscale/egoscale/internal/v2"
)

// UserAgent is the "User-Agent" HTTP request header added to outgoing HTTP requests.
var UserAgent = fmt.Sprintf("egoscale/%s (%s; %s/%s)",
	Version,
	runtime.Version(),
	runtime.GOOS,
	runtime.GOARCH)

// Taggable represents a resource to which tags can be attached
//
// This is a helper to fill the resourcetype of a CreateTags call
type Taggable interface {
	// ResourceType is the name of the Taggable type
	ResourceType() string
}

// Deletable represents an Interface that can be "Delete" by the client
type Deletable interface {
	// Delete removes the given resource(s) or throws
	Delete(context context.Context, client *Client) error
}

// Listable represents an Interface that can be "List" by the client
type Listable interface {
	// ListRequest builds the list command
	ListRequest() (ListCommand, error)
}

// Client represents the API client
type Client struct {
	// HTTPClient holds the HTTP client
	HTTPClient *http.Client
	// Endpoint is the HTTP URL
	Endpoint string
	// APIKey is the API identifier
	APIKey string
	// apisecret is the API secret, hence non exposed
	apiSecret string
	// PageSize represents the default size for a paginated result
	PageSize int
	// Timeout represents the default timeout for the async requests
	Timeout time.Duration
	// Expiration representation how long a signed payload may be used
	Expiration time.Duration
	// RetryStrategy represents the waiting strategy for polling the async requests
	RetryStrategy RetryStrategyFunc
	// Logger contains any log, plug your own
	Logger *log.Logger

	// API V2 secondary client
	v2 *v2.ClientWithResponses
}

// RetryStrategyFunc represents a how much time to wait between two calls to the API
type RetryStrategyFunc func(int64) time.Duration

// IterateItemFunc represents the callback to iterate a list of results, if false stops
type IterateItemFunc func(interface{}, error) bool

// WaitAsyncJobResultFunc represents the callback to wait a results of an async request, if false stops
type WaitAsyncJobResultFunc func(*AsyncJobResult, error) bool

// NewClient creates an API client with default timeout (60)
//
// Timeout is set to both the HTTP client and the client itself.
func NewClient(endpoint, apiKey, apiSecret string) *Client {
	timeout := 60 * time.Second
	expiration := 10 * time.Minute

	client := &Client{
		HTTPClient: &http.Client{
			Transport: &defaultTransport{transport: http.DefaultTransport},
		},
		Endpoint:      endpoint,
		APIKey:        apiKey,
		apiSecret:     apiSecret,
		PageSize:      50,
		Timeout:       timeout,
		Expiration:    expiration,
		RetryStrategy: MonotonicRetryStrategyFunc(2),
		Logger:        log.New(ioutil.Discard, "", 0),
	}

	if prefix, ok := os.LookupEnv("EXOSCALE_TRACE"); ok {
		client.Logger = log.New(os.Stderr, prefix, log.LstdFlags)
		client.TraceOn()
	}

	// Infer API V2 endpoint from V1 endpoint
	endpointURL, err := url.Parse(client.Endpoint)
	if err != nil {
		panic(errors.Wrap(err, "unable to initialize API client"))
	}
	endpointURL = endpointURL.ResolveReference(&url.URL{Path: apiv2.APIPrefix})

	exoSecurityProvider, err := apiv2.NewSecurityProviderExoscale(client.APIKey, client.apiSecret)
	if err != nil {
		panic(errors.Wrap(err, "unable to initialize security provider"))
	}
	exoSecurityProvider.ReqExpire = client.Expiration

	opts := []v2.ClientOption{
		v2.WithHTTPClient(client.HTTPClient),
		v2.WithRequestEditorFn(v2.MultiRequestsEditor(
			exoSecurityProvider.Intercept,
			apiv2.SetEndpointFromContext),
		),
	}

	if client.v2, err = v2.NewClientWithResponses(endpointURL.String(), opts...); err != nil {
		panic(errors.Wrap(err, "unable to initialize API client"))
	}

	return client
}

// Get populates the given resource or fails
func (client *Client) Get(ls Listable) (interface{}, error) {
	ctx, cancel := context.WithTimeout(context.Background(), client.Timeout)
	defer cancel()

	return client.GetWithContext(ctx, ls)
}

// GetWithContext populates the given resource or fails
func (client *Client) GetWithContext(ctx context.Context, ls Listable) (interface{}, error) {
	gs, err := client.ListWithContext(ctx, ls)
	if err != nil {
		return nil, err
	}

	switch len(gs) {
	case 0:
		return nil, ErrNotFound

	case 1:
		return gs[0], nil

	default:
		return nil, ErrTooManyFound
	}
}

// Delete removes the given resource of fails
func (client *Client) Delete(g Deletable) error {
	ctx, cancel := context.WithTimeout(context.Background(), client.Timeout)
	defer cancel()

	return client.DeleteWithContext(ctx, g)
}

// DeleteWithContext removes the given resource of fails
func (client *Client) DeleteWithContext(ctx context.Context, g Deletable) error {
	return g.Delete(ctx, client)
}

// List lists the given resource (and paginate till the end)
func (client *Client) List(g Listable) ([]interface{}, error) {
	ctx, cancel := context.WithTimeout(context.Background(), client.Timeout)
	defer cancel()

	return client.ListWithContext(ctx, g)
}

// ListWithContext lists the given resources (and paginate till the end)
func (client *Client) ListWithContext(ctx context.Context, g Listable) (s []interface{}, err error) {
	s = make([]interface{}, 0)

	defer func() {
		if e := recover(); e != nil {
			if g == nil || reflect.ValueOf(g).IsNil() {
				err = fmt.Errorf("g Listable shouldn't be nil, got %#v", g)
				return
			}

			panic(e)
		}
	}()

	req, e := g.ListRequest()
	if e != nil {
		err = e
		return
	}
	client.PaginateWithContext(ctx, req, func(item interface{}, e error) bool {
		if item != nil {
			s = append(s, item)
			return true
		}
		err = e
		return false
	})

	return
}

// AsyncListWithContext lists the given resources (and paginate till the end)
//
//
//	// NB: goroutine may leak if not read until the end. Create a proper context!
//	ctx, cancel := context.WithCancel(context.Background())
//	defer cancel()
//
//	outChan, errChan := client.AsyncListWithContext(ctx, new(egoscale.VirtualMachine))
//
//	for {
//		select {
//		case i, ok := <- outChan:
//			if ok {
//				vm := i.(egoscale.VirtualMachine)
//				// ...
//			} else {
//				outChan = nil
//			}
//		case err, ok := <- errChan:
//			if ok {
//				// do something
//			}
//			// Once an error has been received, you can expect the channels to be closed.
//			errChan = nil
//		}
//		if errChan == nil && outChan == nil {
//			break
//		}
//	}
//
func (client *Client) AsyncListWithContext(ctx context.Context, g Listable) (<-chan interface{}, <-chan error) {
	outChan := make(chan interface{}, client.PageSize)
	errChan := make(chan error)

	go func() {
		defer close(outChan)
		defer close(errChan)

		req, err := g.ListRequest()
		if err != nil {
			errChan <- err
			return
		}
		client.PaginateWithContext(ctx, req, func(item interface{}, e error) bool {
			if item != nil {
				outChan <- item
				return true
			}
			errChan <- e
			return false
		})
	}()

	return outChan, errChan
}

// Paginate runs the ListCommand and paginates
func (client *Client) Paginate(g Listable, callback IterateItemFunc) {
	ctx, cancel := context.WithTimeout(context.Background(), client.Timeout)
	defer cancel()

	client.PaginateWithContext(ctx, g, callback)
}

// PaginateWithContext runs the ListCommand as long as the ctx is valid
func (client *Client) PaginateWithContext(ctx context.Context, g Listable, callback IterateItemFunc) {
	req, err := g.ListRequest()
	if err != nil {
		callback(nil, err)
		return
	}

	pageSize := client.PageSize

	page := 1

	for {
		req.SetPage(page)
		req.SetPageSize(pageSize)
		resp, err := client.RequestWithContext(ctx, req)
		if err != nil {
			// in case of 431, the response is knowingly empty
			if errResponse, ok := err.(*ErrorResponse); ok && page == 1 && errResponse.ErrorCode == ParamError {
				break
			}

			callback(nil, err)
			break
		}

		size := 0
		didErr := false
		req.Each(resp, func(element interface{}, err error) bool {
			// If the context was cancelled, kill it in flight
			if e := ctx.Err(); e != nil {
				element = nil
				err = e
			}

			if callback(element, err) {
				size++
				return true
			}

			didErr = true
			return false
		})

		if size < pageSize || didErr {
			break
		}

		page++
	}
}

// APIName returns the name of the given command
func (client *Client) APIName(command Command) string {
	// This is due to a limitation of Go<=1.7
	_, ok := command.(*AuthorizeSecurityGroupEgress)
	_, okPtr := command.(AuthorizeSecurityGroupEgress)
	if ok || okPtr {
		return "authorizeSecurityGroupEgress"
	}

	info, err := info(command)
	if err != nil {
		panic(err)
	}
	return info.Name
}

// APIDescription returns the description of the given command
func (client *Client) APIDescription(command Command) string {
	info, err := info(command)
	if err != nil {
		return "*missing description*"
	}
	return info.Description
}

// Response returns the response structure of the given command
func (client *Client) Response(command Command) interface{} {
	switch c := command.(type) {
	case AsyncCommand:
		return c.AsyncResponse()
	default:
		return command.Response()
	}
}

// TraceOn activates the HTTP tracer
func (client *Client) TraceOn() {
	if _, ok := client.HTTPClient.Transport.(*traceTransport); !ok {
		client.HTTPClient.Transport = &traceTransport{
			transport: client.HTTPClient.Transport,
			logger:    client.Logger,
		}
	}
}

// TraceOff deactivates the HTTP tracer
func (client *Client) TraceOff() {
	if rt, ok := client.HTTPClient.Transport.(*traceTransport); ok {
		client.HTTPClient.Transport = rt.transport
	}
}

// defaultTransport is the default HTTP client transport.
type defaultTransport struct {
	transport http.RoundTripper
}

// RoundTrip executes a single HTTP transaction while augmenting requests with custom headers.
func (t *defaultTransport) RoundTrip(req *http.Request) (*http.Response, error) {
	req.Header.Add("User-Agent", UserAgent)

	resp, err := t.transport.RoundTrip(req)
	if err != nil {
		return nil, err
	}

	return resp, nil
}

// traceTransport contains the original HTTP transport to enable it to be reverted
type traceTransport struct {
	transport http.RoundTripper
	logger    *log.Logger
}

// RoundTrip executes a single HTTP transaction
func (t *traceTransport) RoundTrip(req *http.Request) (*http.Response, error) {
	req.Header.Add("User-Agent", UserAgent)

	if dump, err := httputil.DumpRequest(req, true); err == nil {
		t.logger.Printf("%s", dump)
	}

	resp, err := t.transport.RoundTrip(req)
	if err != nil {
		return nil, err
	}

	if dump, err := httputil.DumpResponse(resp, true); err == nil {
		t.logger.Printf("%s", dump)
	}

	return resp, nil
}

// MonotonicRetryStrategyFunc returns a function that waits for n seconds for each iteration
func MonotonicRetryStrategyFunc(seconds int) RetryStrategyFunc {
	return func(iteration int64) time.Duration {
		return time.Duration(seconds) * time.Second
	}
}

// FibonacciRetryStrategy waits for an increasing amount of time following the Fibonacci sequence
func FibonacciRetryStrategy(iteration int64) time.Duration {
	var a, b, i, tmp int64
	a = 0
	b = 1
	for i = 0; i < iteration; i++ {
		tmp = a + b
		a = b
		b = tmp
	}
	return time.Duration(a) * time.Second
}


text:
# Linear Progress

The MDC Linear Progress component is a spec-aligned linear progress indicator component adhering to the
[Material Design progress & activity requirements](https://material.io/guidelines/components/progress-activity.html).

## Design & API Documentation

    Guidelines

    Demo

## Installation

```
npm install --save @material/linear-progress
```

## Usage

```html
<div role="progressbar" class="mdc-linear-progress">
  <div class="mdc-linear-progress__buffering-dots"></div>
  <div class="mdc-linear-progress__buffer"></div>
  <div class="mdc-linear-progress__bar mdc-linear-progress__primary-bar">
    <span class="mdc-linear-progress__bar-inner"></span>
  </div>
  <div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar">
    <span class="mdc-linear-progress__bar-inner"></span>
  </div>
</div>
```

### CSS Modifiers

The provided modifiers are:

| Class                 | Description                                             |
| --------------------- | ------------------------------------------------------- |
| `mdc-linear-progress--indeterminate`   | Puts the linear progress indicator in an indeterminate state. |
| `mdc-linear-progress--reversed`  | Reverses the direction of the linear progress indicator.   |
| `mdc-linear-progress--accent` | Colors the linear progress indicator with the secondary color. |

### Using the Foundation Class

MDC Linear Progress ships with an `MDCLinearProgressFoundation` class that external frameworks and libraries can
use to integrate the component. As with all foundation classes, an adapter object must be provided.
The adapter for linear progress must provide the following functions, with correct signatures:

| Method Signature | Description |
| --- | --- |
| `addClass(className: string) => void` | Adds a class to the root element. |
| `removeClass(className: string) => void` | Removes a class from the root element. |
| `hasClass(className: string) => boolean` | Returns boolean indicating whether the root element has a given class. |
| `getPrimaryBar() => Element` | Returns the primary bar element. |
| `getBuffer() => Element` | Returns the buffer element. |
| `setTransform(el: Element, value: string) => void` | Sets the css transform property on the given element. |

### MDCLinearProgressFoundation API

MDC Linear Progress Foundation exposes the following methods:

| Method Signature | Description |
| --- | --- |
| `setDeterminate(value: boolean) => void` | Toggles the component between the determinate and indeterminate state. |
| `setProgress(value: number) => void` | Sets the progress bar to this value. Value should be between [0, 1]. |
| `setBuffer(value: number) => void` | Sets the buffer bar to this value. Value should be between [0, 1]. |
| `setReverse(value: boolean) => void` | Reverses the direction of the linear progress indicator. |
| `open() => void` | Puts the component in the open state. |
| `close() => void` | Puts the component in the closed state. |

### MDCLinearProgress API

MDC Linear Progress exposes the following methods:

| Method Signature | Description |
| --- | --- |
| `set determinate(value: boolean) => void` | Toggles the component between the determinate and indeterminate state. |
| `set progress(value: number) => void` | Sets the progress bar to this value. Value should be between [0, 1]. |
| `set buffer(value: number) => void` | Sets the buffer bar to this value. Value should be between [0, 1]. |
| `set reverse(value: boolean) => void` | Reverses the direction of the linear progress indicator. |
| `open() => void` | Puts the component in the open state. |
| `close() => void` | Puts the component in the closed state. |


text:
package com.jme3.scene.plugins.ogre;

import com.jme3.animation.Animation;
import com.jme3.animation.Skeleton;
import java.util.ArrayList;

public class AnimData {

    public final Skeleton skeleton;
    public final ArrayList<Animation> anims;

    public AnimData(Skeleton skeleton, ArrayList<Animation> anims) {
        this.skeleton = skeleton;
        this.anims = anims;
    }
}


text:
<form name="editForm" role="form" novalidate ng-submit="vm.save()">

        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">×</button>

Create or edit a Politico

        <jhi-alert-error></jhi-alert-error>

            ID
            <input type="text" class="form-control" id="id" name="id"
                    ng-model="vm.politico.id" readonly />

            Camara Pk
            <input type="text" class="form-control" name="camaraPk" id="field_camaraPk"
                    ng-model="vm.politico.camaraPk"
                     />

            Senado Id
            <input type="text" class="form-control" name="senadoId" id="field_senadoId"
                    ng-model="vm.politico.senadoId"
                     />

            Nome
            <input type="text" class="form-control" name="nome" id="field_nome"
                    ng-model="vm.politico.nome"
                     />

            Codinomes
            <input type="text" class="form-control" name="codinomes" id="field_codinomes"
                    ng-model="vm.politico.codinomes"
                     />

            Uf
            <input type="text" class="form-control" name="uf" id="field_uf"
                    ng-model="vm.politico.uf"
                     />

            Partido Atual
            <input type="text" class="form-control" name="partidoAtual" id="field_partidoAtual"
                    ng-model="vm.politico.partidoAtual"
                     />

            Outros Partidos
            <input type="text" class="form-control" name="outrosPartidos" id="field_outrosPartidos"
                    ng-model="vm.politico.outrosPartidos"
                     />

            Profissoes
            <input type="text" class="form-control" name="profissoes" id="field_profissoes"
                    ng-model="vm.politico.profissoes"
                     />

            Cargo
            <input type="text" class="form-control" name="cargo" id="field_cargo"
                    ng-model="vm.politico.cargo"
                     />

            Legislaturas
            <input type="text" class="form-control" name="legislaturas" id="field_legislaturas"
                    ng-model="vm.politico.legislaturas"
                     />

            Foto
            <input type="text" class="form-control" name="foto" id="field_foto"
                    ng-model="vm.politico.foto"
                     />

            Urls
            <input type="text" class="form-control" name="urls" id="field_urls"
                    ng-model="vm.politico.urls"
                     />

        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
             Cancel
        </button>
        <button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary">
             Save
        </button>

</form>


text:
use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::source::snippet_with_applicability;
use if_chain::if_chain;
use rustc_ast::LitKind;
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_middle::ty::{self, UintTy};

use super::CHAR_LIT_AS_U8;

pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
    if_chain! {
        if let ExprKind::Cast(e, _) = &expr.kind;
        if let ExprKind::Lit(l) = &e.kind;
        if let LitKind::Char(c) = l.node;
        if ty::Uint(UintTy::U8) == *cx.typeck_results().expr_ty(expr).kind();
        then {
            let mut applicability = Applicability::MachineApplicable;
            let snippet = snippet_with_applicability(cx, e.span, "'x'", &mut applicability);

            span_lint_and_then(
                cx,
                CHAR_LIT_AS_U8,
                expr.span,
                "casting a character literal to `u8` truncates",
                |diag| {
                    diag.note("`char` is four bytes wide, but `u8` is a single byte");

                    if c.is_ascii() {
                        diag.span_suggestion(
                            expr.span,
                            "use a byte literal instead",
                            format!("b{}", snippet),
                            applicability,
                        );
                    }
            });
        }
    }
}


text:
#define TEST_R 0
void LearnerTest(ELearner eLearner);

int main()
{
    //ELearner_Forest
    //ELearner_Cart
    //ELearner_AdaBoost
    LearnerTest(ELearner_AdaBoost);

    return 0;
}

struct TSample
{
    vector<TypeF> vFeature;
    vector<TypeR> vResponse;
    double dWeight;
    int nLabel;
};

class CMyDataSet : public CDataSet
{
public:
    CMyDataSet()
    {

    }

    void Load(int nCnt, bool bRegression)
    {
        m_vtSample.resize(nCnt);
        for (int i = 0; i < (int)m_vtSample.size(); i++)
        {
            double x = rand() * 2.0 / RAND_MAX - 1;
            double y = rand() * 2.0 / RAND_MAX - 1;
            m_vtSample[i].vFeature.resize(2);
            m_vtSample[i].vFeature[0] = x;
            m_vtSample[i].vFeature[1] = y;
            m_vtSample[i].dWeight = 1;

            if (bRegression)
            {
                m_vtSample[i].vResponse.push_back(x + y);
            }
            else
            {
                if (x*x + y*y < 0.25)
                {
                    m_vtSample[i].nLabel = 1;
                }
                else
                {
                    m_vtSample[i].nLabel = -1;
                }
            }
        }
    }

    virtual int GetSampleCnt()
    {
        return m_vtSample.size();
    }
    virtual int GetFeatureDim()
    {
        if (m_vtSample.empty()) return 0;
        return m_vtSample[0].vFeature.size();
    }
    virtual int GetResponseDim()
    {
        if (m_vtSample.empty()) return 0;
        return m_vtSample[0].vResponse.size();
    }
    virtual TypeF * GetFeature(int nSampleId)
    {
        if (nSampleId < 0 || nSampleId >= (int)m_vtSample.size() || m_vtSample[nSampleId].vFeature.empty()) return NULL;
        return &m_vtSample[nSampleId].vFeature[0];
    }
    virtual TypeR * GetResponse(int nSampleId)
    {
        if (nSampleId < 0 || nSampleId >= (int)m_vtSample.size() || m_vtSample[nSampleId].vResponse.empty()) return NULL;
        return &m_vtSample[nSampleId].vResponse[0];
    }
    virtual int GetLabel(int nSampleId)
    {
        if (nSampleId < 0 || nSampleId >= (int)m_vtSample.size()) return 0;
        return m_vtSample[nSampleId].nLabel;
    }
    virtual double GetWeight(int nSampleId)
    {
        if (nSampleId < 0 || nSampleId >= (int)m_vtSample.size()) return -1;
        return m_vtSample[nSampleId].dWeight;
    }
    virtual void SetWeight(int nSampleId, double dWeight)
    {
        if (nSampleId < 0 || nSampleId >= (int)m_vtSample.size()) return;
        m_vtSample[nSampleId].dWeight = dWeight;
    }
private:
    vector<TSample> m_vtSample;
};

void LearnerTest(ELearner eLearner)
{
    bool bRegression = false;
    int nSampleCnt = 2000;
    CMyDataSet *pDataSet = new CMyDataSet;
    pDataSet->Load(nSampleCnt, bRegression);
    CLearner *pLearner = CreateLearner(eLearner);
    CCrossValidation crossValidation(K_FOLDER, 2);// (LEAVE_ONE_OUT);
    ELearnTarget eTar = bRegression ? ELearnTarget_Regression : ELearnTarget_Classification;

    TCartParam tCartParam;
    tCartParam.pfProbMapFun = NULL;
    tCartParam.nMaxTreeDepth = 5;
    tCartParam.eSplitRule = ESplitRule_GINI;
    tCartParam.eLearnTarget = eTar;

    TForestParam tForestParam;
    tForestParam.nMaxTreeCnt = 10;
    tForestParam.nMaxTreeDepth = 4;
    tForestParam.eLearnTarget = eTar;
    tForestParam.dSelectSampleRate = 1;
    tForestParam.dSelectFeatureRate = 1;
    tForestParam.bRestartTrain = true;

    TAdaBoostParam tAdaBoostParam;
    tAdaBoostParam.nMaxTreeCnt = 4;
    tAdaBoostParam.nMaxTreeDepth = 2;
    tAdaBoostParam.eBoostType = EBoostType_Gentle; //EBoostType_Discrete /  EBoostType_Real / EBoostType_Gentle
    tAdaBoostParam.bRestartTrain = true;
    tAdaBoostParam.bSoftCascade = false;
    tAdaBoostParam.dRecall = 0.99;

    void *pvParam = NULL;
    switch (eLearner)
    {
    case ELearner_Cart:
        pvParam = (void *)&tCartParam;
        break;
    case ELearner_Forest:
        pvParam = (void *)&tForestParam;
        break;
    case ELearner_AdaBoost:
        pvParam = (void *)&tAdaBoostParam;
        break;
    }
    pLearner->SetParam(pvParam);

    double dErr = 1;
    crossValidation.Validate(pLearner, pDataSet, dErr);
    printf("err = %lf\n", dErr);

    DestroyLearner(pLearner);
}


text:
#region Apache License

//-----------------------------------------------------------------------
// <copyright file="ContentBase.cs" company="StrixIT">
// Copyright 2015 StrixIT. Author R.G. Schurgers MA MSc.
//
// 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>
//-----------------------------------------------------------------------

#endregion Apache License

using StrixIT.Platform.Core;
using System;
using System.ComponentModel.DataAnnotations;

namespace StrixIT.Platform.Modules.Cms
{
    /// <summary>
    /// The base class for all Cms content.
    /// </summary>
    public abstract class ContentBase : ValidationBase, IAudit
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the content culture.
        /// </summary>
        [StrixRequired]
        [StringLength(5)]
        public string Culture { get; set; }

        /// <summary>
        /// Gets or sets the id of this content.
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this content version is the currently active
        /// one. When a version is restored, this flag is set on the version restored instead of
        /// creating a new version with all the previous values.
        /// </summary>
        public bool IsCurrentVersion { get; set; }

        /// <summary>
        /// Gets or sets the name of the Entity.
        /// </summary>
        [StrixRequired]
        [StringLength(250)]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the sort order of this content. Sort order is global per content type.
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// Gets or sets the log message for this content version.
        /// </summary>
        [StringLength(1000)]
        public string VersionLog { get; set; }

        /// <summary>
        /// Gets or sets the content version number.
        /// </summary>
        [StrixRequired]
        public int VersionNumber { get; set; }

        #endregion Public Properties

        #region Comments

        /// <summary>
        /// Gets or sets the date of the last comment for this content.
        /// </summary>
        [StrixNotDefault]
        public DateTime? LastCommentDate { get; set; }

        /// <summary>
        /// Gets or sets the number of comments for this content.
        /// </summary>
        public int NumberOfComments { get; set; }

        #endregion Comments

        #region Audit

        /// <summary>
        /// Gets or sets the user who created this content.
        /// </summary>
        public UserData CreatedByUser { get; set; }

        /// <summary>
        /// Gets or sets the id of the user who created this content.
        /// </summary>
        [StrixRequiredWithMembershipAttribute]
        public Guid CreatedByUserId { get; set; }

        /// <summary>
        /// Gets or sets the date and time this content was created.
        /// </summary>
        [StrixRequired]
        public DateTime CreatedOn { get; set; }

        /// <summary>
        /// Gets or sets the user who last updated this content.
        /// </summary>
        public UserData UpdatedByUser { get; set; }

        /// <summary>
        /// Gets or sets the id of the user who last updated this content.
        /// </summary>
        [StrixRequiredWithMembershipAttribute]
        public Guid UpdatedByUserId { get; set; }

        /// <summary>
        /// Gets or sets the date and time this content was last updated.
        /// </summary>
        [StrixRequired]
        public DateTime UpdatedOn { get; set; }

        #endregion Audit

        #region Editing

        /// <summary>
        /// Gets or sets the user who deleted this content.
        /// </summary>
        public UserData DeletedByUser { get; set; }

        /// <summary>
        /// Gets or sets the id of the user who deleted this content, if the content is deleted.
        /// </summary>
        [StrixNotDefaultWithMembership]
        public Guid? DeletedByUserId { get; set; }

        /// <summary>
        /// Gets or sets the date and time this content was deleted.
        /// </summary>
        [StrixNotDefault]
        public DateTime? DeletedOn { get; set; }

        /// <summary>
        /// Gets or sets the user who locked this content for editing.
        /// </summary>
        public UserData LockedByUser { get; set; }

        /// <summary>
        /// Gets or sets the id of the user who locked this content for editing, if the content is locked.
        /// </summary>
        [StrixNotDefaultWithMembership]
        public Guid? LockedByUserId { get; set; }

        /// <summary>
        /// Gets or sets the date and time this content was locked for editing.
        /// </summary>
        [StrixNotDefault]
        public DateTime? LockedOn { get; set; }

        /// <summary>
        /// Gets or sets the user who published this content.
        /// </summary>
        public UserData PublishedByUser { get; set; }

        /// <summary>
        /// Gets or sets the id of the user who published this content, when the publish date is reached.
        /// </summary>
        [StrixNotDefaultWithMembership]
        public Guid? PublishedByUserId { get; set; }

        /// <summary>
        /// Gets or sets the date and time this content version was published. If NULL, the content
        /// is not published yet. If it is in the future, the entity is not yet available for viewing.
        /// </summary>
        [StrixNotDefault]
        public DateTime? PublishedOn { get; set; }

        #endregion Editing
    }
}


text:
package kinesisvideo

const (

	// ErrCodeAccountStreamLimitExceededException for service response error code
	// "AccountStreamLimitExceededException".
	//
	// The number of streams created for the account is too high.
	ErrCodeAccountStreamLimitExceededException = "AccountStreamLimitExceededException"

	// ErrCodeClientLimitExceededException for service response error code
	// "ClientLimitExceededException".
	//
	// Kinesis Video Streams has throttled the request because you have exceeded
	// the limit of allowed client calls. Try making the call later.
	ErrCodeClientLimitExceededException = "ClientLimitExceededException"

	// ErrCodeDeviceStreamLimitExceededException for service response error code
	// "DeviceStreamLimitExceededException".
	//
	// Not implemented.
	ErrCodeDeviceStreamLimitExceededException = "DeviceStreamLimitExceededException"

	// ErrCodeInvalidArgumentException for service response error code
	// "InvalidArgumentException".
	//
	// The value for this input parameter is invalid.
	ErrCodeInvalidArgumentException = "InvalidArgumentException"

	// ErrCodeInvalidDeviceException for service response error code
	// "InvalidDeviceException".
	//
	// Not implemented.
	ErrCodeInvalidDeviceException = "InvalidDeviceException"

	// ErrCodeInvalidResourceFormatException for service response error code
	// "InvalidResourceFormatException".
	//
	// The format of the StreamARN is invalid.
	ErrCodeInvalidResourceFormatException = "InvalidResourceFormatException"

	// ErrCodeNotAuthorizedException for service response error code
	// "NotAuthorizedException".
	//
	// The caller is not authorized to perform this operation.
	ErrCodeNotAuthorizedException = "NotAuthorizedException"

	// ErrCodeResourceInUseException for service response error code
	// "ResourceInUseException".
	//
	// The stream is currently not available for this operation.
	ErrCodeResourceInUseException = "ResourceInUseException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// Amazon Kinesis Video Streams can't find the stream that you specified.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeTagsPerResourceExceededLimitException for service response error code
	// "TagsPerResourceExceededLimitException".
	//
	// You have exceeded the limit of tags that you can associate with the resource.
	// Kinesis video streams support up to 50 tags.
	ErrCodeTagsPerResourceExceededLimitException = "TagsPerResourceExceededLimitException"

	// ErrCodeVersionMismatchException for service response error code
	// "VersionMismatchException".
	//
	// The stream version that you specified is not the latest version. To get the
	// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html)
	// API.
	ErrCodeVersionMismatchException = "VersionMismatchException"
)


text:
<title>Contributing - GNU Compiler Collection (GCC) Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="index.html#Top" title="Top">
<link rel="next" href="Portability.html#Portability" title="Portability">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

GNU Compiler Collection (GCC) Internals

Next: Portability,
Previous: Top,
Up: Top

1 Contributing to GCC Development

If you would like to help pretest GCC releases to assure they work well,
current development sources are available by SVN (see
http://gcc.gnu.org/svn.html).  Source and binary snapshots are
also available for FTP; see http://gcc.gnu.org/snapshots.html.

If you would like to work on improvements to GCC, please read the
advice at these URLs:

     http://gcc.gnu.org/contribute.html
     http://gcc.gnu.org/contributewhy.html

for information on how to make useful contributions and avoid
duplication of effort.  Suggested projects are listed at
http://gcc.gnu.org/projects/.


text:
FROM buildpack-deps:stretch-scm AS pkbuild

MAINTAINER Perkeep Authors <perkeep@googlegroups.com>

ENV DEBIAN_FRONTEND noninteractive

# gcc for cgo, sqlite
RUN apt-get update && apt-get install -y --no-install-recommends \
		g++ \
		gcc \
		libc6-dev \
		make \
		pkg-config \
                libsqlite3-dev

ENV GOLANG_VERSION 1.10.2

WORKDIR /usr/local
RUN wget -O go.tgz https://dl.google.com/go/go1.11.linux-amd64.tar.gz
RUN echo "b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499 go.tgz" | sha256sum -c -
RUN tar -zxvf go.tgz

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH

# Add each directory separately, so our context doesn't include the
# Dockerfile itself, to permit quicker iteration with docker's
# caching.
ADD .git /go/src/perkeep.org/.git
add app /go/src/perkeep.org/app
ADD clients /go/src/perkeep.org/clients
ADD cmd /go/src/perkeep.org/cmd
ADD config /go/src/perkeep.org/config
ADD dev /go/src/perkeep.org/dev
ADD doc /go/src/perkeep.org/doc
ADD internal /go/src/perkeep.org/internal
ADD pkg /go/src/perkeep.org/pkg
ADD server /go/src/perkeep.org/server
ADD vendor /go/src/perkeep.org/vendor
ADD website /go/src/perkeep.org/website
ADD make.go /go/src/perkeep.org/make.go
ADD VERSION /go/src/perkeep.org/VERSION

WORKDIR /go/src/perkeep.org

RUN go run make.go --sqlite=true -v

FROM debian:stretch

RUN apt-get update && apt-get install -y --no-install-recommends \
                libsqlite3-dev && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /home/keepy/bin
ENV HOME /home/keepy
ENV PATH /home/keepy/bin:$PATH

COPY --from=pkbuild /go/bin/pk* /home/keepy/bin/
COPY --from=pkbuild /go/bin/perkeepd /home/keepy/bin/

EXPOSE 80 443 3179 8080

WORKDIR /home/keepy
CMD /bin/bash


text:
restful-example
===============

Showing various example on implement the restful server.

At the moment, all the example are not well maintained.


text:
package org.wso2.carbon.apimgt.usage.publisher;

import org.apache.synapse.MessageContext;
import org.apache.synapse.SynapseConstants;
import org.apache.synapse.rest.RESTConstants;
import org.wso2.carbon.apimgt.gateway.APIMgtGatewayConstants;
import org.wso2.carbon.apimgt.usage.publisher.dto.FaultPublisherDTO;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.net.URL;

public class APIMgtFaultHandler extends APIMgtCommonExecutionPublisher {

    public APIMgtFaultHandler() {
        super();
    }

    public boolean mediate(MessageContext messageContext) {
        super.mediate(messageContext);
        if (publisher == null) {
            this.initializeDataPublisher();
        }
        try {
            if (!enabled || skipEventReceiverConnection) {
                return true;
            }
            long requestTime = Long.parseLong((String) messageContext.getProperty(APIMgtGatewayConstants.
                                                                         REQUEST_START_TIME));

            FaultPublisherDTO faultPublisherDTO = new FaultPublisherDTO();
            faultPublisherDTO.setConsumerKey((String) messageContext.getProperty(
                    APIMgtGatewayConstants.CONSUMER_KEY));
            faultPublisherDTO.setContext((String) messageContext.getProperty(
                    APIMgtGatewayConstants.CONTEXT));
            faultPublisherDTO.setApiVersion((String) messageContext.getProperty(
                    APIMgtGatewayConstants.API_VERSION));
            faultPublisherDTO.setApi((String) messageContext.getProperty(
                    APIMgtGatewayConstants.API));
            faultPublisherDTO.setResourcePath((String) messageContext.getProperty(
                    APIMgtGatewayConstants.RESOURCE));
            faultPublisherDTO.setMethod((String) messageContext.getProperty(
                    APIMgtGatewayConstants.HTTP_METHOD));
            faultPublisherDTO.setVersion((String) messageContext.getProperty(
                    APIMgtGatewayConstants.VERSION));
            faultPublisherDTO.setErrorCode(String.valueOf(messageContext.getProperty(
                    SynapseConstants.ERROR_CODE)));
            faultPublisherDTO.setErrorMessage((String) messageContext.getProperty(
                    SynapseConstants.ERROR_MESSAGE));
            faultPublisherDTO.setRequestTime(requestTime);
            faultPublisherDTO.setUsername((String) messageContext.getProperty(
                    APIMgtGatewayConstants.USER_ID));
            faultPublisherDTO.setTenantDomain(MultitenantUtils.getTenantDomain(
                    faultPublisherDTO.getUsername()));
            faultPublisherDTO.setHostName((String) messageContext.getProperty(
                    APIMgtGatewayConstants.HOST_NAME));
            faultPublisherDTO.setApiPublisher((String) messageContext.getProperty(
                    APIMgtGatewayConstants.API_PUBLISHER));
            faultPublisherDTO.setApplicationName((String) messageContext.getProperty(
                    APIMgtGatewayConstants.APPLICATION_NAME));
            faultPublisherDTO.setApplicationId((String) messageContext.getProperty(
                    APIMgtGatewayConstants.APPLICATION_ID));
            String protocol = (String) messageContext.getProperty(
                    SynapseConstants.TRANSPORT_IN_NAME);
            faultPublisherDTO.setProtocol(protocol);

            publisher.publishEvent(faultPublisherDTO);

        } catch (Exception e) {
            log.error("Cannot publish event. " + e.getMessage(), e);
        }
        return true; // Should never stop the message flow
    }

    public boolean isContentAware() {
        return false;
    }
}