text:
/* line 1, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single {
  background-color: #f0f0f0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0px;
}
/* line 6, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single:focus {
  outline: 0;
}
/* line 10, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #444;
  line-height: 34px;
}
/* line 15, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single .select2-selection__clear {
  cursor: pointer;
  float: right;
  font-weight: bold;
}
/* line 21, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #999;
}
/* line 25, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  position: absolute;
  top: 1px;
  right: 1px;
  width: 20px;
}
/* line 35, ../scss/theme/default/_single.scss */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #888 transparent transparent transparent;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  height: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -2px;
  position: absolute;
  top: 50%;
  width: 0;
}
/* line 56, ../scss/theme/default/_single.scss */
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
  float: left;
}
/* line 60, ../scss/theme/default/_single.scss */
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
  left: 1px;
  right: auto;
}
/* line 68, ../scss/theme/default/_single.scss */
.select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: #eee;
  cursor: default;
}
/* line 72, ../scss/theme/default/_single.scss */
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
  display: none;
}
/* line 81, ../scss/theme/default/_single.scss */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #888 transparent;
  border-width: 0 4px 5px 4px;
}
/* line 1, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple {
  background-color: #f0f0f0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0px;
  cursor: text;
}
/* line 7, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  box-sizing: border-box;
  list-style: none;
  margin: 0;
  padding: 0 5px;
  width: 100%;
}
/* line 15, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
  color: #999;
  margin-top: 5px;
  float: left;
}
/* line 23, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__clear {
  cursor: pointer;
  float: right;
  font-weight: bold;
  margin-top: 5px;
  margin-right: 10px;
}
/* line 31, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  color: #666;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: default;
  float: left;
  margin-right: 5px;
  margin-top: 5px;
  padding: 3px 5px 2px;
}
/* line 46, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #999;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  margin-right: 2px;
}
/* line 55, ../scss/theme/default/_multiple.scss */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #333;
}
/* line 63, ../scss/theme/default/_multiple.scss */
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder {
  float: right;
}
/* line 67, ../scss/theme/default/_multiple.scss */
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
  margin-left: 5px;
  margin-right: auto;
}
/* line 72, ../scss/theme/default/_multiple.scss */
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
  margin-left: 2px;
  margin-right: auto;
}
/* line 80, ../scss/theme/default/_multiple.scss */
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border: 1px solid #CCC;
  outline: 0;
}
/* line 87, ../scss/theme/default/_multiple.scss */
.select2-container--default.select2-container--disabled .select2-selection--multiple {
  background-color: #eee;
  cursor: default;
}
/* line 92, ../scss/theme/default/_multiple.scss */
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
  display: none;
}
/* line 6, ../../../scss/theme/default/layout.scss */
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* line 13, ../../../scss/theme/default/layout.scss */
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
/* line 20, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #DDD;
}
/* line 22, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  outline: 0;
}
/* line 29, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-search--inline .select2-search__field {
  background: transparent;
  border: none;
  outline: 0;
}
/* line 36, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results > .select2-results__options {
  max-height: 200px;
  overflow-y: auto;
}
/* line 42, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option[role=group] {
  padding: 0;
}
/* line 46, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option[aria-disabled=true] {
  color: #999;
}
/* line 50, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #EEE;
}
/* line 54, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option {
  padding-left: 1em;
}
/* line 57, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
  padding-left: 0;
}
/* line 61, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
  margin-left: -1em;
  padding-left: 2em;
}
/* line 65, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
  margin-left: -2em;
  padding-left: 3em;
}
/* line 69, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
  margin-left: -3em;
  padding-left: 4em;
}
/* line 73, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
  margin-left: -4em;
  padding-left: 5em;
}
/* line 77, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
  margin-left: -5em;
  padding-left: 6em;
}
/* line 88, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #4a89dc;
  color: white;
}
/* line 93, ../../../scss/theme/default/layout.scss */
.select2-container--default .select2-results__group {
  cursor: default;
  display: block;
  padding: 6px;
}


text:
Utilities
=========
chiron-here.reg
---------------
Runs Chiron on any directory just by right-clicking on it.

1. UPDATE SDLSDK LOCATION!

  chiron-here.reg assumes that you unzipped sdl-sdk.zip into C:\sdl-sdk. If this
  is not the case, open chiron-here.reg in your editor of choice (notepad will do)
  and change the two paths to point to your sdl-sdk location.

2. INSTALL

  Double click on chiron-here.reg file. It will prompt you to make sure you trust
  the source of the .reg file; click *Yes* if you want to install it. That's it! No
  reboot required.

3. USAGE

  You will now have two extra options when you right-click on a folder: "Start
  Chiron Here" and "Generate XAP Here".

  "Start Chiron Here" will run Chiron on port 2060at the directory you right-clicked
  on. Then navigate to http://localhost:2060 with your web-browser.

  "Generate XAP Here" will generate a XAP file to disk to deployment. The
  directory you right-clicked on will appear as a .xap file in the same parent
  directory.

XAP HTTP Handler
================

Chiron.exe contains the XapHttpHandler type, which is a HttpHandler to enable
IIS or the ASP.NET Development WebServer (Cassini) to auto-xap any directory
when requested with the .xap extension, just like Chiron does.

xap-http-handler\XapHttpHandler.sln is a example of this working in action. Make
sure to run xap-http-handler\update.bat first, so the DLR binaries are copied to
the website.

To set it up for your own project:

Visual Studio ASP.NET Development WebServer (Cassini)
-----------------------------------------------------
1. Create a ASP.NET Website project
2. Add the binaries in the bin folder to a Bin folder inside the website.
3. Copy xap-http-handler\XapHttpHandler.SampleSite\web.config to your app

IIS
---
Works the same as above; just move your project to IIS.

redpajama_set_name: RedPajamaGithub


text:
<!-- Sorted alphabetically. -->

* Brett Morgan, https://github.com/domesticmouse
* Chris Broadfoot, https://github.com/broady
* Mihai Preda, https://github.com/preda


text:
package org.codehaus.mojo.unix.io;

import org.codehaus.mojo.unix.util.*;

import java.util.*;

/**
 * @author Trygve Laugstøl
 */
public class IncludeExcludeFilter
{
    public static final PathExpression[] DEFAULT_EXCLUDES = new PathExpression[]{
        new PathExpression( "**/*~" ),
        new PathExpression( "**/#*#" ),
        new PathExpression( "**/.#*" ),
        new PathExpression( "**/%*%" ),
        new PathExpression( "**/._*" ),
        new PathExpression( "**/CVS" ),
        new PathExpression( "**/CVS/**" ),
        new PathExpression( "**/.cvsignore" ),
        new PathExpression( "**/SCCS" ),
        new PathExpression( "**/SCCS/**" ),
        new PathExpression( "**/vssver.scc" ),
        new PathExpression( "**/.svn" ),
        new PathExpression( "**/.svn/**" ),
        new PathExpression( "**/.DS_Store" ),
        new PathExpression( "**/META-INF" ),
        new PathExpression( "**/META-INF/**" )
    };

    private final Collection<PathExpression> includes;
    private final Collection<PathExpression> excludes;

    IncludeExcludeFilter( Collection<PathExpression> includes,
                          Collection<PathExpression> excludes )
    {
        this.includes = includes;
        this.excludes = excludes;
    }

    /*
    public boolean includeFile( FileSelectInfo fileSelectInfo )
        throws Exception
    {
        FileObject fileObject = fileSelectInfo.getFile();
        FileName name = fileObject.getName();

        if ( fileType != null && fileObject.getType() != fileType )
        {
            return false;
        }

        String relativePath = root.getRelativeName( name );

        return matches( relativePath );
    }
    */

    public boolean matches( RelativePath path )
    {
        // -----------------------------------------------------------------------
        // Make sure that the relative path always starts with a leading slash as
        // people want to match against "**/.svn**" which would not match the
        // root .svn directory.
        // -----------------------------------------------------------------------

        String s = path.asAbsolutePath( "/" );

        boolean include;

        if ( includes.size() == 0 )
        {
            // Default to including the file is the list of includes is empty
            include = true;

            include = matchesAny( include, false, s, excludes );
        }
        else
        {
            // Default to not including the file if the list of includes is non-empty
            include = false;

            include = matchesAny( include, true, s, includes );

            include = matchesAny( include, false, s, excludes );
        }

        return include;
    }

    private boolean matchesAny( boolean include, boolean returnIfMatch, String relative, Iterable<PathExpression> pathExpressions )
    {
        for ( PathExpression pathExpression : pathExpressions )
        {
            if ( pathExpression.matches( relative ) )
            {
                return returnIfMatch;
            }
        }

        return include;
    }

    public static class TemplateIncludeExcludeFilter
    {
        private List<PathExpression> includes = new ArrayList<PathExpression>( 100 );
        private List<PathExpression> excludes = new ArrayList<PathExpression>( 100 );
        private boolean addDefaultExcludes = true;

        private TemplateIncludeExcludeFilter()
        {
        }

        public TemplateIncludeExcludeFilter noDefaultExcludes()
        {
            addDefaultExcludes = false;

            return this;
        }

        public TemplateIncludeExcludeFilter addInclude( PathExpression include )
        {
            includes.add( include );

            return this;
        }

        public TemplateIncludeExcludeFilter addStringIncludes( Iterable<String> includes )
        {
            if ( includes == null )
            {
                return this;
            }

            for ( String include : includes )
            {
                this.includes.add( new PathExpression( include ) );
            }

            return this;
        }

        public TemplateIncludeExcludeFilter addExclude( PathExpression exclude )
        {
            excludes.add( exclude );

            return this;
        }

        public TemplateIncludeExcludeFilter addStringExcludes( Iterable<String> excludes )
        {
            if ( excludes == null )
            {
                return this;
            }

            for ( String exclude : excludes )
            {
                this.excludes.add( new PathExpression( exclude ) );
            }

            return this;
        }

        public IncludeExcludeFilter create()
        {
            if ( addDefaultExcludes )
            {
                excludes.addAll( Arrays.asList( DEFAULT_EXCLUDES ) );
            }

            return new IncludeExcludeFilter( includes, excludes );
        }
    }

    public static TemplateIncludeExcludeFilter includeExcludeFilter()
    {
        return new TemplateIncludeExcludeFilter();
    }
}


text:
import { NgModule, APP_INITIALIZER } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { NgxBarcodeModule } from 'ngx-barcode';
import { QRCodeModule } from 'angular2-qrcode';
import { QueueService } from '../shared/services/queue.service';
import { UserActions } from '../shared/actions/user.action';
import { HttpService } from '../shared/services/http.service';
import { NetworkService } from '../shared/services/network.service';
import { UserService } from '../shared/services/user.service';
import { ObjectHelper } from "./helpers/object.helper";
import { StorageService } from "./services/storage.service";
import { DictionaryService} from "./services/dictionary.service"
import * as localforage from 'localforage';
import Quagga from 'quagga';

export function initQueueService(queueService: QueueService): any {
  return () => {
    return queueService.load();
  }
}

