text:
package com.emitrom.ti4j.mobile.client.ui;

import com.emitrom.ti4j.core.client.ProxyObject;
import com.emitrom.ti4j.mobile.client.core.handlers.ui.ClickHandler;
import com.emitrom.ti4j.mobile.client.ui.interfaces.HasColor;
import com.emitrom.ti4j.mobile.client.ui.interfaces.HasFont;
import com.emitrom.ti4j.mobile.client.ui.interfaces.HasImage;
import com.emitrom.ti4j.mobile.client.ui.interfaces.HasLabel;
import com.emitrom.ti4j.mobile.client.ui.interfaces.HasStyle;
import com.emitrom.ti4j.mobile.client.ui.style.Font;
import com.emitrom.ti4j.mobile.client.ui.style.Position;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.ui.HasText;

/**
 * A Button Component
 */
public class Button extends View implements HasColor, HasFont, HasLabel, HasStyle, HasImage, HasText {

    public Button() {
        createPeer();
    }

    public Button(String label) {
        this();
        setTitle(label);
    }

    Button(JavaScriptObject obj) {
        jsObj = obj;
    }

    public Button(String label, ClickHandler clickHandler) {
        this(label);
        addClickHandler(clickHandler);
    }

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasColor#getColor()
     */
    @Override
    public native String getColor() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.color;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasColor#setColor(java.lang.String)
     */
    @Override
    public native void setColor(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.color = value;
    }-*/;

    /**
     * @return Boolean that indicates if the button is enabled or not
     */
    public native boolean isEnabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.enabled;
    }-*/;

    public native void setEnabled(boolean value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.enabled = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasFont#getFont()
     */
    @Override
    public native Font getFont() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.font;
		var toReturn = @com.emitrom.ti4j.mobile.client.ui.style.Font::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasFont#setFont(com.emitrom.gwt4
     * .ti.mobile.client.ui.style.Font)
     */
    @Override
    public native void setFont(Font value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.font = value.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasImage#getImage()
     */
    @Override
    public native String getImage() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.image;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasImage#setImage(java.lang.String)
     */
    @Override
    public native void setImage(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.image = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasColor#getSelectedColor()
     */
    @Override
    public native String getSelectedColor() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.selectedColor;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasColor#setSelectedColor(java.lang
     * .String)
     */
    @Override
    public native void setSelectedColor(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.selectedColor = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasStyle#getStyle()
     */
    @Override
    public native int getStyle() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.style;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasStyle#setStyle(int)
     */
    @Override
    public native void setStyle(int value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.style = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasLabel#getTitle()
     */
    @Override
    public native String getTitle() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.title;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasLabel#setTitle(java.lang.String)
     */
    @Override
    public native void setTitle(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.title = value;
    }-*/;

    /**
     * @iOS only
     * @return
     */
    public native int getSystemButton() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.systemButton;
    }-*/;

    public native void setSystemButton(int value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.systemButton = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasLabel#getTitleId()
     */
    @Override
    public native String getTitleId() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.titleid;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasLabel#setTitleId(java.lang.String
     * )
     */
    @Override
    public native void setTitleId(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.titleid = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see
     * com.emitrom.ti4j.mobile.client.ui.HasLabel#setTextAlign(com.emitrom
     * .gwt4.ti.mobile.client.ui.style.Position)
     */
    @Override
    public void setTextAlign(Position align) {
        setTextAlign(align.getValue());
    }

    public native void setTextAlign(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.textAlign = value;
    }-*/;

    public native void setTextAlign(int value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.textAlign = value;
    }-*/;

    /*
     * (non-Javadoc)
     *
     * @see com.emitrom.ti4j.mobile.client.ui.HasLabel#getTextAlign()
     */
    @Override
    public Position getTextAlign() {
        return Position.fromValue(_getTextAlign());
    }

    public void setVerticalAlign(Position align) {
        setVerticalAlign(align.getValue());
    }

    public native void setVerticalAlign(String value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.verticalAlign = value;
    }-*/;

    public native void setVerticalAlign(int value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.verticalAlign = value;
    }-*/;

    private native String _getTextAlign() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.textAlign;
    }-*/;

    @Override
    public void createPeer() {
        jsObj = UI.createButton();
    }

    public static Button from(ProxyObject proxy) {
        return new Button(proxy.getJsObj());
    }

	@Override
	public String getText() {
		return getTitle();
	}

	@Override
	public void setText(String text) {
		setTitle(text);
	}

}


