text:
package godash

import (
	"encoding/base64"
	"encoding/json"
	"math"
	"net"
	"net/url"
	"regexp"
	"strconv"
	"strings"
	"unicode"
	"unicode/utf8"
)

// IsInRange returns true if value lies between left and right border
func IsInRange(value, left, right float64) bool {
	if left > right {
		left, right = right, left
	}
	return value >= left && value <= right
}

// IsEmail is a constraint to do a simple validation for email addresses, it only check if the string contains "@"
// and that it is not in the first or last character of the string
// https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses
func IsEmail(s string) bool {
	if !strings.Contains(s, "@") || string(s[0]) == "@" || string(s[len(s)-1]) == "@" {
		return false
	}
	return true
}

// IsURL check if the string is an URL.
func IsURL(str string) bool {
	if str == "" || len(str) >= 2083 || len(str) <= 3 || strings.HasPrefix(str, ".") {
		return false
	}
	u, err := url.Parse(str)
	if err != nil {
		return false
	}
	if strings.HasPrefix(u.Host, ".") {
		return false
	}
	if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) {
		return false
	}
	return rxURL.MatchString(str)

}

// IsRequestURL check if the string rawurl, assuming
// it was recieved in an HTTP request, is a valid
// URL confirm to RFC 3986
func IsRequestURL(rawurl string) bool {
	url, err := url.ParseRequestURI(rawurl)
	if err != nil {
		return false //Couldn't even parse the rawurl
	}
	if len(url.Scheme) == 0 {
		return false //No Scheme found
	}
	return true
}

// IsRequestURI check if the string rawurl, assuming
// it was recieved in an HTTP request, is an
// absolute URI or an absolute path.
func IsRequestURI(rawurl string) bool {
	_, err := url.ParseRequestURI(rawurl)
	return err == nil
}

// IsAlpha check if the string contains only letters (a-zA-Z). Empty string is valid.
func IsAlpha(s string) bool {
	for _, v := range s {
		if ('Z' < v || v < 'A') && ('z' < v || v < 'a') {
			return false
		}
	}
	return true
}

//IsUTFLetter check if the string contains only unicode letter characters.
//Similar to IsAlpha but for all languages. Empty string is valid.
func IsUTFLetter(str string) bool {
	for _, v := range str {
		if !unicode.IsLetter(v) {
			return false
		}
	}
	return true

}

// IsAlphanumeric check if the string contains only letters and numbers. Empty string is valid.
func IsAlphanumeric(s string) bool {
	for _, v := range s {
		if ('Z' < v || v < 'A') && ('z' < v || v < 'a') && ('9' < v || v < '0') {
			return false
		}
	}
	return true
}

// IsUTFLetterNumeric check if the string contains only unicode letters and numbers. Empty string is valid.
func IsUTFLetterNumeric(s string) bool {
	for _, v := range s {
		if !unicode.IsLetter(v) && !unicode.IsNumber(v) { //letters && numbers are ok
			return false
		}
	}
	return true
}

// IsNumeric check if the string contains only numbers. Empty string is valid.
func IsNumeric(s string) bool {
	for _, v := range s {
		if '9' < v || v < '0' {
			return false
		}
	}
	return true
}

// IsUTFNumeric check if the string contains only unicode numbers of any kind.
// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid.
func IsUTFNumeric(s string) bool {
	for _, v := range s {
		if unicode.IsNumber(v) == false {
			return false
		}
	}
	return true
}

// IsNegative returns true if value < 0
func IsNegative(value float64) bool {
	return value < 0
}

// IsPositive returns true if value > 0
func IsPositive(value float64) bool {
	return value > 0
}

// IsNonNegative returns true if value >= 0
func IsNonNegative(value float64) bool {
	return value >= 0
}

// IsNonPositive returns true if value <= 0
func IsNonPositive(value float64) bool {
	return value <= 0
}

// IsWhole returns true if value is whole number
func IsWhole(value float64) bool {
	return math.Abs(math.Remainder(value, 1)) == 0
}

// IsNatural returns true if value is natural number (positive and whole)
func IsNatural(value float64) bool {
	return IsWhole(value) && IsPositive(value)
}

// IsUTFDigit check if the string contains only unicode radix-10 decimal digits. Empty string is valid.
func IsUTFDigit(s string) bool {
	for _, v := range s {
		if !unicode.IsDigit(v) {
			return false
		}
	}
	return true
}

// IsHexadecimal check if the string is a hexadecimal number.
func IsHexadecimal(str string) bool {
	return rxHexadecimal.MatchString(str)
}

// IsHexcolor check if the string is a hexadecimal color.
func IsHexcolor(str string) bool {
	return rxHexcolor.MatchString(str)
}

// IsRGBcolor check if the string is a valid RGB color in form rgb(RRR, GGG, BBB).
func IsRGBcolor(str string) bool {
	return rxRGBcolor.MatchString(str)
}

// IsLowerCase check if the string is lowercase. Empty string is valid.
func IsLowerCase(str string) bool {
	if IsNull(str) {
		return true
	}
	return str == strings.ToLower(str)
}

// IsUpperCase check if the string is uppercase. Empty string is valid.
func IsUpperCase(str string) bool {
	if IsNull(str) {
		return true
	}
	return str == strings.ToUpper(str)
}

// IsInt check if the string is an integer. Empty string is valid.
func IsInt(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxInt.MatchString(str)
}

// IsFloat check if the string is a float.
func IsFloat(str string) bool {
	return str != "" && rxFloat.MatchString(str)
}

// IsDivisibleBy check if the string is a number that's divisible by another.
// If second argument is not valid integer or zero, it's return false.
// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero).
func IsDivisibleBy(str, num string) bool {
	f, _ := ToFloat(str)
	p := int64(f)
	q, _ := ToInt(num)
	if q == 0 {
		return false
	}
	return (p == 0) || (p%q == 0)
}

// IsNull check if the string is null.
func IsNull(str string) bool {
	return len(str) == 0
}

// IsByteLength check if the string's length (in bytes) falls in a range.
func IsByteLength(str string, min, max int) bool {
	return len(str) >= min && len(str) <= max
}

// IsUUIDv3 check if the string is a UUID version 3.
func IsUUIDv3(str string) bool {
	return rxUUID3.MatchString(str)
}

// IsUUIDv4 check if the string is a UUID version 4.
func IsUUIDv4(str string) bool {
	return rxUUID4.MatchString(str)
}

// IsUUIDv5 check if the string is a UUID version 5.
func IsUUIDv5(str string) bool {
	return rxUUID5.MatchString(str)
}

// IsUUID check if the string is a UUID (version 3, 4 or 5).
func IsUUID(str string) bool {
	return rxUUID.MatchString(str)
}

// IsCreditCard check if the string is a credit card.
func IsCreditCard(str string) bool {
	r, _ := regexp.Compile("[^0-9]+")
	sanitized := r.ReplaceAll([]byte(str), []byte(""))
	if !rxCreditCard.MatchString(string(sanitized)) {
		return false
	}
	var sum int64
	var digit string
	var tmpNum int64
	var shouldDouble bool
	for i := len(sanitized) - 1; i >= 0; i-- {
		digit = string(sanitized[i:(i + 1)])
		tmpNum, _ = ToInt(digit)
		if shouldDouble {
			tmpNum *= 2
			if tmpNum >= 10 {
				sum += ((tmpNum % 10) + 1)
			} else {
				sum += tmpNum
			}
		} else {
			sum += tmpNum
		}
		shouldDouble = !shouldDouble
	}

	if sum%10 == 0 {
		return true
	}
	return false
}

// IsISBN10 check if the string is an ISBN version 10.
func IsISBN10(str string) bool {
	return IsISBN(str, 10)
}

// IsISBN13 check if the string is an ISBN version 13.
func IsISBN13(str string) bool {
	return IsISBN(str, 13)
}

// IsISBN check if the string is an ISBN (version 10 or 13).
// If version value is not equal to 10 or 13, it will be check both variants.
func IsISBN(str string, version int) bool {
	r, _ := regexp.Compile("[\\s-]+")
	sanitized := r.ReplaceAll([]byte(str), []byte(""))
	var checksum int32
	var i int32
	if version == 10 {
		if !rxISBN10.MatchString(string(sanitized)) {
			return false
		}
		for i = 0; i < 9; i++ {
			checksum += (i + 1) * int32(sanitized[i]-'0')
		}
		if sanitized[9] == 'X' {
			checksum += 10 * 10
		} else {
			checksum += 10 * int32(sanitized[9]-'0')
		}
		if checksum%11 == 0 {
			return true
		}
		return false
	} else if version == 13 {
		if !rxISBN13.MatchString(string(sanitized)) {
			return false
		}
		factor := []int32{1, 3}
		for i = 0; i < 12; i++ {
			checksum += factor[i%2] * int32(sanitized[i]-'0')
		}
		if (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 {
			return true
		}
		return false
	}
	return IsISBN(str, 10) || IsISBN(str, 13)
}

// IsJSON check if the string is valid JSON (note: uses json.Unmarshal).
func IsJSON(str string) bool {
	var js json.RawMessage
	return json.Unmarshal([]byte(str), &js) == nil
}

// IsMultibyte check if the string contains one or more multibyte chars. Empty string is valid.
func IsMultibyte(s string) bool {
	for _, v := range s {
		if v >= utf8.RuneSelf {
			return true
		}
	}

	return IsNull(s)
}

// IsASCII check if the string contains ASCII chars only. Empty string is valid.
func IsASCII(s string) bool {
	for _, v := range s {
		if v >= utf8.RuneSelf {
			return false
		}
	}
	return true
}

// IsPrintableASCII check if the string contains printable ASCII chars only. Empty string is valid.
func IsPrintableASCII(s string) bool {
	for _, v := range s {
		if v < ' ' || v > '~' {
			return false
		}
	}
	return true
}

// IsFullWidth check if the string contains any full-width chars. Empty string is valid.
func IsFullWidth(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxFullWidth.MatchString(str)
}

// IsHalfWidth check if the string contains any half-width chars. Empty string is valid.
func IsHalfWidth(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxHalfWidth.MatchString(str)
}

// IsVariableWidth check if the string contains a mixture of full and half-width chars. Empty string is valid.
func IsVariableWidth(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str)
}

