text:
@interface LoginVC ()

@property (nonatomic, weak) UIButton *miMaLoginBtn ;
@property (nonatomic, weak) UIButton *yanZhenLoginBtn ;
@property (nonatomic, weak) UIView *lineView;
@property (nonatomic, weak) UIView *miMaloginView;
@property (nonatomic, weak) UIView *yanZhenloginView;
@property (nonatomic, weak) UITextField *telTextField;
@property (nonatomic, weak) UITextField *yanZhenMaTextField ;
@property (nonatomic, weak) JXTimeButton * timeBtn;

@property (nonatomic, copy) NSString *key;

@end

@implementation LoginVC

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.navigationItem.title = @"登录";

    [self drawView];
}

- (void)drawView
{
//    UIButton *miMaLoginBtn = [[UIButton alloc] init];
//    [miMaLoginBtn setTitle:@"密码登录" forState:UIControlStateNormal];
//    [miMaLoginBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    miMaLoginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
//    miMaLoginBtn.backgroundColor = [UIColor whiteColor];
//    [miMaLoginBtn addTarget:self action:@selector(didClickMiMaLoginBtn) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:miMaLoginBtn];
//    self.miMaLoginBtn = miMaLoginBtn;
//
//    UIButton *yanZhenLoginBtn = [[UIButton alloc] init];
//    [yanZhenLoginBtn setTitle:@"验证登录" forState:UIControlStateNormal];
//    [yanZhenLoginBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
//    yanZhenLoginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
//    yanZhenLoginBtn.backgroundColor = [UIColor whiteColor];
//    [yanZhenLoginBtn addTarget:self action:@selector(didClickYanZhenLoginBtn) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:yanZhenLoginBtn];
//    self.yanZhenLoginBtn = yanZhenLoginBtn;

//    UIView *lineView = [[UIView alloc] init];
//    lineView.backgroundColor = [UIColor colorWithRed:0.325 green:0.824 blue:0.969 alpha:1.00];
//    [self.view addSubview:lineView];
//    self.lineView = lineView;

//    UIView *miMaloginView = [[UIView alloc] init];
//    miMaloginView.backgroundColor = [UIColor colorWithRed:0.906 green:0.910 blue:0.914 alpha:1.00];
//    miMaloginView.hidden = NO;
//    [self.view addSubview:miMaloginView];
//    self.miMaloginView = miMaloginView;

    UIView *yanZhenloginView = [[UIView alloc] init];
    yanZhenloginView.backgroundColor = [UIColor colorWithRed:0.906 green:0.910 blue:0.914 alpha:1.00];
    yanZhenloginView.hidden = NO;
    [self.view addSubview:yanZhenloginView];
    self.yanZhenloginView = yanZhenloginView;

//-----------------------------------------------------------------------------
//    UITextField *nameTextField = [[UITextField alloc] init];
//    nameTextField.placeholder = @"用户名";
//    nameTextField.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user"]];
//    nameTextField.leftViewMode = UITextFieldViewModeAlways;
//    nameTextField.font = [UIFont systemFontOfSize:16];
//    nameTextField.backgroundColor = [UIColor whiteColor];
//    nameTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
//    nameTextField.layer.borderWidth = 0.5;
//    [miMaloginView addSubview:nameTextField];
//
//    UITextField *passwordTextField = [[UITextField alloc] init];
//    passwordTextField.placeholder = @"密码";
//    passwordTextField.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pw"]];
//    passwordTextField.leftViewMode = UITextFieldViewModeAlways;
//    passwordTextField.font = [UIFont systemFontOfSize:16];
//    passwordTextField.backgroundColor = [UIColor whiteColor];
//    passwordTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
//    passwordTextField.layer.borderWidth = 0.5;
//    passwordTextField.secureTextEntry = YES;
//    [miMaloginView addSubview:passwordTextField];
//
//    UIButton *loginBtn = [[UIButton alloc] init];
//    [loginBtn setTitle:@"登录" forState:UIControlStateNormal];
//    [loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    loginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
//    loginBtn.backgroundColor = [UIColor colorWithRed:0.325 green:0.824 blue:0.969 alpha:1.00];
//    [loginBtn addTarget:self action:@selector(didClickLoginBtn) forControlEvents:UIControlEventTouchUpInside];
//    [miMaloginView addSubview:loginBtn];
//
//    UIButton *forgetPasswodrBtn = [[UIButton alloc] init];
//    [forgetPasswodrBtn setTitle:@"忘记密码?" forState:UIControlStateNormal];
//    [forgetPasswodrBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
//    forgetPasswodrBtn.titleLabel.font = [UIFont systemFontOfSize:14];
//    [forgetPasswodrBtn addTarget:self action:@selector(didClickForgetPasswordBtn) forControlEvents:UIControlEventTouchUpInside];
//    [miMaloginView addSubview:forgetPasswodrBtn];

//-----------------------------------------------------------------------------
    UITextField *telTextField = [[UITextField alloc] init];
    telTextField.placeholder = @"手机号码";
    telTextField.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tel"]];
    telTextField.keyboardType = UIKeyboardTypeNumberPad;
    telTextField.leftViewMode = UITextFieldViewModeAlways;
    telTextField.font = [UIFont systemFontOfSize:16];
    telTextField.backgroundColor = [UIColor whiteColor];
    telTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
    telTextField.layer.borderWidth = 0.5;
    telTextField.text = [UserDefaults valueForKey:@"username"];
    [yanZhenloginView addSubview:telTextField];
    self.telTextField = telTextField;

    UITextField *yanZhenMaTextField = [[UITextField alloc] init];
    yanZhenMaTextField.placeholder = @"验证码";
    yanZhenMaTextField.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"key"]];
    yanZhenMaTextField.leftViewMode = UITextFieldViewModeAlways;
    yanZhenMaTextField.font = [UIFont systemFontOfSize:16];
    yanZhenMaTextField.backgroundColor = [UIColor whiteColor];
    yanZhenMaTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
    yanZhenMaTextField.layer.borderWidth = 0.5;
    [yanZhenloginView addSubview:yanZhenMaTextField];
    self.yanZhenMaTextField = yanZhenMaTextField;

    UIButton *loginBtn2 = [[UIButton alloc] init];
    [loginBtn2 setTitle:@"登录" forState:UIControlStateNormal];
    [loginBtn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    loginBtn2.titleLabel.font = [UIFont systemFontOfSize:16];
    loginBtn2.backgroundColor = [UIColor colorWithRed:0.325 green:0.824 blue:0.969 alpha:1.00];
    [loginBtn2 addTarget:self action:@selector(didClickLoginBtn) forControlEvents:UIControlEventTouchUpInside];
    [yanZhenloginView addSubview:loginBtn2];

//    UIButton *forgetPasswodrBtn2 = [[UIButton alloc] init];
//    [forgetPasswodrBtn2 setTitle:@"忘记密码?" forState:UIControlStateNormal];
//    [forgetPasswodrBtn2 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
//    forgetPasswodrBtn2.titleLabel.font = [UIFont systemFontOfSize:14];
//    [forgetPasswodrBtn2 addTarget:self action:@selector(didClickForgetPasswordBtn) forControlEvents:UIControlEventTouchUpInside];
//    [yanZhenloginView addSubview:forgetPasswodrBtn2];

//    miMaLoginBtn.sd_layout
//    .leftSpaceToView(self.view,0)
//    .topSpaceToView(self.view,0)
//    .widthIs(ScreenWidth/2)
//    .heightIs(44);
//
//    yanZhenLoginBtn.sd_layout
//    .rightSpaceToView(self.view,0)
//    .topSpaceToView(self.view,0)
//    .widthIs(ScreenWidth/2)
//    .heightIs(44);
//
//    lineView.sd_layout
//    .centerXEqualToView(miMaLoginBtn)
//    .topSpaceToView(miMaLoginBtn,-2)
//    .widthIs(100)
//    .heightIs(2);
//
//    miMaloginView.sd_layout
//    .topSpaceToView(miMaLoginBtn,0)
//    .leftSpaceToView(self.view,0)
//    .rightSpaceToView(self.view,0)
//    .bottomSpaceToView(self.view,0);

    yanZhenloginView.sd_layout
    .topSpaceToView(self.view,0)
    .leftSpaceToView(self.view,0)
    .rightSpaceToView(self.view,0)
    .bottomSpaceToView(self.view,0);

//-------------------------------------------------------------------------
//    nameTextField.sd_layout
//    .topSpaceToView(miMaloginView,15)
//    .leftSpaceToView(miMaloginView,15)
//    .rightSpaceToView(miMaloginView,15)
//    .heightIs(40);
//
//    passwordTextField.sd_layout
//    .topSpaceToView(nameTextField,15)
//    .leftSpaceToView(miMaloginView,15)
//    .rightSpaceToView(miMaloginView,15)
//    .heightIs(40);
//
//    loginBtn.sd_layout
//    .topSpaceToView(passwordTextField,15)
//    .leftSpaceToView(miMaloginView,15)
//    .rightSpaceToView(miMaloginView,15)
//    .heightIs(40);
//
//    forgetPasswodrBtn.sd_layout
//    .topSpaceToView(loginBtn,5)
//    .centerXEqualToView(loginBtn)
//    .widthIs(100)
//    .heightIs(20);

//-------------------------------------------------------------------------

    telTextField.sd_layout
    .topSpaceToView(yanZhenloginView,15)
    .leftSpaceToView(yanZhenloginView,15)
    .rightSpaceToView(yanZhenloginView,15)
    .heightIs(40);

    yanZhenMaTextField.sd_layout
    .topSpaceToView(telTextField,15)
    .leftSpaceToView(yanZhenloginView,15)
    .rightSpaceToView(yanZhenloginView,15)
    .heightIs(40);

    loginBtn2.sd_layout
    .topSpaceToView(yanZhenMaTextField,15)
    .leftSpaceToView(yanZhenloginView,15)
    .rightSpaceToView(yanZhenloginView,15)
    .heightIs(40);

//    forgetPasswodrBtn2.sd_layout
//    .topSpaceToView(loginBtn2,5)
//    .centerXEqualToView(loginBtn2)
//    .widthIs(100)
//    .heightIs(20);

    UIView *yuanZhenMaRightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 110, 40)];
    yuanZhenMaRightView.backgroundColor = [UIColor clearColor];
    yanZhenMaTextField.rightView = yuanZhenMaRightView;
    yanZhenMaTextField.rightViewMode = UITextFieldViewModeAlways;

    __weak typeof(self) weakSelf = self;
    JXTimeButton * timeBtn = [[JXTimeButton alloc] initWithFrame:CGRectMake(0, 0, 90, 20) AndBeforeTitle:@"获取验证码" AndWorkingMarkStr:@"剩余时间:" AndTimeSum:60 AndTimeButtonStar:^{
        NSLog(@"STAR");
        [weakSelf requestGetCode];
    } AndTimeButtonStop:^{
        NSLog(@"STOP");
    }];
    self.timeBtn = timeBtn;

    timeBtn.textColor = [UIColor whiteColor];
    timeBtn.center = self.view.center;
    timeBtn.font = [UIFont systemFontOfSize:14];
    timeBtn.textAlignment = 1;
    timeBtn.backgroundColor = [UIColor colorWithRed:0.325 green:0.824 blue:0.969 alpha:1.00];
    timeBtn.layer.masksToBounds = YES;
    timeBtn.layer.cornerRadius = 8;
    [yuanZhenMaRightView addSubview:timeBtn];

    timeBtn.sd_layout
    .centerYEqualToView(yuanZhenMaRightView)
    .rightSpaceToView(yuanZhenMaRightView,15)
    .widthIs(90)
    .heightIs(30);

}

