text:
CREATE TABLE prumo_config
(
  config_name VARCHAR(40) NOT NULL,
  config_value VARCHAR(255),
  CONSTRAINT config_pkey PRIMARY KEY (config_name)
);

CREATE TABLE prumo_syslogin
(
  username VARCHAR(30) NOT NULL,
  fullname VARCHAR(50) NOT NULL,
  password VARCHAR(120),
  enabled VARCHAR(1) NOT NULL DEFAULT 't',
  CONSTRAINT syslogin_pkey PRIMARY KEY (username)
);

CREATE TABLE prumo_groups
(
  enabled VARCHAR(1) NOT NULL DEFAULT 't',
  groupname VARCHAR(30) NOT NULL,
  CONSTRAINT groups_pkey PRIMARY KEY (groupname)
);

CREATE TABLE prumo_groups_syslogin
(
  groupname VARCHAR(30) NOT NULL,
  username VARCHAR(30) NOT NULL,
  CONSTRAINT groups_syslogin_pkey PRIMARY KEY (groupname, username)
);

CREATE TABLE prumo_routines
(
  routine VARCHAR(40) NOT NULL,
  enabled VARCHAR(1) NOT NULL DEFAULT 't',
  audit VARCHAR(1) NOT NULL DEFAULT 't',
  link VARCHAR(255),
  description text,
  menu_parent VARCHAR(40),
  menu_label VARCHAR(40),
  menu_icon VARCHAR(255),
  type VARCHAR(40),
  CONSTRAINT routines_pkey PRIMARY KEY (routine)
);

