text:
#import "Message.h"
#import "util.h"

#define HEAD_SIZE 8
#define VERSION 1

@implementation IMMessage

@end

@implementation CustomerMessage

@end

@implementation RoomMessage

@end

@implementation MessageInputing

@end

@implementation AuthenticationToken

@end

@implementation GroupSyncKey

@end

@implementation VOIPControl

@end

@implementation Message
-(NSData*)pack {
    char buf[64*1024] = {0};
    char *p = buf;

    writeInt32(self.seq, p);
    p += 4;
    *p++ = (uint8_t)self.cmd;
    *p++ = (uint8_t)VERSION;
    p += 2;

    if (self.cmd == MSG_HEARTBEAT || self.cmd == MSG_PING) {
        return [NSData dataWithBytes:buf length:HEAD_SIZE];
    } else if (self.cmd == MSG_AUTH_TOKEN) {
        AuthenticationToken *auth = (AuthenticationToken*)self.body;
        *p++ = auth.platformID;
        const char *t;
        t = [auth.token UTF8String];
        *p++ = strlen(t);
        memcpy(p, t, strlen(t));
        p += strlen(t);
        t = [auth.deviceID UTF8String];
        *p++ = strlen(t);
        memcpy(p, t, strlen(t));
        p += strlen(t);
        return [NSData dataWithBytes:buf length:(p-buf)];
    }  else if (self.cmd == MSG_IM || self.cmd == MSG_GROUP_IM) {
        IMMessage *m = (IMMessage*)self.body;
        writeInt64(m.sender, p);
        p += 8;
        writeInt64(m.receiver, p);
        p += 8;
        writeInt32(m.timestamp, p);
        p += 4;
        writeInt32(m.msgLocalID, p);
        p += 4;
        const char *s = [m.content UTF8String];
        size_t l = strlen(s);
        if ((l + 36) > 64*1024) {
            return nil;
        }
        memcpy(p, s, l);
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 24 +l];
    } else if (self.cmd == MSG_CUSTOMER || self.cmd == MSG_CUSTOMER_SUPPORT) {
        CustomerMessage *m = (CustomerMessage*)self.body;
        writeInt64(m.customerAppID, p);
        p += 8;
        writeInt64(m.customerID, p);
        p += 8;
        writeInt64(m.storeID, p);
        p += 8;
        writeInt64(m.sellerID, p);
        p += 8;
        writeInt32(m.timestamp, p);
        p += 4;
        const char *s = [m.content UTF8String];
        size_t l = strlen(s);
        if ((l + 36) >= 32*1024) {
            return nil;
        }
        memcpy(p, s, l);
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 36 + l];
    } else if (self.cmd == MSG_ACK) {
        writeInt32([(NSNumber*)self.body intValue], p);
        return [NSData dataWithBytes:buf length:HEAD_SIZE+4];
    } else if (self.cmd == MSG_INPUTING) {
        MessageInputing *inputing = (MessageInputing*)self.body;
        writeInt64(inputing.sender, p);
        p += 8;
        writeInt64(inputing.receiver, p);
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 16];
    } else if (self.cmd == MSG_ENTER_ROOM || self.cmd == MSG_LEAVE_ROOM) {
        NSNumber *n = (NSNumber*)self.body;
        int64_t roomID = [n longLongValue];
        writeInt64(roomID, p);
        p += 8;
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 8];
    } else if (self.cmd == MSG_ROOM_IM || self.cmd == MSG_RT) {
        RoomMessage *rm = (RoomMessage*)self.body;
        writeInt64(rm.sender, p);
        p += 8;
        writeInt64(rm.receiver, p);
        p += 8;
        const char *s = [rm.content UTF8String];
        size_t l = strlen(s);
        if ((l + 28) > 64*1024) {
            return nil;
        }
        memcpy(p, s, l);
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 16 +l];
    } else if (self.cmd == MSG_UNREAD_COUNT) {
        NSNumber *u = (NSNumber*)self.body;
        writeInt32([u intValue], p);
        p += 4;
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 4];
    } else if (self.cmd == MSG_VOIP_CONTROL) {
        VOIPControl *ctl = (VOIPControl*)self.body;
        writeInt64(ctl.sender, p);
        p += 8;
        writeInt64(ctl.receiver, p);
        p += 8;
        if (ctl.content.length > 0) {
            [ctl.content getBytes:p length:ctl.content.length];
            p += ctl.content.length;
        }
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 16 + ctl.content.length];
    } else if (self.cmd == MSG_SYNC) {
        NSNumber *u = (NSNumber*)self.body;
        writeInt64([u longLongValue], p);
        p += 8;
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 8];
    } else if (self.cmd == MSG_SYNC_GROUP) {
        GroupSyncKey *s = (GroupSyncKey*)self.body;
        writeInt64(s.groupID, p);
        p += 8;
        writeInt64(s.syncKey, p);
        p += 8;
        return [NSData dataWithBytes:buf length:HEAD_SIZE + 16];
    }
    return nil;
}

-(BOOL)unpack:(NSData*)data {
    const char *p = [data bytes];
    self.seq = readInt32(p);
    p += 4;
    self.cmd = *p;
    p += 4;
    NSLog(@"seq:%d cmd:%d", self.seq, self.cmd);
    if (self.cmd == MSG_PONG) {
        return YES;
    } else if (self.cmd == MSG_AUTH_STATUS) {
        int status = readInt32(p);
        self.body = [NSNumber numberWithInt:status];
        return YES;
    } else if (self.cmd == MSG_IM || self.cmd == MSG_GROUP_IM) {
        IMMessage *m = [[IMMessage alloc] init];
        m.sender = readInt64(p);
        p += 8;
        m.receiver = readInt64(p);
        p += 8;
        m.timestamp = readInt32(p);
        p += 4;
        m.msgLocalID = readInt32(p);
        p += 4;
        m.content = [[NSString alloc] initWithBytes:p length:data.length-32 encoding:NSUTF8StringEncoding];
        self.body = m;
        return YES;
    } else if (self.cmd == MSG_CUSTOMER || self.cmd == MSG_CUSTOMER_SUPPORT) {
        CustomerMessage *m = [[CustomerMessage alloc] init];
        m.customerAppID = readInt64(p);
        p += 8;
        m.customerID = readInt64(p);
        p += 8;
        m.storeID = readInt64(p);
        p += 8;
        m.sellerID = readInt64(p);
        p += 8;
        m.timestamp = readInt32(p);
        p += 4;
        m.content = [[NSString alloc] initWithBytes:p length:data.length- HEAD_SIZE - 36 encoding:NSUTF8StringEncoding];
        self.body = m;
        return YES;
    } else if (self.cmd == MSG_ACK) {
        int seq = readInt32(p);
        self.body = [NSNumber numberWithInt:seq];
        return YES;
    } else if (self.cmd == MSG_INPUTING) {
        MessageInputing *inputing = [[MessageInputing alloc] init];
        inputing.sender = readInt64(p);
        p += 8;
        inputing.receiver = readInt64(p);
        p += 8;
        self.body = inputing;
        return YES;
    } else if (self.cmd == MSG_GROUP_NOTIFICATION) {
        self.body = [[NSString alloc] initWithBytes:p length:data.length-HEAD_SIZE encoding:NSUTF8StringEncoding];
        return YES;
    } else if (self.cmd == MSG_ROOM_IM || self.cmd == MSG_RT) {
        RoomMessage *rm = [[RoomMessage alloc] init];
        rm.sender = readInt64(p);
        p += 8;
        rm.receiver = readInt64(p);
        p += 8;
        rm.content = [[NSString alloc] initWithBytes:p length:data.length-24 encoding:NSUTF8StringEncoding];
        self.body = rm;
        return YES;
    } else if (self.cmd == MSG_SYSTEM) {
        self.body = [[NSString alloc] initWithBytes:p length:data.length-HEAD_SIZE encoding:NSUTF8StringEncoding];
        return YES;
    } else if (self.cmd == MSG_VOIP_CONTROL) {
        VOIPControl *ctl = [[VOIPControl alloc] init];
        ctl.sender = readInt64(p);
        p += 8;
        ctl.receiver = readInt64(p);
        p += 8;
        ctl.content = [NSData dataWithBytes:p length:data.length - 24];
        self.body = ctl;
        return YES;
    } else if (self.cmd == MSG_SYNC_BEGIN ||
               self.cmd == MSG_SYNC_END ||
               self.cmd == MSG_SYNC_NOTIFY) {
        int64_t k = readInt64(p);
        p += 8;
        self.body = [NSNumber numberWithLongLong:k];
        return YES;
    } else if (self.cmd == MSG_SYNC_GROUP_BEGIN ||
               self.cmd == MSG_SYNC_GROUP_END ||
               self.cmd == MSG_SYNC_GROUP_NOTIFY) {
        GroupSyncKey *groupSyncKey = [[GroupSyncKey alloc] init];
        groupSyncKey.groupID = readInt64(p);
        p += 8;
        groupSyncKey.syncKey = readInt64(p);
        p += 8;
        self.body = groupSyncKey;
        return YES;
    } else {
        self.body = [NSData dataWithBytes:p length:data.length-8];
        return YES;
    }
}

