text:
SitemapNotifier::Notifier.configure do |config|
  # Set URL to your sitemap. This is required.
  # config.sitemap_url = Quadro.railtie_routes_url_helpers.sitemap_url

  # Enabled in which environments – default is [:production]
  # config.environments = [:development, :production]

  # Delay to wait between notifications – default is 10 minutes
  config.delay = 2.minutes

  # Additional urls to ping
  # config.ping_urls << "http://localhost:3000/ping?sitemap=%{sitemap_url}"

  # If you don't want the notifications to run in the background
  config.background = false
end


text:
typedef struct _GtkList GtkList;
class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
{
public:
    // ctors and such
  wxListBox();
  wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString*) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxASCII_STR(wxListBoxNameStr))
  {
#  if  wxUSE_CHECKLISTBOX
    m_hasCheckBoxes = false;
#  endif
    Create(parent, id, pos, size, n, choices, style, validator, name);
  }
  wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxASCII_STR(wxListBoxNameStr))
  {
#  if  wxUSE_CHECKLISTBOX
    m_hasCheckBoxes = false;
#  endif
    Create(parent, id, pos, size, choices, style, validator, name);
  }
  virtual ~wxListBox();
  bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString*) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxASCII_STR(wxListBoxNameStr));
  bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxASCII_STR(wxListBoxNameStr));
    // implement base class pure virtuals
  virtual void DoClear();
  virtual void DoDeleteOneItem(unsigned int n);
  virtual unsigned int GetCount() const;
  virtual wxString GetString(unsigned int n) const;
  virtual void SetString(unsigned int n, const wxString& s);
  virtual int FindString(const wxString& s, bool bCase = false) const;
  virtual bool IsSelected(int n) const;
  virtual void DoSetSelection(int n, bool select);
  virtual int GetSelection() const;
  virtual int GetSelections(wxArrayInt& aSelections) const;
  virtual int DoInsertItems(const wxArrayStringsAdapter& items, unsigned int pos, void** clientData, wxClientDataType type);
  virtual void DoSetFirstItem(int n);
  virtual void DoSetItemClientData(unsigned int n, void* clientData);
  virtual void* DoGetItemClientData(unsigned int n) const;
  static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
    // implementation from now on
  void GtkAddItem(const wxString& item, int pos = -1);
  int GtkGetIndex(GtkWidget* item) const;
  GtkWidget* GetConnectWidget();
  bool IsOwnGtkWindow(GdkWindow* window);
  void DoApplyWidgetStyle(GtkRcStyle* style);
  void OnInternalIdle();
#  if  wxUSE_TOOLTIPS
  void ApplyToolTip(GtkTooltips* tips, const wxChar* tip);
#  endif
  GtkList* m_list;
  wxList m_clientList;
#  if  wxUSE_CHECKLISTBOX
  bool m_hasCheckBoxes;
#  endif
  int m_prevSelection;
  bool m_blockEvent;
  virtual void FixUpMouseEvent(GtkWidget* widget, wxCoord& x, wxCoord& y);
protected:
  virtual wxSize DoGetBestSize() const;
    // return the string label for the given item
  wxString GetRealLabel(struct _GList* item) const;
    // Widgets that use the style->base colour for the BG colour should
    // override this and return true.
  virtual bool UseGTKStyleBase() const
  {
    return true;
  }
private:
    // this array is only used for controls with wxCB_SORT style, so only
    // allocate it if it's needed (hence using pointer)
  wxSortedArrayString* m_strings;
  wxDECLARE_DYNAMIC_CLASS(wxListBox);
};
#endif

redpajama_set_name: RedPajamaGithub


text:
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

# install zsh syntax highlighting
cd ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git


text:
BOOL                    HTTPStrInsensitiveCompare   (CHAR *pSrc, CHAR* pDest, UINT32 nLength);
BOOL                    HTTPStrSearch               (CHAR *pSrc, CHAR *pSearched, UINT32 nOffset, UINT32 nScope,HTTP_PARAM *HttpParam);
CHAR                    HTTPStrExtract              (CHAR *pParam,UINT32 nOffset,CHAR Restore);
CHAR*                   HTTPStrCaseStr              (CHAR *pSrc, UINT32 nSrcLength, CHAR *pFind);
CHAR*                   HTTPStrGetToken             (CHAR *pSrc, UINT32 nSrcLength, CHAR *pDest, UINT32 *nDestLength);
UINT32                  HTTPStrGetDigestToken       (HTTP_PARAM pParamSrc, CHAR *pSearched, HTTP_PARAM *pParamDest);
UINT32                  HTTPStrHToL                 (CHAR * s);
CHAR*                   HTTPStrLToH                 (CHAR * dest,UINT32 nSrc);
#endif


text:
vaulted-load 1
=============

NAME
----

vaulted load - uses JSON provided to stdin to create or replace the content of a vault

SYNOPSIS
--------

`vaulted load` *name*

DESCRIPTION
-----------

Replaces the content of *name* with JSON content provided via stdin.


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

#if NETFX_CORE
	using Windows.Security.Cryptography;
	using Windows.Security.Cryptography.Core;
	using Windows.Storage.Streams;
	using BestHTTP.PlatformSupport.IO;

	using FileStream = BestHTTP.PlatformSupport.IO.FileStream;
#elif UNITY_WP8
    using Cryptography = BestHTTP.PlatformSupport.Cryptography;
#else
	using Cryptography = System.Security.Cryptography;
	using FileStream = System.IO.FileStream;
#endif

namespace BestHTTP.Extensions
{
    public static class Extensions
    {
        #region ASCII Encoding (These are required becouse Windows Phone doesn't supports the Encoding.ASCII class.)

        /// <summary>
        /// On WP8 platform there are no ASCII encoding.
        /// </summary>
        public static string AsciiToString(this byte[] bytes)
        {
            StringBuilder sb = new StringBuilder(bytes.Length);
            foreach (byte b in bytes)
                sb.Append(b <= 0x7f ? (char)b : '?');
            return sb.ToString();
        }

        /// <summary>
        /// On WP8 platform there are no ASCII encoding.
        /// </summary>
        public static byte[] GetASCIIBytes(this string str)
        {
            byte[] result = new byte[str.Length];
            for (int i = 0; i < str.Length; ++i)
            {
                char ch = str[i];
                result[i] = (byte)((ch < (char)0x80) ? ch : '?');
            }

            return result;
        }

        public static void SendAsASCII(this BinaryWriter stream, string str)
        {
            for (int i = 0; i < str.Length; ++i)
            {
                char ch = str[i];

                stream.Write((byte)((ch < (char)0x80) ? ch : '?'));
            }
        }

        #endregion

        #region FileSystem WriteLine function support

        public static void WriteLine(this FileStream fs)
        {
            fs.Write(HTTPRequest.EOL, 0, 2);
        }

        public static void WriteLine(this FileStream fs, string line)
        {
            var buff = line.GetASCIIBytes();
            fs.Write(buff, 0, buff.Length);
            fs.WriteLine();
        }

        public static void WriteLine(this FileStream fs, string format, params object[] values)
        {
            var buff = string.Format(format, values).GetASCIIBytes();
            fs.Write(buff, 0, buff.Length);
            fs.WriteLine();
        }

        #endregion

        #region Other Extensions

        public static string[] FindOption(this string str, string option)
        {
            //s-maxage=2678400, must-revalidate, max-age=0
            string[] options = str.ToLower().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            option = option.ToLower();

            for (int i = 0; i < options.Length; ++i)
                if (options[i].Contains(option))
                    return options[i].Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries);

            return null;
        }

        #endregion

        #region String Conversions

        public static int ToInt32(this string str, int defaultValue = default(int))
        {
            if (str == null)
                return defaultValue;

            try
            {
                return int.Parse(str);
            }
            catch
            {
                return defaultValue;
            }
        }

        public static long ToInt64(this string str, long defaultValue = default(long))
        {
            if (str == null)
                return defaultValue;

            try
            {
                return long.Parse(str);
            }
            catch
            {
                return defaultValue;
            }
        }

        public static DateTime ToDateTime(this string str, DateTime defaultValue = default(DateTime))
        {
            if (str == null)
                return defaultValue;

            try
            {
                DateTime.TryParse(str, out defaultValue);
                return defaultValue.ToUniversalTime();
            }
            catch
            {
                return defaultValue;
            }
        }

        public static string ToStrOrEmpty(this string str)
        {
            if (str == null)
                return String.Empty;

            return str;
        }

        #endregion

        #region MD5 Hashing

        public static string CalculateMD5Hash(this string input)
        {
            return input.GetASCIIBytes().CalculateMD5Hash();
        }

        public static string CalculateMD5Hash(this byte[] input)
        {
#if NETFX_CORE
            var alg = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5);
            IBuffer buff = CryptographicBuffer.CreateFromByteArray(input);
            var hashed = alg.HashData(buff);
            var res = CryptographicBuffer.EncodeToHexString(hashed);
            return res;
#else
            var hash = Cryptography.MD5.Create().ComputeHash(input);
            var sb = new StringBuilder();
            foreach (var b in hash)
                sb.Append(b.ToString("x2"));
            return sb.ToString();
#endif
        }

        #endregion

        #region Efficient String Parsing Helpers

        internal static string Read(this string str, ref int pos, char block, bool needResult = true)
        {
            return str.Read(ref pos, (ch) => ch != block, needResult);
        }

        internal static string Read(this string str, ref int pos, Func<char, bool> block, bool needResult = true)
        {
            if (pos >= str.Length)
                return string.Empty;

            str.SkipWhiteSpace(ref pos);

            int startPos = pos;

            while (pos < str.Length && block(str[pos]))
                pos++;

            string result = needResult ? str.Substring(startPos, pos - startPos) : null;

            // set position to the next char
            pos++;

            return result;
        }

        internal static string ReadQuotedText(this string str, ref int pos)
        {
            string result = string.Empty;
            if (str == null)
                return result;

            // It's a quoted text?
            if (str[pos] == '\"')
            {
                // Skip the starting quote
                str.Read(ref pos, '\"', false);

                // Read the text until the ending quote
                result = str.Read(ref pos, '\"');

                // Next option
                str.Read(ref pos, ',', false);
            }
            else
                // It's not a quoted text, so we will read until the next option
                result = str.Read(ref pos, ',');

            return result;
        }

        internal static void SkipWhiteSpace(this string str, ref int pos)
        {
            if (pos >= str.Length)
                return;

            while (pos < str.Length && char.IsWhiteSpace(str[pos]))
                pos++;
        }

        internal static string TrimAndLower(this string str)
        {
            if (str == null)
                return null;

            char[] buffer = new char[str.Length];
            int length = 0;

            for (int i = 0; i < str.Length; ++i)
            {
                char ch = str[i];
                if (!char.IsWhiteSpace(ch) && !char.IsControl(ch))
                    buffer[length++] = char.ToLowerInvariant(ch);
            }

            return new string(buffer, 0, length);
        }

        #endregion

        #region Specialized String Parsers

        //public, max-age=2592000
        internal static List<KeyValuePair> ParseOptionalHeader(this string str)
        {
            List<KeyValuePair> result = new List<KeyValuePair>();

            if (str == null)
                return result;

            int idx = 0;

            // process the rest of the text
            while (idx < str.Length)
            {
                // Read key
                string key = str.Read(ref idx, (ch) => ch != '=' && ch != ',').TrimAndLower();
                KeyValuePair qp = new KeyValuePair(key);

                if (str[idx - 1] == '=')
                    qp.Value = str.ReadQuotedText(ref idx);

                result.Add(qp);
            }

            return result;
        }

        //deflate, gzip, x-gzip, identity, *;q=0
        internal static List<KeyValuePair> ParseQualityParams(this string str)
        {
            List<KeyValuePair> result = new List<KeyValuePair>();

            if (str == null)
                return result;

            int idx = 0;
            while (idx < str.Length)
            {
                string key = str.Read(ref idx, (ch) => ch != ',' && ch != ';').TrimAndLower();

                KeyValuePair qp = new KeyValuePair(key);

                if (str[idx - 1] == ';')
                {
                    str.Read(ref idx, '=', false);
                    qp.Value = str.Read(ref idx, ',');
                }

                result.Add(qp);
            }

            return result;
        }

        #endregion

        #region Buffer Filling

        /// <summary>
        /// Will fill the entire buffer from the stream. Will throw an exception when the underlying stream is closed.
        /// </summary>
        public static void ReadBuffer(this Stream stream, byte[] buffer)
        {
            int count = 0;

            do
            {
                int read = stream.Read(buffer, count, buffer.Length - count);

                if (read <= 0)
                    throw ExceptionHelper.ServerClosedTCPStream();

                count += read;
            } while (count < buffer.Length);
        }

        #endregion

        #region MemoryStream

        public static void WriteAll(this MemoryStream ms, byte[] buffer)
        {
            ms.Write(buffer, 0, buffer.Length);
        }

        public static void WriteString(this MemoryStream ms, string str)
        {
            byte[] buffer = Encoding.UTF8.GetBytes(str);
            ms.WriteAll(buffer);
        }

        public static void WriteLine(this MemoryStream ms)
        {
            ms.WriteAll(HTTPRequest.EOL);
        }

        public static void WriteLine(this MemoryStream ms, string str)
        {
            ms.WriteString(str);
            ms.WriteLine();
        }

        #endregion
    }

    public static class ExceptionHelper
    {
        public static Exception ServerClosedTCPStream()
        {
            return new Exception("TCP Stream closed unexpectedly by the remote server");
        }
    }
}


