Top web site - 132 CHAPTER PERMUTATIONS PATTERN if (buffers.Length >

132 CHAPTER PERMUTATIONS PATTERN if (buffers.Length > 1) { multiplier = double.Parse(buffers[1].Substring(2)); } qvalue = multiplier; level = 0; if (String.Compare(buffers[0], “*/*”) == 0) { level = 1; else if (_wildcard.IsMatch(val)) level = 2; } else if (String.Compare(buffers[0], “application/xhtml+xml”) == 0) { level = 4; else level = 3; public int Compare(object x, object y) int levelx = 0, levely = 0; double qvaluex = 0.0, qvaluey = 0.0; CalculateValue((string)x, out levelx, out qvaluex) E B V CalculateValue((string)y, out levely, out qvaluey); if (levelx < levely) { return 1; else if (levelx > levely) return -1; else if (qvaluex < qvaluey) { return 1; } else if (qvaluex > qvaluey) { return -1; else return 0; CompareMimeTypes has two methods: CalculateValue and Compare. The Compare method is required by the IComparer interface and compares two Accept header identifiers. CalculateValue converts the Accept header identifier into a value that can be used for comparison purposes. The calculation of the greater-than value of an individual item is based on the MIME-type specification and its q value. The method CalculateValue has three parameters. The first
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply