text:
namespace DLaB.Xrm.Entities
{

	/// <summary>
	/// Represents a mapping between two related entities so that data from one record can be copied into the form of a new related record.
	/// </summary>
	[System.Runtime.Serialization.DataContractAttribute()]
	[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("entitymap")]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public partial class EntityMap : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
	{

		public static class Fields
		{
			public const string ComponentState = "componentstate";
			public const string CreatedBy = "createdby";
			public const string CreatedOn = "createdon";
			public const string CreatedOnBehalfBy = "createdonbehalfby";
			public const string EntityMapId = "entitymapid";
			public const string Id = "entitymapid";
			public const string EntityMapIdUnique = "entitymapidunique";
			public const string IsManaged = "ismanaged";
			public const string ModifiedBy = "modifiedby";
			public const string ModifiedOn = "modifiedon";
			public const string ModifiedOnBehalfBy = "modifiedonbehalfby";
			public const string OrganizationId = "organizationid";
			public const string OverwriteTime = "overwritetime";
			public const string SolutionId = "solutionid";
			public const string SourceEntityName = "sourceentityname";
			public const string TargetEntityName = "targetentityname";
			public const string VersionNumber = "versionnumber";
			public const string createdby_entitymap = "createdby_entitymap";
			public const string lk_entitymap_createdonbehalfby = "lk_entitymap_createdonbehalfby";
			public const string lk_entitymap_modifiedonbehalfby = "lk_entitymap_modifiedonbehalfby";
			public const string modifiedby_entitymap = "modifiedby_entitymap";
			public const string organization_entitymap = "organization_entitymap";
		}

		/// <summary>
		/// Default Constructor.
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public EntityMap() :
				base(EntityLogicalName)
		{
		}

		public const string EntityLogicalName = "entitymap";

		public const string PrimaryIdAttribute = "entitymapid";

		public const int EntityTypeCode = 4600;

		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

		public event System.ComponentModel.PropertyChangingEventHandler PropertyChanging;

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanged(string propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanging(string propertyName)
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, new System.ComponentModel.PropertyChangingEventArgs(propertyName));
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("componentstate")]
		public Microsoft.Xrm.Sdk.OptionSetValue ComponentState
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("componentstate");
			}
		}

		/// <summary>
		/// Unique identifier of the user who created the entity map.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedBy");
				this.SetAttributeValue("createdby", value);
				this.OnPropertyChanged("CreatedBy");
			}
		}

		/// <summary>
		/// Date and time when the entity map was created.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdon")]
		public System.Nullable<System.DateTime> CreatedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("createdon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOn");
				this.SetAttributeValue("createdon", value);
				this.OnPropertyChanged("CreatedOn");
			}
		}

		/// <summary>
		/// Unique identifier of the delegate user who created the entitymap.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOnBehalfBy");
				this.SetAttributeValue("createdonbehalfby", value);
				this.OnPropertyChanged("CreatedOnBehalfBy");
			}
		}

		/// <summary>
		/// Unique identifier of the entity map.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("entitymapid")]
		public System.Nullable<System.Guid> EntityMapId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("entitymapid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("EntityMapId");
				this.SetAttributeValue("entitymapid", value);
				if (value.HasValue)
				{
					base.Id = value.Value;
				}
				else
				{
					base.Id = System.Guid.Empty;
				}
				this.OnPropertyChanged("EntityMapId");
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("entitymapid")]
		public override System.Guid Id
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return base.Id;
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.EntityMapId = value;
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("entitymapidunique")]
		public System.Nullable<System.Guid> EntityMapIdUnique
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("entitymapidunique");
			}
		}

		/// <summary>
		///
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("ismanaged")]
		public System.Nullable<bool> IsManaged
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<bool>>("ismanaged");
			}
		}

		/// <summary>
		/// Unique identifier of the user who last modified the entity map.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedBy");
				this.SetAttributeValue("modifiedby", value);
				this.OnPropertyChanged("ModifiedBy");
			}
		}

		/// <summary>
		/// Date and time when the entity map was last modified.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedon")]
		public System.Nullable<System.DateTime> ModifiedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("modifiedon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOn");
				this.SetAttributeValue("modifiedon", value);
				this.OnPropertyChanged("ModifiedOn");
			}
		}

		/// <summary>
		/// Unique identifier of the delegate user who last modified the entitymap.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOnBehalfBy");
				this.SetAttributeValue("modifiedonbehalfby", value);
				this.OnPropertyChanged("ModifiedOnBehalfBy");
			}
		}

		/// <summary>
		/// Unique identifier of the organization with which the entity map is associated.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("organizationid")]
		public Microsoft.Xrm.Sdk.EntityReference OrganizationId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("organizationid");
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("overwritetime")]
		public System.Nullable<System.DateTime> OverwriteTime
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("overwritetime");
			}
		}

		/// <summary>
		/// Unique identifier of the associated solution.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("solutionid")]
		public System.Nullable<System.Guid> SolutionId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("solutionid");
			}
		}

		/// <summary>
		/// Name of the source entity for the entity mapping.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("sourceentityname")]
		public string SourceEntityName
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("sourceentityname");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("SourceEntityName");
				this.SetAttributeValue("sourceentityname", value);
				this.OnPropertyChanged("SourceEntityName");
			}
		}

		/// <summary>
		/// Name of the Microsoft Dynamics 365 entity.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("targetentityname")]
		public string TargetEntityName
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("targetentityname");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("TargetEntityName");
				this.SetAttributeValue("targetentityname", value);
				this.OnPropertyChanged("TargetEntityName");
			}
		}

		/// <summary>
		///
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("versionnumber")]
		public System.Nullable<long> VersionNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<long>>("versionnumber");
			}
		}

		/// <summary>
		/// 1:N entity_map_attribute_maps
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("entity_map_attribute_maps")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.AttributeMap> entity_map_attribute_maps
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.AttributeMap>("entity_map_attribute_maps", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("entity_map_attribute_maps");
				this.SetRelatedEntities<DLaB.Xrm.Entities.AttributeMap>("entity_map_attribute_maps", null, value);
				this.OnPropertyChanged("entity_map_attribute_maps");
			}
		}

		/// <summary>
		/// 1:N EntityMap_AsyncOperations
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("EntityMap_AsyncOperations")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.AsyncOperation> EntityMap_AsyncOperations
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("EntityMap_AsyncOperations", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("EntityMap_AsyncOperations");
				this.SetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("EntityMap_AsyncOperations", null, value);
				this.OnPropertyChanged("EntityMap_AsyncOperations");
			}
		}

		/// <summary>
		/// 1:N EntityMap_BulkDeleteFailures
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("EntityMap_BulkDeleteFailures")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.BulkDeleteFailure> EntityMap_BulkDeleteFailures
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.BulkDeleteFailure>("EntityMap_BulkDeleteFailures", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("EntityMap_BulkDeleteFailures");
				this.SetRelatedEntities<DLaB.Xrm.Entities.BulkDeleteFailure>("EntityMap_BulkDeleteFailures", null, value);
				this.OnPropertyChanged("EntityMap_BulkDeleteFailures");
			}
		}

		/// <summary>
		/// 1:N userentityinstancedata_entitymap
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("userentityinstancedata_entitymap")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.UserEntityInstanceData> userentityinstancedata_entitymap
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.UserEntityInstanceData>("userentityinstancedata_entitymap", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("userentityinstancedata_entitymap");
				this.SetRelatedEntities<DLaB.Xrm.Entities.UserEntityInstanceData>("userentityinstancedata_entitymap", null, value);
				this.OnPropertyChanged("userentityinstancedata_entitymap");
			}
		}

		/// <summary>
		/// N:1 createdby_entitymap
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("createdby_entitymap")]
		public DLaB.Xrm.Entities.SystemUser createdby_entitymap
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("createdby_entitymap", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("createdby_entitymap");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("createdby_entitymap", null, value);
				this.OnPropertyChanged("createdby_entitymap");
			}
		}

		/// <summary>
		/// N:1 lk_entitymap_createdonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_entitymap_createdonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_entitymap_createdonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_entitymap_createdonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_entitymap_createdonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_entitymap_createdonbehalfby", null, value);
				this.OnPropertyChanged("lk_entitymap_createdonbehalfby");
			}
		}

		/// <summary>
		/// N:1 lk_entitymap_modifiedonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_entitymap_modifiedonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_entitymap_modifiedonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_entitymap_modifiedonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_entitymap_modifiedonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_entitymap_modifiedonbehalfby", null, value);
				this.OnPropertyChanged("lk_entitymap_modifiedonbehalfby");
			}
		}

		/// <summary>
		/// N:1 modifiedby_entitymap
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("modifiedby_entitymap")]
		public DLaB.Xrm.Entities.SystemUser modifiedby_entitymap
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("modifiedby_entitymap", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("modifiedby_entitymap");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("modifiedby_entitymap", null, value);
				this.OnPropertyChanged("modifiedby_entitymap");
			}
		}

		/// <summary>
		/// N:1 organization_entitymap
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("organizationid")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("organization_entitymap")]
		public DLaB.Xrm.Entities.Organization organization_entitymap
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.Organization>("organization_entitymap", null);
			}
		}

		/// <summary>
		/// Constructor for populating via LINQ queries given a LINQ anonymous type
		/// <param name="anonymousType">LINQ anonymous type.</param>
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public EntityMap(object anonymousType) :
				this()
		{
            foreach (var p in anonymousType.GetType().GetProperties())
            {
                var value = p.GetValue(anonymousType, null);
                var name = p.Name.ToLower();

                if (name.EndsWith("enum") && value.GetType().BaseType == typeof(System.Enum))
                {
                    value = new Microsoft.Xrm.Sdk.OptionSetValue((int) value);
                    name = name.Remove(name.Length - "enum".Length);
                }

                switch (name)
                {
                    case "id":
                        base.Id = (System.Guid)value;
                        Attributes["entitymapid"] = base.Id;
                        break;
                    case "entitymapid":
                        var id = (System.Nullable<System.Guid>) value;
                        if(id == null){ continue; }
                        base.Id = id.Value;
                        Attributes[name] = base.Id;
                        break;
                    case "formattedvalues":
                        // Add Support for FormattedValues
                        FormattedValues.AddRange((Microsoft.Xrm.Sdk.FormattedValueCollection)value);
                        break;
                    default:
                        Attributes[name] = value;
                        break;
                }
            }
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("componentstate")]
		public virtual ComponentState? ComponentStateEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ComponentState?)(EntityOptionSetEnum.GetEnum(this, "componentstate")));
			}
		}
	}
}