text:
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Alphora Dataphor - Frontend WPF Client")]
[assembly: AssemblyDescription("Common Dataphor Frontend WPF Client Library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Alphora")]
[assembly: AssemblyProduct("Dataphor")]
[assembly: AssemblyCopyright("© Copyright 2009-2015 Alphora")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>.  For example, if you are using US english
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

[assembly: ThemeInfo(
	ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
	//(used if a resource is not found in the page,
	// or application resource dictionaries)
	ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
	//(used if a resource is not found in the page,
	// app, or any theme specific resource dictionaries)
)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("3.1.*")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
#if SIGNASSEMBLIES
[assembly: AssemblyKeyFile("..\\..\\..\\..\\Dataphor.snk")]
#else
[assembly: AssemblyKeyFile("")]
#endif
[assembly: AssemblyKeyName("")]

redpajama_set_name: RedPajamaGithub


text:
using Mirabeau.Wbtstr.Net.Email.Interfaces;

namespace Mirabeau.Wbtstr.Net.Email
{
   public class EmailConfig : IEmailConfig
    {
        public string HostName { get; set; }
        public int Port { get; set; }
        public bool UseSsl { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
    }
}


text:
cask 'chromedriver' do
  version '2.43'
  sha256 '84244e590d866294c1eaa5fa65ad51f1b0d2cc4fc1595aa3e414f5aac4da60ef'

  # chromedriver.storage.googleapis.com was verified as official when first introduced to the cask
  url "https://chromedriver.storage.googleapis.com/#{version}/chromedriver_mac64.zip"
  appcast 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE'
  name 'ChromeDriver'
  homepage 'https://sites.google.com/a/chromium.org/chromedriver/home'

  binary 'chromedriver'
end


text:
from django.shortcuts import get_object_or_404, redirect, render, render_to_response
from extra_views import InlineFormSet, CreateWithInlinesView, ModelFormSetView, UpdateWithInlinesView
from django.forms import Textarea, MultipleChoiceField
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.views.generic.list import ListView

from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.urlresolvers import reverse, reverse_lazy
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.forms.models import inlineformset_factory

from farms.models import Farm, Field, CropSeason, CropSeasonEvent, Probe
from farms.readonly import ReadonlyFormset

def crop_seasons_filter(user):
    crop_season_list = CropSeason.objects.filter( Q(field_list__farm__farmer=user) |
                                                  Q(field_list__farm__users=user) ).distinct()
    if crop_season_list:
        return crop_season_list
    else:
        return []

def fields_filter(user):
        return Field.objects.filter( Q(farm__farmer=user) |
                                     Q(farm__users=user) ).distinct()

crop_season_fields = (
                   'name',
                   'description',
                   'crop',
                   'season_start_date',
                   'season_end_date',
                   'field_list',
                   'comment'
                   )

class CropSeasonListView(ListView):
    template_name = "farms/crop_season_list.html"
    model = CropSeason
    fields = crop_season_fields

    def get_queryset(self):
        return crop_seasons_filter(self.request.user)

    @method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        return super(CropSeasonListView, self).dispatch(*args, **kwargs)

class CropSeasonEventsInline(InlineFormSet):
    model = CropSeasonEvent
    can_delete=False
    fields = [ 'field',
               'crop_event',
               'date',
             ]
    extra = 0

    def get_factory_kwargs(self):
        kwargs = super(CropSeasonEventsInline, self).get_factory_kwargs()
        kwargs[ 'extra' ] = self.extra
        return kwargs

    def add_fields(self, form, index):
        super(CropSeasonEventsInline, self).add_fields(form, index)
        Form.fields["event_order"]       = forms.CharField()
        form.fields["event_duration"]    = forms.CharField()
        form.fields["event_description"] = forms.TextField()
        form.fields["key_event"]         = forms.BooleanField()

    def construct_formset(self, *args, **kwargs):
        formset = super(CropSeasonEventsInline, self).construct_formset(*args, **kwargs)
        for form in formset:
            form.instance.event_order       = form.instance.get_event_order()
            form.instance.event_duration    = form.instance.get_event_duration()
            form.instance.event_description = form.instance.get_event_description()
            form.instance.key_event         = form.instance.get_key_event()
        return formset

class CropSeasonEventsInlineReadonly(ReadonlyFormset, CropSeasonEventsInline):

    class NewMeta:
        readonly = [ 'crop_event', ]
        hidden = [ 'field', ]

class CropSeasonUpdateView(UpdateWithInlinesView):
    model = CropSeason
    fields = crop_season_fields
    inlines = [ CropSeasonEventsInlineReadonly ]
    template_name = 'farms/crop_season_and_crop_season_events.html'

    @method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        """
        This function ensures that the user has the right to access
        this object by comparing the primary key of this object to the
        list of primary keys constructed from a query of objects where
        this user is either the farmer or the one of the users.
        """
        self.crop_season_list = crop_seasons_filter(self.request.user)
        user_pk = int(kwargs['pk'])
        pk_list = map( lambda x: int(x.pk), self.crop_season_list )
        if not user_pk in pk_list:
            return redirect( reverse('crop_season_list') )
        else:
            retval = super(CropSeasonUpdateView, self).dispatch(*args, **kwargs)

        return retval

    def get_success_url(self):
        return reverse('crop_season_id', args=[self.object.pk])

    def get_queryset(self):
        user = self.request.user
        queryset = super(CropSeasonUpdateView, self).get_queryset()

        queryset = queryset.filter( Q(field_list__farm__farmer=user) |
                                    Q(field_list__farm__users=user)
                                  )

        return queryset.distinct()

    def get_context_data(self, **kwargs):
        context = super(CropSeasonUpdateView, self).get_context_data(**kwargs)
        field_list = context['object'].field_list.all()
        context['field_list'] = field_list
        return context

    def get_form(self, *args, **kwargs):
        """
        Ensure that the "Field List" widget only shows fields that correspind to this user
        """
        form = super(CropSeasonUpdateView, self).get_form(*args, **kwargs)
        form.fields["field_list"].queryset = fields_filter(self.request.user)
        return form

    def forms_valid(self, form, inlines):
        # If the type of crop has changed, the CropEvent in the
        # formset will contain invalid inforamtiom so ignore it.
        if 'crop' in form.changed_data:
            retval = super(CropSeasonUpdateView, self).forms_valid(form, [] )
        else:
            retval = super(CropSeasonUpdateView, self).forms_valid(form, inlines)

        self.object.save()
        return retval

class CropSeasonCreateView(CreateWithInlinesView):
    model = CropSeason
    fields = crop_season_fields
    inlines = [ CropSeasonEventsInline ]
    template_name = 'farms/crop_season_and_crop_season_events.html'

    @method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        return super(CropSeasonCreateView, self).dispatch(*args, **kwargs)

    def get_success_url(self):
        return reverse('crop_season_id', args=[self.object.pk])

    def get_queryset(self):
        user = self.request.user
        queryset = super(CropSeasonCreateView, self).get_queryset()

        queryset = queryset.filter( Q(field_list__farm__farmer=user) |
                                    Q(field_list__farm__users=user)
                                  )

        return queryset.distinct()

    def get_factory_kwargs(self):
        kwargs = super(CropSeasonEventsInline, self).get_factory_kwargs()
        #kwargs[ 'widgets' ] = self.widgets
        return kwargs

    def get_form(self, *args, **kwargs):
        form = super(CropSeasonCreateView, self).get_form(*args, **kwargs)
        form.fields["field_list"].queryset = fields_filter(self.request.user)
        return form

    def forms_valid(self, form, inlines):
        retval = super(CropSeasonCreateView, self).forms_valid(form, inlines)
        self.object.save()
        self.object.delete_orphan_events(all=False)
        return retval

class CropSeasonDeleteView(DeleteView):
    template_name = "farms/crop_season_delete.html"
    model = CropSeason
    pk_field = 'pk'

    success_url = reverse_lazy('crop_season_list')

    crop_season_list = None

    @method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        """
        This function ensures that the user has the right to access
        this object by comparing the primary key of this object to the
        list of primary keys constructed from a query of objects where
        this user is either the farmer or the one of the users.
        """
        self.crop_season_list = crop_seasons_filter(self.request.user)
        user_pk = int(kwargs['pk'])
        pk_list = map( lambda x: int(x.pk), self.crop_season_list )
        if not user_pk in pk_list:
            return redirect( reverse('crop_season_list') )
        else:
            return super(CropSeasonDeleteView, self).dispatch(*args, **kwargs)

    def get_context_data(self, *args, **kwargs):
        context = super(CropSeasonDeleteView, self).get_context_data(*args, **kwargs)
        context['crop_season_list'] = self.crop_season_list
        return context


text:
layout: post
status: publish
published: true
title: 'Code Mill Minute: Setting Up Xamarin Studio To Work With TFS Online Git Source
  Control'
author:
  display_name: Matthew Soucoup
  login: msoucoup
  email: msoucoup@codemilltech.com
  url: https://codemilltech.com
author_login: msoucoup
author_email: msoucoup@codemilltech.com
author_url: https://codemilltech.com
excerpt: Have a minute? That's all it will take to find out how to get Xamarin Studio
  to use a TFS Online Git repository!
wordpress_id: 2382
wordpress_url: http://codemilltech.com/?p=2382
date: '2015-07-01 12:45:12 -0500'
date_gmt: '2015-07-01 17:45:12 -0500'
categories:
- Tutorial
- Code Mill Minute
tags:
- Xamarin
- Xamarin Studio
- TFS Online
- Visual Studio Online
- Git
comments:
- id: 2934
  author: 'Matthew Soucoup: Code Mill Minute: Setting Up Xamarin Studio To Work With
    TFS Online Git Source Control | XamGeek.com'
  author_email: ''
  author_url: http://xamgeek.com/blog/httpcodemilltech-comcode-mill-minute-setting-up-xamarin-studio-to-work-with-tfs-online-git-source-control/
  date: '2015-07-02 03:26:16 -0500'
  date_gmt: '2015-07-02 08:26:16 -0500'
  content: '[…] Twitter […]'
- id: 2947
  author: 'Adam J Wolf: Weekly Xamarin Newsletter Issue #47 | XamGeek.com'
  author_email: ''
  author_url: http://xamgeek.com/blog/httpswww-syntaxismyui-comweekly-xamarin-newsletter-issue-47/
  date: '2015-07-03 11:11:33 -0500'
  date_gmt: '2015-07-03 16:11:33 -0500'
  content: '[…] Setting Up Xamarin Studio To Work With TFS Online Git Source
    Control Matthew Soucoup, from Code Mill Technologies, gets you up and running
    with TFS and Xamarin Studio. […]'
- id: 3121
  author: Bruce
  author_email: brucemcmillan@hotmail.co.uk
  author_url: ''
  date: '2015-07-17 16:59:19 -0500'
  date_gmt: '2015-07-17 21:59:19 -0500'
  content: "Hello,\r\n\r\nThanks for this post, as a part time VS and newbie tfs user,
    getting an already created VS online code repository onto the mac was a doddle
    using this..\r\n\r\nB.."
- id: 3129
  author: Matthew Soucoup
  author_email: msoucoup@codemilltech.com
  author_url: http://www.codemilltech.com
  date: '2015-07-18 10:53:30 -0500'
  date_gmt: '2015-07-18 15:53:30 -0500'
  content: That's great to hear Bruce ... thanks!
- id: 3134
  author: 'Matthew Soucoup: Code Mill Minute: Setting Up Xamarin Studio To Work With
    TFS Online Git Source Control | XamGeek.com'
  author_email: ''
  author_url: http://xamgeek.com/blog/httpscodemilltech-comcode-mill-minute-setting-up-xamarin-studio-to-work-with-tfs-online-git-source-control/
  date: '2015-07-18 13:44:45 -0500'
  date_gmt: '2015-07-18 18:44:45 -0500'
  content: '[…] LinkedIn […]'
- id: 3191
  author: 'Xamarin: More Awesome Content from Our Community | XamGeek.com'
  author_email: ''
  author_url: http://xamgeek.com/blog/httpsblog-xamarin-commore-awesome-content-from-our-community/
  date: '2015-07-24 13:35:50 -0500'
  date_gmt: '2015-07-24 18:35:50 -0500'
  content: '[…] Setting Up Xamarin Studio to Work with TFS Online Git Repository
    – Learn how to integrate Xamarin Studio with TFS Online's Git source
    control in this post from Matthew Soucoup. […]'
- id: 4653
  author: Mark Rad
  author_email: radacz.mcp@gmail.com
  author_url: http://www.xradapp.com
  date: '2016-02-19 18:39:33 -0600'
  date_gmt: '2016-02-20 00:39:33 -0600'
  content: Tnx Matthew.. your post helped to fix our problem..
---

Today I'm starting a new series of blog posts entitled "Code Mill Minute".  These will be a departure from my normal novel length posts (I'm trying to shorten those too, but that's another story) and will focus on just fixing or doing something that we developers encounter on a day to day basis.

Short and sweet... to the point... and only takes a minute to read.

So let's dive into today's topic ... integrating Xamarin Studio on the Mac with TFS Online's (aka Visual Studio Online) Git source control.

The Problem</h2>

By default, the account you login as to Visual Studio Online is your Microsoft account, which is an email address. The problem with that is the "@" symbol. Applications other than Visual Studio have an issue using that symbol to connect with Git.

The Solution</h2>

We need to enable another set of credentials in TFS Online, link the new credentials up to our existing VSOnline account, clone the repository with our new user, then have Xamarin Studio perform a remote Git operation, so it can cache the user credentials as well.

Enabling VSOnline Alternate Credentials</h3>

The first thing we'll do is enable alternate credentials in VSOnline. To do so, follow these steps.

Login to VSOnline with your normal credentials</li>

In the upper right corner, you'll see your name, click on that, then click on "My Profile" in the resulting dropdown.</li>

A screen similar to the one below will appear. Click on the "Credentials" tab and then "Enable Alternate Credentials".[caption id="attachment_2389" align="aligncenter" width="300"]</a> Enabling Alternate Credentials[/caption]

</li>

Enter the username and password you want to use for Git access with Xamarin Studio (or the command line).

</li>

</ol>

Integrating With Xamarin Studio on the Mac</h3>

Next we need to clone the repository with the new credentials, then make sure Xamarin Studio has those credentials cached as well.

First, note the clone URL of the repository from TFS Online. (This can be found from the "clone" button while viewing the top level source code structure within TFS Online website.)</li>

Open up Terminal and navigate to the directory you want to clone the repository to.</li>

Run the Git clone command with the URL of the repository you want to clone to (from step 1 above).

 git clone "https://testproject.visualstudio.com/DefaultCollection/_git/Test"</span>

</li>

You'll be prompted for your username and password - enter the "alternate" ones you just created.</li>

Then you'll see a screen similar to this... I had no idea what it was at first & I thought I did something wrong, but then I realized it was the friendly Visual Studio logo!

[caption id="attachment_2395" align="aligncenter" width="300"]</a> TFS Git Cloning![/caption]</li>

Finally, you can start using local Git within Xamarin Studio as normal. When you need to do the first operation against the remote repository, you'll be prompted for your username and password - again this is the "alternate credentials" you created.  Once entered, Xamarin Studio will cache them, and you'll be off and running!</li>

</ol>

That's all there is to getting a TFS Online Git repository working with Xamarin Studio on the Mac ... the secret sauce really is just enabling alternate credentials with your Visual Studio Online account.  Once that's done... off to the races!


text:
from app import app
from flask import jsonify
from flask import render_template
from flask.ext.cors import cross_origin

@app.route('/')
@cross_origin()
def index():
  '''Serve the index.html file.'''

  return render_template('index.html')

@app.route('/status')
@cross_origin()
def statusEndpoint():
  '''Serving the status endpoint.'''

  s = {
        "online": True,
        "message":"Service for tracking statistics about HDX.",
        "CKAN_instance":"https://data.hdx.rwlabs.org/",
        "version":"v.0.1.2",
        "repository":"https://github.com/luiscape/hdx-monitor-funnel-stats"
      }

  return jsonify(s)


text: require ("./app/index.js");


text:
package org.hisp.dhis.trackedentity;

import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramTrackedEntityAttribute;

import java.util.List;

/**
 * @author Abyot Asalefew
 * @version $Id$
 */
public interface TrackedEntityAttributeService
{
    String ID = TrackedEntityAttributeService.class.getName();

    /**
     * Adds an {@link TrackedEntityAttribute}
     *
     * @param attribute The to TrackedEntityAttribute add.
     * @return A generated unique id of the added {@link TrackedEntityAttribute}
     * .
     */
    int addTrackedEntityAttribute( TrackedEntityAttribute attribute );

    /**
     * Deletes a {@link TrackedEntityAttribute}.
     *
     * @param attribute the TrackedEntityAttribute to delete.
     */
    void deleteTrackedEntityAttribute( TrackedEntityAttribute attribute );

    /**
     * Updates an {@link TrackedEntityAttribute}.
     *
     * @param attribute the TrackedEntityAttribute to update.
     */
    void updateTrackedEntityAttribute( TrackedEntityAttribute attribute );

    /**
     * Returns a {@link TrackedEntityAttribute}.
     *
     * @param id the id of the TrackedEntityAttribute to return.
     * @return the TrackedEntityAttribute with the given id
     */
    TrackedEntityAttribute getTrackedEntityAttribute( int id );

    /**
     * Returns the {@link TrackedEntityAttribute} with the given UID.
     *
     * @param uid the UID.
     * @return the TrackedEntityAttribute with the given UID, or null if no
     * match.
     */
    TrackedEntityAttribute getTrackedEntityAttribute( String uid );

    /**
     * Returns a {@link TrackedEntityAttribute} with a given name.
     *
     * @param name the name of the TrackedEntityAttribute to return.
     * @return the TrackedEntityAttribute with the given name, or null if no
     * match.
     */
    TrackedEntityAttribute getTrackedEntityAttributeByName( String name );

    /**
     * Returns a {@link TrackedEntityAttribute} with a given short name.
     *
     * @param name the short name of the TrackedEntityAttribute to return.
     * @return the TrackedEntityAttribute with the given short name, or null if no
     * match.
     */
    TrackedEntityAttribute getTrackedEntityAttributeByShortName( String name );

    /**
     * Returns a {@link TrackedEntityAttribute} with a given code.
     *
     * @param code The code of the TrackedEntityAttribute to return.
     * @return the TrackedEntityAttribute with the given code, or null if no match.
     */
    TrackedEntityAttribute getTrackedEntityAttributeByCode( String code );

    /**
     * Returns all {@link TrackedEntityAttribute}
     *
     * @return a List of all TrackedEntityAttribute, or an empty
     * List if there are no TrackedEntityAttributes.
     */
    List<TrackedEntityAttribute> getAllTrackedEntityAttributes();

    /**
     * Get attributes without groups
     *
     * @return List of attributes
     */
    List<TrackedEntityAttribute> getOptionalAttributesWithoutGroup();

    /**
     * Get attributes without groups
     *
     * @return List of attributes without group
     */
    List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutGroup();

    /**
     * Get attributes which are displayed in visit schedule
     *
     * @param displayOnVisitSchedule True/False value
     * @return List of attributes
     */
    List<TrackedEntityAttribute> getTrackedEntityAttributesByDisplayOnVisitSchedule(
        boolean displayOnVisitSchedule );

    /**
     * Get attributes which are displayed in visit schedule
     *
     * @return List of attributes
     */
    List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutProgram();

    /**
     * Get attributes which are displayed in visit schedule
     *
     * @return List of attributes
     */
    List<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList();

    /**
     * Validate scope of tracked entity attribute. Will return true if attribute is non-unique.
     *
     * @param trackedEntityAttribute TrackedEntityAttribute
     * @param value                  Value
     * @param trackedEntityInstance  TrackedEntityInstance - required if updating TEI
     * @param organisationUnit       OrganisationUnit - only required if org unit scoped
     * @param program                Program - only required if program scoped
     * @return null if valid, a message if not
     */
    String validateScope( TrackedEntityAttribute trackedEntityAttribute,
        String value, TrackedEntityInstance trackedEntityInstance, OrganisationUnit organisationUnit, Program program );

    /**
     * Validate value against tracked entity attribute value type.
     *
     * @param trackedEntityAttribute TrackedEntityAttribute
     * @param value                  Value
     * @return null if valid, a message if not
     */
    String validateValueType( TrackedEntityAttribute trackedEntityAttribute, String value );

    /**
     * Gets or adds a program tracked entity attribute for the given program and
     * attribute.
     *
     * @param programUid the program identifier.
     * @param attributeUid the tracked entity attribute identifier.
     * @return a program tracked entity attribute.
     */
    ProgramTrackedEntityAttribute getOrAddProgramTrackedEntityAttribute( String programUid, String attributeUid );

    /**
     * Returns a program tracked entity attribute. The program tracked entity
     * attribute itself will be transient and the associated program and tracked
     * entity attribute will be persistent.
     *
     * @param programUid the program identifier.
     * @param attributeUid the tracked entity attribute identifier.
     * @return a tracked entity attribute.
     */
    ProgramTrackedEntityAttribute getProgramTrackedEntityAttribute( String programUid, String attributeUid );
}


text:
package com.sap.prd.mobile.ios.mios;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

/**
 * Assures that the following required prerequisites are fulfilled:
 *

 *
Xcode version {@value #MIN_XCODE_VERSION} or higher is installed

 *

 *
 * @goal check-prerequisites
 *
 */
public class CheckPrerequisitesMojo extends AbstractXCodeMojo
{
  public final static String MIN_XCODE_VERSION = "4.4";

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException
  {
    try {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      PrintStream out = new PrintStream(bos, true, Charset.defaultCharset().name());
      int exitCode = Forker.forkProcess(out, new File("."), new String[] { "xcodebuild", "-version" });
      if (exitCode == 0) {
        String output = bos.toString(Charset.defaultCharset().name());
        DefaultArtifactVersion version = getVersion(output);
        String buildVersion = getBuildVersion(output);
        getLog().info("Using Xcode " + version + " " + buildVersion);
        checkVersions(version, buildVersion);
      }
      else {
        throw new MojoExecutionException("Could not get xcodebuild version (exit code = " + exitCode + ")");
      }
    }
    catch (IOException e) {
      throw new MojoExecutionException("Could not get xcodebuild version", e);
    }
  }

  private DefaultArtifactVersion getVersion(String output) throws MojoExecutionException
  {
    Pattern versionPattern = Pattern.compile("Xcode (\\d+(\\.\\d+)+)", Pattern.CASE_INSENSITIVE);
    Matcher versionMatcher = versionPattern.matcher(output);
    if (versionMatcher.find()) {
      return new DefaultArtifactVersion(versionMatcher.group(1));
    }
    throw new MojoExecutionException("Could not get xcodebuild version");
  }

  private String getBuildVersion(String output) throws MojoExecutionException
  {
    Pattern buildPattern = Pattern.compile("Build version (\\w+)", Pattern.CASE_INSENSITIVE);
    Matcher buildMatcher = buildPattern.matcher(output);
    if (buildMatcher.find()) {
      return buildMatcher.group(1);
    }
    throw new MojoExecutionException("Could not get xcodebuild build version");
  }

  private void checkVersions(DefaultArtifactVersion version, String buildVersion) throws MojoExecutionException
  {
    DefaultArtifactVersion minXcodeVersion = new DefaultArtifactVersion(MIN_XCODE_VERSION);
    if (version.compareTo(minXcodeVersion) < 0) {
      throw new MojoExecutionException("Xcode " + MIN_XCODE_VERSION + " (or higher) is required (installed: " + version
            + " " + buildVersion + ")");
    }
  }
}


text:
package core

import (
	_ "testing"
)


text:
B68FloatingLabelTextField
=========================

Swift implementation of the [Float Label Design Pattern](http://mattdsmith.com/float-label-pattern/) by Matt D. Smith as a sub call from UITextField

Implementing an input field for a device with limited screen estate is challenging. Matt has developed an pattern for combining a placeholder text wit a floating label if needed.

![Floating Label Animation Example](https://d13yacurqjgara.cloudfront.net/users/6410/screenshots/1254439/form-animation-_gif_.gif)

I implemented the pattern in SWIFT and enabled some of the internal propertiers in Xcode 6 Interface Builder (see screenshot)

![Screenshot](/xcode_screenshot.png)

####Exposed Properties
- Active Color: Text color of the floating label if focused
- Inactive Color: Text Color of the floating label if unfocused

### Installation

#### Manual
Just clone and add ```B68UIFloatLabelTextField.swift``` to your project.

#### CocoaPods
- Make sure that your CocoaPods version is >= 0.36: `pod --version`
- If not, update it: `sudo gem install cocoapods`
- `pod init` in you project root dir
- `nano Podfile`, add:

```
pod 'B68UIFloatLabelTextField', '~> 0.1.0'
use_frameworks!
```
- Save it: `ctrl-x`, `y`, `enter`
- `pod update`
- Open generated `.xcworkspace`

####Requirements
- iOS 7.0+ (8.0+ if you use CocoaPods)
- Xcode 6.3
- Swift 1.2

####License
MIT

Based on the Objectiv-C implementations from:
- [jverdi](https://github.com/jverdi/JVFloatLabeledTextField)
- [ArtSabintsev](https://github.com/ArtSabintsev/UIFloatLabelTextView)


text:
using System;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using WebGrease.Css.Extensions;
using RealtyStore.Models;

namespace RealtyStore.Infrastructure
{
    public class ApplicationUserManager : UserManager<ApplicationUser, string>
    {
        public ApplicationUserManager(IUserStore<ApplicationUser, string> store): base(store)
        {
        }

        public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
        {
            var manager = new ApplicationUserManager(new ApplicationUserStore(new ApplicationDbContext()));
            // Configure the application user manager
            manager.UserValidator = new UserValidator<ApplicationUser>(manager)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail = true
            };
            manager.PasswordValidator = new MinimumLengthValidator(8);

            return manager;
        }

        public override Task<IdentityResult> CreateAsync(ApplicationUser user)
        {
            user.RegistrationDate = DateTime.UtcNow;
            user.LastVisitDate = DateTime.UtcNow;

            return base.CreateAsync(user);
        }
    }
}


text:
module.exports = {
    extend: function(target,source,flag){
        for(var key in source){
            if(source.hasOwnProperty(key)){
                flag ?
                      (target[key] = source[key]) :
                      (target[key] === void 0 && (target[key] = source[key]));
            }
        }
        return target;
    },
    isType: function(obj,type){
        return Object.prototype.toString.call(obj) === '[object '+type+']';
    }
}


text:
package com.evolveum.midpoint.notifications.impl;

import com.evolveum.midpoint.model.api.context.EvaluatedAssignment;
import com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule;
import com.evolveum.midpoint.model.api.context.ModelContext;
import com.evolveum.midpoint.model.api.context.ModelState;
import com.evolveum.midpoint.model.api.hooks.ChangeHook;
import com.evolveum.midpoint.model.api.hooks.HookOperationMode;
import com.evolveum.midpoint.model.api.hooks.HookRegistry;
import com.evolveum.midpoint.model.impl.lens.EvaluatedAssignmentImpl;
import com.evolveum.midpoint.model.impl.lens.LensContext;
import com.evolveum.midpoint.model.impl.lens.LensFocusContext;
import com.evolveum.midpoint.notifications.api.NotificationManager;
import com.evolveum.midpoint.notifications.api.events.Event;
import com.evolveum.midpoint.notifications.api.events.ModelEvent;
import com.evolveum.midpoint.notifications.api.events.PolicyRuleEvent;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.DeltaSetTriple;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.LightweightIdentifierGenerator;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationPolicyActionType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * One of interfaces of the notifier to midPoint.
 *
 * Used to catch user-related events.
 *
 * @author mederly
 */
@Component
public class NotificationHook implements ChangeHook {

    private static final Trace LOGGER = TraceManager.getTrace(NotificationHook.class);

    private static final String HOOK_URI = SchemaConstants.NS_MODEL + "/notification-hook-3";

    @Autowired private LightweightIdentifierGenerator lightweightIdentifierGenerator;
    @Autowired private HookRegistry hookRegistry;
    @Autowired private NotificationManager notificationManager;
    @Autowired private NotificationFunctionsImpl notificationsUtil;

    @PostConstruct
    public void init() {
        hookRegistry.registerChangeHook(HOOK_URI, this);
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Notifier change hook registered.");
        }
    }

    @Override
    public HookOperationMode invoke(@NotNull ModelContext context, @NotNull Task task, @NotNull OperationResult result) {

        // todo in the future we should perhaps act in POSTEXECUTION state, but currently the clockwork skips this state
        if (context.getState() != ModelState.FINAL) {
            return HookOperationMode.FOREGROUND;
        }
        if (notificationManager.isDisabled()) {
            LOGGER.trace("Notifications are temporarily disabled, exiting the hook.");
            return HookOperationMode.FOREGROUND;
        }
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Notification change hook called with model context: " + context.debugDump());
        }
        if (context.getFocusContext() == null) {
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Focus context is null, exiting the hook.");
            }
            return HookOperationMode.FOREGROUND;
        }

        emitModelEvent(context, task, result);
        emitPolicyRulesEvents(context, task, result);

        return HookOperationMode.FOREGROUND;
    }

    private void emitPolicyRulesEvents(ModelContext<?> context, Task task, OperationResult result) {
        LensFocusContext<?> focusContext = (LensFocusContext<?>) context.getFocusContext();
        for (EvaluatedPolicyRule rule : focusContext.getPolicyRules()) {
            emitPolicyEventIfPresent(rule, context, task, result);
        }
        DeltaSetTriple<EvaluatedAssignmentImpl<?>> triple = ((LensContext<?>) context).getEvaluatedAssignmentTriple();
        if (triple != null) {
            for (EvaluatedAssignment<?> assignment : triple.getNonNegativeValues()) {
                for (EvaluatedPolicyRule rule : assignment.getAllTargetsPolicyRules()) {
                    emitPolicyEventIfPresent(rule, context, task, result);
                }
            }
        }
    }

    private void emitPolicyEventIfPresent(EvaluatedPolicyRule rule, ModelContext<?> context, Task task, OperationResult result) {
        if (rule.isTriggered()) {
            for (NotificationPolicyActionType notificationAction : rule.getEnabledActions(NotificationPolicyActionType.class)) {
                emitPolicyEvent(notificationAction, rule, context, task, result);
            }
        }
    }

    private void emitPolicyEvent(@SuppressWarnings("unused") NotificationPolicyActionType action, EvaluatedPolicyRule rule,
            ModelContext<?> context, Task task, OperationResult result) {
        PolicyRuleEvent ruleEvent = createRuleEvent(rule, context, task);
        notificationManager.processEvent(ruleEvent, task, result);
    }

    private void emitModelEvent(@NotNull ModelContext<?> context, @NotNull Task task, @NotNull OperationResult result) {
        PrismObject<?> object = getObject(context);
        if (object == null) {
            LOGGER.trace("Focus context object is null, not sending the notification.");
            return;
        }
        ModelEvent event = createModelEvent(object, context, task);
        notificationManager.processEvent(event, task, result);
    }

    private PrismObject getObject(@NotNull ModelContext context) {
        PrismObject object = context.getFocusContext().getObjectNew();
        if (object == null) {
            object = context.getFocusContext().getObjectOld();
        }
        return object;
    }

    @Override
    public void invokeOnException(@NotNull ModelContext context, @NotNull Throwable throwable, @NotNull Task task, @NotNull OperationResult result) {
        // todo implement this
    }

    @NotNull
    private PolicyRuleEvent createRuleEvent(EvaluatedPolicyRule rule, ModelContext<?> context, Task task) {
        PolicyRuleEvent ruleEvent = new PolicyRuleEvent(lightweightIdentifierGenerator, rule);
        setCommonEventProperties(getObject(context), task, context, ruleEvent);
        return ruleEvent;
    }

    @NotNull
    private ModelEvent createModelEvent(PrismObject<?> object, ModelContext<?> modelContext, Task task) {
        ModelEvent event = new ModelEvent(lightweightIdentifierGenerator, modelContext);
        setCommonEventProperties(object, task, modelContext, event);
        // TODO is this correct? it's not quite clear how we work with channel info in task / modelContext
        String channel = task.getChannel();
        if (channel == null) {
            channel = modelContext.getChannel();
        }
        event.setChannel(channel);
        return event;
    }

    private void setCommonEventProperties(PrismObject<?> object, Task task, ModelContext<?> modelContext, Event event) {
        if (task.getOwner() != null) {
            event.setRequester(new SimpleObjectRefImpl(notificationsUtil, task.getOwner().asObjectable()));
        } else {
            LOGGER.debug("No owner for task " + task + ", therefore no requester will be set for event " + event.getId());
        }

        // if no OID in object (occurs in 'add' operation), we artificially insert it into the object)
        if (object.getOid() == null && modelContext.getFocusContext() != null && modelContext.getFocusContext().getOid() != null) {
            object = object.clone();
            object.setOid(modelContext.getFocusContext().getOid());
        }
        event.setRequestee(new SimpleObjectRefImpl(notificationsUtil, (ObjectType) object.asObjectable()));
    }
}


text:
namespace EntityFramework.BulkLoad.Test
{
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;

    using EntityFramework.BulkLoad.Test.Model;

    using FluentAssertions;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using Ploeh.AutoFixture;

    [TestClass]
    public class BulkInsertTests
    {
        #region Static Fields

        private static string connectionString;

        #endregion

        #region Public Properties

        public TestContext TestContext { get; set; }

        #endregion

        #region Public Methods and Operators

        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
            connectionString = SqlTestUtils.CreateLocalDbConnectionString(testContext);
            DeploySampleDatabase(connectionString);
        }

        [TestMethod]
        public void BulkInsertTest()
        {
            var fixture = new Fixture();

            IEnumerable<SampleEntity> entities = fixture.CreateMany<SampleEntity>(2);

            var loader = new EntityBulkLoader(connectionString);
            loader.BulkInsert(entities, new SampleContext(connectionString));

            this.VerifyEntitiesWereInserted(entities);
        }

        #endregion

        #region Methods

        private static void DeploySampleDatabase(string destinationConnectionString)
        {
            Database.SetInitializer(new CreateDatabaseIfNotExists<SampleContext>());

            using (var context = new SampleContext(destinationConnectionString))
            {
                context.SampleEntities.Load();
            }
        }

        private void VerifyEntitiesWereInserted(IEnumerable<SampleEntity> expectedEntities)
        {
            using (var context = new SampleContext(connectionString))
            {
                List<SampleEntity> actualEntities = context.SampleEntities.ToList();

                actualEntities.Should().NotBeEmpty().And.HaveCount(expectedEntities.Count());

                //actualEntities.ShouldAllBeEquivalentTo(expectedEntities, options => options
                //    .Using<SampleEntity>(c => c.Subject.DateTime.Should().BeCloseTo(c.Subject.DateTime, 1000)));
            }
        }

        #endregion
    }
}


text:
using System.Collections.Generic;
using Cosmos.Logging.Sinks.File.Configurations;
using Cosmos.Logging.Sinks.File.Core.Extensions;
using Cosmos.Logging.Sinks.File.Filters.Navigators;

namespace Cosmos.Logging.Sinks.File.Filters {
    internal static class NavigationFilterProcessor {
        private static readonly RootNamespaceNavigation _root;
        private static readonly NamespaceNavigatorCache _cache;
        private static readonly Dictionary<int, OutputOptions> _optionsesCache;
        private static readonly Dictionary<int, EndValueNamespaceNavigationNode> _valueIndexedByRuleNameCache;

        static NavigationFilterProcessor() {
            _root = RootNamespaceNavigation.GetInstance();
            _cache = new NamespaceNavigatorCache(new NamespaceNavigationParser());
            _optionsesCache = new Dictionary<int, OutputOptions>();
            _valueIndexedByRuleNameCache = new Dictionary<int, EndValueNamespaceNavigationNode>();
        }

        internal static void SetOutputOption(string ruleName, OutputOptions options, string basePath) {
            if (!string.IsNullOrWhiteSpace(ruleName) &&
                !_optionsesCache.ContainsKey(ruleName.GetHashCode()) &&
                options.IsValid()) {
                _cache.Parse(basePath, options, out var value);
                _optionsesCache.Add(ruleName.GetHashCode(), options);
                _valueIndexedByRuleNameCache.Add(ruleName.GetHashCode(), value);
            }
        }

        public static IEnumerable<EndValueNamespaceNavigationNode> GetValues(string @namespace) {
            return _cache.Match(@namespace, out var ret) ? ret : null;
        }
    }
}


text:
package eagle.jfaster.org.container;

import eagle.jfaster.org.spi.Scope;
import eagle.jfaster.org.spi.Spi;

/**
 * Created by fangyanpeng1 on 2017/8/14.
 */
@Spi(scope = Scope.SINGLETON)
public interface Container {
    /**
     * start.
     */
    void start();

    /**
     * stop.
     */
    void stop();
}


text:
<?php
/**
 * corrio ok
 */
namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20151106113641 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");

        $this->addSql("CREATE TABLE plantel_establecimiento (id INT AUTO_INCREMENT NOT NULL, organizacion_id INT DEFAULT NULL, cargo_id INT DEFAULT NULL, te VARCHAR(50) DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, actualizado DATETIME NOT NULL, creado DATETIME NOT NULL, INDEX IDX_686FA49290B1019E (organizacion_id), INDEX IDX_686FA492813AC380 (cargo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
        $this->addSql("ALTER TABLE plantel_establecimiento ADD CONSTRAINT FK_686FA49290B1019E FOREIGN KEY (organizacion_id) REFERENCES organizacion_interna (id)");
        $this->addSql("ALTER TABLE plantel_establecimiento ADD CONSTRAINT FK_686FA492813AC380 FOREIGN KEY (cargo_id) REFERENCES cargo (id)");
//        $this->addSql("ALTER TABLE unidad_oferta DROP has_examen");
    }

    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");

        $this->addSql("DROP TABLE plantel_establecimiento");
//        $this->addSql("ALTER TABLE unidad_oferta ADD has_examen TINYINT(1) DEFAULT NULL");
    }
}


