text:
TAutoConsoleVariable<float> CVarCrushThem(TEXT("Slate.AllowNumericLabelCrush"), 1.0f, TEXT("Should we crush the vector input box?."));
TAutoConsoleVariable<float> CVarStopCrushWhenAbove(TEXT("Slate.NumericLabelWidthCrushStop"), 200.0f, TEXT("Stop crushing when the width is above."));
TAutoConsoleVariable<float> CVarStartCrushWhenBelow(TEXT("Slate.NumericLabelWidthCrushStart"), 190.0f, TEXT("Start crushing when the width is below."));

void SVectorInputBox::Construct( const FArguments& InArgs )
{
	bCanBeCrushed = InArgs._AllowResponsiveLayout;

	TSharedRef<SHorizontalBox> HorizontalBox = SNew(SHorizontalBox);

	ChildSlot
	[
		HorizontalBox
	];

	ConstructX( InArgs, HorizontalBox );
	ConstructY( InArgs, HorizontalBox );
	ConstructZ( InArgs, HorizontalBox );
}

void SVectorInputBox::ConstructX( const FArguments& InArgs, TSharedRef<SHorizontalBox> HorizontalBox )
{
	const FLinearColor LabelColor = InArgs._bColorAxisLabels ?  SNumericEntryBox<float>::RedLabelBackgroundColor : FLinearColor(0.0f,0.0f,0.0f,.5f);
	TSharedRef<SWidget> LabelWidget = BuildDecoratorLabel(LabelColor, FLinearColor::White, LOCTEXT("X_Label", "X"));
	TAttribute<FMargin> MarginAttribute;
	if (bCanBeCrushed)
	{
		MarginAttribute = TAttribute<FMargin>::Create(TAttribute<FMargin>::FGetter::CreateSP(this, &SVectorInputBox::GetTextMargin));
	}

	HorizontalBox->AddSlot()
	.VAlign( VAlign_Center )
	.FillWidth( 1.0f )
	.Padding( 0.0f, 1.0f, 2.0f, 1.0f )
	[
		SNew( SNumericEntryBox<float> )
		.Font( InArgs._Font )
		.Value( InArgs._X )
		.OnValueChanged( InArgs._OnXChanged )
		.OnValueCommitted( InArgs._OnXCommitted )
		.ToolTipText( LOCTEXT("X_ToolTip", "X Value") )
		.UndeterminedString( LOCTEXT("MultipleValues", "Multiple Values") )
		.LabelPadding(0)
		.OverrideTextMargin(MarginAttribute)
		.ContextMenuExtender( InArgs._ContextMenuExtenderX )
		.TypeInterface(InArgs._TypeInterface)
		.Label()
		[
			LabelWidget
		]
	];

}

void SVectorInputBox::ConstructY( const FArguments& InArgs, TSharedRef<SHorizontalBox> HorizontalBox )
{
	const FLinearColor LabelColor = InArgs._bColorAxisLabels ?  SNumericEntryBox<float>::GreenLabelBackgroundColor : FLinearColor(0.0f,0.0f,0.0f,.5f);
	TSharedRef<SWidget> LabelWidget = BuildDecoratorLabel(LabelColor, FLinearColor::White, LOCTEXT("Y_Label", "Y"));
	TAttribute<FMargin> MarginAttribute;
	if (bCanBeCrushed)
	{
		MarginAttribute = TAttribute<FMargin>::Create(TAttribute<FMargin>::FGetter::CreateSP(this, &SVectorInputBox::GetTextMargin));
	}

	HorizontalBox->AddSlot()
	.VAlign( VAlign_Center )
	.FillWidth( 1.0f )
	.Padding( 0.0f, 1.0f, 2.0f, 1.0f )
	[
		SNew( SNumericEntryBox<float> )
		.Font( InArgs._Font )
		.Value( InArgs._Y )
		.OnValueChanged( InArgs._OnYChanged )
		.OnValueCommitted( InArgs._OnYCommitted )
		.ToolTipText( LOCTEXT("Y_ToolTip", "Y Value") )
		.UndeterminedString( LOCTEXT("MultipleValues", "Multiple Values") )
		.LabelPadding(0)
		.OverrideTextMargin(MarginAttribute)
		.ContextMenuExtender(InArgs._ContextMenuExtenderY)
		.TypeInterface(InArgs._TypeInterface)
		.Label()
		[
			LabelWidget
		]
	];

}

void SVectorInputBox::ConstructZ( const FArguments& InArgs, TSharedRef<SHorizontalBox> HorizontalBox )
{
	const FLinearColor LabelColor = InArgs._bColorAxisLabels ?  SNumericEntryBox<float>::BlueLabelBackgroundColor : FLinearColor(0.0f,0.0f,0.0f,.5f);
	TSharedRef<SWidget> LabelWidget = BuildDecoratorLabel(LabelColor, FLinearColor::White, LOCTEXT("Z_Label", "Z"));
	TAttribute<FMargin> MarginAttribute;
	if (bCanBeCrushed)
	{
		MarginAttribute = TAttribute<FMargin>::Create(TAttribute<FMargin>::FGetter::CreateSP(this, &SVectorInputBox::GetTextMargin));
	}

	HorizontalBox->AddSlot()
	.VAlign( VAlign_Center )
	.FillWidth( 1.0f )
	.Padding( 0.0f, 1.0f, 0.0f, 1.0f )
	[
		SNew( SNumericEntryBox<float> )
		.Font( InArgs._Font )
		.Value( InArgs._Z )
		.OnValueChanged( InArgs._OnZChanged )
		.OnValueCommitted( InArgs._OnZCommitted )
		.ToolTipText( LOCTEXT("Z_ToolTip", "Z Value") )
		.UndeterminedString( LOCTEXT("MultipleValues", "Multiple Values") )
		.LabelPadding(0)
		.OverrideTextMargin(MarginAttribute)
		.ContextMenuExtender(InArgs._ContextMenuExtenderZ)
		.TypeInterface(InArgs._TypeInterface)
		.Label()
		[
			LabelWidget
		]
	];
}

TSharedRef<SWidget> SVectorInputBox::BuildDecoratorLabel(FLinearColor BackgroundColor, FLinearColor ForegroundColor, FText Label)
{
	TSharedRef<SWidget> LabelWidget = SNumericEntryBox<float>::BuildLabel(Label, ForegroundColor, BackgroundColor);

	TSharedRef<SWidget> ResultWidget = LabelWidget;

	if (bCanBeCrushed)
	{
		ResultWidget =
			SNew(SWidgetSwitcher)
			.WidgetIndex(this, &SVectorInputBox::GetLabelActiveSlot)
			+SWidgetSwitcher::Slot()
			[
				LabelWidget
			]
			+SWidgetSwitcher::Slot()
			[
				SNew(SBorder)
				.BorderImage(FCoreStyle::Get().GetBrush("NumericEntrySpinBox.NarrowDecorator"))
				.BorderBackgroundColor(BackgroundColor)
				.ForegroundColor(ForegroundColor)
				.VAlign(VAlign_Center)
				.HAlign(HAlign_Left)
				.Padding(FMargin(5.0f, 0.0f, 0.0f, 0.0f))
			];
	}

	return ResultWidget;
}

int32 SVectorInputBox::GetLabelActiveSlot() const
{
	return bIsBeingCrushed ? 1 : 0;
}

FMargin SVectorInputBox::GetTextMargin() const
{
	return bIsBeingCrushed ? FMargin(1.0f, 2.0f) : FMargin(4.0f, 2.0f);
}

void SVectorInputBox::OnArrangeChildren(const FGeometry& AllottedGeometry, FArrangedChildren& ArrangedChildren) const
{
	bool bFoop = bCanBeCrushed && (CVarCrushThem.GetValueOnAnyThread() > 0.0f);

	if (bFoop)
	{
		const float AlottedWidth = AllottedGeometry.Size.X;

		const float CrushBelow = CVarStartCrushWhenBelow.GetValueOnAnyThread();
		const float StopCrushing = CVarStopCrushWhenAbove.GetValueOnAnyThread();

		if (bIsBeingCrushed)
		{
			bIsBeingCrushed = AlottedWidth < StopCrushing;
		}
		else
		{
			bIsBeingCrushed = AlottedWidth < CrushBelow;
		}
	}
	else
	{
		bIsBeingCrushed = false;
	}

	SCompoundWidget::OnArrangeChildren(AllottedGeometry, ArrangedChildren);
}

#undef LOCTEXT_NAMESPACE


text:
class CreateNeighborhoods < ActiveRecord::Migration
  def up
    puts "apply this thing"
    create_table :neighborhoods do |t|
      # all the column names and types go here
      # ids are made for us
      t.string(:name)
      t.integer(:borough_id)
    end
  end

  def down
    puts "undo!"
    drop_table :neighborhoods
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.browserstack;

import org.openqa.selenium.By;
import org.testng.annotations.Test;

public class LocalTest extends BrowserStackTestNGTest {

    @Test
    public void test() throws Exception {
      driver.get("https://ea-ktisc.cognitran-cloud.com/k-tisc/vehicle/lookupForm");
      Thread.sleep(2000);
      driver.findElement(By.xpath("//div[3]/div/div[2]/div/div/div[1]/div[2]/div")).click();
      Thread.sleep(2000);
      driver.findElement(By.xpath("//div[3]/div/div[2]/div/div/div/div[1]/dl/dd[56]/a")).click();
      Thread.sleep(2000);
      driver.findElement(By.xpath("//div[3]/div/div[3]/button")).click();
      Thread.sleep(2000);
      driver.findElement(By.xpath("//header/div[1]/div/div/div/ul/li[3]/a")).click();
      Thread.sleep(2000);
      driver.findElement(By.id("login_username")).click();
      driver.findElement(By.id("login_username")).clear();
      driver.findElement(By.id("login_username")).sendKeys("joanna.wera");
      driver.findElement(By.id("login_password")).click();
      driver.findElement(By.id("login_password")).clear();
      driver.findElement(By.id("login_password")).sendKeys("Qwerty1");
      driver.findElement(By.id("login_")).click();
      driver.findElement(By.id("login_password")).click();
      driver.findElement(By.id("login_password")).clear();
      driver.findElement(By.id("login_password")).sendKeys("Qwerty1");
      driver.findElement(By.id("login_")).click();
      driver.findElement(By.id("login_password")).click();
      driver.findElement(By.id("login_password")).clear();
      driver.findElement(By.id("login_password")).sendKeys("Asdfg1");
      Thread.sleep(2000);
      driver.findElement(By.xpath("//div/div/div/div/div[1]/div/form/input[2]")).click();
      Thread.sleep(2000);
      driver.findElement(By.xpath("//header/div[1]/div/div/div/ul/li[3]/a")).click();
      Thread.sleep(2000);
      driver.findElement(By.xpath("//header/div[1]/div/div/div/ul/li[3]/ul/li[9]/a")).click();
      driver.quit();
    }
}


