text:
namespace eseViewer {
    partial class OpenForm {
        /// <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.label1 = new System.Windows.Forms.Label();
            this.tbfp = new System.Windows.Forms.TextBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.tbLogFilePath = new System.Windows.Forms.TextBox();
            this.tbTempPath = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.tbSystemPath = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.tbinstId = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.tbDatabasePageSize = new System.Windows.Forms.TextBox();
            this.rbReadOnly = new System.Windows.Forms.RadioButton();
            this.rbEdit = new System.Windows.Forms.RadioButton();
            this.bOpen = new System.Windows.Forms.Button();
            this.bCancel = new System.Windows.Forms.Button();
            this.bUseTemp = new System.Windows.Forms.Button();
            this.tlpC = new System.Windows.Forms.TableLayoutPanel();
            this.tableLayoutPanel1.SuspendLayout();
            this.tlpC.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(47, 6);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(55, 12);
            this.label1.TabIndex = 0;
            this.label1.Text = "FileName:";
            //
            // tbfp
            //
            this.tbfp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbfp.Location = new System.Drawing.Point(108, 3);
            this.tbfp.Name = "tbfp";
            this.tbfp.Size = new System.Drawing.Size(404, 19);
            this.tbfp.TabIndex = 1;
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.Controls.Add(this.tlpC, 1, 7);
            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.tbfp, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.tbLogFilePath, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.tbTempPath, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.tbSystemPath, 1, 3);
            this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
            this.tableLayoutPanel1.Controls.Add(this.tbinstId, 1, 4);
            this.tableLayoutPanel1.Controls.Add(this.label6, 0, 5);
            this.tableLayoutPanel1.Controls.Add(this.tbDatabasePageSize, 1, 5);
            this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 8;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel1.Size = new System.Drawing.Size(514, 206);
            this.tableLayoutPanel1.TabIndex = 0;
            //
            // tbLogFilePath
            //
            this.tbLogFilePath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbLogFilePath.Location = new System.Drawing.Point(108, 28);
            this.tbLogFilePath.Name = "tbLogFilePath";
            this.tbLogFilePath.Size = new System.Drawing.Size(404, 19);
            this.tbLogFilePath.TabIndex = 3;
            //
            // tbTempPath
            //
            this.tbTempPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbTempPath.Location = new System.Drawing.Point(108, 53);
            this.tbTempPath.Name = "tbTempPath";
            this.tbTempPath.Size = new System.Drawing.Size(404, 19);
            this.tbTempPath.TabIndex = 5;
            //
            // label2
            //
            this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(37, 31);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(65, 12);
            this.label2.TabIndex = 2;
            this.label2.Text = "LogFilePath";
            //
            // label3
            //
            this.label3.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(46, 56);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(56, 12);
            this.label3.TabIndex = 4;
            this.label3.Text = "TempPath";
            //
            // label4
            //
            this.label4.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(36, 81);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(66, 12);
            this.label4.TabIndex = 6;
            this.label4.Text = "SystemPath";
            //
            // tbSystemPath
            //
            this.tbSystemPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbSystemPath.Location = new System.Drawing.Point(108, 78);
            this.tbSystemPath.Name = "tbSystemPath";
            this.tbSystemPath.Size = new System.Drawing.Size(404, 19);
            this.tbSystemPath.TabIndex = 7;
            //
            // label5
            //
            this.label5.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(21, 106);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(81, 12);
            this.label5.TabIndex = 8;
            this.label5.Text = "Instance Name";
            //
            // tbinstId
            //
            this.tbinstId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbinstId.Location = new System.Drawing.Point(108, 103);
            this.tbinstId.Name = "tbinstId";
            this.tbinstId.Size = new System.Drawing.Size(100, 19);
            this.tbinstId.TabIndex = 9;
            this.tbinstId.Text = "eseViewer";
            //
            // label6
            //
            this.label6.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(3, 131);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(99, 12);
            this.label6.TabIndex = 10;
            this.label6.Text = "DatabasePageSize";
            //
            // tbDatabasePageSize
            //
            this.tbDatabasePageSize.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tbDatabasePageSize.Location = new System.Drawing.Point(108, 128);
            this.tbDatabasePageSize.Name = "tbDatabasePageSize";
            this.tbDatabasePageSize.Size = new System.Drawing.Size(100, 19);
            this.tbDatabasePageSize.TabIndex = 11;
            this.tbDatabasePageSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // rbReadOnly
            //
            this.rbReadOnly.AutoSize = true;
            this.rbReadOnly.Checked = true;
            this.rbReadOnly.Location = new System.Drawing.Point(5, 5);
            this.rbReadOnly.Name = "rbReadOnly";
            this.rbReadOnly.Padding = new System.Windows.Forms.Padding(3);
            this.rbReadOnly.Size = new System.Drawing.Size(78, 22);
            this.rbReadOnly.TabIndex = 0;
            this.rbReadOnly.TabStop = true;
            this.rbReadOnly.Text = "ReadOnly";
            this.rbReadOnly.UseVisualStyleBackColor = true;
            //
            // rbEdit
            //
            this.rbEdit.AutoSize = true;
            this.rbEdit.Location = new System.Drawing.Point(91, 5);
            this.rbEdit.Name = "rbEdit";
            this.rbEdit.Padding = new System.Windows.Forms.Padding(3);
            this.rbEdit.Size = new System.Drawing.Size(70, 22);
            this.rbEdit.TabIndex = 1;
            this.rbEdit.TabStop = true;
            this.rbEdit.Text = "Editable";
            this.rbEdit.UseVisualStyleBackColor = true;
            //
            // bOpen
            //
            this.bOpen.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.bOpen.Location = new System.Drawing.Point(12, 244);
            this.bOpen.Name = "bOpen";
            this.bOpen.Size = new System.Drawing.Size(75, 23);
            this.bOpen.TabIndex = 1;
            this.bOpen.Text = "&Open";
            this.bOpen.UseVisualStyleBackColor = true;
            //
            // bCancel
            //
            this.bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.bCancel.Location = new System.Drawing.Point(127, 244);
            this.bCancel.Name = "bCancel";
            this.bCancel.Size = new System.Drawing.Size(75, 23);
            this.bCancel.TabIndex = 2;
            this.bCancel.Text = "Cancel";
            this.bCancel.UseVisualStyleBackColor = true;
            //
            // bUseTemp
            //
            this.bUseTemp.Location = new System.Drawing.Point(374, 244);
            this.bUseTemp.Name = "bUseTemp";
            this.bUseTemp.Size = new System.Drawing.Size(150, 23);
            this.bUseTemp.TabIndex = 3;
            this.bUseTemp.Text = "Alloc temp directory";
            this.bUseTemp.UseVisualStyleBackColor = true;
            this.bUseTemp.Click += new System.EventHandler(this.bUseTemp_Click);
            //
            // tlpC
            //
            this.tlpC.AutoSize = true;
            this.tlpC.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.tlpC.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset;
            this.tlpC.ColumnCount = 2;
            this.tlpC.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpC.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpC.Controls.Add(this.rbEdit, 1, 0);
            this.tlpC.Controls.Add(this.rbReadOnly, 0, 0);
            this.tlpC.Location = new System.Drawing.Point(108, 153);
            this.tlpC.Name = "tlpC";
            this.tlpC.RowCount = 1;
            this.tlpC.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tlpC.Size = new System.Drawing.Size(174, 32);
            this.tlpC.TabIndex = 14;
            //
            // OpenForm
            //
            this.AcceptButton = this.bOpen;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.bCancel;
            this.ClientSize = new System.Drawing.Size(538, 279);
            this.Controls.Add(this.bUseTemp);
            this.Controls.Add(this.bCancel);
            this.Controls.Add(this.bOpen);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "OpenForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Open";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.tlpC.ResumeLayout(false);
            this.tlpC.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Button bOpen;
        private System.Windows.Forms.Button bCancel;
        internal System.Windows.Forms.TextBox tbfp;
        internal System.Windows.Forms.TextBox tbLogFilePath;
        internal System.Windows.Forms.TextBox tbTempPath;
        internal System.Windows.Forms.TextBox tbSystemPath;
        internal System.Windows.Forms.TextBox tbinstId;
        private System.Windows.Forms.Label label6;
        internal System.Windows.Forms.TextBox tbDatabasePageSize;
        private System.Windows.Forms.Button bUseTemp;
        private System.Windows.Forms.RadioButton rbEdit;
        internal System.Windows.Forms.RadioButton rbReadOnly;
        private System.Windows.Forms.TableLayoutPanel tlpC;
    }
}


text:
require 'helper'