- (void)didClickMiMaLoginBtn
{
    [self.miMaLoginBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.yanZhenLoginBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    self.miMaloginView.hidden = NO;
    self.yanZhenloginView.hidden = YES;

    self.lineView.sd_resetLayout
    .centerXEqualToView(self.miMaLoginBtn)
    .topSpaceToView(self.miMaLoginBtn,-2)
    .widthIs(100)
    .heightIs(2);
}

- (void)didClickYanZhenLoginBtn
{
    [self.miMaLoginBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.yanZhenLoginBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.miMaloginView.hidden = YES;
    self.yanZhenloginView.hidden = NO;

    self.lineView.sd_resetLayout
    .centerXEqualToView(self.yanZhenLoginBtn)
    .topSpaceToView(self.yanZhenLoginBtn,-2)
    .widthIs(100)
    .heightIs(2);
}

- (void)didClickForgetPasswordBtn
{
    ForgetPasswordVC *vc = [[ForgetPasswordVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didClickLoginBtn
{
    [self requestLogin];
}

#pragma mark -
#pragma mark ================= 网络 =================
- (void)requestGetCode
{
    [self.view endEditing:YES];

    if (self.telTextField.text.length != 11 || ![self.telTextField.text LQ_isAllNum])
    {
        [self.timeBtn stop];
        [LCProgressHUD showFailure:@"请填写正确的手机号!"];
        return;
    }

    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:self.telTextField.text forKey:@"mobile"];

    [[LQHTTPSessionManager sharedManager] LQPost:URLSTR(@"/app/sys/user/getCode") parameters:params showTips:nil success:^(id responseObject) {

        self.key = [responseObject valueForKey:@"key"];

    } successBackfailError:^(id responseObject) {

    } failure:^(NSError *error) {

    }];
}

- (void)requestLogin
{
//    [self dismissViewControllerAnimated:YES completion:nil];

    [self.view endEditing:YES];

    if (self.telTextField.text.length != 11 || ![self.telTextField.text LQ_isAllNum])
    {
        [LCProgressHUD showFailure:@"请填写正确的手机号!"];
        return;
    }

    if (![self.yanZhenMaTextField.text LQ_isAllNum] || self.yanZhenMaTextField.text.length != 6)
    {
        [LCProgressHUD showFailure:@"请填写正确的验证码!"];
        return;
    }

    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:self.telTextField.text forKey:@"mobile"];
    [params setValue:self.key forKey:@"key"];
    [params setValue:self.yanZhenMaTextField.text forKey:@"code"];

    [[LQHTTPSessionManager sharedManager] LQPost:URLSTR(@"/app/sys/user/login") parameters:params showTips:@"正在登录..." success:^(id responseObject) {

//        ModelMember *modelMember = [ModelMember sharedManager];
//        modelMember = [ModelMember mj_objectWithKeyValues:responseObject];

        [UserDefaults setValue:self.telTextField.text forKey:@"username"];
        [UserDefaults synchronize];

        ModelDeviceAndNurse *model = [ModelDeviceAndNurse sharedManager];
        model = [ModelDeviceAndNurse mj_objectWithKeyValues:responseObject];

        [self dismissViewControllerAnimated:YES completion:nil];

    } successBackfailError:^(id responseObject) {

    } failure:^(NSError *error) {

    }];
}

@end


text:
document.querySelector("body").addEventListener('click',function (event) {
	event.preventDefault();
	event.stopPropagation();
	var target = event.target;
	for (; target && target !== document; target = target.parentNode) {
		if(target.tagName=='A'){
			plus.runtime.openURL(target.getAttribute("href"));
			break;
		}
		console.log("target:"+target.tagName);
	}
},true);

redpajama_set_name: RedPajamaGithub


text:
package org.dcm4chee.web.common.login;

import java.io.IOException;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.LoginContext;

import org.apache.wicket.RequestCycle;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.security.authentication.LoginException;
import org.apache.wicket.security.hive.authentication.DefaultSubject;
import org.apache.wicket.security.hive.authentication.UsernamePasswordContext;
import org.dcm4chee.web.common.delegate.BaseCfgDelegate;
import org.dcm4chee.web.common.delegate.BaseMBeanDelegate;
import org.dcm4chee.web.common.secure.SecureSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Robert David <robert.david@agfa.com>
 * @version $Revision$ $Date$
 * @since Aug. 31, 2010
 */
public class WebLoginContext extends UsernamePasswordContext {

    protected static Logger log = LoggerFactory.getLogger(BaseMBeanDelegate.class);

    public WebLoginContext() {
    }

    public WebLoginContext(String username, String password) {
        super(username, password);
    }

    @Override
    protected org.apache.wicket.security.hive.authentication.Subject getSubject(String username, String password) throws LoginException {
        WebApplication app = (WebApplication) RequestCycle.get().getApplication();
        String webApplicationPolicy = app.getInitParameter("webApplicationPolicy");
        if (webApplicationPolicy == null) webApplicationPolicy = "dcm4chee";
        String rolesGroupName = app.getInitParameter("rolesGroupName");
        if (rolesGroupName == null) rolesGroupName = "Roles";

        LoginCallbackHandler handler = new LoginCallbackHandler(username, password);
        LoginContext context;
        SecureSession secureSession;
        try {
            secureSession = ((SecureSession) RequestCycle.get().getSession());
            secureSession.setManageUsers(BaseCfgDelegate.getInstance().getManageUsers());
            context = new LoginContext(webApplicationPolicy, handler);
            context.login();
            secureSession.setUsername(username);
        } catch (Exception e) {
            log.warn("Login failed. Reason: " + e.getMessage());
            throw new LoginException();
        }

        if (!readHiveFile())
            return null;

        DefaultSubject subject;
        try {
            subject = LoginContextSecurityHelper.mapSwarmSubject(context.getSubject(), null);
            if (!LoginContextSecurityHelper.checkLoginAllowed(subject)) {
                ((SecureSession) RequestCycle.get().getSession()).invalidate();
                log.warn("Failed to authorize subject for login, denied. See 'LoginAllowedRolename' parameter in web.xml.");
            }
            secureSession.extendedLogin(username, password, subject);
        } catch (Exception e) {
            log.error("Login failed for user "+username, e);
            ((SecureSession) RequestCycle.get().getSession()).invalidate();
            subject = new DefaultSubject();
        }
        return subject;
    }

    private boolean readHiveFile() {
        try {
            ((SecureSession) RequestCycle.get().getSession()).setAllSwarmPrincipals(LoginContextSecurityHelper.readSwarmPrincipals());
            return true;
        } catch (Exception e) {
            log.error("Exception (error processing hive file): " + e.getMessage());
            ((SecureSession) RequestCycle.get().getSession()).invalidate();
            return false ;
        }
    }

    private class LoginCallbackHandler implements CallbackHandler {

        private String user;
        private String passwd;

        public LoginCallbackHandler(String user, String passwd) {
            this.user = user;
            this.passwd = passwd;
        }

        public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
            for (Callback cb : callbacks) {
                if (cb instanceof NameCallback) {
                    ((NameCallback) cb).setName(user);
                } else if (cb instanceof PasswordCallback) {
                    ((PasswordCallback)cb).setPassword(passwd.toCharArray());
                } else {
                    throw new UnsupportedCallbackException(cb, "Callback not supported! (only Name and Password Callback are supported)");
                }
            }
        }
    }
}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PIDOOR ‹ Log In</title>
	<link rel='dns-prefetch' href='//s.w.org' />
<link rel='stylesheet' href='https://pidoor.ru/wp-admin/load-styles.php?c=1&dir=ltr&load%5B%5D=dashicons,buttons,forms,l10n,login&ver=4.6.1' type='text/css' media='all' />
<meta name='robots' content='noindex,follow' />
<link rel="icon" href="https://pidoor.ru/wp-content/uploads/2016/08/cropped-UD-logo1-32x32.jpg" sizes="32x32" />
<link rel="icon" href="https://pidoor.ru/wp-content/uploads/2016/08/cropped-UD-logo1-192x192.jpg" sizes="192x192" />
<link rel="apple-touch-icon-precomposed" href="https://pidoor.ru/wp-content/uploads/2016/08/cropped-UD-logo1-180x180.jpg" />
<meta name="msapplication-TileImage" content="https://pidoor.ru/wp-content/uploads/2016/08/cropped-UD-logo1-270x270.jpg" />

PIDOOR

<form name="loginform" id="loginform" action="https://pidoor.ru/wp-login.php" method="post">

		Username or Email

		<input type="text" name="log" id="user_login" class="input" value="" size="20" />

		Password

		<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" />

<input name="rememberme" type="checkbox" id="rememberme" value="forever"  /> Remember Me

		<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In" />
		<input type="hidden" name="redirect_to" value="https://pidoor.ru/wp-admin/" />
		<input type="hidden" name="testcookie" value="1" />

</form>

	Lost your password?

← Back to PIDOOR


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GDNativeLibrary" inherits="Resource" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
	<brief_description>
		An external library containing functions or script classes to use in Godot.
	</brief_description>
	<description>
		A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on.
	</description>
	<tutorials>
		<link>$DOCS_URL/tutorials/scripting/gdnative/gdnative_c_example.html</link>
		<link>$DOCS_URL/tutorials/scripting/gdnative/gdnative_cpp_example.html</link>
	</tutorials>
	<methods>
		<method name="get_current_dependencies" qualifiers="const">
			<return type="PoolStringArray" />
			<description>
				Returns paths to all dependency libraries for the current platform and architecture.
			</description>
		</method>
		<method name="get_current_library_path" qualifiers="const">
			<return type="String" />
			<description>
				Returns the path to the dynamic library file for the current platform and architecture.
			</description>
		</method>
	</methods>
	<members>
		<member name="config_file" type="ConfigFile" setter="set_config_file" getter="get_config_file">
			This resource in INI-style [ConfigFile] format, as in [code].gdnlib[/code] files.
		</member>
		<member name="load_once" type="bool" setter="set_load_once" getter="should_load_once" default="true">
			If [code]true[/code], Godot loads only one copy of the library and each script that references the library will share static data like static or global variables.
			If [code]false[/code], Godot loads a separate copy of the library into memory for each script that references it.
		</member>
		<member name="reloadable" type="bool" setter="set_reloadable" getter="is_reloadable" default="true">
			If [code]true[/code], the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot.
			[b]Note:[/b] If the library defines tool scripts that run inside the editor, [code]reloadable[/code] must be [code]false[/code]. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash.
		</member>
		<member name="singleton" type="bool" setter="set_singleton" getter="is_singleton" default="false">
			If [code]true[/code], Godot loads the library at startup rather than the first time a script uses the library, calling [code]{prefix}gdnative_singleton[/code] after initializing the library (where [code]{prefix}[/code] is the value of [member symbol_prefix]). The library remains loaded as long as Godot is running.
			[b]Note:[/b] A singleton library cannot be [member reloadable].
		</member>
		<member name="symbol_prefix" type="String" setter="set_symbol_prefix" getter="get_symbol_prefix" default=""godot_"">
			The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its [code]gdnative_init[/code] function as [code]godot_gdnative_init[/code] by default.
			On platforms that require statically linking libraries (currently only iOS), each library must have a different [code]symbol_prefix[/code].
		</member>
	</members>
	<constants>
	</constants>
</class>


text:
package org.kwstudios.play.ragemode.bossbar.type;

import org.bukkit.Location;
import org.kwstudios.play.ragemode.bossbar.common.Maths;

public abstract class WitherBossbar implements Bossbar {

    protected static final float MAX_HEALTH = 300;

    protected boolean spawned;
    protected Location spawnLocation;

    protected String name;
    protected float health;

    public WitherBossbar(String message, Location spawnLocation) {
        this.spawnLocation = spawnLocation;
        this.name = message;
        this.health = MAX_HEALTH;
    }

    @Override
    public String getMessage() {
        return name;
    }

    @Override
    public WitherBossbar setMessage(String message) {
        this.name = message;
        return this;
    }

    @Override
    public float getPercentage() {
        return health / MAX_HEALTH;
    }

    @Override
    public WitherBossbar setPercentage(float percentage) {
        percentage = Maths.clamp(percentage, 0f, 1f);
        health = percentage * MAX_HEALTH;
        return this;
    }

    public boolean isSpawned() {
        return spawned;
    }

    public void setSpawned(boolean spawned) {
        this.spawned = spawned;
    }

    public Location getSpawnLocation() {
        return spawnLocation;
    }

    public void setSpawnLocation(Location spawnLocation) {
        this.spawnLocation = spawnLocation;
    }

}


text:
cask "permute" do
  version "3.6.3,2417"
  sha256 "614753e3a80535c8b64f04460dc051abc311ac3651c80028540509281afff852"

  url "https://trial.charliemonroe.net/permute/v#{version.major}/Permute_#{version.major}_#{version.after_comma}.dmg"
  name "Permute"
  desc "Converts and edits video, audio or image files"
  homepage "https://software.charliemonroe.net/permute.php"

  livecheck do
    url "https://trial.charliemonroe.net/permute/updates_#{version.major}.xml"
    strategy :sparkle
  end

  auto_updates true
  depends_on macos: ">= :el_capitan"

  app "Permute #{version.major}.app"

  zap trash: [
    "~/Library/Containers/com.charliemonroe.Permute-#{version.major}",
    "~/Library/Preferences/com.charliemonroe.Permute-#{version.major}.plist",
  ]
end


text:
from optparse import OptionParser
import os

import numpy as np
import pysam
import pyBigWig
import tensorflow as tf

from basenji.dna_io import hot1_dna
from basenji.tfrecord_batcher import order_tfrecords

'''
tfr_bw.py

Generate BigWig tracks from TFRecords.
Experimental!
'''

################################################################################
# main
################################################################################
def main():
    usage = 'usage: %prog [options] <tfr_dir> <out_bw>'
    parser = OptionParser(usage)
    parser.add_option('-f', dest='fasta_file',
            default='%s/assembly/ucsc/hg38.fa' % os.environ['HG38'])
    parser.add_option('-g', dest='genome_file',
            default='%s/assembly/ucsc/hg38.human.genome' % os.environ['HG38'])
    parser.add_option('-l', dest='target_length',
            default=1024, type='int',
            help='TFRecord target length [Default: %default]')
    parser.add_option('-s', dest='data_split', default='train')
    parser.add_option('-t', dest='target_i',
            default=0, type='int', help='Target index [Default: %default]')
    (options,args) = parser.parse_args()

    if len(args) != 2:
        parser.error('Must provide TF Records directory and output BigWig')
    else:
        tfr_dir = args[0]
        out_bw_file = args[1]

    # initialize output BigWig
    out_bw_open = pyBigWig.open(out_bw_file, 'w')

    # construct header
    header = []
    for line in open(options.genome_file):
        a = line.split()
        header.append((a[0], int(a[1])))

    # write header
    out_bw_open.addHeader(header)

    # initialize chr dictionary
    chr_values = {}
    for chrm, clen in header:
        chr_values[chrm] = np.zeros(clen, dtype='float16')

    # open sequences BED
    seq_bed_open = open('%s/../sequences0.bed' % tfr_dir)

    # open FASTA
    fasta_open = pysam.Fastafile(options.fasta_file)

    # initialize one shot iterator
    # next_op = make_next_op('%s/%s-0-0.tfr' % (tfr_dir, options.data_split))
    next_op = make_next_op('%s/%s-0-*.tfr' % (tfr_dir, options.data_split))

    # read sequence values
    with tf.Session() as sess:
      next_datum = sess.run(next_op)
      while next_datum:
        # read sequence
        seq_bed_line = seq_bed_open.readline()
        a = seq_bed_line.rstrip().split('\t')
        while a[-1] != options.data_split:
            seq_bed_line = seq_bed_open.readline()
            a = seq_bed_line.rstrip().split('\t')
        chrm = a[0]
        start = int(a[1])
        end = int(a[2])
        target_pool = (end - start) // options.target_length

        # check sequence
        seq_1hot = next_datum['sequence'].reshape((-1,4))
        seq_1hot_dna = hot1_dna(seq_1hot)
        seq_fasta = fasta_open.fetch(chrm, start, end).upper()
        if seq_1hot_dna != seq_fasta:
            seq_diff = [seq_1hot_dna[i] != seq_fasta[i] for i in range(len(seq_fasta))]
            seq_diff = np.array(seq_match, dtype='bool')
            print('WARNING: %s:%d-%d differs by %d nts (%.4f)' % \
                    (chrm, start, end, seq_match.sum(), seq_match.mean()))

        # read targets
        targets = next_datum['target'].reshape(options.target_length, -1)
        targets_ti = targets[:,options.target_i]

        # set values
        chr_values[chrm][start:end] = np.repeat(targets_ti, target_pool)

        try:
          next_datum = sess.run(next_op)
        except tf.errors.OutOfRangeError:
          next_datum = False

    fasta_open.close()

    # write chr values
    for chrm, _ in header:
        print(chrm)
        out_bw_open.addEntries(chrm, 0, values=chr_values[chrm], span=1, step=1)

    # close files
    out_bw_open.close()

def make_next_op(tfr_pattern):
    # read TF Records
    # dataset = tf.data.Dataset.list_files(tfr_pattern)
    tfr_files = order_tfrecords(tfr_pattern)
    if tfr_files:
        dataset = tf.data.Dataset.list_files(tf.constant(tfr_files), shuffle=False)
    else:
        print('Cannot order TFRecords %s' % tfr_pattern, file=sys.stderr)
        dataset = tf.data.Dataset.list_files(tfr_pattern)

    def file_to_records(filename):
        return tf.data.TFRecordDataset(filename, compression_type='ZLIB')
    dataset = dataset.flat_map(file_to_records)

    dataset = dataset.batch(1)
    dataset = dataset.map(parse_proto)

    iterator = dataset.make_one_shot_iterator()
    try:
        next_op = iterator.get_next()
    except tf.errors.OutOfRangeError:
        print('TFRecord pattern %s is empty' % self.tfr_pattern, file=sys.stderr)
        exit(1)

    return next_op

def parse_proto(example_protos):
    features = {
        'genome': tf.FixedLenFeature([1], tf.int64),
        'sequence': tf.FixedLenFeature([], tf.string),
        'target': tf.FixedLenFeature([], tf.string)
    }
    parsed_features = tf.parse_example(example_protos, features=features)
    genome = parsed_features['genome']
    seq = tf.decode_raw(parsed_features['sequence'], tf.uint8)
    targets = tf.decode_raw(parsed_features['target'], tf.float16)
    return {'genome': genome, 'sequence': seq, 'target': targets}

################################################################################
# __main__
################################################################################
if __name__ == '__main__':
    main()


text:
namespace Alachisoft.NCache.Common.Protobuf
{
    [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"LockVerifyCommand")]
    public partial class LockVerifyCommand : global::ProtoBuf.IExtensible
    {
      public LockVerifyCommand() {}

    private string _key = "";
    [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)][global::System.ComponentModel.DefaultValue("")]
    public string key
    {
      get { return _key; }
      set { _key = value; }
    }

    private long _requestId = default(long);
    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"requestId", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)][global::System.ComponentModel.DefaultValue(default(long))]
    public long requestId
    {
      get { return _requestId; }
      set { _requestId = value; }
    }
      private global::ProtoBuf.IExtension extensionObject;
      global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
        { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
    }

}


