text:
//
//  SYRegisterViewController.m
//  MicroShop
//
//  Created by siyue on 15/5/30.
//  Copyright (c) 2015年 App. All rights reserved.
//

#import "SYRegisterViewController.h"
#import "CHLayout.h"

@interface SYRegisterViewController ()
@property (weak, nonatomic) IBOutlet UITextField *phoneTextField;
@property (weak, nonatomic) IBOutlet UITextField *passWordTextField;
@property (weak, nonatomic) IBOutlet UITextField *firmPassWordTextField;
@property (weak, nonatomic) IBOutlet UITextField *nickNameTextField;
@property (weak, nonatomic) IBOutlet UITextField *yanzhengTextField;
@property (weak, nonatomic) IBOutlet UIButton *registerBtn;
@property (weak, nonatomic) IBOutlet UIButton *verifyBtn;
@property (weak, nonatomic) IBOutlet UITextField *inviteTextField;

- (IBAction)backClick:(id)sender;
- (IBAction)registerClick:(id)sender;
- (IBAction)verifyBtnClick:(id)sender;

@property (nonatomic,strong)MBProgressHUD *progressHUD;//加载图标

@end

@implementation SYRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"免费注册";

    [self initView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)initView
{
    CHLayout *layout = [CHLayout sharedManager];
    [layout setView:self.verifyBtn withCornerRadius:3];
    [layout setView:self.registerBtn withCornerRadius:3];
}

#pragma mark - net

- (void)requestSendMSM
{
    if (self.progressHUD==nil) {
        self.progressHUD = [[MBProgressHUD alloc] initWithView:self.view];
        [self.view addSubview:self.progressHUD];
    }
    self.progressHUD.labelText = @"加载中";
    [self.progressHUD show:YES];

    NSString *phone = [NSString stringWithFormat:@"&tel=%@",self.phoneTextField.text];
    NSString *url = [NSString stringWithFormat:@"%@%@%@",HomeURL,Register_Send_MSM,phone];
    [[NetworkInterface shareInstance] requestNoCacheGet:url complete:^(NSDictionary *result) {
        [self didRequestSendMSM:result];
        [self.progressHUD hide:YES afterDelay:0];
    } error:^(NSError *error) {
        [self.progressHUD hide:YES afterDelay:0];
    }];
}

- (void)didRequestSendMSM:(NSDictionary *)result
{
    if ([result[@"code"] integerValue]==1) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"已发送手机号"];
    }
    else {
        NSString *message = result[@"message"];
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:message];
    }
}

- (void)requestRegister
{
    if (self.progressHUD==nil) {
        self.progressHUD = [[MBProgressHUD alloc] initWithView:self.view];
        [self.view addSubview:self.progressHUD];
    }
    self.progressHUD.labelText = @"加载中";
    [self.progressHUD show:YES];

    NSString *phone = [NSString stringWithFormat:@"%@",self.phoneTextField.text];
    NSString *password = [NSString stringWithFormat:@"%@",self.passWordTextField.text];
    NSString *repassword = [NSString stringWithFormat:@"%@",self.firmPassWordTextField.text];
    NSString *nickname = [NSString stringWithFormat:@"%@",self.nickNameTextField.text];
    NSString *verify = [NSString stringWithFormat:@"%@",self.yanzhengTextField.text];
    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
    [params setObject:phone forKey:@"tel"];
    [params setObject:password forKey:@"password"];
    [params setObject:repassword forKey:@"repassword"];
    [params setObject:nickname forKey:@"nickname"];
    [params setObject:verify forKey:@"verify"];

    NSString *invite = [NSString stringWithFormat:@"%@",self.inviteTextField.text];;
    if (invite!=nil) {
        [params setObject:invite forKey:@"inviter"];
    }

    NSString *url = [NSString stringWithFormat:@"%@%@",HomeURL,Register_New_User];

    [[NetworkInterface shareInstance] requestNoCachePost:url parms:params complete:^(NSDictionary *result) {
        [self didRequestREgister:result];
        [self.progressHUD hide:YES afterDelay:0];
    } error:^(NSError *error) {
        [self.progressHUD hide:YES afterDelay:0];
    }];
}

- (void)didRequestREgister:(NSDictionary *)result
{
    if ([result[@"code"] integerValue]==1) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"注册成功"];

        if (self.didBack!=nil) {
            self.didBack();
        }
        [self dismissViewControllerAnimated:YES completion:^{
            if (self.didRegister!=nil) {
                self.didRegister(self.phoneTextField.text,self.passWordTextField.text);
            }
        }];
    }
    else {
        NSString *message = result[@"message"];
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:message];
    }
}

