text:
package com.alibaba.fastjson.serializer;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.concurrent.atomic.AtomicLongArray;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.JSONToken;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

/**
 * @author wenshao[szujobs@hotmail.com]
 */
public class AtomicLongArrayCodec implements ObjectSerializer, ObjectDeserializer {

    public final static AtomicLongArrayCodec instance = new AtomicLongArrayCodec();

    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        SerializeWriter out = serializer.getWriter();

        if (object == null) {
            if (out.isEnabled(SerializerFeature.WriteNullListAsEmpty)) {
                out.write("[]");
            } else {
                out.writeNull();
            }
            return;
        }

        AtomicLongArray array = (AtomicLongArray) object;
        int len = array.length();
        out.append('[');
        for (int i = 0; i < len; ++i) {
            long val = array.get(i);
            if (i != 0) {
                out.write(',');
            }
            out.writeLong(val);
        }
        out.append(']');
    }

    @SuppressWarnings("unchecked")
    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
        if (parser.getLexer().token() == JSONToken.NULL) {
            parser.getLexer().nextToken(JSONToken.COMMA);
            return null;
        }

        JSONArray array = new JSONArray();
        parser.parseArray(array);

        AtomicLongArray atomicArray = new AtomicLongArray(array.size());
        for (int i = 0; i < array.size(); ++i) {
            atomicArray.set(i, array.getLong(i));
        }

        return (T) atomicArray;
    }

    public int getFastMatchToken() {
        return JSONToken.LBRACKET;
    }
}


text:
package com.java110.community.dao.impl;

import com.alibaba.fastjson.JSONObject;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.community.dao.IParkingBoxAreaV1ServiceDao;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

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

/**
 * 类表述:
 * add by 吴学文 at 2021-10-18 00:15:30 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Service("parkingBoxAreaV1ServiceDaoImpl")
public class ParkingBoxAreaV1ServiceDaoImpl extends BaseServiceDao implements IParkingBoxAreaV1ServiceDao {

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

    /**
     * 保存停车场岗亭信息 到 instance
     * @param info   bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public int saveParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("保存 saveParkingBoxAreaInfo 入参 info : {}",info);

        int saveFlag = sqlSessionTemplate.insert("parkingBoxAreaV1ServiceDaoImpl.saveParkingBoxAreaInfo",info);

        return saveFlag;
    }

    /**
     * 查询停车场岗亭信息(instance)
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("查询 getParkingBoxAreaInfo 入参 info : {}",info);

        List<Map> businessParkingBoxAreaInfos = sqlSessionTemplate.selectList("parkingBoxAreaV1ServiceDaoImpl.getParkingBoxAreaInfo",info);

        return businessParkingBoxAreaInfos;
    }

    /**
     * 修改停车场岗亭信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public int updateParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("修改 updateParkingBoxAreaInfo 入参 info : {}",info);

        int saveFlag = sqlSessionTemplate.update("parkingBoxAreaV1ServiceDaoImpl.updateParkingBoxAreaInfo",info);

        return saveFlag;
    }

     /**
     * 查询停车场岗亭数量
     * @param info 停车场岗亭信息
     * @return 停车场岗亭数量
     */
    @Override
    public int queryParkingBoxAreasCount(Map info) {
        logger.debug("查询 queryParkingBoxAreasCount 入参 info : {}",info);

        List<Map> businessParkingBoxAreaInfos = sqlSessionTemplate.selectList("parkingBoxAreaV1ServiceDaoImpl.queryParkingBoxAreasCount", info);
        if (businessParkingBoxAreaInfos.size() < 1) {
            return 0;
        }

        return Integer.parseInt(businessParkingBoxAreaInfos.get(0).get("count").toString());
    }

}

redpajama_set_name: RedPajamaGithub


