text:
title: Felices fiestas
layout: single
categories:
- General
- Shenmue II
- Sin and Punishment
tags:
- General
- Shenmue II
- Sin and Punishment
---
Buenas a todos, esta actualización llega con retraso debido a diversos problemas personales.

Vamos a pasar rápidamente por lo que hay: el testeo de Shenmue II sigue su curso, ahora mismo
estamos centrados en todo lo que rodea al cumpleaños de Fangmei, y de hecho ha habido varias
reescrituras de escenas (Por no haberlas visto en vídeo en su momento).

También se ha avanzado en la conversión de esa traducción a XBOX (Ahora mismo solo falta por
convertir los textos correspondientes al disco 3 de Dreamcast).

En lo que se refiere al Sin and Punishment, aunque el doblaje se terminó a tiempo para
RetroBarcelona 2014, hemos preparado ya una ronda de correcciones para los actores, con la que
pulir todos los detalles de textos e interpretaciones que pueden mejorarse. Esperamos que se pueda
grabar todo a lo largo del mes de enero. Seguimos retocando otros contenidos de interfaz y
tutoriales.

Y para terminar, este año no habrá inocentada.

Un saludo a todos.


text:
            <a href="<?php base_url(); ?>">Home

            CETAK ULANG DOKUMEN PENDAFTARAN

                    NPWPD/Nama WP/Objek Pajak

                            <input type="text" class="form-control" name="s_keyword" id="s_keyword">

                    Tanggal Dokumen

                            <input type="text" class="form-control" name="tgl_doc" id="tgl_doc">

                    <button class="btn btn-success" type="button" id="btn-search" onclick="showData()">Tampilkan Data</button>

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FreeDb
{
    [Serializable]
    public class Album
    {
        public string Title { get; set; }
        //public Artist Artist { get; set; }
        //public Genre Genre { get; set; }

        //public List<Track> Tracks { get; private set; }

        //public Album()
        //{
        //    Tracks = new List<Track>();
        //}
    }
}


text:
declare function describe(description: string, callback: Function): void;
declare function xdescribe(description: string, callback: Function): void;
declare function it(expectation: string, callback: Function): void;
declare function xit(expectation: string, callback: Function): void;

interface assert {
	(expression: boolean, message: string): void;
	isOk: (value: any, message?: string) => void;
	isNotOk: (value: any, message?: string) => void;
	exists: (value: any, message?: string) => void;
	notExists: (value: any, message?: string) => void;
	isNumber: (value: any, message?: string) => void;
	isNotNumber: (value: any, message?: string) => void;
	isFunction: (value: any, message?: string) => void;
	isNotFunction: (value: any, message?: string) => void;
	isString: (value: any, message?: string) => void;
	isNotString: (value: any, message?: string) => void;
	isTrue: (value: any, message?: string) => void;
	isNotTrue: (value: any, message?: string) => void;
	isFalse: (value: any, message?: string) => void;
	isNotFalse: (value: any, message?: string) => void;
	isNull: (value: any, message?: string) => void;
	isNotNull: (value: any, message?: string) => void;
	instanceOf: (value: any, constructor: Function, message?: string) => void;
	notInstanceOf: (value: any, constructor: Function, message?: string) => void;
	isUndefined: (value: any, message?: string) => void;
	isDefined: (value: any, message?: string) => void;
	"throws": (fn: Function, errorLike?: any, errMsgMatcher?: any, message?: string) => void;
	doesNotThrow: (fn: Function, errorLike?: any, errMsgMatcher?: any, message?: string) => void;
	equal: (actual: any, expected: any, message?: string) => void;
	notEqual: (actual: any, expected: any, message?: string) => void;
	strictEqual: (actual: any, expected: any, message?: string) => void;
	notStrictEqual: (actual: any, expected: any, message?: string) => void;
	deepEqual: (actual: any, expected: any, message?: string) => void;
	notDeepEqual: (actual: any, expected: any, message?: string) => void;
	property: (object: any, property: string, message?: string) => void;
	notProperty: (object: any, property: string, message?: string) => void;
	isFulfilled: (promise: any, message?: string) => any;
	isRejected: (promise: any, errorLike?: any, errMsgMathcer?: any, message?: string) => any;
	becomes: (promise: any, value: any, message?: string) => any;
	doesNotBecome: (promise: any, value: any, message?: string) => any;
}
declare var assert: assert;


text:
import roslib; roslib.load_manifest('rcommander_pr2_gui')
import rcommander.rcommander as rc
import pypr2.pr2_utils as pu
import rospy
import tf

rospy.init_node('rcommander', anonymous=True)
tf = tf.TransformListener()
#pr2 = pu.PR2(tf)
pr2 = None
#print 'RCOMMANDER EXP IS SHUTDOWN', rospy.is_shutdown()
rc.run(pr2, tf, ['experimental'])


text:
import java.util.Scanner;

public class Problem12 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner keyboard = new Scanner(System.in);
		int in = keyboard.nextInt();
		int[] led = new int[in];
		double[] price = new double[in];
		for (int i = 0; i < in; i++) {
			led[i] = keyboard.nextInt();
			keyboard.nextLine();
			keyboard.nextLine() ;
			price[i] = keyboard.nextDouble();
		}
		double out = 0;
		while (true) {
			int codigo = keyboard.nextInt();
			if (codigo == 0)
				break;
			int quantidade = keyboard.nextInt();
			if (quantidade < 0)
				continue;
			for (int i = 0; i < led.length; i++)
				if (led[i] == codigo) {
					out += price[i] * quantidade;
					break;
				}
		}
		keyboard.close();
		System.out.println(String.format("%.2f", out));
	}

}


text:
var routeUtils = require('../route-utils');

module.exports = function(app){
	/*
   * API overview page
   */
  app.get('/api', function (req, res) {
    res.render('api', {
      title: "Bitponics API"
    });
  });

	require('./action')(app);
	require('./control')(app);
	require('./device')(app);
	//TODO require('./deviceType')(app);
	require('./growPlan')(app);
	require('./gardens')(app);
	require('./growSystem')(app);
	require('./light')(app);
  require('./lightBulb')(app);
	require('./lightFixture')(app);
  require('./notifications')(app);
	require('./nutrient')(app);
  require('./plants')(app);
	require('./sensor')(app);
	require('./sensorLog')(app);
	require('./users')(app);
};


text:
delete from foglamp.configuration where key in (
	'North Readings to OCS',
	'North Statistics to PI',
	'North Readings to PI',
	'North_Statistics_to_PI',
	'dht11',
	'DHT11 South C Plugin',
	'North_Readings_to_HTTP',
	'North_Readings_to_PI') and key not in (
		select distinct process_name from foglamp.tasks);

delete from foglamp.scheduled_processes where name in (
	'North Readings to OCS',
	'North Statistics to PI',
	'North Readings to PI',
	'North_Statistics_to_PI',
	'dht11',
	'DHT11 South C Plugin',
	'North_Readings_to_HTTP',
	'North_Readings_to_PI') and name not in (
		select distinct process_name from foglamp.tasks);

delete from foglamp.schedules where schedule_name in (
	'North Readings to OCS',
	'North Statistics to PI',
	'North Readings to PI',
	'North_Statistics_to_PI',
	'dht11',
	'DHT11 South C Plugin',
	'North_Readings_to_HTTP',
	'North_Readings_to_PI') and schedule_name not in (
		select distinct process_name from foglamp.tasks);


text:
'use strict';

const RENDER_TYPE = require('billund-enums').renderType;
let vueRender = null;
let reactRender = null;

/**
 * 一些预处理方法
 */
function doInit() {
    process.env.REACT_ENV = 'server';
    // 设置VUE_ENV enviroment variable to "server",作用是在服务端取消对数据对象的监控,能够增强性能
    process.env.VUE_ENV = 'server';
}
doInit();

function* render(context, widget, data) {
    const renderType = widget.renderType;
    if (renderType == RENDER_TYPE.RENDER_TYPE_VUE) {
        if (!vueRender) {
            vueRender = require('./lib/vue.js');
        }
        return yield vueRender.render(context, widget, data);
    }
    if (!reactRender) {
        reactRender = require('./lib/react.js');
    }
    return reactRender(widget, data);
}

