text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RA.Models.Input
{
    /// <summary>
    /// Class used with an Organization format or publish request
    /// </summary>
    public class OrganizationRequest : BaseRequest
	{
        public OrganizationRequest()
        {
            Organization = new Organization();
        }

        /// <summary>
        /// Organization Input Class
        /// </summary>
        public Organization Organization { get; set; }

    }

    public class Organization
    {
        public Organization()
        {

            AgentType = new List<string>();

			//AgentSectorType = new List<string>();
			IndustryType = new List<FrameworkItem>();
			Naics = new List<string>();
			Keyword = new List<string>();
            Email = new List<string>();
            SocialMedia = new List<string>();
            SameAs = new List<string>();
            AvailabilityListing = new List<string>();
            ServiceType = new List<string>();
            Jurisdiction = new List<Input.Jurisdiction>();
            Address = new List<Place>();
			AlternateName = new List<string>();
            //ContactPoint = new List<ContactPoint>();
            //
            AccreditedBy = new List<Input.OrganizationReference>();
            ApprovedBy = new List<Input.OrganizationReference>();
            RecognizedBy = new List<Input.OrganizationReference>();
            RegulatedBy = new List<Input.OrganizationReference>();
            //
            Accredits = new List<EntityReference>();
            Approves = new List<EntityReference>();
            Offers = new List<EntityReference>();
            Owns = new List<EntityReference>();
            Renews = new List<EntityReference>();
            Revokes = new List<EntityReference>();
            Recognizes = new List<EntityReference>();

			//
			HasConditionManifest = new List<string>();
            HasCostManifest = new List<string>();
            VerificationServiceProfiles = new List<Input.VerificationServiceProfile>();
			//
            AdministrationProcess = new List<ProcessProfile>();
            DevelopmentProcess = new List<ProcessProfile>();
            MaintenanceProcess = new List<ProcessProfile>();
            AppealProcess = new List<ProcessProfile>();
            ComplaintProcess = new List<ProcessProfile>();
            ReviewProcess = new List<ProcessProfile>();
            RevocationProcess = new List<ProcessProfile>();
			//
            Department = new List<OrganizationReference>();
            SubOrganization = new List<OrganizationReference>();
            JurisdictionAssertions = new List<JurisdictionAssertedInProfile>();
			AlternativeIdentifier = new List<IdentifierValue>();

		}

		#region *** Required Properties ***
		/// <summary>
		/// The type of organization is one of :
		/// - CredentialOrganization
		/// - QACredentialOrganization
		/// Required
		/// </summary>
		public string Type { get; set; }

        /// <summary>
        /// Name
        /// Required
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// Alternately can provide a language map
        /// </summary>
        public LanguageMap Name_Map { get; set; } = new LanguageMap();
        /// <summary>
        /// Description
        /// Required
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// Alternately can provide a language map
        /// </summary>
        public LanguageMap Description_Map { get; set; } = new LanguageMap();

        /// <summary>
        /// Credential Identifier
        /// format:
        /// ce-UUID (guid)
        /// Required
        /// </summary>
        public string Ctid { get; set; }

		/// <summary>
		/// Organization subject web page
		/// Required
		/// </summary>
		public string SubjectWebpage { get; set; }

		/// <summary>
		/// The type of the described agent.
		/// Must provide valid organization types
		/// </summary>
		public List<string> AgentType { get; set; }

		/// <summary>
		/// The types of sociological, economic, or political subdivision of society served by an agent. Enter one of:
		/// <value>
		/// agentSector:PrivateForProfit agentSector:PrivateNonProfit agentSector:Public
		/// </value>
		/// </summary>
		public string AgentSectorType { get; set; }

		#endregion

		#region *** Required if available Properties ***
		public string AgentPurpose { get; set; }
		public string AgentPurposeDescription { get; set; }

		//External Quality Assurance
		public List<OrganizationReference> AccreditedBy { get; set; }
		public List<OrganizationReference> ApprovedBy { get; set; }
		public List<OrganizationReference> RecognizedBy { get; set; }
		public List<OrganizationReference> RegulatedBy { get; set; }

		public List<OrganizationReference> ParentOrganization { get; set; }

		#endregion
		#region *** Recommended Properties ***

		public List<string> SocialMedia { get; set; }
		public List<string> Keyword { get; set; }
		/// <summary>
		/// Url for Organization image
		/// </summary>
		public string Image { get; set; }
		public List<string> ServiceType { get; set; }
		#endregion

		public List<string> AlternateName { get; set; }
		public string FoundingDate { get; set; }

        public string Duns { get; set; }
        public string Fein { get; set; }
        public string IpedsId { get; set; }
        public string OpeId { get; set; }
        public string LEICode { get; set; }
        public List<IdentifierValue> AlternativeIdentifier { get; set; }
		public string MissionAndGoalsStatement { get; set; }
        public string MissionAndGoalsStatementDescription { get; set; }

        public List<FrameworkItem> IndustryType { get; set; }
		public List<string> AlternativeIndustryType { get; set; } = new List<string>();
		public List<string> Naics { get; set; }

        public List<string> Email { get; set; }

        //all phone numbers are entered in contact points

        public List<ContactPoint> ContactPoint { get; set; }
        /// <summary>
        /// A resource that unambiguously indicates the identity of the resource being described.
        /// Resources that may indicate identity include, but are not limited to, descriptions of entities in open databases such as DBpedia and Wikidata or social media accounts such as FaceBook and LinkedIn.
        /// </summary>
        public List<string> SameAs { get; set; }
        public List<string> AvailabilityListing { get; set; }

        public List<Jurisdiction> Jurisdiction { get; set; }
        public List<Place> Address { get; set; }

        public List<JurisdictionAssertedInProfile> JurisdictionAssertions { get; set; }

        /// <summary>
        /// Organization performs QA on these entities
        /// The entities could be any of organization, credential, assessment, or learning opportunity
        /// </summary>
        public List<EntityReference> Accredits { get; set; }
        public List<EntityReference> Approves { get; set; }
        public List<EntityReference> Recognizes { get; set; }
        public List<EntityReference> Regulates { get; set; } = new List<EntityReference>();

		/// <summary>
		/// The 3rd Party properties are populated, but ignored by the API
		/// </summary>
        public List<EntityReference> Accredits3rdParty { get; set; } = new List<EntityReference>();
        public List<EntityReference> Approves3rdParty { get; set; } = new List<EntityReference>();
        public List<EntityReference> Recognizes3rdParty { get; set; } = new List<EntityReference>();
        public List<EntityReference> Regulates3rdParty { get; set; } = new List<EntityReference>();
        //NON-QA
        public List<EntityReference> Owns { get; set; }
        public List<EntityReference> Offers { get; set; }

        public List<EntityReference> Renews { get; set; }
        public List<EntityReference> Revokes { get; set; }

		/// <summary>
		/// OR Prototype separate properties
		/// NOT USED
		/// </summary>
		//public List<EntityReference> OwnsCredentials { get; set; } = new List<EntityReference>()
		//public List<EntityReference> OwnsAssessments { get; set; } = new List<EntityReference>()

		//public List<EntityReference> OwnsLearningOpportunities { get; set; } = new List<EntityReference>()

		/// <summary>
		/// Reference to condition manifests
		/// A condition manifest can never be a third party reference, so a url is expected
		/// </summary>
		public List<string> HasConditionManifest { get; set; }
		/// <summary>
		/// Reference to cost manifests
		/// A cost manifest can never be a third party reference, so a url is expected
		/// </summary>
		public List<string> HasCostManifest { get; set; }

		public List<VerificationServiceProfile> VerificationServiceProfiles { get; set; }
        public List<ProcessProfile> AdministrationProcess { get; set; }
        public List<ProcessProfile> DevelopmentProcess { get; set; }
        public List<ProcessProfile> MaintenanceProcess { get; set; }
        public List<ProcessProfile> AppealProcess { get; set; }
        public List<ProcessProfile> ComplaintProcess { get; set; }
        public List<ProcessProfile> ReviewProcess { get; set; }
        public List<ProcessProfile> RevocationProcess { get; set; }

        public List<OrganizationReference> Department { get; set; }
        public List<OrganizationReference> SubOrganization { get; set; }

    }
}


text:
import django_filters.rest_framework
from rest_framework import filters
from rest_framework import permissions, renderers, viewsets
from rest_framework.response import Response

from cbe.resource.models import PhysicalResource
from cbe.resource.serializers import PhysicalResourceSerializer

class PhysicalResourceViewSet(viewsets.ModelViewSet):
    queryset = PhysicalResource.objects.all()
    serializer_class = PhysicalResourceSerializer
    permission_classes = (permissions.DjangoModelPermissions, )

redpajama_set_name: RedPajamaGithub


text:
title: Thank You For Reaching Out
permalink: "/contact-success.html"
background_image:
layout: blank
---

We'll read your message and be in contact as soon as possible.


text: /*# sourceMappingURL=content_wrapper.css.map */


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.bpmn.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Tijs Rademakers
 */
public class UserTask extends Task {

    protected String assignee;
    protected String owner;
    protected String priority;
    protected String formKey;
    protected boolean sameDeployment = true;
    protected String dueDate;
    protected String businessCalendarName;
    protected String category;
    protected String extensionId;
    protected List<String> candidateUsers = new ArrayList<>();
    protected List<String> candidateGroups = new ArrayList<>();
    protected List<FormProperty> formProperties = new ArrayList<>();
    protected List<FlowableListener> taskListeners = new ArrayList<>();
    protected String skipExpression;
    protected String validateFormFields;
    protected String taskIdVariableName;

    protected Map<String, Set<String>> customUserIdentityLinks = new HashMap<>();
    protected Map<String, Set<String>> customGroupIdentityLinks = new HashMap<>();

    protected List<CustomProperty> customProperties = new ArrayList<>();

    public String getAssignee() {
        return assignee;
    }

    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public String getFormKey() {
        return formKey;
    }

    public void setFormKey(String formKey) {
        this.formKey = formKey;
    }

    public boolean isSameDeployment() {
        return sameDeployment;
    }

    public void setSameDeployment(boolean sameDeployment) {
        this.sameDeployment = sameDeployment;
    }

    public String getDueDate() {
        return dueDate;
    }

    public void setDueDate(String dueDate) {
        this.dueDate = dueDate;
    }

    public String getBusinessCalendarName() {
        return businessCalendarName;
    }