text:
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var plumber = require('gulp-plumber');
var mocha = require('gulp-mocha');
var watch = require('gulp-watch');
var batch = require('gulp-batch');

require('coffee-script/register');

var src_root = 'src';
var dest_root = 'lib';
var test_root = 'test';
var coffee_src = src_root + '/**/*.coffee';
var coffee_dest = dest_root + '/';
var test_src = test_root + '/**/*.coffee';
var lib_src = dest_root + '/**/*.js';

gulp.task('default', ['watch'] );

gulp.task('build', function() {
  gulp.src(coffee_src)
    .pipe(plumber())
    .pipe(watch(coffee_src))
    .pipe(coffee({bare: true}))//.on('error', gutil.log))
    .pipe(gulp.dest(coffee_dest));
});

// gulp.task('coffee-test', function() {
//   gulp.src(test_src)
//     .pipe(plumber())
//     .pipe(coffee({bare: true}))
//     .pipe(gulp.dest(test_dest));
// });

gulp.task('test', function() {
  gulp.src(test_src, {read: false})
    .pipe(plumber())
    .pipe(mocha({
      reporter: 'spec'
    }));
});

gulp.task('watch', ['build'], function() {
  watch(coffee_src, ['build']);
  watch([test_src, lib_src], batch(function(e, done) {
    gulp.start('test', done);
  }));
});

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>The Project | Home Resume</title>
		<meta name="description" content="The Project a Bootstrap-based, Responsive HTML5 Template">
		<meta name="author" content="htmlcoder.me">

		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<link rel="shortcut icon" href="images/favicon.ico">

		<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'>
		<link href='http://fonts.googleapis.com/css?family=Raleway:700,400,300' rel='stylesheet' type='text/css'>
		<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
		<link href='http://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'>

		<link href="bootstrap/css/bootstrap.css" rel="stylesheet">

		<link href="fonts/font-awesome/css/font-awesome.css" rel="stylesheet">

		<link href="fonts/fontello/css/fontello.css" rel="stylesheet">

		<link href="plugins/magnific-popup/magnific-popup.css" rel="stylesheet">
		<link href="plugins/rs-plugin-5/css/settings.css" rel="stylesheet">
		<link href="plugins/rs-plugin-5/css/layers.css" rel="stylesheet">
		<link href="plugins/rs-plugin-5/css/navigation.css" rel="stylesheet">
		<link href="css/animations.css" rel="stylesheet">
		<link href="plugins/owlcarousel2/assets/owl.carousel.min.css" rel="stylesheet">
		<link href="plugins/owlcarousel2/assets/owl.theme.default.min.css" rel="stylesheet">
		<link href="plugins/hover/hover-min.css" rel="stylesheet">
		<link href="plugins/morphext/morphext.css" rel="stylesheet">

		<link href="css/style.css" rel="stylesheet" >

		<link href="css/typography-default.css" rel="stylesheet" >

		<link href="css/skins/dark_cyan.css" rel="stylesheet">

		<link href="css/custom.css" rel="stylesheet">

													<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
														Toggle navigation

													</button>

															Multipurpose HTML5 Template

															Home

Home - Default

About

Skills

Recent Projects

Contact

Hello I'm Robert White!

Senior Web Developer

More Details

About Me

Hello I'm Robert. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi perferendis magnam ea necessitatibus, officiis voluptas odit! Aperiam omnis, cupiditate laudantium velit nostrum, exercitationem accusamus, possimus soluta illo deserunt tempora qui.

2011 - 2016

Web Developer at HtmlCoder

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

2009 - 2011

Freelancer

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

2008 - 2009

Manager at Gogole

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

2006 - 2008

Manager at Pappla

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

2004 - 2006

MSc Software Engineering

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

2000 - 2004

Bachelor Software Engineering

Mauris dolor sapien, malesuada at interdum ut, hendrerit eget lorem. Nunc interdum mi neque, et  sollicitudin purus fermentum ut. Suspendisse faucibus nibh odio, a vehicula eros pharetra in. Maecenas  ullamcorper commodo rutrum.

Why Me?

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Just Perfect!

Sed ut perspiciatis unde omnis iste natu error sit voluptatem accusan tium dolore laud antium, totam rem dolor sit amet tristique pulvinar, turpis arcu rutrum nunc, ac laoreet turpis augue a justo.

- Jane Doe

By Company

Amazing!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et cupiditate deleniti ratione in. Expedita nemo, quisquam, fuga adipisci omnis ad mollitia libero culpa nostrum est quia eos esse vel!

- Jane Doe

By Company

My Skills

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex. Suspendisse aliquet imperdiet commodo. Aenean vel lacinia elit. Class aptent taciti sociosqu ad litora torquent per.

									CSS

									HTML5

									Design

									PHP

									jQuery

									Drupal

Sed eget pulvinar quam, vel feugiat enim. Aliquam erat volutpat. Phasellus eu porta ipsum. Suspendisse aliquet imperdiet commodo. Aenean vel lacinia elit. Class aptent taciti sociosqu ad litora torquent per. Vestibulum velmo.

 Etiam sed dolor ac diam volutpat

 Sed eget pulvinar quam, vel feugiat enim aliquam

 Erat volutpat. Phasellus eu porta ipsum suspendisse aliquet imperdiet

 Phasellus eu porta ipsum. Suspendisse aliquet imperdiet commodo

Recent Projects

Lorem ipsum dolor sit amet, consectetur adipisicing elit Illo quaerat
 commodi excepturi dignissimos!

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Project Title

 Feb, 2016  Web Design

Lorem ipsum dolor sit amet, adipisicing elit. Aliquam atque ipsam nihialal. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam laudantium, provident culpa saepe.

Read More

Powerful Bootstrap Template

Waste no more time

Purchase

Find Me

 One infinity loop, 54100

 +00 1234567890

info@theproject.com

										Contact Me

Follow Me

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro fugiat accusantium similique modi alias consectetur nesciunt.

Contact Me

												We have received your message, we will contact you very soon.

												Oops! Something went wrong please refresh the page and try again.

											<form role="form" id="footer-form" class="margin-clear">

															Name
															<input type="text" class="form-control" id="name2" placeholder="Name" name="name2">

															Email address
															<input type="email" class="form-control" id="email2" placeholder="Enter email" name="email2">

													Message
													<textarea class="form-control" rows="4" id="message2" placeholder="Message" name="message2"></textarea>

												<input type="submit" value="Send" class="margin-clear submit-button radius-50 btn btn-default">
											</form>

Copyright © 2017 The Project by HtmlCoder. All Rights Reserved


text:
"""Script to test basic message-passing with GUIReactor.
Continuously reads out sensor values monitored by SimpleMonitor and FilteringMonitor."""
import sys
import Tkinter as tk
import ttk

from components.messaging import Signal
from components.robots import Beeper
from components.sensors import SimpleMonitor, FilteringMonitor
from components.app import RobotApp

class GUISensors(RobotApp):
    """Reads out robot sensor values."""
    def __init__(self, name="Sensors GUI", update_interval=10):
        super(GUISensors, self).__init__(name, update_interval, 1)
        self.__sensors_frame = None
        self.__effectors_frame = None
        self._initialize_widgets()

    # Implementing abstract methods
    def _react(self, signal):
        if signal.Name == "Floor":
            if signal.Sender == "Sensors Monitor":
                name = "floor"
                label = "Raw Floor"
            elif signal.Sender == "Filtering Sensors Monitor":
                label = "Filtered Floor"
                name = "filteredFloor"
            self.__sensors_frame.nametowidget(name).config(text="{}: ({:.0f}, {:.0f})"
                                                           .format(label, *signal.Data))
        elif signal.Name == "Proximity":
            if signal.Sender == "Sensors Monitor":
                name = "proximity"
                label = "Raw Prox"
            elif signal.Sender == "Filtering Sensors Monitor":
                name = "filteredProximity"
                label = "Filtered Prox"
            self.__sensors_frame.nametowidget(name).config(text="{}: ({:.0f}, {:.0f})"
                                                           .format(label, *signal.Data))
        elif signal.Name == "PSD":
            if signal.Sender == "Sensors Monitor":
                name = "psd"
                label = "Raw PSD"
            elif signal.Sender == "Filtering Sensors Monitor":
                name = "filteredPSD"
                label = "Filtered PSD"
            self.__sensors_frame.nametowidget(name).config(text="{}: {:.0f}"
                                                           .format(label, signal.Data))
    def _initialize_widgets(self):
        app_frame = ttk.LabelFrame(self._root, name="appFrame",
                                   borderwidth=2, relief="ridge",
                                   text="App")
        app_frame.pack(fill="x")
        self._initialize_robotapp_widgets(app_frame)

        self.__sensors_frame = ttk.LabelFrame(self._root, name="sensorsFrame",
                                              borderwidth=2, relief="ridge",
                                              text="Sensors")
        self.__sensors_frame.pack(fill="x")
        ttk.Label(self.__sensors_frame, name="floor",
                  text="Raw Floor: (?, ?)").pack(fill="x")
        ttk.Label(self.__sensors_frame, name="proximity",
                  text="Raw Prox: (?, ?)").pack(fill="x")
        ttk.Label(self.__sensors_frame, name="psd",
                  text="Raw PSD: ?").pack(fill="x")
        ttk.Label(self.__sensors_frame, name="filteredFloor",
                  text="Filtered Floor: (?, ?)").pack(fill="x")
        ttk.Label(self.__sensors_frame, name="filteredProximity",
                  text="Filtered Prox: (?, ?)").pack(fill="x")
        ttk.Label(self.__sensors_frame, name="filteredPSD",
                  text="Filtered PSD: ?").pack(fill="x")
        ttk.Button(self.__sensors_frame, name="monitor", text="Monitor",
                   command=self._toggle_monitor, state="disabled").pack(fill="x")

        self.__effectors_frame = ttk.LabelFrame(self._root, name="effectorsFrame",
                                                borderwidth=2, relief="ridge",
                                                text="Effectors")
        self.__effectors_frame.pack(fill="x")
        ttk.Button(self.__effectors_frame, name="beep", text="Beep",
                   command=self._beep, state="disabled").pack(fill="x")
        self.__servo_angle = tk.StringVar()
        self.__servo_angle.set("90")
        self.__servo_angle.trace("w", self._servo)
        angles = ttk.Combobox(self.__effectors_frame, name="servo",
                              textvariable=self.__servo_angle, state="disabled",
                              values=[str(i) for i in range(1, 181)])
        angles.pack(fill="x")
    def _initialize_threads(self):
        simple_monitor = SimpleMonitor("Sensors Monitor", self._robots[0])
        self.register("Servo", simple_monitor)
        self._add_thread(simple_monitor)

        filtered_monitor = FilteringMonitor("Filtering Sensors Monitor", self._robots[0])
        self.register("Servo", filtered_monitor)
        self._add_thread(filtered_monitor)

        beeper = Beeper("Beeper", self._robots[0])
        self.register("Beep", beeper)
        self._add_thread(beeper)
    def _connect_post(self):
        self.__sensors_frame.nametowidget("monitor").config(state="normal")
        self.__effectors_frame.nametowidget("beep").config(state="normal")
        self.__effectors_frame.nametowidget("servo").config(state="readonly")

    # Monitor button callback
    def _toggle_monitor(self):
        simple_monitor = self._threads["Sensors Monitor"]
        simple_monitor.toggle_registered("Floor", self)
        simple_monitor.toggle_registered("Proximity", self)
        simple_monitor.toggle_registered("PSD", self)

        filtered_monitor = self._threads["Filtering Sensors Monitor"]
        filtered_monitor.toggle_registered("Floor", self)
        filtered_monitor.toggle_registered("Proximity", self)
        filtered_monitor.toggle_registered("PSD", self)

        monitor_button = self.__sensors_frame.nametowidget("monitor")
        if simple_monitor.is_registered("Floor", self):
            monitor_button.config(text="Stop Monitoring")
        else:
            monitor_button.config(text="Monitor")

    # Beep button callback
    def _beep(self):
        self.broadcast(Signal("Beep", self.get_name(), repr(self._robots[0]), (40, 0.2)))
        self.broadcast(Signal("Beep", self.get_name(), repr(self._robots[0]), (0, 0.1)))

    # Servo scale callback
    def _servo(self, _, dummy, operation):
        if operation == "w":
            self.broadcast(Signal("Servo", self.get_name(), repr(self._robots[0]),
                                  int(self.__servo_angle.get())))