module.exports = {
    render
};


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

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

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.tbWidth = new System.Windows.Forms.TextBox();
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.bScalePrint = new System.Windows.Forms.Button();
            this.cbScaleNumber = new System.Windows.Forms.CheckBox();
            this.cbScaleHeight = new System.Windows.Forms.CheckBox();
            this.cbScaleWidth = new System.Windows.Forms.CheckBox();
            this.cbScaleHalf = new System.Windows.Forms.CheckBox();
            this.tbScaleLength = new System.Windows.Forms.TextBox();
            this.tbScaleSize = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.tabPage2 = new System.Windows.Forms.TabPage();
            this.label6 = new System.Windows.Forms.Label();
            this.bGridPrint = new System.Windows.Forms.Button();
            this.tbGridSize = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.tbHeight = new System.Windows.Forms.TextBox();
            this.tabControl1.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.SuspendLayout();
            //
            // tbWidth
            //
            this.tbWidth.Location = new System.Drawing.Point(95, 10);
            this.tbWidth.Name = "tbWidth";
            this.tbWidth.Size = new System.Drawing.Size(100, 25);
            this.tbWidth.TabIndex = 0;
            this.tbWidth.Text = "23.0";
            //
            // tabControl1
            //
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Controls.Add(this.tabPage2);
            this.tabControl1.Location = new System.Drawing.Point(0, 80);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(285, 285);
            this.tabControl1.TabIndex = 1;
            //
            // tabPage1
            //
            this.tabPage1.AutoScroll = true;
            this.tabPage1.Controls.Add(this.bScalePrint);
            this.tabPage1.Controls.Add(this.cbScaleNumber);
            this.tabPage1.Controls.Add(this.cbScaleHeight);
            this.tabPage1.Controls.Add(this.cbScaleWidth);
            this.tabPage1.Controls.Add(this.cbScaleHalf);
            this.tabPage1.Controls.Add(this.tbScaleLength);
            this.tabPage1.Controls.Add(this.tbScaleSize);
            this.tabPage1.Controls.Add(this.label4);
            this.tabPage1.Controls.Add(this.label3);
            this.tabPage1.Location = new System.Drawing.Point(4, 28);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage1.Size = new System.Drawing.Size(277, 253);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "刻度尺";
            this.tabPage1.UseVisualStyleBackColor = true;
            //
            // bScalePrint
            //
            this.bScalePrint.Location = new System.Drawing.Point(15, 150);
            this.bScalePrint.Name = "bScalePrint";
            this.bScalePrint.Size = new System.Drawing.Size(75, 30);
            this.bScalePrint.TabIndex = 3;
            this.bScalePrint.Text = "打印";
            this.bScalePrint.UseVisualStyleBackColor = true;
            this.bScalePrint.Click += new System.EventHandler(this.PrintButton_Click);
            //
            // cbScaleNumber
            //
            this.cbScaleNumber.AutoSize = true;
            this.cbScaleNumber.Checked = true;
            this.cbScaleNumber.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbScaleNumber.Location = new System.Drawing.Point(150, 80);
            this.cbScaleNumber.Name = "cbScaleNumber";
            this.cbScaleNumber.Size = new System.Drawing.Size(67, 23);
            this.cbScaleNumber.TabIndex = 2;
            this.cbScaleNumber.Text = "刻度值";
            this.cbScaleNumber.UseVisualStyleBackColor = true;
            //
            // cbScaleHeight
            //
            this.cbScaleHeight.AutoSize = true;
            this.cbScaleHeight.Location = new System.Drawing.Point(150, 115);
            this.cbScaleHeight.Name = "cbScaleHeight";
            this.cbScaleHeight.Size = new System.Drawing.Size(93, 23);
            this.cbScaleHeight.TabIndex = 2;
            this.cbScaleHeight.Text = "垂直刻度尺";
            this.cbScaleHeight.UseVisualStyleBackColor = true;
            //
            // cbScaleWidth
            //
            this.cbScaleWidth.AutoSize = true;
            this.cbScaleWidth.Checked = true;
            this.cbScaleWidth.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbScaleWidth.Location = new System.Drawing.Point(15, 115);
            this.cbScaleWidth.Name = "cbScaleWidth";
            this.cbScaleWidth.Size = new System.Drawing.Size(93, 23);
            this.cbScaleWidth.TabIndex = 2;
            this.cbScaleWidth.Text = "水平刻度尺";
            this.cbScaleWidth.UseVisualStyleBackColor = true;
            //
            // cbScaleHalf
            //
            this.cbScaleHalf.AutoSize = true;
            this.cbScaleHalf.Checked = true;
            this.cbScaleHalf.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbScaleHalf.Location = new System.Drawing.Point(15, 80);
            this.cbScaleHalf.Name = "cbScaleHalf";
            this.cbScaleHalf.Size = new System.Drawing.Size(67, 23);
            this.cbScaleHalf.TabIndex = 2;
            this.cbScaleHalf.Text = "半刻度";
            this.cbScaleHalf.UseVisualStyleBackColor = true;
            //
            // tbScaleLength
            //
            this.tbScaleLength.Location = new System.Drawing.Point(150, 45);
            this.tbScaleLength.Name = "tbScaleLength";
            this.tbScaleLength.Size = new System.Drawing.Size(100, 25);
            this.tbScaleLength.TabIndex = 1;
            this.tbScaleLength.Text = "1";
            //
            // tbScaleSize
            //
            this.tbScaleSize.Location = new System.Drawing.Point(150, 10);
            this.tbScaleSize.Name = "tbScaleSize";
            this.tbScaleSize.Size = new System.Drawing.Size(100, 25);
            this.tbScaleSize.TabIndex = 1;
            this.tbScaleSize.Text = "1";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(10, 45);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(105, 19);
            this.label4.TabIndex = 0;
            this.label4.Text = "刻度线长度 (cm)";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(10, 10);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(92, 19);
            this.label3.TabIndex = 0;
            this.label3.Text = "刻度间距 (cm)";
            //
            // tabPage2
            //
            this.tabPage2.AutoScroll = true;
            this.tabPage2.Controls.Add(this.label6);
            this.tabPage2.Controls.Add(this.bGridPrint);
            this.tabPage2.Controls.Add(this.tbGridSize);
            this.tabPage2.Location = new System.Drawing.Point(4, 28);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage2.Size = new System.Drawing.Size(277, 253);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "简易网格";
            this.tabPage2.UseVisualStyleBackColor = true;
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(10, 10);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(92, 19);
            this.label6.TabIndex = 2;
            this.label6.Text = "网格间距 (cm)";
            //
            // bGridPrint
            //
            this.bGridPrint.Location = new System.Drawing.Point(15, 45);
            this.bGridPrint.Name = "bGridPrint";
            this.bGridPrint.Size = new System.Drawing.Size(75, 30);
            this.bGridPrint.TabIndex = 3;
            this.bGridPrint.Text = "打印";
            this.bGridPrint.UseVisualStyleBackColor = true;
            this.bGridPrint.Click += new System.EventHandler(this.PrintButton_Click);
            //
            // tbGridSize
            //
            this.tbGridSize.Location = new System.Drawing.Point(150, 10);
            this.tbGridSize.Name = "tbGridSize";
            this.tbGridSize.Size = new System.Drawing.Size(100, 25);
            this.tbGridSize.TabIndex = 1;
            this.tbGridSize.Text = "2.5";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(15, 10);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(66, 19);
            this.label1.TabIndex = 2;
            this.label1.Text = "宽度 (cm)";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(15, 45);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(66, 19);
            this.label2.TabIndex = 2;
            this.label2.Text = "高度 (cm)";
            //
            // tbHeight
            //
            this.tbHeight.Location = new System.Drawing.Point(95, 45);
            this.tbHeight.Name = "tbHeight";
            this.tbHeight.Size = new System.Drawing.Size(100, 25);
            this.tbHeight.TabIndex = 0;
            this.tbHeight.Text = "12.7";
            //
            // FormMain
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 19F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 361);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.tabControl1);
            this.Controls.Add(this.tbHeight);
            this.Controls.Add(this.tbWidth);
            this.Font = new System.Drawing.Font("微软雅黑", 9.75F);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.MaximizeBox = false;
            this.Name = "FormMain";
            this.Text = "打印机辅助工具";
            this.tabControl1.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.tabPage1.PerformLayout();
            this.tabPage2.ResumeLayout(false);
            this.tabPage2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox tbWidth;
        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage tabPage1;
        private System.Windows.Forms.TabPage tabPage2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox tbHeight;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox tbScaleSize;
        private System.Windows.Forms.CheckBox cbScaleHalf;
        private System.Windows.Forms.TextBox tbScaleLength;
        private System.Windows.Forms.Button bScalePrint;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Button bGridPrint;
        private System.Windows.Forms.CheckBox cbScaleHeight;
        private System.Windows.Forms.CheckBox cbScaleWidth;
        private System.Windows.Forms.CheckBox cbScaleNumber;
        private System.Windows.Forms.TextBox tbGridSize;
    }
}


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

<title>A-Index</title>
<meta name="date" content="2015-03-12">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E G H I L M N O P R S T V W

A

action_settings - Static variable in class com.google.sprint1.R.id

action_settings - Static variable in class com.google.sprint1.R.string

actionButton - Static variable in class com.google.sprint1.R.id

actionButton - Static variable in class com.metaio.R.id

activity_game - Static variable in class com.google.sprint1.R.layout

activity_horizontal_margin - Static variable in class com.google.sprint1.R.dimen

Default screen margins, per the Android Design guidelines.

activity_main - Static variable in class com.google.sprint1.R.layout

activity_network - Static variable in class com.google.sprint1.R.layout

activity_settings - Static variable in class com.google.sprint1.R.layout

activity_vertical_margin - Static variable in class com.google.sprint1.R.dimen

app_name - Static variable in class com.google.sprint1.R.string

AppBaseTheme - Static variable in class com.google.sprint1.R.style

Base application theme, dependent on API level.

AppTheme - Static variable in class com.google.sprint1.R.style

Application theme.

audioButton - Static variable in class com.google.sprint1.R.id

audioButton - Static variable in class com.metaio.R.id

A B C D E G H I L M N O P R S T V W

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
import RootDecorationSprite from './RootDecorationSprite'

export default class extends RootDecorationSprite {
  constructor ({ game, world, x, y }) {
    const height = Math.random() * 300
    const width = Math.random() * 100
    super({
      game,
      world,
      x,
      y: y - height,
      asset: 'seaweed',
      width: width,
      height
    })
  }

  update () {
  }
}


text:
/**
 * @file mali_kbase_pm_demand.c
 * A simple demand based power management policy
 */

#include <osk/mali_osk.h>
#include <kbase/src/common/mali_kbase.h>
#include <kbase/src/common/mali_kbase_pm.h>

/* Forward declaration for state change function, as it is required by
 * the power up and down functions */
static void demand_state_changed(kbase_device *kbdev);

/** Turns the cores on.
 *
 * This function turns all the cores of the GPU on.
 */
static void demand_power_up(kbase_device *kbdev)
{
	/* Inform the system that the transition has started */
	kbase_pm_power_transitioning(kbdev);

	/* Turn clocks and interrupts on */
	kbase_pm_clock_on(kbdev);

	kbase_pm_check_transitions(kbdev);

	kbdev->pm.policy_data.demand.state = KBASEP_PM_DEMAND_STATE_POWERING_UP;
}

/** Turn the cores off.
 *
 * This function turns all the cores of the GPU off.
 */
static void demand_power_down(kbase_device *kbdev)
{
	u64 cores;

	/* Inform the system that the transition has started */
	kbase_pm_power_transitioning(kbdev);

	/* Turn the cores off */
	cores = kbase_pm_get_present_cores(kbdev, KBASE_PM_CORE_SHADER);
	kbase_pm_invoke_power_down(kbdev, KBASE_PM_CORE_SHADER, cores);

	cores = kbase_pm_get_present_cores(kbdev, KBASE_PM_CORE_TILER);
	kbase_pm_invoke_power_down(kbdev, KBASE_PM_CORE_TILER, cores);

	kbdev->pm.policy_data.demand.state = KBASEP_PM_DEMAND_STATE_POWERING_DOWN;

	kbase_pm_check_transitions(kbdev);
}

/** Turn some cores on/off.
 *
 * This function turns on/off the cores needed by the scheduler.
 */