    public void setBusinessCalendarName(String businessCalendarName) {
        this.businessCalendarName = businessCalendarName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getExtensionId() {
        return extensionId;
    }

    public void setExtensionId(String extensionId) {
        this.extensionId = extensionId;
    }

    public boolean isExtended() {
        return extensionId != null && !extensionId.isEmpty();
    }

    public List<String> getCandidateUsers() {
        return candidateUsers;
    }

    public void setCandidateUsers(List<String> candidateUsers) {
        this.candidateUsers = candidateUsers;
    }

    public List<String> getCandidateGroups() {
        return candidateGroups;
    }

    public void setCandidateGroups(List<String> candidateGroups) {
        this.candidateGroups = candidateGroups;
    }

    public List<FormProperty> getFormProperties() {
        return formProperties;
    }

    public void setFormProperties(List<FormProperty> formProperties) {
        this.formProperties = formProperties;
    }

    public List<FlowableListener> getTaskListeners() {
        return taskListeners;
    }

    public void setTaskListeners(List<FlowableListener> taskListeners) {
        this.taskListeners = taskListeners;
    }

    public void addCustomUserIdentityLink(String userId, String type) {
        Set<String> userIdentitySet = customUserIdentityLinks.get(type);

        if (userIdentitySet == null) {
            userIdentitySet = new HashSet<>();
            customUserIdentityLinks.put(type, userIdentitySet);
        }

        userIdentitySet.add(userId);
    }

    public void addCustomGroupIdentityLink(String groupId, String type) {
        Set<String> groupIdentitySet = customGroupIdentityLinks.get(type);

        if (groupIdentitySet == null) {
            groupIdentitySet = new HashSet<>();
            customGroupIdentityLinks.put(type, groupIdentitySet);
        }

        groupIdentitySet.add(groupId);
    }

    public Map<String, Set<String>> getCustomUserIdentityLinks() {
        return customUserIdentityLinks;
    }

    public void setCustomUserIdentityLinks(Map<String, Set<String>> customUserIdentityLinks) {
        this.customUserIdentityLinks = customUserIdentityLinks;
    }

    public Map<String, Set<String>> getCustomGroupIdentityLinks() {
        return customGroupIdentityLinks;
    }

    public void setCustomGroupIdentityLinks(Map<String, Set<String>> customGroupIdentityLinks) {
        this.customGroupIdentityLinks = customGroupIdentityLinks;
    }

    public List<CustomProperty> getCustomProperties() {
        return customProperties;
    }

    public void setCustomProperties(List<CustomProperty> customProperties) {
        this.customProperties = customProperties;
    }

    public String getSkipExpression() {
        return skipExpression;
    }

    public void setSkipExpression(String skipExpression) {
        this.skipExpression = skipExpression;
    }

    public String getValidateFormFields() {
        return validateFormFields;
    }

    public void setValidateFormFields(String validateFormFields) {
        this.validateFormFields = validateFormFields;
    }

    public String getTaskIdVariableName() {
        return taskIdVariableName;
    }

    public void setTaskIdVariableName(String taskIdVariableName) {
        this.taskIdVariableName = taskIdVariableName;
    }

    @Override
    public UserTask clone() {
        UserTask clone = new UserTask();
        clone.setValues(this);
        return clone;
    }

    public void setValues(UserTask otherElement) {
        super.setValues(otherElement);
        setAssignee(otherElement.getAssignee());
        setOwner(otherElement.getOwner());
        setFormKey(otherElement.getFormKey());
        setSameDeployment(otherElement.isSameDeployment());
        setDueDate(otherElement.getDueDate());
        setPriority(otherElement.getPriority());
        setCategory(otherElement.getCategory());
        setTaskIdVariableName(otherElement.getTaskIdVariableName());
        setExtensionId(otherElement.getExtensionId());
        setSkipExpression(otherElement.getSkipExpression());
        setValidateFormFields(otherElement.getValidateFormFields());

        setCandidateGroups(new ArrayList<>(otherElement.getCandidateGroups()));
        setCandidateUsers(new ArrayList<>(otherElement.getCandidateUsers()));

        setCustomGroupIdentityLinks(otherElement.customGroupIdentityLinks);
        setCustomUserIdentityLinks(otherElement.customUserIdentityLinks);

        formProperties = new ArrayList<>();
        if (otherElement.getFormProperties() != null && !otherElement.getFormProperties().isEmpty()) {
            for (FormProperty property : otherElement.getFormProperties()) {
                formProperties.add(property.clone());
            }
        }

        taskListeners = new ArrayList<>();
        if (otherElement.getTaskListeners() != null && !otherElement.getTaskListeners().isEmpty()) {
            for (FlowableListener listener : otherElement.getTaskListeners()) {
                taskListeners.add(listener.clone());
            }
        }
    }
}


text:
"""
This weirdness exists to work around a very specific problem
with testing WX: you can only ever have one App() instance per
process. I've spent hours and hours trying to work around this and
figure out how to gracefully destroy and recreate them, but... no dice.

This is echo'd in the docs: https://wxpython.org/Phoenix/docs/html/wx.App.html

Destroying/recreating causes instability in the tests. We can work around that
by reusing the same App instance across tests and only destroying the top level
frame (which is fine). However, this causes a new problem: the last test which
runs will now always fail, cause we're not Destroying the App instance.

Ideal world: UnitTest would expose a global "done" hook regardless of test
discovery type. That doesn't exist, so the best we can do is use the Module cleanup
methods. These aren't perfect, but destroying / recreating at the module boundary
gives slightly more reliable tests. These are picked up by the test runner
by their existence in the module's globals(). There's no other way to hook
things together. We need it in every test, and thus... that's the background
for why this weirdness is going on.

It's a hack around a hack around a problem in Wx.

Usage:

In any tests which use WX, you must import this module's definitions
into the test's global scope

```
from gooey.tests import *
```
"""
import wx
import locale
import platform

class TestApp(wx.App):
    """
    Stolen from the mailing list here:
    https://groups.google.com/g/wxpython-users/c/q5DSyyuKluA

    Wx started randomly exploding with locale issues while running
    the tests. For whatever reason, manually setting it in InitLocale
    seems to solve the problem.
    """
    def __init__(self, with_c_locale=None, **kws):
        if with_c_locale is None:
            with_c_locale = (platform.system() == 'Windows')
        self.with_c_locale = with_c_locale
        wx.App.__init__(self, **kws)

    def InitLocale(self):
        """over-ride wxPython default initial locale"""
        if self.with_c_locale:
            self._initial_locale = None
            locale.setlocale(locale.LC_ALL, 'C')
        else:
            lang, enc = locale.getdefaultlocale()
            self._initial_locale = wx.Locale(lang, lang[:2], lang)
            locale.setlocale(locale.LC_ALL, lang)

    def OnInit(self):
        self.createApp()
        return True

    def createApp(self):
        return True

app = None

def setUpModule():
    global app
    app = TestApp()

def tearDownModule():
    global app
    app.Destroy()


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

<link rel="stylesheet" type="text/css" href="css/ase.css">
<link href='http://fonts.googleapis.com/css?family=Slackey' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Bentham' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
<title>Advanced Services Engineering</title>

 Advanced Services Engineering

Overview

Syllabus

Lecture Notes

Assignments, Projects and Exams

Reading

Syllabus

News/Update

Currently there is no change in the syllabus

 Course date

 Lectures are held on Friday from 10-12 at Seminarraum Argentinierstrasse,  Argentinierstrasse 8 (or Paniglgasse), EG.  Note that lectures are NOT held every week! See  lecture notes for lecture dates and places.

Also Check TISS web page for course date, time, and location

Last modified: Wed Mar  5 21:44:38 CET 2014


text:
module Furnace::AVM2::Tokens
  class ArrayToken < Furnace::Code::SeparatedToken
    include IsSimple

    def text_before
      "[ "
    end

    def text_between
      ", "
    end

    def text_after
      " ]"
    end
  end
end


text:
jQuery(document).ready(function() {
  var MAX_SIZE = 120;
  var current_char = 0;

  // Gets the area where the char count is.
  var char_count = jQuery('#descript_amount');
  char_count.html(current_char + '/' + MAX_SIZE);

  //Sets the max size on the text field.
  jQuery('#description').attr('maxlength', MAX_SIZE.toString());

  // Now, on key up, we update.
  jQuery('#description').keyup(function() {
    current_char = jQuery('#description').val().length;
    char_count.html(current_char + '/' + MAX_SIZE);
  });
});


text:
const mongodb = require('mongodb');
const Collection = mongodb.Collection;

export default class MongoCollection {
  _mongoCollection:Collection;

  constructor(mongoCollection:Collection) {
    this._mongoCollection = mongoCollection;
  }

  // Does a find with "smart indexing".
  // Currently this just means, if it needs a geoindex and there is
  // none, then build the geoindex.
  // This could be improved a lot but it's not clear if that's a good
  // idea. Or even if this behavior is a good idea.
  find(query, { skip, limit, sort, keys, maxTimeMS } = {}) {
    return this._rawFind(query, { skip, limit, sort, keys, maxTimeMS })
      .catch(error => {
        // Check for "no geoindex" error
        if (error.code != 17007 && !error.message.match(/unable to find index for .geoNear/)) {
          throw error;
        }
        // Figure out what key needs an index
        const key = error.message.match(/field=([A-Za-z_0-9]+) /)[1];
        if (!key) {
          throw error;
        }

        var index = {};
        index[key] = '2d';
        return this._mongoCollection.createIndex(index)
          // Retry, but just once.
          .then(() => this._rawFind(query, { skip, limit, sort, keys, maxTimeMS }));
      });
  }

  _rawFind(query, { skip, limit, sort, keys, maxTimeMS } = {}) {
    let findOperation = this._mongoCollection
      .find(query, { skip, limit, sort })

    if (keys) {
      findOperation = findOperation.project(keys);
    }

    if (maxTimeMS) {
      findOperation = findOperation.maxTimeMS(maxTimeMS);
    }

    return findOperation.toArray();
  }

  count(query, { skip, limit, sort, maxTimeMS } = {}) {
    const countOperation = this._mongoCollection.count(query, { skip, limit, sort, maxTimeMS });

    return countOperation;
  }

  insertOne(object) {
    return this._mongoCollection.insertOne(object);
  }

  // Atomically updates data in the database for a single (first) object that matched the query
  // If there is nothing that matches the query - does insert
  // Postgres Note: `INSERT ... ON CONFLICT UPDATE` that is available since 9.5.
  upsertOne(query, update) {
    return this._mongoCollection.update(query, update, { upsert: true })
  }

  updateOne(query, update) {
    return this._mongoCollection.updateOne(query, update);
  }

  updateMany(query, update) {
    return this._mongoCollection.updateMany(query, update);
  }

  deleteOne(query) {
    return this._mongoCollection.deleteOne(query);
  }

  deleteMany(query) {
    return this._mongoCollection.deleteMany(query);
  }

  _ensureSparseUniqueIndexInBackground(indexRequest) {
    return new Promise((resolve, reject) => {
      this._mongoCollection.ensureIndex(indexRequest, { unique: true, background: true, sparse: true }, (error) => {
        if (error) {
          reject(error);
        } else {
          resolve();
        }
      });
    });
  }

  drop() {
    return this._mongoCollection.drop();
  }
}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/kaopu_common_floatbox"
        style="@style/kaopu_common_floatbox"
        android:orientation="vertical"
        android:paddingBottom="40dp" >

        <RelativeLayout
            android:id="@+id/kaopu_float_top"
            style="@style/kaopu_float_top"
            android:orientation="horizontal" >

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true" >

                <ImageView
                    android:id="@+id/kaopu_float_logo"
                    style="@style/kaopu_float_logo" />

                <TextView
                    android:id="@+id/kaopu_float_top_text"
                    style="@style/kaopu_float_top_text"
                    android:layout_gravity="right"
                    android:text="@string/kaopu_pwd_find" />
            </LinearLayout>

            <TextView
                android:id="@+id/kaopu_float_close"
                style="@style/kaopu_float_close"
                android:layout_alignParentRight="true"
                android:layout_centerInParent="true"
                android:clickable="true" />
        </RelativeLayout>
        <!-- 公用头部 end -->

        <LinearLayout
            style="@style/kaopu_deal"
            android:layout_marginTop="40dp"
            android:gravity="center" >

            <TextView
                style="@style/kaopu_deal_text_green"
                android:layout_marginLeft="24dp"
                android:layout_marginRight="24dp"
                android:text="@string/kaopu_find_passwd_other"
                android:textColor="#929292" />
        </LinearLayout>

        <RelativeLayout
            android:id="@+id/kaopu_deal"
            style="@style/kaopu_deal"
            android:layout_marginTop="10dp"
            android:gravity="center_vertical"
            android:paddingLeft="24dp" >

            <TextView
                android:id="@+id/textView1"
                style="@style/kaopu_deal_text_blue"
                android:clickable="true"
                android:text="@string/kaopu_linkQQ" />