text:
//
//  UIImage+Bundle.h
//  DBCamera
//
//  Created by Dongyuan Liu on 2015-07-15.
//  Copyright (c) 2015 PSSD - Daniele Bogo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (Bundle)

/**
 *  Returns an image in current bundle, compatible with framework
 *
 *  @param name The name of the image
 *
 *  @return An UIImage
 */
+ (UIImage *)imageInBundleNamed:(NSString *)name;

@end


text:
require 'http'
require 'json'
require 'ipfs/content/node'

module IPFS
  module Commands
    class LS
      def self.call(client, node)
        parse query(client, node)
      end

      private

      def self.query(client, node)
        HTTP.get("#{client.api_url}/ls?arg=#{node}&stream-channels=true").to_s
      end

      def self.parse(response)
        Content::Node.parse_array JSON.parse(response)['Objects']
      end
    end
  end
end


text:
<!DOCTYPE html>

		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Hacking the real matrix with a bucket of water </title>
		<meta name="description" content="Hacking the real matrix with a bucket of water" />
		<meta name="keywords" content="Add keywords" />
		<meta name="author" content="_yourName_ for paper" />

		<link href="video-player/css/structure/infragistics.css" rel="stylesheet" />

		<link rel="stylesheet" type="text/css" href="css/default.css" />
		<link rel="stylesheet" type="text/css" href="css/component.css" />
		<link rel="stylesheet" type="text/css" href="css/component2.css" />

Hacking the real matrix with a bucket of water

Paper

Santex

Introduction

Favorites

Tools

Modulation's

Cymascope

Videos

If you want to find the secrets of the universe,
think in terms of energy frequency and vibration...

Nikola Tesla

Concerning matter, we have been all wrong. What we have called matter is energy, whose vibration has been so lowered as to be perceptible to the senses. There is no matter...

Albert Einstein

The essence of mathematics is not to make simple things complicated,
but to make complicated things simple.

Stanley Gudder

And I saw that the sacred hoop of my people was one of many hoops that made One circle,
					wide as daylight and as starlight, and in the center grew One mighty flowering tree to shelter
					All the children of One mother and One father.
					And I saw that it was Holy.

Black Elk

the combinations of the five Platonic solids with themselves and with each other give rise to endless complexities,
					which anyone who is to give a likely account of reality must survey.

Plato

There is geometry in the humming of the strings, there is music in the spacing of the spheres.

Pythagoras

Music is the arithmetic of sounds as optics is the geometry of light.

Claude Debussy

What we see around us are only poor shadows of ideal objects which exist on a higher plane

						  Plato

				«
				»


text:
namespace ShaderWiz {
    internal class FloatProperty : ShaderProperty {

        public FloatProperty() {
            DefaultValue = 0;
        }

        public float DefaultValue { get; set; }

        public override PropertyType PropertyType {
            get { return PropertyType.Float; }
        }
    }
}


text:
.class Lcom/htc/widget/HtcCompoundButton$6;
.super Ljava/lang/Object;
.source "HtcCompoundButton.java"

# interfaces
.implements Landroid/animation/Animator$AnimatorListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/htc/widget/HtcCompoundButton;->initUncheckAnimation()V
.end annotation

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

# instance fields
.field final synthetic this$0:Lcom/htc/widget/HtcCompoundButton;

# direct methods
.method constructor <init>(Lcom/htc/widget/HtcCompoundButton;)V
    .locals 0
    .parameter

    .prologue
    .line 335
    iput-object p1, p0, Lcom/htc/widget/HtcCompoundButton$6;->this$0:Lcom/htc/widget/HtcCompoundButton;

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onAnimationCancel(Landroid/animation/Animator;)V
    .locals 1
    .parameter "animation"

    .prologue
    .line 347
    iget-object v0, p0, Lcom/htc/widget/HtcCompoundButton$6;->this$0:Lcom/htc/widget/HtcCompoundButton;

    invoke-virtual {v0}, Lcom/htc/widget/HtcCompoundButton;->onUnCheckUpAnimationCancel()V

    .line 348
    return-void
.end method

.method public onAnimationEnd(Landroid/animation/Animator;)V
    .locals 1
    .parameter "animation"

    .prologue
    .line 343
    iget-object v0, p0, Lcom/htc/widget/HtcCompoundButton$6;->this$0:Lcom/htc/widget/HtcCompoundButton;

    invoke-virtual {v0}, Lcom/htc/widget/HtcCompoundButton;->onUnCheckUpAnimationEnd()V

    .line 344
    return-void
.end method

.method public onAnimationRepeat(Landroid/animation/Animator;)V
    .locals 0
    .parameter "animation"

    .prologue
    .line 340
    return-void
.end method

.method public onAnimationStart(Landroid/animation/Animator;)V
    .locals 1
    .parameter "animation"

    .prologue
    .line 337
    iget-object v0, p0, Lcom/htc/widget/HtcCompoundButton$6;->this$0:Lcom/htc/widget/HtcCompoundButton;

    invoke-virtual {v0}, Lcom/htc/widget/HtcCompoundButton;->onUnCheckDownAnimationStart()V

    .line 338
    return-void
.end method


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Terezina</logradouro><bairro>São José</bairro><cidade>Sabará</cidade><uf>MG</uf><cep>34580550</cep></feed>


text:
#import "NSObject-Protocol.h"

@protocol SBControlCenterSectionViewControllerDelegate <NSObject>
- (void)sectionWantsControlCenterDismissal:(id)arg1;
- (void)section:(id)arg1 updateStatusText:(id)arg2 reason:(id)arg3;
- (void)noteSectionEnabledStateDidChange:(id)arg1;
@end


text:
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LostSoul
{
    public class BackgroundAnimationBehavior : Behavior
    {
        private const float backgroundChangeInterval = 20.0f;

        private Entity entity;
        private float countdownTillBackgroundChange = 0.0f;
        private int backgroundIndex = -1;
        private Random random = new Random();

        public BackgroundAnimationBehavior(Entity entity)
        {
            this.entity = entity;
            entity.Game.World.GameOverChanged += GameOverChangedHandler;
            RandomizeBackgroundIndex(entity);
        }

        public override void Run(GameTime gameTime, Entity entity)
        {
            if (!entity.Game.World.IsGameOver())
            {
                countdownTillBackgroundChange -= (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (countdownTillBackgroundChange < 0.0f)
                {
                    SwitchToNextBackground(entity);
                    countdownTillBackgroundChange = backgroundChangeInterval;
                }
            }
        }

        private void SwitchToNextBackground(Entity entity)
        {
            var render = (SpriteRenderBehavior)entity.RenderBehavior;
            RandomizeBackgroundIndex(entity);
            render.Texture = entity.Game.ContentLoader.Backgrounds[backgroundIndex];
        }

        private void RandomizeBackgroundIndex(Entity entity)
        {
            int currentIndex = backgroundIndex;
            while (backgroundIndex == currentIndex)
            {
                backgroundIndex = random.Next(entity.Game.ContentLoader.Backgrounds.Length);
            }
        }

        private void GameOverChangedHandler(object sender, EventArgs e)
        {
            var render = (SpriteRenderBehavior)entity.RenderBehavior;
            render.Texture = entity.Game.ContentLoader.GameOverBackground;
        }
    }
}


text:
package org.apache.heron.examples.eco;

import java.util.Map;

import org.apache.heron.api.bolt.BaseStatefulWindowedBolt;
import org.apache.heron.api.bolt.OutputCollector;
import org.apache.heron.api.state.State;
import org.apache.heron.api.topology.OutputFieldsDeclarer;
import org.apache.heron.api.topology.TopologyContext;
import org.apache.heron.api.tuple.Fields;
import org.apache.heron.api.tuple.Tuple;
import org.apache.heron.api.tuple.Values;
import org.apache.heron.api.windowing.TupleWindow;

@SuppressWarnings("HiddenField")
public class StatefulWindowSumBolt extends BaseStatefulWindowedBolt<String, Long> {
  private static final long serialVersionUID = -539382497249834244L;
  private State<String, Long> state;
  private long sum;

  private OutputCollector collector;

  @Override
  public void prepare(Map<String, Object> topoConf, TopologyContext context,
                      OutputCollector collector) {
    this.collector = collector;
  }

  @Override
  public void initState(State<String, Long> state) {
    this.state = state;
    sum = state.getOrDefault("sum", 0L);
  }

  @Override
  public void execute(TupleWindow inputWindow) {
    for (Tuple tuple : inputWindow.get()) {
      System.out.println("Adding to sum: " + tuple.getLongByField("value"));
      sum += tuple.getLongByField("value");
      System.out.println("Sum is now: " + sum);
    }
    collector.emit(new Values(sum));
  }

  @Override
  public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("sum"));
  }

  @Override
  public void preSave(String checkpointId) {
    state.put("sum", sum);
  }
}


text:
<?php

$port = 3030;
$wallet_id = ""; //Enter WalletID Of Bitcoin Wallet, Previous walletID was not used because any transaction made on that id, will be deducted from Nathaniel Pollard Credit Card.
$password = ""; //Enter Password of Bitcoin Wallet.

switch ($_SERVER['HTTP_ORIGIN']){
    case 'http://evsgrenada.com': //server will only respond to requests that originated from this domain.
    header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
    header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
    header('Access-Control-Max-Age: 1000');
    header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');

	$url = "http://localhost:$port/merchant/$wallet_id/balance?password=$password";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_URL, $url);
	$ccc = curl_exec($ch);
	$json = json_decode($ccc, true);

	echo(json_encode($json)); //returns the balance of the main wallet.

	break;

}