static void demand_change_gpu_state(kbase_device *kbdev)
{
	/* Update the bitmap of the cores we need */
	u64 new_shader_desired = kbdev->shader_needed_bitmap | kbdev->shader_inuse_bitmap;
	u64 new_tiler_desired = kbdev->tiler_needed_bitmap | kbdev->tiler_inuse_bitmap;

	if ( kbdev->pm.desired_shader_state != new_shader_desired )
	{
		KBASE_TRACE_ADD( kbdev, PM_CORES_CHANGE_DESIRED, NULL, NULL, 0u, (u32)new_shader_desired );
	}

	kbdev->pm.desired_shader_state = new_shader_desired;
	kbdev->pm.desired_tiler_state = new_tiler_desired;

	kbase_pm_check_transitions(kbdev);
}

/** Function to handle a GPU state change for the demand power policy
 *
 * This function is called whenever the GPU has transitioned to another state. It first checks that the transition is
 * complete and then moves the state machine to the next state.
 */
static void demand_state_changed(kbase_device *kbdev)
{
	kbasep_pm_policy_demand *data = &kbdev->pm.policy_data.demand;

	if (kbase_pm_get_pwr_active(kbdev)) {
		/* Cores are still transitioning - ignore the event */
		return;
	}

	switch(data->state)
	{
		case KBASEP_PM_DEMAND_STATE_CHANGING_POLICY:
			/* Signal power events before switching the policy */
			kbase_pm_power_up_done(kbdev);
			kbase_pm_power_down_done(kbdev);
			kbase_pm_change_policy(kbdev);
			break;
		case KBASEP_PM_DEMAND_STATE_POWERING_UP:
			data->state = KBASEP_PM_DEMAND_STATE_POWERED_UP;
			kbase_pm_power_up_done(kbdev);
			/* State changed, try to run jobs */
			KBASE_TRACE_ADD( kbdev, PM_JOB_SUBMIT_AFTER_POWERING_UP, NULL, NULL, 0u, 0 );
			kbase_js_try_run_jobs(kbdev);
			break;
		case KBASEP_PM_DEMAND_STATE_POWERING_DOWN:
			data->state = KBASEP_PM_DEMAND_STATE_POWERED_DOWN;
			/* Disable interrupts and turn the clock off */
			kbase_pm_clock_off(kbdev);
			kbase_pm_power_down_done(kbdev);
			break;
		case KBASEP_PM_DEMAND_STATE_POWERED_UP:
			/* Core states may have been changed, try to run jobs */
			KBASE_TRACE_ADD( kbdev, PM_JOB_SUBMIT_AFTER_POWERED_UP, NULL, NULL, 0u, 0 );
			kbase_js_try_run_jobs(kbdev);
			break;
		default:
			break;
	}
}

/** The event callback function for the demand power policy.
 *
 * This function is called to handle the events for the power policy. It calls the relevant handler function depending
 * on the type of the event.
 *
 * @param kbdev     The kbase device structure for the device
 * @param event     The event that should be processed
 */
static void demand_event(kbase_device *kbdev, kbase_pm_event event)
{
	kbasep_pm_policy_demand *data = &kbdev->pm.policy_data.demand;

	switch(event)
	{
		case KBASE_PM_EVENT_POLICY_INIT:
			demand_power_up(kbdev);
			break;
		case KBASE_PM_EVENT_POLICY_CHANGE:
			if (data->state == KBASEP_PM_DEMAND_STATE_POWERED_UP ||
			    data->state == KBASEP_PM_DEMAND_STATE_POWERED_DOWN)
			{
				kbase_pm_change_policy(kbdev);
			}
			else
			{
				data->state = KBASEP_PM_DEMAND_STATE_CHANGING_POLICY;
			}
			break;
		case KBASE_PM_EVENT_SYSTEM_RESUME:
		case KBASE_PM_EVENT_GPU_ACTIVE:
			switch (data->state)
			{
				case KBASEP_PM_DEMAND_STATE_POWERING_UP:
					break;
				case KBASEP_PM_DEMAND_STATE_POWERED_UP:
					kbase_pm_power_up_done(kbdev);
					break;
				default:
					demand_power_up(kbdev);
			}
			break;
		case KBASE_PM_EVENT_SYSTEM_SUSPEND:
		case KBASE_PM_EVENT_GPU_IDLE:
			switch (data->state)
			{
				case KBASEP_PM_DEMAND_STATE_POWERING_DOWN:
					break;
				case KBASEP_PM_DEMAND_STATE_POWERED_DOWN:
					kbase_pm_power_down_done(kbdev);
					break;
				default:
					demand_power_down(kbdev);
			}
			break;
		case KBASE_PM_EVENT_CHANGE_GPU_STATE:
			if (data->state != KBASEP_PM_DEMAND_STATE_POWERED_DOWN &&
			    data->state != KBASEP_PM_DEMAND_STATE_POWERING_DOWN)
			{
				demand_change_gpu_state(kbdev);
			}
			break;
		case KBASE_PM_EVENT_GPU_STATE_CHANGED:
			demand_state_changed(kbdev);
			break;
		default:
			/* unrecognized event, should never happen */
			OSK_ASSERT(0);
	}
}

/** Initialize the demand power policy.
 *
 * This sets up the private @ref kbase_pm_device_data.policy_data field of the device for use with the demand power
 * policy.
 *
 * @param kbdev     The kbase device structure for the device
 */
static void demand_init(kbase_device *kbdev)
{
	kbdev->pm.policy_data.demand.state = KBASEP_PM_DEMAND_STATE_POWERED_UP;
}

/** Terminate the demand power policy.
 *
 * This frees the resources that were allocated by @ref demand_init.
 *
 * @param kbdev     The kbase device structure for the device
 */
static void demand_term(kbase_device *kbdev)
{
	CSTD_UNUSED(kbdev);
}

/** The @ref kbase_pm_policy structure for the demand power policy.
 *
 * This is the static structure that defines the demand power policy's callback and name.
 */
const kbase_pm_policy kbase_pm_demand_policy_ops =
{
	"demand",                   /* name */
	demand_init,                /* init */
	demand_term,                /* term */
	demand_event,               /* event */
	0u,                         /* flags */
	KBASE_PM_POLICY_ID_DEMAND,  /* id */
};

KBASE_EXPORT_TEST_API(kbase_pm_demand_policy_ops)


text:
var assert = require('assert');

var checkval = require('../src/checkval');

describe('Validate array', function() {

	it('Throwing errors', function() {

		var value, isValid;

		value = 0;
		isValid = true;
		try {
			checkval().add(value, 'field').array().throw(); // invalid
		} catch (err) {
			console.log(err)
			isValid = false;
		}
		assert(!isValid);

		value = undefined;
		isValid = true;
		try {
			checkval().add(value, 'field').array().throw(); // invalid
		} catch (err) {
			isValid = false;
		}
		assert(!isValid);

		value = [];
		isValid = true;
		try {
			checkval().add(value, 'field').array().throw(); // invalid
		} catch (err) {
			isValid = false;
		}
		assert(isValid);

		value = ['one', 'two'];
		isValid = true;
		try {
			checkval().add(value, 'field').array().throw(); // invalid
		} catch (err) {
			console.log(err)
			isValid = false;
		}
		assert(isValid);

	});

});


