text:
/*
 * MainBase
 */
define(function () {
    console.log('SKIN: mainBase called');
    function mainBase(id, require) {
        this.id = id;
        this.require = require;
	    var $ = require('jquery'),
	        backbone = require('backbone'),
	        underscore = require('underscore'),
	        lodash = require('lodash'),
	        jquery = require('jquery'),
	        bootstrap = require('bootstrap'), // bootstrap extends jquery
	        expect = require('expect'),
	        mocha = require('mocha'),
	        jquerypp = require('jquerypp.custom'),
	        framewarp = require('framewarp');
    };
    mainBase.prototype = {
        setLib: function(lib) {
        	console.log('SKIN: mainBase setLib(lib) called');
        	this.lib = lib;
        },
        setConfig: function(config) {
        	console.log('SKIN: mainBase setConfig(config) called');
        	this.config = config;
        },
        setController: function(controller) {
        	console.log('SKIN: mainBase setController(controller) called');
        	this.controller = controller;
        },
        setStoreName: function(storeName) {
        	console.log('SKIN: mainBase setStoreName(storeName) called: storeName =');
        	console.log(storeName);
        	this.storeName = storeName;
        },
        setElementId: function(elementId) {
        	console.log('SKIN: mainBase setElementId(elementId) called: elementId =');
        	console.log(elementId);
        	this.elementId = elementId;
        },
        setApp: function(app) {
        	console.log('SKIN: mainBase setApp(app) called');
        	this.app = app;
        },
        setAppController: function(appController) {
        	console.log('SKIN: mainBase setAppController(appController) called');
        	this.appController = appController;
        },
        setAppEvent: function(appEvent) {
        	console.log('SKIN: mainBase setAppEvent(appEvent) called');
        	this.appEvent = appEvent;
        },
        setAppService: function(appService) {
        	console.log('SKIN: mainBase setAppService(appService) called');
        	this.appService = appService;
        },
        setServiceBus: function(serviceBus) {
        	console.log('SKIN: mainBase setServiceBus(serviceBus) called');
        	this.serviceBus = serviceBus;
        },
        setView: function(view) {
        	console.log('SKIN: mainBase setView(view) called');
        	this.view = view;
        },
        setViewController: function(viewController) {
        	console.log('SKIN: mainBase setViewController(viewController) called');
        	this.viewController = viewController;
        },
        setViewService: function(viewService) {
        	console.log('SKIN: mainBase setViewService(viewService) called');
        	this.viewService = viewService;
        },
        setViewEvent: function(viewEvent) {
        	console.log('SKIN: mainBase setViewEvent(viewEvent) called');
        	this.viewEvent = viewEvent;
        },
        setViewIndex: function(viewIndex) {
        	console.log('SKIN: mainBase setViewIndex(viewIndex) called');
        	this.viewIndex = viewIndex;
        },
        loadView: function(viewIndex) {
        	console.log('SKIN: mainBase loadView(viewIndex) called');
        	this.controller.loadView(viewIndex);
        },
        renderView: function(elementId) {
        	console.log('SKIN: mainBase renderView(elementId) called');
        	this.controller.renderView(elementId);
        },
        readyController: function(me, callback) {
        	console.log('SKIN: mainBase readyController(me, callback) called');
        	var err = null;
			if(typeof me.controller === 'undefined') {
				me.require(['../app/controller/controller'], function (controller) {
                    console.log('SKIN: mainBase: controller required');
                    console.log(controller);
                    me.controller = controller;
                    callback(me, err, me.controller);
            	});
            }
			else {
				me.controller = me.controller;
				console.log(me.controller);
        		callback(me, err, me.controller);
        	}
    	},
        readyConfig: function(me, callback) {
        	console.log('SKIN: mainBase readyConfig(me, callback) called');
        	var err = null;
			if(typeof me.config === 'undefined') {
				me.require(['../app/config/config'], function (config) {
                    console.log('SKIN: mainBase: config required');
                    console.log(config);
                    me.config = config;
                    callback(me, err, me.config);
            	});
            }
			else {
				me.config = me.config;
				console.log(me.config);
        		callback(me, err, me.config);
        	}
    	},
        readyServiceBus: function(me, callback) {
        	console.log('SKIN: mainBase readyServiceBus(me, callback) called');
        	var err = null;
			if(typeof me.serviceBus === 'undefined') {
				me.require(['../app/serviceBus/serviceBus'], function (serviceBus) {
                    console.log('SKIN: mainBase: serviceBus required');
                    console.log(serviceBus);
                    me.serviceBus = serviceBus;
                    callback(me, err, me.serviceBus);
            	});
            }
			else {
				me.serviceBus = me.serviceBus;
				console.log(me.serviceBus);
        		callback(me, err, me.serviceBus);
        	}
    	},
        readyAppController: function(me, callback) {
        	console.log('SKIN: mainBase readyAppController(me, callback) called');
        	var err = null;
			if(typeof me.appController === 'undefined') {
				me.require(['../app/appController/appController'], function (appController) {
                    console.log('SKIN: mainBase: appController required');
                    console.log(appController);
                    me.appController = appController;
                    callback(me, err, me.appController);
            	});
            }
			else {
				me.appController = me.appController;
				console.log(me.appController);
        		callback(me, err, me.appController);
        	}
    	},
        readyAppService: function(me, callback) {
        	console.log('SKIN: mainBase readyAppService(me, callback) called');
        	var err = null;
			if(typeof me.appService === 'undefined') {
				me.require(['../app/appService/appService'], function (appService) {
                    console.log('SKIN: mainBase: appService required');
                    console.log(appService);
                    me.appService = appService;
                    callback(me, err, me.appService);
            	});
            }
			else {
				me.appService = me.appService;
				console.log(me.appService);
        		callback(me, err, me.appService);
        	}
    	},
        readyApp: function(me, callback) {
        	console.log('SKIN: mainBase readyApp(me, callback) called');
        	var err = null;
			if(typeof me.app === 'undefined') {
				me.require(['../app/app/app'], function (app) {
                    console.log('SKIN: mainBase: app required');
                    console.log(app);
                    me.app = app;
                    callback(me, err, me.app);
            	});
            }
			else {
				me.app = me.app;
				console.log(me.app);
        		callback(me, err, me.app);
        	}
    	},
        readyAppEvent: function(me, callback) {
        	console.log('SKIN: mainBase readyAppEvent(me, callback) called');
        	var err = null;
			if(typeof me.appEvent === 'undefined') {
				me.require(['../app/appEvent/appEvent'], function (appEvent) {
                    console.log('SKIN: mainBase: appEvent required');
                    console.log(appEvent);
                    me.appEvent = appEvent;
                    callback(me, err, me.appEvent);
            	});
            }
			else {
				me.appEvent = me.appEvent;
				console.log(me.appEvent);
        		callback(me, err, me.appEvent);
        	}
    	},
        readyViewController: function(me, callback) {
        	console.log('SKIN: mainBase readyViewController(me, callback) called');
        	var err = null;
			if(typeof me.viewController === 'undefined') {
				me.require(['../app/viewController/viewController'], function (viewController) {
                    console.log('SKIN: mainBase: viewController required');
                    console.log(viewController);
                    me.viewController = viewController;
                    callback(me, err, me.viewController);
            	});
            }
			else {
				me.viewController = me.viewController;
				console.log(me.viewController);
        		callback(me, err, me.viewController);
        	}
    	},
        readyViewService: function(me, callback) {
        	console.log('SKIN: mainBase readyViewService(me, callback) called');
        	var err = null;
			if(typeof me.viewService === 'undefined') {
				me.require(['../app/viewService/viewService'], function (viewService) {
                    console.log('SKIN: mainBase: viewService required');
                    console.log(viewService);
                    me.viewService = viewService;
                    callback(me, err, me.viewService);
            	});
            }
			else {
				me.viewService = me.viewService;
				console.log(me.viewService);
        		callback(me, err, me.viewService);
        	}
    	},
        readyView: function(me, callback) {
        	console.log('SKIN: mainBase readyView(me, callback) called');
        	var err = null;
			if(typeof me.view === 'undefined') {
				me.require(['../app/view/view'], function (view) {
                    console.log('SKIN: mainBase: view required');
                    console.log(view);
                    me.view = view;
                    callback(me, err, me.view);
            	});
            }
			else {
				me.view = me.view;
				console.log(me.view);
        		callback(me, err, me.view);
        	}
    	},
        readyViewEvent: function(me, callback) {
        	console.log('SKIN: mainBase readyViewEvent(me, callback) called');
        	var err = null;
			if(typeof me.viewEvent === 'undefined') {
				me.require(['../app/viewEvent/viewEvent'], function (viewEvent) {
                    console.log('SKIN: mainBase: viewEvent required');
                    console.log(viewEvent);
                    me.viewEvent = viewEvent;
                    callback(me, err, me.viewEvent);
            	});
            }
			else {
				me.viewEvent = me.viewEvent;
				console.log(me.viewEvent);
        		callback(me, err, me.viewEvent);
        	}
    	},
        ready: function() {
        	console.log('SKIN: mainBase ready() called');
        	var me = this; // contains the current context
        	// Controller
        	me.readyController(me, function(me, err, controller) {
        		if(err) {
        			console.log('SKIN: mainBase readyController error:');
        			console.log(err);
        		}
        		else {
        			console.log('SKIN: mainBase ready controller:');
        			console.log(controller);
        			me.controller = controller;
					// Set storeName
				    console.log('SKIN: mainBase ready me.controller.setStoreName(me.storeName):');
					// StoreName
					if(typeof me.storeName === 'undefined') {
						me.storeName = 'unknown'; // default
						console.log(me.storeName);
						me.controller.setStoreName(me.storeName);
					}
					else {
						me.storeName = me.storeName;
						console.log(me.storeName);
						me.controller.setStoreName(me.storeName);
					}
					// Config
					me.readyConfig(me, function(me, err, config) {
						if(err) {
							console.log('SKIN: mainBase readyConfig error:');
							console.log(err);
						}
						else {
							console.log('SKIN: mainBase ready config:');
							console.log(config);
							me.config = config;
							// Set config
							console.log('SKIN: mainBase ready me.controller.setConfig(me.config):');
							// Config
							if(typeof me.config === 'undefined') {
								me.config = {}; // default
								console.log(me.config);
								me.controller.setConfig(me.config);
							}
							else {
								me.config = me.config;
								console.log(me.config);
								me.controller.setConfig(me.config);
							}
							// ServiceBus
							me.readyServiceBus(me, function(me, err, serviceBus) {
								if(err) {
									console.log('SKIN: mainBase readyServiceBus error:');
									console.log(err);
								}
								else {
									console.log('SKIN: mainBase ready serviceBus:');
									console.log(serviceBus);
									me.serviceBus = serviceBus;
									// Set serviceBus
									console.log('SKIN: mainBase ready me.controller.setServiceBus(me.serviceBus):');
									// ServiceBus
									if(typeof me.serviceBus === 'undefined') {
										me.serviceBus = {}; // default
										console.log(me.serviceBus);
										me.controller.setServiceBus(me.serviceBus);
									}
									else {
										me.serviceBus = me.serviceBus;
										console.log(me.serviceBus);
										me.controller.setServiceBus(me.serviceBus);
									}
									// AppController
									me.readyAppController(me, function(me, err, appController) {
										if(err) {
											console.log('SKIN: mainBase readyAppController error:');
											console.log(err);
										}
										else {
											console.log('SKIN: mainBase ready appController:');
											console.log(appController);
											me.appController = appController;
											// Set appController
											console.log('SKIN: mainBase ready me.controller.setAppController(me.appController):');
											// AppController
											if(typeof me.appController === 'undefined') {
												me.appController = {}; // default
												console.log(me.appController);
												me.controller.setAppController(me.appController);
											}
											else {
												me.appController = me.appController;
												console.log(me.appController);
												me.controller.setAppController(me.appController);
											}
											// AppService
											me.readyAppService(me, function(me, err, appService) {
												if(err) {
													console.log('SKIN: mainBase readyAppService error:');
													console.log(err);
												}
												else {
													console.log('SKIN: mainBase ready appService:');
													console.log(appService);
													me.appService = appService;
													// Set appService
													console.log('SKIN: mainBase ready me.controller.setAppService(me.appService):');
													// AppService
													if(typeof me.appService === 'undefined') {
														me.appService = {}; // default
														console.log(me.appService);
														me.controller.setAppService(me.appService);
													}
													else {
														me.appService = me.appService;
														console.log(me.appService);
														me.controller.setAppService(me.appService);
													}
													// App
													me.readyApp(me, function(me, err, app) {
														if(err) {
															console.log('SKIN: mainBase readyApp error:');
															console.log(err);
														}
														else {
															console.log('SKIN: mainBase ready app:');
															console.log(app);
															me.app = app;
															// Set app
															console.log('SKIN: mainBase ready me.controller.setApp(me.app):');
															// App
															if(typeof me.app === 'undefined') {
																me.app = {}; // default
																console.log(me.app);
																me.controller.setApp(me.app);
															}
															else {
																me.app = me.app;
																console.log(me.app);
																me.controller.setApp(me.app);
															}
															// AppEvent
															me.readyAppEvent(me, function(me, err, appEvent) {
																if(err) {
																	console.log('SKIN: mainBase readyAppEvent error:');
																	console.log(err);
																}
																else {
																	console.log('SKIN: mainBase ready appEvent:');
																	console.log(appEvent);
																	me.appEvent = appEvent;
																	// Set appEvent
																	console.log('SKIN: mainBase ready me.controller.setAppEvent(me.appEvent):');
																	// AppEvent
																	if(typeof me.appEvent === 'undefined') {
																		me.appEvent = {}; // default
																		console.log(me.appEvent);
																		me.controller.setAppEvent(me.appEvent);
																	}
																	else {
																		me.appEvent = me.appEvent;
																		console.log(me.appEvent);
																		me.controller.setAppEvent(me.appEvent);
																	}
																	// Subscribe AppService
																	console.log('SKIN: mainBase ready this.controller.subscribeAppService()');
				    												me.controller.subscribeAppService();
				    												// More ...

																}
															});// eof AppEvent
														}
													});// eof App
												}
											});// eof AppService
										}
									});// eof AppController
									// ViewController
									me.readyViewController(me, function(me, err, viewController) {
										if(err) {
											console.log('SKIN: mainBase readyViewController error:');
											console.log(err);
										}
										else {
											console.log('SKIN: mainBase ready viewController:');
											console.log(viewController);
											me.viewController = viewController;
											// Set viewController
											console.log('SKIN: mainBase ready me.controller.setViewController(me.viewController):');
											// ViewController
											if(typeof me.viewController === 'undefined') {
												me.viewController = {}; // default
												console.log(me.viewController);
												me.controller.setViewController(me.viewController);
											}
											else {
												me.viewController = me.viewController;
												console.log(me.viewController);
												me.controller.setViewController(me.viewController);
											}
											// ViewService
											me.readyViewService(me, function(me, err, viewService) {
												if(err) {
													console.log('SKIN: mainBase readyViewService error:');
													console.log(err);
												}
												else {
													console.log('SKIN: mainBase ready viewService:');
													console.log(viewService);
													me.viewService = viewService;
													// Set viewService
													console.log('SKIN: mainBase ready me.controller.setViewService(me.viewService):');
													// ViewService
													if(typeof me.viewService === 'undefined') {
														me.viewService = {}; // default
														console.log(me.viewService);
														me.controller.setViewService(me.viewService);
													}
													else {
														me.viewService = me.viewService;
														console.log(me.viewService);
														me.controller.setViewService(me.viewService);
													}
													// View
													me.readyView(me, function(me, err, view) {
														if(err) {
															console.log('SKIN: mainBase readyView error:');
															console.log(err);
														}
														else {
															console.log('SKIN: mainBase ready view:');
															console.log(view);
															me.view = view;
															// Set view
															console.log('SKIN: mainBase ready me.controller.setView(me.view):');
															// View
															if(typeof me.view === 'undefined') {
																me.view = {}; // default
																console.log(me.view);
																me.controller.setView(me.view);
															}
															else {
																me.view = me.view;
																console.log(me.view);
																me.controller.setView(me.view);
															}
															// ViewEvent
															me.readyViewEvent(me, function(me, err, viewEvent) {
																if(err) {
																	console.log('SKIN: mainBase readyViewEvent error:');
																	console.log(err);
																}
																else {
																	console.log('SKIN: mainBase ready viewEvent:');
																	console.log(viewEvent);
																	me.viewEvent = viewEvent;
																	// Set viewEvent
																	console.log('SKIN: mainBase ready me.controller.setViewEvent(me.viewEvent):');
																	// ViewEvent
																	if(typeof me.viewEvent === 'undefined') {
																		me.viewEvent = {}; // default
																		console.log(me.viewEvent);
																		me.controller.setViewEvent(me.viewEvent);
																	}
																	else {
																		me.viewEvent = me.viewEvent;
																		console.log(me.viewEvent);
																		me.controller.setViewEvent(me.viewEvent);
																	} // eof ViewEvent
																	// Subscribe ViewService
																	console.log('SKIN: mainBase ready me.controller.subscribeViewService()');
				    												me.controller.subscribeViewService();
				    												// LoadView, before renderView
                                                                    console.log('SKIN: mainBase ready me.controller.loadView(viewIndex):')
                                                                    // ViewIndex
                                                                    if(typeof me.viewIndex === 'undefined') {
                                                                        me.viewIndex = 0; // default
                                                                        console.log(me.viewIndex);
                                                                        me.controller.loadView(me.viewIndex);
                                                                    }
                                                                    else {
                                                                        me.viewIndex = me.viewIndex;
                                                                        console.log(me.viewIndex);
                                                                        me.controller.loadView(me.viewIndex);
                                                                    }// oef ViewIndex
                                                                    // RenderView, after loadView
                                                                    console.log('SKIN: mainBase ready me.controller.renderView(elementId):');
                                                                    // ElementId
                                                                    if(typeof me.elementId === 'undefined'){
                                                                        me.elementId = 'unknown'; // default
                                                                        console.log(me.elementId);
                                                                        me.controller.renderView(me.elementId);
                                                                    }
                                                                    else {
                                                                        me.elementId = me.elementId;
                                                                        console.log(me.elementId);
                                                                        me.controller.renderView(me.elementId);
                                                                    }// eof ElementId
																}
															});// eof ViewEvent
														}
													});// eof View
												}
											});// eof ViewService
										}
									});// eof ViewController
								}
							});// eof ServiceBus
						}
					});// eof Config
        		}
        	});// eof Controller
        }
    };
    return mainBase;
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.flume.conf.source (Apache Flume 1.7.0 API)</title>
<meta name="date" content="2016-10-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.apache.flume.conf.source

Classes

SourceConfiguration

Enums

SourceConfiguration.SourceConfigurationType

SourceType

redpajama_set_name: RedPajamaGithub


text:
    //
    //  Food.m
    //  iZJU
    //
    //  Created by 爱机 on 12-8-19.
    //  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
    //

#import <QuartzCore/QuartzCore.h>
#import "Food.h"
#import "PopularFoodViewController.h"
#import "PopularTakeawayViewController.h"

@interface Food ()

@end

@implementation Food
@synthesize tableView = _tableView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
            // Custom initialization
        self.title = @"美食";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
        // Do any additional setup after loading the view from its nib.

    self.navigationItem.backBarButtonItem.tintColor = [UIColor blackColor];
    if (IS_IOS_5) {
        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"foodbar.png"]
                                                      forBarMetrics:UIBarMetricsDefault];
    }
    else {
        [self.navigationController.navigationBar setTintColor:[UIColor blueColor]];
    }
    UIImageView *tablebg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foodoptablebg.png"]];
    self.tableView.backgroundView = tablebg;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Actions