            <TextView
                android:id="@+id/kaopu_find_pwd_qq_bt"
                style="@style/kaopu_deal_text_line"
                android:layout_alignParentTop="true"
                android:layout_toRightOf="@+id/textView1"
                android:clickable="true"
                android:text="@string/kaopu_help_other_qq" />
        </RelativeLayout>
    </LinearLayout>

</RelativeLayout>


text:
import template from './datagrid-header.html';

/**
 * @ngdoc directive
 * @name data-prep.datagrid-header.directive:DatagridHeader
 * @description This directive takes care of a datagrid header item. It creates the header dropdown menu.
 * On creation, it calculate the quality bar values.
 * On double-click, it allows to rename the column name.
 *
 * Watchers:
 *

 *
Close transformation menu on retrieve error, base on {@link data-prep.datagrid-header.controller:DatagridHeaderCtrl controller}.transformationsRetrieveError flag

 *

 *
 * @restrict E
 * @usage <datagrid-header column="column"></datagrid-header>
 * @param {object} column The column metadata
 */
export default function DatagridHeader($timeout) {
	'ngInject';

	return {
		restrict: 'E',
		templateUrl: template,
		scope: {
			column: '=',
		},
		bindToController: true,
		controllerAs: 'ctrl',
		controller: 'DatagridHeaderCtrl',
		link: {
			post(scope, iElement, iAttrs, ctrl) {
				let gridHeader;
				let gridHeaderTitle;
				let gridHeaderTitleInput;

				/**
				 * @ngdoc method
				 * @name setEditionMode
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @param {boolean} value The new edition mode value
				 * @description Set edition mode to the provided value. This trigger a $digest.
				 */
				function setEditionMode(value) {
					ctrl.setEditMode(value);
					scope.$digest();
				}

				/**
				 * @ngdoc method
				 * @name setEditionMode
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Update column name if it has changed, just toggle edition mode otherwise
				 */
				function executeRenameAction() {
					ctrl.columnNameEdition.$commitViewValue();
					if (ctrl.nameHasChanged()) {
						ctrl.updateColumnName();
					}
					else {
						ctrl.resetColumnName();
						setEditionMode(false);
					}
				}

				/**
				 * @ngdoc method
				 * @name attachBlurListener
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Attach a 'Blur' event listener on input. It executes the column rename.
				 */
				function attachBlurListener() {
					gridHeaderTitleInput.on('blur', executeRenameAction);
				}

				/**
				 * @ngdoc method
				 * @name attachKeyListener
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Attach a 'Keydown' event listener on input. It handles the ENTER and ESC button
				 */
				function attachKeyListener() {
					gridHeaderTitleInput
						.keydown(function (event) {
							event.stopPropagation();
							switch (event.keyCode) {
							case 13: // ENTER
								gridHeaderTitleInput.blur();
								break;
							case 27: // ESC
								ctrl.resetColumnName();
								gridHeaderTitleInput.blur();
								break;
							}
						});
				}

				/**
				 * @ngdoc method
				 * @name attachDisableInputClick
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Disable all click in the input to prevent header and dropdown actions
				 */
				function attachDisableInputClick() {
					gridHeaderTitleInput.on('click', function (e) {
						e.preventDefault();
						e.stopPropagation();
					});
				}

				/**
				 * @ngdoc method
				 * @name attachDblClickListener
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Attach a 'DblClick' event listener on title. It toggle edition mode and focus/select input text
				 */
				function attachDblClickListener() {
					gridHeaderTitle.on('dblclick', function () {
						setEditionMode(true);

						$timeout(function () {
							gridHeaderTitleInput.focus();
							gridHeaderTitleInput.select();
						}, 100, false);
					});
				}

				/**
				 * @ngdoc method
				 * @name attachClickListener
				 * @methodOf data-prep.datagrid-header.directive:DatagridHeader
				 * @description Attach a 'Click' event listener on grid header
				 */
				function attachClickListener() {
					gridHeader.mouseup(function (event) {
						if (event.which === 3) { // Right click
							gridHeader.find('.grid-header-caret').click();
						}
					});
				}

				/**
				 * Get the title and input elements, attach their listeners
				 */
				$timeout(function () {
					gridHeader = iElement.find('.grid-header').eq(0);
					gridHeaderTitle = gridHeader.find('.grid-header-title').eq(0);
					gridHeaderTitleInput = gridHeader.find('.grid-header-title-input').eq(0);

					attachKeyListener();
					attachDblClickListener();
					attachBlurListener();
					attachDisableInputClick();
					attachClickListener();
				}, 0, false);

				/**
				 * Close transformation menu on retrieve error
				 */
				scope.$watch(
					function () {
						return ctrl.transformationsRetrieveError;
					},

					function (newValue) {
						if (newValue) {
							$timeout(() => {
								const headerDropdownAction = iElement.find('.grid-header-caret').eq(0);
								headerDropdownAction.click();
							});
						}
					});

				iElement.on('$destroy', function () {
					scope.$destroy();
				});
			},
		},
	};
}


text:
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;

namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
    /// <summary>
    /// Interaction logic for AllModulesControl.xaml.
    /// </summary>
    public partial class AllModulesControl : UserControl
    {
        #region Construction and Destructor

        /// <summary>
        /// Initializes a new instance of the AllModulesControl class.
        /// </summary>
        public AllModulesControl()
        {
            InitializeComponent();

            this.Loaded += (obj, args) =>
            {
                this.ModulesCombo.Focus();
            };
        }

        #endregion
        /// <summary>
        /// Gets current control of the ShowModuleControl.
        /// </summary>
        internal ShowModuleControl CurrentShowModuleControl
        {
            get { return this.ShowModuleControl; }
        }

        private void RefreshButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            AllModulesViewModel viewModel = this.DataContext as AllModulesViewModel;
            if (viewModel == null)
            {
                return;
            }

            viewModel.OnRefresh();
        }
    }
}


text:
using System.Collections.Generic;

namespace CompayaSmsGateway.Models.Groups
{
    public class GroupListResponseModel: ResponseModel
    {
        public GroupListResponseModel()
        {
            Groups = new List<GroupResponseModel>();
        }

        public List<GroupResponseModel> Groups { get; set; }
    }
}


text:
"""Very simplified lookup and continuous heartbeat client for Ironic API."""

import json
import random
import sys
import time

import netifaces
import requests

_GET_ADDR_MAX_ITERATION = 50
_LOOKUP_MAX_ITERATION = 50
_RETRY_INTERVAL = 5

# NOTE(pas-ha) supporting only Ironic API >= 1.22 !!!
HEADERS = {'Content-Type': 'application/json',
           'Accept': 'application/json',
           'X-OpenStack-Ironic-API-Version': '1.22'}

# TODO(pas-ha) use Python logging
def _log_error(message):
    sys.stderr.write(message)
    sys.stderr.write('\n')

def _process_error(message):
    _log_error(message)
    sys.exit(1)

def _parse_kernel_cmdline():
    """Parse linux kernel command line"""
    with open('/proc/cmdline', 'rt') as f:
        cmdline = f.read()
    return {k: v for k, v in [opt.split('=', 1) for opt in cmdline.split()]}

def _get_interface_ip(mac_addr):
    """"Get IP address of interface by mac."""
    interfaces = netifaces.interfaces()
    for iface in interfaces:
        addresses = netifaces.ifaddresses(iface)
        link_addresses = addresses.get(netifaces.AF_LINK, [])
        for link_addr in link_addresses:
            if link_addr.get('addr') == mac_addr:
                ip_addresses = addresses.get(netifaces.AF_INET)
                if ip_addresses:
                    # NOTE: return first address, ironic API does not
                    # support multiple
                    return ip_addresses[0].get('addr')
                else:
                    break

def lookup(api_url, macs, node_uuid=None):
    lookup_api = '{api_url}/v1/lookup'.format(api_url=api_url)

    params = {
        'addresses': ','.join(macs)
    }
    if node_uuid:
        params['node_uuid'] = node_uuid

    for attempt in range(_LOOKUP_MAX_ITERATION):
        try:
            resp = requests.get(lookup_api, params=params, headers=HEADERS)
        except Exception as e:
            error = str(e)
        else:
            if resp.status_code != requests.codes.OK:
                error = ('Wrong status code %d returned from Ironic API. '
                         'Last response: %s') % (
                             resp.status_code, resp.content)
            else:
                break

        if attempt == (_LOOKUP_MAX_ITERATION - 1):
            _process_error(error)

        time.sleep(_RETRY_INTERVAL)

    return resp.json()

def heartbeat(heartbeat_url, boot_ip, timeout):
    data = {"callback_url": "http://" + boot_ip}
    attempt = 0
    while True:
        error = None
        try:
            resp = requests.post(heartbeat_url, data=json.dumps(data),
                                 headers=HEADERS)
        except Exception as e:
            error = str(e)
        else:
            if resp.status_code != requests.codes.ACCEPTED:
                error = ('Wrong status code %d returned from Ironic API. '
                         'Last response: %s') % (
                             resp.status_code, resp.content)
            else:
                attempt = 0
                time.sleep(timeout)
        if error:
            _log_error(error)
            attempt += 1
            # exponential backoff
            time.sleep(timeout * random.choice(range(1 << attempt)))

# TODO(pas-ha) rewrite with classes and requests session

def main():
    """Script informs Ironic that bootstrap loading is done.

    There are two mandatory parameters in kernel command line.
        'BOOTIF' - MAC address of the boot interface.
                   Passed from PXE boot loader
        'ipa-api-url' - URL of Ironic API service, passed from Ironic
    """
    kernel_params = _parse_kernel_cmdline()
    api_url = kernel_params.get('ipa-api-url')
    if api_url is None:
        _process_error('Mandatory kernel parameter "ipa-api-url" is missing.')

    boot_mac = kernel_params.get('BOOTIF')
    if boot_mac is None:
        _process_error('Cannot define boot interface, "BOOTIF" kernel '
                       'parameter is missing.')

    # There is a difference in syntax in BOOTIF variable between pxe and ipxe
    # boot with Ironic.
    # For pxe boot the the leading `01-' denotes the device type (Ethernet)
    # and is not a part of the MAC address
    if boot_mac.startswith('01-'):
        boot_mac = boot_mac[3:].replace('-', ':')

    # FIXME(pas-ha) discover all MACs
    node = lookup(api_url, [boot_mac])
    uuid = node['node']['uuid']
    timeout = node['config']['heartbeat_timeout']

    heartbeat_url = '{api_url}/v1/heartbeat/{uuid}'.format(api_url=api_url,
                                                           uuid=uuid)
    for n in range(_GET_ADDR_MAX_ITERATION):
        boot_ip = _get_interface_ip(boot_mac)
        if boot_ip is not None:
            break
        time.sleep(_RETRY_INTERVAL)
    else:
        _process_error('Cannot find IP address of boot interface.')

    heartbeat(heartbeat_url, boot_ip, timeout)

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


text:
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, preprocessing
import pandas as pd
from matplotlib import style
import statistics

style.use("ggplot")

FEATURES =  [
  'DE Ratio',
  'Trailing P/E',
  'Price/Sales',
  'Price/Book',
  'Profit Margin',
  'Operating Margin',
  'Return on Assets',
  'Return on Equity',
  'Revenue Per Share',
  'Market Cap',
  'Enterprise Value',
  'Forward P/E',
  'PEG Ratio',
  'Enterprise Value/Revenue',
  'Enterprise Value/EBITDA',
  'Revenue',
  'Gross Profit',
  'EBITDA',
  'Net Income Avl to Common ',
  'Diluted EPS',
  'Earnings Growth',
  'Revenue Growth',
  'Total Cash',
  'Total Cash Per Share',
  'Total Debt',
  'Current Ratio',
  'Book Value Per Share',
  'Cash Flow',
  'Beta',
  'Held by Insiders',
  'Held by Institutions',
  'Shares Short (as of',
  'Short Ratio',
  'Short % of Float',
  'Shares Short (prior '
]