text:
<admin-grid>
  <ng-template>
    <admin-panel>

            <admin-font name="flag"></admin-font>  FooBarBaz Corp.

          <address class="invoice__address">
            42 Foo Ave, Suite 42

            San Francisco, CA 94107

            Phone: (123) 456-7890

            Email: support@foobar.baz
          </address>

Invoice #42

Issued 3 August 2017

Payment due 3 September 2017

Some Corp.

          <address class="invoice__address">
            42 Some Ave, Suite 42

            San Francisco, CA 94107

            Phone: (111) 111-1111

          </address>

        <admin-table [hover]="true" [striped]="true" tablesaw="stack">

              #
              Item
              Quantity
              Unit Price
              Subtotal

              {{i + 1}}
              {{item.description}}
              {{item.quantity}} {{item.unit}}
              ${{item.price}}
              ${{item.price * item.quantity}}

              Total
              ${{total}}

        </admin-table>

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

          <admin-table [striped]="true" [hover]="true">

                Amount due

                Subtotal
                ${{total}}

                Tax (2%)
                ${{total * 0.02}}

                Total
                ${{total * 1.02}}

          </admin-table>

          <admin-button
            color="darkgray"
            [outlined]="true"
            (click)="onPrint()"
          >Print invoice</admin-button>

    </admin-panel>
  </ng-template>
</admin-grid>


text:
package software.amazon.awssdk.utils;

import static software.amazon.awssdk.utils.StringUtils.lowerCase;

import java.util.function.Supplier;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import software.amazon.awssdk.annotations.SdkProtectedApi;

@SdkProtectedApi
public final class Logger {
    private final org.slf4j.Logger log;

    Logger(org.slf4j.Logger log) {
        this.log = log;
    }

    public org.slf4j.Logger logger() {
        return log;
    }

    /**
     * Checks if info is enabled and if so logs the supplied message
     * @param msg - supplier for the log message
     */
    public void info(Supplier<String> msg) {
        if (log.isInfoEnabled()) {
            log.info(msg.get());
        }
    }

    /**
     * Checks if info is enabled and if so logs the supplied message and exception
     * @param msg - supplier for the log message
     * @param throwable - a throwable to log
     */
    public void info(Supplier<String> msg, Throwable throwable) {
        if (log.isInfoEnabled()) {
            log.info(msg.get(), throwable);
        }
    }

    /**
     * Checks if error is enabled and if so logs the supplied message
     * @param msg - supplier for the log message
     */
    public void error(Supplier<String> msg) {
        if (log.isErrorEnabled()) {
            log.error(msg.get());
        }
    }

    /**
     * Checks if error is enabled and if so logs the supplied message and exception
     * @param msg - supplier for the log message
     * @param throwable - a throwable to log
     */
    public void error(Supplier<String> msg, Throwable throwable) {
        if (log.isErrorEnabled()) {
            log.error(msg.get(), throwable);
        }
    }

    /**
     * Checks if debug is enabled and if so logs the supplied message
     * @param msg - supplier for the log message
     */
    public void debug(Supplier<String> msg) {
        if (log.isDebugEnabled()) {
            log.debug(msg.get());
        }
    }

    /**
     * Checks if debug is enabled and if so logs the supplied message and exception
     * @param msg - supplier for the log message
     * @param throwable - a throwable to log
     */
    public void debug(Supplier<String> msg, Throwable throwable) {
        if (log.isDebugEnabled()) {
            log.debug(msg.get(), throwable);
        }
    }

    /**
     * Checks if warn is enabled and if so logs the supplied message
     * @param msg - supplier for the log message
     */
    public void warn(Supplier<String> msg) {
        if (log.isWarnEnabled()) {
            log.warn(msg.get());
        }
    }

    /**
     * Checks if warn is enabled and if so logs the supplied message and exception
     * @param msg - supplier for the log message
     * @param throwable - a throwable to log
     */
    public void warn(Supplier<String> msg, Throwable throwable) {
        if (log.isWarnEnabled()) {
            log.warn(msg.get(), throwable);
        }
    }

    /**
     * Checks if trace is enabled and if so logs the supplied message
     * @param msg - supplier for the log message
     */
    public void trace(Supplier<String> msg) {
        if (log.isTraceEnabled()) {
            log.trace(msg.get());
        }
    }

    /**
     * Checks if trace is enabled and if so logs the supplied message and exception
     * @param msg - supplier for the log message
     * @param throwable - a throwable to log
     */
    public void trace(Supplier<String> msg, Throwable throwable) {
        if (log.isTraceEnabled()) {
            log.trace(msg.get(), throwable);
        }
    }

    /**
     * Determines if the provided log-level is enabled.
     * @param logLevel the SLF4J log level enum
     * @return whether that level is enabled
     */
    public boolean isLoggingLevelEnabled(Level logLevel) {
        switch (logLevel) {
            case TRACE:
                return log.isTraceEnabled();
            case DEBUG:
                return log.isDebugEnabled();
            case INFO:
                return log.isInfoEnabled();
            case WARN:
                return log.isWarnEnabled();
            case ERROR:
                return log.isErrorEnabled();
            default:
                throw new IllegalStateException("Unsupported log level: " + logLevel);
        }
    }

    /**
     * Determines if the log-level passed is enabled
     * @param logLevel a string representation of the log level, e.g. "debug"
     * @return whether or not that level is enable
     */
    public boolean isLoggingLevelEnabled(String logLevel) {
        String lowerLogLevel = lowerCase(logLevel);
        switch (lowerLogLevel) {
            case "debug":
                return log.isDebugEnabled();
            case "trace":
                return log.isTraceEnabled();
            case "error":
                return log.isErrorEnabled();
            case "info":
                return log.isInfoEnabled();
            case "warn":
                return log.isWarnEnabled();
            default:
                throw new IllegalArgumentException("Unknown log level: " + lowerLogLevel);
        }
    }

    /**
     * Log a message at the given log level (if it is enabled).
     *
     * @param logLevel the SLF4J log level
     * @param msg      supplier for the log message
     */
    public void log(Level logLevel, Supplier<String> msg) {
        switch (logLevel) {
            case TRACE:
                trace(msg);
                break;
            case DEBUG:
                debug(msg);
                break;
            case INFO:
                info(msg);
                break;
            case WARN:
                warn(msg);
                break;
            case ERROR:
                error(msg);
                break;
            default:
                throw new IllegalStateException("Unsupported log level: " + logLevel);
        }
    }

    /**
     * Static factory to get a logger instance for a given class
     * @param clz - class to get the logger for
     * @return a Logger instance
     */
    public static Logger loggerFor(Class<?> clz) {
        return new Logger(LoggerFactory.getLogger(clz));
    }

    /**
     * Static factory to get a logger instance with a specific name.
     * @param name - The name of the logger to create
     * @return a Logger instance
     */
    public static Logger loggerFor(String name) {
        return new Logger(LoggerFactory.getLogger(name));
    }
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const baseResource_1 = require("./baseResource");
/**
 * ClusterZdu
 *
 * @constructor ClusterZdu
 * @property {IConnector} connector the jira connector instance
 */
class ClusterZdu extends baseResource_1.baseResource {
    constructor(connector, Model, settings) {
        super(connector, Model, settings);
        /**
         *
         *
         * @method approveUpgrade
         * @memberOf ClusterZdu#
         * @param {Object} options An object containing options to pass to the Jira API.
         * @param {string} options.token token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used
         * @param [callback] if supplied, called with result of api call
         * @return {Promise.<any>} result of api call
         */
        this.approveUpgrade = (...args) => {
            if (args.length === 0) {
                throw new Error("options must be passed");
            }
            let callback = ((typeof args[args.length - 1]) === 'function') ? args.pop() : null;
            let options = ((typeof args[0]) === 'object') ? args[0] : {};
            return this.makeRequest('approveUpgrade', 'POST', 'rest/api/2/cluster/zdu/approve', options, callback);
        };
        /**
         *
         *
         * @method cancelUpgrade
         * @memberOf ClusterZdu#
         * @param {Object} options An object containing options to pass to the Jira API.
         * @param {string} options.token token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used
         * @param [callback] if supplied, called with result of api call
         * @return {Promise.<any>} result of api call
         */
        this.cancelUpgrade = (...args) => {
            if (args.length === 0) {
                throw new Error("options must be passed");
            }
            let callback = ((typeof args[args.length - 1]) === 'function') ? args.pop() : null;
            let options = ((typeof args[0]) === 'object') ? args[0] : {};
            return this.makeRequest('cancelUpgrade', 'POST', 'rest/api/2/cluster/zdu/cancel', options, callback);
        };
        /**
         *
         *
         * @method getState
         * @memberOf ClusterZdu#
         * @param {Object} options An object containing options to pass to the Jira API.
         * @param {string} options.token token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used
         * @param [callback] if supplied, called with result of api call
         * @return {Promise.<any>} result of api call
         */
        this.getState = (...args) => {
            if (args.length === 0) {
                throw new Error("options must be passed");
            }
            let callback = ((typeof args[args.length - 1]) === 'function') ? args.pop() : null;
            let options = ((typeof args[0]) === 'object') ? args[0] : {};
            return this.makeRequest('getState', 'GET', 'rest/api/2/cluster/zdu/state', options, callback);
        };
        /**
         *
         *
         * @method setReadyToUpgrade
         * @memberOf ClusterZdu#
         * @param {Object} options An object containing options to pass to the Jira API.
         * @param {string} options.token token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used
         * @param [callback] if supplied, called with result of api call
         * @return {Promise.<any>} result of api call
         */
        this.setReadyToUpgrade = (...args) => {
            if (args.length === 0) {
                throw new Error("options must be passed");
            }
            let callback = ((typeof args[args.length - 1]) === 'function') ? args.pop() : null;
            let options = ((typeof args[0]) === 'object') ? args[0] : {};
            return this.makeRequest('setReadyToUpgrade', 'POST', 'rest/api/2/cluster/zdu/start', options, callback);
        };
        this.methods = [];
        this.register();
    }
}
exports.ClusterZdu = ClusterZdu;


text:
from django.conf.urls import patterns, include

urlpatterns = patterns('',
    (r'^view_base/', include('xtests.view_base.urls')),
)


text:
package com.facebook.buck.cxx.toolchain;

import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.SourcePath;
import com.facebook.buck.rules.SourcePathRuleFinder;
import com.facebook.buck.rules.SymlinkTree;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import java.nio.file.Path;
import java.util.Optional;

public class HeaderSymlinkTree extends SymlinkTree {

