text:
package be.gerard.ubrew.interface_v1.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
 * ProductDefinition
 *
 * @author Bart Gerard
 */
public class ProductDefinition implements Serializable {

    private Long id;

    private final List<Unit> units = new ArrayList<>();

    public ProductDefinition() {
    }

    public ProductDefinition(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public List<Unit> getUnits() {
        return Collections.unmodifiableList(units);
    }

    public void addUnit(Unit unit) {
        this.units.add(unit);
    }

    public void removeUnit(Unit unit) {
        this.units.remove(unit);
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 37 * hash + Objects.hashCode(this.id);
        hash = 37 * hash + Objects.hashCode(this.units);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ProductDefinition other = (ProductDefinition) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return Objects.equals(this.units, other.units);
    }

    @Override
    public String toString() {
        return "ProductDefinition{" + "id=" + id + ", units=" + units + '}';
    }

}


text:
package com.googlecode.pondskum.gui.swing.suite;

import com.googlecode.pondskum.gui.swing.tablet.Tablet;
import com.googlecode.pondskum.util.DefaultImageLoader;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JRootPane;
import java.awt.Dimension;
import java.awt.TrayIcon;

public final class DefaultGuiFactory implements GuiFactory {

    static final int PROGRESSION_WIDTH = 600;
    static final int PROGRESSION_HEIGHT = 90;

    static final int TABLET_WIDTH = 600;
    static final int TABLET_HEIGHT = 400;

    private JFrame progressionFrame;
    private TrayIcon progressionTrayIcon;
    private Tablet tablet;

    public DefaultGuiFactory() {
        createProgressionFrame();
        createProgressionTrayIcon();
        createTablet();
    }

    private void createProgressionFrame() {
        progressionFrame = new JFrame("Pondskum Progression");
        progressionFrame.setUndecorated(true);
        progressionFrame.getRootPane().setWindowDecorationStyle(JRootPane.INFORMATION_DIALOG);
        progressionFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        progressionFrame.setSize(PROGRESSION_WIDTH, PROGRESSION_HEIGHT);
        progressionFrame.setResizable(false);
        progressionFrame.setLocationRelativeTo(null);
    }

    private void createProgressionTrayIcon() {
        ImageIcon image = new DefaultImageLoader(getClass()).getImageIcon("pondksum.png");
        final TrayIcon trayIcon = new TrayIcon(image.getImage());
        trayIcon.setImageAutoSize(true);
        progressionTrayIcon = trayIcon;
    }

    private void createTablet() {
        tablet = new Tablet();
        tablet.setSize(new Dimension(TABLET_WIDTH, TABLET_HEIGHT));
        tablet.setResizable(true);
        tablet.setLocationRelativeTo(null);
    }

    @Override
    public GUI createProgressionBar() {
        return new ProgressionGui(progressionFrame);
    }

    @Override
    public GUI createProgressionIcon() {
        return new ProgressionTrayGui(progressionTrayIcon);
    }

    @Override
    public GUI createProgressionTablet() {
        return new ProgressionTabletGui(tablet);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2010-2011 Jake Basile

   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.
-->
<PreferenceScreen
	xmlns:android="http://schemas.android.com/apk/res/android">
	<ListPreference
		android:title="@string/prefs_serv_title"
		android:summary="@string/prefs_serv_summ"
		android:key="service"
		android:defaultValue="goo.gl"
		android:entries="@array/serviceNames"
		android:entryValues="@array/serviceValues" />
	<PreferenceCategory
		android:title="@string/prefs_bitlyconfig">
		<EditTextPreference
			android:title="@string/prefs_bitly_name_title"
			android:summary="@string/prefs_bitly_name_summ"
			android:key="bitlyUsername"
			android:defaultValue="" />
		<EditTextPreference
			android:title="@string/prefs_bitly_key_title"
			android:summary="@string/prefs_bitly_key_summ"
			android:key="bitlyKey"
			android:defaultValue="" />
		<Preference
			android:title="@string/prefs_bitly_getkey_title"
			android:summary="@string/prefs_bitly_getkey_summ"
			android:key="getBitlyKey" />
	</PreferenceCategory>
</PreferenceScreen>


text:
<?php

namespace frontend\controllers;

use Yii;
use app\models\RefAcara;
use frontend\models\RefAcaraSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\Response;

use yii\helpers\Json;

use app\models\RefSukan;

/**
 * RefAcaraController implements the CRUD actions for RefAcara model.
 */
class RefAcaraController extends Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all RefAcara models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new RefAcaraSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single RefAcara model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        $model = $this->findModel($id);

        $ref = RefSukan::findOne(['id' => $model->ref_sukan_id]);
        $model->ref_sukan_id = $ref['desc'];

        return $this->render('view', [
            'model' => $model,
        ]);
    }

    /**
     * Creates a new RefAcara model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new RefAcara();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing RefAcara model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing RefAcara model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the RefAcara model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return RefAcara the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = RefAcara::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * Get Acaras base on Sukan id
     * @param integer $id
     * @return mixed
     */
    public function actionSubacaras()
    {
        $out = [];
        if (isset($_POST['depdrop_parents'])) {
            $parents = $_POST['depdrop_parents'];
            if ($parents != null) {
                $cat_id = $parents[0];
                $out = self::getAcarasBySukan($cat_id);
                // the getSubCatList function will query the database based on the
                // cat_id and return an array like below:
                // [
                //    ['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],
                //    ['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']
                // ]
                echo Json::encode(['output'=>$out, 'selected'=>'']);
                return;
            }
        } else {
			$out = self::getAcarasBySukan(null);
			echo Json::encode(['output'=>$out, 'selected'=>'']);
			return;
		}
        echo Json::encode(['output'=>'', 'selected'=>'']);
    }

    /**
     * get list of Acaras by Sukan
     * @param integer $id
     * @return Array Bandars
     */
    public static function getAcarasBySukan($sukan_id) {
		if($sukan_id != null){
			$data = RefAcara::find()->where(['ref_sukan_id'=>$sukan_id])->select(['id','desc AS name','discipline'])->asArray()->all();
		} else {
			$data = RefAcara::find()->select(['id','desc AS name','discipline'])->asArray()->all();
		}

        for($i=0; $i < count($data); $i++){
            if(isset($data[$i]['discipline']) && $data[$i]['discipline'] != ""){
                $data[$i]['name'] = $data[$i]['discipline'] . ' - ' . $data[$i]['name'];
            }
        }

        $value = (count($data) == 0) ? ['' => ''] : $data;

        return $value;
    }
}


text:
package com.trioptimum.shodan.intercept.service;

import com.trioptimum.shodan.common.internal.ParameterizedCalling;
import com.trioptimum.shodan.intercept.internal.InterceptionContext;

public interface Interception {

	Object intercept(InterceptionContext context, ParameterizedCalling callablePoint) throws Exception;
}


text:
$(document).ready(function(){
		$("#form").submit(function(){
				$('#loader-login').show();
				$("button[type='submit']").attr("disabled","disabled");
				updateModel($(this).serialize());
		});
	});
	function updateModel(form){
		var data = form;
		$.post(addressUpdateModel, data, function(send){
			if(send.state){
				$("#loader-login").fadeOut('fast');
				showMessage(send.type);
				$("button[type='submit']").removeAttr("disabled");
			}
		},'JSON');
	}


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

<title>Using the GNU Compiler Collection (GCC): TILE-Gx Options</title>

<meta name="description" content="Using the GNU Compiler Collection (GCC): TILE-Gx Options">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): TILE-Gx Options">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
<link href="TILEPro-Options.html#TILEPro-Options" rel="next" title="TILEPro Options">
<link href="System-V-Options.html#System-V-Options" rel="prev" title="System V Options">

Next: TILEPro Options, Previous: System V Options, Up: Submodel Options   [Contents][Index]

3.17.47 TILE-Gx Options

These ‘<samp>-m</samp>’ options are supported on the TILE-Gx:

-mcmodel=small

Generate code for the small model.  The distance for direct calls is
limited to 500M in either direction.  PC-relative addresses are 32
bits.  Absolute addresses support the full address range.

-mcmodel=large

Generate code for the large model.  There is no limitation on call
distance, pc-relative addresses, or absolute addresses.

-mcpu=<var>name</var>

Selects the type of CPU to be targeted.  Currently the only supported
type is ‘<samp>tilegx</samp>’.

-m32

-m64

Generate code for a 32-bit or 64-bit environment.  The 32-bit
environment sets int, long, and pointer to 32 bits.  The 64-bit
environment sets int to 32 bits and long and pointer to 64 bits.

-mbig-endian

-mlittle-endian

Generate code in big/little endian mode, respectively.


text:
package algs.blog.example.model.problems;

import algs.model.searchtree.IMove;
import algs.model.searchtree.INode;

/**
 * In pseudo code example, a player can cut both in half providing they
 * are both even.
 *
 * @author George Heineman
 * @version 1.1, 3/4/11
 * @since 1.1
 */
public class CutInHalfMove implements IMove {

	/** Increment move selects the position to be incremented. */
	public CutInHalfMove () {

	}

	/** Execute a move. */
	public boolean execute(INode state) {
		SmallPuzzle tp = (SmallPuzzle) state;
		tp.s[0] /= 2;
		tp.s[1] /= 2;
		return true;
	}

	/** Moves are always valid. */
	public boolean isValid(INode state) {
		SmallPuzzle tp = (SmallPuzzle) state;
		return (tp.s[0] % 2 == 0) && (tp.s[1] % 2 == 0);
	}

	/** Undo a move. */
	public boolean undo(INode state) {
		SmallPuzzle tp = (SmallPuzzle) state;
		tp.s[0] *= 2;
		tp.s[1] *= 2;
		return true;
	}

}


text:
class PageManager
  Page = Struct.new(:name, :number, :transitions_to, :skip_to, :namespace)

  class << self
    def pages
      @pages ||= []
    end

    def page(name, config = {})
      pages << Page.new(name, *config.values_at(:number, :transitions_to, :skip_to))
    end

    def first_page
      @pages.first.name
    end

    def page_names
      @pages.map(&:name)
    end

    def namespace(name = nil)
      return @namespace if name.nil?
      @namespace = name
    end
  end

  def initialize(resource:)
    @resource = resource
  end

  def forward
    page.transitions_to
  end

  def skip
    page.skip_to
  end

  def current_page
    page.number
  end

  def total_pages
    self.class.pages.map(&:number).compact.uniq.size
  end

  private def page
    @page ||= self.class.pages.find do |p|
      if self.class.namespace.nil?
        p.name == @resource.form_name
      else
        [self.class.namespace, p.name].join('/') == @resource.form_name
      end
    end
  end
end


text:
RSpec.configure do |config|
  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'
end

require 'webmock/rspec'
require 'similarweb'

WebMock.disable_net_connect!(allow_localhost: true)