text:
package ru.szhernovoy.simplenumber;

import org.junit.Assert;
import org.junit.Test;

import static org.hamcrest.core.Is.is;

/**
 * Created by admin on 26.08.2016.
 */
public class IteratorSimpleNumberTest {
    @Test
    public void hasNext() throws Exception {

        IteratorSimpleNumber it = new IteratorSimpleNumber(new int[]{1,2,3,4,5,11,67});

        it.next();
        it.next();

        boolean result = it.hasNext();

        Assert.assertThat(result,is(true));

    }

    @Test
    public void next() throws Exception {

        IteratorSimpleNumber it = new IteratorSimpleNumber(new int[]{1,2,3,4,5,11,67});

        it.next();
        int result = (Integer) it.next();

        Assert.assertThat(result,is(2));

    }

}


text:
published: true
title: PDF cheat sheet combined
layout: post
---
| Join | `pdftk A=one.pdf B=two.pdf cat A1-5 A5 B6-20odd output out.pdf` |
| Rotate | `pdftk  A=one.pdf B=two.pdf cat A1-5east B5-endsouth output out.pdf` |
| Reverse | `pdftk A=one.pdf cat Aend-5 output out.pdf` |
| Extract images | `pdfimages -f 10 -l 18 -j one.pdf ../images` |
| Image convert | `convert -density 300 -resize 200% one.pdf[2-3] -quality 80 out.jpg` |
| Convert pdf to png image | `pdftopng -f 10 -l 18 -r 300 -gray one.pdf ../images` |
| Convert pdf to text | `pdftotext -f 10 -l 18 one.pdf` |
| Encrypt | `pdftk one.pdf output output.pdf owner_pw ownpass` |
| Special Encrypt | `pdftk one.pdf output out.pdf owner_pw foo user_pw baz allow printing` |
| Add stamp or watermark | `pdftk one.pdf background back.pdf output out.pdf` |
| Extract metadata to text file | `exiftool -a -g one.pdf > meta.txt` |
| Delete metadata of files | `exiftool -all= one.pdf` |
| Deleting XMP data | `BeCyPDFMetaEdit one.pdf -X 1` |
| [crop](http://stackoverflow.com/questions/6183479/cropping-a-pdf-using-ghostscript-9-01,) or [pdfill](http://www.pdfill.com/pdf_tools_free.html)| `gswin32c.exe   -o cropped.pdf  -sDEVICE=pdfwrite -c ^` <br />`[/CropBox [24 72 559 794]" -c " /PAGES pdfmark"  -f uncropped-input.pdf` |

[ghostscript](http://www.peteryu.ca/tutorials/publishing/pdf_manipulation_tips)


text:
'use strict';

var format = require('util').format;

module.exports = function(grunt) {

  grunt.registerMultiTask('google_appengine', 'Add tasks to Google App Engine.', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
      path: '.',
      args: {},
      email: null,
      password: null
    });
    var done = this.async();

    // Check if action was specified.
    if (!this.data.action) {
      return grunt.log.error('No action specified.');
    }

    // Launch local development server
    if (this.data.action === 'run') {
      // Add command line arguments
      var args = [];
      for (var field in options.args) {
        args.push(format('--%s=%s', field, options.args[field]));
      }
      // Add path component
      args.push(options.path);

      // Spawn server async
      var child = grunt.util.spawn({
        cmd: 'dev_appserver.py',
        args: args
      });

      // Route messages to grunt terminal
      child.stdout.on('data', function(data) {
        grunt.log.writeln(data);
      });

      child.stderr.on('data', function(data) {
        grunt.log.error(data);
      });

      child.on('error', function(error) {
        grunt.log.error(error);
      });

      // Artifical delay to let app engine messages appear before moving to next task
      setTimeout(function() {
        done();
      }, 2000);
    }
    // Other commands run synchronously
    else {
      // Check for credentials
      if (options.email.indexOf('@') === -1) {
        return grunt.log.error('Invalid email.');
      }
      if (!options.password) {
        return grunt.log.error('Invalid password.');
      }

      // Add email and no cookies flag (so credentials are not saved)
      var args = [];
      args.push('--no_cookies');
      args.push(format('--email=%s', options.email));
      args.push('--passin');

      // Add command line arguments
      for (var field in options.args) {
        args.push(format('--%s=%s', field, options.args[field]));
      }
      // Add command action component
      args.push(this.data.action);
      // Add path component
      args.push(options.path);

      // Run server and wait till done
      var child = grunt.util.spawn({
        cmd: 'appcfg.py',
        args: args
      }, function(error, result, code) {
        if (code === 0) {
          grunt.log.ok('Action executed successfully.');
        } else {
          grunt.log.error('Error executing the action.');
        }
        done();
      });

      // Pass in the password for the above email
      child.stdin.write(options.password);
      child.stdin.end();

      // Route messages to grunt terminal
      child.stdout.on('data', function(data) {
        grunt.log.writeln(data);
      });

      child.stderr.on('data', function(data) {
        grunt.log.error(data);
      });

      child.on('error', function(error) {
        grunt.log.error(error);
      });
    }
  });
};


text:
package ru.google.test;

import org.testng.annotations.Test;
import ru.google.appmanager.HomePage;
import ru.google.appmanager.LoginPage;

import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Condition.visible;

public class Login extends TestBase {
  @Test
  public void successfulLogin() {
    HomePage home = new HomePage();
    LoginPage loginPage = home.clickButtonLogin();
    loginPage.inputEmail("TestSelenideNoName@gmail.com");
    loginPage.buttonNextLogin().click();
    loginPage.inputPass("123581321");
    loginPage.clickButtonNextPass();
    home.accountLogo().shouldBe(visible);

  }
}


text:
using UnityEngine;

public class WaitingZone : WunderZone {

    public override void createObject() {
        this.createSurfaceObject(new Color(0.39f, 0.24f, 0, .3f));
    }

}


text:
struct hostent *dns_fake(uint32_t ip, const char *host);

#endif


text:
int ungetc(int c, FILE *stream)
{
#if 0 // Issue #76
  if (c == EOF)
    return c;                   // Fail without changing the FILE object
#endif
  *(--stream->_ptr) = c;        // XXX We don't really know if there's space
  stream->_n++;
  stream->_flags &= ~_ioeof;
  return c;
}


text:
/**
 * @file regularized_svd_test.cpp
 * @author Siddharth Agrawal
 *
 * Test the RegularizedSVDFunction class.
 */
#include <mlpack/core.hpp>
#include <mlpack/methods/regularized_svd/regularized_svd.hpp>

#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"

using namespace mlpack;
using namespace mlpack::svd;

BOOST_AUTO_TEST_SUITE(RegularizedSVDTest);

BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionRandomEvaluate)
{
  // Define useful constants.
  const size_t numUsers = 100;
  const size_t numItems = 100;
  const size_t numRatings = 1000;
  const size_t maxRating = 5;
  const size_t rank = 10;
  const size_t numTrials = 50;

  // Make a random rating dataset.
  arma::mat data = arma::randu(3, numRatings);
  data.row(0) = floor(data.row(0) * numUsers);
  data.row(1) = floor(data.row(1) * numItems);
  data.row(2) = floor(data.row(2) * maxRating + 0.5);

  // Manually set last row to maximum user and maximum item.
  data(0, numRatings - 1) = numUsers - 1;
  data(1, numRatings - 1) = numItems - 1;

  // Make a RegularizedSVDFunction with zero regularization.
  RegularizedSVDFunction rSVDFunc(data, rank, 0);

  for (size_t i = 0; i < numTrials; i++)
  {
    arma::mat parameters = arma::randu(rank, numUsers + numItems);

    // Calculate cost by summing up cost of each example.
    double cost = 0;
    for (size_t j = 0; j < numRatings; j++)
    {
      const size_t user = data(0, j);
      const size_t item = data(1, j) + numUsers;

      const double rating = data(2, j);
      const double ratingError = rating - arma::dot(parameters.col(user),
                                                    parameters.col(item));
      const double ratingErrorSquared = ratingError * ratingError;

      cost += ratingErrorSquared;
    }

    // Compare calculated cost and value obtained using Evaluate().
    BOOST_REQUIRE_CLOSE(cost, rSVDFunc.Evaluate(parameters), 1e-5);
  }
}

BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionRegularizationEvaluate)
{
  // Define useful constants.
  const size_t numUsers = 100;
  const size_t numItems = 100;
  const size_t numRatings = 1000;
  const size_t maxRating = 5;
  const size_t rank = 10;
  const size_t numTrials = 50;

  // Make a random rating dataset.
  arma::mat data = arma::randu(3, numRatings);
  data.row(0) = floor(data.row(0) * numUsers);
  data.row(1) = floor(data.row(1) * numItems);
  data.row(2) = floor(data.row(2) * maxRating + 0.5);

  // Manually set last row to maximum user and maximum item.
  data(0, numRatings - 1) = numUsers - 1;
  data(1, numRatings - 1) = numItems - 1;

  // Make three RegularizedSVDFunction objects with different amounts of
  // regularization.
  RegularizedSVDFunction rSVDFuncNoReg(data, rank, 0);
  RegularizedSVDFunction rSVDFuncSmallReg(data, rank, 0.5);
  RegularizedSVDFunction rSVDFuncBigReg(data, rank, 20);

  for (size_t i = 0; i < numTrials; i++)
  {
    arma::mat parameters = arma::randu(rank, numUsers + numItems);

    // Calculate the regularization contributions of parameters corresponding to
    // each rating and sum them up.
    double smallRegTerm = 0;
    double bigRegTerm = 0;
    for (size_t j = 0; j < numRatings; j++)
    {
      const size_t user = data(0, j);
      const size_t item = data(1, j) + numUsers;

      const double userVecNorm = arma::norm(parameters.col(user), 2);
      const double itemVecNorm = arma::norm(parameters.col(item), 2);
      smallRegTerm += 0.5 * (userVecNorm * userVecNorm +
                             itemVecNorm * itemVecNorm);
      bigRegTerm += 20 * (userVecNorm * userVecNorm +
                          itemVecNorm * itemVecNorm);
    }

    // Cost with regularization should be close to the sum of cost without
    // regularization and the regularization terms.
    BOOST_REQUIRE_CLOSE(rSVDFuncNoReg.Evaluate(parameters) + smallRegTerm,
        rSVDFuncSmallReg.Evaluate(parameters), 1e-5);
    BOOST_REQUIRE_CLOSE(rSVDFuncNoReg.Evaluate(parameters) + bigRegTerm,
        rSVDFuncBigReg.Evaluate(parameters), 1e-5);
  }
}

BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionGradient)
{
  // Define useful constants.
  const size_t numUsers = 50;
  const size_t numItems = 50;
  const size_t numRatings = 100;
  const size_t maxRating = 5;
  const size_t rank = 10;

  // Make a random rating dataset.
  arma::mat data = arma::randu(3, numRatings);
  data.row(0) = floor(data.row(0) * numUsers);
  data.row(1) = floor(data.row(1) * numItems);
  data.row(2) = floor(data.row(2) * maxRating + 0.5);

  // Manually set last row to maximum user and maximum item.
  data(0, numRatings - 1) = numUsers - 1;
  data(1, numRatings - 1) = numItems - 1;

  arma::mat parameters = arma::randu(rank, numUsers + numItems);

  // Make two RegularizedSVDFunction objects, one with regularization and one
  // without.
  RegularizedSVDFunction rSVDFunc1(data, rank, 0);
  RegularizedSVDFunction rSVDFunc2(data, rank, 0.5);

  // Calculate gradients for both the objects.
  arma::mat gradient1, gradient2;
  rSVDFunc1.Gradient(parameters, gradient1);
  rSVDFunc2.Gradient(parameters, gradient2);

  // Perturbation constant.
  const double epsilon = 0.0001;
  double costPlus1, costMinus1, numGradient1;
  double costPlus2, costMinus2, numGradient2;

  for (size_t i = 0; i < rank; i++)
  {
    for (size_t j = 0; j < numUsers + numItems; j++)
    {
      // Perturb parameter with a positive constant and get costs.
      parameters(i, j) += epsilon;
      costPlus1 = rSVDFunc1.Evaluate(parameters);
      costPlus2 = rSVDFunc2.Evaluate(parameters);

      // Perturb parameter with a negative constant and get costs.
      parameters(i, j) -= 2 * epsilon;
      costMinus1 = rSVDFunc1.Evaluate(parameters);
      costMinus2 = rSVDFunc2.Evaluate(parameters);

      // Compute numerical gradients using the costs calculated above.
      numGradient1 = (costPlus1 - costMinus1) / (2 * epsilon);
      numGradient2 = (costPlus2 - costMinus2) / (2 * epsilon);

      // Restore the parameter value.
      parameters(i, j) += epsilon;

      // Compare numerical and backpropagation gradient values.
      if (std::abs(gradient1(i, j)) <= 1e-6)
        BOOST_REQUIRE_SMALL(numGradient1, 1e-5);
      else
        BOOST_REQUIRE_CLOSE(numGradient1, gradient1(i, j), 1e-2);

      if (std::abs(gradient2(i, j)) <= 1e-6)
        BOOST_REQUIRE_SMALL(numGradient2, 1e-5);
      else
        BOOST_REQUIRE_CLOSE(numGradient2, gradient2(i, j), 1e-2);
    }
  }
}

BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionOptimize)
{
  // Define useful constants.
  const size_t numUsers = 50;
  const size_t numItems = 50;
  const size_t numRatings = 100;
  const size_t iterations = 30;
  const size_t rank = 10;
  const double alpha = 0.01;
  const double lambda = 0.01;

  // Initiate random parameters.
  arma::mat parameters = arma::randu(rank, numUsers + numItems);

  // Make a random rating dataset.
  arma::mat data = arma::randu(3, numRatings);
  data.row(0) = floor(data.row(0) * numUsers);
  data.row(1) = floor(data.row(1) * numItems);

  // Manually set last row to maximum user and maximum item.
  data(0, numRatings - 1) = numUsers - 1;
  data(1, numRatings - 1) = numItems - 1;

  // Make rating entries based on the parameters.
  for (size_t i = 0; i < numRatings; i++)
  {
    data(2, i) = arma::dot(parameters.col(data(0, i)),
                           parameters.col(numUsers + data(1, i)));
  }

  // Make the Reg SVD function and the optimizer.
  RegularizedSVDFunction rSVDFunc(data, rank, lambda);
  mlpack::optimization::SGD<RegularizedSVDFunction> optimizer(rSVDFunc,
      alpha, iterations * numRatings);

  // Obtain optimized parameters after training.
  arma::mat optParameters = arma::randu(rank, numUsers + numItems);
  optimizer.Optimize(optParameters);

  // Get predicted ratings from optimized parameters.
  arma::mat predictedData(1, numRatings);
  for (size_t i = 0; i < numRatings; i++)
  {
    predictedData(0, i) = arma::dot(optParameters.col(data(0, i)),
                                    optParameters.col(numUsers + data(1, i)));
  }

  // Calculate relative error.
  const double relativeError = arma::norm(data.row(2) - predictedData, "frob") /
                               arma::norm(data, "frob");

  // Relative error should be small.
  BOOST_REQUIRE_SMALL(relativeError, 1e-2);
}

BOOST_AUTO_TEST_SUITE_END();


text:
package io.ibntab.netrift.core

import io.netty.buffer.ByteBuf

/**
  * Created by ke.meng on 2016/4/29.
  *
  */
case class ThriftMessage(byteBuf: ByteBuf, transportType: ThriftTransportType) {

  var processStartTimeMillis: Long = 0l

  def getMessageFactory =
    new Factory {
      override def apply(messageBuffer: ByteBuf): ThriftMessage = ThriftMessage(messageBuffer, transportType)
    }
}

private[core] trait Factory {
  def apply(messageBuffer: ByteBuf): ThriftMessage
}

sealed abstract class ThriftTransportType(val name: String, val value: Int) {
  // for java compat
  def get(): ThriftTransportType = this
}

object ThriftTransportType {
  case object UNFRAMED extends ThriftTransportType("UNFRAMED", 0)
  case object FRAMED extends ThriftTransportType("FRAMED", 1)
  case object HTTP extends ThriftTransportType("HTTP", 2)
  case object HEADER extends ThriftTransportType("HEADER", 3)
}


text:
<!DOCTYPE html>

Click on the button to copy the text from the text field. Try to paste the text (e.g. ctrl+v) afterwards in a different window, to see the effect.

<input type="text" value="Hello World" id="myInput">
<button onclick="myFunction()">Copy text</button>

The document.execCommand() method is not supported in IE9 and earlier.


text:
package com.yodiwo.androidagent.plegma;

/**
 * Created by ApiGenerator Tool (Java) on 28/08/2015 18:34:40.
 */

/**
 * Globally unique identifier of a Yodiwo.API.Plegma.Thing's Yodiwo.API.Plegma.Port
 */
public class PortKey {

    public com.yodiwo.androidagent.plegma.ThingKey ThingKey;

    public String PortUID;

    public PortKey() {
    }

    public PortKey(com.yodiwo.androidagent.plegma.ThingKey ThingKey, String PortUID) {
        this.ThingKey = ThingKey;
        this.PortUID = PortUID;

    }

    @Override
    public String toString() {
        return ThingKey.toString() + "-" + PortUID;
    }

    public static String CreateKey(String ThingKey, String PortUID) {
        return ThingKey + "-" + PortUID;
    }
}


text:
import os
import collections
import ctypes
import ctypes.util
import select
import struct
import signal
import platform
import subprocess

import mayhem.datatypes.elf
import mayhem.proc
import mayhem.utilities

elf = mayhem.datatypes.elf
libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
ptrace = libc.ptrace
ptrace.argtypes = [ctypes.c_uint, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p]
ptrace.restype = ctypes.c_long

CONSTANTS = {
	'PROT_NONE': 0x00,
	'PROT_READ': 0x01,
	'PROT_WRITE': 0x02,
	'PROT_EXEC': 0x04,
	'PROT_SEM': 0x08,

	'MAP_SHARED': 0x01,
	'MAP_PRIVATE': 0x02,
	'MAP_FIXED': 0x10,
	'MAP_ANONYMOUS': 0x20,

	'RTLD_LOCAL': 0x00,
	'RTLD_LAZY': 0x01,
	'RTLD_NOW': 0x02,
	'RTLD_DEEPBIND': 0x0008,
	'RTLD_GLOBAL': 0x0100,
}

PTRACE_TRACEME = 0
PTRACE_PEEKTEXT = 1
PTRACE_PEEKDATA = 2
PTRACE_PEEKUSR = 3
PTRACE_POKETEXT = 4
PTRACE_POKEDATA = 5
PTRACE_POKEUSR = 6
PTRACE_CONT = 7
PTRACE_KILL = 8
PTRACE_SINGLESTEP = 9
PTRACE_GETREGS = 12
PTRACE_SETREGS = 13
PTRACE_ATTACH = 16
PTRACE_DETACH = 17
PTRACE_SYSCALL = 24

class LinuxMemoryRegion(mayhem.proc.MemoryRegion):
	"""Describe a memory region on Linux."""
	def __init__(self, addr_low, addr_high, perms, pathname=None):
		self.pathname = pathname
		"""The file which mapped the region, if known."""
		super(LinuxMemoryRegion, self).__init__(addr_low, addr_high, perms)

	def __repr__(self):
		if self.pathname:
			return "{0:08x}-{1:08x} {2} {3}".format(self.addr_low, self.addr_high, self.perms, self.pathname)
		else:
			return "{0:08x}-{1:08x} {2}".format(self.addr_low, self.addr_high, self.perms)