@end


text:
namespace Microsoft.Azure.Management.WebSites
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Http;
    using System.Net.Http.Headers;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using Microsoft.Rest.Azure;
    using Models;

    /// <summary>
    /// RecommendationsOperations operations.
    /// </summary>
    internal partial class RecommendationsOperations : IServiceOperations<WebSiteManagementClient>, IRecommendationsOperations
    {
        /// <summary>
        /// Initializes a new instance of the RecommendationsOperations class.
        /// </summary>
        /// <param name='client'>
        /// Reference to the service client.
        /// </param>
        internal RecommendationsOperations(WebSiteManagementClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }
            this.Client = client;
        }

        /// <summary>
        /// Gets a reference to the WebSiteManagementClient
        /// </summary>
        public WebSiteManagementClient Client { get; private set; }

        /// <summary>
        /// Gets a list of recommendations associated with the specified subscription.
        /// </summary>
        /// Gets a list of recommendations associated with the specified subscription.
        /// <param name='featured'>
        /// If set, this API returns only the most critical recommendation among the
        /// others. Otherwise this API returns all recommendations available
        /// </param>
        /// <param name='filter'>
        /// Return only channels specified in the filter. Filter is specified by using
        /// OData syntax. Example: $filter=channels eq 'Api' or channel eq
        /// 'Notification'
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task<AzureOperationResponse<IList<Recommendation>>> GetWithHttpMessagesAsync(bool? featured = default(bool?), string filter = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (this.Client.SubscriptionId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
            }
            string apiVersion = "2016-03-01";
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("featured", featured);
                tracingParameters.Add("filter", filter);
                tracingParameters.Add("apiVersion", apiVersion);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations").ToString();
            _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId));
            List<string> _queryParameters = new List<string>();
            if (featured != null)
            {
                _queryParameters.Add(string.Format("featured={0}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(featured, this.Client.SerializationSettings).Trim('"'))));
            }
            if (filter != null)
            {
                _queryParameters.Add(string.Format("$filter={0}", Uri.EscapeDataString(filter)));
            }
            if (apiVersion != null)
            {
                _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(apiVersion)));
            }
            if (_queryParameters.Count > 0)
            {
                _url += "?" + string.Join("&", _queryParameters);
            }
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
            {
                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString());
            }
            if (this.Client.AcceptLanguage != null)
            {
                if (_httpRequest.Headers.Contains("accept-language"))
                {
                    _httpRequest.Headers.Remove("accept-language");
                }
                _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
            }
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            }
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    CloudError _errorBody = SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex = new CloudException(_errorBody.Message);
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_httpResponse.Headers.Contains("x-ms-request-id"))
                {
                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
                }
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new AzureOperationResponse<IList<Recommendation>>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            if (_httpResponse.Headers.Contains("x-ms-request-id"))
            {
                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
            }
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    _result.Body = SafeJsonConvert.DeserializeObject<IList<Recommendation>>(_responseContent, this.Client.DeserializationSettings);
                }
                catch (JsonException ex)
                {
                    _httpRequest.Dispose();
                    if (_httpResponse != null)
                    {
                        _httpResponse.Dispose();
                    }
                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
                }
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

        /// <summary>
        /// Gets the list of past recommendations optionally specified by the time
        /// range.
        /// </summary>
        /// Gets the list of past recommendations optionally specified by the time
        /// range.
        /// <param name='resourceGroupName'>
        /// Resource group name
        /// </param>
        /// <param name='siteName'>
        /// Site name
        /// </param>
        /// <param name='startTime'>
        /// The start time of a time range to query, e.g. $filter=startTime eq
        /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z'
        /// </param>
        /// <param name='endTime'>
        /// The end time of a time range to query, e.g. $filter=startTime eq
        /// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z'
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task<AzureOperationResponse<IList<Recommendation>>> ListHistoryForWebAppWithHttpMessagesAsync(string resourceGroupName, string siteName, string startTime = default(string), string endTime = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (resourceGroupName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
            }
            if (siteName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "siteName");
            }
            if (this.Client.SubscriptionId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
            }
            string apiVersion = "2016-03-01";
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("resourceGroupName", resourceGroupName);
                tracingParameters.Add("siteName", siteName);
                tracingParameters.Add("startTime", startTime);
                tracingParameters.Add("endTime", endTime);
                tracingParameters.Add("apiVersion", apiVersion);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "ListHistoryForWebApp", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory").ToString();
            _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName));
            _url = _url.Replace("{siteName}", Uri.EscapeDataString(siteName));
            _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId));
            List<string> _queryParameters = new List<string>();
            if (startTime != null)
            {
                _queryParameters.Add(string.Format("startTime={0}", Uri.EscapeDataString(startTime)));
            }
            if (endTime != null)
            {
                _queryParameters.Add(string.Format("endTime={0}", Uri.EscapeDataString(endTime)));
            }
            if (apiVersion != null)
            {
                _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(apiVersion)));
            }
            if (_queryParameters.Count > 0)
            {
                _url += "?" + string.Join("&", _queryParameters);
            }
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
            {
                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString());
            }
            if (this.Client.AcceptLanguage != null)
            {
                if (_httpRequest.Headers.Contains("accept-language"))
                {
                    _httpRequest.Headers.Remove("accept-language");
                }
                _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
            }
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            }
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    CloudError _errorBody = SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex = new CloudException(_errorBody.Message);
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_httpResponse.Headers.Contains("x-ms-request-id"))
                {
                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
                }
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new AzureOperationResponse<IList<Recommendation>>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            if (_httpResponse.Headers.Contains("x-ms-request-id"))
            {
                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
            }
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    _result.Body = SafeJsonConvert.DeserializeObject<IList<Recommendation>>(_responseContent, this.Client.DeserializationSettings);
                }
                catch (JsonException ex)
                {
                    _httpRequest.Dispose();
                    if (_httpResponse != null)
                    {
                        _httpResponse.Dispose();
                    }
                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
                }
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

        /// <summary>
        /// Gets a list of recommendations associated with the specified web site.
        /// </summary>
        /// Gets a list of recommendations associated with the specified web site.
        /// <param name='resourceGroupName'>
        /// Resource group name
        /// </param>
        /// <param name='siteName'>
        /// Site name
        /// </param>
        /// <param name='featured'>
        /// If set, this API returns only the most critical recommendation among the
        /// others. Otherwise this API returns all recommendations available
        /// </param>
        /// <param name='webAppSku'>
        /// The name of web app SKU.
        /// </param>
        /// <param name='numSlots'>
        /// The number of site slots associated to the site
        /// </param>
        /// <param name='liveHours'>
        /// If greater than zero, this API scans the last active live site symptoms,
        /// dynamically generate on-the-fly recommendations
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task<AzureOperationResponse<IList<Recommendation>>> ListRecommendedRulesForWebAppWithHttpMessagesAsync(string resourceGroupName, string siteName, bool? featured = default(bool?), string webAppSku = default(string), int? numSlots = default(int?), int? liveHours = default(int?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (resourceGroupName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
            }
            if (siteName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "siteName");
            }
            if (this.Client.SubscriptionId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
            }
            string apiVersion = "2016-03-01";
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("resourceGroupName", resourceGroupName);
                tracingParameters.Add("siteName", siteName);
                tracingParameters.Add("featured", featured);
                tracingParameters.Add("webAppSku", webAppSku);
                tracingParameters.Add("numSlots", numSlots);
                tracingParameters.Add("liveHours", liveHours);
                tracingParameters.Add("apiVersion", apiVersion);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedRulesForWebApp", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations").ToString();
            _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName));
            _url = _url.Replace("{siteName}", Uri.EscapeDataString(siteName));
            _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId));
            List<string> _queryParameters = new List<string>();
            if (featured != null)
            {
                _queryParameters.Add(string.Format("featured={0}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(featured, this.Client.SerializationSettings).Trim('"'))));
            }
            if (webAppSku != null)
            {
                _queryParameters.Add(string.Format("webAppSku={0}", Uri.EscapeDataString(webAppSku)));
            }
            if (numSlots != null)
            {
                _queryParameters.Add(string.Format("numSlots={0}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(numSlots, this.Client.SerializationSettings).Trim('"'))));
            }
            if (liveHours != null)
            {
                _queryParameters.Add(string.Format("liveHours={0}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(liveHours, this.Client.SerializationSettings).Trim('"'))));
            }
            if (apiVersion != null)
            {
                _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(apiVersion)));
            }
            if (_queryParameters.Count > 0)
            {
                _url += "?" + string.Join("&", _queryParameters);
            }
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
            {
                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString());
            }
            if (this.Client.AcceptLanguage != null)
            {
                if (_httpRequest.Headers.Contains("accept-language"))
                {
                    _httpRequest.Headers.Remove("accept-language");
                }
                _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
            }
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            }
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    CloudError _errorBody = SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex = new CloudException(_errorBody.Message);
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_httpResponse.Headers.Contains("x-ms-request-id"))
                {
                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
                }
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new AzureOperationResponse<IList<Recommendation>>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            if (_httpResponse.Headers.Contains("x-ms-request-id"))
            {
                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
            }
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    _result.Body = SafeJsonConvert.DeserializeObject<IList<Recommendation>>(_responseContent, this.Client.DeserializationSettings);
                }
                catch (JsonException ex)
                {
                    _httpRequest.Dispose();
                    if (_httpResponse != null)
                    {
                        _httpResponse.Dispose();
                    }
                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
                }
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

        /// <summary>
        /// Gets the detailed properties of the recommendation object for the
        /// specified web site.
        /// </summary>
        /// Gets the detailed properties of the recommendation object for the
        /// specified web site.
        /// <param name='resourceGroupName'>
        /// Resource group name
        /// </param>
        /// <param name='siteName'>
        /// Name of web app
        /// </param>
        /// <param name='name'>
        /// Recommendation rule name
        /// </param>
        /// <param name='updateSeen'>
        /// If true, the backend updates the last seen timestamp of the recommendation
        /// object.
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task<AzureOperationResponse<RecommendationRule>> GetRuleDetailsByWebAppWithHttpMessagesAsync(string resourceGroupName, string siteName, string name, bool? updateSeen = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (resourceGroupName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
            }
            if (siteName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "siteName");
            }
            if (name == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "name");
            }
            if (this.Client.SubscriptionId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
            }
            string apiVersion = "2016-03-01";
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("resourceGroupName", resourceGroupName);
                tracingParameters.Add("siteName", siteName);
                tracingParameters.Add("name", name);
                tracingParameters.Add("updateSeen", updateSeen);
                tracingParameters.Add("apiVersion", apiVersion);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "GetRuleDetailsByWebApp", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}").ToString();
            _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName));
            _url = _url.Replace("{siteName}", Uri.EscapeDataString(siteName));
            _url = _url.Replace("{name}", Uri.EscapeDataString(name));
            _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId));
            List<string> _queryParameters = new List<string>();
            if (updateSeen != null)
            {
                _queryParameters.Add(string.Format("updateSeen={0}", Uri.EscapeDataString(SafeJsonConvert.SerializeObject(updateSeen, this.Client.SerializationSettings).Trim('"'))));
            }
            if (apiVersion != null)
            {
                _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(apiVersion)));
            }
            if (_queryParameters.Count > 0)
            {
                _url += "?" + string.Join("&", _queryParameters);
            }
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
            {
                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString());
            }
            if (this.Client.AcceptLanguage != null)
            {
                if (_httpRequest.Headers.Contains("accept-language"))
                {
                    _httpRequest.Headers.Remove("accept-language");
                }
                _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
            }
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            }
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    CloudError _errorBody = SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex = new CloudException(_errorBody.Message);
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_httpResponse.Headers.Contains("x-ms-request-id"))
                {
                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
                }
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new AzureOperationResponse<RecommendationRule>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            if (_httpResponse.Headers.Contains("x-ms-request-id"))
            {
                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
            }
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    _result.Body = SafeJsonConvert.DeserializeObject<RecommendationRule>(_responseContent, this.Client.DeserializationSettings);
                }
                catch (JsonException ex)
                {
                    _httpRequest.Dispose();
                    if (_httpResponse != null)
                    {
                        _httpResponse.Dispose();
                    }
                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
                }
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.devgateway.ocds.persistence.mongo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonPropertyOrder({
        "ocid",
        "releases",
        "compiledRelease"
})
@Document
public class Record implements Identifiable {