def main():
    """Runs test."""
    gui = GUISensors()
    gui.start()

if __name__ == "__main__":
    sys.exit(main())


text:
PO = nwan
include ../../build/config.mk
include ../../build/module.mk


text:
/**
    File Name:          15.5.4.3-2.js
    ECMA Section:       15.5.4.3 String.prototype.valueOf()

    Description:        Returns this string value.

                        The valueOf function is not generic; it generates a
                        runtime error if its this value is not a String object.
                        Therefore it connot be transferred to the other kinds of
                        objects for use as a method.

    Author:             christine@netscape.com
    Date:               1 october 1997
*/

    var SECTION = "15.5.4.3-2";
    var VERSION = "ECMA_1";
    startTest();
    var TITLE   = "String.prototype.valueOf";

    writeHeaderToLog( SECTION + " "+ TITLE);

    var testcases = getTestCases();
    test();

function test() {
    for ( tc=0; tc < testcases.length; tc++ ) {
        testcases[tc].actual = eval(testcases[tc].actual );
        testcases[tc].passed = writeTestCaseResult(
                            testcases[tc].expect,
                            testcases[tc].actual,
                            testcases[tc].description +" = "+
                            testcases[tc].actual );

        testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
    }
    stopTest();
    return ( testcases );
}
function getTestCases() {
    var array = new Array();
    var item = 0;

    array[item++] = new TestCase( SECTION,
                                  "var valof=String.prototype.valueOf; astring=new String(); astring.valueOf = valof; astring.valof()",
                                  "",
                                  "var valof=String.prototype.valueOf; astring=new String(); astring.valueOf = valof; astring.valueOf()" );
    array[item++] = new TestCase( SECTION,
                                  "var valof=String.prototype.valueOf; astring=new String(0); astring.valueOf = valof; astring.valof()",
                                  "0",
                                  "var valof=String.prototype.valueOf; astring=new String(0); astring.valueOf = valof; astring.valueOf()" );
    array[item++] = new TestCase( SECTION,
                                  "var valof=String.prototype.valueOf; astring=new String('hello'); astring.valueOf = valof; astring.valof()",
                                  "hello",
                                  "var valof=String.prototype.valueOf; astring=new String('hello'); astring.valueOf = valof; astring.valueOf()" );
    array[item++] = new TestCase( SECTION,
                                  "var valof=String.prototype.valueOf; astring=new String(''); astring.valueOf = valof; astring.valof()",
                                  "",
                                  "var valof=String.prototype.valueOf; astring=new String(''); astring.valueOf = valof; astring.valueOf()" );
/*
    array[item++] = new TestCase( SECTION,
                                  "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valof()",
                                  "error",
                                  "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valueOf()" );
*/
    return ( array );
}


text:
ActiveRecord::Schema.define do
  self.verbose = false

  create_table :addresses, :force => true do |t|
    t.string :postcode
    t.string :country
    t.timestamps
  end

  create_table :alternative_addresses, :force => true do |t|
    t.string :zip
    t.string :country_code
    t.timestamps
  end
end


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="simple.css">
  <title>binjgb (simple)</title>

    <canvas id="mainCanvas" width="160" height="144">No Canvas Support</canvas>

Select

Start

B

A


text:
/**
 * @file
 * @brief Keyboard driver
 *
 * @date 12.12.10
 * @author Anton Bondarev
 */

#include <errno.h>
#include <stdint.h>

#include <drivers/input/keymap.h>
#include <drivers/input/input_dev.h>
#include <drivers/ps_keyboard.h>

#include <kernel/irq.h>
#include <embox/unit.h>
#include <drivers/diag.h>
#include <drivers/tty.h>
#include <drivers/video_term.h>
#include <drivers/i8042.h>

EMBOX_UNIT_INIT(keyboard_init);

static void keyboard_send_cmd(uint8_t cmd) {
	unsigned int status;
	keyboard_wait_write(status);
	outb(cmd, I8042_CMD_PORT);
}

static unsigned char keyboard_get_mode(void) {
	unsigned char status;

	keyboard_send_cmd(I8042_CMD_READ_MODE);
	keyboard_wait_read(status);
	return inb(I8042_DATA_PORT);
}

static void keyboard_set_mode(unsigned char mode) {
	unsigned char status;

	keyboard_send_cmd(I8042_CMD_WRITE_MODE);
	keyboard_wait_write(status);
	outb(mode, I8042_DATA_PORT);
}

static int keyboard_get_input_event(struct input_dev *dev, struct input_event *event) {
	uint8_t scan_code, status;
	int ret = 0;

	irq_lock();
	{
		status = keyboard_read_stat();

		if (!(status & I8042_STS_OBF)) {
			ret = -EAGAIN;
			goto out;
		}

		scan_code = inb(I8042_DATA_PORT);

		if (scan_code == KEYBOARD_SCAN_CODE_EXT) {
			ret = -EAGAIN;
			goto out;
		}

		if (status & I8042_STS_AUXOBF) {
			ret = -EAGAIN;
			goto out;
		}

		keyboard_scan_code_to_event(scan_code, event);
	}
out:
	irq_unlock();
	return ret;
}

static int keyboard_start(struct input_dev *indev) {
	uint8_t mode;

	irq_lock();
	{
		/* If 0x64 returns 0xff, then we have no keyboard
		 * controller */
		if (inb(0x64) == 0xFF) {
			goto out;
		}

		keyboard_send_cmd(I8042_CMD_PORT_DIS);

		while (keyboard_havechar()) inb(I8042_DATA_PORT);

		/* Read the current mode */
		mode = keyboard_get_mode();
		/* Turn on scancode translate mode so that we can
		 use the scancode set 1 tables */
		mode |= I8042_MODE_XLATE;
		/* Enable keyboard. */
		mode &= ~I8042_MODE_DISABLE;
		/* Enable interrupt */
		mode |= I8042_MODE_INTERRUPT;
		/* Write the new mode */
		keyboard_set_mode(mode);

		keyboard_send_cmd(I8042_CMD_PORT_EN);

		i8042_wait_write();
		outb(I8042_KBD_RESET_ENABLE, I8042_DATA_PORT);
	}
out:
	irq_unlock();
	return 0;
}

static int keyboard_stop(struct input_dev *dev) {

	/* TODO */
	return 0;
}

static const struct input_dev_ops kbd_input_ops = {
		/*.start = keyboard_start,*/
		.stop = keyboard_stop,
};

static struct input_dev kbd_dev = {
		.ops = &kbd_input_ops,
		.name = "ps-keyboard",
		.type = INPUT_DEV_KBD,
};

static irq_return_t ps_kbd_irq_hnd(unsigned int irq_nr, void *data) {
	struct input_dev *dev = (struct input_dev *) data;
	struct input_event ev;
	int ret;

	ret = keyboard_get_input_event(dev, &ev);
	if (!ret) {
		input_dev_report_event(dev, &ev);
	}

	return IRQ_HANDLED;
}

static int keyboard_init(void) {
	int res;

	res = irq_attach(I8042_KBD_IRQ, ps_kbd_irq_hnd, 0,
					 &kbd_dev, "ps keyboard");
	if (res < 0) {
		return res;
	}

	keyboard_start(NULL);

	return input_dev_register(&kbd_dev);
}


text:
/* SimpleApp.scala */

import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf

import com.datastax.spark.connector._

object SimpleApp {
    def main(args: Array[String]) {
        // We'll need to put this in CFS for it to be available at /README.txt
        val textFile = "/README.txt"
        val conf = new SparkConf().setAppName("Simple DSE Spark App")
        val sc = new SparkContext(conf)
        val numPartitions = 2

        val textData = sc.textFile(textFile, numPartitions).cache()
        val numApaches = textData.filter(line => line.contains("Apache")).count()
        val numSparks = textData.filter(line => line.contains("Spark")).count()
        println("Lines with Apache: %s, Lines with Spark: %s".format(numApaches, numSparks))
    }
}


text:
import base64
import datetime
import sys
import unittest

from test_support import test_env
test_env.setup_test_env()

import mock

from google.appengine.ext import ndb

from components import auth
from components import net
from components.config import remote
from test_support import test_case

import test_config_pb2