text:
/* Override some defaults */
html, body {
	background-color: #eee;
}
body {
	padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
}
.container > footer p {
	text-align: center; /* center align it with the container */
}
.container {
	width: 940px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
}

/* The white background content wrapper */
.container > .content {
	background-color: #fff;
	padding: 20px;
	margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
	border-radius: 0 0 6px 6px;
	box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* Page header tweaks */
.page-header {
  	background-color: #f5f5f5;
  	padding: 20px 20px 10px;
  	margin: -20px -20px 20px;
}

/* Give a quick and non-cross-browser friendly divider */
.content .span4 {
  	margin-left: 0;
  	padding-left: 19px;
  	border-left: 1px solid #eee;
}

.topbar .btn {
  	border: 0;
}

.nickname {
	color: #2288CA;
}

.scrollcontent {
	height: 500px;
	overflow-y: scroll;
}

.write-area {
	box-sizing: border-box;
	width: 100%;
	resize: none;
}

.userlist {
	padding-left: 13px;
}

#upload-modal {

}

#fileList {
    height: 160px;
    width: 525px;
    overflow-y: scroll;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fileitem {
    margin: 9px 0 0 0;
}

.filenamefield {
    text-size: 12px;
    width: 320px;
    padding-right: 10px;
    overflow-x: hidden;
}