    /**
     * Open Contracting ID
     *

     * A unique identifier that identifies the unique Open Contracting Process.
     * For more information see:
     * http://ocds.open-contracting.org/standard/r/1__0__0/en/key_concepts/
     * definitions/#contracting-process (Required)
     *
     */
    @JsonProperty("ocid")
    @Id
    private String ocid;
    /**
     * Linked releases
     *

     * A list of objects that identify the releases associated with this Open
     * Contracting ID. The releases MUST be sorted into date order in the array,
     * from oldest (at position 0) to newest (last). (Required)
     *
     */
    @JsonProperty("releases")
    private List<Release> releases = new ArrayList<Release>();

    /**
     * this NOT in the OCDS standard, but the standard uses "oneOf" which is
     * poorly supported presently
     *
     * @see https://github.com/joelittlejohn/jsonschema2pojo/wiki/Proposal-for-
     *      allOf,-anyOf-and-oneOf
     */

    private List<ReleaseReference> releaseReferences = new ArrayList<ReleaseReference>();

    /**
     * Schema for an Open Contracting Release
     *

     *
     *
     */
    @JsonProperty("compiledRelease")
    @DBRef
    private Release compiledRelease;

    /**
     * Open Contracting ID
     *

     * A unique identifier that identifies the unique Open Contracting Process.
     * For more information see:
     * http://ocds.open-contracting.org/standard/r/1__0__0/en/key_concepts/
     * definitions/#contracting-process (Required)
     *
     * @return The ocid
     */
    @JsonProperty("ocid")
    public String getOcid() {
        return ocid;
    }

    /**
     * Open Contracting ID
     *

     * A unique identifier that identifies the unique Open Contracting Process.
     * For more information see:
     * http://ocds.open-contracting.org/standard/r/1__0__0/en/key_concepts/
     * definitions/#contracting-process (Required)
     *
     * @param ocid
     *            The ocid
     */
    @JsonProperty("ocid")
    public void setOcid(final String ocid) {
        this.ocid = ocid;
    }