text:
$(document).ready(function() {
    $('.container').height($(window).outerHeight(true) - ($(window).outerHeight(true) - $(window).height() + 5) - $('.header').height());
    $('.one').simpleWindows({
        php: {
            file: false
        },
        headerText: 'http://atandrastoth.co.uk/advtable/',
        dimension: {
            top: 40,
            left: 40,
            width: 1000,
            height: 300
        }
    });
    $('.two').simpleWindows({
        source: $('<textarea style =  "width:100%;height:100%;"></textarea>'),
        headerText: 'Table from Database  - press alt + r to refresh -',
        funcKey: 'altKey',
        arrangeKey: 'c',
        keys: {
            loadKey: {
                key: 'r',
                order: 'sql',
                param: 100,
                phpFile: 'com.php',
                resFunction: function() {
                    simWinGlobal.winBody.html('
---- LOADING ----
');
                    var retVal = simWinGlobal.active.simpleWindows.ajaxCall(this.phpFile, this.order, this.param);
                    simWinGlobal.winBody.html('
' + retVal + '
');
                }
            }
        },
        dimension: {
            top: 80,
            left: 80,
            width: 800,
            height: 300,
        }
    });
    $('.three').simpleWindows({
        headerText: 'Note  - press alt + l -',
        dimension: {
            top: 120,
            left: 120,
            width: 800,
            height: 400
        },
        keys: {
            loadKey: {
                key: 'l',
                order: 'note_read',
                param: '',
                phpFile: 'com.php',
                resFunction: function() {
                    var retVal = simWinGlobal.active.simpleWindows.ajaxCall(this.phpFile, this.order, this.param);
                    simWinGlobal.winBody.html('<textarea id = "texts" style = "width:100%;height:100%;overflow:auto">' + retVal + '</textarea>');
                    $('#texts').focusin();
                }
            },
            saveKey: {
                key: 's',
                order: 'note_write',
                param: '',
                phpFile: 'com.php',
                resFunction: function() {
                    var cont = simWinGlobal.winBody.children().val();
                    simWinGlobal.active.simpleWindows.ajaxCall(this.phpFile, this.order, cont);
                }
            }
        }
    })
    $('[name="viewDoc"]').click(function() {
        $('.overlay').fadeIn();
        $('.documentWrapper').fadeIn();
    });
    areaSetSyntax($('[name="htmlCode"]'),"text/html");
    areaSetSyntax($('[name="params"]'),"application/javascript");
    areaSetSyntax($('[name="php"]'),"application/x-httpd-php");
    $('.documentWrapper').css('display','none');
    $('.close').click(function(){
        $('.overlay').fadeOut();
        $('.documentWrapper').fadeOut();
    })
});

function areaSetSyntax(argument,mode) {
    var editor = CodeMirror.fromTextArea(argument[0], {
        mode: mode,
        tabMode: "indent",
        readOnly: true
    });
    editor.setOption("theme", "monokai");
    argument.next('div').css({
        'text-align': 'left',
        'height': '18em'
    });

}

function randomed() {
    var w = $('.container').width() - 500;
    var h = $('.container').height() - 300;
    h = Math.floor((Math.random() * h) + 1);
    w = Math.floor((Math.random() * w) + 1);

    $('
').appendTo('.container').simpleWindows({
        dimension: {
            top: h,
            left: w,
            width: 500,
            height: 300
        }
    })
}


text:
package dream.yanhua.com.diskcache.utils;

import android.util.Log;

public final class L {

    private static final String TAG = "DiskCacheLog";

    private static final String LOG_FORMAT = "%1$s\n%2$s";
    private static volatile boolean writeDebugLogs = false;
    private static volatile boolean writeLogs = true;

    private L() {
    }

    @Deprecated
    public static void enableLogging() {
        writeLogs(true);
    }

    @Deprecated
    public static void disableLogging() {
        writeLogs(false);
    }

    public static void writeDebugLogs(boolean writeDebugLogs) {
        L.writeDebugLogs = writeDebugLogs;
    }

    public static void writeLogs(boolean writeLogs) {
        L.writeLogs = writeLogs;
    }

    public static void d(String message, Object... args) {
        if (writeDebugLogs) {
            log(Log.DEBUG, null, message, args);
        }
    }

    public static void i(String message, Object... args) {
        log(Log.INFO, null, message, args);
    }

    public static void w(String message, Object... args) {
        log(Log.WARN, null, message, args);
    }

    public static void e(Throwable ex) {
        log(Log.ERROR, ex, null);
    }

    public static void e(String message, Object... args) {
        log(Log.ERROR, null, message, args);
    }

    public static void e(Throwable ex, String message, Object... args) {
        log(Log.ERROR, ex, message, args);
    }

    private static void log(int priority, Throwable ex, String message, Object... args) {
        if (!writeLogs) return;
        if (args.length > 0) {
            message = String.format(message, args);
        }

        String log;
        if (ex == null) {
            log = message;
        } else {
            String logMessage = message == null ? ex.getMessage() : message;
            String logBody = Log.getStackTraceString(ex);
            log = String.format(LOG_FORMAT, logMessage, logBody);
        }
        Log.println(priority, TAG, log);
    }
}


text:
import pytest
from lxml import etree
from six.moves.urllib.request import urlretrieve
import os.path
import tempfile

@pytest.fixture(scope='module')
def dtd():
    tmp_dir = tempfile.mkdtemp()
    dtd_file = os.path.abspath(os.path.join(tmp_dir, "docbook.dtd"))
    urlretrieve("http://docbook.org/xml/5.0/dtd/docbook.dtd", dtd_file)
    return etree.DTD(file=dtd_file, external_id="-//OASIS//DTD DocBook XML V5.0//EN")


text:
title: Open Source Projects
date: 2014-05-05 02:58:00 Z
tags:
- Front-end Development
image: code
year: Autumn 2014 – Ongoing
link: https://github.com/mblode/
link-title: GitHub
---

I have created a large variety of open source projects and experiments released freely on GitHub. This includes two of my highly popular projects, [Marx](http://matthewblode.com/marx/) and [Burger](http://codepen.io/mblode/full/qEGWwB/).


text:
package com.cjmalloy.torrentfs.editor.ui.swing.component;

import java.io.IOException;
import java.util.*;
import javax.swing.JTabbedPane;

import com.cjmalloy.torrentfs.editor.controller.*;
import com.cjmalloy.torrentfs.editor.event.DoErrorMessage;
import com.cjmalloy.torrentfs.editor.model.EditorFileModel;
import com.cjmalloy.torrentfs.editor.model.EditorFileModel.Facet;
import com.cjmalloy.torrentfs.editor.ui.swing.HasWidget;
import com.cjmalloy.torrentfs.editor.ui.swing.component.FacetEditor.FileEditorFactory;
import com.google.common.eventbus.Subscribe;

public class FileEditor implements HasWidget {
  private static final ResourceBundle R = ResourceBundle.getBundle("com.cjmalloy.torrentfs.editor.i18n.MessageBundle");

  private JTabbedPane tabs;

  private EditorFileController controller;

  private List<Facet> facets = new ArrayList<>();
  private List<FacetEditor> facetEditors = new ArrayList<>();
  private int currentFacet;

  public FileEditor(EditorFileModel model) {
    this.controller = MainController.get().editor.getController(model);
    update(model);
    Controller.EVENT_BUS.register(this);
  }

  public void close() {
    Controller.EVENT_BUS.unregister(this);
    for (FacetEditor e : facetEditors) {
      e.close();
    }
    tabs.removeAll();
    facets.clear();
    facetEditors.clear();
  }

  @Override
  public JTabbedPane getWidget() {
    if (tabs == null) {
      tabs = new JTabbedPane();
      tabs.setTabPlacement(JTabbedPane.BOTTOM);
    }
    return tabs;
  }

  @Subscribe
  public void update(EditorFileModel model) {
    if (controller.model != model) return;

    for (Facet facet : model.supportedFacets) {
      if (facets.contains(facet)) continue;

      FacetEditor c;
      try {
        c = FileEditorFactory.create(facet, controller);
        facets.add(facet);
        facetEditors.add(c);
        getWidget().addTab(getTitle(facet), c.getWidget());
      } catch (IOException e) {
        e.printStackTrace();
        Controller.EVENT_BUS.post(new DoErrorMessage(e.getMessage()));
      }
    }
    for (int i = facets.size() - 1; i >= 0; i--) {
      Facet facet = facets.get(i);
      if (model.supportedFacets.contains(facet)) continue;

      FacetEditor c = facetEditors.get(i);
      c.close();
      facetEditors.remove(i);
      facets.remove(i);
      getWidget().remove(c.getWidget());
    }

    if (currentFacet != model.editMode) {
      currentFacet = model.editMode;
      tabs.setSelectedIndex(currentFacet);
    }
  }

  private static String getTitle(Facet facet) {
    switch (facet) {
      case PROPERTIES:
        return R.getString("propertiesFacetTabTitle");
      case RAW:
        return R.getString("rawFacetTabTitle");
    }
    return null;
  }
}


text:
var client = new XMLHttpRequest();
client.open('GET', 'static/RESOURCES.md');
client.onreadystatechange = function() {
    var converter = new showdown.Converter(),
    text      = client.responseText,
    html      = converter.makeHtml(text);
    var page=document.getElementById("markdown-content");
    page.innerHTML=html;
}
client.send();


text:
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.objects.callback;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.vk.api.sdk.objects.Validable;
import com.vk.api.sdk.objects.annotations.Required;
import java.util.Objects;

/**
 * VideoCommentDelete object
 */
public class VideoCommentDelete implements Validable {
    @SerializedName("id")
    @Required
    private Integer id;

    @SerializedName("owner_id")
    private Integer ownerId;

    @SerializedName("user_id")
    private Integer userId;

    @SerializedName("video_id")
    private Integer videoId;

    public Integer getId() {
        return id;
    }

    public VideoCommentDelete setId(Integer id) {
        this.id = id;
        return this;
    }

    public Integer getOwnerId() {
        return ownerId;
    }

    public VideoCommentDelete setOwnerId(Integer ownerId) {
        this.ownerId = ownerId;
        return this;
    }

    public Integer getUserId() {
        return userId;
    }

    public VideoCommentDelete setUserId(Integer userId) {
        this.userId = userId;
        return this;
    }

    public Integer getVideoId() {
        return videoId;
    }

    public VideoCommentDelete setVideoId(Integer videoId) {
        this.videoId = videoId;
        return this;
    }

    @Override
    public int hashCode() {
        return Objects.hash(videoId, id, ownerId, userId);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VideoCommentDelete videoCommentDelete = (VideoCommentDelete) o;
        return Objects.equals(userId, videoCommentDelete.userId) &&
                Objects.equals(ownerId, videoCommentDelete.ownerId) &&
                Objects.equals(id, videoCommentDelete.id) &&
                Objects.equals(videoId, videoCommentDelete.videoId);
    }

    @Override
    public String toString() {
        final Gson gson = new Gson();
        return gson.toJson(this);
    }

    public String toPrettyString() {
        final StringBuilder sb = new StringBuilder("VideoCommentDelete{");
        sb.append("userId=").append(userId);
        sb.append(", ownerId=").append(ownerId);
        sb.append(", id=").append(id);
        sb.append(", videoId=").append(videoId);
        sb.append('}');
        return sb.toString();
    }
}


text:
<?xml-stylesheet type='text/xsl' href='./CodelistDictionary-v32.xsl'?><gml:Dictionary xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="OccupantTypeValue" xsi:schemaLocation="http://www.opengis.net/gml null">
  <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9">OccupantTypeValue</gml:identifier>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11791">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">residents</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11792">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">workers</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11793">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">students</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11794">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">patients</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11795">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">visitors</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_9137_11796">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/OccupantTypeValue">othersOrCombination</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
</gml:Dictionary>


text:
package org.wso2.carbon.identity.entitlement;

import org.apache.axis2.clustering.ClusteringCommand;
import org.apache.axis2.clustering.ClusteringFault;
import org.apache.axis2.clustering.ClusteringMessage;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.entitlement.cache.IdentityCacheKey;
import org.wso2.carbon.identity.entitlement.cache.PolicyCache;
import org.wso2.carbon.identity.entitlement.cache.PolicyStatus;

/**
 * ClusterMessage to carry policy status changes (like UPDATE, CREATED) to other nodes.
 */
public class PolicyStatusClusterMessage extends ClusteringMessage {

    private static Log log = LogFactory.getLog(PolicyStatusClusterMessage.class);
    private static final long serialVersionUID = -5025603871368248102L;

    private IdentityCacheKey key;
    private PolicyStatus status;

    public PolicyStatusClusterMessage(IdentityCacheKey key, PolicyStatus status) {
        this.key = key;
        this.status = status;
    }

    public IdentityCacheKey getKey() {
        return key;
    }

    public PolicyStatus getStatus() {
        return status;
    }

    @Override
    public ClusteringCommand getResponse() {
        return null;
    }

    @Override
    public void execute(ConfigurationContext configurationContext) throws ClusteringFault {

        if (log.isDebugEnabled()) {
            log.debug("Received PolicyStatusClusterMessage.");
        }
        // we need to update our local policy status map based on the received cluster message from other node
        PolicyCache.updateLocalPolicyCacheMap(key, status);
        if (log.isDebugEnabled()) {
            log.debug("Updated Local Policy Status Map.");
        }
    }
}


text:
using System;
using System.Collections.Generic;
using tv.ouya.console.api;

namespace tv.ouya.console.api
{
    public class DebugInput
    {
        public static string DebugGetAxisName(int axis)
        {
            Dictionary<int, string> names = new Dictionary<int, string>();
            names[OuyaController.AXIS_LS_X] = "AXIS_LS_X";
            names[OuyaController.AXIS_LS_Y] = "AXIS_LS_Y";
            names[OuyaController.AXIS_RS_X] = "AXIS_RS_X";
            names[OuyaController.AXIS_RS_Y] = "AXIS_RS_Y";
            names[OuyaController.AXIS_L2] = "AXIS_L2";
            names[OuyaController.AXIS_R2] = "AXIS_R2";

            if (names.ContainsKey(axis))
            {
                return names[axis];
            }
            else
            {
                return string.Empty;
            }
        }

        public static String DebugGetButtonName(int button)
        {
            Dictionary<int, string> names = new Dictionary<int, string>();
            names[OuyaController.BUTTON_O] = "BUTTON_O";
            names[OuyaController.BUTTON_U] = "BUTTON_U";
            names[OuyaController.BUTTON_Y] = "BUTTON_Y";
            names[OuyaController.BUTTON_A] = "BUTTON_A";
            names[OuyaController.BUTTON_L1] = "BUTTON_L1";
            names[OuyaController.BUTTON_R1] = "BUTTON_R1";
            names[OuyaController.BUTTON_L3] = "BUTTON_L3";
            names[OuyaController.BUTTON_R3] = "BUTTON_R3";
            names[OuyaController.BUTTON_DPAD_UP] = "BUTTON_DPAD_UP";
            names[OuyaController.BUTTON_DPAD_DOWN] = "BUTTON_DPAD_DOWN";
            names[OuyaController.BUTTON_DPAD_RIGHT] = "BUTTON_DPAD_RIGHT";
            names[OuyaController.BUTTON_DPAD_LEFT] = "BUTTON_DPAD_LEFT";
            names[OuyaController.BUTTON_MENU] = "BUTTON_MENU";

            if (names.ContainsKey(button))
            {
                return names[button];
            }
            else
            {
                return string.Empty;
            }
        }
    }
}

#endif


text:
package guru.nidi.loader.basic;

import guru.nidi.loader.Loader;
import guru.nidi.loader.LoaderFactory;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Handles resources with absolute URIs. Handling of relative URIs are delegated to another RamlLoader.
 * Loaders are registered in META-INF/services/guru.nidi.ramltester.loader.RamlLoaderFactory
 */
public class UriLoader implements Loader {
    private static final Pattern ABSOLUTE_URI_PATTERN = Pattern.compile("(([^:]+):?([^@]*)@)?([^:]+)://(.+)");
    private static final int
            GROUP_USER = 2,
            GROUP_PASSWORD = 3,
            GROUP_PROTOCOL = 4,
            GROUP_PATH = 5;

    private static final Map<String, LoaderFactory> FACTORIES = new HashMap<>();

    static {
        final ServiceLoader<LoaderFactory> loader = ServiceLoader.load(LoaderFactory.class);
        for (final LoaderFactory factory : loader) {
            FACTORIES.put(factory.supportedProtocol(), factory);
        }
    }

    private final Loader relativeLoader;

    public UriLoader() {
        this(null);
    }

    public UriLoader(Loader relativeLoader) {
        this.relativeLoader = relativeLoader;
    }

    @Override
    public InputStream fetchResource(String name, long ifModifiedSince) {
        final String normalized = normalizeResourceName(name);
        final Matcher matcher = ABSOLUTE_URI_PATTERN.matcher(normalized);
        if (matcher.matches()) {
            String path = matcher.group(GROUP_PATH);
            String res = "";
            final int lastSlash = path.lastIndexOf('/');
            if (lastSlash >= 0 && lastSlash < path.length() - 1) {
                res = path.substring(lastSlash + 1);
                path = path.substring(0, lastSlash);
            }
            final int query = res.indexOf('?');
            if (query >= 0) {
                path += res.substring(query);
                res = res.substring(0, query);
            }
            return absoluteLoader(matcher.group(GROUP_PROTOCOL), path, matcher.group(GROUP_USER), matcher.group(GROUP_PASSWORD))
                    .fetchResource(res, ifModifiedSince);
        }
        if (relativeLoader == null) {
            throw new IllegalArgumentException("Expected absolute uri '[username:password@]protocol://base[/file]', but got '" + name + "'");
        }
        return relativeLoader.fetchResource(normalized, ifModifiedSince);
    }

    @Override
    public String config() {
        return "uri-" + (relativeLoader == null ? "" : relativeLoader.config());
    }

    //raml parser does its own absolute/relative handling (org.raml.parser.tagresolver.ContextPath#resolveAbsolutePath)
    // -> hack to undo this
    private String normalizeResourceName(String name) {
        if (name.startsWith("//")) {
            return "classpath:" + name;
        }
        final int firstProtocol = name.indexOf("://");
        final int secondProtocol = name.indexOf("://", firstProtocol + 1);
        final int protocol = secondProtocol < 0 ? firstProtocol : secondProtocol;
        final int endOfFirst = name.lastIndexOf("/", protocol);
        if (endOfFirst >= 0) {
            return name.substring(endOfFirst + 1);
        }
        return name;
    }

    private Loader absoluteLoader(String protocol, String base, String username, String password) {
        final LoaderFactory factory = FACTORIES.get(protocol);
        if (factory == null) {
            throw new IllegalArgumentException("Unsupported protocol " + protocol);
        }
        return factory.getLoader(base, username, password);
    }
}


text:
require "pandoc-ruby"

module PresentationsHelper
  def template_path(template)
    File.join(TEMPLATE_PATH, template).to_s
  end
  def render_inner_template(frame)
    template = frame.presentation.template;
    render(
      :file => File.join(template_path(template), frame.template + ".html.haml").to_s,
      :locals => {:frame => frame}
    )
  end
  def render_slot(slot, css_class="")
    return "" unless slot
    if slot["mode"] == "asset" and slot.asset
      @content = slot.asset.content
      render :partial => content_partial(slot.asset.content, "preview") if slot.asset
    else
      PandocRuby.convert(slot["markup"], :from => :markdown, :to => :html)
    end
  end
end


text:
using GaLib.Interop.IPC;
using GaLib.Interop.Messaging;
using GaLib.Interop.Messaging.Messages;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace GaLib.Interop
{
    class CallHandler : ICallHandler
    {
        private readonly ConcurrentDictionary<Guid, MethodInfo> methodInfos = new ConcurrentDictionary<Guid, MethodInfo>();

        private readonly IObjectMapper mapper;
        private readonly IpcClientPipe client;

        public CallHandler(IObjectMapper mapper, string serverName, string serverToken)
        {
            this.mapper = mapper;
            client = new IpcClientPipe(serverName, serverToken);
        }

        public MethodInfoAnswer HandleMethodInfoRequest(MethodInfoRequest methodInfoRequest)
        {

            throw new NotImplementedException();
        }

        public void HandleMethodInfoAnswer(MethodInfoAnswer methodInfoAnswer)
        {
            throw new NotImplementedException();
        }

        public CallAnswer HandleCallRequest(CallRequest callRequest)
        {
            CallAnswer result = null;
            MethodInfo methodInfo;
            methodInfos.TryGetValue(callRequest.MethodInfoId, out methodInfo);
            if (methodInfo != null)
            {
                callRequest.Target = GetRealObject(callRequest.Target);
                object[] paramValues = callRequest.ParameterValues;
                for (int i = 0; i < paramValues.Length; i++)
                {
                    paramValues[i] = GetRealObject(paramValues[i]);
                }

                result = new CallAnswer();

                try
                {
                    object returnValue = methodInfo.Invoke(callRequest.Target, paramValues);
                    result.ReturnValue = GetObjectId(returnValue);
                    //foreach()
                }
                catch (Exception ex)
                {
                    result.ExceptionMessage = ex.Message;
                }
            }
            return result;
        }

        public void HandleCallAnswer(CallAnswer callAnswer)
        {
            throw new NotImplementedException();
        }

        private object GetRealObject(object referenceId)
        {
            return null;
        }

        private object GetObjectId(object referenceId)
        {
            return null;
        }
    }
}


text:
module('BadAriaAttributeValue');

test('Empty idref value is ok', function(assert) {
    var fixture = document.getElementById('qunit-fixture');
    var div = document.createElement('div');
    fixture.appendChild(div);
    div.setAttribute('aria-activedescendant', '');
    var config = {
        ruleName: 'badAriaAttributeValue',
        expected: axs.constants.AuditResult.PASS,
        elements: []
    };
    assert.runRule(config);
});

test('Bad number value doesn\'t cause crash', function(assert) {
    var fixture = document.getElementById('qunit-fixture');
    var div = document.createElement('div');
    fixture.appendChild(div);
    div.setAttribute('aria-valuenow', 'foo');
    var config = {
        ruleName: 'badAriaAttributeValue',
        expected: axs.constants.AuditResult.FAIL,
        elements: [div]
    };
    assert.runRule(config);
});

test('Good number value is good', function(assert) {
    var fixture = document.getElementById('qunit-fixture');
    var div = document.createElement('div');
    fixture.appendChild(div);
    div.setAttribute('aria-valuenow', '10');
    var config = {
        ruleName: 'badAriaAttributeValue',
        expected: axs.constants.AuditResult.PASS,
        elements: []
    };
    assert.runRule(config);
});

test('Good decimal number value is good', function(assert) {
    var fixture = document.getElementById('qunit-fixture');
    var div = document.createElement('div');
    fixture.appendChild(div);
    div.setAttribute('aria-valuenow', '0.5');
    var config = {
        ruleName: 'badAriaAttributeValue',
        expected: axs.constants.AuditResult.PASS,
        elements: []
    };
    assert.runRule(config);
});

test('Good negative number value is good', function(assert) {
    var fixture = document.getElementById('qunit-fixture');
    var div = document.createElement('div');
    fixture.appendChild(div);
    div.setAttribute('aria-valuenow', '-10');
    var config = {
        ruleName: 'badAriaAttributeValue',
        expected: axs.constants.AuditResult.PASS,
        elements: []
    };
    assert.runRule(config);
});


text:
*Read this in other languages: [日本語](README.ja.md)*

# CakeMoney

CakeMoney is a simple household account book (for my wife).
This application is implemented by CakePHP 3.

The way of booking is based on double-entry bookkeeping system.

![Dashboard](webroot/img/screenshots/dashboard-l-en-s.png)

![Report](webroot/img/screenshots/report-l-en-s.png)

* [Dashboard](webroot/img/screenshots/dashboard-l-en.png)
* [Report](webroot/img/screenshots/report-l-en.png)
* [Dashboard on mobile](webroot/img/screenshots/dashboard-s-en.png)
* [Report on mobile](webroot/img/screenshots/report-s-en.png)

## Requirements

* PHP 5.6 or later
* MySQL or PostgreSQL

For more detail, see
[CakePHP Cookbook](https://book.cakephp.org/3.0/en/installation.html#requirements).

CakeMoney refers via CDN:
* Font Awesome
* Twitter Bootstrap
* Bootstrap Datepicker
* Chart.js
* Select2

## Installation

### CakeMoney

1. Download or install [Composer](http://getcomposer.org/doc/00-intro.md).
2. Clone or copy files of CakeMoney.
3. Change directory to CakeMoney directory and
execute `composer install` to install necessary libraries.
```bash
cd /var/www/html/cakemoney
php composer.phar install
```

### Database

1. Create database for CakeMoney.
2. Create `config/app.php` and set suitable values in
`Datasources.default` array.
3. Create database tables by executing the following:
```bash
./bin/cake migrations migrate
```

### Web server

Configure web server. (e.g. Apache and mod_rewrite)
See [CakePHP Cookbook](https://book.cakephp.org/3.0/en/installation.html#url-rewriting).

## Usage

### Category setting

First, add categories.
Open "Categories" page from navigation bar and click "New Category" on the
right side of the page.

Add categories as the following:

| Name           | Account   |
|----------------|-----------|
| Salary         | Income    |
| Cash           | Asset     |
| Credit card    | Liability |
| Foods          | Expense   |
| Clothes/Beauty | Expense   |
| ...            | ...       |

### Journal

In order to book giving and taking of money,
open "New Journal" on the right side of the page.

### Report

If you want to know the summary, open "Reports" page.

## License

[MIT](LICENSE)

## Author

Takeshi Nakamura


text:
package work.samoje.colors.modification.filter.filters;

import work.samoje.colors.ColorHelpers;

/**
 * Abstract filter instance which applies the filter with an intensity dictated
 * by the specified multiplier.
 *
 * @author Jennie Sadler
 */
public abstract class IntensityFilter implements Filter {
    private final double intensity;

    public IntensityFilter(final int multiplier, final int maxMultiplier) {
        this.intensity = (multiplier * 1.0) / maxMultiplier;
    }

    /**
     * Applies the filter intensity given the original color value and the
     * filtered color value.
     *
     * Does this with the following calculation:
     *
     * result = original(1 - intensity) + (filtered * intensity)
     *
     * @param original
     *            The original int value, before the filter is applied
     * @param filtered
     *            The filtered int value, to be applied by the configured
     *            intensity.
     * @return The result value, filtered to the correct intensity
     */
    protected int applyIntensity(final double original, final double filtered) {
        return ColorHelpers.boundByColorRange((original * (1.0 - intensity))
                + (filtered * intensity));
    }
}


text:
namespace DEM::Game
{

bool CAbility::PushStandardExecuteAction(CGameWorld& World, HEntity Actor, const CInteractionContext& Context, bool Enqueue, bool PushChild) const
{
	if (auto pQueue = World.FindComponent<CActionQueueComponent>(Actor))
	{
		PAbilityInstance AbilityInstance(n_new(CAbilityInstance(*this)));
		AbilityInstance->Source = Context.Source;
		AbilityInstance->Targets = Context.Targets;

		// TODO: move to queue method?
		if (PushChild && pQueue->GetCurrent()) pQueue->PushOrUpdateChild<ExecuteAbility>(pQueue->GetCurrent(), std::move(AbilityInstance));
		else
		{
			if (!Enqueue) pQueue->Reset();
			pQueue->EnqueueAction<ExecuteAbility>(std::move(AbilityInstance));
		}
		return true;
	}

	return false;
}
//---------------------------------------------------------------------

}


text:
// Util methods for sorting a slice of values with respect to the comparator

package utils

import "github.com/emirpasic/gods/utils/timsort"

// Sorts values (in-place) using timsort
func Sort(values []interface{}, comparator Comparator) {
	less := func(a, b interface{}) bool { return comparator(a, b) < 0 }
	timsort.Sort(values, less)
}


text:
package scala.tools.nsc.interpreter.shell

import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

case class Tabby(width: Int = 80, isAcross: Boolean = false, marginSize: Int = 3) extends Tabulator
case class VTabby(width: Int = 80, isAcross: Boolean = false, marginSize: Int = 3) extends VariColumnTabulator

@RunWith(classOf[JUnit4])
class TabulatorTest {

  // à̧̄ is composed using 3 combining characters
  val complexA = "a\u0300\u0304\u0327"
  // 𝔟 is stored as 2 characters, but displayed as 1 grapheme
  val frakturB = "\uD835\uDD1F"

  @Test def oneliner() = {
    val sut   = Tabby()
    val items = List(complexA, frakturB, "c")
    val res   = sut tabulate items
    assert(res.size == 1)
    assert(res(0).size == 1)
    assert(res(0)(0) startsWith complexA)
    assert(res(0)(0) endsWith "c")
  }
  @Test def twoliner() = {
    val sut   = Tabby(width = 40)
    val items = List(complexA * 15, frakturB * 15, "c" * 15)
    val res   = sut tabulate items
    assert(res.size == 2)
    assert(res(0).size == 2)
    assert(res(1).size == 2)          // trailing empty strings
    assert(res(1)(0) startsWith frakturB)
  }
  @Test def twolinerx() = {
    val sut   = Tabby(width = 40, isAcross = true)
    val items = List(complexA * 15, frakturB * 15, "c" * 15)
    val res   = sut tabulate items
    assertEquals(res.size, 2)
    assertEquals(res(0).size, 2)
    assertEquals(res(1).size, 1)          // no trailing empty strings
    assert(res(1)(0) startsWith "c")
  }
  // before, two 9-width cols don't fit in 20
  // but now, 5-col and 9-col do fit.
  @Test def twolinerVariable() = {
    val sut   = VTabby(width = 20)
    val items = (1 to 9) map (i => i.toString * i)
    val rows  = sut tabulate items
    assertEquals(rows.size, 5)
    assertEquals(rows(0).size,2)
    assertEquals(rows(0)(0).size, 8) // width is 55555 plus margin of 3
  }
  @Test def sys() = {
    val sut   = VTabby(width = 40)
    val items = List("BooleanProp", "PropImpl", "addShutdownHook", "error",
                    "process", "CreatorImpl", "ShutdownHookThread", "allThreads",
                    "exit", "props", "Prop", "SystemProperties",
                    "env", "package", "runtime")
    val rows  = sut tabulate items
    assertEquals(rows.size, 8)
    assertEquals(rows(0).size, 2)
    assertEquals(rows(0)(0).size, "ShutdownHookThread".length + sut.marginSize)   // 21
  }
  @Test def syswide() = {
    val sut   = VTabby(width = 120)
    val items = List("BooleanProp", "PropImpl", "addShutdownHook", "error",
                    "process", "CreatorImpl", "ShutdownHookThread", "allThreads",
                    "exit", "props", "Prop", "SystemProperties",
                    "env", "package", "runtime")
    val rows  = sut tabulate items
    assertEquals(rows.size, 2)
    assertEquals(rows(0).size, 8)
    assertEquals(rows(0)(0).size, "BooleanProp".length + sut.marginSize)  // 14
  }
  @Test def resultFits() = {
    val sut   = VTabby(width = 10)
    // each of two lines would fit, but layout is two cols of width six > 10
    // therefore, should choose ncols = 1
    val items = List(complexA, "bcd",
                    "efg", frakturB)
    val rows  = sut tabulate items
    assertEquals(rows.size, 4)
    assertEquals(rows(0).size, 1)
    assertEquals(rows(0)(0).size, complexA.length + 2 + sut.marginSize)
  }
  @Test def badFit() = {
    val sut = VTabby(isAcross = true)
    val items = ('a' until 'z').map(_.toString).toList
    val rows = sut tabulate items
    assertEquals(rows.size, 2)
    assertEquals(rows(0).size, 20)   // 20 * 4 = 80
    assertEquals(rows(1)(0).dropRight(sut.marginSize), "u")
  }
  @Test def badFitter() = {
    val sut = VTabby(isAcross = true)
    val items = List (
      "%", "&", "*", "+", "-", "/", ">", ">=", ">>", ">>>", "^",
      "asInstanceOf", "isInstanceOf", "toByte", "toChar", "toDouble", "toFloat",
      "toInt", "toLong", "toShort", "toString", "unary_+", "unary_-", "unary_~", "|"
    )
    val rows = sut tabulate items
    assertEquals(rows.size, 4)
    assertEquals(rows(3).size, 4)   // 7 cols
    assertEquals(rows(3)(0).dropRight(sut.marginSize), "unary_+")
  }
}


text:
package org.opensaml.xml.signature.impl;

import org.opensaml.xml.schema.impl.XSBase64BinaryImpl;
import org.opensaml.xml.signature.DEREncodedKeyValue;

/**
 * Concrete implementation of {@link DEREncodedKeyValue}.
 */
public class DEREncodedKeyValueImpl extends XSBase64BinaryImpl implements DEREncodedKeyValue {

    /** Algorithm attribute value. */
    private String id;

    /**
     * Constructor.
     *
     * @param namespaceURI the namespace the element is in
     * @param elementLocalName the local name of the XML element this Object represents
     * @param namespacePrefix the prefix for the given namespace
     */
    protected DEREncodedKeyValueImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
        super(namespaceURI, elementLocalName, namespacePrefix);
    }

    /** {@inheritDoc} */
    public String getID() {
        return id;
    }

    /** {@inheritDoc} */
    public void setID(String newID) {
        String oldID = id;
        id = prepareForAssignment(id, newID);
        registerOwnID(oldID, id);
    }

}


text:
package errors

import (
	"fmt"
)

type InvalidRepoReference struct {
	Ref string
}

func IsInvalidRepoReference(err error) bool {
	_, ok := err.(InvalidRepoReference)
	return ok
}

func (err InvalidRepoReference) Error() string {
	return fmt.Sprintf("invalid repository reference [ref: %s]", err.Ref)
}

type MirrorNotExist struct {
	RepoID int64
}

func IsMirrorNotExist(err error) bool {
	_, ok := err.(MirrorNotExist)
	return ok
}

func (err MirrorNotExist) Error() string {
	return fmt.Sprintf("mirror does not exist [repo_id: %d]", err.RepoID)
}

type BranchAlreadyExists struct {
	Name string
}

func IsBranchAlreadyExists(err error) bool {
	_, ok := err.(BranchAlreadyExists)
	return ok
}

func (err BranchAlreadyExists) Error() string {
	return fmt.Sprintf("branch already exists [name: %s]", err.Name)
}


text:
#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

#include "unicode/dcfmtsym.h"
#include "unicode/ures.h"
#include "unicode/decimfmt.h"
#include "unicode/ucurr.h"
#include "unicode/choicfmt.h"
#include "unicode/unistr.h"
#include "unicode/numsys.h"
#include "ucurrimp.h"
#include "cstring.h"
#include "locbased.h"
#include "uresimp.h"
#include "ureslocs.h"

// *****************************************************************************
// class DecimalFormatSymbols
// *****************************************************************************

U_NAMESPACE_BEGIN

UOBJECT_DEFINE_RTTI_IMPLEMENTATION(DecimalFormatSymbols)

static const char gNumberElements[] = "NumberElements";
static const char gCurrencySpacingTag[] = "currencySpacing";
static const char gBeforeCurrencyTag[] = "beforeCurrency";
static const char gAfterCurrencyTag[] = "afterCurrency";
static const char gCurrencyMatchTag[] = "currencyMatch";
static const char gCurrencySudMatchTag[] = "surroundingMatch";
static const char gCurrencyInsertBtnTag[] = "insertBetween";

static const UChar INTL_CURRENCY_SYMBOL_STR[] = {0xa4, 0xa4, 0};

// -------------------------------------
// Initializes this with the decimal format symbols in the default locale.

DecimalFormatSymbols::DecimalFormatSymbols(UErrorCode& status)
    : UObject(),
    locale()
{
    initialize(locale, status, TRUE);
}

// -------------------------------------
// Initializes this with the decimal format symbols in the desired locale.

DecimalFormatSymbols::DecimalFormatSymbols(const Locale& loc, UErrorCode& status)
    : UObject(),
    locale(loc)
{
    initialize(locale, status);
}

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

DecimalFormatSymbols::~DecimalFormatSymbols()
{
}

// -------------------------------------
// copy constructor

DecimalFormatSymbols::DecimalFormatSymbols(const DecimalFormatSymbols &source)
    : UObject(source)
{
    *this = source;
}

// -------------------------------------
// assignment operator

DecimalFormatSymbols&
DecimalFormatSymbols::operator=(const DecimalFormatSymbols& rhs)
{
    if (this != &rhs) {
        for(int32_t i = 0; i < (int32_t)kFormatSymbolCount; ++i) {
            // fastCopyFrom is safe, see docs on fSymbols
            fSymbols[(ENumberFormatSymbol)i].fastCopyFrom(rhs.fSymbols[(ENumberFormatSymbol)i]);
        }
        for(int32_t i = 0; i < (int32_t)kCurrencySpacingCount; ++i) {
            currencySpcBeforeSym[i].fastCopyFrom(rhs.currencySpcBeforeSym[i]);
            currencySpcAfterSym[i].fastCopyFrom(rhs.currencySpcAfterSym[i]);
        }
        locale = rhs.locale;
        uprv_strcpy(validLocale, rhs.validLocale);
        uprv_strcpy(actualLocale, rhs.actualLocale);
    }
    return *this;
}

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

UBool
DecimalFormatSymbols::operator==(const DecimalFormatSymbols& that) const
{
    if (this == &that) {
        return TRUE;
    }
    for(int32_t i = 0; i < (int32_t)kFormatSymbolCount; ++i) {
        if(fSymbols[(ENumberFormatSymbol)i] != that.fSymbols[(ENumberFormatSymbol)i]) {
            return FALSE;
        }
    }
    for(int32_t i = 0; i < (int32_t)kCurrencySpacingCount; ++i) {
        if(currencySpcBeforeSym[i] != that.currencySpcBeforeSym[i]) {
            return FALSE;
        }
        if(currencySpcAfterSym[i] != that.currencySpcAfterSym[i]) {
            return FALSE;
        }
    }
    return locale == that.locale &&
        uprv_strcmp(validLocale, that.validLocale) == 0 &&
        uprv_strcmp(actualLocale, that.actualLocale) == 0;
}

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

void
DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
                                 UBool useLastResortData)
{
    *validLocale = *actualLocale = 0;
    currPattern = NULL;
    if (U_FAILURE(status))
        return;

    const char* locStr = loc.getName();
    UResourceBundle *resource = ures_open((char *)0, locStr, &status);
    UResourceBundle *numberElementsRes = ures_getByKey(resource, gNumberElements, NULL, &status);

    if (U_FAILURE(status))
    {
        // Initializes with last resort data if necessary.
        if (useLastResortData)
        {
            status = U_USING_FALLBACK_WARNING;
            initialize();
        }
    }
    else {
        // Gets the number element array.
        int32_t numberElementsLength = ures_getSize(numberElementsRes);

        if (numberElementsLength > (int32_t)kFormatSymbolCount) {
            /* Warning: Invalid format. Array too large. */
            numberElementsLength = (int32_t)kFormatSymbolCount;
        }
        // If the array size is too small, something is wrong with the resource
        // bundle, returns the failure error code.
        if (numberElementsLength != 12 || U_FAILURE(status)) {
            status = U_INVALID_FORMAT_ERROR;
        }
        else {
            const UChar *numberElements[kFormatSymbolCount];
            int32_t numberElementsStrLen[kFormatSymbolCount];
            int32_t i = 0;
            for(i = 0; i<numberElementsLength; i++) {
                numberElements[i] = ures_getStringByIndex(numberElementsRes, i, &numberElementsStrLen[i], &status);
            }

            if (U_SUCCESS(status)) {
                initialize(numberElements, numberElementsStrLen, numberElementsLength);

                // Attempt to set the zero digit based on the numbering system for the locale requested
                //
                NumberingSystem* ns = NumberingSystem::createInstance(loc,status);
                if (U_SUCCESS(status) && ns->getRadix() == 10 && !ns->isAlgorithmic()) {
                    UnicodeString zeroDigit(ns->getDescription(),0,1);
                    setSymbol(kZeroDigitSymbol,zeroDigit);
                }
                if (ns) {
                    delete ns;
                }

                // Obtain currency data from the currency API.  This is strictly
                // for backward compatibility; we don't use DecimalFormatSymbols
                // for currency data anymore.
                UErrorCode internalStatus = U_ZERO_ERROR; // don't propagate failures out
                UChar curriso[4];
                UnicodeString tempStr;
                ucurr_forLocale(locStr, curriso, 4, &internalStatus);

                // Reuse numberElements[0] as a temporary buffer
                uprv_getStaticCurrencyName(curriso, locStr, tempStr, internalStatus);
                if (U_SUCCESS(internalStatus)) {
                    fSymbols[kIntlCurrencySymbol] = curriso;
                    fSymbols[kCurrencySymbol] = tempStr;
                }
                /* else use the default values. */
            }

            U_LOCALE_BASED(locBased, *this);
            locBased.setLocaleIDs(ures_getLocaleByType(numberElementsRes,
                                       ULOC_VALID_LOCALE, &status),
                                  ures_getLocaleByType(numberElementsRes,
                                       ULOC_ACTUAL_LOCALE, &status));
        }
        //load the currency data
        UChar ucc[4]={0}; //Currency Codes are always 3 chars long
        int32_t uccLen = 4;
        const char* locName = loc.getName();
        UErrorCode localStatus = U_ZERO_ERROR;
        uccLen = ucurr_forLocale(locName, ucc, uccLen, &localStatus);

        if(U_SUCCESS(localStatus) && uccLen > 0) {
            char cc[4]={0};
            u_UCharsToChars(ucc, cc, uccLen);
            /* An explicit currency was requested */
            UResourceBundle *currencyResource = ures_open(U_ICUDATA_CURR, locStr, &localStatus);
            UResourceBundle *currency = ures_getByKeyWithFallback(currencyResource, "Currencies", NULL, &localStatus);
            currency = ures_getByKeyWithFallback(currency, cc, currency, &localStatus);
            if(U_SUCCESS(localStatus) && ures_getSize(currency)>2) { // the length is 3 if more data is present
                currency = ures_getByIndex(currency, 2, currency, &localStatus);
                int32_t currPatternLen = 0;
                currPattern = ures_getStringByIndex(currency, (int32_t)0, &currPatternLen, &localStatus);
                UnicodeString decimalSep = ures_getStringByIndex(currency, (int32_t)1, NULL, &localStatus);
                UnicodeString groupingSep = ures_getStringByIndex(currency, (int32_t)2, NULL, &localStatus);
                if(U_SUCCESS(localStatus)){
                    fSymbols[kMonetaryGroupingSeparatorSymbol] = groupingSep;
                    fSymbols[kMonetarySeparatorSymbol] = decimalSep;
                    //pattern.setTo(TRUE, currPattern, currPatternLen);
                    status = localStatus;
                }
            }
            ures_close(currency);
            ures_close(currencyResource);
            /* else An explicit currency was requested and is unknown or locale data is malformed. */
            /* ucurr_* API will get the correct value later on. */
        }
        // else ignore the error if no currency
    }
    ures_close(numberElementsRes);

    // Currency Spacing.
    UErrorCode localStatus = U_ZERO_ERROR;
    UResourceBundle *currencyResource = ures_open(U_ICUDATA_CURR, locStr, &localStatus);
    UResourceBundle *currencySpcRes = ures_getByKeyWithFallback(currencyResource,
                                       gCurrencySpacingTag, NULL, &localStatus);

    if (localStatus == U_USING_FALLBACK_WARNING || U_SUCCESS(localStatus)) {
        const char* keywords[kCurrencySpacingCount] = {
            gCurrencyMatchTag, gCurrencySudMatchTag, gCurrencyInsertBtnTag
        };
        localStatus = U_ZERO_ERROR;
        UResourceBundle *dataRes = ures_getByKeyWithFallback(currencySpcRes,
                                   gBeforeCurrencyTag, NULL, &localStatus);
        if (localStatus == U_USING_FALLBACK_WARNING || U_SUCCESS(localStatus)) {
            localStatus = U_ZERO_ERROR;
            for (int32_t i = 0; i < kCurrencySpacingCount; i++) {
              currencySpcBeforeSym[i] = ures_getStringByKey(dataRes, keywords[i],
                                                        NULL, &localStatus);
            }
            ures_close(dataRes);
        }
        dataRes = ures_getByKeyWithFallback(currencySpcRes,
                                  gAfterCurrencyTag, NULL, &localStatus);
        if (localStatus == U_USING_FALLBACK_WARNING || U_SUCCESS(localStatus)) {
            localStatus = U_ZERO_ERROR;
            for (int32_t i = 0; i < kCurrencySpacingCount; i++) {
              currencySpcAfterSym[i] = ures_getStringByKey(dataRes, keywords[i],
                                                            NULL, &localStatus);
            }
            ures_close(dataRes);
        }
        ures_close(currencySpcRes);
        ures_close(currencyResource);
    }
    ures_close(resource);
}

// Initializes the DecimalFormatSymbol instance with the data obtained
// from ResourceBundle in the desired locale.

void
DecimalFormatSymbols::initialize(const UChar** numberElements, int32_t *numberElementsStrLen, int32_t numberElementsLength)
{
    static const int8_t TYPE_MAPPING[][2] = {
        {kDecimalSeparatorSymbol, 0},
        {kGroupingSeparatorSymbol, 1},
        {kPatternSeparatorSymbol, 2},
        {kPercentSymbol, 3},
        {kZeroDigitSymbol, 4},
        {kDigitSymbol, 5},
        {kMinusSignSymbol, 6},
        {kExponentialSymbol, 7},
        {kPerMillSymbol, 8},
        {kInfinitySymbol, 9},
        {kNaNSymbol, 10},
        {kPlusSignSymbol, 11},
        {kMonetarySeparatorSymbol, 0}
    };
    int32_t idx;

    for (idx = 0; idx < (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0])); idx++) {
        if (TYPE_MAPPING[idx][1] < numberElementsLength) {
            fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]);
        }
    }

    // Default values until it's set later on.
    fSymbols[kCurrencySymbol] = (UChar)0xa4;            // 'OX' currency symbol
    fSymbols[kIntlCurrencySymbol] = INTL_CURRENCY_SYMBOL_STR;
    // TODO: read from locale data, if this makes it into CLDR
    fSymbols[kSignificantDigitSymbol] = (UChar)0x0040;  // '@' significant digit
    fSymbols[kPadEscapeSymbol] = (UChar)0x002a; // TODO: '*' Hard coded for now; get from resource later
    fSymbols[kMonetaryGroupingSeparatorSymbol] = fSymbols[kGroupingSeparatorSymbol];
}

