text:
package net.dougqh.jak.repl;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import net.dougqh.jak.JavaMethodSignature;
import net.dougqh.jak.assembler.JakCondition;
import net.dougqh.jak.assembler.JakExpression;
import net.dougqh.jak.assembler.JakMacro;
import net.dougqh.jak.jvm.annotations.JvmOp;
import net.dougqh.jak.jvm.annotations.Symbol;
import net.dougqh.jak.jvm.annotations.SyntheticOp;
import net.dougqh.jak.jvm.annotations.WrapOp;
import net.dougqh.jak.jvm.assembler.JvmCodeWriter;
import net.dougqh.jak.jvm.operations.JvmOperation;
import net.dougqh.jak.jvm.operations.JvmOperations;
import net.dougqh.java.meta.types.JavaTypes;

final class ReplMethod {
	private static final List< ReplMethod > allMethods = gatherMethods();

	private static final List< ReplMethod > gatherMethods() {
		Method[] methods = JvmCodeWriter.class.getMethods();

		ArrayList< ReplMethod > replMethods = new ArrayList< ReplMethod >( methods.length );
		for ( Method method : methods ) {
			if ( include( method ) ) {
				try {
					replMethods.add( new ReplMethod( method ) );
				} catch ( Throwable t ) {
					System.err.println( method.getName() );
					t.printStackTrace();
					return Collections.emptyList();
				}
			}
		}
		replMethods.trimToSize();
		Collections.sort( replMethods, new MethodComparator() );

		return Collections.unmodifiableList( replMethods );
	}

	public static final Set< ReplMethod > findByOperator( final String operator ) {
		//Preservation of order is important
		LinkedHashSet< ReplMethod > matchingMethods = new LinkedHashSet< ReplMethod >( 4 );

		for ( ReplMethod replMethod : allMethods ) {
			if ( operator.equals( replMethod.getOperator() ) ) {
				matchingMethods.add( replMethod );
			}
		}
		return Collections.unmodifiableSet( matchingMethods );
	}

	public static final Set< ReplMethod > findByName( final String name ) {
		//Preservation of order is important
		LinkedHashSet< ReplMethod > matchingMethods = new LinkedHashSet< ReplMethod >( 4 );

		for ( ReplMethod method : allMethods ) {
			if ( method.getName().equals( name ) ) {
				matchingMethods.add( method );
			}
		}
		return Collections.unmodifiableSet( matchingMethods );
	}

	public static final Set< String > findLike( final String prefix ) {
		//Preservation of order is important
		LinkedHashSet< String > methodNames = new LinkedHashSet< String >();

		for ( ReplMethod method : allMethods ) {
			if ( method.getName().startsWith( prefix ) ) {
				methodNames.add( method.getName() );
			}
		}
		return Collections.unmodifiableSet( methodNames );
	}

	private final Method method;
	private final String name;
	private final ReplArgument[] arguments;

	private ReplMethod( final Method method ) {
		this.method = method;
		this.name = getNameOf( method );

		Class< ? >[] types = this.method.getParameterTypes();
		Annotation[][] parameterAnnotations = this.method.getParameterAnnotations();

		this.arguments = new ReplArgument[ types.length ];
		for ( int i = 0; i < types.length; ++i ) {
			this.arguments[ i ] = ReplArgument.find(
				types[ i ],
				isAnnotationPresent( parameterAnnotations[ i ], Symbol.class ) );
		}
	}

	private static final boolean isAnnotationPresent(
		final Annotation[] annotations,
		final Class< ? extends Annotation > annoClass )
	{
		for ( Annotation annotation: annotations ) {
			if ( annotation.annotationType().equals( annoClass ) ) {
				return true;
			}
		}
		return false;
	}

	public final String getName() {
		return this.name;
	}

	public final boolean isSynthetic() {
		return this.method.isAnnotationPresent( SyntheticOp.class );
	}

	public final boolean matchesStackTypes( final JakRepl repl ) {
		JvmOperation operation = getOperationOf( this.method );

		Type[] expectedTypes = operation.getStackOperandTypes().clone();
		reverse( expectedTypes );

		return repl.codeWriter().stackMonitor().typeStack().matches( expectedTypes );
	}

	private final void reverse( final Object[] array ) {
		for ( int i = 0; i < array.length / 2; ++i ) {
			Object tmp = array[ i ];
			array[ i ] = array[ array.length - 1 ];
			array[ array.length - 1 ] = tmp;
		}
	}

	public final String getOperator() {
		JvmOperation operation = getOperationOf( this.method );
		if ( operation != null ) {
			return operation.getOperator();
		} else {
			return null;
		}
	}

	public final ReplArgument[] getArguments() {
		return this.arguments;
	}

	public final Object[] parseArguments( final JakRepl repl, final List< String > argStrings ) {
		if ( this.arguments.length != argStrings.size() ) {
			throw new IllegalArgumentException();
		}

		Object[] values = new Object[ argStrings.size() ];
		for ( int i = 0; i < argStrings.size(); ++i ) {
			values[ i ] = this.arguments[ i ].parse( repl, argStrings.get( i ) );
		}
		return values;
	}

	public final void invoke(
		final JvmCodeWriter codeWriter,
		final Object... arguments  )
		throws IllegalArgumentException
	{
		try {
			method.invoke( codeWriter, arguments );
		} catch ( IllegalAccessException e ) {
			throw new IllegalStateException( e );
		} catch ( InvocationTargetException e ) {
			throw new IllegalStateException( e );
		}
	}

	private static final boolean include( final Method method ) {
		if ( ! isWritingMethod( method ) ) {
			return false;
		}

		JvmOp op = method.getAnnotation( JvmOp.class );
		if ( op != null && ! op.repl() ) {
			return false;
		}
		WrapOp wrapOp = method.getAnnotation( WrapOp.class );
		if ( wrapOp != null && ! wrapOp.repl() ) {
			return false;
		}
		SyntheticOp syntheticOp = method.getAnnotation( SyntheticOp.class );
		if ( syntheticOp != null && ! syntheticOp.repl() ) {
			return false;
		}

		Class< ? >[] argTypes = method.getParameterTypes();
		if ( containsCollectionType( argTypes ) ) {
			return false;
		}
		if ( containsMacroType( argTypes ) ) {
			return false;
		}
		if ( contains( argTypes, Method.class ) ) {
			return false;
		}
		if ( contains( argTypes, Field.class ) ) {
			return false;
		}
		if ( contains( argTypes, JavaMethodSignature.class ) ) {
			return false;
		}
		return true;
	}

	private static final boolean containsCollectionType( final Type[] types ) {
		for ( Type curType : types ) {
			if ( JavaTypes.isArrayType( curType ) ||
				JavaTypes.isObjectType( Collection.class ) )
			{
				return true;
			}
		}
		return false;
	}

	private static final boolean containsMacroType( final Type[] types ) {
		for ( Type curType : types ) {
			if ( curType.equals( JakMacro.class ) ) {
				return true;
			} else if ( curType.equals( JakExpression.class ) ) {
				return true;
			} else if ( curType.equals( JakCondition.class ) ) {
				return true;
			}
		}
		return false;
	}

	private static final boolean contains( final Type[] types, final Type type ) {
		for ( Type curType : types ) {
			if ( curType.equals( type ) ) {
				return true;
			}
		}
		return false;
	}

	private static final boolean isWritingMethod( final Method method ) {
		return method.getDeclaringClass().equals( JvmCodeWriter.class ) &&
			method.getReturnType().equals( JvmCodeWriter.class );
	}

	private static final String getNameOf( final Method method ) {
		JvmOp op = method.getAnnotation( JvmOp.class );
		if ( op != null ) {
			return JvmOperations.getPrototype( op.value() ).getId();
		}

		WrapOp wrapOp = method.getAnnotation( WrapOp.class );
		if ( wrapOp != null ) {
			return method.getName();
		}

		SyntheticOp synthOp = method.getAnnotation( SyntheticOp.class );
		if ( synthOp != null ) {
			return synthOp.id().isEmpty() ? method.getName() : synthOp.id();
		}

		throw new IllegalStateException( "Unannotated method " + method );
	}

	private static final JvmOperation getOperationOf( final Method method ) {
		JvmOp op = method.getAnnotation( JvmOp.class );
		if ( op != null ) {
			return JvmOperations.getPrototype( op.value() );
		}
		WrapOp wrapOp = method.getAnnotation( WrapOp.class );
		if ( wrapOp != null ) {
			return JvmOperations.getPrototype( wrapOp.value() );
		}
		return null;
	}

	private static final class MethodComparator implements Comparator< ReplMethod > {
		@Override
		public final int compare(
			final ReplMethod lhs,
			final ReplMethod rhs )
		{
			//Compare by name
			int nameCompare = lhs.getName().compareToIgnoreCase( rhs.getName() );
			if ( nameCompare != 0 ) {
				return nameCompare;
			}

			//Then argument length
			if ( lhs.arguments.length < rhs.arguments.length ) {
				return -1;
			} else if ( lhs.arguments.length > rhs.arguments.length ) {
				return 1;
			}

			//Finally, argument type - sort Symbol last, so that ints,
			//method descriptors, etc. are used as possible matches first
			for ( int i = 0; i < lhs.arguments.length; ++i ) {
				ReplArgument lhsArg = lhs.arguments[ i ];
				ReplArgument rhsArg = rhs.arguments[ i ];

				//Symbols sort last
				if ( rhsArg == ReplArgument.SYMBOL ) {
					return -1;
				} else if ( lhsArg == ReplArgument.SYMBOL ) {
					return 1;
				}
			}

			//Otherwise, equivalent
			return 0;
		}
	}
}


text:
'''
Create final data cubes.

Give the path to the data and which cube to create.
Puts the created cubes in a folder called "cubes" one level above where the
channel folders are.
'''

import glob
import os
import sys

from taskinit import ia

# Image product end to create cube from (i.e., image, residual, model, etc...)
output_type = sys.argv[-1]

# Name of the cube to make. The output_type is appended on
# (i.e., "M33_14B-088_HI.clean")
cube_name = sys.argv[-2]

# Path to the channel data
path = sys.argv[-3]

cube_path = os.path.join("/".join(path.rstrip("/").split("/")[:-1]), "cubes")

if not os.path.exists(cube_path):
    os.mkdir(cube_path)

search_string = "*.{}".format(output_type)
out_name = os.path.join(cube_path, "{0}.{1}".format(cube_name. output_type))

channel_direcs = glob.glob(os.path.join(path, "channel_*"))

# Sort by the channel number
min_chan = 10000
max_chan = 0

for channel in channel_direcs:
    # Last 3 characters
    chan_num = int(channel.split("_")[-1])
    if chan_num < min_chan:
        min_chan = chan_num

    if chan_num > max_chan:
        max_chan = chan_num

ordered_chans = []
for chan in xrange(min_chan, max_chan + 1):
    i = 0
    while True:
        chan_num = int(channel_direcs[i].split("_")[-1])
        if chan_num == chan:
            ordered_chans.append(channel_direcs[i])
            break
        i += 1
    else:
        print("No log found for channel " + str(chan))

