text:
namespace Fuddi.Models
{
    using System;
    using System.Collections.Generic;

    public partial class OD_Product
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int CategoryID { get; set; }
        public string Preview { get; set; }
        public string SimpleDesc { get; set; }
        public string DetailDesc { get; set; }
        public int TotalSell { get; set; }
        public bool DelFlag { get; set; }
        public System.DateTime CreateTime { get; set; }
    }
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18bab811a">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States Court of Appeals for the Eleventh Circuit</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2015-03-11</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2015-01-05</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca11-14-13098</identifier>
<identifier type="local">P0b002ee18bab811a</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2015-03-11</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2015-03-11</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ca11-14-13098</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ca11-14-13098</accessId>
 <courtType>Appellate</courtType>
 <courtCode>ca11</courtCode>
 <courtCircuit>11th</courtCircuit>
 <courtSortOrder>1110</courtSortOrder>
 <caseNumber>14-13098</caseNumber>
 <natureSuitCode>440</natureSuitCode>
 <natureSuit>Other Civil Rights</natureSuit>
 <party firstName="Earlean" fullName="Earlean Bozeman" lastName="Bozeman" role="Appellant"></party>
 <party firstName="Stuart" fullName="Stuart Johnson" lastName="Johnson" role="Appellee"></party>
 <party firstName="Daniel" fullName="Daniel Poole" lastName="Poole" role="Appellee"></party>
 <party firstName="David" fullName="David Poole" lastName="Poole" role="Appellee"></party>
 <party firstName="Ina" fullName="Ina Poole" lastName="Poole" role="Appellee"></party>
</extension>
<titleInfo>
 <title>Earlean Bozeman v. David Poole, et al</title>
 <partNumber>14-13098</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca11-14-13098/content-detail.html</url>
</location>
<classification authority="sudocs">JU 2.11</classification>
<identifier type="preferred citation">14-13098;14-13098</identifier>
<name type="corporate">
 <namePart>United States Court of Appeals for the Eleventh Circuit</namePart>
 <namePart>11th Circuit</namePart>
 <namePart></namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Earlean Bozeman</displayForm>
 <namePart type="family">Bozeman</namePart>
 <namePart type="given">Earlean</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellant</description>
</name>
<name type="personal">
 <displayForm>Stuart Johnson</displayForm>
 <namePart type="family">Johnson</namePart>
 <namePart type="given">Stuart</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Daniel Poole</displayForm>
 <namePart type="family">Poole</namePart>
 <namePart type="given">Daniel</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>David Poole</displayForm>
 <namePart type="family">Poole</namePart>
 <namePart type="given">David</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<name type="personal">
 <displayForm>Ina Poole</displayForm>
 <namePart type="family">Poole</namePart>
 <namePart type="given">Ina</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Appellee</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ca11-14-13098</accessId>
 <courtType>Appellate</courtType>
 <courtCode>ca11</courtCode>
 <courtCircuit>11th</courtCircuit>
 <courtSortOrder>1110</courtSortOrder>
 <caseNumber>14-13098</caseNumber>
 <natureSuitCode>440</natureSuitCode>
 <natureSuit>Other Civil Rights</natureSuit>
 <party firstName="Earlean" fullName="Earlean Bozeman" lastName="Bozeman" role="Appellant"></party>
 <party firstName="Stuart" fullName="Stuart Johnson" lastName="Johnson" role="Appellee"></party>
 <party firstName="Daniel" fullName="Daniel Poole" lastName="Poole" role="Appellee"></party>
 <party firstName="David" fullName="David Poole" lastName="Poole" role="Appellee"></party>
 <party firstName="Ina" fullName="Ina Poole" lastName="Poole" role="Appellee"></party>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ca11-14-13098-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ca11-14-13098/USCOURTS-ca11-14-13098-0/mods.xml">
 <titleInfo>
  <title>Earlean Bozeman v. David Poole, et al</title>
  <subTitle>Opinion issued by court as to Appellant Earlean Bozeman. Decision: Affirmed. Opinion type: Non-Published. Opinion method: Per Curiam.</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-01-05</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-ca11-14-13098/pdf/USCOURTS-ca11-14-13098-0.pdf">
  <identifier type="FDsys Unique ID">D09002ee18bae5e69</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ca11-14-13098/USCOURTS-ca11-14-13098-0</identifier>
 <identifier type="former granule identifier">ca11-14-13098_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ca11-14-13098/USCOURTS-ca11-14-13098-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca11-14-13098/pdf/USCOURTS-ca11-14-13098-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 14-13098; Earlean Bozeman v. David Poole, et al; </searchTitle>
  <courtName>United States Court of Appeals for the Eleventh Circuit</courtName>
  <accessId>USCOURTS-ca11-14-13098-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2015-01-05</dateIssued>
  <docketText>Opinion issued by court as to Appellant Earlean Bozeman. Decision: Affirmed. Opinion type: Non-Published. Opinion method: Per Curiam.</docketText>
</extension>
</relatedItem>
</mods>

redpajama_set_name: RedPajamaGithub


text:
"""
All layers just related to metric.
"""

import warnings
from ..layer_helper import LayerHelper
from ..initializer import Normal, Constant
from ..framework import Variable
from ..param_attr import ParamAttr

__all__ = ['accuracy', 'auc']

def accuracy(input, label, k=1, correct=None, total=None):
    """
    This function computes the accuracy using the input and label.
    The output is the top_k inputs and their indices.
    """
    helper = LayerHelper("accuracy", **locals())
    topk_out = helper.create_tmp_variable(dtype=input.dtype)
    topk_indices = helper.create_tmp_variable(dtype="int64")
    helper.append_op(
        type="top_k",
        inputs={"X": [input]},
        outputs={"Out": [topk_out],
                 "Indices": [topk_indices]},
        attrs={"k": k})
    acc_out = helper.create_tmp_variable(dtype="float32")
    if correct is None:
        correct = helper.create_tmp_variable(dtype="int64")
    if total is None:
        total = helper.create_tmp_variable(dtype="int64")
    helper.append_op(
        type="accuracy",
        inputs={
            "Out": [topk_out],
            "Indices": [topk_indices],
            "Label": [label]
        },
        outputs={
            "Accuracy": [acc_out],
            "Correct": [correct],
            "Total": [total],
        })
    return acc_out

def auc(input, label, curve='ROC', num_thresholds=200):
    warnings.warn(
        "This interface not recommended, fluid.layers.auc compute the auc at every minibatch, \
        but can not aggregate them and get the pass AUC, because pass \
        auc can not be averaged with weighted from the minibatch auc value. \
        Please use fluid.metrics.Auc, it can compute the auc value via Python natively, \
        which can get every minibatch and every pass auc value.", Warning)
    helper = LayerHelper("auc", **locals())
    topk_out = helper.create_tmp_variable(dtype=input.dtype)
    topk_indices = helper.create_tmp_variable(dtype="int64")
    helper.append_op(
        type="top_k",
        inputs={"X": [input]},
        outputs={"Out": [topk_out],
                 "Indices": [topk_indices]},
        attrs={"k": k})
    auc_out = helper.create_tmp_variable(dtype="float32")
    if correct is None:
        correct = helper.create_tmp_variable(dtype="int64")
    if total is None:
        total = helper.create_tmp_variable(dtype="int64")
    helper.append_op(
        type="accuracy",
        inputs={
            "Out": [topk_out],
            "Indices": [topk_indices],
            "Label": [label]
        },
        attrs={"curve": curve,
               "num_thresholds": num_thresholds},
        outputs={"AUC": [auc_out], })
    return auc_out


text:
import B
main = interact (printWavefront.read)


text:
class FlowGame : public cocos2d::CCNode, public cocos2d::CCTouchDelegate
{
public:

    class Delegate
    {
    public:
        Delegate(){}
        virtual void onWin()
        {}

        virtual ~Delegate()
        {}
    };
    typedef std::auto_ptr<Delegate> DelegatePtr;

    FlowGame(const FlowTable& table, DelegatePtr delegate);
    static FlowGame* create(const FlowTable& table, DelegatePtr delegate);
private:
    FlowRenderer* _renderer;
    const FlowTable* _table;

    bool ccTouchBegan(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
    void ccTouchMoved(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
    void ccTouchEnded(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
    void ccTouchCancelled(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);

    bool touchStart(const FlowPoint&);
    void touchMoved(const FlowPoint&);
    void touchEnded(const FlowPoint&);

    void cutTheTrace(const FlowPoint& start, const FlowColor color,
                     const bool remove_highlight);
    FlowColor getPointColor(const FlowPoint& p);
    void connectPoints(FlowPointState& a, FlowPointState& b);
    void disconnectPoints(FlowPointState& a, FlowPointState& b);
    void updateHighlighted();
    void removeHighlight(FlowPointState &st);
    void restoreTraces();
    bool checkWinCondition();
    void updateActiveCircle(cocos2d::CCPoint p);

    FlowPoint touchToCellCordinates(cocos2d::CCPoint p);
    cocos2d::CCPoint touchToLocalCords(cocos2d::CCTouch* touch);

    typedef std::vector<FlowPoint> Trace;
    typedef std::vector<Trace> Traces;

    bool _is_touch_active;
    bool _finish_lock;
    int _active_touch_id;
    Traces _active_traces;
    Traces _submitted_traces;

    FlowPoint _last_point;
    FlowColor _working_color;
    DelegatePtr _delegate;

    void traceDebug() const;
    void traceDebug(std::ostream& os, const Traces& tr) const;
};

#endif // FLOWGAME_H


text: export { switchMapTo } from 'rxjs/operators';


text:
Publishing and subscribing to data from the cloud requires that you:

1) Create a cloud account

2) Publish data

3) View the published data