    @JsonProperty("releaseReferences")
    public List<ReleaseReference> getReleaseReferences() {
        return releaseReferences;
    }

    @JsonProperty("releaseReferences")
    public void setReleaseReferences(final List<ReleaseReference> releaseReferences) {
        this.releaseReferences = releaseReferences;
    }

    /**
     * Linked releases
     *

     * A list of objects that identify the releases associated with this Open
     * Contracting ID. The releases MUST be sorted into date order in the array,
     * from oldest (at position 0) to newest (last). (Required)
     *
     * @return The releases
     */
    @JsonProperty("releases")
    public List<Release> getReleases() {
        return releases;
    }

    /**
     * Linked releases
     *

     * A list of objects that identify the releases associated with this Open
     * Contracting ID. The releases MUST be sorted into date order in the array,
     * from oldest (at position 0) to newest (last). (Required)
     *
     * @param releases
     *            The releases
     */
    @JsonProperty("releases")
    public void setReleases(final List<Release> releases) {
        this.releases = releases;
    }

    /**
     * Schema for an Open Contracting Release
     *

     *
     *
     * @return The compiledRelease
     */
    @JsonProperty("compiledRelease")
    public Release getCompiledRelease() {
        return compiledRelease;
    }

    /**
     * Schema for an Open Contracting Release
     *

     *
     *
     * @param compiledRelease
     *            The compiledRelease
     */
    @JsonProperty("compiledRelease")
    public void setCompiledRelease(final Release compiledRelease) {
        this.compiledRelease = compiledRelease;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().
                append(ocid).
                append(releases).
                append(compiledRelease).toHashCode();
    }

    @Override
    public boolean equals(final Object other) {
        if (other == this) {
            return true;
        }
        if (!(other instanceof Record)) {
            return false;
        }
        Record rhs = ((Record) other);
        return new EqualsBuilder().
                append(ocid, rhs.ocid).
                append(releases, rhs.releases).
                append(compiledRelease, rhs.compiledRelease).isEquals();
    }

    @Override
    public Serializable getIdProperty() {
        return ocid;
    }

}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports["default"] = undefined;

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _index = require('../list/index.web');

var _index2 = _interopRequireDefault(_index);

var _Checkbox = require('./Checkbox.web');

var _Checkbox2 = _interopRequireDefault(_Checkbox);

var _omit = require('omit.js');

var _omit2 = _interopRequireDefault(_omit);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var __assign = undefined && undefined.__assign || Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) {
            if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
    }
    return t;
};

var ListItem = _index2["default"].Item;
function noop() {}

var CheckboxItem = function (_React$Component) {
    (0, _inherits3["default"])(CheckboxItem, _React$Component);

    function CheckboxItem() {
        (0, _classCallCheck3["default"])(this, CheckboxItem);
        return (0, _possibleConstructorReturn3["default"])(this, _React$Component.apply(this, arguments));
    }

    CheckboxItem.prototype.render = function render() {
        var _classNames,
            _this2 = this;

        var _props = this.props,
            prefixCls = _props.prefixCls,
            listPrefixCls = _props.listPrefixCls,
            className = _props.className,
            children = _props.children,
            disabled = _props.disabled,
            _props$checkboxProps = _props.checkboxProps,
            checkboxProps = _props$checkboxProps === undefined ? {} : _props$checkboxProps;

        var wrapCls = (0, _classnames2["default"])((_classNames = {}, (0, _defineProperty3["default"])(_classNames, prefixCls + '-item', true), (0, _defineProperty3["default"])(_classNames, prefixCls + '-item-disabled', disabled === true), (0, _defineProperty3["default"])(_classNames, className, className), _classNames));
        var otherProps = (0, _omit2["default"])(this.props, ['listPrefixCls', 'disabled', 'checkboxProps']);
        if (disabled) {
            delete otherProps.onClick;
        } else {
            otherProps.onClick = otherProps.onClick || noop;
        }
        var extraProps = {};
        ['name', 'defaultChecked', 'checked', 'onChange', 'disabled'].forEach(function (i) {
            if (i in _this2.props) {
                extraProps[i] = _this2.props[i];
            }
        });
        return _react2["default"].createElement(ListItem, __assign({}, otherProps, { prefixCls: listPrefixCls, className: wrapCls, thumb: _react2["default"].createElement(_Checkbox2["default"], __assign({}, checkboxProps, extraProps)) }), children);
    };

    return CheckboxItem;
}(_react2["default"].Component);

exports["default"] = CheckboxItem;

CheckboxItem.defaultProps = {
    prefixCls: 'am-checkbox',
    listPrefixCls: 'am-list'
};
module.exports = exports['default'];


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

use app\models\general\GeneralLabel;
use app\models\general\GeneralMessage;

/* @var $this yii\web\View */
/* @var $searchModel frontend\models\PenilaianPrestasiAtletLatihanSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = GeneralLabel::jadual_latihan_periodisasi_jurulatih;
$this->params['breadcrumbs'][] = $this->title;
?>

    <?php
        $template = '{view}';

        // Update Access
        if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['update'])){
            $template .= ' {update}';
        }

        // Delete Access
        if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['delete'])){
            $template .= ' {delete}';
        }
    ?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?php if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['create'])): ?>

            <?= Html::a(GeneralLabel::createTitle . ' ' . GeneralLabel::jadual_latihan_periodisasi_jurulatih,
                    ['create', 'penilaian_prestasi_atlet_sasaran_id' =>$penilaian_prestasi_atlet_sasaran_id, 'atlet_id' =>$atlet_id, 'penilaian_pestasi_id' =>$penilaian_pestasi_id], ['class' => 'btn btn-success']) ?>

    <?php endif; ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            //'tbl_penilaian_prestasi_atlet_latihan_id',
            //'penilaian_pestasi_id',
            'tarikh_mula',
            'tarikh_tamat',
            'tempoh',
            'tempat',
            // 'keterangan:ntext',
            // 'session_id',
            // 'created_by',
            // 'updated_by',
            // 'created',
            // 'updated',

            //['class' => 'yii\grid\ActionColumn'],
            ['class' => 'yii\grid\ActionColumn',
                'buttons' => [
                    'delete' => function ($url, $model) {
                        return Html::a('',
                        ['delete', 'id' => $model->tbl_penilaian_prestasi_atlet_latihan_id, 'penilaian_prestasi_atlet_sasaran_id' =>$model->penilaian_prestasi_atlet_sasaran_id, 'atlet_id' =>$model->atlet_id, 'penilaian_pestasi_id' =>$model->penilaian_pestasi_id],
                        [
                            'title' => Yii::t('yii', 'Delete'),
                            'data-confirm' => GeneralMessage::confirmDelete,
                            'data-method' => 'post',
                        ]);

                    },
                ],
                'template' => $template,
            ],
        ],
    ]); ?>


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../../libc/fn.open64.html">

Redirecting to ../../../../libc/fn.open64.html...


text:
var spawn = require('child_process').spawn,
    fs    = require('fs'),
    path  = require('path'),
    _     = require('lodash'),
    async = require('async'),
    chalk = require('chalk'),
    stat  = require('./stat'),
    rpc   = require('pm2-axon-rpc'),
    axon  = require('pm2-axon');

/**
 * Forever lib.
 * @type {{}}
 */
var pm = module.exports = {};

var re_blank      = /^[\s\r\t]*$/,
    allowedEvents = ['start', 'restart', 'exit', 'online'];

/**
 * Subscribe event BUS.
 * @param {String} sockPath
 * @param {Function} cb
 */
pm.sub = function(sockPath, cb){
  var sub = axon.socket('sub-emitter');
  sub.connect(sockPath);

  // Once awake from sleeping.
  sub.on('log:*', function(e, d){
    // Do not subscribe it.
    sub.off('log:*');
    d.event = 'awake';
    cb(d);
  });

  // Process events.
  sub.on('process:*', function(e, d){
    if (d && !!~allowedEvents.indexOf(d.event)) {
      cb(d);
    }
  });
};