CREATE TABLE prumo_routines_groups
(
  routine VARCHAR(40) NOT NULL,
  groupname VARCHAR(40) NOT NULL,
  c VARCHAR(1) NOT NULL DEFAULT 'f',
  r VARCHAR(1) NOT NULL DEFAULT 'f',
  u VARCHAR(1) NOT NULL DEFAULT 'f',
  d VARCHAR(1) NOT NULL DEFAULT 'f',
  CONSTRAINT routines_groups_pkey PRIMARY KEY (routine, groupname),
  CONSTRAINT routines_groups_routine_fkey FOREIGN KEY (routine)
      REFERENCES prumo_routines (routine) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE TABLE prumo_acess_denied
(
  id integer PRIMARY KEY AUTOINCREMENT,
  username VARCHAR(30) NOT NULL,
  routine VARCHAR(40) NOT NULL,
  permission VARCHAR(10) NOT NULL,
  date_time DATETIME DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT acess_denied_routine_fkey FOREIGN KEY (routine)
      REFERENCES prumo_routines (routine) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE,
  CONSTRAINT acess_denied_username_fkey FOREIGN KEY (username)
      REFERENCES prumo_syslogin (username) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE TABLE prumo_log_sql
(
  log_serial integer PRIMARY KEY AUTOINCREMENT,
  log_timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
  log_obj_name VARCHAR(100) NOT NULL,
  usr_login VARCHAR(40),
  log_prumo_method VARCHAR(40) NOT NULL,
  log_statement text NOT NULL,
  routine VARCHAR(40),
  CONSTRAINT log_sql_routine_fkey FOREIGN KEY (routine)
      REFERENCES prumo_routines (routine) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE SET NULL,
  CONSTRAINT log_sql_usr_login_fkey FOREIGN KEY (usr_login)
      REFERENCES prumo_syslogin (username) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE TABLE prumo_update_framework
(
   file_name VARCHAR(100) NOT NULL,
   usr_login VARCHAR(40),
   date_time DATETIME DEFAULT CURRENT_TIMESTAMP,
   PRIMARY KEY (file_name)
);

CREATE TABLE prumo_reminder
(
	id integer PRIMARY KEY AUTOINCREMENT,
	event VARCHAR(30) NOT NULL,
	description VARCHAR NOT NULL,
	reminder_date DATE NOT NULL,
	repeat_every integer,
	repeat_interval VARCHAR(10),
	username VARCHAR(30),
	last_seen DATE NOT NULL DEFAULT CURRENT_DATE,
	FOREIGN KEY (username) REFERENCES prumo_syslogin (username) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE TABLE prumo_active_reminder
(
	id integer PRIMARY KEY NOT NULL,
	show_at DATETIME NOT NULL,
	FOREIGN KEY (id) REFERENCES prumo_reminder (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE
);

INSERT INTO prumo_routines (routine,enabled,audit,type) VALUES ('prumo_reminders','t','f','view');
UPDATE prumo_routines SET routine='prumo_reminders',link='prumo/view_reminder.php',description=NULL,menu_parent='prumo_system',menu_label='Lembretes',menu_icon='prumo/images/icons/reminder.png' WHERE routine='prumo_reminders';
INSERT INTO prumo_routines_groups (routine,groupname,c,r,u,d) VALUES ('prumo_reminders','sysadmin','t','t','t','t');

INSERT INTO prumo_routines (routine, enabled, type, menu_label, menu_icon, audit) VALUES ('prumo_system', 't', 'root_menu', 'SISTEMA', 'prumo/images/icons/example.png', 'f');
INSERT INTO prumo_routines (routine, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_access_control', 't', 'root_menu', 'prumo_system', 'Controle de Acesso', 'prumo/images/icons/example.png', 'f');

INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_groups',         'prumo/view_groups.php',          't', 'view', 'prumo_access_control', 'Grupos de Usuários',   'prumo/images/icons/users.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_controlPanel',   'prumo/view_control_panel.php',   't', 'view', 'prumo_system',         'Painel de Controle',   'prumo/images/icons/system.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_changePassword', 'prumo/view_change_password.php', 't', 'view', 'prumo_system',         'Alterar Senha',        'prumo/images/icons/key.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_about',          'prumo/view_about.php',           't', 'view', 'prumo_system',         'Sobre o Prumo',        'prumo/images/icons/exclamation.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_users',          'prumo/view_users.php',           't', 'view', 'prumo_access_control', 'Usuários',             'prumo/images/icons/users.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_routines',       'prumo/view_routines.php',        't', 'view', 'prumo_access_control', 'Rotinas e permissões', 'prumo/images/icons/users.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_submission',     'prumo/view_submission.php',      't', 'view', 'prumo_system',         'Instruções iniciais',  'prumo/images/icons/exclamation.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_update',         'prumo/view_update.php',          't', 'view', 'prumo_system',         'Atualização',          'prumo/images/icons/system.png', 'f');
INSERT INTO prumo_routines (routine, link, enabled, type, menu_parent, menu_label, menu_icon, audit) VALUES ('prumo_devtools',       'prumo/ctrl_devtools.php',        't', 'view', 'prumo_system',         'Desenvolvimento',      'prumo/images/icons/system.png', 'f');

INSERT INTO prumo_syslogin(username, fullname, "password") VALUES ('admin', 'Administrador do sistema', '$argon2id$v=19$m=65536,t=2,p=1$Rul0StMsJYFfy/LJuWn8aw$crsoRO623LuQFT7ZcgRcLrFWJbMT/E27eNzl8yVp33A');

INSERT INTO prumo_groups(enabled, groupname) VALUES ('t', 'sysadmin');
INSERT INTO prumo_groups(enabled, groupname) VALUES ('t', 'dev');
INSERT INTO prumo_groups_syslogin(groupname, username) VALUES ('sysadmin', 'admin');
INSERT INTO prumo_groups_syslogin(groupname, username) VALUES ('dev', 'admin');

INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_groups', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_controlPanel', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_changePassword', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_about', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_system', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_users', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_routines', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_submission', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_access_control', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_update', 'sysadmin', 't', 't', 't', 't');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_devtools', 'dev', 't', 't', 't', 't');

INSERT INTO prumo_groups(enabled, groupname) VALUES ('t', 'change_password');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_system', 'change_password', 'f', 't', 'f', 'f');
INSERT INTO prumo_routines_groups(routine, groupname, c, r, u, d) VALUES ('prumo_changePassword', 'change_password', 'f', 't', 't', 'f');

CREATE VIEW prumo_v_menu AS
SELECT routine,tree,type FROM
(
	SELECT
		routine,
		CASE
			WHEN level2='_' THEN level1
			WHEN level3='_' THEN level1||' > '||level2
			WHEN level4='_' THEN level1||' > '||level2||' > '||level3
			WHEN level5='_' THEN level1||' > '||level2||' > '||level3||' > '||level4
			ELSE level1||' > '||level2||' > '||level3||' > '||level4||' > '||level5
		END as tree,
		type
	FROM
	(
		SELECT
			routine,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m5.menu_parent)))) as level1,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m5.menu_parent))) as level2,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m5.menu_parent)) as level3,
			(SELECT menu_label FROM prumo_routines WHERE routine=m5.menu_parent) as level4,
			menu_label as level5,
			5 as nivel,
			type
		FROM prumo_routines m5
		WHERE m5.routine IN (
			--level5
			SELECT routine FROM prumo_routines WHERE menu_parent IN (
				--level4
				SELECT routine FROM prumo_routines WHERE menu_parent IN (
					--level3
					SELECT routine FROM prumo_routines WHERE menu_parent IN (
						--level2
						SELECT routine FROM prumo_routines WHERE menu_parent IN (
							--level1
							SELECT routine FROM prumo_routines WHERE menu_parent IS NULL
						)
					)
				)
			)
		)

		UNION

		SELECT
			routine,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m4.menu_parent))) as level1,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m4.menu_parent)) as level2,
			(SELECT menu_label FROM prumo_routines WHERE routine=m4.menu_parent) as level3,
			menu_label as level4,
			CAST('_' as TEXT) as level5,
			4 as nivel,
			type
		FROM prumo_routines m4
		WHERE m4.routine IN (
			--level4
			SELECT routine FROM prumo_routines WHERE menu_parent IN (
				--level3
				SELECT routine FROM prumo_routines WHERE menu_parent IN (
					--level2
					SELECT routine FROM prumo_routines WHERE menu_parent IN (
						--level1
						SELECT routine FROM prumo_routines WHERE menu_parent IS NULL
					)
				)
			)
		)

		UNION

		SELECT
			routine,
			(SELECT menu_label FROM prumo_routines WHERE routine=(SELECT menu_parent FROM prumo_routines WHERE routine=m3.menu_parent)) as level1,
			(SELECT menu_label FROM prumo_routines WHERE routine=m3.menu_parent) as level2,
			menu_label as level3,
			CAST('_' as TEXT) as level4,
			CAST(NULL as TEXT) as level5,
			3 as nivel,
			type
		FROM prumo_routines m3
		WHERE m3.routine IN (
			--level3
			SELECT routine FROM prumo_routines WHERE menu_parent IN (
				--level2
				SELECT routine FROM prumo_routines WHERE menu_parent IN (
					--level1
					SELECT routine FROM prumo_routines WHERE menu_parent IS NULL
				)
			)
		)

		UNION

		SELECT
			routine,
			(SELECT menu_label FROM prumo_routines WHERE routine=m2.menu_parent) as level1,
			menu_label as level2,
			CAST('_' as TEXT) as level3,
			CAST(NULL as TEXT) as level4,
			CAST(NULL as TEXT) as level5,
			2 as nivel,
			type
		FROM prumo_routines m2
		WHERE m2.routine IN (
			--level2
			SELECT routine FROM prumo_routines WHERE menu_parent IN (
				--level1
				SELECT routine FROM prumo_routines WHERE menu_parent IS NULL
			)
		)

		UNION

		SELECT
			routine,
			menu_label as level1,
			CAST('_' as TEXT) as level2,
			CAST(NULL as TEXT) as level3,
			CAST(NULL as TEXT) as level4,
			CAST(NULL as TEXT) as level5,
			1 as nivel,
			type
		FROM prumo_routines m1
		WHERE m1.menu_parent IS NULL
	) a
	ORDER BY level1,level2,level3,level4,level5
) search;