def Build_Data_Set():
  # data_df = pd.DataFrame.from_csv("key_stats_acc_perf_WITH_NA.csv")
  data_df = pd.DataFrame.from_csv("key_stats_acc_perf_NO_NA.csv")

  # shuffle data:
  data_df = data_df.reindex(np.random.permutation(data_df.index))

  data_df = data_df.replace("NaN",0).replace("N/A",0)
  # data_df = data_df.replace("NaN",-999).replace("N/A",-999)

  X = np.array(data_df[FEATURES].values)#.tolist())

  y = ( data_df["Status"]
        .replace("underperform",0)
        .replace("outperform",1)
        .values.tolist()
  )

  X = preprocessing.scale(X)

  Z = np.array( data_df[ ["stock_p_change", "sp500_p_change"] ] )

  return X,y,Z

def Analysis():
  test_size = 1000
  invest_amount = 10000 # dollars
  total_invests = 0
  if_market = 0
  if_strat = 0

  X, y, Z = Build_Data_Set()
  print(len(X))

  clf = svm.SVC(kernel="linear", C=1.0)
  clf.fit(X[:-test_size],y[:-test_size]) # train data

  correct_count = 0
  for x in range(1, test_size+1):
    invest_return = 0
    market_return = 0
    if clf.predict(X[-x])[0] == y[-x]: # test data
      correct_count += 1

    if clf.predict(X[-x])[0] == 1:
      invest_return = invest_amount + (invest_amount * (Z[-x][0] / 100.0))
      market_return = invest_amount + (invest_amount * (Z[-x][1] / 100.0))
      total_invests += 1
      if_market += market_return
      if_strat += invest_return

  print("correct_count=%s"%float(correct_count))
  print("test_size=%s"%float(test_size))

  print('_'*120)
  # on OS X with 64-bit python 2.7.6 had to add float(), otherwise result was zero:
  print("Accuracy: %s%%" % ((float(correct_count) / float(test_size)) * 100.00))

  print("Total Trades: %s" % total_invests)
  print("Ending with Strategy: %s" % if_strat)
  print("Ending with Market: %s" % if_market)

  compared = ((if_strat - if_market) / if_market) * 100.0
  do_nothing = total_invests * invest_amount
  avg_market = ((if_market - do_nothing) / do_nothing) * 100.0
  avg_strat = ((if_strat - do_nothing) / do_nothing) * 100.0
  print('*'*120)
  print("Compared to market, we earn: %s%% more" % str(compared))
  print('*'*120)
  print("Average investment return: %s%%" % str(avg_strat))
  print("Average market return: %s%%" % str(avg_market))
  print('_'*120)

Analysis()


text:
<?php

namespace Umbrella\Ya\RetornoBoleto;

use Exception;
use InvalidArgumentException;
use League\Flysystem\FileNotFoundException;
use Umbrella\Ya\RetornoBoleto\Cnab\Cnab150\Processor\CNAB150Processor;
use Umbrella\Ya\RetornoBoleto\Cnab\Cnab240\Processor\CNAB240Processor;
use Umbrella\Ya\RetornoBoleto\Cnab\Cnab400\Convenio\Processor\CNAB400Conv6Processor;
use Umbrella\Ya\RetornoBoleto\Cnab\Cnab400\Convenio\Processor\CNAB400Conv7Processor;
use Umbrella\Ya\RetornoBoleto\Exception\DetailSectionNotFoundException;
use Umbrella\Ya\RetornoBoleto\Exception\HeaderSectionNotFoundException;
use Umbrella\Ya\RetornoBoleto\Exception\InvalidHeaderException;
use Umbrella\Ya\RetornoBoleto\Exception\ReturnFileNotSupportedException;

/**
 * Classe que identifica o tipo de arquivo de retorno sendo carregado e instancia a classe
 * específica para leitura do mesmo.
 * @author Ítalo Lelis de Vietro <italolelis@gmail.com>
 */
class ProcessFactory
{

    /**
     * Instancia um objeto de uma das sub-classes de AbstractRetorno,
     * com base no tipo do arquivo de retorno indicado por $fileName
     * @param string fileName Nome do arquivo de retorno a ser identificado
     * para poder instancia a classe específica para leitura do mesmo.
     * @return AbstractProcessor Retorna um objeto de uma das sub-classes de AbstractProcessor.
     */
    public static function getRetorno($fileName)
    {
        if (!$fileName) {
            throw new InvalidArgumentException("Informe o nome do arquivo de retorno.");
        }

        $arq = fopen($fileName, "r");
        if (!$arq) {
            throw new FileNotFoundException("Não foi possível abrir o arquivo \"$fileName\".");
        }

        //Lê o header do arquivo
        $linha = fgets($arq, 500);
        if (!$linha) {
            fclose($arq);
            throw new HeaderSectionNotFoundException("Tipo de arquivo de retorno não identificado. Não foi possível ler o header do arquivo.");
        }

        $len = strlen($linha);
        if ($len >= 150 && $len <= 152) {
            return new CNAB150Processor($fileName);
        } elseif ($len >= 240 && $len <= 242) {
            return new CNAB240Processor($fileName);
        } elseif ($len >= 400 && $len <= 402) {
            if (strstr($linha, "BRADESCO")) {
                throw new ReturnFileNotSupportedException('Arquivo de retorno Bradesco não suportado.');
            }

            //Lê o primeiro registro detalhe
            $linha = fgets($arq, 500);
            if (!$linha) {
                throw new DetailSectionNotFoundException("Tipo de arquivo de retorno não identificado. Não foi possível ler um registro detalhe.");
            }
            switch ($linha[0]) {
                case CNAB400Conv6Processor::DETALHE:
                    return new CNAB400Conv6Processor($fileName);
                case CNAB400Conv7Processor::DETALHE:
                    return new CNAB400Conv7Processor($fileName);
                default:
                    throw new Exception("Tipo de registro detalhe desconhecido: " . $linha[0]);
            }
        } else {
            throw new InvalidHeaderException("Tipo de arquivo de retorno não identificado. Total de colunas do header: $len");
        }
    }
}


text:
<resources>
    <string name="app_name">Client</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_binding">Binding</string>

    <string name="remote_service_started">remote_service_started</string>
    <string name="remote_service_stopped">remote_service_stopped</string>
    <string name="remote_service_connected">remote_service_connected</string>
    <string name="remote_service_label">remote_service_label</string>
    <string name="remote_service_controller">remote_service_controller</string>
    <string name="unbind_service">unbind_service</string>
    <string name="start_service">start_service</string>
    <string name="stop_service">stop_service</string>
    <string name="remote_call_failed">remote_call_failed</string>
    <string name="remote_service_disconnected">remote_service_disconnected</string>
    <string name="remote_service_unbind_disconn">remote_service_unbind_disconn</string>
    <string name="remote_service_binding">remote_service_binding</string>
    <string name="bind_service">bind_service</string>
    <string name="kill_process">kill_process</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="classpath:web-jdbc.properties"/>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driverClassName}"/>
        <property name="url" value="${jdbcUrl}" />
        <property name="username" value="${jdbcUsername}" />
        <property name="password" value="${jdbcPassword}" />

        <property name="maxActive" value="${maxActive}" />
        <property name="initialSize" value="${initialSize}" />
        <property name="maxWait" value="${maxWait}" />
        <property name="minIdle" value="${minIdle}" />
    </bean>

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="mapperLocations"  value="classpath:com/zuoxiaolong/blog/mapper/*.xml" />
        <property name="plugins">
            <bean class="com.zuoxiaolong.blog.common.orm.PageInterceptor"/>
        </property>
    </bean>

    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.zuoxiaolong.blog.mapper" />
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
    </bean>

</beans>


text:
//
// Copyright (c) .NET Foundation and Contributors
// See LICENSE file in the project root for full license information.
//

using System.Threading.Tasks;

namespace nanoFramework.Tools.VisualStudio.Extension
{
    public static class TaskExtensions
    {
        /// <summary>
        /// Extension to tell the compiler that we actually use the instance for something. This is that the "fire-and-forget" mechanism is being used intentionally.
        /// </summary>
        /// <param name="task"></param>
        public static void FireAndForget(this Task task)
        {
        }

        /// <summary>
        /// Extension to tell the compiler that we actually use the instance for something. This is that the "fire-and-forget" mechanism is being used intentionally.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="task"></param>
        public static void FireAndForget<T>(this Task<T> task)
        {
        }
    }
}


text:
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::showEvent(QShowEvent *)
{
    testAllRounds(QDateTime::fromString("31.01.2015 12:20", "dd.MM.yyyy hh:mm"));
    ui->lwLog->addItem("");
    testAllRounds(QDateTime::fromString("31.08.2015 17:40", "dd.MM.yyyy hh:mm"));
}

void MainWindow::testAllRounds(const QDateTime &d)
{
    CLTimeLine* l = new CLTimeLine();
    ui->lwLog->addItem(QString("Date: %1").arg(d.toString()));
    ui->lwLog->addItem(QString("Trunc to hour: %1").arg(l->truncToUnit(d, cluHour).toString()));
    ui->lwLog->addItem(QString("Round to hour: %1").arg(l->roundToUnit(d, cluHour).toString()));
    ui->lwLog->addItem(QString("Trunc to day: %1").arg(l->truncToUnit(d, cluDay).toString()));
    ui->lwLog->addItem(QString("Round to day: %1").arg(l->roundToUnit(d, cluDay).toString()));
    ui->lwLog->addItem(QString("Trunc to week: %1").arg(l->truncToUnit(d, cluWeek).toString()));
    ui->lwLog->addItem(QString("Round to week: %1").arg(l->roundToUnit(d, cluWeek).toString()));
    ui->lwLog->addItem(QString("Trunc to month: %1").arg(l->truncToUnit(d, cluMonth).toString()));
    ui->lwLog->addItem(QString("Round to month: %1").arg(l->roundToUnit(d, cluMonth).toString()));
    ui->lwLog->addItem(QString("Trunc to quarter: %1").arg(l->truncToUnit(d, cluQuarter).toString()));
    ui->lwLog->addItem(QString("Round to quarter: %1").arg(l->roundToUnit(d, cluQuarter).toString()));
    ui->lwLog->addItem(QString("Trunc to year: %1").arg(l->truncToUnit(d, cluYear).toString()));
    ui->lwLog->addItem(QString("Round to year: %1").arg(l->roundToUnit(d, cluYear).toString()));
    // TODO week
    delete l;
}


text:
const volatile void* volatile sink;

void test_static_members() {
  DoNotOptimize(&std::strong_ordering::less);
  DoNotOptimize(&std::strong_ordering::equal);
  DoNotOptimize(&std::strong_ordering::equivalent);
  DoNotOptimize(&std::strong_ordering::greater);
}

void test_signatures() {
  auto& Eq = std::strong_ordering::equivalent;

  ASSERT_NOEXCEPT(Eq == 0);
  ASSERT_NOEXCEPT(0 == Eq);
  ASSERT_NOEXCEPT(Eq != 0);
  ASSERT_NOEXCEPT(0 != Eq);
  ASSERT_NOEXCEPT(0 < Eq);
  ASSERT_NOEXCEPT(Eq < 0);
  ASSERT_NOEXCEPT(0 <= Eq);
  ASSERT_NOEXCEPT(Eq <= 0);
  ASSERT_NOEXCEPT(0 > Eq);
  ASSERT_NOEXCEPT(Eq > 0);
  ASSERT_NOEXCEPT(0 >= Eq);
  ASSERT_NOEXCEPT(Eq >= 0);
#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
  ASSERT_NOEXCEPT(0 <=> Eq);
  ASSERT_NOEXCEPT(Eq <=> 0);
  ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_ordering);
  ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_ordering);
