text:
<?php

/** @var \League\OAuth1\Client\Server\User */
$user = $args['user'];

/** @var array */
$auth_urls = $_SESSION['site_auth_urls'];

/** @var \League\OAuth1\Client\Credentials\TokenCredentials */
$access_token = $args['tokenCredentials'];

?>

Step 3: Connected

Connected to <?php echo htmlspecialchars( $_SESSION['site_base'] ) ?>.
	Reset?

User Details

<img src="<?php echo htmlspecialchars( $user->imageUrl ) ?>" />

<?php echo htmlspecialchars( $user->name ) ?>
			(<?php echo htmlspecialchars( $user->nickname ) ?>)

<a href="<?php echo htmlspecialchars( $user->urls['permalink'] ) ?>">View posts

			<?php if ( $user->firstName ): ?>

First Name

<?php echo htmlspecialchars( $user->firstName ) ?>

			<?php endif ?>

			<?php if ( $user->lastName ): ?>

Last Name

<?php echo htmlspecialchars( $user->lastName ) ?>

			<?php endif ?>

Email

<?php echo htmlspecialchars( $user->email ) ?>

			<?php if ( $user->description ): ?>

Description

<?php echo htmlspecialchars( $user->description ) ?>

			<?php endif ?>

OAuth endpoints

Request Token Endpoint

<?php echo htmlspecialchars( $auth_urls->request ) ?>

Authorize Endpoint

<?php echo htmlspecialchars( $auth_urls->authorize ) ?>

Access Token Endpoint

<?php echo htmlspecialchars( $auth_urls->access ) ?>

OAuth credentials

Client Key

<?php echo htmlspecialchars( $_SESSION['client_key'] ) ?>

Client Secret

<?php echo htmlspecialchars( $_SESSION['client_secret'] ) ?>

Access Token

<?php echo htmlspecialchars( $access_token->getIdentifier() ) ?>

Access Token Secret

<?php echo htmlspecialchars( $access_token->getSecret() ) ?>

redpajama_set_name: RedPajamaGithub


text:
package io.bxbxbai.zhuanlan.widget;

import android.os.ResultReceiver;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AutoCompleteTextView;

import java.lang.reflect.Method;

/**
 * Created by baia on 15/3/13.
 */
public class AutoCompleteTextViewReflector {
    private Method doBeforeTextChanged, doAfterTextChanged;
    private Method ensureImeVisible;
    private Method showSoftInputUnchecked;

    AutoCompleteTextViewReflector() {
        try {
            doBeforeTextChanged = AutoCompleteTextView.class.getDeclaredMethod("doBeforeTextChanged");
            doBeforeTextChanged.setAccessible(true);
        } catch (NoSuchMethodException ignored) {

        }
        try {
            doAfterTextChanged = AutoCompleteTextView.class.getDeclaredMethod("doAfterTextChanged");
            doAfterTextChanged.setAccessible(true);
        } catch (NoSuchMethodException ignored) {

        }
        try {
            ensureImeVisible = AutoCompleteTextView.class.getMethod("ensureImeVisible", boolean.class);
            ensureImeVisible.setAccessible(true);
        } catch (NoSuchMethodException ignored) {

        }
        try {
            showSoftInputUnchecked = InputMethodManager.class.getMethod(
                    "showSoftInputUnchecked", int.class, ResultReceiver.class);
            showSoftInputUnchecked.setAccessible(true);
        } catch (NoSuchMethodException ignored) {

        }
    }

    void doBeforeTextChanged(AutoCompleteTextView view) {
        if (doBeforeTextChanged != null) {
            try {
                doBeforeTextChanged.invoke(view);
            } catch (Exception ignored) {

            }
        }
    }

    void doAfterTextChanged(AutoCompleteTextView view) {
        if (doAfterTextChanged != null) {
            try {
                doAfterTextChanged.invoke(view);
            } catch (Exception ignored) {

            }
        }
    }

    public void ensureImeVisible(AutoCompleteTextView view, boolean visible) {
        if (ensureImeVisible != null) {
            try {
                ensureImeVisible.invoke(view, visible);
            } catch (Exception ignored) {

            }
        }
    }

    void showSoftInputUnchecked(InputMethodManager imm, View view, int flags) {
        if (showSoftInputUnchecked != null) {
            try {
                showSoftInputUnchecked.invoke(imm, flags, null);
                return;
            } catch (Exception ignored) {

            }
        }

        imm.showSoftInput(view, flags);
    }
}


text:
var dependency = {
    production: { host: 'prod.firebase.io', account: 'accountName',  token: { __envVar: 'FIREBASE_TOKEN' } },
    development: { host: 'dev.firebase.io', account: 'accountName',  token: { __envVar: 'FIREBASE_TOKEN' } },
    localTest: { host: 'test.firebase.io', account: 'accountName',  token: { __envVar: 'FIREBASE_TOKEN' } }
};

module.exports = dependency;


text:
$packageName = 'sonarr'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://download.sonarr.tv/v2/master/latest/NzbDrone.master.exe'
$checksum = '21ebe28d484a7c95b98babbdf937bffd384b5266'
$checksumType = 'sha1'
$validExitCodes = @(0)

$scriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$ahkFile = Join-Path $scriptPath "chocolateyInstall.ahk"
$ahkExe = 'AutoHotKey'
Start-Process $ahkExe $ahkFile

Install-ChocolateyPackage -PackageName "$packageName" `
                          -FileType "$installerType" `
                          -SilentArgs "$silentArgs" `
                          -Url "$url" `
                          -ValidExitCodes $validExitCodes `
                          -Checksum "$checksum" `
                          -ChecksumType "$checksumType"


text:
package com.jam.pocket.exception;

/**
 * Created by Jam on 2017/1/27.
 */
public class ConvertFailedException extends RuntimeException {

}


