text:
package org.intellij.ibatis.dom.converters;

import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.LocalQuickFixProvider;
import com.intellij.psi.*;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.xml.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;

/**
 * psi method converter
 *
 * @author jacky
 */
public abstract class PsiMethodConverter extends Converter<PsiMethod> implements CustomReferenceConverter<PsiMethod> {

    protected final static Object[] EMPTY_ARRAY = new Object[0];

    private final MethodAccepter myMethodAccepter;

    public PsiMethodConverter(MethodAccepter accepter) {
        myMethodAccepter = accepter;
    }

    public PsiMethodConverter() {
        this(new MethodAccepter());
    }

    protected static class MethodAccepter {
        public boolean accept(PsiMethod method) {
            return !method.isConstructor() &&
                    method.hasModifierProperty(PsiModifier.PUBLIC) &&
                    !method.hasModifierProperty(PsiModifier.STATIC);
        }
    }

    public PsiMethod fromString(@Nullable final String methodName, final ConvertContext context) {
        if (methodName == null || methodName.length() == 0) {
            return null;
        }
        final PsiClass psiClass = getPsiClass(context);
        if (psiClass != null) {
            final PsiMethod[] psiMethods = psiClass.findMethodsByName(methodName, true);
            if (psiMethods.length == 0) {
                return null;
            }
            final MethodAccepter accepter = getMethodAccepter(context, false);
            for (PsiMethod method : psiMethods) {
                if (accepter.accept(method)) {
                    return method;
                }
            }
            return psiMethods[0];
        } else {
            return null;
        }
    }

    public String toString(@Nullable final PsiMethod psiMethods, final ConvertContext context) {
        return null;
    }

    @Nullable
    protected abstract PsiClass getPsiClass(final ConvertContext context);

    protected MethodAccepter getMethodAccepter(ConvertContext context, final boolean forCompletion) {
        return myMethodAccepter;
    }

    protected Object[] getVariants(ConvertContext context) {
        final PsiClass psiClass = getPsiClass(context);
        if (psiClass == null) {
            return EMPTY_ARRAY;
        }
        final ArrayList<Object> result = new ArrayList<Object>();
        final MethodAccepter methodAccepter = getMethodAccepter(context, true);
        for (PsiMethod method : psiClass.getAllMethods()) {
            if (methodAccepter.accept(method)) {
                result.add(method);
            }
        }
        return ElementPresentationManager.getInstance().createVariants(result);
    }

    @NotNull
    public PsiReference[] createReferences(final GenericDomValue<PsiMethod> genericDomValue, final PsiElement element, final ConvertContext context) {

        return new PsiReference[]{new MyReference(element, genericDomValue, context)};
    }

    protected class MyReference extends PsiReferenceBase<PsiElement> implements LocalQuickFixProvider {
        private final GenericDomValue<PsiMethod> myGenericDomValue;
        private final ConvertContext myContext;

        public MyReference(final PsiElement element,
                           final GenericDomValue<PsiMethod> genericDomValue,
                           ConvertContext context) {
            super(element);
            myGenericDomValue = genericDomValue;
            myContext = context;
        }

        public Object[] getVariants() {
            return PsiMethodConverter.this.getVariants(myContext);
        }

        @Nullable
        public PsiElement resolve() {
            return myGenericDomValue.getValue();
        }

        public boolean isSoft() {
            return true;
        }

        public PsiElement bindToElement(final PsiElement element) throws IncorrectOperationException {
            assert element instanceof PsiMethod : "PsiMethod expected";
            final PsiMethod psiMethod = (PsiMethod) element;
            myGenericDomValue.setStringValue(psiMethod.getName());
            return psiMethod;
        }

        public LocalQuickFix[] getQuickFixes() {
            return PsiMethodConverter.this.getQuickFixes(myContext);
        }
    }