#endif
}

constexpr bool test_conversion() {
  static_assert(std::is_convertible<const std::strong_ordering&,
      std::weak_equality>::value, "");
  { // value == 0
    auto V = std::strong_ordering::equivalent;
    std::weak_equality WV = V;
    assert(WV == 0);
  }
  std::strong_ordering WeakTestCases[] = {
      std::strong_ordering::less,
      std::strong_ordering::greater,
  };
  for (auto V : WeakTestCases)
  { // value != 0
    std::weak_equality WV = V;
    assert(WV != 0);
  }
  static_assert(std::is_convertible<const std::strong_ordering&,
      std::strong_equality>::value, "");
  { // value == 0
    auto V = std::strong_ordering::equivalent;
    std::strong_equality WV = V;
    assert(WV == 0);
  }
  { // value == 0
    auto V = std::strong_ordering::equal;
    std::strong_equality WV = V;
    assert(WV == 0);
  }
  std::strong_ordering StrongTestCases[] = {
      std::strong_ordering::less,
      std::strong_ordering::greater,
  };
  for (auto V : StrongTestCases)
  { // value != 0
    std::strong_equality WV = V;
    assert(WV != 0);
  }

  static_assert(std::is_convertible<const std::strong_ordering&,
      std::partial_ordering>::value, "");
  { // value == 0
    auto V = std::strong_ordering::equivalent;
    std::partial_ordering WV = V;
    assert(WV == 0);
  }
  { // value < 0
    auto V = std::strong_ordering::less;
    std::partial_ordering WV = V;
    assert(WV < 0);
  }
  { // value > 0
    auto V = std::strong_ordering::greater;
    std::partial_ordering WV = V;
    assert(WV > 0);
  }

  static_assert(std::is_convertible<const std::strong_ordering&,
      std::weak_ordering>::value, "");
  { // value == 0
    auto V = std::strong_ordering::equivalent;
    std::weak_ordering WV = V;
    assert(WV == 0);
  }
  { // value < 0
    auto V = std::strong_ordering::less;
    std::weak_ordering WV = V;
    assert(WV < 0);
  }
  { // value > 0
    auto V = std::strong_ordering::greater;
    std::weak_ordering WV = V;
    assert(WV > 0);
  }
  return true;
}

constexpr bool test_constexpr() {
  auto& Eq = std::strong_ordering::equal;
  auto& Equiv = std::strong_ordering::equivalent;
  auto& Less = std::strong_ordering::less;
  auto& Greater = std::strong_ordering::greater;
  struct {
    std::strong_ordering Value;
    bool ExpectEq;
    bool ExpectNeq;
    bool ExpectLess;
    bool ExpectGreater;
  } TestCases[] = {
      {Eq, true, false, false, false},
      {Equiv, true, false, false, false},
      {Less, false, true, true, false},
      {Greater, false, true, false, true},
  };
  for (auto TC : TestCases) {
    auto V = TC.Value;
    assert((V == 0) == TC.ExpectEq);
    assert((0 == V) == TC.ExpectEq);
    assert((V != 0) == TC.ExpectNeq);
    assert((0 != V) == TC.ExpectNeq);

    assert((V < 0) == TC.ExpectLess);
    assert((V > 0) == TC.ExpectGreater);
    assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq));
    assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq));

    assert((0 < V) == TC.ExpectGreater);
    assert((0 > V) == TC.ExpectLess);
    assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
    assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
  }
#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
  {
    std::strong_ordering res = (Eq <=> 0);
    ((void)res);
    res = (0 <=> Eq);
    ((void)res);
  }
  enum ExpectRes {
    ER_Greater,
    ER_Less,
    ER_Equiv
  };
  struct {
    std::strong_ordering Value;
    ExpectRes Expect;
  } SpaceshipTestCases[] = {
      {std::strong_ordering::equivalent, ER_Equiv},
      {std::strong_ordering::less, ER_Less},
      {std::strong_ordering::greater, ER_Greater},
  };
  for (auto TC : SpaceshipTestCases)
  {
    std::strong_ordering Res = (0 <=> TC.Value);
    switch (TC.Expect) {
    case ER_Equiv:
      assert(Res == 0);
      assert(0 == Res);
      break;
    case ER_Less:
      assert(Res < 0);
      break;
    case ER_Greater:
      assert(Res > 0);
      break;
    }
  }
#endif

  return true;
}

int main() {
  test_static_members();
  test_signatures();
  static_assert(test_conversion(), "conversion test failed");
  static_assert(test_constexpr(), "constexpr test failed");
}


text:
package android.hcartoon.activity;

import android.app.Activity;
import android.content.Intent;
import android.hcartoon.adapter.SortActAdapter;
import android.hcartoon.bean.SortActBean;
import android.hcartoon.constant.Constant;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created by Lenovo on 2015/12/4.
 */
public class SortActivity extends Activity implements View.OnClickListener, AdapterView.OnItemClickListener, Response.Listener<JSONObject> {

    private SortActAdapter sortActAdapter;
    private ListView listView;
    private ArrayList<SortActBean> list;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sort);
        Intent intent = getIntent();
        String id = intent.getStringExtra("id");
        String name = intent.getStringExtra("title");

        TextView title = (TextView) findViewById(R.id.sort_ac_title);
        title.setText(name);
        findViewById(R.id.sort_back).setOnClickListener(this);

        listView = (ListView) findViewById(R.id.sort_listview);
        sortActAdapter = new SortActAdapter(this);
        listView.setOnItemClickListener(this);

        String url = Constant.SORT_LIST_ITEMS + id;
        RequestQueue queue = Volley.newRequestQueue(this);
        JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST,url,
                null,this, null);
        queue.add(request);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.sort_back){
            finish();
        }

    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

        if (list != null){
            SortActBean sortActBean = list.get(position);
            String cid = sortActBean.getCid();
            Intent intent = new Intent(this, DetailActivity.class);
            intent.putExtra("cid",cid);
            startActivity(intent);
        }

    }

    @Override
    public void onResponse(JSONObject jsonObject) {

        list = new ArrayList<SortActBean>();
        try {
            JSONObject object = jsonObject.getJSONObject("data");
            Iterator iterator = object.keys();
            while (iterator.hasNext()){
                String key = String.valueOf(iterator.next());
                JSONObject object1 = object.getJSONObject(key);

                String img = Constant.HOST_NAME
                        + object1.getString("frontcover");
                String cid = object1.getString("c_id");
                String title = object1.getString("c_name");
                String author = object1.getString("author_name");
                String intro = object1.getString("rl_long");
                list.add(new SortActBean(img, title, author, intro, cid));
            }
            sortActAdapter.setData(list);
            listView.setAdapter(sortActAdapter);
        } catch (JSONException e) {
            e.printStackTrace();
        }

    }
}


text:
/**
 * Created by gary on 16/4/1.
 */
(function() {
  'use strict';

  angular
    .module('nqms')
    .controller('RolesModalController', rolesModalControllerFunc);

  /** @ngInject */
  function rolesModalControllerFunc($uibModalInstance, $rootScope, rolesService, security, toastr) {
    var vm = this;

    vm.cancel = cancel;
    vm.save = save;

    function save() {
      rolesService.save(vm.role).then(function (response) {
        if (response && response.data.code === '0') {
          toastr.success('添加成功!', '提示');

          $uibModalInstance.dismiss('cancel');

          security.getUserRoleList();
          $rootScope.$apply();
        } else {
          toastr.error('保存失败', '警告');
        }
      });
    }

    function cancel() {
      $uibModalInstance.dismiss('cancel');
    }
  }

})();


text:
#ifndef _CIO_QDIO_H
#define _CIO_QDIO_H

#include <asm/page.h>
#include <asm/schid.h>
#include <asm/debug.h>
#include "chsc.h"

#define QDIO_BUSY_BIT_PATIENCE		(100 << 12)	/* 100 microseconds */
#define QDIO_BUSY_BIT_RETRY_DELAY	10		/* 10 milliseconds */
#define QDIO_BUSY_BIT_RETRIES		1000		/* = 10s retry time */
#define QDIO_INPUT_THRESHOLD		(500 << 12)	/* 500 microseconds */

/*
 * if an asynchronous HiperSockets queue runs full, the 10 seconds timer wait
 * till next initiative to give transmitted skbs back to the stack is too long.
 * Therefore polling is started in case of multicast queue is filled more
 * than 50 percent.
 */
#define QDIO_IQDIO_POLL_LVL		65	/* HS multicast queue */

enum qdio_irq_states {
	QDIO_IRQ_STATE_INACTIVE,
	QDIO_IRQ_STATE_ESTABLISHED,
	QDIO_IRQ_STATE_ACTIVE,
	QDIO_IRQ_STATE_STOPPED,
	QDIO_IRQ_STATE_CLEANUP,
	QDIO_IRQ_STATE_ERR,
	NR_QDIO_IRQ_STATES,
};

/* used as intparm in do_IO */
#define QDIO_DOING_ESTABLISH	1
#define QDIO_DOING_ACTIVATE	2
#define QDIO_DOING_CLEANUP	3

#define SLSB_STATE_NOT_INIT	0x0
#define SLSB_STATE_EMPTY	0x1
#define SLSB_STATE_PRIMED	0x2
#define SLSB_STATE_HALTED	0xe
#define SLSB_STATE_ERROR	0xf
#define SLSB_TYPE_INPUT		0x0
#define SLSB_TYPE_OUTPUT	0x20
#define SLSB_OWNER_PROG		0x80
#define SLSB_OWNER_CU		0x40

#define SLSB_P_INPUT_NOT_INIT	\
	(SLSB_OWNER_PROG | SLSB_TYPE_INPUT | SLSB_STATE_NOT_INIT)  /* 0x80 */
#define SLSB_P_INPUT_ACK	\
	(SLSB_OWNER_PROG | SLSB_TYPE_INPUT | SLSB_STATE_EMPTY)	   /* 0x81 */
#define SLSB_CU_INPUT_EMPTY	\
	(SLSB_OWNER_CU | SLSB_TYPE_INPUT | SLSB_STATE_EMPTY)	   /* 0x41 */
#define SLSB_P_INPUT_PRIMED	\
	(SLSB_OWNER_PROG | SLSB_TYPE_INPUT | SLSB_STATE_PRIMED)	   /* 0x82 */
#define SLSB_P_INPUT_HALTED	\
	(SLSB_OWNER_PROG | SLSB_TYPE_INPUT | SLSB_STATE_HALTED)	   /* 0x8e */
#define SLSB_P_INPUT_ERROR	\
	(SLSB_OWNER_PROG | SLSB_TYPE_INPUT | SLSB_STATE_ERROR)	   /* 0x8f */
#define SLSB_P_OUTPUT_NOT_INIT	\
	(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_NOT_INIT) /* 0xa0 */
#define SLSB_P_OUTPUT_EMPTY	\
	(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_EMPTY)	   /* 0xa1 */
#define SLSB_CU_OUTPUT_PRIMED	\
	(SLSB_OWNER_CU | SLSB_TYPE_OUTPUT | SLSB_STATE_PRIMED)	   /* 0x62 */
#define SLSB_P_OUTPUT_HALTED	\
	(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_HALTED)   /* 0xae */
#define SLSB_P_OUTPUT_ERROR	\
	(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_ERROR)	   /* 0xaf */