/**
 * Get PM2 version.
 * @param {String} sockPath
 * @param {Function} cb
 */
pm.version = function(sockPath, cb){
  pm._rpc({
    sockPath: sockPath,
    events  : [
      ['getVersion', {}, cb]
    ]
  });
};

/**
 * List available processes.
 * @param {String} sockPath
 * @param {Function} cb
 */
pm.list = function(sockPath, cb){
  if (!fs.existsSync(sockPath)) {
    return cb(null, []);
  }
  pm._rpc({
    sockPath: sockPath,
    events  : [
      ['getMonitorData', {}, cb]
    ]
  });
};

/**
 * Execute remote RPC events.
 * @param {Object} opts including:
 *  {String} sockPath
 *  {Object} args
 *  {Object} events
 *    key: event name
 *    value: callback function
 * @private
 */
pm._rpc = function(opts){
  var req = axon.socket("req"),
      rpc_sock = req.connect(opts.sockPath),
      rpc_client = new rpc.Client(req);

  // Connect RPC server.
  rpc_sock.on('connect', function(){
    // Execute request.
    var waterfalls = opts.events.map(function(event){
      return function(next){
        var cb = typeof event[event.length - 1] == 'function' ? event.pop() : null;
        if (cb) {
          event.push(function(){
            // Wrap arguments, no [].slice (avoid leak)!!!
            var args = new Array(arguments.length);
            for (var i = 0; i < args; i++) {
              args[i] = arguments[i];
            }
            cb.apply(null, arguments);
            next();
          });
        }
        rpc_client.call.apply(rpc_client, event);
        if (!cb) {
          next();
        }
      };
    });
    async.waterfall(waterfalls, function(err, res){
      rpc_sock.close();
    });
  });
};

/**
 * Find process by pm_id.
 * @param {String} sockPath
 * @param {String} id
 * @param {Function} cb
 * @private
 */
pm._findById = function(sockPath, id, cb){
  pm.list(sockPath, function(err, procs){
    if (err) {
      return cb(err);
    }
    if (!procs || procs.length == 0) {
      return cb(new Error('No PM2 process running, the sockPath is "' + sockPath + '", please make sure it is existing!'));
    }

    var proc = _.find(procs, function(p){
      return p && p.pm_id == id;
    });

    if (!proc) {
      return cb(new Error('Cannot find pm process by pm_id: ' + id));
    }

    cb(null, proc);
  }, true);
}

/**
 * Trigger actions of process by pm_id.
 * @param {String} sockPath
 * @param {String} id
 * @param {Function} cb
 */
pm.action = function(sockPath, action, id, cb){
  if (id == 'all') {
    pm.list(sockPath, function(err, procs){
      if (err) {
        return cb(err);
      }
      if (!procs || procs.length == 0) {
        return cb(new Error('No PM2 process running, the sockPath is "' + sockPath + '", please make sure it is existing!'));
      }

      async.map(procs, function(proc, next){
        pm._actionByPMId(sockPath, proc, action, next.bind(null, null));
      }, cb);
    });
  } else {
    pm._findById(sockPath, id, function(err, proc){
      if (err) {
        return cb(err);
      }
      pm._actionByPMId(sockPath, proc, action, cb);
    });
  }
};

/**
 * Trigger actions of process by pm_id.
 * @param {String} sockPath
 * @param {Object} proc
 * @param {String} action
 * @param {Function} cb
 * @private
 */
pm._actionByPMId = function(sockPath, proc, action, cb){
  var noBusEvent = action == 'delete' && proc.pm2_env.status != 'online',
      pm_id = proc.pm_id;

  action += 'ProcessId';
  var watchEvent = ['stopWatch', action, {id: pm_id}, function(err, success){
  }];

  if (!!~['restart'].indexOf(action)) {
    watchEvent.splice(0, 1, 'restartWatch');
    watchEvent.pop();
  }

  var actionEvent = [action, pm_id, function(err, sock){
    cb(err, noBusEvent);
  }];

  if (action == 'restartProcessId') {
    actionEvent.splice(1, 1, {id: pm_id});
  }

  pm._rpc({
    sockPath: sockPath,
    events  : [
      watchEvent,
      actionEvent
    ]
  });
};

/**
 * Tail logs.
 * @param {Object} opts
 * @param {Function} each Iterator
 * @param {Function} cb
 * @returns {*}
 */
pm.tail = function(opts, each, cb){
  // Fetch the proccess that we need.
  pm._findById(opts.sockPath, opts.pm_id, function(err, proc){
    if (err) {
      return cb(err);
    }
    proc.pm2_log = opts.logPath;
    // Tail logs.
    var tails = pm._tailLogs(proc, each);
    cb(null, tails);
  });
};
/**
 * Use linux `tail` command to grep logs.
 * @param {Object} proc
 * @param {Function} cb
 * @returns {*}
 * @private
 */
pm._tailLogs = function(proc, cb){
  var logs = [['PM2', proc.pm2_log]];
  if (proc.pm_log_path) {
    logs.push(['entire', proc.pm2_env.pm_log_path]);
  } else {
    var paths = [];
    if (proc.pm2_env.pm_out_log_path) {
      paths.push(['out', proc.pm2_env.pm_out_log_path]);
    }
    if (proc.pm2_env.pm_err_log_path) {
      paths.push(['err', proc.pm2_env.pm_err_log_path]);
    }

    paths = paths.sort(function(a, b) {
      return (fs.existsSync(a[1]) ? fs.statSync(a[1]).mtime.valueOf() : 0) -
        (fs.existsSync(b[1]) ? fs.statSync(b[1]).mtime.valueOf() : 0);
    });
    logs = logs.concat(paths);
  }

  var tails = [];
  (function tailLog(ls){
    var log = ls.shift();
    if (!log) {
      return;
    }
    var logPath = log[1];
    if (!fs.existsSync(logPath)) {
      return;
    }
    var key = log[0],
        prefix = chalk[key == 'err' ? 'red' : 'green'].bold('[' + key + ']');

    var tail = spawn('tail', ['-f', '-n', 10, logPath], {
      killSignal: 'SIGTERM',
      stdio     : [null, 'pipe', 'pipe']
    });

    // Use utf8 encoding.
    tail.stdio.forEach(function(stdio){
      stdio.setEncoding('utf8');
    });

    // stdout.
    tail.stdout.on('data', function(data){
      var lines = [], _lines = data.split(/\n/);
      _lines.forEach(function(line){
        if (!re_blank.test(line)) {
          lines.push(prefix + ' ' + line);
        }
      });
      if (lines.length > 0) {
        cb(null, lines);
      }
    });

    // handle error.
    tail.stderr.on('data', function(data){
      tail.disconnect();
      cb(new Error(data.toString().replace(/\n/, '')));
    });
    tails.push(tail);
    tailLog(ls);
  })(logs);
  return tails;
};


text:
<?php

namespace Kanboard\Plugin\Mailgun\Controller;

use Kanboard\Controller\BaseController;
use Kanboard\Plugin\Mailgun\EmailHandler;

/**
 * Webhook Controller
 *
 * @package  mailgun
 * @author   Frederic Guillot
 */
class WebhookController extends BaseController
{
    /**
     * Handle Mailgun webhooks
     *
     * @access public
     */
    public function receiver()
    {
        $this->checkWebhookToken();

        $handler = new EmailHandler($this->container);
        $this->response->text($handler->receiveEmail($_POST) ? 'PARSED' : 'IGNORED');
    }
}


text:
/* tslint:disable:no-unused-variable */
import {TestBed, inject} from '@angular/core/testing';
import {AuthentificationService} from './authentification.service';
import {UserService} from '../../../user/service/user.service';
import {HttpClientModule} from '@angular/common/http';

