text:
#import "Criterion.h"

@class NSString;

@interface MessageCriterion : Criterion
{
    int _specialMailboxType;
    NSString *_groupUniqueID;
}

+ (void)initialize;
+ (id)messagesInConversationCriterionWithConversationIDs:(id)arg1;
+ (void)_updateAddressComments:(id)arg1;
+ (int)criterionTypeForString:(id)arg1;
+ (id)stringForCriterionType:(int)arg1;
- (id)initWithDictionary:(id)arg1 andRemoveRecognizedKeysIfMutable:(BOOL)arg2;
- (void)dealloc;
- (BOOL)isEqual:(id)arg1;
- (BOOL)isEquivalent:(id)arg1;
- (id)dictionaryRepresentation;
- (void)setCriterionIdentifier:(id)arg1;
- (id)recursiveGroupUniqueIDs;
- (id)_headersRequiredForEvaluation;
- (void)addHeadersRequiredForRoutingToArray:(id)arg1;
- (BOOL)_evaluateDateCriterion:(id)arg1;
- (BOOL)_evaluateHeaderCriterion:(id)arg1;
- (BOOL)_evaluateBodyCriterion:(id)arg1;
- (BOOL)_evaluateAddressBookCriterion:(id)arg1;
- (BOOL)_doesGroup:(id)arg1 containSender:(id)arg2;
- (BOOL)_evaluateMemberOfGroupCriterion:(id)arg1;
- (BOOL)_evaluateAccountCriterion:(id)arg1;
- (BOOL)_evaluateAddressHistoryCriterion:(id)arg1;
- (BOOL)_evaluateFullNameCriterion:(id)arg1;
- (BOOL)_evaluateIsDigitallySignedCriterion:(id)arg1;
- (BOOL)_evaluateIsEncryptedCriterion:(id)arg1;
- (BOOL)_evaluateMessageTypeCriterion:(id)arg1;
- (BOOL)_evaluatePriorityIsNormalCriterion:(id)arg1;
- (BOOL)_evaluatePriorityIsHighCriterion:(id)arg1;
- (BOOL)_evaluatePriorityIsLowCriterion:(id)arg1;
- (BOOL)_evaluateJunkMailHeaders:(id)arg1;
- (BOOL)_evaluateJunkMailCriterion:(id)arg1;
- (BOOL)_evaluateAttachmentCriterion:(id)arg1;
- (BOOL)_evaluateCompoundCriterion:(id)arg1;
- (BOOL)_evaluateFlagCriterion:(id)arg1;
- (BOOL)_evaluateMailboxCriterion:(id)arg1;
- (BOOL)_evaluateSpecialMailboxCriterion:(id)arg1;
- (BOOL)_evaluateFlaggedStatusCriterion:(id)arg1;
- (BOOL)doesMessageSatisfyRuleEvaluationCriterion:(id)arg1;
- (BOOL)_evaluateMessage:(id)arg1;
- (BOOL)evaluateMessage:(id)arg1;
- (BOOL)hasExpression;
- (BOOL)allowsEmptyExpression;
- (BOOL)hasQualifier;
- (BOOL)isValid:(id *)arg1 options:(unsigned int)arg2;
- (BOOL)containsBodyCriterion;
- (id)emailAddressesForGroupCriterion;
- (id)criterionByExpandingGroup;
- (id)criterionByExpandingSpecialMailboxCriterion;
- (BOOL)_containsCriterion:(int)arg1;
- (BOOL)containsLastViewedDateCriterion;
- (BOOL)containsIncludeConversationsCriterion;
- (BOOL)containsMessageIsNotInATrashMailboxCriterion;
- (BOOL)containsRelativeDateCriteria;
- (BOOL)containsAddressBookCriteria;
@property(copy) NSString *groupUniqueID; // @synthesize groupUniqueID=_groupUniqueID;
@property int specialMailboxType; // @synthesize specialMailboxType=_specialMailboxType;
- (id)fixOnceWithExpandedSmartMailboxes:(id)arg1;
- (id)criterionByMergingBodyCriteria;
- (BOOL)hasNumberCriterion;
- (BOOL)isExpressibleInTigerSchema;
- (id)SQLExpressionWithContext:(CDStruct_c53ccb4e *)arg1 depth:(unsigned long long)arg2 enclosingSmartMailboxes:(id)arg3;
- (int)ruleType;
- (void)setRuleType:(int)arg1;
- (id)ruleHeader;
- (void)setRuleHeader:(id)arg1;
- (int)ruleQualifier;
- (void)setRuleQualifier:(int)arg1;
- (id)ruleExpression;
- (void)setRuleExpression:(id)arg1;

@end


text:
module LiftToToplevel.C3  where

import LiftToToplevel.D3(pow)

anotherFun (x:xs) =  x^pow + anotherFun xs

anotherFun [] = 0

redpajama_set_name: RedPajamaGithub


text:
This project runs static simulator code. It transmits sensor values over serial
in ASCII.

The following sensors are used:
 - steer encoder, TIM5, 115200 counts/rev with index

The main loop transmits the following at 1 kHz:
 - short gitsha1
 - realtime counter [rtcnt_t]
 - steer encoder count

The realtime clock runs at 168 MHz for the STM32F405.


text:
var util = require('util');
var plugins = require('../../services/plugins');
var Field = plugins.require('models/fields/field');
var log   = plugins.require('services/log')(module);
var file  = plugins.require('services/file');

function File() {
    this.multipart = true;
    this.multiple  = false;
    Field.call(this);
}

util.inherits(File, Field);

module.exports = File;


text:
namespace XenAdmin.Wizards.DRWizards
{
    partial class DRFailoverWizardFirstPage
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DRFailoverWizardFirstPage));
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.labelInformation1 = new System.Windows.Forms.Label();
            this.labelInformation2 = new System.Windows.Forms.Label();
            this.labelInformation3 = new System.Windows.Forms.Label();
            this.panelWarning = new System.Windows.Forms.TableLayoutPanel();
            this.labelInformation4 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.label6 = new System.Windows.Forms.Label();
            this.tableLayoutPanel1.SuspendLayout();
            this.panelWarning.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
            this.tableLayoutPanel1.Controls.Add(this.labelInformation1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.labelInformation2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.labelInformation3, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.panelWarning, 0, 3);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            //
            // labelInformation1
            //
            resources.ApplyResources(this.labelInformation1, "labelInformation1");
            this.labelInformation1.Name = "labelInformation1";
            //
            // labelInformation2
            //
            resources.ApplyResources(this.labelInformation2, "labelInformation2");
            this.labelInformation2.Name = "labelInformation2";
            //
            // labelInformation3
            //
            resources.ApplyResources(this.labelInformation3, "labelInformation3");
            this.labelInformation3.Name = "labelInformation3";
            //
            // panelWarning
            //
            resources.ApplyResources(this.panelWarning, "panelWarning");
            this.panelWarning.Controls.Add(this.labelInformation4, 1, 1);
            this.panelWarning.Controls.Add(this.pictureBox1, 0, 0);
            this.panelWarning.Controls.Add(this.label6, 1, 0);
            this.panelWarning.Name = "panelWarning";
            //
            // labelInformation4
            //
            resources.ApplyResources(this.labelInformation4, "labelInformation4");
            this.labelInformation4.Name = "labelInformation4";
            //
            // pictureBox1
            //
            this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32;
            resources.ApplyResources(this.pictureBox1, "pictureBox1");
            this.pictureBox1.Name = "pictureBox1";
            this.panelWarning.SetRowSpan(this.pictureBox1, 2);
            this.pictureBox1.TabStop = false;
            //
            // label6
            //
            resources.ApplyResources(this.label6, "label6");
            this.label6.Name = "label6";
            //
            // DRFailoverWizardFirstPage
            //
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "DRFailoverWizardFirstPage";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.panelWarning.ResumeLayout(false);
            this.panelWarning.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Label labelInformation1;
        private System.Windows.Forms.Label labelInformation2;
        private System.Windows.Forms.Label labelInformation3;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Label labelInformation4;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.TableLayoutPanel panelWarning;
    }
}


text:
package main

import (
	"fmt"

	"github.com/appleboy/easyssh-proxy"
)

func main() {
	// Create MakeConfig instance with remote username, server address and path to private key.
	ssh := &easyssh.MakeConfig{
		User:     "appleboy",
		Server:   "example.com",
		Password: "123qwe",
		Port:     "22",
	}

	// Call Scp method with file you want to upload to remote server.
	// Please make sure the `tmp` floder exists.
	err := ssh.Scp("/root/source.csv", "/tmp/target.csv")

	// Handle errors
	if err != nil {
		panic("Can't run remote command: " + err.Error())
	} else {
		fmt.Println("success")
	}
}


text:
layout: post
microblog: true
date: 2010-07-26 03:00 +0300
guid: http://desparoz.micro.blog/2010/07/26/t19534721405.html
---
Belmore Basin (Wollongong Harbour) is a beautiful spot at sunrise @wollongong_nsw


text:
from __future__ import unicode_literals

from django.db import migrations, models
import datetime
from django.utils.timezone import utc

class Migration(migrations.Migration):

    dependencies = [
        ('petitions', '0010_auto_20151023_1134'),
    ]

    operations = [
        migrations.AddField(
            model_name='petitionsign',
            name='timestamp',
            field=models.DateTimeField(auto_now=True, default=datetime.datetime(2015, 10, 23, 15, 51, 48, 611715, tzinfo=utc)),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='petitionstatuschange',
            name='comment',
            field=models.TextField(blank=True, null=True),
        ),
    ]


text:
import com.intellij.codeInsight.intention.*;

import java.util.*;

class MyIntentionAction implements IntentionAction {
  String s;
  List<?> <warning descr="Field may prevent intention preview from working properly">list</warning>;
}


text:
class Bluetooth(object):
    '''Bluetooth facade.
    '''

    def enable(self):
        '''Start the Bluetooth.
        '''
        self._enable()

    def is_enabled(self):
        ''' Return 'True' if Bluetooth is enabled.
        '''
        self._is_enabled()

    def disable(self):
        '''Stop the Bluetooth.
        '''
        self._disable()

    def visible(self):
        '''Turn on Bluetooth visiblity
        '''
        self._visible()

    def connect(self, name):
        '''connect to a bluetooth device
        '''
        self._connect(name=name)

    def disconnect(self, name):
        '''disconnect to a bluetooth device
        '''
        self._disconnect(name=name)

    def pair(self, name):
        ''' pair a bluetooth device
        '''
        self._pair(name=name)

    def scan(self):
        ''' Start scanning for nearby bluetooth devices.
        '''
        self._scan()

    def get_paired_devices(self):
        ''' Get list of paired devices.
        '''
        return self._get_paired_devices()

    def get_scan_devices(self):
        ''' Get the scanned devices.
        '''
        return self._get_scan_devices()

    # private

    def _enable(self):
        raise NotImplementedError()

    def _is_enabled(self):
        raise NotImplementedError()

    def _disable(self):
        raise NotImplementedError()

    def _visible(self):
        raise NotImplementedError()

    def _connect(self, **kwargs):
        raise NotImplementedError()

    def _disconnect(self, **kwargs):
        raise NotImplementedError()

    def _pair(self, **kwargs):
        raise NotImplementedError()

    def _scan(self):
        raise NotImplementedError()

    def _get_paired_devices(self):
        raise NotImplementedError()

    def _get_scan_devices(self):