4) Subscribe to the data

5) Troubleshoot (if necessary)

 Create a cloud account

Go to Intel's enableiot cloud site [https://dashboard.us.enableiot.com] and follow instructions to create an account.
Once an account is created, an activation key will be available in the account details section. Record this
activation key; note that it will *expire* in less than *one hour*. If your activation key has expired,
you can always create a new one by clicking on the adjacent 'refresh' button.

 Publish data

Create a service specification for your sensor (garage-sensor-spec.json):

    {
        "name" : "temperature.v1.0/garage_sensor",
        "type" : {
            "name": "enableiot"
        },
        "port": 34562,
        "type_params": {"deviceid":"EdisonInGarage", "activationCode":"<<YOUR DEVICE ACTIVATION CODE>>"}
    }

Write the code to publish data:

    #include <stdio.h>
    #include <stdbool.h>
    #include <sys/types.h>
    #include "iotkit-comm/iotkit-comm.h"
    #include "iotkit-comm/util.h"

    ServiceSpec *srvSpec = NULL;
    int msgnumber = 13; // sensor value

    void callback(void *handle, int32_t error_code, void *serviceHandle) {
        Context context;
        char msg[256];
        int i = 0;
        CommHandle *commHandle = NULL;

        if(serviceHandle != NULL) {
            commHandle = (CommHandle *) serviceHandle;

            int (**publish) (char *message,Context context);

            publish = commInterfacesLookup(commHandle, "publish");
            if(publish == NULL) {
                fprintf(stderr, "Function \'publish\' is not available; please verify the Plugin documentation !!\n");
                return;
            }

            context.name = "topic";
            context.value = "data";

            while(i < 10) {  // Event Loop
                sprintf(msg, "{\"name\": \"garage_sensor\", \"value\": %d}", msgnumber++);
                printf("Publishing msg:%s\n", msg);

                (*publish)(msg, context);
                sleep(2);

                i ++;
            }
        }

        // clean the objects
        cleanUpService(&srvSpec, &commHandle);
        exit(0);
    }

    int main(void) {
        puts("Sample program to publish data to IoT Cloud !!");

        srvSpec = (ServiceSpec *) parseServiceSpec("./serviceSpecs/temperatureServiceEnableIot.json");

        if (srvSpec){
            advertiseServiceBlocking(srvSpec, callback);
        }

        return 0;
    }

It is important to know that data can only be published using sensors. The cloud supports two types of sensors by
default: temperature (temperature.v1.0) and humidity (humidity.v1.0). You may create other types by going to the
account details page; then, clicking on the 'Catalog' tab; and then finally, clicking on the 'Add a New
Catalog Item' button. These need to be specified as the second-last path element in the 'name' field of
the specification. The last path element is the friendly name of the sensor, e.g. 'garage_sensor'.
As soon as the service is started, the sensor 'garage_sensor' is registered with the cloud and data
can be published as necessary.

 View the published data

Go to Intel's enableiot cloud site [https://dashboard.us.enableiot.com], login, click on the "Menu" button,
and click "Charts". Then, select your device and sensor-type to see a graph of your published data vs.
time.

 Subscribe to data

To receive data published by the sample 'garage_sensor' service running on 'EdisonInGarage', create a
service query ('garage-sensor-query.json'):

    {
        "name" : "temperature.v1.0/garage_sensor",
        "type" : {
            "name": "enableiot"
        },
        "type_params": {"deviceid": "EdisonInGarage", "activationCode":"<<YOUR DEVICE ACTIVATION CODE>>", "subscribeto": "EdisonInGarage", "frequencyInterval": 5}
    }

Then, write the code to subscribe to the data:

    #include <stdio.h>
    #include <stdbool.h>
    #include <sys/types.h>
    #include "iotkit-comm/iotkit-comm.h"
    #include "iotkit-comm/util.h"

    ServiceQuery *query = NULL;
    CommHandle *commHandle = NULL;
    int i = 0;

    void message_callback(char *message, Context context) {
        printf("Message received:%s\n", message);

        i ++;

        if(i >= 3) {
            // clean the objects
            cleanUpService(&query, &commHandle);
            exit(0);
        }
    }

    int serviceStarted = 0;

    void callback(void *handle, int32_t error_code, void *serviceHandle) {
        if(serviceHandle != NULL && !serviceStarted) {
            commHandle = (CommHandle *) serviceHandle;
            char *response = NULL;
            int (**receive)(void (*)(char *, Context)) = NULL;

            receive = commInterfacesLookup(commHandle, "receive");
            if(receive == NULL) {
                printf("Function \'receive\' is not available; please verify the Plugin documentation !!\n");
                return;
            }

            (*receive)(message_callback);

            while(1) { // Infinite Event Loop
                sleep(1);
            }
        }
    }

    bool serviceFilter(ServiceQuery *srvQuery) {
        printf("Got into Service Filter\n");
        return true;
    }

    int main(void) {

        puts("Sample program to test the IoT Cloud subscribe plugin !!");
        query = (ServiceQuery *) parseServiceQuery("./serviceQueries/temperatureServiceQueryEnableIot.json");

        if (query) {
            createClientForGivenService(query, callback);
        }

        return 0;
    }

 Troubleshooting

Some of the most common issues stem from not being connected to the network. We suggest running the following
command on your Edison to ensure that you are connected to the cloud:

    curl www.intel.com/edison

If this command hangs or fails with an error, it means the Edison is not connected to the Internet.

NOTE: please ensure that the activation key has not expired; you can always create a new one as described in the
'Create a cloud account' section above.


text:
//
// Copyright 2021 Google LLC
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.
//