class RemoteTestCase(test_case.TestCase):
  def setUp(self):
    super(RemoteTestCase, self).setUp()
    self.mock(net, 'json_request_async', mock.Mock())
    net.json_request_async.side_effect = self.json_request_async

    self.provider = remote.Provider('luci-config.appspot.com')
    provider_future = ndb.Future()
    provider_future.set_result(self.provider)
    self.mock(remote, 'get_provider_async', lambda: provider_future)

  @ndb.tasklet
  def json_request_async(self, url, **kwargs):
    assert kwargs['scopes']
    URL_PREFIX = 'https://luci-config.appspot.com/_ah/api/config/v1/'
    if url == URL_PREFIX + 'config_sets/services%2Ffoo/config/bar.cfg':
      assert kwargs['params']['hash_only']
      raise ndb.Return({
        'content_hash': 'deadbeef',
        'revision': 'aaaabbbb',
      })
    if url == URL_PREFIX + 'config_sets/services%2Ffoo/config/baz.cfg':
      assert kwargs['params']['hash_only']
      raise ndb.Return({
        'content_hash': 'badcoffee',
        'revision': 'aaaabbbb',
      })

    if url == URL_PREFIX + 'config/deadbeef':
      raise ndb.Return({
        'content':  base64.b64encode('a config'),
      })
    if url == URL_PREFIX + 'config/badcoffee':
      raise ndb.Return({
        'content':  base64.b64encode('param: "qux"'),
      })

    if url == URL_PREFIX + 'projects':
      raise ndb.Return({
        'projects': [
          {
           'id': 'chromium',
           'repo_type': 'GITILES',
           'repo_url': 'https://chromium.googlesource.com/chromium/src',
           'name': 'Chromium browser'
          },
          {
           'id': 'infra',
           'repo_type': 'GITILES',
           'repo_url': 'https://chromium.googlesource.com/infra/infra',
          },
        ]
      })
    self.fail('Unexpected url: %s' % url)

  def test_get_async(self):
    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg').get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(content, 'a config')

    # Memcache coverage
    net.json_request_async.reset_mock()
    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg').get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(content, 'a config')
    self.assertFalse(net.json_request_async.called)

  def test_get_async_with_revision(self):
    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg', revision='aaaabbbb').get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(content, 'a config')

    net.json_request_async.assert_any_call(
        'https://luci-config.appspot.com/_ah/api/config/v1/'
        'config_sets/services%2Ffoo/config/bar.cfg',
        params={'hash_only': True, 'revision': 'aaaabbbb'},
        scopes=net.EMAIL_SCOPE)

    # Memcache coverage
    net.json_request_async.reset_mock()
    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg', revision='aaaabbbb').get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(content, 'a config')
    self.assertFalse(net.json_request_async.called)

  def test_last_good(self):
    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg', store_last_good=True).get_result()
    self.assertIsNone(revision)
    self.assertIsNone(content)

    self.assertTrue(remote.LastGoodConfig.get_by_id('services/foo:bar.cfg'))
    remote.LastGoodConfig(
        id='services/foo:bar.cfg',
        content='a config',
        content_hash='deadbeef',
        revision='aaaaaaaa').put()

    revision, content = self.provider.get_async(
        'services/foo', 'bar.cfg', store_last_good=True).get_result()
    self.assertEqual(revision, 'aaaaaaaa')
    self.assertEqual(content, 'a config')

    self.assertFalse(net.json_request_async.called)

  def test_get_projects(self):
    projects = self.provider.get_projects_async().get_result()
    self.assertEqual(projects, [
      {
       'id': 'chromium',
       'repo_type': 'GITILES',
       'repo_url': 'https://chromium.googlesource.com/chromium/src',
       'name': 'Chromium browser'
      },
      {
       'id': 'infra',
       'repo_type': 'GITILES',
       'repo_url': 'https://chromium.googlesource.com/infra/infra',
      },
    ])

  def test_get_project_configs_async_receives_404(self):
    net.json_request_async.side_effect = net.NotFoundError(
        'Not found', 404, None)
    with self.assertRaises(net.NotFoundError):
      self.provider.get_project_configs_async('cfg').get_result()

  def test_get_project_configs_async(self):
    self.mock(net, 'json_request_async', mock.Mock())
    net.json_request_async.return_value = ndb.Future()
    net.json_request_async.return_value.set_result({
      'configs': [
        {
          'config_set': 'projects/chromium',
          'content_hash': 'deadbeef',
          'path': 'cfg',
          'revision': 'aaaaaaaa',
        }
      ]
    })
    self.mock(self.provider, 'get_config_by_hash_async', mock.Mock())
    self.provider.get_config_by_hash_async.return_value = ndb.Future()
    self.provider.get_config_by_hash_async.return_value.set_result('a config')

    configs = self.provider.get_project_configs_async('cfg').get_result()

    self.assertEqual(configs, {'projects/chromium': ('aaaaaaaa', 'a config')})

  def test_get_config_set_location_async(self):
    self.mock(net, 'json_request_async', mock.Mock())
    net.json_request_async.return_value = ndb.Future()
    net.json_request_async.return_value.set_result({
      'mappings': [
        {
          'config_set': 'services/abc',
          'location': 'http://example.com',
        },
      ],
    })
    r = self.provider.get_config_set_location_async('services/abc').get_result()
    self.assertEqual(r, 'http://example.com')
    net.json_request_async.assert_called_once_with(
        'https://luci-config.appspot.com/_ah/api/config/v1/mapping',
        scopes=net.EMAIL_SCOPE,
        params={'config_set': 'services/abc'})

  def test_cron_update_last_good_configs(self):
    self.provider.get_async(
        'services/foo', 'bar.cfg', store_last_good=True).get_result()
    self.provider.get_async(
        'services/foo', 'baz.cfg', dest_type=test_config_pb2.Config,
        store_last_good=True).get_result()

    # Will be removed.
    old_cfg = remote.LastGoodConfig(
        id='projects/old:foo.cfg',
        content_hash='aaaa',
        content='content',
        last_access_ts=datetime.datetime(2010, 1, 1))
    old_cfg.put()

    remote.cron_update_last_good_configs()

    revision, config = self.provider.get_async(
        'services/foo', 'bar.cfg', store_last_good=True).get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(config, 'a config')

    revision, config = self.provider.get_async(
        'services/foo', 'baz.cfg', dest_type=test_config_pb2.Config,
        store_last_good=True).get_result()
    self.assertEqual(revision, 'aaaabbbb')
    self.assertEqual(config.param, 'qux')

    baz_cfg = remote.LastGoodConfig.get_by_id(id='services/foo:baz.cfg')
    self.assertIsNotNone(baz_cfg)
    self.assertEquals(baz_cfg.content_binary, config.SerializeToString())

    self.assertIsNone(old_cfg.key.get())

if __name__ == '__main__':
  if '-v' in sys.argv:
    unittest.TestCase.maxDiff = None
  unittest.main()


text:
#include <assert.h>
#include <netdb.h>

#include <thrift/c_glib/transport/thrift_transport.h>
#include <thrift/c_glib/transport/thrift_socket.h>
#include <thrift/c_glib/transport/thrift_server_transport.h>
#include <thrift/c_glib/transport/thrift_server_socket.h>

#define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }

#include "../src/thrift/c_glib/transport/thrift_memory_buffer.c"

/* test object creation and destruction */
static void
test_create_and_destroy(void)
{
  GObject *object = NULL;
  object = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, NULL);
  assert (object != NULL);
  g_object_unref (object);
}

static void
test_open_and_close(void)
{
  ThriftMemoryBuffer *tbuffer = NULL;

  /* create a ThriftMemoryBuffer */
  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, NULL);

  /* this shouldn't work */
  assert (thrift_memory_buffer_open (THRIFT_TRANSPORT (tbuffer), NULL) == TRUE);
  assert (thrift_memory_buffer_is_open (THRIFT_TRANSPORT (tbuffer)) == TRUE);
  assert (thrift_memory_buffer_close (THRIFT_TRANSPORT (tbuffer), NULL) == TRUE);
  g_object_unref (tbuffer);
}

static void
test_read_and_write(void)
{
  ThriftMemoryBuffer *tbuffer = NULL;
  guchar buf[10] = TEST_DATA;
  guchar read[10];
  GError *error = NULL;

  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, "buf_size", 5, NULL);
  assert (thrift_memory_buffer_write (THRIFT_TRANSPORT (tbuffer),
                                      (gpointer) buf,
                                      10, &error) == FALSE);
  assert (error != NULL);
  g_error_free (error);
  error = NULL;
  g_object_unref (tbuffer);

  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, "buf_size", 15, NULL);
  assert (thrift_memory_buffer_write (THRIFT_TRANSPORT (tbuffer),
                                      (gpointer) buf, 10, &error) == TRUE);
  assert (error == NULL);

  assert (thrift_memory_buffer_read (THRIFT_TRANSPORT (tbuffer),
                                     &read, 10, &error) > 0);
  assert (error == NULL);
}

int
main(int argc, char *argv[])
{
#if (!GLIB_CHECK_VERSION (2, 36, 0))
  g_type_init();
#endif

  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/testmemorybuffer/CreateAndDestroy", test_create_and_destroy);
  g_test_add_func ("/testmemorybuffer/OpenAndClose", test_open_and_close);
  g_test_add_func ("/testmemorybuffer/ReadAndWrite", test_read_and_write);

  return g_test_run ();
}