raise NotImplementedError()


text:
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.apache.gora.tutorial.log.generated;
@SuppressWarnings("all")
public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"MetricDatum\",\"namespace\":\"org.apache.gora.tutorial.log.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"metricDimension\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"timestamp\",\"type\":\"long\",\"default\":0},{\"name\":\"metric\",\"type\":\"long\",\"default\":0}]}");
  /** Bytes used to represent weather or not a field is dirty. */
  private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
  private java.lang.CharSequence metricDimension;
  private long timestamp;
  private long metric;
  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return __g__dirty;
    case 1: return metricDimension;
    case 2: return timestamp;
    case 3: return metric;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value) {
    switch (field$) {
    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
    case 1: metricDimension = (java.lang.CharSequence)(value); break;
    case 2: timestamp = (java.lang.Long)(value); break;
    case 3: metric = (java.lang.Long)(value); break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'metricDimension' field.
   */
  public java.lang.CharSequence getMetricDimension() {
    return metricDimension;
  }

  /**
   * Sets the value of the 'metricDimension' field.
   * @param value the value to set.
   */
  public void setMetricDimension(java.lang.CharSequence value) {
    this.metricDimension = value;
    setDirty(1);
  }

  /**
   * Checks the dirty status of the 'metricDimension' field. A field is dirty if it represents a change that has not yet been written to the database.
   * @param value the value to set.
   */
  public boolean isMetricDimensionDirty(java.lang.CharSequence value) {
    return isDirty(1);
  }

  /**
   * Gets the value of the 'timestamp' field.
   */
  public java.lang.Long getTimestamp() {
    return timestamp;
  }

  /**
   * Sets the value of the 'timestamp' field.
   * @param value the value to set.
   */
  public void setTimestamp(java.lang.Long value) {
    this.timestamp = value;
    setDirty(2);
  }

  /**
   * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database.
   * @param value the value to set.
   */
  public boolean isTimestampDirty(java.lang.Long value) {
    return isDirty(2);
  }

  /**
   * Gets the value of the 'metric' field.
   */
  public java.lang.Long getMetric() {
    return metric;
  }

  /**
   * Sets the value of the 'metric' field.
   * @param value the value to set.
   */
  public void setMetric(java.lang.Long value) {
    this.metric = value;
    setDirty(3);
  }

  /**
   * Checks the dirty status of the 'metric' field. A field is dirty if it represents a change that has not yet been written to the database.
   * @param value the value to set.
   */
  public boolean isMetricDirty(java.lang.Long value) {
    return isDirty(3);
  }

  /** Creates a new MetricDatum RecordBuilder */
  public static org.apache.gora.tutorial.log.generated.MetricDatum.Builder newBuilder() {
    return new org.apache.gora.tutorial.log.generated.MetricDatum.Builder();
  }

  /** Creates a new MetricDatum RecordBuilder by copying an existing Builder */
  public static org.apache.gora.tutorial.log.generated.MetricDatum.Builder newBuilder(org.apache.gora.tutorial.log.generated.MetricDatum.Builder other) {
    return new org.apache.gora.tutorial.log.generated.MetricDatum.Builder(other);
  }

  /** Creates a new MetricDatum RecordBuilder by copying an existing MetricDatum instance */
  public static org.apache.gora.tutorial.log.generated.MetricDatum.Builder newBuilder(org.apache.gora.tutorial.log.generated.MetricDatum other) {
    return new org.apache.gora.tutorial.log.generated.MetricDatum.Builder(other);
  }

  private static java.nio.ByteBuffer deepCopyToWriteOnlyBuffer(
      java.nio.ByteBuffer input) {
    java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
    int position = input.position();
    input.reset();
    int mark = input.position();
    int limit = input.limit();
    input.rewind();
    input.limit(input.capacity());
    copy.put(input);
    input.rewind();
    copy.rewind();
    input.position(mark);
    input.mark();
    copy.position(mark);
    copy.mark();
    input.position(position);
    copy.position(position);
    input.limit(limit);
    copy.limit(limit);
    return copy.asReadOnlyBuffer();
  }

  /**
   * RecordBuilder for MetricDatum instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<MetricDatum>
    implements org.apache.avro.data.RecordBuilder<MetricDatum> {

    private java.nio.ByteBuffer __g__dirty;
    private java.lang.CharSequence metricDimension;
    private long timestamp;
    private long metric;

    /** Creates a new Builder */
    private Builder() {
      super(org.apache.gora.tutorial.log.generated.MetricDatum.SCHEMA$);
    }

    /** Creates a Builder by copying an existing Builder */
    private Builder(org.apache.gora.tutorial.log.generated.MetricDatum.Builder other) {
      super(other);
    }

    /** Creates a Builder by copying an existing MetricDatum instance */
    private Builder(org.apache.gora.tutorial.log.generated.MetricDatum other) {
            super(org.apache.gora.tutorial.log.generated.MetricDatum.SCHEMA$);
      if (isValidValue(fields()[0], other.__g__dirty)) {
        this.__g__dirty = (java.nio.ByteBuffer) data().deepCopy(fields()[0].schema(), other.__g__dirty);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.metricDimension)) {
        this.metricDimension = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.metricDimension);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.timestamp)) {
        this.timestamp = (java.lang.Long) data().deepCopy(fields()[2].schema(), other.timestamp);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.metric)) {
        this.metric = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.metric);
        fieldSetFlags()[3] = true;
      }
    }

    /** Gets the value of the 'metricDimension' field */
    public java.lang.CharSequence getMetricDimension() {
      return metricDimension;
    }

    /** Sets the value of the 'metricDimension' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder setMetricDimension(java.lang.CharSequence value) {
      validate(fields()[1], value);
      this.metricDimension = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /** Checks whether the 'metricDimension' field has been set */
    public boolean hasMetricDimension() {
      return fieldSetFlags()[1];
    }

    /** Clears the value of the 'metricDimension' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder clearMetricDimension() {
      metricDimension = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'timestamp' field */
    public java.lang.Long getTimestamp() {
      return timestamp;
    }

    /** Sets the value of the 'timestamp' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder setTimestamp(long value) {
      validate(fields()[2], value);
      this.timestamp = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /** Checks whether the 'timestamp' field has been set */
    public boolean hasTimestamp() {
      return fieldSetFlags()[2];
    }

    /** Clears the value of the 'timestamp' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder clearTimestamp() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'metric' field */
    public java.lang.Long getMetric() {
      return metric;
    }

    /** Sets the value of the 'metric' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder setMetric(long value) {
      validate(fields()[3], value);
      this.metric = value;
      fieldSetFlags()[3] = true;
      return this;
    }

    /** Checks whether the 'metric' field has been set */
    public boolean hasMetric() {
      return fieldSetFlags()[3];
    }

    /** Clears the value of the 'metric' field */
    public org.apache.gora.tutorial.log.generated.MetricDatum.Builder clearMetric() {
      fieldSetFlags()[3] = false;
      return this;
    }

    @Override
    public MetricDatum build() {
      try {
        MetricDatum record = new MetricDatum();
        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
        record.metricDimension = fieldSetFlags()[1] ? this.metricDimension : (java.lang.CharSequence) defaultValue(fields()[1]);
        record.timestamp = fieldSetFlags()[2] ? this.timestamp : (java.lang.Long) defaultValue(fields()[2]);
        record.metric = fieldSetFlags()[3] ? this.metric : (java.lang.Long) defaultValue(fields()[3]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  public MetricDatum.Tombstone getTombstone(){
  	return TOMBSTONE;
  }

  public MetricDatum newInstance(){
    return newBuilder().build();
  }

  private static final Tombstone TOMBSTONE = new Tombstone();

  public static final class Tombstone extends MetricDatum implements org.apache.gora.persistency.Tombstone {

      private Tombstone() { }

	  				  /**
	   * Gets the value of the 'metricDimension' field.
		   */
	  public java.lang.CharSequence getMetricDimension() {
	    throw new java.lang.UnsupportedOperationException("Get is not supported on tombstones");
	  }

	  /**
	   * Sets the value of the 'metricDimension' field.
		   * @param value the value to set.
	   */
	  public void setMetricDimension(java.lang.CharSequence value) {
	    throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones");
	  }

	  /**
	   * Checks the dirty status of the 'metricDimension' field. A field is dirty if it represents a change that has not yet been written to the database.
		   * @param value the value to set.
	   */
	  public boolean isMetricDimensionDirty(java.lang.CharSequence value) {
	    throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones");
	  }

				  /**
	   * Gets the value of the 'timestamp' field.
		   */
	  public java.lang.Long getTimestamp() {
	    throw new java.lang.UnsupportedOperationException("Get is not supported on tombstones");
	  }

	  /**
	   * Sets the value of the 'timestamp' field.
		   * @param value the value to set.
	   */
	  public void setTimestamp(java.lang.Long value) {
	    throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones");
	  }

	  /**
	   * Checks the dirty status of the 'timestamp' field. A field is dirty if it represents a change that has not yet been written to the database.
		   * @param value the value to set.
	   */
	  public boolean isTimestampDirty(java.lang.Long value) {
	    throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones");
	  }

				  /**
	   * Gets the value of the 'metric' field.
		   */
	  public java.lang.Long getMetric() {
	    throw new java.lang.UnsupportedOperationException("Get is not supported on tombstones");
	  }

	  /**
	   * Sets the value of the 'metric' field.
		   * @param value the value to set.
	   */
	  public void setMetric(java.lang.Long value) {
	    throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones");
	  }

	  /**
	   * Checks the dirty status of the 'metric' field. A field is dirty if it represents a change that has not yet been written to the database.
		   * @param value the value to set.
	   */
	  public boolean isMetricDirty(java.lang.Long value) {
	    throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones");
	  }

  }

}


text:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/reboot.h>

#include <asm/firmware.h>
#include <asm/lv1call.h>
#include <asm/ps3.h>

#include "vuart.h"

/**
 * ps3_sys_manager - PS3 system manager driver.
 *
 * The system manager provides an asynchronous system event notification
 * mechanism for reporting events like thermal alert and button presses to
 * guests.  It also provides support to control system shutdown and startup.
 *
 * The actual system manager is implemented as an application running in the
 * system policy module in lpar_1.  Guests communicate with the system manager
 * through port 2 of the vuart using a simple packet message protocol.
 * Messages are comprised of a fixed field header followed by a message
 * specific payload.
 */

/**
 * struct ps3_sys_manager_header - System manager message header.
 * @version: Header version, currently 1.
 * @size: Header size in bytes, currently 16.
 * @payload_size: Message payload size in bytes.
 * @service_id: Message type, one of enum ps3_sys_manager_service_id.
 * @request_tag: Unique number to identify reply.
 */

struct ps3_sys_manager_header {
	/* version 1 */
	u8 version;
	u8 size;
	u16 reserved_1;
	u32 payload_size;
	u16 service_id;
	u16 reserved_2;
	u32 request_tag;
};

#define dump_sm_header(_h) _dump_sm_header(_h, __func__, __LINE__)
static void __maybe_unused _dump_sm_header(
	const struct ps3_sys_manager_header *h, const char *func, int line)
{
	pr_debug("%s:%d: version:      %xh\n", func, line, h->version);
	pr_debug("%s:%d: size:         %xh\n", func, line, h->size);
	pr_debug("%s:%d: payload_size: %xh\n", func, line, h->payload_size);
	pr_debug("%s:%d: service_id:   %xh\n", func, line, h->service_id);
	pr_debug("%s:%d: request_tag:  %xh\n", func, line, h->request_tag);
}

/**
 * @PS3_SM_RX_MSG_LEN_MIN - Shortest received message length.
 * @PS3_SM_RX_MSG_LEN_MAX - Longest received message length.
 *
 * Currently all messages received from the system manager are either
 * (16 bytes header + 8 bytes payload = 24 bytes) or (16 bytes header
 * + 16 bytes payload = 32 bytes).  This knowledge is used to simplify
 * the logic.
 */

enum {
	PS3_SM_RX_MSG_LEN_MIN = 24,
	PS3_SM_RX_MSG_LEN_MAX = 32,
};

/**
 * enum ps3_sys_manager_service_id - Message header service_id.
 * @PS3_SM_SERVICE_ID_REQUEST:       guest --> sys_manager.
 * @PS3_SM_SERVICE_ID_REQUEST_ERROR: guest <-- sys_manager.
 * @PS3_SM_SERVICE_ID_COMMAND:       guest <-- sys_manager.
 * @PS3_SM_SERVICE_ID_RESPONSE:      guest --> sys_manager.
 * @PS3_SM_SERVICE_ID_SET_ATTR:      guest --> sys_manager.
 * @PS3_SM_SERVICE_ID_EXTERN_EVENT:  guest <-- sys_manager.
 * @PS3_SM_SERVICE_ID_SET_NEXT_OP:   guest --> sys_manager.
 *
 * PS3_SM_SERVICE_ID_REQUEST_ERROR is returned for invalid data values in a
 * a PS3_SM_SERVICE_ID_REQUEST message.  It also seems to be returned when
 * a REQUEST message is sent at the wrong time.
 */

enum ps3_sys_manager_service_id {
	/* version 1 */
	PS3_SM_SERVICE_ID_REQUEST = 1,
	PS3_SM_SERVICE_ID_RESPONSE = 2,
	PS3_SM_SERVICE_ID_COMMAND = 3,
	PS3_SM_SERVICE_ID_EXTERN_EVENT = 4,
	PS3_SM_SERVICE_ID_SET_NEXT_OP = 5,
	PS3_SM_SERVICE_ID_REQUEST_ERROR = 6,
	PS3_SM_SERVICE_ID_SET_ATTR = 8,
};

/**
 * enum ps3_sys_manager_attr - Notification attribute (bit position mask).
 * @PS3_SM_ATTR_POWER: Power button.
 * @PS3_SM_ATTR_RESET: Reset button, not available on retail console.
 * @PS3_SM_ATTR_THERMAL: System thermal alert.
 * @PS3_SM_ATTR_CONTROLLER: Remote controller event.
 * @PS3_SM_ATTR_ALL: Logical OR of all.
 *
 * The guest tells the system manager which events it is interested in receiving
 * notice of by sending the system manager a logical OR of notification
 * attributes via the ps3_sys_manager_send_attr() routine.
 */

enum ps3_sys_manager_attr {
	/* version 1 */
	PS3_SM_ATTR_POWER = 1,
	PS3_SM_ATTR_RESET = 2,
	PS3_SM_ATTR_THERMAL = 4,
	PS3_SM_ATTR_CONTROLLER = 8, /* bogus? */
	PS3_SM_ATTR_ALL = 0x0f,
};

/**
 * enum ps3_sys_manager_event - External event type, reported by system manager.
 * @PS3_SM_EVENT_POWER_PRESSED: payload.value =
 *  enum ps3_sys_manager_button_event.
 * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec.
 * @PS3_SM_EVENT_RESET_PRESSED: payload.value =
 *  enum ps3_sys_manager_button_event.
 * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec.
 * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id.
 * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id.
 */

enum ps3_sys_manager_event {
	/* version 1 */
	PS3_SM_EVENT_POWER_PRESSED = 3,
	PS3_SM_EVENT_POWER_RELEASED = 4,
	PS3_SM_EVENT_RESET_PRESSED = 5,
	PS3_SM_EVENT_RESET_RELEASED = 6,
	PS3_SM_EVENT_THERMAL_ALERT = 7,
	PS3_SM_EVENT_THERMAL_CLEARED = 8,
	/* no info on controller events */
};

/**
 * enum ps3_sys_manager_button_event - Button event payload values.
 * @PS3_SM_BUTTON_EVENT_HARD: Hardware generated event.
 * @PS3_SM_BUTTON_EVENT_SOFT: Software generated event.
 */

enum ps3_sys_manager_button_event {
	PS3_SM_BUTTON_EVENT_HARD = 0,
	PS3_SM_BUTTON_EVENT_SOFT = 1,
};

/**
 * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed.
 */

enum ps3_sys_manager_next_op {
	/* version 3 */
	PS3_SM_NEXT_OP_SYS_SHUTDOWN = 1,
	PS3_SM_NEXT_OP_SYS_REBOOT = 2,
	PS3_SM_NEXT_OP_LPAR_REBOOT = 0x82,
};

/**
 * enum ps3_sys_manager_wake_source - Next-op wakeup source (bit position mask).
 * @PS3_SM_WAKE_DEFAULT: Disk insert, power button, eject button.
 * @PS3_SM_WAKE_W_O_L: Ether or wireless LAN.
 * @PS3_SM_WAKE_P_O_R: Power on reset.
 *
 * Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN.
 * The system will always wake from the PS3_SM_WAKE_DEFAULT sources.
 * Sources listed here are the only ones available to guests in the
 * other-os lpar.
 */

enum ps3_sys_manager_wake_source {
	/* version 3 */
	PS3_SM_WAKE_DEFAULT   = 0,
	PS3_SM_WAKE_W_O_L     = 0x00000400,
	PS3_SM_WAKE_P_O_R     = 0x80000000,
};

/**
 * user_wake_sources - User specified wakeup sources.
 *
 * Logical OR of enum ps3_sys_manager_wake_source types.
 */

static u32 user_wake_sources = PS3_SM_WAKE_DEFAULT;

/**
 * enum ps3_sys_manager_cmd - Command from system manager to guest.
 *
 * The guest completes the actions needed, then acks or naks the command via
 * ps3_sys_manager_send_response().  In the case of @PS3_SM_CMD_SHUTDOWN,
 * the guest must be fully prepared for a system poweroff prior to acking the
 * command.
 */

enum ps3_sys_manager_cmd {
	/* version 1 */
	PS3_SM_CMD_SHUTDOWN = 1, /* shutdown guest OS */
};

/**
 * ps3_sm_force_power_off - Poweroff helper.
 *
 * A global variable used to force a poweroff when the power button has
 * been pressed irrespective of how init handles the ctrl_alt_del signal.
 *
 */

static unsigned int ps3_sm_force_power_off;

/**
 * ps3_sys_manager_write - Helper to write a two part message to the vuart.
 *
 */

static int ps3_sys_manager_write(struct ps3_system_bus_device *dev,
	const struct ps3_sys_manager_header *header, const void *payload)
{
	int result;

	BUG_ON(header->version != 1);
	BUG_ON(header->size != 16);
	BUG_ON(header->payload_size != 8 && header->payload_size != 16);
	BUG_ON(header->service_id > 8);

	result = ps3_vuart_write(dev, header,
		sizeof(struct ps3_sys_manager_header));

	if (!result)
		result = ps3_vuart_write(dev, payload, header->payload_size);

	return result;
}

/**
 * ps3_sys_manager_send_attr - Send a 'set attribute' to the system manager.
 *
 */

static int ps3_sys_manager_send_attr(struct ps3_system_bus_device *dev,
	enum ps3_sys_manager_attr attr)
{
	struct ps3_sys_manager_header header;
	struct {
		u8 version;
		u8 reserved_1[3];
		u32 attribute;
	} payload;

	BUILD_BUG_ON(sizeof(payload) != 8);

	dev_dbg(&dev->core, "%s:%d: %xh\n", __func__, __LINE__, attr);

	memset(&header, 0, sizeof(header));
	header.version = 1;
	header.size = 16;
	header.payload_size = 16;
	header.service_id = PS3_SM_SERVICE_ID_SET_ATTR;

	memset(&payload, 0, sizeof(payload));
	payload.version = 1;
	payload.attribute = attr;

	return ps3_sys_manager_write(dev, &header, &payload);
}

/**
 * ps3_sys_manager_send_next_op - Send a 'set next op' to the system manager.
 *
 * Tell the system manager what to do after this lpar is destroyed.
 */

static int ps3_sys_manager_send_next_op(struct ps3_system_bus_device *dev,
	enum ps3_sys_manager_next_op op,
	enum ps3_sys_manager_wake_source wake_source)
{
	struct ps3_sys_manager_header header;
	struct {
		u8 version;
		u8 type;
		u8 gos_id;
		u8 reserved_1;
		u32 wake_source;
		u8 reserved_2[8];
	} payload;

	BUILD_BUG_ON(sizeof(payload) != 16);

	dev_dbg(&dev->core, "%s:%d: (%xh)\n", __func__, __LINE__, op);

	memset(&header, 0, sizeof(header));
	header.version = 1;
	header.size = 16;
	header.payload_size = 16;
	header.service_id = PS3_SM_SERVICE_ID_SET_NEXT_OP;

	memset(&payload, 0, sizeof(payload));
	payload.version = 3;
	payload.type = op;
	payload.gos_id = 3; /* other os */
	payload.wake_source = wake_source;

	return ps3_sys_manager_write(dev, &header, &payload);
}

/**
 * ps3_sys_manager_send_request_shutdown - Send 'request' to the system manager.
 *
 * The guest sends this message to request an operation or action of the system
 * manager.  The reply is a command message from the system manager.  In the
 * command handler the guest performs the requested operation.  The result of
 * the command is then communicated back to the system manager with a response
 * message.
 *
 * Currently, the only supported request is the 'shutdown self' request.
 */

static int ps3_sys_manager_send_request_shutdown(
	struct ps3_system_bus_device *dev)
{
	struct ps3_sys_manager_header header;
	struct {
		u8 version;
		u8 type;
		u8 gos_id;
		u8 reserved_1[13];
	} payload;

	BUILD_BUG_ON(sizeof(payload) != 16);

	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);

	memset(&header, 0, sizeof(header));
	header.version = 1;
	header.size = 16;
	header.payload_size = 16;
	header.service_id = PS3_SM_SERVICE_ID_REQUEST;

	memset(&payload, 0, sizeof(payload));
	payload.version = 1;
	payload.type = 1; /* shutdown */
	payload.gos_id = 0; /* self */

	return ps3_sys_manager_write(dev, &header, &payload);
}

/**
 * ps3_sys_manager_send_response - Send a 'response' to the system manager.
 * @status: zero = success, others fail.
 *
 * The guest sends this message to the system manager to acnowledge success or
 * failure of a command sent by the system manager.
 */

static int ps3_sys_manager_send_response(struct ps3_system_bus_device *dev,
	u64 status)
{
	struct ps3_sys_manager_header header;
	struct {
		u8 version;
		u8 reserved_1[3];
		u8 status;
		u8 reserved_2[11];
	} payload;

	BUILD_BUG_ON(sizeof(payload) != 16);

	dev_dbg(&dev->core, "%s:%d: (%s)\n", __func__, __LINE__,
		(status ? "nak" : "ack"));

	memset(&header, 0, sizeof(header));
	header.version = 1;
	header.size = 16;
	header.payload_size = 16;
	header.service_id = PS3_SM_SERVICE_ID_RESPONSE;

	memset(&payload, 0, sizeof(payload));
	payload.version = 1;
	payload.status = status;

	return ps3_sys_manager_write(dev, &header, &payload);
}

/**
 * ps3_sys_manager_handle_event - Second stage event msg handler.
 *
 */

static int ps3_sys_manager_handle_event(struct ps3_system_bus_device *dev)
{
	int result;
	struct {
		u8 version;
		u8 type;
		u8 reserved_1[2];
		u32 value;
		u8 reserved_2[8];
	} event;

	BUILD_BUG_ON(sizeof(event) != 16);

	result = ps3_vuart_read(dev, &event, sizeof(event));
	BUG_ON(result && "need to retry here");

	if (event.version != 1) {
		dev_dbg(&dev->core, "%s:%d: unsupported event version (%u)\n",
			__func__, __LINE__, event.version);
		return -EIO;
	}

	switch (event.type) {
	case PS3_SM_EVENT_POWER_PRESSED:
		dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n",
			__func__, __LINE__,
			(event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
			: "hard"));
		ps3_sm_force_power_off = 1;
		/*
		 * A memory barrier is use here to sync memory since
		 * ps3_sys_manager_final_restart() could be called on
		 * another cpu.
		 */
		wmb();
		kill_cad_pid(SIGINT, 1); /* ctrl_alt_del */
		break;
	case PS3_SM_EVENT_POWER_RELEASED:
		dev_dbg(&dev->core, "%s:%d: POWER_RELEASED (%u ms)\n",
			__func__, __LINE__, event.value);
		break;
	case PS3_SM_EVENT_RESET_PRESSED:
		dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n",
			__func__, __LINE__,
			(event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
			: "hard"));
		ps3_sm_force_power_off = 0;
		/*
		 * A memory barrier is use here to sync memory since
		 * ps3_sys_manager_final_restart() could be called on
		 * another cpu.
		 */
		wmb();
		kill_cad_pid(SIGINT, 1); /* ctrl_alt_del */
		break;
	case PS3_SM_EVENT_RESET_RELEASED:
		dev_dbg(&dev->core, "%s:%d: RESET_RELEASED (%u ms)\n",
			__func__, __LINE__, event.value);
		break;
	case PS3_SM_EVENT_THERMAL_ALERT:
		dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n",
			__func__, __LINE__, event.value);
		pr_info("PS3 Thermal Alert Zone %u\n", event.value);
		break;
	case PS3_SM_EVENT_THERMAL_CLEARED:
		dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n",
			__func__, __LINE__, event.value);
		break;
	default:
		dev_dbg(&dev->core, "%s:%d: unknown event (%u)\n",
			__func__, __LINE__, event.type);
		return -EIO;
	}

	return 0;
}
/**
 * ps3_sys_manager_handle_cmd - Second stage command msg handler.
 *
 * The system manager sends this in reply to a 'request' message from the guest.
 */