text:
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Twig_Extensions_' => array($vendorDir . '/twig/extensions/lib'),
    'Twig_' => array($vendorDir . '/twig/twig/lib'),
    'Symfony\\Bundle\\SwiftmailerBundle' => array($vendorDir . '/symfony/swiftmailer-bundle'),
    'Symfony\\Bundle\\MonologBundle' => array($vendorDir . '/symfony/monolog-bundle'),
    'Symfony\\Bundle\\AsseticBundle' => array($vendorDir . '/symfony/assetic-bundle'),
    'Symfony\\' => array($vendorDir . '/symfony/symfony/src'),
    'Stof\\DoctrineExtensionsBundle' => array($vendorDir . '/stof/doctrine-extensions-bundle'),
    'Sensio\\Bundle\\GeneratorBundle' => array($vendorDir . '/sensio/generator-bundle'),
    'Sensio\\Bundle\\FrameworkExtraBundle' => array($vendorDir . '/sensio/framework-extra-bundle'),
    'Sensio\\Bundle\\DistributionBundle' => array($vendorDir . '/sensio/distribution-bundle'),
    'Rebolon\\Component\\Pager' => array($vendorDir . '/rebolon/pager-component/src'),
    'Psr\\Log\\' => array($vendorDir . '/psr/log'),
    'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src'),
    'Monolog' => array($vendorDir . '/monolog/monolog/src'),
    'Metadata\\' => array($vendorDir . '/jms/metadata/src'),
    'JMS\\SecurityExtraBundle' => array($vendorDir . '/jms/security-extra-bundle'),
    'JMS\\DiExtraBundle' => array($vendorDir . '/jms/di-extra-bundle'),
    'JMS\\AopBundle' => array($vendorDir . '/jms/aop-bundle'),
    'JMS\\' => array($vendorDir . '/jms/parser-lib/src'),
    'Genemu\\Bundle\\FormBundle' => array($vendorDir . '/genemu/form-bundle'),
    'Gedmo\\' => array($vendorDir . '/gedmo/doctrine-extensions/lib'),
    'FOS\\UserBundle' => array($vendorDir . '/friendsofsymfony/user-bundle'),
    'Doctrine\\ORM\\' => array($vendorDir . '/doctrine/orm/lib'),
    'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
    'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
    'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
    'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
    'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'),
    'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'),
    'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'),
    'Doctrine\\Bundle\\DoctrineBundle' => array($vendorDir . '/doctrine/doctrine-bundle'),
    'CG\\' => array($vendorDir . '/jms/cg/src'),
    'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
    '' => array($baseDir . '/src'),
);

redpajama_set_name: RedPajamaGithub


text:
{% if page.comments %}

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus
{% endif %}


text:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Laabus - Online Business Management Portal System">
<meta name="keywords" content="mobile recharge, mobile recharge offers, recharge offers, dth recharge online">
<meta name="author" content="Varini Info Systems Pvt Ltd.">

<!-- <base href="/"> -->

<title>Laabus - Online Business portal</title>

<!-- Icons -->
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/fonts/font-awesome/css/font-awesome.min.css">

<!-- Plugins -->
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/c3.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/waves.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/perfect-scrollbar.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/fullcalendar.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/bootstrap-datepicker.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/plugins/summernote.css">

<!-- Css/Less Stylesheets -->
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>web_assets/styles/main.min.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300' rel='stylesheet' type='text/css'>
<link href='<?php echo base_url()?>web_assets/styles/font-awesome-animation.min.css' rel='stylesheet' type='text/css'>
<script src="<?php echo base_url();?>web_assets/scripts/jquery.js"></script>
<script src="<?php echo base_url()?>web_assets/scripts/vendors.js"></script>
<script src="<?php echo base_url();?>web_assets/scripts/jquery.validate.min.js"></script>

<link href="<?php echo base_url()?>web_assets/styles/autocomplete.css" rel="stylesheet">
<script src="<?php echo base_url()?>web_assets/scripts/jquery-ui.js"></script>
<!--<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>-->

<script>
var u = location.port!="" ? ':'+location.port :"";
var baseurl = location.protocol+"//"+document.domain+u+'/';
//baseurl+=location.port==8312?'laabus/www/':'';
//baseurl+='laabus/';
baseurl+='';
</script>
<!-- Match Media polyfill for IE9 -->
<!--[if IE 9]> <script src="scripts/ie/matchMedia.js"></script>  <![endif]-->

</head>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>StringHelper - FAKE - F# Make</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull">

    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">

    <link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" />

fsharp.org

github page

FAKE - F# Make

StringHelper

Contains basic functions for string manipulation.

Functions and values

Function or value	Description

            ( <* ) prefix text

            Signature: prefix:string -> text:string -> bool

Checks whether the given text starts with the given prefix

            ( >** ) pattern text

            Signature: pattern:string -> text:string -> bool

Determines if a text matches a given regex pattern.

            ( >=> ) pattern replacement text

            Signature: pattern:string -> replacement:string -> text:string -> string

Find a regex pattern in a text and replaces it with the given replacement.

            append text builder

            Signature: text:string -> builder:StringBuilder -> StringBuilder

Appends a text to a StringBuilder.

            appendFileNamesIfNotNull (...)

            Signature: fileNames:seq<string> -> builder:StringBuilder -> StringBuilder

Appends all notnull fileNames.

            appendIfFalse p

            Signature: p:bool -> string -> StringBuilder -> StringBuilder

Appends a text if the predicate is false.

            appendIfNotNull value s

            Signature: value:Object -> s:string -> StringBuilder -> StringBuilder

Appends a text if the value is not null.

            appendIfNotNullOrEmpty value s

            Signature: value:string -> s:string -> StringBuilder -> StringBuilder

Appends a text if the value is not null or empty.

            appendIfSome o f builder

            Signature: o:'?6544 option -> f:('?6544 -> string) -> builder:StringBuilder -> StringBuilder

                          Type parameters: '?6544

Appends string of function value if option has some value

            appendIfTrue p s builder

            Signature: p:bool -> s:string -> builder:StringBuilder -> StringBuilder

Appends a text if the predicate is true.

            appendIfTrueWithoutQuotes p s builder

            Signature: p:bool -> s:string -> builder:StringBuilder -> StringBuilder

            appendQuotedIfNotNull value s builder

            Signature: value:Object -> s:string -> builder:StringBuilder -> StringBuilder

Appends a quoted text if the value is not null.

            appendStringIfValueIsNotNull value

            Signature: value:'?6551 -> string -> StringBuilder -> StringBuilder

                          Type parameters: '?6551

Appends a text if the value is not null.

            appendStringIfValueIsNotNullOrEmpty (...)

            Signature: value:string -> string -> StringBuilder -> StringBuilder

Appends a text if the value is not null or empty.

            AppendToFile file lines

            Signature: file:string -> lines:seq<string> -> unit

Appends all lines to a file line by line

            appendWithoutQuotes text builder

            Signature: text:string -> builder:StringBuilder -> StringBuilder

Appends a text to a StringBuilder without surrounding quotes.

            charsAndDigits

            Signature: char list

Returns all standard chars and digits.

            Colon

            Signature: char

            ConvertFileToWindowsLineBreaks fileName

            Signature: fileName:string -> unit