text:
module.exports = function (grunt) {

    grunt.initConfig({
        connect: {
            server: {
                options: {
                    base: 'spec/fixtures/json'
                }
            }
        },
        jasmine: {
            src : 'lib/jquery.render-tweets.js',
            options : {
                specs : 'spec/*spec.js',
                vendor: 'bower_components/jquery/jquery.js',
                helpers: 'bower_components/jasmine-jquery/lib/jasmine-jquery.js',
                '--local-to-remote-url-access': true
            }
        },
        uglify: {
            main: {
                options: {
                    preserveComments: 'some'
                },
                files: {
                    'dist/jquery.render-tweets.min.js': 'lib/jquery.render-tweets.js'
                }
            }
        },
        bower: {
            install: {
                options: {
                    copy: false
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jasmine');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-bower-task');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.registerTask('default', 'build');
    grunt.registerTask('build', [ 'uglify' ]);
    grunt.registerTask('test', [ 'bower', 'connect', 'jasmine' ]);

};


text:
var app=angular.module('codeRobo-factory',[]);
app.factory('DataService', function ($http) {

	    return {
	    	getSettings: function () {
	        	this.url='settings/getMenu/';
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        userlogin: function (username,password) {
	        	this.url='users/login';
				var promise=$http.post(this.url,{username: username,password: password}).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getProfile: function (Hash) {
	        	this.url='board/info/'+Hash;
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getPages: function () {
	        	this.url='page/all';
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getPageswithparams: function (params) {
	        	this.url='page/'+params.current+'/'+params.limit+'/'+params.sortBy+'/'+params.order+'/'+params.postType;
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getPosts: function (Hash) {
	        	this.url='posts/all';
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        searchPosts: function (query) {
	        	this.url='posts/search/'+query;
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getPostsbyID: function (postID) {
	        	this.url='posts/viewby/'+postID;
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        getrelatedPost: function (tags,postID) {
	        	this.url='posts/'+postID+'/related/'+tags;
				var promise=$http.get(this.url).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        addPost: function (newpost) {
	        	this.url='posts/addPost';
				var promise=$http.post(this.url,newpost).success(function (data) {
					return data;
	            });
	            return promise;
	        },
	        addPage: function (newpost) {
	        	this.url='page/addPost';
				var promise=$http.post(this.url,newpost).success(function (data) {
					return data;
	            });
	            return promise;
	        }
	    }
	});


text: {% include path+"/includes/evidence/_requested-evidence.html" %}


text:
from flybywire.ui import Application, Component
from flybywire.dom import h

def CounterView(count):
    """A simple functional stateless component."""
    return h('h1', str(count))

@Application
class CounterApp(Component):
    def __init__(self):
        """Initialize the application."""
        # super(CounterApp, self).__init__()  # Python 2.7
        super().__init__()
        self.set_initial_state(0)

    def render(self):
        """Renders view given application state."""
        return h('div',
                    [CounterView(count=self.state),
                     h('button', '+', onclick = self.increment),
                     h('button', '-', onclick = self.decrement)]
                )

    def increment(self, e):
        """Increments counter."""
        self.set_state(self.state + 1)

    def decrement(self, e):
        """Decrements counter."""
        self.set_state(self.state - 1)

app = CounterApp()
app.start()


text:
from . import utilities as utils

class EventData:

    def __init__(self, widget, tk_event):
        """
        The EventData class represents a single event and is passed back to
        the callback
        """
        self._widget = widget
        self._tk_event = tk_event

    @property
    def widget(self):
        """
        The guizero widget which raised the event
        """
        return self._widget

    @property
    def tk_event(self):
        """
        The tkinter event which was returned by the event
        """
        return self._tk_event

    @property
    def key(self):
        """
        The key which was pressed and generated the event.
        """
        return self._tk_event.char

    @property
    def x(self):
        """
        The x position of the mouse relative to the upper left hand corner of
        the widget when the event occurred.
        """
        return self._tk_event.x

    @property
    def y(self):
        """
        The y position of the mouse relative to the upper left hand corner of
        the widget when the event occurred.
        """
        return self._tk_event.y

    @property
    def display_x(self):
        """
        The x position of the mouse relative to the upper left hand corner of
        the display when the event occurred.
        """
        return self._tk_event.x_root

    @property
    def display_y(self):
        """
        The y position of the mouse relative to the upper left hand corner of
        the display when the event occurred.
        """
        return self._tk_event.y_root

    @property
    def width(self):
        """
        The new width of the widget when re-configured.
        """
        return self._tk_event.width

    @property
    def height(self):
        """
        The new height of the widget when re-configured.
        """
        return self._tk_event.height

class EventCallback():

    def __init__(self, widget, tks, tk_event):
        """
        The EventCallback handles all the callbacks for a single tk event
        (e.g. <Button-1>) on a guizero widget.

        By using the EventCallback structure you can assign multiple callbacks
        to 1 tk event across multiple tk widgets.
        """
        self._widget = widget
        self._tks = tks
        self._tk_event = tk_event
        self._callbacks = {}
        self._func_ids = []

        # bind to the tk event
        for tk in self._tks:
            func_id = tk.bind(tk_event, self._event_callback)
            self._func_ids.append(func_id)

    def _event_callback(self, tk_event):
        # the tk event has fired, run all the callbacks associated to this event
        for ref in self._callbacks.copy():
            callback = self._callbacks[ref]
            args_expected = utils.no_args_expected(callback)

            if args_expected == 0:
                callback()
            elif args_expected == 1:
                callback(EventData(self._widget, tk_event))
            else:
                utils.error_format("An event callback function must accept either 0 or 1 arguments.\nThe current callback has {} arguments.".format(args_expected))

    def get_callback(self, ref):
        """
        Returns the callback for a ref (reference)
        """
        if ref in self._callbacks:
            return self._callbacks[ref]
        else:
            return None

    def set_callback(self, ref, callback):
        """
        Sets a callback for a ref (reference), setting to None will remove it
        """
        # if the callback already exists, remove it
        self.remove_callback(ref)

        # add it to the callbacks
        if callback is not None:
            self._callbacks[ref] = callback

    def remove_callback(self, ref):
        """
        Removes a callback for a ref (reference),
        """
        if ref in self._callbacks:
            del self._callbacks[ref]

    def rebind(self, tks):
        """
        Rebinds the tk event, only used if a widget has been destroyed
        and recreated.
        """
        self._tks = tks
        for tk in self._tks:
            tk.unbind_all(self._tk_event)
            func_id = tk.bind(self._tk_event, self._event_callback)
            self._func_ids.append(func_id)

    @property
    def widget(self):
        return self._widget

    @property
    def tk_event(self):
        return self._tk_event

class EventManager:

    def __init__(self, widget, *tks):
        """
        The EventManager handles all the events and callbacks for a guizero
        widget.

        Every event created must be given a reference, this reference
        is how events are managed internally within guizero.

        A guizero widget can contain many tk widgets, so all the tk objects
        for this guizero widget need to passed.
        """
        self._widget = widget
        self._tks = tks
        self._refs = {}
        self._event_callbacks = {}

    def get_event(self, ref):
        """
        Returns the event callback for a ref (reference)
        """
        # is this reference one which has been setup?
        if ref in self._refs:
            return self._refs[ref].get_callback(ref)
        else:
            return None

    def set_event(self, ref, tk_event, callback):
        """
        Sets a callback for this widget against a ref (reference) for a
        tk_event, setting the callback to None will remove it.
        """
        # has an EventCallback been created for this tk event
        if tk_event not in self._event_callbacks:
            self._event_callbacks[tk_event] = EventCallback(self._widget, self._tks, tk_event)

        # assign this ref to this event callback
        self._refs[ref] = self._event_callbacks[tk_event]

        # set up the callback
        self._refs[ref].set_callback(ref, callback)

    def remove_event(self, ref):
        """
        Removes an event for a ref (reference),
        """
        # is this reference one which has been setup?
        if ref in self._refs:
            self._refs[ref].remove_callback(ref)

    def rebind_events(self, *tks):
        """
        Rebinds all the tk events, only used if a tk widget has been destroyed
        and recreated.
        """
        for ref in self._refs:
            self._refs[ref].rebind(tks)


text:
Thanks for trying out Ark! We welcome all feedback, please consider joining our mailing list:

- [Mailing List](http://j.hept.io/ark-list)


text:
{% load i18n html extract %}
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">

	<title>{% if feed %}{{ feed.title }} - {% endif %}{{ site.title }}</title>

	<link rel="stylesheet" href="{{ static_url }}/default.css" type="text/css"/>

	<link rel="alternate" type="application/rss+xml"
		title="RSS 2.0" href="{{ site.url }}/feed/rss/" />
	<link rel="alternate" type="application/atom+xml"
		title="Atom 1.0" href="{{ site.url }}/feed/atom/" />

	{% with site.url|hash:5 as site_key %}
		{# Local (client-side only) storage #}

		{# Remote (some host on the net) storage #}

	{% endwith %}

	{% block extrastyle %}{% endblock %}
	{% block extrahead %}{% endblock %}

		{% if feed %}{{ feed.shortname }} - {% endif %}{{ site.title }}

				remoteStorage

					Your user address
					<input type="text" id="userAddress_{{ site_key }}"
						name="userAddress" placeholder="user@somehost" />
					{% spaceless %}

							Connect
							Reconnect

							Authorize
							Deauthorize

							Sync

					{% endspaceless %}

Atom

RSS

FOAF

OPML

				Subfeeds

					{% for subsciber in subscribers %}

{{ subsciber.name }}

					{% endfor %}

 {# empty offset-column #}

{% for item in object_list %}

{% with item|site_ordering_date:site as date_site %}
{% with date_site|date:"Y-m-d" as date_key %}

{% ifchanged item.feed.id date_key %}
{% if not forloop.first %}

 {# /.channel #}
{% endif %}
{% endifchanged %}

{% ifchanged date_key %}
{% if not forloop.first %}

 {# /.day #}
{% endif %}

{{ date_site|date:"l, F j, Y" }}

{% endifchanged %}

{% ifchanged item.feed.id date_key %}

{{ item.feed.shortname }}

{% endifchanged %}

				{% if item.title %}{{ item.title|safe }}
						{% else %}{{ item.subscriber.name|safe }}{% endif %}

{{ item.content|prettyhtml|safe }}

			{% spaceless %}

				{% if item.author %}{% blocktrans with item.author as author %}by {{ author }} at{% endblocktrans %}{% endif %} {{ item.date_modified|date:"g:i A" }}
				{% if item.comments %} ({% trans "Comments" %}){% endif %}

			{% if item.qtags %}
{% for tag in item.qtags %}
				{{ tag.name }}
					{% if not forloop.last %}, {% endif %}
			{% endfor %}
{% endif %}
			{% endspaceless %}

 {# /.entry #}

{% if forloop.last %}

 {# /.channel #}
{% endif %}

{% if forloop.last %}

 {# /.day #}
{% endif %}

{% endwith %}
{% endwith %}

{% endfor %}

Back to top

	{% if site.welcome %}

{% trans "Welcome" %}

		{{ site.welcome|safe }}

	{% endif %}

	{% if site.greets %}

{% trans "Credits" %}

		{{ site.greets|safe }}

	{% endif %}

	{# Hardcore pagination logic #}
	{% if p.has_other_pages %}
	{% with "7:-7" as p_slice_range %}
	{% with p_10neighbors.items|slice:p_slice_range as p_slice %}
	{% with p_10neighbors.keys|slice:p_slice_range as p_slice_keys %}

			«

		{% if 1 not in p_slice_keys %}

1

			{% if 2 not in p_slice_keys %}

				...
{% endif %}
		{% endif %}
		{% for p_num, p_exists in p_slice %}
			{% if p_exists %}

				{{ p_num }}

			{% endif %}
		{% endfor %}
		{% if p.paginator.num_pages not in p_slice_keys %}
			{% if p.paginator.num_pages|add:-1 not in p_slice_keys %}

...

			{% endif %}

{{ p.paginator.num_pages }}

		{% endif %}

			»

{{ pages }} pages
		({% blocktrans count hits as posts %}{{ posts }}
			post{% plural %}{{ posts }} posts{% endblocktrans %},
		showing {{ p.start_index }}-{{ p.end_index }})

	{% endwith %}
	{% endwith %}
	{% endwith %}
	{% endif %}

 {# span10 #}

 {# container #}


text:
using Orchard.Events;

namespace Orchard.MultiTenancy.Services {
    /// <summary>
    /// An event handler interface that allows implementers to execute code when a tenant is being reset.
    /// </summary>
    public interface ITenantResetEventHandler : IEventHandler {
        void Resetting();
    }
}


text:
@protocol LRTestCaseNotifier <NSObject>
- (void)notifiesFailureWithDescription:(NSString *)description
                                inFile:(NSString *)fileName
                                lineNumber:(int)lineNumber;
@end

@class SenTestCase;

@interface LRSenTestCaseNotifier : NSObject <LRTestCaseNotifier>
{
  SenTestCase *testCase;
}
+ (id)notifierForTestCase:(SenTestCase *)aTestCase;
- (id)initWithSenTestCase:(SenTestCase *)aTestCase;
@end


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

<TITLE>
TextPiece (POI API Documentation)
</TITLE>

<META NAME="date" CONTENT="2010-10-29">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.hwpf.model

Class TextPiece

java.lang.Object
  org.apache.poi.hwpf.model.PropertyNode
      org.apache.poi.hwpf.model.TextPiece

All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public final class TextPiece
extends PropertyNode
implements java.lang.Comparable

Lightweight representation of a text piece.
 Works in the character domain, not the byte domain, so you
  need to have turned byte references into character
  references before getting here.

Author:

Ryan Ackley

Field Summary

Fields inherited from class org.apache.poi.hwpf.model.PropertyNode

_buf

Constructor Summary

TextPiece(int start,
          int end,
          byte[] text,
          PieceDescriptor pd,
          int cpStart)

Method Summary

 void
adjustForDelete(int start,
                int length)

          Adjusts the internal string for deletinging
  some characters within this.

 int
bytesLength()

          Returns the length, in bytes

 int
characterLength()

          Returns the length, in characters

 boolean
equals(java.lang.Object o)

 int
getCP()

          Returns the character position we start at.

 PieceDescriptor
getPieceDescriptor()

 byte[]
getRawBytes()

 java.lang.StringBuffer
getStringBuffer()

 boolean
isUnicode()

 java.lang.String
substring(int start,
          int end)

          Returns part of the string.

Methods inherited from class org.apache.poi.hwpf.model.PropertyNode

clone, compareTo, getEnd, getStart, limitsAreEqual, setEnd, setStart

Methods inherited from class java.lang.Object

finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface java.lang.Comparable

compareTo

Constructor Detail

TextPiece

public TextPiece(int start,
                 int end,
                 byte[] text,
                 PieceDescriptor pd,
                 int cpStart)

Parameters:
start - Beginning offset in main document stream, in characters.
end - Ending offset in main document stream, in characters.
text - The raw bytes of our text

Method Detail

isUnicode

public boolean isUnicode()

Returns:
If this text piece is unicode

getPieceDescriptor

public PieceDescriptor getPieceDescriptor()

getStringBuffer

public java.lang.StringBuffer getStringBuffer()

getRawBytes

public byte[] getRawBytes()

substring

public java.lang.String substring(int start,
                                  int end)

Returns part of the string.
 Works only in characters, not in bytes!

Parameters:
start - Local start position, in characters
end - Local end position, in characters

adjustForDelete

public void adjustForDelete(int start,
                            int length)

Adjusts the internal string for deletinging
  some characters within this.

Overrides:
adjustForDelete in class PropertyNode

Parameters:
start - The start position for the delete, in characters
length - The number of characters to delete

characterLength

public int characterLength()

Returns the length, in characters

bytesLength

public int bytesLength()

Returns the length, in bytes

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class PropertyNode

getCP

public int getCP()

Returns the character position we start at.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2010 The Apache Software Foundation or
        its licensors, as applicable.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using KafkaNet.Common;
using KafkaNet.Statistics;

namespace KafkaNet.Protocol
{
    public class ProduceRequest : BaseRequest, IKafkaRequest<ProduceResponse>
    {
        /// <summary>
        /// Provide a hint to the broker call not to expect a response for requests without Acks.
        /// </summary>
        public override bool ExpectResponse { get { return Acks != 0; } }
        /// <summary>
        /// Indicates the type of kafka encoding this request is.
        /// </summary>
        public ApiKeyRequestType ApiKey { get { return ApiKeyRequestType.Produce; } }
        /// <summary>
        /// Time kafka will wait for requested ack level before returning.
        /// </summary>
        public int TimeoutMS = 1000;
        /// <summary>
        /// Level of ack required by kafka.  0 immediate, 1 written to leader, 2+ replicas synced, -1 all replicas
        /// </summary>
        public Int16 Acks = 1;
        /// <summary>
        /// Collection of payloads to post to kafka
        /// </summary>
        public List<Payload> Payload = new List<Payload>();

        public KafkaDataPayload Encode()
        {
            return EncodeProduceRequest(this);
        }

        public IEnumerable<ProduceResponse> Decode(byte[] payload)
        {
            return DecodeProduceResponse(payload);
        }

        #region Protocol...
        private KafkaDataPayload EncodeProduceRequest(ProduceRequest request)
        {
            int totalCompressedBytes = 0;
            if (request.Payload == null) request.Payload = new List<Payload>();

            var groupedPayloads = (from p in request.Payload
                                   group p by new
                                   {
                                       p.Topic,
                                       p.Partition,
                                       p.Codec
                                   } into tpc
                                   select tpc).ToList();

            using (var message = EncodeHeader(request)
                .Pack(request.Acks)
                .Pack(request.TimeoutMS)
                .Pack(groupedPayloads.Count))
            {
                foreach (var groupedPayload in groupedPayloads)
                {
                    var payloads = groupedPayload.ToList();
                    message.Pack(groupedPayload.Key.Topic, StringPrefixEncoding.Int16)
                        .Pack(payloads.Count)
                        .Pack(groupedPayload.Key.Partition);

                    switch (groupedPayload.Key.Codec)
                    {

                        case MessageCodec.CodecNone:
                            message.Pack(Message.EncodeMessageSet(payloads.SelectMany(x => x.Messages)));
                            break;
                        case MessageCodec.CodecGzip:
                            var compressedBytes = CreateGzipCompressedMessage(payloads.SelectMany(x => x.Messages));
                            Interlocked.Add(ref totalCompressedBytes, compressedBytes.CompressedAmount);
                            message.Pack(Message.EncodeMessageSet(new[] { compressedBytes.CompressedMessage }));
                            break;
                        default:
                            throw new NotSupportedException(string.Format("Codec type of {0} is not supported.", groupedPayload.Key.Codec));
                    }
                }

                var result = new KafkaDataPayload
                {
                    Buffer = message.Payload(),
                    CorrelationId = request.CorrelationId,
                    MessageCount = request.Payload.Sum(x => x.Messages.Count)
                };
                StatisticsTracker.RecordProduceRequest(result.MessageCount, result.Buffer.Length, totalCompressedBytes);
                return result;
            }
        }

        private CompressedMessageResult CreateGzipCompressedMessage(IEnumerable<Message> messages)
        {
            var messageSet = Message.EncodeMessageSet(messages);

            var gZipBytes = Compression.Zip(messageSet);

            var compressedMessage = new Message
            {
                Attribute = (byte)(0x00 | (ProtocolConstants.AttributeCodeMask & (byte)MessageCodec.CodecGzip)),
                Value = gZipBytes
            };

            return new CompressedMessageResult
            {
                CompressedAmount = messageSet.Length - compressedMessage.Value.Length,
                CompressedMessage = compressedMessage
            };
        }

        private IEnumerable<ProduceResponse> DecodeProduceResponse(byte[] data)
        {
            using (var stream = new BigEndianBinaryReader(data))
            {
                var correlationId = stream.ReadInt32();

                var topicCount = stream.ReadInt32();
                for (int i = 0; i < topicCount; i++)
                {
                    var topic = stream.ReadInt16String();

                    var partitionCount = stream.ReadInt32();
                    for (int j = 0; j < partitionCount; j++)
                    {
                        var response = new ProduceResponse()
                        {
                            Topic = topic,
                            PartitionId = stream.ReadInt32(),
                            Error = stream.ReadInt16(),
                            Offset = stream.ReadInt64()
                        };

                        yield return response;
                    }
                }
            }
        }
        #endregion
    }

    class CompressedMessageResult
    {
        public int CompressedAmount { get; set; }
        public Message CompressedMessage { get; set; }
    }

    public class ProduceResponse
    {
        /// <summary>
        /// The topic the offset came from.
        /// </summary>
        public string Topic { get; set; }
        /// <summary>
        /// The partition the offset came from.
        /// </summary>
        public int PartitionId { get; set; }
        /// <summary>
        /// Error response code.  0 is success.
        /// </summary>
        public Int16 Error { get; set; }
        /// <summary>
        /// The offset number to commit as completed.
        /// </summary>
        public long Offset { get; set; }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ProduceResponse)obj);
        }

        protected bool Equals(ProduceResponse other)
        {
            return string.Equals(Topic, other.Topic) && PartitionId == other.PartitionId && Error == other.Error && Offset == other.Offset;
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = (Topic != null ? Topic.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ PartitionId;
                hashCode = (hashCode * 397) ^ Error.GetHashCode();
                hashCode = (hashCode * 397) ^ Offset.GetHashCode();
                return hashCode;
            }
        }
    }
}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class AlterTableAdblocksDropInvalidColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('adblocks', function (Blueprint $table) {
            $table->dropColumn('desctiption');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}


text:
This is a simple plugin, which allows logging to be enabled during development and testing of other plugins.

This logger uses [katzgrau/klogger](https://packagist.org/packages/katzgrau/klogger) for operations which has one dependent [psr/log](https://packagist.org/packages/psr/log).

## Installation
### Composer
```
php composer.phar require sturple/phile-logger:dev-master
```

### Download
```
* Install [Phile](https://github.com/PhileCMS/Phile)
* Clone this https://github.com/sturple/phileLogger repo into `plugins/sturple/phileLogger/`
```

## Usage

### setup config.php

``` php
$config['plugins']['sturple\\phileLogger'] =array('active' => false);

```

### Example to be used in other plugins
``` php
$relDir = 'lib/cache/logs';
$logLevel = '{debug|info|notice|warning|error|critical|alert|emergency}'
$options = array('extension'      => 'txt',
		 'dateFormat'     => 'Y-m-d G:i:s.u',
		 'filename'       => false,
		 'flushFrequency' => false,
	 	 'prefix'         => 'log_',
		 'logFormat'      => false,
		 'appendContext'  => true);

$logger = (new \Phile\Plugin\Sturple\PhileLogger\Plugin($relDir='lib/cache/logs',
							$logLevel='debug',
							$options=array()))->getLogger();
$logger->info('You can use functions debug, info, notice, warning, error, critical, alert.');
$logger->warning('You can add arrays',array('phile'=>'CMS'));
```
#### Options

| Option | Default | Description |
| ------ | ------- | ----------- |
| dateFormat | 'Y-m-d G:i:s.u' | The format of the date in the start of the log lone (php formatted) |
| extension | 'txt' | The log file extension |
| filename | [prefix][date].[extension] | Set the filename for the log file. **This overrides the prefix and extention options.** |
| flushFrequency | `false` (disabled) | How many lines to flush the output buffer after |
| prefix  | 'log_' | The log file prefix |
| logFormat | `false` | Format of log entries |
| appendContext | `true` | When `false`, don't append context to log entries |

## Log Formatting

The `logFormat` option lets you define what each line should look like and can contain parameters representing the date, message, etc.

When a string is provided, it will be parsed for variables wrapped in braces (`{` and `}`) and replace them with the appropriate value:

| Parameter | Description |
| --------- | ----------- |
| date | Current date (uses `dateFormat` option) |
| level | The PSR log level |
| level-padding | The whitespace needed to make this log level line up visually with other log levels in the log file |
| priority | Integer value for log level (see `$logLevels`) |
| message | The message being logged |
| context | JSON-encoded context |


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['labeltext'] = 'Текст пояснения';
$string['modulename'] = 'Пояснение';
$string['modulename_help'] = 'Пояснение позволяет на странице курса добавлять текст и изображения между ссылками на элементы курса.';
$string['modulenameplural'] = 'Пояснения';
$string['pluginadministration'] = 'Управление Пояснением';
$string['pluginname'] = 'Пояснение';


text:
layout: page
title: TSLint core rules
permalink: /rules/
menu: main
order: 2
---

Lint _rules_ encode logic for syntactic & semantic checks of TypeScript source code.

### TypeScript-specific

_These rules find errors related to TypeScript features_:

{% include rule_list.html ruleType="typescript" %}

### Functionality

_These rules catch common errors in JS programming or otherwise confusing constructs that are prone to producing bugs_:

{% include rule_list.html ruleType="functionality" %}

### Maintainability

_These rules make code maintenance easier_:

{% include rule_list.html ruleType="maintainability" %}

### Style

_These rules enforce consistent style across your codebase_:

{% include rule_list.html ruleType="style" %}

### Format

_These rules enforce consistent use of whitespace and punctuation_:

{% include rule_list.html ruleType="formatting" %}


text:
Bundle for Java Web Application based on Spring MVC (Telosys Tools v2.1.0)
==========================================================================

Description
----------

These templates generates J2EE web application based on Spring MVC and Spring IOC.
Bootstrap v3 and JQuery are used in front-end pages for responsive design and navigators compatibility.

The application manages each entity with CRUD (Create, Read, Update, Delete) operations.

Architecture
---

Presentation layer:
- Spring MVC, JSPX Pages, Jquery, Bootstrap

Business logic layer:
- Services injected by Spring IOC


text:
package org.openxrd.xrd.core.impl;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.opensaml.xml.XMLObject;
import org.opensaml.xml.util.XMLObjectChildrenList;
import org.opensaml.xml.validation.AbstractValidatingXMLObject;
import org.openxrd.xrd.core.XRD;
import org.openxrd.xrd.core.XRDSequence;

/**
 * A concrete implementation of {@link XRDSequence}.
 */
public class XRDSequenceImpl extends AbstractValidatingXMLObject implements XRDSequence {

    /** Ref. */
    private String ref;

    /** XRDs. */
    private final XMLObjectChildrenList<XRD> xrds;

    /**
     * Constructor.
     *
     * @param namespaceURI the namespace the element is in
     * @param elementLocalName the local name of the XML element this Object represents
     * @param namespacePrefix the prefix for the given namespace
     */
    protected XRDSequenceImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
        super(namespaceURI, elementLocalName, namespacePrefix);

        xrds = new XMLObjectChildrenList<XRD>(this);
    }

    /** {@inheritDoc} */
    public String getRef() {
        return ref;
    }

    /** {@inheritDoc} */
    public void setRef(String newRef) {
        ref = prepareForAssignment(ref, newRef);
    }

    /** {@inheritDoc} */
    public List<XRD> getXRDs() {
        return xrds;
    }

    /** {@inheritDoc} */
    public List<XMLObject> getOrderedChildren() {
        ArrayList<XMLObject> children = new ArrayList<XMLObject>();

        children.addAll(getXRDs());

        return Collections.unmodifiableList(children);
    }

}


text:
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Model.Attachments;
using VkNet.Model.RequestParams;
using VkNet.Model.RequestParams.Polls;
using VkNet.Utils;

namespace VkNet.Categories;

/// <inheritdoc />
public partial class PollsCategory : IPollsCategory
{
	/// <summary>
	/// API.
	/// </summary>
	private readonly IVkApiInvoke _vk;

	/// <summary>
	/// Методы для работы с опросами.
	/// </summary>
	/// <param name="vk"> API. </param>
	public PollsCategory(IVkApiInvoke vk) => _vk = vk;

	/// <inheritdoc />
	public Poll GetById(PollsGetByIdParams @params) => _vk.Call("polls.getById", new()
	{
		{
			"owner_id", @params.OwnerId
		},
		{
			"is_board", @params.IsBoard
		},
		{
			"poll_id", @params.PollId
		}
	});

	/// <inheritdoc />
	public bool Edit(PollsEditParams @params) => _vk.Call("polls.edit", new()
	{
		{
			"owner_id", @params.OwnerId
		},
		{
			"poll_id", @params.PollId
		},
		{
			"question", @params.Question
		},
		{
			"add_answers", Utilities.SerializeToJson(@object: @params.AddAnswers)
		},
		{
			"edit_answers", Utilities.SerializeToJson(@object: @params.EditAnswers)
		},
		{
			"delete_answers", Utilities.SerializeToJson(@object: @params.DeleteAnswers)
		}
	});

	/// <inheritdoc />
	public bool AddVote(PollsAddVoteParams @params) => _vk.Call("polls.addVote", new()
	{
		{
			"owner_id", @params.OwnerId
		},
		{
			"is_board", @params.IsBoard
		},
		{
			"poll_id", @params.PollId
		},
		{
			"answer_id", @params.AnswerId
		}
	});

	/// <inheritdoc />
	public bool DeleteVote(PollsDeleteVoteParams @params) => _vk.Call("polls.deleteVote", new()
	{
		{
			"owner_id", @params.OwnerId
		},
		{
			"is_board", @params.IsBoard
		},
		{
			"poll_id", @params.PollId
		},
		{
			"answer_id", @params.AnswerId
		}
	});

	/// <inheritdoc />
	public VkCollection<PollAnswerVoters> GetVoters(PollsGetVotersParams @params)
	{
		object FormatList(IList<long> answersIds)
		{
			if (answersIds == null)
			{
				return null;
			}

			var stringBuilder = new StringBuilder();

			for (var i = 0; i < answersIds.Count; i++)
			{
				stringBuilder.Append(value: answersIds[index: i]);

				if (i + 1 < answersIds.Count)
				{
					stringBuilder.Append(value: ',');
				}
			}

			return stringBuilder.ToString();
		}

		return _vk.Call("polls.getVoters", new()
			{
				{
					"owner_id", @params.OwnerId
				},
				{
					"is_board", @params.IsBoard
				},
				{
					"poll_id", @params.PollId
				},
				{
					"answer_ids", FormatList(answersIds: @params.AnswersIds)
				},
				{
					"friends_only", @params.FriendsOnly
				},
				{
					"offset", @params.Offset
				},
				{
					"count", @params.Count
				},
				{
					"fields", @params.Fields
				},
				{
					"name_case", @params.NameCase
				}
			})
			.ToVkCollectionOf<PollAnswerVoters>(x => x);
	}

	/// <inheritdoc />
	public Poll Create(PollsCreateParams @params) => _vk.Call("polls.create", new()
	{
		{
			"question", @params.Question
		},
		{
			"is_anonymous", @params.IsAnonymous
		},
		{
			"is_multiple", @params.IsMultiple
		},
		{
			"end_date", @params.EndDate
		},
		{
			"owner_id", @params.OwnerId
		},
		{
			"add_answers", Utilities.SerializeToJson(@params.AddAnswers)
		},
		{
			"photo_id", @params.PhotoId
		},
		{
			"background_id", @params.BackgroundId
		}
	});

	/// <inheritdoc />
	public ReadOnlyCollection<GetBackgroundsResult> GetBackgrounds() => _vk.Call<ReadOnlyCollection<GetBackgroundsResult>>(
		"polls.getBackgrounds",
		new());

	/// <inheritdoc />
	public PhotoUploadServer GetPhotoUploadServer(long ownerId) => _vk.Call<PhotoUploadServer>("polls.getPhotoUploadServer",
		new()
		{
			{
				"owner_id", ownerId
			}
		});

	/// <inheritdoc />
	public SavePhotoResult SavePhoto(SavePhotoParams @params) => _vk.Call<SavePhotoResult>("polls.savePhoto",
		new()
		{
			{
				"photo", @params.Photo
			},
			{
				"hash", @params.Hash
			}
		});
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM jogl-projects module - DO NOT EDIT  ***
***             EDIT ../build.xml INSTEAD              ***
-->
<project name="jogl-template-impl" default="default" basedir=".." >
    <description>Builds the SimpleJOGL2.</description>

    <target name="-jogl-template-post-jar">
        <echo message="Creating native distributions"/>

        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="linux-i586"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="linux-amd64"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="macosx-ppc"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="macosx-universal"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="solaris-sparc"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="solaris-sparcv9"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="solaris-i586"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="windows-i586"/>
        </antcall>
        <antcall target="-create-native-distribution" inheritall="true">
            <param name="platform.name" value="windows-amd64"/>
        </antcall>
        <antcall target="-jogl-template-copy-natives" inheritall="true"/>
    </target>

    <target name="-jogl-template-copy-natives" depends="-jogl-template-test-jnlp-enabled" unless="is.jnlp.enabled">
        <copy todir="${dist.dir}">
            <fileset dir="${libs.JOGL.classpath}" defaultexcludes="yes"/>
            <fileset dir="${libs.GLUEGEN-RT.classpath}" defaultexcludes="yes"/>
        </copy >
    </target>

    <target name="-jogl-template-jnlp" depends="-jogl-template-test-jnlp-enabled,-jogl-template-patch-master-jnlp" if="is.jnlp.enabled">

        <delete file="${dist.dir}/lib/jogl.jar"/>
        <delete file="${dist.dir}/lib/gluegen-rt.jar"/>
        <antcall target="jnlp-impl.jnlp" inheritall="true"/>
        <replace file="${dist.dir}/launch.jnlp">
            <replacetoken><![CDATA[<jar href="lib/jogl.jar" download="eager"/>]]></replacetoken>
            <replacevalue></replacevalue>
        </replace>
        <replace file="${dist.dir}/launch.jnlp">
            <replacetoken><![CDATA[<jar href="lib/gluegen-rt.jar" download="eager"/>]]></replacetoken>
            <replacevalue></replacevalue>
        </replace>
    </target>

    <target name="-jogl-template-patch-master-jnlp" depends="-jogl-template-check-master-jnlp" if="is.jnlp.unpatched">
        <replace file="${master.jnlp.file}">
            <replacetoken><![CDATA[</resources>]]></replacetoken>
            <replacevalue><![CDATA[    <extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />
    </resources>]]></replacevalue>
        </replace>
    </target>

    <target name="-jogl-template-check-master-jnlp" if="is.jnlp.enabled">
        <!-- create it, in case it does not exist yet -->
        <antcall target="jnlp-init-generate-master" inheritall="true"/>
        <loadfile property="master.jnlp.content" srcfile="${master.jnlp.file}"/>
        <condition property="is.jnlp.unpatched">
            <not>
                <contains string="${master.jnlp.content}" substring='extension name="jogl"'/>
            </not>
        </condition>
    </target>

    <target name="-create-native-distribution">
        <mkdir dir="${dist.dir}-${platform.name}"/>
        <!-- This is a bit of a hack to simulate string replacements with ant :/ -->
        <pathconvert pathsep=" " property="platformFiles">
            <path>
                <fileset dir="${libs.JOGL.classpath}" defaultexcludes="yes"/>
                <fileset dir="${libs.GLUEGEN-RT.classpath}" defaultexcludes="yes"/>
            </path>
        </pathconvert>
        <echo file="${java.io.tmpdir}/platformExcludes.properties" message="platformExcludes: ${platformFiles}" />
        <replace file="${java.io.tmpdir}/platformExcludes.properties" value="">
            <replacefilter token="${libs.JOGL.classpath}-natives-${natives.platform}"/>
            <replacefilter token="${libs.GLUEGEN-RT.classpath}-natives-${natives.platform}"/>
        </replace>
        <property file="${java.io.tmpdir}/platformExcludes.properties"/>
        <delete file="${java.io.tmpdir}/platformExcludes.properties"/>
        <copy todir="${dist.dir}-${platform.name}" overwrite="yes">
            <fileset dir="${dist.dir}" excludes="${platformExcludes}" defaultexcludes="no"/>
            <!--<fileset dir="${libs.JOGL.classpath}-natives-${platform.name}"/>
            <fileset dir="${libs.GLUEGEN-RT.classpath}-natives-${platform.name}"/>-->
        </copy >
    </target>

    <target name="-jogl-template-post-clean">
        <echo message="Removing native distributions"/>
        <delete dir="${dist.dir}-linux-i586"/>
        <delete dir="${dist.dir}-linux-amd64"/>
        <delete dir="${dist.dir}-macosx-ppc"/>
        <delete dir="${dist.dir}-macosx-universal"/>
        <delete dir="${dist.dir}-solaris-sparc"/>
        <delete dir="${dist.dir}-solaris-sparcv9"/>
        <delete dir="${dist.dir}-solaris-i586"/>
        <delete dir="${dist.dir}-windows-i586"/>
        <delete dir="${dist.dir}-windows-amd64"/>
    </target>

    <target name="-jogl-template-test-jnlp-enabled">
        <condition property="is.jnlp.enabled">
            <equals arg1="${jnlp.enabled}" arg2="true" casesensitive="false" trim="true"/>
        </condition>
    </target>

</project>


text:
var InterfaceFunctions = function() {
    //faço os binds no init
    this.init = function()
    {
        $( ".wrapper .postboard-news").click(function() {
            var newPosts = parseInt($(".userMenu .menu-news").text());
            if (!newPosts)
                newPosts = postsPerRefresh;
            requestTimelineUpdate('pending',newPosts,followingUsers,promotedPostsOnly);
        });

        // Add refresh posts for home link in menu
        $( ".userMenu-home.current a").click(function() {
            var newPosts = parseInt($(".userMenu .menu-news").text());
            if (!newPosts)
                newPosts = postsPerRefresh;
            requestTimelineUpdate('pending',newPosts,followingUsers,promotedPostsOnly);
        });

        $( ".promoted-posts-only").click(function() {
            promotedPostsOnly = !promotedPostsOnly;

            timelineChangedUser();
            $.MAL.getStreamPostsParent().empty();
            requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
        });

        cleanupStorage();

        initInterfaceCommon();
        initUserSearch();
        initInterfaceDirectMsg();

        initUser(initHome);
        initHashWatching();
    };

    function initHome(cbFunc, cbArg) {
        checkNetworkStatusAndAskRedirect();

        //$("span.screen-name").text('@' + user);
        var $miniProfile = $(".mini-profile");
        if (!defaultScreenName) {
            $('.userMenu-profile > a').attr('href', '#/login').text(polyglot.t('Login'));
            $(".post-area-new > textarea").attr("placeholder",polyglot.t("You have to log in to post messages."));
            $(".post-area-new > textarea").attr("disabled","true");
            $miniProfile.find(".mini-profile-name").text("guest");
            $miniProfile.find(".posts-count").text("0");
            $miniProfile.find(".following-count").text("0");
            $miniProfile.find(".followers-count").text("0");
            $(".dropdown-menu-following").attr("href","#");
            $(".dropdown-menu-following").bind("click", function()
            { alert(polyglot.t("You are not following anyone because you are not logged in."))} );
        } else {
            $miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
            $miniProfile.find("a.open-profile-modal").attr("href",$.MAL.userUrl(defaultScreenName));
            $miniProfile.find(".mini-profile-name").text(defaultScreenName);
            getFullname( defaultScreenName, $miniProfile.find(".mini-profile-name") );
            getAvatar( defaultScreenName, $miniProfile.find(".mini-profile-photo").find("img") );
            getAvatar(defaultScreenName, $('.userMenu-config .mini-profile-photo img'));
            // add avatar in postboard-top
            getAvatar( defaultScreenName, $("#postboard-top").find("img") );
            getPostsCount( defaultScreenName,  $miniProfile.find(".posts-count") );
            getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );

            loadFollowing( function(args) {
                     $(".mini-profile .following-count").text(followingUsers.length-1);
                     requestLastHave();
                     setInterval(requestLastHave, 1000);
                     initMentionsCount();
                     initDMsCount();
                     requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);

                     // install scrollbottom handler to load more posts as needed
                     $(window).scroll(function(){
                        if  ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){
                            if( timelineLoaded ) {
                                requestTimelineUpdate("older", postsPerRefresh, followingUsers, promotedPostsOnly);
                            }
                        }
                     });

                     twisterFollowingO = TwisterFollowing(defaultScreenName);

                     if( args.cbFunc )
                        args.cbFunc(args.cbArg);
                 }, {cbFunc:cbFunc, cbArg:cbArg});

            if ($.Options.WhoToFollow.val === 'enable')
                initWhoToFollow();
            else
                killInterfaceModule('who-to-follow');

            if ($.Options.NewUsers.val === 'enable')
                initNewUsers();
            else
                killInterfaceModule('new-users');

            if ($.Options.TwistdayReminder.val === 'enable')
                initTwistdayReminder();
            else
                killInterfaceModule('twistday-reminder');
        }
        if ($.Options.TopTrends.val === 'enable')
            initTopTrends();
        else
            killInterfaceModule('toptrends');

        if ($.Options.WebTorrent.val === 'enable')
            initWebTorrent();
    }
};

function initTopTrends() {
    var $tt = initInterfaceModule('toptrends');

    if ($tt.length) {
        var $ttRefresh = $tt.find('.refresh-toptrends');
            $ttRefresh.on('click', updateTrendingHashtags);
            setTimeout(function() { $ttRefresh.click() }, 100);
    }
}

function updateTrendingHashtags() {
    var $module = $('.module.toptrends');
    var $list = $module.find('.toptrends-list');

    if ($list.length) {
        $list.empty().hide();
        $module.find('.refresh-toptrends').hide();
        $module.find('.loading-roller').show();
        twisterRpc('gettrendinghashtags', [10],
            function(args, ret) {
                //console.log('hashtags trends: '+ret);
                for( var i = 0; i < ret.length; i++ ) {
                    if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForTopTrends.val)
                        var langFilterData = filterLang(ret[i]);
                    if (typeof(langFilterData) === 'undefined' || langFilterData['pass'] || $.Options.filterLangSimulate.val) {
                        var $li = $('
');
                        var hashtagLinkTemplate = $('#hashtag-link-template').clone(true);

                        hashtagLinkTemplate.removeAttr('id');
                        hashtagLinkTemplate.attr('href',$.MAL.hashtagUrl(ret[i]));
                        hashtagLinkTemplate.text('#'+ret[i]);

                        $li.append(hashtagLinkTemplate);
                        if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangSimulate.val) {
                            if (typeof(langFilterData) !== 'undefined') {
                                $li.append(' '+((langFilterData['pass']) ? polyglot.t('passed') : polyglot.t('blocked'))+': '+langFilterData['prob'][0].toString()+'');
                            } else {
                                $li.append(' '+polyglot.t('not analyzed')+'');
                            }
                        }

                        $list.append($li);
                    }
                }

                if ($list.children().length)
                    $list.show();
                $module.find('.refresh-toptrends').show();
                $module.find('.loading-roller').hide();
            }, {},
            function(args, ret) {
                console.log('Error with gettrendinghashtags. Older twister daemon?');
            }, {}
        );
        if ($list.children().length && $.Options.TopTrendsAutoUpdate.val === 'enable' && $.Options.TopTrendsAutoUpdateTimer.val > 0)
            setTimeout(updateTrendingHashtags, $.Options.TopTrendsAutoUpdateTimer.val * 1000);
    }
}

function initWhoToFollow() {
    var wtf = initInterfaceModule('who-to-follow');

    if (wtf.length) {
        var wtfRefresh = wtf.find('.refresh-users');
            wtfRefresh.on('click', refreshWhoToFollow);
            setTimeout(function() {wtfRefresh.click();}, 100);
        //wtf.find('.view-all-users').on('click', function() {window.location.hash = '#whotofollow';});
    }
}

function refreshWhoToFollow() {
    var module = $('.module.who-to-follow');
    var list = module.find('.follow-suggestions');

    if (list.length) {
        list.empty().hide();
        module.find('.refresh-users').hide();
        module.find('.loading-roller').show();

        getRandomFollowSuggestion();
        getRandomFollowSuggestion();
        getRandomFollowSuggestion();
    }
}

function initNewUsers() {
    var nus = initInterfaceModule('new-users');

    newUsers = NewUserSearch();
    if (nus.length) {
        var nusRefresh = nus.find('.refresh-users');
        nusRefresh.on('click', refreshNewUsers);
        setTimeout(function() {nusRefresh.click();}, 100);
    }
}

function refreshNewUsers() {
    var module = $('.module.new-users');
    var list = module.find('.follow-suggestions');

    if (list.length) {
        list.empty().hide();
        module.find('.refresh-users').hide();
        module.find('.loading-roller').show();

        newUsers.getLastNUsers(3, 0, module, true);
    }
}

function initTwistdayReminder() {
    var $module = initInterfaceModule('twistday-reminder');

    if ($module.length) {
        var $moduleRefresh = $module.find('.refresh');
            $moduleRefresh.on('click', refreshTwistdayReminder);
            setTimeout(function() { $moduleRefresh.click() }, 100);
        $module.find('.current').hide();
        $module.find('.upcoming').hide();
    }
}

function refreshTwistdayReminder() {
    var module = $('.module.twistday-reminder');
    var list = module.find('.list');

    if (list.length) {
        module.find('.refresh').hide();
        module.find('.loading-roller').show();
        if (defaultScreenName && typeof followingUsers !== 'undefined' && followingUsers.length) {
            var suggests = [];
            for (var i = 0; i < followingUsers.length; i++) {
                suggests[i] = {username: followingUsers[i], max_id: 0};
            }
            twisterRpc('getposts', [suggests.length + 1, suggests],
                function(arg, posts) {
                    function addLuckyToList(list, post, time) {
                        var lucky = post.userpost.n;
                        if (!list.find('[data-screen-name=' + lucky + ']').length) {
                            var item = $('#twistday-reminder-suggestion-template').clone(true)
                                .removeAttr('id');
                            item.find('.twister-user-info').attr('data-screen-name', lucky);
                            item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky));
                            item.find('.twister-user-tag').text('@' + lucky);
                            itemTwisterday = item.find('.twisterday');
                            itemTwisterday.on('click', (function(e) {replyInitPopup(e, post);}).bind(post));
                            if (typeof time !== 'undefined')
                                itemTwisterday.text(timeGmtToText(time));
                            else
                                itemTwisterday.text(timeGmtToText(post.userpost.time));

                            getAvatar(lucky, item.find('.twister-user-photo'));
                            getFullname(lucky, item.find('.twister-user-full'));

                            list.append(item);
                        }
                    }
                    function removeLuckyFromList(list, lucky) {
                        list.find('[data-screen-name=' + lucky + ']').closest('li').remove();
                    }

                    var showUpcomingTimer = ($.Options.TwistdayReminderShowUpcoming.val === 'enable') ?
                        $.Options.TwistdayReminderShowUpcomingTimer.val * 3600 : 0;
                    var listCurrent = module.find('.current .list');
                    var listUpcoming = module.find('.upcoming .list');
                    var d = new Date();
                    var curYear = d.getFullYear(), curYearUTC = d.getUTCFullYear();
                    var curMonth = d.getMonth();
                    var curDate = d.getDate();
                    var curSecUTC = Date.UTC(curYearUTC, d.getUTCMonth(), d.getUTCDate(),
                        d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()) / 1000;
                    var upcSecUTC;

                    posts.sort(function(a, b) {
                        return (parseInt(a.userpost.time) > parseInt(b.userpost.time)) ? 1 : -1;
                    });

                    for (var i = 0; i < posts.length; i++) {
                        if (followingUsers.indexOf(posts[i].userpost.n) > -1
                            && posts[i].userpost.height !== posts[i].userpost.k)  // to filter possible promoted twists which may appear suddenly (shame on you Miguel!)
                        {
                            d.setTime(0);
                            d.setUTCSeconds(posts[i].userpost.time);
                            if (d.getMonth() === curMonth && d.getDate() === curDate) {
                                addLuckyToList(listCurrent, posts[i]);
                                removeLuckyFromList(listUpcoming, posts[i].userpost.n);
                            } else if (showUpcomingTimer > 0) {
                                upcSecUTC = Date.UTC(curYearUTC, d.getUTCMonth(), d.getUTCDate(),
                                    d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()) / 1000;
                                if (upcSecUTC > curSecUTC && upcSecUTC - curSecUTC <= showUpcomingTimer) {
                                    d.setTime(0);
                                    d.setUTCSeconds(upcSecUTC);
                                    addLuckyToList(listUpcoming, posts[i], d.getTime() / 1000);
                                } else {
                                    removeLuckyFromList(listCurrent, posts[i].userpost.n);
                                    removeLuckyFromList(listUpcoming, posts[i].userpost.n);
                                }
                            } else {
                                removeLuckyFromList(listCurrent, posts[i].userpost.n);
                                removeLuckyFromList(listUpcoming, posts[i].userpost.n);
                            }
                        }
                    }

                    listCurrent.parent().css('display', listCurrent.children().length ? 'block' : 'none')
                    listUpcoming.parent().css('display', listUpcoming.children().length ? 'block' : 'none')
                    module.find('.refresh').show();
                    module.find('.loading-roller').hide();
                }, null,
                function(arg, ret) {console.log('ajax error:' + ret);}, null
            );
        }
        if ($.Options.TwistdayReminderAutoUpdate.val === 'enable' && $.Options.TwistdayReminderAutoUpdateTimer.val > 0)
            setTimeout(refreshTwistdayReminder, $.Options.TwistdayReminderAutoUpdateTimer.val * 1000);
    }
}

function initWebTorrent() {
    //localStorage.debug = '*'
    //localStorage.removeItem('debug')

    if ($.localStorage.isSet('torrentIds'))
        twister.torrentIds = $.localStorage.get('torrentIds');

    WEBTORRENT_ANNOUNCE = $.Options.WebTorrentTrackers.val.split(/[ ,]+/)
    $.getScript('js/webtorrent.min.js', function() {
        WebTorrentClient = new WebTorrent();
        console.log("WebTorrent started")
        WebTorrentClient.on('error', function (err) {
            console.error('ERROR: ' + err.message);
        });
        WebTorrentClient.on('warning', function (err) {
            console.error('WARNING: ' + err.message);
        });

        $.getScript('js/localforage.min.js', function() {
            localforage.setDriver([localforage.INDEXEDDB,localforage.WEBSQL]).then(function() {
                for (var torrentId in twister.torrentIds) {
                    if( twister.torrentIds[torrentId] ) {
                        if (typeof(twister.torrentIds[torrentId]) === "string") {
                            // get blob file to restart seeding this file
                            var onGetItem = function(torrentId, err, data) {
                                console.log("onget:", torrentId, err, data)
                                if (err || data === null) {
                                    // error reading blob, just add torrentId
                                    console.log("WebTorrent auto-download: " + torrentId +
                                                " (previously seeded as: " + twister.torrentIds[torrentId] + ")" );
                                    WebTorrentClient.add(torrentId);
                                } else {
                                    var fileBlob = new File([data], twister.torrentIds[torrentId]);
                                    console.log('WebTorrent seeding: "' + twister.torrentIds[torrentId] +
                                                '" size: ' + data.size);
                                    WebTorrentClient.seed(fileBlob);
                                }
                            }
                            localforage.getItem(torrentId, onGetItem.bind(null, torrentId));
                        } else if ($.Options.WebTorrentAutoDownload.val === 'enable') {
                            console.log("WebTorrent auto-download: " + torrentId);
                            WebTorrentClient.add(torrentId);
                        }
                    }
                }

                // setup attach button
                $(".post-area-attach").show();
                var fileInput = $("#fileInputAttach");
                fileInput.on('change', function(event) {
                    var file = fileInput[0].files[0];
                    var seedingTorrent = undefined;
                    for (var i = 0; i < WebTorrentClient.torrents.length; i++) {
                        var torrent = WebTorrentClient.torrents[i];
                        if (torrent.length === file.size &&
                            torrent.files[0].name === file.name) {
                            seedingTorrent = torrent;
                        }
                    }
                    var saveBlobFile = function(infoHash,file) {
                        var magnetLink = "magnet:?xt=urn:btih:" + infoHash
                        var blobFile = new Blob([file]);
                        localforage.setItem(magnetLink, blobFile);
                        twister.torrentIds[magnetLink] = file.name;
                        $.localStorage.set('torrentIds', twister.torrentIds);
                        return magnetLink;
                    }
                    if (seedingTorrent) {
                        var magnetLink = saveBlobFile(seedingTorrent.infoHash,file);
                        console.log('Already seeding ' + magnetLink);
                        shortenMagnetLink(event,magnetLink);
                    } else {
                        WebTorrentClient.seed(file, function (torrent) {
                            var magnetLink = saveBlobFile(torrent.infoHash,file);
                            console.log('Client is seeding ' + magnetLink);
                            shortenMagnetLink(event,magnetLink);
                        });
                    }
                });
            });
        });
    });
}

function shortenMagnetLink(event,magnetLink) {
    var uri = prompt(polyglot.t('shorten_URI_enter_link'), magnetLink);
    var textArea = $(event.target).closest('form').find('textarea');
    newShortURI(uri, function(long,short) {
        textArea.append(short);
    });
}

//***********************************************
//******************* INIT **************
//***********************************************
var interfaceFunctions = new InterfaceFunctions;
$( document ).ready( interfaceFunctions.init );


text:
g_Store = {
    gridlist = {},
    window = {},
    button = {}
}

--
--Some important vars:
--g_Store.gridlist[1] - gridlist
--g_Store.button[1] - exit
--g_Store.button[2] - Buy
--

g_Store.window[1] = guiCreateWindow(475, 300, 402, 383, "", false)
guiWindowSetSizable(g_Store.window[1], false)

g_Store.gridlist[1] = guiCreateGridList(12, 27, 268, 279, false, g_Store.window[1])
NameColoumn = guiGridListAddColumn(g_Store.gridlist[1], "Name", 0.5)
PriceColoumn = guiGridListAddColumn(g_Store.gridlist[1], "Price", 0.5)
g_Store.button[1] = guiCreateButton(296, 335, 96, 38, "Exit", false, g_Store.window[1])
guiSetProperty(g_Store.button[1], "NormalTextColour", "FFAAAAAA")
g_Store.button[2] = guiCreateButton(296, 287, 96, 38, "Buy", false, g_Store.window[1])
guiSetProperty(g_Store.button[2], "NormalTextColour", "FFAAAAAA")
guiSetVisible (g_Store.window[1], false)

-- Gridlist
for k,v in pairs ( g_Weapon ) do
	local row = guiGridListAddRow ( g_Store.gridlist[1] )
	guiGridListSetItemText ( g_Store.gridlist[1], row, NameColoumn, getWeaponNameFromID (k), false, false )
	guiGridListSetItemText ( g_Store.gridlist[1], row, PriceColoumn, tonumber (v), false, false )
end

-- Gridlist click
addEventHandler( "onClientGUIClick", g_Store.gridlist[1],
    function ()
    	local ClickedWeaponName = guiGridListGetItemText ( g_Store.gridlist[1], guiGridListGetSelectedItem ( g_Store.gridlist[1] ), 1 )
		ClickGunId = getWeaponIDFromName ( ClickedWeaponName )
    end, false
)

-- Exit button
addEventHandler( "onClientGUIClick", g_Store.button[1],
    function (  )
        toggleAllControls ( true )
    	guiSetVisible ( g_Store.window[1], false )
    	showCursor ( false )
    end, false
)

-- Buy button
addEventHandler( "onClientGUIClick", g_Store.button[2],
    function (  )
        if ClickGunId then
            triggerServerEvent ( "onPlayerBuyWeapon", localPlayer, ClickGunId )
            setPedWeaponSlot ( localPlayer, getSlotFromWeapon ( ClickGunId ) )
        end
    end, false
)

-- Event Marker
function showMarkers( hitPlayer )
    if hitPlayer == localPlayer then
        if not isPedInVehicle (hitPlayer) then
            toggleAllControls ( false )
            guiSetVisible (g_Store.window[1], true)
            showCursor (true)
        end
    end
end

--Сycle
for k,v in pairs ( g_WeaponMarker ) do
	markers = createMarker( g_WeaponMarker[k][1], g_WeaponMarker[k][2], g_WeaponMarker[k][3] - 1, "cylinder", 2, 255, 0, 0 )
	addEventHandler ( "onClientMarkerHit", markers, showMarkers )
end


text:
class CNPC_Breen : public CAI_BaseActor
{
public:
	DECLARE_CLASS( CNPC_Breen, CAI_BaseActor );

	void	Spawn( void );
	void	Precache( void );
	Class_T Classify ( void );
	void	HandleAnimEvent( animevent_t *pEvent );
	int		GetSoundInterests ( void );
	bool	UseSemaphore( void );
};

LINK_ENTITY_TO_CLASS( npc_breen, CNPC_Breen );

//-----------------------------------------------------------------------------
// Classify - indicates this NPC's place in the
// relationship table.
//-----------------------------------------------------------------------------
Class_T	CNPC_Breen::Classify ( void )
{
	return	CLASS_NONE;
}

//-----------------------------------------------------------------------------
// HandleAnimEvent - catches the NPC-specific messages
// that occur when tagged animation frames are played.
//-----------------------------------------------------------------------------
void CNPC_Breen::HandleAnimEvent( animevent_t *pEvent )
{
	switch( pEvent->event )
	{
	case 1:
	default:
		BaseClass::HandleAnimEvent( pEvent );
		break;
	}
}

//-----------------------------------------------------------------------------
// GetSoundInterests - generic NPC can't hear.
//-----------------------------------------------------------------------------
int CNPC_Breen::GetSoundInterests ( void )
{
	return	0;
}

//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CNPC_Breen::Spawn()
{
	// Breen is allowed to use multiple models, because he has a torso version for monitors.
	// He defaults to his normal model.
	const char *szModel = (char *)STRING( GetModelName() );
	if (!szModel || !*szModel)
	{
		szModel = "models/breen.mdl";
		SetModelName( AllocPooledString(szModel) );
	}

	Precache();
	SetModel( szModel );

	BaseClass::Spawn();

	SetHullType(HULL_HUMAN);
	SetHullSizeNormal();

	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	SetMoveType( MOVETYPE_STEP );
	SetBloodColor( BLOOD_COLOR_RED );
	m_iHealth			= 8;
	m_flFieldOfView		= 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
	m_NPCState			= NPC_STATE_NONE;

	CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD );
	CapabilitiesAdd( bits_CAP_FRIENDLY_DMG_IMMUNE );
	AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL | EFL_NO_PHYSCANNON_INTERACTION );

	NPCInit();
}

//-----------------------------------------------------------------------------
// Precache - precaches all resources this NPC needs
//-----------------------------------------------------------------------------
void CNPC_Breen::Precache()
{
	PrecacheModel( STRING( GetModelName() ) );
	BaseClass::Precache();
}

bool CNPC_Breen::UseSemaphore( void )
{
	if ( HasSpawnFlags( SF_BREEN_BACKGROUND_TALK ) )
		return false;

	return BaseClass::UseSemaphore();
}

//-----------------------------------------------------------------------------
// AI Schedules Specific to this NPC
//-----------------------------------------------------------------------------


text:
package com.intellij.uiDesigner.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.uiDesigner.FormEditingUtil;
import com.intellij.uiDesigner.UIDesignerBundle;
import com.intellij.uiDesigner.componentTree.ComponentTree;
import com.intellij.uiDesigner.designSurface.GuiEditor;
import com.intellij.uiDesigner.radComponents.RadComponent;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

public class SurroundPopupAction extends AbstractGuiEditorAction {
  private final SurroundActionGroup myActionGroup = new SurroundActionGroup();

  @Override
  protected void actionPerformed(final GuiEditor editor, final List<? extends RadComponent> selection, final AnActionEvent e) {
    final ListPopup groupPopup = JBPopupFactory.getInstance()
      .createActionGroupPopup(UIDesignerBundle.message("surround.with.popup.title"), myActionGroup, e.getDataContext(),
                              JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, true);

    final JComponent component = (JComponent)e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
    if (component instanceof ComponentTree) {
      groupPopup.show(JBPopupFactory.getInstance().guessBestPopupLocation(component));
    }
    else {
      RadComponent selComponent = selection.get(0);
      FormEditingUtil.showPopupUnderComponent(groupPopup, selComponent);
    }
  }

  @Override
  protected void update(@NotNull GuiEditor editor, final ArrayList<? extends RadComponent> selection, final AnActionEvent e) {
    e.getPresentation().setEnabled(selection.size() > 0);
  }
}


text:
def make_url(query, n=1):
    """
    this function get a API formated query and
    return the full path query to use as an argument in
    feedparser
    imputs:
    query: string formated as a API query
    n: integer

    """
    return 'http://export.arxiv.org/api/query?search_query={0}&start={1}&max_results=100'.format(query,n)


text:
package com.citrix.netscaler.nitro.resource.config.policy;

import com.citrix.netscaler.nitro.resource.base.*;
import com.citrix.netscaler.nitro.service.nitro_service;
import com.citrix.netscaler.nitro.service.options;
import com.citrix.netscaler.nitro.util.*;
import com.citrix.netscaler.nitro.exception.nitro_exception;

class policyexpression_response extends base_response
{
	public policyexpression[] policyexpression;
}
/**
* Configuration for expression resource.
*/

public class policyexpression extends base_resource
{
	private String name;
	private String value;
	private String description;
	private String comment;
	private String clientsecuritymessage;
	private String type;

	//------- Read only Parameter ---------;

	private Long hits;
	private Long pihits;
	private String type1;
	private Boolean isdefault;
	private String[] builtin;
	private Long __count;

	/**
	*

	* Unique name for the expression. Not case sensitive. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Must not begin with 're' or 'xp' or be a word reserved for use as a default syntax expression qualifier prefix (such as HTTP) or enumeration value (such as ASCII). Must not be the name of an existing named expression, pattern set, dataset, stringmap, or HTTP callout.
 Minimum length =  1
	*

	*/
	public void set_name(String name) throws Exception{
		this.name = name;
	}

	/**
	*

	* Unique name for the expression. Not case sensitive. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Must not begin with 're' or 'xp' or be a word reserved for use as a default syntax expression qualifier prefix (such as HTTP) or enumeration value (such as ASCII). Must not be the name of an existing named expression, pattern set, dataset, stringmap, or HTTP callout.
 Minimum length =  1
	*

	*/
	public String get_name() throws Exception {
		return this.name;
	}

	/**
	*

	* Expression string. For example: http.req.body(100).contains("this").
	*

	*/
	public void set_value(String value) throws Exception{
		this.value = value;
	}

	/**
	*

	* Expression string. For example: http.req.body(100).contains("this").
	*

	*/
	public String get_value() throws Exception {
		return this.value;
	}

	/**
	*

	* Description for the expression.
	*

	*/
	public void set_description(String description) throws Exception{
		this.description = description;
	}

	/**
	*

	* Description for the expression.
	*

	*/
	public String get_description() throws Exception {
		return this.description;
	}

	/**
	*

	* Any comments associated with the expression. Displayed upon viewing the policy expression.
	*

	*/
	public void set_comment(String comment) throws Exception{
		this.comment = comment;
	}

	/**
	*

	* Any comments associated with the expression. Displayed upon viewing the policy expression.
	*

	*/
	public String get_comment() throws Exception {
		return this.comment;
	}

	/**
	*

	* Message to display if the expression fails. Allowed for classic end-point check expressions only.
 Minimum length =  1
	*

	*/
	public void set_clientsecuritymessage(String clientsecuritymessage) throws Exception{
		this.clientsecuritymessage = clientsecuritymessage;
	}

	/**
	*

	* Message to display if the expression fails. Allowed for classic end-point check expressions only.
 Minimum length =  1
	*

	*/
	public String get_clientsecuritymessage() throws Exception {
		return this.clientsecuritymessage;
	}

	/**
	*

	* Type of expression. Can be a classic or default syntax (advanced) expression.
 Possible values = CLASSIC, ADVANCED
	*

	*/
	public void set_type(String type) throws Exception{
		this.type = type;
	}

	/**
	*

	* Type of expression. Can be a classic or default syntax (advanced) expression.
 Possible values = CLASSIC, ADVANCED
	*

	*/
	public String get_type() throws Exception {
		return this.type;
	}

	/**
	*

	* The total number of hits.
	*

	*/
	public Long get_hits() throws Exception {
		return this.hits;
	}

	/**
	*

	* The total number of hits.
	*

	*/
	public Long get_pihits() throws Exception {
		return this.pihits;
	}

	/**
	*

	* The type of expression. This is for output only.
 Possible values = CLASSIC, ADVANCED
	*

	*/
	public String get_type1() throws Exception {
		return this.type1;
	}

	/**
	*

	* A value of true is returned if it is a default policy expression.
	*

	*/
	public Boolean get_isdefault() throws Exception {
		return this.isdefault;
	}

	/**
	*

	* Indicates that a variable is a built-in (SYSTEM INTERNAL) type.
 Possible values = MODIFIABLE, DELETABLE, IMMUTABLE
	*

	*/
	public String[] get_builtin() throws Exception {
		return this.builtin;
	}

	/**
	*

	* converts nitro response into object and returns the object array in case of get request.
	*

	*/
	protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception{
		policyexpression_response result = (policyexpression_response) service.get_payload_formatter().string_to_resource(policyexpression_response.class, response);
		if(result.errorcode != 0) {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if (result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		return result.policyexpression;
	}

	/**
	*

	* Returns the value of object identifier argument
	*

	*/

	protected String get_object_name() {
		return this.name;
	}

	/**
	* Use this API to add policyexpression.
	*/
	public static base_response add(nitro_service client, policyexpression resource) throws Exception {
		policyexpression addresource = new policyexpression();
		addresource.name = resource.name;
		addresource.value = resource.value;
		addresource.description = resource.description;
		addresource.comment = resource.comment;
		addresource.clientsecuritymessage = resource.clientsecuritymessage;
		return addresource.add_resource(client);
	}

	/**
	* Use this API to add policyexpression resources.
	*/
	public static base_responses add(nitro_service client, policyexpression resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			policyexpression addresources[] = new policyexpression[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new policyexpression();
				addresources[i].name = resources[i].name;
				addresources[i].value = resources[i].value;
				addresources[i].description = resources[i].description;
				addresources[i].comment = resources[i].comment;
				addresources[i].clientsecuritymessage = resources[i].clientsecuritymessage;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}

	/**
	* Use this API to delete policyexpression of given name.
	*/
	public static base_response delete(nitro_service client, String name) throws Exception {
		policyexpression deleteresource = new policyexpression();
		deleteresource.name = name;
		return deleteresource.delete_resource(client);
	}

	/**
	* Use this API to delete policyexpression.
	*/
	public static base_response delete(nitro_service client, policyexpression resource) throws Exception {
		policyexpression deleteresource = new policyexpression();
		deleteresource.name = resource.name;
		return deleteresource.delete_resource(client);
	}

	/**
	* Use this API to delete policyexpression resources of given names.
	*/
	public static base_responses delete(nitro_service client, String name[]) throws Exception {
		base_responses result = null;
		if (name != null && name.length > 0) {
			policyexpression deleteresources[] = new policyexpression[name.length];
			for (int i=0;i<name.length;i++){
				deleteresources[i] = new policyexpression();
				deleteresources[i].name = name[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}

	/**
	* Use this API to delete policyexpression resources.
	*/
	public static base_responses delete(nitro_service client, policyexpression resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			policyexpression deleteresources[] = new policyexpression[resources.length];
			for (int i=0;i<resources.length;i++){
				deleteresources[i] = new policyexpression();
				deleteresources[i].name = resources[i].name;
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}

	/**
	* Use this API to update policyexpression.
	*/
	public static base_response update(nitro_service client, policyexpression resource) throws Exception {
		policyexpression updateresource = new policyexpression();
		updateresource.name = resource.name;
		updateresource.value = resource.value;
		updateresource.description = resource.description;
		updateresource.comment = resource.comment;
		updateresource.clientsecuritymessage = resource.clientsecuritymessage;
		return updateresource.update_resource(client);
	}

	/**
	* Use this API to update policyexpression resources.
	*/
	public static base_responses update(nitro_service client, policyexpression resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			policyexpression updateresources[] = new policyexpression[resources.length];
			for (int i=0;i<resources.length;i++){
				updateresources[i] = new policyexpression();
				updateresources[i].name = resources[i].name;
				updateresources[i].value = resources[i].value;
				updateresources[i].description = resources[i].description;
				updateresources[i].comment = resources[i].comment;
				updateresources[i].clientsecuritymessage = resources[i].clientsecuritymessage;
			}
			result = update_bulk_request(client, updateresources);
		}
		return result;
	}

	/**
	* Use this API to unset the properties of policyexpression resource.
	* Properties that need to be unset are specified in args array.
	*/
	public static base_response unset(nitro_service client, policyexpression resource, String[] args) throws Exception{
		policyexpression unsetresource = new policyexpression();
		unsetresource.name = resource.name;
		return unsetresource.unset_resource(client,args);
	}

	/**
	* Use this API to unset the properties of policyexpression resources.
	* Properties that need to be unset are specified in args array.
	*/
	public static base_responses unset(nitro_service client, String name[], String args[]) throws Exception {
		base_responses result = null;
		if (name != null && name.length > 0) {
			policyexpression unsetresources[] = new policyexpression[name.length];
			for (int i=0;i<name.length;i++){
				unsetresources[i] = new policyexpression();
				unsetresources[i].name = name[i];
			}
			result = unset_bulk_request(client, unsetresources,args);
		}
		return result;
	}

	/**
	* Use this API to unset the properties of policyexpression resources.
	* Properties that need to be unset are specified in args array.
	*/
	public static base_responses unset(nitro_service client, policyexpression resources[],  String[] args) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			policyexpression unsetresources[] = new policyexpression[resources.length];
			for (int i=0;i<resources.length;i++){
				unsetresources[i] = new policyexpression();
				unsetresources[i].name = resources[i].name;
			}
			result = unset_bulk_request(client, unsetresources,args);
		}
		return result;
	}

	/**
	* Use this API to fetch all the policyexpression resources that are configured on netscaler.
	*/
	public static policyexpression[] get(nitro_service service) throws Exception{
		policyexpression obj = new policyexpression();
		policyexpression[] response = (policyexpression[])obj.get_resources(service);
		return response;
	}
	/**
	* Use this API to fetch all the policyexpression resources that are configured on netscaler.
	*/
	public static policyexpression[] get(nitro_service service, options option) throws Exception{
		policyexpression obj = new policyexpression();
		policyexpression[] response = (policyexpression[])obj.get_resources(service,option);
		return response;
	}
	/**
	* Use this API to fetch all the policyexpression resources that are configured on netscaler.
	* This uses policyexpression_args which is a way to provide additional arguments while fetching the resources.
	*/
	public static policyexpression[] get(nitro_service service, policyexpression_args args) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_args(nitro_util.object_to_string_withoutquotes(args));
		policyexpression[] response = (policyexpression[])obj.get_resources(service, option);
		return response;
	}

	/**
	* Use this API to fetch policyexpression resource of given name .
	*/
	public static policyexpression get(nitro_service service, String name) throws Exception{
		policyexpression obj = new policyexpression();
		obj.set_name(name);
		policyexpression response = (policyexpression) obj.get_resource(service);
		return response;
	}

	/**
	* Use this API to fetch policyexpression resources of given names .
	*/
	public static policyexpression[] get(nitro_service service, String name[]) throws Exception{
		if (name !=null && name.length>0) {
			policyexpression response[] = new policyexpression[name.length];
			policyexpression obj[] = new policyexpression[name.length];
			for (int i=0;i<name.length;i++) {
				obj[i] = new policyexpression();
				obj[i].set_name(name[i]);
				response[i] = (policyexpression) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
	/**
	* Use this API to fetch filtered set of policyexpression resources.
	* filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
	*/
	public static policyexpression[] get_filtered(nitro_service service, String filter) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_filter(filter);
		policyexpression[] response = (policyexpression[]) obj.getfiltered(service, option);
		return response;
	}

	/**
	* Use this API to fetch filtered set of policyexpression resources.
	* set the filter parameter values in filtervalue object.
	*/
	public static policyexpression[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_filter(filter);
		policyexpression[] response = (policyexpression[]) obj.getfiltered(service, option);
		return response;
	}

	/**
	* Use this API to count the policyexpression resources configured on NetScaler.
	*/
	public static long count(nitro_service service) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_count(true);
		policyexpression[] response = (policyexpression[])obj.get_resources(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

	/**
	* Use this API to count filtered the set of policyexpression resources.
	* filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
	*/
	public static long count_filtered(nitro_service service, String filter) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_count(true);
		option.set_filter(filter);
		policyexpression[] response = (policyexpression[]) obj.getfiltered(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

	/**
	* Use this API to count the filtered set of policyexpression resources.
	* set the filter parameter values in filtervalue object.
	*/
	public static long count_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		policyexpression obj = new policyexpression();
		options option = new options();
		option.set_count(true);
		option.set_filter(filter);
		policyexpression[] response = (policyexpression[]) obj.getfiltered(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

	public static class builtinEnum {
		public static final String MODIFIABLE = "MODIFIABLE";
		public static final String DELETABLE = "DELETABLE";
		public static final String IMMUTABLE = "IMMUTABLE";
	}
	public static class typeEnum {
		public static final String CLASSIC = "CLASSIC";
		public static final String ADVANCED = "ADVANCED";
	}
	public static class type1Enum {
		public static final String CLASSIC = "CLASSIC";
		public static final String ADVANCED = "ADVANCED";
	}
}