// export function initDictionaryService(dictionaryService: DictionaryService): any {
//   return () => {
//     return dictionaryService.initDictionary();
//   }
// }

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        NgxBarcodeModule,
        QRCodeModule,
    ],
    providers: [
      { provide: 'localforage', useValue: localforage },
      { provide: 'Quagga', useValue: Quagga },
      UserActions,
      HttpService,
      UserService,
      NetworkService,
      StorageService,
      DictionaryService,
      ObjectHelper,
      QueueService,
      {
        provide: APP_INITIALIZER,
        useFactory: initQueueService,
        deps: [QueueService],
        multi: true
      },
      // {
      //   provide: APP_INITIALIZER,
      //   useFactory: initDictionaryService,
      //   deps: [DictionaryService],
      //   multi: true
      // }
    ],
    exports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        NgxBarcodeModule,
        QRCodeModule,
    ]
})
export class SharedModule {}


text:
require 'chefspec'
require 'chefspec/berkshelf'
ChefSpec::Coverage.start! do
  add_filter( /memcached/ )
  add_filter( /nginx/ )
  add_filter( /ohai/ )
  add_filter( /php/ )
end

RSpec.configure do |config|
  # Specify the path for Chef Solo to find cookbooks
  # config.cookbook_path = '/var/cookbooks'

  # Specify the path for Chef Solo to find roles
  # config.role_path = '/var/roles'

  # Specify the Chef log_level (default: :warn)
  # config.log_level = :debug

  # Specify the path to a local JSON file with Ohai data
  # config.path = 'ohai.json'

  # Specify the operating platform to mock Ohai data from
  config.platform = 'freebsd'

  # Specify the operating version to mock Ohai data from
  config.version = '10.0'
end


text:
package daemonset

import (
	"context"

	apps "k8s.io/api/apps/v1"
	v1 "k8s.io/api/core/v1"
	metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/labels"
	client "k8s.io/client-go/kubernetes"
	"k8s.io/dashboard/api/pkg/api"
	metricapi "k8s.io/dashboard/api/pkg/integration/metric/api"
	"k8s.io/dashboard/api/pkg/resource/common"
	"k8s.io/dashboard/api/pkg/resource/dataselect"
	"k8s.io/dashboard/api/pkg/resource/event"
)

// GetServicesForDSDeletion is based on given selector returns list of services that are candidates for deletion.
// Services are matched by daemon sets' label selector. They are deleted if given
// label selector is targeting only 1 daemon set.
func GetServicesForDSDeletion(client client.Interface, labelSelector labels.Selector,
	namespace string) ([]v1.Service, error) {

	daemonSet, err := client.AppsV1().DaemonSets(namespace).List(context.TODO(), metaV1.ListOptions{
		LabelSelector: labelSelector.String(),
		FieldSelector: fields.Everything().String(),
	})
	if err != nil {
		return nil, err
	}

	// if label selector is targeting only 1 daemon set
	// then we can delete services targeted by this label selector,
	// otherwise we can not delete any services so just return empty list
	if len(daemonSet.Items) != 1 {
		return []v1.Service{}, nil
	}

	services, err := client.CoreV1().Services(namespace).List(context.TODO(), metaV1.ListOptions{
		LabelSelector: labelSelector.String(),
		FieldSelector: fields.Everything().String(),
	})
	if err != nil {
		return nil, err
	}

	return services.Items, nil
}

// The code below allows to perform complex data section on Daemon Set

type DaemonSetCell apps.DaemonSet

func (self DaemonSetCell) GetProperty(name dataselect.PropertyName) dataselect.ComparableValue {
	switch name {
	case dataselect.NameProperty:
		return dataselect.StdComparableString(self.ObjectMeta.Name)
	case dataselect.CreationTimestampProperty:
		return dataselect.StdComparableTime(self.ObjectMeta.CreationTimestamp.Time)
	case dataselect.NamespaceProperty:
		return dataselect.StdComparableString(self.ObjectMeta.Namespace)
	default:
		// if name is not supported then just return a constant dummy value, sort will have no effect.
		return nil
	}
}

func (self DaemonSetCell) GetResourceSelector() *metricapi.ResourceSelector {
	return &metricapi.ResourceSelector{
		Namespace:    self.ObjectMeta.Namespace,
		ResourceType: api.ResourceKindDaemonSet,
		ResourceName: self.ObjectMeta.Name,
		UID:          self.UID,
	}
}

func ToCells(std []apps.DaemonSet) []dataselect.DataCell {
	cells := make([]dataselect.DataCell, len(std))
	for i := range std {
		cells[i] = DaemonSetCell(std[i])
	}
	return cells
}

func FromCells(cells []dataselect.DataCell) []apps.DaemonSet {
	std := make([]apps.DaemonSet, len(cells))
	for i := range std {
		std[i] = apps.DaemonSet(cells[i].(DaemonSetCell))
	}
	return std
}

func getStatus(list *apps.DaemonSetList, pods []v1.Pod, events []v1.Event) common.ResourceStatus {
	info := common.ResourceStatus{}
	if list == nil {
		return info
	}

	for _, daemonSet := range list.Items {
		matchingPods := common.FilterPodsByControllerRef(&daemonSet, pods)
		podInfo := common.GetPodInfo(daemonSet.Status.CurrentNumberScheduled,
			&daemonSet.Status.DesiredNumberScheduled, matchingPods)
		warnings := event.GetPodsEventWarnings(events, matchingPods)

		if len(warnings) > 0 {
			info.Failed++
		} else if podInfo.Pending > 0 {
			info.Pending++
		} else {
			info.Running++
		}
	}

	return info
}


text:
class RenameLinksToExternalLinks < ActiveRecord::Migration
  def up
    rename_table :links, :external_links
  end

  def down
    rename_table :external_links, :links
  end
end


text:
DavidHDTV
=========

DavidHDTV / iBelovedSeriesTemplate, iSiDavida.V=YES/Yes,yes,y/Twin.Sys.Ser. ThisHybridSystem RequiresSpecialFualz. SuchAs GitHubEndorsed And (SomeTimesServes)- The InFamouse ShinyOctoBatManBrew.. iConicAle/


text:
AYAVoiceThread::AYAVoiceThread (CVoice *voice)
{
    mVoice = voice;
    circBuff = (double *)calloc(MAX_QUEUE_SIZE, sizeof(double));
    producerIndex = 0;
    consumerIndex = 0;

    tim.tv_sec = 0;
    tim.tv_nsec = 100;

    pthread_t voice_thread;
    int ret;

    ret = pthread_create(&voice_thread, NULL, AYAVoiceThread::worker_thread, this);

}

void *AYAVoiceThread::worker_thread(void *voiceptr)
{
    AYAVoiceThread *vThread = (AYAVoiceThread *)voiceptr;

    pthread_setname_np("voice_thread");
    double dLeftOutput;
    double dRightOutput;

    for (int i=0; i<1024; i++) {
        vThread->mVoice->doVoice(dLeftOutput, dRightOutput);

        vThread->circBuff[vThread->producerIndex] = dLeftOutput;
        vThread->producerIndex = vThread->incIndex(vThread->producerIndex);
    }

    while (true) {

        bool full = true;

        if ((vThread->producerIndex)%MAX_QUEUE_SIZE != vThread->consumerIndex) {
            full = false;
        }

        int diff = MAX_QUEUE_SIZE - abs(vThread->producerIndex-vThread->consumerIndex)-1;
        if (!full) {
            for (int i=0; i<diff; i++) {
                vThread->mVoice->doVoice(dLeftOutput, dRightOutput);

                vThread->circBuff[vThread->producerIndex] = dLeftOutput;
                vThread->producerIndex = vThread->incIndex(vThread->producerIndex);
            }
        }

    }
}

int AYAVoiceThread::incIndex(int index)
{
     return (index+1)%MAX_QUEUE_SIZE;
}

double AYAVoiceThread::getSample()
{
    if (!mVoice->m_bNoteOn) {
        return 0;
    }

    bool empty = true;

    if ((consumerIndex+1)%MAX_QUEUE_SIZE != producerIndex) {
        empty = false;
    }

    double output = 0;

    if (!empty) {

        output = circBuff[consumerIndex];
        consumerIndex = incIndex(consumerIndex);

    }

    return output;
}


text:
require 'epubber/generators/generator'

module Epubber::Generators
  class Endnotes < Generator
    def generate
      # Because this is an optional generator, don't do anything if there's no
      # introduction in the book
      return if book.endnotes.nil?

      content = template.parse file: 'OEBPS/Text/endnotes.xhtml', context: book_context
      persist file: 'OEBPS/Text/endnotes.xhtml', content: content
    end
  end
end


text:
This repository will retrieve data from Pocket API, prep data for ingest into the Elastic Stack (Elasticsearch, Logstash, Kibana) using Elastic's official docker images.

## Instead of this
![](images/pocket_072020-white.gif)

## Wouldn't this be better!
![](images/elastic-stack7x-pocket.gif)

**Get the most our your Pocket Data!!**
- Date Added
- Unique URLs
- Unique Given Domain
- Unique Resolved Domain
- Tag Cloud

As you can see, I've been a long time user of Pocket even before it was rebranded from Read It Later.

##### Tested Versions

Example has been tested in following versions:
- Python 3.8
- Elasticsearch 7.8.0
- Filebeat 7.8.0
- Kibana 7.8.0
- Docker 19.03.8
- Docker Compose 1.25.5

## Requirements Pocket App
Assumption is that you already have created a Pocket App with credentials.

If you have an account, but do not have an App, following instructions:

