text:
#include "window.h"
#include "lutro.h"
#include "graphics.h"
#include "libretro.h"

#include <stdlib.h>
#include <string.h>

int lutro_window_preload(lua_State *L)
{
   static luaL_Reg win_funcs[] =  {
      { "close", win_close },
      { "setTitle", win_setTitle },
      { "setMode",  win_setMode },
      { "setIcon", win_setIcon },
      { "isCreated", win_isCreated },
      { "maximize", win_maximize },
      { "minimize", win_minimize },
      { "getTitle", win_getTitle },
      { "setPosition", win_setPosition },
      { "getPosition", win_getPosition },
      { "requestAttention", win_requestAttention },
      { "getDisplayName", win_getDisplayName },
      { "setDisplaySleepEnabled", win_setDisplaySleepEnabled },
      {NULL, NULL}
   };

   lutro_ensure_global_table(L, "lutro");

   luaL_newlib(L, win_funcs);

   lua_setfield(L, -2, "window");

   return 1;
}

void lutro_window_init()
{
}

/**
 * lutro.window.setTitle
 *
 * https://love2d.org/wiki/love.window.setTitle
 */
int win_setTitle(lua_State *L)
{
   int n = lua_gettop(L);

   if (n != 1)
      return luaL_error(L, "lutro.window.setTitle expects 1 arguments, %d given.", n);

   // Setting the title is ignored in Lutro.
   return 0;
}

/**
 * lutro.window.close()
 *
 * https://love2d.org/wiki/love.window.close
 */
int win_close(lua_State *L)
{
   retro_shutdown_game();

   return 0;
}

/**
 * lutro.window.setIcon
 *
 * https://love2d.org/wiki/love.window.setIcon
 */
int win_setIcon(lua_State *L)
{
   // Pretend that we successfully set the window icon.
   lua_pushboolean(L, true);

   return 1;
}

int win_setMode(lua_State *L)
{
   int n = lua_gettop(L);

   if (n < 2)
      return luaL_error(L, "lutro.window.setMode at least 2 arguments, %d given.", n);

   settings.width = luaL_checknumber(L, 1);
   settings.height = luaL_checknumber(L, 2);

   lutro_graphics_reinit(L);

   lua_pop(L, n);

   lua_pushboolean(L, true);

   return 1;
}

/**
 * lutro.window.isCreated
 *
 * https://love2d.org/wiki/love.window.isCreated
 */
int win_isCreated(lua_State *L)
{
   int n = lua_gettop(L);

   if (n > 0)
      return luaL_error(L, "lutro.window.isCreated expects 0 arguments, %d given.", n);

   // The window will always be created in libretro.
   lua_pushboolean(L, true);

   return 1;
}

/**
 * lutro.window.maximize
 *
 * https://love2d.org/wiki/love.window.maximize
 */
int win_maximize(lua_State *L)
{
   int n = lua_gettop(L);

   if (n > 0)
      return luaL_error(L, "lutro.window.maximize expects 0 arguments, %d given.", n);

   // Lutro does not support maximizing the window.
   return 0;
}

/**
 * lutro.window.minimize
 *
 * https://love2d.org/wiki/love.window.minimize
 */
int win_minimize(lua_State *L)
{
   int n = lua_gettop(L);

   if (n > 0)
      return luaL_error(L, "lutro.window.minimize expects 0 arguments, %d given.", n);

   // Lutro does not support minimizing the window.
   return 0;
}

/**
 * lutro.window.getTitle
 *
 * https://love2d.org/wiki/love.window.getTitle
 */
int win_getTitle(lua_State *L)
{
   int n = lua_gettop(L);

   if (n > 0)
      return luaL_error(L, "lutro.window.getTitle expects 0 arguments, %d given.", n);

   // Return a standard title.
   lua_pushstring(L, "Lutro");

   return 1;
}

/**
 * lutro.window.setPosition
 *
 * https://love2d.org/wiki/love.window.setPosition
 */
int win_setPosition(lua_State *L)
{
   int n = lua_gettop(L);
   if (n < 2 || n > 3)
      return luaL_error(L, "lutro.window.setPosition expects 2-3 arguments, %d given.", n);

   // Setting position in Lutro is ignored.
   return 0;
}

/**
 * lutro.window.getPosition
 *
 * https://love2d.org/wiki/love.window.getPosition
 */
int win_getPosition(lua_State *L)
{
   int n = lua_gettop(L);
   if (n > 0)
      return luaL_error(L, "lutro.window.getPosition expects 0 arguments, %d given.", n);

   // The position is a fixed point.
   lua_pushnumber(L, 0); // x
   lua_pushnumber(L, 0); // y
   lua_pushnumber(L, 1); // display

   return 3;
}

/**
 * lutro.window.requestAttention
 *
 * https://love2d.org/wiki/love.window.requestAttention
 */
int win_requestAttention(lua_State *L)
{
   int n = lua_gettop(L);
   if (n < 0 || n > 1)
      return luaL_error(L, "lutro.window.requestAttention expects 0 or 1 arguments, %d given.", n);

   return 0;
}

/**
 * lutro.window.getDisplayName
 *
 * https://love2d.org/wiki/love.window.getDisplayName
 */
int win_getDisplayName(lua_State *L)
{
   int n = lua_gettop(L);
   if (n < 0 || n > 1)
      return luaL_error(L, "lutro.window.getDisplayName expects 0 or 1 arguments, %d given.", n);

   // Lutro does not support multiple displays.
   lua_pushstring(L, "libretro");

   return 1;
}

/**
 * lutro.window.setDisplaySleepEnabled
 *
 * https://love2d.org/wiki/love.window.setDisplaySleepEnabled
 */
int win_setDisplaySleepEnabled(lua_State *L)
{
   int n = lua_gettop(L);
   if (n != 1)
      return luaL_error(L, "lutro.window.win_setDisplaySleepEnabled expects 1 argument, %d given.", n);

   // Ignore setting the display sleep.
   return 0;
}


text:
{{> header}}

#{{issueDetails.number}}: {{issueDetails.title}}

Created by {{issueDetails.user.login}} at {{parsedDate}}

<input type="hidden" id="issue_url" value="{{issueDetails.url}}">
<input type="hidden" id="username" value="{{userName}}">
{{#if parsedBody}}

    {{{parsedBody}}}

{{/if}}

{{> timer}}

redpajama_set_name: RedPajamaGithub


text:
#include "ui_tooltip.h"

#include "ui_cfg.h"
#include "util_drawable.h"
#include "util_string.h"

namespace UITooltip
{
  namespace
  {
    String tip_;
    Sprite background_;
    bool emptyTip_ = true;

    float setTime; // 记录设置的时间,用于延长显示
    float delayTime = kTooptipDelayTime; // 延迟出现时间
    float fadeInTime = kTooptipFadeinTime; // 淡入过程时间长度

    const float BACKGROUND_EXPEND_SIZE_X = 10.0f;
    const float BACKGROUND_EXPEND_SIZE_Y = 8.0f;
    const Color EMPTY_BACKGROUND_DEFAULT_COL = Color(97, 104, 255, 240);
  }

  void SetBackground(const Sprite& background)
  {
    background_ = background_;
  }

  void UITooltip::Set( const String& tip , float left /*= 0.0f*/, float top /*= 0.0f*/)
  {
    tip_ = tip;
    emptyTip_ = String_IsEmpty(tip);

    // 设置位置

    tip_.SetPosition(left + BACKGROUND_EXPEND_SIZE_X, top + BACKGROUND_EXPEND_SIZE_Y);

    // 设置背景的大小,如果是非图片背景,则同时设置其背景颜色

    float width = tip_.GetRect().GetWidth() + BACKGROUND_EXPEND_SIZE_X * 2;
    float height = tip_.GetRect().GetHeight() + BACKGROUND_EXPEND_SIZE_Y * 2;
    background_.Resize(width, height);
    background_.SetPosition(left, top);
    if (background_.GetImage() == NULL)
      background_.SetColor(EMPTY_BACKGROUND_DEFAULT_COL);

    // 记录设置时间

    setTime = static_cast<float>(clock());
  }

  void Draw(RenderTarget& target)
  {
    if (!emptyTip_ && (clock() - setTime > delayTime * 1000))
    {
      float alpha = 255 * (clock() - setTime - delayTime * 1000) / (fadeInTime * 1000);
      alpha = alpha > 255 ? 255 : alpha;

      SetAlpha(background_, alpha);
      SetAlpha(tip_, alpha);

      target.Draw(background_);
      target.Draw(tip_);
    }
  }

  void Reset()
  {
    Set(String());
  }

}


text:
package eu.ydp.empiria.player.client.module.labelling.structure;

import com.google.common.base.Objects;

import javax.xml.bind.annotation.*;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "labellingInteraction")
public class LabellingInteractionBean {

    @XmlElement
    private ImgBean img;
    @XmlElement
    private ChildrenBean children;
    @XmlAttribute
    private String id;

    public ImgBean getImg() {
        return img;
    }

    public void setImg(ImgBean img) {
        this.img = img;
    }

    public ChildrenBean getChildren() {
        return children;
    }

    public void setChildren(ChildrenBean children) {
        this.children = children;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return Objects.firstNonNull(id, "");
    }

}


text:
/*
 * image.js: Joyent Cloud DataSet
 *
 * (C) 2012 Charlie Robbins, Ken Perkins, Ross Kukulinski & the Contributors.
 *
 */

var util = require('util'),
    base  = require('../../core/compute/image');

var Image = exports.Image = function Image(client, details) {
  base.Image.call(this, client, details);
};

util.inherits(Image, base.Image);

Image.prototype._setProperties = function (details) {
  this.id           = details.urn;
  this.name         = details.name;
  this.created      = details.created;

  //
  // Joyent specific
  //
  this.urn          = details.urn;
  this.joyentId     = details.id;
  this.os           = details.os;
  this.type         = details.type;
  this.description  = details.description;
  this['default']   = details['default'];
  this.version      = details.version;
  this.requirements = details.requirements;
  this.original     = this.rackspace = details;
};


text:
#pragma once
#include <aws/comprehendmedical/ComprehendMedical_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/comprehendmedical/model/ComprehendMedicalAsyncJobProperties.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace ComprehendMedical
{
namespace Model
{
  class AWS_COMPREHENDMEDICAL_API ListPHIDetectionJobsResult
  {
  public:
    ListPHIDetectionJobsResult();
    ListPHIDetectionJobsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListPHIDetectionJobsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
A list containing the properties of each job returned.

     */
    inline const Aws::Vector<ComprehendMedicalAsyncJobProperties>& GetComprehendMedicalAsyncJobPropertiesList() const{ return m_comprehendMedicalAsyncJobPropertiesList; }

    /**
     *
A list containing the properties of each job returned.

     */
    inline void SetComprehendMedicalAsyncJobPropertiesList(const Aws::Vector<ComprehendMedicalAsyncJobProperties>& value) { m_comprehendMedicalAsyncJobPropertiesList = value; }

    /**
     *
A list containing the properties of each job returned.

     */
    inline void SetComprehendMedicalAsyncJobPropertiesList(Aws::Vector<ComprehendMedicalAsyncJobProperties>&& value) { m_comprehendMedicalAsyncJobPropertiesList = std::move(value); }

    /**
     *
A list containing the properties of each job returned.

     */
    inline ListPHIDetectionJobsResult& WithComprehendMedicalAsyncJobPropertiesList(const Aws::Vector<ComprehendMedicalAsyncJobProperties>& value) { SetComprehendMedicalAsyncJobPropertiesList(value); return *this;}

    /**
     *
A list containing the properties of each job returned.

     */
    inline ListPHIDetectionJobsResult& WithComprehendMedicalAsyncJobPropertiesList(Aws::Vector<ComprehendMedicalAsyncJobProperties>&& value) { SetComprehendMedicalAsyncJobPropertiesList(std::move(value)); return *this;}

    /**
     *
A list containing the properties of each job returned.

     */
    inline ListPHIDetectionJobsResult& AddComprehendMedicalAsyncJobPropertiesList(const ComprehendMedicalAsyncJobProperties& value) { m_comprehendMedicalAsyncJobPropertiesList.push_back(value); return *this; }

    /**
     *
A list containing the properties of each job returned.

     */
    inline ListPHIDetectionJobsResult& AddComprehendMedicalAsyncJobPropertiesList(ComprehendMedicalAsyncJobProperties&& value) { m_comprehendMedicalAsyncJobPropertiesList.push_back(std::move(value)); return *this; }

    /**
     *
Identifies the next page of results to return.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
Identifies the next page of results to return.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }

    /**
     *
Identifies the next page of results to return.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }

    /**
     *
Identifies the next page of results to return.

     */
    inline void SetNextToken(const char* value) { m_nextToken.assign(value); }

    /**
     *
Identifies the next page of results to return.

     */
    inline ListPHIDetectionJobsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
Identifies the next page of results to return.

     */
    inline ListPHIDetectionJobsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
Identifies the next page of results to return.

     */
    inline ListPHIDetectionJobsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    Aws::Vector<ComprehendMedicalAsyncJobProperties> m_comprehendMedicalAsyncJobPropertiesList;

    Aws::String m_nextToken;
  };

} // namespace Model
} // namespace ComprehendMedical
} // namespace Aws


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Batista & Ciferri, Quad. Lab. crittogam. , Pavia 31: 176 (1963)