class LinuxProcessError(mayhem.proc.ProcessError):
	def __init__(self, *args, **kwargs):
		self.errno = kwargs.pop('errno', None)
		"""The libc error number at the time the exception was raised."""
		super(LinuxProcessError, self).__init__(*args, **kwargs)

def get_errno():
	"""
	Get the value of the error from the last function call.

	:return: The error number from libc.
	:rtype: int
	"""
	get_errno_loc = libc.__errno_location
	get_errno_loc.restype = ctypes.POINTER(ctypes.c_int)
	return get_errno_loc()[0]

def parse_proc_maps(pid):
	"""
	Parse the memory maps file for *pid* into a dictionary of
	:py:class:`.LinuxMemoryRegion` objects with keys of their starting
	address.

	:param int pid: The pid to parse the maps file from /proc for.
	:return: The parsed memory regions for *pid*.
	:rtype: dict
	"""
	_maps = collections.deque()
	maps_h = open('/proc/' + str(pid) + '/maps', 'r')
	for memory_region in maps_h:
		memory_region = memory_region[:-1]
		pathname = None
		if memory_region.find('/') != -1:
			pathname = memory_region[memory_region.find('/'):]
		memory_region = memory_region.split()
		addr_low, _, addr_high = memory_region[0].partition('-')
		addr_low = int(addr_low, 16)
		addr_high = int(addr_high, 16)
		perms = memory_region[1]
		if pathname is None and len(memory_region) == 6:
			pathname = memory_region[5]
		_maps.append(LinuxMemoryRegion(addr_low, addr_high, perms, pathname))
	return collections.OrderedDict((mr.addr_low, mr) for mr in sorted(_maps, key=lambda mr: mr.addr_low))

def architecture_is_supported(arch):
	return mayhem.utilities.architecture_is_32bit(arch) or mayhem.utilities.architecture_is_64bit(arch)

def flags(flags):
	supported_operators = ['|', '+', '-', '^']
	if isinstance(flags, int):
		return flags
	if flags[0] == '(' and flags[-1] == ')':
		flags = flags[1:-1]
	for sop in supported_operators:
		flags = flags.replace(sop, ' ' + sop + ' ')
	flags
	flags = flags.split()
	parsed_flags = 0
	last_operator = None
	for part in flags:
		if part in CONSTANTS:
			part = CONSTANTS[part]
		elif part in supported_operators:
			last_operator = part
			continue
		else:
			if part.isdigit():
				part = int(part)
			elif part.startswith('0x'):
				part = int(part[2:], 16)
			else:
				raise ValueError('unknown token: ' + part)
		if last_operator is None:
			parsed_flags = part
		else:
			parsed_flags = eval(str(parsed_flags) + last_operator + str(part))
	return parsed_flags