static int ps3_sys_manager_handle_cmd(struct ps3_system_bus_device *dev)
{
	int result;
	struct {
		u8 version;
		u8 type;
		u8 reserved_1[14];
	} cmd;

	BUILD_BUG_ON(sizeof(cmd) != 16);

	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);

	result = ps3_vuart_read(dev, &cmd, sizeof(cmd));
	BUG_ON(result && "need to retry here");

	if (result)
		return result;

	if (cmd.version != 1) {
		dev_dbg(&dev->core, "%s:%d: unsupported cmd version (%u)\n",
			__func__, __LINE__, cmd.version);
		return -EIO;
	}

	if (cmd.type != PS3_SM_CMD_SHUTDOWN) {
		dev_dbg(&dev->core, "%s:%d: unknown cmd (%u)\n",
			__func__, __LINE__, cmd.type);
		return -EIO;
	}

	ps3_sys_manager_send_response(dev, 0);
	return 0;
}

/**
 * ps3_sys_manager_handle_msg - First stage msg handler.
 *
 * Can be called directly to manually poll vuart and pump message handler.
 */

static int ps3_sys_manager_handle_msg(struct ps3_system_bus_device *dev)
{
	int result;
	struct ps3_sys_manager_header header;

	result = ps3_vuart_read(dev, &header,
		sizeof(struct ps3_sys_manager_header));

	if (result)
		return result;

	if (header.version != 1) {
		dev_dbg(&dev->core, "%s:%d: unsupported header version (%u)\n",
			__func__, __LINE__, header.version);
		dump_sm_header(&header);
		goto fail_header;
	}

	BUILD_BUG_ON(sizeof(header) != 16);

	if (header.size != 16 || (header.payload_size != 8
		&& header.payload_size != 16)) {
		dump_sm_header(&header);
		BUG();
	}

	switch (header.service_id) {
	case PS3_SM_SERVICE_ID_EXTERN_EVENT:
		dev_dbg(&dev->core, "%s:%d: EVENT\n", __func__, __LINE__);
		return ps3_sys_manager_handle_event(dev);
	case PS3_SM_SERVICE_ID_COMMAND:
		dev_dbg(&dev->core, "%s:%d: COMMAND\n", __func__, __LINE__);
		return ps3_sys_manager_handle_cmd(dev);
	case PS3_SM_SERVICE_ID_REQUEST_ERROR:
		dev_dbg(&dev->core, "%s:%d: REQUEST_ERROR\n", __func__,
			__LINE__);
		dump_sm_header(&header);
		break;
	default:
		dev_dbg(&dev->core, "%s:%d: unknown service_id (%u)\n",
			__func__, __LINE__, header.service_id);
		break;
	}
	goto fail_id;

fail_header:
	ps3_vuart_clear_rx_bytes(dev, 0);
	return -EIO;
fail_id:
	ps3_vuart_clear_rx_bytes(dev, header.payload_size);
	return -EIO;
}