Reads a file line by line and replaces all line breaks to windows line breaks
  - uses a temp file to store the contents in order to prevent OutOfMemory exceptions

            ConvertTextToWindowsLineBreaks text

            Signature: text:string -> string

Converts all line breaks in a text to windows line breaks

            DecodeBase64Utf8String text

            Signature: text:string -> string

Decodes a Base64-encoded UTF-8-encoded string

            EncapsulateApostrophe text

            Signature: text:string -> string

Encapsulates the Apostrophe

            endsWith suffix text

            Signature: suffix:string -> text:string -> bool

Checks whether the given text ends with the given suffix

            endsWithSlash

            Signature: string -> bool

Determines whether the last character of the given <see cref="string" />
matches Path.DirectorySeparatorChar.

            isLetterOrDigit c

            Signature: c:char -> bool

Checks whether the given char is a standard char or digit.

            isNotNullOrEmpty value

            Signature: value:string -> bool

Returns if the string is not null or empty

            isNullOrEmpty value

            Signature: value:string -> bool

Returns if the string is null or empty

            isNullOrWhiteSpace value

            Signature: value:string -> bool

Returns if the string is null or empty or completely whitespace

            isUmlaut c

            Signature: c:char -> bool

Checks whether the given char is a german umlaut.

            liftString x

            Signature: x:string -> string option

Lifts a string to an option

            LinuxLineBreaks

            Signature: string

Represents Linux line breaks

            MacLineBreaks

            Signature: string

Represents Mac line breaks

            NormalizeVersion version

            Signature: version:string -> string

Removes all trailing .0 from a version string

            ProduceRelativePath (...)

            Signature: baseLocation:string -> targetLocation:string -> string

Produces relative path when possible to go from baseLocation to targetLocation.

            ReadFile file

            Signature: file:string -> seq<string>

Reads a file line by line

            ReadFileAsBytes file

            Signature: file:string -> byte []

Reads a file as one array of bytes

            ReadFileAsString file

            Signature: file:string -> string

Reads a file as one text

            ReadLine file

            Signature: file:string -> string

Reads the first line of a file. This can be helpful to read a password from file.

            RemoveLineBreaks text

            Signature: text:string -> string

Removes linebreaks from the given string

            replace pattern replacement text

            Signature: pattern:string -> replacement:string -> text:string -> string

Replaces the given pattern in the given text with the replacement

            ReplaceFile fileName text

            Signature: fileName:string -> text:string -> unit

Replaces the file with the given string

            replaceFirst pattern replacement text

            Signature: pattern:string -> replacement:string -> text:string -> string

Replaces the first occurrence of the pattern with the given replacement.

            ReplaceInFile replaceF fileName

            Signature: replaceF:(string -> string) -> fileName:string -> unit

Replaces the text in the given file

            separated delimiter items

            Signature: delimiter:string -> items:seq<string> -> string

Converts a sequence of strings to a string with delimiters

            shortenCurrentDirectory value

            Signature: value:string -> string

Replaces any occurence of the currentDirectory with .

            split delimiter text

            Signature: delimiter:char -> text:string -> string list

Splits the given string at the given char delimiter

            splitStr delimiterStr text

            Signature: delimiterStr:string -> text:string -> string list

Splits the given string at the given string delimiter

            startsWith prefix text

            Signature: prefix:string -> text:string -> bool

Checks whether the given text starts with the given prefix

            toLines text

            Signature: text:seq<string> -> string

Converts a sequence of strings into a string separated with line ends

            toLower s

            Signature: s:string -> string

Converts all characters in a string to lower case.

            toRelativePath value

            Signature: value:string -> string

Replaces the absolute path to a relative path.

            toText builder

            Signature: builder:StringBuilder -> string

Returns the text from the StringBuilder

            trim x

            Signature: x:string -> string

Trims the given string

            trimChars chars x

            Signature: chars:char [] -> x:string -> string

Trims the given string

            trimEndChars chars x

            Signature: chars:char [] -> x:string -> string

Trims the end of the given string

            trimSeparator s

            Signature: s:string -> string

Trims the given string with the DirectorySeparatorChar

            trimSlash s

            Signature: s:string -> string

Removes the slashes from the end of the given string

            trimSpecialChars text

            Signature: text:string -> string

Trims all special characters from a string.

            trimStartChars chars x

            Signature: chars:char [] -> x:string -> string

Trims the start of the given string

            WindowsLineBreaks

            Signature: string

Represents Windows line breaks

            WriteBytesToFile file bytes

            Signature: file:string -> bytes:byte [] -> unit

Writes a byte array to a file

            WriteFile file lines

            Signature: file:string -> lines:seq<string> -> unit

Writes a file line by line

            WriteStringToFile append fileName text

            Signature: append:bool -> fileName:string -> text:string -> unit

Writes a string to a file

            WriteToFile append fileName lines

            Signature: append:bool -> fileName:string -> lines:seq<string> -> unit

Writes a file line by line

FAKE - F# Make

Home page

Get FAKE - F# Make via NuGet

Source Code on GitHub

License (MS-PL)

Release Notes

Contributing to FAKE - F# Make

Who is using FAKE?

Ask a question

Tutorials

Getting started

NuGet package restore

Using FxCop in a build

Generating AssemblyInfo

Create NuGet packages

Running specific targets

Running FAKE from command line

Using the F# compiler from FAKE

Creating custom tasks

TeamCity integration

Running canopy tests

Octopus Deploy

TypeScript support

Fake.Deploy

Reference

API Reference


text:
from odf.namespaces import CONFIGNS
from odf.element import Element

# Autogenerated
def ConfigItem(**args):
    return Element(qname = (CONFIGNS, 'config-item'), **args)

def ConfigItemMapEntry(**args):
    return Element(qname = (CONFIGNS,'config-item-map-entry'), **args)

def ConfigItemMapIndexed(**args):
    return Element(qname = (CONFIGNS,'config-item-map-indexed'), **args)

def ConfigItemMapNamed(**args):
    return Element(qname = (CONFIGNS,'config-item-map-named'), **args)

def ConfigItemSet(**args):
    return Element(qname = (CONFIGNS, 'config-item-set'), **args)


text:
from flask import Blueprint, render_template, current_app, redirect, url_for, request, abort
from .forms import SendLebiForm, PasswordEditForm
from flask.ext.login import login_required, current_user
from application.models.lebi import LeBi

user_blueprint = Blueprint('user', __name__)