describe('Service: Authenticate', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [
        AuthentificationService,
        UserService],
      imports: [
        HttpClientModule
      ]
    });
  });

  it('should ...', inject([AuthentificationService], (service: AuthentificationService) => {
    expect(service).toBeTruthy();
  }));
});


text:
/*
* This software was developed as part of the
* EC FP7 funded project Adept (Project ID: 610490)
* www.adept-project.eu
*/

/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */

/*     http://www.apache.org/licenses/LICENSE-2.0 */

/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */

#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <limits.h>
#include <sys/utsname.h>

#include "level0.h"

void usage();
void info();

int main(int argc, char **argv){

  int c;

  char *bench = "basic_op";
  unsigned long rep = ULONG_MAX;
  char *op  = "+";
  char *dt = "int";

  static struct option option_list[] =
    { {"bench", required_argument, NULL, 'b'},
      {"reps", required_argument, NULL, 'r'},
      {"op", required_argument, NULL, 'o'},
      {"dtype", required_argument, NULL, 'd'},
      {"info", no_argument, NULL, 'i'},
      {"help", no_argument, NULL, 'h'},
      {0, 0, 0, 0}
    };

  while((c = getopt_long(argc, argv, "b:r:o:d:ih", option_list, NULL)) != -1){
    switch(c){
    case 'b':
      bench = optarg;
      printf("Benchmark is %s.\n", bench);
      break;
    case 'r':
      rep = atol(optarg);
      printf("Number of repetitions %lu.\n", rep);
      break;
    case 'o':
      op = optarg;
      printf("Operation %s\n", op);
      break;
    case 'd':
      dt = optarg;
      printf("Data type is %s\n", dt);
      break;
    case 'i':
      info();
      return 0;
    case 'h':
      usage();
      return 0;
    default:
      printf("Undefined.\n");
      return 0;
    }
  }

  bench_level0(bench, rep, op, dt);

  return 0;

}

void usage(){
  printf("Usage for ASSEMBLER MICRO benchmarks:\n\n");
  printf("\t -b, --bench NAME \t name of the benchmark - possible values are basic_op.\n");
  printf("\t -r, --reps N \t\t number of repetitions. Default value is ULONG_MAX.\n");
  printf("\t -o, --op TYPE \t\t TYPE of operation.\n");
  printf("\t\t\t\t --> for basic_op benchmark: \"+\", \"-\", \"*\" and \"/\". Default is \"+\".\n");
  printf("\t -d, --dtype DATATYPE \t DATATYPE to be used - possible values are int, long, float, double. Default is int.\n");
  printf("\t -i, --info \t\t Print out system information such as current CPU frequency, core counts, cache size, plus datatype sizes.\n");
  printf("\t -h, --help \t\t Displays this help.\n");
  printf("\n\n");
}

void info(){
#ifdef __linux__
  printf("\n***************************************\n");
  system("lscpu");
  printf("***************************************\n");
#endif
  printf("\n***************************************\n");
  printf("Datatype sizes on this platform are\n");
  printf("\n");
  printf("Size of int: \t\t%lu bytes\n", sizeof(int));
  printf("Size of long: \t\t%lu bytes\n", sizeof(long));
  printf("Size of float: \t\t%lu bytes\n", sizeof(float));
  printf("Size of double: \t%lu bytes\n", sizeof(double));
  printf("***************************************\n");
  printf("\n\n");
}


text:
package org.faker.data

import org.faker.FakerLocale

/**
 * Provides access to the fake data definitions in the various locale dependent files.
 *
 * {{{
 * scala> val data = new Faker.Data
 * data: org.faker.Faker.Data = org.faker.Faker$Data@dbedbf6
 *
 * scala> data.get("name.name")
 * res3: Option[Seq[String]] = Some(Buffer(#{prefix} #{first_name} #{last_name}, ...)
 *
 * scala> data.getSeq("company.buzzwords")
 * res4: Option[Seq[Seq[String]]] = Some(ArrayBuffer(Buffer(Adaptive, Advanced, Ameliorated, ...))
 * }}}
 */
class Data {
  val allLocales = FakerLocale.allLocales.map(_.localeKey)

  val localeDataMap = initLocaleDataMap

  private def initLocaleDataMap = allLocales.map {
    locale =>
      locale -> LocaleData(locale)
  }.toMap

  private def localeDataKey(locale: String, key: String) = s"$locale.faker.$key"

  /**
   * Given the data´s key returns a list of alternatives for fake data.
   * See [[LocaleData.get( )]] for details.
   *
   * @param key the datas key without the prefix `<locale>`.`faker`
   * @param locale - the locale to use (defaults to FakerLocale.default)
   * @return The sequence of alternatives or `None`
   */
  def get(key: String)(implicit locale: FakerLocale = FakerLocale.default): Option[Seq[String]] = {
    /*
     * the stream is evaluated lazily. So if a match is found in the 'de' locale,
     * the 'en' locale search will not be executed
     */
    val stream: Stream[Seq[String]] = for {
      locale <- locale.locales.toStream
      localeData <- localeDataMap.get(locale)
      data <- localeData.get(localeDataKey(locale, key))
    } yield data
    stream.headOption
  }

  /**
   * given a key returns a sequence of sequences to generate fake data.
   *
   * an example is [[org.faker.Company.catchPhrase]] which uses the key 'company.buzzwords' to generate
   * phases like "Front-line grid-enabled protocol" from three sequences (one for each word).
   *
   * @param key the datas key without the prefix `<locale>`.`faker`
   * @param locale - the locale to use (defaults to FakerLocale.default)
   * @return the sequence of sequences or `None`
   */
  def getSeq(key: String)(implicit locale: FakerLocale = FakerLocale.default): Option[Seq[Seq[String]]] = {
    /*
     * the stream is evaluated lazily. So if a match is found in the 'de' locale,
     * the 'en' locale search will not be executed
     */
    val stream: Stream[Seq[Seq[String]]] = for {
      locale <- locale.locales.toStream
      localeData <- localeDataMap.get(locale)
      data <- localeData.getSeq(localeDataKey(locale, key))
    } yield data
    stream.headOption
  }
}

object Data {
  val data = new Data()

  def get(key: String)(implicit locale: FakerLocale = FakerLocale.default): Option[Seq[String]] = data.get(key)

  def getSeq(key: String)(implicit locale: FakerLocale = FakerLocale.default): Option[Seq[Seq[String]]] = data.getSeq(key)
}


text:
/*	$NetBSD: int_types.h,v 1.7 2014/07/25 21:43:13 joerg Exp $	*/

/*-
 * Copyright (c) 1990 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	from: @(#)types.h	7.5 (Berkeley) 3/9/91
 */

#ifndef	_AMD64_INT_TYPES_H_
#define	_AMD64_INT_TYPES_H_

#ifdef __UINTPTR_TYPE__
#include <sys/common_int_types.h>
#else

#ifdef __x86_64__

#include <sys/cdefs.h>

/*
 * 7.18.1 Integer types
 */

/* 7.18.1.1 Exact-width integer types */

typedef	signed char		 __int8_t;
typedef	unsigned char		__uint8_t;
typedef	short int		__int16_t;
typedef	unsigned short int     __uint16_t;
typedef	int			__int32_t;
typedef	unsigned int	       __uint32_t;
typedef	long int		__int64_t;
typedef	unsigned long int	__uint64_t;

#define	__BIT_TYPES_DEFINED__

/* 7.18.1.4 Integer types capable of holding object pointers */

typedef	long		       __intptr_t;
typedef	unsigned long	      __uintptr_t;

#else	/*	__x86_64__	*/

#include <i386/int_types.h>

#endif	/*	__x86_64__	*/

#endif

#endif	/* !_AMD64_INT_TYPES_H_ */


text:
package LWP::Authen::Ntlm;

use strict;
use vars qw/$VERSION/;

$VERSION = '5.810';

use Authen::NTLM "1.02";
use MIME::Base64 "2.12";

