text:
using SoftvMVC.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PagedList;
using Softv.Entities;
using Globals;

namespace SoftvMVC.Controllers
{
    /// <summary>
    /// Class                   : SoftvMVC.Controllers.RelEncuestaClientesController.cs
    /// Generated by            : Class Generator (c) 2015
    /// Description             : RelEncuestaClientesController
    /// File                    : RelEncuestaClientesController.cs
    /// Creation date           : 02/05/2016
    /// Creation time           : 06:39 p. m.
    ///</summary>
    public partial class RelEncuestaClientesController : BaseController, IDisposable
    {
        private SoftvService.RelEncuestaClientesClient proxy = null;

        private SoftvService.EncuestaClient proxyEncuesta = null;

        private SoftvService.CLIENTEClient proxyCLIENTE = null;

        public RelEncuestaClientesController()
        {

            proxy = new SoftvService.RelEncuestaClientesClient();

            proxyEncuesta = new SoftvService.EncuestaClient();

            proxyCLIENTE = new SoftvService.CLIENTEClient();

        }

        new public void Dispose()
        {
            if (proxy != null)
            {
                if (proxy.State != System.ServiceModel.CommunicationState.Closed)
                {
                    proxy.Close();
                }
            }

            proxyEncuesta = new SoftvService.EncuestaClient();
            if (proxyEncuesta != null)
            {
                if (proxyEncuesta.State != System.ServiceModel.CommunicationState.Closed)
                {
                    proxyEncuesta.Close();
                }
            }

            proxyCLIENTE = new SoftvService.CLIENTEClient();
            if (proxyCLIENTE != null)
            {
                if (proxyCLIENTE.State != System.ServiceModel.CommunicationState.Closed)
                {
                    proxyCLIENTE.Close();
                }
            }

        }

        public ActionResult Index(int? page, int? pageSize)
        {
            PermisosAcceso("RelEncuestaClientes");
            ViewData["Title"] = "RelEncuestaClientes";
            ViewData["Message"] = "RelEncuestaClientes";
            int pSize = pageSize ?? SoftvMVC.Properties.Settings.Default.pagnum;
            int pageNumber = (page ?? 1);
            SoftvList<RelEncuestaClientesEntity> listResult = proxy.GetRelEncuestaClientesPagedListXml(pageNumber, pSize, SerializeTool.Serialize<RelEncuestaClientesEntity>(new RelEncuestaClientesEntity()));

            List<EncuestaEntity> lstEncuesta = new List<EncuestaEntity>();
            lstEncuesta.Add(new EncuestaEntity() { IdEncuesta = null, TituloEncuesta = "Todos" });
            lstEncuesta.AddRange(proxyEncuesta.GetEncuestaList().OrderBy(x => x.TituloEncuesta.Trim()));

            ViewBag.IdEncuestatxt = new SelectList(lstEncuesta, "IdEncuesta", "TituloEncuesta");

            List<CLIENTEEntity> lstCLIENTE = new List<CLIENTEEntity>();
            lstCLIENTE.Add(new CLIENTEEntity() { CONTRATO = null, NOMBRE = "Todos" });
            lstCLIENTE.AddRange(proxyCLIENTE.GetCLIENTEList().OrderBy(x => x.NOMBRE.Trim()));
            ViewBag.CONTRATOtxt = new SelectList(lstCLIENTE, "Contrato", "CONTRATO");

            CheckNotify();
            ViewBag.CustomScriptsDefault = BuildScriptsDefault("RelEncuestaClientes");
            return View(new StaticPagedList<RelEncuestaClientesEntity>(listResult.ToList(), pageNumber, pSize, listResult.totalCount));
        }

        public ActionResult Details(int id = 0)
        {
            RelEncuestaClientesEntity objRelEncuestaClientes = proxy.GetRelEncuestaClientes(id);
            if (objRelEncuestaClientes == null)
            {
                return HttpNotFound();
            }
            return PartialView(objRelEncuestaClientes);
        }

        public ActionResult Create()
        {
            PermisosAccesoDeniedCreate("RelEncuestaClientes");
            ViewBag.CustomScriptsPageValid = BuildScriptPageValid();

            ViewBag.VBEncuesta = new SelectList(proxyEncuesta.GetEncuestaList().OrderBy(x => x.TituloEncuesta.Trim()).ToList(), "IdEncuesta", "TituloEncuesta");

            ViewBag.VBCLIENTE = new SelectList(proxyCLIENTE.GetCLIENTEList().OrderBy(x => x.NOMBRE.Trim()).ToList(), "CONTRATO", "NOMBRE");

            return View();
        }

        [HttpPost]
        public ActionResult Create(RelEncuestaClientesEntity objRelEncuestaClientes)
        {
            if (ModelState.IsValid)
            {

                objRelEncuestaClientes.BaseRemoteIp = RemoteIp;
                objRelEncuestaClientes.BaseIdUser = LoggedUserName;
                int result = proxy.AddRelEncuestaClientes(objRelEncuestaClientes);
                if (result == -1)
                {

                    ViewBag.VBEncuesta = new SelectList(proxyEncuesta.GetEncuestaList().OrderBy(x => x.TituloEncuesta.Trim()).ToList(), "IdEncuesta", "TituloEncuesta", objRelEncuestaClientes.IdEncuesta);

                    ViewBag.VBCLIENTE = new SelectList(proxyCLIENTE.GetCLIENTEList().OrderBy(x => x.NOMBRE.Trim()).ToList(), "CONTRATO", "NOMBRE", objRelEncuestaClientes.Contrato);

                    AssingMessageScript("El RelEncuestaClientes ya existe en el sistema.", "error", "Error", true);
                    CheckNotify();
                    return View(objRelEncuestaClientes);
                }
                if (result > 0)
                {
                    AssingMessageScript("Se dio de alta el RelEncuestaClientes en el sistema.", "success", "Éxito", true);
                    return RedirectToAction("Index");
                }

            }
            return View(objRelEncuestaClientes);
        }

        public ActionResult Edit(int id = 0)
        {
            PermisosAccesoDeniedEdit("RelEncuestaClientes");
            ViewBag.CustomScriptsPageValid = BuildScriptPageValid();
            RelEncuestaClientesEntity objRelEncuestaClientes = proxy.GetRelEncuestaClientes(id);

            ViewBag.VBEncuesta = new SelectList(proxyEncuesta.GetEncuestaList().OrderBy(x => x.TituloEncuesta.Trim()).ToList(), "IdEncuesta", "TituloEncuesta");

            ViewBag.VBCLIENTE = new SelectList(proxyCLIENTE.GetCLIENTEList().OrderBy(x => x.NOMBRE.Trim()).ToList(), "CONTRATO", "NOMBRE");

            if (objRelEncuestaClientes == null)
            {
                return HttpNotFound();
            }
            return View(objRelEncuestaClientes);
        }

        //
        // POST: /RelEncuestaClientes/Edit/5
        [HttpPost]
        public ActionResult Edit(RelEncuestaClientesEntity objRelEncuestaClientes)
        {
            if (ModelState.IsValid)
            {
                objRelEncuestaClientes.BaseRemoteIp = RemoteIp;
                objRelEncuestaClientes.BaseIdUser = LoggedUserName;
                int result = proxy.UpdateRelEncuestaClientes(objRelEncuestaClientes);
                if (result == -1)
                {
                    RelEncuestaClientesEntity objRelEncuestaClientesOld = proxy.GetRelEncuestaClientes(objRelEncuestaClientes.IdProceso);

                    ViewBag.VBEncuesta = new SelectList(proxyEncuesta.GetEncuestaList().Where(x => x.IdEncuesta == objRelEncuestaClientesOld.IdEncuesta).OrderBy(x => x.TituloEncuesta.Trim()).ToList(), "IdEncuesta", "TituloEncuesta", objRelEncuestaClientes.IdEncuesta);

                    ViewBag.VBCLIENTE = new SelectList(proxyCLIENTE.GetCLIENTEList().Where(x => x.CONTRATO == objRelEncuestaClientesOld.Contrato).OrderBy(x => x.NOMBRE.Trim()).ToList(), "CONTRATO", "NOMBRE", objRelEncuestaClientes.Contrato);

                    AssingMessageScript("El RelEncuestaClientes ya existe en el sistema, .", "error", "Error", true);
                    CheckNotify();
                    return View(objRelEncuestaClientes);
                }
                if (result > 0)
                {
                    AssingMessageScript("El RelEncuestaClientes se modifico en el sistema.", "success", "Éxito", true);
                    CheckNotify();
                    return RedirectToAction("Index");
                }
                return RedirectToAction("Index");
            }
            return View(objRelEncuestaClientes);
        }

        public ActionResult QuickIndex(int? page, int? pageSize, DateTime? FechaApli, int? IdEncuesta, int? Contrato)
        {
            int pageNumber = (page ?? 1);
            int pSize = pageSize ?? SoftvMVC.Properties.Settings.Default.pagnum;
            SoftvList<RelEncuestaClientesEntity> listResult = null;
            List<RelEncuestaClientesEntity> listRelEncuestaClientes = new List<RelEncuestaClientesEntity>();
            RelEncuestaClientesEntity objRelEncuestaClientes = new RelEncuestaClientesEntity();
            RelEncuestaClientesEntity objGetRelEncuestaClientes = new RelEncuestaClientesEntity();

            if ((FechaApli != null))
            {
                objRelEncuestaClientes.FechaApli = FechaApli;
            }

            if ((IdEncuesta != null))
            {
                objRelEncuestaClientes.IdEncuesta = IdEncuesta;
            }

            if ((Contrato != null))
            {
                objRelEncuestaClientes.Contrato = Contrato;
            }

            pageNumber = pageNumber == 0 ? 1 : pageNumber;
            listResult = proxy.GetRelEncuestaClientesPagedListXml(pageNumber, pSize, Globals.SerializeTool.Serialize(objRelEncuestaClientes));
            if (listResult.Count == 0)
            {
                int tempPageNumber = (int)(listResult.totalCount / pSize);
                pageNumber = (int)(listResult.totalCount / pSize) == 0 ? 1 : tempPageNumber;
                listResult = proxy.GetRelEncuestaClientesPagedListXml(pageNumber, pSize, Globals.SerializeTool.Serialize(objRelEncuestaClientes));
            }
            listResult.ToList().ForEach(x => listRelEncuestaClientes.Add(x));

            var RelEncuestaClientesAsIPagedList = new StaticPagedList<RelEncuestaClientesEntity>(listRelEncuestaClientes, pageNumber, pSize, listResult.totalCount);
            if (RelEncuestaClientesAsIPagedList.Count > 0)
            {
                return PartialView(RelEncuestaClientesAsIPagedList);
            }
            else
            {
                var result = new { tipomsj = "warning", titulomsj = "Aviso", Success = "False", Message = "No se encontraron registros con los criterios de búsqueda ingresados." };
                return Json(result, JsonRequestBehavior.AllowGet);
            }
        }

        //public ActionResult Delete(int id = 0)
        //{
        //    int result = proxy.DeleteRelEncuestaClientes(RemoteIp, LoggedUserName, id);
        //    if (result > 0)
        //    {
        //        var resultOk = new { tipomsj = "success", titulomsj = "Aviso", Success = "True", Message = "Registro de RelEncuestaClientes Eliminado." };
        //        return Json(resultOk, JsonRequestBehavior.AllowGet);
        //    }
        //    else
        //    {
        //        var resultNg = new { tipomsj = "warning", titulomsj = "Aviso", Success = "False", Message = "El Registro de RelEncuestaClientes No puede ser Eliminado validar dependencias." };
        //        return Json(resultNg, JsonRequestBehavior.AllowGet);
        //    }
        //}