text:
describe LockFile do

  before do
    @lockfile_args = [File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp")), "example.lock"]

    File.delete(@lockfile_args.join("/")) if File.exists?(@lockfile_args.join("/"))
  end

  it "should return a qualified pathname" do
    @lockfile = LockFile.new(*@lockfile_args)

    @lockfile.path.should =~ /tmp/
    @lockfile.filename.should == "example.lock"
    @lockfile.qualified_path.should =~ /tmp\/example.lock/
  end

  it "should have the correct error classes present" do
    LockFile::LockFileError.ancestors.should include(StandardError)
    LockFile::LockFileExists.ancestors.should include(StandardError)
    LockFile::LockFileMissing.ancestors.should include(StandardError)
  end

  it "should not initially be locked" do
    @lockfile = LockFile.new(*@lockfile_args)

    @lockfile.locked?.should be_false
  end

  it "should be able to lock" do
    @lockfile = LockFile.new(*@lockfile_args)

    @lockfile.lock!.should be_true
    @lockfile.locked?.should be_true
    @lockfile.unlocked?.should be_false
  end

  it "should be able to unlock" do
    @lockfile = LockFile.new(*@lockfile_args)

    @lockfile.lock!.should be_true
    @lockfile.locked?.should be_true
    @lockfile.unlocked?.should be_false
    @lockfile.unlock!.should be_true
    @lockfile.locked?.should be_false
    @lockfile.unlocked?.should be_true
  end

  it "should return the process ID of the lockfile if it exists" do
    @lockfile = LockFile.new(*@lockfile_args)

    @lockfile.process_id.should be_nil
    @lockfile.lock!
    @lockfile.process_id.should_not be_nil
    @lockfile.process_id.class.should == Fixnum
  end

end


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Dansk bot. Ark. 9(no. 6): 37 (1938)

#### Original name
Galera tenera f. minor J.E. Lange

### Remarks
null


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Sachbuch Erste Hilfe in Typografie</title>
  <meta name="description" content="»Erste Hilfe in Typografie« erklärt in verständlicher Sprache das komplexe Thema Typografie und unterteilt es in wohldosierte Kapitel.

Als passionierter Leser, Buchfan und Schreiber liebe ich Typografie und Papier. Schwarze Buchstaben auf weißem Untergrund üben immer wieder eine fast soghafte Faszination aus. Der gekonnte Einsatz von Typografie bildet hierbei nicht nur die hilfreiche Vermittlung von Inhalten, sondern auch einen ästhetischen Genuss. Das preiswerte Buch »Erste Hilfe in Typografie« von Hans Peter Willberg und Friedrich Forssmann gibt Typo-Neulingen aufschlussreiche Einblicke, Hilfestellungen und anschauliche Beispiele für die überlegte Verwendung von Typografie.

»Erste Hilfe in Typografie« ist eines jener Bücher, das in einer verständlichen Sprache ein komplexes Thema in wohldosierte Kapitel herunterbricht. Während man das Buch liest, nimmt man unkompliziert die Inhalte auf. Das liegt einerseits an den einfachen und einleuchtenden Beispielen, andererseits aber auch am hier und da durchschimmernden Humor.

Das Thema Typografie stellen die beiden Autoren gekonnt vor und bieten neben zahlreichen Beispielen auch 'was fürs Auge. So führt zum Beispiel das Kapitel »8 Schriften vier Papiere« vor Augen, wie unterschiedliche Schriften auf unterschiedlichem Papier wirken. Besonders wird dieses Beispiel dadurch unterstrichen, dass tatsächlich verschiedene Papiersorten im Buch genutzt werden – die Effekte sind erstaunlich.

Der Ratgeber für Gestaltung mit Schrift…

…ist darüber hinaus mit 13 Euro außerdem preiswert. Die Anschaffung lohnt sich, denn das Buch im DIN A4 Format konsultiert man immer wieder. Insgesamt also ein exzellenter Einstieg für Laien und Typoneulinge.

Informationen zum Design Buch

Erste Hilfe in Typografie
Hans Peter Willberg und Friedrich Forssman
104 Seiten mit mehreren 100 Abbildungen und Beispielen
Euro 12,80 | sFr. 23,40
ISBN 3-87439-474-3">
  <link rel="canonical" href="https://mo.phlow.de/erste-hilfe-in-typografie/">

  <meta property="og:title" content="Sachbuch Erste Hilfe in Typografie">
  <meta property="og:description" content="»Erste Hilfe in Typografie« erklärt in verständlicher Sprache das komplexe Thema Typografie und unterteilt es in wohldosierte Kapitel.

Als passionierter Leser, Buchfan und Schreiber liebe ich Typografie und Papier. Schwarze Buchstaben auf weißem Untergrund üben immer wieder eine fast soghafte ...">
  <meta property="og:url" content="https://mo.phlow.de/erste-hilfe-in-typografie/">
  <meta property="og:locale" content="de_DE">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Sign 'O' The Times">
  <meta property="og:image" content="https://mo.phlow.de/assets/img/facebook-placeholder-1200x630.jpg">

  <link rel="icon" sizes="32x32" href="https://mo.phlow.de/assets/img/favicon-32x32.png" />
  <link rel="icon" sizes="192x192" href="https://mo.phlow.de/assets/img/touch-icon-192x192.png" />
  <link rel="apple-touch-icon-precomposed" sizes="180x180" href="https://mo.phlow.de/assets/img/apple-touch-icon-180x180-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="152x152" href="https://mo.phlow.de/assets/img/apple-touch-icon-152x152-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://mo.phlow.de/assets/img/apple-touch-icon-144x144-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="120x120" href="https://mo.phlow.de/assets/img/apple-touch-icon-120x120-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://mo.phlow.de/assets/img/apple-touch-icon-114x114-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="76x76" href="https://mo.phlow.de/assets/img/apple-touch-icon-76x76-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://mo.phlow.de/assets/img/apple-touch-icon-72x72-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" href="https://mo.phlow.de/assets/img/apple-touch-icon-precomposed.png" />
  <meta name="msapplication-TileImage" content="https://mo.phlow.de/assets/img/msapplication_tileimage.png" />
  <meta name="msapplication-TileColor" content="#fabb00" />

  <link rel="alternate" type="application/rss+xml" title="RSS Sign 'O' The Times" href="https://mo.phlow.de/feed.xml">
  <link type="text/plain" rel="author" href="https://mo.phlow.de/humans.txt">

  <link rel="stylesheet" href="https://mo.phlow.de/assets/css/styles.css">

    Sign 'O' The Times

    Digitale Kultur / Digitales Leben

  ARTIKEL

   /

  SUCHE

   /

  ÜBER

Sachbuch

Erste Hilfe in Typografie

»Erste Hilfe in Typografie« erklärt in verständlicher Sprache das komplexe Thema Typografie und unterteilt es in wohldosierte Kapitel.

Als passionierter Leser, Buchfan und Schreiber liebe ich Typografie und Papier. Schwarze Buchstaben auf weißem Untergrund üben immer wieder eine fast soghafte Faszination aus. Der gekonnte Einsatz von Typografie bildet hierbei nicht nur die hilfreiche Vermittlung von Inhalten, sondern auch einen ästhetischen Genuss. Das preiswerte Buch »Erste Hilfe in Typografie« von Hans Peter Willberg und Friedrich Forssmann gibt Typo-Neulingen aufschlussreiche Einblicke, Hilfestellungen und anschauliche Beispiele für die überlegte Verwendung von Typografie.

»Erste Hilfe in Typografie« ist eines jener Bücher, das in einer verständlichen Sprache ein komplexes Thema in wohldosierte Kapitel herunterbricht. Während man das Buch liest, nimmt man unkompliziert die Inhalte auf. Das liegt einerseits an den einfachen und einleuchtenden Beispielen, andererseits aber auch am hier und da durchschimmernden Humor.

Das Thema Typografie stellen die beiden Autoren gekonnt vor und bieten neben zahlreichen Beispielen auch 'was fürs Auge. So führt zum Beispiel das Kapitel »8 Schriften vier Papiere« vor Augen, wie unterschiedliche Schriften auf unterschiedlichem Papier wirken. Besonders wird dieses Beispiel dadurch unterstrichen, dass tatsächlich verschiedene Papiersorten im Buch genutzt werden – die Effekte sind erstaunlich.

Der Ratgeber für Gestaltung mit Schrift…

…ist darüber hinaus mit 13 Euro außerdem preiswert. Die Anschaffung lohnt sich, denn das Buch im DIN A4 Format konsultiert man immer wieder. Insgesamt also ein exzellenter Einstieg für Laien und Typoneulinge.

Informationen zum Design Buch

Erste Hilfe in Typografie

Hans Peter Willberg und Friedrich Forssman

104 Seiten mit mehreren 100 Abbildungen und Beispielen

Euro 12,80 | sFr. 23,40

ISBN 3-87439-474-3

#buchkritik

#design

#schrift

#typografie

      – <time datetime="2014-10-11T00:00:00+02:00" itemprop="datePublished">11. Oct 2014</time>

      /

        Moritz »mo.« Sauer

<button class="tem2" onclick="myFunction()">Was meinst Du? Kommentar schreiben!</button>

Was meinst Du? Kommentar schreiben!.

      Impressum & Datenschutz /

      Kontakt /

      RSS /
      ↑


text:
/*
We are going to force all our domain object entities to extend the EntityBase class
So we have a new Typescript module called app.domain and we have declared ain interface and class that will be available
outside this module, because we used the export keyword
*/

///<reference path="../../Scripts/typings/jquery/jquery.d.ts" />
///<reference path="../../Scripts/typings/angularjs/angular.d.ts" />

module app.domain {
    //Make the interface and class available outside of the module using export
    export interface IEntity { }
}


text:
typedef NS_ENUM(NSUInteger, SPButtonPosition) {
    SPButtonPositionLeft = 0,
    SPButtonPositionRight,
};

typedef NS_ENUM(NSUInteger, SPButtonState) {
    SPButtonStateIdle = 0,
    SPButtonStateLogin,
    SPButtonStateSignup,
};

static const float PLAYER_VOLUME = 0.0;
static const float BUTTON_PADDING = 20.0f;
static const float BUTTON_CORNER_RADIUS = 8.0f;
static const float BUTTON_ANIM_DURATION = 3.0f;
static const float TITLE_ANIM_DURATION = 5.0f;
static const float TITLE_FONT_SIZE = 72.0f;

const NSString *leftButtonIdleTitle = @"Login";
const NSString *leftButtonLoginTitle = @"Confirm Login";
const NSString *leftButtonSignupTitle = @"Confirm Signup";

const NSString *rightButtonIdleTitle = @"Signup";
const NSString *rightButtonLoginTitle = @"Cancel Login";
const NSString *rightButtonSignupTitle = @"Cancel Signup";

const NSString *leftButtonIdleAction = @"onLoginClick";
const NSString *leftButtonLoginAction = @"onConfirmClick";
const NSString *leftButtonSignupAction = @"onConfirmClick";

const NSString *rightButtonIdleAction = @"onSignupClick";
const NSString *rightButtonLoginAction = @"onCalcelClick";
const NSString *rightButtonSignupAction = @"onCancelClick";

@interface SplashViewController ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *leftButton;
@property (nonatomic, strong) UIButton *rightButton;

@property (nonatomic, strong) SplashView *cardView;
@property (nonatomic, strong) SPButtonState state;

@property (nonatomic, strong) AVPlayer *player;
@property (nonatomic, weak) IBOutlet UIView *playerView;

@end

@implementation SplashViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.state = SPButtonStateIdle;

    [self createVideoPlayer];
    [self createTitleLabel];
    [self createTwoButton];
    [self createShowAnim];
    [self initSplashView];

}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillChangeFrame:)
                                                 name:UIKeyboardWillChangeFrameNotification
                                               object:nil
     ];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(applicationDidBecomeActive:)
                                                 name:UIApplicationDidBecomeActiveNotification
                                               object:nil];
}