using Google.Apis.Util;
using Google.Solutions.Common.Diagnostics;
using Google.Solutions.Common.Locator;
using Google.Solutions.Common.Threading;
using Google.Solutions.Common.Util;
using Google.Solutions.IapDesktop.Application.Data;
using Google.Solutions.IapDesktop.Application.ObjectModel;
using Google.Solutions.IapDesktop.Application.Services.Adapters;
using Google.Solutions.IapDesktop.Application.Services.Integration;
using Google.Solutions.IapDesktop.Application.Services.Settings;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace Google.Solutions.IapDesktop.Application.Services.ProjectModel
{
    /// <summary>
    /// Represents the in-memory model (or workspace) of projects and
    /// instances. Data is cached, but read-only.
    /// </summary>
    public interface IProjectModelService : IDisposable
    {
        /// <summary>
        /// Add a project so that it will be considered when
        /// the model is next (force-) reloaded.
        /// </summary>
        Task AddProjectAsync(ProjectLocator project);

        /// <summary>
        /// Remove project so that it will not be considered when
        /// the model is next (force-) reloaded.
        /// </summary>
        Task RemoveProjectAsync(ProjectLocator project);

        /// <summary>
        /// Load projects without loading zones and instances.
        /// Uses cached data if available.
        /// </summary>
        Task<IProjectModelCloudNode> GetRootNodeAsync(
            bool forceReload,
            CancellationToken token);

        /// <summary>
        /// Load zones and instances. Uses cached data if available.
        /// </summary>
        Task<IReadOnlyCollection<IProjectModelZoneNode>> GetZoneNodesAsync(
            ProjectLocator project,
            bool forceReload,
            CancellationToken token);

        /// <summary>
        /// Load any node. Uses cached data if available.
        /// </summary>
        Task<IProjectModelNode> GetNodeAsync(
            ResourceLocator locator,
            CancellationToken token);

        /// <summary>
        /// Gets the active/selected node. The selection
        /// is kept across reloads.
        /// </summary>
        Task<IProjectModelNode> GetActiveNodeAsync(CancellationToken token);

        /// <summary>
        /// Gets the active/selected node. The selection
        /// is kept across reloads.
        /// </summary>
        Task SetActiveNodeAsync(
            IProjectModelNode node,
            CancellationToken token);

        /// <summary>
        /// Gets the active/selected node. The selection
        /// is kept across reloads.
        /// </summary>
        Task SetActiveNodeAsync(
            ResourceLocator locator,
            CancellationToken token);
    }

    public class ProjectModelService : IProjectModelService
    {
        private readonly Service<IComputeEngineAdapter> computeEngineAdapter;
        private readonly Service<IResourceManagerAdapter> resourceManagerAdapter;
        private readonly IProjectRepository projectRepository;
        private readonly IEventService eventService;

        private ResourceLocator activeNode;

        private readonly AsyncLock cacheLock = new AsyncLock();
        private CloudNode cachedRoot = null;
        private readonly IDictionary<ProjectLocator, IReadOnlyCollection<IProjectModelZoneNode>> cachedZones =
            new Dictionary<ProjectLocator, IReadOnlyCollection<IProjectModelZoneNode>>();

        // For testing only.
        internal int CachedProjectsCount => this.cachedZones.Count;

        //---------------------------------------------------------------------
        // Data loading (uncached).
        //---------------------------------------------------------------------

        private async Task<CloudNode> LoadProjectsAsync(
            CancellationToken token)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithoutParameters())
            using (var computeEngineAdapter = this.computeEngineAdapter.CreateInstance())
            using (var resourceManagerAdapter = this.resourceManagerAdapter.CreateInstance())
            {
                var accessibleProjects = new List<ProjectNode>();

                //
                // Load projects in parallel.
                //
                // NB. The Compute Engine project.get resource does not include the
                // project name, so we have to use the Resource Manager API instead.
                //
                var tasks = new Dictionary<ProjectLocator, Task<Google.Apis.CloudResourceManager.v1.Data.Project>>();
                foreach (var project in await this.projectRepository
                    .ListProjectsAsync()
                    .ConfigureAwait(false))
                {
                    tasks.Add(
                        new ProjectLocator(project.ProjectId),
                        resourceManagerAdapter.GetProjectAsync(
                            project.ProjectId,
                            token));
                }

                foreach (var task in tasks)
                {
                    //
                    // NB. Some projects might not be accessible anymore,
                    // either because they have been deleted or the user
                    // lost access.
                    //
                    try
                    {
                        var project = await task.Value.ConfigureAwait(false);
                        Debug.Assert(project != null);

                        accessibleProjects.Add(new ProjectNode(
                            task.Key,
                            true,
                            project.Name));

                        ApplicationTraceSources.Default.TraceVerbose(
                            "Successfully loaded project {0}", task.Key);
                    }
                    catch (Exception e) when (e.IsReauthError())
                    {
                        // Propagate reauth errors so that the reauth logic kicks in.
                        throw e.Unwrap();
                    }
                    catch (Exception e)
                    {
                        //
                        // Add as inaccessible project and continue.
                        //
                        accessibleProjects.Add(new ProjectNode(
                            task.Key,
                            false,
                            null));

                        ApplicationTraceSources.Default.TraceError(
                            "Failed to load project {0}: {1}",
                            task.Key,
                            e);
                    }
                }

                return new CloudNode(accessibleProjects);
            }
        }

        private async Task<IReadOnlyCollection<IProjectModelZoneNode>> LoadZones(
            ProjectLocator project,
            CancellationToken token)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithoutParameters())
            using (var computeEngineAdapter = this.computeEngineAdapter.CreateInstance())
            {
                var instances = await computeEngineAdapter
                    .ListInstancesAsync(project.ProjectId, token)
                    .ConfigureAwait(false);

                var zoneLocators = instances
                    .EnsureNotNull()
                    .Select(i => ZoneLocator.FromString(i.Zone))
                    .ToHashSet();

                var zones = new List<ZoneNode>();
                foreach (var zoneLocator in zoneLocators.OrderBy(z => z.Name))
                {
                    var instancesInZone = instances
                        .Where(i => ZoneLocator.FromString(i.Zone) == zoneLocator)
                        .Where(i => i.Disks != null && i.Disks.Any())
                        .OrderBy(i => i.Name)
                        .Select(i => new InstanceNode(
                            i.Id.Value,
                            new InstanceLocator(
                                zoneLocator.ProjectId,
                                zoneLocator.Name,
                                i.Name),
                            i.IsWindowsInstance()
                                ? OperatingSystems.Windows
                                : OperatingSystems.Linux,
                            i.Status))
                        .ToList();

                    zones.Add(new ZoneNode(
                        zoneLocator,
                        instancesInZone));
                }

                return zones;
            }
        }

        //---------------------------------------------------------------------
        // Ctor.
        //---------------------------------------------------------------------

        public ProjectModelService(
            Service<IComputeEngineAdapter> computeEngineAdapter,
            Service<IResourceManagerAdapter> resourceManagerAdapter,
            IProjectRepository projectRepository,
            IEventService eventService)
        {
            this.computeEngineAdapter = computeEngineAdapter.ThrowIfNull(nameof(computeEngineAdapter));
            this.resourceManagerAdapter = resourceManagerAdapter.ThrowIfNull(nameof(resourceManagerAdapter));
            this.projectRepository = projectRepository.ThrowIfNull(nameof(projectRepository));
            this.eventService = eventService.ThrowIfNull(nameof(eventService));
        }

        //---------------------------------------------------------------------
        // IProjectModelService.
        //---------------------------------------------------------------------

        public async Task AddProjectAsync(ProjectLocator project)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(project))
            {
                this.projectRepository.AddProject(project);

                await this.eventService
                    .FireAsync(new ProjectAddedEvent(project.ProjectId))
                    .ConfigureAwait(false);
            }
        }

        public async Task RemoveProjectAsync(ProjectLocator project)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(project))
            {
                this.projectRepository.RemoveProject(project);

                //
                // Purge from cache.
                //
                using (await this.cacheLock.AcquireAsync(CancellationToken.None)
                    .ConfigureAwait(false))
                {
                    this.cachedZones.Remove(project);
                }

                await this.eventService
                    .FireAsync(new ProjectDeletedEvent(project.ProjectId))
                    .ConfigureAwait(false);
            }
        }

        public async Task<IProjectModelCloudNode> GetRootNodeAsync(
            bool forceReload,
            CancellationToken token)
        {
            using (await this.cacheLock.AcquireAsync(token).ConfigureAwait(false))
            {
                if (this.cachedRoot == null || forceReload)
                {
                    //
                    // Load from backend and cache.
                    //
                    this.cachedRoot = await LoadProjectsAsync(token)
                        .ConfigureAwait(false);

                    //
                    // Load zones for projects. This serves two purposes:
                    // - On startup, it ensures that all zones are loaded in
                    //   parallel, resulting in faster startup experience.
                    // - On force-reload, it ensures that we not only reload
                    //   the list of projects, but also their contents (zones).
                    //
                    var loadProjectTasks = this.cachedRoot
                        .Projects
                        .Select(p => new {
                            p.Project,
                            Zones = LoadZones(p.Project, token)
                        })

                        //
                        // Force eager evaluation, otherwise we're not triggering
                        // the network call.
                        //
                        .ToList();

                    foreach (var loadProjectTask in loadProjectTasks)
                    {
                        try
                        {
                            this.cachedZones[loadProjectTask.Project] = await loadProjectTask
                                .Zones
                                .ConfigureAwait(false);
                        }
                        catch (ResourceAccessDeniedException)
                        {
                            //
                            // Project inaccessible, ignore. The project will till show up
                            // in the model, but it won't have its zones pre-loaded.
                            //
                        }
                    }
                }
            }

            Debug.Assert(this.cachedRoot != null);

            return this.cachedRoot;
        }

        public async Task<IReadOnlyCollection<IProjectModelZoneNode>> GetZoneNodesAsync(
            ProjectLocator project,
            bool forceReload,
            CancellationToken token)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(project, forceReload))
            {
                IReadOnlyCollection<IProjectModelZoneNode> zones = null;
                using (await this.cacheLock.AcquireAsync(token).ConfigureAwait(false))
                {
                    if (!this.cachedZones.TryGetValue(
                        project,
                        out zones) || forceReload)
                    {
                        //
                        // Load from backend and cache.
                        //
                        zones = await LoadZones(project, token)
                            .ConfigureAwait(false);
                        this.cachedZones[project] = zones;
                    }
                }

                Debug.Assert(zones != null);

                return zones;
            }
        }

        public async Task<IProjectModelNode> GetNodeAsync(
            ResourceLocator locator,
            CancellationToken token)
        {

            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(locator))
            {
                if (locator is ProjectLocator projectLocator)
                {
                    var root = await GetRootNodeAsync(false, token)
                        .ConfigureAwait(false);

                    return root.Projects.FirstOrDefault(p => p.Project == projectLocator);
                }
                else if (locator is ZoneLocator zoneLocator)
                {
                    var project = await GetNodeAsync(
                            new ProjectLocator(zoneLocator.ProjectId), token)
                        .ConfigureAwait(false);
                    if (project == null)
                    {
                        // Don't load a zone if the parent project has not been added.
                        return null;
                    }

                    var zones = await GetZoneNodesAsync(
                            new ProjectLocator(zoneLocator.ProjectId),
                            false,
                            token)
                        .ConfigureAwait(false);
                    return zones.FirstOrDefault(z => z.Zone == zoneLocator);
                }
                else if (locator is InstanceLocator instanceLocator)
                {
                    var project = await GetNodeAsync(
                            new ProjectLocator(instanceLocator.ProjectId), token)
                        .ConfigureAwait(false);
                    if (project == null)
                    {
                        // Don't load a instance if the parent project has not been added.
                        return null;
                    }

                    var zones = await GetZoneNodesAsync(
                            new ProjectLocator(instanceLocator.ProjectId),
                            false,
                            token)
                        .ConfigureAwait(false);
                    return zones
                        .SelectMany(z => z.Instances)
                        .FirstOrDefault(i => i.Instance == instanceLocator);
                }
                else
                {
                    throw new ArgumentException("Unrecognized locator " + locator);
                }
            }
        }

        public async Task<IProjectModelNode> GetActiveNodeAsync(CancellationToken token)
        {
            //
            // Look up the node. It's possible that no node has been
            // selected or that the node is not there anymore because
            // it was removed by a reload - then default to the root.
            //
            if (this.activeNode != null)
            {
                var node = await GetNodeAsync(this.activeNode, token)
                    .ConfigureAwait(false);
                if (node != null)
                {
                    return node;
                }
            }

            return await GetRootNodeAsync(false, token)
                .ConfigureAwait(false);
        }

        public Task SetActiveNodeAsync(
            IProjectModelNode node,
            CancellationToken token)
        {
            if (node is IProjectModelInstanceNode instanceNode)
            {
                return SetActiveNodeAsync(instanceNode.Instance, token);
            }
            else if (node is IProjectModelZoneNode zoneNode)
            {
                return SetActiveNodeAsync(zoneNode.Zone, token);
            }
            else if (node is IProjectModelProjectNode projectNode)
            {
                return SetActiveNodeAsync(projectNode.Project, token);
            }
            else
            {
                return SetActiveNodeAsync((ResourceLocator)null, token);
            }
        }

        public async Task SetActiveNodeAsync(
            ResourceLocator locator,
            CancellationToken token)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(locator))
            {
                IProjectModelNode node;
                if (locator != null)
                {
                    node = await GetNodeAsync(locator, token)
                        .ConfigureAwait(false);

                    if (node != null)
                    {
                        //
                        // Node found -> set as active and fire event.
                        //
                        this.activeNode = locator;

                        await this.eventService
                            .FireAsync(new ActiveProjectChangedEvent(node))
                            .ConfigureAwait(true);

                        return;
                    }
                }

                //
                // Locator was null or pointed to nonexisting node ->
                // set root as active.
                //
                this.activeNode = null;
                if (this.cachedRoot != null)
                {
                    await this.eventService
                        .FireAsync(new ActiveProjectChangedEvent(this.cachedRoot))
                        .ConfigureAwait(true);
                }
            }
        }

        //---------------------------------------------------------------------
        // IDisposable.
        //---------------------------------------------------------------------

        protected virtual void Dispose(bool disposing)
        {
            this.cacheLock.Dispose();
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
    }
}