text:
#pragma once
#include <aws/lexv2-models/LexModelsV2_EXPORTS.h>
#include <aws/lexv2-models/model/SlotDefaultValueSpecification.h>
#include <aws/lexv2-models/model/PromptSpecification.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/lexv2-models/model/WaitAndContinueSpecification.h>
#include <aws/lexv2-models/model/SampleUtterance.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace LexModelsV2
{
namespace Model
{

  /**
   *
Subslot elicitation settings.

 DefaultValueSpecification
   * is a list of default values for a constituent sub slot in a composite slot.
   * Default values are used when Amazon Lex hasn't determined a value for a slot.
   * You can specify default values from context variables, session attributes, and
   * defined values. This is similar to DefaultValueSpecification for
   * slots.

 PromptSpecification is the prompt that Amazon Lex
   * uses to elicit the sub slot value from the user. This is similar to
   * PromptSpecification for slots.

See Also:
   AWS
   * API Reference

   */
  class AWS_LEXMODELSV2_API SubSlotValueElicitationSetting
  {
  public:
    SubSlotValueElicitationSetting();
    SubSlotValueElicitationSetting(Aws::Utils::Json::JsonView jsonValue);
    SubSlotValueElicitationSetting& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    inline const SlotDefaultValueSpecification& GetDefaultValueSpecification() const{ return m_defaultValueSpecification; }

    inline bool DefaultValueSpecificationHasBeenSet() const { return m_defaultValueSpecificationHasBeenSet; }

    inline void SetDefaultValueSpecification(const SlotDefaultValueSpecification& value) { m_defaultValueSpecificationHasBeenSet = true; m_defaultValueSpecification = value; }

    inline void SetDefaultValueSpecification(SlotDefaultValueSpecification&& value) { m_defaultValueSpecificationHasBeenSet = true; m_defaultValueSpecification = std::move(value); }

    inline SubSlotValueElicitationSetting& WithDefaultValueSpecification(const SlotDefaultValueSpecification& value) { SetDefaultValueSpecification(value); return *this;}

    inline SubSlotValueElicitationSetting& WithDefaultValueSpecification(SlotDefaultValueSpecification&& value) { SetDefaultValueSpecification(std::move(value)); return *this;}

    inline const PromptSpecification& GetPromptSpecification() const{ return m_promptSpecification; }

    inline bool PromptSpecificationHasBeenSet() const { return m_promptSpecificationHasBeenSet; }

    inline void SetPromptSpecification(const PromptSpecification& value) { m_promptSpecificationHasBeenSet = true; m_promptSpecification = value; }

    inline void SetPromptSpecification(PromptSpecification&& value) { m_promptSpecificationHasBeenSet = true; m_promptSpecification = std::move(value); }

    inline SubSlotValueElicitationSetting& WithPromptSpecification(const PromptSpecification& value) { SetPromptSpecification(value); return *this;}

    inline SubSlotValueElicitationSetting& WithPromptSpecification(PromptSpecification&& value) { SetPromptSpecification(std::move(value)); return *this;}

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline const Aws::Vector<SampleUtterance>& GetSampleUtterances() const{ return m_sampleUtterances; }

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline bool SampleUtterancesHasBeenSet() const { return m_sampleUtterancesHasBeenSet; }

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline void SetSampleUtterances(const Aws::Vector<SampleUtterance>& value) { m_sampleUtterancesHasBeenSet = true; m_sampleUtterances = value; }

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline void SetSampleUtterances(Aws::Vector<SampleUtterance>&& value) { m_sampleUtterancesHasBeenSet = true; m_sampleUtterances = std::move(value); }

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline SubSlotValueElicitationSetting& WithSampleUtterances(const Aws::Vector<SampleUtterance>& value) { SetSampleUtterances(value); return *this;}

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline SubSlotValueElicitationSetting& WithSampleUtterances(Aws::Vector<SampleUtterance>&& value) { SetSampleUtterances(std::move(value)); return *this;}

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline SubSlotValueElicitationSetting& AddSampleUtterances(const SampleUtterance& value) { m_sampleUtterancesHasBeenSet = true; m_sampleUtterances.push_back(value); return *this; }

    /**
     *
If you know a specific pattern that users might respond to an Amazon Lex
     * request for a sub slot value, you can provide those utterances to improve
     * accuracy. This is optional. In most cases Amazon Lex is capable of understanding
     * user utterances. This is similar to SampleUtterances for slots.

     */
    inline SubSlotValueElicitationSetting& AddSampleUtterances(SampleUtterance&& value) { m_sampleUtterancesHasBeenSet = true; m_sampleUtterances.push_back(std::move(value)); return *this; }

    inline const WaitAndContinueSpecification& GetWaitAndContinueSpecification() const{ return m_waitAndContinueSpecification; }

    inline bool WaitAndContinueSpecificationHasBeenSet() const { return m_waitAndContinueSpecificationHasBeenSet; }

    inline void SetWaitAndContinueSpecification(const WaitAndContinueSpecification& value) { m_waitAndContinueSpecificationHasBeenSet = true; m_waitAndContinueSpecification = value; }

    inline void SetWaitAndContinueSpecification(WaitAndContinueSpecification&& value) { m_waitAndContinueSpecificationHasBeenSet = true; m_waitAndContinueSpecification = std::move(value); }

    inline SubSlotValueElicitationSetting& WithWaitAndContinueSpecification(const WaitAndContinueSpecification& value) { SetWaitAndContinueSpecification(value); return *this;}

    inline SubSlotValueElicitationSetting& WithWaitAndContinueSpecification(WaitAndContinueSpecification&& value) { SetWaitAndContinueSpecification(std::move(value)); return *this;}

  private:

    SlotDefaultValueSpecification m_defaultValueSpecification;
    bool m_defaultValueSpecificationHasBeenSet = false;

    PromptSpecification m_promptSpecification;
    bool m_promptSpecificationHasBeenSet = false;

    Aws::Vector<SampleUtterance> m_sampleUtterances;
    bool m_sampleUtterancesHasBeenSet = false;

    WaitAndContinueSpecification m_waitAndContinueSpecification;
    bool m_waitAndContinueSpecificationHasBeenSet = false;
  };

} // namespace Model
} // namespace LexModelsV2
} // namespace Aws


text:
package org.slf4j.jul;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.LogRecord;

public class ListHandler extends java.util.logging.Handler {

    public List<LogRecord> recordList = new ArrayList<>();

    @Override
    public void publish(LogRecord record) {
        recordList.add(record);
    }

    @Override
    public void flush() {
    }

    @Override
    public void close() throws SecurityException {
    }
}


text:
layout: post
title: Leetcode Problem 162 Summary
date: 2016-08-27
categories: blog
tags: [study]

---

# 题目

A peak element is an element that is greater than its neighbors.

Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.

The array may contain multiple peaks, in that case return the index to any one of the peaks is fine.

You may imagine that num[-1] = num[n] = -∞.

For example, in array [1, 2, 3, 1], 3 is a peak element and your function should return the index number 2.

Note:
Your solution should be in logarithmic complexity.

# 我的算法

一个比较重要的条件是 index 为 -1 和 n 的值为负无穷,利用这个条件,我们使用二分查找,对于 mid 的值如果大于 mid + 1 的值,那么证明在 0 到 mid 间至少有一个 peak。反之小于就是在 mid + 1 到 end 间有一个 peak。

# 代码

{% highlight java %}
public class Solution {
    public int findPeakElement(int[] nums) {
        return helper(nums, 0, nums.length - 1);
    }

    private int helper(int[] nums, int start, int end) {
        if (start == end) return start;

        int mid = start + (end - start) / 2;
        int midNext = mid + 1;
        if (nums[mid] > nums[midNext]) return helper(nums, start, mid);
        else return helper(nums, midNext, end);
    }
}
{% endhighlight %}


text:
package com.thoughtworks.selenium.corebased;

import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;