// initialize with default values
void
DecimalFormatSymbols::initialize() {
    /*
     * These strings used to be in static arrays, but the HP/UX aCC compiler
     * cannot initialize a static array with class constructors.
     *  markus 2000may25
     */
    fSymbols[kDecimalSeparatorSymbol] = (UChar)0x2e;    // '.' decimal separator
    fSymbols[kGroupingSeparatorSymbol].remove();        //     group (thousands) separator
    fSymbols[kPatternSeparatorSymbol] = (UChar)0x3b;    // ';' pattern separator
    fSymbols[kPercentSymbol] = (UChar)0x25;             // '%' percent sign
    fSymbols[kZeroDigitSymbol] = (UChar)0x30;           // '0' native 0 digit
    fSymbols[kDigitSymbol] = (UChar)0x23;               // '#' pattern digit
    fSymbols[kPlusSignSymbol] = (UChar)0x002b;          // '+' plus sign
    fSymbols[kMinusSignSymbol] = (UChar)0x2d;           // '-' minus sign
    fSymbols[kCurrencySymbol] = (UChar)0xa4;            // 'OX' currency symbol
    fSymbols[kIntlCurrencySymbol] = INTL_CURRENCY_SYMBOL_STR;
    fSymbols[kMonetarySeparatorSymbol] = (UChar)0x2e;   // '.' monetary decimal separator
    fSymbols[kExponentialSymbol] = (UChar)0x45;         // 'E' exponential
    fSymbols[kPerMillSymbol] = (UChar)0x2030;           // '%o' per mill
    fSymbols[kPadEscapeSymbol] = (UChar)0x2a;           // '*' pad escape symbol
    fSymbols[kInfinitySymbol] = (UChar)0x221e;          // 'oo' infinite
    fSymbols[kNaNSymbol] = (UChar)0xfffd;               // SUB NaN
    fSymbols[kSignificantDigitSymbol] = (UChar)0x0040;  // '@' significant digit
}