describe Temple::HTML::AttributeRemover do
  before do
    @remover = Temple::HTML::AttributeRemover.new
  end

  it 'should pass static attributes through' do
    @remover.call([:html, :tag,
      'div',
      [:html, :attrs, [:html, :attr, 'class', [:static, 'b']]],
      [:content]
    ]).should.equal [:html, :tag, "div",
                     [:multi,
                      [:html, :attr, "class", [:static, "b"]]],
                     [:content]]
  end

  it 'should check for empty dynamic attribute if it is included in :remove_empty_attrs' do
    @remover.call([:html, :tag,
      'div',
      [:html, :attrs, [:html, :attr, 'class', [:dynamic, 'b']]],
      [:content]
    ]).should.equal [:html, :tag, "div",
                    [:multi,
                      [:multi,
                       [:capture, "_temple_html_attributeremover1", [:dynamic, "b"]],
                       [:if, "!_temple_html_attributeremover1.empty?",
                        [:html, :attr, "class", [:dynamic, "_temple_html_attributeremover1"]]]]],
                     [:content]]
  end

  it 'should not check for empty dynamic attribute if it is not included in :remove_empty_attrs' do
    @remover.call([:html, :tag,
      'div',
      [:html, :attrs, [:html, :attr, 'name', [:dynamic, 'b']]],
      [:content]
    ]).should.equal [:html, :tag, "div",
                     [:multi,
                      [:html, :attr, "name", [:dynamic, "b"]]],
                     [:content]]
  end
end

redpajama_set_name: RedPajamaGithub


text:
namespace Org.Cen.RobotManager.Pages
{
    using System.Windows;
    using System.Windows.Controls;

    /// <summary>
    /// Interaction logic for GameBoardControl.xaml
    /// </summary>
    public partial class GameBoardControl : UserControl
    {
        private MainWindow Main
        {
            get { return (MainWindow)Window.GetWindow(this); }
        }

        public GameBoardControl()
        {
            InitializeComponent();
        }

        private void GameBoardGrid_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            GameBoardScaleTransform.ScaleX = GameBoardGrid.RenderSize.Height / 300;
            GameBoardScaleTransform.ScaleY = -GameBoardGrid.RenderSize.Height / 300;
            GameBoardScaleTranslateTransform.Y = GameBoardGrid.RenderSize.Height;
            GameBoardCanvas.UpdateLayout();
        }
    }
}


text:
import { SETTINGS_NOTIFICATION_TYPE } from '../../calendar/constants';
import { Nullable } from '../utils';
import { CalendarKey } from './CalendarKey';
import { CalendarMember, CalendarOwner } from './CalendarMember';
import { NotificationModel } from './Notification';
import { Passphrase } from './Passphrase';

export enum CALENDAR_TYPE {
    PERSONAL = 0,
    SUBSCRIPTION = 1,
}

export enum CALENDAR_TYPE_EXTENDED {
    SHARED = 2,
}

export type EXTENDED_CALENDAR_TYPE = CALENDAR_TYPE | CALENDAR_TYPE_EXTENDED;

export enum CALENDAR_DISPLAY {
    HIDDEN = 0,
    VISIBLE = 1,
}

export interface Calendar {
    ID: string;
    Type: CALENDAR_TYPE;
}

export interface CalendarWithOwnMembers extends Calendar {
    Owner: CalendarOwner;
    Members: CalendarMember[];
}

export interface VisualCalendar extends CalendarWithOwnMembers {
    Name: string;
    Description: string;
    Color: string;
    Display: CALENDAR_DISPLAY;
    Email: string;
    Flags: number;
    Permissions: number;
}

export enum SETTINGS_VIEW {
    DAY = 0,
    WEEK = 1,
    MONTH = 2,
    YEAR = 3,
    PLANNING = 4,
}

export interface CalendarUserSettings {
    DefaultCalendarID: Nullable<string>;
    WeekLength: number;
    DisplayWeekNumber: number;
    AutoDetectPrimaryTimezone: number;
    PrimaryTimezone: string;
    DisplaySecondaryTimezone: number;
    SecondaryTimezone: Nullable<string>;
    ViewPreference: SETTINGS_VIEW;
    InviteLocale: Nullable<string>;
    AutoImportInvite: number;
}

export interface CalendarNotificationSettings {
    Type: SETTINGS_NOTIFICATION_TYPE;
    Trigger: string;
}

export interface CalendarSettings {
    ID: string;
    CalendarID: string;
    DefaultEventDuration: number;
    DefaultPartDayNotifications: CalendarNotificationSettings[];
    DefaultFullDayNotifications: CalendarNotificationSettings[];
}

export interface CalendarBootstrap {
    Keys: CalendarKey[];
    Passphrase: Passphrase;
    Members: CalendarMember[];
    CalendarSettings: CalendarSettings;
}

export interface CalendarAddressOptions {
    value: string;
    text: string;
}

export interface CalendarSelectOption {
    id: string;
    name: string;
    color: string;
}

export interface CalendarViewModelFull {
    calendarID: string;
    name: string;
    members: CalendarMember[];
    display: boolean;
    description: string;
    color: string;
    addressID: string;
    addressOptions: CalendarAddressOptions[];
    duration: number;
    defaultPartDayNotification: NotificationModel;
    defaultFullDayNotification: NotificationModel;
    partDayNotifications: NotificationModel[];
    fullDayNotifications: NotificationModel[];
    url?: string;
    type: CALENDAR_TYPE;
}

export interface CalendarErrors {
    name?: string;
    description?: string;
}


text:
/****************************************************************************
 * mm/kmm_heap/kmm_realloc.c
 *
 *   Copyright (C) 2014 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <tinyara/config.h>

#include <tinyara/mm/mm.h>

#ifdef CONFIG_MM_KERNEL_HEAP

/****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/****************************************************************************
 * Private Functions
 ****************************************************************************/

/****************************************************************************
 * Public Functions
 ****************************************************************************/
/************************************************************************
 * Name: kmm_realloc_at
 *
 * Description:
 *   realloc to the specific kernel heap.
 *   kmm_realloc_at tries to allocate memory for a specific kernel heap
 *  which passed by api argument.
 *   If there is no enough space to allocate, it will return NULL.
 *
 * Return Value:
 *   The address of the allocated memory (NULL on failure to allocate)
 *
 ************************************************************************/