#pragma mark - UITableView Delegate & Datasource

- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section
{
    return 3;
}

- (UITableViewCell*)tableView:(UITableView *)tableView
        cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FoodCell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                      reuseIdentifier:@"FoodCell"];
        cell.textLabel.textColor=[UIColor whiteColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        UIImageView *bg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
        bg.contentMode = UIViewContentModeTop;
        bg.image = [UIImage imageNamed:@"cell_separator.png"];
        cell.backgroundView = bg;

        UIImageView *indicator = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 120, 10)];
        indicator.contentMode = UIViewContentModeLeft;
        indicator.image = [UIImage imageNamed:@"indicator_arrow.png"];
        cell.accessoryView = indicator;
    }
    switch (indexPath.row) {
        case 0:
        {
            cell.textLabel.text = @"热门美食";
            cell.imageView.image=[UIImage imageNamed:@"popularfoodicon.png"];
        }
            break;
        case 1:
            cell.textLabel.text = @"热门外卖";
            cell.imageView.image=[UIImage imageNamed:@"populartakeawayicon.png"];
            break;
        case 2:
            cell.accessoryType = UITableViewCellAccessoryNone;
            cell.accessoryView = nil;
        default:
            break;
    }

    return cell;
}

- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.tableView deselectRowAtIndexPath:indexPath
                                  animated:YES];
    switch (indexPath.row) {
        case 0:
        {
            PopularFoodViewController *popularFood = [[PopularFoodViewController alloc] init];
            [self.navigationController pushViewController:popularFood
                                                 animated:YES];
        }
            break;
        case 1:
        {
            PopularTakeawayViewController *popularTakeaway = [[PopularTakeawayViewController alloc] init];
            [self.navigationController pushViewController:popularTakeaway
                                                 animated:YES];
        }
            break;
        default:
            break;
    }
}
@end