Locale
DecimalFormatSymbols::getLocale(ULocDataLocaleType type, UErrorCode& status) const {
    U_LOCALE_BASED(locBased, *this);
    return locBased.getLocale(type, status);
}

const UnicodeString&
DecimalFormatSymbols::getPatternForCurrencySpacing(ECurrencySpacing type,
                                                 UBool beforeCurrency,
                                                 UErrorCode& status) const {
    if (U_FAILURE(status)) {
      return fNoSymbol;  // always empty.
    }
    if (beforeCurrency) {
      return currencySpcBeforeSym[(int32_t)type];
    } else {
      return currencySpcAfterSym[(int32_t)type];
    }
}

void
DecimalFormatSymbols::setPatternForCurrencySpacing(ECurrencySpacing type,
                                                   UBool beforeCurrency,
                                             const UnicodeString& pattern) {
  if (beforeCurrency) {
    currencySpcBeforeSym[(int32_t)type] = pattern;
  } else {
    currencySpcAfterSym[(int32_t)type] =  pattern;
  }
}
U_NAMESPACE_END

#endif /* #if !UCONFIG_NO_FORMATTING */

//eof


text:
module VORLON.WebStandards.Rules.CSS {
    export var mobileMediaqueries = <ICSSRule>{
        id: "mobileweb.usemediaqueries",
        title: "use responsive approaches",
        description: "Even if your website target only certain devices, you may have users with unexpected devices or screen ratio.",

        prepare: function(rulecheck: IRuleCheck, analyzeSummary) {
            rulecheck.items = rulecheck.items || [];
            rulecheck.type = "blockitems";
            if (!rulecheck.data){
                rulecheck.data = {
                    cssnbqueries : 0,
                    domnbqueries : 0
                };
            }
        },

        check: function (url, ast, rulecheck: IRuleCheck, analyzeSummary: any) {
            //console.log("check css prefixes");

            this.checkNodes(url, rulecheck, ast);
        },

        checkNodes: function (url, rulecheck: IRuleCheck, ast) {
            if (!ast)
                return;

            ast.forEach((node, i) => {
                var nodeitem = <any>null;

                //scan content for media queries
                if (node.type === "media") {
                    var media = node.selector;
                    if (media){
                        media = media.toLowerCase();
                        if (media.indexOf("width") >= 0 || media.indexOf("height") >= 0){
                            rulecheck.data.cssnbqueries++;
                        }
                    }
                }
            });
        },

        endcheck: function(rulecheck: IRuleCheck, analyzeSummary: any){
        }
    }
}