.fileprogressfield {
    width: 110px;
    top: 0px
}

.filestatusfield {
    width: 70px;
    text-align: center;
}


text:
%% *****************************************************************************
%% CHAPTER: Architecture
%% *****************************************************************************
\chapter{Architecture}
\label{ARCH}

%% -----------------------------------------------------------------------------
%% INCLUDING SECTIONS
%% -----------------------------------------------------------------------------
\input{ch-architecture/arch-modules}
\input{ch-architecture/arch-processes}
\input{ch-architecture/arch-protocols}
\input{ch-architecture/arch-memory}
\input{ch-architecture/arch-primitive}


text:
namespace boost { namespace gil {

namespace detail {

template <typename T>
using get_view_t = typename T::view_t;

template <typename Images>
using images_get_views_t = mp11::mp_transform<get_view_t, Images>;

template <typename T>
using get_const_view_t = typename T::const_view_t;

template <typename Images>
using images_get_const_views_t = mp11::mp_transform<get_const_view_t, Images>;

struct recreate_image_fnobj
{
    using result_type = void;
    point<std::ptrdiff_t> const& _dimensions;
    unsigned _alignment;

    recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment)
        : _dimensions(dims), _alignment(alignment)
    {}

    template <typename Image>
    result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
};

template <typename AnyView>  // Models AnyViewConcept
struct any_image_get_view
{
    using result_type = AnyView;
    template <typename Image>
    result_type operator()(Image& img) const
    {
        return result_type(view(img));
    }
};

template <typename AnyConstView>  // Models AnyConstViewConcept
struct any_image_get_const_view
{
    using result_type = AnyConstView;
    template <typename Image>
    result_type operator()(Image const& img) const { return result_type{const_view(img)}; }
};

} // namespce detail

////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageModel
/// \brief Represents a run-time specified image. Note it does NOT model ImageConcept
///
/// Represents an image whose type (color space, layout, planar/interleaved organization, etc) can be specified at run time.
/// It is the runtime equivalent of \p image.
/// Some of the requirements of ImageConcept, such as the \p value_type alias cannot be fulfilled, since the language does not allow runtime type specification.
/// Other requirements, such as access to the pixels, would be inefficient to provide. Thus \p any_image does not fully model ImageConcept.
/// In particular, its \p view and \p const_view methods return \p any_image_view, which does not fully model ImageViewConcept. See \p any_image_view for more.
////////////////////////////////////////////////////////////////////////////////////////

template <typename Images>
class any_image : public make_variant_over<Images>::type
{
    using parent_t = typename make_variant_over<Images>::type;
public:
    using view_t = any_image_view<detail::images_get_views_t<Images>>;
    using const_view_t = any_image_view<detail::images_get_const_views_t<Images>>;
    using x_coord_t = std::ptrdiff_t;
    using y_coord_t = std::ptrdiff_t;
    using point_t = point<std::ptrdiff_t>;