text:
/* CSS Custom Properties available for reference,
but not using for now due to no IE support */
:root {
  --primaryText: #000000;
  --secondaryText: #8E9AA3;
  --tertiaryText: #B3BCC3;
  --dividerLines: #E1E4E7;
  --fieldBg: #F5F6FA;
  --homeBg: #F3F4FB;
  --darkPurple: #39298C;
  --medPurple: #5645F5;
  --lightPurple: #E7E5FD;
  --darkTeal: #1E4855;
  --teal: #19CDA6;
  --lightBlue: #92b5d8;
  --primaryTheme: var(--darkPurple);
}

a,
p a {
  color: #39298C;
  transition: all 0.2s;
  text-decoration: underline;
}

a:hover,
p a:hover {
  color: #19CDA6;
}

sub {
  vertical-align: sub;
  font-size: smaller;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'NB International Pro', 'Helvetica', sans-serif;
  font-weight: bold;
}

.heroBanner {
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

@media screen and (max-width: 966px) {
  .heroBanner {
    padding: 2rem;
  }
}

.buttons {
  display: flex;
  align-items: center;
  justify-content: center;
}

.features {
  display: flex;
  align-items: center;
  padding: 2rem 0;
  width: 100%;
}

.featureImage {
  height: 200px;
  width: 200px;
}

/*
 * Copyright (c) The Diem Core Contributors
 * SPDX-License-Identifier: CC-BY-4.0
 */

html body {
  font-family: 'NB International Pro', 'Helvetica', sans-serif;
  overflow-x: hidden;
  font-size: 16px;
}

small.figure {
  text-transform: uppercase;
  font-weight: bold;
  font-size: 10pt;
  margin: 0 auto;
}

body {
  padding: 0px !important;
}
nav {
  font-size: 14px;
  border: 0px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.navSpacer {
  height: 120px;
}
.navPusher {
  height: calc(100vh - 120px);
  min-height: calc(100vh - 120px);
  overflow-y: scroll;
  padding-top: 0;
}

.fixedHeaderContainer {
  background-color: #fff;
  padding: 0;
}

.headerWrapper {
  background-color: #fff;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e5e5;
  height: 60px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  display: flex;
}

.headerWrapper.wrapper:not(:first-child) {
  padding: 0;
  height: 60px;
}

.hidden {
  display: none !important;
}

.mobile-hidden {
  display: none;
}

.mobile {
  color: black; /* TODO remove */
}

.pointer {
  cursor: pointer;
}

.fixedHeaderContainer header {
  display: flex;
  align-items: center;
  flex: 1;
}

.fixedHeaderContainer header img {
  margin-right: 0;
}

header .main-nav {
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  flex: 1;
}

header .sub-nav-trigger,
header .main-nav .main-nav-trigger {
  position: relative;
  z-index: 10000;
  height: 22px;
  width: 22px;
  cursor: pointer;
  box-sizing: content-box;
}

header .main-nav .main-nav-trigger.trigger-open {
  margin-left: -5px;
}

header .main-nav .main-nav-trigger.trigger-close {
  margin-left: -7px;
  padding-right: 2px;
}

header .main-nav .logo-container {
  width: 100%;
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;
}

header .main-nav .logo-container .logo {
  height: 21px;
}

header .main-nav .logo-container .docs-image > * {
  color: #39298c;
  height: 100%;
}

.fixedHeaderContainer header .headerTitleWithLogo {
  display: none;
}

.navigationSlider {
  height: unset;
}

.navigationSlider .slidingNav {
  top: unset;
  margin-top: calc(0.4rem + 1px);
}

.navigationSlider .slidingNav ul {
  background: #fff;
  align-items: flex-start;
  flex-direction: column;
  margin-top: 0;
  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.navigationSlider .slidingNav ul li a {
  color: #414f64;
  background-color: #fff;
  transition: all 0.2s;
  font-weight: 300;
  font-size: 16px;
  line-height: 40px;
  text-shadow: 0.5px 0 0;
  letter-spacing: 0.5px;
}

.navigationSlider .slidingNav ul li.siteNavItemActive > a,
.navigationSlider .slidingNav ul li.siteNavGroupActive > a,
.navigationSlider .slidingNav ul li a:hover,
.navigationSlider .slidingNav ul li a:focus {
  color: #39298c;
  background-color: inherit;
}

.navigationSlider .slidingNav ul li.highlight > a {
  height: 3rem;
  border-radius: 2.25rem;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  background-color: #42318c;
  color: #fff;
  padding: 0.8em 1.8rem;
  text-shadow: 0.5px 0 0;
  letter-spacing: 0.5px;
  margin-top: 10px;
}

#SubNav {
  border: 1px solid #e5e5e5;
  border-left: none;
  border-right: none;
  border-top: none;
  background-color: #f9f8f8;
  color: #354052;
  height: 60px;
  display: flex;
  align-items: center;
  flex-flow: row nowrap;
  position: relative;
  z-index: 1;
}

#SubNav header {
  display: flex;
  justify-content: space-between;
  flex: 1;
}

#SubNav .breadcrumb {
  display: flex;
  flex-direction: column-reverse;
}

#SubNav .breadcrumb h2 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  line-height: 23px;
}

#SubNav .navigationSlider .slidingNav {
  margin-top: 30px;
}

#SubNav .navigationSlider .slidingNav ul li:not(:first-child) {
  margin-left: 0px;
}

#SubNav .navigationSlider .slidingNav ul,
#SubNav .navigationSlider .slidingNav ul li a {
  background-color: transparent;
  color: #000000;
  font-size: 16px;
  font-weight: 300;
  line-height: 15px;
  text-align: right;
}

#SubNav .navigationSlider .slidingNav ul {
  background-color: #fff;
}

#SubNav .navigationSlider .slidingNav ul li a {
  background-color: transparent;
  height: 40px;
  text-shadow: none;
}

#SubNav .navigationSlider .slidingNav ul li.siteNavItemActive > a,
#SubNav .navigationSlider .slidingNav ul li.siteNavGroupActive > a {
  color: #42318c;
  text-decoration: none;
}

#SubNav .navigationSlider .slidingNav ul li a:hover,
#SubNav .navigationSlider .slidingNav ul li a:focus {
  color: #39298c;
}

#SubNav .breadcrumb a {
  color: #5f7186;
  height: unset;
  font-size: 12px;
  line-height: 14px;
}

#SubNav .breadcrumb a span {
  margin: 0;
}

.homeContainer,
.formHero {
  background-color: #1e4855;
  background-image: url('/img/hero.jpg');
  background-size: cover;
  padding: 4rem 0;
}

.splashLogo {
  display: block;
  margin: 0 auto;
  height: 100px;
  width: 275px;
}

.projectTitle {
  color: #ffffff;
  font-weight: 300;
  line-height: 1em;
}

.homeContainer .projectTitle > small {
  line-height: 1.3em;
}

.landingPage {
  padding: 0px;
}

div.productShowcaseSection {
  color: #24292e;
}

.productShowcaseSection > h2 {
  color: #000;
  font-size: 2rem;
  font-weight: 360;
  margin: 0px;
  padding: 0px;
}

.productShowcaseSection h4 {
  font-size: 1.5rem;
  color: #39298c !important;
  padding-top: 0em;
  margin-top: 0em;
}

.productShowcaseSection p {
  font-weight: 360;
}

.productShowcaseSection div.container {
  padding: 0px 0px;
}

.productShowcaseSection div.blockImage {
  height: 80px;
}

.productShowcaseSection li {
  padding: 10px 0;
}

.productShowcaseSection pre {
  margin: 10px 0;
  background: #f3f4fb;
  border: 1px solid #e1e4e7;
  border-radius: 5px;
}

.productShowcaseSection code {
  background: #f3f4fb;
  padding: 1em;
}

.container .wrapper .alignCenter h2 {
  color: #222222;
}

div#quickstart {
  background: #fff;
}

div#quickstart ol {
  margin-bottom: 0px;
}

.nav-footer {
  background-color: #15112c;
}

.nav-footer .sitemap a {
  color: #efefef;
}

.nav-footer .sitemap a:hover {
  color: #19cda6;
}

.nav-footer h5 {
  padding-top: 5px;
  font-size: 13pt;
}

a,
p a {
  color: #39298c;
  transition: all 0.2s;
}

a:hover,
p a:hover {
  color: #19cda6;
}

sup {
  vertical-align: super;
  font-size: smaller;
}

sub {
  vertical-align: sub;
  font-size: smaller;
}

.promoSection .promoRow .pluginRowBlock .pluginWrapper {
    padding: 0 2px;
}

.promoSection .promoRow .pluginWrapper {
    display: block;
}

/* Style docs */
.toc .toggleNav .navGroup .navGroupCategoryTitle {
  color: #222222;
}