module VORLON.WebStandards.Rules.DOM {
    export var mobileMediaqueries = <IDOMRule>{
        id: "mobileweb.usemediaqueries",
        title: "use responsive approaches",
        description: "Even if your website target only certain devices, you may have users with unexpected devices or screen ratio.",
        nodeTypes: ["link"],

		prepare: function(rulecheck: IRuleCheck, analyzeSummary) {
            rulecheck.items = rulecheck.items || [];
            if (!rulecheck.data){
                rulecheck.data = {
                    cssnbqueries : 0,
                    domnbqueries : 0
                };
            }
        },

        check: function(node: HTMLElement, rulecheck: IRuleCheck, analyzeSummary: any, htmlstring : string) {
			if (!node.getAttribute) //not an HTML element
				return;

            var rel = node.getAttribute("rel");
            if (rel && rel.toLocaleLowerCase() == "stylesheet"){
                var media = node.getAttribute("media");
                if (media){
                    media = media.toLowerCase();
                    if (media.indexOf("width") >= 0 || media.indexOf("height") >= 0){
                        rulecheck.data.domnbqueries++;
                    }
                }
            }
        },

        endcheck : function(rulecheck: IRuleCheck, analyzeSummary){
            //console.log("media queries css:" + rulecheck.cssnbqueries + ", dom:" + rulecheck.domnbqueries);
            if (rulecheck.data.cssnbqueries==0 && rulecheck.data.domnbqueries==0){
                if (rulecheck.data.cssnbqueries==0){
                    rulecheck.failed = true;
                    rulecheck.items.push({
                        title : 'your css (either files or inline) does not use any media queries'
                    });
                }

                if (rulecheck.data.domnbqueries==0){
                    rulecheck.failed = true;
                    rulecheck.items.push({
                        title : 'your link tags does not use any media queries'
                    });
                }
            }
        }
    }
}