@user_blueprint.route('/')
@login_required
def index():
    count = {
        'received_count': LeBi.objects(receiver_id=current_user.id).count(),
        'created_count': LeBi.objects(creator_id=current_user.id).count(),
    }
    return render_template('user/index.html', count=count)

@user_blueprint.route('/records/')
@user_blueprint.route('/records/<string:act>/')
@login_required
def records(act=None):
    page = request.args.get('page', 1)
    page = int(page)
    if act == 'received':
        result = LeBi.objects(receiver_id=current_user.id).paginate(page=page, per_page=20)
    elif act == 'created':
        result = LeBi.objects(creator_id=current_user.id).paginate(page=page, per_page=20)
    else:
        result = LeBi.objects().order_by('-created_at').paginate(page=page, per_page=20)
    return render_template('user/records.html', result=result, act=act)

@user_blueprint.route('/send/lebi/', methods=['GET', 'POST'])
@user_blueprint.route('/send/lebi/<string:oid>/', methods=['GET', 'POST'])
@login_required
def send_lebi(oid=None):
    if current_user.current_month_sent_count >= current_app.config.get('MONTH_LEBI_NUM', 10):
        form = None
        return render_template('user/send_lebi.html', form=form)
    obj = None
    if oid:
        obj = LeBi.objects(id=oid).first()
        if obj.creator_id != current_user.id:
            abort(403)
        form = SendLebiForm(obj=obj)
    else:
        form = SendLebiForm()
    form.init_choices()
    if form.validate_on_submit():
        if obj:
            obj.receiver_id = form.receiver_id.data
            obj.reason = form.reason.data
            obj.effect = form.effect.data
            obj.receiver_group_id = form.receiver_group_id.data
            obj.save()
        else:
            LeBi.create(
                receiver_id=form.receiver_id.data,
                reason=form.reason.data,
                effect=form.effect.data,
                creator=current_user,
            )
        return redirect(url_for('user.records'))
    return render_template('user/send_lebi.html', form=form)

@user_blueprint.route('/password/edit/', methods=['GET', 'POST'])
@login_required
def password_edit():
    form = PasswordEditForm()
    if form.validate_on_submit():
        current_user.set_password(form.new_password.data)
        return redirect(url_for('user.index'))
    return render_template('user/password_edit.html', form=form)


text:
package com.cezarykluczynski.stapi.server.astronomical_object.mapper;

import com.cezarykluczynski.stapi.client.v1.soap.AstronomicalObjectHeader;
import com.cezarykluczynski.stapi.model.astronomical_object.entity.AstronomicalObject;
import com.cezarykluczynski.stapi.server.configuration.MapstructConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

import java.util.List;

@Mapper(config = MapstructConfiguration.class, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AstronomicalObjectHeaderSoapMapper {

	AstronomicalObjectHeader map(AstronomicalObject astronomicalObject);

	List<AstronomicalObjectHeader> map(List<AstronomicalObject> astronomicalObject);

}


text:
import React from 'react'
import { NavBar, Container, calendar } from 'layui'

export default class CalendarView extends React.Component {
  calendarHandle(e){
    const date = new Date()
    calendar.showCalendar(date, e.target, (obj)=>{
      console.log(obj)
    })
  }
  render () {
    return (

        <NavBar title="日历" />
        <Container>
          日期:
          <input placeholder='请选择日期' onClick={this.calendarHandle.bind(this)} readOnly></input>
        </Container>

    )
  }
}
module.exports = exports['default']


text:
const navbarController = (() => {
    const btnGlobalLogin = $('#btn-global-login');
    const btnGlobalLogout = $('#btn-global-logout');

    function displayControls() {
        const userIsLoggedIn = credentialManager.isLogged();
        if (userIsLoggedIn) {
            btnGlobalLogin.hide();
            btnGlobalLogout.show();
        } else {
            btnGlobalLogin.show();
            btnGlobalLogout.hide();
        }
    }

    return {
        displayControls
    };
})();


text:
(function (global) {
    var asyncQueue = [];
    var originalPromise = global.Promise;

    function FakePromise(resolver) {
        if (typeof resolver != 'function')
            throw new TypeError("Promise resolver " + resolver + " is not a function");

        this.isPending = true;
        this.isResolved = false;
        this.isRejected = false;
        this._callbacks = [];

        try {
            resolver(this.resolve.bind(this), this.reject.bind(this));
        } catch (error) {
            this.reject(error);
        }
    }

    FakePromise.prototype = {
        then: function (resolveCallback, rejectCallback) {
            var self = this;

            return new FakePromise(function (resolve, reject) {
                var resolveHandler = resolveCallback ? handler(resolveCallback) : resolve;
                var rejectHandler = rejectCallback ? handler(rejectCallback) : reject;

                if (self.isResolved)
                    asyncQueue.push(resolveHandler.bind(null, self.value));
                else if (self.isRejected)
                    asyncQueue.push(rejectHandler.bind(null, self.error));
                else
                    self._callbacks.push([resolveHandler, rejectHandler]);

                function handler(callback) {
                    return function (value) {
                        try {
                            var result = callback(value);
                        } catch (error) {
                            reject(error);
                        }

                        if (result && typeof result.then == 'function')
                            result.then(resolve, reject);
                        else
                            resolve(result);
                    }
                }
            });
        },

        catch: function (rejectCallback) {
            return this.then(null, rejectCallback);
        },

        resolve: function (value) {
            if (!this.isPending)
                return;

            this.value = value;
            this.isPending = false;
            this.isResolved = true;

            evaluateCallbacks(this, this._callbacks);
        },

        reject: function (error) {
            if (!this.isPending)
                return;

            this.error = error;
            this.isPending = false;
            this.isRejected = true;

            evaluateCallbacks(this, this._callbacks);
        }
    };

    FakePromise.resolve = function (value) {
        try {
            return value instanceof FakePromise ? value
                : value && typeof value.then == 'function' ? new FakePromise(value.then.bind(value))
                : new FakePromise(function (resolve, reject) {
                resolve(value);
            });
        } catch (e) {
            return FakePromise.reject(e);
        }
    };

    FakePromise.reject = function (reason) {
        return new FakePromise(function (resolve, reject) {
            reject(reason);
        });
    };

    FakePromise.all = function (promises) {
        return new FakePromise(function (resolve, reject) {
            var results = [];
            var resolved = 0;
            promises.forEach(waitForPromise);

            function waitForPromise(promise, i) {
                FakePromise.resolve(promise).then(
                    function (value) {
                        results[i] = value;
                        resolved++;
                        if (resolved == promises.length)
                            resolve(results);
                    },
                    reject
                );
            }
        });
    };

    FakePromise.race = function (promises) {
        return new FakePromise(function (resolve, reject) {
            promises.forEach(function (p) { FakePromise.resolve(p).then(resolve, reject); });
        });
    };

    FakePromise.flush = function () {
        var action;
        while (action = asyncQueue.shift())
            action();
    };

    FakePromise.clear = function () {
        asyncQueue.length = 0;
    };

    FakePromise.defer = function () {
        return new FakePromise(function () { });
    };

    FakePromise.replacePromise = function () {
        global.Promise = FakePromise;
    };

    FakePromise.restorePromise = function () {
        global.Promise = originalPromise;
    };

    function identity(value) {
        return value;
    }

    function evaluateCallbacks(promise, callbacks) {
        callbacks.forEach(promise.then.apply.bind(promise.then, promise));
        callbacks.length = 0;
    }

    global.FakePromise = FakePromise;
})(this);


text:
#pragma once
#include <aws/organizations/Organizations_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace Organizations
{
namespace Model
{
  enum class OrganizationFeatureSet
  {
    NOT_SET,
    ALL,
    CONSOLIDATED_BILLING
  };

namespace OrganizationFeatureSetMapper
{
AWS_ORGANIZATIONS_API OrganizationFeatureSet GetOrganizationFeatureSetForName(const Aws::String& name);

AWS_ORGANIZATIONS_API Aws::String GetNameForOrganizationFeatureSet(OrganizationFeatureSet value);
} // namespace OrganizationFeatureSetMapper
} // namespace Model
} // namespace Organizations
} // namespace Aws