- [Pocket Developer Site](https://getpocket.com/developer/)
- [Create New App](https://getpocket.com/developer/apps/new)
- [Authenticate](https://getpocket.com/developer/docs/authentication)

If you do not have an Pocket Account, jump down to **Launch Containers, Ingest Data**

## Getting Started - Data Prep

1. Update Credentials
	Update `config-example.py` with Pocket App credentials then save as `config.py`

2. Retrieve and Prep Pocket Data

	`retrieve-prep-pocket-data.py` will retrieve and prep data from the Pocket API. The default parameter is one day back.
	- Removes images and videos
	- Creates list for tags and authors while removing item_id
	- Dumps JSON lines to log file ready for Logstash

	Usage:
	```
	usage: retrieve-prep-pocket-data.py [-h] [-d DAYS_BACK]

	Pass number of days back to start from

	optional arguments:
	-h, --help            show this help message and exit
	-d DAYS_BACK, --days_back DAYS_BACK
							Number of days back
	```

	Example:

		```
		cd scripts
		python retrieve-prep-pocket-data.py -d 10
		```

## Launch Stack to Ingest Data
1. Launch Containers and Test Connections

	Docker Compose Ingest will launch Elasticsearch, Logstash and Kibana official Elastic images.

	`docker-compose -f docker-compose-ingest.yml up`

	- Elasticsearch ([http://localhost:9200](http://localhost:9200))
	- Logstash  ([http://localhost:9600](http://localhost:9600))
	- Kibana ([http://localhost:5601](http://localhost:5601))

2. Ingest Data with Logstash
	- Logstash will Ingest `*.logs` in `./data/logs`
	- Creates fields based on uri for given_domain and resolved_domain
	- Transforms UNIX Timestamps to ISO Dates for time_added and time_updated
	- Outputs to Elasticsearch to Pocket Index while setting document_id to item_id

3. Import Visualizations
	- Launch Kibana from browser: `http://localhost:5601`
	- From **Side Navigation Bar**
		- Select **Stack Management**
		- Under Kibana select **Saved Objects**
		- Select **Import**
		- Navigate to local repo then elastic-stack/config/kibana/Kibana780-pocket-dashboards.ndjson
		- Select **Import**
		- Select **Confirm Changes**
		- Select **Done**
	- From **Side Navigation Bar**
		- Select **Dashboard**
		- Select **Pocket Overview**

4. Shutdown Stack
You can stop the Stack without loosing data. The ingested data will persist until you remove the volume.

	```docker-compose -f docker-compose-ingest.yml down```

## Launch Stack to Review Data
You can start the Stack with only Elasticsearch and Kibana to view existing data.

	Start: `docker-compose -f docker-compose.yml up`
	Stop: `docker-compose -f docker-compose.yml down`


text:
"""The admin module

Author: Logan Gore
This file lists any initialization code needed for the admin module.
"""


text:
class Example {
}

public class App {
    public static void main(String[] args) {
        Example ex = new Example();
    }
}


text:
#ifndef PageBlock_h
#define PageBlock_h

namespace WTF {

WTF_EXPORT_PRIVATE size_t pageSize();
WTF_EXPORT_PRIVATE size_t pageMask();
inline bool isPageAligned(void* address) { return !(reinterpret_cast<intptr_t>(address) & (pageSize() - 1)); }
inline bool isPageAligned(size_t size) { return !(size & (pageSize() - 1)); }
inline bool isPowerOfTwo(size_t size) { return !(size & (size - 1)); }

class PageBlock {
public:
    PageBlock();
    PageBlock(const PageBlock&);
    PageBlock(void*, size_t, bool hasGuardPages);

    void* base() const { return m_base; }
    size_t size() const { return m_size; }

    operator bool() const { return !!m_realBase; }

    bool contains(void* containedBase, size_t containedSize)
    {
        return containedBase >= m_base
            && (static_cast<char*>(containedBase) + containedSize) <= (static_cast<char*>(m_base) + m_size);
    }

private:
    void* m_realBase;
    void* m_base;
    size_t m_size;
};

inline PageBlock::PageBlock()
    : m_realBase(0)
    , m_base(0)
    , m_size(0)
{
}

inline PageBlock::PageBlock(const PageBlock& other)
    : m_realBase(other.m_realBase)
    , m_base(other.m_base)
    , m_size(other.m_size)
{
}

inline PageBlock::PageBlock(void* base, size_t size, bool hasGuardPages)
    : m_realBase(base)
    , m_base(static_cast<char*>(base) + ((base && hasGuardPages) ? pageSize() : 0))
    , m_size(size)
{
}

} // namespace WTF

using WTF::pageSize;
using WTF::isPageAligned;
using WTF::isPowerOfTwo;

#endif // PageBlock_h


text:
require "rexml/document"
require 'net/http'
include REXML  # so that we don't have to prefix everything with REXML

class PropertyPoster

    def postcoverage
        @serverurl= ENV['CRUISE_SERVER_URL']
        @pipeline= ENV['CRUISE_PIPELINE_NAME']
        @stage= ENV['CRUISE_STAGE_NAME']
        @job= ENV['CRUISE_JOB_NAME']
        @label= ENV['CRUISE_PIPELINE_LABEL']
        emmafile = "../../target/emma/coverage.xml";
        @emmafilepath = Pathname.new(File.dirname(__FILE__)).realpath + emmafile
        puts @emmafilepath
        file = File.new( @emmafilepath )
        doc = REXML::Document.new file
        coverages = doc.root.elements.to_a("data/all/coverage")
        coverages.each do |coverage|
            url = URI.parse("http://10.18.7.51:8153/go/properties/"+@pipeline+"/"+@label+"/"+@stage+"/"+@job+"/coverage_"+coverage.attributes["type"].to_s.split( ",")[0])
            req = Net::HTTP::Post.new(url.path)
            req.basic_auth 'jez', 'badger'
            req.set_form_data({'value'=>coverage.attributes["value"].split("%")[0]}, ';')
            puts url
            res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
            case res
            when Net::HTTPSuccess, Net::HTTPRedirection
                puts 'done!'
            else
                res.error!
            end
        end
     end
end


text:
#import "PWGradientView.h"

@implementation PWGradientView {
  UIColor* _bottomColor;
  UIColor* _topColor;
}

@synthesize bottomColor = _bottomColor;
@synthesize topColor = _topColor;

- (instancetype)initWithFrame:(CGRect)frame {
  self = [super initWithFrame:frame];
  self.opaque = NO;
  return self;
}

- (void)drawRect:(CGRect)rect {
  CGContextRef context = UIGraphicsGetCurrentContext();

  CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
  CGFloat locations[3] = {0., 0.6, 1.};
  CGFloat components[12] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0.};
  CGGradientRef gradient =
      CGGradientCreateWithColorComponents(colorSpace, components, locations, 3);
  CGRect bounds = [self bounds];
  CGPoint point = bounds.origin;
  point.y += bounds.size.height;
  CGContextDrawLinearGradient(context, gradient, bounds.origin, point, 0);
  CFRelease(gradient);
  CFRelease(colorSpace);

  [super drawRect:rect];
}

@end


text:
package org.pikater.web.vaadin.gui.server.ui_expeditor.expeditor.boxmanager.views.options.values.templated;

import org.pikater.core.ontology.subtrees.newoption.base.Value;
import org.pikater.core.ontology.subtrees.newoption.values.StringValue;
import org.pikater.web.vaadin.gui.server.ui_expeditor.expeditor.boxmanager.views.options.OptionValueForm;
import org.pikater.web.vaadin.gui.server.ui_expeditor.expeditor.boxmanager.views.options.values.AbstractFieldProviderForValue;
import org.pikater.web.vaadin.gui.server.ui_expeditor.expeditor.boxmanager.views.options.values.special.FileInputFieldProvider;

/**
 * Class providing {@link StringValue}-backed fields to {@link OptionValueForm}.
 *
 * @author SkyCrawl
 */
public class StringValueProvider extends AbstractFieldProviderForValue {
	/**
	 * IMPORTANT: {@link FileInputFieldProvider} requires a single text field
	 * to be generated in this method.
	 */
	@Override
	protected void doGenerateFields(final Value value) {
		IFieldContext<String> context = getFieldContextFrom(value);
		addField("value", createTextField("Value:", context, new IOnValueChange<String>() {
			@Override
			public void valueChanged(String newValue) {
				value.setCurrentValue(new StringValue(newValue));
			}
		}));
	}
}


text:
namespace Connexions.Travel.Capi.Car
{
	class SearchStatusResponse : StatusResponse
	{
		/// <summary>
		/// Total count of car results so far.
		/// </summary>
		public int resultsCount;
	}
}


text:
'use strict';

/**
 * Find the token before the closing bracket.
 * @param {ASTNode} node - The JSX element node.
 * @returns {Token} The token before the closing bracket.
 */
function getTokenBeforeClosingBracket(node) {
  const attributes = node.attributes;
  if (!attributes || attributes.length === 0) {
    return node.name;
  }
  return attributes[attributes.length - 1];
}

module.exports = getTokenBeforeClosingBracket;


text:
A little bone-head of a state machine, for Node and browsers. Also
@JacobOscarson's playground for learning how to properly do NPM
modules.

The plan is to re-implement the minimal finite state machine I already
have in [Juntoo](http://juntoo.co), with slightly different goals:

  * Developed in a manner more fit for public re-use
  * Ideally I could then replace the version used in Juntoo with this
version.
  * With a small and manageable footprint so that you don't hesitate
to enter it with a step debugger if needed (just like the slightly
more specialized one I use in Juntoo).
  * To learn more about how to correctly develop modules for
Node.js/NPM. Therefore I need a simplified project to experiment on.


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;
using Spect.Net.Assembler.SyntaxTree;
using Spect.Net.Assembler.SyntaxTree.Operations;

namespace Spect.Net.Assembler.Test.Parser
{
    [TestClass]
    public class IncAndDecOperationTests : ParserTestBed
    {
        [TestMethod]
        public void IncrementWorksAsExpected()
        {
            IncrementWorksAsExpected("inc b", "B");
            IncrementWorksAsExpected("inc c", "C");
            IncrementWorksAsExpected("inc d", "D");
            IncrementWorksAsExpected("inc e", "E");
            IncrementWorksAsExpected("inc h", "H");
            IncrementWorksAsExpected("inc l", "L");
            IncrementWorksAsExpected("inc (hl)", "(HL)");
            IncrementWorksAsExpected("inc a", "A");
            IncrementWorksAsExpected("inc bc", "BC");
            IncrementWorksAsExpected("inc de", "DE");
            IncrementWorksAsExpected("inc hl", "HL");
            IncrementWorksAsExpected("inc sp", "SP");
            IncrementWorksAsExpected("inc ix", "IX");
            IncrementWorksAsExpected("inc xh", "XH");
            IncrementWorksAsExpected("inc xl", "XL");
            IncrementWorksAsExpected("inc iy", "IY");
            IncrementWorksAsExpected("inc yh", "YH");
            IncrementWorksAsExpected("inc yl", "YL");

            IncrementWorksAsExpected("inc bc", "BC");
            IncrementWorksAsExpected("inc de", "DE");
            IncrementWorksAsExpected("inc hl", "HL");
            IncrementWorksAsExpected("inc sp", "SP");
            IncrementWorksAsExpected("inc ix", "IX");
            IncrementWorksAsExpected("inc iy", "IY");

            IncrementWorksAsExpected("inc (ix)", "IX", null);
            IncrementWorksAsExpected("inc (ix+#bc)", "IX", "+");
            IncrementWorksAsExpected("inc (ix-#0a)", "IX", "-");
            IncrementWorksAsExpected("inc (iy)", "IY", null);
            IncrementWorksAsExpected("inc (iy+#bc)", "IY", "+");
            IncrementWorksAsExpected("inc (iy-#0a)", "IY", "-");
        }

        [TestMethod]
        public void DecrementWorksAsExpected()
        {
            DecrementWorksAsExpected("dec b", "B");
            DecrementWorksAsExpected("dec c", "C");
            DecrementWorksAsExpected("dec d", "D");
            DecrementWorksAsExpected("dec e", "E");
            DecrementWorksAsExpected("dec h", "H");
            DecrementWorksAsExpected("dec l", "L");
            DecrementWorksAsExpected("dec (hl)", "(HL)");
            DecrementWorksAsExpected("dec a", "A");
            DecrementWorksAsExpected("dec bc", "BC");
            DecrementWorksAsExpected("dec de", "DE");
            DecrementWorksAsExpected("dec hl", "HL");
            DecrementWorksAsExpected("dec sp", "SP");
            DecrementWorksAsExpected("dec ix", "IX");
            DecrementWorksAsExpected("dec xh", "XH");
            DecrementWorksAsExpected("dec xl", "XL");
            DecrementWorksAsExpected("dec iy", "IY");
            DecrementWorksAsExpected("dec yh", "YH");
            DecrementWorksAsExpected("dec yl", "YL");

            DecrementWorksAsExpected("dec bc", "BC");
            DecrementWorksAsExpected("dec de", "DE");
            DecrementWorksAsExpected("dec hl", "HL");
            DecrementWorksAsExpected("dec sp", "SP");
            DecrementWorksAsExpected("dec ix", "IX");
            DecrementWorksAsExpected("dec iy", "IY");

            DecrementWorksAsExpected("dec (ix)", "IX", null);
            DecrementWorksAsExpected("dec (ix+#bc)", "IX", "+");
            DecrementWorksAsExpected("dec (ix-#0a)", "IX", "-");
            DecrementWorksAsExpected("dec (iy)", "IY", null);
            DecrementWorksAsExpected("dec (iy+#bc)", "IY", "+");
            DecrementWorksAsExpected("dec (iy-#0a)", "IY", "-");
        }

        protected void IncrementWorksAsExpected(string instruction, string register)
        {
            // --- Act
            var visitor = Parse(instruction);

            // --- Assert
            visitor.Compilation.Lines.Count.ShouldBe(1);
            var line = visitor.Compilation.Lines[0] as CompoundOperation;
            line.ShouldNotBeNull();
            line.Mnemonic.ShouldBe("INC");
            line.Operand.Register.ShouldBe(register);
        }

        protected void IncrementWorksAsExpected(string instruction, string reg, string sign)
        {
            // --- Act
            var visitor = Parse(instruction);

            // --- Assert
            visitor.Compilation.Lines.Count.ShouldBe(1);
            var line = visitor.Compilation.Lines[0] as CompoundOperation;
            line.ShouldNotBeNull();
            line.Mnemonic.ShouldBe("INC");
            line.Operand.Type.ShouldBe(OperandType.IndexedAddress);
            line.Operand.Register.ShouldBe(reg);
            line.Operand.Sign.ShouldBe(sign);
            if (sign == null)
            {
                line.Operand.Expression.ShouldBeNull();
            }
            else
            {
                line.Operand.Expression.ShouldNotBeNull();
            }
        }

        protected void DecrementWorksAsExpected(string instruction, string register)
        {
            // --- Act
            var visitor = Parse(instruction);

            // --- Assert
            visitor.Compilation.Lines.Count.ShouldBe(1);
            var line = visitor.Compilation.Lines[0] as CompoundOperation;
            line.ShouldNotBeNull();
            line.Mnemonic.ShouldBe("DEC");
            line.Operand.Register.ShouldBe(register);
        }

        protected void DecrementWorksAsExpected(string instruction, string reg, string sign)
        {
            // --- Act
            var visitor = Parse(instruction);

            // --- Assert
            visitor.Compilation.Lines.Count.ShouldBe(1);
            var line = visitor.Compilation.Lines[0] as CompoundOperation;
            line.ShouldNotBeNull();
            line.Mnemonic.ShouldBe("DEC");
            line.Operand.Type.ShouldBe(OperandType.IndexedAddress);
            line.Operand.Register.ShouldBe(reg);
            line.Operand.Sign.ShouldBe(sign);
            if (sign == null)
            {
                line.Operand.Expression.ShouldBeNull();
            }
            else
            {
                line.Operand.Expression.ShouldNotBeNull();
            }
        }
    }
}


text:
/*
 *   COMMON
 *       CONFIG.js - read exteranl JSON configuration file
 *       0.1 - 15-OCT-2014, first commit
 */
define( function( require, exports, module ) {
    'use strict';

    var Config = require( 'text!config/config.json' );
    var _config = JSON.parse( Config );
    module.exports = _config;
} );


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// |                            Artisan Smarty                            |
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright 2004-2005 ARTISAN PROJECT All rights reserved.             |
// +----------------------------------------------------------------------+
// | Authors: Akito<akito-artisan@five-foxes.com>                         |
// +----------------------------------------------------------------------+
//
/**
 * ArtisanSmarty plugin
 * @package ArtisanSmarty
 * @subpackage plugins
 */

/**
 * Smarty wordwrap modifier plugin
 *
 * Type:     modifier

 * Name:     wordwrap

 * Purpose:  wrap a string of text at a given length
 * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
 *          wordwrap (Smarty online manual)
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @return string
 */
function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
{
    return wordwrap($string,$length,$break,$cut);
}

?>


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (c) 2012 Manning
  See the file license.txt for copying permission.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.manning.androidhacks.hack005"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="4" />

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="12dp"
        android:text="Url" />

    <android.support.v7.widget.AppCompatSpinner
        android:id="@+id/spinner_url"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <EditText
        android:id="@+id/edit_text_url"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="12dp"
        android:text="Action" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/video_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="asVideo" />

        <Button
            android:id="@+id/bitmap_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="asBitmap" />

        <Button
            android:id="@+id/ijk_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="asIjkVideo" />
    </LinearLayout>

</LinearLayout>


text:
//
//  PeopleManageController.m
//  TiJian
//
//  Created by lichaowei on 15/11/6.
//  Copyright © 2015年 lcw. All rights reserved.
//

#import "PeopleManageController.h"
#import "AddPeopleViewController.h"
#import "EditUserInfoViewController.h"
#import "AppointModel.h"
#import "ConfirmOrderViewController.h"
#import "ProductModel.h"
#import "HospitalModel.h"

#define kTag_Appoint 200 //预约
#define kTag_Delete 201 //去删除
#define KTag_EditUserInfo 202 //去编辑个人信息
#define kTag_Appoint_success 203 //预约成功

@interface PeopleManageController ()<UITableViewDataSource,RefreshDelegate>
{
    RefreshTableView *_table;
    UIButton *_arrowBtn;
    BOOL _isOpen;//是否展开
    UIView *_view_tableHeader;
    BOOL _isEdit;//是否在编辑
    UILabel *_numLabel;//位数
    int _deleteIndex;//待删除下标
    NSMutableArray *_selectedArray;//选中
    NSArray *_tempSelectedArray;//选中

    NSMutableArray *_selectedUserArray;//选中model
    NSArray *_tempSelectedUserArray;//选中model

    NSArray *_selectedHospitalArray;//已经选择过的体检分院及体检人

    //此套餐可以预约个数
    int _noAppointNum;//未预约个数
    //提交预约参数
    NSString *_order_id;//订单id
    NSString *_product_id;//单品id
    NSString *_exam_center_id;//体检机构id
    NSString *_exam_center_name;//体检机构name
    NSString *_date;// 预约体检日期(如:2015-11-13)

    //个人特有
    UIImageView *_selectedIcon;//选择本人的icon
    BOOL _isMyselfSelected;//是否选择自己

}

@property(nonatomic,retain)ResultView *nodataView;

@end

@implementation PeopleManageController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

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

    if (_actionType == PEOPLEACTIONTYPE_NORMAL) {
        self.myTitle = @"家人管理";
    }else if (_actionType == PEOPLEACTIONTYPE_SELECT_Single){
        self.myTitle = @"重新选择体检人";
    }else if (_actionType == PEOPLEACTIONTYPE_SELECT_APPOINT ||
              _actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT ||
              _actionType == PEOPLEACTIONTYPE_SELECT_Mul){
        self.myTitle = @"选择体检人";
    }else if (_actionType == PEOPLEACTIONTYPE_GuaHao)
    {
        self.myTitle = @"选择就诊人";
    }

    [self setMyViewControllerLeftButtonType:MyViewControllerLeftbuttonTypeBack WithRightButtonType:MyViewControllerRightbuttonTypeNull];

    self.view.backgroundColor = DEFAULT_VIEW_BACKGROUNDCOLOR;
    [self createNavigationbarTools];

    _table = [[RefreshTableView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH,DEVICE_HEIGHT - 64)];
    _table.refreshDelegate = self;
    _table.dataSource = self;
    _table.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_table];

    _selectedArray = [NSMutableArray array];
    if (_tempSelectedArray) {
        [_selectedArray addObjectsFromArray:_tempSelectedArray];
    }
    _selectedUserArray = [NSMutableArray array];
    if (_tempSelectedUserArray) {
        [_selectedUserArray addObjectsFromArray:_tempSelectedUserArray];
    }
    _isOpen = YES;//默认打开
    _isEdit = NO;//默认非编辑
    _table.tableHeaderView = [self tableHeadView];

    if (_actionType == PEOPLEACTIONTYPE_SELECT_APPOINT ||
        _actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT ||
        _actionType == PEOPLEACTIONTYPE_SELECT_Mul ||
        _actionType == PEOPLEACTIONTYPE_GuaHao) {
        UIView *view = [self tableFooterView];
        [self.view addSubview:view];
        view.top = DEVICE_HEIGHT - view.height - 64;
        _table.height = DEVICE_HEIGHT - 64 - view.height;
    }

    [_table showRefreshHeader:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma - mark 网络请求

- (void)getFamily
{
    NSString *authkey = [UserInfo getAuthkey];
    __weak typeof(self)weakSelf = self;
    __weak typeof(_table)weakTable = _table;
    [[YJYRequstManager shareInstance]requestWithMethod:YJYRequstMethodPost api:GET_FAMILY parameters:@{@"authcode":authkey} constructingBodyBlock:nil completion:^(NSDictionary *result) {

        NSArray *temp = [UserInfo modelsFromArray:result[@"family_list"]];
        [weakTable reloadData:temp pageSize:1000 noDataView:[weakSelf resultViewWithType:PageResultType_nodata]];
        _numLabel.text = [NSString stringWithFormat:@"%d位",(int)weakTable.dataArray.count];

    } failBlock:^(NSDictionary *result) {

        [weakTable loadFail];
    }];
}

- (void)deleteFamily:(int)index
{
    UserInfo *aModel = _table.dataArray[index];

    NSString *authkey = [UserInfo getAuthkey];
    NSDictionary *params = @{@"authcode":authkey,
                             @"family_uids":aModel.family_uid};

    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    __weak typeof(self)weakSelf = self;
    __weak typeof(_table)weakTable = _table;
    [[YJYRequstManager shareInstance]requestWithMethod:YJYRequstMethodPost api:DEL_FAMILY parameters:params constructingBodyBlock:nil completion:^(NSDictionary *result) {

        [MBProgressHUD hideAllHUDsForView:weakSelf.view animated:YES];
        [weakTable.dataArray removeObjectAtIndex:index];
        _isEdit = NO;
        _numLabel.text = [NSString stringWithFormat:@"%d位",(int)weakTable.dataArray.count];
        [weakTable reloadData];

    } failBlock:^(NSDictionary *result) {

        [MBProgressHUD hideAllHUDsForView:weakSelf.view animated:YES];

    }];
}

/**
 *  预约参数传值
 *
 *  @param orderId
 *  @param productId
 *  @param examCenterId     体检机构id
 *  @param date             预约的时间 格式如:2015-11-13
 *  @param noAppointNum     套餐未预约个数
 */
- (void)setAppointOrderId:(NSString *)orderId
                productId:(NSString *)productId
             examCenterId:(NSString *)examCenterId
                     date:(NSString *)date
             noAppointNum:(int)noAppointNum
{
    //提交预约参数
    _order_id = orderId;//订单id
    _product_id = productId;//单品id
    _exam_center_id = examCenterId;//体检机构id
    _date = date;// 预约体检日期(如:2015-11-13)
    _noAppointNum = noAppointNum;
}

/**
 *  选择多个体检人信息 回调
 *  @param examCenterName   体检机构name
 *  @param examCenterId     体检机构id
 *  @param date             预约的时间 格式如:2015-11-13
 *  @param noAppointNum     套餐未预约个数
 */
- (void)selectMulPeopleWithExamCenterId:(NSString *)examCenterId
                         examCenterName:(NSString *)examName
                               examDate:(NSString *)date
                           noAppointNum:(int)noAppointNum
                            updateBlock:(UpdateParamsBlock)updateBlock
{
    self.updateParamsBlock = updateBlock;
    //提交预约参数
    _exam_center_id = examCenterId;//体检机构id
    _exam_center_name = examName;
    _date = date;// 预约体检日期(如:2015-11-13)
    _noAppointNum = noAppointNum;
}

/**
 *  选择多个体检人信息 回调
 *  @param examCenterName   体检机构name
 *  @param examCenterId     体检机构id
 *  @param date             预约的时间 格式如:2015-11-13
 *  @param noAppointNum     套餐未预约个数
 */
- (void)selectMulPeopleWithHospitalArray:(NSArray *)hospitalArray
                            examCenterId:(NSString *)examCenterId
                         examCenterName:(NSString *)examName
                               examDate:(NSString *)date
                           noAppointNum:(int)noAppointNum
                            updateBlock:(UpdateParamsBlock)updateBlock
{
    self.updateParamsBlock = updateBlock;
    //提交预约参数
    _exam_center_id = examCenterId;//体检机构id
    _exam_center_name = examName;
    _date = date;// 预约体检日期(如:2015-11-13)
    _noAppointNum = noAppointNum;
    _selectedHospitalArray = hospitalArray;

    NSArray *userArray;
    for (HospitalModel *hospital in hospitalArray) {
        //分院和时间都满足
        if ([hospital.exam_center_id integerValue] == [examCenterId integerValue] &&
            [hospital.date isEqualToString:date]) {
            userArray = hospital.usersArray;
        }
    }
    if (userArray.count) {
        [self replaceUserArray:userArray noAppointNum:noAppointNum updateBlock:updateBlock];
    }
}

/**
 *  更新体检人
 *
 *  @param userArray    体检人数组
 *  @param noAppointNum
 *  @param updateBlock
 */
- (void)replaceUserArray:(NSArray *)userArray
            noAppointNum:(int)noAppointNum
             updateBlock:(UpdateParamsBlock)updateBlock
{
    NSMutableArray *tempUsers = [NSMutableArray array];
    NSMutableArray *tempIds = [NSMutableArray arrayWithCapacity:userArray.count];
    self.updateParamsBlock = updateBlock;
    for (UserInfo *user in userArray) {

        if ([user.family_uid integerValue] == 0 ||
            user.mySelf == YES) {
            _isMyselfSelected = YES;
        }else
        {
            NSString *uid = NSStringFromInt([user.family_uid intValue]);
            [tempIds addObject:uid];
            [tempUsers addObject:user];
        }
    }
    //
    _tempSelectedArray = [NSArray arrayWithArray:tempIds];
    _tempSelectedUserArray = [NSArray arrayWithArray:tempUsers];
    _noAppointNum = noAppointNum + (int)userArray.count;

    [_table reloadData];
}

/**
 *  提交预约信息
 */
- (void)networkForMakeAppoint
{
    //个人
    //家人id 多个用英文逗号隔开(若是个人买单,则要传)

    NSString *family_uid = [_selectedArray componentsJoinedByString:@","];
    //myself 是否包括本人 1是 0不是(若是个人买单,则要传)
//    NSString *myself = _isMyselfSelected ? @"1" : @"0";

    NSString *authkey = [UserInfo getAuthkey];

    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params safeSetValue:authkey forKey:@"authcode"];
    [params safeSetValue:_order_id forKey:@"order_id"];
    [params safeSetValue:_product_id forKey:@"product_id"];
    [params safeSetValue:_exam_center_id forKey:@"exam_center_id"];
    [params safeSetValue:_date forKey:@"date"];
    [params safeSetBool:_isMyselfSelected forKey:@"myself"];

    [params safeSetValue:family_uid forKey:@"family_uid"];

    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    __weak typeof(self)weakSelf = self;
    [[YJYRequstManager shareInstance]requestWithMethod:YJYRequstMethodPost api:MAKE_APPOINT parameters:params constructingBodyBlock:nil completion:^(NSDictionary *result) {

        [MBProgressHUD hideAllHUDsForView:weakSelf.view animated:YES];
        [weakSelf appointSuccessWithResult:result];

    } failBlock:^(NSDictionary *result) {

        [MBProgressHUD hideAllHUDsForView:weakSelf.view animated:YES];
        int erroCode = [result[RESULT_CODE]intValue];
        if (erroCode < 2000) {
            [LTools showMBProgressWithText:Alert_ServerErroInfo_Inner addToView:weakSelf.view];
        }
    }];
}

/**
 *  预约成功
 *
 *  @param result
 */
- (void)appointSuccessWithResult:(NSDictionary *)result
{
    NSString *msg = result[RESULT_INFO];
    if ([LTools isEmpty:msg]) {
        msg = Alert_AppointSucess;
    }

    //预约成功通知
    [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_APPOINT_SUCCESS object:nil];

    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:msg delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    alert.tag = kTag_Appoint_success;
    [alert show];
}

#pragma - mark 事件处理

- (void)appointSuccess
{
    if (self.lastViewController) {
        [self.navigationController popToViewController:self.lastViewController animated:YES];
        return;
    }
    [self.navigationController popViewControllerAnimated:YES];
}

/**
 *  去预约
 */
- (void)clickToAppoint
{
    int num = (int)_selectedArray.count;
    //选择自己或者选择了至少一个其他人
    if (_isMyselfSelected || num > 0) {

        if (_actionType == PEOPLEACTIONTYPE_NORMAL)
        {
            return;

        }else if (_actionType == PEOPLEACTIONTYPE_SELECT_Single)
        {
            //仅选择人并自动返回
            return;

        }else if (_actionType == PEOPLEACTIONTYPE_SELECT_Mul)//选择多个体检人
        {
            //选择的体检人
            NSMutableArray *temp = [NSMutableArray arrayWithArray:_selectedUserArray];

            //是否包含自己
            if (_isMyselfSelected) {

                UserInfo *loginUser = [UserInfo userInfoForCache];
                UserInfo *userInfo = [[UserInfo alloc]init];
                userInfo.family_uid = 0;
                userInfo.appellation = @"本人";
                userInfo.family_user_name = loginUser.real_name;
                userInfo.id_card = loginUser.id_card;
                userInfo.mySelf = YES;
                [temp addObject:userInfo];
            }

            HospitalModel *tempHospital;
            NSMutableArray *hospitalsArray;
            if (_selectedHospitalArray.count) {
                hospitalsArray = [NSMutableArray arrayWithArray:_selectedHospitalArray];
            }else
            {
                hospitalsArray = [NSMutableArray array];
            }

            for (HospitalModel *hospital in _selectedHospitalArray) {
                //分院和时间都满足
                if ([hospital.exam_center_id integerValue] == [_exam_center_id integerValue] &&
                    [hospital.date isEqualToString:_date]) {

                    tempHospital = hospital;
                }
            }

            if (tempHospital) {
                tempHospital.usersArray = [NSMutableArray arrayWithArray:temp];//体检人信息
            }else
            {
                HospitalModel *hospital = [[HospitalModel alloc]init];
                hospital.date = _date;
                hospital.exam_center_id = _exam_center_id;
                hospital.center_name = _exam_center_name;
                hospital.usersArray = [NSMutableArray arrayWithArray:temp];//体检人信息
                [hospitalsArray addObject:hospital];
            }

            NSMutableDictionary *params = [NSMutableDictionary dictionary];
            [params safeSetValue:hospitalsArray forKey:@"hospital"];//分院数组
            [params safeSetValue:temp forKey:@"userInfo"];//体检人数组

            //回调值
            if (self.updateParamsBlock) {
                self.updateParamsBlock(params);
            }
            if (self.lastViewController) {
                [self.navigationController popToViewController:self.lastViewController animated:YES];
            }else{
                [self.navigationController popViewControllerAnimated:YES];
            }

        }
        else if (_actionType == PEOPLEACTIONTYPE_SELECT_APPOINT) //选择直接预约
        {
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"是否确定预约体检" delegate:self cancelButtonTitle:@"稍等" otherButtonTitles:@"确定", nil];
            alert.tag = kTag_Appoint;
            [alert show];

        }
        else if (_actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT)
        {
            //选择的体检人
            NSMutableArray *temp = [NSMutableArray arrayWithArray:_selectedUserArray];
            //是否包含自己
            if (_isMyselfSelected) {

                UserInfo *loginUser = [UserInfo userInfoForCache];
                UserInfo *userInfo = [[UserInfo alloc]init];
                userInfo.family_uid = 0;
                userInfo.appellation = @"本人";
                userInfo.family_user_name = loginUser.real_name;
                userInfo.id_card = loginUser.id_card;
                userInfo.mySelf = YES;
                [temp addObject:userInfo];

                num += 1;
            }

            //aModel.current_price\product_num、brand_name、cover_pic
            ProductModel *productModel = (ProductModel *)self.productModel;
            productModel.product_num = NSStringFromInt(num);
            productModel.current_price = productModel.setmeal_price;
            productModel.product_name = productModel.setmeal_name;

            HospitalModel *hospital = [[HospitalModel alloc]init];
            hospital.date = _date;
            hospital.exam_center_id = _exam_center_id;
            hospital.center_name = _exam_center_name;

            ConfirmOrderViewController *cc = [[ConfirmOrderViewController alloc]init];
            cc.lastViewController = self;
            [cc appointWithProductModel:productModel hospital:hospital userArray:temp];
            [self.navigationController pushViewController:cc animated:YES];
        }
        else if (_actionType == PEOPLEACTIONTYPE_GuaHao)
        {
            //挂号网选择家属联系人
            DDLOG(@"去挂号网 转诊预约");

            NSString *familyuid = @"0";
            if (_isMyselfSelected) {
                familyuid = @"0";
            }else
            {
                int count = (int)_selectedArray.count;
                if (count > 0) {
                    familyuid = [_selectedArray lastObject];
                }
            }
            NSDictionary *param = @{@"familyuid":familyuid};
            if (self.updateParamsBlock) {
                self.updateParamsBlock(param);
            }
        }

    }
    else{

        [LTools showMBProgressWithText:@"请选择体检人" addToView:self.view];

    }
}

/**
 *  选择体检人并返回
 *
 *  @param user UserInfo model
 *  @param myself 是否是本人
 */
- (void)selectPeople:(UserInfo *)user
              myself:(BOOL)myself
{
    if (self.updateParamsBlock) {

        NSDictionary *params = @{@"result":user,
                                 @"myself":[NSNumber numberWithBool:myself]};
        self.updateParamsBlock(params);
    }

    [self leftButtonTap:nil];
}

/**
 *  查看本人信息
 */
- (void)clickToMe
{
    //大于0表示需要判断性别
    //男或者女时判断选择人的性别
    if (self.gender == Gender_Boy || self.gender == Gender_Girl) {

        Gender gender_select = [[UserInfo userInfoForCache].gender intValue];

        if (gender_select != self.gender) {

            NSString *title = self.gender == Gender_Girl ? @"本套餐仅适用于\"女\"性" : @"本套餐仅适用于\"男\"性";
            [LTools showMBProgressWithText:title addToView:self.view];
            return;
        }
    }

    //普通
    if (_actionType == PEOPLEACTIONTYPE_NORMAL) {

        [self clickToEditUserInfoIsFull:NO];

    }
    //选择人
    else if (_actionType == PEOPLEACTIONTYPE_SELECT_Single){

        if ([self enableSelectNewPeople]) {

            //需要判断信息是否完整
            if ([self isUserInfoWell]) {

                _selectedIcon.hidden = NO;
                _isMyselfSelected = YES;

                UserInfo *user = [UserInfo userInfoForCache];
                user.family_user_name = user.real_name;
                [self selectPeople:user myself:YES];

            }else
            {
                UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"用户信息不完整,去完善?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"去完善", nil];
                alert.tag = KTag_EditUserInfo;
                [alert show];
            }
        }

    }    //选择并预约
    else if (_actionType == PEOPLEACTIONTYPE_SELECT_APPOINT ||
             _actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT ||
             _actionType == PEOPLEACTIONTYPE_SELECT_Mul ||
             _actionType == PEOPLEACTIONTYPE_GuaHao){

        if (_isMyselfSelected) {

            _selectedIcon.hidden = YES;
            _isMyselfSelected = NO;

        }else
        {
            if ([self enableSelectNewPeople]) {

                //需要判断信息是否完整
                if ([self isUserInfoWell]) {

                    _selectedIcon.hidden = NO;
                    _isMyselfSelected = YES;

                }else
                {
                    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"用户信息不完整,去完善?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"去完善", nil];
                    alert.tag = KTag_EditUserInfo;
                    [alert show];
                }
            }
        }
    }
}

/**
 *  跳转至用户详情页
 *
 *  @param aModel
 */
- (void)clickToUserInfo:(UserInfo *)aModel
{
    AddPeopleViewController *add = [[AddPeopleViewController alloc]init];
    add.actionStyle = ACTIONSTYLE_DETTAILT;
    add.userModel = aModel;
    __weak typeof(_table)weakTable = _table;

    [add setUpdateParamsBlock:^(NSDictionary *params){

        NSLog(@"params %@",params);
        [weakTable showRefreshHeader:YES];
    }];

    [self.navigationController pushViewController:add animated:YES];
}

/**
 *  点击打开或者关闭
 *
 *  @param sender
 */
- (void)clickToAction:(UIButton *)sender
{
    sender.selected = !sender.selected;
    _arrowBtn.selected = sender.selected;

    _isOpen = !sender.selected;

    [_table reloadData];

}

/**
 *  添加新人
 */
- (void)clickToAdd:(UIButton *)sender
{
    AddPeopleViewController *add = [[AddPeopleViewController alloc]init];
    __weak typeof(_table)weakTable = _table;

    [add setUpdateParamsBlock:^(NSDictionary *params){

        NSLog(@"params %@",params);
        [weakTable showRefreshHeader:YES];
    }];

    [self.navigationController pushViewController:add animated:YES];
}

/**
 *  编辑状态、可删除人
 *
 *  @param sender
 */
- (void)clickToEdit:(UIButton *)sender
{
    _isEdit = !_isEdit;
    [_table reloadData];
}

/**
 *  编辑本人信息
 */
- (void)clickToEditUserInfoIsFull:(BOOL)isFull
{
    EditUserInfoViewController *edit = [[EditUserInfoViewController alloc]init];
    edit.isFullUserInfo = isFull;
    [self.navigationController pushViewController:edit animated:YES];
}

/**
 *  判断本人信息是否完整
 *
 *  @return
 */
- (BOOL)isUserInfoWell
{
    UserInfo *userInfo = [UserInfo userInfoForCache];
    NSString *name = userInfo.real_name;
    NSString *id_card = userInfo.id_card;
    int sex = [userInfo.gender intValue];
    int age = [userInfo.age intValue];
    NSString *phone = userInfo.mobile;

    if (name.length > 0 &&
        [LTools isValidateIDCard:id_card] &&
        sex > 0 &&
        age > 0 &&
        [LTools isValidateMobile:phone]) {

        return YES;
    }

    return NO;
}

/**
 *  判断是否可以选择更多人
 *
 *  @return 是否
 */
- (BOOL)enableSelectNewPeople
{
    int selectNum = (int)_selectedArray.count;//可选
    if (_isMyselfSelected) { //是否选择本人

        selectNum += 1;
    }

    //已选择小于剩余总数
    if (selectNum < _noAppointNum) {

        return YES;
    }

    NSString *text = [NSString stringWithFormat:@"共可约%d人,已选%d人",_noAppointNum,selectNum];

    [LTools alertText:text viewController:self];

    return NO;
}

#pragma - mark 创建视图

/**
 *  请求结果 为空、等特殊情况
 */
-(ResultView *)resultViewWithType:(PageResultType)type
{
    NSString *content;
    if (type == PageResultType_nodata){

        content = @"您还没有添加家人";
    }

    if (_nodataView) {

        [_nodataView setContent:content];
        return _nodataView;
    }

    ResultView *result = [[ResultView alloc]initWithImage:[UIImage imageNamed:@"hema_heart"]
                                                    title:@"温馨提示"
                                                  content:content];

    self.nodataView = result;

    return result;
}

- (void)createNavigationbarTools
{

    if (_actionType == PEOPLEACTIONTYPE_NORMAL) {

        UIButton *rightView=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 88, 44)];
        rightView.backgroundColor=[UIColor clearColor];

        //添加
        UIButton *heartButton = [[UIButton alloc]initWithframe:CGRectMake(0, 0, 44, 44) buttonType:UIButtonTypeCustom nornalImage:[UIImage imageNamed:@"personal_jiaren_tianjia"] selectedImage:nil target:self action:@selector(clickToAdd:)];
        [heartButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];

        //删除
        UIButton *collectButton = [[UIButton alloc]initWithframe:CGRectMake(44, 0, 44, 44) buttonType:UIButtonTypeCustom nornalImage:[UIImage imageNamed:@"personal_jiaren_shanchu"] selectedImage:nil target:self action:@selector(clickToEdit:)];
        [collectButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];

        [rightView addSubview:heartButton];
        [rightView addSubview:collectButton];

        UIBarButtonItem *comment_item=[[UIBarButtonItem alloc]initWithCustomView:rightView];

        self.navigationItem.rightBarButtonItem = comment_item;
    }else
    {
        //添加
        UIButton *heartButton = [[UIButton alloc]initWithframe:CGRectMake(0, 0, 44, 44) buttonType:UIButtonTypeCustom nornalImage:[UIImage imageNamed:@"personal_jiaren_tianjia"] selectedImage:nil target:self action:@selector(clickToAdd:)];
        [heartButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
        UIBarButtonItem *comment_item=[[UIBarButtonItem alloc]initWithCustomView:heartButton];
        self.navigationItem.rightBarButtonItem = comment_item;
        return;
    }

}

- (UIView *)tableFooterView
{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 30 + 45)];
    view.backgroundColor = [UIColor clearColor];

    //确认预约按钮
    UIButton *sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    if (self.actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT ||
        self.actionType == PEOPLEACTIONTYPE_SELECT_Mul) {
        [sureBtn setTitle:@"确认选择体检人" forState:UIControlStateNormal];
    }else if (_actionType == PEOPLEACTIONTYPE_GuaHao)
    {
        [sureBtn setTitle:@"确认选择就诊人" forState:UIControlStateNormal];

    }else
    {
        [sureBtn setTitle:@"确认预约" forState:UIControlStateNormal];
    }
    sureBtn.backgroundColor = DEFAULT_TEXTCOLOR;
    sureBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    [sureBtn addCornerRadius:2.f];
    [sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [view addSubview:sureBtn];
    sureBtn.frame = CGRectMake(27, 15, DEVICE_WIDTH - 27 * 2, 45);
    [sureBtn addTarget:self action:@selector(clickToAppoint) forControlEvents:UIControlEventTouchUpInside];

    return view;
}

- (UIView *)tableHeadView
{
    UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 67)];

    UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 6, DEVICE_WIDTH, 56)];
    bgView.backgroundColor = [UIColor whiteColor];
    [headView addSubview:bgView];
    //本人
    UILabel *titleLable = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, 35, bgView.height) title:@"本人" font:16 align:NSTextAlignmentLeft textColor:[UIColor blackColor]];
    [bgView addSubview:titleLable];

    UserInfo *userInfo = [UserInfo userInfoForCache];

    NSString *name = userInfo.user_name;
    NSString *realName = userInfo.real_name;
    if (![LTools isEmpty:realName]) {
        name = realName;
    }

    UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(titleLable.right + 60, 0, 200, bgView.height) title:name font:15 align:NSTextAlignmentLeft textColor:[UIColor colorWithHexString:@"313131"]];
    [bgView addSubview:nameLabel];

    if (_actionType == PEOPLEACTIONTYPE_NORMAL) {

        UIImageView *editImage = [[UIImageView alloc]initWithFrame:CGRectMake(DEVICE_WIDTH - 15 - 7, (67-14)/2.f, 7, 14)];
        editImage.image = [UIImage imageNamed:@"personal_jiantou_r"];
        [bgView addSubview:editImage];
    }else
    {
        //图标 对号
        UIImageView *icon = [[UIImageView alloc]initWithFrame:CGRectMake(DEVICE_WIDTH - 15 - 14.5, 0, 14.5, 50)];
        icon.image = [UIImage imageNamed:@"duihao"];
        icon.contentMode = UIViewContentModeCenter;
        [bgView addSubview:icon];
        icon.hidden = YES;
        _selectedIcon = icon;
    }

    if (_isMyselfSelected) {
        _selectedIcon.hidden = NO;
    }else
    {
        _selectedIcon.hidden = YES;
    }

    [bgView addTaget:self action:@selector(clickToMe) tag:0];

    return headView;
}

