text:
@implementation FLLabelAndValueBaseCell

@synthesize valueLabel = _value;
@synthesize spinner = _spinner;

FLSynthesizeStructProperty(updateTextWithRowData, setUpdateTextWithRowData, BOOL, _baseFlags);
FLSynthesizeStructProperty(autoShowSpinner, setAutoShowSpinner, BOOL, _baseFlags);
FLSynthesizeStructProperty(trimWhiteSpace, setTrimWhiteSpace, BOOL, _baseFlags);

- (void) applyTheme:(FLTheme*) theme {
	self.backgroundColor = [UIColor clearColor];
//	field.textDescriptor = self.valueDescriptor;
}

- (UIView*) createValueLabel
{
	FLLabel* label = FLAutorelease([[FLLabel alloc] initWithFrame:CGRectZero]);
	label.backgroundColor = [UIColor clearColor];
	label.lineBreakMode = UILineBreakModeTailTruncation;
	label.textAlignment = UITextAlignmentLeft;
	label.adjustsFontSizeToFitWidth = NO;
	label.highlightedTextColor = [UIColor whiteColor];
	return label;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
	if((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]))
	{
		self.wantsApplyTheme = YES;

		self.trimWhiteSpace = YES;
		self.updateTextWithRowData = YES;
		_value = [[FLDeprecatedTextViewProxy alloc] initWithView:[self createValueLabel]];
		[self addSubview:_value.view];
	}

	return self;
}

- (NSString*) valueLabelText
{
	return [_value text];
//	  self.trimWhiteSpace ? [[_value text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]
}

- (void) setValueLabelText:(NSString*) text
{
	[_value setText:text];
	[self setNeedsLayout];
//	  [_value setText:[text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
}

- (void) enabledStateDidChange
{
	self.label.enabled = self.canEditData;

	if([_value.view respondsToSelector:@selector(setEnabled:)])
	{
		[((id)_value.view) setEnabled:self.canEditData];
	}
	[super enabledStateDidChange];
}

- (void) dealloc
{
	FLRelease(_spinner);
	FLRelease(_value);
	FLSuperDealloc();
}

- (void) startSpinnerInValueCell
{
	if(!_spinner)
	{
		_spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
		[_spinner startAnimating];
		_spinner.hidesWhenStopped = YES;
		[self addSubview:_spinner];
		_value.view.hidden = YES;
	}
}

- (void) adjustSpinnerFrame
{
	_spinner.newFrame =
		FLRectCenterRectInRectVertically(self.bounds, FLRectCenterRectInRectHorizontally(_value.view.frame, [_spinner frame]));
}

- (void) updateCellState
{
	[super updateCellState];

	if(self.dataSource && self.updateTextWithRowData)
	{
		NSString* str = self.formattedDisplayString;
		if(FLStringIsNotEmpty(str))
		{
			[self setValueLabelText:str];
		}
	}

	if(FLStringIsNotEmpty(self.valueLabelText))
	{
		if(_spinner)
		{
			[self stopSpinnerInValueCell];
		}
	}
	else if(self.autoShowSpinner)
	{
		[self startSpinnerInValueCell];
	}
}

- (void) layoutSubviews
{
	[super layoutSubviews];

	if(_spinner)
	{
		[self adjustSpinnerFrame];
	}
}

- (void) stopSpinnerInValueCell
{
	if(_spinner)
	{
		[_spinner removeFromSuperview];
		FLReleaseWithNil(_spinner);

		_value.view.hidden = NO;
	}
}

- (CGSize) valueTextSizeForContentViewWidth:(CGFloat) width
{
	NSString* text = self.valueLabel.text;
	if(FLStringIsEmpty(text))
	{
		text = @"Ty"; // capitol + decender
	}

	CGSize size = [text sizeWithFont:self.valueLabel.font
						constrainedToSize:CGSizeMake(width,CGFLOAT_MAX)
						lineBreakMode:self.valueLabel.lineBreakMode];
	size.height += 2;
	return size;
}

@end


text:
#ifndef _BLK_BSG_
#define _BLK_BSG_

#include <linux/blkdev.h>

struct request;
struct device;
struct scatterlist;
struct request_queue;

struct bsg_buffer {
	unsigned int payload_len;
	int sg_cnt;
	struct scatterlist *sg_list;
};

struct bsg_job {
	struct device *dev;
	struct request *req;

	/* Transport/driver specific request/reply structs */
	void *request;
	void *reply;

	unsigned int request_len;
	unsigned int reply_len;
	/*
	 * On entry : reply_len indicates the buffer size allocated for
	 * the reply.
	 *
	 * Upon completion : the message handler must set reply_len
	 *  to indicates the size of the reply to be returned to the
	 *  caller.
	 */

	/* DMA payloads for the request/response */
	struct bsg_buffer request_payload;
	struct bsg_buffer reply_payload;

	void *dd_data;		/* Used for driver-specific storage */
};

void bsg_job_done(struct bsg_job *job, int result,
		  unsigned int reply_payload_rcv_len);
int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
		    bsg_job_fn *job_fn, int dd_job_size);
void bsg_request_fn(struct request_queue *q);
void bsg_remove_queue(struct request_queue *q);
void bsg_goose_queue(struct request_queue *q);

#endif

redpajama_set_name: RedPajamaGithub


text:
Given /^a registered super user "([^\"]*)" with password "([^\"]*)"$/ do |login, password|
  Factory.create(:super_user, :login => login, :password => password)
end

Given /^a logged in super user "([^\"]*)"$/ do |login|
  Factory.create(:super_user, :login => login)
  visit admin_login_path
  fill_in "login", :with => login
  fill_in "password", :with => 'root_password'
  click_button("Login")
end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="theme" content="hugo-academic">
  <meta name="generator" content="Hugo 0.50" />
  <meta name="author" content="Shohanur Rahaman">
  <meta name="description" content="Game Developer|Data Analyst">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github-gist.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha512-6MXa8B6uaO18Hid6blRMetEIoPqHf7Ux1tnyIQdpt9qI5OACx7C+O3IVTr98vwGnlcg0LOLa02i9Y1HpVhlfiw==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.1/css/academicons.min.css" integrity="sha512-NThgw3XKQ1absAahW6to7Ey42uycrVvfNfyjqcFNgCmOCQ5AR4AO0SiXrN+8ZtYeappp56lk1WtvjVmEa+VR6A==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous">

  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather%7CRoboto+Mono">
  <link rel="stylesheet" href="/me/css/hugo-academic.css">

  <link rel="alternate" href="https://shohan4556.github.io/me/index.xml" type="application/rss+xml" title="Hello !">
  <link rel="feed" href="https://shohan4556.github.io/me/index.xml" type="application/rss+xml" title="Hello !">

  <link rel="icon" type="image/png" href="/me/img/icon.png">
  <link rel="apple-touch-icon" type="image/png" href="/me/img/apple-touch-icon.png">

  <link rel="canonical" href="https://shohan4556.github.io/me/project/boid/">

  <title>Boid/Flocking Agent | Hello !</title>

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
              data-target=".navbar-collapse" aria-expanded="false">
        Toggle navigation

      </button>
      Hello !

            Home

            Posts

            Experience

            Projects

            Contact

Boid/Flocking Agent

    Go to Project Site

← Captain Blands Space Adventure

Quiz Game Prototype →

      © 2017 Shohan ·

      Powered by the Academic
      theme for Hugo.


text:
package com.xeiam.xchange.loyalbit.service.polling;

import java.io.IOException;

import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.loyalbit.LoyalbitAuthenticated;
import com.xeiam.xchange.loyalbit.dto.account.LoyalbitBalance;
import com.xeiam.xchange.loyalbit.service.LoyalbitDigest;

import si.mazi.rescu.RestProxyFactory;

public class LoyalbitAccountServiceRaw extends LoyalbitBasePollingService {

  private final LoyalbitDigest signatureCreator;
  private final LoyalbitAuthenticated loyalbitAuthenticated;

  /**
   * Constructor
   *
   * @param exchange
   */
  protected LoyalbitAccountServiceRaw(Exchange exchange) {

    super(exchange);

    this.loyalbitAuthenticated = RestProxyFactory.createProxy(LoyalbitAuthenticated.class, exchange.getExchangeSpecification().getSslUri());
    this.signatureCreator = LoyalbitDigest.createInstance(exchange.getExchangeSpecification().getSecretKey(),
        exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getApiKey());
  }

  public LoyalbitBalance getLoyalbitBalance() throws IOException {
    return loyalbitAuthenticated.getBalance(exchange.getExchangeSpecification().getApiKey(), exchange.getNonceFactory(), signatureCreator);
  }
}


text:
// <copyright company="eCollabro">
// Copyright (c) 2014 All Rights Reserved
// Collaborative Framework and CMS - eCollabro.com
// </copyright>
// <author>Anand Singh</author>
#region References

using eCollabro.Service.Core;
using System.Collections.Generic;
using System.Runtime.Serialization;

#endregion
namespace eCollabro.Service.DataContracts.ResponseWrapper
{
    /// <summary>
    /// SiteFeatures
    /// </summary>
    [DataContract]
    public class SiteFeatures
    {

        [DataMember]
        public int SiteId { get; set; }

        [DataMember]
        public string SiteCode { get; set; }

        [DataMember]
        public string SiteName { get; set; }

        public SiteFeatures()
        {
            this.Features = new List<ModuleDC>();
        }

        [DataMember]
        public List<ModuleDC> Features { get;set;}

    }
}


text:
/**
 * bootbox.js [master branch]
 *
 * http://bootboxjs.com/license.txt
 */