text:
namespace YAMP.Numerics
{
    using YAMP.Exceptions;

    /// <summary>
    /// Abstract base class for various interpolation algorithms.
    /// </summary>
    public abstract class Interpolation
    {
        #region Fields

        int np;
        MatrixValue _samples;

        #endregion

        #region ctor

        /// <summary>
        /// Creates a new instance.
        /// </summary>
        /// <param name="samples">The given sample values - the matrix has to be Nx2 with the
        /// first column for the x values and the second column for the y values.</param>
        public Interpolation(MatrixValue samples)
        {
            _samples = samples;
            np = samples.DimensionY;

            if (samples.DimensionX != 2)
                new YAMPMatrixDimensionException(samples.DimensionY, 2, samples.DimensionY, samples.DimensionX);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the vector with samples.
        /// </summary>
        public MatrixValue Samples { get { return _samples; } }

        /// <summary>
        /// Gets the number of interpolation points.
        /// </summary>
        public int Np { get { return np; } }

        #endregion

        #region Methods

        /// <summary>
        /// Uses the abstract Compute() methods to compute ALL values.
        /// </summary>
        /// <param name="x">The matrix with given x values.</param>
        /// <returns>The interpolated y values.</returns>
        public virtual MatrixValue ComputeValues(MatrixValue x)
        {
            var y = new MatrixValue(x.DimensionY, x.DimensionX);

            for (var i = 1; i <= x.DimensionX; i++)
                for (var j = 1; j <= x.DimensionY; j++)
                    y[j, i].Re = ComputeValue(x[j, i].Re);

            return y;
        }

        /// <summary>
        /// Computes an interpolated y-value for the given x-value.
        /// </summary>
        /// <param name="x">The x-value to search for a y-value.</param>
        /// <returns>The corresponding y-value.</returns>
        public abstract double ComputeValue(double x);

        /// <summary>
        /// Solves the system of linear equations for a tri-diagonal A in A * x = b.
        /// </summary>
        /// <param name="sub">The lower diagonal of A.</param>
        /// <param name="diag">The diagonal itself of A.</param>
        /// <param name="sup">The upper diagonal of A.</param>
        /// <param name="b">The vector b in A * x = b.</param>
        /// <param name="n">The length of the diagonal.</param>
        protected void SolveTridiag(double[] sub, double[] diag, double[] sup, ref double[] b, int n)
        {
            int i;

            for (i = 2; i <= n; i++)
            {
                sub[i] = sub[i] / diag[i - 1];
                diag[i] = diag[i] - sub[i] * sup[i - 1];
                b[i] = b[i] - sub[i] * b[i - 1];
            }

            b[n] = b[n] / diag[n];

            for (i = n - 1; i >= 1; i--)
                b[i] = (b[i] - sup[i] * b[i + 1]) / diag[i];
        }

        #endregion
    }
}


text:
from jacket.storage.backup import driver

class FakeBackupService(driver.BackupDriver):
    def __init__(self, context, db_driver=None):
        super(FakeBackupService, self).__init__(context, db_driver)

    def backup(self, backup, volume_file):
        pass

    def restore(self, backup, volume_id, volume_file):
        pass

    def delete(self, backup):
        # if backup has magic name of 'fail_on_delete'
        # we raise an error - useful for some tests -
        # otherwise we return without error
        if backup['display_name'] == 'fail_on_delete':
            raise IOError('fake')

def get_backup_driver(context):
    return FakeBackupService(context)


text:
package org.kie.workbench.common.stunner.core.graph.processing.layout;

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

/**
 * A layout for the vertices in a graph.
 */
public class Layout {

    private final ArrayList<VertexPosition> nodePositions;

    public Layout() {
        this.nodePositions = new ArrayList<>();
    }

    public List<VertexPosition> getNodePositions() {
        return nodePositions;
    }
}


text:
'''
This module is a header-like file for pyqtconfig. Handles compatiblity
with both PyQt5 and PySide2.
'''
import sys

if "PyQt5" in sys.modules:
    from PyQt5.QtCore import (QVariant, Qt, QMutex, QMutexLocker, QSettings,
                              QObject, pyqtSignal)
    from PyQt5.QtWidgets import (QComboBox, QCheckBox, QAction,
                                 QActionGroup, QPushButton, QSpinBox,
                                 QDoubleSpinBox, QPlainTextEdit, QLineEdit,
                                 QListWidget, QSlider, QButtonGroup,
                                 QTabWidget, QApplication, QGridLayout,
                                 QTextEdit, QWidget, QMainWindow)

