text:
namespace DLaB.Xrm.Entities
{

	/// <summary>
	/// MIME attachment for an activity.
	/// </summary>
	[System.Runtime.Serialization.DataContractAttribute()]
	[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("activitymimeattachment")]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public partial class ActivityMimeAttachment : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
	{

		public static class Fields
		{
			public const string ActivityId = "activityid";
			public const string ActivityMimeAttachmentId = "activitymimeattachmentid";
			public const string Id = "activitymimeattachmentid";
			public const string ActivityMimeAttachmentIdUnique = "activitymimeattachmentidunique";
			public const string ActivitySubject = "activitysubject";
			public const string AnonymousLink = "anonymouslink";
			public const string AttachmentContentId = "attachmentcontentid";
			public const string AttachmentId = "attachmentid";
			public const string AttachmentNumber = "attachmentnumber";
			public const string Body = "body";
			public const string ComponentState = "componentstate";
			public const string FileName = "filename";
			public const string FileSize = "filesize";
			public const string IsFollowed = "isfollowed";
			public const string IsManaged = "ismanaged";
			public const string MimeType = "mimetype";
			public const string ObjectId = "objectid";
			public const string ObjectTypeCode = "objecttypecode";
			public const string OverwriteTime = "overwritetime";
			public const string OwnerId = "ownerid";
			public const string OwningBusinessUnit = "owningbusinessunit";
			public const string OwningUser = "owninguser";
			public const string SolutionId = "solutionid";
			public const string Subject = "subject";
			public const string VersionNumber = "versionnumber";
			public const string activity_pointer_activity_mime_attachment = "activity_pointer_activity_mime_attachment";
			public const string appointment_activity_mime_attachment = "appointment_activity_mime_attachment";
			public const string email_activity_mime_attachment = "email_activity_mime_attachment";
			public const string template_activity_mime_attachments = "template_activity_mime_attachments";
		}

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

		public const string EntityLogicalName = "activitymimeattachment";

		public const string PrimaryIdAttribute = "activitymimeattachmentid";

		public const string PrimaryNameAttribute = "filename";

		public const int EntityTypeCode = 1001;

		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>
		/// Unique identifier of the activity with which the attachment is associated.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("activityid")]
		[System.ObsoleteAttribute()]
		public Microsoft.Xrm.Sdk.EntityReference ActivityId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("activityid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ActivityId");
				this.SetAttributeValue("activityid", value);
				this.OnPropertyChanged("ActivityId");
			}
		}

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

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

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("activitymimeattachmentidunique")]
		public System.Nullable<System.Guid> ActivityMimeAttachmentIdUnique
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("activitymimeattachmentidunique");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ActivityMimeAttachmentIdUnique");
				this.SetAttributeValue("activitymimeattachmentidunique", value);
				this.OnPropertyChanged("ActivityMimeAttachmentIdUnique");
			}
		}

		/// <summary>
		/// Descriptive subject for the activity.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("activitysubject")]
		public string ActivitySubject
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("activitysubject");
			}
		}

		/// <summary>
		/// anonymous link
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("anonymouslink")]
		public string AnonymousLink
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("anonymouslink");
			}
		}

		/// <summary>
		/// For internal use only
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("attachmentcontentid")]
		public string AttachmentContentId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("attachmentcontentid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("AttachmentContentId");
				this.SetAttributeValue("attachmentcontentid", value);
				this.OnPropertyChanged("AttachmentContentId");
			}
		}

		/// <summary>
		/// Unique identifier of the attachment with which this activitymimeattachment is associated.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("attachmentid")]
		public Microsoft.Xrm.Sdk.EntityReference AttachmentId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("attachmentid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("AttachmentId");
				this.SetAttributeValue("attachmentid", value);
				this.OnPropertyChanged("AttachmentId");
			}
		}

		/// <summary>
		/// Number of the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("attachmentnumber")]
		public System.Nullable<int> AttachmentNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("attachmentnumber");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("AttachmentNumber");
				this.SetAttributeValue("attachmentnumber", value);
				this.OnPropertyChanged("AttachmentNumber");
			}
		}

		/// <summary>
		/// Contents of the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("body")]
		public string Body
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("body");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("Body");
				this.SetAttributeValue("body", value);
				this.OnPropertyChanged("Body");
			}
		}

		/// <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>
		/// File name of the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("filename")]
		public string FileName
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("filename");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("FileName");
				this.SetAttributeValue("filename", value);
				this.OnPropertyChanged("FileName");
			}
		}

		/// <summary>
		/// File size of the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("filesize")]
		public System.Nullable<int> FileSize
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("filesize");
			}
		}

		/// <summary>
		/// Indicates if this attachment is followed.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("isfollowed")]
		public System.Nullable<bool> IsFollowed
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<bool>>("isfollowed");
			}
		}

		/// <summary>
		/// Indicates whether the solution component is part of a managed solution.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("ismanaged")]
		public System.Nullable<bool> IsManaged
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<bool>>("ismanaged");
			}
		}

		/// <summary>
		/// MIME type of the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("mimetype")]
		public string MimeType
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("mimetype");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("MimeType");
				this.SetAttributeValue("mimetype", value);
				this.OnPropertyChanged("MimeType");
			}
		}

		/// <summary>
		/// Unique identifier of the record with which the attachment is associated
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("objectid")]
		public Microsoft.Xrm.Sdk.EntityReference ObjectId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("objectid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ObjectId");
				this.SetAttributeValue("objectid", value);
				this.OnPropertyChanged("ObjectId");
			}
		}

		/// <summary>
		/// Object Type Code of the entity that is associated with the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("objecttypecode")]
		public string ObjectTypeCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("objecttypecode");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ObjectTypeCode");
				this.SetAttributeValue("objecttypecode", value);
				this.OnPropertyChanged("ObjectTypeCode");
			}
		}

		/// <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 user or team who owns the activity_mime_attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("ownerid")]
		public Microsoft.Xrm.Sdk.EntityReference OwnerId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("ownerid");
			}
		}

		/// <summary>
		/// Unique identifier of the business unit that owns the activity mime attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owningbusinessunit")]
		public Microsoft.Xrm.Sdk.EntityReference OwningBusinessUnit
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("owningbusinessunit");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwningBusinessUnit");
				this.SetAttributeValue("owningbusinessunit", value);
				this.OnPropertyChanged("OwningBusinessUnit");
			}
		}

		/// <summary>
		/// Unique identifier of the user who owns the activity mime attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owninguser")]
		public Microsoft.Xrm.Sdk.EntityReference OwningUser
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("owninguser");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwningUser");
				this.SetAttributeValue("owninguser", value);
				this.OnPropertyChanged("OwningUser");
			}
		}

		/// <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>
		/// Descriptive subject for the attachment.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("subject")]
		public string Subject
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("subject");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("Subject");
				this.SetAttributeValue("subject", value);
				this.OnPropertyChanged("Subject");
			}
		}

		/// <summary>
		/// Version number of the activity mime attachment.
		/// </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 ActivityMimeAttachment_AsyncOperations
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("ActivityMimeAttachment_AsyncOperations")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.AsyncOperation> ActivityMimeAttachment_AsyncOperations
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("ActivityMimeAttachment_AsyncOperations", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ActivityMimeAttachment_AsyncOperations");
				this.SetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("ActivityMimeAttachment_AsyncOperations", null, value);
				this.OnPropertyChanged("ActivityMimeAttachment_AsyncOperations");
			}
		}

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

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

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

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

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

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

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

		/// <summary>
		/// Constructor for populating via LINQ queries given a LINQ anonymous type
		/// <param name="anonymousType">LINQ anonymous type.</param>
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public ActivityMimeAttachment(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["activitymimeattachmentid"] = base.Id;
                        break;
                    case "activitymimeattachmentid":
                        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:
{
  "title": "Finally managed to migrate my #rstats blog to #blogdown. Here is why and how you can use #travis to deploy with #netlify without committing html or md derivatives from your R Markdown. Merge previews included. Thanks @xieyihui for #blogdown. https://t.co/rdeL4lBd8Y",
  "date": "2018-06-26"
}

# blogdown

> **Lorenz Walthert** (@lorenzwalthert; 30/6): Finally managed to migrate my #rstats blog to #blogdown. Here is why and how you can use #travis to deploy with #netlify without committing html or md derivatives from your R Markdown. Merge previews included. Thanks @xieyihui for #blogdown.
https://t.co/rdeL4lBd8Y  [↪](https://twitter.com/xieyihui/status/1011301555340038146)

<!-- -->

> **R-bloggers** (@Rbloggers; 10/2): Switching to blogdown, Netlify and Travis https://t.co/r0NY9Mj6UB #rstats #DataScience  [↪](https://twitter.com/xieyihui/status/1011348400195997696)

<!-- -->

> **Maëlle Salmon 🐟** (@ma_salmon; 5/0): @DrMowinckels I'm actually thinking I'd like a blogdown option on my blog to have the direct link to the source file to edit, so that people can more easily fix my own typos!  [↪](https://twitter.com/xieyihui/status/1011222706380034048)

<!-- -->

> **Gina Reynolds** (@EvaMaeRey; 2/0): @a517dogg @NathanielRaley @Nolan_Mc + ggplot() + blogdown! https://t.co/FEZ12x9p2K  [↪](https://twitter.com/xieyihui/status/1011264729959067649)

<!-- -->

> **Simon Grund** (@simongrund89; 1/0): For those interested: The site was build with Hugo and blogdown for R (credit
@xieyihui). The theme is based on Hyde, with way too much time sunk into modification (no regrets 🤘).  [↪](https://twitter.com/xieyihui/status/1011351122026598400)

<!-- -->

> **Dr. Alison Hill** (@apreshill; 1/0): @ma_salmon @DrMowinckels I just made a new post-specific params variable called "raw" and after pushing to github I copy/pasted the link I wanted back into the YAML. I tested that if I left "raw" out of the YAML it still worked 🤓 https://t.co/3zshAUhyl6  [↪](https://twitter.com/xieyihui/status/1011261875747577856)

<!-- -->

> **Dr. Alison Hill** (@apreshill; 1/0): @ma_salmon @DrMowinckels I edited one of the layouts for the blogdown demo site to add a "view raw" button- you could do that with a github editable link? https://t.co/kWsR4JyqQH https://t.co/c5rASBlDZI  [↪](https://twitter.com/xieyihui/status/1011259048040124416)

<!-- -->

> **Maëlle Salmon 🐟** (@ma_salmon; 1/0): @DrMowinckels cc @apreshill is there already an easy way to add an "edit me here" button to blogdown post?  [↪](https://twitter.com/xieyihui/status/1011247726070255619)

<!-- -->

> **Lorenz Walthert** (@lorenzwalthert; 0/0): @Rbloggers Page not rendered correctly because of a problem with feed burner. Sorry. You can read the complete post here: https://t.co/lDMWQQ3cDW  [↪](https://twitter.com/xieyihui/status/1011369243089260545)

<!-- -->

> **Lluís Revilla** (@Lluis_Rev; 0/0): I was expecting that a nice card would appear, but the topic is machine learning methods in bioinformatics.
>
Which reminds me that I might need to change to blogdown to have those nice cards when sharing a blog post.  [↪](https://twitter.com/xieyihui/status/1011270349454041091)

<!-- -->

# bookdown

> **tipsder** (@tipsder; 9/3): Taller de introducción a #R.
https://t.co/kwf2TNqmkq
#rstats #DataSciece #DataViz  [↪](https://twitter.com/xieyihui/status/1011093156597772290)

<!-- -->

> **Romain Lesur** (@RLesur; 1/2): Want to leave #GitHub after #Microsoft's acquisition?
Here is a short guide to easily publish an #rstats bookdown website with #GitLab Pages https://t.co/2ERHOVJeKC  [↪](https://twitter.com/xieyihui/status/1011336810029551616)

<!-- -->

# knitr

> **Sylvain Chabé-Ferret** (@SylvainCF; 9/0): In case it might be of interest, I uploaded to my research webpage a pdf explaining my ideal workflow for collaborative reproducible research and how to set it up : knitr (R+Latex) + Git + MySQL (might become a blog post at some point) :)
>
https://t.co/7ab4PnJIg7  [↪](https://twitter.com/xieyihui/status/1011144868683505665)

<!-- -->

> **Richard Armstrong** (@drrichstrong; 4/0): I've been using #rstats for data analysis for a while now but today is the first time I've used R Markdown #knitr to embed results straight into Word document.
>
🤯🤯🤯
No more Copy and Pasting!
>
https://t.co/KX0IBCFtsS https://t.co/SNr9BH4yr1  [↪](https://twitter.com/xieyihui/status/1011298257920815106)

<!-- -->

> **Sylvain Chabé-Ferret** (@SylvainCF; 1/0): @andreamatranga @abhishekn @CodeOceanHQ oh, and thanks @xieyihui for knitr and for the cache option.
>
So awesome :)  [↪](https://twitter.com/xieyihui/status/1011159271483105280)

<!-- -->

> **Sylvain Chabé-Ferret** (@SylvainCF; 0/0): @andreamatranga @abhishekn In order to save on computational time, I use the awesome knitr 'cache' option, that stores a local version of the results from big computations on my computer.  [↪](https://twitter.com/xieyihui/status/1011158444190117889)

<!-- -->

redpajama_set_name: RedPajamaGithub


text:
/* Portuguese
 * Mirko Jankov
 */

var localizedStrings = new Array;

localizedStrings[": "]
	= ": ";
localizedStrings["Unable to load plugin"]
	= "Não consigo carregar o plugin";
localizedStrings["Calendars:"]
	= "Calendários:";
localizedStrings["Show events happening within the next:"]
	= "Mostrar os eventos nos próximos:";
localizedStrings["Check for new version"]
	= "Checar a versão actualizada";
localizedStrings["No calendars selected."]
	= "Nenhum calendário seleccionado.";
localizedStrings["No events today or in the next %i day(s)."]
	= "Nenhum evento hoje nem nos próximos %i dia(s)";
localizedStrings["Done"]
	= "Pronto";
localizedStrings["1 day"]
	= "1 dia";
localizedStrings["%i days"]
	= "%i dias";
localizedStrings["Today"]
	= "hoje";
localizedStrings["Tomorrow"]
	= "amanhã";
localizedStrings["Location: "]
	= "Localidade: ";
localizedStrings["Birthdays"]
	= "Aniversários";
localizedStrings["%@'s Birthday"]
	= "Aniversário de %@";
localizedStrings["Open iCal"]
	= "Abrir iCal";


text:
require 'yaml'
require 'active_record'

connection = if ENV.fetch('KARAFKA_ENV', '').downcase.include?('production')
  { production: { adapter: 'postgres',
                  url: ENV['DATABASE_URL'] } }
else
  YAML.load(File.open('./config/database.yml'))
end

ActiveRecord::Base.establish_connection(
  connection[ENV['KARAFKA_ENV']]
)

require 'kagu'


text:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Content_category extends CI_Controller
{

    function __construct()
    {
        parent::__construct();
        $this->load->model('Content_category_model');
        $this->load->library('form_validation');
    }

    public function index()
    {
        $content_category = $this->Content_category_model->get_all();

        $data = array(
            'content_category_data' => $content_category,
			'judul' => 'CONTENT_CATEGORY',
			'subjudul' =>'',
        );

        $this->template->load('template','content_category_list', $data);
    }

    public function read($id)
    {
        $row = $this->Content_category_model->get_by_id($id);
        if ($row) {
            $data = array(
		'ID_CATEGORY' => $row->ID_CATEGORY,
		'ID_MENU' => $row->ID_MENU,
		'CATEGORY' => $row->CATEGORY,
		'INFORMATION_CATEGORY' => $row->INFORMATION_CATEGORY,
		'ICON_CATEGORY' => $row->ICON_CATEGORY,
		'judul' => 'CONTENT_CATEGORY',
		'subjudul' =>'Read',
	    );
            $this->template->load('template','content_category_read', $data);
        } else {
            $this->session->set_flashdata('message', 'Record Not Found');
            redirect(site_url('content_category'));
        }
    }

    public function create()
    {
        $data = array(
            'button' => 'Create',
            'action' => site_url('content_category/create_action'),
	    'ID_CATEGORY' => set_value('ID_CATEGORY'),
	    'ID_MENU' => set_value('ID_MENU'),
	    'CATEGORY' => set_value('CATEGORY'),
	    'INFORMATION_CATEGORY' => set_value('INFORMATION_CATEGORY'),
	    'ICON_CATEGORY' => set_value('ICON_CATEGORY'),
		'judul' => 'CONTENT_CATEGORY',
		'subjudul' =>'Create',
	);
        $this->template->load('template','content_category_form', $data);
    }

    public function create_action()
    {
        $this->_rules();

        if ($this->form_validation->run() == FALSE) {
            $this->create();
        } else {
            $data = array(
		'ID_MENU' => $this->input->post('ID_MENU',TRUE),
		'CATEGORY' => $this->input->post('CATEGORY',TRUE),
		'INFORMATION_CATEGORY' => $this->input->post('INFORMATION_CATEGORY',TRUE),
		'ICON_CATEGORY' => $this->input->post('ICON_CATEGORY',TRUE),
	    );

            $this->Content_category_model->insert($data);
            $this->session->set_flashdata('message', 'Create Record Success');
            redirect(site_url('content_category'));
        }
    }

    public function update($id)
    {
        $row = $this->Content_category_model->get_by_id($id);

        if ($row) {
            $data = array(
                'button' => 'Update',
                'action' => site_url('content_category/update_action'),
		'ID_CATEGORY' => set_value('ID_CATEGORY', $row->ID_CATEGORY),
		'ID_MENU' => set_value('ID_MENU', $row->ID_MENU),
		'CATEGORY' => set_value('CATEGORY', $row->CATEGORY),
		'INFORMATION_CATEGORY' => set_value('INFORMATION_CATEGORY', $row->INFORMATION_CATEGORY),
		'ICON_CATEGORY' => set_value('ICON_CATEGORY', $row->ICON_CATEGORY),
		'judul' => 'CONTENT_CATEGORY',
		'subjudul' =>'Update',
	    );
            $this->template->load('template','content_category_form', $data);
        } else {
            $this->session->set_flashdata('message', 'Record Not Found');
            redirect(site_url('content_category'));
        }
    }

    public function update_action()
    {
        $this->_rules();

        if ($this->form_validation->run() == FALSE) {
            $this->update($this->input->post('ID_CATEGORY', TRUE));
        } else {
            $data = array(
		'ID_MENU' => $this->input->post('ID_MENU',TRUE),
		'CATEGORY' => $this->input->post('CATEGORY',TRUE),
		'INFORMATION_CATEGORY' => $this->input->post('INFORMATION_CATEGORY',TRUE),
		'ICON_CATEGORY' => $this->input->post('ICON_CATEGORY',TRUE),
	    );

            $this->Content_category_model->update($this->input->post('ID_CATEGORY', TRUE), $data);
            $this->session->set_flashdata('message', 'Update Record Success');
            redirect(site_url('content_category'));
        }
    }

    public function delete($id)
    {
        $row = $this->Content_category_model->get_by_id($id);

        if ($row) {
            $this->Content_category_model->delete($id);
            $this->session->set_flashdata('message', 'Delete Record Success');
            redirect(site_url('content_category'));
        } else {
            $this->session->set_flashdata('message', 'Record Not Found');
            redirect(site_url('content_category'));
        }
    }

    public function _rules()
    {
	$this->form_validation->set_rules('ID_MENU', 'id menu', 'trim|required');
	$this->form_validation->set_rules('CATEGORY', 'category', 'trim|required');
	$this->form_validation->set_rules('INFORMATION_CATEGORY', 'information category', 'trim|required');
	$this->form_validation->set_rules('ICON_CATEGORY', 'icon category', 'trim|required');

	$this->form_validation->set_rules('ID_CATEGORY', 'ID_CATEGORY', 'trim');
	$this->form_validation->set_error_delimiters('', '');
    }

    public function excel()
    {
        $this->load->helper('exportexcel');
        $namaFile = "content_category.xls";
        $judul = "content_category";
        $tablehead = 0;
        $tablebody = 1;
        $nourut = 1;
        //penulisan header
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
        header("Content-Type: application/force-download");
        header("Content-Type: application/octet-stream");
        header("Content-Type: application/download");
        header("Content-Disposition: attachment;filename=" . $namaFile . "");
        header("Content-Transfer-Encoding: binary ");

        xlsBOF();

        $kolomhead = 0;
        xlsWriteLabel($tablehead, $kolomhead++, "No");
	xlsWriteLabel($tablehead, $kolomhead++, "ID MENU");
	xlsWriteLabel($tablehead, $kolomhead++, "CATEGORY");
	xlsWriteLabel($tablehead, $kolomhead++, "INFORMATION CATEGORY");
	xlsWriteLabel($tablehead, $kolomhead++, "ICON CATEGORY");

	foreach ($this->Content_category_model->get_all() as $data) {
            $kolombody = 0;

            //ubah xlsWriteLabel menjadi xlsWriteNumber untuk kolom numeric
            xlsWriteNumber($tablebody, $kolombody++, $nourut);
	    xlsWriteNumber($tablebody, $kolombody++, $data->ID_MENU);
	    xlsWriteLabel($tablebody, $kolombody++, $data->CATEGORY);
	    xlsWriteLabel($tablebody, $kolombody++, $data->INFORMATION_CATEGORY);
	    xlsWriteLabel($tablebody, $kolombody++, $data->ICON_CATEGORY);

	    $tablebody++;
            $nourut++;
        }

        xlsEOF();
        exit();
    }

    public function word()
    {
        header("Content-type: application/vnd.ms-word");
        header("Content-Disposition: attachment;Filename=content_category.doc");

        $data = array(
            'content_category_data' => $this->Content_category_model->get_all(),
            'start' => 0
        );

        $this->load->view('content_category_doc',$data);
    }

    function pdf()
    {
        $data = array(
            'content_category_data' => $this->Content_category_model->get_all(),
            'start' => 0
        );

        ini_set('memory_limit', '32M');
        $html = $this->load->view('content_category_pdf', $data, true);
        $this->load->library('pdf');
        $pdf = $this->pdf->load();
        $pdf->WriteHTML($html);
        $pdf->Output('content_category.pdf', 'D');
    }

}

/* End of file Content_category.php */
/* Location: ./application/controllers/Content_category.php */
/* Please DO NOT modify this information : */
/* Generated by Harviacode Codeigniter CRUD Generator 2017-05-27 08:18:34 */
/* http://harviacode.com */


text:
require('../common/bootstrap');
const CronJob = require('cron').CronJob;
const updater = require('./updater');
const twitter = require('./twitter');

console.info('Starting periodic tasks...');

// Run every hour at 10sec after the hour
new CronJob('10 0 * * * *', async () => {
    await updater.updateAll();
    await twitter.maybePostTweets();
}, null, true);


text:
package reactivemongo.api.commands

import scala.util.Success

import reactivemongo.api.{
  ReadConcern,
  Session,
  SerializationPack,
  WriteConcern
}

import reactivemongo.core.errors.{ CommandException => CmdErr }

private[reactivemongo] object CommandCodecs {

  private def foldResult[P <: SerializationPack, A](
      decoder: SerializationPack.Decoder[P]
    )(ko: decoder.pack.Document => A,
      ok: decoder.pack.Document => A
    ): decoder.pack.Document => A = { doc =>
    decoder.booleanLike(doc, "ok") match {
      case Some(true) => {
        decoder.string(doc, "note").foreach { note =>
          Command.logger.info(s"${note}: ${decoder.pack pretty doc}")
        }

        ok(doc)
      }

      case _ => ko(doc)
    }
  }

  /**
   * Helper to read a command result, with error handling.
   */
  def dealingWithGenericCommandExceptionsReader[P <: SerializationPack, A](
      pack: P
    )(readResult: pack.Document => A
    ): pack.Reader[A] = {
    val decoder = pack.newDecoder
    val foldRes = foldResult[pack.type, A](decoder) _

    pack.reader[A] {
      foldRes(
        { doc =>
          throw CmdErr(pack)(
            _message = decoder.string(doc, "errmsg").getOrElse(""),
            _originalDocument = Some(doc),
            _code = decoder.int(doc, "code")
          )
        },
        readResult
      )
    }
  }

  def commandBooleanReader[P <: SerializationPack](
      pack: P
    ): pack.Reader[Boolean] =
    dealingWithGenericCommandExceptionsReader[pack.type, Boolean](pack) { _ =>
      true
    }

  /**
   * Helper to read a command result, with error handling.
   */
  def dealingWithGenericCommandExceptionsReaderOpt[P <: SerializationPack, A](
      pack: P
    )(readResult: pack.Document => Option[A]
    ): pack.Reader[A] = {
    val decoder = pack.newDecoder
    val foldRes = foldResult[pack.type, Option[A]](decoder) _

    pack.readerOpt[A] {
      foldRes(
        { doc =>
          throw CmdErr(pack)(
            _message = decoder.string(doc, "errmsg").getOrElse(""),
            _originalDocument = Some(doc),
            _code = decoder.int(doc, "code")
          )
        },
        readResult
      )
    }
  }

  @inline def defaultWriteResultReader[P <: SerializationPack](
      pack: P
    ): pack.Reader[DefaultWriteResult] =
    writeResultReader[DefaultWriteResult, pack.type](pack)

  def writeResultReader[WR >: DefaultWriteResult, P <: SerializationPack](
      pack: P
    ): pack.Reader[WR] = {
    val decoder = pack.newDecoder
    val readWriteError = CommandCodecs.readWriteError(decoder)
    val readWriteConcernError = CommandCodecs.readWriteConcernError(decoder)

    dealingWithGenericCommandExceptionsReader[pack.type, WR](pack) { doc =>
      val werrors = decoder.children(doc, "writeErrors").flatMap { e =>
        readWriteError(e).toSeq
      }

      val wcError =
        decoder.child(doc, "writeConcernError").flatMap(readWriteConcernError)

      new DefaultWriteResult(
        ok = decoder.booleanLike(doc, "ok").getOrElse(true),
        n = decoder.int(doc, "n").getOrElse(0),
        writeErrors = werrors,
        writeConcernError = wcError,
        code = decoder.int(doc, "code"),
        errmsg = decoder.string(doc, "errmsg")
      )

    }
  }

  def unitReader[P <: SerializationPack](pack: P): pack.Reader[Unit] =
    dealingWithGenericCommandExceptionsReader[pack.type, Unit](pack) { _ => () }

  def writeReadConcern[P <: SerializationPack](
      builder: SerializationPack.Builder[P]
    ): ReadConcern => Seq[builder.pack.ElementProducer] = { (c: ReadConcern) =>
    Seq(builder.elementProducer("level", builder.string(c.level)))
  }

  def writeSessionReadConcern[P <: SerializationPack](
      builder: SerializationPack.Builder[P]
    ): Option[Session] => ReadConcern => Seq[builder.pack.ElementProducer] = {
    import builder.{ document, elementProducer => element, pack }

    val simpleReadConcern = writeReadConcern(builder)
    def simpleRead(c: ReadConcern): pack.ElementProducer =
      element("readConcern", document(simpleReadConcern(c)))

    val writeSession = CommandCodecs.writeSession(builder)

    { session =>
      session match {
        case Some(s) => {
          val elements = Seq.newBuilder[pack.ElementProducer]

          elements ++= writeSession(s)

          if (!s.transaction.filter(_.flagSent).isSuccess) {
            // No transaction, or flag not yet send (first tx command)
            s.operationTime match {
              case Some(opTime) => { (c: ReadConcern) =>
                elements += element(
                  "readConcern",
                  document(
                    simpleReadConcern(c) :+ element(
                      "afterClusterTime",
                      builder.timestamp(opTime)
                    )
                  )
                )

                elements.result()
              }

              case _ => { (rc: ReadConcern) =>
                elements += simpleRead(rc)

                elements.result()
              }
            }
          } else { (_: ReadConcern) =>
            // Ignore: Only the first command in a transaction
            // may specify a readConcern (code=72)

            elements.result()
          }
        }

        case _ => { (c: ReadConcern) => Seq(simpleRead(c)) }
      }
    }
  }

  @inline def writeWriteConcern[P <: SerializationPack](
      pack: P
    ): WriteConcern => pack.Document =
    writeWriteConcern[pack.type](pack.newBuilder)

  def writeWriteConcernWWriter[P <: SerializationPack](
      builder: SerializationPack.Builder[P]
    ): WriteConcern.W => builder.pack.Value = {
    case WriteConcern.TagSet(tagSet)            => builder.string(tagSet)
    case WriteConcern.WaitForAcknowledgments(n) => builder.int(n)
    case _                                      => builder.string("majority")
  }

  def writeWriteConcern[P <: SerializationPack](
      builder: SerializationPack.Builder[P]
    ): WriteConcern => builder.pack.Document = {
    val writeGLEW = writeWriteConcernWWriter(builder)

    { (writeConcern: WriteConcern) =>
      import builder.{ elementProducer => element, int }

      val elements = Seq.newBuilder[builder.pack.ElementProducer]

      elements += element("w", writeGLEW(writeConcern.w))
      elements += element("j", builder.boolean(writeConcern.j))

      writeConcern.wtimeout.foreach { t =>
        elements += element("wtimeout", int(t))
      }

      builder.document(elements.result())
    }
  }

  def writeSession[P <: SerializationPack](
      builder: SerializationPack.Builder[P]
    ): Session => Seq[builder.pack.ElementProducer] = {
    import builder.{ elementProducer => element }

    { (session: Session) =>
      val idElmt =
        builder.document(Seq(element("id", builder.uuid(session.lsid))))

      session.transaction match {
        case Success(transaction) => {
          val elms = Seq.newBuilder[builder.pack.ElementProducer]

          elms ++= Seq(
            element("lsid", idElmt),
            element("txnNumber", builder.long(transaction.txnNumber))
          )

          if (!session.transactionToFlag()) {
            elms += element("startTransaction", builder.boolean(true))
          }

          elms += element("autocommit", builder.boolean(false))

          elms.result()
        }

        case _ => Seq(element("lsid", idElmt))
      }
    }
  }

  def readWriteError[P <: SerializationPack](
      decoder: SerializationPack.Decoder[P]
    ): decoder.pack.Document => Option[WriteError] = { doc =>
    (for {
      index <- decoder.int(doc, "index")
      code <- decoder.int(doc, "code")
      err <- decoder.string(doc, "errmsg")
    } yield WriteError(index, code, err))
  }

  def readWriteConcernError[P <: SerializationPack](
      decoder: SerializationPack.Decoder[P]
    ): decoder.pack.Document => Option[WriteConcernError] = { doc =>
    (for {
      code <- decoder.int(doc, "code")
      err <- decoder.string(doc, "errmsg")
    } yield new WriteConcernError(code, err))
  }
}


text:
class Admin::Fulfillment::OrdersController < Admin::Fulfillment::BaseController
  helper_method :sort_column, :sort_direction
  # GET /admin/fulfillment/orders
  def index
    @orders = Order.fulfillment_grid(params).order(sort_column + " " + sort_direction).
                                            paginate(:per_page => 25, :page => params[:page].to_i)

    respond_to do |format|
      format.html # index.html.erb
    end
  end

  # GET /admin/fulfillment/orders/1
  def show
    @order = Order.includes([:shipments, {:order_items => [:shipment, :variant]}]).find(params[:id])
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @order }
    end
  end

  # GET /admin/fulfillment/orders/1/edit
  def edit
    @order = Order.includes([:shipments, {:order_items => [:shipment, :variant]}]).find(params[:id])
  end

  # PUT /admin/fulfillment/orders/1
  def update
    @order    = Order.find(params[:id])
    @invoice  = @order.invoices.find(params[:invoice_id])

    payment = @order.capture_invoice(@invoice)

##  several things happen on this request
# => Payment is captured
# => Invoice is updated to log leger transactions
# => Shipment is marked as ready to send and associated to the order_items
# => If everything works send the user to the shipment page

## TODO
# => Allow partial payments
# => mark only order_items that will be shipped

    respond_to do |format|
      if payment && payment.success?
        @shipments = Shipment.create_shipments_with_items(@order)
        # reload order
        format.html { render :partial => 'success_message' }
        #format.html { redirect_to(admin_fulfillment_order_path(@order), :notice => 'Shipment was successfully updated.') }
      else
        format.html { render :partial => 'failure_message' }
      end
    end
  end

  # DELETE /admin/fulfillment/shipments/1
  # DELETE /admin/fulfillment/shipments/1.xml
  def destroy

    @order    = Order.find(params[:id])
    @invoice  = @order.invoices.find(params[:invoice_id])

    @order.cancel_unshipped_order(@invoice)
    respond_to do |format|
      format.html { render :partial => 'invoice_details', :locals => {:invoice => @invoice} }
      format.json { render :json => @order.to_json }
    end
  end

  private

  def sort_column
    Order.column_names.include?(params[:sort]) ? params[:sort] : "number"
  end

  def sort_direction
    %w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
  end
end


text:
Enter Your Creds

  <form>
    <md-input placeholder="Production Account Name (not URL)" [(ngModel)]="context.production"></md-input>
    <md-input placeholder="Sandbox Account Name (not URL)" [(ngModel)]="context.sandbox"></md-input>

    <md-input placeholder="Administrator Email" type="email" [(ngModel)]="context.email"></md-input>
    <md-input placeholder="Administrator Password" type="password" [(ngModel)]="context.password"></md-input>

    Copy Fields and Forms (no going back!)
  </form>


text:
require "pathname"
require "logger"
require "openssl"

module Drone
  class Supermarket
    #
    # Chef plugin configuration
    #
    class Config
      attr_accessor :payload, :logger

      #
      # Initialize an instance
      #
      def initialize(payload, log = nil)
        self.payload = payload
        self.logger = log || default_logger
      end

      #
      # Validate that all requirements are met
      #
      def validate!
        raise "Missing 'user'" if missing?(:user)
        raise "Missing SUPERMARKET_PRIVATE_KEY" if missing?(:private_key)

        ::OpenSSL::PKey::RSA.new payload[:private_key]
      rescue OpenSSL::PKey::RSAError
        raise "Failed to load SUPERMARKET_PRIVATE_KEY provided starting with:" \
              "\n#{payload[:private_key][0, 35]}"
      end

      #
      # Write config files to filesystem
      #
      def configure!
        write_keyfile
      end

      #
      # Knife flag for enabling/disabling SSL verify
      #
      # @return [String]
      #
      def ssl_mode
        payload[:ssl_verify] ? ":verify_peer" : ":verify_none"
      end

      #
      # Knife config file location
      #
      def knife_config_path
        @knife_config_path ||= Pathname.new(
          Dir.home
        ).join(
          ".chef",
          "knife.rb"
        )

        @knife_config_path.dirname.tap do |dir|
          dir.mkpath unless dir.directory?
        end

        @knife_config_path
      end

      #
      # The path to write our knife keyfile to
      #
      def keyfile_path
        @keyfile_path ||= Pathname.new(
          "/tmp/key.pem"
        )
      end

      #
      # The path to our git workspace
      #
      def workspace_path
        @workspace_path ||= Pathname.new Dir.pwd
      end

      protected

      def default_logger
        @logger ||= Logger.new(STDOUT).tap do |l|
          l.level = payload[:debug] ? Logger::DEBUG : Logger::INFO
          l.formatter = proc do |sev, datetime, _progname, msg|
            "#{sev}, [#{datetime}] : #{msg}\n"
          end
        end
      end

      #
      # Write a knife keyfile
      #
      def write_keyfile
        keyfile_path.open "w" do |f|
          f.write payload[:private_key]
        end
      end

      #
      # Help check if keys exist in payload
      #
      def missing?(key)
        payload[key].nil? || payload[key].empty?
      end

      # #
      # # The path to write our netrc config to
      # #
      # def netrc_path
      #   @netrc_path ||= Pathname.new(
      #     Dir.home
      #   ).join(
      #     ".netrc"
      #   )
      # end

      # #
      # # Write a .netrc file
      # #
      # def write_netrc
      #   return if netrc.nil?
      #   netrc_path.open "w" do |f|
      #     f.puts "machine #{netrc.machine}"
      #     f.puts "  login #{netrc.login}"
      #     f.puts "  password #{netrc.password}"
      #   end
      # end
    end
  end
end


text:
layout: default
title: as time goes on...
permalink: /news/
---

  {% for post in site.posts %}

        {{ post.title }}

    {{ post.date | date_to_string }}

    {{ post.content }}

  {% endfor %}


text:
function vector = cellArrayToVector(cellArray)
vector=[];
for i=1:length(cellArray)
    vector=[vector cellArray{i}];
end


text:
import re

class PyAwk:

    def __init__(self, **kwargs):
        self.FS = ' '
        self.RS = '\n'

    def begin(self, f):
        self.begin = f

    def main(self, f):
        self.main = f

    def end(self, f):
        self.end = f

    def run(self, input):
        if self.begin:
            self.begin()

        record = ''
        fields = [None]
        field  = ''
        for i in input.read():
            if i != self.RS:
                record += i
            else:
                fields.append(field)
                fields[0] = record
                record = ''
                field = ''
                try:
                    self.main(*fields)
                except Exception:
                    pass
                fields = [None]
                continue
            if i != self.FS:
                field += i
            else:
                fields.append(field)
                field = ''

        if self.end:
            self.end()

class recordEq:

    def __init__(self, field, regEx):
        self._field = field
        self._regEx = regEx

    def __call__(self, function):
        def new_function(*args):
            try:
                if re.match(self._regEx, args[self._field]):
                    function(*args)
            except IndexError:
                pass
        return new_function

class recordNotEq:

    def __init__(self, field, regEx):
        self._field = field
        self._regEx = regEx

    def __call__(self, function):
        def new_function(*args):
            try:
                if not re.match(self._regEx, args[self._field]):
                    function(*args)
            except IndexError:
                pass
        return new_function


text:
import glob
import os
import re
import string

import vim

def catFile(filename):
    """ assigns a local variable retval to the contents of a file """
    try:
        fp = open(filename)
        lines = fp.read()
        fp.close()
    except FileNotFoundError:
        lines = ''

    # escape double quotes and backslashes before quoting the string so
    # everything passes throught.
    vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', lines))
    return lines

def isPresentInFile(regexp, filename):
    """ check if regexp is present in the file """
    try:
        fp = open(filename)
        fcontents = fp.read()
        fp.close()
        if re.search(regexp, fcontents):
            vim.command('let retval = 1')
            return 1
        else:
            vim.command('let retval = 0')
            return None
    except FileNotFoundError:
        vim.command('let retval = 0')
        return None

def deleteFile(filepattern):
    """ deletes a file if present

       If the file does not exist, check if its a filepattern rather than a
       filename. If its a pattern, then deletes all files matching the pattern.
    """
    try:
        if os.path.isfile(filepattern):
            os.remove(filepattern)
        else:
            if glob.glob(filepattern):
                for filename in glob.glob(filepattern):
                    os.remove(filename)
            else:
                vim.command('let retval = -1')
    except:
        vim.command('let retval = -1')

# vim:ff=unix:noet:ts=4:sw=4:nowrap


text:
title: N22 A Kitchen On Wheels
architect: Turner Architects
order: 3
categories: [shortlisted]
tags: [kitchen, living]
description: Transforming the ground floor of a small Victorian railway cottage in Wood Green with an adaptable piece of furniture that moves to cater for large gatherings.
products:
  - name: Bacco Dining Chairs
    image: 'https://cdn.thinglink.me/api/image/861281452522733568'
    brand: Habitat
  - name: Brooklyn Wall Lights
    image: 'https://cdn.thinglink.me/api/image/861284716442025984'
    brand: Industville
  - name: Nevada Dining Table
    image: 'https://cdn.thinglink.me/api/image/861283789593116672'
    brand: Barker and Stonehouse
  - name: Kolton Lounge Chair
    image: 'https://cdn.thinglink.me/api/image/861282347935334400'
    brand: Made
---


text:
.. AuthTool documentation master file, created by
   sphinx-quickstart on Fri Oct  2 16:56:14 2015.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to AuthTool's documentation!
====================================

Contents:

.. toctree::
   :maxdepth: 2

   includeme
   config
   models
   plugins
   tools

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
namespace Microsoft.Azure.Management.ContainerService.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Represents an OpenShift router
    /// </summary>
    public partial class OpenShiftRouterProfile
    {
        /// <summary>
        /// Initializes a new instance of the OpenShiftRouterProfile class.
        /// </summary>
        public OpenShiftRouterProfile()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the OpenShiftRouterProfile class.
        /// </summary>
        /// <param name="name">Name of the router profile.</param>
        /// <param name="publicSubdomain">DNS subdomain for OpenShift
        /// router.</param>
        /// <param name="fqdn">Auto-allocated FQDN for the OpenShift
        /// router.</param>
        public OpenShiftRouterProfile(string name = default(string), string publicSubdomain = default(string), string fqdn = default(string))
        {
            Name = name;
            PublicSubdomain = publicSubdomain;
            Fqdn = fqdn;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets name of the router profile.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets DNS subdomain for OpenShift router.
        /// </summary>
        [JsonProperty(PropertyName = "publicSubdomain")]
        public string PublicSubdomain { get; set; }

        /// <summary>
        /// Gets auto-allocated FQDN for the OpenShift router.
        /// </summary>
        [JsonProperty(PropertyName = "fqdn")]
        public string Fqdn { get; private set; }

    }
}


text:
require 'spec_helper'

describe Deterministic::Sequencer do
  include Deterministic::Prelude::Result

  let(:test_class) { Class.new { include Deterministic::Sequencer } }
  let(:test_instance) { test_class.new }
  let(:arbitrary_success) { Success(double) }

  # This mock method makes #arbitrary_success available within the operations
  # in the test sequences
  before { allow(test_instance).to receive(:arbitrary_success).and_return(arbitrary_success) }

  it 'requires #and_yield to be specified' do
    expect do
      in_sequence do
        get(:_) { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield not called')
  end

  it 'does not allow calling #and_yield multiple times' do
    expect do
      in_sequence do
        and_yield { arbitrary_success }
        and_yield { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield already called')
  end

  it 'does not allow calling #get after #and_yield' do
    expect do
      in_sequence do
        and_yield { arbitrary_success }
        get(:_) { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield already called')
  end

  it 'does not allow calling #let after #and_yield' do
    expect do
      in_sequence do
        and_yield { arbitrary_success }
        let(:_) { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield already called')
  end

  it 'does not allow calling #and_then after #and_yield' do
    expect do
      in_sequence do
        and_yield { arbitrary_success }
        and_then { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield already called')
  end

  it 'does not allow calling #observe after #and_yield' do
    expect do
      in_sequence do
        and_yield { arbitrary_success }
        observe { arbitrary_success }
      end
    end.to raise_error(described_class::InvalidSequenceError, 'and_yield already called')
  end

  context 'when #and_yield succeeds' do
    let(:yielder_result) { Success('yield') }
    before { allow(test_instance).to receive(:yielder).and_return(yielder_result) }

    it "returns and_yield's result" do
      result = in_sequence do
        and_yield { yielder }
      end
      expect(result).to eq(yielder_result)
    end

    it 'ignores the return value of the #in_sequence block' do
      result = in_sequence do
        and_yield { yielder }
        'a different return value'
      end
      expect(result).to eq(yielder_result)
    end
  end

  context 'when #and_yield fails' do
    let(:yielder_result) { Failure('yield') }
    before { allow(test_instance).to receive(:yielder).and_return(yielder_result) }

    it "returns and_yield's result" do
      result = in_sequence do
        and_yield { yielder }
      end
      expect(result).to eq(yielder_result)
    end
  end

  context 'when #get succeeds' do
    let(:getter_result) { Success('get') }
    before { allow(test_instance).to receive(:getter).and_return(getter_result) }

    it 'its result is available in a subsequent #get' do
      allow(test_instance).to receive(:second_getter).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        get(:_) { second_getter(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:second_getter).with(getter_result.value)
    end

    it 'its result is not available in a previous #get' do
      allow(test_instance).to receive(:second_getter)

      expect do
        in_sequence do
          get(:_) { second_getter(get_result) }
          get(:get_result) { getter }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in a subsequent #and_then' do
      allow(test_instance).to receive(:and_then_function).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        and_then { and_then_function(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:and_then_function).with(getter_result.value)
    end

    it 'its result is not available in a previous #and_then' do
      allow(test_instance).to receive(:and_then_function)

      expect do
        in_sequence do
          and_then { and_then_function(get_result) }
          get(:get_result) { getter }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in a subsequent #observe' do
      allow(test_instance).to receive(:observer)

      in_sequence do
        get(:get_result) { getter }
        observe { observer(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:observer).with(getter_result.value)
    end

    it 'its result is not available in a previous #observe' do
      allow(test_instance).to receive(:observer)

      expect do
        in_sequence do
          observe { observer(get_result) }
          get(:get_result) { getter }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in #and_yield' do
      allow(test_instance).to receive(:yielder).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        and_yield { yielder(get_result) }
      end

      expect(test_instance).to have_received(:yielder).with(getter_result.value)
    end
  end

  context 'when multiple #gets succeed' do
    let(:first_getter_result) { Success('get1') }
    let(:second_getter_result) { Success('get2') }

    before do
      allow(test_instance).to receive(:first_getter).and_return(first_getter_result)
      allow(test_instance).to receive(:second_getter).and_return(second_getter_result)
    end

    it 'both results are available in subsequent operations' do
      allow(test_instance).to receive(:yielder).and_return(arbitrary_success)

      in_sequence do
        get(:first_get_result) { first_getter }
        get(:second_get_result) { second_getter }
        and_yield { yielder(first_get_result, second_get_result) }
      end

      expect(test_instance).to have_received(:yielder)
        .with(first_getter_result.value, second_getter_result.value)
    end
  end

  context 'when #get fails' do
    let(:getter_result) { Failure('get') }
    before { allow(test_instance).to receive(:getter).and_return(getter_result) }

    it 'does not invoke subsequent #gets' do
      allow(test_instance).to receive(:second_getter).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        get(:_) { second_getter(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).not_to have_received(:second_getter)
    end

    it 'does not invoke subsequent #and_thens' do
      allow(test_instance).to receive(:and_then_function).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        and_then { and_then_function(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).not_to have_received(:and_then_function)
    end

    it 'does not invoke subsequent #observes' do
      allow(test_instance).to receive(:observer)

      in_sequence do
        get(:get_result) { getter }
        observe { observer(get_result) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).not_to have_received(:observer)
    end

    it 'does not invoke #and_yield' do
      allow(test_instance).to receive(:yielder).and_return(arbitrary_success)

      in_sequence do
        get(:get_result) { getter }
        and_yield { yielder }
      end

      expect(test_instance).not_to have_received(:yielder)
    end

    it 'returns the failure' do
      result = in_sequence do
        get(:get_result) { getter }
        and_yield { arbitrary_success }
      end

      expect(result).to eq(getter_result)
    end
  end

  context 'when #let succeeds' do
    let(:object) { {a: 'a'} }
    before { allow(test_instance).to receive(:object).and_return(object) }

    it 'its result is available in a subsequent #let' do
      allow(test_instance).to receive(:test_function)

      in_sequence do
        let(:a) { object.fetch(:a) }
        let(:_) { test_function(a) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:test_function).with(object.fetch(:a))
    end

    it 'its result is not available in a previous #let' do
      allow(test_instance).to receive(:test_function)

      expect do
        in_sequence do
          let(:_) { test_function(a) }
          let(:a) { object.fetch(:a) }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in a subsequent #and_then' do
      allow(test_instance).to receive(:and_then_function).and_return(arbitrary_success)

      in_sequence do
        let(:a) { object.fetch(:a) }
        and_then { and_then_function(a) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:and_then_function).with(object.fetch(:a))
    end

    it 'its result is not available in a previous #and_then' do
      allow(test_instance).to receive(:and_then_function)

      expect do
        in_sequence do
          and_then { and_then_function(a) }
          let(:a) { object.fetch(:a) }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in a subsequent #observe' do
      allow(test_instance).to receive(:observer)

      in_sequence do
        let(:a) { object.fetch(:a) }
        observe { observer(a) }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:observer).with(object.fetch(:a))
    end

    it 'its result is not available in a previous #observe' do
      allow(test_instance).to receive(:observer)

      expect do
        in_sequence do
          observe { observer(a) }
          let(:a) { object.fetch(:a) }
          and_yield { arbitrary_success }
        end
      end.to raise_error(NameError)
    end

    it 'its result is available in #and_yield' do
      allow(test_instance).to receive(:yielder).and_return(arbitrary_success)

      in_sequence do
        let(:a) { object.fetch(:a) }
        and_yield { yielder(a) }
      end

      expect(test_instance).to have_received(:yielder).with(object.fetch(:a))
    end
  end

  context 'when #let raises an error' do
    let(:object) { {a: 'a'} }
    before { allow(test_instance).to receive(:object).and_return(object) }

    it 'bubbles the raised error' do
      expect do
        in_sequence do
          let(:b) { object.fetch(:b) }
          and_yield { arbitrary_success }
        end
      end.to raise_error(KeyError)
    end

    it 'does not invoke #and_yield' do
      allow(test_instance).to receive(:yielder).and_return(arbitrary_success)

      begin
        in_sequence do
          let(:b) { object.fetch(:b) }
          and_yield { yielder }
        end
      rescue KeyError
        # Ignore
      end

      expect(test_instance).not_to have_received(:yielder)
    end
  end

  context 'when #and_then succeeds' do
    let(:and_then_result) { Success('and_then') }
    before { allow(test_instance).to receive(:and_then_function).and_return(and_then_result) }

    it 'continues the sequence' do
      allow(test_instance).to receive(:another_step).and_return(arbitrary_success)

      in_sequence do
        and_then { and_then_function }
        and_then { another_step }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:another_step)
    end
  end

  context 'when #and_then fails' do
    let(:and_then_result) { Failure('and_then') }
    before { allow(test_instance).to receive(:and_then_function).and_return(and_then_result) }

    it 'does not continue the sequence' do
      allow(test_instance).to receive(:another_step).and_return(arbitrary_success)

      in_sequence do
        and_then { and_then_function }
        and_then { another_step }
        and_yield { arbitrary_success }
      end

      expect(test_instance).not_to have_received(:another_step)
    end

    it 'returns the failure' do
      result = in_sequence do
        and_then { and_then_function }
        and_yield { arbitrary_success }
      end

      expect(result).to eq(and_then_result)
    end
  end

  context 'when #observe returns a failure' do
    let(:observe_result) { Failure('observe') }
    before { allow(test_instance).to receive(:observer).and_return(observe_result) }

    it 'its return value is ignored and the sequence continues' do
      allow(test_instance).to receive(:another_step).and_return(arbitrary_success)

      in_sequence do
        observe { observer }
        and_then { another_step }
        and_yield { arbitrary_success }
      end

      expect(test_instance).to have_received(:another_step)
    end
  end

  it 'does not allow calling methods outside of the wrapped instance' do
    expect do
      in_sequence do
        and_yield { top_level_test_method }
      end
    end.to raise_error(NameError)
  end

  context 'when including Deterministic::Prelude' do
    let(:test_class) { Class.new { include Deterministic::Prelude } }

    it '#in_sequence is available' do
      expect do
        in_sequence do
          and_yield { arbitrary_success }
        end
      end.not_to raise_error
    end
  end

  context 'readme example' do
    let(:test_class) do
      Class.new do
        include Deterministic::Prelude

        def call(input)
          in_sequence do
            get(:sanitized_input) { sanitize(input) }
            and_then              { validate(sanitized_input) }
            get(:user)            { get_user_from_db(sanitized_input) }
            let(:name)            { user.fetch(:name) }
            observe               { log('user name', name) }
            get(:request)         { build_request(sanitized_input, user) }
            observe               { log('sending request', request) }
            get(:response)        { send_request(request) }
            observe               { log('got response', response) }
            and_yield             { format_response(response) }
          end
        end

        def sanitize(input)
          sanitized_input = input
          Success(sanitized_input)
        end

        def validate(sanitized_input)
          Success(sanitized_input)
        end

        def get_user_from_db(sanitized_input)
          Success(type: :admin, id: sanitized_input.fetch(:id), name: 'John')
        end

        def build_request(sanitized_input, user)
          Success(input: sanitized_input, user: user)
        end

        def log(message, data)
          # logger.info(message, data)
        end

        def send_request(request)
          Success(status: 200)
        end

        def format_response(response)
          Success(response: response, message: 'it worked')
        end
      end
    end

    it 'returns expected result' do
      result = test_instance.call(id: 1)

      expect(result).to eq(Success(
        response: {status: 200},
        message: 'it worked'
      ))
    end

    it 'logs expected values' do
      allow(test_instance).to receive(:log).and_call_original

      test_instance.call(id: 1)

      expect(test_instance).to have_received(:log)
        .with('user name', 'John')
        .ordered
      expect(test_instance).to have_received(:log)
        .with('sending request',
          input: {id: 1},
          user: {type: :admin, id: 1, name: 'John'}
        )
        .ordered
      expect(test_instance).to have_received(:log)
        .with('got response', status: 200)
        .ordered
    end
  end

  def in_sequence(&block)
    test_instance.instance_eval do
      in_sequence(&block)
    end
  end
end

def top_level_test_method
  :empty
end


text:
SSD1306Brzo display(OLED_ADDRESS, PIN_SDA, PIN_SCL);
OLEDDisplayUi ui     ( &display );
int frameCount = 5;
int nrShotsTemp = 0;
int displaySpeed = 80;
fireMode displayMode = Single;
String fireModeStr[4] {"[ Single ]","[Double]", "[ Triple ]","[  Auto  ]"};

unsigned long blinktimer = 0;
bool blinktxt = true;

void nextFrame(){
  ui.nextFrame();
}

int getFrameNr(){
  return ui.getUiState()->currentFrame;
}

void setFireMode(bool state){
  if(state == true){
    ui.switchToFrame(4);
    ui.setTargetFPS(1);
  }
  else{
    ui.switchToFrame(0);
    ui.setTargetFPS(OLED_FPS);
  }

}

void drawStatus(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
 //draw status display
 ui.disableIndicator();
 if(setting.useClip()) drawClip(display,x,y);
 else drawShots(display,setting.getShots(),x,y);
 drawSpeed(display,setting.getSpeed(),x,y);
 drawBattery(display,80,x,y);
 drawMode(display,setting.getFireMode(),x,y);
}

void drawModeSetting(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
  //draw settings1 display
  //mode
  display->setFont(FONT_SMALL);
  drawModeSetup(display,setting.getFireMode(),x,y);

}

void drawBatteryStat(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
  // draw settings2 display
  // speed
  display->setFont(FONT_SMALL);
  display->drawString(0 + x, 0 + y, "Battery Status");
}

void drawFireStatus(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
   ui.disableIndicator();
   if(setting.useClip()) drawClip(display,x,y);
   else drawShots(display,setting.getShots(),x,y);

}

void drawClipSetting(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {
  //draw reset display
  // shots
  enum {BufSize=10}; // If a is short use a smaller number, eg 5 or 6
  char buf[BufSize];
  snprintf (buf, BufSize, "%02d", setting.getClipSize());
  display->setFont(FONT_SMALL);
  display->drawString(0 + x, 0 + y, "clip setting (reset shots)");
  display->setFont(FONT_LARGE);
  display->drawString(0+x, 12+y, buf);
}

// This array keeps function pointers to all frames
// frames are the single views that slide in
FrameCallback frames[] = { drawStatus, drawModeSetting, drawClipSetting, drawBatteryStat, drawFireStatus };

void drawMode(OLEDDisplay *display, fireMode transport, int16_t x, int16_t y){
  display->setFont(FONT_SMALL);
  display->drawString( 0+x, 34+y, "Mode :");
  display->drawString(40+x, 34+y, fireModeStr[transport]);

}

void drawModeSetup(OLEDDisplay *display, fireMode transport, int16_t x, int16_t y){
  display->setFont(FONT_SMALL);
  display->drawString( 0+x, 0+y, "Mode Setup :");
  display->setFont(FONT_LARGE);
  display->drawString(0+x, 12+y, fireModeStr[transport]);
}

void drawShots(OLEDDisplay *display, int shots, int16_t x, int16_t y){
  enum {BufSize=3}; // If a is short use a smaller number, eg 5 or 6
  char buf[BufSize];
  snprintf (buf, BufSize, "%02d", shots);
  display->setFont(FONT_SMALL);
  display->drawString( 0+x, 9+y, "Shots :");
  display->setFont(FONT_LARGE);
  display->drawString( 40+x, -3+y, buf);
}

void drawClip(OLEDDisplay *display, int16_t x, int16_t y){
  enum {BufSize=5}; // If a is short use a smaller number, eg 5 or 6
  char buf[BufSize];

  display->setFont(FONT_SMALL);
  display->drawString( 0+x, 9+y, "Clip:");
  display->setFont(FONT_LARGE);
  snprintf (buf, BufSize, "%02d", setting.getDartsLeft());
  if(setting.dartReady()) display->drawString( 40+x, -3+y, buf);
  else{
    if(blinktimer < micros()){
      blinktimer = micros() + OLED_BLINK;
      blinktxt = !blinktxt;
    }
    if(blinktxt) display->drawString( 40+x, -3+y, buf);
  }

  display->setFont(FONT_SMALL);
  snprintf (buf, BufSize, "/ %02d", setting.getClipSize());
  display->drawString( 80+x, 20+y, buf);

}

void drawBattery(OLEDDisplay *display, int battery, int16_t x, int16_t y){
  int batteryFill = battery / 5;
  display->drawRect(104+x,3+y,23,12);    //battery body
  display->fillRect(106+x+(20-batteryFill),5+y,batteryFill,9);      //battery fill
  display->fillRect(102+x,7+y,2,4);    //battery nob
}

void drawSpeed(OLEDDisplay *display, int speeds, int16_t x, int16_t y){
  int progressBarOffset = 0;
  display->setFont(FONT_SMALL);
  progressBarOffset = display->getStringWidth("Speed")+4;
  display->drawString(0 + x, 51 + y, "Speed");
  display->drawProgressBar(progressBarOffset+x, 53+y, 127-progressBarOffset, 10, speeds);
}

bool pictureLoop(){
  int remainingTimeBudget = ui.update();

  //if (remainingTimeBudget > 0) {
    // You can do some work here
    // Don't do stuff if you are below your
    // time budget.

    //delay(remainingTimeBudget);
  //}
}

void initOLED(){
  if(DEBUG) Serial.println("Oled: Init start");

  // The ESP is capable of rendering 60fps in 80Mhz mode
  // but that won't give you much time for anything else
  // run it in 160Mhz mode or just set it to 30 fps
  ui.setTargetFPS(OLED_FPS);

  // Customize the active and inactive symbol
  ui.setActiveSymbol(activeSymbol);
  ui.setInactiveSymbol(inactiveSymbol);

  ui.disableAutoTransition();

  // You can change this to
  // TOP, LEFT, BOTTOM, RIGHT
  ui.setIndicatorPosition(BOTTOM);

  // Defines where the first frame is located in the bar.
  ui.setIndicatorDirection(LEFT_RIGHT);

  // You can change the transition that is used
  // SLIDE_LEFT, SLIDE_RIGHT, SLIDE_UP, SLIDE_DOWN
  ui.setFrameAnimation(SLIDE_LEFT);

  // Add frames
  ui.setFrames(frames, frameCount);

  ui.switchToFrame(0);
  // Add overlays
  //ui.setOverlays(overlays, overlaysCount);

  // Initialising the UI will init the display too.
  ui.init();

  display.flipScreenVertically();

  if(DEBUG) Serial.println("OLED: Initialized");
}


text:
yandex-maps-typescript-definition
=================================

Provides Yandex Maps TypeScript definitions


text:
package javax.ims.core;

/**
 * This listener type is used to notify the application about the status of sent page messages.
 *
 * @see PageMessage.setListener(PageMessageListener)
 * @author Cheambe Alice <alice.cheambe@fraunhofer.fokus.de>
 *
 */
public interface PageMessageListener
{

    /**
     * Notifies the application that the PageMessage was successfully delivered.
     *
     * @param pagemessage - the concerned PageMessage
     */
	public abstract void pageMessageDelivered(PageMessage pagemessage);

	/**
	 * Notifies the application that the PageMessage was not successfully delivered.
	 *
	 * @param pagemessage - the concerned PageMessage
	 */
    public abstract void pageMessageDeliveredFailed(PageMessage pagemessage);
}


text:
package org.apache.myfaces.trinidadinternal.share.xml;

import org.xml.sax.Locator;

import org.apache.myfaces.trinidadinternal.share.expl.ExpressionContext;
import org.apache.myfaces.trinidadinternal.share.expl.Function;
import org.apache.myfaces.trinidadinternal.share.expl.PrefixMapper;
import org.apache.myfaces.trinidadinternal.share.expl.NSFunctionMapper;

/**
 * Wrapper class that turns a client-created ParseContext into
 * one sufficient for ParseContextImpl
 *

 * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/xml/ParseContextWrapper.java#0 $) $Date: 10-nov-2005.18:59:12 $
 */
final class ParseContextWrapper implements ParseContext
{
  /**
   * Creates a ParseContext that uses the provided
   * ParserManager to get NodeParsers.
   */
  public ParseContextWrapper(
    ParseContext  base,
    ParserManager manager,
    XMLProvider   provider)
  {
    _base = base;
    _manager = manager;
    _provider = provider;

    final PrefixMapper pmapper = new PrefixMapper()
      {
        public String getNamespaceURI(String prefix)
        {
          return getParserManager().resolveNamespaceAlias
            (_namespaces.getURI(prefix));
        }
      };

    final NSFunctionMapper fmapper =
      new NSFunctionMapper()
      {
        @Override
        public Function resolveFunction(String namespaceURI,
                                        String name)
        {
          return getParserManager().getFunction(namespaceURI, name);
        }
      };

    _bindingContext = new ExpressionContext()
      {
        public NSFunctionMapper getFunctionMapper()
        {
          return fmapper;
        }

        public PrefixMapper getPrefixMapper()
        {
          return pmapper;
        }
      };
  }

  /**
   * Returns the default node parser that shold be used
   * for a specific element name, given the type of expected object.
   *

   * @param expectedType the Class of the Java object expected for this element
   * @param namespaceURI the namespace of the XML element
   * @param localName the local name of the XML element
   */
  public NodeParser getParser(
    Class<?>   expectedType,
    String     namespaceURI,
    String     localName)
  {
    return getParserManager().getParser(this,
                                        expectedType,
                                        namespaceURI,
                                        localName);
  }

  /**
   * Returns a parser extension.
   *

   * @param currentType the Class of the Java object being built
   * @param namespaceURI the namespace of the XML element or attribute
   */
  public ParserExtension getExtension(
    String     namespaceURI)
  {
    return getParserManager().getExtension(namespaceURI);
  }

  /**
   * Returns the parser manager.
   */
  public ParserManager getParserManager()
  {
    return _manager;
  }

  /**
   * gets the bindingContext
   */
  public ExpressionContext getExpressionContext()
  {
    return _bindingContext;
  }

  /**
   * Convert a string prefix to a full namespace URI.
   * @param prefix the string prefix of the namspace, or the empty
   *     string for the default namespace
   * @return the URI of that namespace, or null if the prefix
   *    hasn't been mapped
   * @deprecated since 2.2.0 use {@link #getExpressionContext()} and
   * {@ExpressionContext#getPrefixMapper()}
   */
  @Deprecated
  public final String getNamespaceURI(String prefix)
  {
    return getExpressionContext().getPrefixMapper().getNamespaceURI(prefix);
  }

  /**
   * Return a SAX Locator object for identifying the document location.
   * @return a locator, or null if none is available
   */
  public Locator getLocator()
  {
    return _locator;
  }

  /**
   * Get an XMLProvider.
   */
  public XMLProvider getXMLProvider()
  {
    return _provider;
  }

  /**
   * Gets a property stored on the context.
   */
  public Object getProperty(String namespace, Object key)
  {
    return _base.getProperty(namespace, key);
  }

  /**
   * Stores a property on the context.
   */
  public void setProperty(String namespace, Object key, Object value)
  {
    _base.setProperty(namespace, key, value);
  }

  /**
   *
   */
  @Override
  public Object clone()
  {
    return _base.clone();
  }

  /**
   * Set the locator.  A callback used by TreeBuilder.
   */
  void __setLocator(Locator locator)
  {
    _locator = locator;
  }

  /**
   * A callback used by TreeBuilder.
   */
  void __startElement()
  {
    if (!_contextPushed)
      _namespaces.pushContext();
    else
      _contextPushed = false;
  }

  /**
   * A callback used by TreeBuilder.
   */
  void __endElement()
  {
    _namespaces.popContext();
  }

  /**
   * A callback used by TreeBuilder.
   */
  void __addPrefixMapping(
    String prefix,
    String namespaceURI)
  {
    if (!_contextPushed)
    {
      _contextPushed = true;
      _namespaces.pushContext();
    }

    _namespaces.declarePrefix(prefix, namespaceURI);
  }

  ParseContext __getWrappedContext()
  {
    return _base;
  }

  private final ExpressionContext _bindingContext;
  private final ParseContext   _base;
  private final ParserManager  _manager;
  private final XMLProvider    _provider;

  // A SAX helper object that keeps track of namespace prefixes
  private NamespaceSupport _namespaces = new NamespaceSupport();

  // Boolean to keep track of whether we've called "pushContext()" yet.
  private boolean _contextPushed;

  // The SAX locator
  private Locator          _locator;
}


text:
module.exports = {
  title: 'Zane Riley, Product Designer',  // Your website title
  url: 'https://zaneriley.com',           // Your website URL
  trackingID: 'UA-12259734-2',            // Google Analytics Site's ID
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 Kantega AS
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.kantega.respiro</groupId>
        <artifactId>respiro-plugins</artifactId>
        <version>2.29-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <artifactId>respiro-cxf-plugin</artifactId>

    <dependencies>
        <dependency>
            <groupId>${project.parent.groupId}</groupId>
            <artifactId>respiro-api</artifactId>
            <version>${project.parent.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-javamail_1.4_spec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
    </dependencies>
</project>


text:
"""
Tools for parsing and importing WebAP data
"""
import argparse
import re
import tarfile

import summaryrank

IMPORTER_DESCRIPTION = r'''
Import TREC Novelty Track data and store query/corpus in tab-delimited CSV format.
'''

IMPORTER_EPILOG = r'''
EXAMPLE (based on TREC Novelty Track 2002-2004 data)
----------------------------------------------------
    python -m summaryrank import_trec_novelty -m novelty02 novelty_topics.txt novelty.tar.gz min_qrels.relevant
    python -m summaryrank import_trec_novelty -m novelty03 03.novelty.topics.txt documents.tar.gz qrels.relevant.03.txt
    python -m summaryrank import_trec_novelty -m novelty04 novelty04.topics.txt 04docs.tar.gz 04.qrels.relevant
'''

def import_trec_novelty(argv):
    """ Import TREC Novelty Track data """
    parser = argparse.ArgumentParser(
        prog='import_trec_novelty',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description=IMPORTER_DESCRIPTION,
        epilog=IMPORTER_EPILOG,
    )

    parser.add_argument('-m', dest='model', metavar='DIR', required=True,
                        help='store the processed data in DIR')
    parser.add_argument('query_file',
                        help='query file, in TREC format')
    parser.add_argument('corpus_file',
                        help='corpus file, a tarball as distributed by TREC')
    parser.add_argument('qrels_file',
                        help='relevance judgment file')
    args = parser.parse_args(argv)

    model = summaryrank.Model(args.model)

    # process and save query topics
    topics = get_topics(summaryrank.open(args.query_file))
    qids = [m['qid'] for _, m in topics]
    model.save_topics(topics)

    # process corpus data and save sentences
    qrels = get_qrels_set(summaryrank.open(args.qrels_file))
    sentences = get_sentences(tarfile.open(args.corpus_file, 'r:gz'),
                              qids=qids, qrels=qrels, charset='latin-1')
    model.save_sentences_qrels(sentences, qids=set(qids))

SENTENCE_PATTERN = re.compile(r'<s docid="(.*?)" num="(.*?)">\s*(.*)</s>')

def get_topics(iterable):
    """ Get TREC description topics. """
    result = []
    metadata = None
    tag = None
    for line in iterable:
        if line.startswith('<'):
            if line.startswith('<top>'):
                metadata = dict()
                tag = None
            if line.startswith('<num>'):
                m = re.match(r'<num>\s*Number:\s*(\S+)', line)
                assert m
                metadata['qid'] = m.group(1)
            elif line.startswith('</top>'):
                desc = metadata.get('desc', None)
                result.append((' '.join([l.strip() for l in desc]).strip(), metadata))
            else:
                m = re.match(r'<(.*?)>', line)
                assert m
                tag = m.group(1)
                metadata[tag] = []
        elif tag:
            metadata[tag].append(line)

    return result

def get_sentences(tarball, qids, qrels, charset=None):
    """ Get sentences from TRECTEXT data. """
    names = set(tarball.getnames())
    for qid in qids:
        filename = '{}.docs_text'.format(qid)
        if filename not in names:
            # a hack for Novelty Track 2004 data
            alt = '{}.doc_text'.format(qid)[1:]
            if alt in names:
                filename = alt
            else:
                print >>sys.stderr, 'warning: cannot find {}'.format(filename)
                continue

        in_ = tarball.extractfile(filename)
        for line in in_:
            m = re.match(SENTENCE_PATTERN, line)
            if m:
                sentence = m.group(3).decode(charset) if charset else m.group(3)
                metadata = {'qid': qid, 'docno': m.group(1), 'id': m.group(2)}
                rel = int((metadata['qid'], metadata['docno'], metadata['id']) in qrels)
                metadata['rel'] = str(rel)
                yield sentence, metadata

def get_qrels_set(iterable):
    """ Get TREC Novelty Track qrels """
    return set([tuple(re.split(r'[ :]', line.strip(), maxsplit=2)) for line in iterable])


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

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct base_unit_info<abstract::temperature_unit_tag></title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_units/Reference.html#header.boost.units.systems.abstract_hpp" title="Header <boost/units/systems/abstract.hpp>">
<link rel="prev" href="base_unit_inf_idp998407536.html" title="Struct base_unit_info<abstract::current_unit_tag>">
<link rel="next" href="base_unit_inf_idp998415696.html" title="Struct base_unit_info<abstract::amount_unit_tag>">

Home
Libraries
People
FAQ
More

Struct base_unit_info<abstract::temperature_unit_tag>

boost::units::base_unit_info<abstract::temperature_unit_tag>

Synopsis

// In header: <boost/units/systems/abstract.hpp>

struct base_unit_info<abstract::temperature_unit_tag> {

  // public static functions
  static std::string name();
  static std::string symbol();
};

Description

base_unit_info public static functions

static std::string name();

static std::string symbol();

Copyright © 2003-2008 Matthias Christian Schabel
Copyright © 2007-2010 Steven
      Watanabe

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
package com.carlo.bayes.player;

import org.aiwolf.client.base.player.AbstractBodyguard;
import org.aiwolf.client.lib.TemplateTalkFactory;
import org.aiwolf.common.data.Agent;
import org.aiwolf.common.data.Role;
import org.aiwolf.common.net.GameInfo;
import org.aiwolf.common.net.GameSetting;

import com.carlo.bayes.trust.TrustLevel;
import com.carlo.bayes.trust.TrustListManager;
import com.carlo.lib.AgentInformationManager;

public class BayesBodyguard extends AbstractBodyguard {
	private AgentInformationManager agentInfo;
	private TrustListManager trustListManager;

	@Override
	public void initialize(GameInfo gameInfo,GameSetting gameSetting){
		super.initialize(gameInfo, gameSetting);
		agentInfo=new AgentInformationManager(gameInfo,this.getMe());
		trustListManager=new TrustListManager(gameInfo.getAgentList(), this, agentInfo);
	}
	@Override
	public void update(GameInfo gameInfo){
		super.update(gameInfo);
		agentInfo.update(gameInfo);
		trustListManager.update();

	}

	@Override
	public void dayStart() {
		agentInfo.dayStart();
		trustListManager.dayStart();
		trustListManager.printTrustList();

	}

	@Override
	public void finish() {
		trustListManager.printTrustList(getLatestDayGameInfo());
	}

	@Override
	public String talk() {
		return TemplateTalkFactory.over();
	}

	@Override
	public Agent vote() {
		return trustListManager.getAgent(TrustLevel.LOWEST, true);
	}
	@Override
	public Agent guard() {
		Agent agent=trustListManager.getRoleCOAgent(TrustLevel.HIGHEST, Role.SEER, false);
		if(agentInfo.isAlive(agent)==false) agent=trustListManager.getRoleCOAgent(TrustLevel.HIGHEST, null, true);
		return agent;
	}

}


text:
require 'rspec/its'
require 'pry'

require 'api_buddy'
require 'support/documentation_helpers'

RSpec.configure do |config|
  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.filter_run :focus
  config.run_all_when_everything_filtered = true
  config.example_status_persistence_file_path = "spec/examples.txt"
  config.disable_monkey_patching!
  config.warnings = true
  config.order = :random

  Kernel.srand config.seed
end


text:
import json
import urllib2

#app = Flask(__name__)

url = 'https://android.googleapis.com/gcm/send'
apiKey = ''
myKey = "key=" + apiKey
to = ''

headers = {'Content-Type': 'application/json', 'Authorization': myKey}

data = {}
data['to'] = to
data['notification'] = {'title': 'zz', 'text': 'zz'}
data['data'] = {'data': 'I love you'}
data['time_to_live'] = 100
data['delay_while_idle'] = 'false'
json_dump = json.dumps(data)

req = urllib2.Request(url, json_dump, headers)
result = urllib2.urlopen(req).read()
print json.dumps(result)

#@app.route('/')
#def start():
#	return

#if __name__ == '__main__':
#	app.run(host='0.0.0.0', port=8080, debug=True)