channel_direcs = ordered_chans

images = []
for channel in channel_direcs:
    image = glob.glob(os.path.join(channel, search_string))
    if len(image) == 0:
        print("Cannot find image in " + channel)
        continue

    images.append(image[0])

ia.imageconcat(outfile=out_name, infiles=images)

redpajama_set_name: RedPajamaGithub


text:
/**
 * Index JS controller.
 */

// Use jQuery as $ within this file scope.
const $ = jQuery;

/**
 * Class Index
 */
class Index {

    constructor() {
    }

  /**
   * Contains DOM elements for caching.
   */
  cache() {
    this.loadMoreButton = document.getElementById('article-loadmore');
    this.newsContainer = document.getElementById('article-container');
    if (this.loadMoreButton) {
        this.maxPages = this.loadMoreButton.dataset.maxpages;
        this.page = this.loadMoreButton.dataset.page;
    }
  }

  /**
   * Contains all event listeners.
   */
  events() {
      if (this.loadMoreButton) {
          this.loadMoreButton.addEventListener('click', e => this.loadMore(e));
      }
  }

  /**
   * Fires on load more click on the news page.
   * Fetches more news results for the initial search query.
   *
   */
  loadMore() {
    this.loadMoreButton.disabled = true;
    this.loadMoreButton.className += ' loading';
    this.loadMoreButton.innerHTML = 'Ladataan';

    dp('Index/News', {
        partial: 'news-list',
        success: data => this.loadSuccess(data),
        error: error => {
          console.log(error);
        },
      });
  };

  loadSuccess(data) {
    this.page++;
    this.newsContainer.innerHTML += ( data );
    if (this.page >= this.maxPages ) {
        this.loadMoreButton.parentNode.removeChild(this.loadMoreButton);
    } else {
        this.loadMoreButton.disabled = false;
        this.loadMoreButton.innerHTML = 'Lataa lisää';
    }

    if (window.history) {

      // The url contains a page
      if (/sivu/.test(location.pathname)) {

        // Replace the current location with the new state.
        var path = location.pathname.replace(/sivu\/(\d+)/, 'sivu/' + this.page);

        // Push and change the full location path.
        window.history.pushState({}, 'Sivu', path);
      } else {

        // Push the state to the end of the current location.
        var url = 'sivu/' + this.page + '/';
        window.history.pushState({}, 'Sivu', url );
      }
    }
  }

  /**
   * Run when the document is ready.
   */
  docReady() {
    this.cache();
    this.events();
  }
}

module.exports = Index;


text:
@interface LZFirstViewContrller ()<LZSecondViewControllerProtocal, UIViewControllerTransitioningDelegate>
@property (nonatomic, strong) LZSecondViewController *toVC;
@property (nonatomic, strong) UIPercentDrivenInteractiveTransition *presentInteractiveTransition;
@property (nonatomic, strong) UIPercentDrivenInteractiveTransition *dismissInteractiveTransition;

@end

@implementation LZFirstViewContrller

- (void)viewDidAppear:(BOOL)animated{

    [super viewDidAppear:animated];

//    self.transitioningDelegate = self;
//    self.modalTransitionStyle = UIModalPresentationCustom;
}

- (void)viewDidLoad{

    [super viewDidLoad];

    UIScreenEdgePanGestureRecognizer *gesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(rightPanGesture:)];
    gesture.edges = UIRectEdgeRight;
    [self.view addGestureRecognizer:gesture];

}

- (void)rightPanGesture:(UIScreenEdgePanGestureRecognizer *)gesture{

    CGPoint distance = [gesture translationInView:[UIApplication sharedApplication].keyWindow];

    CGFloat percent = - distance.x / [UIScreen mainScreen].bounds.size.width ;
//     NSLog(@"%@, ---- %f", NSStringFromCGPoint(distance), percent);

    UIGestureRecognizerState state = [gesture state];

    if (state == UIGestureRecognizerStateBegan) {

        self.presentInteractiveTransition = [[UIPercentDrivenInteractiveTransition alloc] init];
        LZSecondViewController *toVC = [self viewControllerFromSB];
        self.toVC = toVC;
        toVC.transitioningDelegate = self;
        toVC.dismissDelegate = self;
        [self presentViewController:toVC animated:YES completion:nil];

    } else if (state == UIGestureRecognizerStateChanged){

        [self.presentInteractiveTransition updateInteractiveTransition:percent];

    }else if (state == UIGestureRecognizerStateCancelled || state == UIGestureRecognizerStateEnded){

        if (percent >= 0.5) {
            [self.presentInteractiveTransition finishInteractiveTransition];
        }else{
            [self.presentInteractiveTransition cancelInteractiveTransition];
        }
        self.presentInteractiveTransition = nil;
    }

}

- (LZSecondViewController *)viewControllerFromSB{

    UIStoryboard *SB = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];

    LZSecondViewController *toVC = [SB instantiateViewControllerWithIdentifier:@"LZSecondVC"];

    return toVC;
}

- (IBAction)presentButtonClick:(UIButton *)sender {

    LZSecondViewController *toVC = [self viewControllerFromSB];
    toVC.dismissDelegate = self;

    toVC.transitioningDelegate = self;
    [self presentViewController:toVC animated:YES completion:^{

    }];
}

- (void)secondViewControllerDidDismiss:(LZSecondViewController *)viewController{

    [self dismissViewControllerAnimated:YES completion:nil];

}

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{

    if ([presenting isKindOfClass:[LZFirstViewContrller class]]) {
        return [[LZPresentTransition alloc] init];
    }
    return nil;
}

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{

    return [[LZDismissTransition alloc] init];
}

- (id<UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id<UIViewControllerAnimatedTransitioning>)animator{

    return self.presentInteractiveTransition;
}
@end


text:
<?php

namespace Icybee\Modules\Forms\Blueprints;

$hooks = __NAMESPACE__ . '\Hooks::';

return array
(
	'events' => array
	(
		'Icybee\Modules\Users\LogoutOperation::process' => $hooks . 'on_user_logout'
	),

	'prototypes' => array
	(
		'Icybee\Modules\Forms\Blueprints\Blueprint::get_page_list' => $hooks . 'blueprint_get_page_list',
		'Icybee\Modules\Forms\Blueprints\Blueprint::get_progress' => $hooks . 'blueprint_get_progress',
		'Icybee\Modules\Forms\Blueprints\Blueprint::to_element' => $hooks . 'blueprint_to_element',
		'Icybee\Modules\Forms\Blueprints\Item::get_control' => $hooks . 'item_get_control'
	)
);


text:
@interface ViewController : UIViewController {
    CLController *locationContoller;
    IBOutlet UILabel *lat;
    IBOutlet UILabel *lon;
    IBOutlet UILabel *alt;
    IBOutlet UILabel *speed;
    IBOutlet UILabel *maxSpeed;
    IBOutlet UILabel *dist;
    IBOutlet UILabel *totalDist;
    IBOutlet UILabel *idle;
    IBOutlet UILabel *elapsed;
    IBOutlet UIProgressView *progressView;
    IBOutlet UIButton *button;
}

@property (nonatomic, strong) AppDelegate *appDelegate;
@property (nonatomic, strong) IBOutlet UILabel *lat;
@property (nonatomic, strong) IBOutlet UILabel *lon;
@property (nonatomic, strong) IBOutlet UILabel *speed;
@property (nonatomic, strong) IBOutlet UILabel *alt;
@property (nonatomic, strong) IBOutlet UILabel *maxSpeed;
@property (nonatomic, strong) IBOutlet UILabel *dist;
@property (nonatomic, strong) IBOutlet UILabel *totalDist;
@property (nonatomic, strong) IBOutlet UILabel *idle;
@property (nonatomic, strong) IBOutlet UILabel *elapsed;
@property (nonatomic, strong) IBOutlet UIProgressView *progressView;
@property (nonatomic, strong) IBOutlet UIButton *button;

- (IBAction)buttonClicked:(id)sender;
- (void)stopGettingLocation;
- (void)locationUpdate:(CLLocation *)location;
- (void)locationError:(NSError *)error;
- (void)initText;

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace OmniConf.Core.Model
{
    public class Speaker : BaseEntity
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string ImageFile { get; set; }
        public string Bio { get; set; }
        public int ConferenceId { get; set; }
    }
}


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using CIB.Exchange.Cexio.Messaging;
using CIB.Exchange.Model;
using Newtonsoft.Json;

namespace CIB.Exchange.Cexio
{
    public class CexioReactiveExchangeGateway : IReactiveExchangeGateway, IDisposable
    {
        private readonly List<CurrencyPair> _tickers;
        private readonly Uri WebsocketApi = new Uri("wss://ws.cex.io/ws/");
        private readonly string _key;
        private readonly string _secret;
        private readonly ReactiveWebSocket _client;
        private int _messageId = 1;

        private int id = 0;
        private string[] buffer = new string[10];

        private readonly Dictionary<string, Messaging.CexioOrderBook> _orderBooks = new Dictionary<string, Messaging.CexioOrderBook>();
        private readonly IDisposable _subscription;

        private readonly ReplaySubject<OrderBook> _orderBookSubject = new ReplaySubject<OrderBook>();
        private readonly ReplaySubject<AccountBalance> _balanceSubject = new ReplaySubject<AccountBalance>();
        private readonly Subject<OrderStatus> _ordersSubject = new Subject<OrderStatus>();

        private readonly ConcurrentDictionary<string, Order> _request = new ConcurrentDictionary<string, Order>();

        public CexioReactiveExchangeGateway(string key, string secret, IEnumerable<CurrencyPair> tickers)
        {
            _tickers = tickers.ToList();
            _key = key;
            _secret = secret;
            _client = new ReactiveWebSocket(WebsocketApi);
            _subscription = _client.Connect().Subscribe(MessageHandler);
        }

        private async void MessageHandler(string message)
        {
            buffer[id++ % 10] = message;

            var wrapper = JsonConvert.DeserializeObject<CexioMessageWrapper>(message);
            if (wrapper == null)
                return;
            switch (wrapper.e)
            {
                case "connected":
                    await Authorize();
                    break;
                case "auth":
                    if (wrapper.ok == "ok")
                    {
                        foreach (var ticker in _tickers)
                            await SubscribeToOrderBook(ticker);
                        await RequestBalance();
                    }
                    else
                    {
                        throw new NotImplementedException();
                    }
                    break;
                case "ping":
                    await Pong();
                    break;
                case "order-book-subscribe":
                    var orderBook = JsonConvert.DeserializeObject<Messaging.CexioOrderBook>(Convert.ToString(wrapper.data));
                    ReadOrderBook(orderBook);
                    break;
                case "md_update":
                    var mdupdate = JsonConvert.DeserializeObject<CexioMarketDataUpdate>(Convert.ToString(wrapper.data));
                    UpdateOrderBook(mdupdate);
                    break;
                case "get-balance":
                    var getbalance = JsonConvert.DeserializeObject<CexioBalance>(Convert.ToString(wrapper.data));
                    PublishBalance(getbalance);
                    break;
                case "place-order":
                    var placement = JsonConvert.DeserializeObject<OrderPlacementResponse>(Convert.ToString(wrapper.data));
                    PublishOrder(wrapper.oid, wrapper.ok == "ok", placement);
                    break;
                case "cancel-order":
                    var cancellation = JsonConvert.DeserializeObject<OrderCancellationResponse>(Convert.ToString(wrapper.data));
                    PublishOrder(wrapper.oid, wrapper.ok == "ok", cancellation);
                    break;
                case "disconnected":
                    break;
                case "order":
                    // ignore for now
                    break;
                case "balance":
                    // ignore for now
                    break;
                case "obalance":
                    // ignore for now
                    break;
                case "tx":
                    // ignore for now
                    break;
                default:
                    Debug.Assert(false);
                    break;
            }
        }