    public LocalQuickFix[] getQuickFixes(final ConvertContext context) {
        return new LocalQuickFix[0];
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package evenints;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 *
 * @author sanket
 */
public class EvenChecker implements Runnable{
    private IntGenerator gen;
    private final int id;
    public EvenChecker(IntGenerator g, int identity) {
        gen = g;
        id = identity;
    }
    @Override
    public void run() {
        while (!gen.isCanceled()) {
            int val = gen.next();
            if (val % 2 != 0) {
                System.out.println("id(" + id + ") " + val + " is not even...bail!");
                gen.cancel();
            }
        }
    }

    //method to test even checker
    public static void test(IntGenerator gp, int count) {
        System.out.println("Testing...");
        ExecutorService exec = Executors.newCachedThreadPool();
        for (int i=0; i < count ; i++) {
            exec.execute(new EvenChecker(gp, i));
        }
        exec.shutdown();
    }

}


text:
'use strict';

angular.module('angularApp')
  .controller('MainCtrl', function ($scope, $http, $q) {

    // Chart configuration
    $scope.kcalBreakdownChart = {
      options: {
       title: 'Calorie Breakdown'
      },
      type: 'PieChart',
      data: {
        rows: [],
        cols: [
          {
            id: "n", label: "Nutrient", type: "string"
          },
          {
            id: "p", label: "Percent", type: "number"
          }
        ]
      }
    };

    // This function is a replacement for $.ajax using the Angular $http service
    // It needs to have an abort() method because select2 will abort previous HTTP requests when
    // it sends new ones out
    var fetchFoods = function (queryParams) {
      var aborter = $q.defer();
      var req = $http.get("/api/foods", { params: queryParams.data, timeout: aborter.promise })
        .then(queryParams.success);
      req.abort = function() {
        aborter.resolve();
      };
      return req;
    };

    // Options for the food selector (using Select2). These options are identical to the non-Angular
    // version.
    $scope.foodSelectOptions = {
      minimumInputLength: 1,
      ajax: {
        data: function (term) {
          return { short_desc: term };
        },
        transport: fetchFoods,
        results: function (result) {
          return { results: _.map(result.data.foods, function(f) {
              f.text = f.short_desc;
              return f;
            })
          };
        }
      },
      initSelection : function (element, callback) {
        var id = element.val();
        $http.get("/api/foods/" + id).then(function(response) {
          if(response.data.food) { response.data.food.text = response.data.food.short_desc; }
          callback(response.data.food);
        });
      }
    };

    // This calculates the data for chart and table display of nutrition data
    _.each(['selectedFood','selectedQty','selectedWeightId'], function(e) { $scope.$watch(e, function() {
      if($scope.selectedFood && $scope.selectedFood.macronutrients) {
        var food = $scope.selectedFood;

        // Calculate the calorie breakdown. This uses 9 kcal/g of fat, 4 for carbs, and 4 for
        // protein. This is an approximation!
        var totalKcal = food.macronutrients.kcal;
        $scope.totalKcal = totalKcal;

        var fat = food.macronutrients.total_fat, protein = food.macronutrients.protein,
          carbs = (food.macronutrients.carbs - food.macronutrients.total_fiber),
          totalEstKcal = (fat * 9 + carbs * 4 + protein * 4);
        var kcalPctBreakdown = {
          fat: ((fat * 9)/totalEstKcal) * 100,
          protein: ((protein * 4)/totalEstKcal) * 100,
          carbs: ((carbs * 4)/totalEstKcal) * 100
        };

        $scope.kcalBreakdownChart.data.rows = [
          { c: [{v: 'Fat'}, {v: kcalPctBreakdown.fat}] },
          { c: [{v: 'Carbs'}, {v: kcalPctBreakdown.carbs}] },
          { c: [{v: 'Protein'}, {v: kcalPctBreakdown.protein}] }
        ];

      }
    }); });

    $scope.getNutrientNiceName = function(key) {
      var niceNames = {
        kcal: 'Calories', protein: 'Protein', total_fat: 'Total Fat', carbs: 'Total Carbohydrates',
        total_fiber: 'Total Fiber', sugar: 'Sugar', cholesterol: 'Cholesterol'
      };
      return niceNames[key];
    };

    $scope.getNutrientNiceAmount = function(key,amt) {
      var units = {
        kcal: '', protein: 'g', total_fat: 'g', carbs: 'g',
        total_fiber: 'g', sugar: 'g', cholesterol: 'mg'
      };
      var val = amt * $scope.getGramAmount()/100;
      if(key !== 'kcal') {
        return val.toFixed(2) + units[key];
      } else {
        return parseInt(val);
      }
    };

    $scope.getGramAmount = function() {
      if(!$scope.selectedWeightId || !$scope.selectedQty) {
        return 100;
      } else {
        if(parseInt($scope.selectedWeightId) === 1) {
          return $scope.selectedFood.weights[0].weight * parseFloat($scope.selectedQty);
        } else {
          return $scope.selectedFood.weights[1].weight * parseFloat($scope.selectedQty);
        }
      }
    };

  });


text:
package com.github.vlsidlyarevich.spring5homework.converters;

import com.github.vlsidlyarevich.spring5homework.commands.CategoryCommand;
import com.github.vlsidlyarevich.spring5homework.domain.model.Category;
import lombok.Synchronized;
import org.springframework.core.convert.converter.Converter;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

/**
 * Created by jt on 6/21/17.
 */
@Component
public class CategoryCommandToCategory implements Converter<CategoryCommand, Category>{

    @Synchronized
    @Nullable
    @Override
    public Category convert(CategoryCommand source) {
        if (source == null) {
            return null;
        }

        final Category category = new Category();
        category.setId(source.getId());
        category.setDescription(source.getDescription());
        return category;
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
    <item android:id="@+id/action_settings" android:title="startUninstalled"
        android:orderInCategory="100"  />
    <item android:id="@+id/action_updateQR" android:title="update  QRCode"
        android:orderInCategory="100"  />
    <item android:id="@+id/action_about" android:title="about"
        android:orderInCategory="100"  />
    <item android:id="@+id/action_nativeFragment" android:title="goFragment"
        android:orderInCategory="100"  />
</menu>


text:
import {Injectable} from 'angular2/core';

@Injectable()
export class LoggerService {
  logs:string[] = [];
  prevMsg = '';
  prevMsgCount = 1;

  log(msg:string)  {
    if (msg === this.prevMsg) {
      // Repeat message; update last log entry with count.
      this.logs[this.logs.length-1] = msg + ` (${this.prevMsgCount+=1}x)`;
    } else {
      // New message; log it.
      this.prevMsg = msg;
      this.prevMsgCount = 1;
      this.logs.push(msg);
    }
  }

  clear()   {this.logs.length = 0;}

  // schedules a view refresh to ensure display catches up
  tick() {
    setTimeout(() => {
    // console.log('tick')
    }, 0);
  }
}


text:
<template name="layout">
    {{> nav }}

                {{> Template.dynamic template=subnav }}

                {{> Template.dynamic template=main }}

                {{> Template.dynamic template=section }}

</template>

<template name="layout2">
    {{> nav }}

                {{> Template.dynamic template=main2 }}

                {{> Template.dynamic template=section2 }}

</template>


text:
"use strict";
(function ($) {
    $.fn.greenify = function () {
        this.css("color", "green");
        return this;
    };
})(jQuery);


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Host.Executors;
using Microsoft.Azure.WebJobs.Host.Indexers;
using Microsoft.Azure.WebJobs.Host.Listeners;
using Microsoft.Azure.WebJobs.Host.Protocols;

namespace Microsoft.Azure.WebJobs
{
    ///
    /// A <see cref="JobHost"/> is the execution container for jobs. Once started, the
    /// <see cref="JobHost"/> will manage and run job functions when they are triggered.
    ///
    public class JobHost : IDisposable
    {
        private const int StateNotStarted = 0;
        private const int StateStarting = 1;
        private const int StateStarted = 2;
        private const int StateStoppingOrStopped = 3;

        private readonly IJobHostContextFactory _contextFactory;
        private readonly CancellationTokenSource _shutdownTokenSource;
        private readonly WebJobsShutdownWatcher _shutdownWatcher;
        private readonly CancellationTokenSource _stoppingTokenSource;

        private Task<JobHostContext> _contextTask;
        private bool _contextTaskInitialized;
        private object _contextTaskLock = new object();

        private JobHostContext _context;
        private IListener _listener;
        private object _contextLock = new object();

        private int _state;
        private Task _stopTask;
        private object _stopTaskLock = new object();
        private bool _disposed;

        ///
        /// Initializes a new instance of the <see cref="JobHost"/> class, using a Microsoft Azure Storage connection
        /// string located in the connectionStrings section of the configuration file or in environment variables.
        ///
        public JobHost()
            : this(new JobHostConfiguration())
        {
        }

        ///
        /// Initializes a new instance of the <see cref="JobHost"/> class using the configuration provided.
        ///
        /// <param name="configuration">The job host configuration.</param>
        public JobHost(JobHostConfiguration configuration)
            : this((IServiceProvider)ThrowIfNull(configuration))
        {
        }

        ///
        /// Initializes a new instance of the <see cref="JobHost"/> class using the service provider provided.
        ///
        /// <param name="serviceProvider">The service provider.</param>
        internal JobHost(IServiceProvider serviceProvider)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            _contextFactory = serviceProvider.GetJobHostContextFactory();
            if (_contextFactory == null)
            {
                throw new InvalidOperationException("The IJobHostContextFactory service must not be null.");
            }

            _shutdownTokenSource = new CancellationTokenSource();
            _shutdownWatcher = WebJobsShutdownWatcher.Create(_shutdownTokenSource);
            _stoppingTokenSource = CancellationTokenSource.CreateLinkedTokenSource(_shutdownTokenSource.Token);
        }

        // Test hook only.
        internal IListener Listener
        {
            get { return _listener; }
            set { _listener = value; }
        }

        /// Starts the host.
        public void Start()
        {
            StartAsync().GetAwaiter().GetResult();
        }

        /// Starts the host.
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A <see cref="Task"/> that will start the host.</returns>
        public Task StartAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            ThrowIfDisposed();

            if (Interlocked.CompareExchange(ref _state, StateStarting, StateNotStarted) != StateNotStarted)
            {
                throw new InvalidOperationException("Start has already been called.");
            }

            return StartAsyncCore(cancellationToken);
        }

        private async Task StartAsyncCore(CancellationToken cancellationToken)
        {
            await EnsureHostStartedAsync(cancellationToken);

            await _listener.StartAsync(cancellationToken);
            _context.Trace.Info("Job host started", Host.TraceSource.Host);

            _state = StateStarted;
        }

        /// Stops the host.
        public void Stop()
        {
            StopAsync().GetAwaiter().GetResult();
        }

        /// Stops the host.
        /// <returns>A <see cref="Task"/> that will stop the host.</returns>
        public Task StopAsync()
        {
            ThrowIfDisposed();

            Interlocked.CompareExchange(ref _state, StateStoppingOrStopped, StateStarted);

            if (_state != StateStoppingOrStopped)
            {
                throw new InvalidOperationException("The host has not yet started.");
            }

            // Multiple threads may call StopAsync concurrently. Both need to return the same task instance.
            lock (_stopTaskLock)
            {
                if (_stopTask == null)
                {
                    _stoppingTokenSource.Cancel();
                    _stopTask = StopAsyncCore(CancellationToken.None);
                }
            }

            return _stopTask;
        }

        private async Task StopAsyncCore(CancellationToken cancellationToken)
        {
            await _listener.StopAsync(cancellationToken);

            _context.Trace.Info("Job host stopped", Host.TraceSource.Host);
        }

        /// Runs the host and blocks the current thread while the host remains running.
        public void RunAndBlock()
        {
            Start();

            // Wait for someone to begin stopping (_shutdownWatcher, Stop, or Dispose).
            _stoppingTokenSource.Token.WaitHandle.WaitOne();

            // Don't return until all executing functions have completed.
            Stop();
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        public void Call(MethodInfo method)
        {
            CallAsync(method).GetAwaiter().GetResult();
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        /// <param name="arguments">
        /// An object with public properties representing argument names and values to bind to parameters in the job
        /// method.
        /// </param>
        public void Call(MethodInfo method, object arguments)
        {
            CallAsync(method, arguments).GetAwaiter().GetResult();
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        /// <param name="arguments">The argument names and values to bind to parameters in the job method.</param>
        public void Call(MethodInfo method, IDictionary<string, object> arguments)
        {
            CallAsync(method, arguments).GetAwaiter().GetResult();
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A <see cref="Task"/> that will call the job method.</returns>
        public Task CallAsync(MethodInfo method, CancellationToken cancellationToken = default(CancellationToken))
        {
            IDictionary<string, object> argumentsDictionary = null;
            return CallAsync(method, argumentsDictionary, cancellationToken);
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        /// <param name="arguments">
        /// An object with public properties representing argument names and values to bind to parameters in the job
        /// method.
        /// </param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A <see cref="Task"/> that will call the job method.</returns>
        public Task CallAsync(MethodInfo method, object arguments,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            ThrowIfDisposed();

            IDictionary<string, object> argumentsDictionary = ObjectDictionaryConverter.AsDictionary(arguments);
            return CallAsync(method, argumentsDictionary, cancellationToken);
        }

        /// Calls a job method.
        /// <param name="method">The job method to call.</param>
        /// <param name="arguments">The argument names and values to bind to parameters in the job method.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A <see cref="Task"/> that will call the job method.</returns>
        public Task CallAsync(MethodInfo method, IDictionary<string, object> arguments,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            ThrowIfDisposed();

            return CallAsyncCore(method, arguments, cancellationToken);
        }

        private async Task CallAsyncCore(MethodInfo method, IDictionary<string, object> arguments,
            CancellationToken cancellationToken)
        {
            await EnsureHostStartedAsync(cancellationToken);
            IFunctionDefinition function = ResolveFunctionDefinition(method, _context.FunctionLookup);
            IFunctionInstance instance = CreateFunctionInstance(function, arguments);

            IDelayedException exception = await _context.Executor.TryExecuteAsync(instance, cancellationToken);

            if (exception != null)
            {
                exception.Throw();
            }
        }

        ///
        /// Dispose the instance
        ///
        /// <param name="disposing">True if currently disposing.</param>
        [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_shutdownTokenSource")]
        protected virtual void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                // Running callers might still be using this cancellation token.
                // Mark it canceled but don't dispose of the source while the callers are running.
                // Otherwise, callers would receive ObjectDisposedException when calling token.Register.
                // For now, rely on finalization to clean up _shutdownTokenSource's wait handle (if allocated).
                _shutdownTokenSource.Cancel();

                _stoppingTokenSource.Dispose();

                if (_shutdownWatcher != null)
                {
                    _shutdownWatcher.Dispose();
                }

                if (_context != null)
                {
                    _context.Dispose();
                }

                _disposed = true;
            }
        }

        /// <inheritdoc />
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private static IFunctionInstance CreateFunctionInstance(IFunctionDefinition func, IDictionary<string, object> parameters)
        {
            return func.InstanceFactory.Create(Guid.NewGuid(), null, ExecutionReason.HostCall, parameters);
        }

        private static IFunctionDefinition ResolveFunctionDefinition(MethodInfo method, IFunctionIndexLookup functionLookup)
        {
            IFunctionDefinition function = functionLookup.Lookup(method);

            if (function == null)
            {
                string msg = String.Format(CultureInfo.CurrentCulture, "'{0}' can't be invoked from Azure WebJobs SDK. Is it missing Azure WebJobs SDK attributes?", method);
                throw new InvalidOperationException(msg);
            }

            return function;
        }

        private static JobHostConfiguration ThrowIfNull(JobHostConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            return configuration;
        }

        private async Task<JobHostContext> CreateContextAndLogHostStartedAsync(CancellationToken cancellationToken)
        {
            JobHostContext context = await _contextFactory.CreateAndLogHostStartedAsync(_shutdownTokenSource.Token, cancellationToken);

            lock (_contextLock)
            {
                if (_context == null)
                {
                    _context = context;
                    _listener = context.Listener;
                }
            }

            return _context;
        }

        private Task EnsureHostStartedAsync(CancellationToken cancellationToken)
        {
            return LazyInitializer.EnsureInitialized<Task<JobHostContext>>(ref _contextTask,
                ref _contextTaskInitialized,
                ref _contextTaskLock,
                () => CreateContextAndLogHostStartedAsync(cancellationToken));
        }

        private void ThrowIfDisposed()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(null);
            }
        }
    }
}


text:
static CommandData *sharedInstance = nil;

@implementation CommandData{
    NSMutableArray *TableItemArray;
    NSMutableArray *CommandTableArray;
    NSString *teststring;
}

+ (CommandData *)sharedInstance {
    if (sharedInstance != nil) {
        return sharedInstance;
    }

    static dispatch_once_t pred;        // Lock
    dispatch_once(&pred, ^{             // This code is called at most once per app
        sharedInstance = [[CommandData alloc] init];
    });
    return sharedInstance;
}

- (instancetype)init {
    self = [super init];

    if (self) {
        //initialization environment
        CommandTableArray = [[NSMutableArray alloc]init];
        TableItemArray = [[NSMutableArray alloc]init];
        [TableItemArray addObject:@"Get Data"];
        [TableItemArray addObject:@"Battery"];
        [TableItemArray addObject:@"Reset"];
        [TableItemArray addObject:@"Test Weight"];
        [TableItemArray addObject:@"LED Remind"];
        [TableItemArray addObject:@"Setting Pin Code"];
        [TableItemArray addObject:@"Checkpingcode"];
        [TableItemArray addObject:@"SettingDevice"];
        [TableItemArray addObject:@"ChangeCup"];
        [TableItemArray addObject:@"Version"];
        [TableItemArray addObject:@"DFUmode"];
        [TableItemArray addObject:@"DataHistory"];

        for (int i=1; i < 15; i++) {
            [[DataBaseObject sharedInstance]addcommandName:[NSString stringWithFormat:@"Btn %d",i]];
        }
        for (int i=1; i <= TableItemArray.count; i++) {
            [[DataBaseObject sharedInstance]UpdateTheCommandName:[TableItemArray objectAtIndex:i-1] keynumber:[NSString stringWithFormat:@"Btn %d",i]];
        }
    }
    return self;
}

- (NSArray *)DataBaseBtn{
    return TableItemArray;
}

- (NSString *)DataCommandBtn{
    return @"41";
}

- (NSString *)ReturnTableArray:(int)indexArray{
    if (TableItemArray.count < indexArray + 1) {
        return @"";
    }
    else return [TableItemArray objectAtIndex:indexArray];
}

@end


text:
module Rolls

  # Ledger class tracks available libraries by library name.
  # It is essentially a hash object, but with a special way
  # of storing library references in order to track versions.
  # Each key is the name of a library, as a String, and each
  # value is either a Library object, if a particular version
  # is active, or an Array of available versions of the library
  # if inactive.
  #
  class Ledger

    #
    # Access to library ledger.
    #
    # @return [Array] The `$LEDGER` array.
    #
    def self.ledger
      $LEDGER
    end

    #
    # Library names from ledger.
    #
    # @return [Array] The keys from `$LEDGER` array.
    #
    def self.names
      $LEDGER.keys
    end

    #
    # Library names from ledger.
    #
    # @return [Array] The keys from `$LEDGER` array.
    #
    def self.list
      $LEDGER.keys
    end

    #
    # Find matching library features. This is the "mac daddy" method used by
    # the #require and #load methods to find the specified +path+ among
    # the various libraries and their load paths.
    #
    def self.find(path, options={})
      $LEDGER.find_feature(path, options)
    end

    #
    # Brute force variation of `#find` looks through all libraries for a
    # matching features. This serves as the fallback method if `#find` comes
    # up empty.
    #
    # @param [String] path
    #   path name for which to search
    #
    # @param [Hash] options
    #   Search options.
    #
    # @option options [Boolean] :latest
    #   Search only the active or most current version of any library.
    #
    # @option options [Boolean] :suffix
    #   Automatically try standard extensions if pathname has none.
    #
    # @option options [Boolean] :legacy
    #   Do not match within library's +name+ directory, eg. `lib/foo/*`.
    #
    # @return [Feature,Array] Matching feature(s).
    #
    def self.find_any(path, options={})
      $LEDGER.find_any(path, options)
    end

    #
    # Brute force search looks through all libraries for matching features.
    # This is the same as #find_any, but returns a list of matches rather
    # then the first matching feature found.
    #
    # @param [String] path
    #   path name for which to search
    #
    # @param [Hash] options
    #   Search options.
    #
    # @option options [Boolean] :latest
    #   Search only the active or most current version of any library.
    #
    # @option options [Boolean] :suffix
    #   Automatically try standard extensions if pathname has none.
    #
    # @option options [Boolean] :legacy
    #   Do not match within library's +name+ directory, eg. `lib/foo/*`.
    #
    # @return [Feature,Array] Matching feature(s).
    #
    def self.search(path, options={})
      $LEDGER.search(path, options)
    end

    #
    # Search for all matching library files that match the given pattern.
    # This could be of useful for plugin loader.
    #
    # @param [Hash] options
    #   Glob matching options.
    #
    # @option options [Boolean] :latest
    #   Search only activated libraries or the most recent version
    #   of a given library.
    #
    # @return [Array] Matching file paths.
    #
    # @todo Should this return list of Feature objects instead of file paths?
    #
    def self.glob(match, options={})
      $LEDGER.glob(match, options)
    end

    #
    # @deprecated
    #
    def self.find_files(match, options={})
      glob(match, options)
    end

    #
    # Access to global load stack.
    #
    # @return [Array] The `$LOAD_STACK` array.
    #
    def self.load_stack
      $LOAD_STACK
    end

    #
    # Require a feature from the library.
    #
    # @param [String] pathname
    #   The pathname of feature relative to library's loadpath.
    #
    # @param [Hash] options
    #
    # @return [true,false] If feature was newly required or successfully loaded.
    #
    def self.require(pathname, options={})
      #options_prior = ($LOAD_OPTIONS ||= {})
      #$LOAD_OPTIONS = options
      #$LOAD_OPTIONS[:legacy] = true if options_prior[:legacy]

      #begin
        if file = $LOAD_CACHE[pathname]
          if options[:load]
            return file.load
          else
            return false
          end
        end

        #unless $LOAD_OPTIONS[:legacy]

        if feature = find(pathname, options)
          #feature.library_activate
          $LOAD_CACHE[pathname] = feature
          return feature.acquire(options)
        end

        #end

        # fallback to Ruby's own load mechinisms
        if options[:load]
          __load__(pathname, options[:wrap])
        else
          __require__(pathname)
        end
      #ensure
      #  $LOAD_OPTIONS = options_prior
      #end
    end

    #
    # Load file path. This is just like #require except that previously
    # loaded files will be reloaded and standard extensions will not be
    # automatically appended.
    #
    # @param pathname [String]
    #   pathname of feature relative to library's loadpath
    #
    # @return [true,false] if feature was successfully loaded
    #
    def self.load(pathname, options={}) #, &block)
      #options.merge!(block.call) if block

      unless Hash === options
        options = {}
        options[:wrap] = options
      end

      options[:load]   = true
      options[:suffix] = false
      options[:local]  = false

      require(pathname, options)

      #if file = $LOAD_CACHE[path]
      #  return file.load
      #end

      #if file = Library.find(path, options)
      #  #file.library_activate
      #  $LOAD_CACHE[path] = file
      #  return file.load(options) #acquire(options)
      #end

      ##if options[:load]
      #  __load__(path, options[:wrap])
      ##else
      ##  __require__(path)
      ##end
    end

    #
    # Roll-style loading. First it looks for a specific library via `:`.
    # If `:` is not present it then tries the current loading library.
    # Failing that it fallsback to Ruby itself.
    #
    #   require('facets:string/margin')
    #
    # To "load" the library, rather than "require" it, set the +:load+
    # option to true.
    #
    #   require('facets:string/margin', :load=>true)
    #
    # @param pathname [String]
    #   pathname of feature relative to library's loadpath
    #
    # @return [true, false] if feature was newly required
    #
    def self.acquire(pathname, options={}) #, &block)
      #options.merge!(block.call) if block
      options[:local] = true
      require(pathname, options)
    end

    #
    # Load up the ledger with a given set of paths.
    #
    def self.prime(*paths)
      $LEDGER.prime(*paths)
    end

    #
    # A ledger is enumerable, iterating over the internal table
    # of libraries.
    #
    include Enumerable

    #
    # State of monitoring setting. This is used for debugging.
    #
    def monitor?
      ENV['monitor'] || ($MONITOR ||= false)
    end

    #
    def initialize
      @table = Hash.new(){ |h,k| h[k] = [] }
    end

    #
    # Add a library to the ledger.
    #
    # @param [String,Library]
    #   A path to a ruby library or a Library object.
    #
    # @return [Library] Added library object.
    #
    def add(lib)
      case lib
      when Library
        add_library(lib)
      else
        add_location(lib)
      end
    end

    alias_method :<<, :add

    #
    # Add library to ledger given a location.
    #
    # @return [Library] Added library object.
    #
    def add_location(location)
      begin
        library = Library.new(location)

        entry = @table[library.name]

        if Array === entry
          entry << library unless entry.include?(library)
        else
          # todo: what to do here?
        end
      rescue Exception => error
        warn error.message if ENV['debug']
      end

      library
    end

    #
    # Add library to ledger given a Library object.
    #
    # @return [Library] Added library object.
    #
    def add_library(library)
      #begin
        raise TypeError unless Library === library

        entry = @table[library.name]

        if Array === entry
          entry << library unless entry.include?(library)
        end
      #rescue Exception => error
      #  warn error.message if ENV['debug']
      #end

      library
    end

    #
    # Get library or library version set by name.
    #
    # @param [String] name
    #   Name of library.
    #
    # @return [Library,Array] Library or lihbrary set referenced by name.
    #
    def [](name)
      @table[name.to_s]
    end

    #
    # Set ledger entry.
    #
    # @param [String] Name of library.
    #
    # @raise [TypeError] If library is not a Library object.
    #
    def []=(name, library)
      raise TypeError unless Library === library

      @table[name.to_s] = library
    end

    #
    #
    #
    def replace(table)
      initialize
      table.each do |name, value|
        @table[name.to_s] = value
      end
    end

    #
    # Iterate over each ledger entry.
    #
    def each(&block)
      @table.each(&block)
    end

    #
    # Size of the ledger is the number of libraries available.
    #
    # @return [Fixnum] Size of the ledger.
    #
    def size
      @table.size
    end

    #
    # Checks ledger for presents of library by name.
    #
    # @return [Boolean]
    #
    def key?(name)
      @table.key?(name.to_s)
    end

    #
    # Get a list of names of all libraries in the ledger.
    #
    # @return [Array<String>] list of library names
    #
    def keys
      @table.keys
    end

    #
    # Get a list of libraries and library version sets in the ledger.
    #
    # @return [Array<Library,Array>]
    #   List of libraries and library version sets.
    #
    def values
      @table.values
    end

    #
    # Inspection string.
    #
    # @return [String] Inspection string.
    #
    def inspect
      @table.inspect
    end

    #
    # Limit versions of a library to the given constraint.
    # Unlike `#activate` this does not reduce the possible versions
    # to a single library, but only reduces the number of possibilites.
    #
    # @param [String] name
    #   Name of library.
    #
    # @param [String] constraint
    #   Valid version constraint.
    #
    # @return [Array] List of conforming versions.
    #
    def constrain(name, contraint)
      libraries = self[name]

      return nil unless Array === libraries

      vers = libraries.select do |library|
        library.version.satisfy?(constraint)
      end

      self[name] = vers
    end

    #
    # Activate a library, retrieving a Library instance by name, or name
    # and version, and ensuring only that instance will be returned for
    # all subsequent requests. Libraries are singleton, so once activated
    # the same object is always returned.
    #
    # This method will raise a LoadError if the name is not found.
    #
    # Note that activating all runtime requirements of a library being
    # activated was considered, but decided against. There's no reason
    # to activatea library until it is actually needed. However this is
    # not so when testing, or verifying available requirements, so other
    # methods are provided such as `#activate_requirements`.
    #
    # @param [String] name
    #   Name of library.
    #
    # @param [String] constraint
    #   Valid version constraint.
    #
    # @return [Library]
    #   The activated Library object.
    #
    # @todo Should we also check $"? Eg. `return false if $".include?(path)`.
    #
    def activate(name, constraint=nil)
      raise LoadError, "no such library -- #{name}" unless key?(name)

      library = self[name]

      if Library === library
        if constraint
          unless library.version.satisfy?(constraint)
            raise Library::VersionConflict, library
          end
        end
      else # library is an array of versions
        if constraint
          verscon = Version::Constraint.parse(constraint)
          library = library.select{ |lib| verscon.compare(lib.version) }.max
        else
          library = library.max
        end
        unless library
          raise VersionError, "no library version -- #{name} #{constraint}"
        end

        self[name] = library #constrain(library)
      end

      library
    end

    #
    # Find matching library features. This is the "mac daddy" method used by
    # the #require and #load methods to find the specified +path+ among
    # the various libraries and their load paths.
    #
    def find_feature(path, options={})
      path   = path.to_s

      #suffix = options[:suffix]
      search = options[:search]
      local  = options[:local]
      from   = options[:from]

      $stderr.print path if monitor?  # debugging

      # absolute, home or current path
      #
      # NOTE: Ideally we would try to find a matching path among avaliable libraries
      # so that the library can be activated, however this would probably add a
      # too much overhead and will by mostly a YAGNI, so we forgo any such
      # functionality, at least for now.
      case path[0,1]
      when '/', '~', '.'
        $stderr.puts "  (absolute)" if monitor?  # debugging
        return nil
      end

      # from explicit library
      if from
        return find_library_feature(from, path, options)
      end

      # check the load stack (TODO: just last or all?)
      if local
        if last = $LOAD_STACK.last
        #$LOAD_STACK.reverse_each do |feature|
          lib = last.library
          if ftr = lib.find(path, options)
            unless $LOAD_STACK.include?(ftr)  # prevent recursive loading
              $stderr.puts "  (2 stack)" if monitor?  # debugging
              return ftr
            end
          end
        end
      end

      name, fname = ::File.split_root(path)

      # if the head of the path is the library
      if fname
        if name == 'ruby'  # part of the ruby hack
          return find_library_feature('ruby', fname, options)
        else
          lib = Library[name]
          if lib && ftr = lib.find(path, options) || lib.find(fname, options)
            $stderr.puts "  (3 indirect)" if monitor?  # debugging
           return ftr
          end
        end
      end

      # plain library name?
      if !fname && lib = Library.instance(path)
        if ftr = lib.default  # default feature to load
          $stderr.puts "  (5 plain library name)" if monitor?  # debugging
          return ftr
        end
      end

      # fallback to brute force search
      #if search #or legacy
        #options[:legacy] = true
        if ftr = find_any(path, options)
          $stderr.puts "  (6 brute search)" if monitor?  # debugging
          return ftr
        end
      #end

      $stderr.puts "  (7 fallback)" if monitor?  # debugging

      nil
    end

    #
    #
    #
    def find_library_feature(lib, path, options={})
      case lib
      when Library
      when :ruby, 'ruby'
        lib = RubyLibrary.singleton  # sort of a hack to let rubygems edge in
      else                           # b/c if RubyLibary is in the regular ledger
        lib = library(lib)           # then it prevents gems working for anything
      end                            # with the same name in ruby site locations.
      ftr = lib.find(path, options)
      raise LoadError, "no such file to load -- #{path}" unless ftr
      $stderr.puts "  (direct)" if monitor?  # debugging
      return ftr
    end

    #
    # Brute force variation of `#find` looks through all libraries for a
    # matching features. This serves as the fallback method if `#find` comes
    # up empty.
    #
    # @param [String] path
    #   path name for which to search
    #
    # @param [Hash] options
    #   Search options.
    #
    # @option options [Boolean] :latest
    #   Search only the active or most current version of any library.
    #
    # @option options [Boolean] :suffix
    #   Automatically try standard extensions if pathname has none.
    #
    # @option options [Boolean] :legacy
    #   Do not match within library's +name+ directory, eg. `lib/foo/*`.
    #
    # @return [Feature,Array] Matching feature(s).
    #
    def find_any(path, options={})
      options = options.merge(:main=>true)

      latest = options[:latest]

      # TODO: Perhaps the selected and unselected should be kept in separate lists?
      unselected, selected = *partition{ |name, libs| Array === libs }

      # broad search of pre-selected libraries
      selected.each do |(name, lib)|
        if ftr = lib.find(path, options)
          next if Library.load_stack.last == ftr
          return ftr
        end
      end

      # finally a broad search on unselected libraries
      unselected.each do |(name, libs)|
        libs = libs.sort
        libs = [libs.first] if latest
        libs.each do |lib|
          ftr = lib.find(path, options)
          return ftr if ftr
        end
      end

      nil
    end

    #
    # Brute force search looks through all libraries for matching features.
    # This is the same as #find_any, but returns a list of matches rather
    # then the first matching feature found.
    #
    # @param [String] path
    #   path name for which to search
    #
    # @param [Hash] options
    #   Search options.
    #
    # @option options [Boolean] :latest
    #   Search only the active or most current version of any library.
    #
    # @option options [Boolean] :suffix
    #   Automatically try standard extensions if pathname has none.
    #
    # @option options [Boolean] :legacy
    #   Do not match within library's +name+ directory, eg. `lib/foo/*`.
    #
    # @return [Feature,Array] Matching feature(s).
    #
    def search(path, options={})
      options = options.merge(:main=>true)

      latest = options[:latest]

      matches = []

      # TODO: Perhaps the selected and unselected should be kept in separate lists?
      unselected, selected = *partition{ |name, libs| Array === libs }

      # broad search of pre-selected libraries
      selected.each do |(name, lib)|
        if ftr = lib.find(path, options)
          next if Library.load_stack.last == ftr
          matches << ftr
        end
      end

      # finally a broad search on unselected libraries
      unselected.each do |(name, libs)|
        libs = [libs.sort.first] if latest
        libs.each do |lib|
          ftr = lib.find(path, options)
          matches << ftr if ftr
        end
      end

      matches.uniq
    end

    #
    # Search for all matching library files that match the given pattern.
    # This could be of useful for plugin loader.
    #
    # @param [Hash] options
    #   Glob matching options.
    #
    # @option options [Boolean] :latest
    #   Search only activated libraries or the most recent version
    #   of a given library.
    #
    # @return [Array] Matching file paths.
    #
    # @todo Should this return list of Feature objects instead of file paths?
    #
    def glob(match, options={})
      latest = options[:latest]

      matches = []

      each do |name, libs|
        case libs
        when Array
          libs = libs.sort
          libs = [libs.first] if latest
        else
          libs = [libs]
        end

        libs.each do |lib|
          lib.loadpath.each do |path|
            find = File.join(lib.location, path, match)
            list = Dir.glob(find)
            list = list.map{ |d| d.chomp('/') }
            matches.concat(list)
          end
        end
      end

      matches
    end

    #
    # Reduce the ledger to only those libraries the given library requires.
    #
    # @param [String] name
    #   The name of the primary library.
    #
    # @param [String] constraint
    #   The version constraint string.
    #
    # @return [Ledger] The ledger.
    #
    def isolate(name, constraint=nil)
      library = activate(name, constraint)

      # TODO: shouldn't this be done in #activate ?
      acivate_requirements(library)

      unused = []
      each do |name, libs|
        ununsed << name if Array === libs
      end
      unused.each{ |name| @table.delete(name) }

      self
    end

    #
    # Load up the ledger with a given set of paths and add an instance of
    # the special `RubyLibrary` class after that.
    #
    # @param [Array] paths
    #
    # @option paths [Boolean] :expound
    #   Expound on path entires. See {#expound_paths}.
    #
    # @return [Ledger] The primed ledger.
    #
    def prime(*paths)
      options = Hash === paths.last ? paths.pop : {}

      paths = expound_paths(*paths) if options[:expound]

require 'library/rubylib'  # TODO: What's the reason rubylib.rb is loaded here?

      paths.each do |path|
        begin
          add_location(path) if library_path?(path)
        rescue => err
          $stderr.puts err.message if ENV['debug']
        end
      end

      # We can not do this b/c it prevents gems from working
      # when a file has the same name as something in the
      # ruby lib or site locations. For example, if we intsll
      # the test-unit gem and require `test/unit`. Of course,
      # it Ruby ever adopted the "Rolls Way" then this could
      # be restored.
      #add_library(RubyLibrary.new)

      self
    end

  private

    #
    # For flexible priming, this method can be used to recursively
    # lookup library locations.
    #
    # If a given path is a file, it will considered a lookup "roll",
    # such that each line entry in the file is considered another
    # path to be expounded upon.
    #
    # If a given path is a directory, it will be returned if it
    # is a valid Ruby library location, otherwise each subdirectory
    # will be checked to see if it is a valid Ruby library location,
    # and returned if so.
    #
    # If, on the other hand, a given path is a file glob pattern,
    # the pattern will be expanded and those paths will expounded
    # upon in turn.
    #
    def expound_paths(*entries)
      paths = []

      entries.each do |entry|
        entry = entry.strip

        next if entry.empty?
        next if entry.start_with?('#')

        if File.directory?(entry)
          if library_path?(entry)
            paths << entry
          else
            subpaths = Dir.glob(File.join(entry, '*/'))
            subpaths.each do |subpath|
              paths << subpath if library_path?(subpath)
            end
          end
        elsif File.file?(entry)
          paths.concat(expound_paths(*File.readlines(entry)))
        else
          glob_paths = Dir.glob(entry)
          if glob_paths.first != entry
            paths.concat(expound_paths(*glob_paths))
          end
        end
      end

      paths
    end

    #
    # Is a directory a Ruby library?
    #
    # @todo Support gem home location.
    #
    def library_path?(path)
      dotindex(path) || (ENV['RUBYLIBS_GEMSPEC'] && gemspec(path))
    end

    # TODO: First recursively constrain the ledger, then activate. That way
    # any missing libraries will cause an error. (hmmm... actually that's
    # an imperfect way to resolve version dependencies). Ultimately we probably
    # need a separate module to handle this.

    #
    # Activate library requirements.
    #
    # @todo: checklist is used to prevent possible infinite recursion, but
    #   it might be better to put a flag in Library instead.
    #
    def acivate_requirements(library, development=false, checklist={})
      reqs = development ? library.requirements : library.runtime_requirements

      checklist[library] = true

      reqs.each do |req|
        name = req['name']
        vers = req['version']

        library = activate(name, vers)

        acivate_requirements(library, development, checklist) unless checklist[library]
      end

      self
    end

    #
    # If the directory has a `.index` file return it, otherwise +nil+.
    #
    def dotindex(path)
      file = File.join(path, '.index')
      File.file?(file) ? file : false
    end

    alias :dotindex? :dotindex

    #
    # Does a path have a `.gemspec` file? This is fallback measure
    # if a `.index` file is not found.
    #
    def gemspec(path)
      installed_gemspec(path) || local_gemspec(path)
    end

    alias :gemspec? :gemspec

    #
    # Does a path have a `.gemspec` file?
    #
    def local_gemspec(path)
      glob = File.file?(File.join(path, '{,*}.gemspec'))
      Dir[glob].first
    end

    # TODO: Would it be faster to determine gem?(path) if we just compared
    # it to GEM_HOME? Then if it was, we could find the gemspec file.

    #
    # Determine if a path belongs to an installed gem. If so, it returns the
    # path to the gemspec, otherwise +false+.
    #
    # @return [String, NilClass] Path to gemspec, or nil.
    #
    def installed_gemspec(path)
      #return true if Dir[File.join(path, '*.gemspec')].first
      pkgname = ::File.basename(path)
      gemsdir = ::File.dirname(path)
      specdir = ::File.join(File.dirname(gemsdir), 'specifications')
      gemspec = ::File.join(specdir, "#{pkgname}.gemspec")
      ::File.exist?(gemspec) ? gemspec : nil
    end

  end

end


text:
package com.quantconnect.lean.util;

import java.awt.Color;
import java.io.IOException;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

//using System.Drawing;
//using System.Globalization;

public class ColorJsonConverters {

    public static class ColorJsonSerializer extends JsonSerializer<Color> {

//        /// Converts a Color to a hexadecimal as a string
//        /// <param name="value">The input value to be converted before serialization
//        /// <returns>Hexadecimal number as a string. If Color is null, returns default #000000</returns>
//        protected @Override String Convert( Color value ) {
//        }
        @Override
        public void serialize( Color value, JsonGenerator gen, SerializerProvider serializers )
                throws IOException, JsonProcessingException {
//            return value.IsEmpty ? string.Empty : String.format( "#{0:X2}{1:X2}{2:X2}", value.getRed(), value.G, value.B);

            gen.writeStartObject();
            if( value == null )
                gen.writeNull();
            else
                gen.writeStringField( "color", String.format( "#%02X%02X%02X", value.getRed(), value.getGreen(), value.getBlue() ) );
            gen.writeEndObject();
        }
    }

    public static class ColorJsonDeserializer extends JsonDeserializer<Color> {

        /// Converts hexadecimal number to integer
        /// <param name="hexValue">Hexadecimal number
        /// <returns>Integer representation of the hexadecimal</returns>
        private int hexToInt( String hexValue ) {
            if( hexValue.length() != 2 )
                throw new NumberFormatException( String.format( "Unable to convert '%s' to an Integer. Requires String length of 2.", hexValue ) );

            return Integer.parseInt( hexValue, 16 );
        }

        /// Converts the input String to a Color object
        /// <param name="value">The deserialized value that needs to be converted to T
        /// <returns>The converted value</returns>
        @Override
        public Color deserialize( JsonParser p, DeserializationContext ctxt )
                throws IOException, JsonProcessingException {
            final JsonNode node = p.getCodec().readTree( p );
            final String value = node.get( "color" ).asText();
            if( StringUtils.isBlank( value ) )
                return null;

            if( value.length() != 7)
                throw new NumberFormatException( String.format( "Unable to convert '%s' to a Color. Requires String length of 7 including the leading hashtag.", value ) );

            final int red = hexToInt( value.substring( 1, 2 ) );
            final int green = hexToInt( value.substring( 3, 2 ) );
            final int blue = hexToInt( value.substring( 5, 2 ) );

            return new Color( red, green, blue );
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mitt. bot. StSamml. , Münch. 19: 258 (1983)

#### Original name
Flagelloscypha subnuda Agerer, 1983

### Remarks
null


text:
/*
This file is part of biOps.

    biOps is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    biOps is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with biOps; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

/*
	Title: Edge detection operators
*/

#include "defs.h"
#include <stdlib.h>

/*
	Function: homogeneityEdgeDetection
		Enhace image's edge by the homogeneity method. It uses a 3x3 matrix to determine the
		current pixel value (by getting the maximum value between the distances of the pixel
		and its neighbors)

	Parameters:
		image - The input image
		width - The image width
		height - Its height
		depth - Its color depth
		bias - Value to be added to each pixel after method is applied (used to correct some expected
			behaviour)

	Returns:
		ret - The image whose edges has been enhaced

	See also:
		<differenceEdgeDetection>
*/
void homogeneityEdgeDetection(int *image, int *width, int *height, int *depth, int *bias, int *ret){
	int x, y, d, i;
	int max, value;

	for (x = 0; x < *width; x++){
		for (y = 0; y < *height; y++){
			for (d = 0; d < *depth; d++){
				int current = image[IMGPOS(x,y,d,*width,*height)];
				int n[8];
				n[0] = (x-1 < 0 || y-1 < 0) ? current : IMGPOS (x-1, y-1, d, *width, *height);
				n[1] = (y-1 < 0) ? current : IMGPOS (x, y-1, d, *width, *height);
				n[2] = (x+1 > *width - 1 || y-1 < 0) ? current : IMGPOS (x+1, y-1, d, *width, *height);
				n[3] = (x-1 < 0) ? current : IMGPOS (x-1, y, d, *width, *height);
				n[4] = (x+1 > *width - 1) ? current : IMGPOS (x+1, y, d, *width, *height);
				n[5] = (x-1 < 0 || y+1 > *height - 1) ? current : IMGPOS (x-1, y+1, d, *width, *height);
				n[6] = (y+1 > *height - 1) ? current : IMGPOS (x, y+1, d, *width, *height);
				n[7] = (x+1 > *width - 1 || y+1 > *height - 1) ? current : IMGPOS (x+1, y+1, d, *width, *height);
				max = 0;
				for (i = 0; i < 8; i++){
					value = abs(image[n[i]] - current);
					if (value > max){
						max = value;
					}
				}
				ret[IMGPOS(x,y,d,*width, *height)] = MIN (max + *bias, MAX_PIXEL_VALUE);
			}
		}
	}
}

/*
	Function: differenceEdgeDetection
		Enhace image's edge by the difference method. It uses a 3x3 matrix to determine the
		current pixel value (by getting the maximum value between the distances of matrix's
		opposite neighbors)

	Parameters:
		image - The input image
		width - The image width
		height - Its height
		depth - Its color depth
		bias - Value to be added to each pixel after method is applied (used to correct some expected
			behaviour)

	Returns:
		ret - The image whose edges has been enhaced

	See also:
		<homogeneityEdgeDetection>
*/
void differenceEdgeDetection(int *image, int *width, int *height, int *depth, int *bias, int *ret){
	int x, y, d, i;
	int max, value;

	for (x = 0; x < *width; x++){
		for (y = 0; y < *height; y++){
			for (d = 0; d < *depth; d++){
				int current = image[IMGPOS(x,y,d,*width,*height)];
				int n[8];
				n[0] = (x-1 < 0 || y-1 < 0) ? current : IMGPOS (x-1, y-1, d, *width, *height);
				n[1] = (y-1 < 0) ? current : IMGPOS (x, y-1, d, *width, *height);
				n[2] = (x+1 > *width - 1 || y-1 < 0) ? current : IMGPOS (x+1, y-1, d, *width, *height);
				n[3] = (x-1 < 0) ? current : IMGPOS (x-1, y, d, *width, *height);
				n[4] = (x+1 > *width - 1) ? current : IMGPOS (x+1, y, d, *width, *height);
				n[5] = (x-1 < 0 || y+1 > *height - 1) ? current : IMGPOS (x-1, y+1, d, *width, *height);
				n[6] = (y+1 > *height - 1) ? current : IMGPOS (x, y+1, d, *width, *height);
				n[7] = (x+1 > *width - 1 || y+1 > *height - 1) ? current : IMGPOS (x+1, y+1, d, *width, *height);
				max = 0;
				for (i = 0; i < 4; i++){
					value = abs(image[n[i]] - image[n[7-i]]);
					if (value > max){
						max = value;
					}
				}
				ret[IMGPOS(x,y,d,*width, *height)] = MIN (max + *bias, MAX_PIXEL_VALUE);
			}
		}
	}
}


text:
#ifndef CSSReflectionDirection_h
#define CSSReflectionDirection_h

namespace WebCore {

enum CSSReflectionDirection { ReflectionBelow, ReflectionAbove, ReflectionLeft, ReflectionRight };

} // namespace WebCore

#endif // CSSReflectionDirection_h


text:
<!DOCTYPE html>

    <title>注册</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
    <link href="data/styles.css" type="text/css" rel="stylesheet"/>
    <link href="files/注册/styles.css" type="text/css" rel="stylesheet"/>

输入手机号码

输入密码

下一步

UI贴图

登录

注册


text:
#include "formscriptrunner_p.h"
#include "formbuilderextra_p.h"
#include "ui4_p.h"

#include <QtScript/QScriptEngine>
#include <QtGui/QWidget>
#include <QtCore/QDebug>
#include <QtCore/QCoreApplication>

QT_BEGIN_NAMESPACE

namespace {
    enum { debugFormScriptRunner = 0 };
}

#ifdef QFORMINTERNAL_NAMESPACE
namespace QFormInternal {
#endif

class  QFormScriptRunner::QFormScriptRunnerPrivate {
public:
    QFormScriptRunnerPrivate() : m_options(DisableScripts) {}
    void clearErrors() { m_errors.clear(); }

    bool run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage);

    static void initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine);
    static QString engineError(QScriptEngine &scriptEngine);

    Options options() const { return m_options; }
    void setOptions(Options options) { m_options = options; }

    Errors errors() const { return m_errors; }
private:
    QScriptEngine m_scriptEngine;
    Options m_options;
    Errors m_errors;
};

bool QFormScriptRunner::QFormScriptRunnerPrivate::run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage) {
    bool rc = false;
    initializeEngine(widget, children, m_scriptEngine);

    do {
        m_scriptEngine.evaluate(script);
        if (m_scriptEngine.hasUncaughtException ()) {
            *errorMessage = QCoreApplication::tr("Exception at line %1: %2").arg(m_scriptEngine.uncaughtExceptionLineNumber()).arg(engineError(m_scriptEngine));
            break;
        }
        rc = true;
    } while (false);
    m_scriptEngine.popContext();

    if (!rc) {
        Error error;
        error.objectName = widget->objectName();
        error.script = script;
        error.errorMessage = *errorMessage;
        m_errors.push_back(error);
    }
    return rc;
}

void QFormScriptRunner::QFormScriptRunnerPrivate::initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine) {
    // Populate the script variables. This pushes a context which must be popped.
    QScriptContext *ctx = scriptEngine.pushContext();
    QScriptValue widgetObject =  scriptEngine.newQObject(w);
    QScriptValue childrenArray = scriptEngine.newArray (children.size());

    for(int i = 0; i < children.size(); i++) {
        childrenArray.setProperty(i, scriptEngine.newQObject(children[i]));
    }

    const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
    ctx ->activationObject().setProperty(strings.scriptWidgetVariable, widgetObject);
    ctx ->activationObject().setProperty(strings.scriptChildWidgetsVariable, childrenArray);
}

QString QFormScriptRunner::QFormScriptRunnerPrivate::engineError(QScriptEngine &scriptEngine) {
    QScriptValue error = scriptEngine.evaluate(QLatin1String("Error"));
    if (error.isValid())
        return error.toString();
    return QCoreApplication::tr("Unknown error");
}
// -- QFormScriptRunner

QFormScriptRunner::QFormScriptRunner() : m_impl(new QFormScriptRunnerPrivate)
{
}

QFormScriptRunner::~QFormScriptRunner()
{
    delete m_impl;
}

bool QFormScriptRunner::run(const DomWidget *domWidget,
                            const QString &customWidgetScript,
                            QWidget *widget, const WidgetList &children,
                            QString *errorMessage)
{
    typedef QList<DomScript*> DomScripts;

    const Options scriptOptions =  m_impl->options();
    if (scriptOptions & DisableScripts)
        return true;
    // get list
    const DomScripts domScripts = domWidget->elementScript();
    // Concatenate snippets, starting with custom widget script
    QString  script = customWidgetScript;
    if (script.isEmpty() && domScripts.empty())
        return true;

    foreach (const DomScript *scriptSnippet, domScripts) {
        // Ensure new line
        if (!script.isEmpty() && !script.endsWith(QLatin1Char('\n')))
            script += QLatin1Char('\n');
        script += scriptSnippet->text();
    }

    if (script.isEmpty())
        return true;

    const bool rc =  m_impl->run(script, widget, children, errorMessage);

    if (debugFormScriptRunner) {
        qDebug() << "For " << widget << " with " << children.size() << " children, ran: " << script;
        if (!rc)
            qDebug() << *errorMessage;
    }

    if (!rc) {
        if (!(scriptOptions & DisableWarnings)) {
            const QString message = QCoreApplication::tr("An error occurred while running the script for %1: %2\nScript: %3").
                arg(widget->objectName()).arg(*errorMessage).arg(script);
            qWarning() <<  message;
        }
    }
    return rc;
}

QFormScriptRunner::Options QFormScriptRunner::options() const
{
    return  m_impl->options();
}

void QFormScriptRunner::setOptions(Options options)
{
     m_impl->setOptions(options);
}

QFormScriptRunner::Errors QFormScriptRunner::errors() const
{
    return m_impl->errors();
}

void QFormScriptRunner::clearErrors()
{
     m_impl->clearErrors();
}

#ifdef QFORMINTERNAL_NAMESPACE
} // namespace QFormInternal
#endif

QT_END_NAMESPACE


text:
function gradientColor(area,ctx,data,statData,posi,posj,othervars) {
	// v0 = left xAxis of rectangle or xAxis of center
	// v1 = top yAxis of rectangle or yAxis of center
	// v2 = right xAxis of rectangle or internal radius (=0 for PolarArea, Pie and Radar)
	// v3 = bottom yAxis or rectangle or external radius
	var grd, gradientColors;
	if (area=="SHAPESINCHART_RECT") {
		grd = ctx.createLinearGradient(othervars.xPosLeft, othervars.yPosBottom, othervars.xPosLeft, othervars.yPosTop);
		gradientColors = othervars.gradientColors;
	}else if (area=="SHAPESINCHART_ELLIPSE" || area=="SHAPESINCHART_REGULARSHAPE" || area=="SHAPESINCHART_CIRCLE") {
		grd = ctx.createRadialGradient(othervars.midPosX, othervars.midPosY, 0, othervars.midPosX, othervars.midPosY , othervars.radius);
		gradientColors = othervars.gradientColors;
	}
	else {
		switch(ctx.tpchart) {
			case "Radar" :
				if (area == "COLOR") {
					grd = ctx.createRadialGradient(othervars.midPosX, othervars.midPosY, 0, othervars.midPosX, othervars.midPosY , othervars.ext_radius);
				} else {
					grd = ctx.createRadialGradient(othervars.xPosLeft + (othervars.xPosRight - othervars.xPosLeft) / 2, othervars.yPosBottom + (othervars.yPosTop - othervars.yPosBottom) / 2, 0, othervars.xPosLeft + (othervars.xPosRight - othervars.xPosLeft) / 2, othervars.yPosBottom + (othervars.yPosTop - othervars.yPosBottom) / 2, Math.max((othervars.xPosRight - othervars.xPosLeft) / 2, (othervars.yPosTop - othervars.yPosBottom) / 2));
				}
				gradientColors = data.datasets[posi].gradientColors;
				break;
			case "PolarArea" :
			case "Pie" :
			case "Doughnut" :
				if (area == "FILLCOLOR") {
					grd = ctx.createRadialGradient(statData[0][0].midPosX, statData[0][0].midPosY, othervars.scaleAnimation*statData[0][posj].int_radius, statData[0][0].midPosX, statData[0][0].midPosY , othervars.scaleAnimation* statData[0][posj].radiusOffset);
				} else {
					grd = ctx.createRadialGradient(othervars.xPosLeft + (othervars.xPosRight - othervars.xPosLeft) / 2, othervars.yPosBottom + (othervars.yPosTop - othervars.yPosBottom) / 2, 0, othervars.xPosLeft + (othervars.xPosRight - othervars.xPosLeft) / 2, othervars.yPosBottom + (othervars.yPosTop - othervars.yPosBottom) / 2, Math.max((othervars.xPosRight - othervars.xPosLeft) / 2, (othervars.yPosTop - othervars.yPosBottom) / 2));
				}
				gradientColors = data.datasets[posi].gradientColors;
				break;
			case "Line" :
			case "Bar" :
			case "StackedBar" :
				grd = ctx.createLinearGradient(othervars.xPosLeft, othervars.yPosBottom, othervars.xPosLeft, othervars.yPosTop);
				gradientColors = data.datasets[posi].gradientColors;
				break;
			case "HorizontalBar" :
			case "HorizontalStackedBar" :
				grd = ctx.createLinearGradient(othervars.xPosLeft, othervars.yPosBottom, othervars.xPosRight, othervars.yPosBottom);
				gradientColors = data.datasets[posi].gradientColors;
				break;
			default :
				break;

		}
	}
	var steps = gradientColors.length;
	var currentStepValue = 0;
	var stepValues = [];
	var PERCENT_REGEX = /(\d{1,2}|100)%\s*?$/g
	for (var iter = 0; iter < steps; iter++) {
		var userStepValue = gradientColors[iter].match(PERCENT_REGEX);
		if (!userStepValue) {
			stepValues[iter] = false;
			continue;
		}
		userStepValue = parseFloat(userStepValue) / 100.0;
		stepValues[iter] = userStepValue;
	}
	for (var iter = 0; iter < steps; iter++) {
		if (stepValues[iter] === false) {
			if (iter == 0) {
				stepValues[iter] = 0;
			} else if (iter == steps - 1) {
				stepValues[iter] = 1;
			} else {
				// found next stepValue which isn't false
				var s = iter + 1;
				while (s < steps - 1 && stepValues[s] === false) {
					s++;
				}
				var lastStep = ((iter == 0) ? 0 : stepValues[iter - 1]);
				stepValues[iter] = ((s >= steps - 1) ? 1 : stepValues[s + 1]) - lastStep;
				stepValues[iter] = lastStep + stepValues[iter] / (s - iter + 1);
			}
		}
		GradientcolorsWithoutStep = gradientColors[iter].replace(PERCENT_REGEX, "").trim();
		grd.addColorStop(stepValues[iter], GradientcolorsWithoutStep);
	}
	return grd;
}


text:
> [Please use wind rider's fork of this library, he's done a miuch better job of maintaining this library than I have][wind-rider]

## Hit the ground runnning

```
npm install --save nuimo-client
```

## What is this?

A simple client library for communicating with the [senic nuimo][nuimo-docs],
via the BLE (Bluetooth Low Energy) API ([read more here][nuimo-ble]).

```javascript
import withNuimo from "nuimo-client";

// log updates
withNuimo().then(nuimo =>
  nuimo.listen(data =>
    console.log(data)));
```

## Missing Features

Due to the partially undocumated nature of the BLE API only a subset of
functionality has been implemented thus far, which is mostly the fly
gesuture.

[wind-rider]: https://github.com/wind-rider/nuimo-client.ts
[nuimo-docs]: https://www.senic.com/developers
[nuimo-ble]: https://medium.com/@senic/developing-for-the-nuimo-controller-7292becfacff


text:
/**
@file	Si5351C_wxgui.cpp
@author	Lime Microsystems
@brief 	panel for configuring Si5351C
*/

#include "Si5351C_wxgui.h"
#include "Si5351C.h"
#include "lms7_device.h"
#include <LMSBoards.h>

//(*InternalHeaders(Si5351C_wxgui)
#include <wx/intl.h>
#include <wx/string.h>
//*)

#include <wx/filedlg.h>
#include <wx/wx.h>

using namespace lime;

//(*IdInit(Si5351C_wxgui)
const long Si5351C_wxgui::ID_BUTTON2 = wxNewId();
const long Si5351C_wxgui::ID_BUTTON4 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT1 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL1 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT14 = wxNewId();
const long Si5351C_wxgui::ID_BUTTON1 = wxNewId();
const long Si5351C_wxgui::ID_BUTTON5 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT2 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT11 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT12 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT13 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT3 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX1 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL2 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX9 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT4 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX2 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL3 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX10 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT5 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX3 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL4 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX11 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT6 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX4 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL5 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX12 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT7 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX5 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL6 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX13 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT8 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX6 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL7 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX14 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT9 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX7 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL8 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX15 = wxNewId();
const long Si5351C_wxgui::ID_STATICTEXT10 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX8 = wxNewId();
const long Si5351C_wxgui::ID_TEXTCTRL9 = wxNewId();
const long Si5351C_wxgui::ID_CHECKBOX16 = wxNewId();
const long Si5351C_wxgui::ID_BUTTON3 = wxNewId();
//*)

BEGIN_EVENT_TABLE(Si5351C_wxgui, wxFrame)
//(*EventTable(Si5351C_wxgui)
//*)
END_EVENT_TABLE()
#include <vector>

Si5351C_wxgui::Si5351C_wxgui(wxWindow* parent, wxWindowID id, const wxString &title, const wxPoint& pos, const wxSize& size, int styles, wxString idname)
{
    lmsControl = NULL;

    wxFlexGridSizer* FlexGridSizer4;
    wxFlexGridSizer* FlexGridSizer3;
    wxFlexGridSizer* FlexGridSizer5;
    wxFlexGridSizer* FlexGridSizer9;
    wxFlexGridSizer* FlexGridSizer2;
    wxFlexGridSizer* FlexGridSizer6;
    wxStaticBoxSizer* StaticBoxSizer1;
    wxFlexGridSizer* FlexGridSizer1;

    Create(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, styles, _T("wxID_ANY"));
    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
    FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
    FlexGridSizer3 = new wxFlexGridSizer(0, 3, 0, 0);
    StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, this, _("Si5351C"));
    btnLoadFile = new wxButton(this, ID_BUTTON2, _("Upload register map from file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
    StaticBoxSizer1->Add(btnLoadFile, 1, wxEXPAND, 5);
    btnResetToDefaults = new wxButton(this, ID_BUTTON4, _("Reset register map to default"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
    StaticBoxSizer1->Add(btnResetToDefaults, 1, wxEXPAND, 5);
    FlexGridSizer3->Add(StaticBoxSizer1, 1, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer2 = new wxFlexGridSizer(0, 2, 5, 5);
    StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("CLKIN Frequency (MHz)"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
    FlexGridSizer2->Add(StaticText1, 1, wxTOP | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtCLKIN_MHz = new wxTextCtrl(this, ID_TEXTCTRL1, _("30.72"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
    FlexGridSizer2->Add(txtCLKIN_MHz, 1, wxTOP | wxEXPAND, 5);

    const wxString clksrcChoices[] = { _("XTAL"), _("CLKIN") };
    rgrClkSrc = new wxRadioBox(this, wxNewId(), _("PLL src"), wxDefaultPosition, wxDefaultSize, 2, clksrcChoices, 2, wxRA_SPECIFY_COLS, wxDefaultValidator, _T("ID_RADIOBOX1"));
    FlexGridSizer2->Add(rgrClkSrc, 1, wxALL | wxEXPAND, 0);

    const wxString xtalfreqChoices[] = { _("25 MHz"), _("27 MHz") };
    rgrXTALfreq = new wxRadioBox(this, wxNewId(), _("XTAL freq"), wxDefaultPosition, wxDefaultSize, 2, xtalfreqChoices, 2, wxRA_SPECIFY_COLS, wxDefaultValidator, _T("ID_RADIOBOX1"));
    FlexGridSizer2->Add(rgrXTALfreq, 1, wxALL | wxEXPAND, 0);

    FlexGridSizer3->Add(FlexGridSizer2, 1, wxLEFT | wxEXPAND, 5);
    FlexGridSizer6 = new wxFlexGridSizer(0, 1, 0, 0);
    lblStatus = new wxStaticText(this, ID_STATICTEXT14, _("SYS_INIT:\t\? \t SYS_INIT_STKY:\t\?\nLOL_B:\t\?  \tLOL_B_STKY:\t\?\nLOL_A:\t\?  \tLOL_A_STKY:\t\?\nLOS:\t\?  \tLOS_STKY:\t\?"), wxDefaultPosition, wxSize(282, 59), 0, _T("ID_STATICTEXT14"));
    FlexGridSizer6->Add(lblStatus, 1, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer5 = new wxFlexGridSizer(0, 3, 0, 0);
    btnReadStatus = new wxButton(this, ID_BUTTON1, _("Read Status"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
    FlexGridSizer5->Add(btnReadStatus, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    btnClearStatus = new wxButton(this, ID_BUTTON5, _("Clear"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON5"));
    FlexGridSizer5->Add(btnClearStatus, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer6->Add(FlexGridSizer5, 1, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer3->Add(FlexGridSizer6, 1, wxALL | wxEXPAND, 5);
    FlexGridSizer1->Add(FlexGridSizer3, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer4 = new wxFlexGridSizer(0, 5, 0, 0);
    FlexGridSizer9 = new wxFlexGridSizer(0, 4, 0, 0);
    StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Pin Name"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
    FlexGridSizer9->Add(StaticText2, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    StaticText11 = new wxStaticText(this, ID_STATICTEXT11, _("Enable channel"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT11"));
    FlexGridSizer9->Add(StaticText11, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    StaticText12 = new wxStaticText(this, ID_STATICTEXT12, _("Output frequency (MHz)"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT12"));
    FlexGridSizer9->Add(StaticText12, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    StaticText13 = new wxStaticText(this, ID_STATICTEXT13, _("Invert output"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT13"));
    FlexGridSizer9->Add(StaticText13, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK0 = new wxStaticText(this, ID_STATICTEXT3, _("CLK0"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
    FlexGridSizer9->Add(lblCLK0, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK0 = new wxCheckBox(this, ID_CHECKBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
    chkEN_CLK0->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK0, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK0 = new wxTextCtrl(this, ID_TEXTCTRL2, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
    FlexGridSizer9->Add(txtFreq_CLK0, 1, wxEXPAND, 5);
    chkInvert_CLK0 = new wxCheckBox(this, ID_CHECKBOX9, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX9"));
    chkInvert_CLK0->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK0, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK1 = new wxStaticText(this, ID_STATICTEXT4, _("CLK1"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
    FlexGridSizer9->Add(lblCLK1, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK1 = new wxCheckBox(this, ID_CHECKBOX2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
    chkEN_CLK1->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK1, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK1 = new wxTextCtrl(this, ID_TEXTCTRL3, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
    FlexGridSizer9->Add(txtFreq_CLK1, 1, wxEXPAND, 5);
    chkInvert_CLK1 = new wxCheckBox(this, ID_CHECKBOX10, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX10"));
    chkInvert_CLK1->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK1, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK2 = new wxStaticText(this, ID_STATICTEXT5, _("CLK2"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5"));
    FlexGridSizer9->Add(lblCLK2, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK2 = new wxCheckBox(this, ID_CHECKBOX3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3"));
    chkEN_CLK2->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK2, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK2 = new wxTextCtrl(this, ID_TEXTCTRL4, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL4"));
    FlexGridSizer9->Add(txtFreq_CLK2, 1, wxEXPAND, 5);
    chkInvert_CLK2 = new wxCheckBox(this, ID_CHECKBOX11, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX11"));
    chkInvert_CLK2->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK2, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK3 = new wxStaticText(this, ID_STATICTEXT6, _("CLK3"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6"));
    FlexGridSizer9->Add(lblCLK3, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK3 = new wxCheckBox(this, ID_CHECKBOX4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX4"));
    chkEN_CLK3->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK3, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK3 = new wxTextCtrl(this, ID_TEXTCTRL5, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL5"));
    FlexGridSizer9->Add(txtFreq_CLK3, 1, wxEXPAND, 5);
    chkInvert_CLK3 = new wxCheckBox(this, ID_CHECKBOX12, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX12"));
    chkInvert_CLK3->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK3, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK4 = new wxStaticText(this, ID_STATICTEXT7, _("CLK4"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7"));
    FlexGridSizer9->Add(lblCLK4, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK4 = new wxCheckBox(this, ID_CHECKBOX5, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5"));
    chkEN_CLK4->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK4, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK4 = new wxTextCtrl(this, ID_TEXTCTRL6, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL6"));
    FlexGridSizer9->Add(txtFreq_CLK4, 1, wxEXPAND, 5);
    chkInvert_CLK4 = new wxCheckBox(this, ID_CHECKBOX13, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX13"));
    chkInvert_CLK4->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK4, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK5 = new wxStaticText(this, ID_STATICTEXT8, _("CLK5"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8"));
    FlexGridSizer9->Add(lblCLK5, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK5 = new wxCheckBox(this, ID_CHECKBOX6, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
    chkEN_CLK5->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK5, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK5 = new wxTextCtrl(this, ID_TEXTCTRL7, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL7"));
    FlexGridSizer9->Add(txtFreq_CLK5, 1, wxEXPAND, 5);
    chkInvert_CLK5 = new wxCheckBox(this, ID_CHECKBOX14, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX14"));
    chkInvert_CLK5->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK5, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK6 = new wxStaticText(this, ID_STATICTEXT9, _("CLK6"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT9"));
    FlexGridSizer9->Add(lblCLK6, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK6 = new wxCheckBox(this, ID_CHECKBOX7, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7"));
    chkEN_CLK6->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK6, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK6 = new wxTextCtrl(this, ID_TEXTCTRL8, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL8"));
    FlexGridSizer9->Add(txtFreq_CLK6, 1, wxEXPAND, 5);
    chkInvert_CLK6 = new wxCheckBox(this, ID_CHECKBOX15, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX15"));
    chkInvert_CLK6->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK6, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    lblCLK7 = new wxStaticText(this, ID_STATICTEXT10, _("CLK7"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT10"));
    FlexGridSizer9->Add(lblCLK7, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    chkEN_CLK7 = new wxCheckBox(this, ID_CHECKBOX8, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX8"));
    chkEN_CLK7->SetValue(true);
    FlexGridSizer9->Add(chkEN_CLK7, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    txtFreq_CLK7 = new wxTextCtrl(this, ID_TEXTCTRL9, _("27.0"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL9"));
    FlexGridSizer9->Add(txtFreq_CLK7, 1, wxEXPAND, 5);
    chkInvert_CLK7 = new wxCheckBox(this, ID_CHECKBOX16, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX16"));
    chkInvert_CLK7->SetValue(false);
    FlexGridSizer9->Add(chkInvert_CLK7, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer4->Add(FlexGridSizer9, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    btnConfigure = new wxButton(this, ID_BUTTON3, _("Configure Clocks"), wxDefaultPosition, wxSize(113, 61), 0, wxDefaultValidator, _T("ID_BUTTON3"));
    FlexGridSizer4->Add(btnConfigure, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
    FlexGridSizer1->Add(FlexGridSizer4, 1, wxALL | wxEXPAND, 5);
    SetSizer(FlexGridSizer1);
    FlexGridSizer1->Fit(this);
    FlexGridSizer1->SetSizeHints(this);

    Connect(ID_BUTTON2, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&Si5351C_wxgui::OnbtnLoadFileClick);
    Connect(ID_BUTTON4, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&Si5351C_wxgui::OnbtnResetToDefaultsClick);
    Connect(ID_BUTTON1, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&Si5351C_wxgui::OnbtnReadStatusClick);
    Connect(ID_BUTTON5, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&Si5351C_wxgui::OnbtnClearStatusClick);
    Connect(ID_BUTTON3, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&Si5351C_wxgui::OnbtnConfigureClockClick);
}

void Si5351C_wxgui::Initialize(lms_device_t* pModule)
{
    lmsControl = pModule;
}

void Si5351C_wxgui::BuildContent(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
}

Si5351C_wxgui::~Si5351C_wxgui()
{
}

void Si5351C_wxgui::OnbtnLoadFileClick(wxCommandEvent& event)
{
   wxFileDialog openFileDialog(this, _("Open project file"), "", "", "Register Files (*.h)|*.h|Text files (*.txt)|*.TXT", wxFD_OPEN|wxFD_FILE_MUST_EXIST);
    if (openFileDialog.ShowModal() == wxID_CANCEL)
        return;

    lime::Si5351C obj;
    obj.Initialize(((LMS7_Device*)lmsControl)->GetConnection());
    obj.LoadRegValuesFromFile(std::string(openFileDialog.GetPath().ToStdString()));
    if (obj.UploadConfiguration()!=0)
        wxMessageBox(wxString::Format(_("Configuration failed"), _("Error")));
}

void Si5351C_wxgui::OnbtnConfigureClockClick(wxCommandEvent& event)
{
    double refFreq;
    if (rgrClkSrc->GetSelection() == 0)
        refFreq = (rgrXTALfreq->GetSelection() == 0 ? 25 : 27);
    else
        txtCLKIN_MHz->GetValue().ToDouble(&refFreq);
    double freq[8];
    double clkin = refFreq * 1000000;
    txtFreq_CLK0->GetValue().ToDouble(&freq[0]);
    txtFreq_CLK1->GetValue().ToDouble(&freq[1]);
    txtFreq_CLK2->GetValue().ToDouble(&freq[2]);
    txtFreq_CLK3->GetValue().ToDouble(&freq[3]);
    txtFreq_CLK4->GetValue().ToDouble(&freq[4]);
    txtFreq_CLK5->GetValue().ToDouble(&freq[5]);
    txtFreq_CLK6->GetValue().ToDouble(&freq[6]);
    txtFreq_CLK7->GetValue().ToDouble(&freq[7]);

    for (int i = 0; i < 8 ; i++)
        freq[i] *= 1e6;

    if (!chkEN_CLK0->GetValue()) freq[0]  = 0;
    if (!chkEN_CLK1->GetValue()) freq[1]  = 0;
    if (!chkEN_CLK2->GetValue()) freq[2]  = 0;
    if (!chkEN_CLK3->GetValue()) freq[3]  = 0;
    if (!chkEN_CLK4->GetValue()) freq[4]  = 0;
    if (!chkEN_CLK5->GetValue()) freq[5]  = 0;
    if (!chkEN_CLK6->GetValue()) freq[6]  = 0;
    if (!chkEN_CLK7->GetValue()) freq[7]  = 0;

    if (chkInvert_CLK0->GetValue()) freq[0] *= -1;
    if (chkInvert_CLK1->GetValue()) freq[1] *= -1;
    if (chkInvert_CLK2->GetValue()) freq[2] *= -1;
    if (chkInvert_CLK3->GetValue()) freq[3] *= -1;
    if (chkInvert_CLK4->GetValue()) freq[4] *= -1;
    if (chkInvert_CLK5->GetValue()) freq[5] *= -1;
    if (chkInvert_CLK6->GetValue()) freq[6] *= -1;
    if (chkInvert_CLK7->GetValue()) freq[7] *= -1;

    lime::Si5351C obj;
    obj.Initialize(((LMS7_Device*)lmsControl)->GetConnection());

    obj.SetPLL(0,clkin,rgrClkSrc->GetSelection());
    obj.SetPLL(1,clkin,rgrClkSrc->GetSelection());

    for (int i = 0; i < 8;i++)
    {
        unsigned clock = abs(freq[i]);
        obj.SetClock(i,clock,clock!=0,freq[i]<0);
    }

    if (obj.ConfigureClocks()!=0 || obj.UploadConfiguration()!=0)
       wxMessageBox(wxString::Format(_("Configuration failed"), _("Error")));
}

void Si5351C_wxgui::OnbtnResetToDefaultsClick(wxCommandEvent& event)
{
    lime::Si5351C obj;
    obj.Initialize(((LMS7_Device*)lmsControl)->GetConnection());
    obj.Reset();
    obj.UploadConfiguration();
}

void Si5351C_wxgui::ModifyClocksGUI(const std::string &board)
{
    for(int i=0; i<8; ++i)
        ClockEnable(i, true);
    if(board == GetDeviceName(LMS_DEV_STREAM))
    {
        lblCLK0->SetLabel(_("CLK0 - CLK_IN"));
        lblCLK1->SetLabel(_("CLK1"));
        ClockEnable(1, false);
        lblCLK2->SetLabel(_("CLK2 - FCLK2"));
        lblCLK3->SetLabel(_("CLK3"));
        ClockEnable(3, false);
        lblCLK4->SetLabel(_("CLK4 - FCLK1"));
        lblCLK5->SetLabel(_("CLK5"));
        ClockEnable(5, false);
        lblCLK6->SetLabel(_("CLK6 - CLK_FPGA0"));
        lblCLK7->SetLabel(_("CLK7 - CLK_FPGA1"));
        rgrClkSrc->SetSelection(1);
    }
    else
    {
        lblCLK0->SetLabel(_("CLK0"));
        lblCLK1->SetLabel(_("CLK1"));
        lblCLK2->SetLabel(_("CLK2"));
        lblCLK3->SetLabel(_("CLK3"));
        lblCLK4->SetLabel(_("CLK4"));
        lblCLK5->SetLabel(_("CLK5"));
        lblCLK6->SetLabel(_("CLK6"));
        lblCLK7->SetLabel(_("CLK7"));
        rgrClkSrc->SetSelection(0);
    }
    Layout();
}

void Si5351C_wxgui::ClockEnable(unsigned int i, bool enabled)
{
    switch(i)
    {
    case 0:
        lblCLK0->Enable(enabled);
        chkEN_CLK0->Enable(enabled);
        txtFreq_CLK0->Enable(enabled);
        chkInvert_CLK0->Enable(enabled);
        break;
    case 1:
        lblCLK1->Enable(enabled);
        chkEN_CLK1->Enable(enabled);
        txtFreq_CLK1->Enable(enabled);
        chkInvert_CLK1->Enable(enabled);
        break;
    case 2:
        lblCLK2->Enable(enabled);
        chkEN_CLK2->Enable(enabled);
        txtFreq_CLK2->Enable(enabled);
        chkInvert_CLK2->Enable(enabled);
        break;
    case 3:
        lblCLK3->Enable(enabled);
        chkEN_CLK3->Enable(enabled);
        txtFreq_CLK3->Enable(enabled);
        chkInvert_CLK3->Enable(enabled);
        break;
    case 4:
        lblCLK4->Enable(enabled);
        chkEN_CLK4->Enable(enabled);
        txtFreq_CLK4->Enable(enabled);
        chkInvert_CLK4->Enable(enabled);
        break;
    case 5:
        lblCLK5->Enable(enabled);
        chkEN_CLK5->Enable(enabled);
        txtFreq_CLK5->Enable(enabled);
        chkInvert_CLK5->Enable(enabled);
        break;
    case 6:
        lblCLK6->Enable(enabled);
        chkEN_CLK6->Enable(enabled);
        txtFreq_CLK6->Enable(enabled);
        chkInvert_CLK6->Enable(enabled);
        break;
    case 7:
        lblCLK7->Enable(enabled);
        chkEN_CLK7->Enable(enabled);
        txtFreq_CLK7->Enable(enabled);
        chkInvert_CLK7->Enable(enabled);
        break;
    default:
        break;
    }
}

void Si5351C_wxgui::OnbtnReadStatusClick(wxCommandEvent& event)
{
    lime::Si5351C obj;
    obj.Initialize(((LMS7_Device*)lmsControl)->GetConnection());
    lime::Si5351C::StatusBits stat = obj.GetStatusBits();
    wxString text = wxString::Format("\
SYS_INIT:	%i 	 SYS_INIT_STKY:	%i\n\
LOL_B:	%i  	LOL_B_STKY:	%i\n\
LOL_A:	%i  	LOL_A_STKY:	%i\n\
LOS:	%i  	LOS_STKY:	%i", stat.sys_init, stat.sys_init_stky, stat.lol_b, stat.lol_b_stky, stat.lol_a, stat.lol_a_stky, stat.los, stat.los_stky);
lblStatus->SetLabel(text);
}

void Si5351C_wxgui::OnbtnClearStatusClick(wxCommandEvent& event)
{
    lime::Si5351C obj;
    obj.Initialize(((LMS7_Device*)lmsControl)->GetConnection());
    obj.ClearStatus();
    wxString text = wxString::Format("\
SYS_INIT:	%i 	 SYS_INIT_STKY:	%i\n\
LOL_B:	%i  	LOL_B_STKY:	%i\n\
LOL_A:	%i  	LOL_A_STKY:	%i\n\
LOS:	%i  	LOS_STKY:	%i", 0,0,0,0,0,0,0,0);
    lblStatus->SetLabel(text);
}


text:
This package is the first stable release of the Microsoft Azure Data Lake Analytics management client library.

### Breaking Changes

Polishing since last public beta release:
- Prepended `DataLakeAnalytics` prefix to all single / simple model names.
- Corrected the format of all `Guid` type properties / parameters.
- Corrected the format of all `ResourceIdentifier` type properties / parameters.
- Corrected the format of all `Uri` type properties / parameters.
- Corrected the suffix of `DateTimeOffset` properties / parameters.
- Corrected the return type and parameter name of some functions.
- Optimized the name of some models and functions.

### Other Changes

- Upgraded dependent Azure.ResourceManager to 1.3.2.
- Optimized the implementation of methods related to tag operations.

## 1.0.0-beta.1 (2022-09-15)

### Breaking Changes

New design of track 2 initial commit.

### Package Name

The package name has been changed from `Microsoft.Azure.Management.DataLake.Analytics` to `Azure.ResourceManager.DataLakeAnalytics`.

### General New Features

This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities:

    - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
    - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
    - HTTP pipeline with custom policies.
    - Better error-handling.
    - Support uniform telemetry across all languages.

This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).

> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).


text:
<?php

namespace Molajo\Factories\Cookie;

use CommonApi\IoC\FactoryInterface;
use CommonApi\IoC\FactoryBatchInterface;
use Molajo\IoC\FactoryMethod\Base as FactoryMethodBase;

/**
 * Cookie Factory Method
 *
 * @author     Amy Stephen
 * @license    http://www.opensource.org/licenses/mit-license.html MIT License
 * @copyright  2014-2015 Amy Stephen. All rights reserved.
 * @since      1.0.0
 */
class CookieFactoryMethod extends FactoryMethodBase implements FactoryInterface, FactoryBatchInterface
{
    /**
     * Constructor
     *
     * @param  array $options
     *
     * @since  1.0.0
     */
    public function __construct(array $options = array())
    {
        $options['product_name']             = basename(__DIR__);
        $options['store_instance_indicator'] = true;
        $options['product_namespace']        = 'Molajo\\User\\Cookie';

        parent::__construct($options);
    }

    /**
     * Factory Method Controller triggers the Factory Method to create the Class for the Service
     *
     * @return  $this
     * @since   1.0.0
     * @throws  \CommonApi\Exception\RuntimeException
     */
    public function instantiateClass()
    {
        $class = $this->product_namespace;

        $this->product_result = new $class(
            $request_cookies = $_COOKIE,
            $response_cookies = null,
            $expire = 2628000,
            $path = null,
            $domain = null,
            $secure = null,
            $http_only = false
        );
    }
}


text:
<?php

?>
<?php include '../../common/view/header.lite.html.php';?>

    <?php if($result == 'fail'):?>

<?php echo $lang->upgrade->fail;?>

<?php echo nl2br(join('\n', $errors)); ?>

    <?php else:?>

<?php echo $lang->upgrade->success;?>

<?php echo html::a('index.php', $lang->home, "class='btn btn-success'");?>

    <?php endif;?>

<?php include '../../install/view/footer.html.php';?>