#### Original name
Podoxyphium yuccae Bat. & Nascim.

### Remarks
null


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>Kyle Scollin</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="apple-touch-icon" href="apple-touch-icon.png">

        <link href="https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet" href="css/portfolio.css">

Projects

About

Contact

Fox & Bear Co.

                My fiancé and I decided to start our own side business making baked goods, pickles, and a variety of other treats. We worked together to brand ourselves and build up a business.

Logo

                After sketching some logo ideas we found that we loved the imagery of a tree. It evokes the idea of nature, and wilderness, but also family and heritage which represents the brand we want to achieve. So I began by stipple drawing a tree and then creating the typographic treatment. We decided the typographic treatment was strong enough, so we opted to lead with that and use the tree as a supporting element.

                    (concepts)

                    (final)

Website

                I designed and hand coded a 5 page website. Every photo that we used on the site was taken by me. We setup an ordering system where people could submit orders through the website and choose a pick up time. However we soon discovered we were more effective just taking pre-orders and delivering in big batches.

                ‹  view more projects

                Hit me up!   hello@kylescollin.com

Copyright 2017 - Kyle Scollin


text:
'use strict';

/**
 * Declare module dependencies
 */

var express = require('express'),
    routes = require('./routes'),
    admin = require('./routes/admin'),
    respondTo = require('./middleware/mime_responds').respondTo,
    protect = require('./middleware/authentication');

/**
 * Create Express server
 */

var app = express();

/**
 * Express configuration
 */

app.use(express.json());
app.use(express.urlencoded());
app.use(express.favicon());
app.use(app.router);

/**
 * Public API Routes
 */

app.all('/api/*', respondTo('json'));

app.get('/api/keywords(.:format)', routes.keywords.index);
app.post('/api/suggestions(.:format)', routes.suggestions.create);

/**
 * Admin API Routes
 */

app.all('/admin/*', protect);
app.all('/api/admin/*', protect);

app.get('/api/admin/suggestions(.:format)', admin.suggestions.index);
app.get('/api/admin/metrics(.:format)', admin.metrics.index);

/**
 * Expose the application instance
 */

module.exports = app;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TarsimAvl.Admin
{
    public partial class Animation : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}


text:
using Microsoft.WindowsAzure.Storage.DataMovement;
using System;

namespace Microsoft.WindowsAzure.Commands.Storage.Common
{
    internal class TransferProgressHandler : IProgress<TransferProgress>
    {
        private Action<TransferProgress> progressHandler;

        public TransferProgressHandler(Action<TransferProgress> progressHandler)
        {
            this.progressHandler = progressHandler;
        }

        public void Report(TransferProgress value)
        {
            this.progressHandler(value);
        }
    }
}