        private void PublishOrder(string oid, bool ok, OrderPlacementResponse placement)
        {
            Order order = null;
            if (!_request.TryRemove(oid, out order))
                throw new NotImplementedException();
            var orderStatus = ok ? new OrderStatus(order.Id, placement.id, OrderState.Accepted) : new OrderStatus(order.Id, null, OrderState.RejectedByExchange, placement.error);
            _ordersSubject.OnNext(orderStatus);
        }

        private void PublishOrder(string oid, bool ok, OrderCancellationResponse placement)
        {
            Order order = null;
            if (!_request.TryRemove(oid, out order))
                throw new NotImplementedException();
            var orderStatus = ok ? new OrderStatus(order.Id, placement.order_id, OrderState.Cancelled) : new OrderStatus(order.Id, placement.order_id, OrderState.CancelReject, placement.error);
            _ordersSubject.OnNext(orderStatus);
        }

        private void PublishBalance(CexioBalance getbalance)
        {
            var accountBalance = new AccountBalance()
            {
                Bitcoin = getbalance.balance["BTC"],
                Ethereum = getbalance.balance["ETH"],
                BitcoinCash = getbalance.balance["BCH"],
                Euro = getbalance.balance["EUR"]
            };
            _balanceSubject.OnNext(accountBalance);
        }

        private async Task RequestBalance()
        {
            var balance = JsonConvert.SerializeObject(new
            {
                e = "get-balance",
                data = new { },
                oid = GetOID("get-balance")
            });
            await _client.Publish(balance);
        }

        private void UpdateOrderBook(CexioMarketDataUpdate marketDataUpdate)
        {
            var cexioOrderBook = _orderBooks[marketDataUpdate.pair];
            cexioOrderBook.Update(marketDataUpdate);
            PublishOrderBook(cexioOrderBook);
        }

        private void ReadOrderBook(Messaging.CexioOrderBook orderBook)
        {
            _orderBooks.Add(orderBook.pair, orderBook);
            PublishOrderBook(orderBook);
        }

        private async Task Pong()
        {
            var pong = JsonConvert.SerializeObject(new
            {
                e = "pong"
            });
            await _client.Publish(pong);
        }

        private async Task SubscribeToOrderBook(CurrencyPair ticker)
        {
            var orderBook = JsonConvert.SerializeObject(new
            {
                e = "order-book-subscribe",
                data = new
                {
                    pair = new[] { ticker.Base, ticker.Quote },
                    subscribe = true,
                    depth = 10,
                },
                oid = GetOID("order-book-subscribe")
            });
            await _client.Publish(orderBook);
        }

        private string GetOID(string orderBookSubscribe)
        {
            return DateTime.UtcNow.ToUnixTimestamp() + "_" + _messageId++ + "_" + orderBookSubscribe;
        }

        private async Task Authorize()
        {
            var timestamp = DateTime.UtcNow.ToUnixTimestamp();
            var authorisation = JsonConvert.SerializeObject(new
            {
                e = "auth",
                auth = new
                {
                    key = _key,
                    signature = SignHelper.HmacSha256(_secret, timestamp + _key),
                    timestamp
                }
            });
            await _client.Publish(authorisation);
        }

        public IObservable<OrderBook> GetMarketData()
        {
            return _orderBookSubject;
        }

        public async void AddOrder(Order order)
        {
            var value = new
            {
                e = "place-order",
                data = new
                {
                    pair = new[] { order.Pair.Base, order.Pair.Quote },
                    amount = order.Volume,
                    price = order.Price,
                    type = ConvertToDto(order.Side)
                },
                oid = DateTime.UtcNow.ToUnixTimestamp() + "_" + _messageId++ + "_place-order"
            };
            var orderPlacement = JsonConvert.SerializeObject(value: value);
            _request.TryAdd(value.oid, order);
            await _client.Publish(orderPlacement);
        }

        private string ConvertToDto(Side orderSide)
        {
            switch (orderSide)
            {
                case Side.Buy:
                    return "buy";
                case Side.Sell:
                    return "sell";
                default:
                    Debug.Fail("Unkown type");
                    throw new NotImplementedException();
            }
        }

        private void PublishOrderBook(Messaging.CexioOrderBook orderBook)
        {
            _orderBookSubject.OnNext(ToDomain(orderBook));
        }

        private OrderBook ToDomain(Messaging.CexioOrderBook orderBook)
        {
            //var timestamp = DateTimeUtilities.FromUnixTimestamp(orderBook.timestamp);
            var dateTime = DateTime.UtcNow;

            return new OrderBook(CexioConverters.ConvertTicker(orderBook.pair), orderBook.bids, orderBook.asks, dateTime);
        }

        public void Dispose()
        {
            _subscription?.Dispose();
        }

        public string Name => "Cexio";
        public IObservable<AccountBalance> GetBalance()
        {
            return _balanceSubject;
        }

        public IObservable<OrderStatus> GetOrders()
        {
            return _ordersSubject;
        }

        public async void CancelOrder(Order order)
        {
            var value = new
            {
                e = "cancel-order",
                data = new
                {
                    order_id = order.ExchangeOrderId,
                },
                oid = GetOID("cancel-order")
            };
            var orderCancelation = JsonConvert.SerializeObject(value: value);
            _request.TryAdd(value.oid, order);
            await _client.Publish(orderCancelation);

        }
    }
}


text:
from urllib.parse import urlencode

from django.conf import settings
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils import translation
from django.utils.translation import pgettext
from twilio.rest import Client

from two_factor.middleware.threadlocals import get_current_request

# Supported voice languages, see http://bit.ly/187I5cr
VOICE_LANGUAGES = ('en', 'en-gb', 'es', 'fr', 'it', 'de', 'da-DK', 'de-DE',
                   'en-AU', 'en-CA', 'en-GB', 'en-IN', 'en-US', 'ca-ES',
                   'es-ES', 'es-MX', 'fi-FI', 'fr-CA', 'fr-FR', 'it-IT',
                   'ja-JP', 'ko-KR', 'nb-NO', 'nl-NL', 'pl-PL', 'pt-BR',
                   'pt-PT', 'ru-RU', 'sv-SE', 'zh-CN', 'zh-HK', 'zh-TW')

class Twilio(object):
    """
    Gateway for sending text messages and making phone calls using Twilio_.

    All you need is your Twilio Account SID and Token, as shown in your Twilio
    account dashboard.

    ``TWILIO_ACCOUNT_SID``
      Should be set to your account's SID.

    ``TWILIO_AUTH_TOKEN``
      Should be set to your account's authorization token.

    ``TWILIO_CALLER_ID``
      Should be set to a verified phone number. Twilio_ differentiates between
      numbers verified for making phone calls and sending text messages.

    ``TWILIO_MESSAGING_SERVICE_SID``
      Can be set to a Twilio Messaging Service for SMS. This service can wrap multiple
      phone numbers and choose one depending on the destination country.
      When left empty the ``TWILIO_CALLER_ID`` will be used as sender ID.

    .. _Twilio: http://www.twilio.com/
    """

    def __init__(self):
        self.client = Client(getattr(settings, 'TWILIO_ACCOUNT_SID'),
                             getattr(settings, 'TWILIO_AUTH_TOKEN'))

    def make_call(self, device, token):
        locale = translation.get_language()
        validate_voice_locale(locale)

        request = get_current_request()
        url = reverse('two_factor_twilio:call_app', kwargs={'token': token})
        url = '%s?%s' % (url, urlencode({'locale': locale}))
        uri = request.build_absolute_uri(url)
        self.client.calls.create(to=device.number.as_e164,
                                 from_=getattr(settings, 'TWILIO_CALLER_ID'),
                                 url=uri, method='GET', timeout=15)

    def send_sms(self, device, token):
        """
        send sms using template 'two_factor/twilio/sms_message.html'
        """
        body = render_to_string(
            'two_factor/twilio/sms_message.html',
            {'token': token}
        )
        send_kwargs = {
            'to': device.number.as_e164,
            'body': body
        }
        messaging_service_sid = getattr(settings, 'TWILIO_MESSAGING_SERVICE_SID', None)
        if messaging_service_sid is not None:
            send_kwargs['messaging_service_sid'] = messaging_service_sid
        else:
            send_kwargs['from_'] = getattr(settings, 'TWILIO_CALLER_ID')

        self.client.messages.create(**send_kwargs)

def validate_voice_locale(locale):
    with translation.override(locale):
        voice_locale = pgettext('twilio_locale', 'en')
        if voice_locale not in VOICE_LANGUAGES:
            raise NotImplementedError('The language "%s" is not '
                                      'supported by Twilio' % voice_locale)


text:
u32 Backdoor_MouseId()
{
    u16 command = (u16)Backdoor_Commands::PointerCommand;
    u32 parameter = (u32)Backdoor_MouseCommands::GetId;

    _asm
    {
        mov eax, BACKDOOR_MAGIC
        mov ebx, [parameter]
        mov cx, [command]
        mov dx, BACKDOOR_PORT

        in eax, dx
    }

    // Find where is the ID
    return 0;
}
u16 Backdoor_MouseStatus()
{
    u16 command = (u16)Backdoor_Commands::PointerStatus;
    u32 status;

    _asm
    {
        mov eax, BACKDOOR_MAGIC
        mov ebx, 0
        mov cx, [command]
        mov dx, BACKDOOR_PORT

        in eax, dx

        mov [status], eax
    }

    return status;
}
void Backdoor_MouseData(void* buffer = null, u32 words = 1)
{
    u16 command = (u16)Backdoor_Commands::PointerData;
    u32 a, b, c, d;

    _asm
    {
        mov eax, BACKDOOR_MAGIC
        mov ebx, words
        mov cx, [command]
        mov dx, BACKDOOR_PORT

        in eax, dx

        mov [a], eax
        mov [b], ebx
        mov [c], ecx
        mov [d], edx
    }

    if (buffer)
    {
        u32* data = (u32*)buffer;

        data[0] = a;
        data[1] = b;
        data[2] = c;
        data[3] = d;
    }
}
void Backdoor_MouseRequest(bool absolute = true)
{
    u16 command = (u16)Backdoor_Commands::PointerCommand;
    u32 parameter = (u32)(absolute ? Backdoor_MouseCommands::GetAbsolute : Backdoor_MouseCommands::GetRelative);

    _asm
    {
        mov eax, BACKDOOR_MAGIC
        mov ebx, [parameter]
        mov cx, [command]
        mov dx, BACKDOOR_PORT

        in eax, dx
    }
}