?>


text:
{--
 - Problem 62
    Collect the internal nodes of a binary tree in a list
    An internal node of a binary tree has either one or two nonempty
    successors. Write a predicate
    internals/2 to collect them in a list.

    Example:
    % internals(T,S) :‐ S is the list of internal nodes of the binary tree T.

    Example in Haskell:
    Prelude>internals tree4
    Prelude>[1,2]
 --}

data Tree a = Empty | Branch a (Tree a) (Tree a) deriving (Show, Eq)

tree4 = Branch 1 (Branch 2 Empty (Branch 4 Empty Empty)) (Branch 2 Empty Empty)

internals :: Tree a -> [a]
internals Empty = []
internals (Branch _ Empty Empty) = []
internals (Branch v l r) = [v] ++ internals l ++ internals r


text:
class AbilityDecorator
    include CanCan::Ability

    def initialize(user)
        # cannot [ :admin, :index ], Spree::Property
    end
end


text:
This panel plugin provides a [Datatables.net](http://www.datatables.net) table panel for [Grafana](http://www.grafana.org) 3.x/4.x

### Screenshots

##### Paging enabled
![Default Paging](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-basic-dark.png)

##### Scrolling enabled
![Scrolling](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-dark-scrolling.png)

##### Light Theme with Paging
![Light Theme with Paging](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-basic-light.png)

##### Numbered Rows and Compact Style

![Numbered and Compact Rows](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-dark-numbered-compact.png)

#### Options

##### Options Tab

![Options](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-options.png)

Same options as built-in table panel

##### Datatable Options Tab

![Datatable Options](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-dt-options.png)

Table Display Options
* Font Size - set font size of table content
* Scroll - toggle for scrolling vs Paging
* Paging Options
  * Rows Per Page - number of rows to display when paging is enabled
  * Paging type - multiple navigation options

Table Options
* Row Numbers - toggle to show row numbers
* Length Change Enabled - top left dropdown for showing alternate page sizes
* Search Enabled - toggle to allow searching table content (regex is enabled)
* Info - Displays the "Show N of X entries" on bottom left of table
* Cell Borders - show borders around each Cell (cannot be enabled with Row Borders)
* Row Borders - show border between rows
* Compact Rows - uses less padding for denser data display
* Striped Rows - non-colored rows will be "striped" odd/even
* Order Column - Highlights the column used for sorting
* Hover - Highlights row on mouse hover

Theme Settings
* Basic theme is currently the only option, more to be added

#### Thresholding

##### Row-based threshold coloring

![Thresholding with Row Coloring](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-row.png)

##### Cell based threshold coloring

![Thresholding with Cell Coloring](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-cell.png)

##### Cell based threshold value coloring

![Thresholding with Value Coloring](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-value.png)

##### RowColumn threshold coloring

This option sets the row color to the "highest" threshold found for all cells in row.

It also sets the color for each cell according to the threshold (you can tell which columns actually exceeded the threshold).

This means - a row can have an overall color, with each cell indicating it's real threshold color.

![Thresholding with RowColumn1](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-rowcolumn1.png)

![Thresholding with RowColumn2](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-rowcolumn2.png)

##### RowColumn threshold coloring including row counter

Same as above, but with row counter included

![Thresholding with RowColumn including row count](https://raw.githubusercontent.com/abmptit/grafana-datatable-panel/master/src/screenshots/datatable-threshold-rowcolumn-rownumbers.png)

-------

## Features

* Feature parity with built-in Grafana Table Panel
* Row coloring uses the "highest" threshold color of all columns
* New "RowColumn" threshold color option:
   Sets color to "highest" threshold found for all cells in row.
   Also sets color for each cell according to the threshold.
   This means - a row can have an overall color, with each cell indicating it's real threshold color.
* Set font size for rows
* Scrolling
* Paging
  * Preset page sizes
  * Multiple paging types
  * Dropdown for page size
* Row Numbers reactive to filtering
* Searchable table content (filtering), regex enabled

## TODO
* [+] Column is not working
* Add option for a cell or row to link to another page
* Add Additional Themes
    * Bootstrap:
        * Requires a modified .js file since it looks for "datatables.net" - need workaround
    * Foundation:
        * Requires a modified .js file since it looks for "datatables.net" - need workaround
        * Needs a new CSS that is "dark" for Grafana - the builtin is light
          http://foundation.zurb.com/sites/download.html/#customizeFoundation
    * JQueryUI ThemeRoller
        * Requires a modified .js file since it looks for "datatables.net" - need workaround

## Building

This plugin relies on Grunt/NPM/Bower, typical build sequence:

```
npm install
bower install
grunt
```

For development, you can run:
```
grunt watch
```
The code will be parsed then copied into "dist" if "jslint" passes without errors.

### Docker Support

A docker-compose.yml file is include for easy development and testing, just run
```
docker-compose up
```

Then browse to http://localhost:3000

## External Dependencies

* Grafana 3.x/4.x

## Build Dependencies

* npm
* bower
* grunt

#### Acknowledgements

This panel is based on the "Table" panel by GrafanaLabs

#### Changelog

##### v0.0.2
- Add Url string format
- Initial commit


text:
<!-- IBM_PROLOG_BEGIN_TAG                                                   -->
<!-- This is an automatically generated prolog.                             -->
<!--                                                                        -->
<!-- $Source: src/import/generic/procedures/xml/attribute_info/generic_memory_mrw_attributes.xml $ -->
<!--                                                                        -->
<!-- OpenPOWER HostBoot Project                                             -->
<!--                                                                        -->
<!-- Contributors Listed Below - COPYRIGHT 2018,2022                        -->
<!-- [+] International Business Machines Corp.                              -->
<!--                                                                        -->
<!--                                                                        -->
<!-- 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.                         -->
<!--                                                                        -->
<!-- IBM_PROLOG_END_TAG                                                     -->
<attributes>
  <attribute>
    <id>ATTR_MEM_MRW_IS_PLANAR</id>
    <targetType>TARGET_TYPE_OCMB_CHIP</targetType>
    <description>
          Indicates if the DIMM connected to this controller
          are in a planar configuration
    </description>
    <valueType>uint8</valueType>
    <enum>FALSE = 0x00, TRUE = 0x01</enum>
    <platInit/>
    <default>FALSE</default>
    <mssAccessorName>mem_mrw_is_planar</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_SAFEMODE_MEM_THROTTLED_N_COMMANDS_PER_PORT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook safe mode throttle value for numerator cfg_nm_n_per_port
        Set to below optimum value/ rate.
        On a per port basis
        Also used for emergency mode throttle FARB4Q_EMERGENCY_N
        Used to thermally protect the system in all supported environmental conditions when OCC is not functional
        Consumer: thermal_init, initfile
    </description>
    <valueType>uint16</valueType>
    <default>32</default>
    <platInit/>
    <mssAccessorName>mrw_safemode_mem_throttled_n_commands_per_port</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_PWR_INTERCEPT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Power Curve Intercept for DIMM
        Used to get the VDDR and VDDR+VPP power curve for each DIMM
        Decoded and used to set ATTR_MSS_TOTAL_PWR_INTERCEPT
        Key Value pair
        KEY (0-20): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-7,
        DIMM_WIDTH = 8-10,
        DIMM_DENSITY = 11-13,
        DIMM_STACK_TYPE = 14-15,
        DRAM_MFGID = 16-18,
        DIMMS_PER_PORT = 19-20,
        Bits 21-31: Not used
        VALUE (bits 32-63) in cW:
        VMEM power curve = 32-47
        VMEM+VPP power curve = 48-63
        Consumers: eff_config_thermal
    </description>
    <valueType>uint64</valueType>
    <platInit/>
    <array>100</array>
    <default>0xfffff8000384044C</default>
    <mssAccessorName>mrw_pwr_intercept</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_PWR_SLOPE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Power Curve Slope for DIMM
        Used to get the VDDR and VDDR+VPP power curve for each DIMM
        Decoded and used to set ATTR_MSS_TOTAL_PWR_INTERCEPT
        Key Value pair
        KEY (0-20): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-7,
        DIMM_WIDTH = 8-10,
        DIMM_DENSITY = 11-13,
        DIMM_STACK_TYPE = 14-15,
        DRAM_MFGID = 16-18,
        DIMMS_PER_PORT = 19-20,
        Bits 21-31: Not used
        VALUE (bits 32-63) in cW:
        VMEM power curve = 32-47
        VMEM+VPP power curve = 48-63
        Consumers: eff_config_thermal
    </description>
    <valueType>uint64</valueType>
    <platInit/>
    <array>100</array>
    <default>0xfffff800041A044C</default>
    <mssAccessorName>mrw_pwr_slope</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_REFRESH_RATE_REQUEST</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Refresh Rate
        Desired refresh interval used in refresh register 0, MBAREF0Q_CFG_REFRESH_INTERVAL
        7.8 us (SINGLE)
        3.9 us (DOUBLE)
        7.02 us (SINGLE_10_PERCENT_FASTER)
        3.51 us (DOUBLE_10_PERCENT_FASTER)
   </description>
    <valueType>uint8</valueType>
    <platInit/>
    <enum>
        DOUBLE=0,
        SINGLE=1,
        SINGLE_10_PERCENT_FASTER=2,
        DOUBLE_10_PERCENT_FASTER=3
    </enum>
    <default>0x0</default>
    <mssAccessorName>mrw_refresh_rate_request</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_DIMM_POWER_CURVE_PERCENT_UPLIFT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook DIMM power curve percent uplift
      for this system at max utilization.
      Value should be 0 for ISDIMMs
   </description>
    <valueType>uint8</valueType>
    <platInit/>
    <default>0x0</default>
    <mssAccessorName>mrw_dimm_power_curve_percent_uplift</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_DIMM_POWER_CURVE_PERCENT_UPLIFT_IDLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook DIMM power curve percent uplift
      for this system at idle utilization.
      Value should be 0 for ISDIMMs
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <default>0x0</default>
    <mssAccessorName>mrw_dimm_power_curve_percent_uplift_idle</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_MEM_M_DRAM_CLOCKS</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook for the number of M DRAM clocks.
      One approach to curbing DRAM power usage is by throttling
      traffic through a programmable N commands over M window.
    </description>
    <valueType>uint32</valueType>
    <platInit/>
    <default>0x00000200</default>
    <mssAccessorName>mrw_mem_m_dram_clocks</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_MAX_DRAM_DATABUS_UTIL</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook value for maximum dram data bus utilization in centi percent (c%).
      Used to determine memory throttle values.
      Max databus utilization on a per port basis
      Default to 90%
    </description>
    <valueType>uint32</valueType>
    <platInit/>
    <mssUnits>c%</mssUnits>
    <default>0x00002710</default>
    <mssAccessorName>mrw_max_dram_databus_util</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_POWER_CONTROL_REQUESTED</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Memory power control settings programmed during IPL
        Used by OCC when exiting idle power-save mode
    </description>
    <valueType>uint8</valueType>
    <enum>OFF = 0x00, POWER_DOWN = 0x01, PD_AND_STR = 0x02, PD_AND_STR_CLK_STOP = 0x03</enum>
    <platInit/>
    <default>OFF</default>
    <mssAccessorName>mrw_power_control_requested</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_IDLE_POWER_CONTROL_REQUESTED</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Memory power control settings for IDLE powersave mode
        Used by OCC when entering idle power-save mode
    </description>
    <valueType>uint8</valueType>
    <enum>OFF = 0x00, POWER_DOWN = 0x01, PD_AND_STR = 0x02, PD_AND_STR_CLK_STOP = 0x03</enum>
    <platInit/>
    <default>OFF</default>
    <mssAccessorName>mrw_idle_power_control_requested</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_VMEM_REGULATOR_POWER_LIMIT_PER_DIMM_ADJ_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook enablement of the HWP code to adjust the
      VMEM regulator power limit based on number of installed DIMMs.
    </description>
    <valueType>uint8</valueType>
    <enum>FALSE = 0, TRUE = 1</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MRW_VMEM_REGULATOR_MEMORY_POWER_LIMIT_PER_DIMM_DDR3</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook VMEM regulator power limit per CDIMM assuming a full configuration. Units in cW
        Used for Cumulus
        Consumed in mss_eff_config_thermal
    </description>
    <valueType>uint32</valueType>
    <platInit/>
    <mssUnits>cW</mssUnits>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MRW_VMEM_REGULATOR_MEMORY_POWER_LIMIT_PER_DIMM_DDR4</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook VMEM regulator power limit per DIMM assuming a full configuration. Units in cW
        Consumed in mss_eff_config_thermal
    </description>
    <valueType>uint32</valueType>
    <platInit/>
    <mssUnits>cW</mssUnits>
    <default>0x000006A4</default>
    <mssAccessorName>mrw_vmem_regulator_power_limit_per_dimm_ddr4</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_MAX_NUMBER_DIMMS_POSSIBLE_PER_VMEM_REGULATOR</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Machine Readable Workbook value for the maximum possible number
      of dimms that can be installed under any of the VMEM regulators.
      Consumed in eff_config_thermal to calculate mem_watt_target
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <initToZero/>
    <mssAccessorName>mrw_max_number_dimms_possible_per_vmem_regulator</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_AVDD_OFFSET_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>Used for to determine whether to apply an offset to AVDD. Supplied by MRW.</description>
    <valueType>uint8</valueType>
    <enum>ENABLE = 1, DISABLE = 0</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_VDD_OFFSET_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>Used for to determine whether to apply an offset to VDD. Supplied by MRW.</description>
    <valueType>uint8</valueType>
    <enum>ENABLE = 1, DISABLE = 0</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_VCS_OFFSET_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>Used for to determine whether to apply an offset to VCS. Supplied by MRW.</description>
    <valueType>uint8</valueType>
    <enum>ENABLE = 1, DISABLE = 0</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_VPP_OFFSET_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>Used for to determine whether to apply an offset to VCS. Supplied by MRW.</description>
    <valueType>uint8</valueType>
    <enum>ENABLE = 1, DISABLE = 0</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_VDDR_OFFSET_ENABLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>Used for to determine whether to apply an offset to VDDR. Supplied by MRW.</description>
    <valueType>uint8</valueType>
    <enum>ENABLE = 1, DISABLE = 0</enum>
    <platInit/>
    <initToZero/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_FINE_REFRESH_MODE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Fine refresh mode.
      Sets DDR4 MRS3.
      ZZ uses normal mode.
      From JEDEC DDR4 Spec 1716.78C from 07-2016
      Page 47 Table 4.9.1

      Note: DDR5 will use either the NORMAL or DDR5_FINE enum values
      For DDR5, MR4's settings are set based upon the values of this attribute
    </description>
    <valueType>uint8</valueType>
    <enum>
      NORMAL = 0,
      FIXED_2X = 1,
      FIXED_4X = 2,
      FLY_2X = 5,
      FLY_4X = 6,
      DDR5_FINE = 7
    </enum>
    <platInit/>
    <default>NORMAL</default>
    <mssAccessorName>mrw_fine_refresh_mode</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_TEMP_REFRESH_RANGE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Temperature refresh range.
      Sets DDR4 MRS4.
      Should be defaulted to extended range.
      NORMAL for running at 85 degrees C or less, EXTENDED for 95 or less degrees C
      Used for calculating periodic refresh intervals
      JEDEC DDR4 spec 1716.78C from 07-2016
      page 46 4.8.1
    </description>
    <valueType>uint8</valueType>
    <enum>NORMAL = 0, EXTEND = 1</enum>
    <platInit/>
    <default>EXTEND</default>
    <mssAccessorName>mrw_temp_refresh_range</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_RESET_DELAY_BEFORE_CAL</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>For resetting the phy delay values at the beginning of calling mss_draminit_training. YES means the vaules will be reset.</description>
    <valueType>uint8</valueType>
    <enum>YES = 0, NO = 1</enum>
    <default>YES</default>
    <platInit/>
    <mssAccessorName>mrw_reset_delay_before_cal</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_PERIODIC_MEMCAL_MODE_OPTIONS</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Describes the settings for periodic calibration for all ports:
      Reading left to right. (DEFAULT: 0xD90C -> Byte 0(11011001), Byte 1(00001100))
      For each bit: OFF = 0, ON = 1. Setting to 0 indicates to disable periodic memcal.
      Byte 0:
      0: ZCAL
      1: SYSCK_ALIGN
      2: RDCENTERING
      3: RDLCK_ALIGN
      4: DQS_ALIGN
      5: RDCLK_UPDATE
      6: PER_DUTYCYCLE
      7: PERCAL_PWR_DIS

      Byte 1:
      0: PERCAL_REPEAT
      1: PERCAL_REPEAT
      2: PERCAL_REPEAT
      3: SINGLE_BIT_MPR
      4: MBA_CFG_0
      5: MBA_CFG_1
      6: SPARE
      7: SPARE
    </description>
    <valueType>uint16</valueType>
    <mssUnits> encoded settings for periodic calibration </mssUnits>
    <platInit/>
    <default>0xD90C</default>
    <mssAccessorName>mrw_periodic_memcal_mode_options</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_PERIODIC_ZQCAL_MODE_OPTIONS</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Describes the settings for periodic ZQ calibration for all ports:
      Reading left to right. For each bit: OFF = 0, ON = 1.
      Setting to 0 indicates to disable periodic zqcal.
      Byte 0:
      0: ZQCAL
      All others reserved for future use
    </description>
    <valueType>uint16</valueType>
    <mssUnits> encoded settings for periodic calibration </mssUnits>
    <platInit/>
    <default>0x8000</default>
    <mssAccessorName>mrw_periodic_zqcal_mode_options</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_DRAM_2N_MODE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Allows user to manually turn on and off 2N Mode.
      AUTO indicates to use Signal Integrity generated setting (from VPD).
    </description>
    <valueType>uint8</valueType>
    <enum>AUTO = 0, FORCE_TO_1N_MODE = 1, FORCE_TO_2N_MODE = 2 </enum>
    <mssUnits> encoded settings for 2N Mode </mssUnits>
    <platInit/>
    <default>AUTO</default>
    <mssAccessorName>mrw_dram_2n_mode</mssAccessorName>
  </attribute>

 <attribute>
    <id>ATTR_MSS_MRW_DRAM_WRITE_CRC</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description> Enables DRAM Write CRC</description>
    <valueType>uint8</valueType>
    <platInit/>
    <enum> DISABLE = 0, ENABLE = 1 </enum>
    <default> 0  </default>
    <mssAccessorName>mrw_dram_write_crc</mssAccessorName>
  </attribute>

 <attribute>
    <id>ATTR_MSS_MRW_DDR5_DRAM_READ_CRC</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description> Enables DRAM Read CRC</description>
    <valueType>uint8</valueType>
    <platInit/>
    <enum> DISABLE = 0, ENABLE = 1 </enum>
    <default> 0  </default>
    <mssAccessorName>mrw_ddr5_dram_read_crc</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_TEMP_REFRESH_MODE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Used in MR4 A3
        Temperature refresh mode
        Should be defaulted to disable
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <enum> DISABLE = 0, ENABLE = 1 </enum>
    <default> 0  </default>
    <mssAccessorName>mrw_temp_refresh_mode</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_FORCE_BCMODE_OFF</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        An override switch to shut off broadcast mode
        Enum values:
        YES: broadcast mode is forced off
        NO:  broadcast mode uses the default value
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <initToZero/>
    <enum> NO = 0, YES = 1 </enum>
    <mssAccessorName>mrw_force_bcmode_off</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_NVDIMM_PLUG_RULES</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        A bitmap containing the plug rules for NVDIMM.
        1 if a DIMM supports an NVDIMM being plugged in, 0 if it does not
        DIMM slot 0 is the left most bit
        The index to the bitmap is the position of the DIMM target
        As such, a bitmap of 0b10010000, would allow NVDIMM plugged into DIMM0 and DIMM3
        Note: this attribute is a 64 bit number to account for 16 DIMM per processor if there is ever a 4 processor system
    </description>
    <valueType>uint64</valueType>
    <platInit/>
    <default> 0 </default>
    <enum> NO_NVDIMM = 0, NVDIMM_CAPABLE = 1 </enum>
    <mssAccessorName>mrw_nvdimm_plug_rules</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_ALLOW_UNSUPPORTED_RCW</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Switch that allows unsupported raw card references by providing a
      default raw card setting.
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <default> 1  </default>
    <enum> DISABLE = 0, ENABLE = 1 </enum>
    <mssAccessorName>mrw_allow_unsupported_rcw</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Bitmap of DRAM widths supported by a system. A 1 indicates that the system supports a density.
      Enums below represent the the bit location in the attribute for a given DRAM width.
      Default value is 0xC -> both x4/x8 supported
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <default> 0xc0 </default>
    <enum> X4 = 0, X8 = 1 </enum>
    <mssAccessorName>mrw_supported_dram_width</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Thermal Memory Power Limit
        Used to calculate throttles to meet the thermal power per DIMM limit
        Per DIMM basis, uses first matching KEY entry
        KEY (0-21): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-8,
        DIMM_WIDTH = 9-11,
        DIMM_DENSITY = 12-14,
        DIMM_STACK_TYPE = 15-16,
        DRAM_MFGID = 17-19,
        DIMM_HEIGHT = 20-21,
        Bits 22-32: Not used
        VALUE (bits 32-47) in cW: thermal power limit
          DDIMM: Total OCMB+DRAM power limit per DDIMM
          non-DDIMM: VMEM+VPP power limit per DIMM
    </description>
    <valueType>uint64</valueType>
    <mssUnits>cW</mssUnits>
    <default>0xfffffc0009c40000</default>
    <array>25</array>
    <platInit/>
    <mssAccessorName>mrw_ocmb_thermal_memory_power_limit</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_PWR_SLOPE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Power Curve Slope for DIMM
        Used to calculate thermal throttles and port power
        Per DIMM basis, uses first matching KEY entry
        KEY (0-21): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-8,
        DIMM_WIDTH = 9-11,
        DIMM_DENSITY = 12-14,
        DIMM_STACK_TYPE = 15-16,
        DRAM_MFGID = 17-19,
        DIMM_HEIGHT = 20-21,
        Bits 22-32: Not used
        VALUE (bits 32-47) in cW/utilization: DIMM power slope
          DDIMM: Total OCMB+DRAM power slope per DDIMM
          non-DDIMM: VMEM+VPP power slope per DIMM
    </description>
    <valueType>uint64</valueType>
    <mssUnits>cW</mssUnits>
    <default>0xfffffc0004620000</default>
    <array>50</array>
    <platInit/>
    <mssAccessorName>mrw_ocmb_pwr_slope</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_PWR_INTERCEPT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Power Curve Intercept for DIMM
        Used to calculate thermal throttles and port power
        Per DIMM basis, uses first matching KEY entry
        KEY (0-21): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-8,
        DIMM_WIDTH = 9-11,
        DIMM_DENSITY = 12-14,
        DIMM_STACK_TYPE = 15-16,
        DRAM_MFGID = 17-19,
        DIMM_HEIGHT = 20-21,
        Bits 22-32: Not used
        VALUE (bits 32-47) in cW/utilization: DIMM power intercept
          DDIMM: Total OCMB+DRAM power intercept per DDIMM
          non-DDIMM: VMEM+VPP power intercept per DIMM
    </description>
    <valueType>uint64</valueType>
    <mssUnits>cW/utilization</mssUnits>
    <default>0xfffffc0005260000</default>
    <array>50</array>
    <platInit/>
    <mssAccessorName>mrw_ocmb_pwr_intercept</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Current Curve Intercept and limit for DIMM
        Used to calculate throttles to meet regulator current per DIMM limit
        Per DIMM basis, uses first matching KEY entry
        For DDIMM, use PMIC SW output that provides worst case throttling
        KEY (0-21): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-8,
        DIMM_WIDTH = 9-11,
        DIMM_DENSITY = 12-14,
        DIMM_STACK_TYPE = 15-16,
        DRAM_MFGID = 17-19,
        DIMM_HEIGHT = 20-21,
        Bits 22-32: Not used
        VALUE (bits 32-39): Current limit (dA)
          DDIMM: PMIC output current limit per DDIMM
          non-DDIMM: VMEM regulator current limit per DIMM
        VALUE (bits 40-51): Current slope (cA/utilization)
          DDIMM: PMIC output current slope per DDIMM
          non-DDIMM: VMEM regulator current slope per DIMM
        VALUE (bits 52-63): Current intercept (cA)
          DDIMM: PMIC output current intercept per DDIMM
          non-DDIMM: VMEM regulator current intercept per DIMM
    </description>
    <valueType>uint64</valueType>
    <mssUnits>dA, cA/utilization, cA</mssUnits>
    <default>0xFFFFFC0064152094</default>
    <array>25</array>
    <platInit/>
    <mssAccessorName>mrw_ocmb_current_curve_with_limit</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_SAFEMODE_DRAM_DATABUS_UTIL</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook value for safe mode dram data bus utilization in centi percent (c%).
        Set to below optimum value/ rate.
        On a per port basis
        Also used for emergency mode throttle
        Used to thermally protect the system in all supported environmental conditions when OCC is not functional
        Consumer: thermal_init, initfile
        Default to 2500 c%%
        This attribute is depricated and is now replaced by ATTR_MSS_MRW_SAFEMODE_UTIL_ARRAY and ATTR_MSS_SAFEMODE_DRAM_DATABUS_UTIL
    </description>
    <valueType>uint32</valueType>
    <default>0x000009C4</default>
    <platInit/>
    <mssAccessorName>mrw_safemode_dram_databus_util</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_THERMAL_SENSOR_POLLING_PERIOD</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook value for polling period of DIMM
        thermal sensors.
    </description>
    <valueType>uint16</valueType>
    <default>200</default>
    <platInit/>
    <mrwHide/>
    <mssAccessorName>mrw_thermal_sensor_polling_period</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_DIMM_SLOT_AIRFLOW</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook value to describe the airflow past DIMM slots.
        Facing the front of the DIMM, the airflow is described as either
        RIGHT_TO_LEFT or LEFT_TO_RIGHT using the attribute enums.
        Note that the enum values here map to the left/right sensor
        locations in the DDIMM SPD.
    </description>
    <valueType>uint8</valueType>
    <enum>RIGHT_TO_LEFT = 0x00, LEFT_TO_RIGHT = 0x01</enum>
    <default>RIGHT_TO_LEFT</default>
    <platInit/>
    <mssAccessorName>mrw_dimm_slot_airflow</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      This is the fapi position of the port that failed to calculate
      memory throttles given the passed in watt target and or utilization
    </description>
    <initToZero></initToZero>
    <valueType>uint64</valueType>
    <mssAccessorName>port_pos_of_fail_throttle</mssAccessorName>
    <writeable/>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_RESET_GROUP</id>
    <targetType>TARGET_TYPE_OCMB_CHIP</targetType>
    <description>
      System specific definition of which RESET_N signal is connected
      to the OCMB's DIMM slot. RESET_N signals are ordered from 0-N
    </description>
    <valueType>uint8</valueType>
    <initToZero></initToZero>
    <platInit/>
    <mssAccessorName>mrw_ocmb_reset_group</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_DIMM_HEIGHT_MIXING_POLICY</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      System specific DIMM height mixing plug rule
    </description>
    <valueType>uint8</valueType>
    <platInit/>
    <enum> NOT_ALLOWED = 0, ALLOWED = 1 </enum>
    <default> NOT_ALLOWED </default>
    <mssAccessorName>mrw_dimm_height_plug_rule</mssAccessorName>
  </attribute>

<!-- DEPRECATED : Avoiding delete for now to avoid coreq CI issues -->
  <attribute>
    <id>ATTR_MSS_MRW_SUPPORTED_FREQ</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      List of memory frequencies supported by the current system.
    </description>
    <valueType>uint32</valueType>
    <array>4</array>
    <platInit/>
    <!-- Note, mirrors ATTR_MSS_FREQ -->
    <enum>
      MT1866 = 1866,
      MT2133 = 2133,
      MT2400 = 2400,
      MT2666 = 2666,
      MT2933 = 2933,
      MT3200 = 3200
    </enum>
    <default> 1866, 2133, 2400, 2666 </default>
    <mssUnit>MT/s</mssUnit>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Machine Readable Workbook Thermal Memory Power Limit
        Used to calculate throttles to be at or under the power limit
        Per DIMM basis
        KEY (0-20): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-7,
        DIMM_WIDTH = 8-10,
        DIMM_DENSITY = 11-13,
        DIMM_STACK_TYPE = 14-15,
        DRAM_MFGID = 16-18,
        DIMMS_PER_PORT = 19-20,
        Bits 21-31: Not used
        VALUE (bits 32-63) in cW:
        VMEM+VPP thermal power limit per DIMM = 32-63
        Consumers: eff_config_thermal and bulk_pwr_throttles
    </description>
    <valueType>uint64</valueType>
    <mssUnits>cW</mssUnits>
    <default>0xfffff80000000794</default>
    <array>10</array>
    <platInit/>
    <mssAccessorName>mrw_thermal_memory_power_limit</mssAccessorName>
  </attribute>
<!-- END DEPRECATED -->

  <attribute>
    <id>ATTR_MSS_MRW_OVERRIDE_THERM_SENSOR_USAGE</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
      Set to ENABLED to activate a workaround for 4U DDIMMs to set thermal sensor usage from DRAM to
      DRAM_AND_MEM_BUF_EXT, and from PMIC to MEM_BUF_EXT. Affects power management subsystem fan speed controls.
    </description>
    <valueType>uint8</valueType>
    <enum>
      DISABLED = 0,
      ENABLED = 1
    </enum>
    <default>DISABLED</default>
    <platInit/>
    <mssAccessorName>mrw_orverride_therm_sensor_usage</mssAccessorName>
  </attribute>

  <attribute>
    <id>ATTR_MSS_MRW_OCMB_SAFEMODE_UTIL_ARRAY</id>
    <targetType>TARGET_TYPE_SYSTEM</targetType>
    <description>
        Memory safemode throttle settings based on DIMM configurations
        Key Value pair
        KEY (0-25): In order
        DIMM_SIZE = bits 0-3,
        DIMM_GEN = 4-5,
        DIMM_TYPE = 6-8,
        DIMM_WIDTH = 9-11,
        DIMM_DENSITY = 12-14,
        DIMM_STACK_TYPE = 15-16,
        DRAM_MFGID = 17-19,
        DIMM_HEIGHT = 20-21,
        DIMM_COUNT = Bits 22-25 (Number of configured DIMMs under processor (supported values are 2,4,6,8,16,32)
          0b0000 = 2 DIMMs
          0b0001 = 4 DIMMs
          0b0010 = 6 DIMMs
          0b0011 = 8 DIMMs
          0b0100 = 16 DIMMs
          0b0101 = 32 DIMMs
          0b1111 = wildcard
        Bits 26-31: Not used
        VALUE (bits 32-47) safemode dram data bus utilization in c%
    </description>
    <valueType>uint64</valueType>
    <platInit/>
    <array>50</array>
    <default>0xFFFFFFC009C40000</default>
    <mssAccessorName>mrw_ocmb_safemode_util_array</mssAccessorName>
  </attribute>

</attributes>


text:
from distutils.spawn import find_executable
import os
from setuptools import setup, find_packages

from dockerfabric import __version__

def include_readme():
    try:
        import pandoc
    except ImportError:
        return ''
    pandoc.core.PANDOC_PATH = find_executable('pandoc')
    readme_file = os.path.join(os.path.dirname(__file__), 'README.md')
    doc = pandoc.Document()
    with open(readme_file, 'r') as rf:
        doc.markdown = rf.read()
        return doc.rst

setup(
    name='docker-fabric',
    version=__version__,
    packages=find_packages(),
    install_requires=['six', 'Fabric>=1.8.0', 'docker-py>=1.9.0', 'docker-map>=0.8.0b2'],
    extras_require={
        'yaml': ['PyYAML'],
    },
    license='MIT',
    author='Matthias Erll',
    author_email='matthias@erll.de',
    url='https://github.com/merll/docker-fabric',
    description='Build Docker images, and run Docker containers in Fabric.',
    long_description=include_readme(),
    platforms=['OS Independent'],
    keywords=['docker', 'fabric'],
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Software Development :: Build Tools',
        'Topic :: System :: Software Distribution',
        'Development Status :: 4 - Beta',
        'Programming Language :: Python :: 2.7',
    ],
    include_package_data=True,
)


text:
from __future__ import absolute_import
from tvtk.pyface.ui.wx.scene_editor import *


text:
using System;
using Valit.Errors;

namespace Valit
{
    public static class ValitRuleFloatExtensions
    {
        public static IValitRule<TObject, float> IsGreaterThan<TObject>(this IValitRule<TObject, float> rule, float value) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && !Single.IsNaN(value) && p > value).WithDefaultMessage(ErrorMessages.IsGreaterThan, value);

        public static IValitRule<TObject, float> IsGreaterThan<TObject>(this IValitRule<TObject, float> rule, float? value) where TObject : class
            => rule.Satisfies(p => value.HasValue && !Single.IsNaN(p) && !Single.IsNaN(value.Value) && p > value.Value).WithDefaultMessage(ErrorMessages.IsGreaterThan, value);

        public static IValitRule<TObject, float?> IsGreaterThan<TObject>(this IValitRule<TObject, float?> rule, float value) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value) && p.Value > value).WithDefaultMessage(ErrorMessages.IsGreaterThan, value);

        public static IValitRule<TObject, float?> IsGreaterThan<TObject>(this IValitRule<TObject, float?> rule, float? value) where TObject : class
            => rule.Satisfies(p => p.HasValue && value.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value.Value) && p.Value > value.Value).WithDefaultMessage(ErrorMessages.IsGreaterThan, value);

        public static IValitRule<TObject, float> IsLessThan<TObject>(this IValitRule<TObject, float> rule, float value) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && !Single.IsNaN(value) && value > p).WithDefaultMessage(ErrorMessages.IsLessThan, value);

        public static IValitRule<TObject, float> IsLessThan<TObject>(this IValitRule<TObject, float> rule, float? value) where TObject : class
            => rule.Satisfies(p => value.HasValue && !Single.IsNaN(p) && !Single.IsNaN(value.Value) && value.Value > p).WithDefaultMessage(ErrorMessages.IsLessThan, value);

        public static IValitRule<TObject, float?> IsLessThan<TObject>(this IValitRule<TObject, float?> rule, float value) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value) && value > p.Value).WithDefaultMessage(ErrorMessages.IsLessThan, value);

        public static IValitRule<TObject, float?> IsLessThan<TObject>(this IValitRule<TObject, float?> rule, float? value) where TObject : class
            => rule.Satisfies(p => p.HasValue && value.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value.Value) && value.Value > p.Value).WithDefaultMessage(ErrorMessages.IsLessThan, value);

        public static IValitRule<TObject, float> IsGreaterThanOrEqualTo<TObject>(this IValitRule<TObject, float> rule, float value) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && !Single.IsNaN(value) && p >= value).WithDefaultMessage(ErrorMessages.IsGreaterThanOrEqualTo, value);

        public static IValitRule<TObject, float> IsGreaterThanOrEqualTo<TObject>(this IValitRule<TObject, float> rule, float? value) where TObject : class
            => rule.Satisfies(p => value.HasValue && !Single.IsNaN(p) && !Single.IsNaN(value.Value) && p >= value.Value).WithDefaultMessage(ErrorMessages.IsGreaterThanOrEqualTo, value);

        public static IValitRule<TObject, float?> IsGreaterThanOrEqualTo<TObject>(this IValitRule<TObject, float?> rule, float value) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value) && p.Value >= value).WithDefaultMessage(ErrorMessages.IsGreaterThanOrEqualTo, value);

        public static IValitRule<TObject, float?> IsGreaterThanOrEqualTo<TObject>(this IValitRule<TObject, float?> rule, float? value) where TObject : class
            => rule.Satisfies(p => p.HasValue && value.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value.Value) && p.Value >= value.Value).WithDefaultMessage(ErrorMessages.IsGreaterThanOrEqualTo, value);

        public static IValitRule<TObject, float> IsLessThanOrEqualTo<TObject>(this IValitRule<TObject, float> rule, float value) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && !Single.IsNaN(value) && p <= value).WithDefaultMessage(ErrorMessages.IsLessThanOrEqualTo, value);

        public static IValitRule<TObject, float> IsLessThanOrEqualTo<TObject>(this IValitRule<TObject, float> rule, float? value) where TObject : class
            => rule.Satisfies(p => value.HasValue && !Single.IsNaN(p) && !Single.IsNaN(value.Value) && p <= value.Value).WithDefaultMessage(ErrorMessages.IsLessThanOrEqualTo, value);

        public static IValitRule<TObject, float?> IsLessThanOrEqualTo<TObject>(this IValitRule<TObject, float?> rule, float value) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value) && p.Value <= value).WithDefaultMessage(ErrorMessages.IsLessThanOrEqualTo, value);

        public static IValitRule<TObject, float?> IsLessThanOrEqualTo<TObject>(this IValitRule<TObject, float?> rule, float? value) where TObject : class
            => rule.Satisfies(p => p.HasValue && value.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value.Value) && p.Value <= value.Value).WithDefaultMessage(ErrorMessages.IsLessThanOrEqualTo, value);

        public static IValitRule<TObject, float> IsEqualTo<TObject>(this IValitRule<TObject, float> rule, float value) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && !Single.IsNaN(value) && p == value).WithDefaultMessage(ErrorMessages.IsEqualTo, value);

        public static IValitRule<TObject, float> IsEqualTo<TObject>(this IValitRule<TObject, float> rule, float? value) where TObject : class
            => rule.Satisfies(p => value.HasValue && !Single.IsNaN(p) && !Single.IsNaN(value.Value) && p == value.Value).WithDefaultMessage(ErrorMessages.IsEqualTo, value);

        public static IValitRule<TObject, float?> IsEqualTo<TObject>(this IValitRule<TObject, float?> rule, float value) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value) && p.Value == value).WithDefaultMessage(ErrorMessages.IsEqualTo, value);

        public static IValitRule<TObject, float?> IsEqualTo<TObject>(this IValitRule<TObject, float?> rule, float? value) where TObject : class
            => rule.Satisfies(p => p.HasValue && value.HasValue && !Single.IsNaN(p.Value) && !Single.IsNaN(value.Value) && p.Value == value.Value).WithDefaultMessage(ErrorMessages.IsEqualTo, value);

        public static IValitRule<TObject, float> IsPositive<TObject>(this IValitRule<TObject, float> rule) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && p > 0f).WithDefaultMessage(ErrorMessages.IsPositive);

        public static IValitRule<TObject, float?> IsPositive<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && p.Value > 0f).WithDefaultMessage(ErrorMessages.IsPositive);

        public static IValitRule<TObject, float> IsNegative<TObject>(this IValitRule<TObject, float> rule) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && p < 0f).WithDefaultMessage(ErrorMessages.IsNegative);

        public static IValitRule<TObject, float?> IsNegative<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && p.Value < 0f).WithDefaultMessage(ErrorMessages.IsNegative);

        public static IValitRule<TObject, float> IsNonZero<TObject>(this IValitRule<TObject, float> rule) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p) && p != 0f).WithDefaultMessage(ErrorMessages.IsNonZero);

        public static IValitRule<TObject, float?> IsNonZero<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value) && p.Value != 0f).WithDefaultMessage(ErrorMessages.IsNonZero);

        public static IValitRule<TObject, float> IsNumber<TObject>(this IValitRule<TObject, float> rule) where TObject : class
            => rule.Satisfies(p => !Single.IsNaN(p)).WithDefaultMessage(ErrorMessages.IsNumber);

        public static IValitRule<TObject, float?> IsNumber<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue && !Single.IsNaN(p.Value)).WithDefaultMessage(ErrorMessages.IsNumber);

        public static IValitRule<TObject, float> IsNaN<TObject>(this IValitRule<TObject, float> rule) where TObject : class
            => rule.Satisfies(p => Single.IsNaN(p)).WithDefaultMessage(ErrorMessages.IsNaN);

        public static IValitRule<TObject, float?> IsNaN<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue && Single.IsNaN(p.Value)).WithDefaultMessage(ErrorMessages.IsNaN);

        public static IValitRule<TObject, float?> Required<TObject>(this IValitRule<TObject, float?> rule) where TObject : class
            => rule.Satisfies(p => p.HasValue).WithDefaultMessage(ErrorMessages.Required);
    }
}