static void ps3_sys_manager_fin(struct ps3_system_bus_device *dev)
{
	ps3_sys_manager_send_request_shutdown(dev);

	pr_emerg("System Halted, OK to turn off power\n");

	while (ps3_sys_manager_handle_msg(dev)) {
		/* pause until next DEC interrupt */
		lv1_pause(0);
	}

	while (1) {
		/* pause, ignoring DEC interrupt */
		lv1_pause(1);
	}
}

/**
 * ps3_sys_manager_final_power_off - The final platform machine_power_off routine.
 *
 * This routine never returns.  The routine disables asynchronous vuart reads
 * then spins calling ps3_sys_manager_handle_msg() to receive and acknowledge
 * the shutdown command sent from the system manager.  Soon after the
 * acknowledgement is sent the lpar is destroyed by the HV.  This routine
 * should only be called from ps3_power_off() through
 * ps3_sys_manager_ops.power_off.
 */

static void ps3_sys_manager_final_power_off(struct ps3_system_bus_device *dev)
{
	BUG_ON(!dev);

	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);

	ps3_vuart_cancel_async(dev);

	ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN,
		user_wake_sources);

	ps3_sys_manager_fin(dev);
}

/**
 * ps3_sys_manager_final_restart - The final platform machine_restart routine.
 *
 * This routine never returns.  The routine disables asynchronous vuart reads
 * then spins calling ps3_sys_manager_handle_msg() to receive and acknowledge
 * the shutdown command sent from the system manager.  Soon after the
 * acknowledgement is sent the lpar is destroyed by the HV.  This routine
 * should only be called from ps3_restart() through ps3_sys_manager_ops.restart.
 */

static void ps3_sys_manager_final_restart(struct ps3_system_bus_device *dev)
{
	BUG_ON(!dev);

	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);

	/* Check if we got here via a power button event. */

	if (ps3_sm_force_power_off) {
		dev_dbg(&dev->core, "%s:%d: forcing poweroff\n",
			__func__, __LINE__);
		ps3_sys_manager_final_power_off(dev);
	}

	ps3_vuart_cancel_async(dev);

	ps3_sys_manager_send_attr(dev, 0);
	ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
		user_wake_sources);

	ps3_sys_manager_fin(dev);
}

/**
 * ps3_sys_manager_get_wol - Get wake-on-lan setting.
 */

int ps3_sys_manager_get_wol(void)
{
	pr_debug("%s:%d\n", __func__, __LINE__);

	return (user_wake_sources & PS3_SM_WAKE_W_O_L) != 0;
}
EXPORT_SYMBOL_GPL(ps3_sys_manager_get_wol);

/**
 * ps3_sys_manager_set_wol - Set wake-on-lan setting.
 */

void ps3_sys_manager_set_wol(int state)
{
	static DEFINE_MUTEX(mutex);

	mutex_lock(&mutex);

	pr_debug("%s:%d: %d\n", __func__, __LINE__, state);

	if (state)
		user_wake_sources |= PS3_SM_WAKE_W_O_L;
	else
		user_wake_sources &= ~PS3_SM_WAKE_W_O_L;
	mutex_unlock(&mutex);
}
EXPORT_SYMBOL_GPL(ps3_sys_manager_set_wol);

/**
 * ps3_sys_manager_work - Asynchronous read handler.
 *
 * Signaled when PS3_SM_RX_MSG_LEN_MIN bytes arrive at the vuart port.
 */

static void ps3_sys_manager_work(struct ps3_system_bus_device *dev)
{
	ps3_sys_manager_handle_msg(dev);
	ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN);
}

static int ps3_sys_manager_probe(struct ps3_system_bus_device *dev)
{
	int result;
	struct ps3_sys_manager_ops ops;

	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);

	ops.power_off = ps3_sys_manager_final_power_off;
	ops.restart = ps3_sys_manager_final_restart;
	ops.dev = dev;

	/* ps3_sys_manager_register_ops copies ops. */

	ps3_sys_manager_register_ops(&ops);

	result = ps3_sys_manager_send_attr(dev, PS3_SM_ATTR_ALL);
	BUG_ON(result);

	result = ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN);
	BUG_ON(result);

	return result;
}

static int ps3_sys_manager_remove(struct ps3_system_bus_device *dev)
{
	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
	return 0;
}

static void ps3_sys_manager_shutdown(struct ps3_system_bus_device *dev)
{
	dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
}

static struct ps3_vuart_port_driver ps3_sys_manager = {
	.core.match_id = PS3_MATCH_ID_SYSTEM_MANAGER,
	.core.core.name = "ps3_sys_manager",
	.probe = ps3_sys_manager_probe,
	.remove = ps3_sys_manager_remove,
	.shutdown = ps3_sys_manager_shutdown,
	.work = ps3_sys_manager_work,
};