text:
/*
 * Copyright 1999-2004 The Apache Software Foundation.
 *
 * 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.
 */

package com.sun.org.apache.regexp.internal;

import java.io.InputStream;
import java.io.IOException;

/**
 * Encapsulates java.io.InputStream as CharacterIterator.
 *
 * @author Ales Novak
 */
public final class StreamCharacterIterator implements CharacterIterator
{
    /** Underlying is */
    private final InputStream is;

    /** Buffer of read chars */
    private final StringBuffer buff;

    /** read end? */
    private boolean closed;

    /** @param is an InputStream, which is parsed */
    public StreamCharacterIterator(InputStream is)
    {
        this.is = is;
        this.buff = new StringBuffer(512);
        this.closed = false;
    }

    /** @return a substring */
    public String substring(int beginIndex, int endIndex)
    {
        try
        {
            ensure(endIndex);
            return buff.toString().substring(beginIndex, endIndex);
        }
        catch (IOException e)
        {
            throw new StringIndexOutOfBoundsException(e.getMessage());
        }
    }

    /** @return a substring */
    public String substring(int beginIndex)
    {
        try
        {
            readAll();
            return buff.toString().substring(beginIndex);
        }
        catch (IOException e)
        {
            throw new StringIndexOutOfBoundsException(e.getMessage());
        }
    }

    /** @return a character at the specified position. */
    public char charAt(int pos)
    {
        try
        {
            ensure(pos);
            return buff.charAt(pos);
        }
        catch (IOException e)
        {
            throw new StringIndexOutOfBoundsException(e.getMessage());
        }
    }

    /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
    public boolean isEnd(int pos)
    {
        if (buff.length() > pos)
        {
            return false;
        }
        else
        {
            try
            {
                ensure(pos);
                return (buff.length() <= pos);
            }
            catch (IOException e)
            {
                throw new StringIndexOutOfBoundsException(e.getMessage());
            }
        }
    }

    /** Reads n characters from the stream and appends them to the buffer */
    private int read(int n) throws IOException
    {
        if (closed)
        {
            return 0;
        }

        int c;
        int i = n;
        while (--i >= 0)
        {
            c = is.read();
            if (c < 0) // EOF
            {
                closed = true;
                break;
            }
            buff.append((char) c);
        }
        return n - i;
    }

    /** Reads rest of the stream. */
    private void readAll() throws IOException
    {
        while(! closed)
        {
            read(1000);
        }
    }