public class TestErrorChecking extends SeleneseTestNgHelper {
	@Test public void testErrorChecking() throws Exception {
		selenium.open("../tests/html/test_click_page1.html");
		//  These tests should all fail, as they are checking the error checking commands.
		try { assertEquals(selenium.getText("link"), "Click here for next page"); fail("expected failure"); } catch (Throwable e) {}
		try { System.out.println("foo"); fail("expected failure"); } catch (Throwable e) {}
		try { assertEquals(selenium.getText("link"), "foo"); fail("expected failure"); } catch (Throwable e) {}
		try { assertEquals(selenium.getText("link"), "Click here for next page"); fail("expected failure"); } catch (Throwable e) {}
		try { assertEquals(selenium.getText("link"), "foo"); fail("expected failure"); } catch (Throwable e) {}
		try { assertEquals(selenium.getText("notAlink"), "foo"); fail("expected failure"); } catch (Throwable e) {}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 Mkhytar Mkhoian
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  -->

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/menu_delete"
        android:title="@string/action_delete"
        android:icon="@drawable/ic_delete_white"
        app:showAsAction="ifRoom" />

    <item
        android:id="@+id/action_mode_menu"
        android:title="@null"
        android:icon="@drawable/ic_menu_white"
        app:showAsAction="always">
        <menu>
            <item
                android:id="@+id/menu_check_all"
                android:title="@string/action_check_all" />
            <item
                android:id="@+id/menu_uncheck_all"
                android:title="@string/action_uncheck_all" />
        </menu>
    </item>
</menu>


text:
package container

import (
	"context"
	"strings"

	packages_model "code.gitea.io/gitea/models/packages"
	user_model "code.gitea.io/gitea/models/user"
	container_module "code.gitea.io/gitea/modules/packages/container"
)

// UpdateRepositoryNames updates the repository name property for all packages of the specific owner
func UpdateRepositoryNames(ctx context.Context, owner *user_model.User, newOwnerName string) error {
	ps, err := packages_model.GetPackagesByType(ctx, owner.ID, packages_model.TypeContainer)
	if err != nil {
		return err
	}

	newOwnerName = strings.ToLower(newOwnerName)

	for _, p := range ps {
		if err := packages_model.DeletePropertyByName(ctx, packages_model.PropertyTypePackage, p.ID, container_module.PropertyRepository); err != nil {
			return err
		}

		if _, err := packages_model.InsertProperty(ctx, packages_model.PropertyTypePackage, p.ID, container_module.PropertyRepository, newOwnerName+"/"+p.LowerName); err != nil {
			return err
		}
	}

	return nil
}


text:
package org.apache.jena.assembler.exceptions;

import org.apache.jena.rdf.model.Resource ;

/**
    Exception used to report a failure to load a class.
*/
public class CannotLoadClassException extends AssemblerException
    {
    protected final String className;

    public CannotLoadClassException( Resource root, String className, ClassNotFoundException e )
        {
        super( root, makeMessage( root, className ), e );
        this.className = className;
        }

    private static String makeMessage( Resource root, String className )
        {
        return
            "the class '" + className
            + "' required by the object " + nice( root )
            + " could not be loaded"
            ;
        }

    /**
         Answer the name of the class that was not loaded.
    */
    public String getClassName()
        { return className; }
    }


text:
#pragma once
#include <aws/privatenetworks/PrivateNetworks_EXPORTS.h>
#include <aws/privatenetworks/model/Order.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace PrivateNetworks
{
namespace Model
{
  class AWS_PRIVATENETWORKS_API GetOrderResult
  {
  public:
    GetOrderResult();
    GetOrderResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetOrderResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
Information about the order.

     */
    inline const Order& GetOrder() const{ return m_order; }

    /**
     *
Information about the order.

     */
    inline void SetOrder(const Order& value) { m_order = value; }

    /**
     *
Information about the order.

     */
    inline void SetOrder(Order&& value) { m_order = std::move(value); }

    /**
     *
Information about the order.

     */
    inline GetOrderResult& WithOrder(const Order& value) { SetOrder(value); return *this;}

    /**
     *
Information about the order.

     */
    inline GetOrderResult& WithOrder(Order&& value) { SetOrder(std::move(value)); return *this;}

    /**
     *
 The order tags.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }

    /**
     *
 The order tags.

     */
    inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tags = value; }

    /**
     *
 The order tags.

     */
    inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tags = std::move(value); }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}

    /**
     *
 The order tags.

     */
    inline GetOrderResult& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(const Aws::String& key, const Aws::String& value) { m_tags.emplace(key, value); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(Aws::String&& key, const Aws::String& value) { m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(const Aws::String& key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(Aws::String&& key, Aws::String&& value) { m_tags.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(const char* key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(Aws::String&& key, const char* value) { m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
 The order tags.

     */
    inline GetOrderResult& AddTags(const char* key, const char* value) { m_tags.emplace(key, value); return *this; }

  private:

    Order m_order;

    Aws::Map<Aws::String, Aws::String> m_tags;
  };

} // namespace Model
} // namespace PrivateNetworks
} // namespace Aws


text:
layout: post
microblog: true
date: 2013-03-20 00:26 +0300
guid: http://desparoz.micro.blog/2013/03/19/t314125662598356992.html
---
Still wish @TurnbullMalcolm would lead one of the parties. Either one.

RT @paulkidd: Who will be Labor leader when we go to bed tonight?


text:
class MainFrame : public wxFrame {

public:
    MainFrame(const wxString& url);

    ~MainFrame();

    wxWebViewWebKit* GetWebView() { return browser; }

    void OnShowWebInspector(wxShowEvent& event);
    void OnCloseWebInspector(wxCloseEvent& event);

private:

    wxSplitterWindow* splitter;
    wxPanel* browserPanel;
    wxWebViewWebKit* browser;
    WebInspector* inspector;
};

#endif // #ifndef WEBVIEW_WEBFRAME_H_


text:
ECE 345 Project - Web app.

This is Where we can do all of our developement and stay up-to-date with this project. It will make it easier to hand off as well at the end of the year.

Make sure to review how to use Git <- it is a super tool.> I would like to use git hub, because there are a lot of really awesome tools that we can use. to make this project easier.

Lets use an agile method to create this project. and do a good job at it. I think that this can help all of us.


text:
package com.mgireesh;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Stack;

public class Solution {
	public List<List<Integer>> levelOrderBottom(TreeNode root) {
		if (root == null) {
			return new LinkedList<List<Integer>>();
		}

		List<List<Integer>> list = new LinkedList<List<Integer>>();
		List<Integer> level = new LinkedList<Integer>();
		Queue<TreeNode> curQ = new LinkedList<TreeNode>();
		Queue<TreeNode> nextQ = new LinkedList<TreeNode>();
		Stack<List<Integer>> stack = new Stack<List<Integer>>();
		curQ.add(root);
		while (!curQ.isEmpty()) {
			TreeNode node = curQ.remove();
			if (node.left != null) {
				nextQ.add(node.left);
			}
			if (node.right != null) {
				nextQ.add(node.right);
			}

			level.add(node.val);
			if (curQ.isEmpty()) {
				curQ = nextQ;
				nextQ = new LinkedList<TreeNode>();
				stack.push(level);
				level = new LinkedList<Integer>();
			}
		}

		while (!stack.isEmpty()) {
			list.add(stack.pop());
		}

		return list;
	}
}


text:
'use strict';

const User = require('../../model/user.js');
const Answer = require('../../model/answer.js');
const Question = require('../../model/question.js');
const mongoose = require('mongoose');

mongoose.Promise = Promise;

module.exports = exports = {};

exports.killAllDataBase = function(done) {
  Promise.all([
    User.remove({}),
    Question.remove({}),
    Answer.remove({})
  ])
  .then( ()=> done())
  .catch(done);
};


text:
module.exports = {
    "plugins": [
        "@babel/plugin-transform-modules-commonjs",
        "@babel/plugin-transform-react-jsx"
    ]
};


text:
<!DOCTYPE HTML>

<title>Uses of Interface com.restfb.exception.generator.FacebookExceptionGenerator (RestFB 2022.9.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2022-09-27">
<meta name="description" content="use: package: com.restfb.exception.generator, interface: FacebookExceptionGenerator">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">

JavaScript is disabled on your browser.

<button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"></button>

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">

Uses of Interface
com.restfb.exception.generator.FacebookExceptionGenerator

Packages that use FacebookExceptionGenerator

Package

Description

com.restfb

Contains types used to interact with the Facebook
 Graph API.

com.restfb.exception.generator

Uses of FacebookExceptionGenerator in com.restfb

Methods in com.restfb that return FacebookExceptionGenerator

Modifier and Type

Method

Description

FacebookExceptionGenerator

DefaultFacebookClient.getFacebookExceptionGenerator()

fetch the current facebook exception generator implementing the FacebookExceptionGenerator interface

Methods in com.restfb with parameters of type FacebookExceptionGenerator

Modifier and Type

Method

Description

void

DefaultFacebookClient.setFacebookExceptionGenerator<wbr>(FacebookExceptionGenerator exceptionGenerator)

override the default facebook exception generator to provide a custom handling for the facebook error objects

Uses of FacebookExceptionGenerator in com.restfb.exception.generator

Classes in com.restfb.exception.generator that implement FacebookExceptionGenerator

Modifier and Type

Class

Description

class

DefaultFacebookExceptionGenerator

RestFB 2022.9.0. Copyright © 2010-2021 Mark Allen, Norbert Bartels. All Rights Reserved.


text:
package io.netty.handler.codec.http;

import java.util.HashMap;
import java.util.Map;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.handler.codec.compression.Brotli;
import io.netty.handler.codec.compression.BrotliEncoder;
import io.netty.handler.codec.compression.BrotliOptions;
import io.netty.handler.codec.compression.CompressionOptions;
import io.netty.handler.codec.compression.DeflateOptions;
import io.netty.handler.codec.compression.GzipOptions;
import io.netty.handler.codec.compression.StandardCompressionOptions;
import io.netty.handler.codec.compression.ZlibCodecFactory;
import io.netty.handler.codec.compression.ZlibEncoder;
import io.netty.handler.codec.compression.ZlibWrapper;
import io.netty.handler.codec.compression.Zstd;
import io.netty.handler.codec.compression.ZstdEncoder;
import io.netty.handler.codec.compression.ZstdOptions;
import io.netty.util.internal.ObjectUtil;

/**
 * Compresses an {@link HttpMessage} and an {@link HttpContent} in {@code gzip} or
 * {@code deflate} encoding while respecting the {@code "Accept-Encoding"} header.
 * If there is no matching encoding, no compression is done.  For more
 * information on how this handler modifies the message, please refer to
 * {@link HttpContentEncoder}.
 */
public class HttpContentCompressor extends HttpContentEncoder {

    private final boolean supportsCompressionOptions;
    private final BrotliOptions brotliOptions;
    private final GzipOptions gzipOptions;
    private final DeflateOptions deflateOptions;
    private final ZstdOptions zstdOptions;

    private final int compressionLevel;
    private final int windowBits;
    private final int memLevel;
    private final int contentSizeThreshold;
    private ChannelHandlerContext ctx;
    private final Map<String, CompressionEncoderFactory> factories;

    /**
     * Creates a new handler with the default compression level (<tt>6</tt>),
     * default window size (<tt>15</tt>) and default memory level (<tt>8</tt>).
     */
    public HttpContentCompressor() {
        this(6);
    }

    /**
     * Creates a new handler with the specified compression level, default
     * window size (<tt>15</tt>) and default memory level (<tt>8</tt>).
     *
     * @param compressionLevel
     *        {@code 1} yields the fastest compression and {@code 9} yields the
     *        best compression.  {@code 0} means no compression.  The default
     *        compression level is {@code 6}.
     */
    @Deprecated
    public HttpContentCompressor(int compressionLevel) {
        this(compressionLevel, 15, 8, 0);
    }

    /**
     * Creates a new handler with the specified compression level, window size,
     * and memory level..
     *
     * @param compressionLevel
     *        {@code 1} yields the fastest compression and {@code 9} yields the
     *        best compression.  {@code 0} means no compression.  The default
     *        compression level is {@code 6}.
     * @param windowBits
     *        The base two logarithm of the size of the history buffer.  The
     *        value should be in the range {@code 9} to {@code 15} inclusive.
     *        Larger values result in better compression at the expense of
     *        memory usage.  The default value is {@code 15}.
     * @param memLevel
     *        How much memory should be allocated for the internal compression
     *        state.  {@code 1} uses minimum memory and {@code 9} uses maximum
     *        memory.  Larger values result in better and faster compression
     *        at the expense of memory usage.  The default value is {@code 8}
     */
    @Deprecated
    public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel) {
        this(compressionLevel, windowBits, memLevel, 0);
    }

    /**
     * Creates a new handler with the specified compression level, window size,
     * and memory level..
     *
     * @param compressionLevel
     *        {@code 1} yields the fastest compression and {@code 9} yields the
     *        best compression.  {@code 0} means no compression.  The default
     *        compression level is {@code 6}.
     * @param windowBits
     *        The base two logarithm of the size of the history buffer.  The
     *        value should be in the range {@code 9} to {@code 15} inclusive.
     *        Larger values result in better compression at the expense of
     *        memory usage.  The default value is {@code 15}.
     * @param memLevel
     *        How much memory should be allocated for the internal compression
     *        state.  {@code 1} uses minimum memory and {@code 9} uses maximum
     *        memory.  Larger values result in better and faster compression
     *        at the expense of memory usage.  The default value is {@code 8}
     * @param contentSizeThreshold
     *        The response body is compressed when the size of the response
     *        body exceeds the threshold. The value should be a non negative
     *        number. {@code 0} will enable compression for all responses.
     */
    @Deprecated
    public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel, int contentSizeThreshold) {
        this.compressionLevel = ObjectUtil.checkInRange(compressionLevel, 0, 9, "compressionLevel");
        this.windowBits = ObjectUtil.checkInRange(windowBits, 9, 15, "windowBits");
        this.memLevel = ObjectUtil.checkInRange(memLevel, 1, 9, "memLevel");
        this.contentSizeThreshold = ObjectUtil.checkPositiveOrZero(contentSizeThreshold, "contentSizeThreshold");
        this.brotliOptions = null;
        this.gzipOptions = null;
        this.deflateOptions = null;
        this.zstdOptions = null;
        this.factories = null;
        this.supportsCompressionOptions = false;
    }

    /**
     * Create a new {@link HttpContentCompressor} Instance with specified
     * {@link CompressionOptions}s and contentSizeThreshold set to {@code 0}
     *
     * @param compressionOptions {@link CompressionOptions} or {@code null} if the default
     *        should be used.
     */
    public HttpContentCompressor(CompressionOptions... compressionOptions) {
        this(0, compressionOptions);
    }

    /**
     * Create a new {@link HttpContentCompressor} instance with specified
     * {@link CompressionOptions}s
     *
     * @param contentSizeThreshold
     *        The response body is compressed when the size of the response
     *        body exceeds the threshold. The value should be a non negative
     *        number. {@code 0} will enable compression for all responses.
     * @param compressionOptions {@link CompressionOptions} or {@code null}
     *        if the default should be used.
     */
    public HttpContentCompressor(int contentSizeThreshold, CompressionOptions... compressionOptions) {
        this.contentSizeThreshold = ObjectUtil.checkPositiveOrZero(contentSizeThreshold, "contentSizeThreshold");
        BrotliOptions brotliOptions = null;
        GzipOptions gzipOptions = null;
        DeflateOptions deflateOptions = null;
        ZstdOptions zstdOptions = null;
        if (compressionOptions == null || compressionOptions.length == 0) {
            brotliOptions = Brotli.isAvailable() ? StandardCompressionOptions.brotli() : null;
            gzipOptions = StandardCompressionOptions.gzip();
            deflateOptions = StandardCompressionOptions.deflate();
            zstdOptions = Zstd.isAvailable() ? StandardCompressionOptions.zstd() : null;
        } else {
            ObjectUtil.deepCheckNotNull("compressionOptions", compressionOptions);
            for (CompressionOptions compressionOption : compressionOptions) {
                if (compressionOption instanceof BrotliOptions) {
                    // if we have BrotliOptions, it means Brotli is available
                    brotliOptions = (BrotliOptions) compressionOption;
                } else if (compressionOption instanceof GzipOptions) {
                    gzipOptions = (GzipOptions) compressionOption;
                } else if (compressionOption instanceof DeflateOptions) {
                    deflateOptions = (DeflateOptions) compressionOption;
                } else if (compressionOption instanceof ZstdOptions) {
                    zstdOptions = (ZstdOptions) compressionOption;
                } else {
                    throw new IllegalArgumentException("Unsupported " + CompressionOptions.class.getSimpleName() +
                            ": " + compressionOption);
                }
            }
        }

        this.gzipOptions = gzipOptions;
        this.deflateOptions = deflateOptions;
        this.brotliOptions = brotliOptions;
        this.zstdOptions = zstdOptions;

        this.factories = new HashMap<String, CompressionEncoderFactory>();

        if (this.gzipOptions != null) {
            this.factories.put("gzip", new GzipEncoderFactory());
        }
        if (this.deflateOptions != null) {
            this.factories.put("deflate", new DeflateEncoderFactory());
        }
        if (this.brotliOptions != null) {
            this.factories.put("br", new BrEncoderFactory());
        }
        if (this.zstdOptions != null) {
            this.factories.put("zstd", new ZstdEncoderFactory());
        }

        this.compressionLevel = -1;
        this.windowBits = -1;
        this.memLevel = -1;
        supportsCompressionOptions = true;
    }

    @Override
    public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
        this.ctx = ctx;
    }

    @Override
    protected Result beginEncode(HttpResponse httpResponse, String acceptEncoding) throws Exception {
        if (this.contentSizeThreshold > 0) {
            if (httpResponse instanceof HttpContent &&
                    ((HttpContent) httpResponse).content().readableBytes() < contentSizeThreshold) {
                return null;
            }
        }

        String contentEncoding = httpResponse.headers().get(HttpHeaderNames.CONTENT_ENCODING);
        if (contentEncoding != null) {
            // Content-Encoding was set, either as something specific or as the IDENTITY encoding
            // Therefore, we should NOT encode here
            return null;
        }

        if (supportsCompressionOptions) {
            String targetContentEncoding = determineEncoding(acceptEncoding);
            if (targetContentEncoding == null) {
                return null;
            }

            CompressionEncoderFactory encoderFactory = factories.get(targetContentEncoding);

            if (encoderFactory == null) {
                throw new Error();
            }

            return new Result(targetContentEncoding,
                    new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
                            ctx.channel().config(), encoderFactory.createEncoder()));
        } else {
            ZlibWrapper wrapper = determineWrapper(acceptEncoding);
            if (wrapper == null) {
                return null;
            }

            String targetContentEncoding;
            switch (wrapper) {
                case GZIP:
                    targetContentEncoding = "gzip";
                    break;
                case ZLIB:
                    targetContentEncoding = "deflate";
                    break;
                default:
                    throw new Error();
            }

            return new Result(
                    targetContentEncoding,
                    new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
                            ctx.channel().config(), ZlibCodecFactory.newZlibEncoder(
                            wrapper, compressionLevel, windowBits, memLevel)));
        }
    }