    Signal = pyqtSignal

elif "PySide2" in sys.modules:
    from PySide.QtGui import (QComboBox, QCheckBox, QAction, QMainWindow,
                              QActionGroup, QPushButton, QSpinBox,
                              QDoubleSpinBox, QPlainTextEdit, QLineEdit,
                              QListWidget, QSlider, QButtonGroup, QWidget,
                              QTabWidget, QApplication, QGridLayout, QTextEdit)
    from PySide.QtCore import (Signal, Qt, QMutex, QMutexLocker, QSettings,
                               QObject)

    QVariant = None


text:
"""
How To: Create a Queue
----------------------
>>> from azure.servicebus import *
>>> bus_service = ServiceBusService(ns, key, 'owner')
>>> bus_service.create_queue('taskqueue')
True

>>> queue_options = Queue()
>>> queue_options.max_size_in_megabytes = '5120'
>>> queue_options.default_message_time_to_live = 'PT1M'
>>> bus_service.create_queue('taskqueue2', queue_options)
True

How to Send Messages to a Queue
-------------------------------
>>> msg = Message('Test Message')
>>> bus_service.send_queue_message('taskqueue', msg)

How to Receive Messages from a Queue
------------------------------------
>>> msg = bus_service.receive_queue_message('taskqueue')
>>> print(msg.body)
Test Message

>>> msg = Message('Test Message')
>>> bus_service.send_queue_message('taskqueue', msg)

>>> msg = bus_service.receive_queue_message('taskqueue', peek_lock=True)
>>> print(msg.body)
Test Message
>>> msg.delete()

>>> bus_service.delete_queue('taskqueue')
True

>>> bus_service.delete_queue('taskqueue2')
True

"""
from util import credentials

ns = credentials.getServiceBusNamespace()
key = credentials.getServiceBusKey()

if __name__ == "__main__":
    import doctest
    doctest.testmod()


text:
// -----------------------------------------------------------------------
// <copyright file="ReportConflictingNamesPass.cs" company="(none)">
//   Copyright © 2014 John Gietzen.  All Rights Reserved.
//   This source is subject to the MIT license.
//   Please see license.md for more information.
// </copyright>
// -----------------------------------------------------------------------

namespace Pegasus.Compiler
{
    using System.Collections.Generic;
    using Pegasus.Expressions;
    using Pegasus.Properties;

    internal class ReportConflictingNamesPass : CompilePass
    {
        public override IList<string> BlockedByErrors
        {
            get { return new[] { "PEG0001" }; }
        }

        public override IList<string> ErrorsProduced
        {
            get { return new[] { "PEG0007" }; }
        }

        public override void Run(Grammar grammar, CompileResult result)
        {
            new ConflictingNamesTreeWalker(result).WalkGrammar(grammar);
        }

        private class ConflictingNamesTreeWalker : ExpressionTreeWalker
        {
            private readonly HashSet<string> currentNames = new HashSet<string>();
            private readonly CompileResult result;

            public ConflictingNamesTreeWalker(CompileResult result)
            {
                this.result = result;
            }

            protected override void WalkChoiceExpression(ChoiceExpression choiceExpression)
            {
                var namesCopy = new HashSet<string>(this.currentNames);
                foreach (var expression in choiceExpression.Choices)
                {
                    this.WalkExpression(expression);
                    this.currentNames.IntersectWith(namesCopy);
                }
            }

            protected override void WalkPrefixedExpression(PrefixedExpression prefixedExpression)
            {
                var success = this.currentNames.Add(prefixedExpression.Prefix.Name);
                this.currentNames.Add(prefixedExpression.Prefix.Name + "Start");
                this.currentNames.Add(prefixedExpression.Prefix.Name + "End");

                if (!success)
                {
                    var cursor = prefixedExpression.Prefix.Start;
                    this.result.AddCompilerError(cursor, () => Resources.PEG0007_ERROR_PrefixAlreadyDeclared, prefixedExpression.Prefix.Name);
                }

                base.WalkPrefixedExpression(prefixedExpression);
            }

            protected override void WalkRule(Rule rule)
            {
                base.WalkRule(rule);
                this.currentNames.Clear();
            }
        }
    }
}


text:
import { ExternalTokenResponse, AuthenticationResult } from "@azure/msal-common";
import { SilentRequest } from "../request/SilentRequest";
import { LoadTokenOptions } from "./TokenCache";

export interface ITokenCache {

    /**
     * API to side-load tokens to MSAL cache
     * @returns `AuthenticationResult` for the response that was loaded.
     */
    loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): AuthenticationResult;

}


text:
package alluxio.master.file;

import alluxio.conf.ServerConfiguration;
import alluxio.conf.PropertyKey;
import alluxio.heartbeat.HeartbeatExecutor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Heartbeat executor for validating inode and block integrity.
 */
public final class BlockIntegrityChecker implements HeartbeatExecutor {
  private static final Logger LOG = LoggerFactory.getLogger(BlockIntegrityChecker.class);

  private final FileSystemMaster mFileSystemMaster;
  private final boolean mRepair;

  /**
   * Constructs a block integrity checker based on the given {@link FileSystemMaster}.
   *
   * @param fsm the master to check
   */
  public BlockIntegrityChecker(FileSystemMaster fsm) {
    mFileSystemMaster = fsm;
    mRepair = ServerConfiguration
        .getBoolean(PropertyKey.MASTER_PERIODIC_BLOCK_INTEGRITY_CHECK_REPAIR);
  }

  @Override
  public void heartbeat() {
    try {
      mFileSystemMaster.validateInodeBlocks(mRepair);
    } catch (Exception e) {
      LOG.error("Failed to run periodic block integrity check.", e.toString());
    }
  }

  @Override
  public void close() {
    // Nothing to clean up.
  }
}


text:
set -o errexit -o nounset
TOP_DIR=$(cd "$(dirname "$0")/.." && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/deploy.osbash"
source "$CONFIG_DIR/provider.virtualbox"
source "$OSBASH_LIB_DIR/functions-host.sh"
source "$OSBASH_LIB_DIR/virtualbox-functions.sh"

OSBASH=exec_cmd

VM_LIST="controller network compute"

function usage {
    # Setting to empty string selects latest (current snapshot)
    echo "Usage: $0 {-l|-c|-t <SNAP>} [-s]"
    echo ""
    echo "-h        Help"
    echo "-l        List snapshots for node VMs"
    echo "-c        Restore cluster node VMs to current snapshot"
    echo "-t SNAP   Restore cluster to target snapshot"
    echo "-s        Start each node VMs after restoring it"
    exit
}

function list_snapshots {
    for vm_name in $VM_LIST; do
        echo -e "Snapshot list for $vm_name node:"
        vboxmanage snapshot "$vm_name" list
        echo
    done
    exit 0
}

while getopts :chlst: opt; do
    case $opt in
        c)
            CURRENT=yes
            ;;
        h)
            usage
            ;;
        l)
            list_snapshots
            ;;
        s)
            START=yes
            ;;
        t)
            TARGET_SNAPSHOT=$OPTARG
            ;;
        :)
            echo "Error: -$OPTARG needs argument"
            ;;
        ?)
            echo "Error: invalid option -$OPTARG"
            echo
            usage
            ;;
    esac