  public HeaderSymlinkTree(
      BuildTarget target,
      ProjectFilesystem filesystem,
      Path root,
      ImmutableMap<Path, SourcePath> links,
      SourcePathRuleFinder ruleFinder) {
    super("cxx_header", target, filesystem, root, links, ImmutableMultimap.of(), ruleFinder);
  }

  /**
   * Get path to use as an include path to get access to the files in the tree.
   *
   *
If {@link #getHeaderMap()} is present, then the path it returns needs to be passed as an
   * include path as well and it has to be passed before the path returned from this method.
   *
   *
This path should not be added to rulekeys as a SourcePath (in some cases it points to the
   * entire buck-out).
   */
  public Path getIncludePath() {
    return getRoot();
  }

  /** Get path of the header map indexing this tree if one exists. */
  public Optional<Path> getHeaderMap() {
    return Optional.empty();
  }

  public Optional<SourcePath> getHeaderMapSourcePath() {
    return Optional.empty();
  }
}


text:
<?php

/* TwigBundle:Exception:error.json.twig */
class __TwigTemplate_1d60f860ddd0b390b17d088c990a919b8a7854a4b8de6cde77acbe55f09f701b extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo twig_jsonencode_filter(array("error" => array("code" => (isset($context["status_code"]) ? $context["status_code"] : null), "message" => (isset($context["status_text"]) ? $context["status_text"] : null))));
        echo "
";
    }

    public function getTemplateName()
    {
        return "TwigBundle:Exception:error.json.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  19 => 1,);
    }
}
/* {{ { 'error': { 'code': status_code, 'message': status_text } }|json_encode|raw }}*/
/* */


text:
"""
Structures to test in the Base package
"""

__author__ = "Benjamin Schubert, benjamin.schubert@epfl.ch"

from lib.configuration.coredump import setup_coredumps, change_coredump_filter
from plugins.base.success import Success
from tests.lib.structures import Compiler, Plugin, AnalysisPlugin

class BaseStructure:
    """
    Structures belonging to the Base package
    """
    @property
    def package(self) -> str:
        """ The package name : base """
        return "base"

# noinspection PyAbstractClass
class SuccessPlugin(BaseStructure, Plugin):
    """
    The Success plugin
    """
    @property
    def name(self) -> str:
        """ the plugin name """
        return "success"

# noinspection PyAbstractClass
class FailPlugin(BaseStructure, Plugin):
    """
    The Fail plugin
    """
    @property
    def name(self) -> str:
        """ the plugin name """
        return "fail"

    def pre_run(self):
        """ Sets up coredumps options before the run """
        setup_coredumps()
        change_coredump_filter()

# noinspection PyAbstractClass
class RRPlugin(BaseStructure, Plugin):
    """
    The Success plugin
    """
    @property
    def name(self) -> str:
        """ the package name """
        return "rr"

class BenchmarkPlugin(BaseStructure, AnalysisPlugin):
    """
    The Benchmark plugin, running with success
    """
    @property
    def name(self) -> str:
        """ the package name """
        return "benchmark"

    @property
    def main_plugin(self):
        """ The main plugin with which to run """
        return Success

    @property
    def priority(self):
        """ Benchmarking is very slow. It must thus be run before the others in order to maximize efficiency """
        return 2

# noinspection PyAbstractClass
class GccCompilerWithoutWllvmTest(BaseStructure, Compiler):
    """
    Compiles without wllvm with gcc
    """

    @property
    def bitcode(self):
        """ We don't want bitcode to be created """
        return False

    @property
    def name(self):
        """ the compiler name to use: gcc """
        return "gcc"

# noinspection PyAbstractClass
class ClangCompilerWithoutWllvmTest(BaseStructure, Compiler):
    """
    Compiles without wllvm with clang
    """

    @property
    def bitcode(self) -> bool:
        """ We don't want bitcode to be created """
        return False

    @property
    def name(self) -> str:
        """ the compiler name to use: clang """
        return "clang"

# noinspection PyAbstractClass
class ClangCompilerWithWllvmAndPluginsTest(BaseStructure, Compiler):
    """
    Tests building everything with wllvm and clang. Also tests all plugins against these programs
    """
    plugins = [SuccessPlugin(), FailPlugin(), RRPlugin(), BenchmarkPlugin()]

    @property
    def bitcode(self) -> bool:
        """ We want bitcode to be created """
        return True

    @property
    def name(self) -> str:
        """ The compiler name to use: clang """
        return "clang"

    @property
    def priority(self) -> int:
        """
        This compiler uses the custom wllvm, which has to be installed. PLus plugins, which have to be configured.
        We thus diminish a bit its priority
        """
        return 7


text:
package org.apache.s4.benchmark.dag;

import org.apache.s4.base.Event;
import org.apache.s4.core.ProcessingElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LastPE extends ProcessingElement {

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

    public void onEvent(Event event) {

        String value = event.get("value", String.class);
        logger.trace("LastPE : {} -> {}", getId(), value);
    }

    @Override
    protected void onRemove() {
        // TODO Auto-generated method stub

    }

    @Override
    protected void onCreate() {
        // TODO Auto-generated method stub

    }

}


text:
% --------------------------------------------------------
%
%                          S E T U P
%
% Este archivo mantiene en orden las carpetas de búsqueda
% necesarias para ejecutar de manera ordenada los métodos
% utilizados en la materia de Optimización Numérica,
% además de la configuración con AMPL.
%
% --------------------------------------------------------

% ampl
% -----
% Biblioteca para derivación automática
addpath('/home/josmanps/Projects/Optimizacion-Numerica/ampl')

% examples
% ---------
% Esta carpeta contiene scripts en los que se usan los métodos
% desarrollados
addpath('/home/josmanps/Projects/Optimizacion-Numerica/examples')

% utils
% ------
% En esta carpeta se tienen las funciones que no representan un
% método de optimización completo, pero que son necesarias
% para ello.
addpath('/home/josmanps/Projects/Optimizacion-Numerica/utils')

% PCS
% ----
% TODO (josman): Escribir descripción
addpath('/home/josmanps/Projects/Optimizacion-Numerica/PCS')

% ampl-models
% ------------
% Modelos escritos para ampl
addpath('/home/josmanps/Projects/Optimizacion-Numerica/ampl-models')

% Gradiente Conjugado
addpath('/home/josmanps/Projects/Optimizacion-Numerica/GC')

% Proyectos
addpath('/home/josmanps/Projects/Optimizacion-Numerica/Proyectos')

% Gradiente Conjugado Proyectado
addpath('/home/josmanps/Projects/Optimizacion-Numerica/Projected_CG')

% Interior Point Methods
addpath('/home/josmanps/Projects/Optimizacion-Numerica/IPM')


text:
layout: page
title: Spring Systems Dinner
date: 2016-05-24
author: David Gaines
tags: weekly links, java
status: published
summary: Nullam venenatis enim fermentum, semper augue eu, ornare dolor. Donec.
banner: images/banner/leisure-03.jpg
booking:
  startDate: 04/12/2018
  endDate: 04/15/2018
  ctyhocn: BEHMIHX
  groupCode: SSD
published: true
---
Mauris vehicula, lacus vel placerat volutpat, nisi urna consequat velit, in maximus urna risus id massa. Nulla a elit feugiat, porta ipsum vel, faucibus erat. Donec commodo mi commodo arcu consectetur, sit amet tempus ex bibendum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Fusce purus felis, fringilla ut quam nec, viverra lacinia lorem. Donec vehicula ipsum at ex tincidunt feugiat. Donec venenatis metus ut enim tincidunt porta. Duis blandit non risus non porta. In tortor est, tempus a luctus at, pellentesque sit amet ligula. In aliquet condimentum congue. Aenean sem nisi, elementum at sapien vitae, pretium condimentum libero.

* Etiam ut nulla laoreet, aliquam turpis a, ultrices tortor
* Vestibulum ornare turpis quis magna laoreet porta
* Ut sollicitudin tortor eget lorem tempus fermentum
* Vivamus facilisis ligula at nisl fringilla, ac ultrices dolor pretium.

Morbi molestie quam dignissim sodales varius. Curabitur et quam et mi iaculis commodo. Etiam magna urna, fringilla ac augue non, luctus facilisis nunc. In purus quam, commodo in pretium ac, accumsan eget sem. Quisque aliquet semper erat non vulputate. Etiam et urna eu nunc sodales egestas ut vitae ex. Fusce suscipit porttitor nulla, egestas consectetur risus efficitur eget. Vivamus sit amet elit non ligula lobortis scelerisque non vitae tellus. Suspendisse nec erat auctor, ultricies arcu sed, malesuada lorem. Vivamus viverra convallis tempor. Nulla facilisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse ac urna eu felis malesuada faucibus. Integer lacinia quam lacus, ac pulvinar dui ultricies vel.


text:
//
// Copyright (c) articy Software GmbH & Co. KG. All rights reserved.

//
#pragma once

#include "ArticyObjectWith_Base.h"
#include "ArticyObjectWithColor.generated.h"

UINTERFACE(MinimalAPI, BlueprintType, meta=(CannotImplementInterfaceInBlueprint))
class UArticyObjectWithColor : public UArticyObjectWith_Base { GENERATED_BODY() };

/**
 * All objects that have a property called 'Color' implement this interface.
 */
class IArticyObjectWithColor : public IArticyObjectWith_Base
{
	GENERATED_BODY()

public:

	UFUNCTION(BlueprintCallable, Category="ArticyObjectWithColor")
	virtual FLinearColor& GetColor()
	{
		static const auto PropName = FName("Color");
		return GetProperty<FLinearColor>(PropName);
	}

	virtual FLinearColor& GetColor() const
	{
		return const_cast<IArticyObjectWithColor*>(this)->GetColor();
	}

	//---------------------------------------------------------------------------//

	UFUNCTION(BlueprintCallable, Category="ArticyObjectWithColor")
	virtual FLinearColor& SetColor(UPARAM(ref) const FLinearColor& Color)
	{
		return GetColor() = Color;
	}
};


text:
package org.jbb.system.api.logging.model;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = AppLoggerNameUniqueValidator.class)
public @interface AppLoggerNameUnique {
    String message() default "{org.jbb.system.api.logging.model.AppLoggerNameUnique.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}


text:
package com.jalat.error;

import java.util.Arrays;

/**
 * TODO Describe class
 *
 * @author Andrey Paslavsky
 * @since 0.1
 */
public class MethodIsNotAllowedHereException extends IncorectBehaviorDetectedException {
    public MethodIsNotAllowedHereException(String method, String... availableInside) {
        super("Method #" + method + " is not allowed here!" +
                (availableInside.length > 0 ? "It is available only inside " + Arrays.toString(availableInside) : ""));
    }
}


text:
<!DOCTYPE html>