text: DeadLinkGC - The dead links garbage collector for famous file hosting services


text:
Tambah User Baru

<form class="form-horizontal" name="post1" id="post1" action="addusers" method="post" enctype="multipart/form-data">

                    Nama

                    <input type="text" class="form-control" name="nama"  id="nama" placeholder="Nama" required>

                    Email

                      <input type="email" class="form-control" id="email" name="email" placeholder="Email" required>

                    Password

                      <input type="password" class="form-control" id="password" name="password" placeholder="password" required>

                    Posisi User

                   <select name="level" id="level" class="form-control" required>
<option value=""><-- Pilih Satu --></option>
<option value="2">General Manager</option>
<option value="3">Project Manager</option>
<option value="4">Admin</option>
                   </select>

                      <button type="submit" class="btn btn-primary">TAMBAH</button>

</form>


text:
package messenger

import (
	"fmt"
	"strings"

	"github.com/gogo/protobuf/proto"
	"github.com/basho-labs/mesos-go/upid"
)

// Message defines the type that passes in the Messenger.
type Message struct {
	UPID         *upid.UPID
	Name         string
	ProtoMessage proto.Message
	Bytes        []byte
}

// RequestURI returns the request URI of the message.
func (m *Message) RequestURI() string {
	if m.Name == "scheduler" {
		return fmt.Sprintf("/api/v1/%s", m.Name)
	}
	return fmt.Sprintf("/%s/%s", m.UPID.ID, m.Name)
}