text:
package framework

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"
)

// FetchJSON fetches JSON content from the specified URL path and returns it
// as a map. The function returns an empty map on error.
func FetchJSON(urlPath string) map[string]interface{} {
	out := map[string]interface{}{}
	response, err := http.Get(fmt.Sprintf("%s%s", ServerAddress, urlPath))
	if err != nil {
		return out
	}
	defer response.Body.Close()
	_ = json.NewDecoder(response.Body).Decode(&out)
	return out
}

// PostJSON performs a post and fetches JSON content from the specified URL path and returns it
// as a map. The function returns an empty map on error.
func PostJSON(urlPath string, values map[string]string) map[string]interface{} {
	urlValues := url.Values{}
	for k, v := range values {
		urlValues.Add(k, v)
	}
	out := map[string]interface{}{}
	response, err := http.PostForm(fmt.Sprintf("%s%s", ServerAddress, urlPath), urlValues)
	if err != nil {
		return out
	}
	defer response.Body.Close()
	_ = json.NewDecoder(response.Body).Decode(&out)
	return out
}

// DebugVars parses /debug/vars and returns a map. The function returns
// an empty map on error.
func DebugVars() map[string]interface{} {
	return FetchJSON("/debug/vars")
}

// FetchInt fetches the specified slash-separated tag and returns the
// value as an int. It returns 0 on error, or if not found.
func FetchInt(vars map[string]interface{}, tags string) int {
	val, _ := FetchVal(vars, tags).(float64)
	return int(val)
}

// FetchVal fetches the specified slash-separated tag and returns the
// value as an interface. It returns nil on error, or if not found.
func FetchVal(vars map[string]interface{}, tags string) interface{} {
	splitTags := strings.Split(tags, "/")
	if len(tags) == 0 {
		return nil
	}
	current := vars
	for _, tag := range splitTags[:len(splitTags)-1] {
		icur, ok := current[tag]
		if !ok {
			return nil
		}
		current, ok = icur.(map[string]interface{})
		if !ok {
			return nil
		}
	}
	return current[splitTags[len(splitTags)-1]]
}

// FetchURL fetches the content from the specified URL path and returns it
// as a string. The function returns an empty string on error.
func FetchURL(urlPath string) string {
	response, err := http.Get(fmt.Sprintf("%s%s", ServerAddress, urlPath))
	if err != nil {
		return ""
	}
	defer response.Body.Close()
	b, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return ""
	}
	return string(b)
}


text:
#pragma once
#include <aws/iam/IAM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace IAM
{
namespace Model
{

  /**
   *
Contains information about a group that a managed policy is attached to.

   *
This data type is used as a response element in the
   * ListEntitiesForPolicy action.

For more information about managed
   * policies, refer to Managed
   * Policies and Inline Policies in the Using IAM guide.

   */
  class AWS_IAM_API PolicyGroup
  {
  public:
    PolicyGroup();
    PolicyGroup(const Aws::Utils::Xml::XmlNode& xmlNode);
    PolicyGroup& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline const Aws::String& GetGroupName() const{ return m_groupName; }

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline void SetGroupName(const Aws::String& value) { m_groupNameHasBeenSet = true; m_groupName = value; }

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline void SetGroupName(Aws::String&& value) { m_groupNameHasBeenSet = true; m_groupName = value; }

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline void SetGroupName(const char* value) { m_groupNameHasBeenSet = true; m_groupName.assign(value); }

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline PolicyGroup& WithGroupName(const Aws::String& value) { SetGroupName(value); return *this;}

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline PolicyGroup& WithGroupName(Aws::String&& value) { SetGroupName(value); return *this;}

    /**
     *
The name (friendly name, not ARN) identifying the group.

     */
    inline PolicyGroup& WithGroupName(const char* value) { SetGroupName(value); return *this;}

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline const Aws::String& GetGroupId() const{ return m_groupId; }

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline void SetGroupId(const Aws::String& value) { m_groupIdHasBeenSet = true; m_groupId = value; }

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline void SetGroupId(Aws::String&& value) { m_groupIdHasBeenSet = true; m_groupId = value; }

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline void SetGroupId(const char* value) { m_groupIdHasBeenSet = true; m_groupId.assign(value); }

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline PolicyGroup& WithGroupId(const Aws::String& value) { SetGroupId(value); return *this;}

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline PolicyGroup& WithGroupId(Aws::String&& value) { SetGroupId(value); return *this;}

    /**
     *
The stable and unique string identifying the group. For more information
     * about IDs, see IAM
     * Identifiers in the IAM User Guide.

     */
    inline PolicyGroup& WithGroupId(const char* value) { SetGroupId(value); return *this;}

  private:
    Aws::String m_groupName;
    bool m_groupNameHasBeenSet;
    Aws::String m_groupId;
    bool m_groupIdHasBeenSet;
  };

} // namespace Model
} // namespace IAM
} // namespace Aws


text:
@implementation SNHRulerView

- (instancetype)initWithFrame:(CGRect)frame
{
    NSAssert(NO, nil);
    @throw nil;
}

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
    return [super initWithCoder:aDecoder];
}

- (instancetype)initWithFrame:(CGRect)frame widthPerSecond:(CGFloat)width themeColor:(UIColor *)color labelInterval:(NSInteger)interval
{
    self = [super initWithFrame:frame];
    if (self) {
        _widthPerSecond = width;
        _themeColor = color;
        _labelInterval = interval;
    }
    return self;
}

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

    CGFloat leftMargin = 10;
    CGFloat topMargin = 0;
    CGFloat height = CGRectGetHeight(self.frame);
    CGFloat width = CGRectGetWidth(self.frame);
    CGFloat minorTickSpace = self.widthPerSecond;
    NSInteger multiple = _labelInterval;
    CGFloat majorTickLength = 12;
    CGFloat minorTickLength = 7;

    CGFloat baseY = topMargin + height;
    CGFloat minorY = baseY - minorTickLength;
    CGFloat majorY = baseY - majorTickLength;

    NSInteger step = 0;
    BOOL shoudSkip = minorTickSpace < 4.75 ? YES : NO;
    NSInteger skipCount = 5;
    for (CGFloat x = leftMargin; x <= (leftMargin + width); x += minorTickSpace) {

        CGContextMoveToPoint(context, x, baseY);

        void (^drawElement)() = ^() {
            CGContextSetFillColorWithColor(context, self.themeColor.CGColor);
            if (step % multiple == 0) {
                CGContextFillRect(context, CGRectMake(x, majorY, 1.75, majorTickLength));

                UIFont *font = [UIFont systemFontOfSize:11];
                UIColor *textColor = self.themeColor;
                NSDictionary *stringAttrs = @{NSFontAttributeName:font, NSForegroundColorAttributeName:textColor};

                NSInteger minutes = step / 60;
                NSInteger seconds = step % 60;

                NSAttributedString* attrStr;

                if (minutes > 0) {
                    attrStr = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld:%02ld", (long) minutes, (long) seconds] attributes:stringAttrs];
                }
                else {
                    attrStr = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@":%02ld", (long) seconds] attributes:stringAttrs];
                }

                [attrStr drawAtPoint:CGPointMake(x-7, majorY - 15)];

            } else {
                CGContextFillRect(context, CGRectMake(x, minorY, 1.0, minorTickLength));
            }
        };

        if (!shoudSkip) {
            drawElement();
        } else if (shoudSkip && skipCount == 5) {
            skipCount = 0;
            drawElement();

        } else {
            skipCount++;
        }

        step++;
    }
}

#pragma mark - Private methods

- (CGFloat)widthPerSecond
{
    return _widthPerSecond ?: 25.0;
}

- (UIColor *)themeColor
{
    return _themeColor ?: [UIColor lightGrayColor];
}

@end


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_73b.cpp
Label Definition File: CWE761_Free_Pointer_Not_at_Start_of_Buffer.label.xml
Template File: source-sinks-73b.tmpl.cpp
*/
/*
 * @description
 * CWE: 761 Free Pointer not at Start of Buffer
 * BadSource: console Read input from the console
 * Sinks:
 *    GoodSink: free() memory correctly at the start of the buffer
 *    BadSink : free() memory not at the start of the buffer
 * Flow Variant: 73 Data flow: data passed in a list from one function to another in different source files
 *
 * */

#include "std_testcase.h"
#include <list>

#include <wchar.h>

#define SEARCH_CHAR L'S'

using namespace std;