    <title></title>

Description:

This sample showcases continuous speech recognition using a custom SRGS grammar.

            <button id="btnContinuousReco" disabled class="win-button"> Continuous Recognition</button>

                <canvas id="shapes" height="200" width="200"></canvas>

Tap the microphone button and speak to choose colors for the circle, background, and border. Try saying 'blue background, red border, green circle'.


text:
package main

import (
	"fmt"
	"regexp"
	"strings"

	"github.com/SUSE/dockerclient"
	"github.com/codegangsta/cli"
)

var specialFlags = []string{
	"--bugzilla",
	"--cve",
	"--issues",
}

func arrayIncludeString(arr []string, s string) bool {
	for _, i := range arr {
		if i == s {
			return true
		}
	}
	return false
}

// It appends the set flags with the given command.
// `boolFlags` is a list of strings containing the names of the boolean
// command line options. These have to be handled in a slightly different
// way because zypper expects `--boolflag` instead of `--boolflag true`. Also
// boolean flags with a false value are ignored because zypper set all the
// undefined bool flags to false by default.
// `toIgnore` contains a list of flag names to not be passed to the final
//  command, this is useful to prevent zypper-docker only parameters to be
// forwarded to zypper (eg: `--author` or `--message`).
func cmdWithFlags(cmd string, ctx *cli.Context, boolFlags, toIgnore []string) string {
	for _, name := range ctx.FlagNames() {
		if arrayIncludeString(toIgnore, name) {
			continue
		}

		if value := ctx.String(name); ctx.IsSet(name) {
			var dash string
			if len(name) == 1 {
				dash = "-"
			} else {
				dash = "--"
			}

			if arrayIncludeString(boolFlags, name) {
				cmd += fmt.Sprintf(" %v%s", dash, name)
			} else {
				if arrayIncludeString(specialFlags, fmt.Sprintf("%v%s", dash, name)) && value != "" {
					cmd += fmt.Sprintf(" %v%s=%s", dash, name, value)
				} else {
					cmd += fmt.Sprintf(" %v%s %s", dash, name, value)
				}
			}
		}
	}

	return cmd
}

// This function clears a list of args (like the one provided by `os.Args`)
// to match with some special cases of zypper.
// For example:
//   zypper lp --bugzilla
// In the above case --buzilla acts as a boolean flag, while with:
//   zypper lp --bugzilla=123
// acts like a string flag.
// We have to differentiate between invocations with and without the "=".
// When the "=" is not found we have to artificially inject an empty string
// to avoid the next parameter to be considered the flag value.
func fixArgsForZypper(args []string) []string {
	sanitizedArgs := []string{}
	skip := false

	for pos, arg := range args {
		if skip {
			skip = false
			continue
		}

		special := false
		for _, specialFlag := range specialFlags {
			if specialFlag == arg {
				sanitizedArgs = append(sanitizedArgs, arg)
				sanitizedArgs = append(sanitizedArgs, "")
				special = true

				if len(args) >= (pos+1) && args[pos+1] == "" {
					skip = true
				}
				break
			} else if strings.Contains(arg, specialFlag+"=") {
				argAndValue := strings.SplitN(arg, "=", 2)

				sanitizedArgs = append(sanitizedArgs, argAndValue[0])
				sanitizedArgs = append(sanitizedArgs, argAndValue[1])
				special = true
				break
			}
		}
		if !special {
			sanitizedArgs = append(sanitizedArgs, arg)
		}
	}

	return sanitizedArgs
}

// Given a Docker image name it returns the repository and the tag composing it
// Returns the repository and the tag strings.
// Examples:
//   * suse/sles11sp3:1.0.0 -> repo is suse/sles11sp3, tag is 1.0.0
//   * suse/sles11sp3 -> repo is suse/sles11sp3, tag is latest
func parseImageName(name string) (string, string, error) {
	var repo, tag string

	re := regexp.MustCompile("([a-z0-9\\._-]+(:[a-z0-9\\._-]+)?\\z)")
	match := re.FindAllString(name, -1)
	if match == nil || len(match) == 0 {
		return "", "", fmt.Errorf("Cannot parse image name")
	}
	repoAndTag := strings.SplitN(match[0], ":", 2)
	repo = repoAndTag[0]

	if len(repoAndTag) != 2 {
		tag = "latest"
	} else {
		tag = repoAndTag[1]
	}

	return repo, tag, nil
}

// Exists with error if the image identified by repo and tag already exists
// Returns an error when the image already exists or something went wrong.
func preventImageOverwrite(repo, tag string) error {
	imageExists, err := checkImageExists(repo, tag)
	if err != nil {
		return err
	}
	if imageExists {
		return fmt.Errorf("Cannot overwrite an existing image. Please use a different repository/tag.")
	}
	return nil
}

func getImageId(name string) (string, error) {
	client := getDockerClient()

	repo, tag, err := parseImageName(name)
	if err != nil {
		return "", err
	}
	if tag == "latest" && !strings.Contains(name, tag) {
		name = name + ":" + tag
	}

	images, err := client.ListImages(true, repo, &dockerclient.ListFilter{})
	if err != nil {
		return "", err
	}

	if len(images) == 0 {
		return "", fmt.Errorf("Cannot find image %s", name)
	}
	for _, image := range images {
		if arrayIncludeString(image.RepoTags, name) {
			return image.Id, nil
		}
	}

	return "", fmt.Errorf("Cannot find image %s", name)
}


text:
namespace Merchello.Tests.PaymentProviders.PayPal.TestHelpers
{
    using System;

    using Merchello.Providers.Payment.PayPal.Models;

    using Newtonsoft.Json;

    /// <summary>
    /// The PayPal test helper.
    /// </summary>
    public class TestHelper
    {
        /// <summary>
        /// Gets PayPalProviderSettings.
        /// </summary>
        /// <returns>
        /// The <see cref="PayPalProviderSettings"/>.
        /// </returns>
        public static PayPalProviderSettings GetPayPalProviderSettings()
        {
            var jsonFile = string.Format("{0}\\{1}", Environment.CurrentDirectory, "..\\..\\PayPal\\extendedData.json");
            string json = System.IO.File.ReadAllText(jsonFile);
            return JsonConvert.DeserializeObject<PayPalProviderSettings>(json);
        }
    }
}


text:
Spaces provides a shorthand for creating and referencing namespaces.

##Without Spaces

```javascript
var EM = EM || {};

EM.Gallery = EM.Gallery || {};
EM.Gallery.views = EM.Gallery.views || {};
EM.Gallery.views.account = EM.Gallery.views.account || {};
EM.Gallery.models == EM.Gallery.models || {};
```

##With Spaces

```javascript
Spaces.create('EM.Gallery');

EM.Gallery.set('views.account');
EM.Gallery.set('models');
```

##Usage

Instantiate a space with a base path. Create namespaces using the *set* method. Return namespaces using the *get* method.

```javascript
(function () {
	// EM.Gallery
	var space = Spaces.create('EM.Gallery');

 	// EM.Gallery.views.account
	space.set('views.account');

	// EM.Gallery.models
	var models = space.set('models');

	models.UserModel = Backbone.Model.extend({
		defaults: {
			firstName: 'Eric',
			lastName: 'Matthys'
		}
	});

	var UserModel = space.get('models.UserModel');
})();

// EM.Gallery is also a reference to the space, so we can use it outside the module
EM.Gallery.set('collections');
```

Set up aliases for long namespaces using the *alias* method. The second argument for the *get* method sets a flag to use the alias.

```javascript
(function () {
	// EM.Gallery
	var space = Spaces.create('EM.Gallery');

	// EM.Gallery.a.really.long.namespace
	space.alias('long', 'a.really.long.namespace');

	var long = space.get('long', true);
	long.testing = true;
})();
```

Use the *noConflict* method to return the Spaces object back to its original value.

```javascript
var AltSpaces = Spaces.noConflict();

AltSpaces.create('EM.Gallery');
```

##License
Spaces is licensed under the terms of the MIT License. See the MIT-LICENSE file for details.


text:
namespace Azure.ResourceManager.MachineLearning.Models
{
    /// <summary> Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. </summary>
    public partial class BanditPolicy : EarlyTerminationPolicy
    {
        /// <summary> Initializes a new instance of BanditPolicy. </summary>
        public BanditPolicy()
        {
            PolicyType = EarlyTerminationPolicyType.Bandit;
        }

        /// <summary> Initializes a new instance of BanditPolicy. </summary>
        /// <param name="delayEvaluation"> Number of intervals by which to delay the first evaluation. </param>
        /// <param name="evaluationInterval"> Interval (number of runs) between policy evaluations. </param>
        /// <param name="policyType"> [Required] Name of policy configuration. </param>
        /// <param name="slackAmount"> Absolute distance allowed from the best performing run. </param>
        /// <param name="slackFactor"> Ratio of the allowed distance from the best performing run. </param>
        internal BanditPolicy(int? delayEvaluation, int? evaluationInterval, EarlyTerminationPolicyType policyType, float? slackAmount, float? slackFactor) : base(delayEvaluation, evaluationInterval, policyType)
        {
            SlackAmount = slackAmount;
            SlackFactor = slackFactor;
            PolicyType = policyType;
        }

        /// <summary> Absolute distance allowed from the best performing run. </summary>
        public float? SlackAmount { get; set; }
        /// <summary> Ratio of the allowed distance from the best performing run. </summary>
        public float? SlackFactor { get; set; }
    }
}


text:
using System;
using System.Text;
using Xunit;

namespace System.Text.EncodingTests
{
    public class UTF7EncodingGetByteCount2
    {
        private readonly Char[] _ARRAY_DIRECTCHARS = { '\t', '\n', '\r', 'X', 'Y', 'Z', 'a', 'b', 'c', '1', '2', '3' };
        private const int c_INT_DIRECTCHARSLENGTH = 12;

        private readonly Char[] _ARRAY_OPTIONALCHARS = { '!', '\"', '#', '$', '%', '&', '*', ';', '<', '=' };     // "!\"#$%&*;<=>@[]^_`{|}";
        private const int c_INT_OPTIONALCHARSLENTTH = 10;

        private readonly Char[] _ARRAY_SPECIALCHARS = { '\u03a0', '\u03a3' };                        // "\u03a0\u03a3";
        private const int c_INT_SPECIALCHARSLENGTH = 8;

        private readonly Char[] _ARRAY_EMPTY = new Char[0];
        private const int c_INT_EMPTYlENGTH = 0;

        // PosTest1: to test direct chars with new UTF7Encoding().
        [Fact]
        public void PosTest1()
        {
            UTF7Encoding utf7 = new UTF7Encoding();
            Assert.Equal(c_INT_DIRECTCHARSLENGTH, utf7.GetByteCount(_ARRAY_DIRECTCHARS, 0, c_INT_DIRECTCHARSLENGTH));
        }

        // PosTest2: to test direct chars with new UTF7Encoding(true).
        [Fact]
        public void PosTest2()
        {
            UTF7Encoding utf7 = new UTF7Encoding(true);
            Assert.Equal(c_INT_DIRECTCHARSLENGTH, utf7.GetByteCount(_ARRAY_DIRECTCHARS, 0, c_INT_DIRECTCHARSLENGTH));
        }

        // PosTest3: to test OPTIONALCHARS with new UTF7Encoding().
        [Fact]
        public void PosTest3()
        {
            UTF7Encoding utf7 = new UTF7Encoding();
            Assert.NotEqual(c_INT_OPTIONALCHARSLENTTH, utf7.GetByteCount(_ARRAY_OPTIONALCHARS, 0, c_INT_OPTIONALCHARSLENTTH));
        }