void Backdoor_MouseInitialize()
{
    Backdoor_MouseId();
    Backdoor_MouseStatus();
    Backdoor_MouseData();
    Backdoor_MouseRequest();
}
bool Backdoor_MouseGetPacket(Backdoor_MousePacket* packet)
{
    u16 status = Backdoor_MouseStatus();
    if (status < 4)
        return false;

    Backdoor_MouseData(packet, 4);
    return true;
}


text:
namespace WindowsUI.TQS.SystemForm
{
    partial class ImageButton
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region 组件设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.ptbBgImage = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.ptbBgImage)).BeginInit();
            this.SuspendLayout();
            //
            // ptbBgImage
            //
            this.ptbBgImage.Image = global::WindowsUI.TQS.Properties.Resources.btn;
            this.ptbBgImage.Location = new System.Drawing.Point(-1, -1);
            this.ptbBgImage.Name = "ptbBgImage";
            this.ptbBgImage.Size = new System.Drawing.Size(205, 63);
            this.ptbBgImage.TabIndex = 0;
            this.ptbBgImage.TabStop = false;
            this.ptbBgImage.Click += new System.EventHandler(this.ImageButton_Click);
            //
            // ImageButton
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.Transparent;
            this.Controls.Add(this.ptbBgImage);
            this.Name = "ImageButton";
            this.Size = new System.Drawing.Size(201, 60);
            ((System.ComponentModel.ISupportInitialize)(this.ptbBgImage)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.PictureBox ptbBgImage;
    }
}


text:
package com.blueprint.centromere.ws.documentation;

import com.blueprint.centromere.core.model.Model;
import com.blueprint.centromere.core.repository.QueryParameterDescriptor;
import com.blueprint.centromere.core.repository.QueryParameterUtil;
import com.blueprint.centromere.ws.config.ModelResourceRegistry;
import com.fasterxml.classmate.TypeResolver;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.Operation;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.OperationBuilderPlugin;
import springfox.documentation.spi.service.contexts.OperationContext;
import springfox.documentation.swagger.common.SwaggerPluginSupport;

/**
 * Springfox plugin for adding {@link Model} query options to the auto-generated Swagger
 *   documentation.
 *
 * @author woemler
 * @since 0.4.1
 */
public class ModelParameterBuilderPlugin implements OperationBuilderPlugin {

    private static final String FIND_METHOD = "find";
    private static final Logger LOGGER = LoggerFactory.getLogger(ModelParameterBuilderPlugin.class);

    @Autowired
    private TypeResolver typeResolver;

    @Autowired
    private ModelResourceRegistry registry;

    @Override
    public void apply(OperationContext context) {
        LOGGER.info("Swagger Plugin - OperationContext - Name: " + context.getName());
        if (FIND_METHOD.equals(context.getName())) {
            Operation operation = context.operationBuilder().build();
            List<Parameter> parameters = operation.getParameters() != null
                ? operation.getParameters() : new ArrayList<>();
            for (Class<? extends Model<?>> model: registry.getRegisteredModels() ) {
                for (QueryParameterDescriptor descriptor: QueryParameterUtil.getAvailableQueryParameters(model).values()) {
                    parameters.add(createParameterFromDescriptior(descriptor));
                }
            }
            context.operationBuilder().parameters(parameters);
        }
    }

    @Override
    public boolean supports(DocumentationType documentationType) {
        return SwaggerPluginSupport.pluginDoesApply(documentationType);
    }

    private Parameter createParameterFromDescriptior(QueryParameterDescriptor descriptor) {
        return new ParameterBuilder()
            .name(descriptor.getFieldName())
            .type(typeResolver.resolve(typeResolver.resolve(descriptor.getType())))
            .modelRef(new ModelRef("string"))
            .parameterType("query")
            .required(false)
            .description(String.format("Query against the '%s' field.", descriptor.getFieldName()))
            .defaultValue("")
            .allowMultiple(false)
            .parameterAccess("")
            .build();
    }

}


text:
define(["src/dataseries/normalize.js", "src/dataseries/range.js"], function(normalize, range) {
	buster.testCase("normalize", {
		"setUp": function() {
			this.series = range(0, 5);
			this.multivariateSeries = _.map(this.series, function(d, i) { return { x: d, y: d }; });
		},

		"normalize": {
			"'normalize' returns a normalized variant of a data series in 'values' in the range ['lower', 'upper']": function() {
				buster.assert.equals(arrayToNumberFixed(normalize(this.series,  0, 1), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range( 2, 7), 0, 1), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range(-2, 3), 0, 1), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);

				buster.assert.equals(arrayToNumberFixed(normalize(this.series,  3, 6), 1), [3, 3.6, 4.2, 4.8, 5.4, 6]);
				buster.assert.equals(normalize(range( 2, 7), 3, 6), [3, 3.6, 4.2, 4.8, 5.4, 6]);
				buster.assert.equals(normalize(range(-2, 3), 3, 6), [3, 3.6, 4.2, 4.8, 5.4, 6]);

				buster.assert.equals(arrayToNumberFixed(normalize(this.series,  -6, -3), 1), [-6, -5.4, -4.8, -4.2, -3.6, -3]);
				buster.assert.equals(normalize(range( 2, 7), -6, -3), [-6, -5.4, -4.8, -4.2, -3.6, -3]);
				buster.assert.equals(normalize(range(-2, 3), -6, -3), [-6, -5.4, -4.8, -4.2, -3.6, -3]);
			},

			"'normalized' replaces the elements in 'values' with their normalized variants": function() {
				buster.assert.equals(normalize(this.series,  0,  1), this.series);
				buster.assert.equals(normalize(this.series,  3,  6), this.series);
				buster.assert.equals(normalize(this.series, -6, -3), this.series);
			},

			"'normalize's limits default to 'lower' = 0 and 'upper' = 1": function() {
				buster.assert.equals(arrayToNumberFixed(normalize(this.series),  1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range( 2, 7)), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range(-2, 3)), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
			},

			"'normalize' returns an array of all 0's if the minimum and maximum value in 'values' are equal": function() {
				buster.assert.equals(normalize([0, 0, 0]), [0, 0, 0]);
				buster.assert.equals(normalize([1, 1, 1]), [0, 0, 0]);
			},

			"'normalize' returns [] if values is empty": function() {
				buster.assert.equals(normalize([]), []);
			},

			"'normalize's 'propertyName' gives access to the property subject to normalization within the current element in the data series": function() {
				var normalizedSeries = normalize(this.multivariateSeries, 0, 1, "y");
				buster.assert.equals(arrayToNumberFixed(normalizedSeries, 1, "y"), [
					{ x: 0, y: 0 },
					{ x: 1, y: 0.2 },
					{ x: 2, y: 0.4 },
					{ x: 3, y: 0.6 },
					{ x: 4, y: 0.8 },
					{ x: 5, y: 1 }
				]);
			},

			"'normalize's 'propertyName' gives access to the current element in the data series per default": function() {
				buster.assert.equals(arrayToNumberFixed(normalize(this.series),  1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range( 2, 7)), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
				buster.assert.equals(arrayToNumberFixed(normalize(range(-2, 3)), 1), [0, 0.2, 0.4, 0.6, 0.8, 1]);
			},

			"'normalize' throws if 'values' is not an array": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize([]);
				}, "Error");

				buster.assert.exception(function() {
					normalize(0);
				}, "Error");

				buster.assert.exception(function() {
					normalize("a");
				}, "Error");

				buster.assert.exception(function() {
					normalize(function() {});
				}, "Error");

				buster.assert.exception(function() {
					normalize({});
				}, "Error");

				buster.assert.exception(function() {
					normalize(null);
				}, "Error");

				buster.assert.exception(function() {
					normalize(undefined);
				}, "Error");
			},

			"'normalize' throws if 'lower' is provided and is not a number": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize([], 0);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], "a");
				}, "Error");

				buster.assert.exception(function() {
					normalize([], []);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], function() {});
				}, "Error");

				buster.assert.exception(function() {
					normalize([], {});
				}, "Error");

				buster.assert.exception(function() {
					normalize([], null);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], undefined);
				}, "Error");
			},

			"'normalize' throws if 'upper' is provided and is not a number": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize([], 0, 1);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, "a");
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, []);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, function() {});
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, {});
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, null);
				}, "Error");

				buster.assert.exception(function() {
					normalize([], 0, undefined);
				}, "Error");
			},

			"'normalize' throws if 'lower' >= 'upper'": function() {
				buster.refute.exception(function() {
					normalize([], 0, 1);
				});

				buster.assert.exception(function() {
					normalize([], 1, 1);
				});

				buster.assert.exception(function() {
					normalize([], 2, 1);
				});
			},

			"'normalize' throws if 'propertyName' is provided and is not a string": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "y");
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, 0);
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, []);
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, function() {});
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, {});
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, null);
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, undefined);
				}, "Error");
			},

			"'normalize' throws if 'values' is an array of basic data types and 'propertyName' is provided": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize(self.series, 0, 1);
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.series, 0, 1, "_");
				}, "Error");
			},

			"'normalize' throws if 'values' is an array of a non-numeric data type": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize(self.series, 0, 1);
				}, "Error");

				buster.assert.exception(function() {
					normalize(["a", "b", "c"], 0, 1);
				}, "Error");
			},

			"'normalize' throws if 'values' is an array of objects and 'propertyName' is provided but does not refer to an existing property": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "y");
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "_");
				}, "Error");
			},

			"'normalize' throws if 'values' is an array of objects and 'propertyName' is provided but does not refer to a numeric type": function() {
				var self = this;

				_.each(self.multivariateSeries, function(d) { d.name = d.x.toString(); });

				buster.refute.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "y");
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "name");
				}, "Error");
			},

			"'normalize' throws if 'values' is an array of objects and 'propertyName' is omitted": function() {
				var self = this;

				buster.refute.exception(function() {
					normalize(self.multivariateSeries, 0, 1, "y");
				}, "Error");

				buster.assert.exception(function() {
					normalize(self.multivariateSeries, 0, 1);
				}, "Error");
			}
		}
	});
});


text:
using System.ComponentModel.Composition;
using TestUtilities.SharedProject;
using MSBuild = Microsoft.Build.Evaluation;