// IsBase64 check if a string is base64 encoded.
func IsBase64(s string) bool {
	if IsNull(s) {
		return false
	}
	_, err := base64.StdEncoding.DecodeString(s)

	return err == nil
}

// IsFilePath check is a string is Win or Unix file path and returns it's type.
func IsFilePath(str string) (bool, int) {
	if rxWinPath.MatchString(str) {
		//check windows path limit see:
		//  http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
		if len(str[3:]) > 32767 {
			return false, Win
		}
		return true, Win
	} else if rxUnixPath.MatchString(str) {
		return true, Unix
	}
	return false, Unknown
}

// IsDataURI checks if a string is base64 encoded data URI such as an image
func IsDataURI(str string) bool {
	dataURI := strings.Split(str, ",")
	if !rxDataURI.MatchString(dataURI[0]) {
		return false
	}
	return IsBase64(dataURI[1])
}

// IsISO3166Alpha2 checks if a string is valid two-letter country code
func IsISO3166Alpha2(str string) bool {
	for _, entry := range ISO3166List {
		if str == entry.Alpha2Code {
			return true
		}
	}
	return false
}

// IsISO3166Alpha3 checks if a string is valid three-letter country code
func IsISO3166Alpha3(str string) bool {
	for _, entry := range ISO3166List {
		if str == entry.Alpha3Code {
			return true
		}
	}
	return false
}

// IsDNSName will validate the given string as a DNS name
func IsDNSName(str string) bool {
	if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
		// constraints already violated
		return false
	}
	return rxDNSName.MatchString(str)
}

// IsDialString validates the given string for usage with the various Dial() functions
func IsDialString(str string) bool {

	if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) {
		return true
	}

	return false
}

// IsIP checks if a string is either IP version 4 or 6.
func IsIP(str string) bool {
	return net.ParseIP(str) != nil
}

// IsPort checks if a string represents a valid port
func IsPort(str string) bool {
	if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 {
		return true
	}
	return false
}

// IsIPv4 check if the string is an IP version 4.
func IsIPv4(str string) bool {
	ip := net.ParseIP(str)
	return ip != nil && strings.Contains(str, ".")
}

// IsIPv6 check if the string is an IP version 6.
func IsIPv6(str string) bool {
	ip := net.ParseIP(str)
	return ip != nil && strings.Contains(str, ":")
}

// IsMAC check if a string is valid MAC address.
// Possible MAC formats:
// 01:23:45:67:89:ab
// 01:23:45:67:89:ab:cd:ef
// 01-23-45-67-89-ab
// 01-23-45-67-89-ab-cd-ef
// 0123.4567.89ab
// 0123.4567.89ab.cdef
func IsMAC(str string) bool {
	_, err := net.ParseMAC(str)
	return err == nil
}

// IsMongoID check if the string is a valid hex-encoded representation of a MongoDB ObjectId.
func IsMongoID(str string) bool {
	return rxHexadecimal.MatchString(str) && (len(str) == 24)
}

// IsLatitude check if a string is valid latitude.
func IsLatitude(str string) bool {
	return rxLatitude.MatchString(str)
}

// IsLongitude check if a string is valid longitude.
func IsLongitude(str string) bool {
	return rxLongitude.MatchString(str)
}

// IsSSN will validate the given string as a U.S. Social Security Number
func IsSSN(str string) bool {
	if str == "" || len(str) != 11 {
		return false
	}
	return rxSSN.MatchString(str)
}

// IsSemver check if string is valid semantic version
func IsSemver(str string) bool {
	return rxSemver.MatchString(str)
}

// IsMatches check if string matches the pattern (pattern is regular expression)
// In case of error return false
func IsMatches(str, pattern string) bool {
	match, _ := regexp.MatchString(pattern, str)
	return match
}

// IsStringMatches checks if a string matches a given pattern.
func IsStringMatches(s string, params ...string) bool {
	if len(params) == 1 {
		pattern := params[0]
		return IsMatches(s, pattern)
	}
	return false
}

// IsStringLength check string's length (including multi byte strings)
func IsStringLength(str string, params ...string) bool {

	if len(params) == 2 {
		strLength := utf8.RuneCountInString(str)
		min, _ := ToInt(params[0])
		max, _ := ToInt(params[1])
		return strLength >= int(min) && strLength <= int(max)
	}

	return false
}


text:
* Fixed issue with values when not found

# 2.0.5 - 2017-10-11
* Fixed issues with latest update

# 2.0.4 - 2017-10-11
* Fixed issue with icons not working together with var

# 2.0.3 - 2017-09-29
* Updated dependecies

# 2.0.2 - 2017-08-23
* Added better detection for variable and color functions
* Updated dependencies

# 2.0.1 = 2017-07-21
* Added color module

# 2.0.0 - 2017-07-19
* Initial release

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8" ?>
<INTERACTIONS>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>82-AVANAFIL.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="AVANAFIL" rxcui="1291301">
<ATC code="G04BE10" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="GRAPEFRUIT (JUICE AND FRUIT)" >
</DRUG>
</DRUG2>
<DESCRIPTION>Increase of the plasma concentrations of the avanafil, with risk of hypotension</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
</INTERACTIONS>


text:
package band.wukong.mz.g.sku;

import band.wukong.mz.g.sku.SkuMoreHelper;
import band.wukong.mz.g.sku.bean.SkuMore;
import com.alibaba.fastjson.JSONArray;
import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * description
 *
 * @author wukong(wukonggg@139.com)
 */
public class SkuMoreHelperTest {

    @Test
    public void convert2Text() {
        List<SkuMore> scmList = new ArrayList<SkuMore>();
        SkuMore scm1 = new SkuMore();
        scm1.setSize("S");  scm1.setCount(3);
        SkuMore scm2 = new SkuMore();
        scm2.setSize("M");  scm2.setCount(3); scm2.setRemark("HOHOHO");
        SkuMore scm3 = new SkuMore();
        scm3.setSize("L");  scm3.setCount(3); scm3.setRemark("HIHIHI");
        scmList.add(scm1);
        scmList.add(scm2);
        scmList.add(scm3);

        String text = SkuMoreHelper.convert2Text(scmList);
        Assert.assertNotNull(text);
        System.out.println(text);
    }

    @Test
    public void convert2ListWhenSave() {
        String text =
            "S###小号###\r\n" +
                "M###中号###哈哈哈哈\r\n" +
                "L###大号###\r\n" +
                "XL###特大号###\r\n" +
                "XXL###超大号###";
        List<SkuMore> scmList = SkuMoreHelper.convert2ListWhenSave(text);
        System.out.println(JSONArray.toJSONString(scmList));
        Assert.assertEquals(5, scmList.size());

    }

}


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import re

from ansible.errors import AnsibleConnectionFailure
from ansible.plugins.terminal import TerminalBase

class TerminalModule(TerminalBase):

    terminal_stdout_re = [
        re.compile(br"[\r\n](?:! )?(?:\* )?(?:\(.*\) )?(?:Slot-\d+ )?(?:VPEX )?\S+\.\d+ (?:[>#]) ?$")
    ]

    terminal_stderr_re = [
        re.compile(br"% ?Error"),
        re.compile(br"% ?Bad secret"),
        re.compile(br"[\r\n%] Bad passwords"),
        re.compile(br"invalid input", re.I),
        re.compile(br"(?:incomplete|ambiguous) command", re.I),
        re.compile(br"connection timed out", re.I),
        re.compile(br"[^\r\n]+ not found"),
        re.compile(br"'[^']' +returned error code: ?\d+"),
        re.compile(br"Bad mask", re.I),
        re.compile(br"% ?(\S+) ?overlaps with ?(\S+)", re.I),
        re.compile(br"[%\S] ?Error: ?[\s]+", re.I),
        re.compile(br"[%\S] ?Informational: ?[\s]+", re.I),
        re.compile(br"%% Invalid .* at '\^' marker.", re.I),
    ]

    def on_open_shell(self):
        try:
            self._exec_cli_command(b'disable clipaging')
        except AnsibleConnectionFailure:
            raise AnsibleConnectionFailure('unable to set terminal parameters')

        try:
            self._exec_cli_command(b'configure cli columns 256')
        except AnsibleConnectionFailure:
            self._connection.queue_message('warning', 'Unable to configure cli columns, command responses may be truncated')


text:
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("Tocsoft.GraphQLCodeGen.Tests")]


text:
namespace net {

// Class which can be configured to implement's TCP's approach of detecting loss
// when 3 nacks have been received for a packet or with a time threshold.
// Also implements TCP's early retransmit(RFC5827).
class NET_EXPORT_PRIVATE GeneralLossAlgorithm : public LossDetectionInterface {
 public:
  // TCP retransmits after 3 nacks.
  static const QuicPacketCount kNumberOfNacksBeforeRetransmission = 3;

  GeneralLossAlgorithm();
  explicit GeneralLossAlgorithm(LossDetectionType loss_type);
  ~GeneralLossAlgorithm() override {}

  LossDetectionType GetLossDetectionType() const override;
  void SetLossDetectionType(LossDetectionType loss_type);

  // Uses |largest_acked| and time to decide when packets are lost.
  void DetectLosses(
      const QuicUnackedPacketMap& unacked_packets,
      QuicTime time,
      const RttStats& rtt_stats,
      QuicPacketNumber largest_newly_acked,
      SendAlgorithmInterface::CongestionVector* packets_lost) override;

  // Returns a non-zero value when the early retransmit timer is active.
  QuicTime GetLossTimeout() const override;

  // Increases the loss detection threshold for time loss detection.
  void SpuriousRetransmitDetected(
      const QuicUnackedPacketMap& unacked_packets,
      QuicTime time,
      const RttStats& rtt_stats,
      QuicPacketNumber spurious_retransmission) override;

  int reordering_shift() const { return reordering_shift_; }

