text:
FROM ubuntu:16.04
MAINTAINER Andrew Codispoti "andrew.codispoti@gmail.com"
RUN apt-get update
RUN apt-get install -y python3 python3-pip vim less grep ruby-dev build-essential
RUN gem install sass
ADD requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
ADD . /var/app

ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8

ENV FLASK_APP /var/app/app.py
ENV FLASK_DEBUG False
WORKDIR /var/app
RUN ["make", "build_css"]

EXPOSE 5000
ENTRYPOINT ["flask", "run", "--host", "0.0.0.0"]


text:
{% extends "base.html" %}
{% load staticfiles %}
{% load analysis_tags %}
{% block content %}

        {% include "analysis/pages/nav-sidebar.html" %}

Options

                        {% load analysis_tags %}

                                    Task ID
                                    {{report.analysis.info.id}}

                                    Mongo ID
                                    {{report.analysis|mongo_id}}

                                    Cuckoo release
                                    {{report.analysis.info.version}}

                                    Delete

                    ©2010-2018 Cuckoo Sandbox

                    Back to Top

{% endblock %}

redpajama_set_name: RedPajamaGithub


text: default_app_config = 'apps.evaluators.MAP.benchmark.apps.MAPBenchmarkConfig'


text:
import ma = require('vsts-task-lib/mock-answer');
import tmrm = require('vsts-task-lib/mock-run');
import path = require('path');

let taskPath = path.join(__dirname, '..', 'xcode.js');
let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);

process.env['HOME'] = '/users/test'; //replace with mock of setVariable when task-lib has the support

tr.setInput('actions', 'build');
tr.setInput('configuration', '$(Configuration)');
tr.setInput('sdk', '$(SDK)');
tr.setInput('xcWorkspacePath', '**/*.xcodeproj');
tr.setInput('scheme', 'testScheme');
tr.setInput('packageApp', 'true');
tr.setInput('xcode8AutomaticSigning', 'true');
tr.setInput('teamId', 'testDevTeamId');
tr.setInput('signMethod', 'file');
tr.setInput('p12', '/user/build/cert.p12');
tr.setInput('p12pwd', 'p12password');
tr.setInput('provProfile', '/user/build/testuuid.mobileprovision');
tr.setInput('removeProfile', 'false');
tr.setInput('unlockDefaultKeychain', 'false');
tr.setInput('defaultKeychainPassword', '');
tr.setInput('iosSigningIdentity', '');
tr.setInput('provProfileUuid', '');
tr.setInput('args', '');
tr.setInput('cwd', '/user/build');
tr.setInput('outputPattern', 'output/$(SDK)/$(Configuration)');
tr.setInput('xcodeDeveloperDir', '');
tr.setInput('useXctool', 'false');
tr.setInput('packageTool', 'xcodebuild');
tr.setInput('xctoolReporter', '');
tr.setInput('publishJUnitResults', 'false');
tr.setInput('archivePath', '/user/build');
tr.setInput('exportPath', '/user/build');
tr.setInput('exportOptions', 'specify');
tr.setInput('exportMethod', 'development');

// provide answers for task mock
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
    "which": {
        "xcodebuild": "/home/bin/xcodebuild",
        "security": "/usr/bin/security",
        "/usr/libexec/PlistBuddy": "/usr/libexec/PlistBuddy",
        "rm": "/bin/rm",
        "cp": "/bin/cp"
    },
    "checkPath": {
        "/home/bin/xcodebuild": true,
        "/usr/bin/security": true,
        "/usr/libexec/PlistBuddy": true,
        "/bin/rm": true,
        "/bin/cp": true
    },
    "filePathSupplied": {
        "archivePath": false
    },
    "getVariable": {
        "HOME": "/users/test"
    },
    "exist": {
        "/user/build/cert.p12": true,
        "/user/build/testuuid.mobileprovision": true,
        "/user/build/_XcodeTaskExport_testScheme": false
    },
    "stats": {
        "/user/build": {
            "isFile": false
        }
    },
    "findMatch": {
        "**/*.xcodeproj": [
            "/user/build/fun.xcodeproj"
        ],
        "**/*.app": [
            "/user/build/output/$(SDK)/$(Configuration)/build.sym/Release.iphoneos/fun.app"
        ],
        "**/*.xcarchive": [
            "/user/build/testScheme.xcarchive"
        ]
    },
    "exec": {
        "/home/bin/xcodebuild -version": {
            "code": 0,
            "stdout": "Xcode 8.0"
        },
        "/home/bin/xcodebuild -sdk $(SDK) -configuration $(Configuration) -project /user/build/fun.xcodeproj -scheme testScheme build DSTROOT=/user/build/output/$(SDK)/$(Configuration)/build.dst OBJROOT=/user/build/output/$(SDK)/$(Configuration)/build.obj SYMROOT=/user/build/output/$(SDK)/$(Configuration)/build.sym SHARED_PRECOMPS_DIR=/user/build/output/$(SDK)/$(Configuration)/build.pch OTHER_CODE_SIGN_FLAGS=--keychain=/user/build/_xcodetasktmp.keychain DEVELOPMENT_TEAM=testDevTeamId": {
            "code": 0,
            "stdout": "xcodebuild output here"
        },
        "/home/bin/xcodebuild -project /user/build/fun.xcodeproj -scheme testScheme archive -sdk $(SDK) -configuration $(Configuration) -archivePath /user/build/testScheme OTHER_CODE_SIGN_FLAGS=--keychain=/user/build/_xcodetasktmp.keychain DEVELOPMENT_TEAM=testDevTeamId": {
            "code": 0,
            "stdout": "xcodebuild archive output here"
        },
        "/home/bin/xcodebuild -exportArchive -archivePath /user/build/testScheme.xcarchive -exportPath /user/build/_XcodeTaskExport_testScheme -exportOptionsPlist _XcodeTaskExportOptions.plist": {
            "code": 0,
            "stdout": "xcodebuild export output here"
        },
        "/usr/libexec/PlistBuddy -c Clear _XcodeTaskExportOptions.plist": {
            "code": 0,
            "stdout": "plist initialized output here"
        },
        "/usr/libexec/PlistBuddy -c Add method string development _XcodeTaskExportOptions.plist": {
            "code": 0,
            "stdout": "plist add output here"
        },
        "/usr/bin/security create-keychain -p _xcodetask_TmpKeychain_Pwd#1 /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "temporary keychain created"
        },
        "/usr/bin/security set-keychain-settings -lut 7200 /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "set-keychain-settings on temporary keychain output"
        },
        "/usr/bin/security unlock-keychain -p _xcodetask_TmpKeychain_Pwd#1 /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "temporary keychain unlocked"
        },
        "/usr/bin/security import /user/build/cert.p12 -P p12password -A -t cert -f pkcs12 -k /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "p12 imported into temporary keychain"
        },
        "/usr/bin/security find-identity -v -p codesigning /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "1) 5229BFC905F473E52FAD51208174528106966930 \"iPhone Developer: XcodeTask Tester (HE432Y3E2Q)\"\n 1 valid identities found"
        },
        "/usr/bin/security cms -D -i /user/build/testuuid.mobileprovision": {
            "code": 0,
            "stdout": "prov profile details here"
        },
        "/usr/libexec/PlistBuddy -c Print UUID _xcodetasktmp.plist": {
            "code": 0,
            "stdout": "testuuid"
        },
        "/bin/rm -f _xcodetasktmp.plist": {
            "code": 0,
            "stdout": "delete output here"
        },
        "/usr/bin/security list-keychain -d user": {
            "code": 0,
            "stdout": "/User/test/Library/Keychains/login.keychain \n /user/build/_xcodetasktmp.keychain"
        },
        "/usr/bin/security list-keychain -d user -s /user/build/_xcodetasktmp.keychain /User/test/Library/Keychains/login.keychain /user/build/_xcodetasktmp.keychain": {
            "code": 0,
            "stdout": "list-keychain output here"
        },
        "/bin/cp -f /user/build/testuuid.mobileprovision /users/test/Library/MobileDevice/Provisioning Profiles/testuuid.mobileprovision": {
            "code": 0,
            "stdout": "provisioning profile copied"
        }
    }
};
tr.setAnswers(a);

tr.run();


text:
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using Skybrud.Social.Json;
using Skybrud.Social.Vimeo.Simple.Objects;
using Skybrud.Social.Vimeo.Simple.Responses;

namespace Skybrud.Social.Vimeo.Simple {

    public class VimeoService {

        #region user channels

        public string GetUserChannelsAsRawXml(string name) {
            return SocialUtils.DoHttpGetRequestAndGetBodyAsString("http://vimeo.com/api/v2/" + name + "/channels.xml");
        }

        public VimeoChannelsResponse GetUserChannels(string name) {
            HttpWebResponse response = SocialUtils.DoHttpGetRequest("http://vimeo.com/api/v2/" + name + "/channels.xml");
            if (response.StatusCode == HttpStatusCode.OK) return VimeoChannelsResponse.Parse(XElement.Parse(response.GetAsString()));
            throw new VimeoException(response.GetAsString());
        }

        #endregion

        #region Channel info

        public string GetChannelInfoAsRawXml(string name) {
            return SocialUtils.DoHttpGetRequestAndGetBodyAsString("http://vimeo.com/api/v2/channel/" + name + "/info.xml");
        }

        public VimeoChannel GetChannelInfo(int id) {
            return GetChannelInfo(id + "");
        }

        public VimeoChannel GetChannelInfo(string name) {
            HttpWebResponse response = SocialUtils.DoHttpGetRequest("http://vimeo.com/api/v2/channel/" + name + "/info.xml");
            if (response.StatusCode == HttpStatusCode.OK) return VimeoChannel.ParseMultiple(XElement.Parse(response.GetAsString())).FirstOrDefault();
            throw new VimeoException(response.GetAsString());
        }

        #endregion

        #region Channel videos

        public string GetChannelVideosAsRawXml(int id, int page) {
            return GetChannelVideosAsRawXml(id + "", page);
        }

        public string GetChannelVideosAsRawXml(string id, int page) {
            NameValueCollection query = new NameValueCollection();
            if (page > 0) query.Set("page", page + "");
            return SocialUtils.DoHttpGetRequestAndGetBodyAsString("http://vimeo.com/api/v2/channel/" + id + "/videos.xml", query);
        }

        public string GetChannelVideosAsRawJson(int id, int page) {
            return GetChannelVideosAsRawJson(id + "", page);
        }

        public string GetChannelVideosAsRawJson(string id, int page) {
            NameValueCollection query = new NameValueCollection();
            if (page > 0) query.Set("page", page + "");
            return SocialUtils.DoHttpGetRequestAndGetBodyAsString("http://vimeo.com/api/v2/channel/" + id + "/videos.json", query);
        }