namespace CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_73
{

#ifndef OMITBAD

void badSink(list<wchar_t *> dataList)
{
    /* copy data out of dataList */
    wchar_t * data = dataList.back();
    /* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
     * memory block not at the start of the buffer */
    for (; *data != L'\0'; data++)
    {
        if (*data == SEARCH_CHAR)
        {
            printLine("We have a match!");
            break;
        }
    }
    free(data);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodB2G uses the BadSource with the GoodSink */
void goodB2GSink(list<wchar_t *> dataList)
{
    wchar_t * data = dataList.back();
    {
        size_t i;
        /* FIX: Use a loop variable to traverse through the string pointed to by data */
        for (i=0; i < wcslen(data); i++)
        {
            if (data[i] == SEARCH_CHAR)
            {
                printLine("We have a match!");
                break;
            }
        }
        free(data);
    }
}

#endif /* OMITGOOD */

} /* close namespace */


text:
package convenientadditions.item.trinket;

import baubles.api.BaubleType;
import baubles.api.IBauble;
import convenientadditions.ModConstants;
import convenientadditions.base.item.CAItem;
import convenientadditions.base.item.EnumItemCategory;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.FoodStats;
import net.minecraft.util.SoundCategory;
import net.minecraftforge.fml.common.Optional;

@Optional.Interface(iface = "baubles.api.IBauble",modid = "baubles",striprefs = true)
public class ItemSaturationRing extends CAItem implements IBauble {

    public ItemSaturationRing() {
        super(ModConstants.ItemNames.saturationRing);
        this.setMaxStackSize(1);
        this.setCategory(EnumItemCategory.TRINKET).setBaublesRequiredInfo(true);
    }

    @Override
    public BaubleType getBaubleType(ItemStack itemstack) {
        return BaubleType.TRINKET;
    }

    @Override
    public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
        if (player.getEntityWorld().isRemote)
            return;
        EntityPlayer p = (EntityPlayer) player;
        FoodStats s = p.getFoodStats();
        if (s.needFood()&&p.ticksExisted%1100==0){
            int foodLevel=Math.min((20-s.getFoodLevel()),(1+(p.world.rand.nextInt(8)==0?1:0)));
            s.addStats(foodLevel,2f+(p.world.rand.nextFloat()*2));
            p.world.playSound(null,p.posX,p.posY,p.posZ,SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS,.05f,.95f);
        }
    }
}


text:
<!DOCTYPE HTML>

<title>org.freedesktop.dbus.connections Class Hierarchy (dbus-java-core 4.2.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2022-09-05">
<meta name="description" content="tree: module: org.freedesktop.dbus, package: org.freedesktop.dbus.connections">
<meta name="generator" content="javadoc/PackageTreeWriter">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Module

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">

Hierarchy For Package org.freedesktop.dbus.connections

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.freedesktop.dbus.connections.AbstractConnection (implements java.io.Closeable)

org.freedesktop.dbus.connections.BusAddress

org.freedesktop.dbus.connections.FallbackContainer

org.freedesktop.dbus.connections.GlobalHandler (implements org.freedesktop.dbus.interfaces.Introspectable, org.freedesktop.dbus.interfaces.Peer)

org.freedesktop.dbus.connections.PeerSet (implements org.freedesktop.dbus.interfaces.DBusSigHandler<T>, java.util.Set<E>)

org.freedesktop.dbus.connections.PendingCallbackManager

org.freedesktop.dbus.connections.ReceivingService

org.freedesktop.dbus.connections.SASL

org.freedesktop.dbus.connections.SASL.Command

java.lang.Thread (implements java.lang.Runnable)

org.freedesktop.dbus.connections.IncomingMessageThread

org.freedesktop.dbus.connections.SenderThread

Interface Hierarchy

org.freedesktop.dbus.connections.IDisconnectAction

org.freedesktop.dbus.connections.IDisconnectCallback

org.freedesktop.dbus.connections.ReceivingService.IThreadPoolRetryHandler

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.lang.constant.Constable, java.io.Serializable)

org.freedesktop.dbus.connections.ReceivingService.ExecutorNames

org.freedesktop.dbus.connections.SASL.SaslCommand

org.freedesktop.dbus.connections.SASL.SaslMode

org.freedesktop.dbus.connections.SASL.SaslResult

Copyright © 2022. All rights reserved.


text:
(function(){
  'use strict';

  angular
    .module('everycent.common')
    .factory('LookupService', LookupService);

  LookupService.$inject = ['Restangular', '$q'];
  function LookupService(Restangular, $q){
    var dataCache = { };
    var promiseCache = { };

    var service = {
      clear: clear,
      refreshList: refreshList
    };
    return service;

    function refreshList(list, params, ignoreCache){
      //TODO: to fix so that we cache based on params
      if(ignoreCache){

        // we need to convert the restangular objects to plain objects,
        // because when used in ngOptions, the restangular objects are generating extra options
        return Restangular.all(list).getList(params).then(function(serverList){
          return _mapRestangularObjectListToSimpleObjectList(serverList);
        });
      }

      return $q.when(dataCache[list] || promiseCache[list] || _refreshFromServer(list, params));

      function _refreshFromServer(list, params){
        promiseCache[list] = Restangular.all(list).getList(params).then(function(listValues){

          // we need to convert the restangular objects to plain objects,
          // because when used in ngOptions, the restangular objects are generating extra options
          var simpleListValues = _mapRestangularObjectListToSimpleObjectList(listValues);
          dataCache[list] = simpleListValues;
          return simpleListValues;
        });

        return promiseCache[list];
      }
    }

    function clear(){
      dataCache = {};
      promiseCache = {};
    }

    // TODO:  this is a temporary fix for the ng-options bug
    // the restangular object array contains extra properties/functions
    // that are not needed for our lookup lists, but are iterated over
    // when the restangularized array is used in ng-options
    // So, we'll create a new array without these extra restangular properties
    function _mapRestangularObjectListToSimpleObjectList(restangularObjectList){
      var result = [];
      restangularObjectList.forEach(function(obj){
        result.push(obj);
      });

      return result;
    }
  }
})();


text:
package run

import (
	"fmt"
	"github.com/ohsu-comp-bio/funnel/client"
	"github.com/ohsu-comp-bio/funnel/proto/tes"
	"golang.org/x/net/context"
	"sync"
)

type taskGroup struct {
	wg        sync.WaitGroup
	err       chan error
	printTask bool
	client    *client.Client
}

func (tg *taskGroup) runTask(t *tes.Task, wait bool, waitFor []string) {
	if tg.err == nil {
		tg.err = make(chan error)
	}

	tg.wg.Add(1)
	go func() {
		err := tg._run(t, wait, waitFor)
		if err != nil {
			tg.err <- err
		}
		tg.wg.Done()
	}()
}

func (tg *taskGroup) wait() error {
	done := make(chan struct{})
	go func() {
		tg.wg.Wait()
		close(done)
	}()

	select {
	case err := <-tg.err:
		return err
	case <-done:
		return nil
	}
}

func (tg *taskGroup) _run(task *tes.Task, wait bool, waitFor []string) error {

	if tg.printTask {
		// Marshal message to JSON
		taskJSON, merr := tg.client.Marshaler.MarshalToString(task)
		if merr != nil {
			return merr
		}
		fmt.Println(taskJSON)
		return nil
	}

	if len(waitFor) > 0 {
		for _, tid := range waitFor {
			tg.client.WaitForTask(context.Background(), tid)
		}
	}

	resp, rerr := tg.client.CreateTask(context.Background(), task)
	if rerr != nil {
		return rerr
	}

	taskID := resp.Id
	fmt.Println(taskID)

	if wait {
		return tg.client.WaitForTask(context.Background(), taskID)
	}
	return nil
}


text:
Launching pgcli
###############

:date: 2015-1-6
:tags: python, postgres
:category: Blog
:slug: launch

Pgcli_ was launched today on HackerNews_ and Reddit_.

Pgcli_ is a command line interface for Postgres database that can do
auto-completion and syntax-highlighting among other things. A list of features_
with screenshots are available on the features_ page.

Source is available on github: http://github.com/amjith/pgcli

.. _Pgcli: http://pgcli.com
.. _HackerNews: https://news.ycombinator.com/item?id=8844723
.. _Reddit: http://www.reddit.com/r/Python/comments/2riuj0/pgcli_a_cli_for_postgres_with_autocompletion_and/
.. _features: http://pgcli.com/features


text:
/**********************************************************\
|                                                          |
|                          hprose                          |
|                                                          |
| Official WebSite: http://www.hprose.com/                 |
|                   http://www.hprose.org/                 |
|                                                          |
\**********************************************************/

/**********************************************************\
 *                                                        *
 * Polyfill.js                                            *
 *                                                        *
 * Polyfill for Node.js.                                  *
 *                                                        *
 * LastModified: Mar 3, 2016                              *
 * Author: Ma Bingyao <andot@hprose.com>                  *
 *                                                        *
\**********************************************************/