        // PosTest4: to test OPTIONALCHARS with new UTF7Encoding(true).
        [Fact]
        public void PosTest4()
        {
            Char[] CHARS = { '!', '\"', '#', '$', '%', '&', '*', ';', '<', '=' };
            UTF7Encoding utf7 = new UTF7Encoding(true);
            Assert.Equal(c_INT_OPTIONALCHARSLENTTH, utf7.GetByteCount(_ARRAY_OPTIONALCHARS, 0, c_INT_OPTIONALCHARSLENTTH));
        }

        // PosTest5: to test SPECIALCHARS with new UTF7Encoding().
        [Fact]
        public void PosTest5()
        {
            UTF7Encoding utf7 = new UTF7Encoding();
            Assert.Equal(c_INT_SPECIALCHARSLENGTH, utf7.GetByteCount(_ARRAY_SPECIALCHARS, 0, _ARRAY_SPECIALCHARS.Length));
        }

        // PosTest6: to test SPECIALCHARS with new UTF7Encoding(true).
        [Fact]
        public void PosTest6()
        {
            UTF7Encoding utf7 = new UTF7Encoding(true);
            Assert.Equal(c_INT_SPECIALCHARSLENGTH, utf7.GetByteCount(_ARRAY_SPECIALCHARS, 0, _ARRAY_SPECIALCHARS.Length));
        }

        // PosTest7: to test Empty Char[] with new UTF7Encoding().
        [Fact]
        public void PosTest7()
        {
            UTF7Encoding utf7 = new UTF7Encoding();
            Assert.Equal(c_INT_EMPTYlENGTH, utf7.GetByteCount(_ARRAY_EMPTY, 0, 0));
        }

        //NegTest1: to test UTF7Encoding.GetByteCount(null,Int32 index ,Int32 count)
        [Fact]
        public void NegTest1()
        {
            Assert.Throws<ArgumentNullException>(() =>
            {
                UTF7Encoding UTF7 = new UTF7Encoding();
                UTF7.GetByteCount(null, 0, 1);
            });
        }

        // NegTest2: to test index is less than zero
        [Fact]
        public void NegTest2()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() =>
            {
                UTF7Encoding UTF7 = new UTF7Encoding();
                UTF7.GetByteCount(_ARRAY_DIRECTCHARS, -1, 1);
            });
        }

        // NegTest3: to test count is less than zero
        [Fact]
        public void NegTest3()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() =>
            {
                UTF7Encoding UTF7 = new UTF7Encoding();
                UTF7.GetByteCount(_ARRAY_DIRECTCHARS, 0, -1);
            });
        }

        // NegTest4: to test index do not denote a valid range in chars
        [Fact]
        public void NegTest4()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() =>
            {
                UTF7Encoding UTF7 = new UTF7Encoding();
                UTF7.GetByteCount(_ARRAY_DIRECTCHARS, 13, 1);
            });
        }

        // NegTest5: to test count do not denote a valid range in chars
        [Fact]
        public void NegTest5()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() =>
            {
                UTF7Encoding UTF7 = new UTF7Encoding();
                UTF7.GetByteCount(_ARRAY_DIRECTCHARS, 0, 13);
            });
        }
    }
}


text:
package com.brownfield.pss.book.component;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.stereotype.Component;

import com.brownfield.pss.book.entity.BookingRecord;
import com.brownfield.pss.book.entity.Inventory;
import com.brownfield.pss.book.entity.Passenger;
import com.brownfield.pss.book.proxy.FareServiceProxy;
import com.brownfield.pss.book.repository.BookingRepository;
import com.brownfield.pss.book.repository.InventoryRepository;

@Component
public class BookingComponent {
	private static final Logger logger = LoggerFactory.getLogger(BookingComponent.class);
	//private static final String FareURL = "http://localhost:8080/fares";

	BookingRepository bookingRepository;
	InventoryRepository inventoryRepository;

	Sender sender;

	@Autowired
	private FareServiceProxy fareServiceProxy;

	@Autowired
	public BookingComponent (BookingRepository bookingRepository,
					  Sender sender,InventoryRepository inventoryRepository){
		this.bookingRepository = bookingRepository;
		this.sender = sender;
		this.inventoryRepository = inventoryRepository;
	}
	public long book(BookingRecord record) {
		logger.info("calling fares to get fare");
		//call fares to get fare
		//Fare fare = restTemplate.getForObject(fareServiceProxy +"/get?flightNumber="+record.getFlightNumber()+"&flightDate="+record.getFlightDate(),Fare.class);

		Fare fare = fareServiceProxy.getFare(record.getFlightNumber(), record.getFlightDate());

		logger.info("calling fares to get fare "+ fare);
		//check fare
		if (!record.getFare().equals(fare.getFare()))
			throw new BookingException("fare is tampered");
		logger.info("calling inventory to get inventory");
		//check inventory
		Inventory inventory = inventoryRepository.findByFlightNumberAndFlightDate(record.getFlightNumber(),record.getFlightDate());
		if(!inventory.isAvailable(record.getPassengers().size())){
			throw new BookingException("No more seats avaialble");
		}
		logger.info("successfully checked inventory" + inventory);
		logger.info("calling inventory to update inventory");
		//update inventory
		inventory.setAvailable(inventory.getAvailable() - record.getPassengers().size());
		inventoryRepository.saveAndFlush(inventory);
		logger.info("sucessfully updated inventory");
		//save booking
		record.setStatus(BookingStatus.BOOKING_CONFIRMED);
		Set<Passenger> passengers = record.getPassengers();
		passengers.forEach(passenger -> passenger.setBookingRecord(record));
		record.setBookingDate(new Date());
		long id=  bookingRepository.save(record).getId();
		logger.info("Successfully saved booking");
		//send a message to search to update inventory
		logger.info("sending a booking event");
		Map<String, Object> bookingDetails = new HashMap<String, Object>();
		bookingDetails.put("FLIGHT_NUMBER", record.getFlightNumber());
		bookingDetails.put("FLIGHT_DATE", record.getFlightDate());
		bookingDetails.put("NEW_INVENTORY", inventory.getBookableInventory());
		sender.send(bookingDetails);
		logger.info("booking event successfully delivered "+ bookingDetails);
		return id;
	}

	public BookingRecord getBooking(long id) {
		return bookingRepository.findOne(id);
	}

	public void updateStatus(String status, long bookingId) {
		BookingRecord record = bookingRepository.findOne(bookingId);

		if(record != null)
			record.setStatus(status);
	}

}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Bananagram</title>

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

        <link rel="stylesheet" href="<?php echo assets_url() . 'css/style.css' ?>">
        <link rel="icon" type="image/png" href="<?php echo assets_url() . 'img/favicon.ico' ?>">

                            <li <?php if (uri_string() == 'welcome' OR uri_string() == '') { echo 'class="active"'; } ?> role="presentation">
                                <a href="<?php echo base_url('welcome') ?>">

                                     Welcome

                            <li <?php if (uri_string() == 'gallery') { echo 'class="active"'; } ?> role="presentation">
                                <a href="<?php echo base_url('gallery') ?>">

                                     Gallery

                            <li <?php if (uri_string() == 'upload' OR uri_string() == 'upload/do_upload') { echo 'class="active"'; } ?> role="presentation">
                                <a href="<?php echo base_url('upload') ?>">

                                     Upload

Bananagram


text:
<?php
session_start();
include('includes/header.php');

//if user is not logged in or user is not an admin send 404 error
if (empty($_SESSION['user_id']) || $_SESSION['non_edit_user_class'] < 1.4) {

include('-404.php');
include('includes/footer.php');
die();
}

//start main content
//center main content
echo '<centr>';

//start left float
include('includes/index_user_float.php');
//end left float

//start right float
echo '<flt_right>';

//start admin page
echo '

Admin
';

//show admin keys from database
echo '
sign up keys
';
echo '
';
$result3 = $mysqli->query("SELECT * from sign_up_keys  ORDER BY id DESC");

//while there are admin keys, display admin keys
while ($row3 = $result3->fetch_assoc()) {
  echo '
';
  echo '
';

  //name of key
  echo $row3['signupkey']."
";

  //how many sign ups are left
  echo '
'.($row3['limit'] - $row3['current_used']);

  //reference user
  echo '

user: '.$row3['ref_user'].'

';
}
echo '
';
//end admin keys

//start of error log
echo '
error log
';

//fetch errors from database
$result = $mysqli->query("SELECT * from error_log  ORDER BY id DESC");
while ($row = $result->fetch_assoc()) {

  //if the error has a user id assigned to it, find the username that matches
  $user_id=$row['user_id'];
  if ($user_id != null) {
  $result2 = $mysqli->query("SELECT * from users where id=$user_id");
  $row2 = $result2->fetch_assoc();
  $username = $row2['username'];
  } else {
  $username = null;
  }

  //start individual error
  echo '<div id="ad_stat_div"';

  //if the row is starred, change the color of it
  if ($row['stared'] === 1) {
    echo 'style="background: rgba(218,197,33,0.5);"';
  }

  //style of individual error
  echo '
';
  echo '<li class="ad_stat_ul_type"';

  //if row is starred
  if($row['stared'] === 1) {
    echo 'style="z-index: 0;"';
  }

  //type of error
  echo $row['type'].'
';

  //user input (if applicable)
  echo '
User Input: ';
  echo htmlspecialchars($row['user_input']);
  echo '
';

  //url accessed
  echo '
URL: ';
  echo htmlspecialchars($row['url']);
  echo '
';

  //IP address of user
  echo '
IP: ';
  echo htmlspecialchars($row['ip_address']);
  echo '
';
  echo '
User: ';
  echo $username.'
';

  //date accessed
  echo '
DATE:';
  $post_date = $row['date'];

  //set timezone (need to make dynamic)
  date_default_timezone_set('America/Denver');
  $post_date = strtotime($post_date);

  //formate date and time
  $post_date = date('g:ia M j, Y', $post_date);
  echo $post_date;
  echo '
';

  //delete post button
  echo 'delete';

  //if user is main admin. let them star the post
  if ($_SESSION['non_edit_user_class'] == 1.5) {
  echo '';
  }

  //end individual error
  echo '

';
}

//end of right float/main content
echo '
</flt_right>

</centr>';
include('includes/footer.php');


text:
#include <mach/map.h>
#include "nocp_monitor.h"

#ifndef _NOC_PROBE_H
#define _NOC_PROBE_H

struct nocp_info {
	struct list_head list;
#ifdef CONFIG_SAMSUNG_NOCP_MONITOR
	struct list_head mon_list;
#endif
	const char *name;
	enum monitor_member id;
	unsigned long pa_base;
	void __iomem *va_base;
	unsigned int weight;
};

struct nocp_cnt {
	unsigned long total_byte_cnt;
	unsigned long cycle_cnt;
};

/* Register offset */
#define NOCP_CON		0x8
#define NOCP_ACT		0xC
#define NOCP_PERIOD		0x24
#define NOCP_STATGO		0x28
#define NOCP_ALARM_MIN		0x2C
#define NOCP_ALARM_MAX		0x30
#define NOCP_ALARM_STAT		0x34
#define NOCP_ALARM_CLR		0x38
#define NOCP_INT_0_EVENT	0x138
#define NOCP_CNT_0_ALARM_MODE	0x13C
#define NOCP_CNT_0_VAL		0x140
#define NOCP_INT_1_EVENT	0x14C
#define NOCP_CNT_1_ALARM_MODE	0x150
#define NOCP_CNT_1_VAL		0x154
#define NOCP_INT_2_EVENT	0x160
#define NOCP_CNT_2_ALARM_MODE	0x164
#define NOCP_CNT_2_VAL		0x168
#define NOCP_INT_3_EVENT	0x174
#define NOCP_CNT_3_ALARM_MODE	0x178
#define NOCP_CNT_3_VAL		0x17C