    @SuppressWarnings("FloatingPointEquality")
    protected String determineEncoding(String acceptEncoding) {
        float starQ = -1.0f;
        float brQ = -1.0f;
        float zstdQ = -1.0f;
        float gzipQ = -1.0f;
        float deflateQ = -1.0f;
        for (String encoding : acceptEncoding.split(",")) {
            float q = 1.0f;
            int equalsPos = encoding.indexOf('=');
            if (equalsPos != -1) {
                try {
                    q = Float.parseFloat(encoding.substring(equalsPos + 1));
                } catch (NumberFormatException e) {
                    // Ignore encoding
                    q = 0.0f;
                }
            }
            if (encoding.contains("*")) {
                starQ = q;
            } else if (encoding.contains("br") && q > brQ) {
                brQ = q;
            } else if (encoding.contains("zstd") && q > zstdQ) {
                zstdQ = q;
            } else if (encoding.contains("gzip") && q > gzipQ) {
                gzipQ = q;
            } else if (encoding.contains("deflate") && q > deflateQ) {
                deflateQ = q;
            }
        }
        if (brQ > 0.0f || zstdQ > 0.0f || gzipQ > 0.0f || deflateQ > 0.0f) {
            if (brQ != -1.0f && brQ >= zstdQ && this.brotliOptions != null) {
                return "br";
            } else if (zstdQ != -1.0f && zstdQ >= gzipQ && this.zstdOptions != null) {
                return "zstd";
            } else if (gzipQ != -1.0f && gzipQ >= deflateQ && this.gzipOptions != null) {
                return "gzip";
            } else if (deflateQ != -1.0f && this.deflateOptions != null) {
                return "deflate";
            }
        }
        if (starQ > 0.0f) {
            if (brQ == -1.0f && this.brotliOptions != null) {
                return "br";
            }
            if (zstdQ == -1.0f && this.zstdOptions != null) {
                return "zstd";
            }
            if (gzipQ == -1.0f && this.gzipOptions != null) {
                return "gzip";
            }
            if (deflateQ == -1.0f && this.deflateOptions != null) {
                return "deflate";
            }
        }
        return null;
    }

    @Deprecated
    @SuppressWarnings("FloatingPointEquality")
    protected ZlibWrapper determineWrapper(String acceptEncoding) {
        float starQ = -1.0f;
        float gzipQ = -1.0f;
        float deflateQ = -1.0f;
        for (String encoding : acceptEncoding.split(",")) {
            float q = 1.0f;
            int equalsPos = encoding.indexOf('=');
            if (equalsPos != -1) {
                try {
                    q = Float.parseFloat(encoding.substring(equalsPos + 1));
                } catch (NumberFormatException e) {
                    // Ignore encoding
                    q = 0.0f;
                }
            }
            if (encoding.contains("*")) {
                starQ = q;
            } else if (encoding.contains("gzip") && q > gzipQ) {
                gzipQ = q;
            } else if (encoding.contains("deflate") && q > deflateQ) {
                deflateQ = q;
            }
        }
        if (gzipQ > 0.0f || deflateQ > 0.0f) {
            if (gzipQ >= deflateQ) {
                return ZlibWrapper.GZIP;
            } else {
                return ZlibWrapper.ZLIB;
            }
        }
        if (starQ > 0.0f) {
            if (gzipQ == -1.0f) {
                return ZlibWrapper.GZIP;
            }
            if (deflateQ == -1.0f) {
                return ZlibWrapper.ZLIB;
            }
        }
        return null;
    }

    /**
     * Compression Encoder Factory that creates {@link ZlibEncoder}s
     * used to compress http content for gzip content encoding
     */
    private final class GzipEncoderFactory implements CompressionEncoderFactory {

        @Override
        public MessageToByteEncoder<ByteBuf> createEncoder() {
            return ZlibCodecFactory.newZlibEncoder(
                    ZlibWrapper.GZIP, gzipOptions.compressionLevel(),
                    gzipOptions.windowBits(), gzipOptions.memLevel());
        }
    }

    /**
     * Compression Encoder Factory that creates {@link ZlibEncoder}s
     * used to compress http content for deflate content encoding
     */
    private final class DeflateEncoderFactory implements CompressionEncoderFactory {

        @Override
        public MessageToByteEncoder<ByteBuf> createEncoder() {
            return ZlibCodecFactory.newZlibEncoder(
                    ZlibWrapper.ZLIB, deflateOptions.compressionLevel(),
                    deflateOptions.windowBits(), deflateOptions.memLevel());
        }
    }

    /**
     * Compression Encoder Factory that creates {@link BrotliEncoder}s
     * used to compress http content for br content encoding
     */
    private final class BrEncoderFactory implements CompressionEncoderFactory {

        @Override
        public MessageToByteEncoder<ByteBuf> createEncoder() {
            return new BrotliEncoder(brotliOptions.parameters());
        }
    }

    /**
     * Compression Encoder Factory for create {@link ZstdEncoder}
     * used to compress http content for zstd content encoding
     */
    private final class ZstdEncoderFactory implements CompressionEncoderFactory {

        @Override
        public MessageToByteEncoder<ByteBuf> createEncoder() {
            return new ZstdEncoder(zstdOptions.compressionLevel(),
                    zstdOptions.blockSize(), zstdOptions.maxEncodeSize());
        }
    }
}


text:
package sg.togoparts;

import java.util.HashMap;
import java.util.Map;

import sg.togoparts.app.Const;
import sg.togoparts.app.MyVolley;
import sg.togoparts.json.GsonRequest;
import sg.togoparts.json.ResultLogin;
import sg.togoparts.login.ChooseLogin;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;

import com.android.volley.AuthFailureError;
import com.android.volley.Request.Method;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.sromku.simple.fb.SimpleFacebook;
import com.sromku.simple.fb.listeners.OnLogoutListener;