class LinuxProcess(mayhem.proc.ProcessBase):
	"""This class represents a process in a POSIX Linux environment."""
	def __init__(self, pid=None, exe=None):
		if platform.system() != 'Linux':
			raise RuntimeError('incompatible platform')
		# Ensure that we are running in a version of python that matches the native architecture of the system.
		if platform.architecture()[0] == '32bit':
			if not mayhem.utilities.architecture_is_32bit(platform.machine()):
				raise LinuxProcessError('Running a 32-bit version of Python on a non x86 system is not supported')
		elif platform.architecture()[0] == '64bit':
			if not mayhem.utilities.architecture_is_64bit(platform.machine()):
				raise LinuxProcessError('Running a 64-bit version of Python on a non x86-64 system is not supported')
		else:
			raise LinuxProcessError('Could not determine the Python version')
		self._proc_h = None
		signal.signal(signal.SIGCHLD, self._signal_sigchld)
		if exe:
			self._proc_h = subprocess.Popen([exe], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
			pid = self._proc_h.pid
		if pid == -1:
			pid = os.fork()
			if pid == 0:
				select.select([], [], [], None)
			select.select([], [], [], 0.50)
		self.handle = pid
		self.pid = pid
		self.exe_file = os.readlink('/proc/' + str(self.pid) + '/exe')
		ei_ident = open(self.exe_file, 'rb').read(elf.constants.EI_NIDENT)
		if ei_ident[elf.constants.EI_CLASS] == elf.constants.ELFCLASS32:
			self.__arch__ = 'x86'
		elif ei_ident[elf.constants.EI_CLASS] == elf.constants.ELFCLASS64:
			if mayhem.utilities.architecture_is_32bit(platform.machine()):
				raise LinuxProcessError('Controlling a 64-bit process from a 32-bit process is not supported')
			self.__arch__ = 'x86_64'
		else:
			raise LinuxProcessError('Unsupported EI_CLASS ' + str(ei_ident[elf.constants.EI_CLASS]))
		if self._ptrace(PTRACE_ATTACH) != 0:
			Exception('could not open PID')
		os.waitpid(pid, 0)
		self._installed_hooks = []

	def _signal_sigchld(self, signum, frame):
		os.waitpid(self.pid, os.WNOHANG)

	@property
	def maps(self):
		return parse_proc_maps(self.pid)

	def get_proc_attribute(self, attribute):
		requested_attribute = attribute
		if attribute.startswith('&'):
			attribute = attribute[1:] + '_addr'
		if attribute.startswith('elf_'):
			if mayhem.utilities.architecture_is_32bit(self.__arch__):
				attribute = 'elf32_' + attribute[4:]
			elif mayhem.utilities.architecture_is_64bit(self.__arch__):
				attribute = 'elf64_' + attribute[4:]
		if hasattr(self, '_get_attr_' + attribute):
			return getattr(self, '_get_attr_' + attribute)()
		elif not attribute.endswith('_addr') and attribute.startswith('elf32_'):
			if hasattr(self, '_get_attr_' + attribute + '_addr'):
				address = getattr(self, '_get_attr_' + attribute + '_addr')()
				attribute = 'Elf32_' + attribute[6:].title()
				if hasattr(elf, attribute):
					return self._read_structure_from_memory(address, getattr(elf, attribute))
		elif not attribute.endswith('_addr') and attribute.startswith('elf64_'):
			if hasattr(self, '_get_attr_' + attribute + '_addr'):
				address = getattr(self, '_get_attr_' + attribute + '_addr')()
				attribute = 'Elf64_' + attribute[6:].title()
				if hasattr(elf, attribute):
					return self._read_structure_from_memory(address, getattr(elf, attribute))
		raise mayhem.proc.ProcessError('Unknown Attribute: ' + requested_attribute)

	def _get_attr_elf32_ehdr_addr(self):
		for mem_region in self.maps.values():
			if mem_region.pathname != self.exe_file:
				continue
			if self.read_memory(mem_region.addr_low, 4) == b'\x7fELF':
				return mem_region.addr_low
		raise LinuxProcessError('could not locate ehdr')

	def _get_attr_elf32_phdr_addr(self):
		ehdr = self.get_proc_attribute('elf32_ehdr')
		return self.get_proc_attribute('elf32_ehdr_addr') + ehdr.e_phoff

	def _get_attr_elf32_shdr(self):
		ehdr = self.get_proc_attribute('elf32_ehdr')
		with open('/proc/' + str(self.pid) + '/exe', 'rb') as handle:
			handle.seek(ehdr.e_shoff, os.SEEK_SET)
			data = handle.read(ehdr.e_shnum * ehdr.e_shentsize)
		_shdr = (elf.Elf32_Shdr * ehdr.e_shnum)
		shdr = _shdr()
		ctypes.memmove(ctypes.byref(shdr), data, len(data))
		return shdr

	def _get_attr_elf32_dyn_addr(self):
		phdr_addr = self.get_proc_attribute('elf32_phdr_addr')
		phdr = self._read_structure_from_memory(phdr_addr, elf.Elf32_Phdr)
		idx = 0
		while phdr.p_type != elf.constants.PT_DYNAMIC:
			idx += 1
			next_phdr_addr = phdr_addr + (ctypes.sizeof(elf.Elf32_Phdr) * idx)
			phdr = self._read_structure_from_memory(next_phdr_addr, elf.Elf32_Phdr)
		return phdr.p_vaddr

	def _get_attr_elf64_ehdr_addr(self):
		for mem_region in self.maps.values():
			if mem_region.pathname != self.exe_file:
				continue
			if self.read_memory(mem_region.addr_low, 4) == b'\x7fELF':
				return mem_region.addr_low
		raise LinuxProcessError('could not locate ehdr')

	def _get_attr_elf64_phdr_addr(self):
		ehdr = self.get_proc_attribute('elf64_ehdr')
		return self.get_proc_attribute('elf64_ehdr_addr') + ehdr.e_phoff

	def _get_attr_elf64_shdr(self):
		ehdr = self.get_proc_attribute('elf64_ehdr')
		with open('/proc/' + str(self.pid) + '/exe', 'rb') as handle:
			handle.seek(ehdr.e_shoff, os.SEEK_SET)
			data = handle.read(ehdr.e_shnum * ehdr.e_shentsize)
		_shdr = (elf.Elf64_Shdr * ehdr.e_shnum)
		shdr = _shdr()
		ctypes.memmove(ctypes.byref(shdr), data, len(data))
		return shdr

	def _get_attr_elf64_dyn_addr(self):
		phdr_addr = self.get_proc_attribute('elf64_phdr_addr')
		phdr = self._read_structure_from_memory(phdr_addr, elf.Elf64_Phdr)
		idx = 0
		while phdr.p_type != elf.constants.PT_DYNAMIC:
			idx += 1
			next_phdr_addr = phdr_addr + (ctypes.sizeof(elf.Elf64_Phdr) * idx)
			phdr = self._read_structure_from_memory(next_phdr_addr, elf.Elf64_Phdr)
		return phdr.p_vaddr

	def _get_attr_got_addr(self):
		if mayhem.utilities.architecture_is_32bit(self.__arch__):
			dyn_struct = elf.Elf32_Dyn
		elif mayhem.utilities.architecture_is_64bit(self.__arch__):
			dyn_struct = elf.Elf64_Dyn
		else:
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))
		dyn_addr = self.get_proc_attribute('elf_dyn_addr')
		dyn = self._read_structure_from_memory(dyn_addr, dyn_struct)
		idx = 0
		while dyn.d_tag != elf.constants.DT_PLTGOT:
			idx += 1
			next_dyn_addr = dyn_addr + (ctypes.sizeof(dyn_struct) * idx)
			dyn = self._read_structure_from_memory(next_dyn_addr, dyn_struct)
		return dyn.d_un.d_ptr

	def _get_attr_link_map_addr(self):
		got_addr = self.get_proc_attribute('got_addr')
		if mayhem.utilities.architecture_is_32bit(self.__arch__):
			return struct.unpack('II', self.read_memory(got_addr, 8))[1]
		elif mayhem.utilities.architecture_is_64bit(self.__arch__):
			return struct.unpack('QQ', self.read_memory(got_addr, 16))[1]
		else:
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))

	def _get_function_address(self, mod_name, func_name):
		if mayhem.utilities.architecture_is_32bit(self.__arch__):
			ehdr_struct = elf.Elf32_Ehdr
			shdr_struct = elf.Elf32_Shdr
			sym_struct = elf.Elf32_Sym
		elif mayhem.utilities.architecture_is_64bit(self.__arch__):
			ehdr_struct = elf.Elf64_Ehdr
			shdr_struct = elf.Elf64_Shdr
			sym_struct = elf.Elf64_Sym
		else:
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))

		func_name = func_name.encode('utf-8') + b'\x00'
		if os.path.isabs(mod_name):
			exe_maps = tuple(mr for mr in self.maps.values() if mr.pathname == mod_name)
			filename = mod_name
		else:
			exe_maps = tuple(mr for mr in self.maps.values() if mr.pathname and os.path.basename(mr.pathname).startswith(mod_name))
			filename = exe_maps[0].pathname
		handle = open(filename, 'rb')
		ehdr = mayhem.utilities.struct_unpack(ehdr_struct, handle.read(ctypes.sizeof(ehdr_struct)))

		# get the shdrs
		handle.seek(ehdr.e_shoff, os.SEEK_SET)
		data = handle.read(ehdr.e_shnum * ehdr.e_shentsize)
		_shdrs = (shdr_struct * ehdr.e_shnum)
		shdrs = _shdrs()
		ctypes.memmove(ctypes.byref(shdrs), data, len(data))

		symtab = strtab = 0
		for idx, shdr in enumerate(shdrs):
			if shdr.sh_type == elf.constants.SHT_SYMTAB or shdr.sh_type == elf.constants.SHT_DYNSYM:
				if not (shdr.sh_entsize and shdr.sh_size):
					continue
				symtab = idx
			elif shdr.sh_type == elf.constants.SHT_STRTAB:
				if idx != ehdr.e_shstrndx:
					strtab = idx
			if not (symtab and strtab):
				continue
			symh = shdrs[symtab]
			strh = shdrs[strtab]
			handle.seek(strh.sh_offset, os.SEEK_SET)
			strsymtbl = handle.read(strh.sh_size)
			sym_num = symh.sh_size // symh.sh_entsize
			_syms = (sym_struct * sym_num)
			syms = _syms()
			handle.seek(symh.sh_offset, os.SEEK_SET)
			ctypes.memmove(ctypes.byref(syms), handle.read(ctypes.sizeof(syms)), ctypes.sizeof(syms))
			for sym in syms[1:]:
				if sym.st_name == 0:
					continue
				if strsymtbl[sym.st_name:(sym.st_name + len(func_name))] != func_name:
					continue
				return sym.st_value
			symtab = strtab = 0
		raise LinuxProcessError('unable to locate function')

	def _call_function(self, function_address, *args):
		if len(args) > 6:
			raise Exception('can not pass more than 6 arguments')
		registers_backup = self._get_registers()
		if mayhem.utilities.architecture_is_32bit(self.__arch__):
			registers = {'eip': function_address, 'eax': function_address}
			self._set_registers(registers)
			backup_sp = self.read_memory(registers_backup['esp'], 4)
			self.write_memory(registers_backup['esp'], b'\x00\x00\x00\x00')
			for i in range(len(args)):
				stack_cursor = registers_backup['esp'] + ((i + 1) * 4)
				backup_sp += self.read_memory(stack_cursor, 4)
				if args[i] < 0:
					self.write_memory(stack_cursor, struct.pack('i', args[i]))
				else:
					self.write_memory(stack_cursor, struct.pack('I', args[i]))
			self._ptrace(PTRACE_CONT)
			wait_result = os.waitpid(self.pid, 0)
			self.write_memory(registers_backup['esp'], backup_sp)
			ending_ip = self._get_registers()['eip']
			result = self._get_registers()['eax']
		elif mayhem.utilities.architecture_is_64bit(self.__arch__):
			registers = {'rip': function_address, 'rax': function_address}
			arg_registers = ['rdi', 'rsi', 'rdx', 'rcx', 'r8', 'r9']
			for i in range(len(args)):
				registers[arg_registers[i]] = args[i]
			self._set_registers(registers)
			backup_sp = self.read_memory(registers_backup['rsp'], 8)
			self.write_memory(registers_backup['rsp'], b'\x00\x00\x00\x00\x00\x00\x00\x00')
			self._ptrace(PTRACE_CONT)
			wait_result = os.waitpid(self.pid, 0)
			self.write_memory(registers_backup['rsp'], backup_sp)
			ending_ip = self._get_registers()['rip']
			result = self._get_registers()['rax']
		self._set_registers(registers_backup)
		if os.WSTOPSIG(wait_result[1]) == signal.SIGSEGV and ending_ip != 0:
			raise LinuxProcessError('segmentation fault')
		return result

	def _read_structure_from_memory(self, address, structure):
		structure_data = self.read_memory(address, ctypes.sizeof(structure))
		return mayhem.utilities.struct_unpack(structure, structure_data)

	def _ptrace(self, command, arg1=0, arg2=0, check_error=True):
		return ptrace(command, self.pid, arg1, arg2, check_error=check_error)

	def _get_registers(self):
		if not architecture_is_supported(self.__arch__):
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))
		_raw_registers = (ctypes.c_ulong * 32)
		raw_registers = _raw_registers()
		if self._ptrace(PTRACE_GETREGS, 0, ctypes.byref(raw_registers)) != 0:
			raise LinuxProcessError('Error: PTRACE_GETREGS', errno=get_errno())
		registers = {}
		# constants from sys/reg.h
		if mayhem.utilities.architecture_is_32bit(platform.machine()):
			registers['ebx'] = raw_registers[0]
			registers['ecx'] = raw_registers[1]
			registers['edx'] = raw_registers[2]
			registers['esi'] = raw_registers[3]
			registers['edi'] = raw_registers[4]
			registers['ebp'] = raw_registers[5]
			registers['eax'] = raw_registers[6]
			registers['ds'] = raw_registers[7]
			registers['es'] = raw_registers[8]
			registers['fs'] = raw_registers[9]
			registers['gs'] = raw_registers[10]
			registers['orig_eax'] = raw_registers[11]
			registers['eip'] = raw_registers[12]
			registers['cs'] = raw_registers[13]
			registers['eflags'] = raw_registers[14]
			registers['esp'] = raw_registers[15]
			registers['ss'] = raw_registers[16]
		elif mayhem.utilities.architecture_is_64bit(platform.machine()):
			registers['r15'] = raw_registers[0]
			registers['r14'] = raw_registers[1]
			registers['r13'] = raw_registers[2]
			registers['r12'] = raw_registers[3]
			registers['rbp'] = raw_registers[4]
			registers['rbx'] = raw_registers[5]
			registers['r11'] = raw_registers[6]
			registers['r10'] = raw_registers[7]
			registers['r9'] = raw_registers[8]
			registers['r8'] = raw_registers[9]
			registers['rax'] = raw_registers[10]
			registers['rcx'] = raw_registers[11]
			registers['rdx'] = raw_registers[12]
			registers['rsi'] = raw_registers[13]
			registers['rdi'] = raw_registers[14]
			registers['orig_rax'] = raw_registers[15]
			registers['rip'] = raw_registers[16]
			registers['cs'] = raw_registers[17]
			registers['eflags'] = raw_registers[18]
			registers['rsp'] = raw_registers[19]
			registers['ss'] = raw_registers[20]
			registers['fs_base'] = raw_registers[21]
			registers['gs_base'] = raw_registers[22]
			registers['ds'] = raw_registers[23]
			registers['es'] = raw_registers[24]
			registers['fs'] = raw_registers[25]
			registers['gs'] = raw_registers[26]
			if mayhem.utilities.architecture_is_32bit(self.__arch__):
				converted_registers = {}
				converted_registers['ebx'] = registers['rbx']
				converted_registers['ecx'] = registers['rcx']
				converted_registers['edx'] = registers['rdx']
				converted_registers['esi'] = registers['rsi']
				converted_registers['edi'] = registers['rdi']
				converted_registers['ebp'] = registers['rbp']
				converted_registers['eax'] = registers['rax']
				converted_registers['ds'] = registers['ds']
				converted_registers['es'] = registers['es']
				converted_registers['fs'] = registers['fs']
				converted_registers['gs'] = registers['gs']
				converted_registers['orig_eax'] = registers['orig_rax']
				converted_registers['eip'] = registers['rip']
				converted_registers['cs'] = registers['cs']
				converted_registers['eflags'] = registers['eflags']
				converted_registers['esp'] = registers['rsp']
				converted_registers['ss'] = registers['ss']
				registers = converted_registers
		return registers

	def _set_registers(self, registers={}):
		if not architecture_is_supported(self.__arch__):
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))
		old_registers = self._get_registers()
		old_registers.update(registers)
		_raw_registers = (ctypes.c_ulong * 32)
		raw_registers = _raw_registers()
		# constants from sys/reg.h
		if mayhem.utilities.architecture_is_32bit(platform.machine()):
			raw_registers[0] = old_registers['ebx']
			raw_registers[1] = old_registers['ecx']
			raw_registers[2] = old_registers['edx']
			raw_registers[3] = old_registers['esi']
			raw_registers[4] = old_registers['edi']
			raw_registers[5] = old_registers['ebp']
			raw_registers[6] = old_registers['eax']
			raw_registers[7] = old_registers['ds']
			raw_registers[8] = old_registers['es']
			raw_registers[9] = old_registers['fs']
			raw_registers[10] = old_registers['gs']
			raw_registers[11] = old_registers['orig_eax']
			raw_registers[12] = old_registers['eip']
			raw_registers[13] = old_registers['cs']
			raw_registers[14] = old_registers['eflags']
			raw_registers[15] = old_registers['esp']
			raw_registers[16] = old_registers['ss']
		elif mayhem.utilities.architecture_is_64bit(platform.machine()):
			if mayhem.utilities.architecture_is_32bit(self.__arch__):
				_raw_registers = (ctypes.c_ulong * 32)
				raw_registers = _raw_registers()
				if self._ptrace(PTRACE_GETREGS, 0, ctypes.byref(raw_registers)) != 0:
					raise LinuxProcessError('Error: PTRACE_GETREGS', errno=get_errno())
				raw_registers[4] = old_registers['ebp']
				raw_registers[5] = old_registers['ebx']
				raw_registers[10] = old_registers['eax']
				raw_registers[11] = old_registers['ecx']
				raw_registers[12] = old_registers['edx']
				raw_registers[13] = old_registers['esi']
				raw_registers[14] = old_registers['edi']
				raw_registers[15] = old_registers['orig_eax']
				raw_registers[16] = old_registers['eip']
				raw_registers[17] = old_registers['cs']
				raw_registers[18] = old_registers['eflags']
				raw_registers[19] = old_registers['esp']
				raw_registers[20] = old_registers['ss']
				raw_registers[23] = old_registers['ds']
				raw_registers[24] = old_registers['es']
				raw_registers[25] = old_registers['fs']
				raw_registers[26] = old_registers['gs']
			else:
				raw_registers[0] = old_registers['r15']
				raw_registers[1] = old_registers['r14']
				raw_registers[2] = old_registers['r13']
				raw_registers[3] = old_registers['r12']
				raw_registers[4] = old_registers['rbp']
				raw_registers[5] = old_registers['rbx']
				raw_registers[6] = old_registers['r11']
				raw_registers[7] = old_registers['r10']
				raw_registers[8] = old_registers['r9']
				raw_registers[9] = old_registers['r8']
				raw_registers[10] = old_registers['rax']
				raw_registers[11] = old_registers['rcx']
				raw_registers[12] = old_registers['rdx']
				raw_registers[13] = old_registers['rsi']
				raw_registers[14] = old_registers['rdi']
				raw_registers[15] = old_registers['orig_rax']
				raw_registers[16] = old_registers['rip']
				raw_registers[17] = old_registers['cs']
				raw_registers[18] = old_registers['eflags']
				raw_registers[19] = old_registers['rsp']
				raw_registers[20] = old_registers['ss']
				raw_registers[21] = old_registers['fs_base']
				raw_registers[22] = old_registers['gs_base']
				raw_registers[23] = old_registers['ds']
				raw_registers[24] = old_registers['es']
				raw_registers[25] = old_registers['fs']
				raw_registers[26] = old_registers['gs']
		if self._ptrace(PTRACE_SETREGS, 0, ctypes.byref(raw_registers)) != 0:
			raise LinuxProcessError('Error: PTRACE_SETREGS', errno=get_errno())
		return

	def _allocate_malloc(self, size):
		malloc_addr = None
		for lib in ('libc-', 'ld-linux.so'):
			try:
				malloc_addr = self._get_function_address(lib, 'malloc')
			except mayhem.proc.ProcessError:
				continue
			break
		if malloc_addr is None:
			raise mayhem.proc.ProcessError('unable to locate function')
		return self._call_function(malloc_addr, size)

	def _free_free(self, address):
		free_addr = None
		for lib in ('libc-', 'ld-linux.so'):
			try:
				free_addr = self._get_function_address(lib, 'free')
			except mayhem.proc.ProcessError:
				continue
			break
		if free_addr is None:
			raise LinuxProcessError('unable to locate function')
		self._call_function(free_addr, address)
		return

	def _allocate_mmap(self, size, address, permissions, mmap_flags=None):
		mmap_addr = self._get_function_address('libc-', 'mmap')
		address = (address or 0)
		permissions = (permissions or 'PROT_READ | PROT_WRITE | PROT_EXEC')
		permissions = flags(permissions)
		if mmap_flags is None:
			if address == 0:
				mmap_flags = flags('MAP_ANONYMOUS | MAP_PRIVATE')
			else:
				mmap_flags = flags('MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED')
		else:
			mmap_flags = flags(mmap_flags)
		return self._call_function(mmap_addr, address, size, permissions, mmap_flags, -1, 0)

	def _free_munmap(self, address, size):
		munmap_addr = self._get_function_address('libc-', 'munmap')
		result = self._call_function(munmap_addr, address, size)
		if result != 0:
			raise LinuxProcessError('Error: munmap')
		return

	def install_hook(self, mod_name, new_address, name=None, ordinal=None):
		if mayhem.utilities.architecture_is_32bit(self.__arch__):
			lm_struct = elf.Elf32_Link_Map
			dyn_struct = elf.Elf32_Dyn
			sym_struct = elf.Elf32_Sym
		elif mayhem.utilities.architecture_is_64bit(self.__arch__):
			lm_struct = elf.Elf64_Link_Map
			dyn_struct = elf.Elf64_Dyn
			sym_struct = elf.Elf64_Sym
		else:
			raise LinuxProcessError('unsupported architecture: ' + repr(self.__arch__))
		if ordinal:
			raise NotImplementedError('an ordinal is not supported for this implementation')
		if not name:
			raise RuntimeError('a name is required for this implementation')
		lm = self._read_structure_from_memory(self.get_proc_attribute('link_map_addr'), lm_struct)
		if os.path.isabs(mod_name):
			validate_name = lambda lm: bool(self.read_memory_string(lm.l_name) == mod_name)
		else:
			validate_name = lambda lm: bool(os.path.split(self.read_memory_string(lm.l_name))[-1].startswith(mod_name))
		while not validate_name(lm):
			if lm.l_next == 0:
				raise mayhem.proc.ProcessError('unable to locate shared library')
			lm = self._read_structure_from_memory(lm.l_next, lm_struct)
		idx = 0
		dyn = self._read_structure_from_memory(lm.l_ld, dyn_struct)
		nchains = 0
		strtab = 0
		symtab = 0
		while dyn.d_tag:
			idx += 1
			if dyn.d_tag == elf.constants.DT_HASH:
				nchains = struct.unpack('I', self.read_memory(dyn.d_un.d_ptr + ctypes.sizeof(ctypes.c_int), ctypes.sizeof(ctypes.c_int)))[0]
			elif dyn.d_tag == elf.constants.DT_STRTAB:
				strtab = dyn.d_un.d_ptr
			elif dyn.d_tag == elf.constants.DT_SYMTAB:
				symtab = dyn.d_un.d_ptr
			dyn = self._read_structure_from_memory(lm.l_ld + (ctypes.sizeof(dyn_struct) * idx), dyn_struct)
		for idx in range(0, nchains):
			sym = self._read_structure_from_memory(symtab + (ctypes.sizeof(sym_struct) * idx), sym_struct)
			if (sym.st_info & 0xf) != elf.constants.STT_FUNC:
				continue
			if self.read_memory_string(strtab + sym.st_name) == name:
				sym_addr = (symtab + (ctypes.sizeof(sym_struct) * idx))
				old_address = lm.l_addr + sym.st_value
				sym.st_value = (lm.l_addr - new_address)
				self.write_memory(sym_addr, mayhem.utilities.struct_pack(sym))
				hook = mayhem.proc.Hook('eat', (sym_addr + sym_struct.st_value.offset), old_address, new_address)
				self._installed_hooks.append(hook)
				return hook
		raise mayhem.proc.ProcessError('unable to locate function')

	def allocate(self, size=0x400, address=None, permissions=None):
		permissions = (permissions or 'PROT_READ | PROT_WRITE | PROT_EXEC')
		if address is not None or permissions is not None:
			return self._allocate_mmap(size, address, permissions)
		try:
			return self._allocate_malloc(size)
		except mayhem.proc.ProcessError:
			return self._allocate_mmap(size, address, permissions)

	def free(self, address):
		memregion = self.maps.get(address)
		if memregion:
			self._free_munmap(address, (memregion.addr_high - memregion.addr_low))
		else:
			self._free_free(address)

	def protect(self, address, permissions=None, size=0x400):
		permissions = (permissions or 'PROT_READ | PROT_WRITE | PROT_EXEC')
		mprotect_addr = self._get_function_address('libc-', 'mprotect')
		permissions = flags(permissions)
		result = self._call_function(mprotect_addr, address, size, permissions)
		if result != 0:
			raise LinuxProcessError('Error: mprotect')
		return

	def start_thread(self, address, targ=None):
		thread_create_addr = self._get_function_address('libpthread', 'pthread_create')
		thread_id_addr = self._allocate_malloc(0x10)
		result = self._call_function(thread_create_addr, thread_id_addr, 0, address, targ)
		if result != 0:
			raise LinuxProcessError('Error: pthread_create')
		thread_id = struct.unpack('L', self.read_memory(thread_id_addr, ctypes.sizeof(ctypes.c_long)))[0]
		self._free_free(thread_id_addr)
		return thread_id

	def join_thread(self, thread_id):
		thread_join_addr = self._get_function_address('libpthread', 'pthread_join')
		if self._call_function(thread_join_addr, thread_id, 0) != 0:
			raise LinuxProcessError('Error: pthread_join')
		return

	def close(self):
		self._ptrace(PTRACE_DETACH)

	def kill(self):
		signal.signal(signal.SIGCHLD, signal.SIG_DFL)
		os.kill(self.pid, signal.SIGKILL)
		os.waitpid(self.pid, 0)

	def load_library(self, libpath):
		libpath = os.path.abspath(libpath)
		libpath = libpath + "\x00"
		dlopen_addr = self._get_function_address('libc-', '__libc_dlopen_mode')
		readable_address = self._allocate_malloc(0x400)
		readdata_backup = self.read_memory(readable_address, len(libpath))
		self.write_memory(readable_address, libpath)
		dlopen_flags = flags('RTLD_LAZY | RTLD_GLOBAL')
		result = self._call_function(dlopen_addr, readable_address, dlopen_flags)
		self.write_memory(readable_address, readdata_backup)
		if result == 0:
			raise LinuxProcessError('Error: failed to load: ' + repr(libpath))
		self._free_free(readable_address)
		return result

	def read_memory(self, address, size=0x400):
		data = b''
		address_cursor = address
		size_of_long = ctypes.sizeof(ctypes.c_long)
		while len(data) < size:
			value = self._ptrace(PTRACE_PEEKDATA, address_cursor)
			if value == -1:
				errno = get_errno()
				if errno != 0:
					raise LinuxProcessError('Error: PTRACE_PEEKDATA', errno=get_errno())
			data += struct.pack('l', value)
			address_cursor += size_of_long
		data = data[:size]
		return data

	def write_memory(self, address, data):
		address_cursor = address
		size_of_long = ctypes.sizeof(ctypes.c_long)
		sz_overlap = address_cursor % size_of_long
		if sz_overlap:
			address_cursor -= sz_overlap
			data = self.read_memory(address_cursor, sz_overlap) + data
		sz_overlap = size_of_long - ((address_cursor + len(data)) % size_of_long)
		if 0 < sz_overlap < 8:
			data = data + self.read_memory(address_cursor + len(data), sz_overlap)
		for idx in range(0, len(data), size_of_long):
			data_chunk = data[idx:(idx + size_of_long)]
			data_chunk = struct.unpack('l', data_chunk)[0]
			if self._ptrace(PTRACE_POKEDATA, address_cursor + idx, data_chunk) != 0:
				raise LinuxProcessError('Error: PTRACE_POKEDATA', errno=get_errno())
		return


text:
{{title}}

Sorry but we could not find the item {{item}}

            Please ensure the target address is correct.

            If what you are looking for is a view, it is possible there is no app serving the view.

            If what you are looking for is an app, it is possible the app has no (running) server.

            If what you are looking for is a file, it is possible the file does not exist.

Contact your system administrator.

        Go Home


text:
from django.conf.urls.defaults import *
from line.views import view_orders

urlpatterns = patterns('line.views',
    url(r'^$', view_orders),
)


text:
#ifndef vl_video_buffer_h
#define vl_video_buffer_h

#include "pipe/p_context.h"
#include "pipe/p_video_codec.h"

#include "vl_defines.h"

/**
 * implementation of a planar ycbcr buffer
 */

/* planar buffer for vl data upload and manipulation */
struct vl_video_buffer
{
   struct pipe_video_buffer base;
   unsigned                 num_planes;
   struct pipe_resource     *resources[VL_NUM_COMPONENTS];
   struct pipe_sampler_view *sampler_view_planes[VL_NUM_COMPONENTS];
   struct pipe_sampler_view *sampler_view_components[VL_NUM_COMPONENTS];
   struct pipe_surface      *surfaces[VL_MAX_SURFACES];
};

/**
 * get subformats for each plane
 */
const enum pipe_format *
vl_video_buffer_formats(struct pipe_screen *screen, enum pipe_format format);

/**
 * get YUV plane order
 */
const unsigned *
vl_video_buffer_plane_order(enum pipe_format format);

/**
 * get maximum size of video buffers
 */
unsigned
vl_video_buffer_max_size(struct pipe_screen *screen);

/**
 * check if video buffer format is supported for a codec/profile
 * can be used as default implementation of screen->is_video_format_supported
 */
boolean
vl_video_buffer_is_format_supported(struct pipe_screen *screen,
                                    enum pipe_format format,
                                    enum pipe_video_profile profile,
                                    enum pipe_video_entrypoint entrypoint);

/*
 * set the associated data for the given video buffer
 */
void
vl_video_buffer_set_associated_data(struct pipe_video_buffer *vbuf,
                                    struct pipe_video_codec *vcodec,
                                    void *associated_data,
                                    void (*destroy_associated_data)(void *));

/*
 * get the associated data for the given video buffer
 */
void *
vl_video_buffer_get_associated_data(struct pipe_video_buffer *vbuf,
                                    struct pipe_video_codec *vcodec);

/**
 * fill a resource template for the given plane
 */
void
vl_video_buffer_template(struct pipe_resource *templ,
                         const struct pipe_video_buffer *templat,
                         enum pipe_format resource_format,
                         unsigned depth, unsigned array_size,
                         unsigned usage, unsigned plane);

/**
 * creates a video buffer, can be used as a standard implementation for pipe->create_video_buffer
 */
struct pipe_video_buffer *
vl_video_buffer_create(struct pipe_context *pipe,
                       const struct pipe_video_buffer *templat);

/**
 * extended create function, gets depth, array_size, usage and formats for each plane seperately
 */
struct pipe_video_buffer *
vl_video_buffer_create_ex(struct pipe_context *pipe,
                          const struct pipe_video_buffer *templat,
                          const enum pipe_format resource_formats[VL_NUM_COMPONENTS],
                          unsigned depth, unsigned array_size, unsigned usage);

/**
 * even more extended create function, provide the pipe_resource for each plane
 */
struct pipe_video_buffer *
vl_video_buffer_create_ex2(struct pipe_context *pipe,
                           const struct pipe_video_buffer *templat,
                           struct pipe_resource *resources[VL_NUM_COMPONENTS]);

#endif /* vl_video_buffer_h */


text:
import _ from "lodash"
import assignDisabledRanges from "../assignDisabledRanges"
import basicChecks from "./basicChecks"
import lessSyntax from "postcss-less"
import normalizeRuleSettings from "../normalizeRuleSettings"
import postcss from "postcss"
import scssSyntax from "postcss-scss"
import sugarss from "sugarss"

/**
 * Create a stylelint rule testing function.
 *
 * Pass in an `equalityCheck` function. Given some information,
 * this checker should use Whatever Test Runner to perform
 * equality checks.
 *
 * `equalityCheck` should accept two arguments:
 * - `processCss` {Promise}: A Promise that resolves with an array of
 *   comparisons that you need to check (documented below).
 * - `context` {object}: An object that contains additional information
 *   you may need:
 *   - `caseDescription` {string}: A description of the test case as a whole.
 *   	 Will look like this:
 *   	   > rule: value-list-comma-space-before
 *   	   > config: "always-single-line"
 *   	   > code: "a { background-size: 0 ,0;\n}"
 *   - `comparisonCount` {number}: The number of comparisons that
 *     will need to be performed (e.g. useful for tape).
 *   - `completeAssertionDescription` {string}: While each individual
 *   	 comparison may have its own description, this is a description
 *   	 of the whole assertion (e.g. useful for Mocha).
 *   - `only` {boolean}: If `true`, the test runner should only run this
 *     test case (e.g. `test.only` in tape, `describe.only` in Mocha).
 *
 * `processCss` is a Promsie that resolves with an array of comparisons.
 * Each comparison has the following properties:
 * - `actual` {any}: Some actual value.
 * - `expected` {any}: Some expected value.
 * - `description` {string}: A (possibly empty) description of the comparison.
 *
 * Within `equalityCheck`, you need to ensure that you:
 * - Set up the test case.
 * - When `processCss` resolves, loop through every comparison.
 * - For each comparison, make an assertion checking that `actual === expected`.
 *
 * The `testRule` function that you get has a simple signature:
 * `testRule(rule, testGroupDescription)`.
 *
 * `rule` is just the rule that you are testing (a function).
 *
 * `testGroupDescription` is an object fitting the following schema.
 *
 * Required properties:
 * - `ruleName` {string}: The name of the rule. Used in descriptions.
 * - `config` {any}: The rule's configuration for this test group.
 *   Should match the format you'd use in `.stylelintrc`.
 * - `accept` {array}: An array of objects describing test cases that
 *   should not violate the rule. Each object has these properties:
 *   - `code` {string}: The source CSS to check.
 *   - `description` {[string]}: An optional description of the case.
 * - `reject` {array}: An array of objects describing test cases that
 *   should violate the rule once. Each object has these properties:
 *   - `code` {string}: The source CSS to check.
 *   - `message` {string}: The message of the expected violation.
 *   - `line` {[number]}: The expected line number of the violation.
 *     If this is left out, the line won't be checked.
 *   - `column` {[number]}: The expected column number of the violation.
 *     If this is left out, the column won't be checked.
 *   - `description` {[string]}: An optional description of the case.
 *
 * Optional properties:
 * - `syntax` {"css"|"scss"|"less"|"sugarss"}: Defaults to `"css"`.
 * - `skipBasicChecks` {boolean}: Defaults to `false`. If `true`, a
 *   few rudimentary checks (that should almost always be included)
 *   will not be performed.
 * - `preceedingPlugins` {array}: An array of PostCSS plugins that
 *   should be run before the CSS is tested.
 *
 * @param {function} equalityCheck - Described above
 * @return {function} testRule - Decsribed above
 */