- (IBAction)backClick:(id)sender {
    if (self.didBack!=nil) {
        self.didBack();
    }
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)registerClick:(id)sender {
    if ([self.phoneTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入手机号码"];
        return;
    }

    if (![self checkPhoneNumInputWithStr:self.phoneTextField.text]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入正确的手机号码"];
        return;
    }

    if ([self.passWordTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入密码"];
        return;
    }
    if ([self.firmPassWordTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请再次输入密码"];
        return;
    }
    if ([self.nickNameTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入昵称"];
        return;
    }
    if ([self.yanzhengTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入短信验证码"];
        return;
    }
    if (![self.passWordTextField.text isEqualToString:self.firmPassWordTextField.text]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"两次密码不一致"];
        return;
    }

    [self requestRegister];
}

- (IBAction)verifyBtnClick:(id)sender {
    if ([self.phoneTextField.text isEqualToString:@""]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入手机号码"];
        return;
    }

    if (![self checkPhoneNumInputWithStr:self.phoneTextField.text]) {
        [[DialogUtil sharedInstance] showDlg:self.view textOnly:@"请输入正确的手机号码"];
        return;
    }

    [self requestSendMSM];
}

-(BOOL)checkPhoneNumInputWithStr:(NSString *)str{

    /*NSString * MOBILE = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$";

    NSString * CM = @"^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$";

    NSString * CU = @"^1(3[0-2]|5[256]|8[56])\\d{8}$";

    NSString * CT = @"^1((33|53|8[09])[0-9]|349)\\d{7}$";

    // NSString * PHS = @"^0(10|2[0-5789]|\\d{3})\\d{7,8}$";

    NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE];
    NSPredicate *regextestcm = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CM];
    NSPredicate *regextestcu = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CU];
    NSPredicate *regextestct = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CT];
    BOOL res1 = [regextestmobile evaluateWithObject:str];
    BOOL res2 = [regextestcm evaluateWithObject:str];
    BOOL res3 = [regextestcu evaluateWithObject:str];
    BOOL res4 = [regextestct evaluateWithObject:str];

    if (res1 || res2 || res3 || res4 )
    {
        return YES;
    }
    else
    {
        return NO;
    }*/

    if (str.length==11) {
        return YES;
    }
    else {
        return NO;
    }
}

@end


text:
package gopacket

import (
	"github.com/google/gopacket"
	"github.com/google/gopacket/layers"
)

func FuzzDNS(data []byte) int {
	gopacket.NewPacket(data, layers.LayerTypeDNS, gopacket.Default)
	return 0
}

redpajama_set_name: RedPajamaGithub


text:
package edu.hm.hafner.analysis.parser;

import java.util.regex.Matcher;

import org.apache.commons.lang3.StringUtils;

import edu.hm.hafner.analysis.FastRegexpLineParser;
import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.IssueBuilder;

/**
 * A parser for the ant javac compiler warnings.
 *
 * @author Ullrich Hafner
 */
public class AntJavacParser extends FastRegexpLineParser {
    private static final long serialVersionUID = 1737791073711198075L;

    private static final String ANT_JAVAC_WARNING_PATTERN = ANT_TASK + "\\s*(.*java):(\\d*):\\s*" +
            "(?:warning|\u8b66\u544a)\\s*:\\s*(?:\\[(\\w*)\\])?\\s*(.*)$" + "|^\\s*\\[.*\\]\\s*warning.*\\]\\s*(.*\"(" +
            ".*)\".*)$" + "|^(.*class)\\s*:\\s*warning\\s*:\\s*(.*)$";
    // \u8b66\u544a is Japanese l10n

    /**
     * Creates a new instance of {@link AntJavacParser}.
     */
    public AntJavacParser() {
        super(ANT_JAVAC_WARNING_PATTERN);
    }

    @Override
    protected boolean isLineInteresting(final String line) {
        return line.contains("warning") || line.contains("\u8b66\u544a");
    }

    @Override
    protected Issue createWarning(final Matcher matcher, final IssueBuilder builder) {
        if (StringUtils.isNotBlank(matcher.group(7))) {
            return builder.setFileName(matcher.group(7))
                    .setLineStart(0)
                    .setCategory(StringUtils.EMPTY)
                    .setMessage(matcher.group(8))
                    .build();
        }
        else if (StringUtils.isBlank(matcher.group(5))) {
            return builder.setFileName(matcher.group(1))
                    .setLineStart(parseInt(matcher.group(2)))
                    .setCategory(guessCategoryIfEmpty(matcher.group(3), matcher.group(4)))
                    .setMessage(matcher.group(4))
                    .build();
        }
        else {
            return builder.setFileName(matcher.group(6))
                    .setLineStart(0)
                    .setCategory("Path")
                    .setMessage(matcher.group(5))
                    .build();
        }
    }
}


text:
var webdriver = require('selenium-webdriver'),
    chrome = require('selenium-webdriver/chrome'),
    safari = require('selenium-webdriver/safari'),
    phantomjs = require('selenium-webdriver/phantomjs'),
    firefox = require('selenium-webdriver/firefox'),
    By = webdriver.By,
    until = webdriver.until,
    test = require('selenium-webdriver/testing'),
    assert = require('assert');

test.describe('Task 13', function() {
    var driver;

    test.before(function() {
        var options = new chrome.Options();
        options.addArguments(["start-fullscreen"]);

        driver = new webdriver.Builder()
            //.withCapabilities({'marionette': true})
            .forBrowser('chrome')
            .setChromeOptions(options)
            .build();
        driver.getCapabilities().then(function(caps) {
            console.log(caps);
            driver.manage().timeouts().implicitlyWait(10000/*ms*/);
        });
    });

    var ducksColors = ["Green", "Red", "Purple"];

    test.it('Task 13 - wait and checkout cart', function() {

        driver.get("http://localhost/litecart/en/");

        driver.findElement(By.xpath("//*[@class='quantity']")).getText().then(function(text){

            console.log("\nИсходное число товаров в корзине = " + text);
            var productNumber = parseInt(text);
            assert.equal(0, productNumber, "Корзин не пустая");

            for(var i = 0; i < ducksColors.length; i++) {
                productNumber++;
                driver.findElement(By.xpath("//*[@class='name' and text()='"+ ducksColors[i] + " Duck']")).click();
                driver.findElement(By.name("add_cart_product")).click();

                // Ждем обновление счетчика.
                driver.findElement(By.xpath("//*[@class='quantity' and text()='" + productNumber +"']"));

                driver.get("http://localhost/litecart/en/");
            }

            // Проверка, что добавились все утки.
            var cartNumber = driver.findElement(By.xpath("//*[@class='quantity']"));
            cartNumber.getText().then(function(text) {
                assert.equal(ducksColors.length, parseInt(text), "Добавились не все утки");
                cartNumber.click();
            }).then(function(){
                for(var i = 0; i < ducksColors.length; i++) (function (x) {

                    driver.findElement(By.css("[name=cart_form]  a > strong")).getText().then(function(duckTitleText){

                        // Проверяем, что приплыла утка.
                        driver.findElement(By.xpath("//strong[text()='" + duckTitleText + "']")).then(function(duckTitle){

                            driver.wait(until.elementIsVisible(duckTitle), 5000/*ms*/).then(function(){

                                // Находим элемент в таблице до удаления.
                                driver.findElement(By.xpath("//*[@class='item' and text()='"+ duckTitleText + "']")).then(function(duckInTable) {
                                    // Удаляем утку.
                                    driver.findElement(By.name("remove_cart_item")).click();
                                    // Ждем исчезновения утки из таблицы.
                                    driver.wait(until.stalenessOf(duckInTable), 5000).then(function () {
                                        console.log("Утка " + duckTitleText + " исчезла из таблицы, идем дальше");
                                    });
                                });
                            });
                        });
                    });
                })(i);
            });

        });

    });

    test.after(function() {
        driver.sleep(2000);
        driver.quit();
    });
});


text:
.class Landroid/net/wifi/WifiWatchdogStateMachine$OnlineState;
.super Lcom/android/internal/util/State;
.source "WifiWatchdogStateMachine.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/net/wifi/WifiWatchdogStateMachine;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "OnlineState"
.end annotation

# instance fields
.field final synthetic this$0:Landroid/net/wifi/WifiWatchdogStateMachine;

# direct methods
.method constructor <init>(Landroid/net/wifi/WifiWatchdogStateMachine;)V
    .locals 0
    .parameter

    .prologue
    .line 823
    iput-object p1, p0, Landroid/net/wifi/WifiWatchdogStateMachine$OnlineState;->this$0:Landroid/net/wifi/WifiWatchdogStateMachine;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

# virtual methods
.method public enter()V
    .locals 2

    .prologue
    .line 826
    invoke-static {}, Landroid/net/wifi/WifiWatchdogStateMachine;->access$000()Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lcom/android/internal/util/State;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\n"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    #calls: Landroid/net/wifi/WifiWatchdogStateMachine;->log(Ljava/lang/String;)V
    invoke-static {v0}, Landroid/net/wifi/WifiWatchdogStateMachine;->access$100(Ljava/lang/String;)V

    .line 827
    :cond_0
    return-void
.end method


text:
//
// Copyright 2020 Google LLC
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//

using Google.Solutions.Common.Diagnostics;
using Google.Solutions.IapDesktop.Application.Services.Adapters;
using Google.Solutions.IapDesktop.Application.Services.ProjectModel;
using Google.Solutions.IapDesktop.Application.Views.ProjectExplorer;
using Google.Solutions.Mvvm.Binding;
using Google.Solutions.Mvvm.Controls;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Google.Solutions.IapDesktop.Extensions.Management.Views.PackageInventory
{
    [SkipCodeCoverage("All logic in view model")]
    public partial class PackageInventoryWindow
        : ProjectExplorerTrackingToolWindow<PackageInventoryViewModel>
    {
        private readonly PackageInventoryViewModel viewModel;

        public PackageInventoryWindow(
            PackageInventoryType inventoryType,
            IServiceProvider serviceProvider)
            : base(serviceProvider, WeifenLuo.WinFormsUI.Docking.DockState.DockBottomAutoHide)
        {
            this.components = new System.ComponentModel.Container();

            InitializeComponent();

            this.viewModel = new PackageInventoryViewModel(
                serviceProvider,
                inventoryType);

            this.infoLabel.BindProperty(
                c => c.Text,
                this.viewModel,
                m => m.InformationText,
                this.components);
            this.components.Add(this.viewModel.OnPropertyChange(
                m => m.IsInformationBarVisible,
                visible =>
                {
                    this.splitContainer.Panel1Collapsed = !visible;
                    this.splitContainer.SplitterDistance = this.splitContainer.Panel1MinSize;
                }));

            this.components.Add(this.viewModel.OnPropertyChange(
                m => m.WindowTitle,
                title =>
                {
                    // NB. Update properties separately instead of using multi-assignment,
                    // otherwise the title does not update properly.
                    this.TabText = title;
                    this.Text = title;
                }));
            this.viewModel.ResetWindowTitle();  // Fire event to set initial window title.

            // Bind list.
            this.packageList.BindProperty(
                c => c.Enabled,
                this.viewModel,
                m => m.IsPackageListEnabled,
                this.components);

            this.packageList.List.BindCollection(this.viewModel.FilteredPackages);
            this.packageList.List.AddCopyCommands();
            this.packageList.BindProperty(
                c => c.SearchTerm,
                this.viewModel,
                m => m.Filter,
                this.components);
            this.packageList.BindProperty(
                c => c.Loading,
                this.viewModel,
                m => m.IsLoading,
                this.components);
            this.packageList.SearchOnKeyDown = true;

            var openUrl = new ToolStripMenuItem(
                "&Additional information...",
                null,
                (sender, args) =>
                {
                    Browser.Default.Navigate(
                        this.packageList.List.SelectedModelItem?.Package?.Weblink.ToString());
                });
            this.packageList.List.ContextMenuStrip.Items.Add(openUrl);
            this.packageList.List.ContextMenuStrip.Opening += (sender, args) =>
            {
                openUrl.Enabled = this.packageList.List.SelectedModelItem?.Package?.Weblink != null;
            };
        }

        //---------------------------------------------------------------------
        // ProjectExplorerTrackingToolWindow.
        //---------------------------------------------------------------------

        protected override async Task SwitchToNodeAsync(IProjectModelNode node)
        {
            Debug.Assert(!InvokeRequired, "running on UI thread");
            await this.viewModel.SwitchToModelAsync(node)
                .ConfigureAwait(true);
        }

        //---------------------------------------------------------------------
        // Window events.
        //---------------------------------------------------------------------

        private void PackageInventoryWindow_KeyDown(object sender, KeyEventArgs e)
        {
            // NB. Hook KeyDown instead of KeyUp event to not interfere with
            // child dialogs. With KeyUp, we'd get an event if a child dialog
            // is dismissed by pressing Enter.

            if ((e.Control && e.KeyCode == Keys.F) ||
                 e.KeyCode == Keys.F3)
            {
                this.packageList.SetFocusOnSearchBox();
            }
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Krypt. -Fl. Brandenburg (Leipzig) 9(3): 597 (1914)

#### Original name
Microdiplodia rhaphiolepidis Henn.

### Remarks
null


text:
using System;
using System.Text;
using System.Drawing;
using Codeer.Friendly.Windows.Grasp;
using Codeer.Friendly.Windows.NativeStandardControls.Inside;
using Codeer.TestAssistant.GeneratorToolKit;

namespace Codeer.Friendly.Windows.NativeStandardControls
{
#if ENG
    /// <summary>
    /// Provides operations on windows of WindowClass type ListBox.
    /// </summary>
#else
    /// <summary>
    /// WindowClassがListBoxのウィンドウに対応した操作を提供します。
    /// </summary>
#endif
    [ControlDriver(WindowClassName = "ListBox")]
    public class NativeListBox : NativeWindow
    {
        Type MyType => typeof(NativeListBox);

        internal const int LB_SETSEL = 0x0185;
        internal const int LB_SETCURSEL = 0x0186;
        internal const int LB_GETSEL = 0x0187;
        internal const int LB_GETCURSEL = 0x0188;
        internal const int LB_GETTEXT = 0x0189;
        internal const int LB_GETTEXTLEN = 0x018A;
        internal const int LB_GETCOUNT = 0x018B;
        internal const int LB_GETTOPINDEX = 0x018E;
        internal const int LB_GETSELCOUNT = 0x0190;
        internal const int LB_GETSELITEMS = 0x0191;
        internal const int LB_SETTOPINDEX = 0x0197;
        internal const int LB_GETITEMRECT = 0x0198;
        internal const int LB_GETITEMDATA = 0x0199;
        internal const int LBN_SELCHANGE = 1;
        internal const int LBN_DBLCLK = 2;
        internal const int LVS_SINGLESEL = 0x4;

#if ENG
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="src">WindowControl with the target window. </param>
#else
        /// <summary>
        /// コンストラクタです。
        /// </summary>
        /// <param name="src">元となるウィンドウコントロールです。</param>
#endif
        public NativeListBox(WindowControl src)
            : base(src)
        {
            Initializer.Initialize(App);
        }

#if ENG
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="app">Application manipulation object.</param>
        /// <param name="windowHandle">Window handle.</param>
#else
        /// <summary>
        /// コンストラクタです。
        /// </summary>
        /// <param name="app">アプリケーション操作クラス。</param>
        /// <param name="windowHandle">ウィンドウハンドル。</param>
#endif
        public NativeListBox(WindowsAppFriend app, IntPtr windowHandle)
            : base(app, windowHandle)
        {
            Initializer.Initialize(App);
        }

#if ENG
        /// <summary>
        /// Returns the number of items in the control.
        /// </summary>
#else
        /// <summary>
        /// アイテム数です。
        /// </summary>
#endif
        public int Count
        {
            get
            {
                return (int)SendMessage(LB_GETCOUNT, IntPtr.Zero, IntPtr.Zero);
            }
        }

#if ENG
        /// <summary>
        /// Returns the currently selected index.
        /// Please use SelectedIndices for multiple selection listboxes.
        /// </summary>
#else
        /// <summary>
        /// 現在選択されているアイテムのインデックスです。
        /// 複数選択リストボックスの場合はItemSelectedIndicesを使用してください。
        /// </summary>
#endif
        public int CurrentSelectedIndex
        {
            get
            {
                return (int)App[MyType, "GetCurrentSelectedIndexInTarget"](Handle).Core;
            }
        }

#if ENG
        /// <summary>
        /// Returns an array of all selected indices.
        /// Please use CurrentSelectedIndex for single selection listboxes.
        /// </summary>
#else
        /// <summary>
        /// 現在選択されているアイテムのインデックスの配列です。
        /// 単一選択リストボックスの場合はCurrentSelectedIndexを使用してください。
        /// </summary>
#endif
        public int[] SelectedIndices
        {
            get
            {
                return (int[])App[MyType, "GetSelectedIndicesInTarget"](Handle).Core;
            }
        }

#if ENG
        /// <summary>
        /// Returns the index of the top item displayed in the list box.
        /// </summary>
#else
        /// <summary>
        /// リストボックスに表示される文字列の先頭インデックスです。
        /// </summary>
#endif
        public int TopIndex
        {
            get
            {
                return (int)SendMessage(LB_GETTOPINDEX, IntPtr.Zero, IntPtr.Zero);
            }
        }

#if ENG
        /// <summary>
        /// Returns the data for the indicated item.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <returns>Item data.</returns>
#else
        /// <summary>
        /// アイテムデータを取得します。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <returns>アイテムデータ。</returns>
#endif
        public IntPtr GetItemData(int index)
        {
            return SendMessage(LB_GETITEMDATA, new IntPtr(index), IntPtr.Zero);
        }

#if ENG
        /// <summary>
        /// Returns the text of the indicated item.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <returns>Item text.</returns>
#else
        /// <summary>
        /// 指定のインデックスのテキストを取得します。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <returns>テキスト。</returns>
#endif
        public string GetItemText(int index)
        {
            return (string)App[MyType, "GetTextInTarget"](Handle, index).Core;
        }

#if ENG
        /// <summary>
        /// Finds an item with the indicated text.
        /// </summary>
        /// <param name="findStart">Index where searching should start.</param>
        /// <param name="text">Text to search for.</param>
        /// <returns>Index of the item found. Returns -1 if the item is not found.</returns>
#else
        /// <summary>
        /// 指定のテキストのアイテムを検索します。
        /// </summary>
        /// <param name="findStart">検索開始インデックス。</param>
        /// <param name="text">テキスト。</param>
        /// <returns>アイテムインデックス。未発見時は-1が返ります。</returns>
#endif
        public int FindItem(int findStart, string text)
        {
            return (int)App[MyType, "FindItemInTarget"](Handle, findStart, text).Core;
        }

#if ENG
        /// <summary>
        /// Returns the client rectangle of the item with the indicated index.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <returns>Returns -1 in the case of failure.</returns>
#else
        /// <summary>
        /// 指定のインデックスのアイテムのクライアント矩形を取得します。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <returns>失敗時は-1が返ります。</returns>
#endif
        public Rectangle GetItemRect(int index)
        {
            AppVar inTarget = App.Dim(new RECT());
            App[typeof(NativeMethods), "SendMessage"](Handle, LB_GETITEMRECT, new IntPtr(index), inTarget);
            return NativeDataUtility.ToRectangle((RECT)inTarget.Core);
        }

#if ENG
        /// <summary>
        /// Scrolls the list so that the item with the indicated index is the top item.
        /// When it is not possible to show the indicated item at the top, the list is scrolled so that the indicated item is visible.        /// </summary>
        /// <param name="index">head index.</param>
#else
        /// <summary>
        /// リストボックスに表示される文字列の先頭インデックスを設定します。
        /// 先頭になれない場合は、表示領域に指定のインデックスのアイテムが入るようにスクロールされます。
        /// </summary>
        /// <param name="index">先頭インデックス。</param>
#endif
        public void SetTopIndex(int index)
        {
            SendMessage(LB_SETTOPINDEX, new IntPtr(index), IntPtr.Zero);
        }

#if ENG
        /// <summary>
        /// Changes the currently selected index.
        /// Causes a LBN_SELCHANGE notification.
        /// Please use EmulateChangeSelect for multiple selection list boxes.
        /// </summary>
        /// <param name="index">Index to select.</param>
#else
        /// <summary>
        /// 現在選択されているインデックスを設定します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 複数選択リストボックスの場合はEmulateChangeSelectを使用してください。
        /// </summary>
        /// <param name="index">選択インデックス。</param>
#endif
        public void EmulateChangeCurrentSelectedIndex(int index)
        {
            App[MyType, "EmulateChangeCurrentSelectedIndexInTarget"](Handle, index);
        }

#if ENG
        /// <summary>
        /// Changes the currently selected index.
        /// Causes a LBN_SELCHANGE notification.
        /// Please use EmulateChangeSelect for multiple selection list boxes.
        /// Executes asynchronously.
        /// </summary>
        /// <param name="index">Index to select.</param>
        /// <param name="async">Asynchronous execution object.</param>
#else
        /// <summary>
        /// 現在選択されているインデックスを設定します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 複数選択リストボックスの場合はEmulateChangeSelectを使用してください。
        /// 非同期で実行します。
        /// </summary>
        /// <param name="index">選択インデックス。</param>
        /// <param name="async">非同期実行オブジェクト。</param>
#endif
        public void EmulateChangeCurrentSelectedIndex(int index, Async async)
        {
            App[MyType, "EmulateChangeCurrentSelectedIndexInTarget", async](Handle, index);
        }

#if ENG
        /// <summary>
        /// Sets the selected state of a specific item in the control.
        /// Causes a LBN_SELCHANGE notification.
        /// Please use EmulateChangeCurrentSelectedIndex for single selection list boxes.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <param name="isSelect">Selects the item if true, deselects it if false.</param>
#else
        /// <summary>
        /// 指定のインデックスのアイテムの選択状態を変更します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 単一選択リストボックスの場合はEmulateChangeCurrentSelectedIndexInTargetを使用してください。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <param name="isSelect">選択状態にする場合はtrueを設定します。</param>
#endif
        public void EmulateChangeSelect(int index, bool isSelect)
        {
            App[MyType, "EmulateChangeSelectInTarget"](Handle, index, isSelect);
        }

#if ENG
        /// <summary>
        /// Sets the selected state of a specific item in the control.
        /// Causes a LBN_SELCHANGE notification.
        /// Please use EmulateChangeCurrentSelectedIndex for single selection list boxes.
        /// Executes asynchronously.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <param name="isSelect">Selects the item if true, deselects it if false.</param>
        /// <param name="async">Asynchronous execution object.</param>
#else
        /// <summary>
        /// 指定のインデックスのアイテムの選択状態を変更します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 単一選択リストボックスの場合はEmulateChangeCurrentSelectedIndexInTargetを使用してください。
        /// 非同期で実行します。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <param name="isSelect">選択状態にする場合はtrueを設定します。</param>
        /// <param name="async">非同期実行オブジェクト。</param>
#endif
        public void EmulateChangeSelect(int index, bool isSelect, Async async)
        {
            App[MyType, "EmulateChangeSelectInTarget", async](Handle, index, isSelect);
        }

        /// <summary>
        /// 現在選択されているアイテムのインデックスの配列です。
        /// 単一選択リストボックスの場合はCurrentSelectedIndexを使用してください。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <returns>現在選択されているアイテムのインデックスの配列。</returns>
        internal static int[] GetSelectedIndicesInTarget(IntPtr handle)
        {
            int count = (int)NativeMethods.SendMessage(handle, LB_GETCOUNT, IntPtr.Zero, IntPtr.Zero);
            int[] selectState = new int[count];
            int selCount = (int)NativeMethods.SendMessage(handle, LB_GETSELITEMS, new IntPtr(count), selectState);
            if (selCount == -1)
            {
                return new int[0];
            }
            int[] trim = new int[selCount];
            for (int i = 0; i < selCount; i++)
            {
                trim[i] = selectState[i];
            }
            return trim;
        }

        /// <summary>
        /// 指定のテキストのアイテムを検索します。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <param name="findStart">検索開始インデックス。</param>
        /// <param name="text">テキスト。</param>
        /// <returns>アイテムインデックス。未発見時は-1が返ります。</returns>
        private static int FindItemInTarget(IntPtr handle, int findStart, string text)
        {
            int count = (int)NativeMethods.SendMessage(handle, LB_GETCOUNT, IntPtr.Zero, IntPtr.Zero);
            for (int i = findStart; i < count; i++)
            {
                if (GetTextInTarget(handle, i) == text)
                {
                    return i;
                }
            }
            return -1;
        }

        /// <summary>
        /// 指定のインデックスのテキストを取得します。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <param name="index">インデックス。</param>
        /// <returns>テキスト。</returns>
        private static string GetTextInTarget(IntPtr handle, int index)
        {
            int len = NativeMethods.SendMessage(handle, LB_GETTEXTLEN, new IntPtr(index), IntPtr.Zero).ToInt32();
            StringBuilder builder = new StringBuilder((len + 1) * 8);
            NativeMethods.SendMessage(handle, LB_GETTEXT, new IntPtr(index), builder);
            return builder.ToString();
        }

        /// <summary>
        /// 現在選択されているインデックスを設定します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 複数選択リストボックスの場合はEmulateChangeSelectを使用してください。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <param name="index">選択インデックス。</param>
        private static void EmulateChangeCurrentSelectedIndexInTarget(IntPtr handle, int index)
        {
            NativeMethods.SetFocus(handle);
            NativeMethods.SendMessage(handle, LB_SETCURSEL, new IntPtr(index), IntPtr.Zero);
            EmulateUtility.SendCommand(handle, LBN_SELCHANGE);
        }

        /// <summary>
        /// 指定のインデックスのアイテムの選択状態を変更します。
        /// LBN_SELCHANGEの通知が発生します。
        /// 単一選択リストボックスの場合はEmulateChangeCurrentSelectedIndexInTargetを使用してください。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <param name="index">インデックス。</param>
        /// <param name="isSelect">選択状態にする場合はtrueを設定します。</param>
        private static void EmulateChangeSelectInTarget(IntPtr handle, int index, bool isSelect)
        {
            NativeMethods.SetFocus(handle);
            NativeMethods.SendMessage(handle, LB_SETSEL, NativeDataUtility.ToIntPtr(isSelect), new IntPtr(index));
            EmulateUtility.SendCommand(handle, LBN_SELCHANGE);
        }

        /// <summary>
        /// 現在の選択インデックスを取得する。
        /// </summary>
        /// <param name="handle">ウィンドウハンドル。</param>
        /// <returns>現在の選択インデックス。</returns>
        internal static int GetCurrentSelectedIndexInTarget(IntPtr handle)
        {
            return (int)NativeMethods.SendMessage(handle, NativeListBox.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero);
        }
    }
}


text:
package arduinoMeasurement.controller.events;

import arduinoMeasurement.mockup.SettingsMockup;

public class ChangeSettingsEvent extends ControllerEvent
{
	private final SettingsMockup settingsMockup;

	public ChangeSettingsEvent(final SettingsMockup settingsMockup)
	{
		this.settingsMockup = settingsMockup;
	}

	public SettingsMockup getSettingsMockup()
	{
		return settingsMockup;
	}

}


text:
package org.eclipse.gemini.blueprint.internal.service.interceptor;

import org.aopalliance.intercept.MethodInvocation;
import org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

/**
 * @author Costin Leau
 */
public class OsgiServiceInvokerTest {

    private ServiceInvoker invoker;

    private Object target;

    /*
     * (non-Javadoc)
     *
     * @see junit.framework.TestCase#setUp()
     */
    @Before
    public void setUp() throws Exception {
        target = new Object();
        invoker = new ServiceInvoker() {

            protected Object getTarget() {
                return target;
            }

            public void destroy() {
            }
        };
    }

    @After
    public void tearDown() throws Exception {
        target = null;
        invoker = null;
    }

    /**
     * Test method for
     * {@link org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker#invoke(org.aopalliance.intercept.MethodInvocation)}.
     */
    @Test
    public void testInvoke() throws Throwable {
        MethodInvocation invocation = new MockMethodInvocation(Object.class.getMethod("hashCode", null));
        Object result = invoker.invoke(invocation);
        assertEquals("different target invoked", target.hashCode(), result);
    }

    @Test
    public void testExceptionUnwrapping() throws Throwable {
        MethodInvocation invocation = new MockMethodInvocation(Integer.class.getMethod("parseInt",
                new Class<?>[]{String.class}), new Object[]{"invalid number"});

        try {
            invoker.invoke(invocation);
            fail("should have thrown exception" + NumberFormatException.class);
        } catch (NumberFormatException nfe) {
            // expected
        }
    }
}


text:
import { Injectable, QueryList } from '@angular/core';
import { BaseResizableTableService, ResizableTableType } from '../resizable-table-base.service';
import { ResizableTableColumnComponent } from '../resizable-table-column.component';

@Injectable()
export class ResizableExpandingTableService extends BaseResizableTableService {

    /** Define the type of resizing we should use */
    type: ResizableTableType = ResizableTableType.Expand;

    /** Store the QueryList of columns */
    private _columns: QueryList<ResizableTableColumnComponent>;

    /** Store the size of each column */
    setColumns(columns: QueryList<ResizableTableColumnComponent>): void {

        // store the current columns
        this._columns = columns;

        // store the sizes
        this.columns = columns.map(column => (column.getNaturalWidth() / this.tableWidth) * 100);

        // ensure all the columns fit
        this._columns.forEach((column, idx) => {
            if (!column.disabled) {
                this.columns = this.setColumnWidth(idx, this.columns[idx], ColumnUnit.Percentage, this.columns);
            }
        });

        // indicate we are now initialised
        if (this.isInitialised$.value === false) {
            this.isInitialised$.next(true);
        }
    }

    /** Set all resizable columns to the same width */
    setUniformWidths(): void {

        // set any disabled columns to their specified width
        this.columns = this._columns.map(column => column.disabled ? (column.getNaturalWidth() / this.tableWidth) * 100 : 0);

        // check to see if we've reached 100% of the table width
        const totalWidth = this.columns.reduce((partial, columnWidth) => partial + columnWidth);

        if (totalWidth > 98) {
            // remove overflow
            this.columns = this.ensureNoOverflow(this.columns);
        } else {
            // get the list of resizable columns
            const resizableColumns = this._columns.toArray().filter(column => !column.disabled);

            // work out what we need to add to each column to make up the full width
            const newWidth = (98 - totalWidth) / resizableColumns.length;

            // set the non-disabled columns to the new width
            this.columns = this._columns.map((column, idx) => column.disabled ? this.columns[idx] : newWidth);
        }

        // do the resizing
        this._columns.forEach((column, idx) => {
            if (!column.disabled) {
                this.resizeColumn(idx, 0, false);
            }
        });

    }

    ensureNoOverflow(columns: ReadonlyArray<number>): ReadonlyArray<number> {

        // get the total width
        const total = columns.reduce((width, column) => width + column);

        // if we have no overflow then we don't need to do anything
        if (total <= 100) {
            return columns;
        }

        // if there is overflow identify which columns can be resized
        const variableColumns = this._columns.filter(column => !column.disabled && this.getColumnWidth(column.getCellIndex(), ColumnUnit.Pixel, columns) > column.minWidth);

        // if there are no columns that can be resized then stop here
        if (variableColumns.length === 0) {
            return columns;
        }

        // determine the total width of the variable columns
        const totalWidth = this._columns.reduce((width, column) => width + this.getColumnWidth(column.getCellIndex(), ColumnUnit.Pixel, columns), 0);

        // determine to the width of all the variable columns
        const variableColumnsWidth = variableColumns.reduce((width, column) => width + this.getColumnWidth(column.getCellIndex(), ColumnUnit.Pixel, columns), 0);

        // determine how much the columns are currently too large (ignoring fixed columns)
        const targetWidth = this.tableWidth - (totalWidth - variableColumnsWidth);

        // determine how much we need to reduce a column by
        const difference = variableColumnsWidth - targetWidth;

        // find the column with the largest size
        const target = variableColumns.reduce((widest, column) => {
            const columnWidth = this.getColumnWidth(column.getCellIndex(), ColumnUnit.Pixel, columns);
            const widestWidth = this.getColumnWidth(widest.getCellIndex(), ColumnUnit.Pixel, columns);

            return columnWidth > widestWidth ? column : widest;
        });

        // perform the resize
        columns = this.setColumnWidth(target.getCellIndex(), this.getColumnWidth(target.getCellIndex(), ColumnUnit.Pixel, columns) - difference, ColumnUnit.Pixel, columns);

        // check if we are still over the limit (allow some variance for javascript double precision)
        if (columns.reduce((width, column) => width + column) > 100.01) {
            return this.ensureNoOverflow(columns);
        }

        return columns;
    }

    /** Allow setting the column size in any unit */
    setColumnWidth(index: number, value: number, unit: ColumnUnit, columns: ReadonlyArray<number> = this.columns): ReadonlyArray<number> {
        // create a new array so we keep the instance array immutable
        const sizes = [...columns];

        switch (unit) {

            case ColumnUnit.Percentage:
                sizes[index] = value;
                break;

            case ColumnUnit.Pixel:
                sizes[index] = (value / this.tableWidth) * 100;
                break;
        }

        // update the instance variable
        return sizes;
    }

    /** Resize a column by a specific pixel amount */
    resizeColumn(index: number, delta: number, isDragging: boolean = true): void {

        // get the sibling column that will also be resized
        const sibling = this.getSiblingColumn(index);

        // create a new array for the sizes
        let columns = [...this.columns] as number[];

        // resize the column to the desired size
        columns = this.setColumnWidth(index, Math.round(this.getColumnWidth(index, ColumnUnit.Pixel) + delta), ColumnUnit.Pixel) as number[];
        columns = this.setColumnWidth(sibling, Math.round(this.getColumnWidth(sibling, ColumnUnit.Pixel)), ColumnUnit.Pixel, columns) as number[];

        // if the move is not possible then stop here
        if (!this.isWidthValid(index, this.getColumnWidth(index, ColumnUnit.Pixel, columns))) {
            return;
        }

        // store the new sizes
        this.columns = columns;

        // emit the resize event for each column
        this.onResize$.next();
    }

    /** Get the next column in the sequence of columns */
    private getSiblingColumn(index: number): number | null {

        // find the first sibling that is not disabled
        for (let idx = index + 1; idx < this.columns.length; idx++) {

            const sibling = this.getColumn(idx);

            if (!sibling || !sibling.disabled) {
                return idx;
            }
        }

        return null;
    }

    /** Return true if this column is above the minimum width */
    private isWidthValid(index: number, width: number): boolean {

        // get the column at a given position
        const column = this.getColumn(index);

        // determine if the specified width is greater than the min width
        return column && width >= column.minWidth;
    }

    getColumn(index: number): ResizableTableColumnComponent | null {
        return this._columns ? this._columns.toArray()[index] : null;
    }

    getColumnDisabled(index: number): boolean {
        return this.getColumn(index) ? this.getColumn(index).disabled : false;
    }

}

export enum ColumnUnit {
    Pixel,
    Percentage
}


text:
var loadJsLibrary = function(path, callback){
	var script=document.createElement('script');
	script.src=path;
	script.type='text/javascript';
	script.addEventListener('load', callback);
	document.head.appendChild(script);
};

(function initialize(){
	// loadJsLibrary("js/jquery-2.1.1/jquery.min.js", function(){
	// 	// $("#su").attr("value","search");
	// });
	// $("#su").attr("value","search");
})();