.toc .toggleNav .navGroup .navGroupSubcategoryTitle {
  color: #24292e;
}

.onPageNav {
  top: 140px;
}

.onPageNav a {
  color: #24292e;
}

.toc .toggleNav ul li a {
  color: #24292e;
}

.toc .toggleNav ul li a:hover {
  color: #39298c;
}

.toc .toggleNav .navGroup .navListItemActive a {
  color: #39298c;
}

.docsNavContainer .toc .navBreadcrumb {
  background-color: #e1e4e7;
}

.mainContainer {
  padding-top: 3rem;
}

.mainContainer .wrapper .post .postHeaderTitle {
  color: #222222;
  font-size: 1.8rem;
}

.mainContainer .wrapper .post h1,
.mainContainer .wrapper .post h2,
.mainContainer .wrapper .post h3 {
  color: #222222;
}

.mainContainer .wrapper .post {
  color: #24292e;
}

.mainContainer .wrapper .post strong {
  color: #222222;
}

.wrapper {
  max-width: 1400px;
}

h2,
h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
  border-bottom: 0px !important;
}

article p img.download {
  margin: 0;
}

@media only screen and (min-width: 480px) {
  .projectTitle {
    font-size: 300%;
    margin: .3em 0;
  }
}

@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
}

@media only screen and (min-width: 1024px) {
  .mobile-hidden {
    display: unset;
  }
  .mobile {
    display: none;
  }
  .navSpacer {
    height: 80px;
  }
  .navPusher {
    height: calc(100vh - 120px);
    min-height: calc(100vh - 120px);
    padding-top: 40px;
  }

  .headerWrapper {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border: none;
    height: 80px;
  }

  .fixedHeaderContainer header {
    display: block;
  }

  .fixedHeaderContainer header img {
    margin-right: 10px;
  }

  header .main-nav {
    flex-flow: row nowrap;
  }

  .navigationSlider .slidingNav {
    margin-top: 0;
  }

  .navigationSlider .slidingNav ul {
    align-items: center;
    flex-direction: row;
    border-bottom: none;
    padding: 0;
  }

  .navigationSlider .slidingNav ul li:not(:first-child) {
    margin-left: 18px;
  }

  .navigationSlider .slidingNav ul li a {
    color: #39298c;
    line-height: 24px;
    padding: 0.5em 1em;
    font-weight: 300;
    font-size: 14px;
  }

  .navigationSlider .slidingNav ul li a:hover,
  .navigationSlider .slidingNav ul li a:focus,
  .navigationSlider .slidingNav ul li.siteNavItemActive > a,
  .navigationSlider .slidingNav ul li.siteNavGroupActive > a {
    text-decoration: underline;
  }

  .navigationSlider .slidingNav ul li.highlight > a {
    margin-top: 0;
  }

  #SubNav {
    border-top: 1px solid #e5e5e5;
    height: 60px;
  }

  #SubNav .breadcrumb {
    flex-direction: row;
  }

  #SubNav .breadcrumb h2 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    line-height: 32px;
  }

  #SubNav .navigationSlider .slidingNav {
    margin-top: 0;
  }

  #SubNav .navigationSlider .slidingNav ul,
  #SubNav .navigationSlider .slidingNav ul li a {
    background-color: transparent;
    color: #000000;
    font-size: 14px;
    font-weight: 300;
    line-height: 15px;
    text-align: right;
  }

  #SubNav .navigationSlider .slidingNav ul li.siteNavItemActive > a,
  #SubNav .navigationSlider .slidingNav ul li.siteNavGroupActive > a {
    color: #42318c;
    text-decoration: none;
  }

  #SubNav .navigationSlider .slidingNav ul li a:hover,
  #SubNav .navigationSlider .slidingNav ul li a:focus {
    color: #39298c;
  }

  #SubNav .breadcrumb a {
    font-size: 14px;
    line-height: 15px;
  }

  #SubNav .breadcrumb a span {
    margin-left: 0.5em;
  }

  .docsNavContainer {
    top: 40px;
  }
  .docsNavContainer,
  .onPageNav > .toc-headings {
    padding-bottom: 140px;
  }

  .onPageNav {
    top: 80px;
  }

  .docsContainer {
    padding-top: 80px;
  }
}

@media only screen and (max-width: 1023px) {
  .tocActive .onPageNav {
    top: 168px;
  }
}

@media only screen and (min-width: 1400px) {
}

@media only screen and (min-width: 1500px) {
}

blockquote {
  /* FIG slate color */
  background-color: #f8fafb;
  border-left: 8px solid #a8bbc3;
  padding: 15px 30px 15px 15px;
  color: #24292e;
}

blockquote.block_note {
  /* FIG lemon color */
  background-color: #fffbf0;
  border-left: 8px solid #f5c33b;
  padding: 15px 30px 15px 15px;
  color: #24292e;
}

.nav-home img {
  width: 57px;
  height: 57px;
  /* override max width so logo isn't squashed */
  max-width: none;
}

.button {
    border: 1px solid #33f;
    border-radius: 3px;
    color: #33f;
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2em;
    padding: 10px;
    text-decoration: none!important;
    text-transform: uppercase;
    transition: background .3s,color .3s;
}
.button {
  position: relative;
  min-width: 5em;
  border-radius: 5em;
  margin: 0.5em;
  padding: 1em;
  text-align: center;
  transition: all 0.2s;
  background: transparent;
  border-color: #5645F5;
  color: #5645F5;
}

.promoSection .button {
  border-color: #E7E5FD;
  color: #E7E5FD;
}

.button:hover,
.promoSection .button:hover {
  background: inherit;
  border-color: #19CDA6;
  color: #19CDA6;
}

.button[type="submit"],
.button.secondary,
.docs-next,
.docs-prev {
  background-color: #39298C;
  color: #fff;
  font-weight: bold;
}

.button[type="submit"]:hover,
.button.secondary:hover,
.docs-next:hover,
.docs-prev:hover {
  background-color: #19CDA6;
  color: #fff;
}

#back-to-top {
  background: #39298C;
}

/* "Copy" code block button */
pre {
  position: relative;
}

pre .btnIcon {
  position: absolute;
  top: 4px;
  z-index: 2;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0;
  color: #5645F5;
  background-color: transparent;
  height: 30px;
  transition: all .25s ease-out;
}

pre .btnIcon:hover {
  text-decoration: none;
}

.btnIcon__body {
  align-items: center;
  display: flex;
}

.btnIcon svg {
  fill: currentColor;
  margin-right: .4em;
}

.btnIcon__label {
  font-size: 11px;
  font-family: 'Helvetica', sans-serif;
  text-transform: uppercase;
}

.btnClipboard {
  right: 10px;
}

pre .btnIcon:hover {
  color: #19CDA6;
}


text:
<?php

// autoload_classmap.php @generated by Composer

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

return array(
    'DluTwBootstrap\\Module' => $vendorDir . '/dlu/dlutwbootstrap/Module.php',
    'StrokerForm\\Module' => $vendorDir . '/stroker/form/Module.php',
    'ZfcAdmin\\Module' => $vendorDir . '/zf-commons/zfc-admin/Module.php',
    'ZfcBase\\Module' => $vendorDir . '/zf-commons/zfc-base/Module.php',
    'ZfcUser\\Module' => $vendorDir . '/zf-commons/zfc-user/Module.php',
);


text:
/* $Xorg: AuGetAddr.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */

/*

Copyright 1988, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.

*/
/* $XFree86: xc/lib/Xau/AuGetAddr.c,v 1.5 2001/12/14 19:54:36 dawes Exp $ */

#include <X11/Xauth.h>
#include <X11/Xos.h>

static int
binaryEqual (_Xconst char *a, _Xconst char *b, int len)
{
    while (len--)
	if (*a++ != *b++)
	    return 0;
    return 1;
}

#if NeedFunctionPrototypes
Xauth *
XauGetAuthByAddr (
#if NeedWidePrototypes
unsigned int	family,
unsigned int	address_length,
#else
unsigned short	family,
unsigned short	address_length,
#endif
_Xconst char*	address,
#if NeedWidePrototypes
unsigned int	number_length,
#else
unsigned short	number_length,
#endif
_Xconst char*	number,
#if NeedWidePrototypes
unsigned int	name_length,
#else
unsigned short	name_length,
#endif
_Xconst char*	name)
#else
Xauth *
XauGetAuthByAddr (family, address_length, address,
			  number_length, number,
			  name_length, name)
unsigned short	family;
unsigned short	address_length;
char	*address;
unsigned short	number_length;
char	*number;
unsigned short	name_length;
char	*name;
#endif
{
    FILE    *auth_file;
    char    *auth_name;
    Xauth   *entry;

    auth_name = XauFileName ();
	fprintf(stderr,"%s gots line %d auth_name=%s\n",__FILE__, __LINE__, auth_name);
    if (!auth_name)
	return 0;
    if (access (auth_name, R_OK) != 0)		/* checks REAL id */
	return 0;
    auth_file = fopen (auth_name, "rb");
    if (!auth_file)
	fprintf(stderr,"%s gots line %d auth_name=%s\n",__FILE__, __LINE__, auth_name);
	return 0;
    for (;;) {
	entry = XauReadAuth (auth_file);
	if (!entry)
	    break;
	/*
	 * Match when:
	 *   either family or entry->family are FamilyWild or
	 *    family and entry->family are the same and
	 *     address and entry->address are the same
	 *  and
	 *   either number or entry->number are empty or
	 *    number and entry->number are the same
	 *  and
	 *   either name or entry->name are empty or
	 *    name and entry->name are the same
	 */

	if ((family == FamilyWild || entry->family == FamilyWild ||
	     (entry->family == family &&
	      address_length == entry->address_length &&
	      binaryEqual (entry->address, address, (int)address_length))) &&
	    (number_length == 0 || entry->number_length == 0 ||
	     (number_length == entry->number_length &&
	      binaryEqual (entry->number, number, (int)number_length))) &&
	    (name_length == 0 || entry->name_length == 0 ||
	     (entry->name_length == name_length &&
 	      binaryEqual (entry->name, name, (int)name_length))))
	    break;
	XauDisposeAuth (entry);
    }
    (void) fclose (auth_file);
    return entry;
}