// @see https://github.com/makeusabrew/bootbox/issues/71
window.bootbox = window.bootbox || (function init($, undefined) {
  "use strict";

  // the base DOM structure needed to create a modal
  var templates = {
    dialog:
      "
" +
        "
" +
          "
" +
            "

" +
          "
" +
        "
" +
      "
",
    header:
      "
" +
        "

" +
      "
",
    footer:
      "

",
    closeButton:
      "<button type='button' class='bootbox-close-button close'>×</button>",
    form:
      "<form class='bootbox-form'></form>",
    inputs: {
      text:
        "<input class='bootbox-input form-control' autocomplete=off type=text />"
    }
  };

  // cache a reference to the jQueryfied body element
  var appendTo = $("body");

  var defaults = {
    // default language
    locale: "en",
    // show backdrop or not
    backdrop: true,
    // animate the modal in/out
    animate: true,
    // additional class string applied to the top level dialog
    className: null,
    // whether or not to include a close button
    closeButton: true,
    // show the dialog immediately by default
    show: true
  };

  // our public object; augmented after our private API
  var exports = {};

  /**
   * @private
   */
  function _t(key) {
    var locale = locales[defaults.locale];
    return locale ? locale[key] : locales.en[key];
  }

  function processCallback(e, dialog, callback) {
    e.preventDefault();

    // by default we assume a callback will get rid of the dialog,
    // although it is given the opportunity to override this

    // so, if the callback can be invoked and it *explicitly returns false*
    // then we'll set a flag to keep the dialog active...
    var preserveDialog = $.isFunction(callback) && callback(e) === false;

    // ... otherwise we'll bin it
    if (!preserveDialog) {
      dialog.modal("hide");
    }
  }

  function getKeyLength(obj) {
    // @TODO defer to Object.keys(x).length if available?
    var k, t = 0;
    for (k in obj) {
      t ++;
    }
    return t;
  }

  function each(collection, iterator) {
    var index = 0;
    $.each(collection, function(key, value) {
      iterator(key, value, index++);
    });
  }

  function sanitize(options) {
    var buttons;
    var total;

    if (typeof options !== "object") {
      throw new Error("Please supply an object of options");
    }

    if (!options.message) {
      throw new Error("Please specify a message");
    }

    // make sure any supplied options take precedence over defaults
    options = $.extend({}, defaults, options);

    if (!options.buttons) {
      options.buttons = {};
    }

    // we only support Bootstrap's "static" and false backdrop args
    // supporting true would mean you could dismiss the dialog without
    // explicitly interacting with it
    options.backdrop = options.backdrop ? "static" : false;

    buttons = options.buttons;

    total = getKeyLength(buttons);

    each(buttons, function(key, button, index) {

      if ($.isFunction(button)) {
        // short form, assume value is our callback. Since button
        // isn't an object it isn't a reference either so re-assign it
        button = buttons[key] = {
          callback: button
        };
      }

      // before any further checks make sure by now button is the correct type
      if ($.type(button) !== "object") {
        throw new Error("button with key " + key + " must be an object");
      }

      if (!button.label) {
        // the lack of an explicit label means we'll assume the key is good enough
        button.label = key;
      }

      if (!button.className) {
        if (total <= 2 && index === total-1) {
          // always add a primary to the main option in a two-button dialog
          button.className = "btn-primary";
        } else {
          button.className = "btn-default";
        }
      }
    });

    return options;
  }

  function mapArguments(args, properties) {
    var argn = args.length;
    var options = {};

    if (argn < 1 || argn > 2) {
      throw new Error("Invalid argument length");
    }

    if (argn === 2 || typeof args[0] === "string") {
      options[properties[0]] = args[0];
      options[properties[1]] = args[1];
    } else {
      options = args[0];
    }

    return options;
  }

  function mergeArguments(defaults, args, properties) {
    return $.extend(true, {}, defaults, mapArguments(args, properties));
  }

  function mergeButtons(labels, args, properties) {
    return validateButtons(
      mergeArguments(createButtons.apply(null, labels), args, properties),
      labels
    );
  }

  function createLabels() {
    var buttons = {};

    for (var i = 0, j = arguments.length; i < j; i++) {
      var argument = arguments[i];
      var key = argument.toLowerCase();
      var value = argument.toUpperCase();

      buttons[key] = {
        label: _t(value)
      };
    }

    return buttons;
  }

  function createButtons() {
    return {
      buttons: createLabels.apply(null, arguments)
    };
  }

  function validateButtons(options, buttons) {
    var allowedButtons = {};
    each(buttons, function(key, value) {
      allowedButtons[value] = true;
    });

    each(options.buttons, function(key) {
      if (allowedButtons[key] === undefined) {
        throw new Error("button key " + key + " is not allowed (options are " + buttons.join("\n") + ")");
      }
    });

    return options;
  }

  exports.alert = function() {
    var options;

    options = mergeButtons(["ok"], arguments, ["message", "callback"]);

    if (options.callback && !$.isFunction(options.callback)) {
      throw new Error("alert requires callback property to be a function when provided");
    }

    /**
     * overrides
     */
    options.buttons.ok.callback = options.onEscape = function() {
      if ($.isFunction(options.callback)) {
        return options.callback();
      }
      return true;
    };

    return exports.dialog(options);
  };

  exports.confirm = function() {
    var options;

    options = mergeButtons(["cancel", "confirm"], arguments, ["message", "callback"]);

    /**
     * overrides; undo anything the user tried to set they shouldn't have
     */
    options.buttons.cancel.callback = options.onEscape = function() {
      return options.callback(false);
    };

    options.buttons.confirm.callback = function() {
      return options.callback(true);
    };

    // confirm specific validation
    if (!$.isFunction(options.callback)) {
      throw new Error("confirm requires a callback");
    }

    return exports.dialog(options);
  };

  exports.prompt = function() {
    var options;
    var defaults;
    var dialog;
    var form;
    var input;
    var shouldShow;

    // we have to create our form first otherwise
    // its value is undefined when gearing up our options
    // @TODO this could be solved by allowing message to
    // be a function instead...
    form = $(templates.form);

    defaults = {
      buttons: createLabels("cancel", "confirm"),
      value: ""
    };

    options = validateButtons(
      mergeArguments(defaults, arguments, ["title", "callback"]),
      ["cancel", "confirm"]
    );

    // capture the user's show value; we always set this to false before
    // spawning the dialog to give us a chance to attach some handlers to
    // it, but we need to make sure we respect a preference not to show it
    shouldShow = (options.show === undefined) ? true : options.show;

    /**
     * overrides; undo anything the user tried to set they shouldn't have
     */
    options.message = form;

    options.buttons.cancel.callback = options.onEscape = function() {
      return options.callback(null);
    };

    options.buttons.confirm.callback = function() {
      return options.callback(input.val());
    };

    options.show = false;

    // prompt specific validation
    if (!options.title) {
      throw new Error("prompt requires a title");
    }

    if (!$.isFunction(options.callback)) {
      throw new Error("prompt requires a callback");
    }

    // create the input
    input = $(templates.inputs.text);
    input.val(options.value);

    // now place it in our form
    form.append(input);

    form.on("submit", function(e) {
      e.preventDefault();
      // @TODO can we actually click *the* button object instead?
      // e.g. buttons.confirm.click() or similar
      dialog.find(".btn-primary").click();
    });

    dialog = exports.dialog(options);

    // clear the existing handler focusing the submit button...
    dialog.off("shown.bs.modal");

    // ...and replace it with one focusing our input, if possible
    dialog.on("shown.bs.modal", function() {
      input.focus();
    });

    if (shouldShow === true) {
      dialog.modal("show");
    }

    return dialog;
  };

  exports.dialog = function(options) {
    options = sanitize(options);

    var dialog = $(templates.dialog);
    var body = dialog.find(".modal-body");
    var buttons = options.buttons;
    var buttonStr = "";
    var callbacks = {
      onEscape: options.onEscape
    };

    each(buttons, function(key, button) {

      // @TODO I don't like this string appending to itself; bit dirty. Needs reworking
      // can we just build up button elements instead? slower but neater. Then button
      // can just become a template too
      buttonStr += "<button data-bb-handler='" + key + "' type='button' class='btn " + button.className + "'>" + button.label + "</button>";
      callbacks[key] = button.callback;
    });

    body.find(".bootbox-body").html(options.message);

    if (options.animate === true) {
      dialog.addClass("fade");
    }

    if (options.className) {
      dialog.addClass(options.className);
    }

    if (options.title) {
      body.before(templates.header);
    }

    if (options.closeButton) {
      var closeButton = $(templates.closeButton);

      if (options.title) {
        dialog.find(".modal-header").prepend(closeButton);
      } else {
        closeButton.css("margin-top", "-10px").prependTo(body);
      }
    }

    if (options.title) {
      dialog.find(".modal-title").html(options.title);
    }

    if (buttonStr.length) {
      body.after(templates.footer);
      dialog.find(".modal-footer").html(buttonStr);
    }

    /**
     * Bootstrap event listeners; used handle extra
     * setup & teardown required after the underlying
     * modal has performed certain actions
     */

    dialog.on("hidden.bs.modal", function(e) {
      // ensure we don't accidentally intercept hidden events triggered
      // by children of the current dialog. We shouldn't anymore now BS
      // namespaces its events; but still worth doing
      if (e.target === this) {
        dialog.remove();
      }
    });

    /*
    dialog.on("show.bs.modal", function() {
      // sadly this doesn't work; show is called *just* before
      // the backdrop is added so we'd need a setTimeout hack or
      // otherwise... leaving in as would be nice
      if (options.backdrop) {
        dialog.next(".modal-backdrop").addClass("bootbox-backdrop");
      }
    });
    */

    dialog.on("shown.bs.modal", function() {
      dialog.find(".btn-primary:first").focus();
    });

    /**
     * Bootbox event listeners; experimental and may not last
     * just an attempt to decouple some behaviours from their
     * respective triggers
     */

    dialog.on("escape.close.bb", function(e) {
      if (callbacks.onEscape) {
        processCallback(e, dialog, callbacks.onEscape);
      }
    });

    /**
     * Standard jQuery event listeners; used to handle user
     * interaction with our dialog
     */

    dialog.on("click", ".modal-footer button", function(e) {
      var callbackKey = $(this).data("bb-handler");

      processCallback(e, dialog, callbacks[callbackKey]);

    });

    dialog.on("click", ".bootbox-close-button", function(e) {
      // onEscape might be falsy but that's fine; the fact is
      // if the user has managed to click the close button we
      // have to close the dialog, callback or not
      processCallback(e, dialog, callbacks.onEscape);
    });

    dialog.on("keyup", function(e) {
      if (e.which === 27) {
        dialog.trigger("escape.close.bb");
      }
    });

    // the remainder of this method simply deals with adding our
    // dialogent to the DOM, augmenting it with Bootstrap's modal
    // functionality and then giving the resulting object back
    // to our caller

    appendTo.append(dialog);

    dialog.modal({
      backdrop: options.backdrop,
      keyboard: false,
      show: false
    });

    if (options.show) {
      dialog.modal("show");
    }

    // @TODO should we return the raw element here or should
    // we wrap it in an object on which we can expose some neater
    // methods, e.g. var d = bootbox.alert(); d.hide(); instead
    // of d.modal("hide");

   /*
    function BBDialog(elem) {
      this.elem = elem;
    }

    BBDialog.prototype = {
      hide: function() {
        return this.elem.modal("hide");
      },
      show: function() {
        return this.elem.modal("show");
      }
    };
    */

    return dialog;

  };

  exports.setDefaults = function(values) {
    $.extend(defaults, values);
  };

  exports.hideAll = function() {
    $(".bootbox").modal("hide");
  };

  /**
   * standard locales. Please add more according to ISO 639-1 standard. Multiple language variants are
   * unlikely to be required. If this gets too large it can be split out into separate JS files.
   */
  var locales = {
    br : {
      OK      : "OK",
      CANCEL  : "Cancelar",
      CONFIRM : "Sim"
    },
    da : {
      OK      : "OK",
      CANCEL  : "Annuller",
      CONFIRM : "Accepter"
    },
    de : {
      OK      : "OK",
      CANCEL  : "Abbrechen",
      CONFIRM : "Akzeptieren"
    },
    en : {
      OK      : "OK",
      CANCEL  : "Cancel",
      CONFIRM : "OK"
    },
    es : {
      OK      : "OK",
      CANCEL  : "Cancelar",
      CONFIRM : "Aceptar"
    },
    fi : {
      OK      : "OK",
      CANCEL  : "Peruuta",
      CONFIRM : "OK"
    },
    fr : {
      OK      : "OK",
      CANCEL  : "Annuler",
      CONFIRM : "D'accord"
    },
    it : {
      OK      : "OK",
      CANCEL  : "Annulla",
      CONFIRM : "Conferma"
    },
    nl : {
      OK      : "OK",
      CANCEL  : "Annuleren",
      CONFIRM : "Accepteren"
    },
    pl : {
      OK      : "OK",
      CANCEL  : "Anuluj",
      CONFIRM : "Potwierdź"
    },
    ru : {
      OK      : "OK",
      CANCEL  : "Отмена",
      CONFIRM : "Применить"
    },
    zh_CN : {
      OK      : "OK",
      CANCEL  : "取消",
      CONFIRM : "确认"
    },
    zh_TW : {
      OK      : "OK",
      CANCEL  : "取消",
      CONFIRM : "確認"
    }
  };

  exports.init = function(_$) {
    window.bootbox = init(_$ || $);
  };

  return exports;

}(window.jQuery));