- (void)viewWillDisappear:(BOOL)animated {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)createShowAnim {
    CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"opacity"];
    anim.fromValue = @0.0f;
    anim.toValue = @1.0f;
    anim.duration = BUTTON_ANIM_DURATION;
    for (UIView *subview in self.view.subviews) {
        if ([subview isEqual:self.playerView] || [subview isEqual:self.titleLabel]) {
            continue;
        }
        [subview.layer addAnimation:anim forKey:@"alpha"];
    }
    CAKeyframeAnimation *keyAnim = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
    keyAnim.duration = TITLE_ANIM_DURATION;
    keyAnim.values = @[@0.0, @1.0, @0.0];
    keyAnim.keyTimes = @[@0.0, @0.35, @1.0];
    [self.titleLabel.layer addAnimation:keyAnim forKey:@"opacity"];
}

- (void)createVideoPlayer {

    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"mp4"];
    NSURL *url = [NSURL fileURLWithPath:filePath];

    AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];

    self.player = [AVPlayer playerWithPlayerItem:playerItem];
    self.player.volume = PLAYER_VOLUME;

    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
    playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
    playerLayer.frame = self.playerView.layer.bounds;
    [self.playerView.layer addSublayer:playerLayer];

    [self.player play];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayDidEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.player.currentItem];
}

- (void)createTitleLabel {

    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width - 80, 80)];
    self.titleLabel.alpha = 0.0f;
    self.titleLabel.center = self.view.center;
    self.titleLabel.backgroundColor = [UIColor clearColor];
    self.titleLabel.text = @"UBER";
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.textColor = [UIColor colorWithWhite:1.0 alpha:0.2];
    self.titleLabel.font = [UIFont systemFontOfSize:TITLE_FONT_SIZE];
    [self.view addSubview:self.titleLabel];
}

- (void)createTwoButton {

    self.leftButton = [self createButtonWithTitle:@"Log in" index:SPButtonPositionLeft action:@selector(onLoginClick)];
    self.rightButton = [self createButtonWithTitle:@"Sign up" index:SPButtonPositionRight action:@selector(onSignupClick)];
    [self.view addSubview:self.leftButton];
    [self.view addSubview:self.rightButton];
}

- (UIButton *)createButtonWithTitle:(NSString *)title index:(SPButtonPosition)index action:(SEL)action {

    float screenWidth = self.view.frame.size.width;
    float screenHeight = self.view.frame.size.height;
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    [button setFrame:CGRectMake(0, 0, (screenWidth - 3*BUTTON_PADDING) / 2, 30)];
    [button setCenter:CGPointMake((screenWidth / 4) + (index * screenWidth / 2), screenHeight - 30)];
    [button setTintColor:[UIColor whiteColor]];
    [button setBackgroundColor:[UIColor clearColor]];

    button.layer.cornerRadius = BUTTON_CORNER_RADIUS;
    button.layer.borderWidth = 1.0f;
    button.layer.borderColor = [[UIColor whiteColor] CGColor];
    button.clipsToBounds = YES;

    [button setTitle:title forState:UIControlStateNormal];
    [button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
    return button;
}

#pragma mark - observer of player

// 视频循环播放
- (void)moviePlayDidEnd:(NSNotification*)notification{

    AVPlayerItem *item = [notification object];
    [item seekToTime:kCMTimeZero];
    [self.player play];
}

#pragma mark - keyboard
// 解决键盘遮挡textfield和确认按钮,通过通知中心触发,改变相应视图frame
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
    NSDictionary *info = [notification userInfo];
    CGRect beginKeyboardRect = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
    CGRect endKeyboardRect = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];

    CGFloat yOffset = endKeyboardRect.origin.y - beginKeyboardRect.origin.y;
    for (UIView *subview in self.view.subviews) {
        if ([subview isEqual:self.playerView] || [subview isEqual:self.titleLabel]) {
            continue;
        }
        CGRect frame = subview.frame;
        frame.origin.y += yOffset;
        subview.frame = frame;
    }
}

- (void)applicationDidBecomeActive:(NSNotification *)notification {

    if (!self.player) return;
    [self.player play];
}

#pragma mark - button click
- (void)onLoginClick {
    [self transitionToNewStatus:SPButtonStateLogin];
}

- (void)onSignupClick {
    [self transitionToNewStatus:SPButtonStateSignup];
}

- (void)onConfirmClick {
    for (UIView *subview in self.cardView.subviews) {
        [subview resignFirstResponder];
    }
    NSLog(@"%@成功 %@ %@",self.state == 1 ? @"登录":@"注册", self.cardView.username.text, self.cardView.password.text);
    [self transitionToNewStatus:SPButtonStateIdle];
}

- (void)onCancelClick {
    for (UIView *subview in self.cardView.subviews) {
        [subview resignFirstResponder];
    }
    [self transitionToNewStatus:SPButtonStateIdle];
}

// 当前按钮状态发生改变时改变按钮标题和事件
- (void)transitionToNewStatus:(SPButtonState)newStatus {

    NSArray *leftButtonTitles = @[leftButtonIdleTitle, leftButtonLoginTitle, leftButtonSignupTitle];
    NSArray *rightButtonTitles = @[rightButtonIdleTitle, rightButtonLoginTitle, rightButtonSignupTitle];
    NSArray *leftButtonActions = @[leftButtonIdleAction, leftButtonLoginAction, leftButtonSignupAction];
    NSArray *rightButtonActions = @[rightButtonIdleAction, rightButtonLoginAction, rightButtonSignupAction];

    // 移除按钮事件
    [self.leftButton removeTarget:self action:NSSelectorFromString(leftButtonActions[self.state]) forControlEvents:UIControlEventTouchUpInside];
    [self.rightButton removeTarget:self action:NSSelectorFromString(rightButtonActions[self.state]) forControlEvents:UIControlEventTouchUpInside];

    // 刷新当前状态
    self.state = newStatus;

    // 刷新按钮事件
    [self.leftButton addTarget:self action:NSSelectorFromString(leftButtonActions[newStatus]) forControlEvents:UIControlEventTouchUpInside];
    [self.leftButton setTitle:leftButtonTitles[newStatus] forState:UIControlStateNormal];
    [self.rightButton addTarget:self action:NSSelectorFromString(rightButtonActions[newStatus]) forControlEvents:UIControlEventTouchUpInside];
    [self.rightButton setTitle:rightButtonTitles[newStatus] forState:UIControlStateNormal];

    switch (self.state) {
        case SPButtonStateIdle:
            [self hideSplashView];
            break;

        case SPButtonStateLogin:
        case SPButtonStateSignup:
            [self showSplashView];
            break;
    }
}

#pragma mark - SplashView Animation
- (void)initSplashView {
    // TODO: 修改为弹性动画
    _cardView = [[SplashView alloc] init];
    _cardView.center = CGPointMake(CGRectGetMidX(self.view.bounds), -CGRectGetMidY(_cardView.bounds));
    [self.view addSubview:_cardView];
}

- (void)showSplashView {
    [UIView animateWithDuration:1.0 animations:^{
        CGPoint center = CGPointMake(self.cardView.center.x, self.cardView.center.y + 500);
        self.cardView.center = center;
    }];
}

- (void)hideSplashView {
    self.cardView.username.text = self.cardView.password.text = @"";
    [UIView animateWithDuration:0.3 animations:^{
        CGPoint center = CGPointMake(self.cardView.center.x, self.cardView.center.y - 500);
        self.cardView.center = center;
    }];
}

@end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.senac.tads3.pi3b.leonsdev.reserva.servlets;

import br.senac.tads3.pi3b.leonsdev.login.classes.SingletonLogin;
import br.senac.tads3.pi3b.leonsdev.reserva.classes.ReservaConsultar;
import br.senac.tads3.pi3b.leonsdev.reserva.classes.ServicoConsultaCancelaReserva;
import br.senac.tads3.pi3b.leonsdev.reserva.classes.ServicoReserva;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Rafael
 */
@WebServlet(name = "ConsultaReservaServlet", urlPatterns = {"/ConsultaReserva"})
public class ConsultaReservaServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        HttpSession sessao = request.getSession();
        SingletonLogin singleton = SingletonLogin.getInstance();

        String ticket = request.getParameter("buscaCodigo").trim();

        if (ticket == null || ticket.trim().equals("")) {
            request.setAttribute("erroConsulta", "Informe o ticket da reserva para a pesquisa.");
            if (singleton.getCargo().equals("Gerente")) {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVoo.jsp");
                dispatcher.forward(request, response);
                return;
            } else {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVooUsuario.jsp");
                dispatcher.forward(request, response);
                return;
            }
        }

        List<ReservaConsultar> consulta = null;

        try {
            consulta = ServicoConsultaCancelaReserva.consultaReserva(ticket);
        } catch (Exception e) {
            request.setAttribute("erroConsulta", e.getMessage());
            if (singleton.getCargo().equals("Gerente")) {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVoo.jsp");
                dispatcher.forward(request, response);
                return;
            } else {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVooUsuario.jsp");
                dispatcher.forward(request, response);
                return;
            }
        }
        if (consulta == null || consulta.isEmpty()) {
            request.setAttribute("erroConsulta", "Não houve resultado.");
            if (singleton.getCargo().equals("Gerente")) {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVoo.jsp");
                dispatcher.forward(request, response);
                return;
            } else {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVooUsuario.jsp");
                dispatcher.forward(request, response);
                return;
            }
        }

        sessao.setAttribute("listaConsulta", consulta);
        if (singleton.getCargo().equals("Gerente")) {
            RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVoo.jsp");
            dispatcher.forward(request, response);
        } else {
            RequestDispatcher dispatcher = request.getRequestDispatcher("/reservaConsultaRetornaVooUsuario.jsp");
            dispatcher.forward(request, response);
        }

    }
}