'use strict';
/* Function */
if (!Function.prototype.bind) {
    Object.defineProperty(Function.prototype, 'bind', { value: function(oThis) {
        if (typeof this !== 'function') {
            throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
        }
        var aArgs   = Array.prototype.slice.call(arguments, 1),
            toBind = this,
            NOP    = function() {},
            bound  = function() {
                return toBind.apply(this instanceof NOP ? this : oThis,
                        aArgs.concat(Array.prototype.slice.call(arguments)));
            };
        if (this.prototype) {
            NOP.prototype = this.prototype;
        }
        bound.prototype = new NOP();
        return bound;
    } });
}
/* Array */
if (!Array.prototype.includes) {
    Object.defineProperty(Array.prototype, 'includes', { value: function(searchElement /*, fromIndex*/ ) {
        var O = Object(this);
        var len = parseInt(O.length, 10) || 0;
        if (len === 0) {
            return false;
        }
        var n = parseInt(arguments[1], 10) || 0;
        var k;
        if (n >= 0) {
            k = n;
        }
        else {
            k = len + n;
            if (k < 0) { k = 0; }
        }
        var currentElement;
        while (k < len) {
            currentElement = O[k];
            if (searchElement === currentElement ||
                (searchElement !== searchElement && currentElement !== currentElement)) { // NaN !== NaN
                return true;
            }
            k++;
        }
        return false;
    } });
}
if (!Array.prototype.find) {
    Object.defineProperty(Array.prototype, 'find', { value: function(predicate) {
        if (this === null || this === undefined) {
            throw new TypeError('Array.prototype.find called on null or undefined');
        }
        if (typeof predicate !== 'function') {
            throw new TypeError('predicate must be a function');
        }
        var list = Object(this);
        var length = list.length >>> 0;
        var thisArg = arguments[1];
        var value;
        for (var i = 0; i < length; i++) {
            value = list[i];
            if (predicate.call(thisArg, value, i, list)) {
                return value;
            }
        }
        return undefined;
    } });
}
if (!Array.prototype.findIndex) {
    Object.defineProperty(Array.prototype, 'findIndex', { value: function(predicate) {
        if (this === null || this === undefined) {
            throw new TypeError('Array.prototype.findIndex called on null or undefined');
        }
        if (typeof predicate !== 'function') {
            throw new TypeError('predicate must be a function');
        }
        var list = Object(this);
        var length = list.length >>> 0;
        var thisArg = arguments[1];
        var value;

        for (var i = 0; i < length; i++) {
            value = list[i];
            if (predicate.call(thisArg, value, i, list)) {
                return i;
            }
        }
        return -1;
    } });
}
if (!Array.prototype.fill) {
    Object.defineProperty(Array.prototype, 'fill', { value: function(value) {
        if (this === null || this === undefined) {
            throw new TypeError('this is null or not defined');
        }
        var O = Object(this);
        var len = O.length >>> 0;
        var start = arguments[1];
        var relativeStart = start >> 0;
        var k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
        var end = arguments[2];
        var relativeEnd = end === undefined ? len : end >> 0;
        var f = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);

        while (k < f) {
            O[k] = value;
            k++;
        }
        return O;
    } });
}
if (!Array.prototype.copyWithin) {
    Object.defineProperty(Array.prototype, 'copyWithin', { value: function(target, start/*, end*/) {
        if (this === null || this === undefined) {
            throw new TypeError('this is null or not defined');
        }
        var O = Object(this);
        var len = O.length >>> 0;
        var relativeTarget = target >> 0;
        var to = relativeTarget < 0 ? Math.max(len + relativeTarget, 0) : Math.min(relativeTarget, len);
        var relativeStart = start >> 0;
        var from = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
        var end = arguments[2];
        var relativeEnd = end === undefined ? len : end >> 0;
        var f = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);
        var count = Math.min(f - from, len - to);
        var direction = 1;
        if (from < to && to < (from + count)) {
            direction = -1;
            from += count - 1;
            to += count - 1;
        }
        while (count > 0) {
            if (from in O) {
                O[to] = O[from];
            }
            else {
                delete O[to];
            }
            from += direction;
            to += direction;
            count--;
        }
        return O;
    } });
}
if (!Array.from) {
    Object.defineProperty(Array, 'from', { value: (function() {
        var toStr = Object.prototype.toString;
        var isCallable = function(fn) {
            return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
        };
        var toInteger = function(value) {
            var number = Number(value);
            if (isNaN(number)) { return 0; }
            if (number === 0 || !isFinite(number)) { return number; }
            return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
        };
        var maxSafeInteger = Math.pow(2, 53) - 1;
        var toLength = function(value) {
            var len = toInteger(value);
            return Math.min(Math.max(len, 0), maxSafeInteger);
        };

        return function(arrayLike/*, mapFn, thisArg */) {
            var C = this;
            var items = Object(arrayLike);
            if (arrayLike === null || arrayLike === undefined) {
                throw new TypeError("Array.from requires an array-like object - not null or undefined");
            }
            var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
            var T;
            if (typeof mapFn !== 'undefined') {
                if (!isCallable(mapFn)) {
                    throw new TypeError('Array.from: when provided, the second argument must be a function');
                }
                if (arguments.length > 2) {
                    T = arguments[2];
                }
            }
            var len = toLength(items.length);
            var A = isCallable(C) ? Object(new C(len)) : new Array(len);
            var k = 0;
            var kValue;
            while (k < len) {
                kValue = items[k];
                if (mapFn) {
                    A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
                }
                else {
                    A[k] = kValue;
                }
                k += 1;
            }
            A.length = len;
            return A;
        };
    }()) });
}
if (!Array.of) {
    Object.defineProperty(Array, 'of', { value: function() {
        return Array.prototype.slice.call(arguments);
    } });
}
/* String */
if (!String.prototype.startsWith) {
    Object.defineProperty(String.prototype, 'startsWith', { value: function(searchString, position){
        position = position || 0;
        return this.substr(position, searchString.length) === searchString;
    } });
}
if (!String.prototype.endsWith) {
    Object.defineProperty(String.prototype, 'endsWith', { value: function(searchString, position) {
        var subjectString = this.toString();
        if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
            position = subjectString.length;
        }
        position -= searchString.length;
        var lastIndex = subjectString.indexOf(searchString, position);
        return lastIndex !== -1 && lastIndex === position;
    } });
}
if (!String.prototype.includes) {
    Object.defineProperty(String.prototype, 'includes', { value: function() {
        if (typeof arguments[1] === "number") {
            if (this.length < arguments[0].length + arguments[1].length) {
                return false;
            }
            else {
                return this.substr(arguments[1], arguments[0].length) === arguments[0];
            }
        }
        else {
            return String.prototype.indexOf.apply(this, arguments) !== -1;
        }
    } });
}
if (!String.prototype.repeat) {
    Object.defineProperty(String.prototype, 'repeat', { value: function(count) {
        var str = this.toString();
        count = +count;
        if (count !== count) {
            count = 0;
        }
        if (count < 0) {
            throw new RangeError('repeat count must be non-negative');
        }
        if (count === Infinity) {
            throw new RangeError('repeat count must be less than infinity');
        }
        count = Math.floor(count);
        if (str.length === 0 || count === 0) {
            return '';
        }
        // Ensuring count is a 31-bit integer allows us to heavily optimize the
        // main part. But anyway, most current (August 2014) browsers can't handle
        // strings 1 << 28 chars or longer, so:
        if (str.length * count >= 1 << 28) {
          throw new RangeError('repeat count must not overflow maximum string size');
        }
        var rpt = '';
        for (;;) {
            if ((count & 1) === 1) {
                rpt += str;
            }
            count >>>= 1;
            if (count === 0) {
                break;
            }
            str += str;
        }
        // Could we try:
        // return Array(count + 1).join(this);
        return rpt;
    } });
}
if (!String.prototype.trim) {
    Object.defineProperty(String.prototype, 'trim', { value: function() {
        return this.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, '');
    } });
}
if (!String.prototype.trimLeft) {
    Object.defineProperty(String.prototype, 'trimLeft', { value: function() {
        return this.toString().replace(/^[\s\xa0]+/, '');
    } });
}
if (!String.prototype.trimRight) {
    Object.defineProperty(String.prototype, 'trimRight', { value: function() {
        return this.toString().replace(/[\s\xa0]+$/, '');
    } });
}
/* Object */
if (!Object.keys) {
    Object.defineProperty(Object, 'keys', { value: (function () {
        var hasOwnProperty = Object.prototype.hasOwnProperty,
            hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
            dontEnums = [
                'toString',
                'toLocaleString',
                'valueOf',
                'hasOwnProperty',
                'isPrototypeOf',
                'propertyIsEnumerable',
                'constructor'
            ],
            dontEnumsLength = dontEnums.length;
        return function (obj) {
            if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) {
                throw new TypeError('Object.keys called on non-object');
            }
            var result = [];
            for (var prop in obj) {
                if (hasOwnProperty.call(obj, prop)) {
                    result.push(prop);
                }
            }
            if (hasDontEnumBug) {
                for (var i=0; i < dontEnumsLength; i++) {
                    if (hasOwnProperty.call(obj, dontEnums[i])) {
                        result.push(dontEnums[i]);
                    }
                }
            }
            return result;
        };
    })() });
}
/* Generic methods */
var generic = global.hprose.generic;