let onlyTest

function checkCaseForOnly(caseType, testCase) {
  if (!testCase.only) { return }
  /* istanbul ignore next */
  if (onlyTest) { throw new Error("Cannot use `only` on multiple test cases") }
  onlyTest = { case: testCase, type: caseType }
}

export default function (equalityCheck) {
  return function (rule, schema) {
    const alreadyHadOnlyTest = !!onlyTest
    if (schema.accept) {
      schema.accept.forEach(_.partial(checkCaseForOnly, "accept"))
    }

    if (schema.reject) {
      schema.reject.forEach(_.partial(checkCaseForOnly, "reject"))
    }

    if (onlyTest) {
      schema = _.assign(_.omit(schema, [ "accept", "reject" ]), {
        skipBasicChecks: true,
        [onlyTest.type]: [onlyTest.case],
      })
    }

    if (!alreadyHadOnlyTest) {
      process.nextTick(() => {
        processGroup(rule, schema, equalityCheck)
      })
    }
  }
}

function processGroup(rule, schema, equalityCheck) {
  const { ruleName } = schema
  const ruleOptions = normalizeRuleSettings(schema.config)
  const rulePrimaryOptions = ruleOptions[0]
  const ruleSecondaryOptions = ruleOptions[1]

  let printableConfig = (rulePrimaryOptions) ? JSON.stringify(rulePrimaryOptions) : ""
  if (printableConfig && ruleSecondaryOptions) {
    printableConfig += ", " + JSON.stringify(ruleSecondaryOptions)
  }

  function createCaseDescription(code) {
    let text = `\n> rule: ${ruleName}\n`
    text += `> config: ${printableConfig}\n`
    text += `> code: ${JSON.stringify(code)}\n`
    return text
  }

  // Process the code through the rule and return
  // the PostCSS LazyResult promise
  function postcssProcess(code) {
    const postcssProcessOptions = {}

    switch (schema.syntax) {
      case "scss":
        postcssProcessOptions.syntax = scssSyntax
        break
      case "less":
        postcssProcessOptions.syntax = lessSyntax
        break
      case "sugarss":
        postcssProcessOptions.syntax = sugarss
        break
    }

    const processor = postcss()
    processor.use(assignDisabledRanges)

    if (schema.preceedingPlugins) {
      schema.preceedingPlugins.forEach(processor.use)
    }

    return processor.use(rule(rulePrimaryOptions, ruleSecondaryOptions))
      .process(code, postcssProcessOptions)
  }

  // Apply the basic positive checks unless
  // explicitly told not to
  const passingTestCases = (schema.skipBasicChecks)
    ? schema.accept
    : basicChecks.concat(schema.accept)

  if (passingTestCases && passingTestCases.length) {
    passingTestCases.forEach(acceptedCase => {
      if (!acceptedCase) { return }
      const assertionDescription = spaceJoin(acceptedCase.description, "should be accepted")
      const resultPromise = postcssProcess(acceptedCase.code).then(postcssResult => {
        const warnings = postcssResult.warnings()
        return [{
          expected: 0,
          actual: warnings.length,
          description: assertionDescription,
        }]
      }).catch(err => console.log(err.stack)) // eslint-disable-line no-console

      equalityCheck(resultPromise, {
        comparisonCount: 1,
        caseDescription: createCaseDescription(acceptedCase.code),
        completeAssertionDescription: assertionDescription,
      })
    })
  }

  if (schema.reject && schema.reject.length) {
    schema.reject.forEach(rejectedCase => {
      let completeAssertionDescription = "should register one warning"
      let comparisonCount = 1
      if (rejectedCase.line) {
        comparisonCount++
        completeAssertionDescription += ` on line ${rejectedCase.line}`
      }
      if (rejectedCase.column !== undefined) {
        comparisonCount++
        completeAssertionDescription += ` on column ${rejectedCase.column}`
      }
      if (rejectedCase.message) {
        comparisonCount++
        completeAssertionDescription += ` with message "${rejectedCase.message}"`
      }

      const resultPromise = postcssProcess(rejectedCase.code).then(postcssResult => {
        const warnings = postcssResult.warnings()
        const warning = warnings[0]

        const comparisons = [{
          expected: 1,
          actual: warnings.length,
          description: spaceJoin(rejectedCase.description, "should register one warning"),
        }]

        if (rejectedCase.line) {
          comparisons.push({
            expected: rejectedCase.line,
            actual: _.get(warning, "line"),
            description: spaceJoin(rejectedCase.description, `should warn on line ${rejectedCase.line}`),
          })
        }
        if (rejectedCase.column !== undefined) {
          comparisons.push({
            expected: rejectedCase.column,
            actual: _.get(warning, "column"),
            description: spaceJoin(rejectedCase.description, `should warn on column ${rejectedCase.column}`),
          })
        }
        if (rejectedCase.message) {
          comparisons.push({
            expected: rejectedCase.message,
            actual: _.get(warning, "text"),
            description: spaceJoin(rejectedCase.description, `should warn with message ${rejectedCase.message}`),
          })
        }
        return comparisons
      }).catch(err => console.log(err.stack)) // eslint-disable-line no-console

      equalityCheck(resultPromise, {
        comparisonCount,
        completeAssertionDescription,
        caseDescription: createCaseDescription(rejectedCase.code),
        only: rejectedCase.only,
      })
    })
  }
}

function spaceJoin(...args) {
  return _.compact(args).join(" ")
}


text:
@implementation AllModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{

}
@end


text:
using System.Globalization;
using System.Threading;

namespace unvell.ReoGrid
{
	#region Multi-Languages
	/// <summary>
	/// Static language resources
	/// </summary>
	public static class LanguageResource
	{
		public static CultureInfo Culture;

		#region Public
		static LanguageResource()
		{
			Culture = Thread.CurrentThread.CurrentUICulture;

			switch (Culture.Name)
			{
                case "zh-CN":
                    Filter_SortAtoZ = "升序(&S)";
                    Filter_SortZtoA = "降序(&O)";
                    Filter_SelectAll = "(全部选择)";
                    Filter_Blanks = "(空白格)";

                    Menu_InsertSheet = "插入(&I)";
                    Menu_DeleteSheet = "删除(&D)";
                    Menu_RenameSheet = "改名(&R)...";

                    //Sheet = "シート";
                    Sheet_RenameDialog_Title = "表格名的变更";
                    Sheet_RenameDialog_NameLabel = "名称(&N): ";

                    Button_Cancel = "取消";
                    break;

                case "ja-JP":
					Filter_SortAtoZ = "昇順(&S)";
					Filter_SortZtoA = "降順(&O)";
					Filter_SelectAll = "(すべて選択)";
					Filter_Blanks = "(空白セル)";

					Menu_InsertSheet = "挿入(&I)";
					Menu_DeleteSheet = "削除(&D)";
					Menu_RenameSheet = "名前変更(&R)...";

					//Sheet = "シート";
					Sheet_RenameDialog_Title = "シートの名前変更";
					Sheet_RenameDialog_NameLabel = "名前(&N): ";

					Button_Cancel = "キャンセル";
					break;

				case "ru-RU":
					Filter_SortAtoZ = "Сортировка от А до Я";
					Filter_SortZtoA = "Сортировка от Я до А";
					Filter_SelectAll = "(Выделить все)";
					Filter_Blanks = "(Пустые)";

					Menu_InsertSheet = "&Вставить";
					Menu_DeleteSheet = "&Удалить";
					Menu_RenameSheet = "&Переименовать…";

					Sheet_RenameDialog_Title = "Переименование листа";
					Sheet_RenameDialog_NameLabel = "&Имя: ";

					Button_Cancel = "Отмена";

					break;
			}
		}

		#region Filter
		/// <summary>
		/// Text displayed on column filter. (Sort A to Z)
		/// </summary>
		public static string Filter_SortAtoZ = "Sort A to Z";

		/// <summary>
		/// Text displayed on column filter (Sort Z to A)
		/// </summary>
		public static string Filter_SortZtoA = "Sort Z to A";
		/// <summary>
		/// Text displayed on column filter (Select All)
		/// </summary>
		public static string Filter_SelectAll = "(Select All)";
		/// <summary>
		/// Text of blank option in filter list. (Blanks)
		/// </summary>
		public static string Filter_Blanks = "(Blanks)";
		#endregion // Filter

		#region Sheet Menu
		/// <summary>
		/// Text displayed on sheet tab control (Insert)
		/// </summary>
		public static string Menu_InsertSheet = "Insert";
		/// <summary>
		/// Text displayed on sheet tab control (Delete)
		/// </summary>
		public static string Menu_DeleteSheet = "Delete";
		/// <summary>
		/// Text displayed on sheet tab control (Rename...)
		/// </summary>
		public static string Menu_RenameSheet = "Rename...";
		#endregion // Sheet Menu

		/// <summary>
		/// Text displayed on sheet renaming dialog (Rename sheet)
		/// </summary>
		public static string Sheet_RenameDialog_Title = "Rename sheet";
		/// <summary>
		/// Label text displayed on sheet renaming dialog (Name: )
		/// </summary>
		public static string Sheet_RenameDialog_NameLabel = "&Name: ";

		/// <summary>
		/// Common text displayed as label of OK button (OK)
		/// </summary>
		public static string Button_OK = "OK";
		/// <summary>
		/// Common text displayed as label of Cancel button (Cancel)
		/// </summary>
		public static string Button_Cancel = "Cancel";

		/// <summary>
		/// Text of word sheet (Sheet)
		/// </summary>
		public static string Sheet = "Sheet";
		#endregion // Public

	}
	#endregion // Multi-Languages
}


text: docker build -t lc-tools .


text:
\documentclass[12pt, a4paper]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{color}
\usepackage{listings}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\lstdefinelanguage{JavaScript}{
  keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
  keywordstyle=\color{blue}\bfseries,
  ndkeywords={class, export, boolean, throw, implements, import, this},
  ndkeywordstyle=\color{darkgray}\bfseries,
  identifierstyle=\color{black},
  sensitive=false,
  comment=[l]{//},
  morecomment=[s]{/*}{*/},
  commentstyle=\color{purple}\ttfamily,
  stringstyle=\color{red}\ttfamily,
  morestring=[b]',
  morestring=[b]"
}
\lstset{
   language=JavaScript,
   backgroundcolor=\color{lightgray},
   extendedchars=true,
   basicstyle=\footnotesize\ttfamily,
   showstringspaces=false,
   showspaces=false,
   numbers=left,
   numberstyle=\footnotesize,
   numbersep=9pt,
   tabsize=2,
   breaklines=true,
   showtabs=false,
   captionpos=b
}
\author{Andrey Lushnikov}
\title{Online-Latex Sample (english-russian)}
\date{May 5, 2012}
\begin{document}
\maketitle
\tableofcontents
\section{Demo document}
\subsection{Math}

Vector: $\vec{a}: a_x, a_y$ \\
Vector: $\vec{b}: b_x, b_y$ \\
$\vec{a} ^\wedge \vec{b} = \alpha$ \\
$\vec{a} \cdot \vec{b} = |\vec{a}| \cdot |\vec{b}| * \cos \alpha$

$\vec{a} \bot \vec{b} \Leftrightarrow \vec{a} \cdot \vec{b} = 0$

\subsection{Code Listings}
\begin{lstlisting}
for(var i = 0; i < n; i++) {
        console.log(i);
}
\end{lstlisting}

\subsection{Кириллица}
Сервис поддерживает компиляцию кириллических файлов

\end{document}