 private:
  LossDetectionType loss_type_;
  QuicTime loss_detection_timeout_;
  // Largest sent packet when a spurious retransmit is detected.
  // Prevents increasing the reordering threshold multiple times per epoch.
  QuicPacketNumber largest_sent_on_spurious_retransmit_;
  // Fraction of a max(SRTT, latest_rtt) to permit reordering before declaring
  // loss.  Fraction calculated by shifting max(SRTT, latest_rtt) to the right
  // by reordering_shift.
  int reordering_shift_;

  DISALLOW_COPY_AND_ASSIGN(GeneralLossAlgorithm);
};

}  // namespace net

#endif  // NET_QUIC_CONGESTION_CONTROL_GENERAL_LOSS_ALGORITHM_H_


text:
dojo.provide("dwa.lv.DominoReadDesign");

dojo.require("dwa.common.commonProperty");
dojo.require("dwa.lv.jsonReadDesign");
dojo.require("dwa.lv.xmlReadDesign");
dojo.require("dwa.lv.globals");
dojo.require("dwa.lv.miscs");
dojo.require("dwa.common.utils");

dojo.declare(
	"dwa.lv.DominoReadDesign",
	null,
{
	url: "",
	type: "json", // "json" or "xml"
	dwa: true,

	viewColumns: "",
	viewColumnsExt: "",
	viewName: "",
	readDesignEx: true,
	showUnreadOnly: "",
	sortByFirstDateColumn: false,
	searchDefaultSortColumn: false,
	showDefaultSort: false,
	updateUnreadOnlyMenu: "",

	constructor: function(/*Object*/args){
		if(args){
			dojo.mixin(this, args);
		}

	    this.oColCache = [];
	},
	_initStore: function(){
		if(this.oDataStore)
			return;
		if(this.type == "json"){
			this.oDataStore = new dwa.lv.jsonReadDesign({
				url: this.url,
				dwa: this.dwa
			});
		}else{
			this.oDataStore = new dwa.lv.xmlReadDesign({
				url: this.url,
				dwa: this.dwa
			});
		}
	},
	fetch: function(listViewWidget){
		this.viewColumns = listViewWidget.viewColumns;
		this.viewName = listViewWidget.viewName;

	    var oPropertyViewName = dwa.common.commonProperty.get(this.viewName);
	    oPropertyViewName.attach(this);
	    dwa.common.commonProperty.get(this.viewColumns + '-internal').attach(this);
	    if(this.showUnreadOnly)
	        dwa.common.commonProperty.get(this.showUnreadOnly).attach(this);
	    this.observeName(oPropertyViewName);
	},
	load: function(sFolder, nSortBy, sFTSearch, sFormName, sDirIndex, fnLoaded ){
	    if (!sFolder)
	        return;

		this._initStore();

		var oQuery = {
			FolderName : sFolder
            ,bReadDesignEx: this.readDesignEx
			,FormName : sFormName || ( this.readDesignEx ? "s_ReadDesignEx" : "s_ReadDesign")
		};
        if( typeof sDirIndex != 'undefined' ){ oQuery.sDirIndex = sDirIndex; }
		var oRequest = {
			oRequest : oRequest
			,sProperty : this.viewColumns + '-internal'
			,sFolder : sFolder
			,nSortBy : nSortBy
			,bSortByFirstDateColumn : this.sortByFirstDateColumn
			,bSearchDefaultSortColumn : this.searchDefaultSortColumn
			,sFTSearch : sFTSearch
			,oColCache : this.oColCache
			,bShowDefaultSort : this.showDefaultSort
			,oDataStore : this.oDataStore
			,oClass : this
			,fnCallback : fnLoaded || this.loaded
			,oQuery : oQuery
		};
		this.oDataStore.load(oRequest);
	},
	loaded: function(oRequest){
	    var oViewDesignRoot = this.oDataStore.getDesignRoot(oRequest);
	    if (!oViewDesignRoot ) {
	        dwa.lv.globals.get().oStatusManager.addEntry(3, '', dwa.lv.globals.get().oStrings.sLoadingDataComplete);
	        return;
	    }

	    var aAllCols = this.parseDesign(oRequest, oRequest.bSoftDeleteDisabled ? 1 : 0, '', oRequest.sWho, oRequest.sAltWho, oRequest.sFolder, oRequest.bShowDefaultSort, oRequest.aShowHiddenColNames);
	    var aCols=[];
	    for( var i=0,j=0,iMax=(aAllCols?aAllCols.length:0); i<iMax; i++ ){
	        if( !aAllCols[i].bHidden )
	            aCols[j++] = aAllCols[i];
	    }

	    aCols.sFolder = oRequest.sFolder;
	    aCols.nDefaultSortBy = oRequest.bSearchDefaultSortColumn ? this.getFirstSortColumn(aCols) : this.getFirstDateColumn(aCols);
	    var nDefaultSortBy = -1;
	    if(oRequest.bSortByFirstDateColumn)
	        nDefaultSortBy = aCols.nDefaultSortBy;
	    aCols.nSortBy = isNaN(oRequest.nSortBy) ? nDefaultSortBy : oRequest.nSortBy;
	    aCols.sFTSearch = oRequest.sFTSearch;
	    aCols.sStartKey = '';
	    aCols.sUntilKey = '';
	    aCols.bIncludeUntilKey = false;
	    aCols.sIMColName = aAllCols.sIMColName;

	    aCols.bShowUnreadOnly = false;
	    var oViewDesignExRoot = this.oDataStore.getDesignExRoot(oRequest);
	    if(oViewDesignExRoot) {
	        var sNameVLColInfo = this.oDataStore.getAttributeString(oViewDesignExRoot, 'vlcolinfo_name');
	        var sVLColInfo = this.oDataStore.getAttributeString(oViewDesignExRoot, 'vlcolinfo');
	        if(sNameVLColInfo)
	            dwa.lv.miscs.getNotesListViewProfileCache().set(sNameVLColInfo, sVLColInfo);

	        var sNameMLSortBy = this.oDataStore.getAttributeString(oViewDesignExRoot, 'mlsortby_name');
	        var sMLSortBy = this.oDataStore.getAttributeString(oViewDesignExRoot, 'mlsortby');
	        if(sNameMLSortBy)
	            dwa.lv.miscs.getNotesListViewProfileCache().set(sNameMLSortBy, sMLSortBy);
	        aCols.nSortBy = sMLSortBy!='' ? parseInt(sMLSortBy) : aCols.nSortBy;

	        var sNameMLOptions = this.oDataStore.getAttributeString(oViewDesignExRoot, 'mloptions_name');
	        var sMLOptions = this.oDataStore.getAttributeString(oViewDesignExRoot, 'mloptions');
	        if(sNameMLOptions)
	            dwa.lv.miscs.getNotesListViewProfileCache().set(sNameMLOptions, sMLOptions);
	        aCols.bShowUnreadOnly = sMLOptions.indexOf('U')!=-1;

	        aCols.bIsFolder = (this.oDataStore.getAttributeString(oViewDesignExRoot, 'isfolder') == '1');

	        if(oRequest.sPropertyToUpdateMenu)
	            dwa.common.commonProperty.get(oRequest.sPropertyToUpdateMenu).setValue(aCols.bShowUnreadOnly);
	    }

	    if (aCols.nSortBy==-1 || aCols.nSortBy==aCols.nDefaultSortBy)
	        aCols.nSortBy = nDefaultSortBy;

	    dwa.common.commonProperty.get(oRequest.sProperty).setValue(aCols);
	},
	parseDesign: function(oRequest,bTrash,sIMColName,sWho,sAlt,sViewName,bShowDefaultSort/*=true*/,aShowHiddenColNames){

	    if (typeof(bShowDefaultSort)=='undefined'){ bShowDefaultSort=true;}

	    var d,k,i,iMax,oDesign,aNodes,aCols,bViewSort,nSTCol=-1;

	    // create an array to hold a design collection
	    aCols = [];

	    var oDesign = this.oDataStore.getDesignRoot(oRequest);

	    // get rowlines attr from design element.
	    var nRowLines = this.oDataStore.getAttributeInt(oDesign, 'rowlines');
	    var bAltWhoExists = false;

	    // get the collection of column elements
	    aNodes = this.oDataStore.getColumns(oRequest);
	    if (!aNodes){ return; }

	    // get the number of columns
	    // iMax = Math.max(0,oDesign.getAttribute("columns"));
	    iMax = this.oDataStore.getLength(aNodes);

	    // k represents physical column in view
	    k = 0;
	    // d represents the xml data column
	    d = 0;

	    // used for tracking the first sorted column in a view
	    bViewSort = false;

	    if (bTrash){
	        // Define column 0 object for displaying trash icon
	        aCols[k] = { nWidth:20, bChars:false, bFixed:true, bIsIcon:true, nXmlCol:-1, bIsTrash:true };
	        k++;
	    }

	    var nColWho = -1;
	    var nColAlt = -1;

	    for (i=0; i < iMax; i++){
	        var colDesign = this.oDataStore.getItem(aNodes, i);
	        var bSortA    = false;
	        var bSortD    = false;
	        var bFixed    = true;
	        var bIsIcon   = false;
	        var nWidth    = 0;
	        var bChars    = true;
	        var sTitle    = "";
	        var sHiddenTitle = "";
	        var nFormat   = 2;
	        var bTwistie  = false;
	        var iColSort  = 0;
	        var iViewSort = 0;

	        // resizeable?
	        bFixed = !this.oDataStore.getAttributeBoolean(colDesign, "resize");

	        // width?
	        nWidth = this.oDataStore.getAttributeInt(colDesign, "width");
	        // If col width is zero and column is fixed, treat it as hidden
	        if (0 == nWidth && bFixed){
	            d++; continue;
	        }
	        else {
	            // "Designer" allows the user to specify the number of characters
	            //  each view column should display.  this info is translated to
	            //  pixels by the Domino XML generator.  The code below is an attempt
	            //  to recreate the intended char width specified by the designer.
	            // XML design data seems to indicate a size of 8 pixels per character
	            nWidth = Math.ceil(nWidth/8);
	        }

	        // column title
	        sTitle = this.oDataStore.getAttributeString(colDesign, "title");
	        sHiddenTitle = this.oDataStore.getAttributeString(colDesign, "hiddentitle");

	        // icon?
	        bIsIcon = this.oDataStore.getAttributeBoolean(colDesign, "icon");
	        // icons are fixed width even if it says we can resize
	        //  -> unless the column has a title
	        if (bIsIcon && 0==sTitle.length) {
	            // #YHAO6MG627: it set icon column size when notes column design over D_IconColumnWidth.
	            bFixed=true;
	            nWidth=Math.max(this.oDataStore.getAttributeInt(colDesign, "width"), 20);
	            bChars=false;
	        }

	        // resortable?
	        bSortA = this.oDataStore.getAttributeBoolean(colDesign, "resortascending");
	        bSortD = this.oDataStore.getAttributeBoolean(colDesign, "resortdescending");
	        if (bSortA && bSortD) iColSort = 5;
	        else if (bSortA)      iColSort = 2;
	        else if (bSortD)      iColSort = 1;

	        // first sorted column in view
	        //  If the column can be resorted, make sure that the resort indication makes sense.
	        if (!bViewSort){
	            // is this column part of the view's primary sort?
	            bViewSort = this.oDataStore.getAttributeBoolean(colDesign, "sort");

	            // overwrite sort value for some special columns
	            // YCDL78VA6D:  draft does not sort the column "date" ascending as the preference set.
	            if(sViewName == "($Drafts)" && this.oDataStore.getAttributeString(colDesign, "name") == '$86')
	                bViewSort = false;

	            if (bViewSort){
	                // ascending or descending?
	                if (this.oDataStore.getAttributeBoolean(colDesign, "sortdescending"))
	                    iViewSort = 1;
	                else
	                    iViewSort = 2;

	                // do we need to fix up the "resort" indication?
	                if (iColSort==iViewSort){
	                    // some knucklehead set the view sorting to "ascending",
	                    //  and then set the "click to resort" to "ascending" also.
	                    //  (this only matters for the first column)
	                    //  attempt to fix the mistake
	                    //  the designer really meant to resort descending ... opposite of the view's sort
	                    iColSort=2==iColSort?4:3;
	                }
	                else
	                // do we need to show a sort indication?
	                if (0==iColSort && bShowDefaultSort){
	                    iColSort=iViewSort;
	                }
	            }
	        }

	        // store attribs in visible & exposed hidden column array
	        aCols[k] = {
	            nWidth:nWidth
	            ,bChars:bChars
	            ,bFixed:bFixed
	            ,bIsIcon:bIsIcon
	            ,nXmlCol:parseInt(this.oDataStore.getAttributeString(colDesign, "columnnumber"))
	            ,bSort:iColSort
	            ,sTitle:sTitle
	            ,sHiddenTitle:sHiddenTitle
	            ,sName:this.oDataStore.getAttributeString(colDesign, "name")
	            ,iViewSort:iViewSort
	            ,nDigits:0
	            ,bIsName:this.oDataStore.getAttributeBoolean(colDesign, "isname")
	            ,bExtend:this.oDataStore.getAttributeBoolean(colDesign, "extendcolwidth")
	            ,sNumFormat:''
	            ,bBytes:false
	            ,bOmitThisYear:false

	            ,bHidden:this.oDataStore.getAttributeBoolean(colDesign, "hidden")
	            ,bTwistie:this.oDataStore.getAttributeBoolean(colDesign, "twistie")
	            ,nFormat:this.oDataStore.getAttributeInt(colDesign, "format")
	            ,bResponse:this.oDataStore.getAttributeBoolean(colDesign, "response")
	            ,sNarrowDisplay:this.oDataStore.getAttributeString(colDesign, "narrowdisplay")
	            ,nSequenceNumber:isNaN(parseInt(this.oDataStore.getAttributeString(colDesign, "sequence"))) ? 1 : parseInt(this.oDataStore.getAttributeString(colDesign, "sequence"))
	            ,bBeginWrapUnder:this.oDataStore.getAttributeBoolean(colDesign, "beginwrapunder")
	        };

	        if(aShowHiddenColNames && dwa.common.utils.indexOf(aShowHiddenColNames, aCols[k].sName)!=-1 && aCols[k].bHidden)
	            aCols[k].visible = true;

	        if(sWho == aCols[k].sName)
	            nColWho = k;
	        if(sAlt == aCols[k].sName)
	            nColAlt = k;

	        // overwrite hidden value for some special columns
	        if(sViewName == "$ThreadsEmbed" && aCols[k].sName == '$ThreadsEmbed')
	            aCols[k].bHidden = true;

	        // If name column, look for two other attributes
	        if( dwa.lv.globals.get().oSettings.bLiveNames){
	            // With DWA we show status presently only on leftmost column so as not to
	            //  interfere with selection
	            if( sIMColName && (sIMColName == aCols[k].sName || sIMColName == aCols[k].sTitle) ){
	                aCols[k].sIMColName = sIMColName;
	            }
	            else if( this.oDataStore.getAttributeBoolean(colDesign, "imstatus") ){
	                var s = this.oDataStore.getAttributeString(colDesign, "imcolumnname");
	                aCols[k].sIMColName = s ? s : aCols[k].sName;
	                sIMColName = aCols[k].sIMColName;
	            }
	        }

	        // overwrite format value for some special columns
	        var oMap = {
	            "($Follow-Up)": '$114',
	            "($SoftDeletions)": '$107',
	            "Threads": '$13'
	        };

	        for (var s in oMap) {
	            if (sViewName == s && aCols[k].sName == oMap[s]) {
	                aCols[k].nFormat = 3;
	                break;
	            }
	        }

	        if (aCols[k].nFormat){
	            // For date-time columns, retrieve the date-time format
	            // now always try to get the date-time format because the Time column has the format=2
	            // -waiho 5/1/03
	            var oDTFmtNode = this.oDataStore.getDatetimeFormat(colDesign);
	            var sDTFmt = this.oDataStore.getAttributeString(oDTFmtNode, "show");
	            aCols[k].nDTFmt = (sDTFmt == "datetime" ? 7 :0);
	            aCols[k].bTimeOnly = (sDTFmt == "time" ? true: false);
	            aCols[k].bOmitThisYear = dwa.lv.globals.get().oSettings.bOmitThisYear && this.oDataStore.getAttributeBoolean(oDTFmtNode, "omitthisyear");
	        }

	        // append NUMBER format ... needed for SIZE column
	        var oFmtNode = this.oDataStore.getNumberFormat(colDesign);
	        var sFmt    = this.oDataStore.getAttributeString(oFmtNode, "digits");
	        var bVaries = this.oDataStore.getAttributeBoolean(oFmtNode, "varying");
	        if( bVaries )
	            aCols[k].nDigits = -1;
	        else
	            aCols[k].nDigits = parseInt(sFmt,10);

	        aCols[k].sNumFormat = this.oDataStore.getAttributeString(oFmtNode, "format");
	        aCols[k].bBytes = this.oDataStore.getAttributeBoolean(oFmtNode, "bytes");

	        this.parseSpecialAttrs(aCols[k], colDesign);

	        // overwrite special attributes for some columns
	        if(sViewName == "Threads") {
	            switch(aCols[k].sName) {
	            case '$86':
	                aCols[k].nHeaderIcon = 130;
	                aCols[k].bShowGradientColor = true;
	                break;
	            case '$Importance':
	                aCols[k].nHeaderIcon = 150;
	                aCols[k].bAlignGradientColor = true;
	                aCols[k].bThinColumn = true;
	                aCols[k].bFixed = true;
	                aCols[k].nWidth = 6;
	                aCols[k].bChars = false;
	                break;
	            case '$ToStuff':
	                aCols[k].nHeaderIcon = 184;
	                break;
	            case '$32':
	                aCols[k].nHeaderIcon = 5;
	                break;
	            case '$109':
	                aCols[k].nHeaderIcon = 182;
	                break;
	            }
	        }

	        // change response column to normal hidden column to use Notebook view as flat view
	        if(sViewName == "($Journal)") {
	            switch(aCols[k].sName) {
	            case '$51':
	                aCols[k].hide = true;
	                aCols[k].bResponse = false;
	                aCols[k].bTwistie = false;
	                break;
	            case '$52':
	                aCols[k].bTwistie = false;
	                break;
	            }
	        }

	        // advance column counter
	        k++;
	    }

	    if(nColWho != -1 && nColAlt != -1)
	    {
	        aCols[nColWho].hide = true;
	        aCols[nColAlt].visible = true;
	        bAltWhoExists = true;
	    }

	    // Remove awareness flag from secondary awareness column for Junk Mail view
	    var bIsFirstIMCol = true;
	    for(var i=0;sIMColName && i<aCols.length;i++) {
	        if(aCols[i].sIMColName == sIMColName && aCols[i].sName != sIMColName && !aCols[i].bHidden) {
	            if(!bIsFirstIMCol)
	                aCols[i].sIMColName = '';
	            bIsFirstIMCol = false;
	        }
	    }

	    for( var i=0,nHidden=0,nIMCol=0,nHide=0,v=0,iMax=aCols.length; i<iMax; i++ ){
	        var nOrgHidden = aCols[i].bHidden;
	        if( ((!aCols[i].bHidden || aCols[i].visible) && !aCols[i].hide) || aCols[i].bUnhideWhenWrapped ){
	            aCols[i].bHidden = false;
	            if(nHidden) aCols[i].nXmlCol -= nHidden;
	            // nSortCol property to keeps track of the available XML columns for sorting purposes (Next/Previous navigation)
	            aCols[i].nSortCol = aCols[i].nXmlCol; // for Navigate
	            aCols[i].nSortColForPrint = aCols[i].nSortCol - nHide; // for Print
	            if(aCols[i].bUnhideWhenWrapped) {
	                nHide++;
	                nHidden++;
	            }
	        }
	        else
	        {
	            aCols[i].bHidden = true;
	            // We're eliminating this hidden column (need to fixup the nXmlCol value for
	            //  all following columns)
	            if( aCols[i].sName == sIMColName && dwa.lv.globals.get().oSettings.bLiveNames ) // for Navigation
	                // never used. just to not increment nHidden
	                nIMCol++;
	            else if(aCols[i].hide) // for Print
	                nHide++;
	            else
	                nHidden++;
	        }
	    }
	    aCols.nRowLines = nRowLines;
	    aCols.sIMColName = sIMColName;
	    aCols.bAltWhoExists = bAltWhoExists;

	    return aCols;
	},
	parseSpecialAttrs: function(oCol, oNode){
	    var sAttr = (this.oDataStore.getAttributeString(oNode, "attrs")).replace(/\s/g, '');
	    var asMatch = sAttr.match(/(^|,)\$TypeHeaderIcon=([^,]+)(,|$)/);
	    var sHeaderIcon = asMatch && asMatch[2];
	    if(sHeaderIcon) {
	        var aValues = sHeaderIcon.split(':');
	        var nNum = parseInt(aValues[2]);
	        if(aValues[1]=='colicon1' && !isNaN(nNum))
	            oCol.nHeaderIcon = nNum + 1; //convert 0 base to 1 base
	    }

	    var bThinColumn = !!sAttr.match(/(^|,)\$ThinColumn=true(,|$)/);
	    if (bThinColumn && 0==oCol.sTitle.length) {
	        oCol.bThinColumn = true;
	        oCol.bFixed = true;
	        oCol.nWidth = 6;
	        oCol.bChars = false;
	    }

	    oCol.bShowGradientColor = !!sAttr.match(/(^|,)\$ShowGradientColor=true(,|$)/i);
	    oCol.bAlignGradientColor = !!sAttr.match(/(^|,)\$AlignGradientColor=true(,|$)/);
	    oCol.bUnhideWhenWrapped = !!sAttr.match(/(^|,)\$UnhideWhenWrapped=true(,|$)/);
	},
	getFirstDateColumn: function(aCols){
	    // set a global var for the first date column
	    if(aCols){
	        if(window.s_ViewName=="Threads"){
	            for(var i=0,i$=aCols.length;i<i$;i++){
	                if(0!=aCols[i].iViewSort){
	                    aCols[i].nFormat = 3;
	                    return i;
	                }
	            }
	        }else{
	            for(var i=0,i$=aCols.length;i<i$;i++){
	                if(1==aCols[i].nFormat)return i;
	            }
	        }
	    }
	    return -1;
	},
	getFirstSortColumn: function(aCols){
	    // set a global var for the first sort column
	    if(aCols){
	        for(var i=0,i$=aCols.length;i<i$;i++)
	            if(aCols[i].bSort != 0)return i;
	    }
	    return -1;
	},
	observeLoadedDesign: function(oProperty){
	    this.oCols = oProperty.vValue;
	    this.oColCache[this.oCols.sFolder] = this.oCols;
	    if(this.viewColumnsExt)
	        dwa.common.commonProperty.get(this.viewColumnsExt).setValue(this.oCols);
	    else
	        dwa.common.commonProperty.get(this.viewColumns).setValue(this.oCols);
	},
	observe: function(oProperty){
	    if (!oProperty.isLatest())
	        return;

	    if (oProperty.sName == this.viewName)
	        this.observeName(oProperty);
	    else if (oProperty.sName == this.viewColumns + '-internal')
	        this.observeLoadedDesign(oProperty);
	    else if (oProperty.sName == this.showUnreadOnly)
	        this.observeShowUnreadOnly(oProperty);
	},
	observeName: function(oProperty){
	    if (!oProperty.vValue)
	        return;

	    var sFolder = oProperty.vValue.split('|')[0];
	    var nSortBy = parseInt(oProperty.vValue.split('|')[1]);
	    if(this.oColCache[sFolder]) {
	        this.oCols = this.oColCache[sFolder];
	        if(!isNaN(nSortBy))
	            this.oCols.nSortBy = nSortBy;
	        if(this.readDesignEx && this.updateUnreadOnlyMenu)
	            dwa.common.commonProperty.get(this.updateUnreadOnlyMenu).setValue(this.oCols.bShowUnreadOnly);
	        if(this.viewColumnsExt)
	            dwa.common.commonProperty.get(this.viewColumnsExt).setValue(this.oCols);
	        else
	            dwa.common.commonProperty.get(this.viewColumns).setValue(this.oCols);
	    }
	    else
	        this.load(sFolder, nSortBy);
	},
	observeShowUnreadOnly: function(oProperty){
	    this.oCols.bShowUnreadOnly = oProperty.vValue;

	    var sFldName = "MLOptions" + this.oCols.sFolder.replace(/[  $\(\)]/g,'_');
	    var sValue = dwa.lv.miscs.getNotesListViewProfileCache().get(sFldName);
	    sValue = sValue.replace(/U/g, '') + (this.oCols.bShowUnreadOnly ? 'U' : '');
	    dwa.lv.miscs.getNotesListViewProfileCache().set(sFldName, sValue, true, this.sId);

	    if(this.readDesignEx && this.updateUnreadOnlyMenu)
	        dwa.common.commonProperty.get(this.updateUnreadOnlyMenu).setValue(this.oCols.bShowUnreadOnly);

	    if(this.viewColumnsExt)
	        dwa.common.commonProperty.get(this.viewColumnsExt).setValue(this.oCols);
	    else
	        dwa.common.commonProperty.get(this.viewColumns).setValue(this.oCols);
	}
});