sub authenticate {
	LWP::Debug::debug("authenticate() has been called");
    my($class, $ua, $proxy, $auth_param, $response,
       $request, $arg, $size) = @_;

    my($user, $pass) = $ua->get_basic_credentials($auth_param->{realm},
                                                  $request->url, $proxy);

    unless(defined $user and defined $pass) {
		LWP::Debug::debug("No username and password available from get_basic_credentials().  Returning unmodified response object");
		return $response;
	}

	if (!$ua->conn_cache()) {
		LWP::Debug::debug("Keep alive not enabled, emitting a warning");
		warn "The keep_alive option must be enabled for NTLM authentication to work.  NTLM authentication aborted.\n";
		return $response;
	}

	my($domain, $username) = split(/\\/, $user);

	ntlm_domain($domain);
	ntlm_user($username);
	ntlm_password($pass);

    my $auth_header = $proxy ? "Proxy-Authorization" : "Authorization";

	# my ($challenge) = $response->header('WWW-Authenticate');
	my $challenge;
	foreach ($response->header('WWW-Authenticate')) {
		last if /^NTLM/ && ($challenge=$_);
	}

	if ($challenge eq 'NTLM') {
		# First phase, send handshake
		LWP::Debug::debug("In first phase of NTLM authentication");
	    my $auth_value = "NTLM " . ntlm();
		ntlm_reset();

	    # Need to check this isn't a repeated fail!
	    my $r = $response;
		my $retry_count = 0;
	    while ($r) {
			my $auth = $r->request->header($auth_header);
			++$retry_count if ($auth && $auth eq $auth_value);
			if ($retry_count > 2) {
				    # here we know this failed before
				    $response->header("Client-Warning" =>
						      "Credentials for '$user' failed before");
				    return $response;
			}
			$r = $r->previous;
	    }

	    my $referral = $request->clone;
	    $referral->header($auth_header => $auth_value);
		LWP::Debug::debug("Returning response object with auth header:\n$auth_header $auth_value");
	    return $ua->request($referral, $arg, $size, $response);
	}

	else {
		# Second phase, use the response challenge (unless non-401 code
		#  was returned, in which case, we just send back the response
		#  object, as is
		LWP::Debug::debug("In second phase of NTLM authentication");
		my $auth_value;
		if ($response->code ne '401') {
			LWP::Debug::debug("Response from server was not 401 Unauthorized, returning response object without auth headers");
			return $response;
		}
		else {
			my $challenge;
			foreach ($response->header('WWW-Authenticate')) {
				last if /^NTLM/ && ($challenge=$_);
			}
			$challenge =~ s/^NTLM //;
			ntlm();
			$auth_value = "NTLM " . ntlm($challenge);
			ntlm_reset();
		}

	    my $referral = $request->clone;
	    $referral->header($auth_header => $auth_value);
		LWP::Debug::debug("Returning response object with auth header:\n$auth_header $auth_value");
	    my $response2 = $ua->request($referral, $arg, $size, $response);
		return $response2;
	}
}

1;

=head1 NAME

LWP::Authen::Ntlm - Library for enabling NTLM authentication (Microsoft) in LWP

=head1 SYNOPSIS

 use LWP::UserAgent;
 use HTTP::Request::Common;
 my $url = 'http://www.company.com/protected_page.html';

 # Set up the ntlm client and then the base64 encoded ntlm handshake message
 my $ua = new LWP::UserAgent(keep_alive=>1);
 $ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword');

 $request = GET $url;
 print "--Performing request now...-----------\n";
 $response = $ua->request($request);
 print "--Done with request-------------------\n";

 if ($response->is_success) {print "It worked!->" . $response->code . "\n"}
 else {print "It didn't work!->" . $response->code . "\n"}

=head1 DESCRIPTION

C<LWP::Authen::Ntlm> allows LWP to authenticate against servers that are using the
NTLM authentication scheme popularized by Microsoft.  This type of authentication is
common on intranets of Microsoft-centric organizations.

The module takes advantage of the Authen::NTLM module by Mark Bush.  Since there
is also another Authen::NTLM module available from CPAN by Yee Man Chan with an
entirely different interface, it is necessary to ensure that you have the correct
NTLM module.

In addition, there have been problems with incompatibilities between different
versions of Mime::Base64, which Bush's Authen::NTLM makes use of.  Therefore, it is
necessary to ensure that your Mime::Base64 module supports exporting of the
encode_base64 and decode_base64 functions.

=head1 USAGE

The module is used indirectly through LWP, rather than including it directly in your
code.  The LWP system will invoke the NTLM authentication when it encounters the
authentication scheme while attempting to retrieve a URL from a server.  In order
for the NTLM authentication to work, you must have a few things set up in your
code prior to attempting to retrieve the URL:

=over 4

=item *

Enable persistent HTTP connections

To do this, pass the "keep_alive=>1" option to the LWP::UserAgent when creating it, like this:

    my $ua = new LWP::UserAgent(keep_alive=>1);

=item *

Set the credentials on the UserAgent object

The credentials must be set like this:

   $ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword');

Note that you cannot use the HTTP::Request object's authorization_basic() method to set
the credentials.  Note, too, that the 'www.company.com:80' portion only sets credentials
on the specified port AND it is case-sensitive (this is due to the way LWP is coded, and
has nothing to do with LWP::Authen::Ntlm)

=back

If you run into trouble and need help troubleshooting your problems, try enabling LWP
debugging by putting this line at the top of your code:

    use LWP::Debug qw(+);

You should get copious debugging output, including messages from LWP::Authen::Ntlm itself.

=head1 AVAILABILITY

General queries regarding LWP should be made to the LWP Mailing List.

Questions specific to LWP::Authen::Ntlm can be forwarded to jtillman@bigfoot.com

=head1 COPYRIGHT

Copyright (c) 2002 James Tillman. All rights reserved. This
program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=head1 SEE ALSO

L<LWP>, L<LWP::UserAgent>, L<lwpcook>.


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js
 * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within a FunctionExpression)
 * @noStrict
 * @negative TypeError
 */

var f1 = function () {
    var f = function () {
        "use strict";
        return gNonStrict();
    }
    return f();
}
f1();

function gNonStrict() {
    return gNonStrict.caller || gNonStrict.caller.throwTypeError;
}


text:
sudo apt-get install -y -q btrfs-tools libsystemd-journal-dev apparmor debhelper dh-apparmor dh-systemd libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config "linux-image-extra-$(uname -r)"

# docker key
if [ ! -f /etc/apt/sources.list.d/docker.list ]; then
    sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
    sudo apt-get update -y -q
    sudo apt-get install -y -q docker-engine
fi

# docker-machine
if [ ! -f /usr/local/bin/docker-machine ]; then
    curl -L "https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-$(uname -s)-$(uname -m)" > docker-machine
    chmod +x docker-machine
    sudo mv docker-machine /usr/local/bin/docker-machine
fi

# add vagrant to docker for dockering
sudo usermod -aG docker vagrant


text:
#pragma once

namespace WTF {

template<typename T>
struct IndexKeyType {
    static size_t index(const T& key) { return key.index(); }
};

template<typename T>
struct IndexKeyType<T*> {
    static size_t index(T* key) { return key->index(); }
};

} // namespace WTF


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

<title>Uses of Package org.jenkinsci.plugins.spokehubintegration.command</title>
<meta name="date" content="2016-03-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
org.jenkinsci.plugins.spokehubintegration.command

Packages that use org.jenkinsci.plugins.spokehubintegration.command

Package
Description

org.jenkinsci.plugins.spokehubintegration.command

Classes in org.jenkinsci.plugins.spokehubintegration.command used by org.jenkinsci.plugins.spokehubintegration.command

Class and Description

Command

Command interface for command execution.

JenkinsReceiver

Class that executes commands.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?php

namespace Zhiyi\Plus\Models;

use Illuminate\Database\Eloquent\Model;

class UserCount extends Model
{
    protected $guarded = ['total'];
}