text:
module Puppet::Parser::Functions
  newfunction(:merge_array_of_hash, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
    Merges two or more hashes together into an array of hashes and returns the resulting hash merges inside an array.

    For example:

        $hash1 = [{'name' => 'testrule', 'value', => 'testvalue'}, {'name' => 'secondtestrule', 'value' => 'secondtestvalue', 'three' => 'losingthree'}]
        $hash2 = {'two' => 'dos', 'three', => 'tres'}
        $merged_hash = merge($hash1, $hash2)
        # The resulting hash is equivalent to:
        # $merged_hash =  [{'name' => 'testrule', 'value' => 'testvalue', 'two' => 'dos', 'three' => 'tres'}, {'name' => 'secondtestrule', 'value' => 'secondtestvalue', 'two' => 'dos', 'three' => 'tres'}]

    When there is a duplicate key, the key in the rightmost hash will "win."

    ENDHEREDOC

    if args.length < 2
      raise Puppet::ParseError, ("merge(): wrong number of arguments (#{args.length}; must be at least 2)")
    end

    hash_array = args[0]

    # This is just incase they happen to pass us a hash that's not in an array as their source hash
    hash_array = [hash_array] unless hash_array.is_a?(Array)

    result = Array.new

    hash_array.each do |arr|
      next if arr.is_a? String and arr.empty? # empty string is synonym for puppet's undef
      unless arr.is_a?(Hash)
        raise Puppet::ParseError, "merge: unexpected argument type #{arr.class}, only expects hash arguments"
      end
      # Swap args[0] so that we place each hash, one at a time, into the merge loop
      args[0] = arr
      # The hash we accumulate into
      accumulator = Hash.new
      # Merge into the accumulator hash
      args.each do |arg|
        next if arg.is_a? String and arg.empty? # empty string is synonym for puppet's undef
        unless arg.is_a?(Hash)
          raise Puppet::ParseError, "merge: unexpected argument type #{arg.class}, only expects hash arguments"
        end
        accumulator.merge!(arg)
      end
      # Place the fully merged hash into the array
      result << accumulator
    end
    return result
  end
end


text:
from django.db import models
from django.utils import timezone;

# Create your models here.

class OpLog(models.Model):
    """ Save the app op logs in the db.
    Args:
        user: an sso user_name
        op: should be one of the following operations
            reposit
            delete
            deploy
            update
            update
            lock
            scale
        app: the app name
        app_version: if the op is deploy, the app_version is the new version.
        time: the time when the op is begin
        message: if the op is lock, is the user's input message; otherwise will be description for the op
    """
    user = models.CharField(max_length=64)
    op = models.CharField(max_length=16)
    app = models.CharField(max_length=32)
    app_version = models.CharField(max_length=128)
    time = models.DateTimeField()
    message = models.CharField(max_length=512)

def add_oplog(user, op, app, app_version, message):
    try:
        time = timezone.localtime(timezone.now())
        oplog = OpLog(user=user, op=op, app=app,
                      app_version=app_version, time=time, message=message)
        oplog.save()
    except:
        pass


text:
package bweng.netbeans.thrift;

import bweng.netbeans.thrift.nodes.ThriftChildFactory;
import bweng.netbeans.thrift.nodes.ThriftNode;
import org.netbeans.api.project.Project;
import bweng.thrift.parser.ThriftLexer;
import bweng.thrift.parser.ThriftModelGenerator;
import bweng.thrift.parser.model.ThriftDocument;
import java.io.IOException;
import org.antlr.runtime.ANTLRInputStream;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.MIMEResolver;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Result;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.TopComponent;

@Messages({
    "LBL_Thrift_LOADER=Files of Thrift"
})
@MIMEResolver.ExtensionRegistration(
        displayName = "#LBL_Thrift_LOADER",
        mimeType = "text/x-thrift",
        extension = {"thrift"},
        position = 300
)
@DataObject.Registration(
        mimeType = "text/x-thrift",
        iconBase = "bweng/netbeans/thrift/resources/Thrift.png",
        displayName = "#LBL_Thrift_LOADER",
        position = 300
)

/**
 * Data Object Node to represent a Thrift file.
 * @author Bernd Wengenroth
 */
public class ThriftDataObject extends MultiDataObject {

    public final static String mime_type = "text/x-thrift";

    private ThriftDocument doc_;

    Result<Project> projectsInLookup;

    public ThriftDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
        super(pf, loader);
        registerEditor("text/x-thrift", true);
    }

    @Override
    protected int associateLookup()
    {
        return 1;
    }

    @MultiViewElement.Registration(
            displayName = "#LBL_Thrift_EDITOR",
            iconBase = "bweng/netbeans/thrift/resources/Thrift.png",
            mimeType = "text/x-thrift",
            persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
            preferredID = "Thrift",
            position = 1000
    )

    @Messages("LBL_Thrift_EDITOR=Source")
    public static MultiViewEditorElement createEditor(Lookup lkp) {
        return new MultiViewEditorElement(lkp);
    }

    @Override
    protected Node createNodeDelegate()
    {
        return new ThriftNode(this,
                Children.create(new ThriftChildFactory(this), true),
                getLookup());
    }

    public void refresh()
    {
       doc_ = null;
    }

    public synchronized ThriftDocument getDocument()
    {
       if ( null == doc_ )
       {
         FileObject fObj = getPrimaryFile();
         try
         {
            ThriftLexer lex = new ThriftLexer(new ANTLRInputStream(fObj.getInputStream()));
            doc_ = new ThriftModelGenerator().generateModel( fObj.getName(), lex );
            if ( doc_ != null) doc_.ospath_ = fObj.getPath();
         }
         catch (IOException ex)
         {
            // ex.printStackTrace();
         }
       }
       return doc_;
    }

}


text:
evernote-mode
=============
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/pymander/evernote-mode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/pymander/evernote-mode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Emacs interface for Evernote which originally started on
[Google Code][1].  Then it was [updated][2] for working with Ruby
1.9.3 and Emacs 24.1.  Which was then updated to [work with OAuth][3].
Then just a little bit of Emacs customization niceness was added.

INSTALLATION
------------

You will need to install the Evernote OAUTH Ruby gems in order to get
all of this stuff working.  Run the following command:

    gem install evernote_oauth

Clone this repo and run setup.rb:

    git clone https://github.com/pymander/evernote-mode
    cd evernote-mode/ruby
    ruby setup.rb

Copy `evernote-mode.el` to your load path.

See the [Original Readme][5] for installation and usage details.

CONFIGURATION
-------------

You'll need to get a production developer token from [Evernote][4] and
in Emacs set the custom variable `evernote-developer-token`.  If
`evernote-mode` is loaded this can be done easily with `M-x
customize-group evernote`.

.emacs SETUP
-------------
Below is a sample .emacs config file,

```{lisp}
(add-to-list 'load-path "~/.emacs.d/evernote-mode")
(require 'evernote-mode)
(setq evernote-username "<EVERNOTE USERNAME>") ; optional: you can use this username as default.
(setq evernote-enml-formatter-command '("w3m" "-dump" "-I" "UTF8" "-O" "UTF8")) ; option
(global-set-key "\C-cec" 'evernote-create-note)
(global-set-key "\C-ceo" 'evernote-open-note)
(global-set-key "\C-ces" 'evernote-search-notes)
(global-set-key "\C-ceS" 'evernote-do-saved-search)
(global-set-key "\C-cew" 'evernote-write-note)
(global-set-key "\C-cep" 'evernote-post-region)
(global-set-key "\C-ceb" 'evernote-browser)
(custom-set-variables '(evernote-developer-token "<EVERNOTE DEV TOKEN>"))
```

In this case, you will also need to install w3m,

     apt-get install w3m

or

     yum install w3m
TROUBLESHOOTING
---------------

If you get an error message regarding enclient.rb, you may need to modify
the variable enh-enclient-command in evernote-mode.el (check to see where setup.rb installed it).

[1]: http://code.google.com/p/emacs-evernote-mode/ "Original source"

[2]: https://github.com/rubbish/evernote-mode "rubbish/evernote-mode"

[3]: https://github.com/pymander/evernote-mode "pymander/evernote-mode"

[4]: http://dev.evernote.com/doc/articles/authentication.php#devtoken "Evernote Authentication"

[5]: http://emacs-evernote-mode.googlecode.com/svn/branches/0_41/doc/readme_en.html "Original Readme"


text:
using namespace std;

void interp(string program) {
    unsigned int program_counter = 0;
    while (program_counter < program.size()) {
        if ( '0' <= program[program_counter] && program[program_counter] <= '9') {
            if (program[program_counter] == '0') {
                // nop.
            } else {
                program[program_counter] = program[program_counter]-1;
                program_counter -= 2;
            }
        } else if (program[program_counter]=='n') {
            cout << endl;
        } else {
            cout << program[program_counter];
        }
        program_counter += 1;
    }
}

int main() {
    string program = "+-8+n| 8|n| 8|n| 8|n| 8|n| 8|n+-8+n";
    interp(program);

    return 0;
}


text:
require_relative 'inputs/HTML/CPBKGB22/Personal/CreditCard/V_2011_04_09'
require_relative 'inputs/HTML/CPBKGB22/Personal/CreditCard/V_2015_05_27'
require_relative 'inputs/HTML/CPBKGB22/Personal/Current/V_2011_05_07'
require_relative 'inputs/HTML/CPBKGB22/Personal/Current/V_2015_03_03'
require_relative 'inputs/HTML/CPBKGB22/Personal/Savings/V_2011_05_07'
require_relative 'inputs/HTML/CPBKGB22/Personal/Savings/V_2015_03_03'
require_relative 'inputs/TXT/CPBKGB22/Business/Current/V_2015_12_06'


text:
This repository's goal is to create a way to classify pictures in categories.

It's composed of three docker containers :

1. rebuild-pics.yml : Get pictures used for training in a distant database, download them and resize them.

2. classify-pics.yml : Train a CNN with theses pictures.

3. report.yml : Start a web server in order to easily see the results on a webpage.

## Requirements :
* docker
* docker-compose
* git

## How to install :
#### 1. Clone this repository :

"git clone https://github.com/anthill/pixifier.git"

#### 2. Mount the 3 docker containers :

"docker-compose -f rebuild-pics.yml build"

"docker-compose -f classify-pics.yml build"

"docker-compose -f report.yml build"

## How to configure :