    any_image() = default;
    any_image(any_image const& img) : parent_t((parent_t const&)img) {}

    template <typename Image>
    explicit any_image(Image const& img) : parent_t(img) {}

    template <typename Image>
    explicit any_image(Image& img, bool do_swap) : parent_t(img, do_swap) {}

    template <typename OtherImages>
    any_image(any_image<OtherImages> const& img)
        : parent_t((typename make_variant_over<OtherImages>::type const&)img)
    {}

    any_image& operator=(any_image const& img)
    {
        parent_t::operator=((parent_t const&)img);
        return *this;
    }

    template <typename Image>
    any_image& operator=(Image const& img)
    {
        parent_t::operator=(img);
        return *this;
    }

    template <typename OtherImages>
    any_image& operator=(any_image<OtherImages> const& img)
    {
            parent_t::operator=((typename make_variant_over<OtherImages>::type const&)img);
            return *this;
    }

    void recreate(const point_t& dims, unsigned alignment=1)
    {
        apply_operation(*this, detail::recreate_image_fnobj(dims, alignment));
    }

    void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
    {
        recreate({ width, height }, alignment);
    }

    std::size_t num_channels() const
    {
        return apply_operation(*this, detail::any_type_get_num_channels());
    }

    point_t dimensions() const
    {
        return apply_operation(*this, detail::any_type_get_dimensions());
    }

