Page MenuHomeDevCentral

Implement a weighted list
ClosedPublic

Authored by dereckson on Apr 30 2018, 10:40.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 15, 15:23
Unknown Object (File)
Sat, Dec 14, 10:29
Unknown Object (File)
Fri, Dec 13, 21:19
Unknown Object (File)
Fri, Dec 13, 12:36
Unknown Object (File)
Fri, Dec 13, 12:35
Unknown Object (File)
Fri, Dec 13, 12:35
Unknown Object (File)
Fri, Dec 13, 12:35
Unknown Object (File)
Wed, Nov 27, 02:02
Subscribers
None

Details

Summary

A weighted value is a pair defined by a value, and an associated weight.

A weighted list is a collection of weight values.

This change allows to create a list of items, with an associated weight.

A use case is to parse $_SERVER['HTTP_ACCEPT_LANGUAGE'], a list of
languages, with associated weight to indicate user preferences of
languages with more granularity.

Test Plan
  • Unit tests provided
  • The next commit will implement this for AcceptedLanguages

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
dereckson edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 30 2018, 10:47

Drop AcceptedLanguages class from this change

This revision was automatically updated to reflect the committed changes.