#if CONFIG_KMM_NHEAPS > 1
void *kmm_realloc_at(int heap_index, void *oldmem, size_t size)
{
	struct mm_heap_s *kheap;
	if (heap_index >= CONFIG_KMM_NHEAPS || heap_index < 0) {
		mdbg("kmm_realloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, CONFIG_KMM_NHEAPS);
		return NULL;
	}

	kheap = kmm_get_heap();
#ifdef CONFIG_DEBUG_MM_HEAPINFO
	ARCH_GET_RET_ADDRESS
	return mm_realloc(&kheap[heap_index], oldmem, size, retaddr);
#else
	return mm_realloc(&kheap[heap_index], oldmem, size);
#endif
}
#endif

/****************************************************************************
 * Name: kmm_realloc
 *
 * Description:
 *   Re-allocate memory in the kernel heap.
 *
 * Parameters:
 *   oldmem  - The old memory allocated
 *   newsize - Size (in bytes) of the new memory region to be re-allocated.
 *
 * Return Value:
 *   The address of the re-allocated memory (NULL on failure to re-allocate)
 *
 ****************************************************************************/

FAR void *kmm_realloc(FAR void *oldmem, size_t newsize)
{
	void *ret;
	int kheap_idx;
	struct mm_heap_s *kheap_origin = mm_get_heap(oldmem);
	struct mm_heap_s *kheap_new;
#ifdef CONFIG_DEBUG_MM_HEAPINFO
	ret = mm_realloc(kheap_origin, oldmem, newsize, __builtin_return_address(0));
#else
	ret = mm_realloc(kheap_origin, oldmem, newsize);
#endif
	if (ret != NULL) {
		return ret;
	}

	/* Try to mm_malloc to another heap. */
	kheap_new = kmm_get_heap();
	for (kheap_idx = 0; kheap_idx < CONFIG_KMM_NHEAPS; kheap_idx++) {
#ifdef CONFIG_DEBUG_MM_HEAPINFO
		ret = mm_malloc(&kheap_new[kheap_idx], newsize, __builtin_return_address(0));
#else
		ret = mm_malloc(&kheap_new[kheap_idx], newsize);
#endif
		if (ret != NULL) {
			kmm_free(oldmem);
			return ret;
		}
	}
	return NULL;
}

#endif							/* CONFIG_MM_KERNEL_HEAP */


text:
set enable_seqscan=off;

CREATE TABLE test_numeric (
	i numeric
);

INSERT INTO test_numeric VALUES (-2),(-1),(0),(1),(2),(3);

CREATE INDEX idx_numeric ON test_numeric USING gin (i);

SELECT * FROM test_numeric WHERE i<'1'::numeric ORDER BY i;
SELECT * FROM test_numeric WHERE i<='1'::numeric ORDER BY i;
SELECT * FROM test_numeric WHERE i='1'::numeric ORDER BY i;
SELECT * FROM test_numeric WHERE i>='1'::numeric ORDER BY i;
SELECT * FROM test_numeric WHERE i>'1'::numeric ORDER BY i;


text:
package io.jsonwebtoken;

/**
 * Looks for a JWT {@code calg} header, and if found, returns the corresponding {@link CompressionCodec} the parser
 * can use to decompress the JWT body.
 *
 *
JJWT's default {@link JwtParser} implementation supports both the
 * {@link io.jsonwebtoken.impl.compression.DeflateCompressionCodec DEFLATE}
 * and {@link io.jsonwebtoken.impl.compression.GzipCompressionCodec GZIP} algorithms by default - you do not need to
 * specify a {@code CompressionCodecResolver} in these cases.

 *
 *
However, if you want to use a compression algorithm other than {@code DEF} or {@code GZIP}, you must implement
 * your own {@link CompressionCodecResolver} and specify that when
 * {@link io.jsonwebtoken.JwtBuilder#compressWith(CompressionCodec) building} and
 * {@link io.jsonwebtoken.JwtParser#setCompressionCodecResolver(CompressionCodecResolver) parsing} JWTs.

 *
 * @since 0.6.0
 */
public interface CompressionCodecResolver {

    /**
     * Looks for a JWT {@code calg} header, and if found, returns the corresponding {@link CompressionCodec} the parser
     * can use to decompress the JWT body.
     *
     * @param header of the JWT
     * @return CompressionCodec matching the {@code calg} header, or null if there is no {@code calg} header.
     * @throws CompressionException if a {@code calg} header value is found and not supported.
     */
    CompressionCodec resolveCompressionCodec(Header header) throws CompressionException;

}


text:
<resources>
	<string name="app_name">testutils</string>
</resources>


text:
mkdir -p output/dist

export LC_ALL="en_US.UTF-8"
VERSION=$(awk -F"'" '$1 ~ /SDK_VERSION/ {print $2}' baidubce/__init__.py)
TARGET="bce-python-sdk-$VERSION"
mkdir $TARGET
cp -rf baidubce sample setup.py README.txt $TARGET
zip -r ${TARGET}.zip $TARGET -x "*.pyc" "*.pyo"
cp ${TARGET}.zip output/

PYTHON=python
[ -f /home/cmc/opt/pyenv/versions/2.7.14/bin/python2.7 ] && PYTHON=/home/cmc/opt/pyenv/versions/2.7.14/bin/python2.7

echo "using Python=$PYTHON"

$PYTHON setup.py bdist_wheel --universal
$PYTHON setup.py sdist
mv -fv dist/* output/dist/


text:
package com.b12kab.tmdblibrary.entities;

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

import androidx.annotation.NonNull;

/***
 * Link to this page to display all options and provide deep links to the actual providers (and to support TMDb)
 */
public class WatchProviders {

    public static class CountryInfo {
        public String link;
        @NonNull public java.util.List<WatchProvider> flatrate = new ArrayList<>();
        @NonNull public java.util.List<WatchProvider> free = new ArrayList<>();
        @NonNull public java.util.List<WatchProvider> ads = new ArrayList<>();
        @NonNull public java.util.List<WatchProvider> buy = new ArrayList<>();
    }

    public Integer id;
    /**
     * Mapped by ISO 3166-1 two letter country code, e.g. DE and US.
     */
    @NonNull public Map<String, CountryInfo> results = new HashMap<>();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ToolGood.ReadyGo3.PetaPoco.Core;

namespace ToolGood.ReadyGo3
{
    partial class SqlHelper
    {

        #region FirstOrDefault PK

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, int condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition);
        }
        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, int? condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, uint condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition);
        }

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, uint? condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, long condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition);
        }
        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, long? condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, ulong condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition);
        }

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, ulong? condition) where T : class
        {
            return Table_SingleOrDefaultById<T>(table, condition ?? 0);
        }

        #endregion

        /// <summary>
        /// 根据条件查询第一个
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public T Table_FirstOrDefault<T>(string table, object condition) where T : class
        {
            return Table_FirstOrDefault<T>(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询
        /// </summary>
        /// <param name="table"></param>
        /// <param name="limit">个数</param>
        /// <param name="offset">位移</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public List<T> Table_Select<T>(string table, int limit, int offset, object condition) where T : class
        {
            return Table_Select<T>(table, limit, offset, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询
        /// </summary>
        /// <param name="table"></param>
        /// <param name="limit">个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public List<T> Table_Select<T>(string table, int limit, object condition) where T : class
        {
            return Table_Select<T>(table, limit, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public List<T> Table_Select<T>(string table, object condition) where T : class
        {
            return Table_Select<T>(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询页
        /// </summary>
        /// <param name="table"></param>
        /// <param name="page">页数</param>
        /// <param name="itemsPerPage">每页个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public List<T> Table_SelectPage<T>(string table, int page, int itemsPerPage, object condition)
            where T : class
        {
            return Table_SelectPage<T>(table, page, itemsPerPage, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询页
        /// </summary>
        /// <param name="table"></param>
        /// <param name="page">页数</param>
        /// <param name="itemsPerPage">每页个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Page<T> Table_Page<T>(string table, int page, int itemsPerPage, object condition)
            where T : class
        {
            return Table_Page<T>(table, page, itemsPerPage, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 更新表
        /// </summary>
        /// <param name="table"></param>
        /// <param name="set"></param>
        /// <param name="condition"></param>
        /// <param name="ignoreFields"></param>
        /// <returns></returns>
        public int Table_Update(string table, object set, object condition, IEnumerable<string> ignoreFields = null)
        {
            var tbn = _provider.GetTableName(table);
            return Update("UPDATE " + tbn + " " + ConditionObjectToUpdateSetWhere(set, condition, ignoreFields));
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public int Table_Delete(string table, object condition)
        {
            if (null == condition) {
                throw new ArgumentNullException(nameof(condition));
            }
            var tbn = _provider.GetTableName(table);
            return Delete("DELETE FROM " + tbn + " " + ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询个数
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public int Table_Count(string table, object condition)
        {
            return Table_Count(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件判断是否存在
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public bool Table_Exists(string table, object condition)
        {
            return Table_Count(table, ConditionObjectToWhere(condition)) > 0;
        }

#if !NET40

        #region FirstOrDefault_Async PK

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, int condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, int? condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, uint condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, uint? condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, long condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition);
        }
        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, long? condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition ?? 0);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, ulong condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition);
        }

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, ulong? condition) where T : class
        {
            return Table_SingleOrDefaultById_Async<T>(table, condition ?? 0);
        }

        #endregion

        /// <summary>
        /// 根据条件查询第一个,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<T> Table_FirstOrDefault_Async<T>(string table, object condition) where T : class
        {
            return Table_FirstOrDefault_Async<T>(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="limit">个数</param>
        /// <param name="offset">位移</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<List<T>> Table_Select_Async<T>(string table, int limit, int offset, object condition) where T : class
        {
            return Table_Select_Async<T>(table, limit, offset, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询
        /// </summary>
        /// <param name="table"></param>
        /// <param name="limit">个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<List<T>> Table_Select_Async<T>(string table, int limit, object condition) where T : class
        {
            return Table_Select_Async<T>(table, limit, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<List<T>> Table_Select_Async<T>(string table, object condition) where T : class
        {
            return Table_Select_Async<T>(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        ///  根据条件查询页,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="page">页数</param>
        /// <param name="itemsPerPage">每页个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<List<T>> Table_SelectPage_Async<T>(string table, int page, int itemsPerPage, object condition)
            where T : class
        {
            return Table_SelectPage_Async<T>(table, page, itemsPerPage, ConditionObjectToWhere(condition));
        }

        /// <summary>
        ///  根据条件查询页,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="page">页数</param>
        /// <param name="itemsPerPage">每页个数</param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<Page<T>> Table_Page_Async<T>(string table, int page, int itemsPerPage, object condition)
            where T : class
        {
            return Table_Page_Async<T>(table, page, itemsPerPage, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 更新表
        /// </summary>
        /// <param name="table"></param>
        /// <param name="set"></param>
        /// <param name="condition"></param>
        /// <param name="ignoreFields"></param>
        /// <returns></returns>
        public Task<int> Table_Update_Async(string table, object set, object condition, IEnumerable<string> ignoreFields = null)
        {
            var tbn = _provider.GetTableName(table);
            return Update_Async("UPDATE " + tbn + " " + ConditionObjectToUpdateSetWhere(set, condition, ignoreFields));
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public Task<int> Table_Delete_Async(string table, object condition)
        {
            if (null == condition) {
                throw new ArgumentNullException(nameof(condition));
            }
            var tbn = _provider.GetTableName(table);
            return Delete_Async("DELETE FROM " + tbn + " " + ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件查询个数,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public Task<int> Table_Count_Async(string table, object condition)
        {
            return Table_Count_Async(table, ConditionObjectToWhere(condition));
        }

        /// <summary>
        /// 根据条件是判断否存在,异步操作
        /// </summary>
        /// <param name="table"></param>
        /// <param name="condition">条件</param>
        /// <returns></returns>
        public async Task<bool> Table_Exists_Async(string table, object condition)
        {
            return await Table_Count_Async(table, ConditionObjectToWhere(condition)) > 0;

        }

#endif

    }
}


text:
package de.javagl.geom;

import java.awt.Shape;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.Point2D;

/**
 * A class for creating shapes of arrows
 */
public final class ArrowCreator
{
    /**
     * The length of the head of the arrow. This may either be
     * a relative length (referring to the total length of the
     * arrow) when {@link #relativeHeadLength} is true,
     * or an absolute length, when {@link #relativeHeadLength}
     * is false,
     */
    private double headLength;

    /**
     * Whether the {@link #headLength} is relative (referring to
     * the length of the arrow)
     */
    private boolean relativeHeadLength;

    /**
     * The minimum absolute head length
     */
    private double minHeadLength;

    /**
     * The maximum absolute head length
     */
    private double maxHeadLength;

    /**
     * The width of the head of the arrow. This may either be
     * a relative width (referring to the total length of the
     * arrow) when {@link #relativeHeadWidth} is true,
     * or an absolute width, when {@link #relativeHeadWidth}
     * is false,
     */
    private double headWidth;

    /**
     * Whether the {@link #headWidth} is relative (referring to
     * the length of the arrow)
     */
    private boolean relativeHeadWidth;

    /**
     * The minimum absolute head width
     */
    private double minHeadWidth;

    /**
     * The maximum absolute head width
     */
    private double maxHeadWidth;

    /**
     * The position of the "base" of the head. This is a value
     * between 0 and 1. When it is 0, then the base will be at
     * the same position as the tips of the head. If it is 1,
     * then the base will be at the arrow end
     */
    private double headBasePosition;

    /**
     * Default constructor
     */
    ArrowCreator()
    {
        setRelativeHeadLength(0.2);
        setRelativeHeadWidth(0.15);
        setHeadBasePosition(0.15);
    }

    /**
     * Set the absolute length of the arrow head
     *
     * @param headLength The head length
     * @return This instance
     */
    public ArrowCreator setAbsoluteHeadLength(double headLength)
    {
        this.headLength = headLength;
        this.minHeadLength = headLength;
        this.maxHeadLength = headLength;
        this.relativeHeadLength = false;
        return this;
    }

    /**
     * Set the head length, relative to the length of the arrow,
     * usually as a value between 0 and 1
     *
     * @param headLength The head length
     * @return This instance
     */
    public ArrowCreator setRelativeHeadLength(double headLength)
    {
        return setRelativeHeadLength(headLength, 0, Double.MAX_VALUE);
    }

    /**
     * Set the head length, relative to the length of the arrow,
     * usually as a value between 0 and 1, but with the given
     * absolute bounds
     *
     * @param headLength The head length
     * @param minAbsolute The minimum head length
     * @param maxAbsolute The maximum head length
     * @return This instance
     */
    public ArrowCreator setRelativeHeadLength(
        double headLength, double minAbsolute, double maxAbsolute)
    {
        this.headLength = headLength;
        this.minHeadLength = minAbsolute;
        this.maxHeadLength = maxAbsolute;
        this.relativeHeadLength = true;
        return this;
    }

    /**
     * Set the absolute width of the arrow head
     *
     * @param headWidth The head width
     * @return This instance
     */
    public ArrowCreator setAbsoluteHeadWidth(double headWidth)
    {
        this.headWidth = headWidth;
        this.minHeadWidth = headWidth;
        this.maxHeadWidth = headWidth;
        this.relativeHeadWidth = false;
        return this;
    }

    /**
     * Set the head width, relative to the length of the arrow,
     * usually as a value between 0 and 1
     *
     * @param headWidth The head width
     * @return This instance
     */
    public ArrowCreator setRelativeHeadWidth(double headWidth)
    {
        return setRelativeHeadWidth(headWidth, 0, Double.MAX_VALUE);
    }

    /**
     * Set the head width, relative to the width of the arrow,
     * usually as a value between 0 and 1, but with the given
     * absolute bounds
     *
     * @param headWidth The head width
     * @param minAbsolute The minimum head width
     * @param maxAbsolute The maximum head width
     * @return This instance
     */
    public ArrowCreator setRelativeHeadWidth(
        double headWidth, double minAbsolute, double maxAbsolute)
    {
        this.headWidth = headWidth;
        this.minHeadWidth = minAbsolute;
        this.maxHeadWidth = maxAbsolute;
        this.relativeHeadWidth = true;
        return this;
    }

    /**
     * Set the position of the head base, as a value between 0 and 1.
     * In this image, "B" represents the base position, between "0" and
     * "1":
     *

     *               __
     *               \ \__
     *                \   \__
     *                 \     \_
     * --------------0--B-----1
     *                 /   __/
     *                / __/
     *               /_/
     *

     *
     *
     * @param headBasePosition The head base position
     * @return This instance
     */
    public ArrowCreator setHeadBasePosition(double headBasePosition)
    {
        this.headBasePosition = headBasePosition;
        return this;
    }

    /**
     * Compute the actual head length, based on the absolute/relative
     * head length and the minimum/maximum head length
     *
     * @param arrowLength The length of the arrow
     * @return The head length
     */
    private double computeActualHeadLength(double arrowLength)
    {
        double actualHeadLength = headLength;
        if (relativeHeadLength)
        {
            actualHeadLength *= arrowLength;
        }
        actualHeadLength = Math.max(minHeadLength, actualHeadLength);
        actualHeadLength = Math.min(maxHeadLength, actualHeadLength);
        return actualHeadLength;
    }

    /**
     * Compute the actual head width, based on the absolute/relative
     * head width and the minimum/maximum head width
     *
     * @param arrowLength The length of the arrow
     * @return The head width
     */
    private double computeActualHeadWidth(double arrowLength)
    {
        double actualHeadWidth = headWidth;
        if (relativeHeadWidth)
        {
            actualHeadWidth *= arrowLength;
        }
        actualHeadWidth = Math.max(minHeadWidth, actualHeadWidth);
        actualHeadWidth = Math.min(maxHeadWidth, actualHeadWidth);
        return actualHeadWidth;
    }

    /**
     * Build the shape of an arrow, based on the current settings
     * of this arrow creator
     *
     * @param line The line for the arrow
     * @param shaftWidth The width of the shaft
     * @return The arrow shape
     */
    public Shape buildShape(
        Line2D line, double shaftWidth)
    {
        return buildShape(
            line.getY1(), line.getY1(), line.getX2(), line.getY2(),
            shaftWidth, true);
    }

    /**
     * Build the shape of an arrow, based on the current settings
     * of this arrow creator
     *
     * @param p0 The start point of the arrow
     * @param p1 The end point of the arrow
     * @param shaftWidth The width of the shaft
     * @return The arrow shape
     */
    public Shape buildShape(
        Point2D p0, Point2D p1, double shaftWidth)
    {
        return buildShape(p0.getX(), p0.getY(), p1.getX(), p1.getY(),
            shaftWidth, true);
    }

    /**
     * Build the shape of an arrow, based on the current settings
     * of this arrow creator
     *
     * @param x0 The x-coordinate of the start point of the arrow
     * @param y0 The y-coordinate of the start point of the arrow
     * @param x1 The x-coordinate of the end point of the arrow
     * @param y1 The y-coordinate of the end point of the arrow
     * @param shaftWidth The width of the shaft
     * @return The arrow shape
     */
    public Shape buildShape(
        double x0, double y0, double x1, double y1, double shaftWidth)
    {
        return buildShape(x0, y0, x1, y1, shaftWidth, true);
    }

    /**
     * Build the shape of an arrow head, based on the current settings
     * of this arrow creator
     *
     * @param x0 The x-coordinate of the start point of the arrow
     * @param y0 The y-coordinate of the start point of the arrow
     * @param x1 The x-coordinate of the end point of the arrow
     * @param y1 The y-coordinate of the end point of the arrow
     * @param shaftWidth The width of the shaft
     * @return The arrow head shape
     */
    public Shape buildHeadShape(
        double x0, double y0, double x1, double y1, double shaftWidth)
    {
        return buildShape(x0, y0, x1, y1, shaftWidth, false);
    }

    /**
     * Build the shape of an arrow, based on the current settings
     * of this arrow creator
     *

     *               TL__
     *                 \ \__
     *                  \   \__
     *                   \     \_
     * SL-----------------BL     \
     *  |                         (x1,y1)
     * SR-----------------BR     /
     *                   /   __/
     *                  / __/
     *               TR/_/
     *
     * TL : headTipL
     * TR : headTipR
     * BL : headBaseL
     * BR : headBaseR
     * SL : shaftBaseL
     * SR : shaftBaseR
     *

     *
     *
     * @param x0 The x-coordinate of the start point of the arrow
     * @param y0 The y-coordinate of the start point of the arrow
     * @param x1 The x-coordinate of the end point of the arrow
     * @param y1 The y-coordinate of the end point of the arrow
     * @param shaftWidth The width of the shaft
     * @param includeShaft Whether the shaft should be part of the shape
     * @return The shape
     */
    private Shape buildShape(
        double x0, double y0, double x1, double y1,
        double shaftWidth, boolean includeShaft)
    {
        // To do: Avoid code duplication here and in buildLines

        double dx = x1-x0;
        double dy = y1-y0;
        double length = Math.sqrt(dx*dx+dy*dy);
        double invLength = 1.0 / length;
        double dirX = dx * invLength;
        double dirY = dy * invLength;
        double perpDirX = dirY;
        double perpDirY = -dirX;
        double perpDirOffsetX = perpDirX * 0.5;
        double perpDirOffsetY = perpDirY * 0.5;

        double actualHeadLength = computeActualHeadLength(length);
        double actualHeadWidth = computeActualHeadWidth(length);

        double headTipsX = x1 - actualHeadLength * dirX;
        double headTipsY = y1 - actualHeadLength * dirY;
        double headTipOffsetX = actualHeadWidth * perpDirOffsetX;
        double headTipOffsetY = actualHeadWidth * perpDirOffsetY;
        double headTipLx = headTipsX + headTipOffsetX;
        double headTipLy = headTipsY + headTipOffsetY;
        double headTipRx = headTipsX - headTipOffsetX;
        double headTipRy = headTipsY - headTipOffsetY;

        double headBaseOffsetFromEnd =
            (actualHeadLength * (1-headBasePosition));
        double headBaseX = x1 - headBaseOffsetFromEnd * dirX;
        double headBaseY = y1 - headBaseOffsetFromEnd * dirY;

        double shaftWidthOffsetX = shaftWidth * perpDirOffsetX;
        double shaftWidthOffsetY = shaftWidth * perpDirOffsetY;

        double headBaseLx = headBaseX + shaftWidthOffsetX;
        double headBaseLy = headBaseY + shaftWidthOffsetY;
        double headBaseRx = headBaseX - shaftWidthOffsetX;
        double headBaseRy = headBaseY - shaftWidthOffsetY;

        double shaftBaseLx = x0 + shaftWidthOffsetX;
        double shaftBaseLy = y0 + shaftWidthOffsetY;
        double shaftBaseRx = x0 - shaftWidthOffsetX;
        double shaftBaseRy = y0 - shaftWidthOffsetY;

        Path2D p = new Path2D.Double();
        if (includeShaft)
        {
            p.moveTo(shaftBaseLx, shaftBaseLy);
            p.lineTo(headBaseLx, headBaseLy);
        }
        else
        {
            p.moveTo(headBaseLx, headBaseLy);
        }
        p.lineTo(headBaseLx, headBaseLy);
        p.lineTo(headTipLx, headTipLy);
        p.lineTo(x1, y1);
        p.lineTo(headTipRx, headTipRy);
        p.lineTo(headBaseRx, headBaseRy);
        if (includeShaft)
        {
            p.lineTo(shaftBaseRx, shaftBaseRy);
        }
        p.closePath();
        return p;
    }

    /**
     * Build a simple arrow that only consists of lines, from the start
     * to the end, and from the head tips to the end.
     *
     * @param line The line for the arrow
     * @return The shape, only consisting of lines
     */
    public Shape buildLines(Line2D line)
    {
        return buildLines(
            line.getY1(), line.getY1(), line.getX2(), line.getY2());
    }

    /**
     * Build a simple arrow that only consists of lines, from the start
     * to the end, and from the head tips to the end.
     *
     * @param p0 The start point of the arrow
     * @param p1 The end point of the arrow
     * @return The shape, only consisting of lines
     */
    public Shape buildLines(
        Point2D p0, Point2D p1)
    {
        return buildLines(p0.getX(), p0.getY(), p1.getX(), p1.getY());
    }

    /**
     * Build a simple arrow that only consists of lines, from the start
     * to the end, and from the head tips to the end.
     *
     * @param x0 The x-coordinate of the start point of the arrow
     * @param y0 The y-coordinate of the start point of the arrow
     * @param x1 The x-coordinate of the end point of the arrow
     * @param y1 The y-coordinate of the end point of the arrow
     * @return The shape, only consisting of lines
     */
    public Shape buildLines(
        double x0, double y0, double x1, double y1)
    {
        // To do: Avoid code duplication here and in buildShape

        double dx = x1-x0;
        double dy = y1-y0;
        double length = Math.sqrt(dx*dx+dy*dy);
        double invLength = 1.0 / length;
        double dirX = dx * invLength;
        double dirY = dy * invLength;
        double perpDirX = dirY;
        double perpDirY = -dirX;
        double perpDirOffsetX = perpDirX * 0.5;
        double perpDirOffsetY = perpDirY * 0.5;

        double actualHeadLength = computeActualHeadLength(length);
        double actualHeadWidth = computeActualHeadWidth(length);

        double headTipsX = x1 - actualHeadLength * dirX;
        double headTipsY = y1 - actualHeadLength * dirY;
        double headTipOffsetX = actualHeadWidth * perpDirOffsetX;
        double headTipOffsetY = actualHeadWidth * perpDirOffsetY;
        double headTipLx = headTipsX + headTipOffsetX;
        double headTipLy = headTipsY + headTipOffsetY;
        double headTipRx = headTipsX - headTipOffsetX;
        double headTipRy = headTipsY - headTipOffsetY;

        Path2D p = new Path2D.Double();
        p.moveTo(x0, y0);
        p.lineTo(x1, y1);
        p.moveTo(headTipLx, headTipLy);
        p.lineTo(x1, y1);
        p.moveTo(headTipRx, headTipRy);
        p.lineTo(x1, y1);
        return p;
    }

}


text:
/** @jsx h */

import h from '../helpers/h'

export const config = {}

export const input = ''

export const output = (
  <state>
    <document>
      <paragraph />
    </document>
  </state>
)


text:
<!DOCTYPE html>

	<title>Art</title>
	<link rel="shortcut icon" href="../images/v.jpg">

		<?php

		include("../header.html");

		 ?>

Drawings and poetry

Pencil drawings

 I made some drawings just to see if I can,
					after seing a few youtube videos about speed
					drawing, which really impressed me. I was quite
					surprised by the results...

		<?php
			include("../bootstrapcarousel.html");
		 ?>

Poetry

 I was very passionate about writing poetry since I was a child.
					This urge to write is a come and go feeling, but when it happens, it is very rewarding.

Endles Joy

 we live inside an endless tear

		fouling arround without fear

		dancing under the clearest sky

		knowing in here we'll never die

		i kiss you and i hold your hand

		a moment that will never end

		you look at me and kiss me back

		the time is going off the track

		we fly away above the clouds

		and realise there are no bounds

		free to do what we have in mind

		and never again to look behind

		i take your hand, i lift you high

		you look at me and start to cry

		it is a joy, we start to dance

		we cuddle and we hold our hands

		i make a rainbow of your tears

		and every drop will last for years

		will make our world so colourfull

		with crazy games, just wonderfull

		together we'll have endless joy

		the time will be a simple toy

		and nothing will make us fall

		nothing at all

Dreaming For Real

 you're far away into the night

		just come to me, we'll make it bright

		a little kiss to take my sorrow

		i'll think of u untill tomorrow

		now follow me into my dreams

		the time will shatter when we'll kiss

		the shining stars will sing for us

		our naked feet will touch the grass

		to take you in my arms will be

		a sweet and fun insanity

		my mind will fly and set me free

		the time will be like sand for me

		i feel the fire in your heart

		it burns and burns and never stops

		i touch, you feel, you kiss, i die

		and live forever in your eyes

		my death is nothing but a door

		it takes me straight into your soul

		i keep you warm, i make you smile

		you sing for me your own desire

		and even if it's just a dream

		we'll never know, we'll always feel

		we'd touch the sky and never fall

		forever and for all

Pain

 i raise my hand to reach the sky

		the wind is blowing on my hand

		i touch my lips, they are so dry

		and all arround there's only sand

		my mind is slipping away from me

		like breaking free from reality

		making things as they should be

		and taking me closer to insanity

		breathing is harder and harder

		blinking my eyes feels endless

		the time seems to pass slower

		screaming now would be hopeless

		i'm driven away by a thought

		maybe i'm captive in my own mind

		i try to find the right path

		the one to leave all this behind

		lifting my arms felt like lead

		nothing is right, nothing i know

		this time i try to move my head

		but it is stuck and won't let go

		some things are to be left alone

		i may be punished for everything

		how did i get to this dead zone?

		maybe dreaming...

Scroll To Top^

		<?php

		include("../footer.html");

		 ?>


text:
<?php
/**
 * This configuration file is used by G4UtilBundle/Pdf.php.
 *
 * These settings replace the defaults in vendor/tcpdf/config/tcpdf_config.php.
 * See that file for explanation of individual settings.
 */

// Don't load the default tcpdf settings
define('K_TCPDF_EXTERNAL_CONFIG', true);

// --------------------
// Environment settings
// --------------------
define('K_PATH_MAIN',   __DIR__ . '/../../../../../vendor/tcpdf/');
define('K_PATH_FONTS',  K_PATH_MAIN.'fonts/');
define('K_PATH_CACHE',  __DIR__ . '/../../../../../app/cache/');
define('K_PATH_IMAGES', K_PATH_MAIN.'images/');
define('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');

define('K_PATH_URL',       'http://disabledPdfUrl/'); // we do not currently need to expose a URL
define('K_PATH_URL_CACHE', K_PATH_URL.'cache/');

// --------------------
// Application settings
// --------------------

// meta properties
define('PDF_CREATOR', '');
define('PDF_AUTHOR', '');

// header/footer properties
define('PDF_HEADER_TITLE', '');
define('PDF_HEADER_STRING', '');
define('PDF_HEADER_LOGO', '');
define('PDF_HEADER_LOGO_WIDTH', 0);
define('PDF_MARGIN_HEADER', 0);
define('PDF_MARGIN_FOOTER', 0);

// page properties
define('PDF_PAGE_FORMAT', 'A4');
define('PDF_PAGE_ORIENTATION', 'P'); // P=portrait, L=landscape
define('PDF_UNIT', 'mm');            // pt=point, mm=millimeter, cm=centimeter, in=inch

define('PDF_MARGIN_TOP', 15);
define('PDF_MARGIN_BOTTOM', 10);
define('PDF_MARGIN_LEFT', 10);
define('PDF_MARGIN_RIGHT', 10);

define('PDF_FONT_NAME_MAIN', 'helvetica');
define('PDF_FONT_SIZE_MAIN', 10);

define('PDF_FONT_NAME_DATA', 'helvetica');
define('PDF_FONT_SIZE_DATA', 8);

define('PDF_FONT_MONOSPACED', 'courier');

/**
 * ratio used to adjust the conversion of pixels to user units
 */
define('PDF_IMAGE_SCALE_RATIO', 1.25);

/**
 * magnification factor for titles
 */
define('HEAD_MAGNIFICATION', 1.1);

/**
 * height of cell repect font height
 */
define('K_CELL_HEIGHT_RATIO', 1.2);

/**
 * title magnification respect main font size
 */
define('K_TITLE_MAGNIFICATION', 1.3);

/**
 * reduction factor for small font
 */
define('K_SMALL_RATIO', 2/3);

/**
 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
 */
define('K_THAI_TOPCHARS', false);

/**
 * if true allows to call TCPDF methods using HTML syntax
 * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
 * NOTE: we use this to print barcode in BoardingPassController
 */
define('K_TCPDF_CALLS_IN_HTML', true);


text:
<?php

// Get the latest logo contents
$data = base64_encode(file_get_contents('http://kohanaframework.org/media/img/kohana.png'));

// Create the logo file
file_put_contents('logo.php', "<?php

return array('mime' => 'image/png', 'data' => '{$data}'); ?>");


text:
package org.patricbrc.Workspace;

import java.io.*;
import java.util.*;
import org.codehaus.jackson.map.*;
import org.codehaus.jackson.map.annotate.*;
import org.codehaus.jackson.type.*;
import org.codehaus.jackson.*;

public class args_ls_serializer extends JsonSerializer<args_ls>
{
    public void serialize(args_ls value, JsonGenerator jgen, SerializerProvider provider)
	throws IOException, JsonProcessingException
    {
	jgen.writeStartArray();
	jgen.writeObject(value.input);
	jgen.writeEndArray();
    }
}


text:
package ru.job4j.simpleelevator;

/**
 * The type Parameters.
 */
public class Parameters {
    /**
     * Number of floors in the building.
     */
    private int floors;
    /**
     * Height of floor in meters.
     */
    private int heightOfFloor;
    /**
     * Speed of the lift in meters per second.
     */
    private int speed;
    /**
     * Door delay in seconds.
     */
    private int doorDelay;

    /**
     * Instantiates a new Parameters.
     *
     * @param args the args
     * @throws Exception the exception
     */
    public Parameters(String[] args) throws Exception {
        if (args.length < 4) {
            throw new Exception("Not enough parameters!");
        }

        boolean hasErrors = false;

        try {
            this.floors = Integer.parseInt(args[0]);
        } catch (Exception e) {
            System.err.println("Wrong format of parameter 1 (Number of floors): " + args[0]);
            hasErrors = true;
        }
        try {
            this.heightOfFloor = Integer.parseInt(args[1]);
        } catch (Exception e) {
            System.err.println("Wrong format of parameter 2 (Height of floor, m): " + args[1]);
            hasErrors = true;
        }
        try {
            this.speed = Integer.parseInt(args[2]);
        } catch (Exception e) {
            System.err.println("Wrong format of parameter 3 (Speed of the Lift, m/sec): " + args[2]);
            hasErrors = true;
        }
        try {
            this.doorDelay = Integer.parseInt(args[3]);
        } catch (Exception e) {
            System.err.println("Wrong format of parameter 4 (Door open/close delay (sec): " + args[3]);
            hasErrors = true;
        }

        if (hasErrors) {
            throw new Exception("Wrong parameters format!");
        }
    }

    /**
     * Gets floors.
     *
     * @return the floors
     */
    public int getFloors() {
        return floors;
    }

    /**
     * Gets height of floor.
     *
     * @return the height of floor
     */
    public int getHeightOfFloor() {
        return heightOfFloor;
    }

    /**
     * Gets speed.
     *
     * @return the speed
     */
    public int getSpeed() {
        return speed;
    }

    /**
     * Gets door delay.
     *
     * @return the door delay
     */
    public int getDoorDelay() {
        return doorDelay;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c)2014 Prometheus Consulting

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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:oxm="http://www.springframework.org/schema/oxm"
	xsi:schemaLocation="http://www.springframework.org/schema/beans	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
	http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm.xsd
	http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

	<bean id="JUnitLaunchForm" class="nz.co.senanque.forms.WorkflowFormMock" scope="prototype"/>
	<bean id="JUnitFirstForm" class="nz.co.senanque.forms.WorkflowFormMock" scope="prototype"/>
	<bean id="JUnitSecondForm" class="nz.co.senanque.forms.WorkflowFormMock" scope="prototype"/>
	<bean id="VaadinLaunchForm" class="nz.co.senanque.forms.WorkflowFormMock" scope="prototype"/>
	<bean id="VaadinFirstForm" class="nz.co.senanque.forms.WorkflowFormMock" scope="prototype"/>

	<bean id="workflowManager" class="nz.co.senanque.workflow.WorkflowManagerMock"/>

    <bean id="formFactory" class="nz.co.senanque.workflow.conf.FormFactoryImpl" >
     <property name="formsMap">
    	 <map>
    		 <entry key="JUnit">
    			 <map>
    				 <entry key="launchForm" value="JUnitLaunchForm"/>
    				 <entry key="firstForm" value="JUnitlaunchForm"/>
    			 </map>
    		 </entry>
    		 <entry key="Vaadin">
    			 <map>
    				 <entry key="launchForm" value="VaadinLaunchForm"/>
    				 <entry key="firstForm" value="VaadinlaunchForm"/>
    			 </map>
    		 </entry>
    	 </map>
     </property>
    </bean>

</beans>


text:
/*
 * TeBkUmLpqAsync.h
 *
 *  Created on: 03-Feb-2020
 *      Author: sumeetc
 */

#ifndef WEB_t1_INCLUDE_TeBkUmLpqAsync_H_
#define WEB_t1_INCLUDE_TeBkUmLpqAsync_H_
#include "TemplateHandler.h"
#include "vector"
#ifndef OS_MINGW
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
#include "DataSourceManager.h"
#include <stdlib.h>
#include <algorithm>
#include "CryptoHandler.h"
#include "vector"
#include "CastUtil.h"
#include "CacheManager.h"
#include <stdlib.h>
#include "HttpRequest.h"
#include "HttpResponse.h"
#include "JSONSerialize.h"
#include "string"
#include "yuarel.h"
#include "Router.h"
#include <unordered_map>
#include "ConfigurationData.h"

class TeBkUmLpqAsyncWorld;

class TeBkUmLpqAsyncWorld {
	int id;
	int randomNumber;
public:
	TeBkUmLpqAsyncWorld();
	TeBkUmLpqAsyncWorld(int id);
	TeBkUmLpqAsyncWorld(int id, int randomNumber);
	virtual ~TeBkUmLpqAsyncWorld();
	int getId() const;
	void setId(int id);
	int getRandomNumber() const;
	void setRandomNumber(int randomNumber);
#ifdef HAVE_RAPID_JSON
	void toJson(rapidjson::Writer<rapidjson::StringBuffer>& w) {
		w.StartObject();
		w.String("id", 2);
	    w.Int(id);
		w.String("randomNumber", 12);
	    w.Int(randomNumber);
		w.EndObject();
	}
#endif
#ifdef HAVE_RAPID_JSON
	static void toJson(std::vector<TeBkUmLpqAsyncWorld>& vec, rapidjson::Writer<rapidjson::StringBuffer>& w) {
		w.StartArray();
		for(auto el: vec) {
			el.toJson(w);
		}
		w.EndArray();
	}
#endif
};

class TeBkUmLpqAsyncFortune {
	int id;
public:
	std::string message_i;
	std::string_view message;
	bool allocd;
	TeBkUmLpqAsyncFortune(int id);
	TeBkUmLpqAsyncFortune(int id, std::string message);
	TeBkUmLpqAsyncFortune();
	virtual ~TeBkUmLpqAsyncFortune();
	int getId() const;
	void setId(int id);
	bool operator < (const TeBkUmLpqAsyncFortune& other) const;
};

class TeBkUmLpqAsyncMessage {
	std::string message;
public:
	TeBkUmLpqAsyncMessage();
	TeBkUmLpqAsyncMessage(std::string message);
	virtual ~TeBkUmLpqAsyncMessage();
	const std::string& getMessage() const;
	void setMessage(const std::string& message);
#ifdef HAVE_RAPID_JSON
	void toJson(rapidjson::Writer<rapidjson::StringBuffer>& w) {
		w.StartObject();
		w.String("message", 7);
	    w.String(message.c_str(), static_cast<rapidjson::SizeType>(message.length()));
		w.EndObject();
	}
#endif
};

struct AsyncDbReq {
	float httpVers;
	bool conn_clos;
	BaseSocket* sif;
	TeBkUmLpqAsyncWorld w;
};

struct AsyncQueriesReq {
	float httpVers;
	bool conn_clos;
	BaseSocket* sif;
	std::vector<TeBkUmLpqAsyncWorld> vec;
};

struct AsyncUpdatesReq {
	float httpVers;
	bool conn_clos;
	BaseSocket* sif;
	LibpqDataSourceImpl* sqli;
	std::vector<TeBkUmLpqAsyncWorld> vec;
};

struct AsyncFortuneReq {
	float httpVers;
	bool conn_clos;
	BaseSocket* sif;
	std::list<TeBkUmLpqAsyncFortune> flst;
};

struct AsyncCacheReq {
	CacheInterface* cchi;
	std::vector<TeBkUmLpqAsyncWorld> vec;
};

class TeBkUmLpqAsyncRouter : public Router {
	static const std::string HELLO_WORLD;
	static const std::string WORLD;
	static const std::string WORLD_ONE_QUERY;
	static const std::string WORLD_ALL_QUERY;
	static const std::string FORTUNE_ALL_QUERY;
	static int g_seed;

	static TemplatePtr tmplFunc;

	static Ser m_ser;
	static Ser w_ser;
	static SerCont wcont_ser;

	static std::string& getUpdQuery(int count);
	void dbAsync(BaseSocket* sif);
	void queriesAsync(const char* q, int ql, BaseSocket* sif);
	void updatesAsync(const char* q, int ql, AsyncUpdatesReq* req);
	void updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* req);
	void cachedWorlds(const char*, int, std::vector<TeBkUmLpqAsyncWorld>&);
	void fortunes(BaseSocket* sif);

	void queriesMultiAsync(const char*, int, BaseSocket* sif);
	void updatesMulti(const char*, int, AsyncUpdatesReq*);

	static std::unordered_map<int, std::string> _qC;
	LibpqDataSourceImpl* sqli;
protected:
	virtual LibpqDataSourceImpl* getDb(int max = 0);
public:
	TeBkUmLpqAsyncRouter& operator=(const TeBkUmLpqAsyncRouter& a) {
		return *this;
	}
	TeBkUmLpqAsyncRouter(const TeBkUmLpqAsyncRouter& a) {
		sqli = NULL;
	}
	TeBkUmLpqAsyncRouter();
	virtual ~TeBkUmLpqAsyncRouter();
	void updateCache();
	/* These functions are here just for test purposes and serve no purpose START */
	static void temp() {
	}
	virtual void temp1() const {
	}
	std::map<std::string, std::string> l(std::map<std::string, std::string> a1, std::map<std::string, std::string> a2) {
		return std::map<std::string, std::string>();
	}
	/* END */
	bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif);
};

class TeBkUmLpqAsyncRouterPooled : public TeBkUmLpqAsyncRouter {
	LibpqDataSourceImpl* getDb(int max = 0);
	std::atomic<int> opt;
	bool inited;
	int maxconns;
	std::vector<LibpqDataSourceImpl*> pool;
public:
	TeBkUmLpqAsyncRouterPooled& operator=(const TeBkUmLpqAsyncRouterPooled& a) {
		return *this;
	}
	TeBkUmLpqAsyncRouterPooled(const TeBkUmLpqAsyncRouterPooled& a) {
		this->opt = 0;
		this->inited = false;
		this->maxconns = 7;
	}
	TeBkUmLpqAsyncRouterPooled();
	virtual ~TeBkUmLpqAsyncRouterPooled();
};

#endif /* WEB_t1_INCLUDE_TeBkUmLpqAsync_H_ */


text:
import pytest

from ray.air.config import (
    ScalingConfig,
    DatasetConfig,
    FailureConfig,
    CheckpointConfig,
    RunConfig,
)
from ray.air.constants import MAX_REPR_LENGTH

@pytest.mark.parametrize(
    "config",
    [
        ScalingConfig(),
        ScalingConfig(use_gpu=True),
        DatasetConfig(),
        DatasetConfig(fit=True),
        FailureConfig(),
        FailureConfig(max_failures=2),
        CheckpointConfig(),
        CheckpointConfig(num_to_keep=1),
        RunConfig(),
        RunConfig(name="experiment"),
        RunConfig(failure_config=FailureConfig()),
    ],
)
def test_repr(config):
    representation = repr(config)

    assert eval(representation) == config
    assert len(representation) < MAX_REPR_LENGTH

if __name__ == "__main__":
    import sys

    import pytest

    sys.exit(pytest.main(["-v", "-x", __file__]))


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:background="@color/light_grey_color"
    android:descendantFocusability="blocksDescendants" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="24dp"
        android:layout_height="28dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"
        android:focusable="false"
        android:focusableInTouchMode="false" />

    <TextView
        android:id="@+id/country_code"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="10dp"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:singleLine="true"
        android:text="+92"
        android:textColor="@color/_777777" />

    <TextView
        android:id="@+id/country_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@+id/imageView1"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:paddingBottom="10dp"
        android:paddingTop="10dp"
        android:singleLine="true"
        android:text="Pakistan"
        android:textColor="@color/_4d4d4d" />

</RelativeLayout>


text:
import sys
import random
import math
from sets import Set

# adds node attribute of which shard node should be placed on
num_shards = 8
num_runs = 1
capacity = 84000/num_shards
assignments = dict()
shard_sizes = [0] * num_shards
LDG = True
G = {}

def load(argv):
    assert(len(argv) == 2)
    print 'loading graph from file'
    inputfile = open(argv[1], 'r')
    for line in inputfile:
        if line[0] == '#': # ignore comments
            continue
        edge = line.split()
        assert(len(edge) == 2)
        n0 = int(edge[0])
        n1 = int(edge[1])
        if n0 not in G:
            G[n0] = Set([])
        if n1 not in G:
            G[n1] = Set([])
        G[n0].add(n1)
    inputfile.close()

def get_balanced_assignment(tied_shards):
    min_size = shard_sizes[tied_shards[0]] #pick one as min
    min_indices = []
    for s in tied_shards:
        if shard_sizes[s] < min_size:
            min_size = shard_sizes[s]
            min_indices = [s]
        elif shard_sizes[s] == min_size:
            min_indices.append(s)

    assert(len(min_indices) > 0)
    return random.choice(min_indices)

def penalty(shard):
    return 1.0 - (float(shard_sizes[shard])/float(capacity))

def get_intersection_scores(node):
    shard_scores = [0] * num_shards
    for nbr in G[node]:
        if nbr in assignments:
            shard_scores[assignments[nbr]] += 1
    return shard_scores

def clustering_multiplier(num_mutual_friends):
    return math.log(2 + num_mutual_friends)

def calc_mutual_friends(n1, n2):
    return len(G[n1] & G[n2])

def get_clustering_scores(node):
    shard_scores = [0] * num_shards
    for nbr in G[node]:
        if nbr in assignments:
            mutual_friends = calc_mutual_friends(node, nbr)
            shard_scores[assignments[nbr]] += clustering_multiplier(mutual_friends)
    return shard_scores

def get_ldg_assignment(node):
    if LDG:
        shard_scores = get_intersection_scores(node)
    else:
        shard_scores = get_clustering_scores(node)

    arg_max = 0.0
    max_indices = []
    for i in range(num_shards):
        val = (float(shard_scores[i])*penalty(i))
        if arg_max < val:
            arg_max = val
            max_indices = [i]
        elif arg_max == val:
            max_indices.append(i)

    assert(len(max_indices) > 0)
    if len(max_indices) is 1:
        return max_indices[0]
    else:
        return get_balanced_assignment(max_indices)

def get_hash_assignment(node):
    return node % num_shards

print 'partitioning graph onto ' + str(num_shards) + ' shards using LDG with a capacity constant of ' + str(capacity)
load(sys.argv)
for run in range(num_runs):
    moved = 0
    for n in G:
        orig_loc = -1
        if n in assignments:
            shard_sizes[assignments[n]] -= 1
            orig_loc = assignments[n]
        put_on_shard = get_ldg_assignment(n)
        #put_on_shard = get_hash_assignment(n)
        assignments[n] = put_on_shard
        shard_sizes[put_on_shard] += 1
        if orig_loc != -1 and orig_loc != put_on_shard:
            moved += 1
    print 'Completed run ' + str(run) + ', moved node count = ' + str(moved)
    print shard_sizes

'''
colors = [float(assignments[n])/float(num_shards) for n in G.nodes()]
print 'trying to draw graph...'
nx.draw_circular(G, node_color=colors)
plt.show()
'''

fname = sys.argv[1].rsplit('.',1)
if len(fname) == 1:
    fileout = open(fname[0] + '-partitioned.', 'w')
else:
    fileout = open(fname[0] + '-partitioned.' + fname[1], 'w')
fileout.write('#' + str(len(assignments)) + '\n')
for (k,v) in assignments.iteritems():
    fileout.write(str(k) + ' '  + str(v) + '\n')
for n in G:
    for nbr in G[n]:
        line = str(n) + ' ' + str(nbr)
        if random.random() > 0.9:
            line += ' color blue\n'
        else:
            line += '\n'
        fileout.write(line)
fileout.close()
print 'finshed writing assignments'


text:
**Ensure your data is valid as soon as it's received**

Instead of having your data validation and sanitization logic written as lengthy code, you can declare the requirements to your data with concise, easy to read and cross-platform [JSON Schema](https://json-schema.org) or [JSON Type Definition](https://jsontypedef.com) specifications and validate the data as soon as it arrives to your application.

TypeScript users can use validation functions as type guards, having type level guarantee that if your data is validated - it is correct.

Read more in [Getting started](./getting-started.md) and [Using with TypeScript](./typescript.md)

## Super fast & secure

**Compiles your schemas to optimized JavaScript code**

Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.

Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks:

- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place
- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster
- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)

Ajv was designed at the time when there were no validators fully complying with JSON Schema specification, aiming to achieve the best possibly validation performance via just-in-time compilation of JSON schemas to code. Ajv achieved both speed and rigour, but initially security was an afterthought - many security flaws have been fixed thanks to the reports from its users.

Ajv version 7 was rebuilt to have secure code generation embedded in its design as the primary objective - even if you use untrusted schemas (which is still not recommended) there are type-level guarantees against remote code execution.

Read more in [Code generation design](../codegen.md)

## Multi-standard

**Use JSON Type Definition or JSON Schema**

In addition to the multiple [JSON Schema](../json-schema.md) drafts, including the latest draft 2020-12, Ajv has support for [JSON Type Definition](../json-type-definition.md) - a new [RFC8927](https://datatracker.ietf.org/doc/rfc8927/) that offers a much simpler alternative to JSON Schema. Designed to be well-aligned with type systems, JTD has tools for both validation and type code generation for multiple languages.

Read more in [Choosing schema language](./schema-language.md)


text:
<!doctype html>

        <meta charset="utf-8"/>
        <meta http-equiv="x-ua-compatible" content="ie=edge"/>
        <title>Web Development Notebook</title>
        <meta name="box assignment" content="lesson learned"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>

        <link rel="apple-touch-icon" href="apple-touch-icon.png"/>

        <link rel="stylesheet" href="css/normalize.css"/>
        <link rel="stylesheet" href="css/main.css"/>

Web Development Notebook

Kaylani.sung@gmail.com

GitHub

Linkedin

Journal

My Goals

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Week 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

I hate git

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

My Goals

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Week 1

                            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

I hate git

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

My Goals

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Week 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

I hate git

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

My Goals

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Week 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

I hate git

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

            Copyright Kaylani Sung © 2015

Hello world! This is HTML5 Boilerplate.


text:
/* HIT_START
 * BUILD: %t %s ../../test_common.cpp
 * HIT_END
 */

#include <cstdio>
#include "hip/hip_runtime.h"

__global__ void Kernel(volatile float* hostRes) {
    int tid = threadIdx.x + blockIdx.x * blockDim.x;
    hostRes[tid] = tid + 1;
    __threadfence_system();
    // expecting that the data is getting flushed to host here!
    // time waster for-loop (sleep)
    for (int timeWater = 0; timeWater < 100000000; timeWater++)
        ;
}

int main() {
    size_t blocks = 2;
    volatile float* hostRes;
    hipHostMalloc((void**)&hostRes, blocks * sizeof(float), hipHostMallocMapped);
    hostRes[0] = 0;
    hostRes[1] = 0;
    hipLaunchKernelGGL(HIP_KERNEL_NAME(Kernel), dim3(1), dim3(blocks), 0, 0, hostRes);
    int eleCounter = 0;
    while (eleCounter < blocks) {
        // blocks until the value changes
        while (hostRes[eleCounter] == 0)
            ;
        printf("%f\n", hostRes[eleCounter]);
        ;
        eleCounter++;
    }
    hipHostFree((void*)hostRes);
    return 0;
}


text:
package java8.mooc.week01;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.stream.*;

/**
 * @author Speakjava (simon.ritter@oracle.com)
 */
public class Lesson1Hw {
    /**
     * Run the exercises to ensure we got the right answers
     */
    public void runExercises() {
        System.out.println("JDK 8 Lambdas and Streams MOOC Lesson 1");
        System.out.println("Running exercise 1 solution...");
        exercise1();
        System.out.println("Running exercise 2 solution...");
        exercise2();
        System.out.println("Running exercise 3 solution...");
        exercise3();
        System.out.println("Running exercise 4 solution...");
        exercise4();
        System.out.println("Running exercise 5 solution...");
        exercise5();
    }

    /**
     * All exercises should be completed using Lambda expressions and the new
     * methods added to JDK 8 where appropriate. There is no need to use an
     * explicit loop in any of the code. Use method references rather than full
     * lambda expressions wherever possible.
     */
    /**
     * Exercise 1
     *
     * Create a string that consists of the first letter of each word in the list
     * of Strings provided.
     */
    private void exercise1() {
        List<String> list = Arrays.asList(
                "alpha", "bravo", "charlie", "delta", "echo", "foxtrot");

        String string = list.stream()
                .map(s -> s.substring(0, 1))
                .reduce(
                        "",
                        (a, b) -> a + b
                );
        System.out.println(string);
    }

    /**
     * Exercise 2
     *
     * Remove the words that have odd lengths from the list.
     */
    private void exercise2() {
        List<String> list = new ArrayList<>(Arrays.asList(
                "alpha", "bravo", "charlie", "delta", "echo", "foxtrot"));

        list.removeIf(s -> s.length() % 2 != 0);
        System.out.println(list);
    }

    /**
     * Exercise 3
     *
     * Replace every word in the list with its upper case equivalent.
     */
    private void exercise3() {
        List<String> list = new ArrayList<>(Arrays.asList(
                "alpha", "bravo", "charlie", "delta", "echo", "foxtrot"));

        List<String> upperCaseList = list.stream()
                .map(String::toUpperCase)
                .collect(Collectors.toList());

        System.out.println(upperCaseList);
    }

    /**
     * Exercise 4
     *
     * Convert every key-value pair of the map into a string and append them all
     * into a single string, in iteration order.
     */
    private void exercise4() {
        Map<String, Integer> map = new TreeMap<>();
        map.put("c", 3);
        map.put("b", 2);
        map.put("a", 1);

        String string =map.entrySet().stream()
                .map(entry -> entry.getKey() + entry.getValue())
                .reduce("", String::concat);
        System.out.println(string);
    }

    /**
     * Exercise 5
     *
     * Create a new thread that prints the numbers from the list.
     */
    private void exercise5() {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

        new Thread( () ->
            list.forEach(System.out::println)
        ).start();
    }

    /**
     * Main entry point for application
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Lesson1Hw lesson = new Lesson1Hw();
        lesson.runExercises();
    }
}


text:
/* Added for Tor. */
#ifndef SRC_EXT_ED25519_DONNA_H_INCLUDED_
#define SRC_EXT_ED25519_DONNA_H_INCLUDED_
#include <torint.h>

typedef unsigned char curved25519_key[32];

int ed25519_sign_open_batch_donna(const unsigned char **m, size_t *mlen, const unsigned char **pk, const unsigned char **RS, size_t num, int *valid);
void curved25519_scalarmult_basepoint_donna(curved25519_key pk, const curved25519_key e);

/* Tor specific interface to match the `ref10` glue code. */
int ed25519_donna_selftest(void);
int ed25519_donna_seckey(unsigned char *sk);
int ed25519_donna_seckey_expand(unsigned char *sk, const unsigned char *sk_seed);
int ed25519_donna_pubkey(unsigned char *pk, const unsigned char *sk);
int ed25519_donna_keygen(unsigned char *pk, unsigned char *sk);

int ed25519_donna_open(const unsigned char *signature, const unsigned char *m,
  size_t mlen, const unsigned char *pk);

int ed25519_donna_sign(unsigned char *sig, const unsigned char *m, size_t mlen,
  const unsigned char *sk, const unsigned char *pk);

int ed25519_donna_blind_secret_key(unsigned char *out, const unsigned char *inp,
  const unsigned char *param);

int ed25519_donna_blind_public_key(unsigned char *out, const unsigned char *inp,
  const unsigned char *param);

int ed25519_donna_pubkey_from_curve25519_pubkey(unsigned char *out,
  const unsigned char *inp, int signbit);

int
ed25519_donna_scalarmult_with_group_order(unsigned char *out,
                                          const unsigned char *pubkey);

#endif


text:
<!doctype html>
<!--
This file is part of the BBx-Kitchen/bbx-linear-gauge
(c) Basis Europe <eu@basis.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<html>
<head>
  <title>BBX Linear-gauge</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="../webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="../iron-component-page/iron-component-page.html">
</head>
<body>
  <iron-component-page></iron-component-page>
</body>
</html>


text:
require 'chef/knife'
require 'json'

class Chef
  class Knife
    class GogridServerList < Knife

      banner "knife gogrid server list (options)"

      def h
        @highline ||= HighLine.new
      end

      def run
        require 'fog'
        require 'highline'
        require 'net/ssh/multi'
        require 'readline'

        connection = Fog::Compute::GoGrid.new(
          :go_grid_api_key => Chef::Config[:knife][:go_grid_api_key],
          :go_grid_shared_secret => Chef::Config[:knife][:go_grid_shared_secret]
        )

        servers  = connection.servers.inject({}) { |h,i| h[i.id] = i.description; h }
        images   = connection.images.inject({}) { |h,i| h[i.id] = i.os; h }

        server_list = [ h.color('id', :bold), h.color('name', :bold), h.color('ip', :bold), h.color('os', :bold) ]

        connection.servers.each do |server|
          server_list << server.id.to_s
          server_list << server.name
          server_list << server.ip["ip"]
          server_list << images[server.image_id]["name"].to_s
        end
        puts h.list(server_list, :columns_across, 4)

      end
    end
  end
end