#pragma - mark UIAlertViewDelegate <NSObject>

// Called when a button is clicked. The view will be automatically dismissed after this call returns
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex == 1){

        if (alertView.tag == kTag_Appoint) {

            [self networkForMakeAppoint];//提交预约

        }else if (alertView.tag == KTag_EditUserInfo){

            //去编辑个人信息

            [self clickToEditUserInfoIsFull:YES];
        }

        if (alertView.tag == kTag_Delete) {

            [self deleteFamily:_deleteIndex];
        }
    }else if (buttonIndex == 0){

        if (alertView.tag == kTag_Appoint_success) {
            [self appointSuccess];
        }
    }
}

#pragma - mark RefreshDelegate

- (void)loadNewDataForTableView:(UITableView *)tableView
{
    [self getFamily];
}
- (void)loadMoreDataForTableView:(UITableView *)tableView
{

}
//新加
- (void)didSelectRowAtIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
    UserInfo *aModel = _table.dataArray[indexPath.row];

    //大于0表示需要判断性别
    //男或者女时判断选择人的性别
    if (self.gender == Gender_Boy || self.gender == Gender_Girl) {

        Gender gender_select = [aModel.gender intValue];

        if (gender_select != self.gender) {

            NSString *title = self.gender == Gender_Girl ? @"本套餐仅适用于\"女\"性" : @"本套餐仅适用于\"男\"性";
            [LTools showMBProgressWithText:title addToView:self.view];
            return;
        }
    }

    if (_isEdit) {//在编辑
        NSLog(@"删除");
        _deleteIndex = (int)indexPath.row;
        NSString *text = [NSString stringWithFormat:@"是否删除\"%@\"\"%@\"?",aModel.appellation,aModel.family_user_name];
        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:text delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
        alert.tag = kTag_Delete;
        [alert show];
    }else
    {
        NSString *uid = aModel.family_uid;

        if (_actionType == PEOPLEACTIONTYPE_NORMAL) {

            [self clickToUserInfo:aModel];

        }else if (_actionType == PEOPLEACTIONTYPE_SELECT_Single){

            if ([self enableSelectNewPeople]) {
                [_selectedArray addObject:uid];
                [_selectedUserArray addObject:aModel];//记录model
            }
            [tableView reloadData];

            //选择成功回调
            [self selectPeople:aModel myself:NO];

        }else if (_actionType == PEOPLEACTIONTYPE_SELECT_APPOINT ||
                  _actionType == PEOPLEACTIONTYPE_NOPAYAPPOINT ||
                  _actionType == PEOPLEACTIONTYPE_SELECT_Mul ||
                  _actionType == PEOPLEACTIONTYPE_GuaHao){

            if ([_selectedArray containsObject:uid]) {
                [_selectedArray removeObject:uid];
                UserInfo *temp;
                for (UserInfo *user in _selectedUserArray) {
                    if ([user.family_uid integerValue] == [uid integerValue]) {
                        temp = user;
                    }
                }
                if (temp) {
                    [_selectedUserArray removeObject:temp];
                }

            }else
            {

                if ([self enableSelectNewPeople]) {

                    [_selectedArray addObject:uid];
                    [_selectedUserArray addObject:aModel];

                }else
                {
                    return;
                }
            }

            [tableView reloadData];
        }
    }
}
- (CGFloat)heightForRowIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
    return 56.f;
}