#### Create the file app/param-ini.json and configure it (example in param-ini.json.sample)

* urlAPI : URL of the training API sending you every pictures, and their associated categories

    here's what the API should look like :

    [{"category":"CATEGORY","title":"KEYWORD1 KEYWORD2 ","pics":"pic1.jpg;pic2.jpg;"},{"category":"sport","title":"red bicycle","pics":"bicycle(1).jpg;"}]

* urlPics : URL where pics are located

* maxPics : How many pics should it download for each object

* classes : An array which determines what objects you want to download pics for :

	* active : boolean : allows to disable some objects (useful when testing)

	* name : String : name of the object (ex : bicycle)

	* categories : Array : categories where it will search for this item in the API (ex: sport)

	* keywords : Array : keywords related to this item in the API (ex: "bicycle", "mountain bike", "bike")

## How to use :
#### Start the three containers :

"docker-compose -f rebuild-pics.yml up"

"docker-compose -f classify-pics.yml up"

"docker-compose -f report.yml up"

## Other informations :

Special thanks to kaparthy, who created the library [ConvNetJS](http://cs.stanford.edu/people/karpathy/convnetjs/), that we use.


text:
module ConceptQL
  module SqlFormatters
    class Formatter
      def available?
        installed?(program)
      end

      def format(sql)
        sql = ConceptQL::Utils.timed_capture(command, stdin_data: sql, timeout: 10)
        return sql
      rescue
        return sql
      end

      def installed?(name)
        `which #{name} > /dev/null 2>&1`
        $?.success?
      end

      def arguments
        []
      end

      def command
        command = [program]
        command += arguments
        command.compact.join(" ")
      end
    end
  end
end


text:
package org.pentaho.libformula.editor.function;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.xml.XMLHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

public class FunctionLib {

  private List<FunctionDescription> functions;

  public FunctionLib( String filename ) throws KettleXMLException {
    functions = new ArrayList<FunctionDescription>();

    Document document = XMLHandler.loadXMLFile( getClass().getResourceAsStream( filename ) );
    Node functionsNode = XMLHandler.getSubNode( document, "libformula-functions" );
    int nrFunctions = XMLHandler.countNodes( functionsNode, FunctionDescription.XML_TAG );
    for ( int i = 0; i < nrFunctions; i++ ) {
      Node functionNode = XMLHandler.getSubNodeByNr( functionsNode, FunctionDescription.XML_TAG, i );
      this.functions.add( new FunctionDescription( functionNode ) );
    }
  }

  /**
   * @return the functions
   */
  public List<FunctionDescription> getFunctions() {
    return functions;
  }

  /**
   * @param functions
   *          the functions to set
   */
  public void setFunctions( List<FunctionDescription> functions ) {
    this.functions = functions;
  }

  /**
   * @return A sorted array of function names, extracted from the function descriptions...
   */
  public String[] getFunctionNames() {
    String[] names = new String[functions.size()];
    for ( int i = 0; i < functions.size(); i++ ) {
      names[i] = functions.get( i ).getName();
    }
    Arrays.sort( names );
    return names;
  }

  /**
   * @return A sorted array of unique categories, extracted from the function descriptions...
   */
  public String[] getFunctionCategories() {
    List<String> categories = new ArrayList<String>();
    for ( FunctionDescription function : functions ) {
      String category = function.getCategory();
      if ( !categories.contains( category ) ) {
        categories.add( category );
      }
    }
    Collections.sort( categories );
    return categories.toArray( new String[categories.size()] );
  }

  /**
   * Get all the function names for a certain category
   *
   * @param category
   *          the category name to look for
   * @return the sorted array of function names for the specified category
   */
  public String[] getFunctionsForACategory( String category ) {
    List<String> names = new ArrayList<String>();
    for ( FunctionDescription function : functions ) {
      if ( function.getCategory().equalsIgnoreCase( category ) ) {
        names.add( function.getName() );
      }
    }
    Collections.sort( names );
    return names.toArray( new String[names.size()] );
  }

  /**
   * @param functionName
   *          the name of the function to look for
   * @return the corresponding function description or null if nothing was found.
   */
  public FunctionDescription getFunctionDescription( String functionName ) {
    for ( FunctionDescription function : functions ) {
      if ( function.getName().equalsIgnoreCase( functionName ) ) {
        return function;
      }
    }
    return null;
  }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0010_auto_20170127_1521'),
    ]

    operations = [
        migrations.AddField(
            model_name='project',
            name='interventions',
            field=models.ManyToManyField(to='projects.Intervention'),
        ),
    ]


text:
"""flow_director.py provides a private class to help create FlowDirectors.

Provides the _FlowDirector component which does grid type testing, adds
the surface over which flow will be routed to the component, and sets up
part of the boundary condition testing.
"""

from landlab import RasterModelGrid  # for type tests
from landlab import Component
from landlab.utils.return_array import return_array_at_node

class _FlowDirector(Component):

    """Private class for creating components to calculate flow directions.

    This class is not meant to be used directly in modeling efforts.
    Instead it has the functionality that all flow direction calculators need
    to initialize and check boundary conditions.

    It also creates the following field used by all FlowDirectors.

    -  Link array identifing if flow goes with (1) or against (-1) the link
       direction: *'flow__link_direction'*

    The primary method of this class, :func:`run_one_step` is not implemented.

    Parameters
    ----------
    grid : ModelGrid
        A grid.
    surface : field name at node or array of length node
        The surface to direct flow across.

    Examples
    --------
    >>> from landlab import RasterModelGrid
    >>> from landlab.components.flow_director.flow_director import(
    ... _FlowDirector)
    >>> mg = RasterModelGrid((3,3), xy_spacing=(1, 1))
    >>> mg.set_closed_boundaries_at_grid_edges(True, True, True, False)
    >>> _ = mg.add_field(
    ...     "topographic__elevation",
    ...     mg.node_x + mg.node_y,
    ...     at="node",
    ... )
    >>> fd = _FlowDirector(mg, 'topographic__elevation')
    >>> fd.surface_values
    array([ 0.,  1.,  2.,  1.,  2.,  3.,  2.,  3.,  4.])
    >>> 'topographic__elevation' in mg.at_node.keys()
    True
    >>> 'flow__sink_flag'in mg.at_node.keys()
    True

    _FlowDirector also works if you pass it an array instead of a field name.

    >>> import numpy as np
    >>> mg = RasterModelGrid((3,3), xy_spacing=(1, 1))
    >>> z = np.array([ 0.,  1.,  2.,  1.,  2.,  3.,  2.,  3.,  4.])
    >>> fd = _FlowDirector(mg, z)
    >>> fd.surface_values
    array([ 0.,  1.,  2.,  1.,  2.,  3.,  2.,  3.,  4.])
    """

    _name = "_FlowDirector"

    _unit_agnostic = True

    _info = {
        "flow__sink_flag": {
            "dtype": bool,
            "intent": "out",
            "optional": False,
            "units": "-",
            "mapping": "node",
            "doc": "Boolean array, True at local lows",
        }
    }

    def __init__(self, grid, surface):
        """Initialize the _FlowDirector class."""
        # We keep a local reference to the grid
        super().__init__(grid)

        self._bc_set_code = self._grid.bc_set_code

        # set up the grid type testing
        self._is_raster = isinstance(self._grid, RasterModelGrid)
        if not self._is_raster:
            self._method = None

        # save elevations as class properites.
        self._surface = surface
        self._surface_values = return_array_at_node(grid, surface)

        grid.add_zeros("flow__sink_flag", at="node", dtype=bool, clobber=True)

    @property
    def surface_values(self):
        """Values of the surface over which flow is directed."""
        return self._surface_values

    def _changed_surface(self):
        """Check if the surface values have changed.

        If the surface values are stored as a field, it is important to
        check if they have changed since the component was instantiated.
        """
        if isinstance(self._surface, str):
            self._surface_values = return_array_at_node(self._grid, self._surface)

    def _check_updated_bc(self):
        # step 0. Check and update BCs
        if self._bc_set_code != self._grid.bc_set_code:
            self.updated_boundary_conditions()
            self._bc_set_code = self._grid.bc_set_code

    def run_one_step(self):
        """run_one_step is not implemented for this component."""
        raise NotImplementedError("run_one_step()")

    @property
    def sink_flag(self):
        """Return the array with sink flags."""
        return self._grid["node"]["flow__sink_flag"]

    @property
    def node_steepest_slope(self):
        """Return the steepest link slope at a node."""
        return self._grid["node"]["topographic__steepest_slope"]

    @property
    def link_to_flow_receiving_node(self):
        """Return the link id along the link transporting flow."""
        return self._grid["node"]["flow__link_to_receiver_node"]

    @property
    def node_receiving_flow(self):
        """Return the node ids of the nodes receiving flow."""
        return self._grid["node"]["flow__receiver_node"]

if __name__ == "__main__":  # pragma: no cover
    import doctest

    doctest.testmod()


text:
<?xml version="1.0" encoding="UTF-8"?>
<xmcda:XMCDA
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xmcda="http://www.decision-deck.org/2017/XMCDA-2.2.2"
        xsi:schemaLocation="http://www.decision-deck.org/2017/XMCDA-2.2.2 http://www.decision-deck.org/xmcda/_downloads/XMCDA-2.2.2.xsd">
    <methodParameters>
        <parameter id="assignToABetterClass">
            <value>
                <boolean>false</boolean>
            </value>
        </parameter>
        <parameter id="useMarginalValue">
            <value>
                <boolean>true</boolean>
            </value>
        </parameter>
    </methodParameters>
</xmcda:XMCDA>


text:
layout: post
title: "Vision API Fail"
posturl: http://www.commitstrip.com/en/2017/11/03/vision-api-fail/
tags:
- Fun
- Comics
- Computer vision
---

{% include post_info_header.md %}

Cute muffins, eh?

<!--more-->
{% include post_info_footer.md %}


text:
<form id="myForm" name="myForm" >

        Description
        <input id="description" name="description" class="form-group col-xs-6" ng-model="project.description" required/>

        Importance
        <select id="importance" class="form-group" name="importance" ng-model="project.importance" ng-options="i.value as i.level for i in importances" required></select>

        Cancel
        <button ng-click="save()" ng-disabled="myForm.$invalid" class="btn btn-primary">Save</button>
        <button ng-click="destroy()" ng-show="project.$id" class="btn btn-danger">Delete</button>

</form>