public class MoreActivity extends Activity_Main {
	TextView mTvSearchAds;
	TextView mTvSearchShop;
	TextView mTvAbout;
	TextView mTvShortlist;
	TextView mTvLoginOrLogout;
	protected SimpleFacebook mSimpleFacebook;
	ProgressDialog mProgressDialog;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.more_activity);
		mSimpleFacebook = SimpleFacebook.getInstance(this);
		createHeader();
		mTvSearchAds = (TextView) findViewById(R.id.tvAdsSearch);
		mTvSearchShop = (TextView) findViewById(R.id.tvShopSearch);
		mTvAbout = (TextView) findViewById(R.id.tvAbout);
		mTvShortlist = (TextView) findViewById(R.id.tvShortlistedAds);
		mTvLoginOrLogout = (TextView) findViewById(R.id.tvLoginOrLogout);

		mTvSearchAds.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(MoreActivity.this,
						SearchActivity.class));
			}
		});

		mTvSearchShop.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// Bundle b = new Bundle();
				// b.putString(FilterBikeShop.AREA, "");
				// b.putString(FilterBikeShop.BIKESHOP_NAME, "");
				// b.putString(FilterBikeShop.SORT_BY, "2");
				// b.putBoolean(FilterBikeShop.MECHANIC, true);
				// b.putBoolean(FilterBikeShop.OPENNOW, true);
				Intent i = new Intent(MoreActivity.this, FilterBikeShop.class);
				// i.putExtras(b);
				startActivity(i);
			}
		});
		mTvAbout.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(MoreActivity.this, AboutActivity.class));
			}
		});

		mTvShortlist.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				Intent i = new Intent(MoreActivity.this,
						FSActivity_ShortList.class);
				startActivity(i);
			}
		});

		mProgressDialog = new ProgressDialog(this);
		mTvLoginOrLogout.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				if (Const.isLogin(MoreActivity.this)) {
					AlertDialog.Builder builder = new Builder(MoreActivity.this);
					builder.setMessage(R.string.msg_confirm_logout)
							.setPositiveButton(android.R.string.yes,
									new DialogInterface.OnClickListener() {

										@Override
										public void onClick(
												DialogInterface dialog,
												int which) {
											logout();
											mProgressDialog.show();
											dialog.dismiss();
										}
									})
							.setNegativeButton(android.R.string.no,
									new DialogInterface.OnClickListener() {

										@Override
										public void onClick(
												DialogInterface dialog,
												int which) {
											// TODO Auto-generated method stub
											dialog.dismiss();
										}
									});
					builder.show();

				} else {
					Intent i = new Intent(MoreActivity.this, ChooseLogin.class);
					i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

					startActivity(i);
					finish();
				}

			}
		});
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		mSimpleFacebook = SimpleFacebook.getInstance(this);
		if (Const.isLogin(this)) {
			mTvLoginOrLogout.setText(R.string.label_logout);
			mTvLoginOrLogout.setCompoundDrawablesWithIntrinsicBounds(
					R.drawable.logout_icon, 0, 0, 0);
		} else {
			mTvLoginOrLogout.setText(R.string.label_login);
			mTvLoginOrLogout.setCompoundDrawablesWithIntrinsicBounds(
					R.drawable.login_icon, 0, 0, 0);
		}
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		mSimpleFacebook.onActivityResult(this, requestCode, resultCode, data);
	}

	protected void logout() {
		RequestQueue queue = MyVolley.getRequestQueue();

		GsonRequest<ResultLogin> myReq = new GsonRequest<ResultLogin>(
				Method.POST, Const.URL_LOGOUT, ResultLogin.class,
				createMyReqSuccessListener(), createMyReqErrorListener()) {

			protected Map<String, String> getParams() throws AuthFailureError {
				Map<String, String> params = new HashMap<String, String>();
				String key = Const.getRefreshId(MoreActivity.this)
						+ ChooseLogin.CLIENT_ID;
				key = Const.getSHA256EncryptedString(key);
				params.put("session_id", Const.getSessionId(MoreActivity.this));
				params.put("refresh_id", key);
				return params;
			};
		};
		queue.add(myReq);

		// logout listener

	}

	OnLogoutListener onLogoutListener = new OnLogoutListener() {
		@Override
		public void onLogout() {
			Log.i("haipn", "Facebook You are logged out");
			mTvLoginOrLogout.setText(R.string.label_login);
			mTvLoginOrLogout.setCompoundDrawablesWithIntrinsicBounds(
					R.drawable.login_icon, 0, 0, 0);
			mProgressDialog.dismiss();
		}

		@Override
		public void onThinking() {
			// TODO Auto-generated method stub

		}

		@Override
		public void onException(Throwable throwable) {
			// TODO Auto-generated method stub

		}

		@Override
		public void onFail(String reason) {
			// TODO Auto-generated method stub

		}
	};

	private Response.Listener<ResultLogin> createMyReqSuccessListener() {
		return new Response.Listener<ResultLogin>() {
			@Override
			public void onResponse(ResultLogin response) {
				Log.d("haipn", "response success:" + response.Result.Return);
				Toast.makeText(MoreActivity.this, "Logout successful",
						Toast.LENGTH_LONG).show();
				Const.deleteSessionId(MoreActivity.this);
				Const.writeAccessTokenFb(MoreActivity.this, "");

//				mProgressDialog.dismiss();
				mSimpleFacebook.logout(onLogoutListener);
			}
		};
	}

	private Response.ErrorListener createMyReqErrorListener() {
		return new Response.ErrorListener() {
			@Override
			public void onErrorResponse(VolleyError error) {
				Log.d("haipn", "response error:" + error.getMessage());
			}
		};
	}

	private void createHeader() {
		findViewById(R.id.btnBack).setVisibility(View.INVISIBLE);
		findViewById(R.id.btnSearch).setVisibility(View.INVISIBLE);
		findViewById(R.id.logo).setVisibility(View.INVISIBLE);

		TextView mTvTitle = (TextView) findViewById(R.id.title);
		mTvTitle.setVisibility(View.VISIBLE);
		mTvTitle.setText(R.string.more);
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			// if (Const.isAppExitable) {
			return false;
			// } else
			// return super.onKeyDown(keyCode, event);
		}
		return super.onKeyDown(keyCode, event);
	}
}


text:
package vue;
/*
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.Timer;
import java.util.TimerTask;*/

import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.scene.control.Label;
import javafx.util.Duration;
import modele.MilkRs;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

public class DigitalClock extends Label {
	private static DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(MilkRs.DATE_FORMAT);
	//private static DateFormat dateFormat = new SimpleDateFormat(MilkRs.DATE_FORMAT);

	public DigitalClock() {
		bindToTime();
	}

	private void bindToTime() {
		Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(0),
											event -> setText(LocalTime.now().format(dateFormat))),
											new KeyFrame(Duration.seconds(1)));
		timeline.setCycleCount(Animation.INDEFINITE);
		timeline.play();

		/* old version :
        Timer timer;
        timer = new Timer();
		timer.schedule(new TimerTask() {
			@Override
			public void run() {
				Platform.runLater(new Runnable() {
					public void run() {
						String heure =  dateFormat.format(new GregorianCalendar().getTime());
						timeLabel.setText(heure);
					}
				});
			}
		}, 0,1000);
		*/

	}
}


text:
package com.kvn.classifier.ruleengine.rule;

public class WordOfMouthRule extends DefaultRegexRule {

  public static final String LABEL = "StoreWOM";
  /**
   *
   */
  private static final long serialVersionUID = 1L;

  public WordOfMouthRule() {
    this("wom_rule_without_name");
  }

  public WordOfMouthRule(String name) {
    super(name);
  }

  @Override
  public String getRuleLable() {
    return LABEL;
  }

}