- (UIView *)viewForHeaderInSection:(NSInteger)section tableView:(UITableView *)tableView
{
    if (!_view_tableHeader) {
        _view_tableHeader = [[UIView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 56)];
        _view_tableHeader.backgroundColor = [UIColor whiteColor];
        //本人
        UILabel *titleLable = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, 35, _view_tableHeader.height) title:@"家人" font:16 align:NSTextAlignmentLeft textColor:[UIColor blackColor]];
        [_view_tableHeader addSubview:titleLable];

        NSString *name = [NSString stringWithFormat:@"%d位",(int)_table.dataArray.count];
        UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(titleLable.right + 60, 0, 200, _view_tableHeader.height) title:name font:15 align:NSTextAlignmentLeft textColor:[UIColor colorWithHexString:@"313131"]];
        [_view_tableHeader addSubview:nameLabel];
        _numLabel = nameLabel;

        _arrowBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _arrowBtn.frame = CGRectMake(DEVICE_WIDTH - 15 - 13, (67-7)/2.f, 13, 7);
        [_view_tableHeader addSubview:_arrowBtn];
        [_arrowBtn setImage:[UIImage imageNamed:@"personal_jiaren_jiantou_b"] forState:UIControlStateNormal];
        [_arrowBtn setImage:[UIImage imageNamed:@"personal_jiaren_jiantou_t"] forState:UIControlStateSelected];
        [_view_tableHeader addTaget:self action:@selector(clickToAction:) tag:0];

        //line
        UIImageView *line = [[UIImageView alloc]initWithFrame:CGRectMake(0, _view_tableHeader.height - 0.5, DEVICE_WIDTH, 0.5)];
        line.backgroundColor = DEFAULT_LINECOLOR;
        [_view_tableHeader addSubview:line];
    }

    return _view_tableHeader;
}
- (CGFloat)heightForHeaderInSection:(NSInteger)section tableView:(UITableView *)tableView
{
    return 56.f;
}