        ///
        /// Get a list of channel videos.
        ///
        /// <param name="id">The ID of the channel.</param>
        public VimeoChannelVideosResponse GetChannelVideos(int id) {
            return GetChannelVideos(id + "", 0);
        }

        ///
        /// Get a list of channel videos.
        ///
        /// <param name="id">The ID of the channel.</param>
        /// <param name="page">The Simple API only allows to browse pages 1 through 3.</param>
        public VimeoChannelVideosResponse GetChannelVideos(int id, int page) {
            return GetChannelVideos(id + "", page);
        }

        ///
        /// Get a list of channel videos.
        ///
        /// <param name="id">The ID of the channel.</param>
        public VimeoChannelVideosResponse GetChannelVideos(string id) {
            return GetChannelVideos(id, 0);
        }

        ///
        /// Get a list of channel videos.
        ///
        /// <param name="id">The ID of the channel.</param>
        /// <param name="page">The Simple API only allows to browse pages 1 through 3.</param>
        public VimeoChannelVideosResponse GetChannelVideos(string id, int page) {
            NameValueCollection query = new NameValueCollection();
            if (page > 0) query.Set("page", page + "");
            HttpWebResponse response = SocialUtils.DoHttpGetRequest("http://vimeo.com/api/v2/channel/" + id + "/videos.json", query);
            if (response.StatusCode == HttpStatusCode.OK) return VimeoChannelVideosResponse.Parse(JsonConverter.ParseArray(response.GetAsString()));
            string str = response.GetAsString();
            Match match = Regex.Match(str, "
(.+?)
", RegexOptions.Singleline);
            throw new VimeoException(match.Success ? match.Groups[1].Value.Trim() : str);
        }

        #endregion

    }

}


text:
package org.dspace.app.xmlui.aspect.discovery;

import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
import org.dspace.app.util.Util;
import org.dspace.app.xmlui.utils.ContextUtil;
import org.dspace.core.Context;
import org.dspace.workflow.ClaimedTask;
import org.dspace.workflow.WorkflowItem;
import org.dspace.workflow.WorkflowManager;
import org.dspace.workflow.WorkflowRequirementsManager;

import java.util.List;
import java.util.Map;

/**
 * User: kevin (kevin at atmire.com)
 * Date: 15-sep-2011
 * Time: 9:37:23
 */
public class BackToPoolAction extends AbstractAction {

    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
        Request request = ObjectModelHelper.getRequest(objectModel);
        Context context = ContextUtil.obtainContext(objectModel);

        context.turnOffAuthorisationSystem();
        //Retrieve the reason
        WorkflowItem wfItem = WorkflowItem.findByItemId(context, Util.getIntParameter(request, "itemID"));
        String reason = request.getParameter("reason");

        if(wfItem != null){
            //Reject the item
            List<ClaimedTask> claimedTasks = ClaimedTask.findByWorkflowId(context, wfItem.getID());

            //Remove all the claimed tasks
            for (ClaimedTask claimedTask : claimedTasks) {
                WorkflowManager.deleteClaimedTask(context, wfItem, claimedTask);
                WorkflowRequirementsManager.removeClaimedUser(context, wfItem, context.getCurrentUser(), claimedTask.getStepID());
                wfItem.update();
            }
            context.commit();
        }
        context.restoreAuthSystemState();
        return null;
    }
}


text:
namespace OJS.Services.Data.Checkers
{
    using System.Linq;

    using OJS.Data.Models;
    using OJS.Services.Common;

    public interface ICheckersDataService : IService
    {
        Checker GetByName(string name);

        IQueryable<Checker> GetAll();
    }
}


text:
@ECHO OFF

IF NOT EXIST "%DXROOT%Data\Reflection\*.xml" GOTO BuildData

ECHO *
ECHO * %DXROOT%Data\Reflection already exists.
ECHO *
ECHO * With the October 2007 release and on, it is not necessary to create the
ECHO * files unless you install a newer version of the .NET Framework.  If
ECHO * you want to recreate it, you must delete the folder first.
ECHO *
PAUSE
GOTO Done

:BuildData
ECHO *
ECHO * This will build the Sandcastle refelection data prior to first use.
ECHO * This may take up to 30 minutes so please be patient.  Hit any key
ECHO * to start or Ctrl+C to cancel.
ECHO *
ECHO * NOTE: If running this on Vista, you may need to edit the shortcut that
ECHO *       started this script to give it Run as Administrator priviliges.
ECHO *
PAUSE

REM Determine the most recent .NET version installed
SET DNVER=2.0

IF EXIST "%WINDIR%\Microsoft.NET\Framework\v3.0\*.*" SET DNVER=3.0
IF EXIST "%WINDIR%\Microsoft.NET\Framework\v3.5\*.*" SET DNVER=3.5

"%WINDIR%\Microsoft.Net\Framework\v2.0.50727\msbuild" "%DXROOT%Examples\Sandcastle\fxReflection.proj" /Property:NetfxVer=%DNVER% /Property:PresentationStyle=vs2005

REM Clean up by removing some unnecessary stuff
RD /S /Q "%DXROOT%Data\Tmp"

del "%DXROOT%Data\Reflection\AdoNetDiag.xml"
del "%DXROOT%Data\Reflection\alink.xml"
del "%DXROOT%Data\Reflection\aspnet_filter.xml"
del "%DXROOT%Data\Reflection\aspnet_isapi.xml"
del "%DXROOT%Data\Reflection\Aspnet_perf.xml"
del "%DXROOT%Data\Reflection\aspnet_rc.xml"
del "%DXROOT%Data\Reflection\CORPerfMonExt.xml"
del "%DXROOT%Data\Reflection\cscomp.xml"
del "%DXROOT%Data\Reflection\Culture.xml"
del "%DXROOT%Data\Reflection\dfdll.xml"
del "%DXROOT%Data\Reflection\diasymreader.xml"
del "%DXROOT%Data\Reflection\EventLogMessages.xml"
del "%DXROOT%Data\Reflection\fusion.xml"
del "%DXROOT%Data\Reflection\InstallUtilLib.xml"
del "%DXROOT%Data\Reflection\MmcAspExt.xml"
del "%DXROOT%Data\Reflection\mscordacwks.xml"
del "%DXROOT%Data\Reflection\mscordbc.xml"
del "%DXROOT%Data\Reflection\mscordbi.xml"
del "%DXROOT%Data\Reflection\mscorie.xml"
del "%DXROOT%Data\Reflection\mscorjit.xml"
del "%DXROOT%Data\Reflection\mscorld.xml"
del "%DXROOT%Data\Reflection\mscorpe.xml"
del "%DXROOT%Data\Reflection\mscorrc.xml"
del "%DXROOT%Data\Reflection\mscorsec.xml"
del "%DXROOT%Data\Reflection\mscorsn.xml"
del "%DXROOT%Data\Reflection\mscorsvc.xml"
del "%DXROOT%Data\Reflection\mscortim.xml"
del "%DXROOT%Data\Reflection\mscorwks.xml"
del "%DXROOT%Data\Reflection\normalization.xml"
del "%DXROOT%Data\Reflection\PerfCounter.xml"
del "%DXROOT%Data\Reflection\peverify.xml"
del "%DXROOT%Data\Reflection\sbscmp20_mscorlib.xml"
del "%DXROOT%Data\Reflection\shfusion.xml"
del "%DXROOT%Data\Reflection\ShFusRes.xml"
del "%DXROOT%Data\Reflection\SOS.xml"
del "%DXROOT%Data\Reflection\sysglobl.xml"
del "%DXROOT%Data\Reflection\System.EnterpriseServices.Thunk.xml"
del "%DXROOT%Data\Reflection\System.EnterpriseServices.Wrapper.xml"
del "%DXROOT%Data\Reflection\TLBREF.xml"
del "%DXROOT%Data\Reflection\vjsc.xml"
del "%DXROOT%Data\Reflection\vjsnativ.xml"
del "%DXROOT%Data\Reflection\VsaVb7rt.xml"
del "%DXROOT%Data\Reflection\webengine.xml"
del "%DXROOT%Data\Reflection\WMINet_Utils.xml"

del "%DXROOT%Data\Reflection\HtmlLite.xml"
del "%DXROOT%Data\Reflection\NaturalLanguage6.xml"
del "%DXROOT%Data\Reflection\NlsData0009.xml"
del "%DXROOT%Data\Reflection\NlsLexicons0009.xml"
del "%DXROOT%Data\Reflection\PenIMC.xml"
del "%DXROOT%Data\Reflection\PresentationHostDLL.xml"
del "%DXROOT%Data\Reflection\SITSetup.xml"
del "%DXROOT%Data\Reflection\ServiceModelEvents.xml"
del "%DXROOT%Data\Reflection\ServiceMonikerSupport.xml"
del "%DXROOT%Data\Reflection\WapRes.1025.xml"
del "%DXROOT%Data\Reflection\WapRes.1028.xml"
del "%DXROOT%Data\Reflection\WapRes.1029.xml"
del "%DXROOT%Data\Reflection\WapRes.1030.xml"
del "%DXROOT%Data\Reflection\WapRes.1031.xml"
del "%DXROOT%Data\Reflection\WapRes.1032.xml"
del "%DXROOT%Data\Reflection\WapRes.1035.xml"
del "%DXROOT%Data\Reflection\WapRes.1036.xml"
del "%DXROOT%Data\Reflection\WapRes.1037.xml"
del "%DXROOT%Data\Reflection\WapRes.1038.xml"
del "%DXROOT%Data\Reflection\WapRes.1040.xml"
del "%DXROOT%Data\Reflection\WapRes.1041.xml"
del "%DXROOT%Data\Reflection\WapRes.1042.xml"
del "%DXROOT%Data\Reflection\WapRes.1043.xml"
del "%DXROOT%Data\Reflection\WapRes.1044.xml"
del "%DXROOT%Data\Reflection\WapRes.1045.xml"
del "%DXROOT%Data\Reflection\WapRes.1046.xml"
del "%DXROOT%Data\Reflection\WapRes.1049.xml"
del "%DXROOT%Data\Reflection\WapRes.1053.xml"
del "%DXROOT%Data\Reflection\WapRes.1055.xml"
del "%DXROOT%Data\Reflection\WapRes.2052.xml"
del "%DXROOT%Data\Reflection\WapRes.2070.xml"
del "%DXROOT%Data\Reflection\WapRes.3082.xml"
del "%DXROOT%Data\Reflection\WapRes.xml"
del "%DXROOT%Data\Reflection\WapUI.xml"
del "%DXROOT%Data\Reflection\dlmgr.xml"
del "%DXROOT%Data\Reflection\gencomp.xml"
del "%DXROOT%Data\Reflection\install.res.1033.xml"
del "%DXROOT%Data\Reflection\setupres.1025.xml"
del "%DXROOT%Data\Reflection\setupres.1028.xml"
del "%DXROOT%Data\Reflection\setupres.1029.xml"
del "%DXROOT%Data\Reflection\setupres.1030.xml"
del "%DXROOT%Data\Reflection\setupres.1031.xml"
del "%DXROOT%Data\Reflection\setupres.1032.xml"
del "%DXROOT%Data\Reflection\setupres.1035.xml"
del "%DXROOT%Data\Reflection\setupres.1036.xml"
del "%DXROOT%Data\Reflection\setupres.1037.xml"
del "%DXROOT%Data\Reflection\setupres.1038.xml"
del "%DXROOT%Data\Reflection\setupres.1040.xml"
del "%DXROOT%Data\Reflection\setupres.1041.xml"
del "%DXROOT%Data\Reflection\setupres.1042.xml"
del "%DXROOT%Data\Reflection\setupres.1043.xml"
del "%DXROOT%Data\Reflection\setupres.1044.xml"
del "%DXROOT%Data\Reflection\setupres.1045.xml"
del "%DXROOT%Data\Reflection\setupres.1046.xml"
del "%DXROOT%Data\Reflection\setupres.1049.xml"
del "%DXROOT%Data\Reflection\setupres.1053.xml"
del "%DXROOT%Data\Reflection\setupres.1055.xml"
del "%DXROOT%Data\Reflection\setupres.2052.xml"
del "%DXROOT%Data\Reflection\setupres.2070.xml"
del "%DXROOT%Data\Reflection\setupres.3082.xml"
del "%DXROOT%Data\Reflection\setupres.xml"
del "%DXROOT%Data\Reflection\vs70uimgr.xml"
del "%DXROOT%Data\Reflection\vs_setup.xml"
del "%DXROOT%Data\Reflection\vsbasereqs.xml"
del "%DXROOT%Data\Reflection\vsscenario.xml"