text:
[![asciicast](https://asciinema.org/a/36893.png)](https://asciinema.org/a/36893)

http://soyuka.me/benchmarking-nodejs-streams/

Computer informations:

```
Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
MemTotal:        8096856 kB
Device Model:     Samsung SSD 840 EVO 250GB
```

## Api-benchmark

```bash
cd test/benchmark
npm install
node express.js #listens on 3002
```

The express app has 5 routes:
- `/` - normal render mode
- `/pipe` - just pipe haml to res
- `/cached` - cache javascript per view
- `/hamljs` - hamljs rendering
- `/hamljs/cached` - hamljs cached rendering

Start api benchmarks:

```bash
node index.js
```

Results:

```bash
server1/cached x 700 ops/sec ±8.35% (1000 runs sampled)
server1/pipe x 295 ops/sec ±5.59% (1000 runs sampled)
server1/render x 294 ops/sec ±10.09% (1000 runs sampled)
server1/hamljs x 1,401 ops/sec ±3.71% (1000 runs sampled)
server1/hamljscached x 1,923 ops/sec ±5.92% (1000 runs sampled)
```

## Siege results

Normal render function:

```bash
(master ✗)❯ sudo siege -c1 -b -t10s http://localhost:3002/

Transactions:                   3402 hits
Availability:                 100.00 %
Elapsed time:                   9.83 secs
Data transferred:               5.16 MB
Response time:                  0.00 secs
Transaction rate:             346.08 trans/sec
Throughput:                     0.52 MB/sec
Concurrency:                    0.99
Successful transactions:        3402
Failed transactions:               0
Longest transaction:            0.16
Shortest transaction:           0.00
```

Pipe:

```bash
(master ✗)❯ sudo siege -c1 -b -t10s http://localhost:3002/pipe

Transactions:                   3237 hits
Availability:                 100.00 %
Elapsed time:                   9.77 secs
Data transferred:               4.91 MB
Response time:                  0.00 secs
Transaction rate:             331.32 trans/sec
Throughput:                     0.50 MB/sec
Concurrency:                    0.99
Successful transactions:        3237
Failed transactions:               0
Longest transaction:            0.25
Shortest transaction:           0.00
```

Cache:

```bash
(master ✗)❯ sudo siege -c1 -b -t10s http://localhost:3002/cached

Transactions:                   9299 hits
Availability:                 100.00 %
Elapsed time:                   9.36 secs
Data transferred:              14.09 MB
Response time:                  0.00 secs
Transaction rate:             993.48 trans/sec
Throughput:                     1.51 MB/sec
Concurrency:                    0.99
Successful transactions:        9299
Failed transactions:               0
Longest transaction:            0.30
Shortest transaction:           0.00
```

Hamljs:

```bash
(master ✗)❯ sudo siege -c1 -b -t10s http://localhost:3002/hamljs

Transactions:                  22514 hits
Availability:                 100.00 %
Elapsed time:                   9.50 secs
Data transferred:              32.89 MB
Response time:                  0.00 secs
Transaction rate:            2369.89 trans/sec
Throughput:                     3.46 MB/sec
Concurrency:                    0.98
Successful transactions:       22514
Failed transactions:               0
Longest transaction:            0.01
Shortest transaction:           0.00
```

Hamljs-cached:

```bash
(master ✗)❯ sudo siege -c1 -b -t10s http://localhost:3002/hamljs/cached

Transactions:                  37803 hits
Availability:                 100.00 %
Elapsed time:                   9.80 secs
Data transferred:              55.23 MB
Response time:                  0.00 secs
Transaction rate:            3857.45 trans/sec
Throughput:                     5.64 MB/sec
Concurrency:                    0.97
Successful transactions:       37803
Failed transactions:               0
Longest transaction:            0.02
Shortest transaction:           0.00
```


text:
package com.tedchen.play.bluetoothctrl;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * Created by tedchen on 2017/3/8.
 */
public class GlobalConfig {
    private static GlobalConfig ourInstance = new GlobalConfig();

    public static GlobalConfig getInstance() {
        return ourInstance;
    }

    private GlobalConfig() {
        allUUID = new ArrayList<UUID>();
    }

    //
    public UUID blueUuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");

    public UUID getBlueUuid() {
        return blueUuid;
    }

    public void setBlueUuid(UUID uuid_str) {
        this.blueUuid = uuid_str;
    }

    List<UUID> allUUID;
    public List<UUID> getAllUUID() {
        return allUUID;
    }

    public void addUUID(UUID uuid) {
        this.allUUID.add(uuid);
    }

    public static final String CMD_SPLIT = "\n";
    public static final String CMD_UP = "up";
    public static final String CMD_DOWN = "down";
    public static final String CMD_LEFT = "left";
    public static final String CMD_RIGHT = "right";
    public static final String CMD_SPEED = "speed";
    public static final String CMD_STOP = "stop";
    public static final String CMD_LIGHT = "light";
    public static final String CMD_SOUND = "sound";

    public static final String CMD_RELEASE = "release";  //松开按键
    public static final String CMD_CANCLE = "cancle";  //松开按键
    public static final String CMD_MOVE_START = "move";
    public static final String CMD_MOVE_STOP = "move0";

    //发送串口命令
    public static void SendBluetoothCmd(String cmd) {
        if (null == AppContexts.getInstance().mChatService) {
            return;
        }
        // Check that we're actually connected before trying anything
        if (AppContexts.getInstance().mChatService.getState() != BluetoothCtrlService.STATE_CONNECTED) {
            //Toast.makeText(getContext(), R.string.not_connected, Toast.LENGTH_SHORT).show();
            return;
        }
        //Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();

        // Check that there's actually something to send
        if (cmd.length() > 0) {
            cmd += GlobalConfig.CMD_SPLIT;
            // Get the message bytes and tell the BluetoothCtrlService to write
            byte[] send = cmd.getBytes();
            AppContexts.getInstance().mChatService.write(send);
        }
    }
}


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

namespace System
{
    public static class UriExtensions
    {
        public static IDictionary<string, string> GetQueryParameters(this Uri uri, bool mergeDuplicateKeys = false)
        {
            return uri.ToString().ParseQueryParameters();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@color/white_a"
              android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_value_48"
        android:background="@color/main_tab_select">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/tab_circle"
            android:textColor="@color/white_a"
            android:textSize="18sp"/>
    </RelativeLayout>

    <com.seeran.common.ui.views.pulltorefreshview.PullToRefreshListView
        android:id="@+id/pull_list_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#00000000"
        android:divider="@null"
        android:scrollbars="none"
        android:footerDividersEnabled="true"
        android:listSelector="@android:color/transparent"
        android:scrollingCache="true"/>
<!--    <ListView
        android:id="@+id/lv_dynamic_state"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@null"></ListView>-->
</LinearLayout>


text:
package org.springframework.web.service.annotation;

import org.junit.jupiter.api.Test;

import org.springframework.aop.SpringProxy;
import org.springframework.aop.framework.Advised;
import org.springframework.aot.generate.GenerationContext;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
import org.springframework.beans.factory.aot.BeanRegistrationCode;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RegisteredBean;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.DecoratingProxy;
import org.springframework.lang.Nullable;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

/**
 * Tests for {@link HttpExchangeBeanRegistrationAotProcessor}.
 *
 * @author Sebastien Deleuze
 */
class HttpExchangeBeanRegistrationAotProcessorTests {

	private final HttpExchangeBeanRegistrationAotProcessor processor = new HttpExchangeBeanRegistrationAotProcessor();

	private final GenerationContext generationContext = new TestGenerationContext();

	@Test
	void shouldSkipNonAnnotatedInterface() {
		process(NonAnnotatedInterface.class);
		assertThat(this.generationContext.getRuntimeHints().proxies().jdkProxyHints()).isEmpty();
	}

	@Test
	void shouldProcessAnnotatedInterface() {
		process(AnnotatedInterface.class);
		assertThat(RuntimeHintsPredicates.proxies().forInterfaces(AnnotatedInterface.class, SpringProxy.class, Advised.class,
				DecoratingProxy.class)).accepts(this.generationContext.getRuntimeHints());
	}

	private void process(Class<?> beanClass) {
		BeanRegistrationAotContribution contribution = createContribution(beanClass);
		if (contribution != null) {
			contribution.applyTo(this.generationContext, mock(BeanRegistrationCode.class));
		}
	}

	@Nullable
	private BeanRegistrationAotContribution createContribution(Class<?> beanClass) {
		DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
		beanFactory.registerBeanDefinition(beanClass.getName(), new RootBeanDefinition(beanClass));
		return this.processor.processAheadOfTime(RegisteredBean.of(beanFactory, beanClass.getName()));
	}

	interface NonAnnotatedInterface {

		void notExchange();
	}

	interface AnnotatedInterface {

		@GetExchange
		void get();
	}

}


text:
VERSION = $(shell godzil show-version)
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-s -w -X main.revision=$(CURRENT_REVISION)"
VERBOSE_FLAG = $(if $(VERBOSE),-v)
u := $(if $(update),-u)

export GO111MODULE=on

.PHONY: deps
deps:
	go get ${u} -d $(VERBOSE_FLAG)
	go mod tidy

.PHONY: devel-deps
devel-deps: deps
	GO111MODULE=off go get ${u} \
	  golang.org/x/lint/golint                  \
	  github.com/mattn/goveralls                \
	  github.com/Songmu/godzil/cmd/godzil       \
	  github.com/Songmu/goxz/cmd/goxz           \
	  github.com/Songmu/ghch/cmd/ghch           \
	  github.com/Songmu/gocredits/cmd/gocredits \
	  github.com/tcnksm/ghr

.PHONY: test
test: deps
	go test $(VERBOSE_FLAG) ./...

.PHONY: lint
lint: devel-deps
	go vet ./...
	golint -set_exit_status ./...

.PHONY: cover
cover: devel-deps
	goveralls

.PHONY: build
build: deps
	go build $(VERBOSE_FLAG) -ldflags=$(BUILD_LDFLAGS)

.PHONY: install
install: deps
	go install $(VERBOSE_FLAG) -ldflags=$(BUILD_LDFLAGS)

.PHONY: bump
bump: devel-deps
	godzil release

CREDITS: devel-deps go.sum
	gocredits -w

DIST_DIR = dist/v$(VERSION)
.PHONY: crossbuild
crossbuild: CREDITS
	rm -rf $(DIST_DIR)
	goxz -arch=386,amd64 -build-ldflags=$(BUILD_LDFLAGS) \
      -include='zsh/_ghq' -z -d $(DIST_DIR)
	cd $(DIST_DIR) && shasum $$(find * -type f -maxdepth 0) > SHASUMS

.PHONY: upload
upload:
	ghr -body="$$(ghch --latest -F markdown)" v$(VERSION) $(DIST_DIR)

.PHONY: release
release: bump docker-release

.PHONY: local-release
local-release: bump crossbuild upload

.PHONY: docker-release
docker-release:
	@docker run \
      -v $(PWD):/ghq \
      -w /ghq \
      -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \
      --rm        \
      golang:1.12 \
      make crossbuild upload


text:
using System;
using MediaWiki.Queries.Meta;
using Xunit;

namespace MediaWiki.Tests.Integration.Actions.Query.Meta
{
    public class UserInfoMetaQueryTests
    {
        private WikiClient _client;

        public UserInfoMetaQueryTests()
        {
            _client = new WikiClient("https://www.mediawiki.org/w/api.php");
        }

        private UserInfoMeta ExecuteWithProperty(UserInfoProperties? properties)
        {
            var query = new UserInfoMetaQuery();

            if (properties.HasValue)
                query.Properties = properties.Value;

            var result = _client.Query(query);
            return UserInfoMetaQuery.ExtractResults(result);
        }

        [IntegrationTest]
        public void BasicInfo()
        {
            var userInfo = ExecuteWithProperty(null);

            Assert.NotNull(userInfo);
            Assert.Equal<uint>(0, userInfo.Id);
            Assert.True(userInfo.Anonymous);
        }

        [IntegrationTest(Skip = "Block information is not implemented")]
        public void BlockInfo()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.BlockInfo);
        }

        [IntegrationTest(Skip = "TODO: Message test")]
        public void HasMessage()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.HasMessage);
        }

        [IntegrationTest]
        public void Groups()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.Groups);

            Assert.NotNull(userInfo);
            Assert.NotEmpty(userInfo.Groups);
            Assert.Contains("*", userInfo.Groups);
        }

        [IntegrationTest]
        public void ImplicitGroups()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.ImplicitGroups);

            Assert.NotNull(userInfo);
            Assert.NotEmpty(userInfo.ImplicitGroups);
            Assert.Contains("*", userInfo.ImplicitGroups);
        }

        [IntegrationTest]
        public void Rights()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.Rights);

            Assert.NotNull(userInfo);
            Assert.NotEmpty(userInfo.Rights);
            Assert.Contains("read", userInfo.Rights);
        }

        [IntegrationTest]
        public void ChangeableGroups()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.ChangeableGroups);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.ChangeableGroups);
        }

        [IntegrationTest]
        public void Options()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.Options);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.Options);
            Assert.Equal("default", userInfo.Options["date"]);
        }

        [IntegrationTest]
        public void PreferencesToken()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.PreferencesToken);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.PreferencesToken);
            Assert.Equal("+\\", userInfo.PreferencesToken);
        }

        [IntegrationTest(Skip = "Anonymous users do not have edit counts")]
        public void EditCount()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.EditCount);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.EditCount);
            Assert.Equal<uint>(0, userInfo.EditCount);
        }

        [IntegrationTest]
        public void RateLimits()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.RateLimits);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.RateLimits);
            Assert.Contains("edit", userInfo.RateLimits.Keys);
        }

        [IntegrationTest(Skip = "Anonymous users do not have real names")]
        public void RealName()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.RealName);

            Assert.NotNull(userInfo);
        }

        [IntegrationTest(Skip = "Anonymous users do not have emails")]
        public void Email()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.Email);

            Assert.NotNull(userInfo);
            Assert.True(userInfo.Email != "");
        }

        [IntegrationTest(Skip = "Anonymous users do not have registrations")]
        public void RegistrationDate()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.RegistrationDate);

            Assert.NotNull(userInfo);
        }

        [IntegrationTest(Skip = "RestSharp does not pass an AcceptLang")]
        public void AcceptLang()
        {
            var userInfo = ExecuteWithProperty(UserInfoProperties.AcceptLang);

            Assert.NotNull(userInfo);
            Assert.NotNull(userInfo.AcceptLang);
            Assert.NotEmpty(userInfo.AcceptLang);
        }
    }
}


text:
package com.hsdc.dp.service.flyweight;

import java.util.concurrent.ConcurrentHashMap;

import com.hsdc.dp.intf.domain.flyweight.Code;

public class CodeFactory {
	private static final Object lock = new Object();
	private static volatile CodeFactory instance;
	private ConcurrentHashMap<String, Code> flyweights = new ConcurrentHashMap<String, Code>();

	private CodeFactory() { }

	public static CodeFactory getInstance()
    {
        if (instance == null)
        {
        	synchronized (lock)
            {
                if (instance == null)
                	instance = new CodeFactory();
            }
        }

        return instance;
    }

	public Code getCode(String type)
    {
        if (type.equals("AREA"))
        	return new UncachedCode(type);
        if (!flyweights.containsKey(type)) {
        	flyweights.put(type, new CachedCode(type));
        	System.out.println(flyweights.keySet());
        }
        return flyweights.get(type);
    }
}


text:
LibNotifyLoader::LibNotifyLoader() : loaded_(false) {}

LibNotifyLoader::~LibNotifyLoader() {
  CleanUp(loaded_);
}

bool LibNotifyLoader::Load(const std::string& library_name) {
  if (loaded_)
    return false;

  library_ = dlopen(library_name.c_str(), RTLD_LAZY);
  if (!library_)
    return false;

  notify_is_initted = reinterpret_cast<decltype(this->notify_is_initted)>(
      dlsym(library_, "notify_is_initted"));
  if (!notify_is_initted) {
    CleanUp(true);
    return false;
  }

  notify_init = reinterpret_cast<decltype(this->notify_init)>(
      dlsym(library_, "notify_init"));
  if (!notify_init) {
    CleanUp(true);
    return false;
  }

  notify_get_server_info =
      reinterpret_cast<decltype(this->notify_get_server_info)>(
          dlsym(library_, "notify_get_server_info"));
  if (!notify_get_server_info) {
    CleanUp(true);
    return false;
  }

  notify_get_server_caps =
      reinterpret_cast<decltype(this->notify_get_server_caps)>(
          dlsym(library_, "notify_get_server_caps"));
  if (!notify_get_server_caps) {
    CleanUp(true);
    return false;
  }

  notify_notification_new =
      reinterpret_cast<decltype(this->notify_notification_new)>(
          dlsym(library_, "notify_notification_new"));
  if (!notify_notification_new) {
    CleanUp(true);
    return false;
  }

  notify_notification_add_action =
      reinterpret_cast<decltype(this->notify_notification_add_action)>(
          dlsym(library_, "notify_notification_add_action"));
  if (!notify_notification_add_action) {
    CleanUp(true);
    return false;
  }

  notify_notification_set_image_from_pixbuf = reinterpret_cast<decltype(
      this->notify_notification_set_image_from_pixbuf)>(
      dlsym(library_, "notify_notification_set_image_from_pixbuf"));
  if (!notify_notification_set_image_from_pixbuf) {
    CleanUp(true);
    return false;
  }

  notify_notification_set_timeout =
      reinterpret_cast<decltype(this->notify_notification_set_timeout)>(
          dlsym(library_, "notify_notification_set_timeout"));
  if (!notify_notification_set_timeout) {
    CleanUp(true);
    return false;
  }

  notify_notification_set_hint_string =
      reinterpret_cast<decltype(this->notify_notification_set_hint_string)>(
          dlsym(library_, "notify_notification_set_hint_string"));
  if (!notify_notification_set_hint_string) {
    CleanUp(true);
    return false;
  }

  notify_notification_show =
      reinterpret_cast<decltype(this->notify_notification_show)>(
          dlsym(library_, "notify_notification_show"));
  if (!notify_notification_show) {
    CleanUp(true);
    return false;
  }

  notify_notification_close =
      reinterpret_cast<decltype(this->notify_notification_close)>(
          dlsym(library_, "notify_notification_close"));
  if (!notify_notification_close) {
    CleanUp(true);
    return false;
  }

  loaded_ = true;
  return true;
}