text:
package modi;

public abstract class LayoutModus extends Modus {
	public abstract void runLayout();

}


text:
require 'indifferent_access'

module Rho
  module RhoSupport

    USE_BBSQLITE = System.get_property('platform') == 'Blackberry' && System.get_property('os_version')[0].to_i() >= 5

    class << self

      def url_encode(s)
#        s.to_s.dup.force_encoding("ASCII-8BIT").gsub(/[^a-zA-Z0-9_\-.]/n) {
#          sprintf("%%%02X", $&.unpack("C")[0])
#        }
        s.to_s.gsub(/[^a-zA-Z0-9_\-.]/n) do
            us = $&
            tmp = ''
            us.each_byte do |uc|
              tmp << sprintf('%%%02X', uc)
            end
            tmp
        end.force_encoding("ASCII-8BIT")

      end
      #def url_decode(s)
      #  s.tr('+',' ').gsub(/((?:%[0-9a-fA-f]{2})+)/n) do
      #    [$1.delete('%')].pack('H*')
      #  end
      #end

      def binary_encode(str)
        return str unless USE_BBSQLITE

        str.binary_encode
      end

      def binary_decode(str)
        return str unless USE_BBSQLITE

        str.binary_decode
      end

     # def _unescape(str, regex) str.gsub(regex){ $1.hex.chr } end
      def url_decode(str)
        _url_decode(str, /((?:%[0-9a-fA-f]{2})+)/n)
      end

      def _url_decode(str, regex)
        return str if str.nil? || str.length() == 0

        isEncoded = false
        res = str.tr('+',' ').gsub(regex) {
          isEncoded = true
          #[$&[1, 2].hex].pack('C')
          [$1.delete('%')].pack('H*')
        }
        if isEncoded
            res.force_encoding("ASCII-8BIT") #need for BB since Java string is UTF16
            res.force_encoding('UTF-8')
        end

        res
      end

      #ESCAPED = /%([0-9a-fA-F]{2})/

      #def unescape_form(str)
      #  _unescape(str.gsub(/\+/, " "), ESCAPED)
      #end
      def form_decode(str)
        _url_decode(str, /%([0-9a-fA-F]{2})/)
      end

      def parse_query_parameters(query_string)
        return {} if query_string.nil?

        pairs = query_string.split('&').collect do |chunk|
          next if !chunk || chunk.empty?
          key, value = chunk.split('=', 2)
          next if !key || key.empty?
          value = value.nil? ? nil : form_decode(value)
          [ form_decode(key), value ]
        end.compact

        UrlEncodedPairParser.new(pairs).result
      end

      def query_params(req)
        params = {}
        unless req['id'].nil?
          params['id'] = req['id']
        end
        unless req['request-query'].nil? or req['request-query'].length == 0
          params.merge!(parse_query_parameters(req['request-query']))
        end
        unless req['headers'].nil? or req['headers']['Content-Type'].nil?
          unless req['headers']['Content-Type'].index('application/x-www-form-urlencoded').nil?
            params.merge!(parse_query_parameters(req['request-body']))
          end
        end

        skip_params = Rho::RhoConfig.log_skip_post
        if skip_params.to_s != 'true' && skip_params.to_s != '1'
            puts "Params: " + params.to_s unless params.empty?
        end

        params
      end
    end

    class UrlEncodedPairParser < StringScanner #:nodoc:
      attr_reader :top, :parent, :result

      def initialize(pairs = [])
        super('')
        @result = {}
        pairs.each { |key, value| parse(key, value) }
      end

      KEY_REGEXP = %r{([^\[\]=&]+)}
      BRACKETED_KEY_REGEXP = %r{\[([^\[\]=&]+)\]}

      # Parse the query string
      def parse(key, value)
        self.string = key
        @top, @parent = result, nil

        # First scan the bare key
        key = scan(KEY_REGEXP) or return
        key = post_key_check(key)

        # Then scan as many nestings as present
        until eos?
          r = scan(BRACKETED_KEY_REGEXP) or return
          key = self[1]
          key = post_key_check(key)
        end

        bind(key, value)
      end

      private
      # After we see a key, we must look ahead to determine our next action. Cases:
      #
      #   [] follows the key. Then the value must be an array.
      #   = follows the key. (A value comes next)
      #   & or the end of string follows the key. Then the key is a flag.
      #   otherwise, a hash follows the key.
      def post_key_check(key)
        if scan(/\[\]/) # a[b][] indicates that b is an array
          container(key, Array)
          nil
        elsif check(/\[[^\]]/) # a[b] indicates that a is a hash
          container(key, Hash)
          nil
        else # End of key? We do nothing.
          key
        end
      end

      # Add a container to the stack.
      def container(key, klass)
        type_conflict! klass, top[key] if top.is_a?(Hash) && top.key?(key) && ! top[key].is_a?(klass)
        value = bind(key, klass.new)
        type_conflict! klass, value unless value.is_a?(klass)
        push(value)
      end

      # Push a value onto the 'stack', which is actually only the top 2 items.
      def push(value)
        @parent, @top = @top, value
      end

      # Bind a key (which may be nil for items in an array) to the provided value.
      def bind(key, value)
        if top.is_a? Array
          if key
            if top[-1].is_a?(Hash) && ! top[-1].key?(key)
              top[-1][key] = value
            else
              top << {key => value}.with_indifferent_access
              push top.last
              value = top[key]
            end
          else
            top << value
          end
        elsif top.is_a? Hash
          #key = CGI.unescape(key)
          parent << (@top = {}) if top.key?(key) && parent.is_a?(Array)
          top[key] ||= value
          return top[key]
        else
          raise ArgumentError, "Don't know what to do: top is #{top.inspect}"
        end

        return value
      end

      def type_conflict!(klass, value)
        raise TypeError, "Conflicting types for parameter containers. Expected an instance of #{klass} but found an instance of #{value.class}. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value. (The parameters received were #{value.inspect}.)"
      end
    end

    def self.rhobundle_getfilename()
        File.join( __rhoGetCurrentDir(), '/RhoBundle/upgrade_bundle.zip')
    end

    def self.rhobundle_download(download_url, download_callback)

        file_name = rhobundle_getfilename()
        dir_name = File.dirname(file_name)
        if Dir.exists?(dir_name) && System.delete_folder(dir_name) != 0
            return false
        end

        Dir.mkdir(dir_name) unless Dir.exists?(dir_name)

        Rho::AsyncHttp.download_file(
                 :url => download_url,
                 :filename => file_name,
                 :headers => {},
                 :callback => download_callback ) if download_url

        return true
    end

  end # RhoSupport