// NOTE: This should not fail or panic.
func extractNameFromRequestURI(requestURI string) string {
	return strings.Split(requestURI, "/")[2]
}


text:
template<bool> struct STATIC_ASSERTION_FAILURE;

template<> struct STATIC_ASSERTION_FAILURE<true> {
  enum { value = 1 };
};

template<int> struct static_assert_test{};

#define STATIC_ASSERT(B) \
typedef static_assert_test<\
  sizeof(STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
    static_assert_typedef_ ##  __LINE__

#endif  // CHROME_BROWSER_SYNC_NOTIFIER_BASE_STATIC_ASSERT_H_


text:
import React, { Component } from 'react';
import {TouchableHighlight,Text, StyleSheet} from 'react-native';

export default class InputButton extends Component {
    render() {
      return (
        <TouchableHighlight style={[Style.inputButton, this.props.highlight ? Style.inputButtonHighlighted : null]}
                            underlayColor="#193441"
                            onPress={this.props.onPress}>
            <Text style={Style.inputButtonText}>{this.props.value}</Text>
        </TouchableHighlight>
      );
    }
}

var Style = StyleSheet.create({
  inputButton: {
      flex: 1,
      alignItems: 'center',
      justifyContent: 'center',
      borderWidth: 0.5,
      borderColor: '#91AA9D'
  },
  inputButtonHighlighted: {
      backgroundColor: '#193441'
  },
  inputButtonText: {
      fontSize: 22,
      fontWeight: 'bold',
      color: 'white'
  },
});


text:
function K=multiplekernel(x,kernel,kerneloptionvec,xapp,solution);

%
% USAGE
%
% K=multiplekernel(x,kernel,kerneloptionvec,xapp,solution);
%
% process the kernel K(x,xapp). If solution is provided, it process
% only the kernel of the Support Vector xapp
%
%

K=[];
nbkerneloption=length(kerneloptionvec);
if nargin < 4
    for i=1:nbkerneloption
        kerneloption=kerneloptionvec(i);
        K=[K svmkernel(x,kernel,kerneloption)];
    end;
else
    nbapp=size(xapp,1);
    if nargin < 5
        indxsup=1:nbapp*nbkerneloption;
    else
        indxsup=solution.indxsup;
    end;

    K=zeros(size(x,1),length(indxsup));
    for i=1:nbkerneloption
        kerneloption=kerneloptionvec(i);
        indice=find(indxsup <= i*nbapp & indxsup > (i-1)*nbapp);    % les points qui sont concernes par ce kerneloption
        if ~isempty(indice)
            Kaux=svmkernel(x,kernel,kerneloption, xapp(indxsup(indice)-(i-1)*nbapp,:));
            K(:,indice)=Kaux;
        end

    end;
end


text:
package org.elasticsearch.search.geo;

import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.geo.builders.PointBuilder;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.IndexService;
import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.test.ESIntegTestCase;

import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;

public class GeoShapeIntegrationIT extends ESIntegTestCase {

    @Override
    protected Settings nodeSettings(int nodeOrdinal) {
        return Settings.builder()
                // Check that only geo-shape queries on legacy PrefixTree based
                // geo shapes are disallowed.
                .put("search.allow_expensive_queries", false)
                .put(super.nodeSettings(nodeOrdinal))
                .build();
    }

    /**
     * Test that orientation parameter correctly persists across cluster restart
     */
    public void testOrientationPersistence() throws Exception {
        String idxName = "orientation";
        String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject()
            .startObject("properties").startObject("location")
            .field("type", "geo_shape")
            .field("orientation", "left")
            .endObject()
            .endObject().endObject());

        // create index
        assertAcked(prepareCreate(idxName).setMapping(mapping));

        mapping = Strings.toString(XContentFactory.jsonBuilder().startObject()
            .startObject("properties").startObject("location")
            .field("type", "geo_shape")
            .field("orientation", "right")
            .endObject()
            .endObject().endObject());

        assertAcked(prepareCreate(idxName+"2").setMapping(mapping));
        ensureGreen(idxName, idxName+"2");

        internalCluster().fullRestart();
        ensureGreen(idxName, idxName+"2");

        // left orientation test
        IndicesService indicesService = internalCluster().getInstance(IndicesService.class, findNodeName(idxName));
        IndexService indexService = indicesService.indexService(resolveIndex(idxName));
        MappedFieldType fieldType = indexService.mapperService().fieldType("location");
        assertThat(fieldType, instanceOf(GeoShapeFieldMapper.GeoShapeFieldType.class));

        GeoShapeFieldMapper.GeoShapeFieldType gsfm = (GeoShapeFieldMapper.GeoShapeFieldType)fieldType;
        ShapeBuilder.Orientation orientation = gsfm.orientation();
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.CLOCKWISE));
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.LEFT));
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.CW));

        // right orientation test
        indicesService = internalCluster().getInstance(IndicesService.class, findNodeName(idxName+"2"));
        indexService = indicesService.indexService(resolveIndex((idxName+"2")));
        fieldType = indexService.mapperService().fieldType("location");
        assertThat(fieldType, instanceOf(GeoShapeFieldMapper.GeoShapeFieldType.class));

        gsfm = (GeoShapeFieldMapper.GeoShapeFieldType)fieldType;
        orientation = gsfm.orientation();
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.COUNTER_CLOCKWISE));
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.RIGHT));
        assertThat(orientation, equalTo(ShapeBuilder.Orientation.CCW));
    }

    /**
     * Test that ignore_malformed on GeoShapeFieldMapper does not fail the entire document
     */
    public void testIgnoreMalformed() throws Exception {
        // create index
        assertAcked(client().admin().indices().prepareCreate("test")
            .setMapping("shape", "type=geo_shape,ignore_malformed=true").get());
        ensureGreen();

        // test self crossing ccw poly not crossing dateline
        String polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon")
            .startArray("coordinates")
            .startArray()
            .startArray().value(176.0).value(15.0).endArray()
            .startArray().value(-177.0).value(10.0).endArray()
            .startArray().value(-177.0).value(-10.0).endArray()
            .startArray().value(176.0).value(-15.0).endArray()
            .startArray().value(-177.0).value(15.0).endArray()
            .startArray().value(172.0).value(0.0).endArray()
            .startArray().value(176.0).value(15.0).endArray()
            .endArray()
            .endArray()
            .endObject());

        indexRandom(true, client().prepareIndex("test").setId("0").setSource("shape",
            polygonGeoJson));
        SearchResponse searchResponse = client().prepareSearch("test").setQuery(matchAllQuery()).get();
        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
    }

    public void testMappingUpdate() throws Exception {
        // create index
        assertAcked(client().admin().indices().prepareCreate("test")
            .setMapping("shape", "type=geo_shape").get());
        ensureGreen();

        String update ="{\n" +
            "  \"properties\": {\n" +
            "    \"shape\": {\n" +
            "      \"type\": \"geo_shape\",\n" +
            "      \"strategy\": \"recursive\"\n" +
            "    }\n" +
            "  }\n" +
            "}";

        IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> client().admin().indices()
            .preparePutMapping("test")
            .setSource(update, XContentType.JSON).get());
        assertThat(e.getMessage(), containsString("mapper [shape] of type [geo_shape] cannot change strategy from [BKD] to [recursive]"));
    }

    /**
     * Test that the indexed shape routing can be provided if it is required
     */
    public void testIndexShapeRouting() throws Exception {
        String mapping = "{\"_doc\":{\n" +
            "    \"_routing\": {\n" +
            "      \"required\": true\n" +
            "    },\n" +
            "    \"properties\": {\n" +
            "      \"shape\": {\n" +
            "        \"type\": \"geo_shape\"\n" +
            "      }\n" +
            "    }\n" +
            "  }}";

        // create index
        assertAcked(client().admin().indices().prepareCreate("test").setMapping(mapping).get());
        ensureGreen();

        String source = "{\n" +
            "    \"shape\" : {\n" +
            "        \"type\" : \"bbox\",\n" +
            "        \"coordinates\" : [[-45.0, 45.0], [45.0, -45.0]]\n" +
            "    }\n" +
            "}";

        indexRandom(true, client().prepareIndex("test").setId("0").setSource(source, XContentType.JSON).setRouting("ABC"));

        SearchResponse searchResponse = client().prepareSearch("test").setQuery(
            geoShapeQuery("shape", "0").indexedShapeIndex("test").indexedShapeRouting("ABC")
        ).get();

        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
    }

    public void testIndexPolygonDateLine() throws Exception {
        String mappingVector = "{\n" +
                "    \"properties\": {\n" +
                "      \"shape\": {\n" +
                "        \"type\": \"geo_shape\"\n" +
                "      }\n" +
                "    }\n" +
                "  }";

        String mappingQuad = "{\n" +
                "    \"properties\": {\n" +
                "      \"shape\": {\n" +
                "        \"type\": \"geo_shape\",\n" +
                "        \"tree\": \"quadtree\"\n" +
                "      }\n" +
                "    }\n" +
                "  }";

        // create index
        assertAcked(client().admin().indices().prepareCreate("vector").setMapping(mappingVector).get());
        ensureGreen();

        assertAcked(client().admin().indices().prepareCreate("quad").setMapping(mappingQuad).get());
        ensureGreen();

        String source = "{\n" +
                "    \"shape\" : \"POLYGON((179 0, -179 0, -179 2, 179 2, 179 0))\""+
                "}";

        indexRandom(true, client().prepareIndex("quad").setId("0").setSource(source, XContentType.JSON));
        indexRandom(true, client().prepareIndex("vector").setId("0").setSource(source, XContentType.JSON));

        try {
            ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest();
            updateSettingsRequest.persistentSettings(Settings.builder().put("search.allow_expensive_queries", true));
            assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet());

            SearchResponse searchResponse = client().prepareSearch("quad").setQuery(
                    geoShapeQuery("shape", new PointBuilder(-179.75, 1))
            ).get();

            assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));

            searchResponse = client().prepareSearch("quad").setQuery(
                    geoShapeQuery("shape", new PointBuilder(90, 1))
            ).get();

            assertThat(searchResponse.getHits().getTotalHits().value, equalTo(0L));

            searchResponse = client().prepareSearch("quad").setQuery(
                    geoShapeQuery("shape", new PointBuilder(-180, 1))
            ).get();

            assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));

            searchResponse = client().prepareSearch("quad").setQuery(
                    geoShapeQuery("shape", new PointBuilder(180, 1))
            ).get();

            assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
        } finally {
            ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest();
            updateSettingsRequest.persistentSettings(Settings.builder().put("search.allow_expensive_queries", (String) null));
            assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet());
        }

        SearchResponse searchResponse = client().prepareSearch("vector").setQuery(
            geoShapeQuery("shape", new PointBuilder(90, 1))
        ).get();

        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(0L));

        searchResponse = client().prepareSearch("vector").setQuery(
            geoShapeQuery("shape", new PointBuilder(-179.75, 1))
        ).get();

        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));

        searchResponse = client().prepareSearch("vector").setQuery(
            geoShapeQuery("shape", new PointBuilder(-180, 1))
        ).get();

        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));

        searchResponse = client().prepareSearch("vector").setQuery(
            geoShapeQuery("shape", new PointBuilder(180, 1))
        ).get();

        assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
    }

    private String findNodeName(String index) {
        ClusterState state = client().admin().cluster().prepareState().get().getState();
        IndexShardRoutingTable shard = state.getRoutingTable().index(index).shard(0);
        String nodeId = shard.assignedShards().get(0).currentNodeId();
        return state.getNodes().get(nodeId).getName();
    }
}