#define SLSB_ERROR_DURING_LOOKUP  0xff

/* additional CIWs returned by extended Sense-ID */
#define CIW_TYPE_EQUEUE			0x3 /* establish QDIO queues */
#define CIW_TYPE_AQUEUE			0x4 /* activate QDIO queues */

/* flags for st qdio sch data */
#define CHSC_FLAG_QDIO_CAPABILITY	0x80
#define CHSC_FLAG_VALIDITY		0x40

/* qdio adapter-characteristics-1 flag */
#define AC1_SIGA_INPUT_NEEDED		0x40	/* process input queues */
#define AC1_SIGA_OUTPUT_NEEDED		0x20	/* process output queues */
#define AC1_SIGA_SYNC_NEEDED		0x10	/* ask hypervisor to sync */
#define AC1_AUTOMATIC_SYNC_ON_THININT	0x08	/* set by hypervisor */
#define AC1_AUTOMATIC_SYNC_ON_OUT_PCI	0x04	/* set by hypervisor */
#define AC1_SC_QEBSM_AVAILABLE		0x02	/* available for subchannel */
#define AC1_SC_QEBSM_ENABLED		0x01	/* enabled for subchannel */

/* SIGA flags */
#define QDIO_SIGA_WRITE		0x00
#define QDIO_SIGA_READ		0x01
#define QDIO_SIGA_SYNC		0x02
#define QDIO_SIGA_QEBSM_FLAG	0x80

#ifdef CONFIG_64BIT
static inline int do_sqbs(u64 token, unsigned char state, int queue,
			  int *start, int *count)
{
	register unsigned long _ccq asm ("0") = *count;
	register unsigned long _token asm ("1") = token;
	unsigned long _queuestart = ((unsigned long)queue << 32) | *start;

	asm volatile(
		"	.insn	rsy,0xeb000000008A,%1,0,0(%2)"
		: "+d" (_ccq), "+d" (_queuestart)
		: "d" ((unsigned long)state), "d" (_token)
		: "memory", "cc");
	*count = _ccq & 0xff;
	*start = _queuestart & 0xff;

	return (_ccq >> 32) & 0xff;
}

static inline int do_eqbs(u64 token, unsigned char *state, int queue,
			  int *start, int *count, int ack)
{
	register unsigned long _ccq asm ("0") = *count;
	register unsigned long _token asm ("1") = token;
	unsigned long _queuestart = ((unsigned long)queue << 32) | *start;
	unsigned long _state = (unsigned long)ack << 63;

	asm volatile(
		"	.insn	rrf,0xB99c0000,%1,%2,0,0"
		: "+d" (_ccq), "+d" (_queuestart), "+d" (_state)
		: "d" (_token)
		: "memory", "cc");
	*count = _ccq & 0xff;
	*start = _queuestart & 0xff;
	*state = _state & 0xff;

	return (_ccq >> 32) & 0xff;
}
#else
static inline int do_sqbs(u64 token, unsigned char state, int queue,
			  int *start, int *count) { return 0; }
static inline int do_eqbs(u64 token, unsigned char *state, int queue,
			  int *start, int *count, int ack) { return 0; }
#endif /* CONFIG_64BIT */

struct qdio_irq;

struct siga_flag {
	u8 input:1;
	u8 output:1;
	u8 sync:1;
	u8 sync_after_ai:1;
	u8 sync_out_after_pci:1;
	u8:3;
} __attribute__ ((packed));

struct chsc_ssqd_area {
	struct chsc_header request;
	u16:10;
	u8 ssid:2;
	u8 fmt:4;
	u16 first_sch;
	u16:16;
	u16 last_sch;
	u32:32;
	struct chsc_header response;
	u32:32;
	struct qdio_ssqd_desc qdio_ssqd;
} __attribute__ ((packed));

struct scssc_area {
	struct chsc_header request;
	u16 operation_code;
	u16:16;
	u32:32;
	u32:32;
	u64 summary_indicator_addr;
	u64 subchannel_indicator_addr;
	u32 ks:4;
	u32 kc:4;
	u32:21;
	u32 isc:3;
	u32 word_with_d_bit;
	u32:32;
	struct subchannel_id schid;
	u32 reserved[1004];
	struct chsc_header response;
	u32:32;
} __attribute__ ((packed));

struct qdio_dev_perf_stat {
	unsigned int adapter_int;
	unsigned int qdio_int;
	unsigned int pci_request_int;

	unsigned int tasklet_inbound;
	unsigned int tasklet_inbound_resched;
	unsigned int tasklet_inbound_resched2;
	unsigned int tasklet_outbound;

	unsigned int siga_read;
	unsigned int siga_write;
	unsigned int siga_sync;

	unsigned int inbound_call;
	unsigned int inbound_handler;
	unsigned int stop_polling;
	unsigned int inbound_queue_full;
	unsigned int outbound_call;
	unsigned int outbound_handler;
	unsigned int outbound_queue_full;
	unsigned int fast_requeue;
	unsigned int target_full;
	unsigned int eqbs;
	unsigned int eqbs_partial;
	unsigned int sqbs;
	unsigned int sqbs_partial;
	unsigned int int_discarded;
} ____cacheline_aligned;

struct qdio_queue_perf_stat {
	/*
	 * Sorted into order-2 buckets: 1, 2-3, 4-7, ... 64-127, 128.
	 * Since max. 127 SBALs are scanned reuse entry for 128 as queue full
	 * aka 127 SBALs found.
	 */
	unsigned int nr_sbals[8];
	unsigned int nr_sbal_error;
	unsigned int nr_sbal_nop;
	unsigned int nr_sbal_total;
};

enum qdio_queue_irq_states {
	QDIO_QUEUE_IRQS_DISABLED,
};

struct qdio_input_q {
	/* input buffer acknowledgement flag */
	int polling;
	/* first ACK'ed buffer */
	int ack_start;
	/* how much sbals are acknowledged with qebsm */
	int ack_count;
	/* last time of noticing incoming data */
	u64 timestamp;
	/* upper-layer polling flag */
	unsigned long queue_irq_state;
	/* callback to start upper-layer polling */
	void (*queue_start_poll) (struct ccw_device *, int, unsigned long);
};

struct qdio_output_q {
	/* PCIs are enabled for the queue */
	int pci_out_enabled;
	/* timer to check for more outbound work */
	struct timer_list timer;
	/* used SBALs before tasklet schedule */
	int scan_threshold;
};

/*
 * Note on cache alignment: grouped slsb and write mostly data at the beginning
 * sbal[] is read-only and starts on a new cacheline followed by read mostly.
 */
struct qdio_q {
	struct slsb slsb;

	union {
		struct qdio_input_q in;
		struct qdio_output_q out;
	} u;

	/*
	 * inbound: next buffer the program should check for
	 * outbound: next buffer to check if adapter processed it
	 */
	int first_to_check;

	/* first_to_check of the last time */
	int last_move;

	/* beginning position for calling the program */
	int first_to_kick;

	/* number of buffers in use by the adapter */
	atomic_t nr_buf_used;

	/* error condition during a data transfer */
	unsigned int qdio_error;

	struct tasklet_struct tasklet;
	struct qdio_queue_perf_stat q_stats;

	struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q] ____cacheline_aligned;

	/* queue number */
	int nr;

	/* bitmask of queue number */
	int mask;

	/* input or output queue */
	int is_input_q;

	/* list of thinint input queues */
	struct list_head entry;

	/* upper-layer program handler */
	qdio_handler_t (*handler);

	struct dentry *debugfs_q;
	struct qdio_irq *irq_ptr;
	struct sl *sl;
	/*
	 * A page is allocated under this pointer and used for slib and sl.
	 * slib is 2048 bytes big and sl points to offset PAGE_SIZE / 2.
	 */
	struct slib *slib;
} __attribute__ ((aligned(256)));

struct qdio_irq {
	struct qib qib;
	u32 *dsci;		/* address of device state change indicator */
	struct ccw_device *cdev;
	struct dentry *debugfs_dev;
	struct dentry *debugfs_perf;

	unsigned long int_parm;
	struct subchannel_id schid;
	unsigned long sch_token;	/* QEBSM facility */

	enum qdio_irq_states state;

	struct siga_flag siga_flag;	/* siga sync information from qdioac */

	int nr_input_qs;
	int nr_output_qs;

	struct ccw1 ccw;
	struct ciw equeue;
	struct ciw aqueue;

	struct qdio_ssqd_desc ssqd_desc;
	void (*orig_handler) (struct ccw_device *, unsigned long, struct irb *);

	int perf_stat_enabled;

	struct qdr *qdr;
	unsigned long chsc_page;

	struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
	struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];

	debug_info_t *debug_area;
	struct mutex setup_mutex;
	struct qdio_dev_perf_stat perf_stat;
};

/* helper functions */
#define queue_type(q)	q->irq_ptr->qib.qfmt
#define SCH_NO(q)	(q->irq_ptr->schid.sch_no)

#define is_thinint_irq(irq) \
	(irq->qib.qfmt == QDIO_IQDIO_QFMT || \
	 css_general_characteristics.aif_osa)

#define qperf(__qdev, __attr)	((__qdev)->perf_stat.(__attr))

#define qperf_inc(__q, __attr)						\
({									\
	struct qdio_irq *qdev = (__q)->irq_ptr;				\
	if (qdev->perf_stat_enabled)					\
		(qdev->perf_stat.__attr)++;				\
})

static inline void account_sbals_error(struct qdio_q *q, int count)
{
	q->q_stats.nr_sbal_error += count;
	q->q_stats.nr_sbal_total += count;
}

/* the highest iqdio queue is used for multicast */
static inline int multicast_outbound(struct qdio_q *q)
{
	return (q->irq_ptr->nr_output_qs > 1) &&
	       (q->nr == q->irq_ptr->nr_output_qs - 1);
}

#define pci_out_supported(q) \
	(q->irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED)
#define is_qebsm(q)			(q->irq_ptr->sch_token != 0)

#define need_siga_in(q)			(q->irq_ptr->siga_flag.input)
#define need_siga_out(q)		(q->irq_ptr->siga_flag.output)
#define need_siga_sync(q)		(unlikely(q->irq_ptr->siga_flag.sync))
#define need_siga_sync_after_ai(q)	\
	(unlikely(q->irq_ptr->siga_flag.sync_after_ai))
#define need_siga_sync_out_after_pci(q)	\
	(unlikely(q->irq_ptr->siga_flag.sync_out_after_pci))

#define for_each_input_queue(irq_ptr, q, i)	\
	for (i = 0, q = irq_ptr->input_qs[0];	\
		i < irq_ptr->nr_input_qs;	\
		q = irq_ptr->input_qs[++i])
#define for_each_output_queue(irq_ptr, q, i)	\
	for (i = 0, q = irq_ptr->output_qs[0];	\
		i < irq_ptr->nr_output_qs;	\
		q = irq_ptr->output_qs[++i])

#define prev_buf(bufnr)	\
	((bufnr + QDIO_MAX_BUFFERS_MASK) & QDIO_MAX_BUFFERS_MASK)
#define next_buf(bufnr)	\
	((bufnr + 1) & QDIO_MAX_BUFFERS_MASK)
#define add_buf(bufnr, inc) \
	((bufnr + inc) & QDIO_MAX_BUFFERS_MASK)
#define sub_buf(bufnr, dec) \
	((bufnr - dec) & QDIO_MAX_BUFFERS_MASK)

#define queue_irqs_enabled(q)			\
	(test_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state) == 0)
#define queue_irqs_disabled(q)			\
	(test_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state) != 0)

#define TIQDIO_SHARED_IND		63