text:
#ifndef _cuANN_kernel_HPP_
#define _cuANN_kernel_HPP_
#include "includes.ihh"
namespace cuANN
{

/// Signum function, 1 if > 0, 0 if 0, -1 if < 0
__device__ static float sgn(const float x)
{
    return (0.f < x) - (x < 0.f);
}

/// Sigmoid: `σ(x) = 1 / 1 + e^( -x )`
struct sigmoid
{
    sigmoid()=default;
    __device__ float operator()(const float x) const
    {
        float denom = __fadd_rz(1.f,__expf(-x));
        return __fdividef(1.f,denom);
    }
};

/// Sigmoid Derivative: `σ'(x) = σ(x) * (1 - σ(x) )`
struct sigmoid_deriv
{
    sigmoid_deriv()=default;
    __device__ float operator()(const float x) const
    {
        float denom = __fadd_rz(1.f,__expf(-x));
        float sig= __fdividef(1.f,denom);
        return __fmul_rz(sig,(1.f-sig));
    }
};

/// Sigmoid Bipolar: `σ(x) = -1 + 2 / (1 + e^-x)`
struct sigmoid_bipolar
{
    __device__ float operator()(const float x) const
    {
        float denom = __fadd_rz(1.f,__expf(-x));
        return __fdividef(1,denom);
    }
};

/// Sigmoid Bipolar Derivative: `σ(x) = 0.5 * (1 + σ(x)) * (1 – σ(x) )`
struct sigmoid_bipolar_deriv
{
    sigmoid_bipolar_deriv()=default;
    __device__ float operator()(const float x) const
    {
        float denom = __fadd_rz(1,__expf(-x));
        float sig= __fdividef(1,denom);
        float rhs = 1-sig;
        float lhs = __fadd_rz(1,sig);
        float inner= __fmul_rz(lhs,rhs);
        return __fmul_rz(0.5,inner);
    }
};

/// Normal Hyperbolic Tangent: `tanh(x) = e^(x) - e^(-x) / e^(x) + e^(-x)i`
struct tanh_norm
{
    tanh_norm()=default;
    __device__ float operator()(const float x) const
    {
        return tanhf(x);
    }
};

/// Normal Hyperbolic Tangent Derivative: `1 / cosh^2(x)`
struct tanh_norm_deriv
{
    tanh_norm_deriv()=default;
    __device__ float operator()(const float x) const
    {
        float cosh_x = coshf(x);
        return __fdividef(1,__fmul_rz(cosh_x,cosh_x));
    }
};

/// Scaled Hyperbolic Tangent: `1.7159 * tanh(2.f/3.f*x)`
/// @note: The function is scaled in range {-1,1} to avoid learning saturation
struct tanh_scaled
{
    tanh_scaled()=default;
    __device__ float operator()(const float x) const
    {
        float value = __fmul_rz(0.666666667,x);
        float tanh_vl=  tanhf(value);
        return __fmul_rz(1.7159,tanh_vl);
    }
};

/// Tanh: `σ'(x) = 1.14393 * (1- tanh^2 ( 2/3 * x))`
/// ∴ σ'(x) = 0.6667/1.7159 * (1.7159 - σ(x)) * (1.7159 + σ(x) )
struct tanh_scaled_deriv
{
    tanh_scaled_deriv()=default;
    __device__ float operator()(const float x) const
    {
        float tanh_vl = tanhf(__fmul_rz(0.666666667,x));
        float dot = __fmul_rz((1.7159-tanh_vl),__fadd_rz(1.7159,tanh_vl));
        return __fmul_rz(0.38852303,dot);
    }
};

/// Softsign: `σ(x) = x / 1 + abs( x )`
struct soft_sign
{
    soft_sign()=default;
    __device__ float operator()(const float x) const
    {
        float denom = __fadd_rz(1,fabsf(x));
        return __fdividef(x,denom);
    }
};

/// Softsign: `σ(x) = sgn(x) / (1 + |x| )^2` where sgn is the signum
struct soft_sign_deriv
{
    soft_sign_deriv()=default;
    __device__ float operator()(const float x) const
    {
        float inner = __fadd_rz(1,fabsf(x));
        float in_sq = __fmul_rz(inner,inner);
        return __fdividef(sgn(x),in_sq);
    }
};

/**
 * @brief Activation Kernel
 * @param func is the activation function, same as template typename F
 * @param input is an input device array,
 * @note this is a 1D grid kernel
 */
template <typename F>
__global__ void activate(
                          F const& func,
                          float * input
                        )
{
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    input[x]  = func(input[x]);
}

template <typename F>
__global__ void activate(
                          F const& func,
                          float * input,
                          float * output
                        )
{
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    output[x]  = func(input[x]);
}

/// TODO: Add documentation, this is ex-`sigmoid_prime`
template <typename F>
__global__ void derivatives(
                              F const& func,
                              float * sum_ji,
                              float * output
                           )
{
    // Iterate Vector `Σ[ji]`
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    output[x] = func(sum_ji[x]);
}

/**
 * @brief Delta Error of output layer: `-E * σ'( Σ(W[i]*O[j]) )`
 * @param sum is array of previous layer output dot incoming weights: `Σ ( W[i] * O[j])`
 * @param ideal is array `ideal` output, e.g., the Target output
 * @param actual is array `actual` output
 * @param delta is array of δ[i] of output layer
 * @param index is (???) @see ann/ann.cu
 * @note all parameters (w_sum,out_err,delta) should be the same size
 */
__global__ void delta_output (
                                const float * primed_sum,
                                const float * ideal,
                                const float * actual,
                                float * delta,
                                unsigned int index
                             );

///
/// CUDA kernels for Testing a network
///

/**
 * @brief Forward Propagation: `O[j] * W[i]`
 * @param weight is the Weights Matrix, in Row-Major format, where a row corresponds to a node's weights
 * @param input is a Column Vector, corresponding to `O[j]` (the output from previous nodes)
 * @param output is a Row-Major matrix which stores the result
 * @param w_size defines the Width of the Matrices (Weights & Output)
 * @note 2D kernel: X grid is Input/Row iterator, Y grid is Column iterator
 */
__global__ void forward_prop (
                               const float * weight, // W[ji]
                               const float * input,  // O[j]
                               float * output,       // I[i]
                               unsigned int w_size   // weights per node (# of columns)
                             );

/**
 * @brief Summarize Matrix Columns to a Row Vector: `Σ( O[j] * W[i] )`
 * @param w_mtx is  `O[j] * W[i]` from `forward_prop`
 * @param output is `Σ( O[j] * W[i] )` e.g., the Sumed columns as a Row
 * @param height defines the Height of the Matrix
 * @param width defines the Width of the Matrix
 * @note 1D grid: X is iterating Columns Index
 */
__global__ void sum_columns (
                                float * w_mtx,
                                float * output,
                                unsigned int height,
                                unsigned int width
                            );

///
/// CUDA kernels for Training a network
///

/**
 * @brief Calculate Delta dot product of weights and next layer node Deltas: `W[ik] * δ[k]`
 * @note We multiply each weight, with its respective (next layer node's) δ[k]
 * @note `weights per node` must equal δ[k]
 * @note Y grid is `weights per node` as well as δ[k] size (since they are equal)
 * @note X grid is layer i nodes (could differ from k nodes)
 */
__global__ void delta_product (
                                const float * w_ik,
                                const float * d_k,
                                float * output,
                                unsigned int width
                              );

/**
 * @brief Sum Rows of Matrix: `Σ( W[ik] * δ[k] )`
 * @param w_ik_d is the matrix `W[ik] * δ[k]`
 * @param delta_i stores the Summed rows for each node in layer i
 * @param width defines the matrix width
 */
__global__ void delta_sum_rows (
                                float * w_ik_d,
                                float * delta_i,
                                unsigned int width
                               );

/**
 * @brief Delta Error of a hidden layer:  `δ[i] = f'( Σ[ji] ) * Σ( W[ik] * δ[k])`
 * @param prime_ji is array `F'( Σ( W[ji] * N[j] ) )`
 * @param delta_i is array `δ[i]` the current layer's deltas (one for each neuron), our output
 * @warning delta_i **must** contain the values of `Σ( W[ik] * δ[k])`
 */
__global__ void delta_hidden (
                               float * prime_ji,
                               float * delta_i
                             );

/**
 * @brief Gradient Descent for all (but output) Neurons/Nodes: `∂E / ∂W[ik] = δ[k] * O[i]`
 * @note This is a per-layer calculation, not a network global function (not for the entire network)
 * @param d_k is `δ[k]` the following layer's Node Delta
 * @param i_i is `O[i]` the output of the activation function from preceeding layer
 * @param g_ik is the product `∂E/∂W[ik]` e.g., the gradient (function output)
 * @param size_d defines the row width of the produced matrix
 * @note X grid is Node Delta count, Y grid is O[i] count
 */
__global__ void gradient_descent (
                                    float * d_k,
                                    float * o_i,
                                    float * g_ik,
                                    unsigned int size_d
                                 );

/**
 * @brief Summarize Gradients for an entire Epoch
 * @param gradient will be updated (the storage array)
 * @param new_value is the value to be added (the temp array)
 */
__global__ void sum_gradients (
                                float * gradient,
                                float * new_value
                              );

/**
 * @brief Back-Propagation for all weights: `Δw(t) = ε * ( ∂E / ∂W[i] ) + α * ( Δw(t-1) )`
 * @param weights the entire network weights
 * @param gradients all gradients `∂E / ∂W[ik]` same size as weights
 * @param updates previous weight updates `Δw(t-1)` same size as weights, we set `Δw(t-1) = Δw(t)`
 * @param alpha the gradient momentum
 * @param epsilon the learning rate
 * @note this is a linear 1D grid, where X iterates weights, gradiients and updates (all same size)
 */
__global__ void back_prop (
                            float * weight,
                            float * gradient,
                            float * update,
                            float alpha,
                            float epsilon
                         );

// TODO: Resilient Back-Prop

/// Calculate the Output Error: (Ideal[i] - Actual[i])^2
__global__ void squared_error (
                                const float * ideal,
                                float * actual,
                                float * errors
                              );

};
#endif


text:
Empty detached yaml front matter is perfectly fine. It is a marker like you would do empty inline front matter
---
---


text:
package golangQL

import (
	"bytes"
	"errors"
	"regexp"
	"strings"
)

const (
	openComma     = '{'
	closeComma    = '}'
	baseFieldName = "data"
	space         = ' '
)

var (
	ErrWrongGQLFormat = errors.New("errors.GQLWrongFormat")
	spacesRegEx = regexp.MustCompile("( )+")
)

func parse(query string) (*node, error) {
	query, err := formatQuery(query)
	if err != nil {
		return nil, err
	}

	tree := newNode(baseFieldName)
	currentNode := tree

	var buf bytes.Buffer
	for _, char := range query {
		switch char {
		case openComma:
			newNode := newNode(buf.String())
			newNode.parent = currentNode
			currentNode.appendChild(newNode)

			currentNode = newNode

			buf.Reset()
		case closeComma:
			if currentNode.parent == nil {
				return nil, ErrWrongGQLFormat
			}

			currentNode = currentNode.parent
		case space:
			currentNode.fields = append(currentNode.fields, buf.String())
			buf.Reset()
		default:
			buf.WriteRune(char)
		}
	}

	return tree, nil
}

func formatQuery(query string) (string, error) {
	if len(query) == 0 {
		return "", ErrWrongGQLFormat
	}

	query = strings.Replace(query, "}", " }", -1)

	query, err := deleteDoubleSpaces(query)
	if err != nil {
		return "", err
	}

	if query[0] != openComma || query[len(query)-1] != closeComma {
		return "", ErrWrongGQLFormat
	}

	query = strings.Replace(query, "{ ", "{", -1)
	query = strings.Replace(query, " {", "{", -1)
	query = strings.Replace(query, "} ", "}", -1)
	query = strings.Trim(query, "{}")

	return query, nil
}

func deleteDoubleSpaces(str string) (string, error) {
	str = strings.TrimSpace(str)
	str = spacesRegEx.ReplaceAllString(str, " ")

	return str, nil
}


text:
package resource

import (
	"github.com/dokku/dokku/plugins/common"
)

// CommandLimit implements resource:limit
func CommandLimit(appName string, processType string, r Resource) error {
	if err := common.VerifyAppName(appName); err != nil {
		return err
	}

	return setResourceType(appName, processType, r, "limit")
}

// CommandLimitClear implements resource:limit-clear
func CommandLimitClear(appName string, processType string) error {
	if err := common.VerifyAppName(appName); err != nil {
		return err
	}

	clearByResourceType(appName, processType, "limit")
	return nil
}

// CommandReport displays a resource report for one or more apps
func CommandReport(appName string, format string, infoFlag string) error {
	if len(appName) == 0 {
		apps, err := common.DokkuApps()
		if err != nil {
			return err
		}
		for _, appName := range apps {
			if err := ReportSingleApp(appName, format, infoFlag); err != nil {
				return err
			}
		}
		return nil
	}

	return ReportSingleApp(appName, format, infoFlag)
}

// CommandReserve implements resource:reserve
func CommandReserve(appName string, processType string, r Resource) error {
	if err := common.VerifyAppName(appName); err != nil {
		return err
	}

	return setResourceType(appName, processType, r, "reserve")
}

// CommandReserveClear implements resource:reserve-clear
func CommandReserveClear(appName string, processType string) error {
	if err := common.VerifyAppName(appName); err != nil {
		return err
	}

	clearByResourceType(appName, processType, "reserve")
	return nil
}