    x_coord_t width()  const { return dimensions().x; }
    y_coord_t height() const { return dimensions().y; }
};

///@{
/// \name view, const_view
/// \brief Get an image view from a run-time instantiated image

/// \ingroup ImageModel

/// \brief Returns the non-constant-pixel view of any image. The returned view is any view.
/// \tparam Types Models ImageVectorConcept
template <typename Types>
BOOST_FORCEINLINE
auto view(any_image<Types>& img) -> typename any_image<Types>::view_t
{
    using view_t = typename any_image<Types>::view_t;
    return apply_operation(img, detail::any_image_get_view<view_t>());
}

/// \brief Returns the constant-pixel view of any image. The returned view is any view.
/// \tparam Types Models ImageVectorConcept
template <typename Types>
BOOST_FORCEINLINE
auto const_view(any_image<Types> const& img) -> typename any_image<Types>::const_view_t
{
    using view_t = typename any_image<Types>::const_view_t;
    return apply_operation(img, detail::any_image_get_const_view<view_t>());
}
///@}

}}  // namespace boost::gil

#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif

#endif


text:
/**
 *
 */
package org.dhs.chrislee;

import java.util.HashSet;

import javax.mail.Message;
import javax.mail.MessagingException;

/**
 * The Class SubjectBasedMessageEvaluationCallback.
 *
 * @author chris
 */
public class SubjectBasedMessageEvaluationCallback implements
		MessageEvaluationCallback {

	private HashSet<String> subjects;
	private boolean invert = false;

	/**
	 * Instantiates a new subject based message evaluation callback.
	 */
	public SubjectBasedMessageEvaluationCallback() {
		subjects = new HashSet<String>();
	}

	/**
	 * Adds a subject.
	 *
	 * @param subject the subject
	 */
	public void addSubject(String subject) {
		subjects.add(subject);
	}

	/**
	 * Sets the invert.
	 *
	 * @param invert flag to invert the match
	 */
	public void setInvert(boolean invert) {
		this.invert = invert;
	}

	/**
	 * test the Message to see if it matches one of the configured subjects
	 *
	 * @param m Message to evaluate
	 */
	public boolean isEncryptableMessage(Message m) throws MessagingException {
		String subject = m.getSubject();
		for(String sub:subjects) {
			if(subject.contains(sub)) {
				return !this.invert;
			}
		}
		return this.invert;
	}

}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>Class Echosign\RequestBuilders\Widget\WidgetFileInfo | Echosign V3</title>

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

		Overview