/* device state change indicators */
struct indicator_t {
	u32 ind;	/* u32 because of compare-and-swap performance */
	atomic_t count; /* use count, 0 or 1 for non-shared indicators */
};

extern struct indicator_t *q_indicators;

static inline int shared_ind(u32 *dsci)
{
	return dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
}

/* prototypes for thin interrupt */
void qdio_setup_thinint(struct qdio_irq *irq_ptr);
int qdio_establish_thinint(struct qdio_irq *irq_ptr);
void qdio_shutdown_thinint(struct qdio_irq *irq_ptr);
void tiqdio_add_input_queues(struct qdio_irq *irq_ptr);
void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr);
void tiqdio_inbound_processing(unsigned long q);
int tiqdio_allocate_memory(void);
void tiqdio_free_memory(void);
int tiqdio_register_thinints(void);
void tiqdio_unregister_thinints(void);

/* prototypes for setup */
void qdio_inbound_processing(unsigned long data);
void qdio_outbound_processing(unsigned long data);
void qdio_outbound_timer(unsigned long data);
void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
		      struct irb *irb);
int qdio_allocate_qs(struct qdio_irq *irq_ptr, int nr_input_qs,
		     int nr_output_qs);
void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr);
int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
			struct subchannel_id *schid,
			struct qdio_ssqd_desc *data);
int qdio_setup_irq(struct qdio_initialize *init_data);
void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
				struct ccw_device *cdev);
void qdio_release_memory(struct qdio_irq *irq_ptr);
int qdio_setup_create_sysfs(struct ccw_device *cdev);
void qdio_setup_destroy_sysfs(struct ccw_device *cdev);
int qdio_setup_init(void);
void qdio_setup_exit(void);

int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
			unsigned char *state);
#endif /* _CIO_QDIO_H */


text:
package com.foc.gui.dateChooser;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;

import java.text.DateFormatSymbols;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * JCalendar is a bean for choosing a day.
 *
 * @author Kai Toedter
 * @version 1.2.1
 */
@SuppressWarnings("serial")
public class JDayChooser extends JPanel implements ActionListener, KeyListener,
    FocusListener {
    protected JButton[] days;
    protected JButton[] weeks;
    protected JButton selectedDay;
    protected JPanel weekPanel;
    protected JPanel dayPanel;
    protected int day;
    protected Color oldDayBackgroundColor;
    protected Color selectedColor;
    protected Color sundayForeground;
    protected Color weekdayForeground;
    protected Color decorationBackgroundColor;
    protected String[] dayNames;
    protected Calendar calendar;
    protected Calendar today;
    protected Locale locale;
    protected boolean initialized;
    protected boolean weekOfYearVisible;
    protected boolean decorationBackgroundVisible = true;
    protected boolean decorationBordersVisible;
    private boolean alwaysFireDayProperty;

    /**
     * Default JDayChooser constructor.
     */
    public JDayChooser() {
        this(false);
    }

    /**
     * JDayChooser constructor.
     *
     * @param weekOfYearVisible true, if the weeks of a year shall be shown
     */
    public JDayChooser(boolean weekOfYearVisible) {
        setBackground(Color.blue);
        this.weekOfYearVisible = weekOfYearVisible;
        locale = Locale.getDefault();
        days = new JButton[49];
        selectedDay = null;
        calendar = Calendar.getInstance(locale);
        today = (Calendar) calendar.clone();

        setLayout(new BorderLayout());

        dayPanel = new JPanel();
        dayPanel.setLayout(new GridLayout(7, 7));

        sundayForeground = new Color(164, 0, 0);
        weekdayForeground = new Color(0, 90, 164);

        // decorationBackgroundColor = new Color(194, 211, 252);
        // decorationBackgroundColor = new Color(206, 219, 246);
        decorationBackgroundColor = new Color(210, 228, 238);

        for (int y = 0; y < 7; y++) {
            for (int x = 0; x < 7; x++) {
                int index = x + (7 * y);

                if (y == 0) {
                    // Create a button that doesn't react on clicks or focus
                    // changes.
                    // Thanks to Thomas Schaefer for the focus hint :)
                    days[index] = new JButton() {
                                public void addMouseListener(MouseListener l) {
                                }

                                public boolean isFocusable() {
                                    return false;
                                }
                            };

                    days[index].setContentAreaFilled(decorationBackgroundVisible);
                    days[index].setBorderPainted(decorationBordersVisible);
                    days[index].setBackground(decorationBackgroundColor);
                } else {
                    days[index] = new JButton("x");
                    days[index].addActionListener(this);
                    days[index].addKeyListener(this);
                    days[index].addFocusListener(this);
                }

                days[index].setMargin(new Insets(0, 0, 0, 0));
                days[index].setFocusPainted(false);
                dayPanel.add(days[index]);
            }
        }

        weekPanel = new JPanel();
        weekPanel.setLayout(new GridLayout(7, 1));
        weeks = new JButton[7];

        for (int i = 0; i < 7; i++) {
            weeks[i] = new JButton() {
                        public void addMouseListener(MouseListener l) {
                        }

                        public boolean isFocusable() {
                            return false;
                        }
                    };
            weeks[i].setMargin(new Insets(0, 0, 0, 0));
            weeks[i].setFocusPainted(false);
            weeks[i].setBackground(decorationBackgroundColor);
            weeks[i].setForeground(new Color(100, 100, 100));

            weeks[i].setContentAreaFilled(decorationBackgroundVisible);
            weeks[i].setBorderPainted(decorationBordersVisible);

            if (i != 0) {
                weeks[i].setText("0" + (i + 1));
            }

            weekPanel.add(weeks[i]);
        }

        init();
        drawWeeks();

        setDay(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
        add(dayPanel, BorderLayout.CENTER);

        if (weekOfYearVisible) {
            add(weekPanel, BorderLayout.WEST);
        }

        initialized = true;
    }

    /**
     * Initilizes the locale specific names for the days of the week.
     */
    protected void init() {
        JButton testButton = new JButton();
        oldDayBackgroundColor = testButton.getBackground();
        selectedColor = new Color(160, 160, 160);

        Date date = calendar.getTime();
        calendar = Calendar.getInstance(locale);
        calendar.setTime(date);

        drawDayNames();
        drawDays();
    }

    /**
     * Draws the day names of the day columnes.
     */
    private void drawDayNames() {
        int firstDayOfWeek = calendar.getFirstDayOfWeek();
        DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale);
        dayNames = dateFormatSymbols.getShortWeekdays();

        int day = firstDayOfWeek;

        for (int i = 0; i < 7; i++) {
            days[i].setText(dayNames[day]);

            if (day == 1) {
                days[i].setForeground(sundayForeground);
            } else {
                days[i].setForeground(weekdayForeground);
            }

            if (day < 7) {
                day++;
            } else {
                day -= 6;
            }
        }
    }

    /**
     * Initializes both day names and weeks of the year.
     */
    protected void initDecorations() {
        for (int x = 0; x < 7; x++) {
            days[x].setContentAreaFilled(decorationBackgroundVisible);
            days[x].setBorderPainted(decorationBordersVisible);
            weeks[x].setContentAreaFilled(decorationBackgroundVisible);
            weeks[x].setBorderPainted(decorationBordersVisible);
        }
    }

    /**
     * Hides and shows the week buttons.
     */
    protected void drawWeeks() {
        Calendar tmpCalendar = (Calendar) calendar.clone();

        for (int i = 1; i < 7; i++) {
            tmpCalendar.set(Calendar.DAY_OF_MONTH, (i * 7) - 6);

            int week = tmpCalendar.get(Calendar.WEEK_OF_YEAR);
            String buttonText = Integer.toString(week);

            if (week < 10) {
                buttonText = "0" + buttonText;
            }

            weeks[i].setText(buttonText);

            if ((i == 5) || (i == 6)) {
                weeks[i].setVisible(days[i * 7].isVisible());
            }
        }
    }

    /**
     * Hides and shows the day buttons.
     */
    protected void drawDays() {
        Calendar tmpCalendar = (Calendar) calendar.clone();
        int firstDayOfWeek = tmpCalendar.getFirstDayOfWeek();
        tmpCalendar.set(Calendar.DAY_OF_MONTH, 1);

        int firstDay = tmpCalendar.get(Calendar.DAY_OF_WEEK) - firstDayOfWeek;

        if (firstDay < 0) {
            firstDay += 7;
        }

        int i;

        for (i = 0; i < firstDay; i++) {
            days[i + 7].setVisible(false);
            days[i + 7].setText("");
        }

        tmpCalendar.add(Calendar.MONTH, 1);

        Date firstDayInNextMonth = tmpCalendar.getTime();
        tmpCalendar.add(Calendar.MONTH, -1);

        Date day = tmpCalendar.getTime();
        int n = 0;
        Color foregroundColor = getForeground();

        while (day.before(firstDayInNextMonth)) {
            days[i + n + 7].setText(Integer.toString(n + 1));
            days[i + n + 7].setVisible(true);

            if ((tmpCalendar.get(Calendar.DAY_OF_YEAR) == today.get(
                        Calendar.DAY_OF_YEAR)) &&
                    (tmpCalendar.get(Calendar.YEAR) == today.get(Calendar.YEAR))) {
                days[i + n + 7].setForeground(sundayForeground);
            } else {
                days[i + n + 7].setForeground(foregroundColor);
            }

            if ((n + 1) == this.day) {
                days[i + n + 7].setBackground(selectedColor);
                selectedDay = days[i + n + 7];
            } else {
                days[i + n + 7].setBackground(oldDayBackgroundColor);
            }

            n++;
            tmpCalendar.add(Calendar.DATE, 1);
            day = tmpCalendar.getTime();
        }

        for (int k = n + i + 7; k < 49; k++) {
            days[k].setVisible(false);
            days[k].setText("");
        }
    }

    /**
     * Returns the locale.
     *
     * @return the locale value
     *
     * @see #setLocale
     */
    public Locale getLocale() {
        return locale;
    }

    /**
     * Sets the locale.
     *
     * @param locale the new locale value
     *
     * @see #getLocale
     */
    public void setLocale(Locale locale) {
        if (!initialized) {
            super.setLocale(locale);
        } else {
            this.locale = locale;
            super.setLocale(locale);
            init();
        }
    }

    /**
     * Sets the day. This is a bound property.
     *
     * @param d the day
     *
     * @see #getDay
     */
    public void setDay(int d) {
        if (d < 1) {
            d = 1;
        }

        Calendar tmpCalendar = (Calendar) calendar.clone();
        tmpCalendar.set(Calendar.DAY_OF_MONTH, 1);
        tmpCalendar.add(Calendar.MONTH, 1);
        tmpCalendar.add(Calendar.DATE, -1);

        int maxDaysInMonth = tmpCalendar.get(Calendar.DATE);

        if (d > maxDaysInMonth) {
            d = maxDaysInMonth;
        }

        int oldDay = day;
        day = d;

        if (selectedDay != null) {
            selectedDay.setBackground(oldDayBackgroundColor);
            selectedDay.repaint();
        }

        for (int i = 7; i < 49; i++) {
            if (days[i].getText().equals(Integer.toString(day))) {
                selectedDay = days[i];
                selectedDay.setBackground(selectedColor);

                break;
            }
        }

        if (alwaysFireDayProperty) {
            firePropertyChange("day", 0, day);
        } else {
            firePropertyChange("day", oldDay, day);
        }
    }

    /**
     * this is needed for JDateChooser.
     *
     * @param alwaysFire true, if day property shall be fired every time a day is chosen.
     */
    public void setAlwaysFireDayProperty(boolean alwaysFire) {
        alwaysFireDayProperty = alwaysFire;
    }

    /**
     * Returns the selected day.
     *
     * @return the day value
     *
     * @see #setDay
     */
    public int getDay() {
        return day;
    }

    /**
     * Sets a specific month. This is needed for correct graphical
     * representation of the days.
     *
     * @param month the new month
     */
    public void setMonth(int month) {
        calendar.set(Calendar.MONTH, month);

        // Since the day does not change,
        // don't fire a day property change, even if  alwaysFireDayProperty is true :)
        boolean storedMode = alwaysFireDayProperty;
        alwaysFireDayProperty = false;
        setDay(day);
        alwaysFireDayProperty = storedMode;

        drawDays();
        drawWeeks();
    }

    /**
     * Sets a specific year. This is needed for correct graphical
     * representation of the days.
     *
     * @param year the new year
     */
    public void setYear(int year) {
        calendar.set(Calendar.YEAR, year);
        drawDays();
        drawWeeks();
    }

    /**
     * Sets a specific calendar. This is needed for correct graphical
     * representation of the days.
     *
     * @param calendar the new calendar
     */
    public void setCalendar(Calendar calendar) {
        this.calendar = calendar;
        drawDays();
    }

    /**
     * Sets the font property.
     *
     * @param font the new font
     */
    public void setFont(Font font) {
        if (days != null) {
            for (int i = 0; i < 49; i++) {
                days[i].setFont(font);
            }
        }
    }

    /**
     * Sets the foregroundColor color.
     *
     * @param foreground the new foregroundColor
     */
    public void setForeground(Color foreground) {
        super.setForeground(foreground);

        if (days != null) {
            for (int i = 7; i < 49; i++) {
                days[i].setForeground(foreground);
            }

            drawDays();
        }
    }

    /**
     * Returns "JDayChooser".
     *
     * @return the name value
     */
    public String getName() {
        return "JDayChooser";
    }

    /**
     * JDayChooser is the ActionListener for all day buttons.
     *
     * @param e the ActionEvent
     */
    public void actionPerformed(ActionEvent e) {
        JButton button = (JButton) e.getSource();
        String buttonText = button.getText();
        int day = new Integer(buttonText).intValue();
        setDay(day);
    }

    /**
     * JDayChooser is the FocusListener for all day buttons. (Added by Thomas
     * Schaefer)
     *
     * @param e the FocusEvent
     */
	/*
	 * Code below commented out by Mark Brown on 24 Aug 2004.  This code breaks
	 * the JDateChooser code by triggering the actionPerformed method on the next
	 * day button.  This causes the date chosen to always be incremented by one day.
	 */
    public void focusGained(FocusEvent e) {
//        JButton button = (JButton) e.getSource();
//        String buttonText = button.getText();
//
//        if ((buttonText != null) && !buttonText.equals("") && !e.isTemporary()) {
//            actionPerformed(new ActionEvent(e.getSource(), 0, null));
//        }
    }

    /**
     * Does nothing.
     *
     * @param e the FocusEvent
     */
    public void focusLost(FocusEvent e) {
    }

    /**
     * JDayChooser is the KeyListener for all day buttons. (Added by Thomas
     * Schaefer and modified by Austin Moore)
     *
     * @param e the KeyEvent
     */
    public void keyPressed(KeyEvent e) {
        int offset = (e.getKeyCode() == KeyEvent.VK_UP) ? (-7)
                                                        : ((e.getKeyCode() == KeyEvent.VK_DOWN)
            ? (+7)
            : ((e.getKeyCode() == KeyEvent.VK_LEFT) ? (-1)
                                                    : ((e.getKeyCode() == KeyEvent.VK_RIGHT)
            ? (+1) : 0)));

        int newDay = getDay() + offset;

        if ((newDay >= 1) &&
                (newDay <= calendar.getMaximum(Calendar.DAY_OF_MONTH))) {
            setDay(newDay);
        }
    }

    /**
     * Does nothing.
     *
     * @param e the KeyEvent
     */
    public void keyTyped(KeyEvent e) {
    }

    /**
     * Does nothing.
     *
     * @param e the KeyEvent
     */
    public void keyReleased(KeyEvent e) {
    }

    /**
     * Enable or disable the JDayChooser.
     *
     * @param enabled The new enabled value
     */
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);

        for (short i = 0; i < days.length; i++) {
            if (days[i] != null) {
                days[i].setEnabled(enabled);
            }
        }

        for (short i = 0; i < weeks.length; i++) {
            if (weeks[i] != null) {
                weeks[i].setEnabled(enabled);
            }
        }
    }

    /**
     * In some Countries it is often usefull to know in which week of the year
     * a date is.
     *
     * @return boolean true, if the weeks of the year is shown
     */
    public boolean isWeekOfYearVisible() {
        return weekOfYearVisible;
    }

    /**
     * In some Countries it is often usefull to know in which week of the year
     * a date is.
     *
     * @param weekOfYearVisible true, if the weeks of the year shall be shown
     */
    public void setWeekOfYearVisible(boolean weekOfYearVisible) {
        if (weekOfYearVisible == this.weekOfYearVisible) {
            return;
        } else if (weekOfYearVisible) {
            add(weekPanel, BorderLayout.WEST);
        } else {
            remove(weekPanel);
        }

        this.weekOfYearVisible = weekOfYearVisible;
        validate();
        dayPanel.validate();
    }

    /**
     * Returns the day panel.
     *
     * @return the day panel
     */
    public JPanel getDayPanel() {
        return dayPanel;
    }

    /**
     * Returns the color of the decoration (day names and weeks).
     *
     * @return the color of the decoration (day names and weeks).
     */
    public Color getDecorationBackgroundColor() {
        return decorationBackgroundColor;
    }

    /**
     * Sets the background of days and weeks of year buttons.
     *
     * @param decorationBackgroundColor The background to set
     */
    public void setDecorationBackgroundColor(Color decorationBackgroundColor) {
        this.decorationBackgroundColor = decorationBackgroundColor;

        if (days != null) {
            for (int i = 0; i < 7; i++) {
                days[i].setBackground(decorationBackgroundColor);
            }
        }

        if (weeks != null) {
            for (int i = 0; i < 7; i++) {
                weeks[i].setBackground(decorationBackgroundColor);
            }
        }
    }

    /**
     * Returns the Sunday foreground.
     *
     * @return Color the Sunday foreground.
     */
    public Color getSundayForeground() {
        return sundayForeground;
    }

    /**
     * Returns the weekday foreground.
     *
     * @return Color the weekday foreground.
     */
    public Color getWeekdayForeground() {
        return weekdayForeground;
    }

    /**
     * Sets the Sunday foreground.
     *
     * @param sundayForeground The sundayForeground to set
     */
    public void setSundayForeground(Color sundayForeground) {
        this.sundayForeground = sundayForeground;
        drawDayNames();
        drawDays();
    }

    /**
     * Sets the weekday foreground.
     *
     * @param weekdayForeground The weekdayForeground to set
     */
    public void setWeekdayForeground(Color weekdayForeground) {
        this.weekdayForeground = weekdayForeground;
        drawDayNames();
        drawDays();
    }

    /**
     * Requests that the selected day also have the focus.
     */
    public void setFocus() {
        if (selectedDay != null) {
            this.selectedDay.requestFocus();
        }
    }

    /**
     * The decoration background is the background color of the day titles and
     * the weeks of the year.
     *
     * @return Returns true, if the decoration background is painted.
     */
    public boolean isDecorationBackgroundVisible() {
        return decorationBackgroundVisible;
    }

    /**
     * The decoration background is the background color of the day titles and
     * the weeks of the year.
     *
     * @param decorationBackgroundVisible true, if the decoration background
     *        shall be painted.
     */
    public void setDecorationBackgroundVisible(
        boolean decorationBackgroundVisible) {
        this.decorationBackgroundVisible = decorationBackgroundVisible;
        initDecorations();
    }

    /**
     * The decoration border is the button border of the day titles and the
     * weeks of the year.
     *
     * @return Returns true, if the decoration border is painted.
     */
    public boolean isDecorationBordersVisible() {
        return decorationBordersVisible;
    }

    /**
     * The decoration border is the button border of the day titles and the
     * weeks of the year.
     *
     * @param decorationBordersVisible true, if the decoration border shall be
     *        painted.
     */
    public void setDecorationBordersVisible(boolean decorationBordersVisible) {
        this.decorationBordersVisible = decorationBordersVisible;
        initDecorations();
    }

    /**
     * Creates a JFrame with a JDayChooser inside and can be used for testing.
     *
     * @param s The command line arguments
     */
    public static void main(String[] s) {
        JFrame frame = new JFrame("JDayChooser");
        frame.getContentPane().add(new JDayChooser());
        frame.pack();
        frame.setVisible(true);
    }
}