function genericMethods(obj, properties) {
    var proto = obj.prototype;
    for (var i = 0, len = properties.length; i < len; i++) {
        var property = properties[i];
        var method = proto[property];
        if (typeof method === 'function' && typeof obj[property] === 'undefined') {
            Object.defineProperty(obj, property, { value: generic(method) });
        }
    }
}
genericMethods(Array, [
    "pop",
    "push",
    "reverse",
    "shift",
    "sort",
    "splice",
    "unshift",
    "concat",
    "join",
    "slice",
    "indexOf",
    "lastIndexOf",
    "filter",
    "forEach",
    "every",
    "map",
    "some",
    "reduce",
    "reduceRight",
    "includes",
    "find",
    "findIndex"
]);
genericMethods(String, [
    'quote',
    'substring',
    'toLowerCase',
    'toUpperCase',
    'charAt',
    'charCodeAt',
    'indexOf',
    'lastIndexOf',
    'include',
    'startsWith',
    'endsWith',
    'repeat',
    'trim',
    'trimLeft',
    'trimRight',
    'toLocaleLowerCase',
    'toLocaleUpperCase',
    'match',
    'search',
    'replace',
    'split',
    'substr',
    'concat',
    'slice'
]);


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

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <screen name="EntitySQLProcessor">

            <actions>
                <set field="titleProperty" value="PageTitleEntitySQLProcessor"/>
                <set field="tabButtonItem" value="EntitySQLProcessor"/>
                <set field="labelTitleProperty" value="PageTitleEntitySQLProcessor"/>
                <set field="sqlCommand" from-field="parameters.sqlCommand"/>
                <set field="selGroup" from-field="parameters.group"/>
                <set field="rowLimit" from-field="parameters.rowLimit" type="Integer"/>
                <set field="parameters.TRANSACTION_TIMEOUT" value="7200"/>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--Value for the analog watchface-->
    <dimen name="analog_hand_stroke">3dp</dimen>

    <!--Values for the round digital watch-->
    <dimen name="temp_text_size_round">30dp</dimen>
    <dimen name="date_text_size_round">20dp</dimen>
    <dimen name="time_text_size_round">32dp</dimen>
    <dimen name="time_x_offset_round">90dp</dimen>
    <dimen name="time_x_offset_round_ambient">60dp</dimen>
    <dimen name="date_x_offset_round">70dp</dimen>

    <!--Values for the square digital watch-->
    <dimen name="time_x_offset">80dp</dimen>
    <dimen name="time_x_offset_ambient">50dp</dimen>
    <dimen name="date_x_offset">50dp</dimen>
    <dimen name="time_text_size">30dp</dimen>
    <dimen name="date_text_size">15dp</dimen>
    <dimen name="temp_text_size">25dp</dimen>

    <!--General values for watch-->
    <dimen name="time_y_offset">90dp</dimen>
    <dimen name="date_y_offset">110dp</dimen>
    <dimen name="divider_y_offset">125dp</dimen>
    <dimen name="weather_y_offset">160dp</dimen>
    <dimen name="line_height">15dp</dimen>

</resources>


text:
package shakey.server.internal.algorithm

/**
 * Calculates Moving Average Convergence-Divergence (MACD) indicator
 */