#pragma - mark UITableViewDataSource<NSObject>

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    if (!_isOpen) {
        return 0.f;
    }
    return _table.dataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    static NSString *identifier = @"peopleManagerCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];

        UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 56)];
        bgView.backgroundColor = [UIColor whiteColor];
        [cell.contentView addSubview:bgView];

        if (_actionType == PEOPLEACTIONTYPE_NORMAL) {

            UIImageView *arrow = [[UIImageView alloc]initWithFrame:CGRectMake(DEVICE_WIDTH - 15 - 7, (56-7-15)/2.f, 7, 14)];
            arrow.image = [UIImage imageNamed:@"personal_jiantou_r"];
            [bgView addSubview:arrow];
            arrow.tag = 104;
        }else
        {
            //图标 对号
            UIImageView *icon = [[UIImageView alloc]initWithFrame:CGRectMake(DEVICE_WIDTH - 15 - 14.5, 0, 14.5, 50)];
            icon.image = [UIImage imageNamed:@"duihao"];
            icon.contentMode = UIViewContentModeCenter;
            [cell.contentView addSubview:icon];
            icon.tag = 103;
        }

        UILabel *titleLable = [[UILabel alloc]initWithFrame:CGRectMake(15 * 2, 0, 100, bgView.height) title:nil font:16 align:NSTextAlignmentLeft textColor:[UIColor blackColor]];
        [bgView addSubview:titleLable];
        titleLable.tag = 100;

        NSString *name = nil;
        UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(titleLable.right, 0, DEVICE_WIDTH - titleLable.right - 10, bgView.height) title:name font:15 align:NSTextAlignmentLeft textColor:[UIColor colorWithHexString:@"313131"]];
        [bgView addSubview:nameLabel];
        nameLabel.tag = 101;

        //line
        UIImageView *line = [[UIImageView alloc]initWithFrame:CGRectMake(0, 56 - 0.5, DEVICE_WIDTH, 0.5)];
        line.backgroundColor = DEFAULT_LINECOLOR;
        [cell.contentView addSubview:line];

        //删除按钮
        UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [deleteBtn setTitle:@"删除" forState:UIControlStateNormal];
        deleteBtn.backgroundColor = [UIColor colorWithHexString:@"ed1f1f"];
        deleteBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        deleteBtn.frame = CGRectMake(DEVICE_WIDTH, 0, 70, 56);
        [bgView addSubview:deleteBtn];
        deleteBtn.tag = 102;
        deleteBtn.userInteractionEnabled = NO;

    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.textLabel.font = [UIFont systemFontOfSize:14];

    UILabel *title = [cell.contentView viewWithTag:100];
    UILabel *nameLabel = [cell.contentView viewWithTag:101];
    UIButton *deleteBtn = (UIButton *)[cell.contentView viewWithTag:102];

    UIImageView *icon = [cell.contentView viewWithTag:103];
    UIImageView *arrow = [cell.contentView viewWithTag:104];

    [UIView animateWithDuration:0.3 animations:^{
        deleteBtn.left = _isEdit ? DEVICE_WIDTH - 70 : DEVICE_WIDTH;
        arrow.hidden = _isEdit;
        title.left = _isEdit ? 5 : 30;
        nameLabel.left = title.right;
    }];

    UserInfo *aModel = _table.dataArray[indexPath.row];
    title.text = aModel.appellation;

    NSString *name = @"";
    NSString *alia = @"";
    Gender gender = [aModel.gender intValue];
    if (gender != Gender_NO && gender != Gender_Other) {

        alia = [NSString stringWithFormat:@"(%@)",gender == Gender_Boy ? @"男" : @"女" ];
        name = [NSString stringWithFormat:@"%@%@",aModel.family_user_name,alia];
    }else
    {
        name = aModel.family_user_name;
    }
    [nameLabel setAttributedText:[LTools attributedString:name keyword:alia color:[UIColor orangeColor]]];

    NSString *uid = aModel.family_uid;
    if ([_selectedArray containsObject:uid]) {
        icon.hidden = NO;
    }else
    {
        icon.hidden = YES;
    }

    return cell;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