end # Rho


text:
/*******************************************************************************
 * \file i2c_slave_interface.c
 *
 * \author MAV'RIC Team
 * \author sfx
 *
 * \brief
 *
 ******************************************************************************/

#include "i2c_slave_interface.h"
#include "sysclk.h"

#include "twis.h"

#include "radar_module_driver.h"
#include "doppler_radar.h"

int32_t status;

void i2c_slave_interface_handle_twis_receive(uint8_t data){
	status=data;
}

uint8_t i2c_slave_interface_handle_twis_reply() {
	uint8_t *radar_output= (uint8_t*) get_tracked_target();
	uint8_t ret=radar_output[status];
	status++;
	return ret;
}

void i2c_slave_interface_handle_twis_stop() {

}

void i2c_slave_interface_init(int32_t device_address) {
	twis_options_t twis_options;
		twis_options.pba_hz =sysclk_get_pba_hz(),
		//! The baudrate of the TWI bus.
		twis_options.speed= 400000,
		//! The desired address.
		twis_options.chip=device_address;
		//! smbus mode
		twis_options.smbus=false;
		//! tenbit mode
		twis_options.tenbit=false;

	twis_slave_fct_t twis_functions={
		.rx=&i2c_slave_interface_handle_twis_receive,
		.tx=&i2c_slave_interface_handle_twis_reply,
		.stop=&i2c_slave_interface_handle_twis_stop
	};
	twis_slave_init(&AVR32_TWIS1, &twis_options, &twis_functions);
}