text:
PORT=8000
DIR=public

# Python >= 3.7 is required for the --directory argument
python3.7 -m http.server "$PORT" --directory "$DIR"


text:
from .aws import Action as BaseAction
from .aws import BaseARN

service_name = "AWS Panorama"
prefix = "panorama"

class Action(BaseAction):
    def __init__(self, action: str = None) -> None:
        super().__init__(prefix, action)

class ARN(BaseARN):
    def __init__(self, resource: str = "", region: str = "", account: str = "") -> None:
        super().__init__(
            service=prefix, resource=resource, region=region, account=account
        )

CreateApp = Action("CreateApp")
CreateAppDeployment = Action("CreateAppDeployment")
CreateAppVersion = Action("CreateAppVersion")
CreateApplicationInstance = Action("CreateApplicationInstance")
CreateDataSource = Action("CreateDataSource")
CreateDeploymentConfiguration = Action("CreateDeploymentConfiguration")
CreateDevice = Action("CreateDevice")
CreateDeviceUpdate = Action("CreateDeviceUpdate")
CreateInputs = Action("CreateInputs")
CreateJobForDevices = Action("CreateJobForDevices")
CreateModel = Action("CreateModel")
CreateNodeFromTemplateJob = Action("CreateNodeFromTemplateJob")
CreatePackage = Action("CreatePackage")
CreatePackageImportJob = Action("CreatePackageImportJob")
CreateStreams = Action("CreateStreams")
DeleteApp = Action("DeleteApp")
DeleteAppVersion = Action("DeleteAppVersion")
DeleteDataSource = Action("DeleteDataSource")
DeleteDevice = Action("DeleteDevice")
DeleteModel = Action("DeleteModel")
DeletePackage = Action("DeletePackage")
DeregisterPackageVersion = Action("DeregisterPackageVersion")
DescribeApp = Action("DescribeApp")
DescribeAppDeployment = Action("DescribeAppDeployment")
DescribeAppVersion = Action("DescribeAppVersion")
DescribeApplicationInstance = Action("DescribeApplicationInstance")
DescribeApplicationInstanceDetails = Action("DescribeApplicationInstanceDetails")
DescribeDataSource = Action("DescribeDataSource")
DescribeDevice = Action("DescribeDevice")
DescribeDeviceJob = Action("DescribeDeviceJob")
DescribeDeviceUpdate = Action("DescribeDeviceUpdate")
DescribeModel = Action("DescribeModel")
DescribeNode = Action("DescribeNode")
DescribeNodeFromTemplateJob = Action("DescribeNodeFromTemplateJob")
DescribePackage = Action("DescribePackage")
DescribePackageImportJob = Action("DescribePackageImportJob")
DescribePackageVersion = Action("DescribePackageVersion")
DescribeSoftware = Action("DescribeSoftware")
GetDeploymentConfiguration = Action("GetDeploymentConfiguration")
GetInputs = Action("GetInputs")
GetStreams = Action("GetStreams")
GetWebSocketURL = Action("GetWebSocketURL")
ListAppDeploymentOperations = Action("ListAppDeploymentOperations")
ListAppVersions = Action("ListAppVersions")
ListApplicationInstanceDependencies = Action("ListApplicationInstanceDependencies")
ListApplicationInstanceNodeInstances = Action("ListApplicationInstanceNodeInstances")
ListApplicationInstances = Action("ListApplicationInstances")
ListApps = Action("ListApps")
ListDataSources = Action("ListDataSources")
ListDeploymentConfigurations = Action("ListDeploymentConfigurations")
ListDeviceUpdates = Action("ListDeviceUpdates")
ListDevices = Action("ListDevices")
ListDevicesJobs = Action("ListDevicesJobs")
ListModels = Action("ListModels")
ListNodeFromTemplateJobs = Action("ListNodeFromTemplateJobs")
ListNodes = Action("ListNodes")
ListPackageImportJobs = Action("ListPackageImportJobs")
ListPackages = Action("ListPackages")
ListTagsForResource = Action("ListTagsForResource")
ProvisionDevice = Action("ProvisionDevice")
RegisterPackageVersion = Action("RegisterPackageVersion")
RemoveApplicationInstance = Action("RemoveApplicationInstance")
TagResource = Action("TagResource")
UntagResource = Action("UntagResource")
UpdateApp = Action("UpdateApp")
UpdateAppConfiguration = Action("UpdateAppConfiguration")
UpdateDataSource = Action("UpdateDataSource")
UpdateDevice = Action("UpdateDevice")
UpdateDeviceMetadata = Action("UpdateDeviceMetadata")


text:
/*jslint white:true, browser:true, plusplus:true, nomen:true, vars:true, bitwise:true */
/*global wooga */

(function () {

    "use strict";

    var PersonView = wooga.castle.PersonView = function (person, worldView) {
        this.definition = wooga.castle.entityDefinitions[wooga.castle.Person.DEFINTION_URI];

        this.entity = person;

        this.zIndex = this.definition.zIndex || 0;

        this._worldView = worldView;

        this.width = person.width * wooga.castle.GRID_UNIT;
        this.height = person.height * wooga.castle.GRID_UNIT;

        this.image = this.definition.image;
        this.spriteRatio = 1.3125;

        this.frameWidth = this.image.width / this.definition.animationLength;
        this.frameHeight = this.definition.height * this._worldView.gridUnit * this.spriteRatio;

        this.frameIndex = 0;

        this.color = Math.floor(Math.random() * 1000) % 5;

        this.frameX = 0;
        this.frameY = (this.spriteRatio  * this._worldView.gridUnit)* this.color * 2;

        person.addEventHandler("move", function () {
            this.updatePosition(person, this._worldView);
        }, this);

        person.addEventHandler("update walk direction", function (message) {
           this.updateImage(message.direction);
        }, this);
    };

    PersonView.prototype.updatePosition = function () {
        this.x = (this.entity.x * wooga.castle.GRID_UNIT + this._worldView.mapWidthPx / 2) | 0;
        this.y = (this.entity.y * wooga.castle.GRID_UNIT + this._worldView.mapHeightPx / 2) | 0;
    };

    PersonView.prototype.updateImage = function(walkDirection) {

        switch(walkDirection){
            case wooga.castle.Person.WalkDirection.RIGHT:
                this.frameY = (this._worldView.gridUnit * this.spriteRatio * this.color * 2) + this._worldView.gridUnit * this.spriteRatio;
                break;
            case wooga.castle.Person.WalkDirection.LEFT:
                this.frameY = (this.spriteRatio * this._worldView.gridUnit * this.color * 2);
                break;
        }
    };

    PersonView.prototype.draw = function (ctx, x, y) {
        x += Math.sin(Date.now() / 50);
        y += Math.sin(Date.now() / 50);

        ctx.drawImage(
                this.image,
                this.frameX, this.frameY, this.frameWidth, this.frameHeight,
                x, y, this.width, this.height);
    };

    PersonView.prototype.drawStatic = function () {};
    PersonView.prototype.drawDynamic = function () {};

}());


text:
var output = {
  solidJob : function(){
    document.getElementById("LessonTwoModuleOneOutput").innerHTML = "Excellent work. Now head on down to the next module!";
    LessonTwoModuleOnePicture.src = "assets/images/niceWork.gif";
  },

  reread : function(){
    document.getElementById("LessonTwoModuleOneOutput").innerHTML = "Uh oh! Go re-read the tutorial, and try out 'git status' in your terminal"
    LessonTwoModuleOnePicture.src = "assets/images/panic.gif"
  }
}


text:
namespace chrome_browser_net {

class NetworkStatsTest : public PlatformTest {
 public:
  NetworkStatsTest() {}
 protected:
  virtual void TearDown() {
    // Flush the message loop to make application verifiers happy.
    message_loop_.RunUntilIdle();
  }
  MessageLoopForIO message_loop_;
};

class NetworkStatsTestUDP : public NetworkStatsTest {
 public:
  NetworkStatsTestUDP()
      : test_server_(net::SpawnedTestServer::TYPE_UDP_ECHO,
                     net::SpawnedTestServer::kLocalhost,
                     base::FilePath(FILE_PATH_LITERAL("net/data"))) {
  }

 protected:
  void RunUDPEchoTest(int bytes, int packets, bool has_proxy) {
    net::TestCompletionCallback cb;

    scoped_ptr<net::MockHostResolver> host_resolver(
        new net::MockHostResolver());

    // We will use HISTOGRAM_PORT_MAX as the PortIndex enum for testing
    // purposes.
    NetworkStats* udp_stats_client = new NetworkStats();
    EXPECT_TRUE(udp_stats_client->Start(host_resolver.get(),
                                        test_server_.host_port_pair(),
                                        NetworkStats::HISTOGRAM_PORT_MAX,
                                        has_proxy,
                                        bytes,
                                        packets,
                                        cb.callback()));
    int rv = cb.WaitForResult();
    // Check there were no errors during connect/write/read to echo UDP server.
    EXPECT_EQ(0, rv);
  }