text:
package core.contract.infracontract;

import core.domain.realestate.estateaggregate.Image;

public interface IImageRepository extends IRepository<Image> {

}


text:
<FrameLayout android:id="@id/widget_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ProgressBar
        android:id="@+id/progress_bar"
        style="?android:progressBarStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminateTint="@color/colorAccent"
        tools:visibility="gone" />

    <TextView
        android:id="@+id/btn_retry"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:fontFamily="sans-serif-condensed"
        android:text="@string/label_refresh"
        android:textAllCaps="true"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="#fff"
        android:textStyle="bold" />

    <LinearLayout
        android:id="@+id/prayertable"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/tv_prayer_time"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="-8dp"
            android:fontFamily="sans-serif-light"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#fff"
            android:textSize="50sp"
            tools:text="20:10" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/tv_prayer_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fontFamily="sans-serif-condensed"
                android:gravity="center"
                android:textAllCaps="true"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fff"
                android:textStyle="bold"
                tools:text="Maghrib" />

            <ImageView
                android:layout_width="24dp"
                android:layout_height="16dp"
                android:src="@drawable/ic_place"
                android:tint="@color/light_grey" />

            <TextView
                android:id="@+id/tv_location"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fontFamily="sans-serif-condensed"
                android:gravity="center"
                android:textAllCaps="true"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/light_grey"
                android:textStyle="bold"
                tools:text="Kajang" />

        </LinearLayout>

    </LinearLayout>

</FrameLayout>