text: An application to unlock Life Logging™


text:
/**
 * @license ngHammer.js v1.0.0
 * (c) 2014 Daniel Smith http://www.danmasta.com
 * License: MIT
 */
(function(window, angular, undefined) {'use strict';

/**
 * @ngdoc module
 * @name ngHammer
 * @description
 *
 * # ngHammer
 *
 * The ngHammer module provides angular directives for all touch events handled by hammer.js
 * The implementation is the same as default angular event handlers. Event object is available as $event.
 * http://eightmedia.github.io/hammer.js/
 */

// define ngHammer module
var ngHammer = angular.module('ngHammer', []);

// Normalize directive name
function capitalize(string){
  return string.charAt(0).toUpperCase() + string.slice(1);
}

// Programatically create directives using the same method as angular.js default events
angular.forEach('hold tap doubletap drag dragstart dragend dragup dragdown dragleft dragright swipe swipeup swipedown swipeleft swiperight transform transformstart transformend rotate pinch pinchin pinchout touch release'.split(' '), function(value, key){
  var directiveName = 'ng' + capitalize(value);
  angular.module('ngHammer').directive(directiveName, function($parse){
    return{
      compile: function($element, attr) {
        var fn = $parse(attr[directiveName]);
        return function(scope, element, attr) {
          Hammer(element[0]).on(value.toLowerCase(), function(event) {
            scope.$apply(function() {
              fn(scope, {$event:event});
            });
          });
        };
      }
    }
  });
});

})(window, window.angular);