text: require 'opentelemetry/exporter/otlp/grpc'


text:
package fr.adrienbrault.idea.symfony2plugin.assistant;

import com.intellij.psi.PsiReference;
import com.jetbrains.php.lang.psi.elements.MethodReference;
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
import fr.adrienbrault.idea.symfony2plugin.assistant.reference.MethodParameterSetting;

import java.util.List;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public interface AssistantReferenceProvider {
    PsiReference getPsiReference(AssistantReferenceProviderParameter parameter);
    String getAlias();
    String getDocBlockParamAlias();

    class AssistantReferenceProviderParameter {

        private StringLiteralExpression psiElement;
        private MethodParameterSetting methodParameterSetting;
        private List<MethodParameterSetting> configsMethodScope;
        private MethodReference methodReference;

        public AssistantReferenceProviderParameter(StringLiteralExpression psiElement, MethodParameterSetting methodParameterSetting, List<MethodParameterSetting> configsMethodScope, MethodReference methodReference) {
            this.psiElement = psiElement;
            this.methodParameterSetting = methodParameterSetting;
            this.configsMethodScope = configsMethodScope;
            this.methodReference = methodReference;
        }

        public List<MethodParameterSetting> getConfigsMethodScope() {
            return configsMethodScope;
        }

        public StringLiteralExpression getPsiElement() {
            return psiElement;
        }

        public MethodParameterSetting getMethodParameterSetting() {
            return methodParameterSetting;
        }

        public MethodReference getMethodReference() {
            return methodReference;
        }

    }
}


text:
import { get, set } from '../../../utils/functional/get_set.js'

// Applies `args.select`.
// Only output the fields that were picked by the client.
export const applySelect = function ({ response, results }) {
  // Need to recurse through children first
  const responseA = results.reduceRight(selectFieldsByResult, response)
  return { response: responseA }
}

const selectFieldsByResult = function (
  response,
  {
    path,
    action: {
      args: { select },
    },
  },
) {
  const model = get(response, path)

  const modelA = selectFieldsByModel({ model, select })

  const responseA = set(response, path, modelA)
  return responseA
}

const selectFieldsByModel = function ({ model, select }) {
  if (select === undefined) {
    return model
  }

  // Using 'all' means all fields are returned
  const hasAllAttr = select.includes('all')

  if (hasAllAttr) {
    return model
  }

  const modelA = select.map((key) => pickAttr({ model, key }))
  const modelB = Object.assign({}, ...modelA)

  return modelB
}

const pickAttr = function ({ model, key }) {
  // When explicitely selected, transform `undefined` to `null`
  // eslint-disable-next-line unicorn/no-null
  const value = model[key] === undefined ? null : model[key]
  return { [key]: value }
}


text:
#ifndef __COMMON_H__
#define __COMMON_H__

#define PACKET_SIZE_START	(40)
#define DATA_SIZE		(100)
#define SENDING_TIME_MS		(1000)

struct data_packet {
	unsigned long cnt;
	unsigned long size;
	unsigned char data[DATA_SIZE];
};

#endif /* __COMMON_H__ */