@end


text:
Before("@lakeformation") do
  @service = Aws::LakeFormation::Resource.new
  @client = @service.client
end

After("@lakeformation") do
  # shared cleanup logic
end


text:
#include "sys_sys_types.h"
#include "LOG_bridge.h"
#include "POP_bridge.h"
#include "T_bridge.h"
#include "ooaofooa_classes.h"

/*
 * Instance Loader (from string data).
 */
Escher_iHandle_t
ooaofooa_C_DG_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] )
{
  Escher_iHandle_t return_identifier = 0;
  ooaofooa_C_DG * self = (ooaofooa_C_DG *) instance;
  /* Initialize application analysis class attributes.  */
  self->Id = (Escher_iHandle_t) Escher_atoi( avlstring[ 1 ] );
  Escher_strcpy( self->Name, avlstring[ 2 ] );
  return return_identifier;
}

/*
 * Select any where using referential/identifying attribute set.
 * If not_empty, relate this instance to the selected instance.
 */
void ooaofooa_C_DG_batch_relate( Escher_iHandle_t instance )
{
  ooaofooa_C_DG * ooaofooa_C_DG_instance = (ooaofooa_C_DG *) instance;
  ooaofooa_PE_PE * ooaofooa_PE_PErelated_instance1 = (ooaofooa_PE_PE *) Escher_instance_cache[ (intptr_t) ooaofooa_C_DG_instance->Id ];
  if ( ooaofooa_PE_PErelated_instance1 ) {
    ooaofooa_C_DG_R8001_Link( ooaofooa_PE_PErelated_instance1, ooaofooa_C_DG_instance );
  }
}

/*
 * Scan the extent for a matching instance.
 */
ooaofooa_C_DG *
ooaofooa_C_DG_AnyWhere1( Escher_UniqueID_t w_Id )
{
  ooaofooa_C_DG * w;
  Escher_Iterator_s iter_C_DG;
  Escher_IteratorReset( &iter_C_DG, &pG_ooaofooa_C_DG_extent.active );
  while ( (w = (ooaofooa_C_DG *) Escher_IteratorNext( &iter_C_DG )) != 0 ) {
    if ( w->Id == w_Id ) {
      return w;
    }
  }
  return 0;
}

/*
 * RELATE PE_PE TO C_DG ACROSS R8001
 */
void
ooaofooa_C_DG_R8001_Link( ooaofooa_PE_PE * supertype, ooaofooa_C_DG * subtype )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  subtype->Id = supertype->Element_ID;
  /* Optimized linkage for C_DG->PE_PE[R8001] */
  subtype->PE_PE_R8001 = supertype;
  /* Optimized linkage for PE_PE->C_DG[R8001] */
  supertype->R8001_subtype = subtype;
  supertype->R8001_object_id = ooaofooa_C_DG_CLASS_NUMBER;
}

/*
 * UNRELATE PE_PE FROM C_DG ACROSS R8001
 */
void
ooaofooa_C_DG_R8001_Unlink( ooaofooa_PE_PE * supertype, ooaofooa_C_DG * subtype )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  subtype->PE_PE_R8001 = 0;
  supertype->R8001_subtype = 0;
  supertype->R8001_object_id = 0;
}

/*
 * Dump instances in SQL format.
 */
void
ooaofooa_C_DG_instancedumper( Escher_iHandle_t instance )
{
  ooaofooa_C_DG * self = (ooaofooa_C_DG *) instance;
  printf( "INSERT INTO C_DG VALUES ( %ld,'%s' );\n",
    ((long)self->Id & ESCHER_IDDUMP_MASK),
    self->Name );
}
/*
 * Statically allocate space for the instance population for this class.
 * Allocate space for the class instance and its attribute values.
 * Depending upon the collection scheme, allocate containoids (collection
 * nodes) for gathering instances into free and active extents.
 */
static Escher_SetElement_s ooaofooa_C_DG_container[ ooaofooa_C_DG_MAX_EXTENT_SIZE ];
static ooaofooa_C_DG ooaofooa_C_DG_instances[ ooaofooa_C_DG_MAX_EXTENT_SIZE ];
Escher_Extent_t pG_ooaofooa_C_DG_extent = {
  {0,0}, {0,0}, &ooaofooa_C_DG_container[ 0 ],
  (Escher_iHandle_t) &ooaofooa_C_DG_instances,
  sizeof( ooaofooa_C_DG ), 0, ooaofooa_C_DG_MAX_EXTENT_SIZE
  };