text:
The [hfactory-server-in-docker-machine](https://github.com/hfactory/hfactory-server-in-docker-machine) github project packages all the utilities necessary for a simple installation of HFactory Server via Docker. The image contains both an HBase standalone Docker and a HFactory Server inside a hfactoryserver Docker machine.

Restarting the containers allows you to start again with an empty HBase server.

## Prerequisites

To use the container, you need to have VirtualBox and Docker-machine installed.

### VirtualBox

In order to install VirtualBox, go to : https://www.virtualbox.org/wiki/Downloads

### Docker Machine

In order to install docker-machine, go to : http://docs.docker.com/machine/#installation

- Download the last version
- Put the command in the path

## Using the HFactory server in docker machine

For ease of use you can put the bin folder in your path.

### First initialization

Launch ```hfactory-env.sh init``` and edit the /etc/hosts file as required

### Using the containers

To start the containers simply use ```hfactory-env.sh start```

The hbase container is launched in host-only mode and you can connect to it directly using hfactoryserver for the hbase.zookeeper.quorum property

The hfactoryserver container is launched to listen on port 80 and you can connect to it directly using http://hfactoryserver

To stop the docker containers use ```hfactory-env.sh stop```

To read the logs ```hfactory-env.sh serverlog``` or ```hfactory-env.sh hbaselog```

To kill the containers if stopping it does not work ```hfactory-env.sh kill```

To restart the container ```hfactory-env.sh restart``` does stop/start

For getting the status ```hfactory-env.sh status``` gives you the docker processes running on the hfactoryserver instance

## docker-machine related commands

To launch the hfactoryserver docker machine ```hfactory-env.sh up```

To connect to it ```hfactory-env.sh ssh```

To stop it ```hbase-env.sh shutdown```

## Applications installation

```hfactory-env.sh putApp applicationFolder``` to add an application in the server

```hfactory-env.sh removeApp applicationName``` to remove an application from the server

## Advanced usage

To make the hbase container data persistent use ```export PERSISTS="true"```


text:
{-# LANGUAGE DeriveAnyClass        #-}
{-# LANGUAGE DeriveDataTypeable    #-}
{-# LANGUAGE DeriveGeneric         #-}
{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell       #-}
----------------------------------------------------------------------------
-- |
-- Module      :  Web.Skroutz.Model.Base.ShopLocationFormat
-- Copyright   :  (c) 2016 Remous-Aris Koutsiamanis
-- License     :  Apache License 2.0
-- Maintainer  :  Remous-Aris Koutsiamanis <ariskou@gmail.com>
-- Stability   :  alpha
-- Portability :  non-portable
--
-- Provides the 'ShopLocationFormat' type, a type representing the possible types
-- of formats for 'Web.Skroutz.Model.Base.ShopLocationAddress.ShopLocationAddress'
-- in 'Web.Skroutz.Model.Base.ShopLocation.ShopLocation's.
----------------------------------------------------------------------------
module Web.Skroutz.Model.Base.ShopLocationFormat
where

import           Control.DeepSeq (NFData)
import           Data.Data       (Data, Typeable)
import           GHC.Generics    (Generic)
import           Web.Skroutz.TH

data ShopLocationFormat = ShopLocationFormatStructured | ShopLocationFormatUnstructured
  deriving (Eq, Ord, Typeable, Data, Generic, Show, NFData)

makeLensesAndJSONSumType ''ShopLocationFormat "" "ShopLocationFormat"


text:
Extracted from [deepjs](https://github.com/deepjs/deepjs) core lib.

JavaScript Object Walker Tools.

## Install

```
> git clone https://github.com/nomocas/owalk.git
```
or

```
> npm install owalk
```
or

```
> bower install owalk
```

## Usage

You could either use it as an AMD module (requirejs, almond, ...) in your browser, or as a CommonJS module under nodejs, or by including the file directly in a script tag in your html page (owalk will be accessible in global window).

Requirejs :
```javascript
define(["require", "owalk/dist/owalk.full.min.js"], function(require, owalk){
	// do something
});
```

Nodejs :
```javascript
var owalk = require("owalk/dist/owalk.full.js);
// do something
```

Window global :
```html
<script src="/path/to/lib/owalk/dist/owalk.full.min.js"></script>
```

## Examples

## Tests

### Under nodejs

You need to have mocha installed globally before launching test.
```
> npm install -g mocha
```
Do not forget to install dev-dependencies. i.e. : from 'owalk' folder, type :
```
> npm install
```

then, always in 'owalk' folder simply enter :
```
> mocha
```

### In the browser

Simply serve "owalk" folder in you favorite web server then open ./index.html.

You could use the provided "gulp web server" by entering :
```
> gulp serve-test
```

## Licence

The [MIT](http://opensource.org/licenses/MIT) License

Copyright (c) 2015 Gilles Coomans <gilles.coomans@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
body {
  font-family: Georgia, Palatino, serif;
  font-size: 12pt;
  background: white;
}

#header, #leftbar,#export-link, .breadtrail, #siteinfo-compliance-links { display: none; }

#content {
  width: auto;
  padding: 0;
  float: none !important;
  color: black;
  background: transparent;
}

a:link, a:visited {
  color: #336699;
  background: transparent;
  text-decoration: underline;
}

#footer {
  margin-top: 4em;
}

acronym {
  border: 0;
}


text:
package com.tdsoft.uploader;

public abstract class AbstractCacheService {
	/**
	 * 加上key前綴
	 *
	 * @param key 愈加上前綴
	 * @return 已加完key
	 */
	protected String appendPrefix(String prefix, String key) {
		StringBuilder sb = new StringBuilder();
		sb.append(prefix).append(key);
		return sb.toString();
	}

}


text:
extern "C" int sysTickHook(){
  PolledTimerServer();//all of our millisecond stuff hangs off of here.
  return false; //allowed standard code to run
}
#include "tableofpointers.h"

#endif


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

// Author: api.anash@gmail.com (Anash P. Oommen)

using Google.Api.Ads.Common.Lib;
using Google.Api.Ads.Common.Util;

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Net;
using System.Text;
using System.Web;

namespace Google.Api.Ads.Common.Logging {

  /// <summary>
  /// Helper class for logging.
  /// </summary>
  public class LogEntry {

    /// <summary>
    /// The application configuration.
    /// </summary>
    private AppConfig config;

    /// <summary>
    /// The date and time provider.
    /// </summary>
    private DateTimeProvider dateTimeProvider;

    /// <summary>
    /// The flag to indicate whether this request is a failure or not.
    /// </summary>
    bool isFailure;

    /// <summary>
    /// Gets or sets the summary request log.
    /// </summary>
    public string SummaryRequestLog {
      get;
      private set;
    }

    /// <summary>
    /// Gets or sets the summary response log.
    /// </summary>
    public string SummaryResponseLog {
      get;
      private set;
    }

    /// <summary>
    /// Gets or sets the detailed request log.
    /// </summary>
    public string DetailedRequestLog {
      get;
      private set;
    }

    /// <summary>
    /// Gets or sets the detailed response log.
    /// </summary>
    public string DetailedResponseLog {
      get;
      private set;
    }

    /// <summary>
    /// Gets the detailed log.
    /// </summary>
    public string DetailedLog {
      get {
        return this.DetailedRequestLog + this.DetailedResponseLog;
      }
    }

    /// <summary>
    /// Gets the summary log.
    /// </summary>
    public string SummaryLog {
      get {
        return this.SummaryRequestLog + "," + this.SummaryResponseLog;
      }
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="LogEntry"/> class.
    /// </summary>
    /// <param name="config">The application configuration.</param>
    /// <param name="dateTimeProvider">The date and time provider.</param>
    public LogEntry(AppConfig config, DateTimeProvider dateTimeProvider) {
      this.config = config;
      this.dateTimeProvider = dateTimeProvider;
    }

    /// <summary>
    /// Logs an HTTP request.
    /// </summary>
    /// <param name="request">The HTTP web request.</param>
    /// <param name="requestBody">The request body.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    public void LogRequest(WebRequest request, string requestBody, ISet<string> headersToMask) {
      LogRequest(request, requestBody, headersToMask,
          GetTraceFormatterForHTTPRequests(config.MaskCredentials));
    }

    /// <summary>
    /// Logs an HTTP request.
    /// </summary>
    /// <param name="request">The HTTP web request.</param>
    /// <param name="requestBody">The request body.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    /// <param name="formatter">The <see cref="TraceFormatter"/> to use when
    /// formatting the message.</param>
    /// <returns>The request logs</returns>
    public void LogRequest(WebRequest request, string requestBody,
        ISet<string> headersToMask, TraceFormatter formatter) {
      LogRequestSummary(request, requestBody, headersToMask, formatter);
      LogRequestDetails(request, requestBody, headersToMask, formatter);
    }

    /// <summary>
    /// Logs the details of an HTTP request.
    /// </summary>
    /// <param name="request">The HTTP web request.</param>
    /// <param name="requestBody">The request body.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    /// <param name="formatter">The <see cref="TraceFormatter"/> to use when
    /// formatting the message.</param>
    public void LogRequestDetails(WebRequest request, string requestBody,
        ISet<string> headersToMask, TraceFormatter formatter) {
      this.DetailedRequestLog = GetFormattedRequestLog(new RequestInfo(request, requestBody),
          headersToMask, formatter);
    }

    /// <summary>
    /// Logs the summary of an HTTP request.
    /// </summary>
    /// <param name="request">The HTTP web request.</param>
    /// <param name="requestSummary">The formatted request summary.</param>
    public void LogRequestSummary(WebRequest request, string requestSummary) {
      this.SummaryRequestLog = string.Format(CultureInfo.InvariantCulture,
          "host={0},url={1},{2}", request.RequestUri.Host, request.RequestUri.AbsolutePath,
          requestSummary);
    }

    /// <summary>
    /// Logs the summary of an HTTP request.
    /// </summary>
    /// <param name="request">The HTTP web request.</param>
    /// <param name="requestBody">The request body.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    /// <param name="formatter">The <see cref="TraceFormatter"/> to use when
    /// formatting the message.</param>
    public void LogRequestSummary(WebRequest request, string requestBody,
        ISet<string> headersToMask, TraceFormatter formatter) {
      LogRequestSummary(request, GetRequestSummary(request.Headers, requestBody, headersToMask,
          formatter));
    }

    /// <summary>
    /// Logs an HTTP response.
    /// </summary>
    /// <param name="response">The HTTP web response.</param>
    /// <param name="isFailure">True, if this is a failed response, false
    /// otherwise.</param>
    /// <param name="formattedMessage">The formatted response message.</param>
    public void LogResponse(WebResponse response, bool isFailure, string formattedMessage) {
      LogResponse(response, isFailure, formattedMessage, new HashSet<string>(),
          new DefaultBodyFormatter());
    }

    /// <summary>
    /// Logs an HTTP response.
    /// </summary>
    /// <param name="response">The HTTP web response.</param>
    /// <param name="isFailure">True, if this is a failed response, false
    /// otherwise.</param>
    /// <param name="responseBody">The response body.</param>
    /// <param name="fieldsToMask">The list of fields to mask.</param>
    /// <param name="formatter">The formatter to be used for formatting the
    /// response logs.</param>
    public void LogResponse(WebResponse response, bool isFailure, string responseBody,
        ISet<string> fieldsToMask, TraceFormatter formatter) {
      LogResponseSummary(isFailure, "");
      LogResponseDetails(response, responseBody, fieldsToMask, formatter);
    }

    /// <summary>
    /// Logs the summary of an HTTP response..
    /// </summary>
    /// <param name="isFailure">True, if this is a failed response, false
    /// otherwise.</param>
    /// <param name="formattedMessage">Any additional details to be appended to the
    /// response logs.</param>
    public void LogResponseSummary(bool isFailure, string formattedMessage) {
      this.isFailure = isFailure;
      this.SummaryResponseLog = string.Format("Result={0},{1}", isFailure ? "Failure" : "Success",
          formattedMessage).TrimEnd(',');
    }

    /// <summary>
    /// Logs the details of an HTTP response.
    /// </summary>
    /// <param name="response">The HTTP web response.</param>
    /// <param name="isFailure">True, if this is a failed response, false
    /// otherwise.</param>
    /// <param name="responseBody">The response body.</param>
    /// <param name="fieldsToMask">The list of fields to mask.</param>
    /// <param name="formatter">The formatter to be used for formatting the
    /// response logs.</param>
    public void LogResponseDetails(WebResponse response, string responseBody,
        ISet<string> fieldsToMask, TraceFormatter formatter) {
      if (config.MaskCredentials) {
        this.DetailedResponseLog = GetFormattedResponseLog(new ResponseInfo(
            response.Headers, responseBody), fieldsToMask, formatter);
      } else {
        this.DetailedResponseLog = GetFormattedResponseLog(new ResponseInfo(
            response.Headers, responseBody));
      }
    }

    /// <summary>
    /// Writes the HTTP logs.
    /// </summary>
    /// <param name="requestLogs">The HTTP request logs.</param>
    /// <param name="responseLogs">The HTTP response logs.</param>
    /// <param name="isFailure">True, if this is a failed request, false
    /// otherwise.</param>
    public void Flush() {
      TraceUtilities.WriteDetailedRequestLogs(this.DetailedLog, isFailure);
      TraceUtilities.WriteSummaryRequestLogs(this.SummaryLog, isFailure);
    }

    /// <summary>
    /// Gets the formatted logs for an HTTP request.
    /// </summary>
    /// <param name="requestInfo">The request information.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    /// <param name="traceFormatter">The trace formatter to use when formatting
    /// the message.</param>
    /// <returns></returns>
    private string GetFormattedRequestLog(RequestInfo requestInfo, ISet<string> headersToMask,
        TraceFormatter traceFormatter) {
      StringBuilder builder = new StringBuilder();
      builder.AppendFormat("\r\n-----------------BEGIN API CALL---------------------\r\n");
      builder.AppendFormat("\r\nRequest\r\n");
      builder.AppendFormat("-------\r\n\r\n");

      StringBuilder headerBuilder = new StringBuilder();

      headerBuilder.AppendFormat("{0} {1}\r\n", requestInfo.Method, requestInfo.Uri.AbsolutePath);
      headerBuilder.AppendFormat("{0}", GetFormattedHttpHeaderLogs(MaskHeaders(
          requestInfo.Headers, headersToMask), "\r\n"));
      builder.AppendFormat("{0}\r\n\r\n{1}\r\n", headerBuilder.ToString(),
          traceFormatter.MaskContents(requestInfo.Body, headersToMask));
      return builder.ToString();
    }

    /// <summary>
    /// Gets the formatted logs for an HTTP response.
    /// </summary>
    /// <param name="responseInfo">The response information.</param>
    /// <returns>The response log text.</returns>
    private string GetFormattedResponseLog(ResponseInfo responseInfo) {
      return GetFormattedResponseLog(responseInfo, new HashSet<string>(),
          new DefaultBodyFormatter());
    }

    /// <summary>
    /// Gets the formatted logs for an HTTP response.
    /// </summary>
    /// <param name="responseInfo">The response information.</param>
    /// <param name="headersToMask">The headers to mask.</param>
    /// <param name="bodyFormatter">The trace formatter to use when formatting
    /// the message.
    /// <returns>The response log text.</returns>
    private string GetFormattedResponseLog(ResponseInfo responseInfo, ISet<string> headersToMask,
        TraceFormatter traceFormatter) {
      StringBuilder builder = new StringBuilder();
      builder.AppendFormat("\r\nResponse\r\n");
      builder.AppendFormat("--------\r\n");

      builder.AppendFormat("\r\n{0}\r\n\r\n{1}\r\n",
          GetFormattedHttpHeaderLogs(MaskHeaders(responseInfo.Headers, headersToMask), "\r\n"),
          traceFormatter.MaskContents(responseInfo.Body, headersToMask));

      builder.AppendFormat("-----------------END API CALL-----------------------\r\n");
      return builder.ToString();
    }

    /// <summary>
    /// Gets the formatted logs for HTTP request or response headers.
    /// </summary>
    /// <param name="headers">The HTTP headers.</param>
    /// <param name="seps">The separator string.</param>
    /// <returns>The log output.</returns>
    private string GetFormattedHttpHeaderLogs(Dictionary<string, string> headers, string seps) {
      StringBuilder headerBuilder = new StringBuilder();
      foreach (string key in headers.Keys) {
        headerBuilder.AppendFormat("{0}: {1}{2}", key, headers[key], seps);
      }
      headerBuilder.AppendFormat("TimeStamp: {0}{1}", this.GetTimeStamp(), seps);
      return headerBuilder.ToString();
    }

    /// <summary>
    /// Masks the headers.
    /// </summary>
    /// <param name="headers">The list of all headers</param>
    /// <param name="headersToMask">The list of headers to mask.</param>
    /// <returns>The list of headers, after masking.</returns>
    private Dictionary<string, string> MaskHeaders(WebHeaderCollection headers,
        ISet<string> headersToMask) {
      Dictionary<string, string> maskedHeaders = new Dictionary<string, string>();
      foreach (string key in headers) {
        if (config.MaskCredentials && headersToMask.Contains(key)) {
          maskedHeaders[key] = TraceFormatter.MASK_PATTERN;
        } else {
          maskedHeaders[key] = headers[key];
        }
      }
      return maskedHeaders;
    }

    /// <summary>
    /// Gets the trace formatter for formatting an HTTP request.
    /// </summary>
    /// <param name="shouldMask">True, if fields should be masked, false
    /// otherwise.</param>
    /// <returns>A trace formatter for formatting HTTP request.</returns>
    private TraceFormatter GetTraceFormatterForHTTPRequests(bool shouldMask) {
      TraceFormatter formatter = null;
      if (shouldMask) {
        formatter = new UrlEncodedBodyFormatter();
      } else {
        formatter = new DefaultBodyFormatter();
      }
      return formatter;
    }

    /// <summary>
    /// Gets the request summary for logging.
    /// </summary>
    /// <param name="headers">The HTTP request headers.</param>
    /// <param name="body">The HTTP request body.</param>
    /// <returns>The request summary for logging.</returns>
    private string GetRequestSummary(WebHeaderCollection headers, string body,
        ISet<string> headersToMask, TraceFormatter formatter) {
      Dictionary<string, string> maskedHeader = MaskHeaders(headers, headersToMask);
      NameValueCollection collection = HttpUtility.ParseQueryString(body);
      string loggedHeaders = GetFormattedHttpHeaderLogs(maskedHeader, ", ");
      string details = formatter.MaskContents(body, headersToMask);

      return loggedHeaders + details;
    }

    /// <summary>
    /// Gets the current timestamp as a formatted string.
    /// </summary>
    /// <returns>The current timestamp.</returns>
    private string GetTimeStamp() {
      return dateTimeProvider.Now.ToString("R");
    }
  }
}


text:
using namespace std;

Level::Level(string path,string name):
mDirectory(path+name+"/"),
mName(name)
{
	loadLevel();
}

Level::~Level()
{
	delete mWorld;
}

void Level::loadLevel()
{
	NBT::TagCompound* root = NBT::ReadNBTFromGzipFile(mDirectory+"level.dat");

	NBT::Print(cerr,root);

	NBT::TagCompound* data = root->getCompound("Data");

	mWorld = new World(mDirectory+"region/");
	mWorld->loadWorld();

	NBT::TagList* pos = data->getCompound("Player")->getList("Pos");
	playerX = pos->getDouble(0);
	playerY = pos->getDouble(1);
	playerZ = pos->getDouble(2);

}

ofstream Level::logfile("E:/abc.txt");


text:
<function-new-detail *ngIf="openFunctionNewDetail"
  [functionCard]="functionCard"
  [functionLanguage]="functionLanguage"
  [functionsInfo]="functionsInfo"
  [functionApp]="functionApp"
  [appNode]="appNode"
  [functionsNode]="functionsNode"
  [context]="context"
  (closePanel) ="close()">
</function-new-detail>

<extension-install-detail *ngIf="openExtensionInstallDetail"
  [functionApp]="functionApp"
  [functionCard]="functionCard"
  [requiredExtensions]="currentTemplate.metadata.extensions"
  (closePanel) ="close()">
</extension-install-detail>


text:
package integration;

import com.coveros.selenified.services.Call;
import com.coveros.selenified.services.Response;
import com.google.gson.JsonObject;
import org.testng.annotations.Test;

import java.util.*;

public class ServicesResponseVerifyContainsIT extends ServicesBase {

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonArrayContains() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/").verifyContains().value(json1);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonObjectContainsInteger() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keyValues(values);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonObjectContainsString() {
        Map<String, Object> values = new HashMap<>();
        values.put("title", "eum et est occaecati");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keyValues(values);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonObjectContainsMultiple() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        values.put("title", "eum et est occaecati");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keyValues(values);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonMessageContains() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("null/").verifyContains().message("We encountered an error");
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonArrayDoesntContain() {
        JsonObject json = new JsonObject();
        json.addProperty("id", 1);
        json.addProperty("title", "sunt aut facere repellat provident occaecati excepturi optio reprehenderit");
        json.addProperty("body",
                "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/").verifyContains().value(json);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonObjectDoesntContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 3);
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keyValues(values);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsEmptyContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().nestedKeyValues(new ArrayList<>(), values);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsSingleContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("userId", 4);
        List<String> crumbs = new ArrayList<>();
        crumbs.add("users");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("users/").verifyContains().nestedKeyValues(crumbs, values);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsDoubleContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        List<String> crumbs = new ArrayList<>();
        crumbs.add("users");
        crumbs.add("userId");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("users/").verifyContains().nestedKeyValues(crumbs, values);
        // verify 1 issues
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsNoObjectContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        List<String> crumbs = new ArrayList<>();
        crumbs.add("userId");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/").verifyContains().nestedKeyValues(crumbs, values);
        // verify 1 issues
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsBadCrumbContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        List<String> crumbs = new ArrayList<>();
        crumbs.add("user");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().nestedKeyValues(crumbs, values);
        // verify 1 issues
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsMisMatchContain() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 4);
        List<String> crumbs = new ArrayList<>();
        crumbs.add("userId");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().nestedKeyValues(crumbs, values);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsEmptyContains() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/").verifyContains().nestedValue(new ArrayList<>(), json1);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsSingleContains() {
        List<String> crumbs = new ArrayList<>();
        crumbs.add("ids");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("ids/").verifyContains().nestedValue(crumbs, json1);
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsDoubleContains() {
        List<String> crumbs = new ArrayList<>();
        crumbs.add("ids");
        crumbs.add("id");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("ids/").verifyContains().nestedValue(crumbs, json1);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsNoArrayContains() {
        List<String> crumbs = new ArrayList<>();
        crumbs.add("users");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("users").verifyContains().nestedValue(crumbs, json1);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsBadCrumbContains() {
        List<String> crumbs = new ArrayList<>();
        crumbs.add("userId");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().nestedValue(crumbs, json1);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonCrumbsMisMatchContains() {
        List<String> crumbs = new ArrayList<>();
        crumbs.add("ids");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("ids").verifyContains().nestedValue(crumbs, simJson4);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonMessageDoesntContain() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("null/").verifyContains().message("We found an error");
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonArrayDoesntContainMismatch() {
        Map<String, Object> values = new HashMap<>();
        values.put("id", 3);
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/").verifyContains().keyValues(values);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonObjectDoesntContainMismatch() {
        JsonObject json = new JsonObject();
        json.addProperty("id", 1);
        json.addProperty("title", "sunt aut facere repellat provident occaecati excepturi optio reprehenderit");
        json.addProperty("body",
                "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto");
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().value(json);
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonMessageDoesntContainMismatch() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        Response response = call.get("null/");
        response.verifyContains().message("Something");
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyJsonMessageDoesntContainNull() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        Response response = call.get("/null/");
        response.verifyContains().message("Something");
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyKeysContainsEmpty() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("/null/").verifyContains().keys(Arrays.asList("id", "title"));
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyKeysContainsPass() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keys(Arrays.asList("id", "title"));
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyKeysContainsFailOne() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keys(Arrays.asList("id", "space"));
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyKeysContainsFail() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("posts/?id=4").verifyContains().keys(Collections.singletonList("space"));
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyNestedKeysNotObject() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("/null/").verifyContains().nestedKeys(Collections.singletonList("something"), Arrays.asList("id", "title"));
        // verify 1 issue
        finish(1);
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyNestedKeysNoCrumb() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("ids/1").verifyContains().nestedKeys(new ArrayList<>(), Collections.singletonList("ids"));
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyNestedKeysCrumbMatch() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("users/").verifyContains().nestedKeys(Collections.singletonList("users"), Collections.singletonList("userId"));
        // verify no issues
        finish();
    }

    @Test(groups = {"integration", "service", "httpget", "response"},
            description = "An integration test to verify json data response")
    public void verifyNestedKeysCrumbNoMatch() {
        // use this object to verify the app looks as expected
        Call call = this.calls.get();
        // perform some actions
        call.get("ids/1").verifyContains().nestedKeys(Collections.singletonList("ids"), Arrays.asList("userId", "name"));
        // verify 1 issue
        finish(1);
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

        <link type="text/css" rel="stylesheet" href="style.css" />

FlushdbCommand: Contents
  FLUSHDB
    Return value
    See also

FlushdbCommand

FLUSHDB

Delete all the keys of the currently selected DB. This command never fails.

Return value
Status code reply
See also

 FLUSHALL


text:
using System;

namespace TestHelperExtensions
{
    /// <summary>
    /// Adds functionality that is often used for
    /// unit testing to the Integer (Int32) data type
    /// </summary>
    /// <remarks>This library is not intended for use as production code,
    /// but instead is intended to provide functionality in the test
    /// libraries for that production code.</remarks>
    public static class IntExtensions
    {
        internal static Random _rnd = new Random();

        /// <summary>
        /// Returns a random number greater than or equal to 0 and less than the integer
        /// </summary>
        /// <param name="maxValue">The non-inclusive maximum integer value for the random number</param>
        /// <returns>A random integer</returns>
        public static int GetRandom(this int maxValue)
        {
            return maxValue.GetRandom(0);
        }

        /// <summary>
        /// Returns a random number greater than or equal to the specified minValue and less than the integer
        /// </summary>
        /// <param name="maxValue">The non-inclusive maximum integer value for the random number</param>
        /// <param name="minValue">the inclusive minimum integer value for the random number</param>
        /// <returns>A random integer</returns>
        public static int GetRandom(this int maxValue, int minValue)
        {
            return _rnd.Next(minValue, maxValue);
        }

    }
}


text:
#include "pthread.h"
#include "semaphore.h"
#include "implement.h"

#include <stdio.h>

int
sem_trywait (sem_t * sem)
     /*
      * ------------------------------------------------------
      * DOCPUBLIC
      *      This function tries to wait on a semaphore.
      *
      * PARAMETERS
      *      sem
      *              pointer to an instance of sem_t
      *
      * DESCRIPTION
      *      This function tries to wait on a semaphore. If the
      *      semaphore value is greater than zero, it decreases
      *      its value by one. If the semaphore value is zero, then
      *      this function returns immediately with the error EAGAIN
      *
      * RESULTS
      *              0               successfully decreased semaphore,
      *              -1              failed, error in errno
      * ERRNO
      *              EAGAIN          the semaphore was already locked,
      *              EINVAL          'sem' is not a valid semaphore,
      *              ENOTSUP         sem_trywait is not supported,
      *              EINTR           the function was interrupted by a signal,
      *              EDEADLK         a deadlock condition was detected.
      *
      * ------------------------------------------------------
      */
{
#ifdef NEED_SEM

  /*
   * not yet implemented!
   */
  errno = ENOTSUP;
  return -1;

#else /* NEED_SEM */

  int result = 0;
  sem_t s = *sem;

  if (s == NULL)
    {
      result = EINVAL;
    }
  else if ((result = pthread_mutex_lock (&s->lock)) == 0)
    {
      if (--s->value < 0)
	{
	  s->value++;
	  result = EAGAIN;
	}

      (void) pthread_mutex_unlock (&s->lock);
    }

  if (result != 0)
    {
      errno = result;
      return -1;
    }

  return 0;

#endif /* NEED_SEM */

}				/* sem_trywait */


text:
using ArcTouchApp.DTOS;
using ArcTouchApp.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ArcTouchApp.Repositories
{
    public interface IGenreRepository
    {
        Task<IEnumerable<GenreDTO>> GetGenreListAsync();
    }
}


text:
package com.github.TKnudsen.ComplexDataObject.model.attribute;

public interface IAttributeFilter {

	public boolean accept(String attribute);
}


text:
The original implementation of thinglang was written in pure Python as an exercise to learn about the components that make up a high level programming language and its runtime: lexical analysis, parsing, static analysis, compilation and execution.

Since then, the runtime has been rewritten in C++, and the process now resembles that of the classic strictly typed languages, specifically Java/C#. Outlined below is the thinglang compilation pipeline.

## Lexical Analysis + Parsing
The first stage is a line-by-line lexical tokenization process. Each time stream (one per line) is transformed using multiple rounds of pattern replacements. Consider the line `if self.average([1, 2, 3]) eq 2`. The tokenizer will emit the following stream for this line:
```
[L_IF L_SELF ACCESS ID(average) L_PAREN_OPEN L_BRACKET_OPEN NUMERIC(1) SEP NUMERIC(2) SEP NUMERIC(3) L_BRACKET_CLOSE L_PAREN_CLOSE L_EQ NUMERIC(2)]
```

What follows is the likely pattern transformation the stream will undergo:

```
[L_IF L_SELF ACCESS ID(average) L_PAREN_OPEN ListInitPartial([NUMERIC(1)]) SEP NUMERIC(2) SEP NUMERIC(3) L_BRACKET_CLOSE L_PAREN_CLOSE L_EQ NUMERIC(2)]
[L_IF L_SELF ACCESS ID(average) L_PAREN_OPEN ListInitPartial([NUMERIC(1), NUMERIC(2)]) SEP NUMERIC(3) L_BRACKET_CLOSE L_PAREN_CLOSE L_EQ NUMERIC(2)]
[L_IF L_SELF ACCESS ID(average) L_PAREN_OPEN ListInitPartial([NUMERIC(1), NUMERIC(2), NUMERIC(3)]) L_BRACKET_CLOSE L_PAREN_CLOSE L_EQ NUMERIC(2)]
[L_IF L_SELF ACCESS ID(average) L_PAREN_OPEN ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)]) L_PAREN_CLOSE L_EQ NUMERIC(2)]
[L_IF L_SELF ACCESS ID(average) ArgListPartial([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]) L_PAREN_CLOSE L_EQ NUMERIC(2)]
[L_IF L_SELF ACCESS ID(average) ArgList([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]) L_EQ NUMERIC(2)]
[L_IF Access([L_SELF, ID(average)]) ArgList([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]) L_EQ NUMERIC(2)]
[L_IF MethodCall(target=[L_SELF, ID(average)], args=ArgList([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]) L_EQ NUMERIC(2)]
[L_IF LogicalOperation(lhs=MethodCall(target=[L_SELF, ID(average)], args=ArgList([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]), rhs=NUMERIC(2), type=EQ))]
[Conditional(LogicalOperation(lhs=MethodCall(target=[L_SELF, ID(average)], args=ArgList([ListInit([NUMERIC(1), NUMERIC(2), NUMERIC(3)])]), rhs=NUMERIC(2), type=EQ)))]
```

The object of this process is to reduce the token stream of a line to a single compound AST node. If at any point no transformations can be applied, and there is more than one element remaining from the original stream, the parser fails on the line.

The output of the parser is an AST of compound nodes. Examples of nodes include method calls, assignments, conditionals, and so on.

## Static Analysis
The AST undergoes two processes during SA: indexing and reduction.

**Indexing** is a process which inspects declarations, usages and assignments of variables, instances, methods, and members.  Each entity is given an appropriate slot in its containing structure.

**Reduction** is a process in which compound nodes containing certain nested operations (e.g. nested method calls) are simplified into a series of non-compound nodes. This simplifies the logic required during compilation for certain constructs.

## Symbol Generation
A symbol map is generated from the AST, and its dependencies are inspected and loaded. If needed, additional source files go through the pipeline as described, otherwise, existing symbol maps are loaded. Processing continues once all dependencies are resolved.

## Compilation
The AST is traversed in DFS, each node in turn producing appropriate bytecode instructions. Since this process resolves and binds references, it is also catches certain non-syntactic errors. Additionally, static data is collected and debugging maps are generated for the final executable if applicable.

## Runtime
With an executable in hand, we switch to the C++ runtime. After loading and processing the bytecode and its dependencies, it begins an execution loop and performs its expected runtime duties (allocating memory, interacting with the system, catching errors, and so on).


text:
package com.opengamma.financial.security.index;

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

import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefinition;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;

import com.opengamma.master.security.SecurityDescription;
import com.opengamma.util.ArgumentChecker;

/**
 * Class representing an equity index.
 */
@BeanDefinition
@SecurityDescription(type = EquityIndex.INDEX_TYPE, description = "Equity index")
public class EquityIndex extends Index {

  /** Serialization version */
  private static final long serialVersionUID = 1L;

  /**
   * The index type.
   */
  public static final String INDEX_TYPE = "EQUITY_INDEX";

  /**
   * The equity components of the index.
   */
  @PropertyDefinition(validate = "notNull")
  private List<EquityIndexComponent> _equityComponents;

  /**
   * The weighting calculation type.
   */
  @PropertyDefinition(validate = "notNull")
  private IndexWeightingType _weightingType;

  /**
   * For the builder.
   */
  public EquityIndex() {
    super(INDEX_TYPE);
  }

  /**
   * Constructs an equity index with no description.
   * @param name The index name, not null
   * @param equityComponents The equity components, not null
   * @param weightingType The index weighting type, not null
   */
  public EquityIndex(final String name, final List<EquityIndexComponent> equityComponents, final IndexWeightingType weightingType) {
    super(INDEX_TYPE, name);
    ArgumentChecker.notNull(equityComponents, "equityComponents");
    setEquityComponents(equityComponents);
    setWeightingType(weightingType);
  }

  /**
   * Constructs an equity index.
   * @param name The index name, not null
   * @param description The index description, not null
   * @param equityComponents The equity components, not null
   * @param weightingType The index weighting type, not null
   */
  public EquityIndex(final String name, final String description, final List<EquityIndexComponent> equityComponents, final IndexWeightingType weightingType) {
    super(INDEX_TYPE, name, description);
    ArgumentChecker.notNull(equityComponents, "equityComponents");
    setEquityComponents(equityComponents);
    setWeightingType(weightingType);
  }

  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code EquityIndex}.
   * @return the meta-bean, not null
   */
  public static EquityIndex.Meta meta() {
    return EquityIndex.Meta.INSTANCE;
  }

  static {
    JodaBeanUtils.registerMetaBean(EquityIndex.Meta.INSTANCE);
  }

  @Override
  public EquityIndex.Meta metaBean() {
    return EquityIndex.Meta.INSTANCE;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the equity components of the index.
   * @return the value of the property, not null
   */
  public List<EquityIndexComponent> getEquityComponents() {
    return _equityComponents;
  }

  /**
   * Sets the equity components of the index.
   * @param equityComponents  the new value of the property, not null
   */
  public void setEquityComponents(List<EquityIndexComponent> equityComponents) {
    JodaBeanUtils.notNull(equityComponents, "equityComponents");
    this._equityComponents = equityComponents;
  }

  /**
   * Gets the the {@code equityComponents} property.
   * @return the property, not null
   */
  public final Property<List<EquityIndexComponent>> equityComponents() {
    return metaBean().equityComponents().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the weighting calculation type.
   * @return the value of the property, not null
   */
  public IndexWeightingType getWeightingType() {
    return _weightingType;
  }

  /**
   * Sets the weighting calculation type.
   * @param weightingType  the new value of the property, not null
   */
  public void setWeightingType(IndexWeightingType weightingType) {
    JodaBeanUtils.notNull(weightingType, "weightingType");
    this._weightingType = weightingType;
  }

  /**
   * Gets the the {@code weightingType} property.
   * @return the property, not null
   */
  public final Property<IndexWeightingType> weightingType() {
    return metaBean().weightingType().createProperty(this);
  }

  //-----------------------------------------------------------------------
  @Override
  public EquityIndex clone() {
    return JodaBeanUtils.cloneAlways(this);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      EquityIndex other = (EquityIndex) obj;
      return JodaBeanUtils.equal(getEquityComponents(), other.getEquityComponents()) &&
          JodaBeanUtils.equal(getWeightingType(), other.getWeightingType()) &&
          super.equals(obj);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = hash * 31 + JodaBeanUtils.hashCode(getEquityComponents());
    hash = hash * 31 + JodaBeanUtils.hashCode(getWeightingType());
    return hash ^ super.hashCode();
  }

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(96);
    buf.append("EquityIndex{");
    int len = buf.length();
    toString(buf);
    if (buf.length() > len) {
      buf.setLength(buf.length() - 2);
    }
    buf.append('}');
    return buf.toString();
  }

  @Override
  protected void toString(StringBuilder buf) {
    super.toString(buf);
    buf.append("equityComponents").append('=').append(JodaBeanUtils.toString(getEquityComponents())).append(',').append(' ');
    buf.append("weightingType").append('=').append(JodaBeanUtils.toString(getWeightingType())).append(',').append(' ');
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code EquityIndex}.
   */
  public static class Meta extends Index.Meta {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code equityComponents} property.
     */
    @SuppressWarnings({"unchecked", "rawtypes" })
    private final MetaProperty<List<EquityIndexComponent>> _equityComponents = DirectMetaProperty.ofReadWrite(
        this, "equityComponents", EquityIndex.class, (Class) List.class);
    /**
     * The meta-property for the {@code weightingType} property.
     */
    private final MetaProperty<IndexWeightingType> _weightingType = DirectMetaProperty.ofReadWrite(
        this, "weightingType", EquityIndex.class, IndexWeightingType.class);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
        this, (DirectMetaPropertyMap) super.metaPropertyMap(),
        "equityComponents",
        "weightingType");

    /**
     * Restricted constructor.
     */
    protected Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case -281080901:  // equityComponents
          return _equityComponents;
        case 86270148:  // weightingType
          return _weightingType;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public BeanBuilder<? extends EquityIndex> builder() {
      return new DirectBeanBuilder<EquityIndex>(new EquityIndex());
    }

    @Override
    public Class<? extends EquityIndex> beanType() {
      return EquityIndex.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return _metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    /**
     * The meta-property for the {@code equityComponents} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<List<EquityIndexComponent>> equityComponents() {
      return _equityComponents;
    }

    /**
     * The meta-property for the {@code weightingType} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<IndexWeightingType> weightingType() {
      return _weightingType;
    }

    //-----------------------------------------------------------------------
    @Override
    protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
      switch (propertyName.hashCode()) {
        case -281080901:  // equityComponents
          return ((EquityIndex) bean).getEquityComponents();
        case 86270148:  // weightingType
          return ((EquityIndex) bean).getWeightingType();
      }
      return super.propertyGet(bean, propertyName, quiet);
    }

    @SuppressWarnings("unchecked")
    @Override
    protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
      switch (propertyName.hashCode()) {
        case -281080901:  // equityComponents
          ((EquityIndex) bean).setEquityComponents((List<EquityIndexComponent>) newValue);
          return;
        case 86270148:  // weightingType
          ((EquityIndex) bean).setWeightingType((IndexWeightingType) newValue);
          return;
      }
      super.propertySet(bean, propertyName, newValue, quiet);
    }

    @Override
    protected void validate(Bean bean) {
      JodaBeanUtils.notNull(((EquityIndex) bean)._equityComponents, "equityComponents");
      JodaBeanUtils.notNull(((EquityIndex) bean)._weightingType, "weightingType");
      super.validate(bean);
    }

  }

  ///CLOVER:ON
  //-------------------------- AUTOGENERATED END --------------------------
}


text:
const randomNumber = (length) => Math.floor(Math.random() * length)

module.exports = randomNumber


text:
systemctl is-enabled --quiet airflow-scheduler &&\
    systemctl restart airflow-scheduler
systemctl is-enabled --quiet airflow-webserver &&\
    systemctl restart airflow-webserver
systemctl is-enabled --quiet airflow-workerset &&\
    systemctl restart airflow-workerset
exit 0


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

<TITLE>
Uses of Class org.apache.pig.impl.logicalLayer.LOLoad (Pig 0.7.0 API)
</TITLE>

<META NAME="date" CONTENT="2010-05-05">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.pig.impl.logicalLayer.LOLoad

Packages that use LOLoad

org.apache.pig.backend.hadoop.executionengine.physicalLayer

Implementation of physical operators that use hadoop as the execution engine
and data storage.

org.apache.pig.experimental.logical

org.apache.pig.impl.logicalLayer

The logical operators that represent a pig script and tools for manipulating
those operators.

org.apache.pig.impl.logicalLayer.optimizer

org.apache.pig.impl.logicalLayer.validators

org.apache.pig.pen

Uses of LOLoad in org.apache.pig.backend.hadoop.executionengine.physicalLayer

Methods in org.apache.pig.backend.hadoop.executionengine.physicalLayer with parameters of type LOLoad

 void
LogToPhyTranslationVisitor.visit(LOLoad loLoad)

Uses of LOLoad in org.apache.pig.experimental.logical

Methods in org.apache.pig.experimental.logical with parameters of type LOLoad

 void
LogicalPlanMigrationVistor.visit(LOLoad load)

Uses of LOLoad in org.apache.pig.impl.logicalLayer

Methods in org.apache.pig.impl.logicalLayer with parameters of type LOLoad

protected  void
ProjectionMapRemover.visit(LOLoad load)

protected  void
ProjectionMapCalculator.visit(LOLoad load)

 void
PlanSetter.visit(LOLoad op)

protected  void
LogicalPlanCloneHelper.visit(LOLoad load)

protected  void
LOVisitor.visit(LOLoad load)

protected  void
ColumnPruner.visit(LOLoad lOp)

Uses of LOLoad in org.apache.pig.impl.logicalLayer.optimizer

Methods in org.apache.pig.impl.logicalLayer.optimizer with parameters of type LOLoad

protected  void
SchemaRemover.visit(LOLoad load)

protected  void
SchemaCalculator.visit(LOLoad load)

Uses of LOLoad in org.apache.pig.impl.logicalLayer.validators

Methods in org.apache.pig.impl.logicalLayer.validators with parameters of type LOLoad

protected  void
TypeCheckingVisitor.visit(LOLoad load)

protected  void
SchemaAliasVisitor.visit(LOLoad load)

Uses of LOLoad in org.apache.pig.pen

Methods in org.apache.pig.pen that return types with arguments of type LOLoad

 Map<LOLoad,DataBag>
AugmentBaseDataVisitor.getNewBaseData()

Methods in org.apache.pig.pen with parameters of type LOLoad

protected  void
LineageTrimmingVisitor.visit(LOLoad load)

protected  void
DerivedDataVisitor.visit(LOLoad load)

protected  void
AugmentBaseDataVisitor.visit(LOLoad load)

Constructor parameters in org.apache.pig.pen with type arguments of type LOLoad

AugmentBaseDataVisitor(LogicalPlan plan,
                       Map<LOLoad,DataBag> baseData,
                       Map<LogicalOperator,DataBag> derivedData)

DerivedDataVisitor(LogicalOperator op,
                   PigContext pc,
                   Map<LOLoad,DataBag> baseData,
                   Map<LogicalOperator,PhysicalOperator> logToPhyMap,
                   PhysicalPlan physPlan)

DerivedDataVisitor(LogicalPlan plan,
                   PigContext pc,
                   Map<LOLoad,DataBag> baseData,
                   Map<LogicalOperator,PhysicalOperator> logToPhyMap,
                   PhysicalPlan physPlan)

LineageTrimmingVisitor(LogicalPlan plan,
                       Map<LOLoad,DataBag> baseData,
                       Map<LogicalOperator,PhysicalOperator> LogToPhyMap,
                       PhysicalPlan physPlan,
                       PigContext pc)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © ${year} The Apache Software Foundation


text:
To contribute to Seed, clone the [happy\_seed repo](https://github.com/happyfuncode/happy_seed). To create a new app with the the rails generator script, run

```
$ export SEED_DEVELOPMENT=/path/to/your/happy_seed
$ cd /path/to/your/happy_seed
$ bundle exec happy_seed rails mytestapp
```

This will generate, for example, a new rails app and will set the `happy_seed` gem to use the source specified in `SEED_DEVELOPMENT`. Within that app, you can then use the regular generator commands, for example:

```
$ cd mytestapp
$ rails generate happy_seed:bootstrap
```

Since it's inconvenient to generate apps over and over, a simple pattern to test and undo your changes is

```
$ git commit -a
$ rails generate happy_seed:bootstrap
$ git reset --hard
```

Write tests where needed and submit a pull request!


text:
#include <ortc/IICETypes.h>
#include <ortc/internal/types.h>
#include <ortc/internal/platform.h>
#include <ortc/internal/ortc_Helper.h>

#include <ortc/IHelper.h>

#include <zsLib/eventing/IHasher.h>

#include <zsLib/XML.h>
#include <zsLib/Numeric.h>

#include <cryptopp/sha.h>

namespace ortc { ZS_DECLARE_SUBSYSTEM(ortclib) }

namespace ortc
{
  ZS_DECLARE_USING_PTR(zsLib::eventing, IHasher);

  using zsLib::Numeric;
  using zsLib::Log;

  //-----------------------------------------------------------------------
  static Log::Params slog(const char *message)
  {
    return Log::Params(message, "ortc::IICETypes");
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Roles
  #pragma mark

  //---------------------------------------------------------------------------
  const char *IICETypes::toString(Roles roles)
  {
    switch (roles) {
      case Role_Controlling:  return "controlling";
      case Role_Controlled:   return "controlled";
    }
    return "unknown";
  }

  //---------------------------------------------------------------------------
  IICETypes::Roles IICETypes::toRole(const char *role) throw (InvalidParameters)
  {
    String str(role);
    for (IICETypes::Roles index = IICETypes::Role_First; index <= IICETypes::Role_Last; index = static_cast<IICETypes::Roles>(static_cast<std::underlying_type<IICETypes::Roles>::type>(index) + 1)) {
      if (0 == str.compareNoCase(IICETypes::toString(index))) return index;
    }

    ORTC_THROW_INVALID_PARAMETERS("Invalid parameter value: " + str)
    return Role_First;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Components
  #pragma mark

  //---------------------------------------------------------------------------
  const char *IICETypes::toString(Components component)
  {
    switch (component) {
      case Component_RTP:   return "rtp";
      case Component_RTCP:  return "rtcp";
    }
    return "unknown";
  }

  //---------------------------------------------------------------------------
  IICETypes::Components IICETypes::toComponent(const char *component) throw (InvalidParameters)
  {
    String str(component);
    for (IICETypes::Components index = IICETypes::Component_First; index <= IICETypes::Component_Last; index = static_cast<IICETypes::Components>(static_cast<std::underlying_type<IICETypes::Components>::type>(index) + 1)) {
      if (0 == str.compareNoCase(IICETypes::toString(index))) return index;
    }

    ORTC_THROW_INVALID_PARAMETERS("Invalid parameter value: " + str)
    return Component_First;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Protocols
  #pragma mark

  //---------------------------------------------------------------------------
  const char *IICETypes::toString(Protocols protocol)
  {
    switch (protocol) {
      case Protocol_UDP:  return "udp";
      case Protocol_TCP:  return "tcp";
    }
    return "unknown";
  }

  //---------------------------------------------------------------------------
  IICETypes::Protocols IICETypes::toProtocol(const char *protocol) throw (InvalidParameters)
  {
    String str(protocol);
    for (IICETypes::Protocols index = IICETypes::Protocol_First; index <= IICETypes::Protocol_Last; index = static_cast<IICETypes::Protocols>(static_cast<std::underlying_type<IICETypes::Protocols>::type>(index) + 1)) {
      if (0 == str.compareNoCase(IICETypes::toString(index))) return index;
    }

    ORTC_THROW_INVALID_PARAMETERS("Invalid parameter value: " + str)
    return Protocol_First;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::CandidateTypes
  #pragma mark

  //---------------------------------------------------------------------------
  const char *IICETypes::toString(CandidateTypes candidateType)
  {
    switch (candidateType) {
      case CandidateType_Host:    return "host";
      case CandidateType_Srflex:  return "srflx";
      case CandidateType_Prflx:   return "prflx";
      case CandidateType_Relay:   return "relay";
    }
    return "unknown";
  }

  //---------------------------------------------------------------------------
  IICETypes::CandidateTypes IICETypes::toCandidateType(const char *candidateType) throw (InvalidParameters)
  {
    String str(candidateType);
    for (IICETypes::CandidateTypes index = IICETypes::CandidateType_First; index <= IICETypes::CandidateType_Last; index = static_cast<IICETypes::CandidateTypes>(static_cast<std::underlying_type<IICETypes::CandidateTypes>::type>(index) + 1)) {
      if (0 == str.compareNoCase(IICETypes::toString(index))) return index;
    }

    ORTC_THROW_INVALID_PARAMETERS("Invalid parameter value: " + str)
    return CandidateType_First;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::TCPCandidateTypes
  #pragma mark

  //---------------------------------------------------------------------------
  const char *IICETypes::toString(TCPCandidateTypes protocol)
  {
    switch (protocol) {
      case TCPCandidateType_Active:   return "active";
      case TCPCandidateType_Passive:  return "passive";
      case TCPCandidateType_SO:       return "so";
    }
    return "unknown";
  }

  //---------------------------------------------------------------------------
  IICETypes::TCPCandidateTypes IICETypes::toTCPCandidateType(const char *tcpCandidateType) throw (InvalidParameters)
  {
    String str(tcpCandidateType);
    for (IICETypes::TCPCandidateTypes index = IICETypes::TCPCandidateType_First; index <= IICETypes::TCPCandidateType_Last; index = static_cast<IICETypes::TCPCandidateTypes>(static_cast<std::underlying_type<IICETypes::TCPCandidateTypes>::type>(index) + 1)) {
      if (0 == str.compareNoCase(IICETypes::toString(index))) return index;
    }

    ORTC_THROW_INVALID_PARAMETERS("Invalid parameter value: " + str)
    return TCPCandidateType_First;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::GatherCandidate
  #pragma mark

  //---------------------------------------------------------------------------
  IICETypes::GatherCandidatePtr IICETypes::GatherCandidate::create(ElementPtr elem)
  {
    if (!elem) return GatherCandidatePtr();

    ElementPtr childEl = elem->getFirstChildElement();
    ElementPtr completeEl = elem->findFirstChildElement("complete");
    if ((completeEl) ||
        (!childEl)) {
      CandidateCompletePtr pThis(make_shared<CandidateComplete>(elem));
      return pThis;
    }

    CandidatePtr pThis(make_shared<Candidate>(elem));
    return pThis;
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Candidate
  #pragma mark

  //---------------------------------------------------------------------------
  IICETypes::CandidatePtr IICETypes::Candidate::convert(GatherCandidatePtr candidate)
  {
    return ZS_DYNAMIC_PTR_CAST(Candidate, candidate);
  }

  //---------------------------------------------------------------------------
  IICETypes::Candidate::Candidate(ElementPtr elem)
  {
    if (!elem) return;

    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "interfaceType", mInterfaceType);
    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "foundation", mFoundation);

    {
      String str = IHelper::getElementText(elem->findFirstChildElement("component"));
      if (str.hasData()) {
        try {
          std::underlying_type<decltype(mComponent)>::type converted = Numeric<std::underlying_type<decltype(mComponent)>::type>(str);
          IICETypes::Components component = static_cast<decltype(mComponent)>(converted);
          if ((component >= IICETypes::Component_First) ||
              (component <= IICETypes::Component_Last)) {
            mComponent = component;
          } else {
            ZS_LOG_WARNING(Debug, slog("component value invalid") + ZS_PARAM("value", str))
          }
        } catch(const Numeric<std::underlying_type<decltype(mComponent)>::type>::ValueOutOfRange &) {
          ZS_LOG_WARNING(Debug, slog("component value invalid") + ZS_PARAM("value", str))
        }
      }
    }

    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "priority", mPriority);
    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "unfreezePriority", mUnfreezePriority);

    {
      String str = IHelper::getElementText(elem->findFirstChildElement("protocol"));
      if (str.hasData()) {
        try {
          mProtocol = IICETypes::toProtocol(str);
        } catch(const InvalidParameters &) {
          ZS_LOG_WARNING(Debug, slog("protocol value invalid") + ZS_PARAM("value", str))
        }
      }
    }

    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "ip", mIP);
    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "port", mPort);

    {
      String str = IHelper::getElementText(elem->findFirstChildElement("type"));
      if (str.hasData()) {
        try {
          mCandidateType = IICETypes::toCandidateType(str);
        } catch(const InvalidParameters &) {
          ZS_LOG_WARNING(Debug, slog("candidate type value invalid") + ZS_PARAM("value", str))
        }
      }
    }

    {
      String str = IHelper::getElementText(elem->findFirstChildElement("tcpType"));
      if (str.hasData()) {
        try {
          mTCPType = IICETypes::toTCPCandidateType(str);
        } catch(const InvalidParameters &) {
          ZS_LOG_WARNING(Debug, slog("candidate type value invalid") + ZS_PARAM("value", str))
        }
      }
    }

    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "relatedAddress", mRelatedAddress);
    IHelper::getElementValue(elem, "ortc::IICETypes::Candidate", "relatedPort", mRelatedPort);
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::Candidate::createElement(const char *objectName) const
  {
    if (NULL == objectName) objectName = "candidate";
    ElementPtr elem = Element::create(objectName);

    IHelper::adoptElementValue(elem, "interfaceType", mInterfaceType, false);
    IHelper::adoptElementValue(elem, "foundation", mFoundation, false);
    IHelper::adoptElementValue(elem, "component", static_cast<std::underlying_type<IICETypes::Components>::type>(mComponent));
    IHelper::adoptElementValue(elem, "priority", mPriority);
    IHelper::adoptElementValue(elem, "unfreezePriority", mUnfreezePriority);
    IHelper::adoptElementValue(elem, "protocol", IICETypes::toString(mProtocol), false);
    IHelper::adoptElementValue(elem, "ip", mIP, false);
    IHelper::adoptElementValue(elem, "port", mPort);
    IHelper::adoptElementValue(elem, "type", IICETypes::toString(mCandidateType), false);
    IHelper::adoptElementValue(elem, "tcpType", IICETypes::toString(mTCPType), false);
    IHelper::adoptElementValue(elem, "relatedAddress", mRelatedAddress, false);
    IHelper::adoptElementValue(elem, "relatedPort", mRelatedPort);

    if (!elem->hasChildren()) return ElementPtr();

    return elem;
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::Candidate::toDebug() const
  {
    return createElement("ortc::IICETypes::Candidate");
  }

  //---------------------------------------------------------------------------
  String IICETypes::Candidate::hash(bool includePriorities) const
  {
    auto hasher = IHasher::sha1();

    hasher->update("IICETypes::Candidate:");
    hasher->update(mInterfaceType);
    hasher->update(":");
    hasher->update(mFoundation);
    hasher->update(":");
    hasher->update(static_cast<std::underlying_type<decltype(mComponent)>::type>(mComponent));
    hasher->update(":");
    if (includePriorities) {
      hasher->update(mPriority);
      hasher->update(":");
      hasher->update(mUnfreezePriority);
      hasher->update(":");
    }
    hasher->update(toString(mProtocol));
    hasher->update(":");
    hasher->update(mIP);
    hasher->update(":");
    hasher->update(mPort);
    hasher->update(":");
    hasher->update(toString(mCandidateType));
    hasher->update(":");
    if (Protocol_TCP == mProtocol) {
      hasher->update(toString(mTCPType));
      hasher->update(":");
    }
    hasher->update(mRelatedAddress);
    hasher->update(":");
    hasher->update(mRelatedPort);

    return hasher->finalizeAsString();
  }

  //---------------------------------------------------------------------------
  IPAddress IICETypes::Candidate::ip() const
  {
    if (mIP.isEmpty()) return IPAddress();
    IPAddress ip(mIP, mPort);
    return ip;
  }

  //---------------------------------------------------------------------------
  IPAddress IICETypes::Candidate::relatedIP() const
  {
    if (mRelatedAddress.isEmpty()) return IPAddress();
    IPAddress ip(mRelatedAddress, mRelatedPort);
    return ip;
  }

  //---------------------------------------------------------------------------
  String IICETypes::Candidate::foundation(
                                          const char *relatedServerURL,
                                          const char *baseIP
                                          ) const
  {
    if (mFoundation.hasData()) return mFoundation;

    auto hasher = IHasher::sha1();

    hasher->update("foundation:");
    hasher->update(IICETypes::toString(mCandidateType));
    hasher->update(":");
    switch (mCandidateType) {
      case CandidateType_Host:    hasher->update(mIP); break;
      case CandidateType_Prflx:   hasher->update(mIP); break;
      case CandidateType_Relay:   {
        if (baseIP) {
          if (0 != (*baseIP)) {
            hasher->update(baseIP);
            break;
          }
        }
        hasher->update(mRelatedAddress);
        break;
      }
      case CandidateType_Srflex:  hasher->update(mRelatedAddress); break;
    }
    hasher->update(":");
    hasher->update(IICETypes::toString(mProtocol));
    if (relatedServerURL) {
      if (0 != (*relatedServerURL)) {
        hasher->update(":");
        hasher->update(relatedServerURL);
      }
    }

    return hasher->finalizeAsString();
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Candidate
  #pragma mark

  //---------------------------------------------------------------------------
  IICETypes::CandidateCompletePtr IICETypes::CandidateComplete::convert(GatherCandidatePtr candidate)
  {
    return ZS_DYNAMIC_PTR_CAST(CandidateComplete, candidate);
  }

  //---------------------------------------------------------------------------
  IICETypes::CandidateComplete::CandidateComplete(ElementPtr elem)
  {
    if (!elem) return;

    {
      String str = IHelper::getElementText(elem->findFirstChildElement("component"));
      if (str.hasData()) {
        try {
          std::underlying_type<decltype(mComponent)>::type converted = Numeric<std::underlying_type<decltype(mComponent)>::type>(str);
          IICETypes::Components component = static_cast<decltype(mComponent)>(converted);
          if ((component >= IICETypes::Component_First) ||
              (component <= IICETypes::Component_Last)) {
            mComponent = component;
          } else {
            ZS_LOG_WARNING(Debug, slog("component value invalid") + ZS_PARAM("value", str))
          }
        } catch (const Numeric<std::underlying_type<decltype(mComponent)>::type>::ValueOutOfRange &) {
          ZS_LOG_WARNING(Debug, slog("component value invalid") + ZS_PARAM("value", str))
        }
      }
    }

    IHelper::getElementValue(elem, "ortc::IICETypes::CandidateComplete", "complete", mComplete);
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::CandidateComplete::createElement(const char *objectName) const
  {
    if (NULL == objectName) objectName = "candidateComplete";

    ElementPtr elem = Element::create(objectName);

    IHelper::adoptElementValue(elem, "component", static_cast<std::underlying_type<decltype(mComponent)>::type>(mComponent));
    IHelper::adoptElementValue(elem, "complete", mComplete);

    if (!elem->hasChildren()) return ElementPtr();

    return elem;
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::CandidateComplete::toDebug() const
  {
    return createElement("ortc::IICETypes::CandidateComplete");
  }

  //---------------------------------------------------------------------------
  String IICETypes::CandidateComplete::hash() const
  {
    auto hasher = IHasher::sha1();

    hasher->update("IICETypes::CandidateComplete:");
    hasher->update(static_cast<std::underlying_type<decltype(mComponent)>::type>(mComponent));
    hasher->update(":");
    hasher->update(mComplete);

    return hasher->finalizeAsString();
  }

  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  #pragma mark
  #pragma mark IICETypes::Parameters
  #pragma mark

  //---------------------------------------------------------------------------
  IICETypes::Parameters::Parameters(ElementPtr elem)
  {
    if (!elem) return;

    IHelper::getElementValue(elem, "ortc::IICETypes::Parameters", "useUnfreezePriority", mUseUnfreezePriority);
    IHelper::getElementValue(elem, "ortc::IICETypes::Parameters", "usernameFragment", mUsernameFragment);
    IHelper::getElementValue(elem, "ortc::IICETypes::Parameters", "password", mPassword);
    IHelper::getElementValue(elem, "ortc::IICETypes::Parameters", "iceLite", mICELite);
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::Parameters::createElement(const char *objectName) const
  {
    ElementPtr elem = Element::create(objectName);

    IHelper::adoptElementValue(elem, "useCandidateFreezePriority", mUseUnfreezePriority);
    IHelper::adoptElementValue(elem, "usernameFragment", mUsernameFragment, false);
    IHelper::adoptElementValue(elem, "password", mPassword, false);
    IHelper::adoptElementValue(elem, "iceLite", mICELite);

    if (!elem->hasChildren()) return ElementPtr();

    return elem;
  }

  //---------------------------------------------------------------------------
  ElementPtr IICETypes::Parameters::toDebug() const
  {
    return createElement("ortc::IICETypes::Parameters");
  }

  //---------------------------------------------------------------------------
  String IICETypes::Parameters::hash() const
  {
    auto hasher = IHasher::sha1();

    hasher->update(mUseUnfreezePriority ? "Parameters:true:" : "Parameters:false:");
    hasher->update(mUsernameFragment);
    hasher->update(":");
    hasher->update(mPassword);
    return hasher->finalizeAsString();
  }
}


text:
import { useDateUnits, useFiscalDateUnits } from './date_units'

export const useFiscalIntervalUnits = () => {
  const dateUnits = useDateUnits()
  const fiscalDateUnits = useFiscalDateUnits()
  return [...dateUnits, ...fiscalDateUnits]
}


text:
import sys

from st2actions.runners.pythonrunner import Action

__all__ = [
    'StreamWriter'
]

class StreamWriter(Action):

    def run(self, stream):
        if stream.upper() == 'STDOUT':
            sys.stdout.write('STREAM IS STDOUT.')
            return stream

        if stream.upper() == 'STDERR':
            sys.stderr.write('STREAM IS STDERR.')
            return stream

        raise ValueError('Invalid stream specified.')


text:
require 'open3'

module MMD
    module Actions
        module PerlFtpSync
            attr_reader :perl_script, :perl_cmd

            def before_action
                @options =
                  { :checkout_path => @parameters[:checkout_path],
                    :ftp_username  => @parameters[:ftp_username],
                    :ftp_password  => @parameters[:ftp_password],
                    :ftp_host      => @parameters[:ftp_host],
                    :ftp_path      => @parameters[:ftp_path] }.merge( @options )

                required_params( @options,
                  [ :checkout_path, :ftp_username, :ftp_password, :ftp_host, :ftp_path ], false )
                set_instance_variables( @options )

                @perl_script = File.join( MMD::Option.scripts, 'ftpsync.pl')
                if not File.exists?( @perl_script )
                  raise ActionError.new( "ftpsync script not found: #{@perl_script}" )
                end

                @perl_cmd = "export HOME=#{@checkout_path};perl #{@perl_script} -l -p ftpuser=#{@ftp_username} ftppasswd=#{@ftp_password} #{@checkout_path} ftp://#{@ftp_host}/#{@ftp_path}"
            end

            def action()
                @logger.info( "PerlFtpSync begin sync")
                @logger.debug( "  executing #{@perl_script}" )
                output = []
                IO.popen( @perl_cmd ) do |pipe|
                  pipe.sync = true
                  while msg = pipe.gets
                      output << msg
                      @logger.info( "  #{msg.strip()}" )
                  end
                end
                if RAILS_ENV != 'test' and output.size == 0
                  raise ActionError.new( "Failed to run script: #{@perl_script}" )
                end
                @logger.info( "finshed PerlFtpSync")
            end
        end
    end
end


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

<title>de.esoco.lib.io (esoco-lib 1.3.0 API)</title>
<meta name="date" content="2018-10-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package de.esoco.lib.io

Class Summary

Class
Description

EchoInputStream

An input stream that echos all bytes that are read from a wrapped input
 stream to an output stream.

EchoOutputStream

An output stream that echos all bytes that are written to a wrapped output
 stream to another output stream.

EchoReader

A Reader that echos all characters that are read from a wrapped
 reader to a Writer.

EchoWriter

A Writer that echos all characters that are written to a wrapped
 writer to another writer.

IOFunctions

Contains factory methods for I/O-related functions.

IOFunctions.PatternFilenameFilter

Implementation of FilenameFilter that uses a regular expression
 pattern for the filename selection.

LimitedInputStream

An input stream wrapper that limits the number of bytes that can be read from
 the stream.

LimitedOutputStream

An output stream wrapper that limits the number of bytes that can be written
 to the stream.

LimitedReader

A wrapper for Reader instances that limits the number of characters
 that can be read from it.

LimitedWriter

A wrapper for Writer instances that limits the number of characters
 that can be written to it.

RandomAccessFileInputStream

A wrapper that forwards the input stream read methods to the corresponding
 RandomAccessFile methods so that stream-based tools can be used on
 the file.

RandomAccessFileOutputStream

A wrapper that forwards the output stream write methods to the corresponding
 RandomAccessFile methods so that stream-based tools and classes can
 be used on the file.

StreamFunctions

Provides access to stream and I/O related function implementations.

StreamUtil

Class containing tools for access to IO streams.

StreamUtil.ReadHandler

Used by StreamUtil methods to process values that have been read from a
 stream.

XmlWriter

A simple class to write XML files directly to an arbitrary Writer
 instance.

Exception Summary

Exception
Description

StreamLimitException

An IO exception that is thrown if a stream has reached a limit.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
'use strict';

/**
 * @ngdoc function
 * @name africaSmsApp.controller:AboutCtrl
 * @description
 * # AboutCtrl
 * Controller of the africaSmsApp
 */
angular.module('africaSmsApp')
  .controller('ListsCtrl', ['$scope', '$location', 'EverythingFactory', function ($scope, $location, EverythingFactory) {
    EverythingFactory.getLists().then(function (data) {
      $scope.lists = data;
    });
    $scope.goToList = function (list) {
      $location.path('/lists/' + list.id);
    };
    $scope.createList = function () {
      var name = window.prompt('What is this list\'s name?');
      if (name) {
        ///create list and navigate to it
        EverythingFactory.addList(name).then(function (data) {
          $scope.lists = data.distributionLists;
        });
      }
    };
    $scope.isModalOpen = false;
    $scope.newMessage = function () {
      $scope.isModalOpen = true;
    };
    $scope.messageSent = function (message) {
      if (message.text) {
        EverythingFactory.sendMessage(message.list, message.text).then(function (data) {
          console.log(data);
          $scope.isModalOpen = false;
        });
      }
    };
    $scope.closeModal = function () {
      $scope.isModalOpen = false;
    };
  }]);