static int __init ps3_sys_manager_init(void)
{
	if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
		return -ENODEV;

	return ps3_vuart_port_driver_register(&ps3_sys_manager);
}

module_init(ps3_sys_manager_init);
/* Module remove not supported. */

MODULE_AUTHOR("Sony Corporation");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("PS3 System Manager");
MODULE_ALIAS(PS3_MODULE_ALIAS_SYSTEM_MANAGER);


text:
package org.esupportail.publisher.config.apidoc;

import org.springdoc.core.SpringDocConfigProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
JHipsterOpenApiEndpointConfiguration class.

 */
@Configuration
@ConditionalOnClass(SpringDocConfigProperties.class)
@AutoConfigureAfter(JHipsterSpringDocAutoConfiguration.class)
public class JHipsterOpenApiEndpointConfiguration {

    /**
     *
jHipsterOpenApiEndpoint.

     *
     * @param springDocConfigProperties a {@link org.springdoc.core.SpringDocConfigProperties} object.
     * @return a {@link JHipsterOpenApiEndpoint} object.
     */
    @Bean
    @ConditionalOnBean({SpringDocConfigProperties.class})
    @ConditionalOnMissingBean
    @ConditionalOnAvailableEndpoint
    public JHipsterOpenApiEndpoint jHipsterOpenApiEndpoint(
            SpringDocConfigProperties springDocConfigProperties,
            @Value("${spring.application.name:application}") String appName
            ) {
        return new JHipsterOpenApiEndpoint(springDocConfigProperties, appName);
    }
}


text:
package strace

import (
	"bytes"
	"context"
	"os"
	"os/exec"
	"testing"
	"time"

	"github.com/u-root/u-root/pkg/testutil"
	"github.com/u-root/u-root/pkg/uio/uiotest"
)

func prepareTestCmd(t *testing.T, cmd string) {
	// VM environment doesn't have makefiles or whatever. Just skip it.
	testutil.SkipIfInVMTest(t)

	if _, err := os.Stat(cmd); !os.IsNotExist(err) {
		if err != nil {
			t.Fatalf("Failed to find test program %q: %v", cmd, err)
		}
		return
	}

	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
	defer cancel()
	w := uiotest.TestLineWriter(t, "make all")

	c := exec.CommandContext(ctx, "make", "all")
	c.Stdout = w
	c.Stderr = w
	c.Dir = "./test"
	if err := c.Run(); err != nil {
		t.Fatalf("make failed: %v", err)
	}
}

func runAndCollectTrace(t *testing.T, cmd *exec.Cmd) []*TraceRecord {
	// Write strace logs to t.Logf.
	w := uiotest.TestLineWriter(t, "")
	traceChan := make(chan *TraceRecord)
	done := make(chan error, 1)

	go func() {
		done <- Trace(cmd, PrintTraces(w), RecordTraces(traceChan))
		close(traceChan)
	}()

	var events []*TraceRecord
	for r := range traceChan {
		events = append(events, r)
	}

	if err := <-done; err != nil {
		if os.IsNotExist(err) {
			t.Errorf("Trace exited with error -- did you compile the test programs? (cd ./test && make all): %v", err)
		} else {
			t.Errorf("Trace exited with error: %v", err)
		}
	}
	return events
}

func TestSingleThreaded(t *testing.T) {
	prepareTestCmd(t, "./test/hello")

	var b bytes.Buffer
	cmd := exec.Command("./test/hello")
	cmd.Stdout = &b

	runAndCollectTrace(t, cmd)
}

func TestMultiProcess(t *testing.T) {
	prepareTestCmd(t, "./test/fork")

	var b bytes.Buffer
	cmd := exec.Command("./test/fork")
	cmd.Stdout = &b

	runAndCollectTrace(t, cmd)
}


text:
package com.mcxtzhang.algorithm.other;

/**
 * Intro: 判断一个字符数组是否以suffix结尾,并写出case
 * Author: zhangxutong
 * E-mail: mcxtzhang@163.com
 * Home Page: http://blog.csdn.net/zxt0601
 * Created:   2017/8/15.
 * History:
 */
public class Suffix {
    public static void main(String[] args){
        //  I am a programmer, programmer
        //  I am a programmer, programme
        //  I am a programmer, rogrammer
        //  I am a programmer, a
        //  I am a programmer, prorammer
        //  I am a programmer, null
        //  I am a programmer, []

        //  null, programmer
        //  null, null
        //  null, []
        //  [], []

        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"programmer".toCharArray()));//true
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"programme".toCharArray()));//false
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"rogrammer".toCharArray()));//true
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"a".toCharArray()));//false
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"r".toCharArray()));//true
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),"prorammer".toCharArray()));//false
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),null));//false
        System.out.println(endWithSuffix("I am a programmer".toCharArray(),new char[0]));//true

        System.out.println(endWithSuffix(null,"programmer".toCharArray()));//false
        System.out.println(endWithSuffix(null,null));//false
        System.out.println(endWithSuffix(null,new char[0]));//false
        System.out.println(endWithSuffix(new char[0],new char[0]));//true

    }

    public static boolean endWithSuffix(char[] originalString, char[] suffix) {
        //1 空 2 长度 3 suffix的长度
        if (null == originalString || null == suffix) return false;
        if (suffix.length > originalString.length) return false;
        if (suffix.length == 0) return true;

        for (int i = 0; i < suffix.length; i++) {
            if (suffix[suffix.length - 1 - i] != originalString[originalString.length - 1 - i]) {
                return false;
            }
        }
        return true;

    }

}


text:
package org.ScripterRon.MyMoney;
import org.ScripterRon.Chart.*;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.SortedSet;

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;

/**
 * Display the net worth graph
 */
public final class NetWorthGraphDialog extends JDialog implements ActionListener {

    /** Start date field */
    private JFormattedTextField startField;

    /** End date field */
    private JFormattedTextField endField;

    /**
     * Construct the dialog
     *
     * @param       parent          Parent frame
     */
    public NetWorthGraphDialog(JFrame parent) {
        super(parent, "Net Worth", true);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

        //
        // Set the start date to the beginning of the year
        //
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(Main.getCurrentDate());
        cal.set(Calendar.DAY_OF_YEAR, 1);
        startField = new JFormattedTextField(new EditDate());
        startField.setColumns(8);
        startField.setInputVerifier(new EditInputVerifier(false));
        startField.addActionListener(new FormattedTextFieldListener(this));
        startField.setValue(cal.getTime());

        //
        // Set the end date to the current date
        //
        endField = new JFormattedTextField(new EditDate());
        endField.setColumns(8);
        endField.setInputVerifier(new EditInputVerifier(false));
        endField.addActionListener(new FormattedTextFieldListener(this));
        endField.setValue(Main.getCurrentDate());

        //
        // Create the edit pane
        //
        //    Start Date:        <text-field>
        //    End Date:          <text-field>
        //
        JPanel editPane = new JPanel(new GridLayout(0, 2, 5, 5));

        editPane.add(new JLabel("Start Date:", JLabel.RIGHT));
        editPane.add(startField);

        editPane.add(new JLabel("End Date:", JLabel.RIGHT));
        editPane.add(endField);

        //
        // Create the buttons (Create Graph, Done)
        //
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));

        JButton button = new JButton("Create Graph");
        button.setActionCommand("create graph");
        button.addActionListener(this);
        buttonPane.add(button);
        getRootPane().setDefaultButton(button);

        buttonPane.add(Box.createHorizontalStrut(10));

        button = new JButton("Done");
        button.setActionCommand("done");
        button.addActionListener(this);
        buttonPane.add(button);

        //
        // Set up the content pane
        //
        JPanel contentPane = new JPanel();
        contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
        contentPane.setOpaque(true);
        contentPane.setBorder(BorderFactory.createEmptyBorder(30, 30, 30, 30));
        contentPane.add(editPane);
        contentPane.add(Box.createVerticalStrut(15));
        contentPane.add(buttonPane);
        setContentPane(contentPane);
    }

    /**
     * Action performed (ActionListener interface)
     *
     * @param       ae              Action event
     */
    public void actionPerformed(ActionEvent ae) {

        //
        // Process the action command
        //
        // "create graph" - Create the graph
        // "done" - All done
        //
        try {
            switch (ae.getActionCommand()) {
                case "create graph":
                    Date startDate, endDate;
                    if (!startField.isEditValid() || !endField.isEditValid()) {
                        JOptionPane.showMessageDialog(this, "You must specify start and end dates",
                                                      "Error", JOptionPane.ERROR_MESSAGE);
                    } else {
                        startDate = (Date)startField.getValue();
                        endDate = (Date)endField.getValue();
                        if (endDate.compareTo(startDate) < 0) {
                            JOptionPane.showMessageDialog(this, "The end date is before the start date",
                                                          "Error", JOptionPane.ERROR_MESSAGE);
                        } else {
                            createGraph(startDate, endDate);
                        }
                    }
                    break;

                case "done":
                    setVisible(false);
                    dispose();
                    break;
            }
        } catch (Exception exc) {
            Main.logException("Exception while processing action event", exc);
        }
    }

    /**
     * Show the dialog
     *
     * @param       parent          Parent window for the dialog
     */
    public static void showDialog(JFrame parent) {
        try {
            JDialog dialog = new NetWorthGraphDialog(parent);
            dialog.pack();
            dialog.setLocationRelativeTo(parent);
            dialog.setVisible(true);
        } catch (Exception exc) {
            Main.logException("Exception while displaying dialog", exc);
        }
    }

    /**
     * Create the graph
     *
     * @param       startDate       The start date
     * @param       endDate         The end date
     */
    private void createGraph(Date startDate, Date endDate) {

        //
        // We will have one data point for each month in the range.  As a rough
        // estimate on the list size, use 2592000 seconds/month.
        //
        int listSize = (int)((endDate.getTime()-startDate.getTime())/2592000L);
        List<TimeChartElement> dataPoints = new ArrayList<>(listSize+1);

        //
        // Maintain a list of securities so we can price them using the history price
        // for each month
        //
        List<SecurityHolding> holdings = new ArrayList<>(SecurityRecord.securities.size());

        //
        // Compute the net worth for each month between the start and end dates
        //
        GregorianCalendar cal = new GregorianCalendar();
        Date currentDate = (Date)startDate.clone();
        double accountBalance = 0.0;

        for (TransactionRecord t : TransactionRecord.transactions) {

            //
            // Get transaction date
            //
            Date date = t.getDate();

            //
            // Add a new data point to the list if we have passed the current date
            // and then advance to the next month
            //
            if (date.compareTo(currentDate) > 0) {
                double netWorth = accountBalance + getPortfolioValue(currentDate, holdings);
                dataPoints.add(new TimeChartElement(currentDate, netWorth/1000.0));
                cal.setTime(currentDate);
                cal.add(Calendar.MONTH, 1);
                cal.set(Calendar.DAY_OF_MONTH, 1);
                currentDate = cal.getTime();
            }

            //
            // Stop if we have passed the end date
            //
            if (date.compareTo(endDate) > 0)
                break;

            //
            // Update the net worth
            //
            double amount = t.getAmount();
            AccountRecord a = t.getAccount();
            if (a.getType() == AccountRecord.INVESTMENT) {
                SecurityHolding.updateSecurityHolding(holdings, t);
                if (t.getTransferAccount() != null)
                    accountBalance -= amount;
            } else if (t.getTransferAccount() == null) {
                accountBalance += amount;
            }

            List<TransactionSplit> splits = t.getSplits();
            if (splits != null) {
                for (TransactionSplit split : splits) {
                    if (split.getAccount() != null)
                        accountBalance -= split.getAmount();
                }
            }
        }

        //
        // Add the final data point to the list
        //
        listSize = dataPoints.size();
        if (listSize == 0 || !dataPoints.get(listSize-1).getDate().equals(endDate)) {
            double netWorth = accountBalance + getPortfolioValue(endDate, holdings);
            dataPoints.add(new TimeChartElement(endDate, netWorth/1000.0));
        }

        //
        // Display the net worth graph
        //
        TimeChart chart = new TimeChart(dataPoints, "Date", "Net Worth ($K)");
        chart.setOpaque(true);
        chart.setBackground(Color.CYAN);
        chart.setPreferredSize(new Dimension(640, 640));
        chart.setMinimumGridIncrement(10.0);

        String dialogTitle = String.format("Net Worth for %s to %s",
                                           Main.getDateString(startDate),
                                           Main.getDateString(endDate));
        JDialog dialog = new JDialog(this, dialogTitle, true);
        dialog.setContentPane(chart);
        dialog.pack();
        dialog.setLocationRelativeTo(this);
        dialog.setVisible(true);
    }

    /**
     * Compute the current value of the security portfolio
     *
     * @param       date            The current date
     * @param       holdings        The current security holdings
     * @return                      The portfolio value
     */
    private double getPortfolioValue(Date date, List<SecurityHolding> holdings) {
        double portfolioValue = 0.0;

        for (SecurityHolding h : holdings) {
            SecurityRecord s = h.getSecurity();
            SortedSet<PriceHistory> prices = s.getPriceHistory();
            double price = 0.0;
            for (PriceHistory ph : prices) {
                if (ph.getDate().compareTo(date) > 0)
                    break;

                price = ph.getPrice();
            }

            if (price == 0.0)
                price = h.getTotalCost()/h.getTotalShares();

            portfolioValue += (double)Math.round(h.getTotalShares()*price*100.0)/100.0;
        }

        return portfolioValue;
    }
}