    /** Reads chars up to the idx */
    private void ensure(int idx) throws IOException
    {
        if (closed)
        {
            return;
        }

        if (idx < buff.length())
        {
            return;
        }

        read(idx + 1 - buff.length());
    }
}


text:
import computed from 'ember-computed';
import get from 'ember-metal/get';

export default function classifyMacro(key, ifFalsey, ifTruthy) {
  return computed(key, {
    get() {
      return get(this, key) ? ifFalsey : ifTruthy;
    }
  }).readOnly();
}


text:
<?php

class UrlField extends TextField {

  public function __construct() {

    $this->type        = 'url';
    $this->icon        = 'chain';
    $this->label       = l::get('fields.url.label', 'URL');
    $this->placeholder = 'http://';

  }

  public function validate() {
    return v::url($this->value());
  }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>Free Birds</title>
  <meta name="author" content="" />
  <meta name="description"
        content="Free Birds é um desenho com qualidade técnica discutível e narrativa idem. Suas ideias oscilam entre o divertido e o repetitivo. Seus personagens são quase cópias de outros desenhos. Dito isto, o..."/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="Free Birds"/>
  <meta itemprop="description"
        content="Free Birds é um desenho com qualidade técnica discutível e narrativa idem. Suas ideias oscilam entre o divertido e o repetitivo. Seus personagens são quase cópias de outros desenhos. Dito isto, o..."/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="Free Birds"/>
  <meta property="og:type"
        content="article"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/free-birds/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content="Free Birds é um desenho com qualidade técnica discutível e narrativa idem. Suas ideias oscilam entre o divertido e o repetitivo. Seus personagens são quase cópias de outros desenhos. Dito isto, o..."/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:published_time"
        content="2014-08-15T00:00:00+00:00"/>
  <meta property="article:section" content="post"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="Free Birds"/>
  <meta name="twitter:description"
        content="Free Birds é um desenho com qualidade técnica discutível e narrativa idem. Suas ideias oscilam entre o divertido e o repetitivo. Seus personagens são quase cópias de outros desenhos. Dito isto, o..."/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

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

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

Free Birds

    ★★★☆☆

 Wanderley Caloni, August 15, 2014

Free Birds é um desenho com qualidade técnica discutível e narrativa idem. Suas ideias oscilam entre o divertido e o repetitivo. Seus personagens são quase cópias de outros desenhos. Dito isto, o conjunto da obra mais impressiona por conseguir levar a história do começo ao fim a despeito de todas suas limitações.

A história envolve viagem no tempo em um objeto que não apenas se assemelha a um ovo como à nave de Ellie em Contato (com suas paredes translúcidas), ou seja, espere por todas as homenagens necessárias a obras que brincam com esses conceitos, sejam o clássico Contato já citado ou os tri-clássicos De Volta Para o Futuro (há uma citação “divertidinha” de Doc. Brown a respeito de uma pessoa se encontrar com ela mesma do passado).

Mesmo com piadas faltando aquele toque a mais e com pedaços de histórias não-originais, ainda assim a dedicação pessoal em contar essa história supera mais uma vez suas deficiências narrativas. Os personagens mais importantes são dois perus que voltam no tempo para alterar o evento onde eles se tornam o prato principal do feriado americano do Dia de Ação de Graças. O que encontram lá se torna a sequência mais interessante do filme.

Jimmy Hayward já havia dirigido o subestimado “Horton Hears a Who!” em 2008 (Horton no Mundo dos Quem), e continua sendo uma alternativa curiosa dos grandes estúdios e seus milhões de pixels. Aqui em Free Birds há um espaço enorme de caixa de areia onde muitas ideias poderiam ser, mais uma vez, reaproveitadas em produções mais caras.

           Imagens e créditos no IMDB.

    ★★★☆☆

 Free Birds ● Free Birds. Free Birds (USA, 2013). Dirigido por Jimmy Hayward. Escrito por Scott Mosier, Jimmy Hayward, David I. Stern, John J. Strauss. Com Owen Wilson, Woody Harrelson, Amy Poehler, George Takei, Colm Meaney, Keith David, Dan Fogler, Jimmy Hayward, Kaitlyn Maher. ● Nota: 3/5. Categoria: movies.  Publicado em 2014-08-15.  Texto escrito por Wanderley Caloni.

Quer comentar?

      Share


text:
package skin.support.widget;

/**
 * Created by ximsfei on 2017/1/13.
 */

public abstract class SkinCompatHelper {
    protected static final String SYSTEM_ID_PREFIX = "1";
    public static final int INVALID_ID = 0;

    final static public int checkResourceId(int resId) {
        String hexResId = Integer.toHexString(resId);
        return hexResId.startsWith(SYSTEM_ID_PREFIX) ? INVALID_ID : resId;
    }

    abstract public void applySkin();
}


text:
<?php
/**
 * Add a justified image gallery
 * @link http://miromannino.github.io/Justified-Gallery/
 */
namespace MarkNotes\Plugins\Page\HTML;

defined('_MARKNOTES') or die('No direct access allowed');

class Image_Gallery extends \MarkNotes\Plugins\Page\HTML\Plugin
{
	protected static $me = __CLASS__;
	protected static $json_settings = 'plugins.page.html.image_gallery';
	protected static $json_options = 'plugins.options.page.html.image_gallery';

	/**
	 * Provide additionnal javascript
	 */
	public static function addJS(&$js = null) : bool
	{
		$aeFunctions = \MarkNotes\Functions::getInstance();
		$aeSettings = \MarkNotes\Settings::getInstance();

		$url = rtrim($aeFunctions->getCurrentURL(), '/');
		$url.= '/marknotes/plugins/page/html/image_gallery/';

		$script =
			"\n<script ". "src=\"".$url."libs/justified-gallery/jquery.justifiedGallery.min.js\" ".
			"defer=\"defer\"></script>\n".
			"<script src=\"".$url."image_gallery.js\" ".
			"defer=\"defer\"></script>\n";

		$js .= $aeFunctions->addJavascriptInline($script);

		return true;
	}

	/**
	 * Provide additionnal stylesheets
	 */
	public static function addCSS(&$css = null) : bool
	{
		$aeFunctions = \MarkNotes\Functions::getInstance();
		$aeSettings = \MarkNotes\Settings::getInstance();

		$url = rtrim($aeFunctions->getCurrentURL(), '/');
		$url.= '/marknotes/plugins/page/html/image_gallery/';

		$script =
			"<link media=\"screen\" rel=\"stylesheet\" type=\"text/css\" ". "href=\"".$url."libs/justified-gallery/justifiedGallery.min.css\">\n";

		$css .= $aeFunctions->addStyleInline($script);

		return true;
	}

	/**
	 * Add/modify the HTML content
	 */
	public static function doIt(&$html = null) : bool
	{
		return true;
	}

	/**
	 * Determine if this plugin is needed or not
	 */
	final protected static function canRun() : bool
	{
		$bCanRun = false;

		$aeFiles = \MarkNotes\Files::getInstance();
		$aeSession = \MarkNotes\Session::getInstance();
		$aeSettings = \MarkNotes\Settings::getInstance();

		// Open the .md file and check if the %GALLERY% tag is
		// there. If yes, then the plugin has something to do.
		// If not mentionned, it's not needed to add the .js and .css
		// file of this plugin since they don't have any things to do

		$filename = trim($aeSession->get('filename'));

		if ($filename=='') {
			return false;
		}

		$filename=$aeFiles->removeExtension($filename).'.md';
		$filename=$aeSettings->getFolderDocs(true).$filename;

		if ($aeFiles->exists($filename)) {
			$content = '';

			//if ($aeFiles->exists($filename)) {
				$content = trim($aeFiles->getContent($filename));
			//} elseif ($aeFiles->exists(utf8_decode($filename))) {
				// Arrrgh, sometimes with sometimes without utf8_decode,
				// it's crazy
			//	$content = trim($aeFiles->getContent(utf8_decode($filename)));
			//}

			// Search the plugin's tag
			$pattern = '/%GALLERY ([^\\%]*)%/';

			if (preg_match_all($pattern, $content, $matches)) {
				// Ok, tag found => the plugin has added value
				$bCanRun = true;
			}
		}

		return $bCanRun;
	}
}


text:
package com.example.ledgr.cards;

import android.app.Activity;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.ArrayAdapter;
import android.widget.RadioGroup;
import android.widget.RatingBar;
import android.widget.Spinner;
import android.widget.TextView;

import com.example.ledgr.R;
import com.example.ledgr.dataobjects.ItemPriceUnit;
import com.example.ledgr.dataobjects.ItemState;
import com.fima.cardsui.objects.RecyclableCard;

public class ViewItemCard extends RecyclableCard {

	TextView textDescription, textPrice, textTitle;
	RadioGroup radioGroup;
	Activity activity;
	ItemState state;
	ItemPriceUnit unit;
	String title, description, price;
	Spinner unit_spinner;
	RatingBar ratingbar;
	int rating;

	String[] ratingStrings = new String[] {"Broken! Completely unusable!","Almost broken... Kinda usable.",
			"Still working, but its seen better days.",
			"Looks like its been used, still working good!",
			"Looks good, works good!",
			"Almost perfect condition!"};

	public ViewItemCard(Activity activity, String description, String price,
			String title, ItemState state, ItemPriceUnit unit, int rating) {
		this.activity = activity;
		this.description = description;
		this.price = price;
		this.title = title;
		this.state = state;
		this.unit = unit;
		this.rating = rating;
	}

	@Override
	protected int getCardLayoutId() {
		return R.layout.fragment_view_item;
	}

	@Override
	protected void applyTo(View convertView) {
		textDescription = (TextView) convertView.findViewById(R.id.description);
		textDescription.setText(description);

		textPrice = (TextView) convertView.findViewById(R.id.price);
		textPrice.setText(price);

		textTitle = (TextView) convertView.findViewById(R.id.title);
		textTitle.setText(title);

		radioGroup = (RadioGroup) convertView.findViewById(R.id.rent);
		unit_spinner = (Spinner) convertView.findViewById(R.id.price_unit);

		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
				activity, R.array.item_unit_strings,
				android.R.layout.simple_spinner_item);
		// Specify the layout to use when the list of choices appears
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		// Apply the adapter to the spinner
		unit_spinner.setAdapter(adapter);

		if (state == ItemState.FOR_RENT) {
			radioGroup.check(R.id.forrent);
		} else {
			radioGroup.check(R.id.notforrent);
		}
		radioGroup.setFocusable(false);
		radioGroup.setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				return true;
			}
		});

		radioGroup.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub

			}
		});

		if (unit == ItemPriceUnit.DAY) {
			unit_spinner.setSelection(0);
		} else if (unit == ItemPriceUnit.WEEK) {
			unit_spinner.setSelection(1);
		} else {
			unit_spinner.setSelection(2);
		}
		unit_spinner.setFocusable(false);
		unit_spinner.setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				return true;
			}
		});
		ratingbar = (RatingBar) convertView.findViewById(R.id.rating);
		ratingbar.setRating(rating);

		ratingbar.setOnTouchListener(new OnTouchListener() {
		        public boolean onTouch(View v, MotionEvent event) {
		            return true;
		        }
		    });
		ratingbar.setFocusable(false);

		TextView ratingText = (TextView) convertView.findViewById(R.id.ratingstring);
		ratingText.setText(ratingStrings[rating]);
	}

	@Override
	public boolean convert(View convertCardView) {
		// TODO Auto-generated method stub

		return super.convert(convertCardView);

	}

	@Override
	public OnClickListener getClickListener() {
		// TODO Auto-generated method stub
		return super.getClickListener();
	}

	@Override
	protected int getCardLayout() {
		// TODO Auto-generated method stub
		return super.getCardLayout();
	}

}


text:
Node and edge types and functions.

```@docs
EvolvingGraphs.AbstractNode
EvolvingGraphs.node_index
EvolvingGraphs.node_key
EvolvingGraphs.Node
EvolvingGraphs.AttributeNode
EvolvingGraphs.node_attributes
EvolvingGraphs.TimeNode
EvolvingGraphs.node_timestamp
EvolvingGraphs.AbstractEdge
EvolvingGraphs.source
EvolvingGraphs.target
EvolvingGraphs.edge_timestamp
EvolvingGraphs.Edge
EvolvingGraphs.edge_reverse
EvolvingGraphs.TimeEdge
EvolvingGraphs.WeightedTimeEdge
EvolvingGraphs.edge_weight
EvolvingGraphs.has_node
```

## Paths

Path types and functions.

```@docs
EvolvingGraphs.AbstractPath
EvolvingGraphs.TemporalPath
```


text:
1. SELECT * FROM states;
2. SELECT * FROM regions;
3. SELECT state_name, population FROM states;
4. SELECT state_name, population FROM states ORDER BY population DESC;
5. SELECT state_name FROM states WHERE region_id = 7;
6. SELECT state_name, population_density FROM states WHERE population_density > 50 ORDER BY population_density;
7. SELECT state_name FROM states WHERE population BETWEEN 1000000 AND 1500000;
8. SELECT state_name, region_id FROM states ORDER BY region_id;
9. SELECT * FROM regions WHERE region_name LIKE '%Central';

10.SELECT regions.region_name, states.state_name FROM regions JOIN states ON states.region_id = regions.id;

[Schema](db_schema.png)

###What are databases for?
They are used to store data in a structure ways so that it can easily searched and access int the future.
###What is a one-to-many relationship?
We have one-to-many relationship if a table can have many tables related to it and not the other way around. for example; a hospital table can have many patients but a patient can't have many hospitals.
###What is a primary key? What is a foreign key? How can you determine which is which?
A primary key uniquely identify a row and the foreign key identify a table in another table.
###How can you select information out of a SQL database? What are some general guidelines for that?
You can use clauses such as SELECT to create queries from a SQL database.


text:
/*
	This file is part of cpp-ethereum.

	cpp-ethereum is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	cpp-ethereum is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.
*/
/** @file WebThreeStubServer.h
 * @authors:
 *   Gav Wood <i@gavwood.com>
 *   Marek Kotewicz <marek@ethdev.com>
 * @date 2014
 */

#pragma once

#include <memory>
#include <iostream>
#include <jsonrpccpp/server.h>
#include <libdevcrypto/Common.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "abstractwebthreestubserver.h"
#pragma GCC diagnostic pop

namespace dev
{
class WebThreeNetworkFace;
class AccountHolder;
class KeyPair;
namespace eth
{
struct TransactionSkeleton;
class Interface;
}
namespace shh
{
class Interface;
}

extern const unsigned SensibleHttpThreads;
extern const unsigned SensibleHttpPort;

class WebThreeStubDatabaseFace
{
public:
	virtual std::string get(std::string const& _name, std::string const& _key) = 0;
	virtual void put(std::string const& _name, std::string const& _key, std::string const& _value) = 0;
};

/**
 * @brief JSON-RPC api implementation
 * @todo filters should work on unsigned instead of int
 * unsigned are not supported in json-rpc-cpp and there are bugs with double in json-rpc-cpp version 0.2.1
 * @todo split these up according to subprotocol (eth, shh, db, p2p, web3) and make it /very/ clear about how to add other subprotocols.
 * @todo modularise everything so additional subprotocols don't need to change this file.
 */
class WebThreeStubServerBase: public AbstractWebThreeStubServer
{
public:
	WebThreeStubServerBase(jsonrpc::AbstractServerConnector& _conn, std::vector<dev::KeyPair> const& _accounts);

	virtual std::string web3_sha3(std::string const& _param1);
	virtual std::string web3_clientVersion() { return "C++ (ethereum-cpp)"; }

	virtual std::string net_version() { return ""; }
	virtual std::string net_peerCount();
	virtual bool net_listening();

	virtual std::string eth_protocolVersion();
	virtual std::string eth_hashrate();
	virtual std::string eth_coinbase();
	virtual bool eth_mining();
	virtual std::string eth_gasPrice();
	virtual Json::Value eth_accounts();
	virtual std::string eth_blockNumber();
	virtual std::string eth_getBalance(std::string const& _address, std::string const& _blockNumber);
	virtual std::string eth_getStorageAt(std::string const& _address, std::string const& _position, std::string const& _blockNumber);
	virtual std::string eth_getTransactionCount(std::string const& _address, std::string const& _blockNumber);
	virtual std::string eth_getBlockTransactionCountByHash(std::string const& _blockHash);
	virtual std::string eth_getBlockTransactionCountByNumber(std::string const& _blockNumber);
	virtual std::string eth_getUncleCountByBlockHash(std::string const& _blockHash);
	virtual std::string eth_getUncleCountByBlockNumber(std::string const& _blockNumber);
	virtual std::string eth_getCode(std::string const& _address, std::string const& _blockNumber);
	virtual std::string eth_sendTransaction(Json::Value const& _json);
	virtual std::string eth_call(Json::Value const& _json, std::string const& _blockNumber);
	virtual bool eth_flush();
	virtual Json::Value eth_getBlockByHash(std::string const& _blockHash, bool _includeTransactions);
	virtual Json::Value eth_getBlockByNumber(std::string const& _blockNumber, bool _includeTransactions);
	virtual Json::Value eth_getTransactionByHash(std::string const& _transactionHash);
	virtual Json::Value eth_getTransactionByBlockHashAndIndex(std::string const& _blockHash, std::string const& _transactionIndex);
	virtual Json::Value eth_getTransactionByBlockNumberAndIndex(std::string const& _blockNumber, std::string const& _transactionIndex);
	virtual Json::Value eth_getUncleByBlockHashAndIndex(std::string const& _blockHash, std::string const& _uncleIndex);
	virtual Json::Value eth_getUncleByBlockNumberAndIndex(std::string const& _blockNumber, std::string const& _uncleIndex);
	virtual Json::Value eth_getCompilers();
	virtual std::string eth_compileLLL(std::string const& _s);
	virtual std::string eth_compileSerpent(std::string const& _s);
	virtual std::string eth_compileSolidity(std::string const& _code);
	virtual std::string eth_newFilter(Json::Value const& _json);
	virtual std::string eth_newBlockFilter(std::string const& _filter);
	virtual bool eth_uninstallFilter(std::string const& _filterId);
	virtual Json::Value eth_getFilterChanges(std::string const& _filterId);
	virtual Json::Value eth_getFilterLogs(std::string const& _filterId);
	virtual Json::Value eth_getLogs(Json::Value const& _json);
	virtual Json::Value eth_getWork();
	virtual bool eth_submitWork(std::string const& _nonce, std::string const& _mixHash);
	virtual std::string eth_register(std::string const& _address);
	virtual bool eth_unregister(std::string const& _accountId);
	virtual Json::Value eth_fetchQueuedTransactions(std::string const& _accountId);

	virtual bool db_put(std::string const& _name, std::string const& _key, std::string const& _value);
	virtual std::string db_get(std::string const& _name, std::string const& _key);

	virtual bool shh_post(Json::Value const& _json);
	virtual std::string shh_newIdentity();
	virtual bool shh_hasIdentity(std::string const& _identity);
	virtual std::string shh_newGroup(std::string const& _id, std::string const& _who);
	virtual std::string shh_addToGroup(std::string const& _group, std::string const& _who);
	virtual std::string shh_newFilter(Json::Value const& _json);
	virtual bool shh_uninstallFilter(std::string const& _filterId);
	virtual Json::Value shh_getFilterChanges(std::string const& _filterId);
	virtual Json::Value shh_getMessages(std::string const& _filterId);

	void setAccounts(std::vector<dev::KeyPair> const& _accounts);
	void setIdentities(std::vector<dev::KeyPair> const& _ids);
	std::map<dev::Public, dev::Secret> const& ids() const { return m_ids; }

protected:
	virtual void authenticate(dev::eth::TransactionSkeleton const& _t, bool _toProxy);

protected:
	virtual dev::eth::Interface* client() = 0;
	virtual std::shared_ptr<dev::shh::Interface> face() = 0;
	virtual dev::WebThreeNetworkFace* network() = 0;
	virtual dev::WebThreeStubDatabaseFace* db() = 0;

	std::map<dev::Public, dev::Secret> m_ids;
	std::map<unsigned, dev::Public> m_shhWatches;
	std::shared_ptr<dev::AccountHolder> m_accounts;
};

} //namespace dev


text:
<?php

declare(strict_types=1);

namespace App\Responses;

use Ramsey\Uuid\Uuid;
use Slim\Http\Response;

class ApiResponse extends Response
{
    /**
     * Return a Bad Validation Response
     *
     * @param array $data
     *
     * @return Response
     */
    public function errorValidation(array $data): Response
    {
        $response = [];
        $response['id'] = Uuid::uuid1();
        $response['title'] = 'Validation error';
        $response['detail'] = 'Some fields are not correctly sent';
        $response['source']['pointer'] = $data;
        $response['status'] = 400;

        return $this->withJson(['error' => $response], 400);
    }

    /**
     * Return a Bad Response
     *
     * @param string $title
     * @param string $message
     * @param int $status
     * @param array $data
     * @param Uuid|null $uuid
     *
     * @return Response
     */
    public function error(string $title, string $message, int $status, $data = [], Uuid $uuid = null): Response
    {
        $response = [];
        $response['id'] = ($uuid == null) ? Uuid::uuid1() : $uuid;
        $response['title'] = $title;
        $response['detail'] = $message;
        $response['source']['pointer'] = $data;
        $response['status'] = $status;

        return $this->withJson(['error' => $response], $status);
    }

    /**
     * Return a successful Response
     * @param $data
     * @param int $status
     *
     * @return Response
     */
    public function success($data, $status = 200): Response
    {
        return $this->withJson(['data' => $data], $status);
    }
}


text:
package com.amazonaws.services.identitymanagement.model;

import com.amazonaws.AmazonServiceException;

/**
 * <p>
 * The request was rejected because the type of user for the transaction was incorrect.
 * </p>
 */
public class InvalidUserTypeException extends AmazonServiceException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new InvalidUserTypeException with the specified error
     * message.
     *
     * @param message Describes the error encountered.
     */
    public InvalidUserTypeException(String message) {
        super(message);
    }

}