text: A/B targeting engine


text:
{% extends "adminlte/base_without_nav.html" %}

{% block navbar %}

          Toggle navigation

            Logout

{%- endblock navbar %}

{% block title %}Log In{% endblock %}
{% block description %}Log into your account!{% endblock %}
{% block bodytag %}login-page{% endblock %}

{% block body %}

      AdminLTE

Log into your account!

      {# Display errors (if there are any). #}
      {% with messages = get_flashed_messages() %}
        {% if messages %}

            {% for message in messages %}

{{ message }}

            {% endfor %}

        {% endif %}
      {% endwith %}
      {# Render the login form. #}
      <form method="post">

          <input type="email" placeholder="Username or Email" required="true" class="form-control">

          <input type="password" placeholder="Password" required="true" class="form-control">

            <button type="submit" class="btn btn-primary btn-block btn-flat">Log In</button>

      </form>

{% endblock %}


text:
FactoryGirl.define do
  factory :user_defined_field_type, class: UserDefinedAttributes::FieldType do
    sequence(:name) {|n| "UDA#{ "%03d" % n }" }
    model_type      'Lead'
    data_type       'string'
    required        false
  end

  factory :user_defined_field, class: UserDefinedAttributes::Field do
    association :field_type, factory: :user_defined_field_type

    sequence(:value) {|n| "#{field_type.name} value #{n}"}

    ignore do
      model {Lead.new rescue nil}
    end
    after(:build) { |user_defined_field,evaluator|
      user_defined_field.model_type = evaluator.model.class.to_s
      user_defined_field.model_id   = evaluator.model.id
    }
  end
end


text:
package cc.factorie.app.classify
import cc.factorie.util.TopN
import cc.factorie.variable._

/** Calculate the weighted log-odds ratio:
    p(w|c) * log(p(w|c)/p(w|!c)) for each word w and label c.
    Ranks highly those words that substantially contribute to positively predicting label c.
    @author Andrew McCallum
    @since 0.10
 */
class PerLabelLogOdds[L<:DiscreteVar,F<:VectorVar](labels:Iterable[L], labelToFeatures:L=>F) {
  val instanceDomain: VectorDomain = labelToFeatures(labels.head).domain
  val featureDomain: DiscreteDomain = instanceDomain.dimensionDomain
  val labelDomain: DiscreteDomain = labels.head.domain
  private val logodds = Array.ofDim[Double](labelDomain.size, featureDomain.size)
  var labelEntropies = new Array[Double](labelDomain.size)
  init(labels)

  def top(labelIndex:Int, n:Int): TopN[String] = new TopN[String](n, logodds(labelIndex), featureDomain.asInstanceOf[CategoricalDomain[String]].categories)
  def top(labelValue:DiscreteValue, n:Int): TopN[String] = {
    require(labelValue.dim1 == labelDomain.size) // require(labelValue.domain == labelDomain)
    top(labelValue.intValue, n)
  }

  protected def init(labels:Iterable[L]) {
    val numInstances = labels.size
    val numFeatures = featureDomain.size
    val numLabels = labelDomain.size

    val labelFeatureCounts = Array.ofDim[Double](numLabels, numFeatures)
    val featureCounts = new Array[Int](numFeatures)
    val labelCounts = new Array[Int](numLabels)

    for (label <- labels) {
      val instance = labelToFeatures(label)
      assert(instance.domain == instanceDomain)
      assert(label.domain == labelDomain)
      val labelIndex = label.intValue
      labelCounts(labelIndex) += 1
      //for (featureIndex <- instance.activeDomain)
      instance.value.foreachActiveElement((featureIndex,featureValue) => {
        labelFeatureCounts(labelIndex)(featureIndex) += 1
        featureCounts(featureIndex) += 1
      })
    }

    // Calculate per-class weighted-log-odds of each feature, and store it in "igs"
    for (fi <- 0 until numFeatures) {
      for (li <- 0 until numLabels) {
        if (featureCounts(fi) == 0) {
          logodds(li)(fi) = 0.0
        } else {
          if (labelFeatureCounts(li)(fi) == 0)
            logodds(li)(fi) = 0.0
          else {
            // Use +1 "Laplace" smoothing
            val pr_w_c = (labelFeatureCounts(li)(fi) + 1.0) / (labelCounts(li) + numFeatures)
            val pr_w_nc = (featureCounts(fi) - labelFeatureCounts(li)(fi) + 1.0) / (numInstances - labelCounts(li) + numFeatures)
            logodds(li)(fi) = pr_w_c * math.log(pr_w_c / pr_w_nc)
          }
        }
      }
    }

  }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.

using Newtonsoft.Json;

namespace Microsoft.Azure.Search.Tests
{
    internal class ReviewedBook : Book
    {
        [CustomField(shouldIgnore: true)]
        public int Rating { get; set; }

        public override bool Equals(object obj)
        {
            ReviewedBook other = obj as ReviewedBook;

            if (other == null)
            {
                return false;
            }

            return base.Equals(other) && this.Rating == other.Rating;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return base.ToString() + string.Format("; Rating: {0}", this.Rating);
        }
    }
}