  net::SpawnedTestServer test_server_;
};

TEST_F(NetworkStatsTestUDP, UDPEcho100BytesHasProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(100, 1, true);
}

TEST_F(NetworkStatsTestUDP, UDPEcho100BytesNoProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(100, 1, false);
}

TEST_F(NetworkStatsTestUDP, UDPEcho500BytesHasProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(500, 1, true);
}

TEST_F(NetworkStatsTestUDP, UDPEcho500BytesNoProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(500, 1, false);
}

TEST_F(NetworkStatsTestUDP, UDPEcho1KBytesHasProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(1024, 1, true);
}

TEST_F(NetworkStatsTestUDP, UDPEcho1KBytesNoProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(1024, 1, false);
}

TEST_F(NetworkStatsTestUDP, UDPEchoMultiplePacketsHasProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(1024, 4, true);
}

TEST_F(NetworkStatsTestUDP, UDPEchoMultiplePacketsNoProxy) {
  ASSERT_TRUE(test_server_.Start());
  RunUDPEchoTest(1024, 4, false);
}

TEST_F(NetworkStatsTestUDP, VerifyBytesInvalidHeaders) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;
  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);

  std::string message;
  EXPECT_EQ(NetworkStats::ZERO_LENGTH_ERROR,
            network_stats.VerifyBytes(message));

  std::string version = base::StringPrintf("%02d", 1);
  std::string invalid_checksum = base::StringPrintf("%010d", 0);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string invalid_key = base::StringPrintf("%06d", -1);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string packet_number_string = base::StringPrintf("%010d", packet_number);
  std::string short_payload(packet_number_string +
      "1234567890123456789012345678901234567890123456789012345678901234567890");
  std::string long_payload(packet_number_string +
      "1234567890123456789012345678901234567890123456789012345678901234567890"
      "1234567890123456789012345678901234567890123456789012345678901234567890");

  message = version;
  EXPECT_EQ(NetworkStats::NO_CHECKSUM_ERROR,
            network_stats.VerifyBytes(message));

  message = version + invalid_checksum;
  EXPECT_EQ(NetworkStats::NO_PAYLOAD_SIZE_ERROR,
            network_stats.VerifyBytes(message));

  message = version + invalid_checksum + payload_size;
  EXPECT_EQ(NetworkStats::NO_KEY_ERROR, network_stats.VerifyBytes(message));

  message = version + invalid_checksum + payload_size + invalid_key;
  EXPECT_EQ(NetworkStats::NO_PAYLOAD_ERROR, network_stats.VerifyBytes(message));

  message = version + invalid_checksum + payload_size + invalid_key +
      short_payload;
  EXPECT_EQ(NetworkStats::INVALID_KEY_ERROR,
            network_stats.VerifyBytes(message));

  message = version + invalid_checksum + payload_size + key_string +
      short_payload;
  EXPECT_EQ(NetworkStats::TOO_SHORT_PAYLOAD,
            network_stats.VerifyBytes(message));

  message = version + invalid_checksum + payload_size + key_string +
      long_payload;
  EXPECT_EQ(NetworkStats::TOO_LONG_PAYLOAD, network_stats.VerifyBytes(message));
}

TEST_F(NetworkStatsTestUDP, VerifyBytesInvalidChecksum) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;

  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);

  std::string message;
  EXPECT_EQ(NetworkStats::ZERO_LENGTH_ERROR,
            network_stats.VerifyBytes(message));

  std::string version = base::StringPrintf("%02d", 1);
  std::string invalid_checksum = base::StringPrintf("%010d", 0);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string packet_number_string = base::StringPrintf("%010d", packet_number);

  scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(KBytesToSend));

  // Copy the Packet number into the payload.
  size_t packet_number_size = packet_number_string.size();
  memcpy(payload->data(), packet_number_string.c_str(), packet_number_size);

  // Get random bytes to fill rest of the payload.
  network_stats.stream_.GetBytes(payload->data() + packet_number_size,
                                 KBytesToSend - packet_number_size);

  // Calculate checksum for the payload.
  char* payload_data = payload->data();
  uint32 sum = network_stats.GetChecksum(payload_data, KBytesToSend);
  std::string checksum = base::StringPrintf("%010d", sum);

  char encoded_data[KBytesToSend];
  memset(encoded_data, 0, KBytesToSend);
  const char* key = key_string.c_str();
  network_stats.Crypt(
      key, key_string.length(), payload_data, KBytesToSend, encoded_data);
  std::string encoded_payload(encoded_data, KBytesToSend);

  // Test invalid checksum error by sending wrong checksum.
  message = version + invalid_checksum + payload_size + key_string +
      encoded_payload;
  EXPECT_EQ(NetworkStats::INVALID_CHECKSUM, network_stats.VerifyBytes(message));
}

TEST_F(NetworkStatsTestUDP, VerifyBytesPreviousPacket) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;

  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);
  uint32 prev_packet_number = packet_number - 1;

  std::string message;
  std::string version = base::StringPrintf("%02d", 1);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string prev_packet_number_string =
      base::StringPrintf("%010d", prev_packet_number);

  // Copy the previous packet number into the payload.
  scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(KBytesToSend));
  size_t packet_number_size = prev_packet_number_string.size();
  memcpy(payload->data(), prev_packet_number_string.c_str(),
         packet_number_size);

  // Get random bytes to fill rest of the payload.
  network_stats.stream_.GetBytes(payload->data() + packet_number_size,
                                 KBytesToSend - packet_number_size);

  // Calculate checksum for the previous packet number payload.
  char* payload_data = payload->data();
  uint32 sum = network_stats.GetChecksum(payload_data, KBytesToSend);
  std::string checksum = base::StringPrintf("%010d", sum);

  char encoded_data[KBytesToSend];
  memset(encoded_data, 0, KBytesToSend);
  const char* key = key_string.c_str();
  network_stats.Crypt(
      key, key_string.length(), payload_data, KBytesToSend, encoded_data);
  std::string encoded_payload(encoded_data, KBytesToSend);

  message = version + checksum + payload_size + key_string +  encoded_payload;
  EXPECT_EQ(NetworkStats::PREVIOUS_PACKET_NUMBER,
            network_stats.VerifyBytes(message));
  EXPECT_EQ(0u, network_stats.packets_received_mask());
}

TEST_F(NetworkStatsTestUDP, VerifyBytesInvalidPacketNumber) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;

  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);
  uint32 corrupt_packet_number = packet_number + 1;

  std::string message;
  std::string version = base::StringPrintf("%02d", 1);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string corrupt_packet_number_string =
      base::StringPrintf("%010d", corrupt_packet_number);

  scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(KBytesToSend));
  size_t packet_number_size = corrupt_packet_number_string.size();
  memcpy(payload->data(), corrupt_packet_number_string.c_str(),
         packet_number_size);

  // Get random bytes to fill rest of the payload.
  network_stats.stream_.GetBytes(payload->data() + packet_number_size,
                                 KBytesToSend - packet_number_size);

  // Calculate checksum for the corrupt packet number payload.
  char* payload_data = payload->data();
  uint32 sum = network_stats.GetChecksum(payload_data, KBytesToSend);
  std::string checksum = base::StringPrintf("%010d", sum);

  char encoded_data[KBytesToSend];
  memset(encoded_data, 0, KBytesToSend);
  const char* key = key_string.c_str();
  network_stats.Crypt(
      key, key_string.length(), payload_data, KBytesToSend, encoded_data);
  std::string encoded_payload(encoded_data, KBytesToSend);
  message = version + checksum + payload_size + key_string + encoded_payload;
  EXPECT_EQ(NetworkStats::INVALID_PACKET_NUMBER,
            network_stats.VerifyBytes(message));
  EXPECT_EQ(0u, network_stats.packets_received_mask());
}

TEST_F(NetworkStatsTestUDP, VerifyBytesPatternChanged) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;

  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);

  std::string message;
  std::string version = base::StringPrintf("%02d", 1);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string packet_number_string = base::StringPrintf("%010d", packet_number);

  scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(KBytesToSend));

  // Copy the Packet number into the payload.
  size_t packet_number_size = packet_number_string.size();
  memcpy(payload->data(), packet_number_string.c_str(), packet_number_size);

  // Get random bytes to fill rest of the payload.
  network_stats.stream_.GetBytes(payload->data() + packet_number_size,
                                 KBytesToSend - packet_number_size);

  // Calculate checksum for the payload.
  char* payload_data = payload->data();
  uint32 sum = network_stats.GetChecksum(payload_data, KBytesToSend);
  std::string checksum = base::StringPrintf("%010d", sum);

  const char* key = key_string.c_str();

  // Corrupt the randomly generated bytes in payload data.
  char corrupted_data_2[KBytesToSend];
  memcpy(corrupted_data_2, payload_data, KBytesToSend);
  char temp_char_1 = corrupted_data_2[packet_number_size];
  corrupted_data_2[packet_number_size] =
      corrupted_data_2[packet_number_size + 1];
  corrupted_data_2[packet_number_size + 1] = temp_char_1;
  char encoded_corrupted_data_2[KBytesToSend];
  memset(encoded_corrupted_data_2, 0, KBytesToSend);
  network_stats.Crypt(key,
                      key_string.length(),
                      corrupted_data_2,
                      KBytesToSend,
                      encoded_corrupted_data_2);
  std::string invalid_payload(encoded_corrupted_data_2, KBytesToSend);
  message = version + checksum + payload_size + key_string + invalid_payload;
  EXPECT_EQ(NetworkStats::PATTERN_CHANGED, network_stats.VerifyBytes(message));
  EXPECT_EQ(0u, network_stats.packets_received_mask());
}

TEST_F(NetworkStatsTestUDP, VerifyBytes) {
  const uint32 KBytesToSend = 100;
  const uint32 packets_to_send = 1;
  NetworkStats network_stats;
  net::TestCompletionCallback cb;

  network_stats.Initialize(KBytesToSend,
                           NetworkStats::HISTOGRAM_PORT_MAX,
                           true,
                           packets_to_send,
                           cb.callback());
  uint32 packet_number = network_stats.packet_number();
  network_stats.set_base_packet_number(packet_number);

  std::string message;
  std::string version = base::StringPrintf("%02d", 1);
  std::string payload_size = base::StringPrintf("%07d", KBytesToSend);
  std::string key_string = base::StringPrintf("%06d", 899999);
  std::string packet_number_string = base::StringPrintf("%010d", packet_number);

  scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(KBytesToSend));

  // Copy the Packet number into the payload.
  size_t packet_number_size = packet_number_string.size();
  memcpy(payload->data(), packet_number_string.c_str(), packet_number_size);

  // Get random bytes to fill rest of the payload.
  network_stats.stream_.GetBytes(payload->data() + packet_number_size,
                                 KBytesToSend - packet_number_size);

  // Calculate checksum for the payload.
  char* payload_data = payload->data();
  uint32 sum = network_stats.GetChecksum(payload_data, KBytesToSend);
  std::string checksum = base::StringPrintf("%010d", sum);

  char encoded_data[KBytesToSend];
  memset(encoded_data, 0, KBytesToSend);
  const char* key = key_string.c_str();
  network_stats.Crypt(
      key, key_string.length(), payload_data, KBytesToSend, encoded_data);
  std::string encoded_payload(encoded_data, KBytesToSend);

  message = version + checksum + payload_size + key_string + encoded_payload;
  EXPECT_EQ(NetworkStats::SUCCESS, network_stats.VerifyBytes(message));
  EXPECT_EQ(1u, network_stats.packets_received_mask());
}

}  // namespace chrome_browser_net


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>rabbit-imooc-01</artifactId>
        <groupId>com.bbxyard.mq</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>rbmq-imooc-producer</artifactId>

    <dependencies>
        <!--RabbitMQ依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>

        <!--工具类依赖-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.36</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