ECHO *
ECHO * The reflection data has been built.  Hit any key to exit.
ECHO *
PAUSE

:Done


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Torrey bot. Club 28: 430 (1901)

#### Original name
Tulostoma kansense V.S. White, 1901

### Remarks
null


text:
package org.apache.nifi.integration.util;

import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.framework.security.util.SslContextFactory;
import org.apache.nifi.services.FlowService;
import org.apache.nifi.ui.extension.UiExtensionMapping;
import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.web.util.WebUtils;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.webapp.WebAppContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContext;
import javax.ws.rs.client.Client;
import java.io.File;
import java.util.Collections;

/**
 * Creates an embedded server for testing the NiFi REST API.
 */
public class NiFiTestServer {

    private static final Logger logger = LoggerFactory.getLogger(NiFiTestServer.class);

    private Server jetty;
    private final NiFiProperties properties;
    private WebAppContext webappContext;

    public NiFiTestServer(String webappRoot, String contextPath, NiFiProperties properties) {
        this.properties = properties;

        createWebAppContext(webappRoot, contextPath);
        createServer();
    }

    private WebAppContext createWebAppContext(String webappRoot, String contextPath) {
        webappContext = new WebAppContext();
        webappContext.setContextPath(contextPath);
        webappContext.setWar(webappRoot);
        webappContext.setLogUrlOnStart(true);
        webappContext.setTempDirectory(new File("target/jetty"));
        return webappContext;
    }

    private Server createServer() {
        jetty = new Server(0);

        createSecureConnector();

        jetty.setHandler(webappContext);
        return jetty;
    }

    private void createSecureConnector() {
        org.eclipse.jetty.util.ssl.SslContextFactory contextFactory = new org.eclipse.jetty.util.ssl.SslContextFactory();

        // require client auth when not supporting login or anonymous access
        if (StringUtils.isBlank(properties.getProperty(NiFiProperties.SECURITY_USER_LOGIN_IDENTITY_PROVIDER))) {
            contextFactory.setNeedClientAuth(true);
        } else {
            contextFactory.setWantClientAuth(true);
        }

        /* below code sets JSSE system properties when values are provided */
        // keystore properties
        if (StringUtils.isNotBlank(properties.getProperty(NiFiProperties.SECURITY_KEYSTORE))) {
            contextFactory.setKeyStorePath(properties.getProperty(NiFiProperties.SECURITY_KEYSTORE));
        }
        if (StringUtils.isNotBlank(properties.getProperty(NiFiProperties.SECURITY_KEYSTORE_TYPE))) {
            contextFactory.setKeyStoreType(properties.getProperty(NiFiProperties.SECURITY_KEYSTORE_TYPE));
        }
        final String keystorePassword = properties.getProperty(NiFiProperties.SECURITY_KEYSTORE_PASSWD);
        final String keyPassword = properties.getProperty(NiFiProperties.SECURITY_KEY_PASSWD);
        if (StringUtils.isNotBlank(keystorePassword)) {
            // if no key password was provided, then assume the keystore password is the same as the key password.
            final String defaultKeyPassword = (StringUtils.isBlank(keyPassword)) ? keystorePassword : keyPassword;
            contextFactory.setKeyManagerPassword(keystorePassword);
            contextFactory.setKeyStorePassword(defaultKeyPassword);
        } else if (StringUtils.isNotBlank(keyPassword)) {
            // since no keystore password was provided, there will be no keystore integrity check
            contextFactory.setKeyStorePassword(keyPassword);
        }

        // truststore properties
        if (StringUtils.isNotBlank(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE))) {
            contextFactory.setTrustStorePath(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE));
        }
        if (StringUtils.isNotBlank(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_TYPE))) {
            contextFactory.setTrustStoreType(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_TYPE));
        }
        if (StringUtils.isNotBlank(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_PASSWD))) {
            contextFactory.setTrustStorePassword(properties.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_PASSWD));
        }

        // add some secure config
        final HttpConfiguration httpsConfiguration = new HttpConfiguration();
        httpsConfiguration.setSecureScheme("https");
        httpsConfiguration.setSecurePort(0);
        httpsConfiguration.addCustomizer(new SecureRequestCustomizer());

        // build the connector
        final ServerConnector https = new ServerConnector(jetty,
                new SslConnectionFactory(contextFactory, "http/1.1"),
                new HttpConnectionFactory(httpsConfiguration));

        // set host and port
        https.setPort(0);

        // add the connector
        jetty.addConnector(https);
    }

    public void startServer() throws Exception {
        jetty.start();

        // ensure the ui extensions are set
        webappContext.getServletContext().setAttribute("nifi-ui-extensions", new UiExtensionMapping(Collections.EMPTY_MAP));
    }

    public void loadFlow() throws Exception {
        logger.info("Loading Flow...");

        // start and load the flow
        FlowService flowService = getSpringBean("flowService", FlowService.class);
        flowService.load(null);

        logger.info("Flow loaded successfully.");
    }

    public void shutdownServer() throws Exception {
        jetty.stop();
    }

    public int getPort() {
        if (!jetty.isStarted()) {
            throw new IllegalStateException("Jetty server not started");
        }
        return ((ServerConnector) jetty.getConnectors()[1]).getLocalPort();
    }

    public String getBaseUrl() {
        return "https://localhost:" + getPort();
    }

    public Client getClient() {
        return WebUtils.createClient(null, SslContextFactory.createSslContext(properties));
    }

    /**
     * Convenience method to provide access to Spring beans accessible from the
     * web application context.
     *
     * @param <T> target cast
     * @param beanName name of the spring bean
     * @param clazz class of the spring bean
     * @return Spring bean with given name and class type
     *
     * @throws ClassCastException if the bean found cannot be cast to the given
     * class type
     */
    public <T> T getSpringBean(String beanName, Class<T> clazz) {
        ServletContext servletContext = webappContext.getServletHandler().getServletContext();
        WebApplicationContext webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
        return clazz.cast(webApplicationContext.getBean(beanName));
    }
}