trait MACD {
  this: EMA =>
  /**
   *
   * Calculates Moving Average Convergence-Divergence (MACD) indicator
   * @param input Input signal
   * @param fastPeriod Number of periods for fast moving averag
   * @param slowPeriod Number of periods for slow moving average
   * @param signalPeriod Number of periods for signal line
   * @return Object containing operation results
   */
  def MACD(input: Array[Double], fastPeriod: Int, slowPeriod: Int, signalPeriod: Int) = {

    val fastEMA = EMA(input, fastPeriod).drop(slowPeriod - fastPeriod)
    val slowEMA = EMA(input, slowPeriod)

    val MACD = fastEMA.zip(slowEMA).map {
      case (fastValue, slowValue) =>
        fastValue - slowValue
    }

    val signal = EMA(MACD, signalPeriod)

    signal
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.svarasoft</groupId>
    <artifactId>passwordmanager</artifactId>
    <name>passwordmanager</name>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <organization>
        <!-- Used as the 'Vendor' for JNLP generation -->
        <name>Svarasoft</name>
    </organization>

    <modules>
        <module>passwordmanager-security</module>
        <module>passwordmanager-gui</module>
        <module>passwordmanager-datamanager</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <slf4j.version>1.7.7</slf4j.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.svarasoft</groupId>
                <artifactId>passwordmanager-security</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.3.1</version>
            </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
                <version>3.1</version>
            </dependency>
            <dependency>
                <groupId>org.jasypt</groupId>
                <artifactId>jasypt</artifactId>
                <version>1.9.2</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.10</version>
                <scope>test</scope>
            </dependency>
            <!-- Logging  -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>4.0-beta5</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.4.186</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>


text:
package org.bubblecloud.zigbee.tools.zcl;

/**
 * Created by tlaukkan on 4/10/2016.
 */
public class DataType {
    public String dataTypeName;
    public String dataTypeType;
    public String dataTypeClass;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <attr name="layout_gravity">
        <!-- Push object to the top of its container, not changing its size. -->
        <flag name="top" value="0x30" />
        <!-- Push object to the bottom of its container, not changing its size. -->
        <flag name="bottom" value="0x50" />
        <!-- Push object to the left of its container, not changing its size. -->
        <flag name="left" value="0x03" />
        <!-- Push object to the right of its container, not changing its size. -->
        <flag name="right" value="0x05" />
        <!-- Place object in the vertical center of its container, not changing its size. -->
        <flag name="center_vertical" value="0x10" />
        <!-- Place object in the horizontal center of its container, not changing its size. -->
        <flag name="center_horizontal" value="0x01" />
    </attr>

    <declare-styleable name="MyScollView">
        <attr name="layout_gravity" />
    </declare-styleable>
</resources>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('lostnfound', '0004_auto_20161205_1307'),
    ]

    operations = [
        migrations.AlterField(
            model_name='item',
            name='found',
            field=models.NullBooleanField(default=None, verbose_name=b'Found'),
        ),
    ]


text:
package org.apache.ignite.internal.processors.cache.distributed.dht;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;

/**
 * Exception that is thrown when a partition reservation failed.
 */
public class GridDhtUnreservedPartitionException extends IgniteCheckedException {
    /** */
    private static final long serialVersionUID = 0L;

    /** Partition. */
    private final int part;

    /** Topology version. */
    private final AffinityTopologyVersion topVer;

    /**
     * @param part Partition.
     * @param topVer Affinity topology version.
     * @param msg Message.
     */
    public GridDhtUnreservedPartitionException(int part, AffinityTopologyVersion topVer, String msg) {
        super(msg);

        this.part = part;
        this.topVer = topVer;
    }

    /**
     * @return Partition.
     */
    public int partition() {
        return part;
    }

    /**
     * @return Affinity topology version.
     */
    public AffinityTopologyVersion topologyVersion() {
        return topVer;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return getClass() + " [part=" + part + ", msg=" + getMessage() + ']';
    }
}


text:
package com.opengamma.integration.copier.snapshot.reader;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.threeten.bp.Instant;

import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.core.marketdatasnapshot.CurveKey;
import com.opengamma.core.marketdatasnapshot.CurveSnapshot;
import com.opengamma.core.marketdatasnapshot.UnstructuredMarketDataSnapshot;
import com.opengamma.core.marketdatasnapshot.ValueSnapshot;
import com.opengamma.core.marketdatasnapshot.VolatilitySurfaceKey;
import com.opengamma.core.marketdatasnapshot.VolatilitySurfaceSnapshot;
import com.opengamma.core.marketdatasnapshot.YieldCurveKey;
import com.opengamma.core.marketdatasnapshot.YieldCurveSnapshot;
import com.opengamma.core.marketdatasnapshot.impl.ManageableCurveSnapshot;
import com.opengamma.core.marketdatasnapshot.impl.ManageableUnstructuredMarketDataSnapshot;
import com.opengamma.core.marketdatasnapshot.impl.ManageableVolatilitySurfaceSnapshot;
import com.opengamma.core.marketdatasnapshot.impl.ManageableYieldCurveSnapshot;
import com.opengamma.id.ExternalIdBundle;
import com.opengamma.id.UniqueId;
import com.opengamma.integration.copier.sheet.reader.XlsSheetReader;
import com.opengamma.integration.copier.snapshot.SnapshotColumns;
import com.opengamma.integration.copier.snapshot.SnapshotType;
import com.opengamma.integration.tool.marketdata.MarketDataSnapshotToolUtils;
import com.opengamma.util.money.Currency;
import com.opengamma.util.tuple.ObjectsPair;
import com.opengamma.util.tuple.Pair;

/**
 * Reads a snapshot from an imported file.
 */
public class XlsSnapshotReader implements SnapshotReader {

  private final Map<CurveKey, CurveSnapshot> _curves;
  private UnstructuredMarketDataSnapshot _global;
  private final Map<VolatilitySurfaceKey, VolatilitySurfaceSnapshot> _surface;
  private final Map<YieldCurveKey, YieldCurveSnapshot> _yieldCurve;
  private String _name;
  private String _basisName;
  private XlsSheetReader _nameSheet;
  private XlsSheetReader _globalsSheet;
  private XlsSheetReader _yieldCurveSheet;
  private XlsSheetReader _curveSheet;
  private XlsSheetReader _surfaceSheet;
  private final Workbook _workbook;
  private final InputStream _fileInputStream;
  private final String _valueObject = "Market_Value";

  public XlsSnapshotReader(final String filename) {
    _fileInputStream = openFile(filename);
    _workbook = getWorkbook(_fileInputStream);
    _curves = new HashMap<>();
    _surface = new HashMap<>();
    _yieldCurve = new HashMap<>();
    buildNameData();
    buildGlobalData();
    buildYieldCurveData();
    buildCurveData();
    buildSurfaceData();
  }

  /**
   * Build surface data from xls data, made up of a key/value block of details, a matrix block of market values and a matrix block of override values, each
   * block separated by a empty row
   */
  private void buildSurfaceData() {
    _surfaceSheet = new XlsSheetReader(_workbook, SnapshotType.VOL_SURFACE.get());

    // continue reading in each surface object until current row incrementing returns no data
    while (true) {
      final Map<String, String> details = _surfaceSheet.readKeyValueBlock(_surfaceSheet.getCurrentRowIndex(), 0);
      if (details == null || details.isEmpty()) {
        break;
      }

      final Map<Pair<String, String>, String> marketValues = _surfaceSheet.readMatrix(_surfaceSheet.getCurrentRowIndex(), 0);
      final Map<Pair<String, String>, String> overrideValues = _surfaceSheet.readMatrix(_surfaceSheet.getCurrentRowIndex(), 0);
      final ManageableVolatilitySurfaceSnapshot surface = new ManageableVolatilitySurfaceSnapshot();
      final VolatilitySurfaceKey key = VolatilitySurfaceKey.of(UniqueId.parse(details.get(SnapshotColumns.SURFACE_TARGET.get())),
          details.get(SnapshotColumns.NAME.get()),
          details.get(SnapshotColumns.SURFACE_INSTRUMENT_TYPE.get()),
          details.get(SnapshotColumns.SURFACE_QUOTE_TYPE.get()),
          details.get(SnapshotColumns.SURFACE_QUOTE_UNITS.get()));
      final HashMap<Pair<Object, Object>, ValueSnapshot> values = new HashMap<>();

      // use the market value map to add the value and 'lookup' the corresponding override value
      for (final Map.Entry<Pair<String, String>, String> entry : marketValues.entrySet()) {
        final Pair<String, String> rawOrdinals = entry.getKey();
        final Pair<Object, Object> ordinals = MarketDataSnapshotToolUtils.createOrdinatePair(rawOrdinals.getFirst().toString(),
            rawOrdinals.getSecond().toString());
        final String override = overrideValues.get(rawOrdinals);
        final String market = entry.getValue();
        values.put(ordinals, MarketDataSnapshotToolUtils.createValueSnapshot(market, override));
      }

      surface.setValues(values);
      _surface.put(key, surface);
    }
  }

  private Workbook getWorkbook(final InputStream inputStream) {
    try {
      return new HSSFWorkbook(inputStream);
    } catch (final IOException ex) {
      throw new OpenGammaRuntimeException("Error opening Excel workbook: " + ex.getMessage());
    }
  }

  private ExternalIdBundle createExternalIdBundle(final String idBundle) {
    final Iterable<String> iterable = Arrays.asList(idBundle.split("\\|"));
    return ExternalIdBundle.parse(iterable);
  }

  /**
   * Build yield curve data from xls data, made up of a key/value block of details and a key/value-pair block of values built by
   * getManageableUnstructuredMarketDataSnapshot, each block separated by a empty row
   */
  private void buildYieldCurveData() {
    _yieldCurveSheet = new XlsSheetReader(_workbook, SnapshotType.YIELD_CURVE.get());
    while (true) {
      final Map<String, String> details = _yieldCurveSheet.readKeyValueBlock(_yieldCurveSheet.getCurrentRowIndex(), 0);
      if (details == null || details.isEmpty()) {
        break;
      }
      final YieldCurveKey key = YieldCurveKey.of(Currency.of(details.get(SnapshotColumns.YIELD_CURVE_CURRENCY.get())),
          details.get(SnapshotColumns.NAME.get()));
      final Instant instant = Instant.parse(details.get(SnapshotColumns.INSTANT.get()));
      final ManageableUnstructuredMarketDataSnapshot snapshot = getManageableUnstructuredMarketDataSnapshot(_yieldCurveSheet);
      final ManageableYieldCurveSnapshot curve = ManageableYieldCurveSnapshot.of(instant, snapshot);
      _yieldCurve.put(key, curve);
    }
  }

  /**
   * Build curve data from xls data, made up of a key/value block of details and a key/value-pair block of values built by
   * getManageableUnstructuredMarketDataSnapshot, each block separated by a empty row
   */
  private void buildCurveData() {
    _curveSheet = new XlsSheetReader(_workbook, SnapshotType.CURVE.get());
    while (true) {
      final Map<String, String> details = _curveSheet.readKeyValueBlock(_curveSheet.getCurrentRowIndex(), 0);
      if (details == null || details.isEmpty()) {
        break;
      }
      final ManageableCurveSnapshot curve = new ManageableCurveSnapshot();
      final ManageableUnstructuredMarketDataSnapshot snapshot = getManageableUnstructuredMarketDataSnapshot(_curveSheet);
      final Instant instant = Instant.parse(details.get(SnapshotColumns.INSTANT.get()));
      curve.setValuationTime(instant);
      curve.setValues(snapshot);
      _curves.put(CurveKey.of(details.get(SnapshotColumns.NAME.get())), curve);
    }
  }

  private ManageableUnstructuredMarketDataSnapshot getManageableUnstructuredMarketDataSnapshot(final XlsSheetReader sheet) {
    // Skip the header row
    final Map<String, ObjectsPair<String, String>> map = sheet.readKeyPairBlock(sheet.getCurrentRowIndex() + 1, 0);
    final ManageableUnstructuredMarketDataSnapshot builder = new ManageableUnstructuredMarketDataSnapshot();
    for (final Map.Entry<String, ObjectsPair<String, String>> entry : map.entrySet()) {
      builder.putValue(createExternalIdBundle(entry.getKey()),
          _valueObject,
          MarketDataSnapshotToolUtils.createValueSnapshot(entry.getValue().getFirst(),
              entry.getValue().getSecond()));
    }
    return builder;
  }

  /**
   * Build global data from xls data, made up of a key/value-pair block of values built by getManageableUnstructuredMarketDataSnapshot, should only consist of
   * one block
   */
  private void buildGlobalData() {
    _globalsSheet = new XlsSheetReader(_workbook, SnapshotType.GLOBAL_VALUES.get());
    _global = getManageableUnstructuredMarketDataSnapshot(_globalsSheet);
  }

  /**
   * Name data is made up of two separate blocks (name and basis name) which are special cased on writing the data so that they can be read in as on key value
   * block
   */
  private void buildNameData() {
    _nameSheet = new XlsSheetReader(_workbook, SnapshotType.NAME.get());
    final Map<String, String> nameMap = _nameSheet.readKeyValueBlock(_nameSheet.getCurrentRowIndex(), 0);
    _name = nameMap.get(SnapshotType.NAME.get());
    _basisName = nameMap.get(SnapshotType.BASIS_NAME.get());
  }

  protected static InputStream openFile(final String filename) {
    // Open input file for reading
    FileInputStream fileInputStream;
    try {
      fileInputStream = new FileInputStream(filename);
    } catch (final FileNotFoundException ex) {
      throw new OpenGammaRuntimeException("Could not open file " + filename + " for reading, exiting immediately.");
    }
    return fileInputStream;
  }

  @Override
  public Map<CurveKey, CurveSnapshot> readCurves() {
    return _curves;
  }

  @Override
  public UnstructuredMarketDataSnapshot readGlobalValues() {
    return _global;
  }

  @Override
  public Map<VolatilitySurfaceKey, VolatilitySurfaceSnapshot> readVolatilitySurfaces() {
    return _surface;
  }

  @Override
  public Map<YieldCurveKey, YieldCurveSnapshot> readYieldCurves() {
    return _yieldCurve;
  }

  @Override
  public void close() {
    // XlsSheetReader takes care of closing the input stream
  }

  @Override
  public String getName() {
    return _name;
  }

  @Override
  public String getBasisViewName() {
    return _basisName;
  }
}


text:
A way to organize your projects would be:

* projectA - Parent Directory
  * projectA - Source code directory containing Arduino code
    * projectA.ino
    * header.h
    * implementation.cpp
  * docs - Your main documentation directory
  * schematics - these may be maintained separately on a separate Git repo or part of the same repo
  * libs - This will contain your third party libraries.
  * test - Any test cases or code that tests parts of your system.
    * libA - These may be maintained as third party repositories
    * libC - ...
  * license
  * README
  * Makefile - Necessary to handle dependencies across directories


text:
package org.apache.harmony.test.func.api.java.lang.F_StringTest_07;

import org.apache.harmony.test.func.share.ScenarioTest;

public class F_StringTest_07 extends ScenarioTest {

    public int test() {

        String s1 = "abc";

        Object c = new Character('a');
        Object s = new String("a");

        try {

            try {

                int tmp = s1.compareTo(c);

                return fail("Test failed: ClassCastException wasn't caught for non-String Object!");

            } catch (ClassCastException cce) {
                log
                    .info("Info: ClassCastException caught for non-String Object");
            }

            try {

                int tmp = s1.compareTo(s);
                if (tmp != 2)
                    return fail("Test failed: Wrong compare");

            } catch (ClassCastException cce) {
                cce.printStackTrace();
                return fail("Test failed: ClassCastException caught for String Object!");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return fail("Error: Unexpected Exception caught");
        }

        return pass();
    }

    public static void main(String[] args) {
        System.exit(new F_StringTest_07().test(args));
    }
}


text:
import os

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

DEBUG = False
TEMPLATE_DEBUG = DEBUG

TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'de'
SITE_ID = 1
USE_L10N = True
USE_TZ = True

SECRET_KEY = 'local'

ROOT_URLCONF = 'tests.urls'

DATABASES = {
    'default': {
        "ENGINE": "django.db.backends.sqlite3",
    }
}

MIDDLEWARE_CLASSES = [
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

STATIC_URL = 'static/'

MEDIA_ROOT = os.path.dirname(os.path.abspath(__file__)) + '/upload'

MEDIA_URL = 'media/'

INSTALLED_APPS = (
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sites",
    "django_tus",
)

PASSWORD_HASHERS = (
    'django.contrib.auth.hashers.MD5PasswordHasher',
)

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

AUTH_PASSWORD_VALIDATORS = []


text:
package com.nhl.link.move.connect;

import java.io.IOException;
import java.io.InputStream;

/**
 * @since 1.4
 */
public interface StreamConnector extends Connector {

	InputStream getInputStream() throws IOException;

}