namespace Microsoft.Nodejs.Tests.UI
{
    [Export(typeof(IProjectProcessor))]
    [ProjectExtension(".njsproj")]
    public class NodejsProjectProcessor : IProjectProcessor
    {
        public void PreProcess(MSBuild.Project project)
        {
            if (project.ProjectFileLocation.File.EndsWith(".user", System.StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            // Node.js projects are flavored which enables a lot of our functionality, so
            // setup our flavor.
            project.SetProperty("ProjectTypeGuids", "{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}");

            var prop = project.SetProperty("VisualStudioVersion", "14.0");

            project.Xml.AddProperty("VisualStudioVersion", "14.0").Condition = "'$(VisualStudioVersion)' == ''";
            project.Xml.AddProperty("VSToolsPath", "$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)").Condition = "'$(VSToolsPath)' == ''";

            var import = project.Xml.AddImport("$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props");
            import.Condition = "Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')";
            project.Xml.AddImport("$(VSToolsPath)\\Node.js Tools\\Microsoft.NodejsTools.targets");

            project.SetProperty("ProjectHome", ".");
            project.SetProperty("WorkingDirectory", ".");
            project.SetProperty("ProjectView", "ShowAllFiles");
            project.SetProperty("OutputPath", ".");
        }

        public void PostProcess(MSBuild.Project project)
        {
            var projectExt = project.Xml.CreateProjectExtensionsElement();
            projectExt.Content = @"
    <VisualStudio>
      <FlavorProperties GUID=""{349c5851-65df-11da-9384-00065b846f21}"">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>0</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost:48022/</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>True</UseCustomServer>
          <CustomServerUrl>http://localhost:1337</CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
      <FlavorProperties GUID=""{349c5851-65df-11da-9384-00065b846f21}"" User="""">
        <WebProjectProperties>
          <StartPageUrl>
          </StartPageUrl>
          <StartAction>CurrentPage</StartAction>
          <AspNetDebugging>True</AspNetDebugging>
          <SilverlightDebugging>False</SilverlightDebugging>
          <NativeDebugging>False</NativeDebugging>
          <SQLDebugging>False</SQLDebugging>
          <ExternalProgram>
          </ExternalProgram>
          <StartExternalURL>
          </StartExternalURL>
          <StartCmdLineArguments>
          </StartCmdLineArguments>
          <StartWorkingDirectory>
          </StartWorkingDirectory>
          <EnableENC>False</EnableENC>
          <AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
";
            project.Xml.AppendChild(projectExt);
        }
    }
}


text:
alias g='git'
alias gb='git branch -vv'
alias gbr='git branch -vv -r'
alias gs='g status --untracked-files=no'
alias gsa='g status'
alias gsaa='g status --untracked-files=all'
alias gd='git diff'
alias gfa='g fetch --all'
alias gfat='gfa --tags'
alias gfap='gfa --prune --tags'
alias gp='git pull'
alias gr='git remote -v'
alias gpum='git pull upstream main'


text:
<?php

namespace PDM\Pdo;

class DCL
{

	/**
	 * tables prefix
	 */
	protected $prefix;

	/**
	 * get db Connection
	 */
	public $connect;

	/**
	 * construct
	 * @param array $config
	 */
	public function __construct(array $config)
	{

		$this->connect = Connect::getInstance();
		$this->prefix	= $config['prefix'];
		$this->connect->setConfig($config);
		unset($config);
	}

	/**
	 * destruct
	 */
	public function __destruct()
	{
		$this->connect = null;
	}

	/**
	 * start database connection
	 * @return void
	 */
	public function start()
	{
		$this->connect->start();
	}

	/**
	 * GRANT
	 * @param  string $priv Privilege ex : SELECT, UPDATE ...
	 * @see https://www.techonthenet.com/mysql/grant_revoke.php
	 * @return boolean
	 */
	public function grant($priv)
	{
		if ($this->connect->query( $this->connect->sqlFormat("GRANT {$priv} ON @dbname TO '@user'@'@host'") )) return true;
		return false;
	}

	/**
	 * REVOKE
	 * @param  string $priv Privilege
	 * @see https://www.techonthenet.com/mysql/grant_revoke.php
	 * @return boolean
	 */
	public function revoke($priv)
	{
		if ($this->connect->query( $this->connect->sqlFormat("REVOKE {$priv} ON @dbname FROM '@user'@'@host'") )) return true;
		return false;
	}
}


text:
import * as RateLimiter from 'rolling-rate-limiter';

/*
  Setup:
*/

const limiter = RateLimiter({
  // in miliseconds
  interval: 1000,
  maxInInterval: 10,
  // optional: the minimum time (in miliseconds) between any two actions
  minDifference: 100
});

/*
  Action:
*/

function attemptAction(userId: string) {
  // Argument should be a unique identifier for a user if one exists.
  // If none is provided, the limiter will not differentiate between users.
  const timeLeft = limiter(userId);

  if (timeLeft > 0) {
    // limit was exceeded, action should not be allowed
    // timeLeft is the number of ms until the next action will be allowed
    // note that this can be treated as a boolean, since 0 is falsy
  } else {
    // limit was not exceeded, action should be allowed
  }
}

/*
  Note that the in-memory version can also operate asynchronously.
  The syntax is identical to the redis implementation below.
*/


text:
(function () {
  /**
   * Depending on the value of the data-iframe-loader attribute, display or store the content of the iframe
   * @param  {HTMLElement} iframe
   */
  var processFrame = function (iframe) {
    var type = iframe.getAttribute('data-iframe-loader');
    if (type === "display") {
      displayFrame(iframe);
    } else if (type === "store") {
      storeFrame(iframe);
    } else {
      console.error('iframeLoader invalid type : ' + type);
    }
  };

  /**
   * Replace the existing iframe with the content of the iframe
   * If the iframe has a single root element, it will directly replace the iframe.
   * If there are several roots, a wrapping div will be created and will replace the iframe
   * @param  {HTMLElement} iframe
   */
  var displayFrame = function (iframe) {
    var div=document.createElement("div");
    div.innerHTML = iframe.contentWindow.document.body.innerHTML;
    if (div.children.length == 1) {
      div = div.children[0];
    }
    iframe.parentNode.replaceChild(div, iframe);
  };

  /**
   * Load the iframe content as a <script type="text/html" id={iframe-src}>{iframe-content}</script>
   * The content can later be accessed by getting the script (through getElementById for instance) and reading innerHTML
   * @param  {HTMLElement} iframe
   */
  var storeFrame = function (iframe) {
    var script=document.createElement("script");
    script.setAttribute("type", "text/html");
    script.setAttribute("id", iframe.getAttribute("src").replace(/.*templates[^\/]*\//,'templates/'));
    script.innerHTML = iframe.contentWindow.document.body.innerHTML;
    iframe.parentNode.removeChild(iframe);
    document.body.appendChild(script);
  };

  window.iframeloader = {
    onLoad : function (event) {
      var iframe = event.target || event.srcElement;
      processFrame(iframe);
    }
  };
})();


text:
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//********************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.Security.ExchangeActiveSyncProvisioning;
using Windows.System.Profile;
using Windows.Devices.Enumeration.Pnp;

namespace AudioVideoPlayer.Information
{
    public static class SystemInformation
    {

        public static string SystemFamily { get; }
        public static string SystemVersion { get; }
        public static string SystemArchitecture { get; }
        public static string ApplicationName { get; }
        public static string ApplicationVersion { get; }
        public static string DeviceManufacturer { get; }
        public static string DeviceModel { get; }
        public static string AppSpecificHardwareID { get;  }

        public static string GetWindowsVersion()
        {
            string str;
            string[] strArray = { "{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3" };
            PnpObject halDevice = GetHalDevice(strArray);
            if (halDevice == null || !halDevice.Properties.ContainsKey("{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"))
                str = "UNKNOWN";
            else
                str = halDevice.Properties["{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"].ToString();
            return str;
        }

        private static PnpObject GetHalDevice(params String[] properties)
        {
            String[] strArray = properties;
            String[] strArray1 = { "{A45C254E-DF1C-4EFD-8020-67D146A850E0},10" };
            IEnumerable<String> enumerable = strArray.Concat(strArray1);
            try
            {
                PnpObjectCollection pnpObjectCollection = PnpObject.FindAllAsync(PnpObjectType.Device, enumerable, "System.Devices.ContainerId:=\"{00000000-0000-0000-FFFF-FFFFFFFFFFFF}\"").GetResults();

                foreach (PnpObject pnpObject in pnpObjectCollection)
                {
                    if (pnpObject.Properties == null || !pnpObject.Properties.Any())
                        continue;

                    KeyValuePair<String, Object> keyValuePair = pnpObject.Properties.Last();
                    if (keyValuePair.Value == null || !keyValuePair.Value.ToString().Equals("4d36e966-e325-11ce-bfc1-08002be10318"))
                        continue;
                    return pnpObject;
                }
            }
            catch(Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception: " + e.Message);
                return null;
            }
            return null;
        }
        private static string GetAppSpecificHardwareID()
        {
            Windows.System.Profile.HardwareToken packageSpecificToken;
            try
            {
                packageSpecificToken = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);
                if (packageSpecificToken != null)
                {

                    Windows.Storage.Streams.DataReader dataReader = Windows.Storage.Streams.DataReader.FromBuffer(packageSpecificToken.Id);

                    byte[] bytes = new byte[packageSpecificToken.Id.Length];
                    dataReader.ReadBytes(bytes);
                    return BitConverter.ToString(bytes);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception in GetAppSpecificHardwareID: " + e.Message);
            }
            return "UNKNOWN";
        }
        static SystemInformation()
        {
            // get the system family name
            AnalyticsVersionInfo ai = AnalyticsInfo.VersionInfo;
            SystemFamily = ai.DeviceFamily;

            // get the system version number
#if WINDOWS_UWP
            string sv = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
            ulong v = ulong.Parse(sv);
            ulong v1 = (v & 0xFFFF000000000000L) >> 48;
            ulong v2 = (v & 0x0000FFFF00000000L) >> 32;
            ulong v3 = (v & 0x00000000FFFF0000L) >> 16;
            ulong v4 = (v & 0x000000000000FFFFL);
            SystemVersion = $"{v1}.{v2}.{v3}.{v4}";
#else
            // get os version
            SystemVersion = GetWindowsVersion();
#endif
            // get the package architecure
            Package package = Package.Current;
            SystemArchitecture = package.Id.Architecture.ToString();

            // get the user friendly app name
            ApplicationName = package.DisplayName;

            // get the app version
            PackageVersion pv = package.Id.Version;
            ApplicationVersion = $"{pv.Major}.{pv.Minor}.{pv.Build}.{pv.Revision}";

            // get the device manufacturer and model name
            EasClientDeviceInformation eas = new EasClientDeviceInformation();
            DeviceManufacturer = eas.SystemManufacturer;
            DeviceModel = eas.SystemProductName;

            // get App Specific Hardware ID
            AppSpecificHardwareID = GetAppSpecificHardwareID();
        }
        public static string GetString()
        {
            string result = string.Empty;
            try {
                result = string.Format("System Information:\r\nFamily: {0}\r\nVersion: {1}\r\nArchitecture: {2}\r\nApplication Name: {3}\r\nApplication Version: {4}\r\nDevice Manufacturer: {5}\r\nDevice Model: {6}\r\nHardware ID: {7}\r\n",
                            SystemFamily,
                            SystemVersion,
                            SystemArchitecture,
                            ApplicationName,
                            ApplicationVersion,
                            DeviceManufacturer,
                            DeviceModel,
                            AppSpecificHardwareID
                    );
            }
            catch(Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception: " + e.Message);
                result = "OS version: UNKNOWN\r\nFamily: UNKNOWN\r\nVersion: UNKNOWN\r\nArchitecture: UNKNOWN\r\nApplication Name: UNKNOWN\r\nApplication Version: UNKNOWN\r\nDevice Manufacturer: UNKNOWN\r\nDevice Model: UNKNOWN\r\nHardware ID: UNKNOWN\r\n";
            }

            return result;
        }
    }
}


text:
website at

https://chandler12.github.io/game-dev/


text:
from textdata import *
from textdata.core import ensure_text, noquotes
import sys
import pytest

def _print(*args, **kwargs):
    """
    Python 2 and 3 compatible print function, similar to Python 3 arg handling.
    """
    sep = kwargs.get('sep', ' ')
    end = kwargs.get('end', '\n')
    f   = kwargs.get('file', sys.stdout)
    parts = [str(item) for item in args]
    parts.append(end)
    f.write(sep.join(parts))

def single_trial(name, t, **kwargs):
    _print("---", name, "---")
    reslines = lines(t, **kwargs)
    for line in reslines:
        _print(line)
    _print("--- end", name, "---")

    _print()

def test_ensure_text():
    assert ensure_text("this") == "this"
    assert ensure_text("this is a".split()) == "this\nis\na"

def test_noquotes():
    assert noquotes('"this"') == 'this'
    assert noquotes("'this'") == 'this'
    assert noquotes('this') == 'this'

def test_basic():

    assert lines("""
                 a
                 line
                 or
                 two""") == ['a', 'line', 'or', 'two']

def test_lines_take_lines():
    """
    Ensure that lines() treats data coming in as line lists just as it
    would text.
    """
    assert lines(['a', 'line', 'or', 'two']) == ['a', 'line', 'or', 'two']
    assert lines(['', 'a', 'line', '   ', 'or', 'two', '\n']) == ['a', 'line', 'or', 'two']

def test_encoding():
    assert lines(u"⍟\n★") == [u'\u235F', u'\u2605']

def test_lstrip_and_rstrip():
    s = "  a \n b\n c\t\nd"
    assert lines(s, lstrip=True, rstrip=False) == ['a ', 'b', 'c\t', 'd']
    assert lines(s, lstrip=False, rstrip=True) == ['  a', ' b', ' c', 'd']
    assert lines(s, lstrip=True, rstrip=True) == ['a', 'b', 'c', 'd']

def test_expandtabs():
    s = "    a\tb"
    assert lines(s) == ['a\tb']
    assert lines(s, expandtabs=True) == ['a b']
    assert lines(s, expandtabs=4) == ['a   b']
    s2 = """
        a\tb
        c\td
    """
    assert lines(s2) == ['a\tb', 'c\td']

def test_mixed_indent():

    assert lines("""
    This is a test of lines
    these should all
    be nice and dedented
        except this one, which has a little non-common space
    ok?
    because ends with more than one blank line, those will be captured

          """) == \
        ['This is a test of lines',
         'these should all',
         'be nice and dedented',
         '    except this one, which has a little non-common space',
         'ok?',
         'because ends with more than one blank line, those will be captured']

def test_noblanks_false():

    assert lines("""
    This is a test of lines
    these should all
    be nice and dedented
        except this one, which has a little non-common space
    ok?
    because ends with more than one blank line, those will be captured

          """, noblanks=False) == \
        ['This is a test of lines',
         'these should all',
         'be nice and dedented',
         '    except this one, which has a little non-common space',
         'ok?',
         'because ends with more than one blank line, those will be captured',
         '',
         '']

def test_cstrip():

    t = """
        this

            is
        ok

    """

    tc = """
        this  # look, a comment!
# more comment
            is
        ok    # other comment
   #comment
    """

    assert lines(t) == lines(tc)
    assert text(t) == text(tc)

def test_malindented_blank_lines():

    assert lines(noblanks=False, source="""
        this

        is
        ok

    """) == "this\n\nis\nok\n\n".splitlines()

def test_extra_start_space():

    single_trial('test2', """

    This is a test of lines

    here there should be no blanks
     but some that start wiht a little extra space ok?
      which isn't common

          """) == \
        ['This is a test of lines',
         'here there should be no blanks',
         ' but some that start wiht a little extra space ok?',
         "  which isn't common"]

def test_lines():
    data = """

    This is a test of lines

    here there should be no blanks
     but some that start wiht a little extra space ok?
      which isn't common

          """

    assert lines(data) == text(data).splitlines()
    assert lines(data, join=True) == lines(data, join='')
    assert lines(data, join=True) == ''.join(text(data).splitlines())
    assert lines(data, join=' ') == ' '.join(text(data).splitlines())
    assert lines(data, join='\n') == text(data)
    assert len(lines(data)) == 4

def test_text():
    data = """

    This is a test of lines

    here there should be no blanks
     but some that stetart wiht a little extra space ok?
      which isn't common

          """

    assert lines(data) == text(data).splitlines()
    assert lines(data, join=True) == lines(data, join='')
    assert lines(data, join=True) == ''.join(text(data).splitlines())
    assert lines(data, join=' ') == ' '.join(text(data).splitlines())
    assert lines(data, join='\n') == text(data)
    assert len(lines(data)) == 4

def test_text_textlines_equivalence():
    data = """

    This is a test of lines

    here there should be no blanks
     but some that stetart wiht a little extra space ok?
      which isn't common

          """
    with pytest.warns(DeprecationWarning):
        assert text(data) == textlines(data)

def test_tricky_prefix():
    """
    Common prefixes need not be all spaces. This tests if common non-blank
    prefixes are properly handled.
    """

    t = text("""
        something
        something else
    """)
    assert t == "something\nsomething else"

    t2 = text("""
xxx y
xxx z
""")
    assert t2 == "xxx y\nxxx z"

def test_words():

    assert words('a b c') == 'a b c'.split()
    assert words(' a b c') == 'a b c'.split()
    assert words('  a  b   c   ') == 'a b c'.split()
    assert words(' Billy Bobby "Mr. Smith"') == ['Billy', 'Bobby', 'Mr. Smith']
    assert words(' Billy Bobby "Mr. Smith" "Mrs. Jones"  ') == \
        ['Billy', 'Bobby', 'Mr. Smith', 'Mrs. Jones']
    assert words(' "" " " "  " "   "') == ['', ' ', '  ', '   ']
    assert words("don't be daft") == ["don't", 'be', 'daft']
    assert words(""" "don't be daft" love """) == ["don't be daft", 'love']

    assert words(""" "hey\nthere" joe""") == ['hey\nthere', 'joe']

    assert words("don't be blue") == ["don't", "be", "blue"]

    assert words("don't be blue don't") == ["don't", "be", "blue", "don't"]
    assert words(""" "'this'" works '"great"' """) == \
                 ["'this'", 'works', '"great"']

def test_words_cstrip():
    w = """ this and
            that
            and
            more
        """
    wc = """ this and  # comment
            that  #comment
            and#comment
            more        #comment
        """
    assert words(w) == words(wc)

def test_words_cstrip_example():
    assert words("""
        __pycache__ *.pyc *.pyo     # compilation artifacts
        .hg* .git*                  # repository artifacts
        .coverage                   # code tool artifacts
        .DS_Store                   # platform artifacts
    """) == ['__pycache__', '*.pyc', '*.pyo', '.hg*', '.git*',
             '.coverage', '.DS_Store']

    assert words("""
        __pycache__ *.pyc *.pyo     # compilation artifacts
        .hg* .git*                  # repository artifacts
        .coverage                   # code tool artifacts
        .DS_Store                   # platform artifacts
    """, cstrip=False) == ['__pycache__', '*.pyc', '*.pyo', '#',
             'compilation', 'artifacts', '.hg*', '.git*', '#', 'repository',
             'artifacts', '.coverage', '#', 'code', 'tool',
             'artifacts', '.DS_Store', '#', 'platform', 'artifacts']

def test_words_sep():
    assert words('one/two/three', sep='/') == ['one', 'two', 'three']
    assert words('one/two 2/three', sep='/') == ['one', 'two 2', 'three']
    assert words('one / two 2 / three', sep='/') == ['one', 'two 2', 'three']
    assert words('one / two 2 /\n three', sep='/') == ['one', 'two 2', 'three']
    assert words("""one / two 2 /
                    three / four""", sep='/') == ['one', 'two 2', 'three', 'four']

def test_paras_example():
    rhyme = """
        Hey diddle diddle,

        The cat and the fiddle,
        The cow jumped over the moon.
        The little dog laughed,
        To see such sport,

        And the dish ran away with the spoon.
    """
    assert paras(rhyme) == \
    [['Hey diddle diddle,'],
     ['The cat and the fiddle,',
      'The cow jumped over the moon.',
      'The little dog laughed,',
      'To see such sport,'],
     ['And the dish ran away with the spoon.']]

    assert paras(rhyme, join="\n") == \
    ['Hey diddle diddle,',
     'The cat and the fiddle,\nThe cow jumped over the moon.\nThe little dog laughed,\nTo see such sport,',
     'And the dish ran away with the spoon.']

def test_paras_list_input():
    assert paras(['Hey diddle diddle,',
                  '',
                  'The cat and the fiddle,',
                  'The cow jumped over the moon.',
                  'The little dog laughed,',
                  'To see such sport,',
                  '',
                  'And the dish ran away with the spoon.']) == \
        [['Hey diddle diddle,'],
         ['The cat and the fiddle,',
          'The cow jumped over the moon.',
          'The little dog laughed,',
          'To see such sport,'],
         ['And the dish ran away with the spoon.']]

def test_paras_with_comments():
    rhyme = """
        Hey diddle diddle,  # some comment!

        The cat and the fiddle,
        The cow jumped over the moon.
        The little dog laughed, # how he laughed!
        To see such sport,

        And the dish ran away with the spoon. # yee-ha!!
    """
    assert paras(rhyme) == \
    [['Hey diddle diddle,'],
     ['The cat and the fiddle,',
      'The cow jumped over the moon.',
      'The little dog laughed,',
      'To see such sport,'],
     ['And the dish ran away with the spoon.']]

    assert paras(rhyme, join="\n") == \
    ['Hey diddle diddle,',
     'The cat and the fiddle,\nThe cow jumped over the moon.\nThe little dog laughed,\nTo see such sport,',
     'And the dish ran away with the spoon.']

    assert paras(rhyme, cstrip=True) == paras(rhyme)

    assert paras(rhyme, cstrip=False) == \
    [['Hey diddle diddle,  # some comment!'],
     ['The cat and the fiddle,',
      'The cow jumped over the moon.',
      'The little dog laughed, # how he laughed!',
      'To see such sport,'],
     ['And the dish ran away with the spoon. # yee-ha!!']]

    assert paras(rhyme, cstrip=False, join="\n") == \
    ['Hey diddle diddle,  # some comment!',
    'The cat and the fiddle,\nThe cow jumped over the moon.\nThe little dog laughed, # how he laughed!\nTo see such sport,',
    'And the dish ran away with the spoon. # yee-ha!!']

    # NB comments on blank lines => they're no longer blank, unless cstrip=True
    # that can change entire shape of text paragraphization

def test_textline():
    assert textline("""
        this is
        a question
    """) == "this is a question"

    assert textline(["    this is", "    a question"]) == "this is a question"


text:
Imports StaxRip.UI

Imports System.Threading
Imports System.Runtime.Serialization.Formatters.Binary

Friend Class JobsForm
    Inherits DialogBase

#Region " Designer "

    Friend WithEvents bnRemove As ButtonEx
    Private WithEvents bnClose As StaxRip.UI.ButtonEx
    Friend WithEvents bnStart As StaxRip.UI.ButtonEx
    Friend WithEvents bnNew As StaxRip.UI.ButtonEx
    Friend WithEvents bnDown As StaxRip.UI.ButtonEx
    Friend WithEvents bnUp As StaxRip.UI.ButtonEx
    Friend WithEvents bnLoad As StaxRip.UI.ButtonEx
    Friend WithEvents lv As ListViewEx
    Friend WithEvents TableLayoutPanel1 As TableLayoutPanel
    Friend WithEvents TableLayoutPanel2 As TableLayoutPanel
    Friend WithEvents TableLayoutPanel3 As TableLayoutPanel
    Private components As System.ComponentModel.IContainer

    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        Me.bnDown = New StaxRip.UI.ButtonEx()
        Me.bnRemove = New StaxRip.UI.ButtonEx()
        Me.bnUp = New StaxRip.UI.ButtonEx()
        Me.bnClose = New StaxRip.UI.ButtonEx()
        Me.bnStart = New StaxRip.UI.ButtonEx()
        Me.bnNew = New StaxRip.UI.ButtonEx()
        Me.bnLoad = New StaxRip.UI.ButtonEx()
        Me.lv = New StaxRip.UI.ListViewEx()
        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
        Me.TableLayoutPanel3 = New System.Windows.Forms.TableLayoutPanel()
        Me.TableLayoutPanel2 = New System.Windows.Forms.TableLayoutPanel()
        Me.TableLayoutPanel1.SuspendLayout()
        Me.TableLayoutPanel3.SuspendLayout()
        Me.TableLayoutPanel2.SuspendLayout()
        Me.SuspendLayout()
        '
        'bnDown
        '
        Me.bnDown.Anchor = System.Windows.Forms.AnchorStyles.Left
        Me.bnDown.Enabled = False
        Me.bnDown.Location = New System.Drawing.Point(3, 0)
        Me.bnDown.Margin = New System.Windows.Forms.Padding(3, 0, 0, 0)
        Me.bnDown.Size = New System.Drawing.Size(35, 36)
        '
        'bnRemove
        '
        Me.bnRemove.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.bnRemove.Location = New System.Drawing.Point(234, 0)
        Me.bnRemove.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
        Me.bnRemove.Size = New System.Drawing.Size(100, 36)
        Me.bnRemove.Text = "Remove"
        '
        'bnUp
        '
        Me.bnUp.Anchor = System.Windows.Forms.AnchorStyles.Right
        Me.bnUp.Enabled = False
        Me.bnUp.Location = New System.Drawing.Point(402, 0)
        Me.bnUp.Margin = New System.Windows.Forms.Padding(0, 0, 3, 0)
        Me.bnUp.Size = New System.Drawing.Size(35, 36)
        '
        'bnClose
        '
        Me.bnClose.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.bnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.bnClose.Location = New System.Drawing.Point(340, 0)
        Me.bnClose.Margin = New System.Windows.Forms.Padding(0)
        Me.bnClose.Size = New System.Drawing.Size(100, 36)
        Me.bnClose.Text = "Close"
        '
        'bnStart
        '
        Me.bnStart.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.bnStart.Location = New System.Drawing.Point(0, 0)
        Me.bnStart.Margin = New System.Windows.Forms.Padding(0, 0, 6, 0)
        Me.bnStart.Size = New System.Drawing.Size(100, 36)
        Me.bnStart.Text = "Start"
        '
        'bnNew
        '
        Me.bnNew.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.bnNew.Location = New System.Drawing.Point(106, 0)
        Me.bnNew.Margin = New System.Windows.Forms.Padding(0)
        Me.bnNew.Size = New System.Drawing.Size(201, 36)
        Me.bnNew.Text = "Start in new instance"
        '
        'bnLoad
        '
        Me.bnLoad.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.bnLoad.Location = New System.Drawing.Point(128, 0)
        Me.bnLoad.Margin = New System.Windows.Forms.Padding(0)
        Me.bnLoad.Size = New System.Drawing.Size(100, 36)
        Me.bnLoad.Text = "Load"
        '
        'lv
        '
        Me.lv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.TableLayoutPanel1.SetColumnSpan(Me.lv, 2)
        Me.lv.Location = New System.Drawing.Point(0, 0)
        Me.lv.Margin = New System.Windows.Forms.Padding(0, 0, 0, 8)
        Me.lv.Name = "lv"
        Me.lv.Size = New System.Drawing.Size(880, 560)
        Me.lv.TabIndex = 7
        Me.lv.UseCompatibleStateImageBehavior = False
        '
        'TableLayoutPanel1
        '
        Me.TableLayoutPanel1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.TableLayoutPanel1.ColumnCount = 2
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
        Me.TableLayoutPanel1.Controls.Add(Me.TableLayoutPanel3, 1, 1)
        Me.TableLayoutPanel1.Controls.Add(Me.TableLayoutPanel2, 0, 1)
        Me.TableLayoutPanel1.Controls.Add(Me.lv, 0, 0)
        Me.TableLayoutPanel1.Location = New System.Drawing.Point(11, 11)
        Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(2)
        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
        Me.TableLayoutPanel1.RowCount = 2
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 66.66666!))
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
        Me.TableLayoutPanel1.Size = New System.Drawing.Size(880, 604)
        Me.TableLayoutPanel1.TabIndex = 15
        '
        'TableLayoutPanel3
        '
        Me.TableLayoutPanel3.AutoSize = True
        Me.TableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
        Me.TableLayoutPanel3.ColumnCount = 4
        Me.TableLayoutPanel3.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
        Me.TableLayoutPanel3.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel3.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel3.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel3.Controls.Add(Me.bnDown, 0, 0)
        Me.TableLayoutPanel3.Controls.Add(Me.bnClose, 3, 0)
        Me.TableLayoutPanel3.Controls.Add(Me.bnLoad, 1, 0)
        Me.TableLayoutPanel3.Controls.Add(Me.bnRemove, 2, 0)
        Me.TableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill
        Me.TableLayoutPanel3.Location = New System.Drawing.Point(440, 568)
        Me.TableLayoutPanel3.Margin = New System.Windows.Forms.Padding(0)
        Me.TableLayoutPanel3.Name = "TableLayoutPanel3"
        Me.TableLayoutPanel3.RowCount = 1
        Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
        Me.TableLayoutPanel3.Size = New System.Drawing.Size(440, 36)
        Me.TableLayoutPanel3.TabIndex = 9
        '
        'TableLayoutPanel2
        '
        Me.TableLayoutPanel2.AutoSize = True
        Me.TableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
        Me.TableLayoutPanel2.ColumnCount = 3
        Me.TableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
        Me.TableLayoutPanel2.Controls.Add(Me.bnStart, 0, 0)
        Me.TableLayoutPanel2.Controls.Add(Me.bnNew, 1, 0)
        Me.TableLayoutPanel2.Controls.Add(Me.bnUp, 2, 0)
        Me.TableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.TableLayoutPanel2.Location = New System.Drawing.Point(0, 568)
        Me.TableLayoutPanel2.Margin = New System.Windows.Forms.Padding(0)
        Me.TableLayoutPanel2.Name = "TableLayoutPanel2"
        Me.TableLayoutPanel2.RowCount = 1
        Me.TableLayoutPanel2.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
        Me.TableLayoutPanel2.Size = New System.Drawing.Size(440, 36)
        Me.TableLayoutPanel2.TabIndex = 8
        '
        'JobsForm
        '
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
        Me.CancelButton = Me.bnClose
        Me.ClientSize = New System.Drawing.Size(902, 626)
        Me.Controls.Add(Me.TableLayoutPanel1)
        Me.KeyPreview = True
        Me.Margin = New System.Windows.Forms.Padding(0, 1, 0, 1)
        Me.MinimumSize = New System.Drawing.Size(194, 162)
        Me.Name = "JobsForm"
        Me.Text = "Jobs"
        Me.TableLayoutPanel1.ResumeLayout(False)
        Me.TableLayoutPanel1.PerformLayout()
        Me.TableLayoutPanel3.ResumeLayout(False)
        Me.TableLayoutPanel2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private FileWatcher As New FileSystemWatcher

    Sub New()
        MyBase.New()
        InitializeComponent()

        Dim pad = New Padding(CInt(bnUp.Width / 8))

        bnUp.Padding = pad
        bnUp.ZoomImage = ImageHelp.GetSymbolImage(Symbol.Up)

        bnDown.Padding = pad
        bnDown.ZoomImage = ImageHelp.GetSymbolImage(Symbol.Down)

        KeyPreview = True

        lv.UpButton = bnUp
        lv.DownButton = bnDown
        lv.RemoveButton = bnRemove
        lv.SingleSelectionButtons = {bnLoad}
        lv.CheckBoxes = True
        lv.EnableListBoxMode()
        lv.ItemCheckProperty = NameOf(StringBooleanPair.Value)
        lv.AddItems(GetJobs())
        lv.SelectFirst()
        UpdateControls()

        FileWatcher.Path = Folder.Settings
        FileWatcher.NotifyFilter = NotifyFilters.LastWrite Or NotifyFilters.CreationTime
        FileWatcher.Filter = "Jobs.dat"
        AddHandler FileWatcher.Changed, AddressOf Reload
        AddHandler FileWatcher.Created, AddressOf Reload
        FileWatcher.EnableRaisingEvents = True

        AddHandler lv.ItemsChanged, Sub()
                                        SaveJobs()
                                        UpdateControls()
                                    End Sub
    End Sub

    Private IsLoading As Boolean

    Sub Reload(sender As Object, e As FileSystemEventArgs)
        If IsHandleCreated Then Invoke(Sub()
                                           IsLoading = True
                                           lv.Items.Clear()
                                           lv.AddItems(GetJobs())
                                           lv.SelectFirst()
                                           UpdateControls()
                                           IsLoading = False
                                       End Sub)
    End Sub

    Private Sub UpdateControls()
        Dim activeJobs = From item In lv.Items.OfType(Of ListViewItem)
                         Where DirectCast(item.Tag, StringBooleanPair).Value

        bnNew.Enabled = activeJobs.Count > 0
        bnStart.Enabled = bnNew.Enabled AndAlso Not ProcessForm.IsActive
    End Sub

    Private Sub JobsForm_HelpRequested() Handles Me.HelpRequested
        Dim f As New HelpForm
        f.Doc.WriteStart(Text)
        f.Doc.WriteP("The Jobs dialog allows to encode a batch of projects.")
        f.Show()
    End Sub

    Sub SaveJobs(sender As Object, e As EventArgs)
        SaveJobs()
    End Sub

    Sub SaveJobs()
        If IsLoading Then Exit Sub
        Dim jobs As New List(Of StringBooleanPair)

        For Each i As ListViewItem In lv.Items
            jobs.Add(DirectCast(i.Tag, StringBooleanPair))
        Next

        FileWatcher.EnableRaisingEvents = False
        SaveJobs(jobs)
        FileWatcher.EnableRaisingEvents = True
    End Sub

    Shared Sub SaveJobs(jobs As List(Of StringBooleanPair))
        Dim formatter As New BinaryFormatter
        Dim counter As Integer

        While True
            Try
                Using stream As New FileStream(Folder.Settings + "Jobs.dat",
                                               FileMode.Create,
                                               FileAccess.ReadWrite,
                                               FileShare.None)

                    formatter.Serialize(stream, jobs)
                End Using

                Exit While
            Catch ex As Exception
                Thread.Sleep(500)
                counter += 1
                If counter > 9 Then Throw ex
            End Try
        End While
    End Sub

    Shared Function GetJobs() As List(Of StringBooleanPair)
        Dim formatter As New BinaryFormatter
        Dim jobsPath = Folder.Settings + "Jobs.dat"
        Dim counter As Integer

        If File.Exists(jobsPath) Then
            While True
                Try
                    Using stream As New FileStream(jobsPath,
                                                   FileMode.Open,
                                                   FileAccess.ReadWrite,
                                                   FileShare.None)

                        Return DirectCast(formatter.Deserialize(stream), List(Of StringBooleanPair))
                    End Using

                    Exit While
                Catch ex As Exception
                    Thread.Sleep(500)
                    counter += 1

                    If counter > 9 Then
                        g.ShowException(ex, "Failed to load job file:" + BR2 + jobsPath)
                        FileHelp.Delete(jobsPath)
                        Exit While
                    End If
                End Try
            End While
        End If

        Return New List(Of StringBooleanPair)
    End Function

    Shared Sub RemoveJob(jobPath As String)
        Dim jobs = GetJobs()

        For Each i In jobs.ToArray
            If i.Key = jobPath Then
                jobs.Remove(i)
                SaveJobs(jobs)
            End If
        Next
    End Sub

    Shared Sub ActivateJob(jobPath As String, Optional isActive As Boolean = True)
        Dim jobs = GetJobs()

        For Each i In jobs
            If i.Key = jobPath Then i.Value = isActive
        Next

        SaveJobs(jobs)
    End Sub

    Shared Sub AddJob(jobPath As String, Optional isActive As Boolean = True)
        Dim jobs = GetJobs()

        For Each i In jobs.ToArray
            If i.Key = jobPath Then jobs.Remove(i)
        Next

        jobs.Add(New StringBooleanPair(jobPath, isActive))
        SaveJobs(jobs)
    End Sub

    Private Sub bnStart_Click(sender As Object, e As EventArgs) Handles bnStart.Click
        If g.MainForm.IsSaveCanceled Then Exit Sub
        DialogResult = DialogResult.OK
    End Sub

    Private Sub bnNew_Click(sender As Object, e As EventArgs) Handles bnNew.Click
        If Not ProcessForm.IsActive Then If g.MainForm.IsSaveCanceled Then Exit Sub
        g.ShellExecute(Application.ExecutablePath, "-SetPreventSaveSettings:True -StartJobs -Exit")
    End Sub

    Private Sub bnLoad_Click(sender As Object, e As EventArgs) Handles bnLoad.Click
        g.MainForm.LoadProject(lv.SelectedItem.ToString)
    End Sub

    Protected Overrides Sub Dispose(disposing As Boolean)
        MyBase.Dispose(disposing)
        FileWatcher.Dispose()
    End Sub

    Private Sub JobsForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        Select Case e.KeyData
            Case Keys.Control Or Keys.A
                For Each i As ListViewItem In lv.Items
                    i.Selected = True
                Next
            Case Keys.Delete
                lv.RemoveSelection()
        End Select
    End Sub
End Class


text:
<?php
namespace Rebuilder;

/**
 * The core rebuilder class which handles the loading of modules.
 */
class Loader {

    /**
     * The path to the module directory.
     *
     * @var string
     */
    protected $_defaultModulePath;

    /**
     * Custom module paths.
     *
     * @var array
     */
    protected $_customModulePaths = array();

    /**
     * The default config values which get merged. Also provides the full
     * set of allowable config keys.
     *
     * @var array
     */
    private $_modules = array();

    /**
     * The default constructor for loading configuration settings and
     * setting up the autoloader.
     *
     * @access  public
     * @param   array   $customPaths    Full paths to custom module directories
     * @return  void
     */
    public function __construct($modules, $customPaths)
    {
        // set the default module path
        $this->_defaultModulePath = __DIR__ . '/Modules/';
        $this->_customModulePaths = $customPaths;

        // if we have modules, get them in order...
        if (!empty($modules)) {
            $this->setModuleOrder($modules);
        }

        // load default modules
        $this->loadDefault();

        // load custom modules
        $this->loadCustom();

        // merge defaults with modules
        if (!empty($modules)) {
            $this->updateConfig($modules);
        }

        // register the autoloader for modules
        spl_autoload_register(array($this, 'moduleLoader'));
    }

    /**
     * Loads all default module configuration files recursively.
     *
     * @access  public
     * @return  void
     */
    public function loadDefault()
    {
        $this->_loadModulesFromDirectory($this->_defaultModulePath);
    }

    /**
     * Attempt to load custom modules.
     *
     * @access  public
     * @return  void
     */
    public function loadCustom()
    {
        if (!empty($this->_customModulePaths)) {
            foreach ((array) $this->_customModulePaths as $path) {
                $this->_loadModulesFromDirectory($path);
            }
        }
    }

    /**
     * Handles adding a module to the queue of modules.
     *
     * @access  public
     * @param   string  $moduleName
     * @param   array   $moduleConfig
     * @return  void
     */
    public function addModule($moduleName, array $moduleConfig)
    {
        // handle overriding existing settings
        if (isset($this->_modules[$moduleName])) {
            $this->_modules[$moduleName] =
                $this->_mergeModuleConfig($this->_modules[$moduleName], $moduleConfig);
        } else {
            // handles loading new module
            $this->_modules[$moduleName] = $moduleConfig;
        }
    }

    /**
     * Handle removing an existing module from the queue of modules.
     *
     * @access  public
     * @param   string      $moduleName
     * @return  array|bool  Returns module config if found and removed
     */
    public function removeModule($moduleName)
    {
        if (isset($this->_modules[$moduleName])) {
            $module = $this->_modules[$moduleName];
            unset($this->_modules[$moduleName]);
            return $module;
        }

        return false;
    }

    /**
     * Retrieve a particular modules config settings.
     *
     * @access  public
     * @param   string  $module
     * @return  array
     */
    public function getModule($module)
    {
        return isset($this->_modules[$module]) ? $this->_modules[$module] : array();
    }

    /**
     * Returns the full set of loaded modules.
     *
     * @access  public
     * @return  array
     */
    public function getModules()
    {
        return $this->_modules;
    }

    /**
     * Ensures we maintain module order from the original input.
     *
     * @access  public
     * @param   array   $modules
     */
    public function setModuleOrder($modules)
    {
        foreach ($modules as $k => $v) {
            $this->_modules[$k] = array();
        }
    }

    /**
     * Updates the default module config with user overrides.
     *
     * @access  public
     * @param   array   $modules
     * @return  void
     */
    public function updateConfig($modules)
    {
        $this->log('Updating module loader configuration with user supplied values.');
        $this->_modules = $this->_mergeModuleConfig($this->_modules, $modules);
    }

    /**
     * Handles loading of modules from a given directory. If the config already
     * exists, we merge with existing to handle the scenario of overriding
     * default config values.
     *
     * @access  protected
     * @return  void
     */
    protected function _loadModulesFromDirectory($dir)
    {
        $this->log('Attempting to load module config from directory: ' . $dir);

        if (!is_dir($dir)) {
            $this->log('Module directory doesnt exist: ' . $dir);
            return;
        }

        $it = new \RecursiveIteratorIterator(
            new \Rebuilder\Loader\Filter(
                new \RecursiveDirectoryIterator($dir)
            )
        );

        foreach ($it as $file) {
            $config = include_once($file->getPathname());
            if (empty($this->_modules[$config['name']])) {
                $this->log('Initial module config import: ' . $config['name']);
                $this->_modules[$config['name']] = $config;
            } else {
                $this->log('Overriding module config: ' . $config['name']);
                $this->_modules[$config['name']] =
                    $this->_mergeModuleConfig(
                        $this->_modules[$config['name']],
                        $config
                    );
            }
        }
    }

    /**
     * Handles merging the default module params with the user supplied
     * module params.
     *
     * @access  public
     * @param   array   $default    The currently existing module config
     * @param   array   $override    The new module config (override)
     * @return  array
     */
    protected function _mergeModuleConfig($default, $override)
    {
        foreach ($override as $k => $v) {
            if (isset($default[$k]) && is_array($v)) {
                $default[$k] = $this->_mergeModuleConfig($default[$k], $override[$k]);
            } else {
                $default[$k] = $v;
            }
        }

        return $default;
    }

    /**
     * Handles autoloading of modules.
     *
     * @access  public
     * @param   string  $className
     * @return  void
     */
    public function moduleLoader($className)
    {
        // remove namespacing
        $className = (string) str_replace('\\', DIRECTORY_SEPARATOR, $className);

        $filename = explode('_', $className);
        $filename = array_map(function($arr) {
            return ucfirst($arr);
        }, $filename);

        if (count($filename) > 1) {
            $filename = implode('/', $filename);
        } else {
            // if no dir structure, assume file name has same name as module dir
            $filename = $filename[0] . '/' . $filename[0];
        }

        // remove our namespace from filename
        $filename = str_replace('Rebuilder/Modules/', '', $filename);
        $filename .= '.php';

        // check for file existance across all module paths
        $modulePaths = array($this->_defaultModulePath);
        if (!empty($this->_customModulePaths)) {
            $modulePaths += $this->_customModulePaths;
        }

        // check for existance in array
        foreach ($modulePaths as $path) {
            $filepath = $path . $filename;
            $this->log('Attempting to load module from path: ' . $filepath);
            if (file_exists($filepath)) {
                require_once($filepath);
                return true;
            }
        }

        $this->log('The class you have requested, ' . $className . ', could not be found.');
        die;
    }

    /**
     * Logs a message to the error log.
     *
     * @access  public
     * @param   $msg
     * @return  void
     */
    public function log($msg)
    {
        echo '[' . date('Y-m-d H:i:s') . '] ' . print_r($msg, true) . PHP_EOL;
    }

}


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 br.senac.tads.pi3.blacksystem.ablack;

/**
 *
 * @author Rafael
 */
public class PecaDao {

}