text:
namespace School
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class School
    {
        private ICollection<Student> students;
        private ICollection<Course> courses;
        private string name;

        public School(string name, ICollection<Course> courses)
        {
            this.Name = name;
            this.students = new List<Student>();
            this.Courses = courses;
        }

        public string Name
        {
            get
            {
                return this.name;
            }

            private set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentNullException("The name of the school can't be null or empty");
                }

                this.name = value;
            }
        }

        public ICollection<Student> Students
        {
            get
            {
                return this.students;
            }
        }

        public ICollection<Course> Courses
        {
            get
            {
                return this.courses;
            }

            private set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("The courses in the school cannot be null!");
                }

                this.courses = value;
            }
        }

        public void AddStudent(Student student)
        {
            if (student == null)
            {
                throw new ArgumentNullException("The student can' be null!");
            }

            if (this.Students.Any(st => st.Id == student.Id))
            {
                throw new InvalidOperationException("There already is student with this ID");
            }

            this.students.Add(student);
        }
    }
}


text:
package gw.lang.parser;

public interface ITypedSymbol extends IFunctionSymbol {
  SymbolType getSymbolType();
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id$ -->
<!--
   Copyright 2004 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<mock-test>
    <context name="c2" root="context2"/>

  	<servlet name="app" class="org.apache.tapestry.ApplicationServlet">
  		<init-parameter
  			name="org.apache.tapestry.application-specification"
  			value="/org/apache/tapestry/junit/mock/c2/C2.application"/>
  	</servlet>

    <request>
    	<parameter name="service" value="page/Relative"/>

		<assert-output name="Title">
<![CDATA[
<title>Relative Page</title>
]]>
		</assert-output>

		<assert-output name="Text from page">
This page's specification is located relative to the application specification.
		</assert-output>

	</request>

</mock-test>


text:
namespace Microsoft.Azure.Management.StorSimple1200Series.Models
{
    public partial class Manager
    {
        public Manager(
            StorSimpleManagementClient client,
            string resourceGroupName,
            string managerName) : base(client, resourceGroupName, managerName)
        {
        }
    }
}


text:
using System;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace SolutionRenamer.Win.Logic.Logging
{
    internal class TextBoxLogger : ILogger
    {
        private static Image _image;
        private static Label _label;
        private static TextBox _textbox;
        private BitmapImage _infoBitmap = new BitmapImage(new Uri(@"/Images/info-128.png", UriKind.Relative));
        private string _lastMessage;
        private DateTime _lastUpdateDate;
        private BitmapImage _warnBitmap = new BitmapImage(new Uri(@"/Images/warn-128.png", UriKind.Relative));

        private TextBoxLogger()
        {
        }

        public static ILogger Get()
        {
            if (_label == null || _textbox == null)
            {
                throw new InvalidOperationException("First initialize the logger with a textbox and label to log to");
            }

            return new TextBoxLogger();
        }

        public static void Initialize(TextBox textbox, Label label, Image image)
        {
            if (textbox == null)
            {
                throw new ArgumentNullException(nameof(textbox));
            }

            if (label == null)
            {
                throw new ArgumentNullException(nameof(label));
            }

            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            _textbox = textbox;
            _label = label;
            _image = image;
        }

        public void WriteInfo(string message)
        {
            var printMessage = $"{DateTime.Now}: {message}{Environment.NewLine}";

            ShowMessage(message, printMessage, _infoBitmap);
        }

        public void WriteWarning(string message)
        {
            var printMessage = $"{DateTime.Now}: {message}{Environment.NewLine}";

            ShowMessage(message, printMessage, _warnBitmap);
        }

        public void WriteWarning(string message, Exception ex)
        {
            var printMessage = $"{DateTime.Now}: {message}{Environment.NewLine}{ex.ToString()}";

            ShowMessage(message, printMessage, _warnBitmap);
        }

        private void ShowMessage(string message, string printMessage, BitmapImage image)
        {
            _textbox.Text += printMessage;
            if (_lastUpdateDate < DateTime.Now.AddSeconds(-1) && _textbox.LineCount > 0)
            {
                _textbox.ScrollToLine(_textbox.LineCount - 1);
                _lastUpdateDate = DateTime.Now;
            }

            _label.Content = message;
            _image.Source = image;
            _lastMessage = printMessage;
        }
    }
}


text:
package org.spongepowered.common.data.builder.block.state;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.data.DataView;
import org.spongepowered.api.data.Queries;
import org.spongepowered.api.data.persistence.DataContentUpdater;
import org.spongepowered.api.data.persistence.InvalidDataException;
import org.spongepowered.common.data.util.DataQueries;
import org.spongepowered.common.data.util.DataVersions;

import java.util.Optional;

public class SpongeBlockStateMetaContentUpdater implements DataContentUpdater {

    @Override
    public int getInputVersion() {
        return DataVersions.BlockState.BLOCK_TYPE_WITH_DAMAGE_VALUE;
    }

    @Override
    public int getOutputVersion() {
        return DataVersions.BlockState.STATE_AS_CATALOG_ID;
    }

    @Override
    public DataView update(DataView content) {
        // Right, so we have to get the block type id
        final String blockTypeId = content.getString(DataQueries.BLOCK_TYPE).get();
        // Check if it's there....
        final Optional<BlockType> blockType = Sponge.getRegistry().getType(BlockType.class, blockTypeId);
        if (!blockType.isPresent()) {
            // sure, throw an exception to throw down the chain
            throw new InvalidDataException("Could not find a block type for the given id: " + blockTypeId);
        }
        // Get the meta, if it wasn't available, just default to the default block state.
        final int meta = content.getInt(DataQueries.BLOCK_STATE_UNSAFE_META).orElse(0);
        // Get the block type
        final BlockType type = blockType.get();
        // Cast to internal and get the block state from damage value, this is purely
        // implementation of minecraft, mods may change this in the future, not really known how
        // they will handle it?

        final IBlockState blockState = ((Block) type).getStateFromMeta(meta);
        // Now that we have the actual block state, delete the old data
        content.remove(DataQueries.BLOCK_TYPE);
        content.remove(DataQueries.BLOCK_STATE_UNSAFE_META);

        // Cast to the API state to get the id
        final BlockState apiState = (BlockState) blockState;
        // set the id
        content.set(DataQueries.BLOCK_STATE, apiState.getId());
        // set the version!!
        content.set(Queries.CONTENT_VERSION, 2);
        // Presto!
        return content;
    }
}


text:
#search_box_bg{width:714px;padding-left:50px;}
#search_box_bg label{padding-top:0px;color:#555;font-size:16px; float:left; width:80px; font-weight: bold;}
#search_textbox input{
    background : #eee;
    float:left;
    border : 1px solid #c6c6c6;
    margin : -5px 0 0 10px;
    width : 180px;
    height:22px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    padding: 4px 0 0 5px;
}

#search_textbox input:focus{
    background: #fff;
    border: 1px solid #9e0f15;
}

#information{min-height:100px;width:816px;margin:0px auto;padding-left:0px; margin-top:30px;}
#no_result{font-weight:bold;color:#b00}
#ajax_result {padding:10px 0 10px 0;width:204px;float:left;}
#ajax_result a{color:#000;font-weight:bold; text-decoration:none;}
#ajax_result a:hover{color:#9E0F15; text-decoration:underline;}

/* ALL STUDENT CSS */

#all_students{margin:0px; padding:0px; height:300px; width:725px; margin:20px 0 0 40px;}
#student_name{padding:10px 10px 10px 0;text-decoration:none;width:230px;float:left;background:#fff url(../../images/student_details/ajax_result_underline.jpg) bottom left no-repeat}
#student_name a {text-decoration:none;color:#000;font-weight:bold}
.students-on-one-line {
    background : #fff url(../../images/student_details/ajax_result_underline.jpg) bottom left repeat-x;
    overflow: auto;
    width:816px;
    margin-bottom: 20px;
}