Namespaces

						Echosign

						Abstracts

						Creators

						Exceptions

						Interfaces

						RequestBuilders

						Agreement

						LibraryDocument

						Widget

						Requests

						Responses

						Transports

Classes

CounterSignerInfo

PhoneInfo

WidgetCompletionInfo

WidgetCreationInfo

WidgetFileInfo

WidgetMergefieldInfo

WidgetSecurityOption

WidgetSignerSecurityOption

WidgetURLFileInfo

WidgetVaultingInfo

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

				Namespace

Class

Class WidgetFileInfo

Class FileInfo

Echosign\RequestBuilders\Widget\WidgetFileInfo
			 implements
				Echosign\Interfaces\RequestBuilder

		Namespace: Echosign\RequestBuilders\Widget

		Package: Echosign\RequestBuilders\Widget

			Located at RequestBuilders/Widget/WidgetFileInfo.php

Methods summary

			 public

		#
		setDocumentURL(  <var>$name</var>,  <var>$url</var>, string <var>$mimeType</var> = null  )

Parameters

<var>$name</var>

<var>$url</var>

<var>$mimeType</var>

Returns

$this

			 public

			array

		#
		toArray( )

Returns

					array

Implementation of

Echosign\Interfaces\RequestBuilder::toArray()

			 public

			string

		#
		getLibraryDocumentId( )

Returns

					string

			 public

		#
		setLibraryDocumentId( string <var>$libraryDocumentId</var> )

Parameters

<var>$libraryDocumentId</var>

Returns

$this

			 public

			string

		#
		getTransientDocumentId( )

Returns

					string

			 public

		#
		setTransientDocumentId( string <var>$transientDocumentId</var> )

Parameters

<var>$transientDocumentId</var>

Returns

$this

			 public

			string

		#
		getLibraryDocumentName( )

Returns

					string

			 public

		#
		setLibraryDocumentName( string <var>$libraryDocumentName</var> )

Parameters

<var>$libraryDocumentName</var>

Returns

$this

			 public

			Echosign\RequestBuilders\Widget\WidgetURLFileInfo

		#
		getDocumentURL( )

Returns

					Echosign\RequestBuilders\Widget\WidgetURLFileInfo

Properties summary

			public
			string

				<var>$libraryDocumentId</var>

				#

			public
			string

				<var>$transientDocumentId</var>

				#

			public
			string

				<var>$libraryDocumentName</var>

				#

			protected
			Echosign\RequestBuilders\Widget\WidgetURLFileInfo

				<var>$documentURL</var>

				#

		Echosign V3 API documentation generated by ApiGen


text:
package br.github.gnomex.rmi.crypt;

import java.rmi.Remote;

public interface IRMIServer extends Remote {

	public abstract String getMessage() throws Exception;

}


text:
CREATE TABLE [Message] (
	MessageId uniqueidentifier not null,
	PatientId uniqueidentifier not null,
	FromAccountId uniqueidentifier not null,
	SentTimestamp datetime not null,
	Body nvarchar(max));
CREATE TABLE [MessageRecipient] (
	MessageRecipientId uniqueidentifier not null,
	MessageId uniqueidentifier not null,
	RecipientAccountId uniqueidentifier not null,
	ReadTimestamp datetime);

ALTER TABLE [Message] ADD CONSTRAINT [PK_Message] PRIMARY KEY (MessageId);
ALTER TABLE [Message] ADD CONSTRAINT [DF_Message_MessageId] DEFAULT (newid()) FOR MessageId;
ALTER TABLE [Message] ADD CONSTRAINT [FK_Message_PatientId] FOREIGN KEY (PatientId) REFERENCES Patient (PatientId);
ALTER TABLE [Message] ADD CONSTRAINT [FK_Message_FromAccountId] FOREIGN KEY (FromAccountId) REFERENCES Account (AccountId);

ALTER TABLE [MessageRecipient] ADD CONSTRAINT [PK_MessageRecipient] PRIMARY KEY (MessageRecipientId);
ALTER TABLE [MessageRecipient] ADD CONSTRAINT [DF_MessageRecipient_MessageRecipientId] DEFAULT (newid()) FOR MessageRecipientId;
ALTER TABLE [MessageRecipient] ADD CONSTRAINT [FK_MessageRecipient_Message] FOREIGN KEY (MessageId) REFERENCES [Message] (MessageId);
ALTER TABLE [MessageRecipient] ADD CONSTRAINT [FK_MessageRecipient_RecipientAccountId] FOREIGN KEY (RecipientAccountId) REFERENCES Account (AccountId);


text:
import configparser
import logging
from os.path import join
import random
import time

import pyautogui

from .constants import package_root, guild_wars_config as config
from . import battle_result
from .summon import SummonSelector
from .components import Button, AppWindow

logger = logging.getLogger(__name__)

attack = Button("attack.png", config["attack"])
reload_ = Button("reload.png", config["reload"])
back = Button("back2.png", config["back"])
character1 = Button("character.png", config["character1"])
character2 = Button("character.png", config["character2"])
character3 = Button("character.png", config["character3"])
character4 = Button("character.png", config["character4"])
characters_map = {
    "character1": character1,
    "character2": character2,
    "character3": character3,
    "character4": character4,
}
skill1 = Button("skill.png", config["skill1"])
skill2 = Button("skill.png", config["skill2"])
skill3 = Button("skill.png", config["skill3"])
skill4 = Button("skill.png", config["skill4"])
skills_map = [
    0,
    skill1,
    skill2,
    skill3,
    skill4,
]

battle_summon_list = Button("battle_summon_list.png", config["battle summon list"])
battle_summon1 = Button("battle_summon_list.png", config["battle summon 1"])
battle_summon2 = None
battle_summon3 = None
battle_summon4 = None
battle_summon5 = None
battle_summon6 = Button("battle_summon_list.png", config["battle summon 6"])
summons_map = [
    0,
    battle_summon1,
    battle_summon2,
    battle_summon3,
    battle_summon4,
    battle_summon5,
    battle_summon6,
]
battle_summon_confirm = Button("ok3.png", config["battle summon confirm"])

cell = Button("guildwars_ex_cell.png", config["cell"], False)
ex_plus = Button("guildwars_ex_plus.png", config["ex+"])
ok = Button("ok1.png")
summon = SummonSelector(config["summon name"])

script = configparser.ConfigParser()
script.read(join(package_root, "guild_wars.ini"))

auto = Button("auto.png", config["auto"])

def wait_battle_start(sleep_time=0.5):
    while True:
        time.sleep(sleep_time)
        found = AppWindow.locate_on(attack.path, (1 / 2, 1 / 3, 1 / 2, 2 / 3))
        if found is not None:
            return

def cast(stage):
    logger.info(stage)
    try:
        commands = script[stage]
    except KeyError:
        commands = []

    skill_count = 0
    n = len(commands)
    for i, command in enumerate(commands):
        if "character" in command:
            skill_count += use_character(command, commands[command])
        elif command == "summon":
            use_summon(int(commands[command]))
            skill_count += 1

        if i < n - 1 and "character" in command:
            back.click()
        time.sleep(random.random() * 0.2)
    attack.click()
    # ratio = 2.4
    # TODO: attention to this 2.4 or 2.5 is good
    # If lag, set ration to 3
    # time.sleep(skill_count * ratio + random.random() * 0.5)

def use_character(character, behavior):
    characters_map[character].click()
    skills = [int(skill) for skill in behavior.split(",")]
    count = 0
    for skill in skills:
        skills_map[skill].click()
        time.sleep(random.random() * 0.2)
        count += 1
    return count

def use_summon(number):
    battle_summon_list.click()
    summons_map[number].click()
    battle_summon_confirm.click(partition=8)
    time.sleep(random.random() * 0.2)

def is_finished():
    found = AppWindow.locate_on(ok.path, (0, 1 / 2, 1, 1 / 4))
    if found is not None:
        return True
    return False