<?php

class home extends model {

    function __construct() {
        parent::__construct(Controller::$a_con);
    }

    function get_info_web() {
        return $this->get_ResultA_One($this->con->select_query('SELECT * FROM info_web', 'info-web'));
    }

    function get_info_user($id) {
        return $this->get_ResultA_One($this->con->select_query('SELECT us_name,us_email FROM users WHERE us_id="' . $id . '"', 'info-web'), MYSQLI_ASSOC, true);
    }

    function get_acc_type($id) {
        return $this->get_ResultA_One($this->con->select_query('SELECT at_name,at_color,at_price FROM acc_type WHERE at_id="' . $id . '"', 'info-web'), MYSQLI_ASSOC, true);
    }

    function insert_payment($at_id, $pay_num, $total_price, $us_id) {
        return $this->get_Results($this->con->select_query('INSERT INTO payment VALUES("' . $at_id . '","' . $pay_num . '","' . $total_price . '","' . $us_id . '")', 'info-web'));
    }

    function login($email, $pass) {
        return $this->con->select_query('SELECT us_id,at_id,us_name FROM users  WHERE us_email="' . $email . '" AND us_pass="' . md5($pass) . '"', 'login');
    }

}


text:
/**
 * @ignore
 * generate proxy drag object,
 * @author yiminghe@gmail.com
 */

var DD = require('dd'),
    Base = require('base');

var DDM = DD.DDM,
    PROXY_EVENT = '.-ks-proxy' + (+new Date());

/**
 * @extends KISSY.Base
 * @class KISSY.DD.Plugin.Proxy
 * Proxy plugin to provide abilities for draggable tp create a proxy drag node,
 * instead of dragging the original node.
 */
module.exports = Base.extend({
    pluginId: 'dd/plugin/proxy',

    /**
     * make this draggable object can be proxied.
     * @param {KISSY.DD.Draggable} drag
     * @private
     */
    pluginInitializer: function (drag) {
        var self = this;

        function start() {
            var node = self.get('node'),
                dragNode = drag.get('node');
            // cache proxy node
            if (!self.get('proxyNode')) {
                if (typeof node === 'function') {
                    node = node(drag);
                    node.addClass('ks-dd-proxy');
                    self.set('proxyNode', node);
                }
            } else {
                node = self.get('proxyNode');
            }
            node.show();
            dragNode.parent().append(node);
            DDM.cacheWH(node);
            node.offset(dragNode.offset());
            drag.setInternal('dragNode', dragNode);
            drag.setInternal('node', node);
        }

        function end() {
            var node = self.get('proxyNode'),
                dragNode = drag.get('dragNode');
            if (self.get('moveOnEnd')) {
                dragNode.offset(node.offset());
            }
            if (self.get('destroyOnEnd')) {
                node.remove();
                self.set('proxyNode', 0);
            } else {
                node.hide();
            }
            drag.setInternal('node', dragNode);
        }

        drag.on('dragstart' + PROXY_EVENT, start)
            .on('dragend' + PROXY_EVENT, end);
    },
    /**
     * make this draggable object unproxied
     * @param {KISSY.DD.Draggable} drag
     * @private
     */
    pluginDestructor: function (drag) {
        drag.detach(PROXY_EVENT);
    }
}, {
    ATTRS: {
        /**
         * how to get the proxy node.
         * default clone the node itself deeply.
         * @cfg {Function} node
         */
        /**
         * @ignore
         */
        node: {
            value: function (drag) {
                return drag.get('node').clone(true);
            }
        },

        /**
         * destroy the proxy node at the end of this drag.
         * default false
         * @cfg {Boolean} destroyOnEnd
         */
        /**
         * @ignore
         */
        destroyOnEnd: {
            value: false
        },

        /**
         * move the original node at the end of the drag.
         * default true
         * @cfg {Boolean} moveOnEnd
         */
        /**
         * @ignore
         */
        moveOnEnd: {
            value: true
        },

        /**
         * Current proxy node.
         * @type {KISSY.Node}
         * @property proxyNode
         */
        /**
         * @ignore
         */
        proxyNode: {}
    }
});


text:
"""
Description:
* An interface is defined for creating an object.
* Comparing to simple factory, subclasses decide which class is instantiated.

@author: Paul Bodean
@date: 12/08/2017
"""
from abc import ABCMeta, abstractmethod
from typing import Union
from selenium.webdriver import Chrome, Firefox

from src.factory.pages.menu import Menu
from src.factory.pages.search import Search

class Component(object):
    """
    Abstract class defining how a tested component will look
    """

    @abstractmethod
    def set_name(self):
        pass

    @abstractmethod
    def get_actions(self, *args):
        pass

class SearchComponent(Component, Search):
    """
    Each new product will implement specific actions
    """

    def set_name(self):
        return 'Youtube search component'

    def get_actions(self, *args: list):
        """
        :type args: list
        """
        if args[0] == 'click_search':
            self.search()
        elif args[0] == 'set_query':
            self.set_query(args[1])
        else:
            raise NotImplemented

class MenuComponent(Component, Menu):
    """
    Menu specific component are implemented
    """

    def set_name(self):
        return 'Youtube menu component'

    def get_actions(self, *args: list):
        """

        :type args: list
        """
        if args[0] == 'click_menu':
            self.menu_button()
        elif args[0] == 'trend':
            self.filter_by_trend()
        elif args[0] == 'history':
            self.filter_by_history()
        elif args[0] == 'browse':
            self.browse()
        else:
            raise NotImplemented

class TemplateTest(metaclass=ABCMeta):
    """
    TestCase abstract class provide a factory method _create_test which should be implemented by concrete classes
    """

    def __init__(self):
        self.sections = dict()
        self.create_test()

    @abstractmethod
    def create_test(self):
        """
        Factory abstract method
        """
        pass

    def get_sections(self) -> dict:
        """

        :return: all section to be tested in a TestCase
        :rtype: list
        """
        return self.sections

    def add_sections(self, section_key: str, section: object):
        """

        :param section_key: section key name
        :type section_key: str
        :param section: a section to be tested
        :type section: object
        :return: all sections to be tested
        :rtype: list
        """
        self.sections.update({section_key: section})

class MenuTest(TemplateTest):
    """
    Implement Test Menu class
    """

    def __init__(self, driver: Union[Chrome, Firefox]):
        """

        :param driver: browser driver
        :type driver: object
        """
        self.__driver = driver
        super().__init__()

    def create_test(self):
        """

        :return: sections to be tested
        :rtype: dict
        """
        self.add_sections('menu', MenuComponent(self.__driver))

class MenuAndSearchTest(TemplateTest):
    """
    Implement a test case for checking menu and search
    """

    def __init__(self, driver: Union[Chrome, Firefox]):
        """

        :param driver: browser driver
        :type driver: object
        """
        self.__driver = driver
        super().__init__()

    def create_test(self):
        """

        :return: sections to be tested
        :rtype: dict
        """
        self.add_sections('menu', MenuComponent(self.__driver))
        self.add_sections('search', SearchComponent(self.__driver))


text:
package com.allanbank.mongodb.client.metrics.basic;

import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.concurrent.TimeUnit;

import org.junit.Test;

import com.allanbank.mongodb.client.Message;
import com.allanbank.mongodb.client.message.Reply;
import com.allanbank.mongodb.client.metrics.MongoMessageListener;

/**
 * BasicConnectionMetricsTest provides tests for the
 * {@link BasicConnectionMetrics} class.
 *
 * @copyright 2014, Allanbank Consulting, Inc., All Rights Reserved
 */
public class BasicConnectionMetricsTest {

    /**
     * Test method for
     * {@link BasicConnectionMetrics#receive(String, long, Message, Reply, long)}
     * .
     */
    @Test
    public void testReceive() {
        final Message mockSentMessage = createMock(Message.class);
        final Reply mockReply = createMock(Reply.class);
        final MongoMessageListener mockListener = createMock(MongoMessageListener.class);

        final BasicConnectionMetrics metrics = new BasicConnectionMetrics(
                mockListener);

        expect(mockReply.size()).andReturn(202);
        mockListener.receive(null, 0L, mockSentMessage, mockReply,
                TimeUnit.MILLISECONDS.toNanos(1));
        expectLastCall();

        replay(mockSentMessage, mockReply, mockListener);

        metrics.receive(null, 0L, mockSentMessage, mockReply,
                TimeUnit.MILLISECONDS.toNanos(1));

        metrics.close();

        verify(mockSentMessage, mockReply, mockListener);
    }

    /**
     * Test method for
     * {@link BasicConnectionMetrics#sent(String, long, Message)} .
     */
    @Test
    public void testSent() {
        final Message mockSentMessage = createMock(Message.class);
        final MongoMessageListener mockListener = createMock(MongoMessageListener.class);

        final BasicConnectionMetrics metrics = new BasicConnectionMetrics(
                mockListener);

        expect(mockSentMessage.size()).andReturn(101);
        mockListener.sent(null, 0L, mockSentMessage);
        expectLastCall();

        replay(mockSentMessage, mockListener);

        metrics.sent(null, 0L, mockSentMessage);

        metrics.close();

        verify(mockSentMessage, mockListener);
    }

    /**
     * Test method for {@link BasicConnectionMetrics#writeTo(PrintWriter)}.
     */
    @Test
    public void testWriteToPrintWriter() {
        final StringWriter sink = new StringWriter();
        final PrintWriter writer = new PrintWriter(sink);

        final BasicConnectionMetrics metrics = new BasicConnectionMetrics(null);

        metrics.writeTo(writer);
        assertThat(
                sink.toString(),
                is("Connection["
                        + System.identityHashCode(metrics)
                        + ": sentBytes=0, sentCount=0, receivedBytes=0, receivedCount=0, "
                        + "lastLatency=0 ms, totalLatency=0 ms]"));

        // For Closeable.
        metrics.close();
    }
}