text:
[![Stories in Ready](https://badge.waffle.io/melvincarvalho/webid.im.png?label=ready&title=Ready)](https://waffle.io/melvincarvalho/webid.im)
# webid.im

[![Join the chat at https://gitter.im/melvincarvalho/webid.im](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/melvincarvalho/webid.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
instant message over webid

demo: http://webid.im


text:
typedef enum {
    CSStatusHealthy = 0,
    CSStatusPartial = 1,
    CSStatusFaulty = 2,
    CSStatusMaintenance = 3,
    CSStatusUnkknown = INT_MAX
} CSStatus;

#pragma mark Status

@interface Status : NSObject

+ (UIColor *)colorForStatus:(CSStatus)status;
+ (CSStatus)statusForString:(NSString *)status;
+ (void)statusWithSuccess:(void (^)(CSStatus status))success failure:(void (^)(NSError *error))failure;
+ (void)statusForStack:(NSString *)stack success:(void (^)(CSStatus status))success failure:(void (^)(NSError *error))failure;

@end


text:
  <wicket:panel>
    <input type="hidden" wicket:id="recorder"/>

          [available header]

        <select class="form-control" style="min-width: 100px;" wicket:id="choices">[choices]</select>

          [selected header]

        <select class="form-control" style="min-width: 100px;" wicket:id="selection">[selection]</select>

  </wicket:panel>


text:
<!DOCTYPE html>

  <meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name='description' content='The repertoire method is an method of finding closed-form of recurrence relations and sum of a series. The method is introduced in Chapter 1 of ConMath but most readers at the first time seem to struggle with it. Through the book, especially Chapter 1 and 2, the repertoire method demonstrates its ability to solve many sums and recurrences. However, I honestly admit that it is quite difficult to apply and fully understand how it works.'>
<meta name='theme-color' content='#44ccff'>

<meta property='og:title' content='The repertoire method • Dang-Khoa'>
<meta property='og:description' content='The repertoire method is an method of finding closed-form of recurrence relations and sum of a series. The method is introduced in Chapter 1 of ConMath but most readers at the first time seem to struggle with it. Through the book, especially Chapter 1 and 2, the repertoire method demonstrates its ability to solve many sums and recurrences. However, I honestly admit that it is quite difficult to apply and fully understand how it works.'>
<meta property='og:url' content='http://dangkhoasdc.github.io/post/repertoire/'>
<meta property='og:site_name' content='Dang-Khoa's blog '>
<meta property='og:type' content='article'><meta property='og:image' content='https://www.gravatar.com/avatar/ff98eba7ca4592a175b13bd623f28f0c?s=256'><meta property='article:author' content='https://facebook.com/dangkhoasdc'><meta property='article:section' content='Post'><meta property='article:tag' content='math'><meta property='article:published_time' content='2017-12-26T00:00:00Z'/><meta property='article:modified_time' content='2017-12-26T00:00:00Z'/><meta name='twitter:card' content='summary'><meta name='twitter:creator' content='@dksdc'>

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

  <title>The repertoire method • Dang-Khoa</title>
  <link rel='canonical' href='http://dangkhoasdc.github.io/post/repertoire/'>

  <link rel='icon' href='/favicon.ico'>
<link rel='stylesheet' href='/assets/css/main.809149b6.css'><link rel='stylesheet' href='/css/custom.css'>

  Skip to Main Menu

    Dang-Khoa's blog

    just another blog

Search

  <form action='/search' id='search-form' class='search-form'>

      Search
      <input id='search-term' class='search-term' type='search' name='q' placeholder='Search…'>
    </form>

  Home

  Docs

Tags

        algorithms

        android

        books

        computer vision

        courses

        history

        math

        matlab

        misc

        notes

        opencv

        programming

        taocp

        visual studio

        windows

    Skip to Content

<button id='sidebar-toggler' class='sidebar-toggler' aria-controls='sidebar'>
  Toggle Sidebar
  <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <line x1="3" y1="12" x2="21" y2="12" />
  <line x1="3" y1="6" x2="21" y2="6" />
  <line x1="3" y1="18" x2="21" y2="18" />

</svg>

  <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <line x1="18" y1="6" x2="6" y2="18" />
  <line x1="6" y1="6" x2="18" y2="18" />

</svg>

</button>

          Home

          Docs

          About Me

          Tiếng Việt

          English

Dang-Khoa's blog

just another blog

The repertoire method

  <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
  <line x1="16" y1="2" x2="16" y2="6"/>
  <line x1="8" y1="2" x2="8" y2="6"/>
  <line x1="3" y1="10" x2="21" y2="10"/>

</svg>
Posted on
  <time class='entry-date' datetime='2017-12-26T00:00:00Z'>2017, Dec 26</time>

  <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <path d="M21,21V20c0-2.76-4-5-9-5s-9,2.24-9,5v1"/>
  <path d="M16,6.37A4,4,0,1,1,12.63,3,4,4,0,0,1,16,6.37Z"/>

</svg>
 by Dang-Khoa

<svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <circle cx="12" cy="12" r="10"/>
  <polyline points="12 6 12 12 15 15"/>

</svg>
5 mins read

The repertoire method is an method of finding closed-form of recurrence relations
and sum of a series. The method is introduced in Chapter 1 of ConMath but
most readers at the first time seem to struggle with it. Through the book,
especially Chapter 1 and 2, the repertoire method demonstrates its ability to
solve many sums and recurrences. However, I honestly admit that it is quite
difficult to apply and fully understand how it works. In this note, I try to
figure the way to effectively apply the method for solving recurrences.

Definition

In essence, the main goal of the method is to find coefficients for a linear
combination of a set of recurrences. This method works very well on linear
recurrences, in the sense that the solutions can be expressed as a sum of
coefficients multiplied by functions of $n$ Therefore,
if we have to find a closed-form of a linear recurrence, this is worth trying.

The method is not described clearly in ConMath because the authors always come
up with a set of recurrences and get their coefficients but they do not
mention how they figure out. Regarding this aspect, Sedgewick’s book obtains
accessible clarification and systematic examples. Therefore, I use the procedure
in Sedgewick’s book as a recipe for the repertoire method:

Relax the recurrence by adding an extra function term.

Substitue known functions into the recurrence to derive identities similar to the recurrence.

Take linear combination of such identities to derive an equation identical to the recurrence.

At the first look, it is quite abstract. However, some examples carried out
in the book illustrate how we manipulate the steps. Suppose that we have
recurrence $a_{n} = a_{n-1} + {\text stuff} $. First we generalize the
identity by replacing ${\text stuff}$ with $f(n)$, i.e., $a_{n} = a_{n-1} + f(n)$.
We easily obtain $f(n) =  a_{n} - a_{n-1}$. The next step is to build a table
of ingredients in which we can construct $f(n)$. Finally, we determine coefficients
of each component so that they satisfy $f(n)$ and the basis of the
recurrence.

For more details and explanations, I strongly recommend reading
Markus Scheuer’s answer. Of
course, ConMath (Chapter 1, 2, 6) is a good material for practicing the method
except understanding purposes. Section 2.5 from Sedgewick’s book summarizes
some approaches to finding the closed-form including the repertoire method.
Examples in the book are required reading.

The best way to fully understand the method is to work through examples.

Examples

Closed-form of sums

We can easily convert sum of a sequence into a linear recurrence. Let begin
with the first example which only contains term $n^3$.

$ S_{n} = \sum_{k=0}^n k^3$

This sum can be seen as:

$ a_{0} = 0$
$ a_{n} = a_{n-1} + n^3$

Next,  we build a table of $a_{n}$ and $a_n - a_{n-1}$.

$a_n$
$a_n -a_{n-1}$

1
0

n
1

$n^2$
$2n-1$

$n^3$
$3n^2-3n+1$

$n^4$
$4n^3-6n^2+4n-1$

How can I fill $a_n$? Since we want $f(n)$ obtains $n^3$
and we observe that $f(n) = a_n - a_{n-1}$ depends on the degree of $n$ in
$a_n$ and hence we come up with some simple sequence, i.e., computing $a_n - a_{n-1}$.
Turn out $f(n)$ have smaller degree of $n$ than $a_n$ exactly 1. $f(n)$ obtaining $n^3$
means that $a_n$ has to obtain $n^4$. The simplest form we can come up with
is $n^3 = \alpha (4n^3-6n^2+4n-1)$. So $\alpha = {1\over 4}$, we need to eliminate $n^2$,
$n$ and constants. In the second attempt, we add $n^3$ and $n^2$ into the
linear combination:

$$
\alpha (4n^3-6n^2+4n-1) + \beta(3n^2-3n+1) + \lambda (2n-1) = n^3
$$

$$
\begin{cases}
-6\alpha + 3\beta = 0\newline
4\alpha -3\beta + 2\lambda = 0\newline
-\alpha + \beta - \lambda = 0
\end{cases}
$$

The solution is $(\alpha, \beta,\lambda) =({1\over 4}, {1\over 2}, {1\over 4}) $
and hence $a_n = \alpha n^3 + \beta n^2 + \lambda n = {1\over 4}n^2(n+1)^2$.
Also, since $a_0 = 0$, it is the final solution.

Let try another example, this time we use an exercise in ConMath:

$$ S_{n} = \sum_{k=0}^{k} (-1)^kk^2$$

$a_n$
$a_n-a_{n-1}$

$(-1)^nn^2$
$(-1)^n(2n^2-2n+1)$

$(-1)^n $
$2(-1)^n$

$(-1)^nn $
$(-1)^n(2n-1)$

The solution is $S_n = {1\over 2}(-1)^n n(n+1)$ since we just add the first term
and the last term together and then divide by 2, we get $f(n)$. When I first saw
the sum, I could not think any sequences which help me find $f(n)$. After
play which some sequences, I realize that assigning $a_n = f(n) = (-1)^nn^2$
actually lets other patterns be discovered.

Linear Recurrences

$ a_0 = 7 $

$ a_n = a_{n-1} + 2n^2 + 7 \; n > 0 $

Based on the table we built in previous examples, we can construct a linear
combination for the recurrence:

$\alpha(3n^2-3n+1) + \beta(2n-1) + \lambda 1 = 2n^2+7$

$$
\begin{cases}
3\alpha = 2 \newline
-3\alpha + 2\beta = 0 \newline
\alpha - \beta + \lambda = 7
\end{cases}
$$

The solution is $(\alpha, \beta, \lambda) = ({2\over 3}, 1, {22\over 3})$. However,
at this time $a_0= 0 \neq 7$, we have to add constant $7$ to the final form.
The closed-form is $a_n = {2\over 3}n^3+n^2+{22\over 3}n+7$.

Exercise 1.16 (ConMath)

$$
g(1) = \alpha
$$
$$
g(2n+j) = 3g(n) + \gamma n + \beta \; j = 0, 1 ; n \geq 1
$$

Related Materials

After hours searching on Internet, I found some useful links which actually
helps me understand the method:

Wakatta’s post

Math stackexchange answer:
this one is damn good.

Pindancing’s post

Sedgewick, Robert, and Philippe Flajolet. An introduction to the analysis of algorithms. Pearson Education India, 1996. [IMO,
the explanation in this book is much better than in ConMath.]

Graham, Ronald L., et al. “Concrete mathematics: a foundation for computer science.” Computers in Physics 3.5 (1989): 106-107.

  <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <path d="M20.59,13.41l-7.17,7.17a2,2,0,0,1-2.83,0L2,12V2H12l8.59,8.59A2,2,0,0,1,20.59,13.41Z"/>
  <line x1="7" y1="7" x2="7" y2="7"/>

</svg>

  Tags: math

        <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <line x1="20" y1="12" x2="4" y2="12"/>
  <polyline points="10 18 4 12 10 6"/>

</svg>
 Previous
        Previous post: Miscellaneous notes

        Next post: Selected Papers on Computer Science (Don Knuth) and the current state of Deep LearningNext <svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <line x1="4" y1="12" x2="20" y2="12"/>
  <polyline points="14 6 20 12 14 18"/>

</svg>

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

          Open Github account in new tab<svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/>

</svg>

          Contact via Email<svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>

  <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
  <polyline points="22,6 12,13 2,6"/>

</svg>

 © 2017-2019 Dang-Khoa


text:
'use strict';

/**
 * Dependencies
 */
const path = require('path');
const replaceInFile = require('replace-in-file');
const build = require('../build');
const config = require('../config');

/**
 * Copy assets
 */
module.exports = function updateRedirects(done) {
  replaceInFile({
    files: path.join(build.DEST_ASSETS, '_redirects'),
    replace: /%API_BASE_URL%/g,
    with: config.API_BASE_URL,
  }, done);
};


text:
Rubik UI is a Material Design style ui library based Vue.js 2.0+ which can be used for PC and Mobile.

Rubik UI 是一个基于 Vue.js 2.0+ 的开源 UI 组件库,在交互和视觉设计上遵循 Material Design 规范,适用于 PC 端和 mobile 端。

## GitHub

[https://github.com/ccforward/rubik](https://github.com/ccforward/rubik)

## NPM

[![npm](https://img.shields.io/npm/v/i-rubik.svg)](https://www.npmjs.com/package/i-rubik)

## Support

Support Vue.js 2.0+

Not support Vue.js 1.x

## Demo

[https://ccforward.github.io/rubik/](https://ccforward.github.io/rubik/)

[http://rubik.ccforward.net/](http://rubik.ccforward.net/)

## Usage

#### npm install

``` shell
$ npm install i-rubik --save

$ yarn add i-rubik

```

#### Rubik init

``` js
import Vue from 'vue'
import Rubik from 'i-rubik'
Vue.use(Rubik)

export default {
  name: 'app',
  mounted(){
    this.$rubik.init()
  }
}
```

### iconfont

Material Design's iconfont has been writtened in css file

### import css

```html
<link href="./node_modules/i-rubik/dist/rubik.min.css" rel="stylesheet" type="text/css">
```
OR

```html
<link href="//unpkg.com/i-rubik/dist/rubik.min.css" rel="stylesheet" type="text/css">
```

## Releated Projects

Rubik UI 的部分组件和样式代码参考了以下项目

Thanks to

*   [materializecss](http://materializecss.com/)
*   [material-ui](http://www.material-ui.com/)
*   [iview](https://www.iviewui.com/)
*   [vuetify](https://vuetifyjs.com/)


text:
<?php
class testMethodPostfixStructureForParentInvocation
    extends testMethodPostfixStructureForParentInvocationParent
{
    function testMethodPostfixStructureForParentInvocation()
    {
        parent::testMethodPostfixStructureForParentInvocation();
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.server.master.remote;

import java.rmi.RemoteException;
import java.rmi.server.RemoteServer;
import java.rmi.server.ServerNotActiveException;
import org.server.core.IPAddress;
import org.server.core.remote.RMIServiceInterface;
import org.server.core.remote.RMIServiceInterfaceImpl;
import org.server.master.ManagedServerInformationNode;
import org.server.master.MasterServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MasterRMIServerInterfaceImpl extends RMIServiceInterfaceImpl<MasterServer> implements MasterRMIServerInterface {

    /**
	 *
	 */
	private static final long serialVersionUID = 2661310995704469536L;
	private static final Logger logger = LoggerFactory.getLogger(MasterRMIServerInterfaceImpl.class);

    public MasterRMIServerInterfaceImpl(MasterServer server) throws RemoteException {
        super(server);
    }

    @Override
    public boolean registerServer(String key, RMIServiceInterface service) throws RemoteException {
        for (ManagedServerInformationNode node
                : getServer().getServerConfig().getManagedServers().values()) {
            if (node.getServerKey().equals(key)) {
                try {
                    // 注册服务
                    node.setRemoteService(service);
                    node.setServerRMIAddress(service.getServerRMIAddress());
                    // 输出日志
                    logger.info(
                            String.format("服务节点 [%s] 上线.服务地址为 [%s] .",
                                    node.getServerType(),
                                    RemoteServer.getClientHost()));
                    return true;
                } catch (ServerNotActiveException ex) {
                    logger.error("尝试注册服务失败:", ex);
                }
            }
        }
        return false;
    }

    @Override
    public IPAddress getRMIAddressByKey(String key) throws RemoteException {
        for (ManagedServerInformationNode node
                : getServer().
                getServerConfig().
                getManagedServers().
                values()) {
            if (node.getServerKey().equals(key)) {
                return node.getServerRMIAddress();
            }
        }
        return null;
    }
}


text:
"What's In Retrograde?" is a web app that allows the user to see the current retrograde status of the planets. Users can also view a different date by selecting a date in the dropdown. All the data is fed through a JS file which holds objects containing the data for each date.

## Getting Started
The page automatically loads a JavaScript function which fetches retrograde data based on todays date. The function checks against todays date and then iterates through each date object, returning the current days data. The date selector function works in the similar way, but checks against the selected date versus todays date.

### The Retrograde Database

retrogradeData.js contains one object named dateInfo which contains an object for each day of the year. The structure of these objects is as follows:

```
feb06: {
        planets: ['VENUS', 'JUPITER', 'SATURN', 'PLUTO'],
        direction: ['In RX Zone', 'Stationary Retrograde', 'In RX Zone', 'In Rx Zone'],
        time: ['12:59 AM'],
        sign: ['Libra'],
        degrees: ['23°'],
        minutes: ["8'"],
},
```

When the ```fetchRetrograde()``` function runs, it iterates through each date object to pull the data for each category.

### Installing

Just copy the all the contents into your web server and deploy!

## Things To Add

* Icons for days with no event
* Simple way to retrieve data for any day
* Create an API based on the retrogradeData.js file

## Built With

* Good ol' vanilla JavaScript
* Sweaty hands

## Contributing

Feel free to point out anything that can be improved or added!

## Authors

* **Bryan Torres** - *Initial work* - [BryTorres](https://github.com/brytorres)

Other contributors will be added to this list when the time comes :)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
package org.apache.commons.digester3;

import static java.lang.String.format;

import org.xml.sax.Attributes;

/**
 * @since 3.0
 */
final class PatternRuleMatcher
    implements RuleMatcher
{

    private final String pattern;

    private final String namespaceURI;

    public PatternRuleMatcher( final String pattern )
    {
        this( pattern, null );
    }

    public PatternRuleMatcher( final String pattern, /* @Nullable */final String namespaceURI )
    {
        if ( pattern == null )
        {
            throw new IllegalArgumentException( "Input pattern must be not null" );
        }

        this.pattern = pattern;
        this.namespaceURI = namespaceURI;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean match( final String namespace, final String pattern, final String name, final Attributes attributes )
    {
        if ( namespaceURI != null && !namespace.equals( namespaceURI ) )
        {
            return false;
        }
        return this.pattern.equals( pattern );
    }

    public String getPattern()
    {
        return pattern;
    }

    public String getNamespaceURI()
    {
        return namespaceURI;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ( ( namespaceURI == null ) ? 0 : namespaceURI.hashCode() );
        result = prime * result + pattern.hashCode();
        return result;
    }

    @Override
    public boolean equals( final Object obj )
    {
        if ( this == obj )
        {
            return true;
        }

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

        if ( getClass() != obj.getClass() )
        {
            return false;
        }

        final PatternRuleMatcher other = (PatternRuleMatcher) obj;
        if ( namespaceURI == null )
        {
            if ( other.getNamespaceURI() != null )
            {
                return false;
            }
        }
        else if ( !namespaceURI.equals( other.getNamespaceURI() ) )
        {
            return false;
        }

        if ( !pattern.equals( other.getPattern() ) )
        {
            return false;
        }

        return true;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString()
    {
        return format( "%s (%s)", pattern, namespaceURI );
    }

}


text:
package org.gradle.internal.component.model;

import com.google.common.collect.ImmutableList;
import org.gradle.api.capabilities.CapabilitiesMetadata;
import org.gradle.api.internal.attributes.ImmutableAttributes;
import org.gradle.internal.DisplayName;

import javax.annotation.Nullable;

public class DefaultVariantMetadata implements VariantResolveMetadata {
    private final String name;
    private final Identifier identifier;
    private final DisplayName displayName;
    private final ImmutableAttributes attributes;
    private final ImmutableList<? extends ComponentArtifactMetadata> artifacts;
    private final CapabilitiesMetadata capabilitiesMetadata;

    public DefaultVariantMetadata(String name, @Nullable Identifier identifier, DisplayName displayName, ImmutableAttributes attributes, ImmutableList<? extends ComponentArtifactMetadata> artifacts, @Nullable CapabilitiesMetadata capabilitiesMetadata) {
        this.name = name;
        this.identifier = identifier;
        this.displayName = displayName;
        this.attributes = attributes;
        this.artifacts = artifacts;
        this.capabilitiesMetadata = capabilitiesMetadata;
    }

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

    @Override
    public Identifier getIdentifier() {
        return identifier;
    }

    @Override
    public DisplayName asDescribable() {
        return displayName;
    }

    @Override
    public ImmutableAttributes getAttributes() {
        return attributes;
    }

    @Override
    public ImmutableList<? extends ComponentArtifactMetadata> getArtifacts() {
        return artifacts;
    }

    @Override
    public CapabilitiesMetadata getCapabilities() {
        return capabilitiesMetadata;
    }

    @Override
    public boolean isExternalVariant() {
        return false;
    }
}


text:
package com.navigation.reactnative;

import androidx.annotation.NonNull;

import com.facebook.react.common.MapBuilder;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;

import java.util.Map;

public class ActionBarManager extends ViewGroupManager<ActionBarView> {
    @NonNull
    @Override
    public String getName() {
        return "NVActionBar";
    }

    @NonNull
    @Override
    protected ActionBarView createViewInstance(@NonNull ThemedReactContext reactContext) {
        return new ActionBarView(reactContext);
    }

    @Override
    public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
        return MapBuilder.<String, Object>builder()
            .put("topOnExpanded", MapBuilder.of("registrationName", "onExpanded"))
            .put("topOnCollapsed", MapBuilder.of("registrationName", "onCollapsed"))
            .build();
    }
}


text:
Article 1241
----
Le paiement fait au créancier n'est point valable s'il était incapable de le
recevoir, à moins que le débiteur ne prouve que la chose payée a tourné au
profit du créancier.


text:
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *  # noqa

import vim
from ycm import vimsupport
from ycmd import utils
from ycmd.responses import ServerError
from ycmd.completers.completer import Completer
from ycm.client.base_request import BaseRequest, HandleServerException

OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" '
                     ' list when expected.' )

class OmniCompleter( Completer ):
  def __init__( self, user_options ):
    super( OmniCompleter, self ).__init__( user_options )
    self._omnifunc = None

  def SupportedFiletypes( self ):
    return []

  def ShouldUseCache( self ):
    return bool( self.user_options[ 'cache_omnifunc' ] )

  def ShouldUseNow( self, request_data ):
    if not self._omnifunc:
      return False

    if self.ShouldUseCache():
      return super( OmniCompleter, self ).ShouldUseNow( request_data )
    return self.ShouldUseNowInner( request_data )

  def ShouldUseNowInner( self, request_data ):
    if not self._omnifunc:
      return False
    return super( OmniCompleter, self ).ShouldUseNowInner( request_data )

  def ComputeCandidates( self, request_data ):
    if self.ShouldUseCache():
      return super( OmniCompleter, self ).ComputeCandidates( request_data )
    else:
      if self.ShouldUseNowInner( request_data ):
        return self.ComputeCandidatesInner( request_data )
      return []

  def ComputeCandidatesInner( self, request_data ):
    if not self._omnifunc:
      return []

    try:
      return_value = int( vim.eval( self._omnifunc + '(1,"")' ) )
      if return_value < 0:
        # FIXME: Technically, if the return is -1 we should raise an error
        return []

      omnifunc_call = [ self._omnifunc,
                        "(0,'",
                        vimsupport.EscapeForVim( request_data[ 'query' ] ),
                        "')" ]

      items = vim.eval( ''.join( omnifunc_call ) )

      if isinstance( items, dict ) and 'words' in items:
        items = items[ 'words' ]

      if not hasattr( items, '__iter__' ):
        raise TypeError( OMNIFUNC_NOT_LIST )

      return list( filter( bool, items ) )

    except ( TypeError, ValueError, vim.error ) as error:
      vimsupport.PostVimMessage(
        OMNIFUNC_RETURNED_BAD_VALUE + ' ' + str( error ) )
      return []

  def OnFileReadyToParse( self, request_data ):
    self._omnifunc = utils.ToUnicode( vim.eval( '&omnifunc' ) )

  def FilterAndSortCandidatesInner( self, candidates, sort_property, query ):
    request_data = {
      'candidates': candidates,
      'sort_property': sort_property,
      'query': query
    }

    try:
      return BaseRequest.PostDataToHandler( request_data,
                                            'filter_and_sort_candidates' )
    except ServerError as e:
      HandleServerException( e )
      return candidates


text:
root=$(cd $(dirname $0) && pwd)

case "$1" in
  def)
    defaults write -g KeyRepeat -int 2
    defaults write -g InitialKeyRepeat -int 15
    defaults write -g com.apple.trackpad.scaling -int 3
    defaults write -g com.apple.mouse.scaling -int 3
    defaults write -g AppleShowAllExtensions -bool true
    defaults write com.apple.menuextra.clock DateFormat -string 'M\\U6708d\\U65e5(EEE)  H:mm:ss'
    defaults write com.apple.menuextra.clock ShowSeconds -bool true
    defaults write com.apple.AppleMultitouchTrackpad Dragging -bool true
    defaults write com.apple.AppleMultitouchTrackpad DragLock -bool true
    defaults write com.apple.finder AppleShowAllFiles -bool true
    defaults write com.apple.dock wvous-br-corner -int 13
    defaults write com.apple.dock wvous-br-modifier -int 0
    killall Finder
    killall Dock
    ;;

  link)
    for src in $(find $root -name '*.symlink'); do
      dest=$HOME/.${src#$root/}
      dest=${dest%.*}
      if [ ! -e $dest ];then
        mkdir -p $(dirname $dest)
        ln -s $src $dest
      fi
    done
    ;;

  brew)
    sudo softwareupdate --install-rosetta
    /opt/homebrew/bin/brew bundle install --file "$root/Brewfile"
    if [ -d /opt/homebrew/opt/openjdk/libexec/openjdk.jdk ]; then
      sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
    fi
    ;;

  vim)
    /opt/homebrew/bin/brew install vim
    bundle_root=$HOME/.vim/bundle
    neobundle_dir=$bundle_root/neobundle.vim
    mkdir -p $bundle_root
    [ ! -d $neobundle_dir ] && git clone https://github.com/Shougo/neobundle.vim $neobundle_dir
    vim +NeoBundleInstall +qall!
    ;;

  fisher)
    /opt/homebrew/bin/fish -l -c "$(curl -sL https://git.io/fisher | source)"
    fisher install jorgebucaran/fisher
    fisher install oh-my-fish/plugin-peco
    fisher install 0rax/fish-bd
    fisher install jethrokuan/z
    ;;
  *)
    set +x
    clear
    echo def
    echo link
    echo brew
    echo vim
    echo fisher
    ;;
esac


text:
"use strict";

exports.__esModule = true;
exports.config = undefined;
exports.normaliseOptions = normaliseOptions;

var _parsers = require("./parsers");

var parsers = _interopRequireWildcard(_parsers);

var _config = require("./config");

var _config2 = _interopRequireDefault(_config);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

exports.config = _config2.default;
function normaliseOptions() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  for (var key in options) {
    var val = options[key];
    if (val == null) continue;

    var opt = _config2.default[key];
    if (opt && opt.alias) opt = _config2.default[opt.alias];
    if (!opt) continue;

    var parser = parsers[opt.type];
    if (parser) val = parser(val);

    options[key] = val;
  }

  return options;
}


text:
import 'babel-polyfill';
import { describe, it, beforeEach, afterEach } from 'mocha';
import chai from 'chai';
import sinon from 'sinon';
import jsonfile from 'jsonfile';
import fs from 'fs';
import * as constants from '../constants';
import utils from '../utils';
import open from './fileDB';

const { expect } = chai;
const testDbPath = './test_db';

describe('fileDB', () => {
  let readFileStub;
  let writeFileStub;
  let mkdirSyncStub;

  beforeEach(() => {
    constants.DB_PATH = testDbPath;
    readFileStub = sinon.stub(jsonfile, 'readFile');
    writeFileStub = sinon.stub(jsonfile, 'writeFile');
    mkdirSyncStub = sinon.stub(fs, 'mkdirSync');
  });

  it('open() should return "Db" instance', async () => {
    readFileStub.callsFake((path, cb) => cb({}));
    writeFileStub.callsFake((path, data, cb) => cb());

    const db = await open('test_database_need_to_be_wiped');

    expect(db).to.be.a('object');
  });

  it('"Db.get()" should return valid data', async () => {
    const key = '123';
    const jsonOnKey = {
      prop1: 1,
      prop2: '',
    };
    const json = {
      123: jsonOnKey,
    };
    readFileStub.callsFake((path, cb) => cb(null, json));

    const db = await open('test_database_need_to_be_wiped');
    const result = db.get(key);
    const resultDeep = db.get(`${key}.prop1`);

    expect(JSON.stringify(db.data)).to.equal(JSON.stringify(json));
    expect(JSON.stringify(result)).to.equal(JSON.stringify(jsonOnKey));
    expect(resultDeep).to.equal(1);
  });

  it('"Db.get()" shouldn\'t fail on path that doesn\'t exist', async () => {
    const json = {
      123: {
        prop1: 1,
        prop2: '',
      },
    };
    readFileStub.callsFake((path, cb) => cb(null, json));

    const db = await open('test_database_need_to_be_wiped');
    const result = db.get('123.prop1.prop2.prop3');

    expect(result).to.equal(undefined);
  });

  it('"Db.set()" should set valid data', async () => {
    const jsonOnKey = {
      prop1: 1,
      prop2: '',
    };
    const newJsonOnKey = {
      prop1: 2,
      prop2: 'prop2',
    };
    const json = {
      123: jsonOnKey,
    };
    const keyDeep = '123.prop3.prop4';
    const valueDeep = 'prop3value';
    readFileStub.callsFake((path, cb) => cb(null, json));

    const db = await open('test_database_need_to_be_wiped');
    db.set('123', newJsonOnKey);
    const result = db.get('123');
    db.set(keyDeep, valueDeep);
    const resultDeep = db.get(keyDeep);

    expect(JSON.stringify(db.data)).to.equal(JSON.stringify(json));
    expect(JSON.stringify(result)).to.equal(JSON.stringify(newJsonOnKey));
    expect(resultDeep).to.equal(valueDeep);
  });

  it('open() should throw an error if write is fail', async () => {
    readFileStub.callsFake((path, cb) => cb({}));
    writeFileStub.callsFake((path, data, cb) => cb(new Error()));
    let errorCatched = false;
    try {
      await open('test_database_need_to_be_wiped');
    } catch (error) {
      errorCatched = true;
    }

    expect(errorCatched).to.equal(true);
  });

  afterEach(async () => {
    await utils.removeFolder(testDbPath);
    readFileStub.restore();
    writeFileStub.restore();
    mkdirSyncStub.restore();
  });
});


text:
import mountTemplate from 'test/utils/mountTemplate'
import MdApp from './MdApp.vue'

test('should render the app', async () => {
  const template = '<md-app></md-app>'
  const wrapper = await mountTemplate(MdApp, template)

  expect(wrapper.hasClass('md-app')).toBe(true)
})


text:
set -m # Enable Job Control

source enviroments.sh
source helper_functions.sh

# trap ctrl-c and call ctrl_c()
trap ctrl_c INT

BEFORE=$(date +%s)

start

logs_dir=/tmp/`date +%s`
mkdir -p $logs_dir

source cases.sh

wait
echo
cat $logs_dir/* 2>/dev/null
rm -rf $logs_dir
stop

AFTER=$(date +%s)
exit_with_summary $(expr $AFTER - $BEFORE)


text:
package org.apache.hyracks.control.common.application;

public enum ApplicationStatus {
    CREATED,
    IN_INITIALIZATION,
    INITIALIZED,
    IN_DEINITIALIZATION,
    DEINITIALIZED
}


text:
<?php

// constants used by class
define('MYSQL_TYPES_NUMERIC', 'int real ');
define('MYSQL_TYPES_DATE', 'datetime timestamp year date time ');
define('MYSQL_TYPES_STRING', 'string blob ');

class db_class {

   var $last_error;         // holds the last error. Usually mysql_error()
   var $last_query;         // holds the last query executed.
   var $row_count;          // holds the last number of rows from a select

   var $host;               // mySQL host to connect to
   var $user;               // mySQL user name
   var $pw;                 // mySQL password
   var $db;                 // mySQL database to select

   var $db_link;            // current/last database link identifier
   var $auto_slashes;       // the class will add/strip slashes when it can

   function db_class() {

      // class constructor.  Initializations here.

      // Setup your own default values for connecting to the database here. You
      // can also set these values in the connect() function and using
      // the select_database() function.

      $this->host = 'SERVERHOST';
      $this->user = 'SERVERUSER';
      $this->pw = 'SERVERPASS';
      $this->db = 'booking';

      $this->auto_slashes = true;
   }

   function connect($host='', $user='', $pw='', $db='', $persistant=true) {

      // Opens a connection to MySQL and selects the database.  If any of the
      // function's parameter's are set, we want to update the class variables.
      // If they are NOT set, then we're giong to use the currently existing
      // class variables.
      // Returns true if successful, false if there is failure.

      if (!empty($host)) $this->host = $host;
      if (!empty($user)) $this->user = $user;
      if (!empty($pw)) $this->pw = $pw;

      // Establish the connection.
      if ($persistant)
         $this->db_link = mysql_pconnect($this->host, $this->user, $this->pw);
      else
         $this->db_link = mysql_connect($this->host, $this->user, $this->pw);

      // Check for an error establishing a connection
      if (!$this->db_link) {
         $this->last_error = mysql_error();
         return false;
      }

      // Select the database
      if (!$this->select_db($db)) return false;

      return $this->db_link;  // success
   }

   function select_db($db='') {

      // Selects the database for use.  If the function's $db parameter is
      // passed to the function then the class variable will be updated.

      if (!empty($db)) $this->db = $db;

      if (!mysql_select_db($this->db)) {
         $this->last_error = mysql_error();
         return false;
      }

      return true;
   }

   function select($sql) {

      // Performs an SQL query and returns the result pointer or false
      // if there is an error.

      $this->last_query = $sql;

      $r = mysql_query($sql);
      if (!$r) {
         $this->last_error = mysql_error();
         return false;
      }
      $this->row_count = mysql_num_rows($r);
      return $r;
   }

   function select_one($sql) {

      // Performs an SQL query with the assumption that only ONE column and
      // one result are to be returned.
      // Returns the one result.

      $this->last_query = $sql;

      $r = mysql_query($sql);
      if (!$r) {
         $this->last_error = mysql_error();
         return false;
      }
      if (mysql_num_rows($r) > 1) {
         $this->last_error = "Your query in function select_one() returned more that one result.";
         return false;
      }
      if (mysql_num_rows($r) < 1) {
         $this->last_error = "Your query in function select_one() returned no results.";
         return false;
      }
      $ret = mysql_result($r, 0);
      mysql_free_result($r);
      if ($this->auto_slashes) return stripslashes($ret);
      else return $ret;
   }

   function get_row($result, $type='MYSQL_BOTH') {

      // Returns a row of data from the query result.  You would use this
      // function in place of something like while($row=mysql_fetch_array($r)).
      // Instead you would have while($row = $db->get_row($r)) The
      // main reason you would want to use this instead is to utilize the
      // auto_slashes feature.

      if (!$result) {
         $this->last_error = "Invalid resource identifier passed to get_row() function.";
         return false;
      }

      if ($type == 'MYSQL_ASSOC') $row = mysql_fetch_array($result, MYSQL_ASSOC);
      if ($type == 'MYSQL_NUM') $row = mysql_fetch_array($result, MYSQL_NUM);
      if ($type == 'MYSQL_BOTH') $row = mysql_fetch_array($result, MYSQL_BOTH);

      if (!$row) return false;
      if ($this->auto_slashes) {
         // strip all slashes out of row...
         foreach ($row as $key => $value) {
            $row[$key] = stripslashes($value);
         }
      }
      return $row;
   }

   function dump_query($sql) {

      // Useful during development for debugging  purposes.  Simple dumps a
      // query to the screen in a table.

      $r = $this->select($sql);
      if (!$r) return false;
      echo "
\n";
      echo "
\n";

      $i = 0;
      while ($row = mysql_fetch_assoc($r)) {
         if ($i == 0) {
            echo "
$sql
\n";
            echo "
\n";
            foreach ($row as $col => $value) {
               echo "$col	\n";
            }
            echo "
\n";
         }
         $i++;
         if ($i % 2 == 0) $bg = '#E3E3E3';
         else $bg = '#F3F3F3';
         echo "
\n";
         foreach ($row as $value) {
            echo "$value	\n";
         }
         echo "
\n";
      }
      echo "

\n";
   }

   function insert_sql($sql) {

      // Inserts data in the database via SQL query.
      // Returns the id of the insert or true if there is not auto_increment
      // column in the table.  Returns false if there is an error.

      $this->last_query = $sql;

      $r = mysql_query($sql);
      if (!$r) {
         $this->last_error = mysql_error();
         return false;
      }

      $id = mysql_insert_id();
      if ($id == 0) return true;
      else return $id;
   }

   function update_sql($sql) {

      // Updates data in the database via SQL query.
      // Returns the number or row affected or true if no rows needed the update.
      // Returns false if there is an error.

      $this->last_query = $sql;

      $r = mysql_query($sql);
      if (!$r) {
         $this->last_error = mysql_error();
         return false;
      }

      $rows = mysql_affected_rows();
      if ($rows == 0) return true;  // no rows were updated
      else return $rows;

   }

   function insert_array($table, $data) {

      // Inserts a row into the database from key->value pairs in an array. The
      // array passed in $data must have keys for the table's columns. You can
      // not use any MySQL functions with string and date types with this
      // function.  You must use insert_sql for that purpose.
      // Returns the id of the insert or true if there is not auto_increment
      // column in the table.  Returns false if there is an error.

      if (empty($data)) {
         $this->last_error = "You must pass an array to the insert_array() function.";
         return false;
      }

      $cols = '(';
      $values = '(';

      foreach ($data as $key=>$value) {     // iterate values to input

         $cols .= "$key,";

         $col_type = $this->get_column_type($table, $key);  // get column type
         if (!$col_type) return false;  // error!

         // determine if we need to encase the value in single quotes
         if (is_null($value)) {
            $values .= "NULL,";
         }
         elseif (substr_count(MYSQL_TYPES_NUMERIC, "$col_type ")) {
            $values .= "$value,";
         }
         elseif (substr_count(MYSQL_TYPES_DATE, "$col_type ")) {
            $value = $this->sql_date_format($value, $col_type); // format date
            $values .= "'$value',";
         }
         elseif (substr_count(MYSQL_TYPES_STRING, "$col_type ")) {
            if ($this->auto_slashes) $value = addslashes($value);
            $values .= "'$value',";
         }
      }
      $cols = rtrim($cols, ',').')';
      $values = rtrim($values, ',').')';

      // insert values
      $sql = "INSERT INTO $table $cols VALUES $values";
      return $this->insert_sql($sql);

   }

   function update_array($table, $data, $condition) {

      // Updates a row into the database from key->value pairs in an array. The
      // array passed in $data must have keys for the table's columns. You can
      // not use any MySQL functions with string and date types with this
      // function.  You must use insert_sql for that purpose.
      // $condition is basically a WHERE claus (without the WHERE). For example,
      // "column=value AND column2='another value'" would be a condition.
      // Returns the number or row affected or true if no rows needed the update.
      // Returns false if there is an error.

      if (empty($data)) {
         $this->last_error = "You must pass an array to the update_array() function.";
         return false;
      }

      $sql = "UPDATE $table SET";
      foreach ($data as $key=>$value) {     // iterate values to input

         $sql .= " $key=";

         $col_type = $this->get_column_type($table, $key);  // get column type
         if (!$col_type) return false;  // error!

         // determine if we need to encase the value in single quotes
         if (is_null($value)) {
            $sql .= "NULL,";
         }
         elseif (substr_count(MYSQL_TYPES_NUMERIC, "$col_type ")) {
            $sql .= "$value,";
         }
         elseif (substr_count(MYSQL_TYPES_DATE, "$col_type ")) {
            $value = $this->sql_date_format($value, $col_type); // format date
            $sql .= "'$value',";
         }
         elseif (substr_count(MYSQL_TYPES_STRING, "$col_type ")) {
            if ($this->auto_slashes) $value = addslashes($value);
            $sql .= "'$value',";
         }

      }
      $sql = rtrim($sql, ','); // strip off last "extra" comma
      if (!empty($condition)) $sql .= " WHERE $condition";

      // insert values
      return $this->update_sql($sql);
   }

   function execute_file ($file) {

      // executes the SQL commands from an external file.

      if (!file_exists($file)) {
         $this->last_error = "The file $file does not exist.";
         return false;
      }
      $str = file_get_contents($file);
      if (!$str) {
         $this->last_error = "Unable to read the contents of $file.";
         return false;
      }

      $this->last_query = $str;

      // split all the query's into an array
      $sql = explode(';', $str);
      foreach ($sql as $query) {
         if (!empty($query)) {
            $r = mysql_query($query);

            if (!$r) {
               $this->last_error = mysql_error();
               return false;
            }
         }
      }
      return true;

   }

   function get_column_type($table, $column) {

      // Gets information about a particular column using the mysql_fetch_field
      // function.  Returns an array with the field info or false if there is
      // an error.

      $r = mysql_query("SELECT $column FROM $table");
      if (!$r) {
         $this->last_error = mysql_error();
         return false;
      }
      $ret = mysql_field_type($r, 0);
      if (!$ret) {
         $this->last_error = "Unable to get column information on $table.$column.";
         mysql_free_result($r);
         return false;
      }
      mysql_free_result($r);
      return $ret;

   }

   function sql_date_format($value) {

      // Returns the date in a format for input into the database.  You can pass
      // this function a timestamp value such as time() or a string value
      // such as '04/14/2003 5:13 AM'.

      if (gettype($value) == 'string') $value = strtotime($value);
      return date('Y-m-d H:i:s', $value);

   }
   function print_last_error($show_query=true) {

      // Prints the last error to the screen in a nicely formatted error message.
      // If $show_query is true, then the last query that was executed will
      // be displayed aswell.

      ?>

         db.class.php Error:
<?= $this->last_error ?>

      <?
      if ($show_query && (!empty($this->last_query))) {
      $this->print_last_query();
      }

   }

   function print_last_query() {

      // Prints the last query that was executed to the screen in a nicely formatted
      // box.

      ?>

         Last SQL Query:
<?= str_replace("\n", '
', $this->last_query) ?>

      <?php
   }
}
?>


text:
/*
Thoughts: same as the number of meeting.
Use a Point class {time, flag} and mark all time spot, and use a min-heap(PriorityQueue) to sort it.

Note: LintCode forces me to put '10' in PriorityQueue constructor?
*/

/**
 * Definition of Interval:
 * public classs Interval {
 * int start, end;
 * Interval(int start, int end) {
 * this.start = start;
 * this.end = end;
 * }
 */

class Solution {
    /**
     * @param intervals: An interval array
     * @return: Count of airplanes are in the sky.
     */
    public int countOfAirplanes(List<Interval> airplanes) {
        if (airplanes == null || airplanes.size() == 0) {
            return 0;
        }
        PriorityQueue<Point> queue = new PriorityQueue<Point>(10,
                new Comparator<Point>() {
                    public int compare(Point a, Point b) {
                        return a.x - b.x;
                    }
                });
        for (Interval interval : airplanes) {
            queue.offer(new Point(interval.start, 1));
            queue.offer(new Point(interval.end, -1));
        }
        int count = 0;
        int max = 0;
        while (!queue.isEmpty()) {
            Point p = queue.poll();
            count += p.flag;
            while (!queue.isEmpty() && queue.peek().x == p.x) {
                p = queue.poll();
                count += p.flag;
            }
            max = Math.max(count, max);
        }
        return max;
    }

    class Point {
        int x;
        int flag;

        public Point(int x, int flag) {
            this.x = x;
            this.flag = flag;
        }
    }
}


text:
var respecConfig = {
    specStatus: "ED",
    shortName: "vocab-ssn",
    //publishDate:  "2015-05-18",
    //previousPublishDate: "2014-03-27",
    //previousMaturity: "FPWD",
    //previousURI: "http://www.w3.org/TR/2014/WD-tabular-data-model-20140327/",
    edDraftURI: "http://w3c.github.io/sdw/ssn/",
    // lcEnd: "3000-01-01",
    // crEnd: "3000-01-01",
    editors: [
    {
      name: "Kerry Taylor",
      company: "Australian National University",
      companyURL: "https://cecs.anu.edu.au/"
    }, {
			name: "Krzysztof Janowicz",
			company: "University of California, Santa Barbara",
			companyURL: "http://geog.ucsb.edu/"
		}, {
			name: "Danh Le Phuoc",
			company: "Insight Centre for Data Analytics",
			companyURL: "http://www.insight-centre.org/"
		}, {
			name: "Armin Haller",
      company: "Australian National University",
      companyURL: "http://cbe.anu.edu.au/"
		}],
    otherLinks: [
    {
      key: "OGC Document Number",
      data: [
      {
        value: "OGC 16-079"
      }]
      }],
    wg: "Spatial Data on the Web Working Group",
    wgURI: "http://www.w3.org/2015/spatial/",
    wgPublicList: "public-sdw-comments",
    wgPatentURI: "http://www.w3.org/2004/01/pp-impl/75471/status",
    inlineCSS: true,
    noIDLIn: true,
    noLegacyStyle: false,
      logos: [
      {
        src: "http://www.w3.org/Icons/w3c_home",
        alt: "W3C",
        height: "48",
        width: "72",
        url: "http://www.w3.org/"
      },
      {
        src: "http://www.w3.org/2015/01/ogc_logo.jpg",
        alt: "OGC",
        height: "48",
        width: "115",
        url: "http://www.opengeospatial.org/"
      }
      ],
    noRecTrack: false,
    overrideCopyright: "
Copyright © 2015 OGC &  W3C ® (MIT, ERCIM, Keio, Beihang), W3C liability, trademark and document use rules apply.
",

    localBiblio: {
      "GeoJSON":{
        href:"http://geojson.org/geojson-spec.html",
        title:"The GeoJSON Format Specification",
        authors: ["Howard Butler", "Martin Daly", "Allan Doyle", "Sean Gillies", "Tim Schaub", "Christopher Schmidt"],
        date: "16 June 2008"
       },
       "GeoSPARQL":{
        href:"http://www.opengeospatial.org/standards/geosparql",
        title:"GeoSPARQL - A Geographic Query Language for RDF Data",
        authors: ["Matthew Perry", "John Herring"],
        date: "10 September 2012"
       },
       "OM":{
        href:"http://www.opengeospatial.org/standards/om",
        title:"Observations and Measurements (O&M)",
        authors: ["Simon Cox"],
        publisher: "Open Geospatial Consortium",
        date: "2011"
       },
       "SML":{
        href:"http://www.opengeospatial.org/standards/sensorml",
        title:"Sensor Model Language",
        authors: ["Mike Botts", "Alexandre Robin"],
        publisher: "Open Geospatial Consortium",
        date: "2010"
       },
       "SWE":{
        href:"http://www.opengeospatial.org/ogc/markets-technologies/swe",
        title:"Sensor Web Enablement (SWE)",
        publisher: "Open Geospatial Consortium"
       },
       "SSNO": {
         authors: ["Michael Compton", "Payam Barnaghi", "Luis Bermudez", "Raúl García-Castro", "Oscar Corcho", "Simon Cox", "John Graybeal", "Manfred Hauswirth", "Cory Henson", "Arthur Herzog", "Vincent Huang", "Krzysztof Janowicz", "W. David Kelsey", "Danh Le Phuoc", "Laurent Lefort", "Myriam Leggieri", "Holger Neuhaus", "Andriy Nikolov", "Kevin Page", "Alexandre Passant", "Amit Sheth", "Kerry Taylor"],
         title:"The SSN ontology of the W3C semantic sensor network incubator group",
         href:"http://www.sciencedirect.com/science/article/pii/S1570826812000571",
         publisher:"Web Semantics: Science, Services and Agents on the World Wide Web, 17:25-32 ",
         date:"December 2012"
      },
      "DUL":{
         href:"http://ontologydesignpatterns.org/wiki/Ontology:DOLCE+DnS_Ultralite",
         authors: ["Aldo Gangemi"],
         title: "DOLCE+DnS Ultralite (DUL)"
      }
    },
    issueBase: "https://www.w3.org/2015/spatial/track/issues/"
};


text:
Journal de bord

        <input type="checkbox" id="offer-log-postulation" [ngModel]="logbook.getPostulated()" (ngModelChange)="logbook.setPostulated($event)"  />
        Postulation

        <button class="datepicker ui button" data-value="{{logbook.postulationDate}}"  (click)="onEditPostulationDate()">

          {{logbook.getPostulatedDateStr()}}
        </button>

        <input type="checkbox" id="offer-log-sent" [(ngModel)]="logbook.documentsSent"  />
        Envoi du CV et de la lettre de motivation

                Télécharger le CV

                Sauvegarder le CV

                Sauvegarder la lettre

                Sauvegarder la lettre

        <input type="checkbox" id="offer-log-response"  [ngModel]="logbook.getGotAResponse()" (ngModelChange)="logbook.setGotAResponse($event)" />
        Réponse

        <button class="datepicker ui button" data-value="{{logbook.responseDate}}"  (click)="onEditResponseDate()">

          {{logbook.getResponseDateStr()}}
        </button>

            <input type="radio" name="resp-state" checked="checked" (click)="onResponseStatusChange(0)">
            Attente

            <input type="radio" name="resp-state" (click)="onResponseStatusChange(1)">
            Entretien

            <input type="radio" name="resp-state" (click)="onResponseStatusChange(2)">
            Refus

        <input type="checkbox" id="offer-log-backs" [checked]="logbook.applyBacks.length > 0"/>
        Relances

      <button class="ui circular icon button" (click)="onAddApplyBack()">

      </button>

          <pj-apply-back [applyBack]="back" (onEditApplyBack)="onEditApplyBack($event)" (onDeleteApplyBack)="onDeleteApplyBack($event)"></pj-apply-back>

        <input type="checkbox" id="offer-log-notes" [checked]="logbook.note !== ''" />
        Notes

      <textarea  [(ngModel)]="logbook.note" class="log-notes-list"></textarea>

        Rien à afficher

Sélectionnez une offre sauvegardée.


text:
#include "vice.h"

#include <stdio.h>

#include "c64dtvmodel.h"
#include "resources.h"
#include "tui.h"
#include "tuimenu.h"
#include "uic64dtvmodel.h"
#include "vicii.h"

static TUI_MENU_CALLBACK(set_model_callback)
{
    if (been_activated) {
        dtvmodel_set((int)param);
        ui_update_menus();
    }

    /* This way, the "Not Really!" item is always the default one.  */
    *become_default = 0;
    return NULL;
}

static tui_menu_item_def_t c64dtv_model_items[] = {
    { "_Not Really!",
      "Keep the current settings",
      NULL, NULL, 0, TUI_MENU_BEH_CLOSE, NULL, NULL },
    { "--" },
    { "_A: DTV V2 PAL",
      "Configure the emulator to emulate a DTV V2 PAL machine and do a soft RESET",
      set_model_callback, (void *)DTVMODEL_V2_PAL, 0,
      TUI_MENU_BEH_RESUME, NULL, NULL },
    { "_B: DTV V2 NTSC",
      "Configure the emulator to emulate a DTV V2 NTSC machine and do a soft RESET",
      set_model_callback, (void *)DTVMODEL_V2_NTSC, 0,
      TUI_MENU_BEH_RESUME, NULL, NULL },
    { "_C: DTV V3 PAL",
      "Configure the emulator to emulate a DTV V3 PAL machine and do a soft RESET",
      set_model_callback, (void *)DTVMODEL_V3_PAL, 0,
      TUI_MENU_BEH_RESUME, NULL, NULL },
    { "_D: DTV V3 NTSC",
      "Configure the emulator to emulate a DTV V3 NTSC machine and do a soft RESET",
      set_model_callback, (void *)DTVMODEL_V3_NTSC, 0,
      TUI_MENU_BEH_RESUME, NULL, NULL },
    { "_E: Hummer NTSC",
      "Configure the emulator to emulate a Hummer NTSC machine and do a soft RESET",
      set_model_callback, (void *)DTVMODEL_HUMMER_NTSC, 0,
      TUI_MENU_BEH_RESUME, NULL, NULL },
    { NULL }
};

void uic64dtvmodel_init(struct tui_menu *parent_submenu)
{
    tui_menu_t ui_c64dtvmodel_submenu;

    ui_c64dtvmodel_submenu = tui_menu_create("C64DTV model settings", 1);

    tui_menu_add(ui_c64dtvmodel_submenu, c64dtv_model_items);

    tui_menu_add_submenu(parent_submenu, "C64DTV _model settings...",
                         "C64DTV model settings",
                         ui_c64dtvmodel_submenu,
                         NULL, 0,
                         TUI_MENU_BEH_CONTINUE);
}


text:
Package `dnspool` creates a goroutine pool for DNS query to limit the number of
OS threads that will be spawned by the go runtime.

Use godoc to see more details.


text:
/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.SetOperatorNode

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you 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.foundationdb.sql.parser;

import com.foundationdb.sql.StandardException;

/**
 * A SetOperatorNode represents a UNION, INTERSECT, or EXCEPT in a DML statement. Binding and optimization
 * preprocessing is the same for all of these operations, so they share bind methods in this abstract class.
 *
 * The class contains a boolean telling whether the operation should eliminate
 * duplicate rows.
 *
 */

public abstract class SetOperatorNode extends TableOperatorNode
{
    /**
     ** Tells whether to eliminate duplicate rows.  all == TRUE means do
     ** not eliminate duplicates, all == FALSE means eliminate duplicates.
     */
    boolean all;

    OrderByList orderByList;
    ValueNode offset; // OFFSET n ROWS
    ValueNode fetchFirst; // FETCH FIRST n ROWS ONLY

    /**
     * Initializer for a SetOperatorNode.
     *
     * @param leftResult The ResultSetNode on the left side of this union
     * @param rightResult The ResultSetNode on the right side of this union
     * @param all Whether or not this is an ALL.
     * @param tableProperties Properties list associated with the table
     *
     * @exception StandardException Thrown on error
     */

    public void init(Object leftResult,
                     Object rightResult,
                     Object all,
                     Object tableProperties)
            throws StandardException {
        super.init(leftResult, rightResult, tableProperties);
        this.all = ((Boolean)all).booleanValue();

        /* resultColumns cannot be null, so we make a copy of the left RCL
         * for now.  At bind() time, we need to recopy the list because there
         * may have been a "*" in the list.  (We will set the names and
         * column types at that time, as expected.)
         */
        resultColumns = copyResultColumnsFromLeft();
    }

    /**
     * Deep copy of the left result ResultColumnList.
     * @return
     * @throws StandardException
     */
    public ResultColumnList copyResultColumnsFromLeft() throws StandardException {
        return (ResultColumnList) getNodeFactory().copyNode(leftResultSet.getResultColumns(),
                        getParserContext());
    }
    /**
     * Fill this node with a deep copy of the given node.
     */
    public void copyFrom(QueryTreeNode node) throws StandardException {
        super.copyFrom(node);

        SetOperatorNode other = (SetOperatorNode)node;
        this.all = other.all;
        this.orderByList = (OrderByList)getNodeFactory().copyNode(other.orderByList,
                                                                  getParserContext());
        this.offset = (ValueNode)getNodeFactory().copyNode(other.offset,
                                                           getParserContext());
        this.fetchFirst = (ValueNode)getNodeFactory().copyNode(other.fetchFirst,
                                                               getParserContext());
    }

    /**
     * Convert this object to a String.  See comments in QueryTreeNode.java
     * for how this should be done for tree printing.
     *
     * @return This object as a String
     */

    public String toString() {
        return "all: " + all + "\n" +
            super.toString();
    }

    /**
     * Prints the sub-nodes of this object.  See QueryTreeNode.java for
     * how tree printing is supposed to work.
     *
     * @param depth The depth of this node in the tree
     */

    public void printSubNodes(int depth) {
        super.printSubNodes(depth);

        if (orderByList != null) {
            printLabel(depth, "orderByList:");
            orderByList.treePrint(depth + 1);
        }
    }

    public boolean isAll() {
        return all;
    }

    /**
     * @return the operator name: "UNION", "INTERSECT", or "EXCEPT"
     */
    abstract String getOperatorName();

}


text:
package cn.aezo.springboot.oauth2.aiqiyi.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {

    @RequestMapping("/jump")
    public String jump() {
        return "jump";
    }

}


text:
namespace Terrence
{
    interface ITerrenceService
    {
        void Run(string[] args);
    }
}


text:
namespace Microsoft.Data.ConnectionUI
{
	partial class DataConnectionAdvancedDialog
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataConnectionAdvancedDialog));
			this.propertyGrid = new Microsoft.Data.ConnectionUI.DataConnectionAdvancedDialog.SpecializedPropertyGrid();
			this.textBox = new System.Windows.Forms.TextBox();
			this.buttonsTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.okButton = new System.Windows.Forms.Button();
			this.cancelButton = new System.Windows.Forms.Button();
			this.buttonsTableLayoutPanel.SuspendLayout();
			this.SuspendLayout();
			//
			// propertyGrid
			//
			resources.ApplyResources(this.propertyGrid, "propertyGrid");
			this.propertyGrid.CommandsActiveLinkColor = System.Drawing.SystemColors.ActiveCaption;
			this.propertyGrid.CommandsDisabledLinkColor = System.Drawing.SystemColors.ControlDark;
			this.propertyGrid.CommandsLinkColor = System.Drawing.SystemColors.ActiveCaption;
			this.propertyGrid.MinimumSize = new System.Drawing.Size(270, 250);
			this.propertyGrid.Name = "propertyGrid";
			this.propertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.SetTextBox);
			//
			// textBox
			//
			resources.ApplyResources(this.textBox, "textBox");
			this.textBox.Name = "textBox";
			this.textBox.ReadOnly = true;
			//
			// buttonsTableLayoutPanel
			//
			resources.ApplyResources(this.buttonsTableLayoutPanel, "buttonsTableLayoutPanel");
			this.buttonsTableLayoutPanel.Controls.Add(this.okButton, 0, 0);
			this.buttonsTableLayoutPanel.Controls.Add(this.cancelButton, 1, 0);
			this.buttonsTableLayoutPanel.Name = "buttonsTableLayoutPanel";
			//
			// okButton
			//
			resources.ApplyResources(this.okButton, "okButton");
			this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.okButton.MinimumSize = new System.Drawing.Size(75, 23);
			this.okButton.Name = "okButton";
			//
			// cancelButton
			//
			resources.ApplyResources(this.cancelButton, "cancelButton");
			this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cancelButton.MinimumSize = new System.Drawing.Size(75, 23);
			this.cancelButton.Name = "cancelButton";
			this.cancelButton.Click += new System.EventHandler(this.RevertProperties);
			//
			// DataConnectionAdvancedDialog
			//
			this.AcceptButton = this.okButton;
			resources.ApplyResources(this, "$this");
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.CancelButton = this.cancelButton;
			this.Controls.Add(this.buttonsTableLayoutPanel);
			this.Controls.Add(this.textBox);
			this.Controls.Add(this.propertyGrid);
			this.HelpButton = true;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "DataConnectionAdvancedDialog";
			this.ShowIcon = false;
			this.ShowInTaskbar = false;
			this.buttonsTableLayoutPanel.ResumeLayout(false);
			this.buttonsTableLayoutPanel.PerformLayout();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.TextBox textBox;
		private System.Windows.Forms.TableLayoutPanel buttonsTableLayoutPanel;
		private System.Windows.Forms.Button okButton;
		private System.Windows.Forms.Button cancelButton;
		private DataConnectionAdvancedDialog.SpecializedPropertyGrid propertyGrid;

	}
}


text:
package com.emerchantpay.gateway.api.constants;

public class ReminderConstants {
    public static String REMINDERS_CHANNEL_EMAIL = "email";
    public static String REMINDERS_CHANNEL_SMS = "sms";
    public static Integer MIN_ALLOWED_REMINDER_MINUTES = 1;
    public static Integer MAX_ALLOWED_REMINDER_DAYS = 31;
}