text:
title: Support, Extend and Contribute to Aspose.BarCode in PHP
type: docs
weight: 30
url: /java/support-extend-and-contribute-to-aspose-barcode-in-php/
---

## **Support**
From the very first days of Aspose, we knew that just giving our customers good products would not be enough. We also needed to deliver good service. We are developers ourselves and understand how frustrating it is when a technical issue or a quirk in the software stops you from doing what you need to do. We're here to solve problems, not create them.

This is why we offer free support. Anyone who uses our product, whether they have bought them or are using an evaluation, deserves our full attention and respect.

You can log any issues or suggestions related to Aspose.Barcode Java for PHP using any of the following platforms:

- [Github](https://github.com/aspose-barcode/Aspose.BarCode-for-Java/issues)
- [CodePlex](https://asposebarcodejavaphp.codeplex.com/workitem/list/basic)
## **Extend and Contribute**
Aspose.Barcode Java for PHP is open source and its source code is available on the major social coding websites listed below. Developers are encouraged to download the source code and contribute by suggesting or adding new feature or improving the existing ones, so that others could also benefit from it.
## **Source Code**
You can get the latest source code from one of the following locations

- [Github](https://github.com/aspose-barcode/Aspose.BarCode-for-Java/tree/master/Plugins/Aspose_Barcode_Java_for_PHP)
- [CodePlex](https://asposebarcodejavaphp.codeplex.com/SourceControl/latest)


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Login_storage.DataManager
{
    #region Open Source Attributions

    #endregion

    class LoginDecoder
    {
        private FileManager toDeocdeFile;
        private List<LoginFormular> loginList;
        private string password;
        public LoginDecoder(string username, string password)
        {
            this.password = password;
            toDeocdeFile = new FileManager(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\LoginStorage\\Users\\" + username + ".ls");
        }

        public bool IsCorrectPassword()
        {
            string readedFile = toDeocdeFile.ReadFile();
            if (readedFile == null)
            {
                return true;
            }
            try
            {   //3DES Decode
                readedFile = EncryptString(readedFile, password);
                //JSON to List<Object>
                loginList = JsonConvert.DeserializeObject<List<LoginFormular>>(readedFile);
                return true;
            }
            catch
            {
                return false;
            }

        }
        public List<LoginFormular> GetLoginList()
        {
            return this.loginList;
        }

        public string EncryptString(string encryptedText, string password)
        {
            PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, new byte[0]);
            TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider
            {
                IV = new byte[8],
                Key = pdb.CryptDeriveKey("3DES", "SHA512", 168, new byte[8])
            };
            byte[] encryptedBytes = Convert.FromBase64String(encryptedText);
            MemoryStream ms = new MemoryStream(encryptedText.Length);
            CryptoStream decStream = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
            decStream.Write(encryptedBytes, 0, encryptedBytes.Length);
            decStream.FlushFinalBlock();
            byte[] plainBytes = new byte[ms.Length];
            ms.Position = 0;
            ms.Read(plainBytes, 0, (int)ms.Length);
            decStream.Close();
            return Encoding.UTF8.GetString(plainBytes);
        }

    }
}


text:
using System.Threading.Tasks;

namespace NoDb
{
    public interface IStoragePathOptionsResolver
    {
        Task<StoragePathOptions> Resolve(string projectId);
    }
}


text:
namespace rx
{
class Renderer11;

class StreamProducerNV12 : public StreamProducerImpl
{
  public:
    StreamProducerNV12(Renderer11 *renderer);
    ~StreamProducerNV12() override;

    egl::Error validateD3DNV12Texture(void *pointer) const override;
    void postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) override;
    egl::Stream::GLTextureDescription getGLFrameDescription(int planeIndex) override;

    // Gets a pointer to the internal D3D texture
    ID3D11Texture2D *getD3DTexture();

    // Gets the slice index for the D3D texture that the frame is in
    UINT getArraySlice();

  private:
    Renderer11 *mRenderer;

    ID3D11Texture2D *mTexture;
    UINT mArraySlice;
    UINT mTextureWidth;
    UINT mTextureHeight;
};
}  // namespace rx

#endif  // LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_


text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.autofill_assistant;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.swipeRight;
import static androidx.test.espresso.assertion.PositionAssertions.isRightOf;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.hasDescendant;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;

import android.support.test.InstrumentationRegistry;
import android.widget.LinearLayout;

import androidx.test.filters.MediumTest;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantActionsCarouselCoordinator;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantCarouselModel;
import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChip;
import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule;
import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.TestThreadUtils;

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

/**
 * Tests for the autofill assistant actions carousel.
 */
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@RunWith(ChromeJUnit4ClassRunner.class)
public class AutofillAssistantActionsCarouselUiTest {
    @Rule
    public CustomTabActivityTestRule mTestRule = new CustomTabActivityTestRule();

    /** Creates a coordinator for use in UI tests, and adds it to the global view hierarchy. */
    private AssistantActionsCarouselCoordinator createCoordinator(AssistantCarouselModel model)
            throws Exception {
        AssistantActionsCarouselCoordinator coordinator = TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> new AssistantActionsCarouselCoordinator(
                                InstrumentationRegistry.getTargetContext(), model));

        TestThreadUtils.runOnUiThreadBlocking(() -> {
            // Note: apparently, we need an intermediate container for this coordinator's view,
            // otherwise the view will be invisible.
            // @TODO(crbug.com/806868) figure out why this is the case.
            LinearLayout container = new LinearLayout(InstrumentationRegistry.getTargetContext());
            container.addView(coordinator.getView());
            AutofillAssistantUiTestUtil.attachToCoordinator(mTestRule.getActivity(), container);
        });

        return coordinator;
    }

    @Before
    public void setUp() {
        mTestRule.startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
                InstrumentationRegistry.getTargetContext(), "about:blank"));
    }

    /** Tests assumptions about the initial state of the carousel. */
    @Test
    @MediumTest
    public void testInitialState() throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        assertThat(model.get(AssistantCarouselModel.CHIPS).size(), is(0));
        assertThat(coordinator.getView().getAdapter().getItemCount(), is(0));
    }

    /** Adds a single chip and tests assumptions about the view state after the change. */
    @Test
    @MediumTest
    public void testAddSingleChip() throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> model.set(AssistantCarouselModel.CHIPS,
                                Collections.singletonList(new AssistantChip(
                                        AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                                        "Test", false, true, true, ""))));

        // Chip was created and is displayed on the screen.
        onView(is(coordinator.getView()))
                .check(matches(hasDescendant(allOf(withText("Test"), isDisplayed()))));

        // TODO(crbug.com/806868): test that single chip is center aligned.
    }

    /** Adds multiple chips and tests assumptions about the view state after the change. */
    @Test
    @MediumTest
    public void testAddMultipleChips() throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        // Note: this should be a small number that fits on screen without scrolling.
        int numChips = 3;
        List<AssistantChip> chips = new ArrayList<>();
        for (int i = 0; i < numChips; i++) {
            chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                    "T" + i, false, false, true, ""));
        }
        chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                "X", false, true, true, ""));

        TestThreadUtils.runOnUiThreadBlocking(() -> model.set(AssistantCarouselModel.CHIPS, chips));

        // Cancel chip is displayed to the user.
        onView(withText("X")).check(matches(isDisplayed()));

        // All chips are to the right of the cancel chip.
        for (int i = 0; i < numChips; i++) {
            onView(withText("T" + i)).check(isRightOf(withText("X")));
        }
    }

    /** Adds many chips and tests that the cancel chip is always visible. */
    @Test
    @MediumTest
    public void testCancelChipAlwaysVisible() throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        // Note: this should be a large number that does not fit on screen without scrolling.
        int numChips = 30;
        List<AssistantChip> chips = new ArrayList<>();
        for (int i = 0; i < numChips; i++) {
            chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                    "Test" + i, false, false, true, ""));
        }
        chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                "Cancel", false, true, true, ""));
        TestThreadUtils.runOnUiThreadBlocking(() -> model.set(AssistantCarouselModel.CHIPS, chips));

        // Cancel chip is initially displayed to the user.
        onView(withText("Cancel")).check(matches(isDisplayed()));

        // Scroll right, check that cancel is still visible.
        onView(is(coordinator.getView())).perform(swipeRight());
        onView(withText("Cancel")).check(matches(isDisplayed()));
    }

    /**
     * Tests the change between two chip configurations:
     * X           Test_2
     * X   Test_1  Test_2
     *
     * This inserts Test_1 in between X and Test_2, forcing Test_2 to move.
     */
    @Test
    @MediumTest
    public void testMoveChip() throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        List<AssistantChip> chips = new ArrayList<>();
        chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                "Test 2", false, false, true, ""));
        chips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                "Cancel", false, true, true, ""));
        TestThreadUtils.runOnUiThreadBlocking(() -> model.set(AssistantCarouselModel.CHIPS, chips));
        onView(withText("Cancel")).check(matches(isDisplayed()));
        onView(withText("Test 2")).check(matches(isDisplayed()));
        onView(withText("Test 2")).check(isRightOf(withText("Cancel")));

        List<AssistantChip> newChips = new ArrayList<>();
        newChips.add(chips.get(0));
        newChips.add(new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                "Test 1", false, false, true, ""));
        newChips.add(chips.get(1));
        TestThreadUtils.runOnUiThreadBlocking(
                () -> model.set(AssistantCarouselModel.CHIPS, newChips));
        onView(withText("Cancel")).check(matches(isDisplayed()));
        onView(withText("Test 1")).check(matches(isDisplayed()));
        onView(withText("Test 2")).check(matches(isDisplayed()));
        onView(withText("Test 1")).check(isRightOf(withText("Cancel")));
        onView(withText("Test 2")).check(isRightOf(withText("Test 1")));
    }

    /**
     * Adds a single chip with non empty content description, and tests that same is used as content
     * description.
     */
    @Test
    @MediumTest
    public void testSuppliedNonEmptyContentDescriptionIsUsed() throws Exception {
        String contentDescription = "Test content description";
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> model.set(AssistantCarouselModel.CHIPS,
                                Collections.singletonList(new AssistantChip(
                                        AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                                        "Chip", false, true, true, contentDescription))));

        onView(is(coordinator.getView()))
                .check(matches(hasDescendant(
                        allOf(withContentDescription(contentDescription), isDisplayed()))));
    }

    /**
     * Adds a single chip with empty content description, and tests that same is used as content
     * description.
     */
    @Test
    @MediumTest
    public void testSuppliedEmptyContentDescriptionIsUsed() throws Exception {
        String contentDescription = "";
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinator = createCoordinator(model);

        TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> model.set(AssistantCarouselModel.CHIPS,
                                Collections.singletonList(new AssistantChip(
                                        AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.NONE,
                                        "Chip", false, true, true, contentDescription))));

        onView(is(coordinator.getView()))
                .check(matches(hasDescendant(
                        allOf(withContentDescription(contentDescription), isDisplayed()))));
    }

    /**
     * Adds a single chip with null content description, and tests that chip text is used as content
     * description if it's non-empty.
     */
    @Test
    @MediumTest
    public void testWhenNullContentDescriptionIsSuppliedChipTextIsUsed() throws Exception {
        String chipText = "Chip Text";
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinatorNonEmptyChipText = createCoordinator(model);

        TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> model.set(AssistantCarouselModel.CHIPS,
                                Collections.singletonList(
                                        new AssistantChip(AssistantChip.Type.BUTTON_HAIRLINE,
                                                AssistantChip.Icon.DONE, chipText, false, true,
                                                true, /* contentDescription */ null))));

        onView(is(coordinatorNonEmptyChipText.getView()))
                .check(matches(
                        hasDescendant(allOf(withContentDescription(chipText), isDisplayed()))));
    }

    /**
     * Adds a single chip with null content description and empty chip text, and tests that icon
     * description is used as content description if available.
     */
    @Test
    @MediumTest
    public void testWhenNullContentDescriptionIsSuppliedChipTextOrIconDescriptionIsUsed()
            throws Exception {
        AssistantCarouselModel model =
                TestThreadUtils.runOnUiThreadBlocking(AssistantCarouselModel::new);
        AssistantActionsCarouselCoordinator coordinatorEmptyChipText = createCoordinator(model);

        TestThreadUtils.runOnUiThreadBlocking(
                ()
                        -> model.set(AssistantCarouselModel.CHIPS,
                                Collections.singletonList(new AssistantChip(
                                        AssistantChip.Type.BUTTON_HAIRLINE, AssistantChip.Icon.DONE,
                                        /* chipText */ "", false, true, true,
                                        /* contentDescription */ null))));

        onView(is(coordinatorEmptyChipText.getView()))
                .check(matches(
                        hasDescendant(allOf(withContentDescription("Done"), isDisplayed()))));
    }
}


text:
package com.github.mkjensen.dml.ondemand;

import static com.github.mkjensen.dml.ondemand.OnDemandListeners.createOnItemViewClickedListener;
import static com.github.mkjensen.dml.ondemand.OnDemandListeners.createOnItemViewSelectedListener;

import android.os.Bundle;
import android.os.Handler;
import android.support.v17.leanback.app.SearchSupportFragment;
import android.support.v17.leanback.widget.ArrayObjectAdapter;
import android.support.v17.leanback.widget.HeaderItem;
import android.support.v17.leanback.widget.ListRow;
import android.support.v17.leanback.widget.ListRowPresenter;
import android.support.v17.leanback.widget.ObjectAdapter;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.text.TextUtils;
import android.util.Log;

import com.github.mkjensen.dml.backend.loader.CategoriesLoader;
import com.github.mkjensen.dml.model.Category;
import com.github.mkjensen.dml.presenter.VideoPresenter;
import com.github.mkjensen.dml.util.BackgroundHelper;
import com.github.mkjensen.dml.util.LoadingHelper;

import java.util.List;

/**
 * Search screen for on-demand videos.
 */
public final class SearchFragment extends SearchSupportFragment implements
    SearchSupportFragment.SearchResultProvider,
    LoaderManager.LoaderCallbacks<List<Category>> {

  private static final String TAG = "SearchFragment";

  private static final String QUERY_ARGUMENT = "query";

  private static final int QUERY_DELAY_IN_MILLISECONDS = 300;

  private static final int QUERY_LOADER_ID = 0;

  private ArrayObjectAdapter results;

  private Handler handler;

  private Runnable queryRunnable;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    results = new ArrayObjectAdapter(new ListRowPresenter());
    handler = new Handler();
    initListeners();
    setSearchResultProvider(this);
  }

  private void initListeners() {
    setOnItemViewClickedListener(createOnItemViewClickedListener(getActivity()));
    setOnItemViewSelectedListener(createOnItemViewSelectedListener(getActivity()));
  }

  @Override
  public void onDestroy() {
    super.onDestroy();
    removePendingQuery();
  }

  private void removePendingQuery() {
    if (queryRunnable != null) {
      handler.removeCallbacks(queryRunnable);
    }
    LoadingHelper.hideLoading(this);
  }

  @Override
  public ObjectAdapter getResultsAdapter() {
    return results;
  }

  @Override
  public boolean onQueryTextChange(String newQuery) {
    performQuery(newQuery);
    return true;
  }

  @Override
  public boolean onQueryTextSubmit(String query) {
    performQuery(query);
    return true;
  }

  private void performQuery(String query) {
    if (TextUtils.isEmpty(query)) {
      clearResults();
      return;
    }
    createPendingQuery(query);
  }

  private void clearResults() {
    removePendingQuery();
    BackgroundHelper.clearBackground(getActivity());
    results.clear();
  }

  private void createPendingQuery(final String query) {
    removePendingQuery();
    queryRunnable = new Runnable() {
      @Override
      public void run() {
        Bundle args = new Bundle();
        args.putString(QUERY_ARGUMENT, query);
        getLoaderManager().restartLoader(QUERY_LOADER_ID, args, SearchFragment.this);
      }
    };
    handler.postDelayed(queryRunnable, QUERY_DELAY_IN_MILLISECONDS);
  }

  @Override
  public Loader<List<Category>> onCreateLoader(int id, Bundle args) {
    Log.d(TAG, "onCreateLoader");
    LoadingHelper.showLoading(this);
    String query = args.getString(QUERY_ARGUMENT);
    //noinspection ConstantConditions
    return new CategoriesLoader(getActivity(), query);
  }

  @Override
  public void onLoadFinished(Loader<List<Category>> loader, List<Category> data) {
    Log.d(TAG, "onLoadFinished");
    clearResults();
    if (data == null || data.isEmpty()) {
      return;
    }
    addResults(data);
  }

  private void addResults(List<Category> categories) {
    VideoPresenter presenter = new VideoPresenter();
    for (Category category : categories) {
      HeaderItem header = new HeaderItem(category.getTitle());
      ArrayObjectAdapter videos = new ArrayObjectAdapter(presenter);
      videos.addAll(0, category.getVideos());
      results.add(new ListRow(header, videos));
    }
  }

  @Override
  public void onLoaderReset(Loader<List<Category>> loader) {
    Log.d(TAG, "onLoaderReset");
    clearResults();
  }
}


text:
cd src;
time java com.yzong.dsf14.openMPIKMeans.strandDataset.DNASequential ../input/randDNA.csv 15 2;
cd ..;


text:
export PROJECT_ID="long-door-651"
export POOL_NAME="github-actions-pool"
export PROVIDER_NAME="github-actions-provider"
export SERVICE_ACCOUNT="kokoro-system-test@long-door-651.iam.gserviceaccount.com"
export GITHUB_REPO="GoogleCloudPlatform/nodejs-docs-samples"

# Enable the IAM Credentials API
gcloud services enable iamcredentials.googleapis.com --project "${PROJECT_ID}"

# Create a workload identity pool
gcloud iam workload-identity-pools create "${POOL_NAME}" \
  --project="${PROJECT_ID}" \
  --location="global" \
  --display-name="GitHub Actions Pool"

# Get the full ID of the Workload Identity Pool
gcloud iam workload-identity-pools describe "${POOL_NAME}" \
  --project="${PROJECT_ID}" \
  --location="global" \
  --format="value(name)"

export WORKLOAD_IDENTITY_POOL_ID="$(!!)"

# Create a Workload Identity Provider in that pool
gcloud iam workload-identity-pools providers create-oidc "${PROVIDER_NAME}" \
  --project="${PROJECT_ID}" \
  --location="global" \
  --workload-identity-pool="${POOL_NAME}" \
  --display-name="GitHub Actions Provider" \
  --attribute-mapping="google.subject=assertion.sub,attribute.actor=assertion.actor,attribute.aud=assertion.aud" \
  --issuer-uri="https://token.actions.githubusercontent.com"

# Allow authentications from the Workload Identity Provider to impersonate the Service Account.
# Note executions are limited to requests from this specific repository.
gcloud iam service-accounts add-iam-policy-binding "${SERVICE_ACCOUNT}" \
  --role="roles/iam.workloadIdentityUser" \
  --member="principalSet://iam.googleapis.com/${WORKLOAD_IDENTITY_POOL_ID}/attribute.repository/${GITHUB_REPO}"


text:
"""Example for a simple program with a command line parser."""

# Core Library modules
import os
from os import listdir
from os.path import isfile, join

# Third party modules
import PIL.ExifTags
import PIL.Image

def main(args):
    onlyfiles = [
        os.path.join(args.folder, f)
        for f in listdir(args.folder)
        if isfile(join(args.folder, f))
    ]
    image_files = filter_images(onlyfiles)
    if args.show_metadata:
        show_metadata(image_files)
    elif args.remove_metadata:
        remove_metadata(image_files)
    else:
        print("No action was chosen.")