/* Register for NOCP_INT */
#define NOCP_EVT_OFFSET		0x1F
#define NOCP_EVT_CYCLE		0x1
#define NOCP_EVT_BUSY_CYCLE	0x4
#define NOCP_EVT_BYTE		0x8
#define NOCP_EVT_CHAIN		0x10

/* Register for NOCP_CNT_ALARM_MODE */
#define NOCP_ALARM_MODE_OFFSET	0x3
#define NOCP_ALARM_MODE_OFF	0x0
#define NOCP_ALARM_MODE_MIN	0x1
#define NOCP_ALARM_MODE_MAX	0x2
#define NOCP_ALARM_MODE_MIN_MAX	0x3

/* Register for NOCP_CON */
#define NOCP_CON_STAT_EN	(1 << 3)
#define NOCP_CON_ALARM_EN	(1 << 4)

/* Register for NOCP_ACT */
#define NOCP_ACT_GLOBAL_EN	(1 << 0)
#define NOCP_ACT_ACTIVE_EN	(1 << 1)

/* Register for NOCP_STATGO */
#define NOCP_STATGO_EN		(1 << 0)

/* Register for NOCP_ALARM_STAT */
#define NOCP_ALARM_STAT_MASK	0x1

/* Define API for nocp */
extern unsigned int regist_nocp(struct list_head *target_list,
			struct nocp_info **nocp_info,
			unsigned int nr_nocp, enum nocp_usage usage);

extern unsigned int exit_nocp(struct list_head *target_list);
extern unsigned int nocp_get_aver_cnt(struct list_head *target_list, struct nocp_cnt *nocp_cnt);
extern unsigned int resume_nocp(struct list_head *target_list);
extern void start_nocp(struct nocp_info *nocp);
extern void stop_nocp(struct nocp_info *nocp);
extern void get_cnt_nocp(struct nocp_info *nocp, unsigned int *cnt_val0,
	unsigned int *cnt_val1, unsigned int *cnt_val2, unsigned int *cnt_val3);
extern void set_env_nocp(struct nocp_info *nocp);

#endif /* _NOC_PROBE_H */


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: mainwindow.cpp Example File (widgets/icons/mainwindow.cpp)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