        public JsonResult Delete(int id)
        {
            proxy.DeleteRelEncuestaClientes(id);

            String mensaje = "{mensaje:'Se ha eliminado la Encuesta'}";
            return Json(mensaje, JsonRequestBehavior.AllowGet);
        }

    }

}


text:
atsumi
======

A static site generator for Nate Eagle. Atsumi is the term in japanese go for [thickness](http://senseis.xmp.net/?Thickness), or a strong position without weaknesses. Thickness is something that's hard to appreciate when you're starting out - where's the value? How does this get me territory? But it becomes more and more important to your game, the stronger you get.

Static sites are thick: they don't rely on a database, so they're portable, easy on your web server, and easy to integrate into other build processes.

There are a million billion static site generators on the web because people figured out how useful they are and how easy they are to write. I'm writing my own because I'd rather create one than bother to use someone else's. I suggest you do the same. It's fun.

redpajama_set_name: RedPajamaGithub


text: Online event coidng system with machine learning algorithms applied.


text:
from django.conf.urls import patterns, include, url
from django.contrib import admin

from .core.urls import urlpatterns as core_urls
from .userprofile.urls import urlpatterns as userprofile_urls
from .playlist.urls import urlpatterns as playlist_urls
from .song.urls import urlpatterns as song_urls
from .search.urls import urlpatterns as search_urls

urlpatterns = patterns('',
    url(r'^', include(core_urls, namespace='core')),
    url(r'^user/', include(userprofile_urls, namespace='userprofile')),
    url(r'^user/(?P<user_id>\d+)/playlist/', include(playlist_urls, namespace='playlist')),
    url(r'^user/(?P<user_id>\d+)/playlist/(?P<playlist_id>\d+)/song/', include(song_urls, namespace='song')),
    url(r'^search/', include(search_urls, namespace='search')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^accounts/', include('allauth.urls')),
)


text:
package dk.lessismore.nojpa.resources;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * This class represents the resources in a property file. The class can be
 * configured through the property file called <tt>resources.properties</tt>.
 * In this file you can configurate how often the resources should be loaded.
 * This is done through the variable <tt>reloadPeriod</tt>; which is measured in
 * minutes. If you do not want the resources to be reloaded; you
 * can specify this in the constructor. When it reloads the old resources
 * will be replaced with new ones from the property file. In this way you
 * can change the properties at runtime !
 * <br>NB: Remember that the property which this class should represent should be
 * in the classpath before execution of the program !
 *
 * @author LESS-IS-MORE
 * @version 1.0 25-7-02
 */
public class PropertyResources extends Resources {

    private static final Logger log = LoggerFactory.getLogger(PropertyResources.class);
    /**
     * The property file.
     */
    private Properties _properties = null;

    /**
     * The file name of the property file.
     */
    private String _propertyFileName = "";

    /**
     * Indicates wether the property file should be reloaded at each hit.
     */
    private boolean _reloadOnEachHit = false;

    /**
     * Should we reload the properties.
     */
    private boolean _reload = false;

    /**
     * The reload period in miliseconds.
     */
    private long _reloadPeriod = 10000*60*1000;

    /**
     * The time of the last reload.
     */
    private long _timeOfLastReload = 0;

    /**
     * The location of the configuration file of this class.
     */
    private String _resourceConfigurationFile = "/resources.properties";

    /**
     * @param reload If the resources should be reloaded.
     * @param propertyFileName The name of the property file. You do not
     * have to end the name with <tt>.properties</tt>.
     */
    public PropertyResources(String propertyFileName, boolean reload) {
        this(propertyFileName);
        _reload = reload;
    }

	public Map getMap(){

		Map propertyMap = new HashMap();
		Enumeration es = _properties.propertyNames();
		Object tmpObject = null;

		while(es.hasMoreElements()){
			tmpObject = es.nextElement();
			propertyMap.put(tmpObject, _properties.get(tmpObject));
		}
		return propertyMap;
	}

    /**
     * @param propertyFileName The name of the property file. You do not
     * have to end the name with <tt>.properties</tt>.
     */
    public PropertyResources(String propertyFileName) {
        if(!propertyFileName.startsWith("/"))
            propertyFileName = "/"+propertyFileName;
        if(!propertyFileName.endsWith(".properties"))
            propertyFileName += ".properties";
        _propertyFileName = propertyFileName;
        reloadPropertyFile();
    }
    public void setReloadAtEachHit(boolean reloadOnEachHit) {
        _reloadOnEachHit = reloadOnEachHit;
    }
    /**
     * This method will reload the property file which the resources depend on. The reload
     * will only happen if reload is set to true. The reloadPeriod will allso
     * be reloaded as well so you can change this at runtime.
     */
    private synchronized void reloadPropertyFile() {
        Properties properties = loadPropertyFile(_propertyFileName);
        if(properties != null)
            _properties = properties;
        _timeOfLastReload = System.currentTimeMillis();
        if(isReloadable()) {
            Properties resourceConfiguration = loadPropertyFile(_resourceConfigurationFile);
            try {
                _reloadPeriod = Integer.parseInt(resourceConfiguration.getProperty("reloadPeriod"))*1000*60;
            } catch (Exception e) {
	        }
        }
    }

    /**
     * This method will try to load the property file. If this is not possible null
     * will be returned.
     */
    private Properties loadPropertyFile(String name) {
        System.out.println("Loading filename = " + name);
        URL propertyURL = Resources.class.getResource(name);
        if(propertyURL != null) {
            Properties properties = new Properties();
            try{
                log.debug("Loading : " + propertyURL);
                InputStream fi = propertyURL.openStream();
                properties.load(new InputStreamReader(fi, "UTF-8"));
		        fi.close();
                return properties;
            }catch(Exception e) {
		        log.error("some error when loadPropertyFile " + e);
	        }
        } else {
            System.out.println("ERROR: Cant file filename = '"+ name +"' ... ");
        }
        return null;
    }

    public static InputStream streamFileFromClassPath(String filename){
        System.out.println("streamFileFromClassPath filename = " + filename);
        return PropertyResources.class.getClassLoader().getResourceAsStream(filename);
    }

    public static void main(String[] args) {
        String filename = "db";
        System.out.println("PropertyResources.class.getClassLoader().getResourceAsStream(filename) = " + PropertyResources.class.getClassLoader().getResourceAsStream(filename));
        System.out.println("PropertyResources.class.getClassLoader().getResourceAsStream(filename) = " + (new PropertyResources("asda", false)).getClass().getClassLoader().getResourceAsStream(filename));
    }

    private boolean isReloadable() {
        return _reload;
    }
    /**
     * Have we passed the time when we should reload the propertyfile.
     */
    private boolean passedReloadTime() {
        long elapsedTime = (System.currentTimeMillis() - _timeOfLastReload);
        return elapsedTime >= _reloadPeriod;

    }

    /**
     * This method will check to see if we have passed the time to reload;
     * and if so reload the property file.
     */
    private synchronized void checkForReload() {
        if(_reloadOnEachHit)
            reloadPropertyFile();
        else if(isReloadable()) {
            if(passedReloadTime())
                reloadPropertyFile();
        }
    }

    public String getResource(String key) {
        checkForReload();
        if(_properties != null)
            return _properties.getProperty(key);
        else
            return null;
    }
    public boolean gotResources() {
        return _properties != null;
    }
    public Enumeration getResourceNames() {
        checkForReload();
        if(_properties != null)
            return _properties.propertyNames();
        else
            return null;
    }
    public boolean canGetParameterNameList() {
        return true;
    }

    public synchronized boolean setString(String key, String value) {
        if(_properties != null) {
            try {
                _properties.setProperty(key, value);
                URL propertyURL = Resources.class.getResource(this._propertyFileName);
		        FileOutputStream fo = new FileOutputStream(propertyURL.getFile());
                _properties.store(fo, null);
		        fo.flush();
		        fo.close();
                return true;
            }catch(Exception e) {
                e.printStackTrace();
                return false;
            }
        }
        return false;
    }

 public synchronized void remove(String key) {
        if(_properties != null) {
            try {
                _properties.remove(key);
                URL propertyURL = Resources.class.getResource(this._propertyFileName);
                if(propertyURL != null && propertyURL.getFile() != null && (new File(propertyURL.getFile())).exists()){
                    FileOutputStream fo = new FileOutputStream(propertyURL.getFile());
                    _properties.store(fo, null);
                    fo.flush();
                    fo.close();
                } else {
                    log.warn("Cant find property file for: " + this._propertyFileName, new Exception());
                }
            }catch(Exception e) {
                e.printStackTrace();
            }
        }
    }
}


text:
env=$(dirname $0)

for service in discovery router broker networkserver handler
do
  # ttn $service gen-keypair --key-dir "$env/$service"
  ttn $service gen-cert --key-dir "$env/$service" "localhost" "127.0.0.1" "::1"
done


text:
#ifndef __FStar_Kremlin_Endianness_H
#define __FStar_Kremlin_Endianness_H

#include "FStar_BitVector.h"
#include <inttypes.h>
#include "kremlib.h"
#include "kremlin/internal/compat.h"
#include "kremlin/internal/target.h"
typedef struct Prims_list__uint8_t_s Prims_list__uint8_t;

typedef struct Prims_list__uint8_t_s
{
  Prims_list__bool_tags tag;
  uint8_t hd;
  Prims_list__uint8_t *tl;
}
Prims_list__uint8_t;

typedef Prims_list__uint8_t *FStar_Seq_Base_seq__uint8_t;

KRML_DEPRECATED("FStar.Endianness.le_to_n")

extern Prims_int FStar_Kremlin_Endianness_le_to_n(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.be_to_n")

extern Prims_int FStar_Kremlin_Endianness_be_to_n(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.n_to_le")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_n_to_le(uint32_t len, Prims_int n);

KRML_DEPRECATED("FStar.Endianness.n_to_be")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_n_to_be(uint32_t len, Prims_int n);

KRML_DEPRECATED("FStar.Endianness.uint32_of_le")

extern uint32_t FStar_Kremlin_Endianness_uint32_of_le(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.le_of_uint32")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_le_of_uint32(uint32_t x);

KRML_DEPRECATED("FStar.Endianness.uint32_of_be")

extern uint32_t FStar_Kremlin_Endianness_uint32_of_be(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.be_of_uint32")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_be_of_uint32(uint32_t x);

KRML_DEPRECATED("FStar.Endianness.uint64_of_le")

extern uint64_t FStar_Kremlin_Endianness_uint64_of_le(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.le_of_uint64")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_le_of_uint64(uint64_t x);

KRML_DEPRECATED("FStar.Endianness.uint64_of_be")

extern uint64_t FStar_Kremlin_Endianness_uint64_of_be(Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.be_of_uint64")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_be_of_uint64(uint64_t x);

typedef struct Prims_list__uint32_t_s Prims_list__uint32_t;

typedef struct Prims_list__uint32_t_s
{
  Prims_list__bool_tags tag;
  uint32_t hd;
  Prims_list__uint32_t *tl;
}
Prims_list__uint32_t;

typedef Prims_list__uint32_t *FStar_Seq_Base_seq__uint32_t;

KRML_DEPRECATED("FStar.Endianness.seq_uint32_of_le")

extern Prims_list__uint32_t
*FStar_Kremlin_Endianness_seq_uint32_of_le(Prims_int l, Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.le_of_seq_uint32")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_le_of_seq_uint32(Prims_list__uint32_t *s);

KRML_DEPRECATED("FStar.Endianness.seq_uint32_of_be")

extern Prims_list__uint32_t
*FStar_Kremlin_Endianness_seq_uint32_of_be(Prims_int l, Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.be_of_seq_uint32")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_be_of_seq_uint32(Prims_list__uint32_t *s);

typedef struct Prims_list__uint64_t_s Prims_list__uint64_t;

typedef struct Prims_list__uint64_t_s
{
  Prims_list__bool_tags tag;
  uint64_t hd;
  Prims_list__uint64_t *tl;
}
Prims_list__uint64_t;

typedef Prims_list__uint64_t *FStar_Seq_Base_seq__uint64_t;

KRML_DEPRECATED("FStar.Endianness.seq_uint64_of_le")

extern Prims_list__uint64_t
*FStar_Kremlin_Endianness_seq_uint64_of_le(Prims_int l, Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.le_of_seq_uint64")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_le_of_seq_uint64(Prims_list__uint64_t *s);

KRML_DEPRECATED("FStar.Endianness.seq_uint64_of_be")

extern Prims_list__uint64_t
*FStar_Kremlin_Endianness_seq_uint64_of_be(Prims_int l, Prims_list__uint8_t *b);

KRML_DEPRECATED("FStar.Endianness.be_of_seq_uint64")

extern Prims_list__uint8_t *FStar_Kremlin_Endianness_be_of_seq_uint64(Prims_list__uint64_t *s);

#define __FStar_Kremlin_Endianness_H_DEFINED
#endif


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.component.chain.model;

import com.yahoo.component.AbstractComponent;
import com.yahoo.component.ComponentId;

/**
 * For using non-component model classes with ComponentRegistry.
 *
 * @author Tony Vaagenes
 */
public final class ComponentAdaptor<T> extends AbstractComponent {

    public final T model;

    @SuppressWarnings("deprecation")
    public ComponentAdaptor(ComponentId globalComponentId, T model) {
        super(globalComponentId);
        this.model = model;
    }

    public static <T> ComponentAdaptor<T> create(ComponentId globalComponentId, T model) {
        return new ComponentAdaptor<>(globalComponentId, model);
    }

    // For testing
    T model() {
        return model;
    }

}


text:
- [Live](https://garnet-viper.hyperdev.space/)

- This is a [Tableau](https://www.tableau.com/) Web Data Connector using the public [BoardGameGeek](https://boardgamegeek.com/) [API](https://boardgamegeek.com/wiki/page/BGG_XML_API2).
Given a BoardGameGeek username this WDC will pull all the play data for that user and all of the games for each play.

Intended to be hosted on [HyperDev](https://hyperdev.com/about/)


text:
package com.squareup.javapoet;

import com.google.testing.compile.CompilationRule;
import java.lang.annotation.Annotation;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.lang.model.element.TypeElement;
import org.junit.Rule;
import org.junit.Test;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;

public final class AnnotationSpecTest {

  @Retention(RetentionPolicy.RUNTIME)
  public @interface AnnotationA {
  }

  @Inherited
  @Retention(RetentionPolicy.RUNTIME)
  public @interface AnnotationB {
  }

  @Retention(RetentionPolicy.RUNTIME)
  public @interface AnnotationC {
    String value();
  }

  public enum Breakfast {
    WAFFLES, PANCAKES;
    public String toString() { return name() + " with cherries!"; };
  }

  @Retention(RetentionPolicy.RUNTIME)
  public @interface HasDefaultsAnnotation {

    byte a() default 5;

    short b() default 6;

    int c() default 7;

    long d() default 8;

    float e() default 9.0f;

    double f() default 10.0;

    char[] g() default {0, 0xCAFE, 'z', '€', 'ℕ', '"', '\'', '\t', '\n'};

    boolean h() default true;

    Breakfast i() default Breakfast.WAFFLES;

    AnnotationA j() default @AnnotationA();

    String k() default "maple";

    Class<? extends Annotation> l() default AnnotationB.class;

    int[] m() default {1, 2, 3};

    Breakfast[] n() default {Breakfast.WAFFLES, Breakfast.PANCAKES};

    Breakfast o();

    int p();

    AnnotationC q() default @AnnotationC("foo");

    Class<? extends Number>[] r() default {Byte.class, Short.class, Integer.class, Long.class};

  }

  @HasDefaultsAnnotation(
      o = Breakfast.PANCAKES,
      p = 1701,
      f = 11.1,
      m = {9, 8, 1},
      l = Override.class,
      j = @AnnotationA,
      q = @AnnotationC("bar"),
      r = {Float.class, Double.class})
  public class IsAnnotated {
    // empty
  }

  @Rule public final CompilationRule compilation = new CompilationRule();

  @Test public void equalsAndHashCode() {
    AnnotationSpec a = AnnotationSpec.builder(AnnotationC.class).build();
    AnnotationSpec b = AnnotationSpec.builder(AnnotationC.class).build();
    assertThat(a.equals(b)).isTrue();
    assertThat(a.hashCode()).isEqualTo(b.hashCode());
    a = AnnotationSpec.builder(AnnotationC.class).addMember("value", "$S", "123").build();
    b = AnnotationSpec.builder(AnnotationC.class).addMember("value", "$S", "123").build();
    assertThat(a.equals(b)).isTrue();
    assertThat(a.hashCode()).isEqualTo(b.hashCode());
  }

  @Test public void defaultAnnotation() {
    String name = IsAnnotated.class.getCanonicalName();
    TypeElement element = compilation.getElements().getTypeElement(name);
    AnnotationSpec annotation = AnnotationSpec.get(element.getAnnotationMirrors().get(0));

    TypeSpec taco = TypeSpec.classBuilder("Taco")
        .addAnnotation(annotation)
        .build();
    assertThat(toString(taco)).isEqualTo(""
        + "package com.squareup.tacos;\n"
        + "\n"
        + "import com.squareup.javapoet.AnnotationSpecTest;\n"
        + "import java.lang.Double;\n"
        + "import java.lang.Float;\n"
        + "import java.lang.Override;\n"
        + "\n"
        + "@AnnotationSpecTest.HasDefaultsAnnotation(\n"
        + "    o = AnnotationSpecTest.Breakfast.PANCAKES,\n"
        + "    p = 1701,\n"
        + "    f = 11.1,\n"
        + "    m = {\n"
        + "        9,\n"
        + "        8,\n"
        + "        1\n"
        + "    },\n"
        + "    l = Override.class,\n"
        + "    j = @AnnotationSpecTest.AnnotationA,\n"
        + "    q = @AnnotationSpecTest.AnnotationC(\"bar\"),\n"
        + "    r = {\n"
        + "        Float.class,\n"
        + "        Double.class\n"
        + "    }\n"
        + ")\n"
        + "class Taco {\n"
        + "}\n");
  }

  @Test public void defaultAnnotationWithImport() {
    String name = IsAnnotated.class.getCanonicalName();
    TypeElement element = compilation.getElements().getTypeElement(name);
    AnnotationSpec annotation = AnnotationSpec.get(element.getAnnotationMirrors().get(0));
    TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(IsAnnotated.class.getSimpleName());
    typeBuilder.addAnnotation(annotation);
    JavaFile file = JavaFile.builder("com.squareup.javapoet", typeBuilder.build()).build();
    assertThat(file.toString()).isEqualTo(
        "package com.squareup.javapoet;\n"
            + "\n"
            + "import java.lang.Double;\n"
            + "import java.lang.Float;\n"
            + "import java.lang.Override;\n"
            + "\n"
            + "@AnnotationSpecTest.HasDefaultsAnnotation(\n"
            + "    o = AnnotationSpecTest.Breakfast.PANCAKES,\n"
            + "    p = 1701,\n"
            + "    f = 11.1,\n"
            + "    m = {\n"
            + "        9,\n"
            + "        8,\n"
            + "        1\n"
            + "    },\n"
            + "    l = Override.class,\n"
            + "    j = @AnnotationSpecTest.AnnotationA,\n"
            + "    q = @AnnotationSpecTest.AnnotationC(\"bar\"),\n"
            + "    r = {\n"
            + "        Float.class,\n"
            + "        Double.class\n"
            + "    }\n"
            + ")\n"
            + "class IsAnnotated {\n"
            + "}\n"
    );
  }

  @Test public void emptyArray() {
    AnnotationSpec.Builder builder = AnnotationSpec.builder(HasDefaultsAnnotation.class);
    builder.addMember("n", "$L", "{}");
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation(" + "n = {}" + ")");
    builder.addMember("m", "$L", "{}");
    assertThat(builder.build().toString())
        .isEqualTo(
            "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
                + "n = {}, m = {}"
                + ")");
  }

  @Test public void dynamicArrayOfEnumConstants() {
    AnnotationSpec.Builder builder = AnnotationSpec.builder(HasDefaultsAnnotation.class);
    builder.addMember("n", "$T.$L", Breakfast.class, Breakfast.PANCAKES.name());
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
            + "n = com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ")");

    // builder = AnnotationSpec.builder(HasDefaultsAnnotation.class);
    builder.addMember("n", "$T.$L", Breakfast.class, Breakfast.WAFFLES.name());
    builder.addMember("n", "$T.$L", Breakfast.class, Breakfast.PANCAKES.name());
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
            + "n = {"
            + "com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.WAFFLES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + "})");

    builder = builder.build().toBuilder(); // idempotent
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
            + "n = {"
            + "com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.WAFFLES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + "})");

    builder.addMember("n", "$T.$L", Breakfast.class, Breakfast.WAFFLES.name());
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
            + "n = {"
            + "com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.WAFFLES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ", com.squareup.javapoet.AnnotationSpecTest.Breakfast.WAFFLES"
            + "})");
  }

  @Test public void defaultAnnotationToBuilder() {
    String name = IsAnnotated.class.getCanonicalName();
    TypeElement element = compilation.getElements().getTypeElement(name);
    AnnotationSpec.Builder builder = AnnotationSpec.get(element.getAnnotationMirrors().get(0))
        .toBuilder();
    builder.addMember("m", "$L", 123);
    assertThat(builder.build().toString()).isEqualTo(
        "@com.squareup.javapoet.AnnotationSpecTest.HasDefaultsAnnotation("
            + "o = com.squareup.javapoet.AnnotationSpecTest.Breakfast.PANCAKES"
            + ", p = 1701"
            + ", f = 11.1"
            + ", m = {9, 8, 1, 123}"
            + ", l = java.lang.Override.class"
            + ", j = @com.squareup.javapoet.AnnotationSpecTest.AnnotationA"
            + ", q = @com.squareup.javapoet.AnnotationSpecTest.AnnotationC(\"bar\")"
            + ", r = {java.lang.Float.class, java.lang.Double.class}"
            + ")");
  }

  @Test public void reflectAnnotation() {
    HasDefaultsAnnotation annotation = IsAnnotated.class.getAnnotation(HasDefaultsAnnotation.class);
    AnnotationSpec spec = AnnotationSpec.get(annotation);
    TypeSpec taco = TypeSpec.classBuilder("Taco")
        .addAnnotation(spec)
        .build();
    assertThat(toString(taco)).isEqualTo(""
        + "package com.squareup.tacos;\n"
        + "\n"
        + "import com.squareup.javapoet.AnnotationSpecTest;\n"
        + "import java.lang.Double;\n"
        + "import java.lang.Float;\n"
        + "import java.lang.Override;\n"
        + "\n"
        + "@AnnotationSpecTest.HasDefaultsAnnotation(\n"
        + "    f = 11.1,\n"
        + "    l = Override.class,\n"
        + "    m = {\n"
        + "        9,\n"
        + "        8,\n"
        + "        1\n"
        + "    },\n"
        + "    o = AnnotationSpecTest.Breakfast.PANCAKES,\n"
        + "    p = 1701,\n"
        + "    q = @AnnotationSpecTest.AnnotationC(\"bar\"),\n"
        + "    r = {\n"
        + "        Float.class,\n"
        + "        Double.class\n"
        + "    }\n"
        + ")\n"
        + "class Taco {\n"
        + "}\n");
  }

  @Test public void reflectAnnotationWithDefaults() {
    HasDefaultsAnnotation annotation = IsAnnotated.class.getAnnotation(HasDefaultsAnnotation.class);
    AnnotationSpec spec = AnnotationSpec.get(annotation, true);
    TypeSpec taco = TypeSpec.classBuilder("Taco")
        .addAnnotation(spec)
        .build();
    assertThat(toString(taco)).isEqualTo(""
        + "package com.squareup.tacos;\n"
        + "\n"
        + "import com.squareup.javapoet.AnnotationSpecTest;\n"
        + "import java.lang.Double;\n"
        + "import java.lang.Float;\n"
        + "import java.lang.Override;\n"
        + "\n"
        + "@AnnotationSpecTest.HasDefaultsAnnotation(\n"
        + "    a = 5,\n"
        + "    b = 6,\n"
        + "    c = 7,\n"
        + "    d = 8,\n"
        + "    e = 9.0f,\n"
        + "    f = 11.1,\n"
        + "    g = {\n"
        + "        '\\u0000',\n"
        + "        '쫾',\n"
        + "        'z',\n"
        + "        '€',\n"
        + "        'ℕ',\n"
        + "        '\"',\n"
        + "        '\\'',\n"
        + "        '\\t',\n"
        + "        '\\n'\n"
        + "    },\n"
        + "    h = true,\n"
        + "    i = AnnotationSpecTest.Breakfast.WAFFLES,\n"
        + "    j = @AnnotationSpecTest.AnnotationA,\n"
        + "    k = \"maple\",\n"
        + "    l = Override.class,\n"
        + "    m = {\n"
        + "        9,\n"
        + "        8,\n"
        + "        1\n"
        + "    },\n"
        + "    n = {\n"
        + "        AnnotationSpecTest.Breakfast.WAFFLES,\n"
        + "        AnnotationSpecTest.Breakfast.PANCAKES\n"
        + "    },\n"
        + "    o = AnnotationSpecTest.Breakfast.PANCAKES,\n"
        + "    p = 1701,\n"
        + "    q = @AnnotationSpecTest.AnnotationC(\"bar\"),\n"
        + "    r = {\n"
        + "        Float.class,\n"
        + "        Double.class\n"
        + "    }\n"
        + ")\n"
        + "class Taco {\n"
        + "}\n");
  }

  @Test public void disallowsNullMemberName() {
    AnnotationSpec.Builder builder = AnnotationSpec.builder(HasDefaultsAnnotation.class);
    try {
      AnnotationSpec.Builder $L = builder.addMember(null, "$L", "");
      fail($L.build().toString());
    } catch (NullPointerException e) {
      assertThat(e).hasMessageThat().isEqualTo("name == null");
    }
  }

  @Test public void requiresValidMemberName() {
    AnnotationSpec.Builder builder = AnnotationSpec.builder(HasDefaultsAnnotation.class);
    try {
      AnnotationSpec.Builder $L = builder.addMember("@", "$L", "");
      fail($L.build().toString());
    } catch (IllegalArgumentException e) {
      assertThat(e).hasMessageThat().isEqualTo("not a valid name: @");
    }
  }

  private String toString(TypeSpec typeSpec) {
    return JavaFile.builder("com.squareup.tacos", typeSpec).build().toString();
  }
}


text:
import {
	SEND,
	UPDATE,
	CHECKFORM
} from '../actions/main'

var stateDefault = {
	loadingStatus:false,
	name:"",
	email:"",
	confirmEmail:""
}
function mainReducer(state = stateDefault,action){

	switch (action.type){
		case  `${SEND}_SUCCESS`:
			//硬编码: 处理为当如果是某个邮箱则报错
			if(state.email == "usedemail@airwallex.com"){
				return Object.assign({},state,{message:" hardcoded: server error",loadingStatus:false});
			}
			//mock 硬编码: 处理为成功状态
			return Object.assign({},state,{loadingStatus:false,isOpenForm:false,isOpenSuccess:true,name:"",email:"",confirmEmail:""});

		case  `${SEND}_ERROR`:
			//硬编码: 处理为当如果是某个邮箱则报错
			if(state.email == "usedemail@airwallex.com"){
				return Object.assign({},state,{message:" hardcoded: server error",loadingStatus:false});
			}

			//mock 硬编码: 处理为成功状态
			return Object.assign({},state,{loadingStatus:false,isOpenForm:false,isOpenSuccess:true});

		case  UPDATE:
			return Object.assign({},state,action.data);

		case CHECKFORM:
			//表单验证
			if(state.name.length < 3){
				return Object.assign({},state,{message:"用户名不得少于3个字符"});
			};

			if(!(/^([A-Za-z0-9-_]+)*@([A-Za-z0-9-_]+)\.([A-Za-z]+)$/).test(state.email)){
				return Object.assign({},state,{message:"请输入正确的邮箱地址"});
			}

			if(state.email != state.confirmEmail ){
				return Object.assign({},state,{message:"两次邮箱地址不一致"});
			}

			return Object.assign({},state,{message:"send"});

		default:
			return  Object.assign({},state);
	}
}

export default  mainReducer


text:
#ifndef OSPL_DDS_CORE_DETAIL_MACROS_HPP_
#define OSPL_DDS_CORE_DETAIL_MACROS_HPP_

/**
 * @file
 */

// Implementation

#include <iostream>
#include <string.h>

// == Constants
#define OMG_DDS_DEFAULT_STATE_BIT_COUNT_DETAIL (size_t)16
#define OMG_DDS_DEFAULT_STATUS_COUNT_DETAIL    (size_t)16
// ==========================================================================

#ifdef DOXYGEN_FOR_ISOCPP
/* The above macro is never (and must never) be defined in normal compilation. The
 below macros may be defined individually for the effect described in the documentation */
/** @internal If this macro is defined C++11 features will be assumed to be available and
 * should be used wherever possible in the API
 * @see OSPL_USE_TR1
 * @see OSPL_USE_BOOST */
#define OSPL_USE_CXX11
/** @internal If this macro is defined Technical Report 1 features will be assumed to be available and
 * this macro will direct that they be used in the API
 * @see OSPL_USE_CXX11
 * @see OSPL_USE_BOOST */
#define OSPL_USE_TR1
/** @internal If this macro is defined Boost will be assumed to be available and that its features should be
 * be used throughout the API
 * @see OSPL_USE_CXX11
 * @see OSPL_USE_TR1 */
#define OSPL_USE_BOOST
#endif

// == C++ 11 / Techical Report 1 / Boost availability
/* Determine if C++ 11 compile flag is 'on', or is usually on by default */
#if (defined __GXX_EXPERIMENTAL_CXX0X || \
       __cplusplus >= 201103L || \
       (_MSC_VER >= 1600 && _HAS_CPP0X))
# define OSPL_DEFAULT_TO_CXX11
#endif

#if (_MSC_VER >= 1500) || ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))
# define OSPL_DEFAULT_TO_TR1
#endif

/* Compiling explicitly w/ C++ 11 e.g. -std=cxx0x; Studio 2010; &c... */
#if (defined(OSPL_DEFAULT_TO_CXX11) && !defined (OSPL_USE_BOOST) &&  !defined (OSPL_USE_TR1)) \
        || defined(OSPL_USE_CXX11)
#  ifndef OSPL_USE_CXX11
#    define OSPL_USE_CXX11
#  endif

/* Tech Report 1 headers are known available. Use unless we specifically ask for boost */
#elif (defined (OSPL_DEFAULT_TO_TR1) && !defined (OSPL_USE_BOOST)) \
        || defined(OSPL_USE_TR1)
#  ifndef OSPL_USE_TR1
#    define OSPL_USE_TR1
#  endif

#else /* Not C++11, no TR1, or explicit OSPL_USE_BOOST - use boost */
#  ifndef OSPL_USE_BOOST
#    define OSPL_USE_BOOST
#  endif

#endif

// == Static Assert
#if defined (OSPL_USE_CXX11) /* static_assert keyword supported */
#  define OMG_DDS_STATIC_ASSERT_DETAIL(condition) static_assert(condition, #condition)
#else
#  if defined (OSPL_USE_BOOST)
#    include <boost/static_assert.hpp>
#    define OMG_DDS_STATIC_ASSERT_DETAIL BOOST_STATIC_ASSERT
#  else /* Create a compilation error by creating a negative sized array type when condition not true */
#    define OSPL_MACRO_CONCAT_(a, b) a ## b
#    define OSPL_MACRO_CONCAT(a, b) OSPL_MACRO_CONCAT_(a, b)
#    if (__GNUC__ >= 4) /* Have seen 'attribute unused' on types in gcc 3.1 docs but we're only worried re 4+ anyway... */
#      define OSPL_GCC_ATTRIBUTE_UNUSED __attribute__ ((unused))
/* If the above addition does not silence warnings like:
 * typedef 'OMG_DDS_STATIC_ASSERT_FAILED_nn' locally defined but not used [-Wunused-local-typedefs]
 * then you may wish to consider also/instead uncommenting the below line.
 * @see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54372 and OSPL-3329 */
//#      pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#    else
#      define OSPL_GCC_ATTRIBUTE_UNUSED
#    endif
#    define OMG_DDS_STATIC_ASSERT_DETAIL(condition) typedef int OSPL_MACRO_CONCAT(OMG_DDS_STATIC_ASSERT_FAILED_, __LINE__)[(condition) ? 1 : -1] OSPL_GCC_ATTRIBUTE_UNUSED
#  endif
#endif
// ==========================================================================

// DLL Export Macros
#ifdef BUILD_OMG_DDS_API
#  ifdef _WIN32 // This is defined for 32/64 bit Windows
#    define OMG_DDS_API_DETAIL __declspec(dllexport)
#  else
#    define OMG_DDS_API_DETAIL
#  endif
#else
#  ifdef _WIN32 // This is defined for 32/64 bit Windows
#    define OMG_DDS_API_DETAIL __declspec(dllimport)
#  else
#    define OMG_DDS_API_DETAIL
#  endif
#endif

// ==========================================================================

// Logging Macros
#include <dds/core/detail/maplog.hpp>
#define OMG_DDS_LOG_DETAIL(kind, msg) \
    if (dds::core::detail::maplog(kind) >= os_reportVerbosity) \
        os_report(dds::core::detail::maplog(kind),"isocpp-OMG_DDS_LOG",__FILE__,__LINE__,0,-1,OS_TRUE,"%s",msg)
//  std::cout << "[" << kind << "]: " << msg << std::endl;
// ==========================================================================

/**
 * @internal
 * @bug OSPL-2893 SunCC template compilation issue.
 * Partial specialization to 'hardcode' the delegate required.
 */
#ifdef __SUNPRO_CC
#  define OSPL_2893_COMPILER_BUG
/**
 * @internal
 * @bug OSPL-3323 Old SunCC has poor template support. SunCC 5.9/12.0 is known not to work.
 * SunCC 5.11/12.2 works. For now, let 5.10/12.1 try their luck...
 */
#  if (__SUNPRO_CC < 0x5100)
#    error The ISO C++ API is not supported on Solaris Studio 12.0 or earlier. Please upgrade or export INCLUDE_API_DCPS_ISOCPP=no.
#  endif
#endif

// C++ 11 features
// Slightly pathological - we could (for example) want to use boost traits
// and 'STL' implementations  but compile with -std=c++11, so set a macro for
// C++11 compile being on. This way we can always use language features
#if defined (OSPL_DEFAULT_TO_CXX11) || defined(OSPL_USE_CXX11)
#  define OSPL_DDS_CXX11
#  include <cstring>
#endif

#if !defined(OSPL_DDS_FINAL) && defined (OSPL_DDS_CXX11)
#  if defined (_MSC_VER) && ( _MSC_VER < 1700)
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx
// 'Visual C++ in Visual Studio 2010 ... "final" was ... supported, but
// under the different spelling "sealed". The Standard spelling and
// semantics of "override" and "final" are now completely supported.'
#    define OSPL_DDS_FINAL sealed
#  else
#    define OSPL_DDS_FINAL final
#endif
#else
#  define OSPL_DDS_FINAL
#endif

#if defined(OSPL_DDS_CXX11)
#  if defined (_MSC_VER) && (_MSC_VER <= 1800)
// See: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx
// "These are now supported, but with this exception: For defaulted functions,
// the use of = default to request member-wise move constructors and move
// assignment operators is not supported."
// ('now' is currently VS 2013 - _MSC_VER == 1800).
#    define OSPL_CXX11_NO_FUNCTION_DEFAULTS
#  endif
#endif

// End of implementation

#endif /* OSPL_DDS_CORE_DETAIL_MACROS_HPP_ */


text:
package org.dmfs.httpessentials.executors.authorizing;

import org.dmfs.httpessentials.HttpMethod;
import org.dmfs.httpessentials.HttpStatus;
import org.dmfs.httpessentials.client.HttpRequest;
import org.dmfs.httpessentials.client.HttpRequestEntity;
import org.dmfs.httpessentials.client.HttpRequestExecutor;
import org.dmfs.httpessentials.client.HttpResponse;
import org.dmfs.httpessentials.client.HttpResponseHandler;
import org.dmfs.httpessentials.exceptions.ProtocolError;
import org.dmfs.httpessentials.exceptions.ProtocolException;
import org.dmfs.httpessentials.executors.authorizing.challenges.ResponseChallenges;
import org.dmfs.httpessentials.executors.authorizing.charsequences.SingleCredentials;
import org.dmfs.httpessentials.headers.BasicSingletonHeaderType;
import org.dmfs.httpessentials.headers.HeaderType;
import org.dmfs.httpessentials.headers.Headers;
import org.dmfs.httpessentials.typedentity.EntityConverter;
import org.dmfs.jems.optional.decorators.Mapped;

import java.io.IOException;
import java.net.URI;

import static org.dmfs.jems.optional.elementary.Absent.absent;

/**
 * An authorized {@link HttpRequest}. It takes an {@link AuthState} and adds any {@link Authorization} it returns to the request.
 *
 * @author Marten Gajda
 */
final class Authorized<T> implements HttpRequest<T>
{
    /**
     * HeaderType for the AUTHORIZATION header. Private for now.
     */
    private final static HeaderType<Authorization> AUTHORIZATION = new BasicSingletonHeaderType<>("Authorization", new EntityConverter<Authorization>()
    {
        @Override
        public Authorization value(String valueString)
        {
            throw new UnsupportedOperationException("Parsing Credentials is not supported yet.");
        }

        @Override
        public String valueString(Authorization authorization)
        {
            return new SingleCredentials(authorization).value().toString();
        }
    });

    private final HttpRequestExecutor mExecutor;
    private final AuthState mAuthState;
    private final URI mUri;
    private final HttpRequest<T> mRequest;
    private final AuthStrategyCache mAuthStrategyCache;

    Authorized(HttpRequestExecutor executor, AuthStrategyCache authStrategyCache, URI uri, HttpRequest<T> request, AuthState authState)
    {
        mExecutor = executor;
        mAuthStrategyCache = authStrategyCache;
        mAuthState = authState;
        mUri = uri;
        mRequest = request;
    }

    @Override
    public HttpMethod method()
    {
        return mRequest.method();
    }

    @Override
    public Headers headers()
    {
        final Headers originalHeaders = mRequest.headers();

        // add an Authorization header if we have credentials and there is none yet
        return originalHeaders.contains(AUTHORIZATION)
                ? originalHeaders
                : new Mapped<>(
                authorization -> originalHeaders.withHeader(AUTHORIZATION.entity(authorization)), mAuthState.authorization()).value(originalHeaders);
    }

    @Override
    public HttpRequestEntity requestEntity()
    {
        return mRequest.requestEntity();
    }

    @Override
    public HttpResponseHandler<T> responseHandler(HttpResponse response) throws IOException, ProtocolError, ProtocolException
    {
        if (!mRequest.headers().contains(AUTHORIZATION))
        {
            if (HttpStatus.UNAUTHORIZED.equals(response.status()))
            {

                // authentication failed, return a response handler which authenticates and re-sends the request
                return response1 -> {
                    // start over with the new AuthState
                    return mExecutor.execute(
                            response1.requestUri(),
                            new Authorized<>(mExecutor, mAuthStrategyCache, mUri, mRequest, mAuthState.withChallenges(new ResponseChallenges(response1))));
                };
            }
            // successfully authenticated, update the auth cache
            // TODO: pass any Authentication-Info header value
            mAuthStrategyCache.update(mUri, mAuthState.prematureAuthStrategy(absent()));
        }
        return mRequest.responseHandler(response);
    }
}


text:
<?php

class Khaus_Helper_Head
{

    /**
     * Obtiene la URL base del script
     *
     * Captura la ruta donde se esta ejecutando el script
     * desde la informacion de entorno de servidor
     * luego se le da el formato especifico para ser usada
     * en la etiqueta <base />
     *
     * @return string
     */
    static public function basename()
    {
        $base = $_SERVER['SCRIPT_NAME'];
        $base = dirname($base);
        $base = str_replace('\\', '/', $base);
        $base.= substr($base, -1) != '/' ? '/' : '';
        return $base;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "urn:pubid:dita4publishers.sourceforge.net:doctypes:dita:chapter" "chapter.dtd">
<topic id="d2e4691">
   <title>
      <d4pSimpleEnumerator>Chapter 16. </d4pSimpleEnumerator>
      <ph>Strolling the Plains</ph>
   </title>

         <ph outputclass="size_plus_2">THIS CELL</ph>, properly speaking, was the
Nautilus's arsenal and wardrobe. Hanging from its walls, a
dozen diving outfits were waiting for anybody who wanted to take a
stroll.

After seeing these, Ned Land exhibited an obvious distaste for
the idea of putting one on.

"But my gallant Ned," I told him, "the forests of Crespo Island
are simply underwater forests!"

"Oh great!" put in the disappointed harpooner, watching his
dreams of fresh meat fade away. "And you, Professor Aronnax, are
you going to stick yourself inside these clothes?"

"It has to be, Mr. Ned."

"Have it your way, sir," the harpooner replied, shrugging his
shoulders. "But speaking for myself, I'll never get into those
things unless they force me!"

"No one will force you, Mr. Land," Captain Nemo said.

"And is Conseil going to risk it?" Ned asked.

"Where master goes, I go," Conseil replied.

At the captain's summons, two crewmen came to help us put on
these heavy, waterproof clothes, made from seamless india rubber
and expressly designed to bear considerable pressures. They were
like suits of armor that were both yielding and resistant, you
might say. These clothes consisted of jacket and pants. The pants
ended in bulky footwear adorned with heavy lead soles. The fabric
of the jacket was reinforced with copper mail that shielded the
chest, protected it from the water's pressure, and allowed the
lungs to function freely; the sleeves ended in supple gloves that
didn't impede hand movements.

These perfected diving suits, it was easy to see, were a far cry
from such misshapen costumes as the cork breastplates, leather
jumpers, seagoing tunics, barrel helmets, etc., invented and
acclaimed in the 18th century.

Conseil and I were soon dressed in these diving suits, as were
Captain Nemo and one of his companions—a herculean type who
must have been prodigiously strong. All that remained was to encase
one's head in its metal sphere. But before proceeding with this
operation, I asked the captain for permission to examine the rifles
set aside for us.

One of the Nautilus's men presented me with a streamlined
rifle whose butt was boilerplate steel, hollow inside, and of
fairly large dimensions. This served as a tank for the compressed
air, which a trigger–operated valve could release into the
metal chamber. In a groove where the butt was heaviest, a cartridge
clip held some twenty electric bullets that, by means of a spring,
automatically took their places in the barrel of the rifle. As soon
as one shot had been fired, another was ready to go off.

"Captain Nemo," I said, "this is an ideal,
easy–to–use weapon. I ask only to put it to the test.
But how will we reach the bottom of the sea?"

"Right now, professor, the Nautilus is aground in ten
meters of water, and we've only to depart."

"But how will we set out?"

"You'll see."

Captain Nemo inserted his cranium into its spherical headgear.
Conseil and I did the same, but not without hearing the Canadian
toss us a sarcastic "happy hunting." On top, the suit ended in a
collar of threaded copper onto which the metal helmet was screwed.
Three holes, protected by heavy glass, allowed us to see in any
direction with simply a turn of the head inside the sphere. Placed
on our backs, the Rouquayrol device went into operation as soon as
it was in position, and for my part, I could breathe with ease.

The Ruhmkorff lamp hanging from my belt, my rifle in hand, I was
ready to go forth. But in all honesty, while imprisoned in these
heavy clothes and nailed to the deck by my lead soles, it was
impossible for me to take a single step.

But this circumstance had been foreseen, because I felt myself
propelled into a little room adjoining the wardrobe. Towed in the
same way, my companions went with me. I heard a door with
watertight seals close after us, and we were surrounded by profound
darkness.

After some minutes a sharp hissing reached my ears. I felt a
distinct sensation of cold rising from my feet to my chest.
Apparently a stopcock inside the boat was letting in water from
outside, which overran us and soon filled up the room. Contrived in
the Nautilus's side, a second door then opened. We were lit
by a subdued light. An instant later our feet were treading the
bottom of the sea.

And now, how can I convey the impressions left on me by this
stroll under the waters. Words are powerless to describe such
wonders! When even the painter's brush can't depict the effects
unique to the liquid element, how can the writer's pen hope to
reproduce them?

Captain Nemo walked in front, and his companion followed us a
few steps to the rear. Conseil and I stayed next to each other, as
if daydreaming that through our metal carapaces, a little polite
conversation might still be possible! Already I no longer felt the
bulkiness of my clothes, footwear, and air tank, nor the weight of
the heavy sphere inside which my head was rattling like an almond
in its shell. Once immersed in water, all these objects lost a part
of their weight equal to the weight of the liquid they displaced,
and thanks to this law of physics discovered by Archimedes, I did
just fine. I was no longer an inert mass, and I had, comparatively
speaking, great freedom of movement.

Lighting up the seafloor even thirty feet beneath the surface of
the ocean, the sun astonished me with its power. The solar rays
easily crossed this aqueous mass and dispersed its dark colors. I
could easily distinguish objects 100 meters away. Farther on, the
bottom was tinted with fine shades of ultramarine; then, off in the
distance, it turned blue and faded in the midst of a hazy darkness.
Truly, this water surrounding me was just a kind of air, denser
than the atmosphere on land but almost as transparent. Above me I
could see the calm surface of the ocean.

We were walking on sand that was fine–grained and smooth,
not wrinkled like beach sand, which preserves the impressions left
by the waves. This dazzling carpet was a real mirror, throwing back
the sun's rays with startling intensity. The outcome: an immense
vista of reflections that penetrated every liquid molecule. Will
anyone believe me if I assert that at this thirty–foot depth,
I could see as if it was broad daylight?

For a quarter of an hour, I trod this blazing sand, which was
strewn with tiny crumbs of seashell. Looming like a long reef, the
Nautilus's hull disappeared little by little, but when night
fell in the midst of the waters, the ship's beacon would surely
facilitate our return on board, since its rays carried with perfect
distinctness. This effect is difficult to understand for anyone who
has never seen light beams so sharply defined on shore. There the
dust that saturates the air gives such rays the appearance of a
luminous fog; but above water as well as underwater, shafts of
electric light are transmitted with incomparable clarity.

Meanwhile we went ever onward, and these vast plains of sand
seemed endless. My hands parted liquid curtains that closed again
behind me, and my footprints faded swiftly under the water's
pressure.

Soon, scarcely blurred by their distance from us, the forms of
some objects took shape before my eyes. I recognized the lower
slopes of some magnificent rocks carpeted by the finest zoophyte
specimens, and right off, I was struck by an effect unique to this
medium.

By then it was ten o'clock in the morning. The sun's rays hit
the surface of the waves at a fairly oblique angle, decomposing by
refraction as though passing through a prism; and when this light
came in contact with flowers, rocks, buds, seashells, and polyps,
the edges of these objects were shaded with all seven hues of the
solar spectrum. This riot of rainbow tints was a wonder, a feast
for the eyes: a genuine kaleidoscope of red, green, yellow, orange,
violet, indigo, and blue; in short, the whole palette of a
color–happy painter! If only I had been able to share with
Conseil the intense sensations rising in my brain, competing with
him in exclamations of wonderment! If only I had known, like
Captain Nemo and his companion, how to exchange thoughts by means
of prearranged signals! So, for lack of anything better, I talked
to myself: I declaimed inside this copper box that topped my head,
spending more air on empty words than was perhaps advisable.

Conseil, like me, had stopped before this splendid sight.
Obviously, in the presence of these zoophyte and mollusk specimens,
the fine lad was classifying his head off. Polyps and echinoderms
abounded on the seafloor: various isis coral, cornularian coral
living in isolation, tufts of virginal genus Oculina
formerly known by the name "white coral," prickly fungus coral in
the shape of mushrooms, sea anemone holding on by their muscular
disks, providing a literal flowerbed adorned by jellyfish from the
genus Porpita wearing collars of azure tentacles, and
starfish that spangled the sand, including veinlike feather stars
from the genus Asterophyton that were like fine lace
embroidered by the hands of water nymphs, their festoons swaying to
the faint undulations caused by our walking. It filled me with real
chagrin to crush underfoot the gleaming mollusk samples that
littered the seafloor by the thousands: concentric comb shells,
hammer shells, coquina (seashells that actually hop around),
top–shell snails, red helmet shells, angel–wing conchs,
sea hares, and so many other exhibits from this inexhaustible
ocean. But we had to keep walking, and we went forward while
overhead there scudded schools of Portuguese men–of–war
that let their ultramarine tentacles drift in their wakes, medusas
whose milky white or dainty pink parasols were festooned with azure
tassels and shaded us from the sun's rays, plus jellyfish of the
species Pelagia panopyra that, in the dark, would have
strewn our path with phosphorescent glimmers!

All these wonders I glimpsed in the space of a quarter of a
mile, barely pausing, following Captain Nemo whose gestures kept
beckoning me onward. Soon the nature of the seafloor changed. The
plains of sand were followed by a bed of that viscous slime
Americans call "ooze," which is composed exclusively of seashells
rich in limestone or silica. Then we crossed a prairie of algae,
open–sea plants that the waters hadn't yet torn loose, whose
vegetation grew in wild profusion. Soft to the foot, these densely
textured lawns would have rivaled the most luxuriant carpets woven
by the hand of man. But while this greenery was sprawling under our
steps, it didn't neglect us overhead. The surface of the water was
crisscrossed by a floating arbor of marine plants belonging to that
superabundant algae family that numbers more than 2,000 known
species. I saw long ribbons of fucus drifting above me, some
globular, others tubular: Laurencia, Cladostephus
with the slenderest foliage, Rhodymenia palmata resembling
the fan shapes of cactus. I observed that green–colored
plants kept closer to the surface of the sea, while reds occupied a
medium depth, which left blacks and browns in charge of designing
gardens and flowerbeds in the ocean's lower strata.

These algae are a genuine prodigy of creation, one of the
wonders of world flora. This family produces both the biggest and
smallest vegetables in the world. Because, just as 40,000
near–invisible buds have been counted in one
five–square–millimeter space, so also have fucus plants
been gathered that were over 500 meters long!

We had been gone from the Nautilus for about an hour and
a half. It was almost noon. I spotted this fact in the
perpendicularity of the sun's rays, which were no longer refracted.
The magic of these solar colors disappeared little by little, with
emerald and sapphire shades vanishing from our surroundings
altogether. We walked with steady steps that rang on the seafloor
with astonishing intensity. The tiniest sounds were transmitted
with a speed to which the ear is unaccustomed on shore. In fact,
water is a better conductor of sound than air, and under the waves
noises carry four times as fast.

Just then the seafloor began to slope sharply downward. The
light took on a uniform hue. We reached a depth of 100 meters, by
which point we were undergoing a pressure of ten atmospheres. But
my diving clothes were built along such lines that I never suffered
from this pressure. I felt only a certain tightness in the joints
of my fingers, and even this discomfort soon disappeared. As for
the exhaustion bound to accompany a two–hour stroll in such
unfamiliar trappings—it was nil. Helped by the water, my
movements were executed with startling ease.

Arriving at this 300–foot depth, I still detected the
sun's rays, but just barely. Their intense brilliance had been
followed by a reddish twilight, a midpoint between day and night.
But we could see well enough to find our way, and it still wasn't
necessary to activate the Ruhmkorff device.

Just then Captain Nemo stopped. He waited until I joined him,
then he pointed a finger at some dark masses outlined in the
shadows a short distance away.

"It's the forest of Crespo Island," I thought; and I was not
mistaken.

</topic>


text:
//
//  CategoryViewController.m
//  Velectric
//
//  Created by QQ on 2016/11/26.
//  Copyright © 2016年 LiuXiaoQin. All rights reserved.
//

#import "CategoryViewController.h"
#import "CategoryMeunModel.h"
#import "CommodityModel.h"
#import "MultilevelMenu.h"
#import "CommodityTableViewController.h"
#import "RightMenuTableViewController.h"
#import "FactoryViewController.h"
#import "HSearchView.h"
#import "SearchViewController.h"
#import "VBannerModel.h"
#import "VBaseWebVC.h"

@interface CategoryViewController ()<UITextFieldDelegate,MultilevelMenuDelegate>
{

    NSMutableArray * _list;
    NSMutableArray * firStArray;
    NSMutableArray * TwoStArray;
    NSMutableArray * threeStArray;
    MultilevelMenu * multileView;
    int index;

}
@property (nonatomic, strong)UITextField * searchField;
@property (nonatomic, strong)HSearchView * SV;
@property (nonatomic, strong) UIBarButtonItem * rightBotton;
@property (nonatomic, strong)UIView * searchBar;
@property (nonatomic, assign)int categoryId;
@property (nonatomic, strong)MultilevelMenu * multileView;

//二期
@property (nonatomic, strong) VBannerModel *bannerModel;//banner图片model

@end

@implementation CategoryViewController
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"分类"];
    //请求分类数据
    if (firStArray.count==0) {
        [self initDataCategoryId:@"1"];
    }
    //请求banner图片
    [self requestBannerImage];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    //初始化数据
//    [self initData];
    //初始化分类菜单
    [self initCategoryMenu];
    //设置导航栏
    [self setupNavigationItem];
  //  [self initDataCategoryId:@"1"];
    //初始化数组
    threeStArray = [NSMutableArray array];
    index = 0;
}

- (void)setupNavigationItem {

    UIView * searchBar = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
    self.searchBar = searchBar;
    UIImageView * searchImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"search"]];
    searchImage.frame = CGRectMake(0, 0, 20, 20);
    searchBar.backgroundColor = [UIColor whiteColor];
    searchBar.layer.cornerRadius = 5;
    UITextField * searchField = [[UITextField alloc]initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH-30, 30)];
    self.navigationItem.leftBarButtonItem = self.rightBotton;

    [searchBar addSubview:searchField];
    searchField.leftView = searchImage;
    searchField.leftViewMode=UITextFieldViewModeAlways;
    searchField.delegate = self;
    [searchField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];

    self.searchField = searchField;
    searchField.placeholder = @"搜索V机电商品";
    self.navigationItem.titleView =searchBar;

     HSearchView* SV = [[HSearchView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    SV.nav = self.navigationController;
    self.SV = SV;
    self.SV.hidden = YES;
    self.SV.isSearch =YES;
    [self.view addSubview:self.SV];

    UIButton * rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, SCREEN_WIDTH-40, 50, 30)];
    [rightBtn setBackgroundImage:[UIImage imageNamed:@"logo"] forState:UIControlStateNormal];

    UIBarButtonItem * rightBotton = [[UIBarButtonItem alloc]initWithCustomView:rightBtn];
    self.rightBotton = rightBotton;
    [rightBtn addTarget:self action:@selector(cancleBtn) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = rightBotton;
    self.navigationItem.rightBarButtonItem = nil;

}

#pragma mark - https

//获取banner图片
- (void)requestBannerImage {

    NSDictionary *paramDic = @{
                               @"memberId" : GET_USER_INFO.memberId ? GET_USER_INFO.memberId : @""
                               };

    [VJDProgressHUD showProgressHUD:nil];
    [SYNetworkingManager GetOrPostWithHttpType:2
                                 WithURLString:BannerQueryURL
                                    parameters:paramDic
                                       success:^(NSDictionary *responseObject) {

                                           if ([responseObject[@"code"] isEqualToString:@"RS200"]) {
                                               [VJDProgressHUD showSuccessHUD:nil];
                                               self.bannerModel = [VBannerModel yy_modelWithDictionary:responseObject[@"bannerPO"]];
                                               NSString *imageUrl = [NSString stringWithFormat:@"%@/%@",V_Base_ImageURL,self.bannerModel.picUrl ];
                                               self.multileView.headview.imageView.image = nil;
                                               [self.multileView.headview.imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"categoryPic"]];
                                               self.multileView.picUrl = imageUrl;

                                           }else{
                                               [VJDProgressHUD showTextHUD:responseObject[@"msg"]];
                                           }

                                       } failure:^(NSError *error) {
                                           [VJDProgressHUD showErrorHUD:INTERNET_ERROR];
                                       }];
}

//点击图片跳转
- (void)bannerJumpAction {

    if ([self.bannerModel.jumpPictureUrl isEmpty] || !self.bannerModel.jumpPictureUrl || [self.bannerModel.jumpPictureUrl isEqualToString:@""]) {
        NSLog(@"不跳转");
    }else{
        VBaseWebVC *webVC = [[VBaseWebVC alloc]initWithUrlString:self.bannerModel.jumpPictureUrl];
        [self.navigationController pushViewController:webVC animated:YES];
    }

}

//一级分类
- (void)initDataCategoryId:(NSString *)categoryId{
    firStArray = [NSMutableArray array];
//    [VJDProgressHUD showProgressHUD:nil];
    NSDictionary * parameters = @{@"categoryId":categoryId
                                  };
    [SYNetworkingManager GetOrPostNoBodyWithHttpType:1 WithURLString:GetGetTreeURL parameters:parameters success:^(NSDictionary *respronseObject) {
        ELog(@"成功");
  //      firStArray = respronseObject[@"result"][@"children"];
        NSDictionary * result =respronseObject[@"result"];
        if ([result isKindOfClass:[NSNull class]]) {
            [VJDProgressHUD showTextHUD:INTERNET_ERROR];
            return ;
        }
        NSMutableArray * arr=result[@"children"];
        if (arr.count==0) {
            [VJDProgressHUD showTextHUD:INTERNET_ERROR];
            return ;
        }
        firStArray = arr;
        [self categoryTwoNetworkingCategoryId:firStArray[0][@"id"]];
    } failure:^(NSError *error) {
        ELog(@"失败");
        [VJDProgressHUD showTextHUD:@"网络连接异常,请重试"];
    }];

  }
//二级分类

-(void)categoryTwoNetworkingCategoryId:(NSString *)categoryId
{
    [VJDProgressHUD showProgressHUD:nil];
    NSDictionary * parameters = @{@"categoryId":categoryId};
    [SYNetworkingManager GetOrPostNoBodyWithHttpType:1 WithURLString:GetGetTreeURL parameters:parameters success:^(NSDictionary *responseObject) {
        ELog(@"成功");
        TwoStArray =responseObject[@"result"][@"children"];
        [self categoryThreeNetworkingCategoryId:TwoStArray[0][@"id"]];

    } failure:^(NSError *error) {
        ELog(@"失败");
        [VJDProgressHUD showTextHUD:@"网络连接异常,请重试"];
    }];
}

//三级分类

-(void)categoryThreeNetworkingCategoryId:(NSString *)categoryId
{
    if (index==0) {
        [threeStArray removeAllObjects];
    }
    index++;

    NSDictionary * parameters = @{@"categoryId":categoryId};
    [SYNetworkingManager GetOrPostNoBodyWithHttpType:1 WithURLString:GetGetTreeURL parameters:parameters success:^(NSDictionary *responseObject) {
        ELog(@"成功");
        NSArray * threeDataArr = [NSArray array];
        threeDataArr = responseObject[@"result"][@"children"];
        [threeStArray addObject:threeDataArr];
        if (index<TwoStArray.count) {
            [self categoryThreeNetworkingCategoryId:TwoStArray[index][@"id"]];

        }else{
            [self relodetableView];
            [VJDProgressHUD dismissHUD];
        }

    } failure:^(NSError *error) {
        ELog(@"失败");
        [VJDProgressHUD showTextHUD:@"网络连接异常,请重试"];
    }];
}

-(void)relodetableView
{
//    MultilevelMenu * view = [[MultilevelMenu alloc]init];
    [self.multileView reloadDataFirstData:firStArray TwoData:TwoStArray ThreeData:threeStArray];
}

- (void)initCategoryMenu{

    MultilevelMenu * view = [[MultilevelMenu alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) FirstData:firStArray TwoData:TwoStArray  ThreeData:threeStArray withSelectIndex:^(NSInteger left, NSInteger right, NSString* categoryName) {

        CommodityTableViewController * tableView = [[CommodityTableViewController alloc]init];
        NSArray * arr = [NSArray arrayWithObject:[NSString stringWithFormat:@"%ld",right]];
        tableView.enterType = ScreeningViewEnterType10;
        tableView.categoryIds =arr;
        tableView.saiXuanCategoryId =[arr[0] integerValue];
       // tableView.categoryName=categoryName;
        [self.navigationController pushViewController:tableView animated:YES];
    }];

    //  MultilevelMenu * view=[[MultilevelMenu alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) WithData:_list withSelectIndex:^(NSInteger left, NSInteger right,CategoryMeunModel * info) {
    //   }];
    self.multileView = view;
    view.delegate = self;
    view.leftSelectColor=RGBColor(243, 121, 120);//选中文字颜色
    view.leftSelectBgColor=[UIColor whiteColor];//选中背景颜色
    view.isRecordLastScroll=NO;//是否记住当前位置
    [self.view addSubview:view];
    [self.view addSubview:self.SV];

    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(bannerJumpAction) name:BannerJumpNotification object:nil];

}

#pragma 的代理方法
-(void)BtnPush:(NSDictionary*)dic
{
    CommodityTableViewController * commodity = [[CommodityTableViewController alloc]init];
    commodity.categoryName = dic[@"name"];
    commodity.categoryIds = @[dic[@"id"]];
    commodity.enterType =ScreeningViewEnterType9;
    commodity.saiXuanCategoryId =[dic[@"id"] integerValue];
    [self.navigationController pushViewController:commodity animated:YES];
}

#pragma mark 刷新collectView

-(void)passTrendValues:(NSString *)values{
    [self categoryTwoNetworkingCategoryId:values];
    index = 0;
}

//取消的btn
-(void)cancleBtn
{
    self.SV.hidden = YES;
    [self.navigationController.navigationBar endEditing:YES];
}

#pragma uitextField 的代理
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
   // self.SV.hidden = NO;
    //return YES;
    SearchViewController * search = [[SearchViewController alloc]init];
    [self.navigationController pushViewController:search animated:YES];
    return NO;
}

- (void)textFieldDidChange:(id)sender
{
    UITextField * field = (UITextField *)sender;
    [self.SV reloadTableviewFieldText:field.text];
/*
    if (field.text.length) {
        self.SV.hidden =NO;
        self.SV.isSearch =YES;// no  为二期开发
    }else{
        self.SV.isSearch =YES;
        [self.SV reloadTableviewFieldText:field];

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

- (void)dealloc {
    [[NSNotificationCenter defaultCenter ]removeObserver:self name:BannerJumpNotification object:nil];
}

#pragma mark - getter

@end


text:
This component allows rendering of markdown in misojs.

## installation

In your main misojs application directory:

```
npm install misojs-markdown-component --save
```

## Usage

Acceess the component in your mvc entities like so:

```javascript
var Markdown = require('misojs-markdown-component')();
```

In your controller, you might set a value like so:

```javascript
this.markdownValue = [
	"## Markdown",
	"The mark-up that likes to get down!",
	"* Amazing!",
	"* Awesome!"].join("\n");
```

And in your view:

```javascript
m.component(Markdown, {
	value: ctrl.markdownValue
}),
```

This will render the markdown.

## Controlling the render

By default the misojs markdown component will render both client and server side, however in miso you are able to serve static markdown on the client side, by simply including the file manually like so:

```javascript
var Markdown = require('../node_modules/misojs-markdown-component/markdown.component.js')({});
```

This works because miso can compile separate server and client versions of the code automatically, and any directly referenced files will be included. See markdown.component.client.js for details on how the client side implementation works, and if it is suitable for your use.


text:
"""
Schema for V3 Group Snapshots API.

"""

from cinder.api.validation import parameter_types

create = {
    'type': 'object',
    'properties': {
        'type': 'object',
        'group_snapshot': {
            'type': 'object',
            'properties': {
                'group_id': parameter_types.uuid,
                'name': parameter_types.name_allow_zero_min_length,
                'description': parameter_types.description,
            },
            'required': ['group_id'],
            'additionalProperties': False,
        },
    },
    'required': ['group_snapshot'],
    'additionalProperties': False,
}

reset_status = {
    'type': 'object',
    'properties': {
        'type': 'object',
        'reset_status': {
            'type': 'object',
            'properties': {
                'status': parameter_types.group_snapshot_status,
            },
            'required': ['status'],
            'additionalProperties': False,
        },
    },
    'required': ['reset_status'],
    'additionalProperties': False,
}


text:
"use strict";

describe("DebugService", function() {

  var service, filter;

  beforeEach(module("kopf"));

  beforeEach(function() {
    module('kopf');

    module(function($provide) {
      $provide.value('$filter',
          function() {
            return function() {
              return 'prefix> ';
            }
          }
      );
    });
  });

  beforeEach(inject(function($injector) {
    service = $injector.get('DebugService');
    filter = $injector.get('$filter');
    filter.date = function() {
      return 'xxx';
    };
  }));

  it("should correctly add a formatted message to the messages list", function() {
    service.debug("hello");
    expect(service.getMessages().length).toEqual(1);
    expect(service.getMessages()).toEqual(['prefix> hello']);
  });

  it("should limit message to 100", function() {
    for (var i = 0; i < 1003; i++) {
      service.debug('message ' + i);
    }
    expect(service.getMessages().length).toEqual(1000);
    expect(service.getMessages()[999]).toEqual('prefix> message 1002');

  });

  it("adding a message should change internal updatedAt value", function() {
    expect(service.getUpdatedAt()).toEqual(0);
    service.debug('message');
    expect(service.getUpdatedAt()).not.toEqual(0);
  });

});


text:
package com.github.dreamhead.moco.parser.model;

import com.github.dreamhead.moco.Moco;
import com.github.dreamhead.moco.MocoProcedure;
import com.github.dreamhead.moco.RequestExtractor;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.handler.AndResponseHandler;
import com.github.dreamhead.moco.handler.failover.Failover;
import com.github.dreamhead.moco.parser.ResponseHandlerFactory;
import com.github.dreamhead.moco.resource.ContentResource;
import com.github.dreamhead.moco.resource.Resource;
import com.google.common.base.Function;
import com.google.common.collect.*;
import com.google.common.net.HttpHeaders;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Map;

import static com.github.dreamhead.moco.Moco.*;
import static com.github.dreamhead.moco.util.Jsons.toJson;
import static com.google.common.collect.FluentIterable.from;
import static com.google.common.collect.ImmutableMap.copyOf;
import static com.google.common.collect.ImmutableSet.of;
import static java.lang.String.format;

public class DynamicResponseHandlerFactory extends Dynamics implements ResponseHandlerFactory {
    private static final ImmutableSet<String> RESOURCES = of("text", "file", "pathResource", "version");
    private static final ImmutableMap<String, String> COMPOSITES = ImmutableMap.<String, String>builder()
            .put("headers", "header")
            .put("cookies", "cookie")
            .build();

    @Override
    public ResponseHandler createResponseHandler(ResponseSetting responseSetting) {
        FluentIterable<ResponseHandler> handlers = from(getFields(responseSetting.getClass())).filter(isValidField(responseSetting)).transform(fieldToResponseHandler(responseSetting));
        return getResponseHandler(handlers.toList());
    }

    private ResponseHandler getResponseHandler(ImmutableList<ResponseHandler> list) {
        if (list.size() == 1) {
            return list.get(0);
        }

        return new AndResponseHandler(list);
    }

    private boolean isResource(String name) {
        return RESOURCES.contains(name);
    }

    private Function<Field, ResponseHandler> fieldToResponseHandler(final ResponseSetting response) {
        return new Function<Field, ResponseHandler>() {
            @Override
            public ResponseHandler apply(Field field) {
                try {
                    Object value = field.get(response);
                    return createResponseHandler(field.getName(), value);
                } catch (IllegalAccessException e) {
                    throw new RuntimeException(e);
                }
            }
        };
    }

    private ResponseHandler createResponseHandler(String name, Object value) {
        if ("json".equalsIgnoreCase(name)) {
            return new AndResponseHandler(of(with(text(toJson(value))), header(HttpHeaders.CONTENT_TYPE, "application/json")));
        }

        if (isResource(name) && TextContainer.class.isInstance(value)) {
            TextContainer container = TextContainer.class.cast(value);
            return with(resourceFrom(name, container));
        }

        if (Map.class.isInstance(value)) {
            return createCompositeHandler(name, castToMap(value));
        }

        if ("status".equalsIgnoreCase(name)) {
            return invokeTarget(name, Integer.parseInt(value.toString()), ResponseHandler.class);
        }

        if ("latency".equalsIgnoreCase(name)) {
            return with(invokeTarget(name, Long.parseLong(value.toString()), MocoProcedure.class));
        }

        if (ProxyContainer.class.isInstance(value)) {
            return createProxy((ProxyContainer) value);
        }

        if ("attachment".equalsIgnoreCase(name)) {
            AttachmentSetting attachment = (AttachmentSetting)value;
            return attachment(attachment.getFilename(), resourceFrom(attachment));
        }

        throw new IllegalArgumentException(format("unknown field [%s]", name));
    }

    private Field getField(Class<?> clazz, String name) throws NoSuchFieldException {
        try {
            return clazz.getDeclaredField(name);
        } catch (NoSuchFieldException e) {
            Class<?> superclass = clazz.getSuperclass();
            if (superclass != null) {
                return getField(superclass, name);
            }
            throw e;
        }
    }

    private Resource resourceFrom(BaseResourceSetting resourceSetting) {
        for (String resource : RESOURCES) {
            try {
                Field field = getField(resourceSetting.getClass(), resource);
                return resourceFrom(resource, (TextContainer)field.get(resourceSetting));
            } catch (Exception ignored) {
            }
        }

        throw new IllegalArgumentException(format("resourceSetting is expected"));
    }

    private ResponseHandler createCompositeHandler(String name, Map<String, TextContainer> map) {
        ImmutableList<ResponseHandler> handlers = from(map.entrySet()).transform(toTargetHandler(name)).toList();
        return getResponseHandler(handlers);
    }

    private Function<Map.Entry<String, TextContainer>, ResponseHandler> toTargetHandler(final String name) {
        return new Function<Map.Entry<String, TextContainer>, ResponseHandler>() {
            @Override
            public ResponseHandler apply(Map.Entry<String, TextContainer> pair) {
                String result = COMPOSITES.get(name);
                if (result == null) {
                    throw new RuntimeException("unknown composite handler name [" + name + "]");
                }

                return createResponseHandler(pair, result);
            }
        };
    }

    private ResponseHandler createResponseHandler(Map.Entry<String, TextContainer> pair, String targetMethodName) {
        TextContainer container = pair.getValue();
        try {
            if (container.isForTemplate()) {
                Method method = Moco.class.getMethod(targetMethodName, String.class, Resource.class);
                return (ResponseHandler) method.invoke(null, pair.getKey(), template(container.getText()));
            }

            Method method = Moco.class.getMethod(targetMethodName, String.class, String.class);
            return (ResponseHandler) method.invoke(null, pair.getKey(), container.getText());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @SuppressWarnings("unchecked")
    private Map<String, TextContainer> castToMap(Object value) {
        return Map.class.cast(value);
    }

    private Resource resourceFrom(String name, TextContainer container) {
        if (container.isRawText()) {
            return invokeTarget(name, container.getText(), Resource.class);
        }

        if (container.isForTemplate()) {
            if ("version".equalsIgnoreCase(name)) {
                return version(template(container.getText()));
            }

            if (container.hasProperties()) {
                return template(invokeTarget(name, container.getText(), ContentResource.class),
                        toVariables(container.getProps()));
            }

            return template(invokeTarget(name, container.getText(), ContentResource.class));
        }

        throw new IllegalArgumentException(format("unknown operation [%s]", container.getOperation()));
    }

    private ImmutableMap<String, RequestExtractor<?>> toVariables(ImmutableMap<String, TextContainer> props) {
        return copyOf(Maps.transformEntries(props, toVariable()));
    }

    private static Maps.EntryTransformer<String, TextContainer, RequestExtractor<?>> toVariable() {
        return new Maps.EntryTransformer<String, TextContainer, RequestExtractor<?>>() {
            @Override
            @SuppressWarnings("unchecked")
            public RequestExtractor<?> transformEntry(String key, TextContainer value) {
                if (value.isRawText()) {
                    return var(value.getText());
                }

                return createRequestExtractor(getExtractorMethod(value.getOperation()), value.getText());
            }
        };
    }

    private ResponseHandler createProxy(ProxyContainer proxy) {
        Failover failover = proxy.getFailover();

        if (proxy.hasProxyConfig()) {
            return proxy(proxy.getProxyConfig(), failover);
        }

        return proxy(proxy.getUrl(), failover);
    }
}


text:
package adb

import (
	"context"

	"github.com/google/gapid/core/os/android"
	"github.com/google/gapid/core/os/device/bind"
	"github.com/google/gapid/core/os/shell"
)

// Device extends the android.Device interface with adb specific features.
type Device interface {
	android.Device
	// Command is a helper that builds a shell.Cmd with the device as its target.
	Command(name string, args ...string) shell.Cmd
	// Root restarts adb as root. If the device is running a production build then
	// Root will return ErrDeviceNotRooted.
	Root(ctx context.Context) error
	// IsDebuggableBuild returns true if the device runs a debuggable Android build.
	IsDebuggableBuild(ctx context.Context) (bool, error)
	// Forward will forward the specified device Port to the specified local Port.
	Forward(ctx context.Context, local, device Port) error
	// RemoveForward removes a port forward made by Forward.
	RemoveForward(ctx context.Context, local Port) error
	// GraphicsDriver queries and returns info on the preview graphics driver.
	GraphicsDriver(ctx context.Context) (Driver, error)
}

// Driver contains the information about a graphics driver.
type Driver struct {
	Package string
	Path    string
}

// DeviceList is a list of devices.
type DeviceList []Device

// FindBySerial returns the device with the matching serial, or nil if the
// device cannot be found.
func (l DeviceList) FindBySerial(serial string) Device {
	for _, d := range l {
		if d.Instance().Serial == serial {
			return d
		}
	}
	return nil
}

// binding represents an attached Android device.
type binding struct {
	bind.Simple
}

// verify that binding implements Device
var _ Device = (*binding)(nil)


text:
import csv
import io
import jmespath
import json
import os.path
import logging
from urllib.request import Request, urlopen
from urllib.parse import parse_qsl, urlparse
import zlib
from contextlib import closing

from c7n.utils import format_string_values

log = logging.getLogger('custodian.resolver')

ZIP_OR_GZIP_HEADER_DETECT = zlib.MAX_WBITS | 32

class URIResolver:

    def __init__(self, session_factory, cache):
        self.session_factory = session_factory
        self.cache = cache

    def resolve(self, uri):
        if self.cache:
            contents = self.cache.get(("uri-resolver", uri))
            if contents is not None:
                return contents

        if uri.startswith('s3://'):
            contents = self.get_s3_uri(uri)
        else:
            # TODO: in the case of file: content and untrusted
            # third parties, uri would need sanitization
            req = Request(uri, headers={"Accept-Encoding": "gzip"})
            with closing(urlopen(req)) as response:
                contents = self.handle_response_encoding(response)

        if self.cache:
            self.cache.save(("uri-resolver", uri), contents)
        return contents

    def handle_response_encoding(self, response):
        if response.info().get('Content-Encoding') != 'gzip':
            return response.read().decode('utf-8')

        data = zlib.decompress(response.read(),
                               ZIP_OR_GZIP_HEADER_DETECT).decode('utf8')
        return data

    def get_s3_uri(self, uri):
        parsed = urlparse(uri)
        client = self.session_factory().client('s3')
        params = dict(
            Bucket=parsed.netloc,
            Key=parsed.path[1:])
        if parsed.query:
            params.update(dict(parse_qsl(parsed.query)))
        result = client.get_object(**params)
        body = result['Body'].read()
        if isinstance(body, str):
            return body
        else:
            return body.decode('utf-8')

class ValuesFrom:
    """Retrieve values from a url.

    Supports json, csv and line delimited text files and expressions
    to retrieve a subset of values.

    Expression syntax
    - on json, a jmespath expr is evaluated
    - on csv, an integer column or jmespath expr can be specified
    - on csv2dict, a jmespath expr (the csv is parsed into a dictionary where
    the keys are the headers and the values are the remaining columns)

    Text files are expected to be line delimited values.

    Examples::

      value_from:
         url: s3://bucket/xyz/foo.json
         expr: [].AppId

      value_from:
         url: http://foobar.com/mydata
         format: json
         expr: Region."us-east-1"[].ImageId

      value_from:
         url: s3://bucket/abc/foo.csv
         format: csv2dict
         expr: key[1]

       # inferred from extension
       format: [json, csv, csv2dict, txt]
    """
    supported_formats = ('json', 'txt', 'csv', 'csv2dict')

    # intent is that callers embed this schema
    schema = {
        'type': 'object',
        'additionalProperties': 'False',
        'required': ['url'],
        'properties': {
            'url': {'type': 'string'},
            'format': {'enum': ['csv', 'json', 'txt', 'csv2dict']},
            'expr': {'oneOf': [
                {'type': 'integer'},
                {'type': 'string'}]}
        }
    }

    def __init__(self, data, manager):
        config_args = {
            'account_id': manager.config.account_id,
            'region': manager.config.region
        }
        self.data = format_string_values(data, **config_args)
        self.manager = manager
        self.cache = manager._cache
        self.resolver = URIResolver(manager.session_factory, manager._cache)

    def get_contents(self):
        _, format = os.path.splitext(self.data['url'])

        if not format or self.data.get('format'):
            format = self.data.get('format', '')
        else:
            format = format[1:]

        if format not in self.supported_formats:
            raise ValueError(
                "Unsupported format %s for url %s",
                format, self.data['url'])
        contents = str(self.resolver.resolve(self.data['url']))
        return contents, format

    def get_values(self):
        if self.cache:
            # use these values as a key to cache the result so if we have
            # the same filter happening across many resources, we can reuse
            # the results.
            key = [self.data.get(i) for i in ('url', 'format', 'expr')]
            contents = self.cache.get(("value-from", key))
            if contents is not None:
                return contents

        contents = self._get_values()
        if self.cache:
            self.cache.save(("value-from", key), contents)
        return contents

    def _get_values(self):
        contents, format = self.get_contents()

        if format == 'json':
            data = json.loads(contents)
            if 'expr' in self.data:
                res = jmespath.search(self.data['expr'], data)
                if res is None:
                    log.warning('ValueFrom filter: %s key returned None' % self.data['expr'])
                return res
        elif format == 'csv' or format == 'csv2dict':
            data = csv.reader(io.StringIO(contents))
            if format == 'csv2dict':
                data = {x[0]: list(x[1:]) for x in zip(*data)}
            else:
                if isinstance(self.data.get('expr'), int):
                    return [d[self.data['expr']] for d in data]
                data = list(data)
            if 'expr' in self.data:
                res = jmespath.search(self.data['expr'], data)
                if res is None:
                    log.warning('ValueFrom filter: %s key returned None' % self.data['expr'])
                return res
            return data
        elif format == 'txt':
            return [s.strip() for s in io.StringIO(contents).readlines()]