text:
using SteamKit2;

namespace SteamKit2X2.Internal.SteamAPI
{
    internal sealed class ISteamDirectory
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="cellid">Client's Steam cell ID</param>
        /// <remarks>NO KEY</remarks>
        public void GetCMList(uint cellid)
        {
            using (dynamic data = WebAPI.GetInterface("ISteamDirectory", API.AppKey))
            {
                KeyValue items = data.GetCMList(cellid: cellid, l: "english");
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="cellid">Client's Steam cell ID</param>
        /// <param name="maxcount">Max number of servers to return</param>
        /// <remarks>NO KEY</remarks>
        public void GetCMList(uint cellid, uint maxcount)
        {
            using (dynamic data = WebAPI.GetInterface("ISteamDirectory", API.AppKey))
            {
                KeyValue items = data.GetCMList(cellid: cellid, maxcount: maxcount, l: "english");
            }
        }
    }
}


text:
package springfox.documentation.spi.schema;

import org.springframework.plugin.core.Plugin;
import springfox.documentation.spi.DocumentationType;

public interface TypeNameProviderPlugin extends Plugin<DocumentationType> {
    /**
     * Given a class name provides a name for it
     *
     * @param type - class to provide name for
     * @return name
     */
    String nameFor(Class<?> type);
}


text:
<TITLE>Fortran Bindings for Process Topologies</TITLE>

10.12. Fortran Bindings for Process Topologies

Up:  Language Binding
Next:  Fortran Bindings for Environmental Inquiry
Previous:  Fortran Bindings for Groups, Contexts, etc.

 <tt> MPI_CART_CREATE(COMM_OLD, NDIMS, DIMS, PERIODS, REORDER, COMM_CART, IERROR)
 INTEGER COMM_OLD, NDIMS, DIMS(*), COMM_CART, IERROR
LOGICAL PERIODS(*), REORDER
</tt>
 <tt> MPI_DIMS_CREATE(NNODES, NDIMS, DIMS, IERROR)
 INTEGER NNODES, NDIMS, DIMS(*), IERROR
</tt>
 <tt> MPI_GRAPH_CREATE(COMM_OLD, NNODES, INDEX, EDGES, REORDER, COMM_GRAPH, IERROR)
 INTEGER COMM_OLD, NNODES, INDEX(*), EDGES(*), COMM_GRAPH, IERROR
LOGICAL REORDER
</tt>
 <tt> MPI_TOPO_TEST(COMM, STATUS, IERROR)
 INTEGER COMM, STATUS, IERROR
</tt>
 <tt> MPI_GRAPHDIMS_GET(COMM, NNODES, NEDGES, IERROR)
 INTEGER COMM, NNODES, NEDGES, IERROR
</tt>
 <tt> MPI_GRAPH_GET(COMM, MAXINDEX, MAXEDGES, INDEX, EDGES, IERROR)
 INTEGER COMM, MAXINDEX, MAXEDGES, INDEX(*), EDGES(*), IERROR
</tt>
 <tt> MPI_CARTDIM_GET(COMM, NDIMS, IERROR)
 INTEGER COMM, NDIMS, IERROR
</tt>
 <tt> MPI_CART_GET(COMM, MAXDIMS, DIMS, PERIODS, COORDS, IERROR)
 INTEGER COMM, MAXDIMS, DIMS(*), COORDS(*), IERROR
LOGICAL PERIODS(*)
</tt>
 <tt> MPI_CART_RANK(COMM, COORDS, RANK, IERROR)
 INTEGER COMM, COORDS(*), RANK, IERROR
</tt>
 <tt> MPI_CART_COORDS(COMM, RANK, MAXDIMS, COORDS, IERROR)
 INTEGER COMM, RANK, MAXDIMS, COORDS(*), IERROR
</tt>
 <tt> MPI_GRAPH_NEIGHBORS_COUNT(COMM, RANK, NNEIGHBORS, IERROR)
 INTEGER COMM, RANK, NNEIGHBORS, IERROR
</tt>
 <tt> MPI_GRAPH_NEIGHBORS(COMM, RANK, MAXNEIGHBORS, NEIGHBORS, IERROR)
 INTEGER COMM, RANK, MAXNEIGHBORS, NEIGHBORS(*), IERROR
</tt>
 <tt> MPI_CART_SHIFT(COMM, DIRECTION, DISP, RANK_SOURCE, RANK_DEST, IERROR)
 INTEGER COMM, DIRECTION, DISP, RANK_SOURCE, RANK_DEST, IERROR
</tt>
 <tt> MPI_CART_SUB(COMM, REMAIN_DIMS, NEWCOMM, IERROR)
 INTEGER COMM, NEWCOMM, IERROR
LOGICAL REMAIN_DIMS(*)
</tt>
 <tt> MPI_CART_MAP(COMM, NDIMS, DIMS, PERIODS, NEWRANK, IERROR)
 INTEGER COMM, NDIMS, DIMS(*), NEWRANK, IERROR
LOGICAL PERIODS(*)
</tt>
 <tt> MPI_GRAPH_MAP(COMM, NNODES, INDEX, EDGES, NEWRANK, IERROR)
 INTEGER COMM, NNODES, INDEX(*), EDGES(*), NEWRANK, IERROR
</tt>

Up:  Language Binding
Next:  Fortran Bindings for Environmental Inquiry
Previous:  Fortran Bindings for Groups, Contexts, etc.

Return to MPI 1.1 Standard Index

Return to MPI-2 Standard Index

Return to MPI Forum Home Page

MPI-1.1 of June 12, 1995

HTML Generated on August 6, 1997


text:
/*
 * @author Jean Lazarou
 * Date: June 3, 2004
 */
package com.ap.straight.types;

import java.math.BigDecimal;

import com.ap.straight.util.DateFactory;
import com.ap.straight.util.SelectTestCase;

public class TestSelectWhereLower extends SelectTestCase {

	public void testStringField() throws Exception {

		addStringTable();

		select("'C'", '<');
		verify("A", "B");

	}

	public void testIntegerField() throws Exception {

		addIntegerTable();

		select("3", '<');
		verify(new Integer(1));

	}

	public void testIntField() throws Exception {

		addIntTable();

		select("3", '<');
		verify(1);
	}

	public void testDateField() throws Exception {

		addDateTable();

		select("'2002-08-02'", '<');
		verify(DateFactory.newDate(2000, 12, 3), DateFactory.newDate(2001, 1, 8));
	}

	public void testBigDecimalField() throws Exception {

		addBigDecimalTable();

		select("17.573", '<');
		verify(new BigDecimal("11.0"), new BigDecimal("3.876"));
	}
}


text:
package com.hazelcast.client.proxy;

import com.hazelcast.client.impl.protocol.ClientMessage;
import com.hazelcast.client.impl.protocol.codec.SemaphoreAcquireCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreAvailablePermitsCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreDrainPermitsCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreInitCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreReducePermitsCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreReleaseCodec;
import com.hazelcast.client.impl.protocol.codec.SemaphoreTryAcquireCodec;
import com.hazelcast.core.ISemaphore;

import java.util.concurrent.TimeUnit;

/**
 * Proxy implementation of {@link ISemaphore}.
 */
public class ClientSemaphoreProxy extends PartitionSpecificClientProxy implements ISemaphore {