mainwindow.cpp Example File
widgets/icons/mainwindow.cpp

 #include <QtGui>

 #include "iconpreviewarea.h"
 #include "iconsizespinbox.h"
 #include "imagedelegate.h"
 #include "mainwindow.h"

 MainWindow::MainWindow()
 {
     centralWidget = new QWidget;
     setCentralWidget(centralWidget);

     createPreviewGroupBox();
     createImagesGroupBox();
     createIconSizeGroupBox();

     createActions();
     createMenus();
     createContextMenu();

     QGridLayout *mainLayout = new QGridLayout;
     mainLayout->addWidget(previewGroupBox, 0, 0, 1, 2);
     mainLayout->addWidget(imagesGroupBox, 1, 0);
     mainLayout->addWidget(iconSizeGroupBox, 1, 1);
     centralWidget->setLayout(mainLayout);

     setWindowTitle(tr("Icons"));
     checkCurrentStyle();
     otherRadioButton->click();

     resize(minimumSizeHint());
 }

 void MainWindow::about()
 {
     QMessageBox::about(this, tr("About Icons"),
             tr("The <b>Icons</b> example illustrates how Qt renders an icon in "
                "different modes (active, normal, disabled, and selected) and "
                "states (on and off) based on a set of images."));
 }

 void MainWindow::changeStyle(bool checked)
 {
     if (!checked)
         return;

     QAction *action = qobject_cast<QAction *>(sender());
     QStyle *style = QStyleFactory::create(action->data().toString());
     Q_ASSERT(style);
     QApplication::setStyle(style);

     smallRadioButton->setText(tr("Small (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_SmallIconSize)));
     largeRadioButton->setText(tr("Large (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_LargeIconSize)));
     toolBarRadioButton->setText(tr("Toolbars (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_ToolBarIconSize)));
     listViewRadioButton->setText(tr("List views (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_ListViewIconSize)));
     iconViewRadioButton->setText(tr("Icon views (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_IconViewIconSize)));
     tabBarRadioButton->setText(tr("Tab bars (%1 x %1)")
             .arg(style->pixelMetric(QStyle::PM_TabBarIconSize)));

     changeSize();
 }

 void MainWindow::changeSize(bool checked)
 {
     if (!checked)
         return;

     int extent;

     if (otherRadioButton->isChecked()) {
         extent = otherSpinBox->value();
     } else {
         QStyle::PixelMetric metric;

         if (smallRadioButton->isChecked()) {
             metric = QStyle::PM_SmallIconSize;
         } else if (largeRadioButton->isChecked()) {
             metric = QStyle::PM_LargeIconSize;
         } else if (toolBarRadioButton->isChecked()) {
             metric = QStyle::PM_ToolBarIconSize;
         } else if (listViewRadioButton->isChecked()) {
             metric = QStyle::PM_ListViewIconSize;
         } else if (iconViewRadioButton->isChecked()) {
             metric = QStyle::PM_IconViewIconSize;
         } else {
             metric = QStyle::PM_TabBarIconSize;
         }
         extent = QApplication::style()->pixelMetric(metric);
     }
     previewArea->setSize(QSize(extent, extent));
     otherSpinBox->setEnabled(otherRadioButton->isChecked());
 }

 void MainWindow::changeIcon()
 {
     QIcon icon;

     for (int row = 0; row < imagesTable->rowCount(); ++row) {
         QTableWidgetItem *item0 = imagesTable->item(row, 0);
         QTableWidgetItem *item1 = imagesTable->item(row, 1);
         QTableWidgetItem *item2 = imagesTable->item(row, 2);

         if (item0->checkState() == Qt::Checked) {
             QIcon::Mode mode;
             if (item1->text() == tr("Normal")) {
                 mode = QIcon::Normal;
             } else if (item1->text() == tr("Active")) {
                 mode = QIcon::Active;
             } else if (item1->text() == tr("Disabled")) {
                 mode = QIcon::Disabled;
             } else {
                 mode = QIcon::Selected;
             }

             QIcon::State state;
             if (item2->text() == tr("On")) {
                 state = QIcon::On;
             } else {
                 state = QIcon::Off;
             }

             QString fileName = item0->data(Qt::UserRole).toString();
             QImage image(fileName);
             if (!image.isNull())
                 icon.addPixmap(QPixmap::fromImage(image), mode, state);
         }
     }

     previewArea->setIcon(icon);
 }

 void MainWindow::addImages()
 {
     QStringList fileNames = QFileDialog::getOpenFileNames(this,
                                     tr("Open Images"), "",
                                     tr("Images (*.png *.xpm *.jpg);;"
                                        "All Files (*)"));
     if (!fileNames.isEmpty()) {
         foreach (QString fileName, fileNames) {
             int row = imagesTable->rowCount();
             imagesTable->setRowCount(row + 1);

             QString imageName = QFileInfo(fileName).baseName();
             QTableWidgetItem *item0 = new QTableWidgetItem(imageName);
             item0->setData(Qt::UserRole, fileName);
             item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);

             QTableWidgetItem *item1 = new QTableWidgetItem(tr("Normal"));
             QTableWidgetItem *item2 = new QTableWidgetItem(tr("Off"));

             if (guessModeStateAct->isChecked()) {
                 if (fileName.contains("_act")) {
                     item1->setText(tr("Active"));
                 } else if (fileName.contains("_dis")) {
                     item1->setText(tr("Disabled"));
                 } else if (fileName.contains("_sel")) {
                     item1->setText(tr("Selected"));
                 }

                 if (fileName.contains("_on"))
                     item2->setText(tr("On"));
             }

             imagesTable->setItem(row, 0, item0);
             imagesTable->setItem(row, 1, item1);
             imagesTable->setItem(row, 2, item2);
             imagesTable->openPersistentEditor(item1);
             imagesTable->openPersistentEditor(item2);

             item0->setCheckState(Qt::Checked);
         }
     }
 }

 void MainWindow::removeAllImages()
 {
     imagesTable->setRowCount(0);
     changeIcon();
 }

 void MainWindow::createPreviewGroupBox()
 {
     previewGroupBox = new QGroupBox(tr("Preview"));

     previewArea = new IconPreviewArea;

     QVBoxLayout *layout = new QVBoxLayout;
     layout->addWidget(previewArea);
     previewGroupBox->setLayout(layout);
 }

 void MainWindow::createImagesGroupBox()
 {
     imagesGroupBox = new QGroupBox(tr("Images"));

     imagesTable = new QTableWidget;
     imagesTable->setSelectionMode(QAbstractItemView::NoSelection);
     imagesTable->setItemDelegate(new ImageDelegate(this));

     QStringList labels;
     labels << tr("Image") << tr("Mode") << tr("State");

     imagesTable->horizontalHeader()->setDefaultSectionSize(90);
     imagesTable->setColumnCount(3);
     imagesTable->setHorizontalHeaderLabels(labels);
     imagesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
     imagesTable->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
     imagesTable->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
     imagesTable->verticalHeader()->hide();

     connect(imagesTable, SIGNAL(itemChanged(QTableWidgetItem *)),
             this, SLOT(changeIcon()));

     QVBoxLayout *layout = new QVBoxLayout;
     layout->addWidget(imagesTable);
     imagesGroupBox->setLayout(layout);
 }

 void MainWindow::createIconSizeGroupBox()
 {
     iconSizeGroupBox = new QGroupBox(tr("Icon Size"));

     smallRadioButton = new QRadioButton;
     largeRadioButton = new QRadioButton;
     toolBarRadioButton = new QRadioButton;
     listViewRadioButton = new QRadioButton;
     iconViewRadioButton = new QRadioButton;
     tabBarRadioButton = new QRadioButton;
     otherRadioButton = new QRadioButton(tr("Other:"));

     otherSpinBox = new IconSizeSpinBox;
     otherSpinBox->setRange(8, 128);
     otherSpinBox->setValue(64);

     connect(smallRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(largeRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(toolBarRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(listViewRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(iconViewRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(tabBarRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(otherRadioButton, SIGNAL(toggled(bool)),
             this, SLOT(changeSize(bool)));
     connect(otherSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeSize()));

     QHBoxLayout *otherSizeLayout = new QHBoxLayout;
     otherSizeLayout->addWidget(otherRadioButton);
     otherSizeLayout->addWidget(otherSpinBox);
     otherSizeLayout->addStretch();

     QGridLayout *layout = new QGridLayout;
     layout->addWidget(smallRadioButton, 0, 0);
     layout->addWidget(largeRadioButton, 1, 0);
     layout->addWidget(toolBarRadioButton, 2, 0);
     layout->addWidget(listViewRadioButton, 0, 1);
     layout->addWidget(iconViewRadioButton, 1, 1);
     layout->addWidget(tabBarRadioButton, 2, 1);
     layout->addLayout(otherSizeLayout, 3, 0, 1, 2);
     layout->setRowStretch(4, 1);
     iconSizeGroupBox->setLayout(layout);
 }

 void MainWindow::createActions()
 {
     addImagesAct = new QAction(tr("&Add Images..."), this);
     addImagesAct->setShortcut(tr("Ctrl+A"));
     connect(addImagesAct, SIGNAL(triggered()), this, SLOT(addImages()));

     removeAllImagesAct = new QAction(tr("&Remove All Images"), this);
     removeAllImagesAct->setShortcut(tr("Ctrl+R"));
     connect(removeAllImagesAct, SIGNAL(triggered()),
             this, SLOT(removeAllImages()));

     exitAct = new QAction(tr("&Quit"), this);
     exitAct->setShortcut(tr("Ctrl+Q"));
     connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

     styleActionGroup = new QActionGroup(this);
     foreach (QString styleName, QStyleFactory::keys()) {
         QAction *action = new QAction(styleActionGroup);
         action->setText(tr("%1 Style").arg(styleName));
         action->setData(styleName);
         action->setCheckable(true);
         connect(action, SIGNAL(triggered(bool)), this, SLOT(changeStyle(bool)));
     }

     guessModeStateAct = new QAction(tr("&Guess Image Mode/State"), this);
     guessModeStateAct->setCheckable(true);
     guessModeStateAct->setChecked(true);

     aboutAct = new QAction(tr("&About"), this);
     connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

     aboutQtAct = new QAction(tr("About &Qt"), this);
     connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
 }

 void MainWindow::createMenus()
 {
     fileMenu = menuBar()->addMenu(tr("&File"));
     fileMenu->addAction(addImagesAct);
     fileMenu->addAction(removeAllImagesAct);
     fileMenu->addSeparator();
     fileMenu->addAction(exitAct);

     viewMenu = menuBar()->addMenu(tr("&View"));
     foreach (QAction *action, styleActionGroup->actions())
         viewMenu->addAction(action);
     viewMenu->addSeparator();
     viewMenu->addAction(guessModeStateAct);

     menuBar()->addSeparator();

     helpMenu = menuBar()->addMenu(tr("&Help"));
     helpMenu->addAction(aboutAct);
     helpMenu->addAction(aboutQtAct);
 }

 void MainWindow::createContextMenu()
 {
     imagesTable->setContextMenuPolicy(Qt::ActionsContextMenu);
     imagesTable->addAction(addImagesAct);
     imagesTable->addAction(removeAllImagesAct);
 }

 void MainWindow::checkCurrentStyle()
 {
     foreach (QAction *action, styleActionGroup->actions()) {
         QString styleName = action->data().toString();
         QStyle *candidate = QStyleFactory::create(styleName);
         Q_ASSERT(candidate);
         if (candidate->metaObject()->className()
                 == QApplication::style()->metaObject()->className()) {
             action->trigger();
             return;
         }
         delete candidate;
     }
 }

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
// **********************************************************************
//
// <copyright>
//
//  BBN Technologies
//  10 Moulton Street
//  Cambridge, MA 02138
//  (617) 873-8000
//
//  Copyright (C) BBNT Solutions LLC. All rights reserved.
//
// </copyright>
// **********************************************************************
//
// $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/omGraphics/OMDistance.java,v $
// $RCSfile: OMDistance.java,v $
// $Revision: 1.12 $
// $Date: 2009/01/21 01:24:41 $
// $Author: dietrick $
//
// **********************************************************************

package com.bbn.openmap.omGraphics;

import java.awt.Font;
import java.awt.Graphics;
import java.awt.Paint;
import java.awt.geom.AffineTransform;
import java.text.DecimalFormat;
import java.util.Iterator;

import com.bbn.openmap.geo.Geo;
import com.bbn.openmap.proj.Length;
import com.bbn.openmap.proj.ProjMath;
import com.bbn.openmap.proj.Projection;
import com.bbn.openmap.util.Debug;
import com.bbn.openmap.util.DeepCopyUtil;

/**
 * OMGraphic object that represents a polyline, labeled with distances.
 */
public class OMDistance
      extends OMPoly {

   protected OMGraphicList labels = new OMGraphicList();
   protected OMGraphicList points = new OMGraphicList();

   protected Length distUnits = Length.NM;
   public DecimalFormat df = new DecimalFormat("0.#");
   /**
    * Paint used for labels
    */
   protected Paint labelPaint;
   /**
    * Font used for labels
    */
   protected Font labelFont;

   /**
    * Construct a default OMDistance.
    */
   public OMDistance() {
      super();
      setRenderType(RENDERTYPE_LATLON);
   }

   /**
    * Create an OMDistance from a list of float lat/lon pairs.
    *

    * NOTES:
    *

    *
llPoints array is converted into radians IN PLACE for more efficient
    * handling internally if it's not already in radians! For even better
    * performance, you should send us an array already in radians format!
    *
If you want the poly to be connected (as a polygon), you need to
    * ensure that the first and last coordinate pairs are the same.
    *

    *
    * @param llPoints array of lat/lon points, arranged lat, lon, lat, lon, etc.
    * @param units radians or decimal degrees. Use OMGraphic.RADIANS or
    *        OMGraphic.DECIMAL_DEGREES
    * @param lType line type, from a list defined in OMGraphic.
    */
   public OMDistance(double[] llPoints, int units, int lType, Length distanceUnits) {
      this(llPoints, units, lType, -1, distanceUnits);
   }

   /**
    * Create an OMDistance from a list of float lat/lon pairs.
    *

    * NOTES:
    *

    *
llPoints array is converted into radians IN PLACE for more efficient
    * handling internally if it's not already in radians! For even better
    * performance, you should send us an array already in radians format!
    *
If you want the poly to be connected (as a polygon), you need to
    * ensure that the first and last coordinate pairs are the same.
    *

    *
    * @param llPoints array of lat/lon points, arranged lat, lon, lat, lon, etc.
    * @param units radians or decimal degrees. Use OMGraphic.RADIANS or
    *        OMGraphic.DECIMAL_DEGREES
    * @param lType line type, from a list defined in OMGraphic.
    * @param nsegs number of segment points (only for LINETYPE_GREATCIRCLE or
    *        LINETYPE_RHUMB line types, and if < 1, this value is generated
    *        internally)
    */
   public OMDistance(double[] llPoints, int units, int lType, int nsegs, Length distanceUnits) {
      super(llPoints, units, lType, nsegs);
      setDistUnits(distanceUnits);
   }

   /**
    * Set the Length object used to represent distances.
    */
   public void setDistUnits(Length distanceUnits) {
      distUnits = distanceUnits;
   }

   /**
    * Get the Length object used to represent distances.
    */
   public Length getDistUnits() {
      return distUnits;
   }

   public void setLocation(double[] llPoints, int units) {
      this.units = OMGraphic.RADIANS;
      if (units == OMGraphic.DECIMAL_DEGREES) {
         ProjMath.arrayDegToRad(llPoints);
      }
      rawllpts = llPoints;
      setNeedToRegenerate(true);
      setRenderType(RENDERTYPE_LATLON);
   }

   public void createLabels() {
      labels.clear();
      points.clear();

      if (rawllpts == null) {
         return;
      }
      if (rawllpts.length < 4) {
         return;
      }

      Geo lastGeo = new Geo(rawllpts[0], rawllpts[1], units == DECIMAL_DEGREES);
      double latpnt = rawllpts[0];
      double lonpnt = rawllpts[1];
      if (units == RADIANS) {
         latpnt = ProjMath.radToDeg(latpnt);
         lonpnt = ProjMath.radToDeg(lonpnt);
      }
      points.add(new OMPoint(latpnt, lonpnt, 1));
      Geo curGeo = null;
      float cumulativeDist = 0f;
      for (int p = 2; p < rawllpts.length; p += 2) {
         if (curGeo == null) {
            curGeo = new Geo(rawllpts[p], rawllpts[p + 1], units == DECIMAL_DEGREES);
         } else {
            if (units == DECIMAL_DEGREES) {
               curGeo.initialize(rawllpts[p], rawllpts[p + 1]);
            } else {
               curGeo.initializeRadians(rawllpts[p], rawllpts[p + 1]);
            }
         }

         float dist = getDist(lastGeo, curGeo);
         cumulativeDist += dist;

         labels.add(createLabel(lastGeo, curGeo, dist, cumulativeDist, distUnits));
         latpnt = rawllpts[p];
         lonpnt = rawllpts[p + 1];
         if (units == RADIANS) {
            latpnt = ProjMath.radToDeg(latpnt);
            lonpnt = ProjMath.radToDeg(lonpnt);
         }

         points.add(new OMPoint(latpnt, lonpnt, 1));
         lastGeo.initialize(curGeo);
      }
   }

   /**
    * Get an OMText label for a segments between the given lat/lon points whose
    * given distance and cumulative distance is specified.
    */
   public OMText createLabel(Geo g1, Geo g2, float dist, float cumulativeDist, Length distanceUnits) {
      Geo mid;
      switch (getLineType()) {
         case LINETYPE_STRAIGHT:
            float lat = (float) (g1.getLatitude() + g2.getLatitude()) / 2f;
            float lon = (float) (g1.getLongitude() + g2.getLongitude()) / 2f;
            mid = new Geo(lat, lon);
            break;
         case LINETYPE_RHUMB:
            System.err.println("Rhumb distance calculation not implemented.");
         case LINETYPE_GREATCIRCLE:
         case LINETYPE_UNKNOWN:
         default:
            mid = g1.midPoint(g2);
      }

      // String text = ((int)dist) + " (" + ((int)cumulativeDist) +
      // ")";

      String text =
            (df.format(distanceUnits.fromRadians(dist))) + " (" + (df.format(distanceUnits.fromRadians(cumulativeDist))) + ") "
                  + distanceUnits.getAbbr();
      OMText omtext = new OMText((float) mid.getLatitude(), (float) mid.getLongitude(), text, OMText.JUSTIFY_LEFT);
      // omtext.setLinePaint(new Color(200, 200, 255));
      return omtext;
   }

   /**
    * Return the distance between that lat/lons defined in radians. The returned
    * value is in radians.
    */
   public float getDist(Geo g1, Geo g2) {
      switch (getLineType()) {
         case LINETYPE_STRAIGHT:
            float lonDist = ProjMath.lonDistance((float) g2.getLongitude(), (float) g1.getLongitude());
            float latDist = (float) g2.getLatitude() - (float) g1.getLatitude();
            return (float) Math.sqrt(lonDist * lonDist + latDist * latDist);
         case LINETYPE_RHUMB:
            Debug.error("Rhumb distance calculation not implemented.");
         case LINETYPE_GREATCIRCLE:
         case LINETYPE_UNKNOWN:
         default:
            return (float) g1.distance(g2);
      }
   }

   /**
    * Prepare the poly for rendering.
    *
    * @param proj Projection
    * @return true if generate was successful
    */
   public boolean generate(Projection proj) {
      boolean ret = super.generate(proj);
      createLabels();
      labels.generate(proj);
      points.generate(proj);
      return ret;
   }

   /**
    * Flag used by the EditableOMDistance to do quick movement paints in a
    * cleaner way.
    */
   protected boolean paintOnlyPoly = false;

   /**
    * Paint the poly. This works if generate() has been successful.
    *
    * @param g java.awt.Graphics to paint the poly onto.
    */
   public void render(Graphics g) {
      super.render(g);

      if (!paintOnlyPoly) {
         renderPoints(g);
         renderLabels(g);
      }
   }

   /**
    * render points
    */
   protected void renderPoints(Graphics g) {
      Paint pointPaint = getLabelPaint();

      for (Iterator<OMGraphic> it = points.iterator(); it.hasNext();) {
         OMGraphic point = (OMPoint) it.next();
         point.setLinePaint(pointPaint);
         point.setFillPaint(pointPaint);
         point.render(g);
      }
   }

   /**
    * render labels
    */
   protected void renderLabels(Graphics g) {
      Font f = getFont();
      Paint labelPaint = getLabelPaint();
      Paint mattingPaint = getMattingPaint();
      boolean isMatted = isMatted();
      for (Iterator<OMGraphic> it = labels.iterator(); it.hasNext();) {
         OMText text = (OMText) it.next();
         text.setFont(f);
         text.setLinePaint(labelPaint);
         if (isMatted) {
            text.setFillPaint(mattingPaint);
         }
         text.render(g);
      }
   }

   /**
    * Set paint used for labels
    *
    * @param lPaint paint used for labels
    */
   public void setLabelPaint(Paint lPaint) {
      labelPaint = lPaint;
   }

   /**
    * @return normal paint used for labels
    */
   public Paint getLabelPaint() {
      if (labelPaint == null) {
         return getLinePaint();
      }
      return labelPaint;
   }

   /**
    * @param font font used for labels
    */
   public void setFont(Font font) {
      if (font == null) {
         labelFont = OMText.DEFAULT_FONT;
      } else {
         labelFont = font;
      }
   }

   /**
    * @return font used for labels
    */
   public Font getFont() {
      if (labelFont == null) {
         labelFont = OMText.DEFAULT_FONT;
      }
      return labelFont;
   }

   private void writeObject(java.io.ObjectOutputStream stream)
         throws java.io.IOException {
      stream.defaultWriteObject();
      stream.writeObject(distUnits.getAbbr());
   }

   private void readObject(java.io.ObjectInputStream stream)
         throws java.io.IOException, ClassNotFoundException {
      stream.defaultReadObject();
      distUnits = Length.get((String) stream.readObject());
   }

   public void restore(OMGeometry source) {
      super.restore(source);
      if (source instanceof OMDistance) {
         OMDistance dist = (OMDistance) source;
         this.labels = DeepCopyUtil.deepCopy(dist.labels);
         this.points = DeepCopyUtil.deepCopy(dist.points);
         this.distUnits = dist.distUnits;
         this.df = new DecimalFormat(dist.df.toLocalizedPattern());
         this.labelPaint = dist.labelPaint;
         if (dist.labelFont != null) {
            this.labelFont = dist.labelFont.deriveFont(AffineTransform.TYPE_IDENTITY);
         }
      }
   }

}


text:
Update
======

**Always make a backup of your database before upgrading!**

From the archive (stable version)
---------------------------------

1. Close your session (logout)
2. Rename your actual Kanboard directory (to keep a backup)
3. Uncompress the new archive and copy your `data` directory to the newly uncompressed directory.
4. Make the directory `data` writeable by the web server user
5. Login and check if everything is ok
6. Remove the old Kanboard directory

From the repository (development version)
-----------------------------------------

1. Close your session (logout)
2. `git pull`
3. `composer install`
3. Login and check if everything is ok

Note: This method will install the **current development version**, use at your own risk.


text:
class CCtrlObj : public CDevObj
{
	DECLARE_SERIAL(CCtrlObj)

public:
	CCtrlObj(CDevObjDoc* pContainer = NULL);
	virtual ~CCtrlObj();
	virtual BOOL GetPropertyPageCLSIDs(CArray< CLSID, CLSID& >& aclsidPages);
	virtual void Serialize(CArchive& ar);

// Implementation
public:
	BOOL Create(REFCLSID clsid);
	BOOL FinishCreate(CCtrlItem* pItem, BOOL bActive = FALSE);

	virtual void Draw(CDC* pDC);
	virtual void DrawBackToFront(CDC* pDC);
	virtual void DrawFrontToBack(CDC* pDC);

	virtual void Invalidate(CLayoutView* pView = NULL);

	virtual void CopyToClipboard(CArchive& ar, IStorage* pStorage);
	virtual BOOL CreateFromClipboard(CArchive& ar, IStorage* pStorage);
	virtual enumObjectType GetObjectType(){ return ctrlobj; }

	virtual void MoveTo(const CRectF& position, BOOL bUniformScale, CLayoutView* pView = NULL);
	virtual LPUNKNOWN GetObjectUnknown();

	virtual void Release();
	virtual void Delete(BOOL bAutoDelete = TRUE);

	virtual void SetChildObjectDocument();

	void SetTabIndex(int nTabIndex);

	CCtrlItem* m_pClientItem;

	int m_nTabIndex;
	BOOL m_bTabStop;
	BOOL m_bDefault;
	BOOL m_bCancel;

	friend class CCtrlItem;
};

#endif // !defined(__CTRLOBJ_H__)


text:
arabicPostDate
==============

To display the time passed since a certain date in Arabic in a facebook-similar way

Example
=======
<img src="http://iphone.adhamox.com/wp-content/uploads/Screen-Shot-2013-12-17-at-18.44.40.png" />


text:
<?php

namespace UthandoCommon\Mapper;

use UthandoCommon\UthandoException;

/**
 * Class MapperException
 *
 * @package UthandoCommon\Mapper
 */
class MapperException extends UthandoException
{
}


text:
namespace blink {

class FontVariantNumeric {
  STACK_ALLOCATED();

 public:
  enum NumericFigure { NormalFigure = 0, LiningNums, OldstyleNums };

  enum NumericSpacing { NormalSpacing = 0, ProportionalNums, TabularNums };

  enum NumericFraction {
    NormalFraction = 0,
    DiagonalFractions,
    StackedFractions
  };

  enum Ordinal { OrdinalOff = 0, OrdinalOn };

  enum SlashedZero { SlashedZeroOff = 0, SlashedZeroOn };

  FontVariantNumeric() : m_fieldsAsUnsigned(0) {}

  static FontVariantNumeric initializeFromUnsigned(unsigned initValue) {
    return FontVariantNumeric(initValue);
  }

  void setNumericFigure(NumericFigure figure) {
    m_fields.m_numericFigure = figure;
  };
  void setNumericSpacing(NumericSpacing spacing) {
    m_fields.m_numericSpacing = spacing;
  };
  void setNumericFraction(NumericFraction fraction) {
    m_fields.m_numericFraction = fraction;
  };
  void setOrdinal(Ordinal ordinal) { m_fields.m_ordinal = ordinal; };
  void setSlashedZero(SlashedZero slashedZero) {
    m_fields.m_slashedZero = slashedZero;
  };

  NumericFigure numericFigureValue() const {
    return static_cast<NumericFigure>(m_fields.m_numericFigure);
  }
  NumericSpacing numericSpacingValue() const {
    return static_cast<NumericSpacing>(m_fields.m_numericSpacing);
  }
  NumericFraction numericFractionValue() const {
    return static_cast<NumericFraction>(m_fields.m_numericFraction);
  }
  Ordinal ordinalValue() const {
    return static_cast<Ordinal>(m_fields.m_ordinal);
  };
  SlashedZero slashedZeroValue() const {
    return static_cast<SlashedZero>(m_fields.m_slashedZero);
  }

  bool isAllNormal() { return !m_fieldsAsUnsigned; }

  bool operator==(const FontVariantNumeric& other) const {
    return m_fieldsAsUnsigned == other.m_fieldsAsUnsigned;
  }

 private:
  FontVariantNumeric(unsigned initValue) : m_fieldsAsUnsigned(initValue) {}

  struct BitFields {
    unsigned m_numericFigure : 2;
    unsigned m_numericSpacing : 2;
    unsigned m_numericFraction : 2;
    unsigned m_ordinal : 1;
    unsigned m_slashedZero : 1;
  };

  union {
    BitFields m_fields;
    unsigned m_fieldsAsUnsigned;
  };
  static_assert(sizeof(BitFields) == sizeof(unsigned),
                "Mapped union types must match in size.");

  // Used in setVariant to store the value in m_fields.m_variantNumeric;
  friend class FontDescription;
};
}

#endif  // FontVariantNumeric_h


text:
package co.lqnt.lockbox;

import co.lqnt.lockbox.exception.DecryptionFailedException;
import co.lqnt.lockbox.key.PrivateKeyInterface;
import co.lqnt.lockbox.key.PublicKeyInterface;

/**
 * The standard Lockbox bi-directional cipher, with a bound key.
 */
public class BoundCipher implements BoundCipherInterface
{
    /**
     * Construct a new bound bi-directional cipher.
     *
     * @param privateKey The private key to use.
     */
    public BoundCipher(final PrivateKeyInterface privateKey)
    {
        this(privateKey, privateKey.publicKey());
    }

    /**
     * Construct a new bound bi-directional cipher.
     *
     * @param privateKey The private key to use.
     * @param publicKey  The public key to use.
     */
    public BoundCipher(
        final PrivateKeyInterface privateKey,
        final PublicKeyInterface publicKey
    ) {
        this(
            privateKey,
            publicKey,
            new EncryptionCipher(),
            new DecryptionCipher()
        );
    }

    /**
     * Construct a new bound bi-directional cipher.
     *
     * @param privateKey       The private key to use.
     * @param publicKey        The public key to use.
     * @param encryptionCipher The encryption cipher to use.
     * @param decryptionCipher The decryption cipher to use.
     */
    public BoundCipher(
        final PrivateKeyInterface privateKey,
        final PublicKeyInterface publicKey,
        final EncryptionCipherInterface encryptionCipher,
        final DecryptionCipherInterface decryptionCipher
    ) {
        this.privateKey = privateKey;
        this.publicKey = publicKey;
        this.encryptionCipher = encryptionCipher;
        this.decryptionCipher = decryptionCipher;
    }

    /**
     * Get the private key.
     *
     * @return The private key.
     */
    public PrivateKeyInterface privateKey()
    {
        return this.privateKey;
    }

    /**
     * Get the public key.
     *
     * @return The public key.
     */
    public PublicKeyInterface publicKey()
    {
        return this.publicKey;
    }

    /**
     * Get the encryption cipher.
     *
     * @return The encryption cipher.
     */
    public EncryptionCipherInterface encryptionCipher()
    {
        return this.encryptionCipher;
    }

    /**
     * Get the decryption cipher.
     *
     * @return The decryption cipher.
     */
    public DecryptionCipherInterface decryptionCipher()
    {
        return this.decryptionCipher;
    }

    /**
     * Encrypt a data packet.
     *
     * @param data The data to encrypt.
     *
     * @return The encrypted data.
     */
    public byte[] encrypt(final byte[] data)
    {
        return this.encryptionCipher().encrypt(this.publicKey(), data);
    }

    /**
     * Encrypt a data packet.
     *
     * @param data The data to encrypt.
     *
     * @return The encrypted data.
     */
    public String encrypt(final String data)
    {
        return this.encryptionCipher().encrypt(this.publicKey(), data);
    }

    /**
     * Decrypt a data packet.
     *
     * @param data The data to decrypt.
     *
     * @return The decrypted data.
     */
    public byte[] decrypt(final byte[] data) throws DecryptionFailedException
    {
        return this.decryptionCipher().decrypt(this.privateKey(), data);
    }

    /**
     * Decrypt a data packet.
     *
     * @param data The data to decrypt.
     *
     * @return The decrypted data.
     */
    public String decrypt(final String data) throws DecryptionFailedException
    {
        return this.decryptionCipher().decrypt(this.privateKey(), data);
    }

    private PrivateKeyInterface privateKey;
    private PublicKeyInterface publicKey;
    private EncryptionCipherInterface encryptionCipher;
    private DecryptionCipherInterface decryptionCipher;
}