done

# Remove processed options from arguments
shift $(( OPTIND - 1 ));

if [ $# -ne 0 ]; then
    usage
elif [ -z "${TARGET_SNAPSHOT:-}" -a -z "${CURRENT:-""}" ]; then
    echo
    echo "Error: no target snapshot given."
    echo
    usage
elif [ -n "{$TARGET_SNAPSHOT:-}" -a -n "${CURRENT:-""}" ]; then
    echo
    echo "Error: conflicting options: target snapshot name and -c."
    echo
    usage
fi

# Find target_snapshot in scripts_cfg and set global *_SNAPSHOT variables
# to the correct snapshot name for each node (to allow building from there)
function set_snapshot_vars {
    local target_snapshot=$1

    local found=0
    local scripts_cfg="$TOP_DIR/config/scripts.ubuntu_cluster"

    while read -r line; do
        if [[ $line =~ ^cmd\ snapshot.*-n\ ([^ ]*)\ (.*) ]]; then
            # Node name (e.g. controller)
            node=${BASH_REMATCH[1]}

            # Snapshot name (e.g. keystone_installed)
            snapshot=${BASH_REMATCH[2]}

            # Global variable name (e.g. CONTROLLER_SNAPSHOT)
            # Can't use ${node,,} (OS X bash version is only 3.2)
            var_name=$(echo "$node"|tr "a-z" "A-Z")_SNAPSHOT

            if [ "$snapshot" = "$target_snapshot" ]; then
                # Can't use associative arrays (OS X bash version is only 3.2)
                eval "${var_name}=$snapshot"

                found=1
            elif [ $found -eq 0 ]; then
                eval "${var_name}=$snapshot"
            fi
        fi
    done < "$scripts_cfg"

    if [ $found -eq 0 ]; then
        echo "ERROR: snapshot '$target_snapshot' not found"
        exit 1
    fi
}

function restore_current_snapshot {
    local vm_name=$1
    vboxmanage snapshot "$vm_name" restorecurrent
}

function restore_named_snapshot {
    local vm_name=$1
    local snapshot=$2
    vboxmanage snapshot "$vm_name" restore "$snapshot"
}

if [ -n "$TARGET_SNAPSHOT" ]; then
    set_snapshot_vars "$TARGET_SNAPSHOT"
fi

for vm_name in $VM_LIST; do
    vm_power_off "$vm_name"
    vm_wait_for_shutdown "$vm_name"

    if [ "${CURRENT:-""}" = "yes" ]; then
        restore_current_snapshot "$vm_name"
        if [ "${START:-""}" = "yes" ]; then
            vbox_boot "$vm_name"
        fi
    else
        # Global variable name (e.g. CONTROLLER_SNAPSHOT)
        # (use tr due to OS X bash limitation)
        var_name=$(echo "$vm_name"|tr "a-z" "A-Z")_SNAPSHOT
        if [ -z "${!var_name:=""}" ]; then
            vm_delete "$vm_name"
        else
            restore_named_snapshot "$vm_name" "${!var_name}"
            if [ "${START:-""}" = "yes" ]; then
                vbox_boot "$vm_name"
            fi
        fi
    fi
done


text:
#import "MLCEntity.h"
#import <CoreGraphics/CoreGraphics.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#elif TARGET_OS_OSX
#import <AppKit/AppKit.h>
#endif

NS_ASSUME_NONNULL_BEGIN

#if TARGET_OS_IPHONE
typedef void(^MLCImageCompletionHandler)(UIImage *_Nullable image, NSError *_Nullable error) NS_SWIFT_NAME(MLCImage.CompletionHandler);
#elif TARGET_OS_OSX
typedef void(^MLCImageCompletionHandler)(NSImage *_Nullable image, NSError *_Nullable error) NS_SWIFT_NAME(MLCImage.CompletionHandler);
#else
typedef void(^MLCImageCompletionHandler)(NSData *_Nullable data, NSError *_Nullable error) NS_SWIFT_NAME(MLCImage.CompletionHandler);
#endif
typedef void(^MLCImageDownloadCompletionHandler)(NSURL *_Nullable location, NSError *_Nullable error) NS_SWIFT_NAME(MLCImage.DownloadCompletionHandler);

/**
 A MLCImage object encapsulates the image data for a deal stored in
 the Moblico Admin Portal.
 */
NS_SWIFT_NAME(Image)
@interface MLCImage : MLCEntity

/**
 A unique identifier for this image.
 */
@property (nonatomic) NSUInteger imageId NS_SWIFT_NAME(id);
@property (nonatomic) CGFloat scaleFactor;
/**
 The URL for this image.
 */
@property (strong, nonatomic) NSURL *url;

/**
 The date this image was last updated.
 */
@property (strong, nonatomic) NSDate *lastUpdateDate;

- (void)loadImage:(MLCImageCompletionHandler)handler;
- (void)downloadImage:(MLCImageDownloadCompletionHandler)handler NS_SWIFT_NAME(download(_:));
#if TARGET_OS_IPHONE
@property (strong, nonatomic, readonly, nullable) UIImage *cachedImage;
#elif TARGET_OS_OSX
@property (strong, nonatomic, readonly, nullable) NSImage *cachedImage;
#else
@property (strong, nonatomic, readonly, nullable) NSData *cachedImage;
#endif

+ (BOOL)clearCache:(out NSError **)error;

- (nullable instancetype)initWithURLString:(NSString *)URLString;
- (nullable instancetype)initWithStringComponents:(NSString *)components;

@end

NS_ASSUME_NONNULL_END


text:
a simple implementation of the car race

Here is [demo](http://shellbye.com/CarRace/)

##Author
[Baybaylee](http://baybaylee.github.io/)
[Shellbye](http://shellbye.com)