text: <script src=../../moment/locale/vi.js></script>


text:
package leap.orm.generator;

import leap.core.annotation.ConfigProperty;
import leap.core.annotation.Configurable;
import leap.lang.expression.AbstractExpression;
import leap.lang.expression.Expression;
import leap.lang.util.ShortUUID;
import leap.orm.mapping.EntityMappingBuilder;
import leap.orm.mapping.FieldMappingBuilder;
import leap.orm.metadata.MetadataContext;

import java.util.Map;
import java.util.UUID;

@Configurable(prefix = "orm.short_uuid")
public class ShortUUIDGenerator extends AbstractExpression implements IdGenerator, ValueGenerator,Expression {

    private int defaultColumnLength = 38;

    @Override
    public Integer getDefaultColumnLength() {
        return defaultColumnLength;
    }

    @ConfigProperty
    public void setDefaultColumnLength(int defaultColumnLength) {
        this.defaultColumnLength = defaultColumnLength;
    }

	@Override
    public void mapping(MetadataContext context, EntityMappingBuilder emb, FieldMappingBuilder fmb) {
		fmb.setInsertValue(this);
    }

	@Override
    protected Object eval(Object context, Map<String, Object> vars) {
		return ShortUUID.randomUUID();
    }

}


text:
<form action="/logout" method="POST">
    {{ csrf_field() }}
    <input type="submit" value="Logout">
</form>


text:
from ryu.lib import hub
hub.patch(thread=False)

# TODO:
#   Right now, we have our own patched copy of ovs python bindings
#   Once our modification is upstreamed and widely deployed,
#   use it
#
# NOTE: this modifies sys.path and thus affects the following imports.
# eg. oslo.config.cfg.
import ryu.contrib

from ryu import cfg
import logging
import sys

from ryu import log
log.early_init_log(logging.DEBUG)

from ryu import flags
from ryu import version
from ryu.app import wsgi
from ryu.base.app_manager import AppManager
from ryu.controller import controller
from ryu.topology import switches

CONF = cfg.CONF
CONF.register_cli_opts([
    cfg.ListOpt('app-lists', default=[],
                help='application module name to run'),
    cfg.MultiStrOpt('app', positional=True, default=[],
                    help='application module name to run'),
    cfg.StrOpt('pid-file', default=None, help='pid file name'),
    cfg.BoolOpt('enable-debugger', default=False,
                help='don\'t overwrite Python standard threading library'
                '(use only for debugging)'),
])

def main(args=None, prog=None):
    try:
        CONF(args=args, prog=prog,
             project='ryu', version='ryu-manager %s' % version,
             default_config_files=['/usr/local/etc/ryu/ryu.conf'])
    except cfg.ConfigFilesNotFoundError:
        CONF(args=args, prog=prog,
             project='ryu', version='ryu-manager %s' % version)

    log.init_log()

    if CONF.enable_debugger:
        LOG = logging.getLogger('ryu.cmd.manager')
        msg = 'debugging is available (--enable-debugger option is turned on)'
        LOG.info(msg)
    else:
        hub.patch(thread=True)

    if CONF.pid_file:
        import os
        with open(CONF.pid_file, 'w') as pid_file:
            pid_file.write(str(os.getpid()))

    app_lists = CONF.app_lists + CONF.app
    # keep old behaivor, run ofp if no application is specified.
    if not app_lists:
        app_lists = ['ryu.controller.ofp_handler']

    app_mgr = AppManager.get_instance()
    app_mgr.load_apps(app_lists)
    contexts = app_mgr.create_contexts()
    services = []
    services.extend(app_mgr.instantiate_apps(**contexts))

    webapp = wsgi.start_service(app_mgr)
    if webapp:
        thr = hub.spawn(webapp)
        services.append(thr)

    try:
        hub.joinall(services)
    finally:
        app_mgr.close()

if __name__ == "__main__":
    main()


text:
package com.swfarm.biz.chain.web;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.swfarm.biz.chain.dto.SearchSscTicketsCriteria;
import com.swfarm.pub.framework.OrderItem;
import com.swfarm.pub.utils.DateUtils;

public class SearchSscTicketsController extends AbstractController {

	protected ModelAndView handleRequestInternal(HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		SearchSscTicketsCriteria criteria = new SearchSscTicketsCriteria();
		String articleNumber = req.getParameter("articleNumber");
		if (StringUtils.isNotEmpty(articleNumber)) {
			criteria.setArticleNumber(articleNumber);
		}
		String productManagerNo = req.getParameter("productManagerNo");
		if (StringUtils.isNotEmpty(productManagerNo)) {
			criteria.setProductManagerNo(productManagerNo);
		}
		String minQuantityGap = req.getParameter("minQuantityGap");
		if (StringUtils.isNotEmpty(minQuantityGap)) {
			criteria.setMinQuantityGap(new Double(minQuantityGap));
		}
		String maxQuantityGap = req.getParameter("maxQuantityGap");
		if (StringUtils.isNotEmpty(maxQuantityGap)) {
			criteria.setMaxQuantityGap(new Double(maxQuantityGap));
		}
		String startDateStr = req.getParameter("startDate");
		if (StringUtils.isNotEmpty(startDateStr)) {
			criteria.setStartDate(DateUtils.stringToDate(startDateStr,
					"yyyy/MM/dd"));
		}
		String endDateStr = req.getParameter("endDate");
		if (StringUtils.isNotEmpty(endDateStr)) {
			criteria.setEndDate(DateUtils
					.stringToDate(endDateStr, "yyyy/MM/dd"));
		}
		String[] sscTicketProcessSteps = req
				.getParameterValues("sscTicketProcessSteps");
		criteria.setSscTicketProcessSteps(sscTicketProcessSteps);
		String[] orderItemInfos = req.getParameterValues("orderItem");
		if (orderItemInfos != null && orderItemInfos.length > 0) {
			for (int i = 0; i < orderItemInfos.length; i++) {
				String[] orderItemInfo = StringUtils.split(orderItemInfos[i],
						"|");
				OrderItem orderItem = new OrderItem();
				orderItem.setField(orderItemInfo[0]);
				orderItem.setStatus(orderItemInfo[1]);
				orderItem.setIndex(new Integer(orderItemInfo[2]));
				criteria.addOrderItem(orderItem);
			}
		}
		Map dataMap = new HashMap();
		if (!(criteria.getArticleNumber() == null
				&& criteria.getProductManagerNo() == null
				&& criteria.getMinQuantityGap() == null
				&& criteria.getMaxQuantityGap() == null
				&& criteria.getStartDate() == null
				&& criteria.getEndDate() == null
				&& criteria.getSscTicketProcessSteps() == null && CollectionUtils
					.isEmpty(criteria.getOrderItemList()))) {
			dataMap.put("criteria", criteria);
		}
		String saction = req.getParameter("saction");
		if ("download".equals(saction)) {
			return new ModelAndView("forward:/chain/download_ssctickets.shtml",
					dataMap);
		}
		return new ModelAndView("forward:/chain/ssctickets.shtml", dataMap);
	}
}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Completion.Providers
{
    internal class KeywordCompletionItem : CompletionItem
    {
        public KeywordCompletionItem(CompletionListProvider completionProvider, string displayText, TextSpan filterSpan, Func<CancellationToken, Task<ImmutableArray<SymbolDisplayPart>>> descriptionFactory, Glyph? glyph, bool isIntrinsic, bool shouldFormatOnCommit = false)
            : base(completionProvider, displayText, filterSpan, descriptionFactory, glyph, shouldFormatOnCommit: shouldFormatOnCommit, rules: KeywordCompletionItemRules.Instance)
        {
            this.IsIntrinsic = isIntrinsic;
        }

        public bool IsIntrinsic { get; }
    }
}


text:
package cn.buaa.myweixin;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class Login extends Activity {
	private EditText mUser; // 帐号编辑框
	private EditText mPassword; // 密码编辑框

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);

        mUser = (EditText)findViewById(R.id.login_user_edit);
        mPassword = (EditText)findViewById(R.id.login_passwd_edit);

    }

    public void login_mainweixin(View v) {
    	if("buaa".equals(mUser.getText().toString()) && "123".equals(mPassword.getText().toString()))   //判断 帐号和密码
        {
             Intent intent = new Intent();
             intent.setClass(Login.this,LoadingActivity.class);
             startActivity(intent);
             //Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
          }
        else if("".equals(mUser.getText().toString()) || "".equals(mPassword.getText().toString()))   //判断 帐号和密码
        {
        	new AlertDialog.Builder(Login.this)
			.setIcon(getResources().getDrawable(R.drawable.login_error_icon))
			.setTitle("登录错误")
			.setMessage("微信帐号或者密码不能为空,\n请输入后再登录!")
			.create().show();
         }
        else{

        	new AlertDialog.Builder(Login.this)
			.setIcon(getResources().getDrawable(R.drawable.login_error_icon))
			.setTitle("登录失败")
			.setMessage("微信帐号或者密码不正确,\n请检查后重新输入!")
			.create().show();
        }

    	//登录按钮
    	/*
      	Intent intent = new Intent();
		intent.setClass(Login.this,Whatsnew.class);
		startActivity(intent);
		Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
		this.finish();*/
      }
    public void login_back(View v) {     //标题栏 返回按钮
      	this.finish();
      }
    public void login_pw(View v) {     //忘记密码按钮
    	Uri uri = Uri.parse("http://3g.qq.com");
    	Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    	startActivity(intent);
    	//Intent intent = new Intent();
    	//intent.setClass(Login.this,Whatsnew.class);
        //startActivity(intent);
      }
}


text:
describe('Remote', function() {

  beforeEach(function() {
    jasmine.Transport.useMock();

    this.remote = new Remote({
      url: '/test?q=%QUERY',
      prepare: function(x) { return x; },
      transform: function(x) { return x; }
    });

    this.transport = this.remote.transport;
  });

  describe('#cancelLastRequest', function() {
    it('should cancel last request', function() {
      this.remote.cancelLastRequest();
      expect(this.transport.cancel).toHaveBeenCalled();
    });
  });

  describe('#get', function() {
    it('should have sensible default request settings', function() {
      var spy;

      spy = jasmine.createSpy();
      spyOn(this.remote, 'prepare');

      this.remote.get('foo', spy);

      expect(this.remote.prepare).toHaveBeenCalledWith('foo', {
        url: '/test?q=%QUERY',
        type: 'GET',
        dataType: 'json'
      });
    });

    it('should transform request settings with prepare', function() {
      var spy;

      spy = jasmine.createSpy();
      spyOn(this.remote, 'prepare').andReturn([{ foo: 'bar' }]);

      this.remote.get('foo', spy);

      expect(this.transport.get)
      .toHaveBeenCalledWith([{ foo: 'bar' }], jasmine.any(Function));
    });

    it('should transform response with transform', function() {
      var spy;

      spy = jasmine.createSpy();
      spyOn(this.remote, 'transform').andReturn([{ foo: 'bar' }]);
      this.transport.get.andCallFake(function(_, cb) { cb(null, {}); });

      this.remote.get('foo', spy);

      expect(spy).toHaveBeenCalledWith([{ foo: 'bar' }]);
    });

    it('should return empty array on error', function() {
      var spy;

      spy = jasmine.createSpy();
      this.transport.get.andCallFake(function(_, cb) { cb(true); });

      this.remote.get('foo', spy);

      expect(spy).toHaveBeenCalledWith([]);
    });
  });
});