text:
package ccc

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// DataInListInstancesOfUser is a nested struct in ccc response
type DataInListInstancesOfUser struct {
	PageNumber int                  `json:"PageNumber" xml:"PageNumber"`
	PageSize   int                  `json:"PageSize" xml:"PageSize"`
	TotalCount int                  `json:"TotalCount" xml:"TotalCount"`
	List       []CallCenterInstance `json:"List" xml:"List"`
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>#engage</title>
	<meta content="Social Recruiting starts here. Refer a friend for a job to help, make money, earn reputation and for some fun! HashEngage is the social recruiting platform." name="description">
	<meta itemprop="image" content="../assets/google_favicon_128.png">

	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<link href="/assets/css/normalize.css" rel="stylesheet">
	<link href="/assets/css/bootstrap.min.css" rel="stylesheet">
	<link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="/assets/css/style.css" />

		Welcome, {{ user.nickname() }} sign out

Master Password

			      <input  type="password" autocomplete="off" type="text" id="masterPassword" placeholder="Your master password" name="website"/>

				 {% include "keyboard.html" %}

Secure new password

			<form class="form-horizontal" onsubmit="return false;">

			      <input  autocomplete="off" type="text" id="inputWebsite" placeholder="Ref: e.g. http://gmail.com" name="website"/>

			      <input  autocomplete="off" type="password" id="inputPassword" placeholder="****************************" name="password">

			      <button type="submit" class="btn" value="Add" onclick="encrypt_new_password(this)">Encrypt and save!</button>

			</form>

                  #
                  Website
                  Password
                  Decrypt
                  Delete

              	{% for passwd in passwds %}

                	{{ loop.index }}

                		{{ passwd.website|truncate(killwords=True,length=15) }}
                		{{ passwd.website }}

						*******
						{{ passwd.password }}

                	decrypt
                	delete

                {% endfor %}


text:
record Foo(int baz) {
    public Foo { this.baz = baz; }
    public int b<caret>az() { return baz; }
    public int test() { return baz(); }
}


text:
var robot = {

  //MY ROBOT PROPERTIES - WHAT YOUR ROBOT HAS
  colour: 'blue',
  name: 'Engelbert',
  type: '',
  vocabulary: [
    " :Hello master!",
    " :How may I serve you?",
    " :Have a good day",
    " :Salaam fam",
    " :What's cooking good looking?",
    " :Salaam vat my saam",

  ],
  inventory: [],

  //MY ROBOT FUNCTIONS - WHAT YOUR ROBOT CAN DO

  //############### SPEECH RELATED ##############
  // Make robot speak
  speak: function() {

    var index = prompt("Choose a number between 0 and 5");
    if (index <= 5) {

    document.getElementById('caption').innerHTML ='
' + this.name + this.vocabulary[index]+'!
';

    } else {
      document.getElementById('caption').innerHTML ='
' + this.name + " Please choose a number between 0 and 5 "+'!
';
    }
    // Prompt user for input between 0 and 2 and save results in the
    // variable "index"

    // Get the phrase from vocabulary array aulat index position 'words'

    // Display the phrase in #caption

  },

  // Greets user
  greeting: function() {

    document.getElementById('caption').innerHTML ='
' + this.name + ': Hi! My name is ' + this.name +'!
';

  },

  //############### CUSTOMIZE ROBOT ##############
  // Rename your robot
  rename: function(){

    // Get the new name value from #userNameInput input field
    var name = document.getElementById('userNameInput').value;
    this.name=name;
    document.getElementById('caption').innerHTML ='
' + this.name + ': Hi! My name is ' + this.name +'!
';
    // Change the value of the name property of the robot object

    // Display a message to the user to let them know that the
    // name has changed

  },

  // Paints the robot a different colour
  // Accepts the new colour which is the background colour of the div clicked (See index.html)
    paint: function(newColor) {
          var robot = document.getElementById('robot');
          robot.style.backgroundColor= newColor;
    // Change the colour of the robot object

    // Change the colour of the robot element

  },

  //############### TIME RELATED ##############
  // Display time
  time: function() {
    var d = new Date() ;
    var hours = d.getHours();
    var minutes = d.getMinutes();
    var time = document.getElementById('caption').innerHTML ='
' + hours+ ':'+ minutes +'!
';
    // Create a new Date object and store it in a variable named "d"

    // Get hours from d object using getHours() method and
    // store it in a variable named "hours"

    // Get hours from d object using getMinutes() method and
    // store it in a variable named "minutes"
    // BONUS: Use conditional statement to add '0' to minutes less than 10

    // Concatenate "hours" and "minutes" to create a HH:MM format and
    // store in a variable named "time"

    // Display the newly formatted time inside the caption box
  },

  //############### INVENTORY RELATED ##############
  // Display inventory
  listItems: function() {
    var inventoryList = "
"
   for (var i = 0;i< this.inventory.length; i++){
     console.log(this.inventory[i]);
     inventoryList += "
" + this.inventory[i] + "
";
   }
  inventoryList +="
"
    // Use a for loop to log each value in the inventory array to the console

    // Create a variable "inventoryList" and add each item in the array to inventoryList to create a long string
console.log(inventoryList);
document.getElementById('caption').innerHTML = inventoryList ;
    // Display the results inside the caption

    // Now concatenate html tags into the string so that it appears as an unordered list in the browser

  },

  // Add an item to your robot's inventory
  addItem: function() {
    var newItem = document.getElementById('userItemInput').value;
    newItem.toLowerCase();
    this.inventory.push(newItem);
    document.getElementById('caption').innerHTML ='
' + newItem +" has been added to your inventory" +'
';

    // Get value of #userItemInput and store in variable "newItem"
    document.getElementById('userItemInput').value= '';
    // "  " === "  "
    // convert string to lowercase

    // Add item to inventory array using push method

    // Notify user that the item has been added to the inventory by
    // displaying it in the caption

    // Clear input field by emptying the value property

  },

  // Remove an item to your robot's inventory
  removeItem: function(){

    var searchQuery=document.getElementById('userItemInput').value;

    searchQuery.toLowerCase();

    var indexPos = this.inventory.indexOf(searchQuery);

    if (indexPos > -1) {
      this.inventory.splice(indexPos, 1);
      document.getElementById('caption').innerHTML ='
' + searchQuery +" has been removed from your inventory" +'
';
    }
    else
    {
      document.getElementById('caption').innerHTML ='
'+"item not found" +'!
';
    }
    // named "searchQuery"

    // Convert "searchQuery" to lowercase

    // Use indexOf to find the index position of the searchQuery
    // in the inventory array

    // Use a conditional statement to check the searchQuery was found

    // If the item was found:
    // Use the splice method to remove the item from the inventory array using the index position of the item
    // Display message to let user know that the item was removed

    // else if the item was not found
    // Display message to let user know that the item could not be found

    // Clear input field by emptying the value property
  },

  // Search for an item to your robot's inventory
  findItem: function() {
   var searchQuery = document.getElementById('userItemSearch').value;
   searchQuery.toLowerCase();
     var index = this.inventory.indexOf(searchQuery);
     if (index > -1)
     { document.getElementById('caption').innerHTML ='
'+ searchQuery + " was found" +'!
';
     }
     else{ document.getElementById('caption').innerHTML ='
'+ searchQuery + " is not available " +'!
';}

    // Get value of #userItemSearch and save it to a variable
    // named "searchQuery"

    // Convert "searchQuery" to lowercase

    // Use indexOf to find the index position of the searchQuery
    // in the inventory array

    // Use a conditional statement to display a message in the
    // caption based on the index position of the searchQuery

    // Clear input field by emptying the value property

  },

  // ############### MOVEMENT FUNCTIONS #########################
  // Use the paint function as a guide on how to change style properties
  // move robot
  // Accepts the direction that the robot must travel as an argument
  move: function(direction) {
  var robot = document.getElementById('robot');
    // Create variable "robot" and store the element #robot in it
    // Create variable "playground" and store the element #playground in it
  var playground = document.getElementById('playground')
    // Get the position of the robot element relative to its parent
    // (playground) by using the offsetLeft and offsetTop methods
    // Assign the left offset value to the variable named 'x'
    // Assign the top offset value to the variable named 'y'
    // e.g. element.offsetLeft;
var x = robot.offsetLeft
var y =robot.offsetTop
    // Use a switch statement to change the coordinates based on the direction
    // The robot should move 40px in the direction that is clicked

switch(direction){
  case "up":
  robot.style.top = y - 40 +"px";
   break;
  case "down":
  robot.style.top = y + 40 + "px";
   break;
  case "left":
  robot.style.left = x - 40 +"px";
   break;
  case "right":
  robot.style.left = x + 40 +"px";
   break;
  default:
}
    // Use style properties left and top to change the
    // position of the robot element.
    // Don't forget to concatenate "px" to the value

  }
};


text:
NSString * const kGTLRClassroom_Course_CourseState_Active      = @"ACTIVE";
NSString * const kGTLRClassroom_Course_CourseState_Archived    = @"ARCHIVED";
NSString * const kGTLRClassroom_Course_CourseState_CourseStateUnspecified = @"COURSE_STATE_UNSPECIFIED";
NSString * const kGTLRClassroom_Course_CourseState_Declined    = @"DECLINED";
NSString * const kGTLRClassroom_Course_CourseState_Provisioned = @"PROVISIONED";

// GTLRClassroom_CourseWork.state
NSString * const kGTLRClassroom_CourseWork_State_CourseWorkStateUnspecified = @"COURSE_WORK_STATE_UNSPECIFIED";
NSString * const kGTLRClassroom_CourseWork_State_Deleted       = @"DELETED";
NSString * const kGTLRClassroom_CourseWork_State_Draft         = @"DRAFT";
NSString * const kGTLRClassroom_CourseWork_State_Published     = @"PUBLISHED";

// GTLRClassroom_CourseWork.submissionModificationMode
NSString * const kGTLRClassroom_CourseWork_SubmissionModificationMode_Modifiable = @"MODIFIABLE";
NSString * const kGTLRClassroom_CourseWork_SubmissionModificationMode_ModifiableUntilTurnedIn = @"MODIFIABLE_UNTIL_TURNED_IN";
NSString * const kGTLRClassroom_CourseWork_SubmissionModificationMode_SubmissionModificationModeUnspecified = @"SUBMISSION_MODIFICATION_MODE_UNSPECIFIED";

// GTLRClassroom_CourseWork.workType
NSString * const kGTLRClassroom_CourseWork_WorkType_Assignment = @"ASSIGNMENT";
NSString * const kGTLRClassroom_CourseWork_WorkType_CourseWorkTypeUnspecified = @"COURSE_WORK_TYPE_UNSPECIFIED";
NSString * const kGTLRClassroom_CourseWork_WorkType_MultipleChoiceQuestion = @"MULTIPLE_CHOICE_QUESTION";
NSString * const kGTLRClassroom_CourseWork_WorkType_ShortAnswerQuestion = @"SHORT_ANSWER_QUESTION";

// GTLRClassroom_GlobalPermission.permission
NSString * const kGTLRClassroom_GlobalPermission_Permission_CreateCourse = @"CREATE_COURSE";
NSString * const kGTLRClassroom_GlobalPermission_Permission_PermissionUnspecified = @"PERMISSION_UNSPECIFIED";

// GTLRClassroom_GuardianInvitation.state
NSString * const kGTLRClassroom_GuardianInvitation_State_Complete = @"COMPLETE";
NSString * const kGTLRClassroom_GuardianInvitation_State_GuardianInvitationStateUnspecified = @"GUARDIAN_INVITATION_STATE_UNSPECIFIED";
NSString * const kGTLRClassroom_GuardianInvitation_State_Pending = @"PENDING";

// GTLRClassroom_Invitation.role
NSString * const kGTLRClassroom_Invitation_Role_CourseRoleUnspecified = @"COURSE_ROLE_UNSPECIFIED";
NSString * const kGTLRClassroom_Invitation_Role_Student        = @"STUDENT";
NSString * const kGTLRClassroom_Invitation_Role_Teacher        = @"TEACHER";

// GTLRClassroom_SharedDriveFile.shareMode
NSString * const kGTLRClassroom_SharedDriveFile_ShareMode_Edit = @"EDIT";
NSString * const kGTLRClassroom_SharedDriveFile_ShareMode_StudentCopy = @"STUDENT_COPY";
NSString * const kGTLRClassroom_SharedDriveFile_ShareMode_UnknownShareMode = @"UNKNOWN_SHARE_MODE";
NSString * const kGTLRClassroom_SharedDriveFile_ShareMode_View = @"VIEW";

// GTLRClassroom_StudentSubmission.courseWorkType
NSString * const kGTLRClassroom_StudentSubmission_CourseWorkType_Assignment = @"ASSIGNMENT";
NSString * const kGTLRClassroom_StudentSubmission_CourseWorkType_CourseWorkTypeUnspecified = @"COURSE_WORK_TYPE_UNSPECIFIED";
NSString * const kGTLRClassroom_StudentSubmission_CourseWorkType_MultipleChoiceQuestion = @"MULTIPLE_CHOICE_QUESTION";
NSString * const kGTLRClassroom_StudentSubmission_CourseWorkType_ShortAnswerQuestion = @"SHORT_ANSWER_QUESTION";

// GTLRClassroom_StudentSubmission.state
NSString * const kGTLRClassroom_StudentSubmission_State_Created = @"CREATED";
NSString * const kGTLRClassroom_StudentSubmission_State_New    = @"NEW";
NSString * const kGTLRClassroom_StudentSubmission_State_ReclaimedByStudent = @"RECLAIMED_BY_STUDENT";
NSString * const kGTLRClassroom_StudentSubmission_State_Returned = @"RETURNED";
NSString * const kGTLRClassroom_StudentSubmission_State_SubmissionStateUnspecified = @"SUBMISSION_STATE_UNSPECIFIED";
NSString * const kGTLRClassroom_StudentSubmission_State_TurnedIn = @"TURNED_IN";

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Assignment
//

@implementation GTLRClassroom_Assignment
@dynamic studentWorkFolder;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_AssignmentSubmission
//

@implementation GTLRClassroom_AssignmentSubmission
@dynamic attachments;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"attachments" : [GTLRClassroom_Attachment class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Attachment
//

@implementation GTLRClassroom_Attachment
@dynamic driveFile, form, link, youTubeVideo;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Course
//

@implementation GTLRClassroom_Course
@dynamic alternateLink, courseGroupEmail, courseMaterialSets, courseState,
         creationTime, descriptionProperty, descriptionHeading, enrollmentCode,
         guardiansEnabled, identifier, name, ownerId, room, section,
         teacherFolder, teacherGroupEmail, updateTime;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  NSDictionary<NSString *, NSString *> *map = @{
    @"descriptionProperty" : @"description",
    @"identifier" : @"id"
  };
  return map;
}

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"courseMaterialSets" : [GTLRClassroom_CourseMaterialSet class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_CourseAlias
//

@implementation GTLRClassroom_CourseAlias
@dynamic alias;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_CourseMaterial
//

@implementation GTLRClassroom_CourseMaterial
@dynamic driveFile, form, link, youTubeVideo;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_CourseMaterialSet
//

@implementation GTLRClassroom_CourseMaterialSet
@dynamic materials, title;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"materials" : [GTLRClassroom_CourseMaterial class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_CourseWork
//

@implementation GTLRClassroom_CourseWork
@dynamic alternateLink, assignment, associatedWithDeveloper, courseId,
         creationTime, descriptionProperty, dueDate, dueTime, identifier,
         materials, maxPoints, multipleChoiceQuestion, state,
         submissionModificationMode, title, updateTime, workType;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  NSDictionary<NSString *, NSString *> *map = @{
    @"descriptionProperty" : @"description",
    @"identifier" : @"id"
  };
  return map;
}

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"materials" : [GTLRClassroom_Material class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Date
//

@implementation GTLRClassroom_Date
@dynamic day, month, year;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_DriveFile
//

@implementation GTLRClassroom_DriveFile
@dynamic alternateLink, identifier, thumbnailUrl, title;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_DriveFolder
//

@implementation GTLRClassroom_DriveFolder
@dynamic alternateLink, identifier, title;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Empty
//

@implementation GTLRClassroom_Empty
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Form
//

@implementation GTLRClassroom_Form
@dynamic formUrl, responseUrl, thumbnailUrl, title;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_GlobalPermission
//

@implementation GTLRClassroom_GlobalPermission
@dynamic permission;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Guardian
//

@implementation GTLRClassroom_Guardian
@dynamic guardianId, guardianProfile, invitedEmailAddress, studentId;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_GuardianInvitation
//

@implementation GTLRClassroom_GuardianInvitation
@dynamic creationTime, invitationId, invitedEmailAddress, state, studentId;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Invitation
//

@implementation GTLRClassroom_Invitation
@dynamic courseId, identifier, role, userId;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Link
//

@implementation GTLRClassroom_Link
@dynamic thumbnailUrl, title, url;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListCourseAliasesResponse
//

@implementation GTLRClassroom_ListCourseAliasesResponse
@dynamic aliases, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"aliases" : [GTLRClassroom_CourseAlias class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"aliases";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListCoursesResponse
//

@implementation GTLRClassroom_ListCoursesResponse
@dynamic courses, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"courses" : [GTLRClassroom_Course class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"courses";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListCourseWorkResponse
//

@implementation GTLRClassroom_ListCourseWorkResponse
@dynamic courseWork, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"courseWork" : [GTLRClassroom_CourseWork class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"courseWork";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListGuardianInvitationsResponse
//

@implementation GTLRClassroom_ListGuardianInvitationsResponse
@dynamic guardianInvitations, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"guardianInvitations" : [GTLRClassroom_GuardianInvitation class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"guardianInvitations";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListGuardiansResponse
//

@implementation GTLRClassroom_ListGuardiansResponse
@dynamic guardians, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"guardians" : [GTLRClassroom_Guardian class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"guardians";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListInvitationsResponse
//

@implementation GTLRClassroom_ListInvitationsResponse
@dynamic invitations, nextPageToken;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"invitations" : [GTLRClassroom_Invitation class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"invitations";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListStudentsResponse
//

@implementation GTLRClassroom_ListStudentsResponse
@dynamic nextPageToken, students;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"students" : [GTLRClassroom_Student class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"students";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListStudentSubmissionsResponse
//

@implementation GTLRClassroom_ListStudentSubmissionsResponse
@dynamic nextPageToken, studentSubmissions;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"studentSubmissions" : [GTLRClassroom_StudentSubmission class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"studentSubmissions";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ListTeachersResponse
//

@implementation GTLRClassroom_ListTeachersResponse
@dynamic nextPageToken, teachers;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"teachers" : [GTLRClassroom_Teacher class]
  };
  return map;
}

+ (NSString *)collectionItemsKey {
  return @"teachers";
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Material
//

@implementation GTLRClassroom_Material
@dynamic driveFile, form, link, youtubeVideo;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ModifyAttachmentsRequest
//

@implementation GTLRClassroom_ModifyAttachmentsRequest
@dynamic addAttachments;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"addAttachments" : [GTLRClassroom_Attachment class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_MultipleChoiceQuestion
//

@implementation GTLRClassroom_MultipleChoiceQuestion
@dynamic choices;

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"choices" : [NSString class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_MultipleChoiceSubmission
//

@implementation GTLRClassroom_MultipleChoiceSubmission
@dynamic answer;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Name
//

@implementation GTLRClassroom_Name
@dynamic familyName, fullName, givenName;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ReclaimStudentSubmissionRequest
//

@implementation GTLRClassroom_ReclaimStudentSubmissionRequest
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ReturnStudentSubmissionRequest
//

@implementation GTLRClassroom_ReturnStudentSubmissionRequest
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_SharedDriveFile
//

@implementation GTLRClassroom_SharedDriveFile
@dynamic driveFile, shareMode;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_ShortAnswerSubmission
//

@implementation GTLRClassroom_ShortAnswerSubmission
@dynamic answer;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Student
//

@implementation GTLRClassroom_Student
@dynamic courseId, profile, studentWorkFolder, userId;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_StudentSubmission
//

@implementation GTLRClassroom_StudentSubmission
@dynamic alternateLink, assignedGrade, assignmentSubmission,
         associatedWithDeveloper, courseId, courseWorkId, courseWorkType,
         creationTime, draftGrade, identifier, late, multipleChoiceSubmission,
         shortAnswerSubmission, state, updateTime, userId;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_Teacher
//

@implementation GTLRClassroom_Teacher
@dynamic courseId, profile, userId;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_TimeOfDay
//

@implementation GTLRClassroom_TimeOfDay
@dynamic hours, minutes, nanos, seconds;
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_TurnInStudentSubmissionRequest
//

@implementation GTLRClassroom_TurnInStudentSubmissionRequest
@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_UserProfile
//

@implementation GTLRClassroom_UserProfile
@dynamic emailAddress, identifier, name, permissions, photoUrl;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
  NSDictionary<NSString *, Class> *map = @{
    @"permissions" : [GTLRClassroom_GlobalPermission class]
  };
  return map;
}

@end

// ----------------------------------------------------------------------------
//
//   GTLRClassroom_YouTubeVideo
//

@implementation GTLRClassroom_YouTubeVideo
@dynamic alternateLink, identifier, thumbnailUrl, title;

+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
  return @{ @"identifier" : @"id" };
}

@end


text:
package com.google.inject.internal.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/**
 * A high-performance, immutable {@code Set} with reliable, user-specified
 * iteration order. Does not permit null elements.
 *
 *
Unlike {@link Collections#unmodifiableSet}, which is a view of a
 * separate collection that can still change, an instance of this class contains
 * its own private data and will never change. This class is convenient
 * for {@code public static final} sets ("constant sets") and also lets you
 * easily make a "defensive copy" of a set provided to your class by a caller.
 *
 *
Warning: Like most sets, an {@code ImmutableSet} will not function
 * correctly if an element is modified after being placed in the set. For this
 * reason, and to avoid general confusion, it is strongly recommended to place
 * only immutable objects into this collection.
 *
 *
This class has been observed to perform significantly better than {@link
 * HashSet} for objects with very fast {@link Object#hashCode} implementations
 * (as a well-behaved immutable object should). While this class's factory
 * methods create hash-based instances, the {@link ImmutableSortedSet} subclass
 * performs binary searches instead.
 *
 *
Note: Although this class is not final, it cannot be subclassed
 * outside its package as it has no public or protected constructors. Thus,
 * instances of this type are guaranteed to be immutable.
 *
 * @see ImmutableList
 * @see ImmutableMap
 * @author Kevin Bourrillion
 * @author Nick Kralevich
 */
@SuppressWarnings("serial") // we're overriding default serialization
public abstract class ImmutableSet<E> extends ImmutableCollection<E>
    implements Set<E> {
  private static final ImmutableSet<?> EMPTY_IMMUTABLE_SET
      = new EmptyImmutableSet();

  /**
   * Returns the empty immutable set. This set behaves and performs comparably
   * to {@link Collections#emptySet}, and is preferable mainly for consistency
   * and maintainability of your code.
   */
  // Casting to any type is safe because the set will never hold any elements.
  @SuppressWarnings({"unchecked"})
  public static <E> ImmutableSet<E> of() {
    return (ImmutableSet<E>) EMPTY_IMMUTABLE_SET;
  }

  /**
   * Returns an immutable set containing a single element. This set behaves and
   * performs comparably to {@link Collections#singleton}, but will not accept
   * a null element. It is preferable mainly for consistency and
   * maintainability of your code.
   */
  public static <E> ImmutableSet<E> of(E element) {
    return new SingletonImmutableSet<E>(element, element.hashCode());
  }

  /**
   * Returns an immutable set containing the given elements, in order. Repeated
   * occurrences of an element (according to {@link Object#equals}) after the
   * first are ignored (but too many of these may result in the set being
   * sized inappropriately).
   *
   * @throws NullPointerException if any of {@code elements} is null
   */
  public static <E> ImmutableSet<E> of(E... elements) {
    switch (elements.length) {
      case 0:
        return of();
      case 1:
        return of(elements[0]);
      default:
        return create(Arrays.asList(elements), elements.length);
    }
  }

  /**
   * Returns an immutable set containing the given elements, in order. Repeated
   * occurrences of an element (according to {@link Object#equals}) after the
   * first are ignored (but too many of these may result in the set being
   * sized inappropriately). This method iterates over {@code elements} at most
   * once.
   *
   *
Note that if {@code s} is a {@code Set<String>}, then {@code
   * ImmutableSet.copyOf(s)} returns an {@code ImmutableSet<String>} containing
   * each of the strings in {@code s}, while {@code ImmutableSet.of(s)} returns
   * a {@code ImmutableSet<Set<String>>} containing one element (the given set
   * itself).
   *
   *
Note: Despite what the method name suggests, if {@code elements}
   * is an {@code ImmutableSet} (but not an {@code ImmutableSortedSet}), no copy
   * will actually be performed, and the given set itself will be returned.
   *
   * @throws NullPointerException if any of {@code elements} is null
   */
  public static <E> ImmutableSet<E> copyOf(Iterable<? extends E> elements) {
    if (elements instanceof ImmutableSet) {
      @SuppressWarnings("unchecked") // all supported methods are covariant
      ImmutableSet<E> set = (ImmutableSet<E>) elements;
      return set;
    }
    return copyOfInternal(Collections2.toCollection(elements));
  }

  /**
   * Returns an immutable set containing the given elements, in order. Repeated
   * occurrences of an element (according to {@link Object#equals}) after the
   * first are ignored.
   *
   * @throws NullPointerException if any of {@code elements} is null
   */
  public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) {
    Collection<E> list = Lists.newArrayList(elements);
    return copyOfInternal(list);
  }

  private static <E> ImmutableSet<E> copyOfInternal(
      Collection<? extends E> collection) {
    // TODO: Support concurrent collections that change while this method is
    // running.
    switch (collection.size()) {
      case 0:
        return of();
      case 1:
        // TODO: Remove "ImmutableSet.<E>" when eclipse bug is fixed.
        return ImmutableSet.<E>of(collection.iterator().next());
      default:
        return create(collection, collection.size());
    }
  }

  ImmutableSet() {}

  /** Returns {@code true} if the {@code hashCode()} method runs quickly. */
  boolean isHashCodeFast() {
    return false;
  }

  @Override public boolean equals(@Nullable Object object) {
    if (object == this) {
      return true;
    }
    if (object instanceof ImmutableSet
        && isHashCodeFast()
        && ((ImmutableSet<?>) object).isHashCodeFast()
        && hashCode() != object.hashCode()) {
      return false;
    }
    return Collections2.setEquals(this, object);
  }

  @Override public int hashCode() {
    int hashCode = 0;
    for (Object o : this) {
      hashCode += o.hashCode();
    }
    return hashCode;
  }

  // This declaration is needed to make Set.iterator() and
  // ImmutableCollection.iterator() consistent.
  @Override public abstract UnmodifiableIterator<E> iterator();

  @Override public String toString() {
    if (isEmpty()) {
      return "[]";
    }
    Iterator<E> iterator = iterator();
    StringBuilder result = new StringBuilder(size() * 16);
    result.append('[').append(iterator.next().toString());
    for (int i = 1; i < size(); i++) {
      result.append(", ").append(iterator.next().toString());
    }
    return result.append(']').toString();
  }

  private static final class EmptyImmutableSet extends ImmutableSet<Object> {
    public int size() {
      return 0;
    }

    @Override public boolean isEmpty() {
      return true;
    }

    @Override public boolean contains(Object target) {
      return false;
    }

    @Override public UnmodifiableIterator<Object> iterator() {
      return Iterators.emptyIterator();
    }

    private static final Object[] EMPTY_ARRAY = new Object[0];

    @Override public Object[] toArray() {
      return EMPTY_ARRAY;
    }

    @Override public <T> T[] toArray(T[] a) {
      if (a.length > 0) {
        a[0] = null;
      }
      return a;
    }

    @Override public boolean containsAll(Collection<?> targets) {
      return targets.isEmpty();
    }

    @Override public boolean equals(@Nullable Object object) {
      if (object instanceof Set) {
        Set<?> that = (Set<?>) object;
        return that.isEmpty();
      }
      return false;
    }

    @Override public final int hashCode() {
      return 0;
    }

    @Override boolean isHashCodeFast() {
      return true;
    }

    @Override public String toString() {
      return "[]";
    }
  }

  private static final class SingletonImmutableSet<E> extends ImmutableSet<E> {
    final E element;
    final int hashCode;

    SingletonImmutableSet(E element, int hashCode) {
      this.element = element;
      this.hashCode = hashCode;
    }

    public int size() {
      return 1;
    }

    @Override public boolean isEmpty() {
      return false;
    }

    @Override public boolean contains(Object target) {
      return element.equals(target);
    }

    @Override public UnmodifiableIterator<E> iterator() {
      return Iterators.singletonIterator(element);
    }

    @Override public Object[] toArray() {
      return new Object[] { element };
    }

    @SuppressWarnings({"unchecked"})
    @Override public <T> T[] toArray(T[] array) {
      if (array.length == 0) {
        array = ObjectArrays.newArray(array, 1);
      } else if (array.length > 1) {
        array[1] = null;
      }
      array[0] = (T) element;
      return array;
    }

    @Override public boolean equals(@Nullable Object object) {
      if (object == this) {
        return true;
      }
      if (object instanceof Set) {
        Set<?> that = (Set<?>) object;
        return that.size() == 1 && element.equals(that.iterator().next());
      }
      return false;
    }

    @Override public final int hashCode() {
      return hashCode;
    }

    @Override boolean isHashCodeFast() {
      return true;
    }

    @Override public String toString() {
      String elementToString = element.toString();
      return new StringBuilder(elementToString.length() + 2)
          .append('[')
          .append(elementToString)
          .append(']')
          .toString();
    }
  }

  private static <E> ImmutableSet<E> create(
      Iterable<? extends E> iterable, int count) {
    // count is always the (nonzero) number of elements in the iterable
    int tableSize = Hashing.chooseTableSize(count);
    Object[] table = new Object[tableSize];
    int mask = tableSize - 1;

    List<E> elements = new ArrayList<E>(count);
    int hashCode = 0;

    for (E element : iterable) {
      int hash = element.hashCode();
      for (int i = Hashing.smear(hash); true; i++) {
        int index = i & mask;
        Object value = table[index];
        if (value == null) {
          // Came to an empty bucket. Put the element here.
          table[index] = element;
          elements.add(element);
          hashCode += hash;
          break;
        } else if (value.equals(element)) {
          break; // Found a duplicate. Nothing to do.
        }
      }
    }

    // The iterable might have contained only duplicates of the same element.
    return (elements.size() == 1)
        ? new SingletonImmutableSet<E>(elements.get(0), hashCode)
        : new RegularImmutableSet<E>(elements.toArray(), hashCode, table, mask);
  }

  abstract static class ArrayImmutableSet<E> extends ImmutableSet<E> {
    final Object[] elements; // the elements (two or more) in the desired order

    ArrayImmutableSet(Object[] elements) {
      this.elements = elements;
    }

    public int size() {
      return elements.length;
    }

    @Override public boolean isEmpty() {
      return false;
    }

    /*
     * The cast is safe because the only way to create an instance is via the
     * create() method above, which only permits elements of type E.
     */
    @SuppressWarnings("unchecked")
    @Override public UnmodifiableIterator<E> iterator() {
      return (UnmodifiableIterator<E>) Iterators.forArray(elements);
    }

    @Override public Object[] toArray() {
      Object[] array = new Object[size()];
      System.arraycopy(elements, 0, array, 0, size());
      return array;
    }

    @Override public <T> T[] toArray(T[] array) {
      int size = size();
      if (array.length < size) {
        array = ObjectArrays.newArray(array, size);
      } else if (array.length > size) {
        array[size] = null;
      }
      System.arraycopy(elements, 0, array, 0, size);
      return array;
    }

    @Override public boolean containsAll(Collection<?> targets) {
      if (targets == this) {
        return true;
      }
      if (!(targets instanceof ArrayImmutableSet)) {
        return super.containsAll(targets);
      }
      if (targets.size() > size()) {
        return false;
      }
      for (Object target : ((ArrayImmutableSet<?>) targets).elements) {
        if (!contains(target)) {
          return false;
        }
      }
      return true;
    }
  }

  private static final class RegularImmutableSet<E>
      extends ArrayImmutableSet<E> {
    final Object[] table; // the same elements in hashed positions (plus nulls)
    final int mask; // 'and' with an int to get a valid table index
    final int hashCode;

    RegularImmutableSet(Object[] elements, int hashCode,
        Object[] table, int mask) {
      super(elements);
      this.table = table;
      this.mask = mask;
      this.hashCode = hashCode;
    }

    @Override public boolean contains(Object target) {
      if (target == null) {
        return false;
      }
      for (int i = Hashing.smear(target.hashCode()); true; i++) {
        Object candidate = table[i & mask];
        if (candidate == null) {
          return false;
        }
        if (candidate.equals(target)) {
          return true;
        }
      }
    }

    @Override public int hashCode() {
      return hashCode;
    }

    @Override boolean isHashCodeFast() {
      return true;
    }
  }

  /** such as ImmutableMap.keySet() */
  abstract static class TransformedImmutableSet<D, E> extends ImmutableSet<E> {
    final D[] source;
    final int hashCode;

    TransformedImmutableSet(D[] source, int hashCode) {
      this.source = source;
      this.hashCode = hashCode;
    }

    abstract E transform(D element);

    public int size() {
      return source.length;
    }

    @Override public boolean isEmpty() {
      return false;
    }

    @Override public UnmodifiableIterator<E> iterator() {
      Iterator<E> iterator = new AbstractIterator<E>() {
        int index = 0;
        @Override protected E computeNext() {
          return index < source.length
              ? transform(source[index++])
              : endOfData();
        }
      };
      // Though the AbstractIterator is unmodifiable, it isn't an
      // UnmodifiableIterator.
      return Iterators.unmodifiableIterator(iterator);
    }

    @Override public Object[] toArray() {
      return toArray(new Object[size()]);
    }

    @SuppressWarnings("unchecked")
    @Override public <T> T[] toArray(T[] array) {
      int size = size();
      if (array.length < size) {
        array = ObjectArrays.newArray(array, size);
      } else if (array.length > size) {
        array[size] = null;
      }

      for (int i = 0; i < source.length; i++) {
        array[i] = (T) transform(source[i]);
      }
      return array;
    }

    @Override public final int hashCode() {
      return hashCode;
    }

    @Override boolean isHashCodeFast() {
      return true;
    }
  }

  /*
   * This class is used to serialize all ImmutableSet instances, regardless of
   * implementation type. It captures their "logical contents" and they are
   * reconstructed using public static factories. This is necessary to ensure
   * that the existence of a particular implementation type is an implementation
   * detail.
   */
  private static class SerializedForm implements Serializable {
    final Object[] elements;
    SerializedForm(Object[] elements) {
      this.elements = elements;
    }
    Object readResolve() {
      return of(elements);
    }
    private static final long serialVersionUID = 0;
  }

  @Override Object writeReplace() {
    return new SerializedForm(toArray());
  }

  /**
   * Returns a new builder. The generated builder is equivalent to the builder
   * created by the {@link Builder} constructor.
   */
  public static <E> Builder<E> builder() {
    return new Builder<E>();
  }

  /**
   * A builder for creating immutable set instances, especially
   * {@code public static final} sets ("constant sets").
   *
   *
Example:
   *
{@code
   *   public static final ImmutableSet<Color> GOOGLE_COLORS
   *       = new ImmutableSet.Builder<Color>()
   *           .addAll(WEBSAFE_COLORS)
   *           .add(new Color(0, 191, 255))
   *           .build();}

   *
   *
Builder instances can be reused - it is safe to call {@link #build}
   * multiple times to build multiple sets in series. Each set
   * is a superset of the set created before it.
   */
  public static class Builder<E> {
    final ArrayList<E> contents = Lists.newArrayList();

    /**
     * Creates a new builder. The returned builder is equivalent to the builder
     * generated by {@link ImmutableSet#builder}.
     */
    public Builder() {}

    /**
     * Adds {@code element} to the {@code ImmutableSet}.  If the
     * {@code ImmutableSet} already contains {@code element}, then
     * {@code add} has no effect. (only the previously added element
     * is retained).
     *
     * @param element the element to add
     * @return this {@code Builder} object
     * @throws NullPointerException if {@code element} is null
     */
    public Builder<E> add(E element) {
      Preconditions.checkNotNull(element, "element cannot be null");
      contents.add(element);
      return this;
    }

    /**
     * Adds each element of {@code elements} to the {@code ImmutableSet},
     * ignoring duplicate elements (only the first duplicate element is added).
     *
     * @param elements the elements to add
     * @return this {@code Builder} object
     * @throws NullPointerException if {@code elements} is or contains null
     */
    public Builder<E> add(E... elements) {
      Preconditions.checkNotNull(elements, "elements cannot be null");
      List<E> elemsAsList = Arrays.asList(elements);
      Preconditions.checkContentsNotNull(elemsAsList,
          "elements cannot contain null");
      contents.addAll(elemsAsList);
      return this;
    }

    /**
     * Adds each element of {@code elements} to the {@code ImmutableSet},
     * ignoring duplicate elements (only the first duplicate element is added).
     *
     * @param elements the {@code Iterable} to add to the {@code ImmutableSet}
     * @return this {@code Builder} object
     * @throws NullPointerException if {@code elements} is or contains null
     */
    public Builder<E> addAll(Iterable<? extends E> elements) {
      if (elements instanceof Collection) {
        @SuppressWarnings("unchecked")
        Collection<? extends E> collection = (Collection<? extends E>) elements;
        contents.ensureCapacity(contents.size() + collection.size());
      }
      for (E elem : elements) {
        Preconditions.checkNotNull(elem, "elements contains a null");
        contents.add(elem);
      }
      return this;
    }

    /**
     * Adds each element of {@code elements} to the {@code ImmutableSet},
     * ignoring duplicate elements (only the first duplicate element is added).
     *
     * @param elements the elements to add to the {@code ImmutableSet}
     * @return this {@code Builder} object
     * @throws NullPointerException if {@code elements} is or contains null
     */
    public Builder<E> addAll(Iterator<? extends E> elements) {
      while (elements.hasNext()) {
        E element = elements.next();
        Preconditions.checkNotNull(element, "element cannot be null");
        contents.add(element);
      }
      return this;
    }

    /**
     * Returns a newly-created {@code ImmutableSet} based on the contents of
     * the {@code Builder}.
     */
    public ImmutableSet<E> build() {
      return copyOf(contents);
    }
  }
}


text:
package org.dashbuilder.renderer.chartjs;

import java.util.List;
import java.util.Set;

import org.dashbuilder.dataset.DataColumn;
import org.dashbuilder.dataset.group.Interval;
import org.dashbuilder.displayer.ColumnSettings;
import org.dashbuilder.displayer.client.AbstractDisplayer;

public abstract class ChartJsDisplayer<V extends ChartJsDisplayer.View> extends AbstractDisplayer<V> {

    public interface View<P extends ChartJsDisplayer> extends AbstractDisplayer.View<P> {

        void setWidth(int width);

        void setHeight(int height);

        void setMarginTop(int marginTop);

        void setMarginBottom(int marginBottom);

        void setMarginRight(int marginRight);

        void setMarginLeft(int marginLeft);

        void dataClear();

        void dataAddLabel(String label);

        void dataAddSerie(String columnName, String color, double[] values);

        String getGroupsTitle();

        String getColumnsTitle();

        void setTitle(String title);

        void setFilterEnabled(boolean enabled);

        void clearFilterStatus();

        void addFilterValue(String value);

        void addFilterReset();

        void nodata();

        void drawChart();
    }

    public static final String[] COLOR_ARRAY = new String[] {
            "blue",
            "red",
            "orange",
            "brown",
            "coral",
            "aqua",
            "fuchsia",
            "gold",
            "green",
            "grey",
            "lime",
            "magenta",
            "pink",
            "silver",
            "yellow"};

    @Override
    protected void createVisualization() {
        if (displayerSettings.isTitleVisible()) {
            getView().setTitle(displayerSettings.getTitle());
        }
        getView().setFilterEnabled(displayerSettings.isFilterEnabled());
        getView().setWidth(displayerSettings.getChartWidth());
        getView().setHeight(displayerSettings.getChartHeight());
        getView().setMarginTop(displayerSettings.getChartMarginTop());
        getView().setMarginBottom(displayerSettings.getChartMarginBottom());
        getView().setMarginLeft(displayerSettings.getChartMarginLeft());
        getView().setMarginRight(displayerSettings.getChartMarginRight());

        drawChart();
    }

    @Override
    protected void updateVisualization() {
        updateFilterStatus();
        drawChart();
    }

    protected void drawChart() {
        if (dataSet.getRowCount() == 0) {
            getView().nodata();
        } else {
            pushDataToView();
            getView().drawChart();
        }
    }

    protected void updateFilterStatus() {
        getView().clearFilterStatus();
        Set<String> columnFilters = filterColumns();
        if (displayerSettings.isFilterEnabled() && !columnFilters.isEmpty()) {

            for (String columnId : columnFilters) {
                List<Interval> selectedValues = filterIntervals(columnId);
                DataColumn column = dataSet.getColumnById(columnId);
                for (Interval interval : selectedValues) {
                    String formattedValue = formatInterval(interval, column);
                    getView().addFilterValue(formattedValue);
                }
            }
            getView().addFilterReset();
        }
    }

    // View notifications

    void onFilterResetClicked() {
        filterReset();

        // Update the displayer view in order to reflect the current selection
        // (only if not has already been redrawn in the previous filterUpdate() call)
        if (!displayerSettings.isFilterSelfApplyEnabled()) {
            updateVisualization();
        }
    }

    // Data generation

    protected void pushDataToView() {

        getView().dataClear();

        for (int i=0; i<dataSet.getRowCount(); i++) {
            String label = super.formatValue(i, 0);
            getView().dataAddLabel(label);
        }

        List<DataColumn> columns = dataSet.getColumns();
        for (int i=1; i<columns.size(); i++) {
            DataColumn seriesColumn = columns.get(0);
            ColumnSettings columnSettings = displayerSettings.getColumnSettings(seriesColumn);
            String columnName = columnSettings.getColumnName();
            String color = COLOR_ARRAY[i - 1];

            double[] values = new double[dataSet.getRowCount()];
            for (int j=0; j<dataSet.getRowCount(); j++) {
                values[j] = ((Number) dataSet.getValueAt(j, i)).doubleValue();
            }

            getView().dataAddSerie(columnName, color, values);
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Frequently Asked Questions</title>

    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
    <meta name="Date-Revision-yyyymmdd" content="20130501" />
    <meta http-equiv="Content-Language" content="en" />

        Last Published: 2013-05-01
                   | Version: 5.0.4
                          |                           SourceForge
        >
                          PMD
        >
    Frequently Asked Questions

                    SourceForge.net Project Page
            |
                        Hosted by SourceForge

Overview

                          Download PMD 5.0.4

                          What's new in PMD 5.0.4

                          PMD in the news

                          PMD-related products and books

                          Best practices

                          Future directions

                          Similar projects

                          Credits

                          License

                          What does 'PMD' mean?

Usage

                          Installation

                          Command line usage

                          Ant task usage

                          Maven plugin usage

                          Mvn plugin usage

                          IDE plugin usage

                          Suppressing warnings

                          Finding duplicated code

                          JSP support

Customizing PMD

                          Compiling PMD

                          How to write a rule

                          Writing XPath rules

                          How to make a rule set

                          How it works

                          Rule guidelines

                          PMD developers information

                          PMD Release Process

For example

                          Run PMD on a Sourceforge project

Misc.

                          XPath tutorial (Gregorian)

Rule Sets

                          ecmascript

                          Basic Ecmascript

                          Braces

                          Unnecessary

                          java

                          Android

                          Basic

                          Braces

                          Clone Implementation

                          Code Size

                          Comments

                          Controversial

                          Coupling

                          Design

                          Empty Code

                          Finalizer

                          Import Statements

                          J2EE

                          JavaBeans

                          JUnit

                          Jakarta Commons Logging

                          Java Logging

                          Migration

                          Naming

                          Optimization

                          Strict Exceptions

                          String and StringBuffer

                          Security Code Guidelines

                          Type Resolution

                          Unnecessary

                          Unused Code

                          jsp

                          Basic JSF

                          Basic JSP

                          xml

                          Basic XML

                          xsl

                          XPath in XSL

Project Documentation

                          Project Information

                          Project Reports

Frequently Asked Questions

Development

        In which order are nodes visited?

        Is there a simple way of getting fields from a given class?

Rules

        How useful are the rules?

Development

        In which order are nodes visited?

The parser performs a depth-first traversal.
        Consider the given source:

public class Foo {
String name;
    private class Bar {
    String x;
    }
int total;
}

The visiting order here will be:

Class Foo

Field name

Class Bar

Field x

Field total

Note that the total field of Foo will be visited after visiting the fields in Bar.
        You must take this into account for certain rules.

[top]

        Is there a simple way of getting fields from a given class?

Yes, the symbol table can supply that information.

FIXME add code example

[top]

Rules

        How useful are the rules?

Have this clear: having a projects with no pmd violations does not mean at all, I repeat,
            It does not mean at all, not at the minimum expected, that the project has any quality.
            For illustrating this I'll tell a little story taken from my work (a sadly real story).
            Some classes had fields that were reported as unused, (unused code ruleset) as developers
            saw this, they wanted to remove the violation, (not fix the code, fix the violation) so
            the action took was to add useless log sentences with something like:
            'unused variable '+unusedVariable. Belive it or not, the code was worse than the original
            and reported less pmd violations.

In a more positive way: use the rules as you see them fix, don't try to remove violations
         per-se try to review the code and see if the particular cases you are using are correct or not.

[top]

              Copyright ©                    2002-2013
                        InfoEther.
            All Rights Reserved.


text:
package com.microsoft.azure;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

/**
 * The Resource model.
 */
public class Resource {
    /**
     * Resource Id.
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /**
     * Resource name.
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /**
     * Resource type.
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /**
     * Resource location.
     */
    @JsonProperty(required = true)
    private String location;

    /**
     * Resource tags.
     */
    private Map<String, String> tags;

    /**
     * Get the id value.
     *
     * @return the id value
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the name value.
     *
     * @return the name value
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the type value.
     *
     * @return the type value
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the location value.
     *
     * @return the location value
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location value.
     *
     * @param location the location value to set
     * @return the resource itself
     */
    public Resource withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags value.
     *
     * @return the tags value
     */
    public Map<String, String> getTags() {
        return this.tags;
    }

    /**
     * Set the tags value.
     *
     * @param tags the tags value to set
     * @return the resource itself
     */
    public Resource withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }
}


text:
Get the cell value of a local raster at the tapped location and display the result in a callout.

![Image of identify raster cell](identify-raster-cell.png)

## Use case

You may want to identify a raster layer to get its exact cell value in the case the approximate value conveyed by its symbology is not sufficient. The information available for the raster cell depends on the type of raster layer being identified. For example, a 3-band satellite or aerial image might provide 8-bit RGB values, whereas a digital elevation model (DEM) would provide floating point z values. By identifying a raster cell of a DEM, you can retrieve the precise elevation of a location.

## How to use the sample

Tap or double tap drag an area of the raster to identify it and see the raster cell attributes information displayed in a callout.

## How it works

1. Create a `DefaultMapViewOnTouchListener` on the `MapView`.
2. On tap or double tap drag:
   * Call `identifyLayerAsync(...)` passing in the raster layer, screen point, tolerance, and maximum number of results per layer.
   * Add a done loading listener for the result of the identify and then get the `GeoElement` from the layer result and get any `RasterCell`s from them.
   * Create a callout at the calculated map point and populate the callout content with text from the `RasterCell` attributes.
   * Show the callout.

## Relevant API

* GeoView.identifyLayerAsync(...)
* IdentifyLayerResult
* RasterCell
* RasterCell.attributes
* RasterLayer
*
## Offline Data

1. Download the data from [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=b5f977c78ec74b3a8857ca86d1d9b318).
2. Open your command prompt and navigate to the folder where you extracted the contents of the data from step 1.
3. Push the data into the scoped storage of the sample app:
`adb push SA_EVI_8Day_03May20/. /Android/data/com.esri.arcgisruntime.sample.identifyrastercell/files`

## About the data

The data shown is an NDVI classification derived from MODIS imagery between 27 Apr 2020 and 4 May 2020. It comes from the [NASA Worldview application](https://worldview.earthdata.nasa.gov/). In a normalized difference vegetation index, or [NDVI](https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index), values range between -1 and +1 with the positive end of the spectrum showing green vegetation.

## Tags

band, cell, cell value, continuous, discrete, identify, pixel, pixel value, raster


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Rhus wellmanii Engl.

### Remarks
null


text:
import React from 'react';
import { shallow, mount, render } from 'enzyme';
import Home from '../src/components/home.js';

describe('The main app', function() {

  xit('should render without throwing an error', function() {
    expect(shallow(<Home />).length).toEqual(1);
  });

});


text:
package com.twosigma.beakerx.autocomplete;

import java.util.List;

public class AutocompleteResult {

  private List<String> matches;
  private int startIndex;

  public AutocompleteResult(List<String> matches, int startIndex) {
    this.matches = matches;
    this.startIndex = startIndex;
  }

  public List<String> getMatches() {
    return matches;
  }

  public int getStartIndex() {
    return startIndex;
  }

}


text:
module Azure::Consumption::Mgmt::V2019_05_01_preview
  module Models
    #
    # Defines values for CategoryType
    #
    module CategoryType
      Cost = "Cost"
      Usage = "Usage"
    end
  end
end


text:
import unittest

from django.test import TestCase

from corehq.apps.commtrack.models import CommtrackConfig
from corehq.apps.commtrack.util import generate_code, make_domain_commtrack, unicode_slug
from corehq.apps.domain.shortcuts import create_domain

class CommtrackUtilsTest(TestCase):

    def test_unicode_slug(self):
        test_cases = (
            ('normal', 'normal'),
            ('unicode', 'unicode'),
            ('    with\n\t  whitespace   ', 'with-whitespace'),
            ('speçial çháracters', 'special-characters'),
            ('हिंदी', 'hindii'),
        )
        for input, output in test_cases:
            self.assertEqual(output, unicode_slug(input))

    def test_make_domain_commtrack(self):
        domain_obj = create_domain("test-make-domain-commtrack")
        make_domain_commtrack(domain_obj)
        self.assertTrue(domain_obj.commtrack_enabled)
        self.assertTrue(domain_obj.locations_enabled)
        config = CommtrackConfig.for_domain(domain_obj.name)
        self.assertEqual(config.to_json(), {
            'domain': 'test-make-domain-commtrack',
            'actions': [{
                'action': 'receipts',
                'subaction': None,
                '_keyword': 'r',
                'caption': 'Received',
            }, {
                'action': 'consumption',
                'subaction': None,
                '_keyword': 'c',
                'caption': 'Consumed',
            }, {
                'action': 'consumption',
                'subaction': 'loss',
                '_keyword': 'l',
                'caption': 'Losses',
            }, {
                'action': 'stockonhand',
                'subaction': None,
                '_keyword': 'soh',
                'caption': 'Stock on hand',
            }, {
                'action': 'stockout',
                'subaction': None,
                '_keyword': 'so',
                'caption': 'Stock-out',
            }],
            'use_auto_emergency_levels': False,
            'sync_consumption_fixtures': False,
            'use_auto_consumption': False,
            'individual_consumption_defaults': False,
            'alert_config': {
                'stock_out_facilities': False,
                'stock_out_commodities': False,
                'stock_out_rates': False,
                'non_report': False,
            },
            'consumption_config': {
                'min_transactions': 2,
                'min_window': 10,
                'optimal_window': None,
                'use_supply_point_type_default_consumption': False,
                'exclude_invalid_periods': False,
            },
            'ota_restore_config': {
                'section_to_consumption_types': {},
                'force_consumption_case_types': [],
                'use_dynamic_product_list': False,
            },
            'stock_levels_config': {
                'emergency_level': 0.5,
                'understock_threshold': 1.5,
                'overstock_threshold': 3,
            }
        })
        config.delete()
        domain_obj.delete()

class GenerateCodeTest(unittest.TestCase):

    def test_no_change_needed(self):
        name = 'turtle'
        existing = []

        self.assertEqual(
            generate_code(name, existing),
            'turtle'
        )

    def test_sluggifies(self):
        name = 'türtłę'
        existing = []

        self.assertEqual(
            generate_code(name, existing),
            'turtle'
        )

    def test_strips_spaces(self):
        name = 'pizza cat'
        existing = []

        self.assertEqual(
            generate_code(name, existing),
            'pizza_cat'
        )

    def test_adds_1(self):
        name = 'turtle'
        existing = ['turtle']

        self.assertEqual(
            generate_code(name, existing),
            'turtle1'
        )

    def test_increments_number(self):
        name = 'taco'
        existing = ['taco', 'taco1', 'taco2', 'taco3']

        self.assertEqual(
            generate_code(name, existing),
            'taco4'
        )

    def test_doesnt_strip_numbers(self):
        name = 'taco1'
        existing = []

        self.assertEqual(
            generate_code(name, existing),
            'taco1'
        )

    def test_doesnt_die_on_only_numbers(self):
        name = '1'
        existing = []

        self.assertEqual(
            generate_code(name, existing),
            '1'
        )

    def test_empty_values(self):
        empty_default = 'no_name'
        self.assertEqual(
            generate_code('', []),
            empty_default,
        )
        self.assertEqual(
            generate_code(None, []),
            empty_default,
        )


text:
import "hint" HLint.Default

ignore "Use infix"


text:
#ifndef mpControlPanelWidget_h
#define mpControlPanelWidget_h

#include "mpQtVTKControllerWin32ExportHeader.h"
#include "ui_mpControlPanelWidget.h"

#include <QWidget>

namespace mp
{

/**
* \class ControlPanelWidget
* \brief Demo widget to combine a standard Qt widget with one of ours.
*
* Intended to demonstrate that a widget should JUST contain widget logic
* and communicate entirely via signals and slots and also that we can
* combine both Qt widgets and our own widgets in the Designer.
*/
class MYPROJECT_QTVTKCONTROLLERWINEXPORT ControlPanelWidget : public QWidget, Ui_ControlPanelWidget
{
  Q_OBJECT

public:

  ControlPanelWidget(QWidget* parent);
  virtual ~ControlPanelWidget();

  void SetIntensityRange(int low, int high);

signals:

  void WindowValuesChanged(int low, int high);
  void DoSomethingPressed();

private slots:

}; // end class

} // end namespace

#endif