void LibNotifyLoader::CleanUp(bool unload) {
  if (unload) {
    dlclose(library_);
    library_ = NULL;
  }
  loaded_ = false;
  notify_is_initted = NULL;
  notify_init = NULL;
  notify_get_server_info = NULL;
  notify_get_server_caps = NULL;
  notify_notification_new = NULL;
  notify_notification_add_action = NULL;
  notify_notification_set_image_from_pixbuf = NULL;
  notify_notification_set_timeout = NULL;
  notify_notification_set_hint_string = NULL;
  notify_notification_show = NULL;
  notify_notification_close = NULL;
}


text:
package com.adenops.moustack.agent;

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

import com.adenops.moustack.agent.client.AbstractPackagingClient;
import com.adenops.moustack.agent.client.DesignateClient;
import com.adenops.moustack.agent.client.DockerLocalClient;
import com.adenops.moustack.agent.client.DpkgClient;
import com.adenops.moustack.agent.client.KeystoneClient;
import com.adenops.moustack.agent.client.MongoClient;
import com.adenops.moustack.agent.client.MySQLClient;
import com.adenops.moustack.agent.client.ValidationClient;
import com.adenops.moustack.agent.client.YumClient;
import com.adenops.moustack.agent.config.StackConfig;

/**
 * Everything the modules may need during the deployment.
 *
 * We use lazy loading because most of the services do not exist yet when the environment is instanciated.
 * All instantiations are thread safe, even if it shouldn't be necessary with the current implementation.
 *
 */
public class DeploymentEnvironment {
	public final Logger log = LoggerFactory.getLogger(DeploymentEnvironment.class);

	public enum OSFamily {
		DEBIAN, REDHAT;
	}

	// OS information
	private final OSFamily osFamily;
	private final String osId;
	private final String osVersion;

	// stack configuration
	private final StackConfig stack;

	// clients
	private final AbstractPackagingClient packagingClient;
	private DockerLocalClient dockerClient;
	private KeystoneClient keystoneClient;
	private DesignateClient designateClient;
	private MongoClient mongoClient;
	private MySQLClient mySQLClient;
	private ValidationClient validationClient;

	public DeploymentEnvironment(StackConfig stack, OSFamily osFamily, String osId, String osVersion)
			throws DeploymentException {
		this.stack = stack;
		this.osFamily = osFamily;
		this.osId = osId;
		this.osVersion = osVersion;
		switch (osFamily) {
		case DEBIAN:
			packagingClient = new DpkgClient();
			break;
		case REDHAT:
			packagingClient = new YumClient();
			break;
		default:
			throw new DeploymentException("unexpected OS family " + osFamily);
		}
	}

	public StackConfig getStack() {
		return stack;
	}

	public DockerLocalClient getDockerClient() throws DeploymentException {
		if (dockerClient == null) {
			synchronized (DockerLocalClient.class) {
				if (dockerClient != null)
					return dockerClient;
				dockerClient = new DockerLocalClient(stack);
			}
		}
		return dockerClient;
	}

	public boolean isDockerClientInitialized() {
		return dockerClient == null;
	}

	public KeystoneClient getKeystoneClient() throws DeploymentException {
		if (keystoneClient == null) {
			synchronized (KeystoneClient.class) {
				if (keystoneClient != null)
					return keystoneClient;
				keystoneClient = new KeystoneClient(stack);
			}
		}
		return keystoneClient;
	}

	public DesignateClient getDesignateClient() throws DeploymentException {
		if (designateClient == null) {
			synchronized (DesignateClient.class) {
				if (designateClient != null)
					return designateClient;
				designateClient = new DesignateClient(stack, getKeystoneClient());
			}
		}
		return designateClient;
	}

	public MongoClient getMongoClient() throws DeploymentException {
		if (mongoClient == null) {
			synchronized (MongoClient.class) {
				if (mongoClient != null)
					return mongoClient;
				mongoClient = new MongoClient(stack);
			}
		}
		return mongoClient;
	}

	public MySQLClient getMySQLClient() throws DeploymentException {
		if (mySQLClient == null) {
			synchronized (MySQLClient.class) {
				if (mySQLClient != null)
					return mySQLClient;
				mySQLClient = new MySQLClient(stack);
			}
		}
		return mySQLClient;
	}

	public ValidationClient getValidationClient() throws DeploymentException {
		if (validationClient == null) {
			synchronized (ValidationClient.class) {
				if (validationClient != null)
					return validationClient;
				validationClient = new ValidationClient(stack);
			}
		}
		return validationClient;
	}

	public AbstractPackagingClient getPackagingClient() {
		return packagingClient;
	}

	public OSFamily getOsFamily() {
		return osFamily;
	}

	public String getOsId() {
		return osId;
	}

	public String getOsVersion() {
		return osVersion;
	}
}


text:
class Package
{
	char id[10];
	int weight;
	int profit;
public:
	Package();
	Package(char const*, int, int);

	const char* getId() const;
	int getWeight() const;
	int getProfit() const;
};

#endif


text:
package org.locationtech.geomesa.filter.expression

import org.opengis.filter.MultiValuedFilter.MatchAction
import org.opengis.filter.expression.{Expression, Literal}
import org.opengis.filter.{FilterVisitor, PropertyIsEqualTo}

abstract class FastPropertyIsEqualTo(exp1: Expression, exp2: Literal) extends PropertyIsEqualTo {

  override def accept(visitor: FilterVisitor, extraData: Any): AnyRef = visitor.visit(this, extraData)

  override def getExpression1: Expression = exp1

  override def getExpression2: Expression = exp2

  override def getMatchAction: MatchAction = MatchAction.ANY

  override def toString: String = s"[ $exp1 = $exp2 ]"

  def canEqual(other: Any): Boolean = other.isInstanceOf[FastPropertyIsEqualTo]

  override def equals(other: Any): Boolean = other match {
    case that: FastPropertyIsEqualTo =>
      (that canEqual this) && exp1 == that.getExpression1 && exp2 == that.getExpression2 &&
          isMatchingCase == that.isMatchingCase
    case _ => false
  }

  override def hashCode(): Int =
    Seq(exp1, exp2, isMatchingCase).map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b)
}

object FastPropertyIsEqualTo {

  class FastIsEqualTo(exp1: Expression, exp2: Literal) extends FastPropertyIsEqualTo(exp1, exp2) {
    private val lit = exp2.evaluate(null)
    override def evaluate(obj: Any): Boolean = lit == exp1.evaluate(obj)
    override def isMatchingCase: Boolean = true
  }

  class FastIsEqualToIgnoreCase(exp1: Expression, exp2: Literal) extends FastPropertyIsEqualTo(exp1, exp2) {
    private val lit = String.valueOf(exp2.evaluate(null))
    override def evaluate(obj: Any): Boolean = lit.equalsIgnoreCase(String.valueOf(exp1.evaluate(obj)))
    override def isMatchingCase: Boolean = false
  }

  // exp1 is expected to evaluate to a list, exp2 is expected to evaluate to a single value
  class FastListIsEqualToAny(exp1: Expression, exp2: Literal) extends FastPropertyIsEqualTo(exp1, exp2) {
    private val lit = exp2.evaluate(null)
    override def evaluate(obj: Any): Boolean = {
      val list = exp1.evaluate(obj).asInstanceOf[java.util.List[Any]]
      list != null && list.contains(lit)
    }
    override def isMatchingCase: Boolean = false
  }
}