def show_metadata(image_files):
    for filename in image_files:
        print("## %s" % filename)
        img = PIL.Image.open(filename)
        if not hasattr(img, "_getexif"):
            exif = None
        else:
            exif = img._getexif()
        if exif is not None:
            exif = {
                PIL.ExifTags.TAGS[k]: v
                for k, v in img._getexif().items()
                if k in PIL.ExifTags.TAGS
            }
            for k, v in sorted(exif.items(), key=lambda n: n[0]):
                if isinstance(v, str) and len(v) > 80:
                    print(
                        "  %s: %s (cropped to 80 characters, was %i "
                        "characters long)" % (k, v[:80], len(v))
                    )
                else:
                    print(f"  {k}: {v}")
        else:
            print("  No metadata found.")

def remove_metadata(image_files):
    """
    Remove EXIF metadata from an list of images.

    Parameters
    ----------
    image_files : list of paths to images
    """
    for filename in image_files:
        print("## %s" % filename)

        with open(filename) as image_file:
            image = PIL.Image.open(image_file)

        # next 3 lines strip exif
        data = list(image.getdata())
        image_without_exif = PIL.Image.new(image.mode, image.size)
        image_without_exif.putdata(data)

        image_without_exif.save(filename)

def filter_images(filenames):
    """Return a list which contains images only."""
    # TODO: Consider using https://docs.python.org/2/library/imghdr.html
    endings = ["jpg", "png", "gif", "jpeg"]
    filtered = []
    for filename in filenames:
        for end in endings:
            if filename.lower().endswith(end):
                filtered.append(filename)
                break
    return filtered

def is_valid_folder(parser, arg):
    """Check if arg is a valid file that already exists on the file system."""
    arg = os.path.abspath(arg)
    if not os.path.isdir(arg):
        parser.error("The folder %s does not exist!" % arg)
    else:
        return arg

def get_parser():
    # Core Library modules
    from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser

    parser = ArgumentParser(
        description=__doc__, formatter_class=ArgumentDefaultsHelpFormatter
    )
    parser.add_argument(
        "-f",
        "--folder",
        dest="folder",
        required=True,
        type=lambda x: is_valid_folder(parser, x),
        help="FOLDER to which an action gets applied",
        metavar="FOLDER",
    )
    parser.add_argument(
        "-r",
        "--remove",
        action="store_true",
        dest="remove_metadata",
        default=False,
        help="remove metadata from images (cannot be undone!)",
    )
    parser.add_argument(
        "-s",
        "--show",
        action="store_true",
        dest="show_metadata",
        default=False,
        help="show metadata of images",
    )
    return parser

def entry_point():
    args = get_parser().parse_args()
    main(args)


text:
import * as formatters from "./formatters";
import createTemplateBuilder from "./builder";

export const smart = createTemplateBuilder(formatters.smart);
export const statement = createTemplateBuilder(formatters.statement);
export const statements = createTemplateBuilder(formatters.statements);
export const expression = createTemplateBuilder(formatters.expression);
export const program = createTemplateBuilder(formatters.program);

type DefaultTemplateBuilder = typeof smart & {
  smart: typeof smart;
  statement: typeof statement;
  statements: typeof statements;
  expression: typeof expression;
  program: typeof program;
};

export default Object.assign(smart.bind(undefined) as DefaultTemplateBuilder, {
  smart,
  statement,
  statements,
  expression,
  program,
  ast: smart.ast,
});


text:
package com.suzhou.carmanager;

import android.os.Environment;
import com.google.gson.JsonParser;

/**
 * Created by root on 16-6-21.
 */
public class Constants {

    public static final String SHOW_TOAST = "car_toast";

    public static final JsonParser _jsonParser = new JsonParser();
    public static final int DEFAULT_LOCATION_UPLOAD_TIME = 5 * 1000;

    public static final String APP_CONFIG = "APP_CONFIG";
    public static final String APP_ONLY_ID = "APP_ONLY_ID";

    public static final String APP_USER_INFO = "APP_USER_INFO";
    public static final String APP_EXIT_FLAG = "APP_EXIT_FLAG";
    public static final String IS_RESTART = "IS_RESTART";

    public static final String USER_LOGIN_TOKEN = "USER_LOGIN_TOKEN";
    public static final String USER_UID = "USER_UID";
    public static final String USER_NAME = "USER_UID";
    public static final String USER_NIKE_NAME = "USER_UID";
    public static final String USER_ACCESS_TOKEN = "USER_ACCESS_TOKEN";
    public static final String USER_PASSWORD = "USER_PASSWORD";
    public static final String USER_BIND_STATUS = "USER_BIND_STATUS";
    public static final String USER_BIND_COMPANY_NAME = "USER_BIND_COMPANY_NAME";

    public static final String LOCATION_UPLOAD_TIME = "app.location.upload.time.interval";
    public static final String SET_JG_ALIAS_SUCCESS = "SET_JG_ALIAS_SUCCESS";

    public static final int VISIBLE_THRESHOLD = 3;

    public static final String ASSIGN_ID = "ASSIGN_ID";
    public static final String ORDER_NO = "ORDER_NO";

    public static final String EXCEPTION_ID = "EXCEPTION_ID";
    public static final String EXCEPTION_TYPE = "EXCEPTION_TYPE";
    public static final String EXCEPTION_NO = "EXCEPTION_NO";
    public static final String EXCEPTION_DETAIL = "EXCEPTION_DETAIL";
    public static final String EXCEPTION_OPERATE_TYPE = "EXCEPTION_OPERATE_TYPE";

    public static final String TRANS_TYPE_DQR = "DQR";
    public static final String TRANS_TYPE_YQR = "YQR";
    public static final String TRANS_TYPE_THZ = "THZ";
    public static final String TRANS_TYPE_YSZ = "YSZ";
    public static final String TRANS_TYPE_YWC = "YWC";
    public static final String TRANS_TYPE_EXCEPTION = "EXCEPTION";

    public static final String HAS_PICK_FILE = "HAS_PICK_FILE"; //已取文件
    public static final String HAS_REACH_PICK = "HAS_REACH_PICK"; //到达提货地
    public static final String FINISH_PICKUP_GOODS = "FINISH_PICKUP_GOODS"; //完成提货 不提示错误
    public static final String FINISH_PICKUP_GOODS_OK = "FINISH_PICKUP_GOODS_OK"; //完成提货 提示

    public static final String REACH_TERMINAL = "REACH_TERMINAL"; //到达场站
    public static final String FOR_INSPECTION = "FOR_INSPECTION"; //入查验库
    public static final String HAS_DELIVERED = "HAS_DELIVERED"; //到达送货地
    public static final String HAS_COMPLETED = "HAS_COMPLETED"; //完成送货
    public static final String HAS_COMPLETED_GOODS_OK = "HAS_COMPLETED_GOODS_OK"; //完成送货货物是否完好无损

    public static final String FROM_PICK_GOODS = "FROM_PICK_GOODS";
    public static final String FROM_ARRIVE_DELIVERY = "FROM_ARRIVE_DELIVERY";

    public static final String FILE_LIST = "FILE_LIST";

    public static final String FILE_TYPE_WORD = "WORD";
    public static final String FILE_TYPE_PDF = "PDF";
    public static final String FILE_TYPE_IMAGE = "IMAGE";
    public static final String FILE_TYPE_OTHER = "OTHER";

    public static final String EXTRA_BUNDLE = "EXTRA_BUNDLE";
    public static final String REGISTRATION_ID = "RegistrationID";

    public static final int POST_EXCEPTION_CODE = 10001;
    public static final int COMPANY_CHOOSE_CODE = 10002;
    public static final int COMPANY_CHOOSE_RESULT_CODE = 10002;

    public static final String UN_READ_TEXT = "UN_READ";
    public static final String READ_TEXT = "READ";
}


text:
@implementation BuildAction

+ (NSString *)name
{
  return @"build";
}

- (BOOL)performActionWithOptions:(Options *)options xcodeSubjectInfo:(XcodeSubjectInfo *)xcodeSubjectInfo
{
  NSArray *arguments = [[[options xcodeBuildArgumentsForSubject]
                         arrayByAddingObjectsFromArray:[options commonXcodeBuildArgumentsForSchemeAction:@"LaunchAction"
                                                                                xcodeSubjectInfo:xcodeSubjectInfo]]
                        arrayByAddingObject:@"build"];

  return RunXcodebuildAndFeedEventsToReporters(arguments,
                                               @"build",
                                               [options scheme],
                                               [options reporters]);
}

@end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Giao_diện
{
    public partial class Thay_đỗi_tài_khoản : Form
    {
        Service.Service1Client sc = new Service.Service1Client();
        public Thay_đỗi_tài_khoản()
        {
            InitializeComponent();
            UpdateLang();
        }

        CultureInfo culture;
        private void UpdateLang()
        {
            culture = CultureInfo.CurrentCulture;
            string cultureName = Check_Lang.Curr_Lang;
            culture = CultureInfo.CreateSpecificCulture(cultureName);
            ResourceManager rm = new
                ResourceManager("Giao_diện.Lang.MyResource", typeof(Form1).Assembly);

            lbltrangthai.Text = rm.GetString("thaydoitrangthaitk", culture);
            lbltinhtrang.Text = rm.GetString("tinhtrang", culture);
            lblloaitk.Text = rm.GetString("loaitk", culture);
            btnkhoa.Text = rm.GetString("khoa", culture);
            btnlenvip.Text = rm.GetString("lenvip", culture);
            btnphuchoi.Text = rm.GetString("phuchoi", culture);
            btnvethuong.Text = rm.GetString("vethuong", culture);

        }

        private void btQuay_lai_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btPhuchoi_Click(object sender, EventArgs e)
        {
            string So_tai_khoan = dsTai_khoan.CurrentRow.Cells["So_tai_khoan"].Value.ToString();
            sc.Thay_doi_tinh_trang(So_tai_khoan, 1);
            dsTai_khoan.DataSource = sc.Ds_tai_khoan();
        }

        private void btKhoa_Click(object sender, EventArgs e)
        {
            string So_tai_khoan = dsTai_khoan.CurrentRow.Cells["So_tai_khoan"].Value.ToString();
            sc.Thay_doi_tinh_trang(So_tai_khoan, -1);
            dsTai_khoan.DataSource = sc.Ds_tai_khoan();
        }

        private void Thay_đỗi_tài_khoản_Load(object sender, EventArgs e)
        {
            dsTai_khoan.DataSource = sc.Ds_tai_khoan();
        }

        private void dsTai_khoan_SelectionChanged(object sender, EventArgs e)
        {
            try
            {
                dsTai_khoan.CurrentRow.Selected = true;
            }
            catch
            {
            }
        }

        private void btVip_Click(object sender, EventArgs e)
        {
            string So_tai_khoan = dsTai_khoan.CurrentRow.Cells["So_tai_khoan"].Value.ToString();
            sc.Thay_doi_loai_tai_khoan(So_tai_khoan, "vip");
            dsTai_khoan.DataSource = sc.Ds_tai_khoan();
        }

        private void btThuong_Click(object sender, EventArgs e)
        {
            string So_tai_khoan = dsTai_khoan.CurrentRow.Cells["So_tai_khoan"].Value.ToString();
            sc.Thay_doi_loai_tai_khoan(So_tai_khoan, "thuong");
            dsTai_khoan.DataSource = sc.Ds_tai_khoan();
        }

    }
}


text:
package com.simularity.sax;

public interface Deviator {
	double getMean();
	double getStdDev();
	void reset();
	void apply(double d);
	double normalize(double d);
};