# XXX: need to rewrite becuase EXTREME+ mechanism changed
def activate():
    pyautogui.PAUSE = 1.5

    count = 1
    while True:
        logger.info(f"execution times: {count}")

        if count == 1:
            chose_enemy()

        # chose summon
        summon.activate(True)

        wait_battle_start()
        # battle start
        # round by round
        for times in range(1, 6):
            cast(f"round {times}")

            # click auto
            if times == 1:
                # logger.info('click auto')
                # auto.click(partition=12)
                time.sleep(20 + random.random() * 0.2)
            elif times == 2:
                logger.info("wait 10 sec")
                time.sleep(15)
            else:
                time.sleep(2)

            reload_.click()
            # time.sleep(3)
            time.sleep(4)

            if is_finished():
                break

            if times == 1 and config["assault time"] == "yes":
                time.sleep(15)

            if is_finished():
                break

        battle_result.activate()

        count += 1

def chose_enemy():
    time.sleep(1)
    pyautogui.click(1671, 232)
    pyautogui.scroll(-10)
    logger.info("click cell")
    cell.click(partition=8)
    time.sleep(0.75)
    logger.info("click ex+")
    ex_plus.click(partition=10)


text:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:orientation="vertical"
    android:background="#37474f"
    android:elevation="4dp"
	android:showDividers="middle"
	tools:ignore="Overdraw">

	<Button
		android:id="@+id/bSettings"
		style="?android:buttonBarButtonStyle"
		android:textColor="?android:textColorPrimary"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:drawableLeft="@drawable/ic_menu_preferences"
		android:drawablePadding="16dp"
		android:gravity="left|center_vertical"
		android:text="@string/menuPengaturan"
        android:textAppearance="?android:attr/textAppearanceMedium"
		android:textSize="16sp"
        android:clickable="true"
        android:elegantTextHeight="true" />

	<Button
		android:id="@+id/bHelp"
		style="?android:buttonBarButtonStyle"
		android:textColor="?android:textColorPrimary"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:drawableLeft="@drawable/ic_menu_help"
		android:drawablePadding="16dp"
		android:gravity="left|center_vertical"
		android:text="@string/menuBantuan"
        android:textAppearance="?android:attr/textAppearanceMedium"
		android:textSize="16sp"
        android:clickable="true" />

</LinearLayout>


text:
using System;

using System.Xml.Serialization;

using DAQ.Environment;
using DAQ.Pattern;

using ScanMaster.Acquire.Patterns;
using ScanMaster.Acquire.Plugin;

namespace ScanMaster.Acquire.Plugins
{
    /// <summary>
    /// Plugin for controlling the crazy box that accepts two ttl pulses and generates 4 possible analog output levels depending on their states.
    /// There are two ttl lines, and each one is pulsed on twice. The settings are ttlXStartY and ttlXDurationY (X=1,2; Y=1,2).
    /// </summary>
    [Serializable]
    public class AomLevelControlPatternPlugin : SupersonicPGPluginBase
    {
        [NonSerialized]
        private AomLevelControlPatternBuilder scanPatternBuilder;

        protected override void InitialiseCustomSettings()
        {
            settings["ttl1Start1"] = 300;
            settings["ttl1Duration1"] = 200;
            settings["ttl1Start2"] = 1200;
            settings["ttl1Duration2"] = 200;
            settings["ttl2Start1"] = 300;
            settings["ttl2Duration1"] = 200;
            settings["ttl2Start2"] = 1200;
            settings["ttl2Duration2"] = 200;
        }

        protected override void DoAcquisitionStarting()
        {
            scanPatternBuilder = new AomLevelControlPatternBuilder();
        }

        protected override IPatternSource GetScanPattern()
        {
            scanPatternBuilder.Clear();
            scanPatternBuilder.ShotSequence(
                (int)settings["padStart"],
                (int)settings["sequenceLength"],
                (int)settings["padShots"],
                (int)settings["flashlampPulseInterval"],
                (int)settings["valvePulseLength"],
                (int)settings["valveToQ"],
                (int)settings["flashToQ"],
                (int)settings["ttl1Start1"],
                (int)settings["ttl1Duration1"],
                (int)settings["ttl1Start2"],
                (int)settings["ttl1Duration2"],
                (int)settings["ttl2Start1"],
                (int)settings["ttl2Duration1"],
                (int)settings["ttl2Start2"],
                (int)settings["ttl2Duration2"],
                GateStartTimePGUnits
                );

            scanPatternBuilder.BuildPattern(((int)settings["padShots"] + 1) * (int)settings["sequenceLength"]
                * (int)settings["flashlampPulseInterval"]);

            return scanPatternBuilder;
        }
    }
}


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudresourcemanager.v3.model;

/**
 * An EffectiveTag represents a tag that applies to a resource during policy evaluation. Tags can be
 * either directly bound to a resource or inherited from its ancestor. EffectiveTag contains the
 * name and namespaced_name of the tag value and tag key, with additional fields of `inherited` to
 * indicate the inheritance status of the effective tag.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Resource Manager API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class EffectiveTag extends com.google.api.client.json.GenericJson {

  /**
   * Indicates the inheritance status of a tag value attached to the given resource. If the tag
   * value is inherited from one of the resource's ancestors, inherited will be true. If false, then
   * the tag value is directly attached to the resource, inherited will be false.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean inherited;

  /**
   * The namespaced_name of the TagKey. Now only supported in the format of
   * `{organization_id}/{tag_key_short_name}`. Other formats will be supported when we add non-org
   * parented tags.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String namespacedTagKey;

  /**
   * Namespaced name of the TagValue. Now only supported in the format
   * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. Other formats will be
   * supported when we add non-org parented tags.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String namespacedTagValue;

  /**
   * The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String tagKey;

  /**
   * Resource name for TagValue in the format `tagValues/456`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String tagValue;

  /**
   * Indicates the inheritance status of a tag value attached to the given resource. If the tag
   * value is inherited from one of the resource's ancestors, inherited will be true. If false, then
   * the tag value is directly attached to the resource, inherited will be false.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getInherited() {
    return inherited;
  }

  /**
   * Indicates the inheritance status of a tag value attached to the given resource. If the tag
   * value is inherited from one of the resource's ancestors, inherited will be true. If false, then
   * the tag value is directly attached to the resource, inherited will be false.
   * @param inherited inherited or {@code null} for none
   */
  public EffectiveTag setInherited(java.lang.Boolean inherited) {
    this.inherited = inherited;
    return this;
  }

  /**
   * The namespaced_name of the TagKey. Now only supported in the format of
   * `{organization_id}/{tag_key_short_name}`. Other formats will be supported when we add non-org
   * parented tags.
   * @return value or {@code null} for none
   */
  public java.lang.String getNamespacedTagKey() {
    return namespacedTagKey;
  }

  /**
   * The namespaced_name of the TagKey. Now only supported in the format of
   * `{organization_id}/{tag_key_short_name}`. Other formats will be supported when we add non-org
   * parented tags.
   * @param namespacedTagKey namespacedTagKey or {@code null} for none
   */
  public EffectiveTag setNamespacedTagKey(java.lang.String namespacedTagKey) {
    this.namespacedTagKey = namespacedTagKey;
    return this;
  }

  /**
   * Namespaced name of the TagValue. Now only supported in the format
   * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. Other formats will be
   * supported when we add non-org parented tags.
   * @return value or {@code null} for none
   */
  public java.lang.String getNamespacedTagValue() {
    return namespacedTagValue;
  }

  /**
   * Namespaced name of the TagValue. Now only supported in the format
   * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. Other formats will be
   * supported when we add non-org parented tags.
   * @param namespacedTagValue namespacedTagValue or {@code null} for none
   */
  public EffectiveTag setNamespacedTagValue(java.lang.String namespacedTagValue) {
    this.namespacedTagValue = namespacedTagValue;
    return this;
  }

  /**
   * The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.
   * @return value or {@code null} for none
   */
  public java.lang.String getTagKey() {
    return tagKey;
  }

  /**
   * The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.
   * @param tagKey tagKey or {@code null} for none
   */
  public EffectiveTag setTagKey(java.lang.String tagKey) {
    this.tagKey = tagKey;
    return this;
  }

  /**
   * Resource name for TagValue in the format `tagValues/456`.
   * @return value or {@code null} for none
   */
  public java.lang.String getTagValue() {
    return tagValue;
  }

  /**
   * Resource name for TagValue in the format `tagValues/456`.
   * @param tagValue tagValue or {@code null} for none
   */
  public EffectiveTag setTagValue(java.lang.String tagValue) {
    this.tagValue = tagValue;
    return this;
  }

  @Override
  public EffectiveTag set(String fieldName, Object value) {
    return (EffectiveTag) super.set(fieldName, value);
  }

  @Override
  public EffectiveTag clone() {
    return (EffectiveTag) super.clone();
  }

}