text:
/* spi_oled example

   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/

#include <stdio.h>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"

#include "esp8266/gpio_struct.h"
#include "esp8266/spi_struct.h"
#include "esp_system.h"
#include "esp_log.h"
#include "esp_libc.h"

#include "driver/gpio.h"
#include "driver/spi.h"

static const char *TAG = "spi_oled";

#define OLED_DC_GPIO     12
#define OLED_RST_GPIO    15
#define OLED_PIN_SEL  (1ULL<<OLED_DC_GPIO) | (1ULL<<OLED_RST_GPIO)

static uint8_t oled_dc_level = 0;

static esp_err_t oled_delay_ms(uint32_t time)
{
    vTaskDelay(time / portTICK_RATE_MS);
    return ESP_OK;
}

static esp_err_t oled_set_dc(uint8_t dc)
{
    oled_dc_level = dc;
    return ESP_OK;
}

// Write an 8-bit cmd
static esp_err_t oled_write_cmd(uint8_t data)
{
    uint32_t buf = data << 24; // In order to improve the transmission efficiency, it is recommended that the external incoming data is (uint32_t *) type data, do not use other type data.
    spi_trans_t trans = {0};
    trans.mosi = &buf;
    trans.bits.mosi = 8;
    oled_set_dc(0);
    spi_trans(HSPI_HOST, &trans);
    return ESP_OK;
}

static esp_err_t oled_rst()
{
    gpio_set_level(OLED_RST_GPIO, 0);
    oled_delay_ms(200);
    gpio_set_level(OLED_RST_GPIO, 1);
    oled_delay_ms(100);
    return ESP_OK;
}

static esp_err_t oled_init()
{
    oled_rst(); // Reset OLED
    oled_write_cmd(0xAE);    // Set Display ON/OFF (AEh/AFh)
    oled_write_cmd(0x00);    // Set Lower Column Start Address for Page Addressing Mode (00h~0Fh)
    oled_write_cmd(0x10);    // Set Higher Column Start Address for Page Addressing Mode (10h~1Fh)
    oled_write_cmd(0x40);    // Set Display Start Line (40h~7Fh)
    oled_write_cmd(0x81);    // Set Contrast Control for BANK0 (81h)
    oled_write_cmd(0xCF);    //
    oled_write_cmd(0xA1);    // Set Segment Re-map (A0h/A1h)
    oled_write_cmd(0xC8);    // Set COM Output Scan Direction (C0h/C8h)
    oled_write_cmd(0xA6);    // Set Normal/Inverse Display (A6h/A7h)
    oled_write_cmd(0xA8);    // Set Multiplex Ratio (A8h)
    oled_write_cmd(0x3F);    //
    oled_write_cmd(0xD3);    // Set Display Offset (D3h)
    oled_write_cmd(0x00);    // Set Lower Column Start Address for Page Addressing Mode (00h~0Fh)
    oled_write_cmd(0xD5);    // Set Display Clock Divide Ratio/ Oscillator Frequency (D5h)
    oled_write_cmd(0x80);    //
    oled_write_cmd(0xD9);    // Set Pre-charge Period (D9h)
    oled_write_cmd(0xF1);    //
    oled_write_cmd(0xDA);    // Set COM Pins Hardware Configuration (DAh)
    oled_write_cmd(0x12);    // Set Higher Column Start Address for Page Addressing Mode (10h~1Fh)
    oled_write_cmd(0xDB);    // Set VCOMH  Deselect Level (DBh)
    oled_write_cmd(0x40);    // Set Display Start Line (40h~7Fh)
    oled_write_cmd(0x20);    // Set Memory Addressing Mode (20h)
    oled_write_cmd(0x02);    // Set Lower Column Start Address for Page Addressing Mode (00h~0Fh)
    oled_write_cmd(0x8D);    //
    oled_write_cmd(0x14);    // Set Higher Column Start Address for Page Addressing Mode (10h~1Fh)
    oled_write_cmd(0xA4);    // Entire Display ON (A4h/A5h)
    oled_write_cmd(0xA6);    // Set Normal/Inverse Display (A6h/A7h)
    oled_write_cmd(0xAF);    // Set Display ON/OFF (AEh/AFh)
    return ESP_OK;
}

static esp_err_t oled_set_pos(uint8_t x_start, uint8_t y_start)
{
    oled_write_cmd(0xb0 + y_start);
    oled_write_cmd(((x_start & 0xf0) >> 4) | 0x10);
    oled_write_cmd((x_start & 0x0f) | 0x01);
    return ESP_OK;
}

static esp_err_t oled_clear(uint8_t data)
{
    uint8_t x;
    uint32_t buf[16];
    spi_trans_t trans = {0};
    trans.mosi = buf;
    trans.bits.mosi = 64 * 8;

    for (x = 0; x < 16; x++) {
        buf[x] = data << 24 | data << 16 | data << 8 | data;
    }

    // SPI transfers 64 bytes at a time, transmits twice, increasing the screen refresh rate
    for (x = 0; x < 8; x++) {
        oled_set_pos(0, x);
        oled_set_dc(1);
        spi_trans(HSPI_HOST, &trans);
        spi_trans(HSPI_HOST, &trans);
    }

    return ESP_OK;
}

static void IRAM_ATTR spi_event_callback(int event, void *arg)
{
    switch (event) {
        case SPI_INIT_EVENT: {

        }
        break;

        case SPI_TRANS_START_EVENT: {
            gpio_set_level(OLED_DC_GPIO, oled_dc_level);
        }
        break;

        case SPI_TRANS_DONE_EVENT: {

        }
        break;

        case SPI_DEINIT_EVENT: {
        }
        break;
    }
}

void app_main(void)
{
    uint8_t x = 0;

    ESP_LOGI(TAG, "init gpio");
    gpio_config_t io_conf;
    io_conf.intr_type = GPIO_INTR_DISABLE;
    io_conf.mode = GPIO_MODE_OUTPUT;
    io_conf.pin_bit_mask = OLED_PIN_SEL;
    io_conf.pull_down_en = 0;
    io_conf.pull_up_en = 1;
    gpio_config(&io_conf);

    ESP_LOGI(TAG, "init hspi");
    spi_config_t spi_config;
    // Load default interface parameters
    // CS_EN:1, MISO_EN:1, MOSI_EN:1, BYTE_TX_ORDER:1, BYTE_TX_ORDER:1, BIT_RX_ORDER:0, BIT_TX_ORDER:0, CPHA:0, CPOL:0
    spi_config.interface.val = SPI_DEFAULT_INTERFACE;
    // Load default interrupt enable
    // TRANS_DONE: true, WRITE_STATUS: false, READ_STATUS: false, WRITE_BUFFER: false, READ_BUFFER: false
    spi_config.intr_enable.val = SPI_MASTER_DEFAULT_INTR_ENABLE;
    // Cancel hardware cs
    spi_config.interface.cs_en = 0;
    // MISO pin is used for DC
    spi_config.interface.miso_en = 0;
    // CPOL: 1, CPHA: 1
    spi_config.interface.cpol = 1;
    spi_config.interface.cpha = 1;
    // Set SPI to master mode
    // 8266 Only support half-duplex
    spi_config.mode = SPI_MASTER_MODE;
    // Set the SPI clock frequency division factor
    spi_config.clk_div = SPI_10MHz_DIV;
    // Register SPI event callback function
    spi_config.event_cb = spi_event_callback;
    spi_init(HSPI_HOST, &spi_config);

    ESP_LOGI(TAG, "init oled");
    oled_init();
    oled_clear(0x00);

    while (1) {
        oled_clear(x);
        oled_delay_ms(1000);
        x++;
    }
}


text:
#pragma once

#include <vector>
#include <CrtDbg.h>

#include "Basic/UtilMath.h"
#include "Basic/UtilTime.h"
#include "Basic/Statistic.h"
#include "Basic/Mtrx.h"
#include "../ModelBase/WeatherBasedSimulation.h"

namespace WBSF
{
	class CIndividualInfo
	{
	public:
		CIndividualInfo(CTRef creationDate = CTRef(), double age = 0, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0, double scaleFactor = 0)
		{
			m_creationDate = creationDate;
			m_age = age;
			m_sex = sex;
			m_bFertil = bFertil;
			m_generation = generation;
			m_scaleFactor = scaleFactor;
		}

		CTRef m_creationDate;
		double m_age;
		TSex m_sex;
		bool m_bFertil;
		size_t m_generation;
		double m_scaleFactor;
	};

	class CInitialPopulation : public std::vector < CIndividualInfo >
	{
	public:

		CInitialPopulation(size_t nbObjects, double initialPopulation, double age, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0);
		CInitialPopulation(CTRef peakDay = CTRef(), double sigma = 0, size_t nbObjects = 400, double initialPopulation = 100, double age = 0, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0);
		void Initialize(size_t nbObjects, double initialPopulation, double age, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0);
		void Initialize(CTRef peakDay, double sigma = 0, size_t nbObjects = 400, double initialPopulation = 100, double age = 0, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0);

		void UpdateYear(int year)
		{
			for (iterator it = begin(); it != end(); it++)
				it->m_creationDate.m_year = year;
		}
	};

	class CTStatMatrix;

	typedef std::vector<double> _CModelStat;
	class CModelStat : public _CModelStat
	{
	public:

		CModelStat(size_t nbStat = 0, double initValue = 0) :_CModelStat(nbStat, initValue){}
		void Reset(double v)
		{
			for (size_t i = 0; i < size(); i++)
				at(i) = v;
		}

		double GetPourcent(size_t stat, size_t reference)const
		{
			_ASSERTE(stat >= 0 && stat < size());
			_ASSERTE(reference >= 0 && reference < size());

			return at(reference)>0 ? at(stat) / at(reference) * 100 : 0;
		}

		CModelStat& operator +=(const CModelStat& stat)
		{
			_ASSERTE(size() == stat.size());
			for (size_t i = 0; i < size(); i++)
				at(i) += stat.at(i);

			return *this;
		}

		double GetAverageInstar(size_t f, size_t F, size_t l, bool bStopDevLast = false)const
		{
			const CModelStat& me = (CModelStat&)(*this);

			double nbValue = me[f];
			double sum = me[f] * F;

			for (size_t i = f; i <= l; i++)
			{
				int iStopDev = (i == l && bStopDevLast) ? -1 : 0;

				nbValue += me[f + i];
				sum += me[f + i] * (F + i + iStopDev);
			}

			_ASSERTE(nbValue >= 0 && sum >= 0);
			return nbValue > 0 ? sum / nbValue : -999;
		}

	};

	class CTStatMatrix;
	typedef std::vector<CModelStat> CModelStatVectorBase;
	class CModelStatVector : public CModelStatVectorBase
	{
	public:

		CModelStatVector(size_t size = 0, CTRef firstDate = CTRef(), short nbStat = 0, double initValue = 0, const std::string& header = ""){ m_missingValue = -9999; Init(size, firstDate, nbStat, initValue, header); }
		CModelStatVector(const CTPeriod& p, size_t nbStat = 0, double initValue = 0, const std::string& header = ""){ m_missingValue = -9999; Init(p, nbStat, initValue, header); }

		CModelStatVector(const CModelStatVector& in, CTM TM=CTM(), size_t stat = MEAN);
		CModelStatVector(const CModelStatVector& in, const CTTransformation& TT, size_t stat);
		CModelStatVector(const CTStatMatrix& in, size_t stat);

		void Init(size_t size, CTRef firstDate, size_t nbStat, double initValue = 0, const std::string& header = ""){ m_firstTRef = firstDate; m_nbStat = nbStat; m_header = header; resize(size, initValue); }
		void Init(const CTPeriod& p, size_t nbStat, double initValue = 0, const std::string& header = ""){ Init(p.GetNbRef(), p.Begin(), nbStat, initValue, header); }
		void Init(const CModelStatVector& in, CTM TM=CTM(), size_t stat = MEAN);
		void Init(const CModelStatVector& in, const CTTransformation& TT, size_t stat);

		void Init(const CTStatMatrix& in, size_t stat);

		void Reset(){ Init(0, CTRef(), 0, 0); }

		size_t GetRows()const{ return size(); }
		size_t GetCols()const{ return m_nbStat; }
		void resize(size_t size, size_t nbStat, double defaultValue){ m_nbStat = nbStat; resize(size, defaultValue); }
		void resize(size_t size, double defaultValue = 0)
		{
			CModelStatVectorBase::resize(size);
			for (size_t i = 0; i < size; i++)
				at(i).resize(m_nbStat, defaultValue);
		}

		CModelStatVector& operator=(const CModelStatVector& in);
		CModelStatVector& swap(CModelStatVector& in);

		bool HaveData()const;
		__int32 GetFirstIndex(size_t stat, const std::string& op, double threshold, int nbDayBefore = 1, const CTPeriod& p = CTPeriod())const;
		__int32 GetLastIndex(size_t stat, const std::string& op, double threshold, int nbDayAfter = 1, const CTPeriod& p = CTPeriod())const;
		CTRef GetFirstTRef(size_t v, const std::string& op, double threshold = 0, int nbDayBefore = 1, const CTPeriod& p = CTPeriod())const{ int i = GetFirstIndex(v, op, threshold, nbDayBefore, p); return i == -1 ? CTRef() : m_firstTRef + i; }
		CTRef GetLastTRef(size_t v, const std::string& op, double threshold = 0, int nbDayAfter = 1, const CTPeriod& p = CTPeriod())const{ int i = GetLastIndex(v, op, threshold, nbDayAfter, p); return i == -1 ? CTRef() : m_firstTRef + i; }
		CTPeriod GetTPeriod(size_t v, const std::string& op, double threshold = 0, int nbDayBefore = 1, int nbDayAfter = 1, const CTPeriod& p = CTPeriod())const{ return CTPeriod(GetFirstTRef(v, op, threshold, nbDayBefore, p), GetLastTRef(v, op, threshold, nbDayAfter, p)); }

		CStatistic GetStat(size_t v, const CTPeriod& period = CTPeriod())const;

		CTRef GetFirstTRef()const{ return m_firstTRef; }
		void SetFirstTRef(CTRef firstDate){ m_firstTRef = firstDate; }
		CTRef GetLastTRef()const{ return m_firstTRef + (size() - 1); }

		using CModelStatVectorBase::at;
		const CModelStat& at(CTRef d)const{ ASSERT(d.GetTM() == m_firstTRef.GetTM()); return at(d - m_firstTRef); }
		CModelStat& at(CTRef d){ ASSERT(d.GetTM() == m_firstTRef.GetTM());  return at(d - m_firstTRef); }
		using CModelStatVectorBase::operator[];
		const CModelStat& operator [](CTRef d)const{ return at(d); }
		CModelStat& operator [](CTRef d){ return at(d); }
		size_t Insert(CTRef r, const CModelStat& row);

		CTM GetTM()const{ return m_firstTRef.GetTM(); }
		CTPeriod GetTPeriod()const{ return CTPeriod(m_firstTRef, m_firstTRef + (size() - 1)); }
		bool IsInside(CTRef d)const{ return GetTPeriod().IsInside(d); }
		__int32 GetNbDay(size_t v, const CMathEvaluation& op, const CTPeriod& p, bool bConsecutive, double MISSING = -999)const;

		void WriteStream(std::ostream& stream)const;
		ERMsg ReadStream(std::istream& stream);

		void ConvertValue(float value1, float value2);
		size_t GetNbStat()const{ return m_nbStat; }
		CInitialPopulation GetInitialPopulation(size_t var, size_t nbObject = 400, double initialPopulation = 100, double age = 0, TSex sex = RANDOM_SEX, bool bFertil = false, size_t generation = 0, CTPeriod p = CTPeriod())const;
		CInitialPopulation GetInitialPopulation(size_t var, CTPeriod p)const{ return GetInitialPopulation(var, 400, 100, 0, RANDOM_SEX, false, 0, p); }
		void Transform(const CTM& TM, size_t s);//= WBSF::MEAN
		void Transform(const CTTransformation& TT, size_t s );//= WBSF::MEAN

		ERMsg Load(const std::string& filePath);
		ERMsg Load(std::istream& stream);

		ERMsg Save(const std::string& filePath)const;
		ERMsg Save(std::ostream& stream)const;

		double GetMissing()const{ return m_missingValue; }
		void SetMissing(double missing){ m_missingValue = missing; }

		static bool test_op(double value, const std::string& op, double threshold);
		void SetHeader(const std::string& header) {	m_header= header;}

	protected:

		CTRef m_firstTRef;
		size_t m_nbStat;
		double m_missingValue;
		std::string m_header;
	};

	template <__int32 T, const char * U = NULL>
	class CModelStatVectorTemplate : public CModelStatVector
	{
	public:

		CModelStatVectorTemplate(size_t size = 0, CTRef firstDate = CTRef(), double initValue = 0) :CModelStatVector(size, firstDate, T, initValue, U ? U : ""){}
		CModelStatVectorTemplate(const CTPeriod& p, double initValue = 0) :CModelStatVector(p, T, initValue, U ? U : ""){}
		void Init(size_t size = 0, CTRef firstDate = CTRef(), double initValue = 0){ CModelStatVector::Init(size, firstDate, T, initValue, U ? U : ""); }
		void Init(const CTPeriod& p, double initValue = 0){ CModelStatVector::Init(p, T, initValue, U ? U : ""); }

	};

	//*********************************************************************************************************

	template <class T>
	class CTReferencedMatrixIterator
	{
	public:

		CTReferencedMatrixIterator(CMatrix<T>& matrix, size_t row) :
			m_matrix(matrix),
			m_row(row)//actual level of the reference
		{}

		T& operator[](size_t col)	{ return m_matrix[m_row][col]; }
		const T& operator[](size_t col)const{ return m_matrix[m_row][col]; }

	protected:

		CMatrix<T>& m_matrix;
		size_t m_row;
	};

	template <class T>
	class CTReferencedMatrix : public CMatrix < T >
	{
	public:

		CTPeriod m_period;

		CTReferencedMatrix(CTPeriod period = CTPeriod(), size_t nbVars = 0)
		{
			Init(period, nbVars);
		}

		void Init(CTPeriod period = CTPeriod(), size_t nbVars = 0)
		{
			m_period = period;
			CMatrix::resize(m_period.GetNbRef(), nbVars);
			//resize_rows(m_period.GetNbRef());
			//resize_cols(nbVars);
		}

		CTReferencedMatrix(const CTReferencedMatrix& in){ operator=(in); }

		CTReferencedMatrix& operator=(const CTReferencedMatrix& in)
		{
			if (&in != this)
			{
				CMatrix<T>::operator =(in);
				m_period = in.m_period;
			}

			return *this;
		}

		CTRef GetFirstTRef()const{ return m_period.Begin(); }
		CTM GetTM()const{ return m_period.GetTM(); }
		bool IsInit()const{ return m_period.IsInit(); }

		using CMatrix<T>::operator[];
		CTReferencedMatrixIterator<T> operator[](const CTRef& TRef)const{ return at(TRef); }
		CTReferencedMatrixIterator<T> operator[](const CTRef& TRef){ return at(TRef); }
		CTReferencedMatrixIterator<T> at(const CTRef& TRef)const{ return CTReferencedMatrixIterator<T>(*this, TRef - m_period.Begin()); }
		CTReferencedMatrixIterator<T> at(const CTRef& TRef){ return CTReferencedMatrixIterator<T>(*this, TRef - m_period.Begin()); }

		CTRef GetTRef(size_t i)const{ return (m_period.Begin() + i); }

		T& operator()(CTRef TRef, size_t col)
		{
			CMatrix<T>& me = *this;
			return me[TRef - m_period.Begin()][col];
		}

		const T& operator()(CTRef TRef, size_t col)const
		{
			CMatrix<T>& me = *this;
			return me[TRef - m_period.Begin()][col];
		}
	};

	typedef CTReferencedMatrix<CStatistic> CTStatMatrixBase;
	class CTStatMatrix : public CTStatMatrixBase
	{
	public:

		CTStatMatrix(CTPeriod period = CTPeriod(), size_t nbVar=0);
		CTStatMatrix(const CModelStatVector& input, const CTM& TM = CTM());
		CTStatMatrix(const CModelStatVector& input, const CTTransformation& TT);

		void Init(const CModelStatVector& in, const CTM& TM = CTM());
		void Init(const CModelStatVector& in, const CTTransformation& TT);

		void Transform(const CTM& TM);
		void Transform(const CTTransformation& TT);
	};

	struct ModelInterface
	{

		void Transform(const CTM& TM, const CModelStatVector& in, CModelStatVector& out, size_t s){ Transform(CTTransformation(in.GetTPeriod(), TM), in, out, s); }
		void Transform(const CTTransformation& TT, const CModelStatVector& in, CModelStatVector& out, size_t s);
		void Transform(const CTM& TM, const CModelStatVector& in, CTStatMatrix& out){ Transform(CTTransformation(in.GetTPeriod(), TM), in, out); }
		void Transform(const CTTransformation& TT, const CModelStatVector& in, CTStatMatrix& out);

	};

}//namespace WBSF


text:
@extends('layouts.app', ['navbar_articles' => ' active'])

@include('common.breadcrumbs.breadcrumbs_render', ['args' => [$category]])

@section('content')

 Recipes - all {{ Illuminate\Support\Str::plural(ucwords($category)) }} ({{ $articles->total() }} items)

{!! $articles->links() !!}

            @foreach ($articles as $article)
                @include('articles._dish-list')
            @endforeach

{!! $articles->links() !!}

@endsection


text:
require 'cucumber/formatter/io'
require 'cucumber/formatter/message_builder'

module Cucumber
  module Formatter
    # The formatter used for <tt>--format message</tt>
    class Message < MessageBuilder
      include Io

      def initialize(config)
        @io = ensure_io(config.out_stream, config.error_stream)
        super(config)
      end

      def output_envelope(envelope)
        @io.write(envelope.to_json)
        @io.write("\n")
      end
    end
  end
end


text:
package org.kuali.rice.krad.uif;

/**
 * General constants used within the User Interface Framework.
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class UifConstants {
    public static final String CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME = "methodToCall";
    public static final String DEFAULT_MODEL_NAME = "KualiForm";
    public static final String COMPONENT_MODEL_NAME = "Component";
    public static final String DEFAULT_VIEW_NAME = "default";
    public static final String COMPONENT_ID_PREFIX = "u";
    public static final String SUFFIX_SEPARATOR = "_";

    public static final String DEFAULT_THEMES_DIRECTORY = "/themes";
    public static final String DEFAULT_IMAGES_DIRECTORY = "images";
    public static final String DEFAULT_SCRIPTS_DIRECTORY = "scripts";
    public static final String DEFAULT_STYLESHEETS_DIRECTORY = "stylesheets";
    public static final String THEME_DERIVED_PROPERTY_FILE = "theme-derived.properties";
    public static final String THEME_CSS_FILES = "themeCssFiles";
    public static final String THEME_JS_FILES = "themeJsFiles";
    public static final String THEME_DEV_JS_FILES = "devJsIncludes";
    public static final String THEME_LESS_FILES = "themeLessFiles";

    public static final String SPRING_VIEW_ID = "/krad/WEB-INF/ftl/uifRender";
    public static final String SPRING_REDIRECT_ID = "/krad/WEB-INF/ftl/redirect";
    public static final String REDIRECT_PREFIX = "redirect:";

    public static final String EL_PLACEHOLDER_PREFIX = "@{";
    public static final String EL_PLACEHOLDER_SUFFIX = "}";
    public static final String NO_BIND_ADJUST_PREFIX = "#form.";
    public static final String SEQUENCE_PREFIX = "#sequence";
    public static final String DEFAULT_PATH_BIND_ADJUST_PREFIX = "#dp.";
    public static final String FIELD_PATH_BIND_ADJUST_PREFIX = "#fp.";
    public static final String LINE_PATH_BIND_ADJUST_PREFIX = "#lp.";
    public static final String NODE_PATH_BIND_ADJUST_PREFIX = "#np.";
    public static final String STRING_TEMPLATE_PARAMETER_PLACEHOLDER = "@";

    public static final String SPACE = " ";

    public static final String REQUEST_FORM = "requestForm";

    public static final String BLOCKUI_NAVOPTS = "navigation";
    public static final String BLOCKUI_REFRESHOPTS = "refresh";

    public static final String VALIDATE_VIEWS_ONBUILD = "validate.views.onbuild";

    public static final String MESSAGE_VIEW_ID = "Uif-MessageView";
    public static final String SESSION_TIMEOUT_VIEW_ID = "Uif-SessionTimeoutView";
    public static final String LOGGED_OUT_VIEW_ID = "Uif-LoggedOutView";
    public static final String GROUP_VALIDATION_DEFAULTS_MAP_ID = "Uif-GroupValidationMessages-DataDefaults";
    public static final String FIELD_VALIDATION_DEFAULTS_MAP_ID = "Uif-FieldValidationMessages-DataDefaults";
    public static final String ACTION_DEFAULTS_MAP_ID = "Uif-Action-DataDefaults";
    public static final String REQUIRED_INDICATOR_ID = "Uif-RequiredIndicator";
    public static final String REQUIRED_NEXT_STATE_INDICATOR_ID = "Uif-RequiredIndicator-ForNextState";
    public static final String REFERER = "Referer";
    public static final String NO_RETURN = "";

    public static final String EXPORT_FILE_NAME = "export.xml";
    public static final String KUALI_FORM_ATTR = "KualiForm";

    public static final String ICON_ONLY_PLACEMENT = "ICON_ONLY";
    public static final String PROPERTY_EDITOR_REGISTRY = "rice.krad.uif.propertyEditorRegistry";

    public static enum ReadOnlyListTypes {
        DELIMITED, BREAK, OL, UL
    }

    public static enum Position {
        BOTTOM, LEFT, RIGHT, TOP
    }

    public static enum Order {
        FIRST, LINE_FIRST, NEXT_INPUT, SELF
    }

    public static enum NavigationType {
        VERTICAL_MENU, HORIZONTAL_TABS
    }

    public static enum Orientation {
        HORIZONTAL, VERTICAL
    }

    public static enum ViewType {
        DEFAULT, DOCUMENT, INQUIRY, LOOKUP, MAINTENANCE, INCIDENT, TRANSACTIONAL;
    }

    public static enum ControlType {
        CHECKBOX, CHECKBOXGROUP, FILE, GROUP, HIDDEN, RADIOGROUP, SELECT,
        TEXTAREA, TEXT, USER
    }

    public static enum WorkflowAction {
        SAVE, ROUTE, BLANKETAPPROVE, APPROVE, DISAPPROVE, CANCEL, FYI, ACKNOWLEDGE, COMPLETE, SENDADHOCREQUESTS, RECALL
    }

    public static enum SuperUserWorkflowAction {
        TAKEACTION, APPROVE, DISAPPROVE
    }

    /**
     * Enum of return types. Used to return the type of response being sent by the server to the client.
     */
    public enum AjaxReturnTypes {
        UPDATEPAGE("update-page"), UPDATECOMPONENT("update-component"), REDIRECT("redirect"),
        UPDATEVIEW("update-view"), UPDATENONE("update-none"), DISPLAYLIGHTBOX("display-lightbox"),
        UPDATEDIALOG("update-dialog");

        private String key;

        AjaxReturnTypes(String key) {
            this.key = key;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }
    }

    public static enum WindowTargets {
        _blank, _self, _parent, _top
    }

    public static enum DialogDismissOption {
        IMMEDIATE, PRESUBMIT, REQUEST
    }

    public enum WizardAction {
        NONE(0), BACK(-1), CONTINUE(1);

        private int step;

        WizardAction(int step) {
            this.step = step;
        }

        public int getStep() {
            return step;
        }

        public void setStep(int step) {
            this.step = step;
        }
    }

    public static class ControllerMappings {
        public static final String EXPORT = "export";
    }

    public static class MethodToCallNames {
        public static final String NAVIGATE = "navigate";
        public static final String START = "start";
        public static final String SAVE = "save";
        public static final String SEARCH = "search";
        public static final String CLOSE = "close";
        public static final String CLOSE_EDIT_LINE_DIALOG = "closeEditLineDialog";
        public static final String ADD_LINE = "addLine";
        public static final String DELETE_LINE = "deleteLine";
        public static final String REFRESH = "refresh";
        public static final String CANCEL = "cancel";
        public static final String RETRIEVE_EDIT_LINE_DIALOG = "retrieveEditLineDialog";
        public static final String SESSION_TIMEOUT = "sessionTimeout";
        public static final String TABLE_JSON = "tableJsonRetrieval";
        public static final String TABLE_DATA = "tableDataRetrieval";
        public static final String TABLE_XML = "tableXmlRetrieval";
        public static final String INQUIRY_XML = "inquiryXmlRetrieval";
        public static final String TABLE_CSV = "tableCsvRetrieval";
        public static final String TABLE_XLS = "tableXlsRetrieval";
        public static final String DISPLAY_SUPER_USER_DOCUMENT = "displaySuperUserDocument";
    }

    public static class ActionEvents {
        public static final String ADD_LINE = "addLine";
        public static final String ADD_BLANK_LINE = "addBlankLine";
        public static final String EDIT_LINE = "editLine";
    }

    public static class LayoutComponentOptions {
        public static final String COLUMN_SPAN = "colSpan";
        public static final String ROW_SPAN = "rowSpan";
    }

    public static class RowSelection {
        public static final String ALL = "all";
        public static final String ODD = "odd";
        public static final String EVEN = "even";
    }

    public static class IdSuffixes {
        public static final String ACTION = "_act";
        public static final String ADD_LINE = "_add";
        public static final String CONTROL = "_control";
        public static final String ATTRIBUTE = "_attribute";
        public static final String COLUMN = "_c";
        public static final String COLUMN_SORTS = "_columnSorts";
        public static final String COMPARE = "_comp";
        public static final String CONSTRAINT = "_constraint";
        public static final String DELETE_LINE = "_del";
        public static final String DETAIL_LINK = "_detLink";
        public static final String DETAIL_GROUP = "_detGroup";
        public static final String DIALOG_GROUP = "_dialogGroup";
        public static final String EDIT_DETAIL_BUTTON = "_editDetButton";
        public static final String EDIT_DETAIL_GROUP = "_editDetGroup";
        public static final String DIRECT_INQUIRY = "_directinquiry";
        public static final String DISCLOSURE_CONTENT = "_disclosureContent";
        public static final String ERRORS = "_errors";
        public static final String INSTRUCTIONAL = "_instructional";
        public static final String LINE = "_line";
        public static final String LABEL = "_label";
        public static final String FIELDSET = "_fieldset";
        public static final String SUB = "_sub";
        public static final String SUGGEST = "_suggest";
        public static final String QUICK_FINDER = "_quickfinder";
        public static final String SPAN = "_span";
        public static final String TAB = "_tab";
        public static final String HEADER_WRAPPER = "_headerWrapper";
        public static final String HEADER_UPPER_GROUP = "_headerUpperGroup";
        public static final String HEADER_RIGHT_GROUP = "_headerRightGroup";
        public static final String HEADER_LOWER_GROUP = "_headerLowerGroup";
        public static final String HELP_WRAPPER = "_helpWrapper";
        public static final String HELP = "_help";
    }

    public static class ViewPhases {
        public static final String INITIALIZE = "INITIALIZE";
        public static final String APPLY_MODEL = "APPLY_MODEL";
        public static final String FINALIZE = "FINALIZE";
        public static final String RENDER = "RENDER";
        public static final String PRE_PROCESS = "PRE_PROCESS";
    }

    public static class ViewStatus {
        public static final String CACHED = "X";
        public static final String CREATED = "C";
        public static final String INITIALIZED = "I";
        public static final String MODEL_APPLIED = "M";
        public static final String FINAL = "F";
        public static final String RENDERED = "R";
    }

    public static class PostMetadata {
        public static final String INPUT_FIELD_ATTRIBUTE_QUERY = "attributeQuery";
        public static final String INPUT_FIELD_SUGGEST = "suggest";
        public static final String INPUT_FIELD_SUGGEST_QUERY = "suggestQuery";
        public static final String INPUT_FIELD_IS_UPPERCASE = "isUppercase";
        public static final String LABEL = "label";
        public static final String PATH = "path";
        public static final String SIMPLE_CONSTRAINT = "simpleConstraint";
        public static final String VALID_CHARACTER_CONSTRAINT = "validCharacterConstraint";
        public static final String CASE_CONSTRAINT = "caseConstraint";
        public static final String MUST_OCCUR_CONSTRAINTS = "mustOccurConstraints";
        public static final String PREREQ_CONSTSTRAINTS = "prerequisiteConstraints";
        public static final String BINDING_PATH = "bindingPath";
        public static final String BINDING_INFO = "bindingInfo";
        public static final String ADD_LINE_BINDING_INFO = "addLineBindingInfo";
        public static final String ADD_LINE_PLACEMENT = "addLinePlacement";
        public static final String BASE_ID = "BASE_ID";
        public static final String COLL_DISPLAY_START = "displayStart";
        public static final String COLL_DISPLAY_LENGTH = "displayLength";
        public static final String COLL_LABEL = "collectionLabel";
        public static final String COLL_LOOKUP_FIELD_CONVERSIONS = "collectionLookup.fieldConversions";
        public static final String COLL_OBJECT_CLASS = "collectionObjectClass";
        public static final String DUPLICATE_LINE_PROPERTY_NAMES = "duplicateLinePropertyNames";
        public static final String DUPLICATE_LINE_LABEL_STRING = "duplicateLineLabelString";
        public static final String RESET_DATA_ON_REFRESH = "resetDataOnRefresh";
        public static final String STATE_MAPPING = "stateMapping";
        public static final String STATE_OBJECT_BINDING_PATH = "stateObjectBindingPath";
        public static final String SUGGEST = "suggest";
        public static final String QUICKFINDER_FOCUS_ID = "quickfinderFocusId";
        public static final String QUICKFINDER_JUMP_TO_ID = "quickfinderJumpToId";
        public static final String QUICKFINDER_CALLBACK_METHOD_TO_CALL = "quickfinderCallbackMethodToCall";
        public static final String QUICKFINDER_CALLBACK_METHOD = "quickfinderCallbackMethod";
        public static final String QUICKFINDER_CALLBACK_CONTEXT = "quickfinderCallbackContext";
        public static final String QUICKFINDER_CALLBACK_CONTEXT_PROPERTY_LINE_INDEX = "lineIndex";
        public static final String FILTERABLE_LOOKUP_CRITERIA = "filterableLookupCriteria";
    }

    public static class LookupCriteriaPostMetadata {
        public static final String COMPONENT_ID = "componentId";
        public static final String DISABLE_WILDCARDS_AND_OPERATORS = "disableWildcardsAndOperators";
        public static final String HIDDEN = "hidden";
        public static final String REQUIRED = "required";
        public static final String SECURE_VALUE = "secureValue";
        public static final String VALID_CHARACTERS_CONSTRAINT = "validCharactersConstraint";
    }

    public static class ContextVariableNames {
        public static final String COLLECTION_GROUP = "collectionGroup";
        public static final String CONFIG_PROPERTIES = "ConfigProperties";
        public static final String COMPONENT = "component";
        public static final String CONSTANTS = "Constants";
        public static final String DOCUMENT_ENTRY = "DocumentEntry";
        public static final String INDEX = "index";
        public static final String IS_ADD_LINE = "isAddLine";
        public static final String LINE = "line";
        public static final String LINE_SUFFIX = "lineSuffix";
        public static final String READONLY_LINE = "readOnlyLine";
        public static final String MANAGER = "manager";
        public static final String NODE = "node";
        public static final String NODE_PATH = "nodePath";
        public static final String PARENT = "parent";
        public static final String THEME_IMAGES = "ThemeImages";
        public static final String UIF_CONSTANTS = "UifConstants";
        public static final String VIEW = "view";
        public static final String VIEW_HELPER = "ViewHelper";
        public static final String PARENT_LINE = "parentLine";
        public static final String WIZARD = "wizard";
        public static final String USER_SESSION = "userSession";
    }

    public static class TableToolsKeys {
        public static final String AASORTING = "aaSorting";
        public static final String BAUTO_TYPE = "bAutoType";
        public static final String BPROCESSING = "bProcessing";
        public static final String BSERVER_SIDE = "bServerSide";
        public static final String SDOM = "sDom";
        public static final String CELL_CLASS = "sClass";
        public static final String MDATA = "mDataProp";
        public static final String LANGUAGE = "oLanguage";
        public static final String EMPTY_TABLE = "sEmptyTable";
        public static final String AO_COLUMNS = "aoColumns";
        public static final String AO_COLUMN_DEFS = "aoColumnDefs";
        public static final String SORT_SKIP_ROWS = "aiSortingSkipRows";
        public static final String SORT_DATA_TYPE = "sSortDataType";
        public static final String SORTABLE = "bSortable";
        public static final String TARGETS = "aTargets";
        public static final String VISIBLE = "bVisible";
        public static final String SORT_TYPE = "sType";
        public static final String TABLE_SORT = "bSort";
        public static final String SAJAX_SOURCE = "sAjaxSource";
        public static final String FOOTER_CALLBACK = "fnFooterCallback";
        public static final String AA_DATA = "aaData";
        public static final String DEFER_RENDER = "bDeferRender";
        public static final String SDOWNLOAD_SOURCE = "sDownloadSource";
        public static final String SERVER_PARAMS = "fnServerParams";
    }

    public static class TableToolsValues {
        public static final String DOM_TEXT = "dom-text";
        public static final String DOM_SELECT = "dom-select";
        public static final String DOM_CHECK = "dom-checkbox";
        public static final String DOM_RADIO = "dom-radio";

        // sort types:

        public static final String NUMERIC = "numeric";
        public static final String STRING = "string";
        public static final String DATE = "kuali_date";
        public static final String PERCENT = "kuali_percent";
        public static final String CURRENCY = "kuali_currency";
        public static final String TIMESTAMP = "kuali_timestamp";

        public static final String FALSE = "false";
        public static final String TRUE = "true";

        public static final int ADD_ROW_DEFAULT_INDEX = 0;
        public static final String JSON_TEMPLATE = "components/element/dataTablesJson.ftl";
    }

    public static class TableLayoutValues {
        public static final int ACTIONS_COLUMN_LEFT_INDEX = 1;
        public static final int ACTIONS_COLUMN_RIGHT_INDEX = -1;
    }

    public static class PageRequest {
        public static final String PREV = "prev";
        public static final String NEXT = "next";
        public static final String FIRST = "first";
        public static final String LAST = "last";
        public static final String PAGE_NUMBER = "pageNumber";
    }

    public static class TabOptionKeys {
        public static final String ACTIVE = "active";
    }

    public static class TitleAppendTypes {
        public static final String DASH = "dash";
        public static final String PARENTHESIS = "parenthesis";
        public static final String REPLACE = "replace";
        public static final String NONE = "none";
    }

    public static class ComponentProperties {
        public static final String HEADER_TEXT = "headerText";
        public static final String DEFAULT_VALUE = "defaultValue";
        public static final String DEFAULT_VALUES = "defaultValues";
    }

    public static class UrlParams {
        public static final String ACTION_EVENT = "actionEvent";
        public static final String FORM_KEY = "formKey";
        public static final String VIEW_ID = "viewId";
        public static final String PAGE_ID = "pageId";
        public static final String HISTORY = "history";
        public static final String LAST_FORM_KEY = "lastFormKey";
        public static final String LOGIN_USER = "__login_user";
    }

    public static class Messages {
        public static final String VALIDATION_MSG_KEY_PREFIX = "validation.";
        public static final String STATE_PREFIX = "validation.statePrefix";
        public static final String PROPERTY_NAME_PREFIX = "validation.propertyNamePrefix";
    }

    public static class MessageKeys {
        public static final String LOOKUP_RESULT_MESSAGES = "LookupResultMessages";
        public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound";
        public static final String OPTION_ALL = "option.all";
    }

    public static class ClientSideVariables {
        public static final String KRAD_IMAGE_LOCATION = "kradImageLocation";
        public static final String KRAD_SCRIPT_CLEANUP = "scriptCleanup";
        public static final String KRAD_URL = "kradUrl";
        public static final String APPLICATION_URL = "applicationUrl";
    }

    public static class RefreshCallerTypes {
        public static final String LOOKUP = "LOOKUP";
        public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP";
        public static final String QUESTION = "QUESTION";
    }

    public static class RefreshStatus {
        public static final String ERROR = "ERROR";
    }

    public static final class HistoryFlow {
        public static final String HISTORY_MANAGER = "historyManager";
        public static final String FLOW = "flow";
        public static final String START = "start";
        public static final String RETURN_TO_START = "returnToStart";
        public static final String SEPARATOR = "@@";
    }

    public static final class RoleTypes {
        public static final String ACTION = "Action";
        public static final String CONTROL = "Control";
        public static final String DATA_SCRIPT = "dataScript";
        public static final String INPUT_FIELD = "InputField";
        public static final String GROUP = "Group";
        public static final String GROUP_TOTAL = "groupTotal";
        public static final String TOTAL = "total";
        public static final String TOTALS_BLOCK = "totalsBlock";
        public static final String PAGE = "Page";
        public static final String PAGE_TOTAL = "pageTotal";
        public static final String ROW_GROUPING = "RowGrouping";
        public static final String VIEW = "View";
    }

    public static final class DataAttributes {
        public static final String TYPE = "type";
        public static final String ROLE = "role";
        public static final String REQ_INDICATOR = "req_indicator";
        public static final String ONCLICK = "onClick";
        public static final String SUBMIT_DATA = "submit_data";
        public static final String HAS_MESSAGES = "has_messages";
        public static final String SERVER_MESSAGES = "server_messages";
        public static final String VALIDATION_MESSAGES = "validation_messages";
        public static final String ACTION_DEFAULTS = "action_defaults";
        public static final String GROUP_VALIDATION_DEFAULTS = "group_validation_defaults";
        public static final String FIELD_VALIDATION_DEFAULTS = "field_validation_defaults";
        public static final String MESSAGES_FOR = "messages_for";
        public static final String PARENT = "parent";
        public static final String SUMMARIZE = "summarize";
        public static final String DISPLAY_MESSAGES = "displayMessages";
        public static final String CLOSEABLE = "closeable";
        public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages";
        public static final String DISPLAY_LABEL = "displayLabel";
        public static final String SHOW_PAGE_SUMMARY_HEADER = "showPageSummaryHeader";
        public static final String DISPLAY_HEADER_SUMMARY = "displayHeaderSummary";
        public static final String IS_TABLE_COLLECTION = "isTableCollection";
        public static final String HAS_OWN_MESSAGES = "hasOwnMessages";
        public static final String PAGE_LEVEL = "pageLevel";
        public static final String FORCE_SHOW = "forceShow";
        public static final String SECTIONS = "sections";
        public static final String ORDER = "order";
        public static final String RETURN = "return";
        public static final String SERVER_ERRORS = "serverErrors";
        public static final String SERVER_WARNINGS = "serverWarnings";
        public static final String SERVER_INFO = "serverInfo";
        public static final String VIGNORE = "vignore";
        public static final String TOTAL = "total";
        public static final String SKIP_TOTAL = "skip_total";
        public static final String LABEL = "label";
        public static final String GROUP = "group";
        public static final String LABEL_FOR = "label_for";
        public static final String CONTROL_FOR = "control_for";
        public static final String ADD_CONTROLS = "add_controls";
        public static final String EDIT_CONTROLS = "edit_controls";
        public static final String HEADER_FOR = "header_for";
        public static final String STICKY = "sticky";
        public static final String STICKY_FOOTER = "sticky_footer";
        public static final String DETAILS_DEFAULT_OPEN = "details_default_open";
        public static final String RENDER_DETAILS_EDIT = "render_details_edit";
        public static final String TAB_FOR = "tabfor";
        public static final String CHECKED = "checked";
        public static final String ENTER_KEY = "enter_key";
        public static final String DEFAULT_ENTER_KEY_ACTION = "default_enter_key_action";
        public static final String DISMISS = "dismiss";
        public static final String DISMISS_DIALOG_OPTION = "dismissdialogoption";
        public static final String DISMISS_RESPONSE = "response";
        public static final String DIALOG_RESPONSE_HANDLER = "response_handler";
        public static final String DIALOG_SHOW_HANDLER = "show_handler";
        public static final String DIALOG_HIDE_HANDLER = "hide_handler";
        public static final String DIALOG_HIDDEN_HANDLER = "hidden_handler";
        public static final String INLINE_EDIT = "inline_edit";
        public static final String DETACHED = "detached";
    }

    public static final String JS_REGEX_SPECIAL_CHARS = new String("$[\\^.|?*+()");

    public static final class ActionDataAttributes {
        public static final String AJAX_SUBMIT = "ajaxSubmit";
        public static final String CONFIRM_DIALOG_ID = "confirmDialogId";
        public static final String CONFIRM_PROMPT_TEXT = "confirm_prompttext";
        public static final String SUCCESS_CALLBACK = "successCallback";
        public static final String ERROR_CALLBACK = "errorCallback";
        public static final String PRE_SUBMIT_CALL = "preSubmitCall";
        public static final String LOADING_MESSAGE = "loadingMessage";
        public static final String DISABLE_BLOCKING = "disableBlocking";
        public static final String AJAX_RETURN_TYPE = "ajaxReturnType";
        public static final String REFRESH_ID = "refreshId";
        public static final String VALIDATE = "validate";
        public static final String DIRTY_ON_ACTION = "dirtyOnAction";
        public static final String CLEAR_DIRTY = "clearDirtyOnAction";
        public static final String PERFORM_DIRTY_VALIDATION = "performDirtyValidation";
        public static final String FOCUS_ID = "focusId";
        public static final String JUMP_TO_ID = "jumpToId";
        public static final String JUMP_TO_NAME = "jumpToName";
        public static final String FIELDS_TO_SEND = "fieldsToSend";
    }

    public static final class AriaAttributes {
        public static final String VALUE_NOW = "valuenow";
        public static final String VALUE_MAX = "valuemax";
        public static final String VALUE_MIN = "valuemin";
        public static final String VALUE_TEXT = "valuetext";
    }

    public static final class AriaRoles {
        public static final String PROGRESS_BAR = "progressbar";
    }

    public static final class HtmlAttributeValues {
        public static final String TARGET_BLANK = "_blank";
    }

    public static final class CaseConstraintOperators {
        public static final String HAS_VALUE = "has_value";
        public static final String EQUALS = "equals";
        public static final String GREATER_THAN_EQUAL = "greater_than_equal";
        public static final String LESS_THAN_EQUAL = "less_than_equal";
        public static final String NOT_EQUAL = "not_equal";
        public static final String NOT_EQUALS = "not_equals";
        public static final String GREATER_THAN = "greater_than";
        public static final String LESS_THAN = "less_than";
    }

    public static final class JsFunctions {
        public static final String COLLECTION_LINE_CHANGED = "collectionLineChanged";
        public static final String SHOW_LOOKUP_DIALOG = "showLookupDialog";
        public static final String HANDLE_SERVER_DIALOG_RESPONSE = "handleServerDialogResponse";
        public static final String INITIALIZE_VIEW_STATE = "initializeViewState";
        public static final String INITIALIZE_SESSION_TIMERS = "initializeSessionTimers";
        public static final String REDIRECT = "redirect";
        public static final String SET_CONFIG_PARM = "setConfigParam";
        public static final String SET_VALUE = "setValue";
        public static final String SHOW_GROWL = "showGrowl";
        public static final String SHOW_EDIT_LINE_DIALOG = "showEditLineDialog";
        public static final String SHOW_DIALOG = "showDialog";
        public static final String VALIDATE_ADD_LINE = "validateAddLine";
        public static final String VALIDATE_LINE = "validateLine";
        public static final String WRITE_CURRENT_PAGE_TO_SESSION = "writeCurrentPageToSession";
    }

    public static final String EVENT_NAMESPACE = "uif";

    public static final String BOX_LAYOUT_HORIZONTAL_ITEM_CSS = "uif-boxLayoutHorizontalItem";
    public static final String BOX_LAYOUT_VERTICAL_ITEM_CSS = "uif-boxLayoutVerticalItem";

    public static final class ConfigProperties {
        public static final String KRAD_IMAGES_URL = "krad.externalizable.images.url";
        public static final String KRAD_URL = "krad.url";
    }

    public static final class FileExtensions {
        public static final String CSS = ".css";
        public static final String JS = ".js";
        public static final String MIN = ".min";
        public static final String LESS = ".less";
    }

    public static final class WrapperTags {
        public static final String DIV = "div";
        public static final String SPAN = "span";
        public static final String P = "p";
        public static final String MAIN = "main";
        public static final String SECTION = "section";
        public static final String HEADER = "header";
        public static final String FOOTER = "footer";
        public static final String NAV = "nav";
    }

    public static final class MultiFileUploadOptions {
        public static final String URL = "url";
        public static final String ACCEPT_FILE_TYPES = "acceptFileTypes";
        public static final String MIN_SIZE = "minFileSize";
        public static final String MAX_SIZE = "maxFileSize";
    }

    public static final class KimLink {
        public static final String PRINCIPAL_ID = "principalId";
        public static final String PRINCIPAL_NAME = "principalName";
        public static final String ROLE_ID = "id";
        public static final String ROLE_NAME = "name";
        public static final String ROLE_NAMESPACE_CODE = "namespaceCode";
        public static final String GROUP_ID = "id";
        public static final String GROUP_NAME = "name";
        public static final String GROUP_NAMESPACE_CODE = "namespaceCode";
        public static final String BLANK_LINK = " ";
    }
}