    public ClientSemaphoreProxy(String serviceName, String objectId) {
        super(serviceName, objectId);
    }

    @Override
    public boolean init(int permits) {
        checkNegative(permits);
        ClientMessage request = SemaphoreInitCodec.encodeRequest(name, permits);
        ClientMessage response = invokeOnPartition(request);
        SemaphoreInitCodec.ResponseParameters resultParameters = SemaphoreInitCodec.decodeResponse(response);

        return resultParameters.response;
    }

    @Override
    public void acquire() throws InterruptedException {
        ClientMessage request = SemaphoreAcquireCodec.encodeRequest(name, 1);
        invokeOnPartition(request);
    }

    @Override
    public void acquire(int permits) throws InterruptedException {
        checkNegative(permits);
        ClientMessage request = SemaphoreAcquireCodec.encodeRequest(name, permits);
        invokeOnPartition(request);
    }

    @Override
    public int availablePermits() {
        ClientMessage request = SemaphoreAvailablePermitsCodec.encodeRequest(name);
        ClientMessage response = invokeOnPartition(request);
        SemaphoreAvailablePermitsCodec.ResponseParameters resultParameters
                = SemaphoreAvailablePermitsCodec.decodeResponse(response);
        return resultParameters.response;
    }

    @Override
    public int drainPermits() {
        ClientMessage request = SemaphoreDrainPermitsCodec.encodeRequest(name);
        ClientMessage response = invokeOnPartition(request);
        SemaphoreDrainPermitsCodec.ResponseParameters resultParameters
                = SemaphoreDrainPermitsCodec.decodeResponse(response);
        return resultParameters.response;
    }

    @Override
    public void reducePermits(int reduction) {
        checkNegative(reduction);
        ClientMessage request = SemaphoreReducePermitsCodec.encodeRequest(name, reduction);
        invokeOnPartition(request);
    }

    @Override
    public void release() {
        ClientMessage request = SemaphoreReleaseCodec.encodeRequest(name, 1);
        invokeOnPartition(request);
    }

    @Override
    public void release(int permits) {
        checkNegative(permits);
        ClientMessage request = SemaphoreReleaseCodec.encodeRequest(name, permits);
        invokeOnPartition(request);
    }

    @Override
    public boolean tryAcquire() {
        ClientMessage request = SemaphoreTryAcquireCodec.encodeRequest(name, 1, 0);
        ClientMessage response = invokeOnPartition(request);
        SemaphoreTryAcquireCodec.ResponseParameters resultParameters = SemaphoreTryAcquireCodec.decodeResponse(response);
        return resultParameters.response;
    }

    @Override
    public boolean tryAcquire(int permits) {
        checkNegative(permits);
        try {
            return tryAcquire(permits, 0, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            return false;
        }
    }

    @Override
    public boolean tryAcquire(long timeout, TimeUnit unit) throws InterruptedException {
        if (timeout == 0) {
            return tryAcquire();
        }
        ClientMessage request = SemaphoreTryAcquireCodec.encodeRequest(name, 1, unit.toMillis(timeout));
        ClientMessage response = invokeOnPartition(request);
        SemaphoreTryAcquireCodec.ResponseParameters resultParameters = SemaphoreTryAcquireCodec.decodeResponse(response);
        return resultParameters.response;
    }

    @Override
    public boolean tryAcquire(int permits, long timeout, TimeUnit unit) throws InterruptedException {
        checkNegative(permits);
        ClientMessage request = SemaphoreTryAcquireCodec.encodeRequest(name, permits, unit.toMillis(timeout));
        ClientMessage response = invokeOnPartition(request);
        SemaphoreTryAcquireCodec.ResponseParameters resultParameters = SemaphoreTryAcquireCodec.decodeResponse(response);
        return resultParameters.response;
    }

    private void checkNegative(int permits) {
        if (permits < 0) {
            throw new IllegalArgumentException("Permits cannot be negative!");
        }
    }

    @Override
    public String toString() {
        return "ISemaphore{" + "name='" + name + '\'' + '}';
    }
}


text:
package org.stokesdrift.config;

public enum RuntimeType {
	RUBY,
	CLOJURE,
	JAVA
}


text:
class CreateCoins < ActiveRecord::Migration
  def change
    create_table :coins do |t|
      t.integer :value
      t.integer :year
      t.string :currency
      t.datetime :acquired
      t.text :details
      t.binary :front_face
      t.binary :back_face
      t.integer :collection_id

      t.timestamps null: false
    end
  end
end


text:
#ifndef __SLATE_NCURSES_CONSOLE_H__
#define __SLATE_NCURSES_CONSOLE_H__

#include "env.h"

extern int sc_isAvailable();

extern int sc_enterStructuredMode();
extern int sc_leaveStructuredMode();

extern char *sc_keySequenceOf(char *keyName);

extern int sc_columns();
extern int sc_rows();

extern int sc_write(void *buffer, int size, int start);
extern int sc_clear();
extern int sc_clearToEOS();
extern int sc_clearToEOL();
extern int sc_scroll(int lines);
extern int sc_moveToXY(int x, int y);
extern int sc_nextEvent(int blockingMillisecs);
extern int sc_hasEvent();
extern int sc_flush();
extern int sc_deleteChar();	// delete char and move the rest of the line one left
extern int sc_deleteLines(int lines);
extern int sc_insertLines(int lines);
extern int sc_hideCursor();
extern int sc_showCursor();

extern int sc_maxColorPairs();
extern int sc_initColorPair(int colorPair, int fg, int bg);
extern void sc_setAttributes(int mode, int colorPair);

#endif /* __SLATE_NCURSES_CONSOLE_H__ */


text:
category:
- Transportation
- Parks and recreation
- Locations and mapping
license: http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=4a37e03bb8d1e310VgnVCM10000071d60f89RCRD
maintainer: Open Data Team
maintainer_email: opendata@toronto.ca
notes: A geospatial file that shows where all the trail accesses are located in the
  City of Toronto.
organization: Transportation Services
resources:
- format: ZIP
  name: Bicycle Trail Entrance(WGS84)
  url: http://opendata.toronto.ca/gcc/bicycle_trail_entrance_wgs84.zip
- format: ZIP
  name: Bicycle Trail Entrance(MTM3)
  url: http://opendata.toronto.ca/gcc/bicycle_trail_entrance_mtm3.zip
- format: ''
  name: View Data
  url: http://map.toronto.ca/maps/map.jsp?app=OpenData
source: http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=f27f75b59fe87410VgnVCM10000071d60f89RCRD&vgnextchannel=1a66e03bb8d1e310VgnVCM10000071d60f89RCRD
title: Multi-Use Trail Entrances
---


text:
<!DOCTYPE HTML>

    <title>Welcome to Jekyll!</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="You'll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa..." />
    <meta name="keywords" content="" />

    <link rel="stylesheet" href="/css/syntax.css" />

        <link rel="stylesheet" href="/css/main.css">
        <link rel="stylesheet" href="/css/skel.css"/>
        <link rel="stylesheet" href="/css/style.css" />
        <link rel="stylesheet" href="/css/style-desktop.css" />
        <link rel="stylesheet" href="/css/style-noscript.css" />

    <link rel="canonical" href="http://thetonyho.net/posts/2015/04/13/welcome-to-jekyll/">
    <link rel="alternate" type="application/rss+xml" title="theTonyHo" href="http://thetonyho.net/feed.xml" />

Welcome to Jekyll!

Home

Blog

About

13 Apr 2015

You'll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll's GitHub repo. If you have questions, you can ask them on Jekyll's dedicated Help repository.

Contact

GitHub

Twitter

Instagram

Pinterest

Linkedin

RSS

© theTonyHo. All rights reserved.

Design: HTML5 UP


text:
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using System.Windows.Media.TextFormatting;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Utils;

namespace ICSharpCode.AvalonEdit.Rendering
{
	/// <summary>
	/// Contains information relevant for text run creation.
	/// </summary>
	public interface ITextRunConstructionContext
	{
		/// <summary>
		/// Gets the text document.
		/// </summary>
		TextDocument Document { get; }

		/// <summary>
		/// Gets the text view for which the construction runs.
		/// </summary>
		TextView TextView { get; }

		/// <summary>
		/// Gets the visual line that is currently being constructed.
		/// </summary>
		VisualLine VisualLine { get; }

		/// <summary>
		/// Gets the global text run properties.
		/// </summary>
		TextRunProperties GlobalTextRunProperties { get; }

		/// <summary>
		/// Gets a piece of text from the document.
		/// </summary>
		/// <remarks>
		/// This method is allowed to return a larger string than requested.
		/// It does this by returning a <see cref="StringSegment"/> that describes the requested segment within the returned string.
		/// This method should be the preferred text access method in the text transformation pipeline, as it can avoid repeatedly allocating string instances
		/// for text within the same line.
		/// </remarks>
		StringSegment GetText(int offset, int length);
	}
}


text:
<Record>
<Term>Pathologic Decalcification</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<ParentTerm>Calcium Metabolism Disorders</ParentTerm>
<ParentTerm>Bone Demineralization, Pathologic</ParentTerm>
<ClassificationPath>Musculoskeletal Diseases/Bone Diseases/Bone Diseases, Metabolic/Bone Demineralization, Pathologic/Decalcification, Pathologic</ClassificationPath>
<ClassificationPath>Nutritional and Metabolic Diseases/Metabolic Diseases/Calcium Metabolism Disorders/Decalcification, Pathologic</ClassificationPath>
<BroaderTerm>Decalcification, Pathologic</BroaderTerm>
<BroaderTerm>Metabolic Diseases</BroaderTerm>
<BroaderTerm>Musculoskeletal Diseases</BroaderTerm>
<BroaderTerm>Calcium Metabolism Disorders</BroaderTerm>
<BroaderTerm>Nutritional and Metabolic Diseases</BroaderTerm>
<BroaderTerm>Bone Demineralization, Pathologic</BroaderTerm>
<BroaderTerm>Bone Diseases, Metabolic</BroaderTerm>
<BroaderTerm>Bone Diseases</BroaderTerm>
<Synonym>Pathologic Decalcification</Synonym>
<Synonym>Pathological Decalcification</Synonym>
<Description>The loss of calcium salts from bones and teeth. Bacteria may be responsible for this occurrence in teeth. Old age may be a factor contributing to calcium loss, as is the presence of diseases such as rheumatoid arthritis.</Description>
<Source>MeSH</Source>
</Record>


text:
<?php

namespace common\module\mregion\console\controllers;

use common\extend\jeen\JDebug;
use common\module\mregion\console\controllers\crawl\CityAction;
use common\module\mregion\console\controllers\crawl\CountyAction;
use common\module\mregion\console\controllers\crawl\ProvinceAction;
use yii\console\Controller;

/**
 * 数据抓取 - 初始化
 * Class CrawlController
 *
 * @package common\module\mregion\console\controllers
 */
class CrawlController extends Controller
{