text:
<?php

declare(strict_types=1);

namespace App\Jobs;

use App\Models\Team;
use App\Models\User;
use Exception;
use GuzzleHttp\Client;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class PushToJedi implements ShouldQueue, ShouldBeUnique
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    /**
     * The number of attempts for this job.
     *
     * @var int
     */
    public $tries = 1;

    /**
     * The user that will be sent to JEDI.
     *
     * @var \App\Models\User
     */
    private $user;

    /**
     * The name of the class that caused the push to be run.
     *
     * @var string
     */
    private $model_class;

    /**
     * The ID of the model that caused the push to be run.
     *
     * @var int
     */
    private $model_id;

    /**
     * A description of the event that caused the push to be run.
     *
     * @var string
     */
    private $model_event;

    /**
     * Create a new job instance.
     */
    public function __construct(User $user, string $model_class, int $model_id, string $model_event)
    {
        $this->user = $user;
        $this->model_class = $model_class;
        $this->model_id = $model_id;
        $this->model_event = $model_event;
        $this->queue = 'jedi';
    }

    /**
     * Execute the job.
     *
     * @phan-suppress PhanPossiblyNullTypeArgumentInternal
     */
    public function handle(): void
    {
        if (config('jedi.host') === null || config('jedi.token') === null) {
            return;
        }

        // Skip users who have never logged in as they will not have access to anything. This allows running on every
        // user but saving some time.
        if (! $this->user->has_ever_logged_in) {
            return;
        }

        $lastAttendance = $this->user->attendance()->where('attendable_type', Team::getMorphClassStatic())
            ->orderByDesc('created_at')->first();

        $send = [
            'username' => strtolower($this->user->uid),
            'first_name' => $this->user->preferred_first_name,
            'last_name' => $this->user->last_name,
            'is_access_active' => $this->user->is_access_active,
            'github_username' => $this->user->github_username,
            'google_accounts' => [],
            'model_class' => $this->model_class,
            'model_id' => $this->model_id,
            'model_event' => $this->model_event,
            'last_attendance_time' => $lastAttendance?->created_at,
            'last_attendance_id' => $lastAttendance?->id,
            'teams' => [],
            'project_manager_of_teams' => [],
            'exists_in_sums' => $this->user->exists_in_sums,
            'clickup_email' => $this->user->clickup_email,
            'clickup_id' => $this->user->clickup_id,
            'clickup_invite_pending' => $this->user->clickup_invite_pending,
            'autodesk_email' => $this->user->autodesk_email,
            'autodesk_invite_pending' => $this->user->autodesk_invite_pending,
            'signed_latest_agreement' => $this->user->signed_latest_agreement,
        ];

        foreach ($this->user->teams as $team) {
            $send['teams'][] = $team->name;
        }

        foreach ($this->user->manages as $team) {
            $send['project_manager_of_teams'][] = $team->name;
        }

        $gmail_address = $this->user->gmail_address;
        if ($gmail_address !== null) {
            $send['google_accounts'][] = strtolower($gmail_address);
        }

        if (in_array('G Suite', $send['teams'], true)) {
            $send['google_accounts'][] = strtolower(
                preg_replace(
                    '/[^[:alnum:]-]/u',
                    '',
                    $this->user->preferred_first_name
                ).'.'.preg_replace(
                    '/[^[:alnum:]-]/u',
                    '',
                    $this->user->last_name
                )
            ).'@robojackets.org';
        }

        $send['google_accounts'] = array_unique($send['google_accounts'], SORT_STRING);

        $client = new Client(
            [
                'headers' => [
                    'User-Agent' => 'Apiary on '.config('app.url'),
                    'Authorization' => 'Bearer '.config('jedi.token'),
                    'Accept' => 'application/json',
                ],
                'allow_redirects' => false,
            ]
        );

        $response = $client->request('POST', config('jedi.host').'/api/v1/apiary', ['json' => $send]);

        if ($response->getStatusCode() !== 202) {
            throw new Exception(
                'Sending data to JEDI failed with HTTP response code '.$response->getStatusCode()
            );
        }
    }

    /**
     * The unique ID of the job.
     */
    public function uniqueId(): string
    {
        return strval($this->user->id);
    }
}


text:
package experiments;

import entities.*;
import entities.RequirementLevel.ReqLevel;
import entities.Process;
import models.PolicyModel;

/**
 * This is the example which is used at the GitHub quick start guide.
 */
public class QuickStartExample extends Experiment {

    public QuickStartExample() {
        super("Quick-start-example");
        DigitalObject importantFile = new DigitalObject(scenario, "ImportantFile");
        importantFile.version("1.0");
        TechnicalService server = new TechnicalService(scenario, "Server");
        ServiceInterface webInterface = new ServiceInterface(scenario, "WebInterface");
        server.hasPart(importantFile);
        server.hasPart(webInterface);
        webInterface.providesAccessTo(importantFile);

        Community company = new Community(scenario, "Company");
        Community artists = new Community(scenario, "Artists");
        company.owns(server);
        HumanAgent admin = new HumanAgent(scenario, "SystemAdministrator");
        HumanAgent artist = new HumanAgent(scenario, "Artist");
        artist.isMemberOf(artists);
        admin.isMemberOf(company);
        Role dataCreator = new Role(scenario, "DataCreators");
        dataCreator.describedBy("Persons who create Digital Objects");
        artist.hasRole(dataCreator);
        importantFile.hasAuthor(artist);

        Policy policy = new Policy(scenario, "AccessibilityPolicy");
        policy.describedBy("All important files should be "
                + "accessible via the web interface.");
        QualityAssurance accessibility = new QualityAssurance(scenario, "ServerAccessible");
        QualityAssurance availability = new QualityAssurance(scenario, "FileAvailable");
        policy.addQACriterion(accessibility);
        policy.addQACriterion(availability);
        policy.hasMandator(company);
        policy.responsiblePerson(admin);
        policy.hasRequirementsLevel(ReqLevel.MUST);
        ImplementationState state = PolicyModel.implementationState.createImplementationState(scenario, ImplementationState.State.IMPLEMENTED);
        state.isStateOf(policy);
        policy.constraints(importantFile);
        policy.constraints(webInterface);
        policy.constraints(server);

        AggregatedProcess aggProcess = new AggregatedProcess(scenario,
                "AccessibilityEnsurance");
        Process testServerAccessibility = new Process(scenario,
                "TestServerAccessibility");
        Process testFileAvailability = new Process(scenario,
                "TestFileAvailability");
        Process startServer = new Process(scenario, "StartServer");
        Process copyFile = new Process(scenario, "CopyFile");
        testServerAccessibility.hasLink("tests/serverAccessibility");
        startServer.runsOn(server);
        copyFile.hasInput(importantFile);
        aggProcess.hasSubProcess(testServerAccessibility);
        aggProcess.hasSubProcess(testFileAvailability);
        aggProcess.hasSubProcess(startServer);
        aggProcess.hasSubProcess(copyFile);
        policy.isEnforcedBy(aggProcess);

        Policy maintenancePolicy = new Policy(scenario,
                "MaintenanceWork");
        maintenancePolicy.describedBy("For server maintenance it could be necessary "
                        + "to shut the server down for a short length of time.");
        policy.conflictDetectedWith(maintenancePolicy);

        DigitalObject artBook = new DigitalObject(scenario, "ArtBook");
        DigitalObject introduction = new DigitalObject(scenario,
                "Introduction");
        artBook.hasPart(introduction);
        artBook.hasPart(importantFile);
    }
}


text:
@interface AppDelegate (XYWindow)

@property (nonatomic, strong) UIWindow *window;

@end


text:
1. Создаете каталог в котором будет размещен проект

      `mkdir {projectname}`
2. Переход в каталог

    `cd {projectname}`
3. Клонирование репозитория с  шаблоном проекта

    `git clone https://github.com/intpro/engine3base.git ./`
4. Установка пакетов для работы движка

    `composer install`
5. Установка пакетов для разработки

    `npm install`
6. Затем необоходимо создать базу данных и подцепить ее к файлу `.env`

7. После этого выполнить последовательно команды:

    * `php artisan key:generate` - создать ключ приложения
    * `php artisan vendor:publish` - опубликовать конфиг файл, создать рабочие директории
    * `php artisan migrate` - создать таблицы в базе данных
    * `php artisan db:seed` - создать юзера для работы с админ панелью
8. Переходим в папку public - `cd public`

9. Копируем скрипты и стили для панели администратора

    `git clone https://github.com/InterProFront/admin3.git ./admin`

10. Если это *nix система  то
    `chmod -R 777 ./`

# Справка по командам движка

## Консольные команды

### В корневом каталоге

- `php artisan sync all` - синхронизировать конфигурационные файлы с базой
- `composer update interpro\*` - обновить пакеты движка

### В папке public

- `gulp watch` - Слежение за изменениями в папке /dev/less и /dev/img . Запуск соответсвующих тасков ( компиляция less, копирование и минификация изображений )
- `gulp style --production` - Компиляция less для боевого сервера. Стили минифицируются, соурсмап не пишется.

## Файлы конфигураций

- `interpro\qs.php` - Конфиг сайта ( все статичные поля)
- `interpro\feedback.php` - Настройка для форм обратной связи
- `interpro\images.php` -  Указание каким изображениям какие кропы и ресайзы применять
- `interpro\modimages.php` - Указание какие есть ватермарки и маски
- `interpro\resizes.php` - Ресайзы для картинок
- `interpro\crops.php` - Кропы для картинок
- `interpro\seo.php` - СЕО поля для сайта, а так же какие блокам или группам они цепляются


text:
package maximsblog.blogspot.com.jlatexmath.core;

/**
 * Signals that an error occured while parsing a string to a formula.
 */
public class ParseException extends JMathTeXException {

    public ParseException(String str, Throwable cause) {
        super(str, cause);
    }

    public ParseException(String str) {
        super(str);
    }
}