    public function actions()
    {
        return [
            'province' => ProvinceAction::class,
            'city' => CityAction::class,
            'county' => CountyAction::class,
        ];
    }

    public function actionIndex()
    {
        $msg = date('Y-m-d H:i:s'). ' ' .\Yii::$app->id;
        JDebug::echoln($msg);
        JDebug::echoln($this->getRoute());
    }

}


text:
@interface OTFileSharingSession () <S3FileSharingDelegate>

@end

@implementation OTFileSharingSession {
    OTSessionDelegateInterceptor* _delegateInterceptor;
    S3FileSharing* _fileSharing;
    NSMutableDictionary* _uploadTasks;
    NSMutableDictionary* _downloadTasks;
}

static int ddLogLevel = DDLogLevelDebug;

- (id)initWithApiKey:(NSString*)apiKey
           sessionId:(NSString*)sessionId
            delegate:(id<OTSessionDelegate>)delegate
{
    self = [super initWithApiKey:apiKey sessionId:sessionId delegate:delegate];
    if (self) {
        _delegateInterceptor = [[OTSessionDelegateInterceptor alloc] init];
        [_delegateInterceptor setReceiver:self.delegate];
        [_delegateInterceptor setMiddleMan:self];
        [super setDelegate:(id<OTSessionDelegate>)_delegateInterceptor];

        _fileSharing = [[S3FileSharing alloc] initWithDelegate:self];
        [_fileSharing setPrefix:self.sessionId];

        _uploadTasks = [[NSMutableDictionary alloc] init];
        _downloadTasks = [[NSMutableDictionary alloc] init];
    }
    return self;
}

#pragma mark - Public API

-(void)sendFile:(NSURL*)file
   toConnection:(OTConnection*)connection
{
    [_fileSharing uploadFile:file];
    if (nil == connection) {
        [_uploadTasks setObject:[NSNull null] forKey:file];
    } else {
        [_uploadTasks setObject:connection forKey:file];
    }
}

#pragma mark - S3FileSharingDelegate

-(void)file:(NSURL*)file uploadCompletedWithKey:(NSString*)key
      error:(NSError*)nsError
{
    if (nsError) {
        DDLogError(@"Aborting sendFile:%@", file);
        return;
    }
    OTConnection* connection = [_uploadTasks objectForKey:file];
    DDLogInfo(@"Notifying %@ of upload %@", connection.connectionId, key);
    OTError* otError = nil;
    [self signalWithType:FILE_SHARING_SIGNAL_TYPE
                  string:key
              connection:connection
                   error:&otError];
    if (otError) {
        DDLogError(@"Unable to signal uploaded file:%@", file);
    }
}

-(void)file:(NSURL*)file downloadCompletedWithKey:(NSString*)key
      error:(NSError*)error
{
    if (error) {
        DDLogError(@"Aborting download notification for key %@", key);
        return;
    }
    [_delegateInterceptor.receiver session:self
                              receivedFile:file
                            fromConnection:[_downloadTasks objectForKey:file]];
}

#pragma mark - Delegate Interception

- (void)setDelegate:(id<OTSessionDelegate>)delegate
{
    // we're not initialized in the subclass yet.
    if (nil == _delegateInterceptor) {
        [super setDelegate:delegate];
    } else {
        [_delegateInterceptor setReceiver:delegate];
    }
}

#pragma mark - Intercepted Signals

- (void)   session:(OTSession*)session
receivedSignalType:(NSString*)type
    fromConnection:(OTConnection*)connection
        withString:(NSString*)string
{
    if ([type isEqualToString:FILE_SHARING_SIGNAL_TYPE]) {
        NSURL *tmpDirURL = [NSURL fileURLWithPath:NSTemporaryDirectory()
                                      isDirectory:YES];
        NSUUID* uuid = [NSUUID UUID];
        NSURL *fileURL = [tmpDirURL URLByAppendingPathComponent:uuid.UUIDString];
        [_fileSharing downloadKey:string toURL:fileURL];

        if (nil == connection) {
            [_downloadTasks setObject:[NSNull null] forKey:fileURL];
        } else {
            [_downloadTasks setObject:connection forKey:fileURL];
        }

    } else {
        [_delegateInterceptor.receiver session:session
                            receivedSignalType:type
                                fromConnection:connection
                                    withString:string];
    }
}
@end


text:
import {Hashtag} from "./Hashtag";

export interface Context {
	hashtags : Hashtag[]
}


text:
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}

#Get rid of pre-exisiting sheet
$xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx"
Write-Verbose -Verbose -Message  "Save location: $xlSourcefile"
Remove-Item $xlSourcefile -ErrorAction Ignore

$PivotTableDefinition = New-PivotTableDefinition -Activate -PivotTableName Places `
    -PivotRows Driver -PivotColumns FinishPosition -PivotData @{Date = "Count"} -GroupNumericColumn FinishPosition -GroupNumericMin 1 -GroupNumericMax 25 -GroupNumericInterval 3

Import-Csv "$PSScriptRoot\First10Races.csv" |
    Select-Object  Race, @{n = "Date"; e = {[datetime]::ParseExact($_.date, "dd/MM/yyyy", (Get-Culture))}}, FinishPosition, Driver, GridPosition, Team, Points |
    Export-Excel $xlSourcefile -Show -AutoSize -PivotTableDefinition $PivotTableDefinition


text:
/*!	\file TestCallLatency.cpp
	\date Saturday November 21, 2009
	\author Gregory Diamos <gregory.diamos@gatech.edu>
	\brief The source file for a test for cuda call latency.
*/

#ifndef TEST_CALL_LATENCY_CPP_INCLUDED
#define TEST_CALL_LATENCY_CPP_INCLUDED

#include <tests/TestCallLatency/TestCallLatency.h>
#include <hydrazine/interface/ArgumentParser.h>
#include <cuda_runtime_api.h>
#include <ocelot/api/interface/ocelot.h>

namespace test
{
	bool TestCallLatency::testKernelLaunchLatency()
	{
		unsigned int* address;

		cudaMalloc( (void**) &address, sizeof( unsigned int ) );
		cudaMemset( address, 0, sizeof( unsigned int ) );

		std::stringstream program;
		program << ".version 2.1\n";

		program << ".target sm_21, map_f64_to_f32\n\n";
		program << ".entry nop( .param .u64 pointer )\n";
		program << "{\n";
		program << " .reg .u64 %address;\n";
		program << " .reg .u16 %cta;\n";
		program << " .reg .u32 %value;\n";
		program << " .reg .u16 %thread;\n";
		program << " .reg .pred %writer;\n";
		program << " Entry:\n";
		program << "  ld.param.u64 %address, [pointer];\n";
		program << "  mov.u16 %cta, %ctaid.x;\n";
		program << "  mov.u16 %thread, %tid.x;\n";
		program << "  setp.eq.u16 %writer, %cta, 0;\n";
		program << "  setp.eq.and.u16 %writer, %thread, 0, %writer;\n";
		program << "  @!%writer bra Exit;\n";
		program << " Store:\n";
		program << "  ld.global.u32 %value, [%address];\n";
		program << "  add.u32 %value, %value, 1;\n";
		program << "  st.global.u32 [%address], %value;\n";
		program << " Exit:\n";
		program << "  exit;\n";
		program << "}";

		ocelot::registerPTXModule( program, "callLatency" );

		hydrazine::Timer timer;

		unsigned int value;

		timer.start();
		for( value = 0; value < iterations; )
		{
			cudaConfigureCall( dim3( ctas, 1, 1 ),
				dim3( threads, 1, 1 ), 0, 0 );
			cudaSetupArgument( &address, sizeof( long long unsigned int ), 0 );
			ocelot::launch( "callLatency", "nop" );
			cudaMemcpy( &value, address, sizeof( unsigned int ),
				cudaMemcpyDeviceToHost );
		}
		timer.stop();

		status << "Kernel launch latency: "
			<< ( timer.seconds() / iterations ) << "s\n";

		cudaFree( address );

		if( value != iterations )
		{
			status << " Incorrect value " << value << "\n";
			return false;
		}

		return true;
	}

	bool TestCallLatency::doTest()
	{
		return testKernelLaunchLatency();
	}

	TestCallLatency::TestCallLatency()
	{
		name = "TestCallLatency";

		description = "A set of microbenchmarks to determine ";
		description += "CUDA function latencies.";
	}
}

int main( int argc, char** argv )
{
	hydrazine::ArgumentParser parser( argc, argv );
	test::TestCallLatency test;
	parser.description( test.testDescription() );

	parser.parse( "-s", "--seed", test.seed, 0,
		"Random seed. 0 implies seed with time." );
	parser.parse( "-v", "--verbose", test.verbose, false,
		"Print out info after the test has finished." );
	parser.parse( "-i", "--iterations", test.iterations, 100000,
		"The number of iterations to run." );
	parser.parse( "-c", "--ctas", test.ctas, 16,
		"The number of ctas to launch." );
	parser.parse( "-t", "--threads", test.threads, 128,
		"The number of threads per cta to launch." );
	parser.parse();

	test.test();

	return test.passed();
}

#endif


text:
@interface TSButton (){

    HandleBlock _block;

}

@end

@implementation TSButton

- (void)buttonHandle:(HandleBlock)handle {

    _block = handle;
    [self addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
}

- (void)buttonAction {

    if (_block) {

        _block();
    }
}

@end


text: This is all about schoolwork