In software engineering, a double-chance function is a software design pattern with a strong application in cross-platform and scalable development. Consider a graphics API with functions to DrawPoint, DrawLine, and DrawSquare. It is easy to see that DrawLine can be implemented solely in terms of DrawPoint, and DrawSquare can in turn be implemented through four calls to DrawLine. If you were porting this API to a new architecture you would have a choice: implement three different functions natively (taking more time to implement, but likely resulting in faster code), or write DrawPoint natively, and implement the others as described above using common, cross-platform, code. An important example of this approach is the X11 graphics system, which can be ported to new graphics hardware by pro

AttributesValues
type
label
  • Double-chance function
  • Chance double
comment
  • Chance double (en anglais double chance) est un terme fréquemment utilisé dans le monde des paris sportifs. Il désigne une technique propre aux parieurs, qui consiste à miser sur deux résultats possibles à l’issue de la rencontre. Elle est présente chez la très grande majorité des bookmakers, que ce soit via des paris en ligne ou des paris faits au sein de structures physiques. * Si l’équipe A gagne : le pari est gagnant * Si l’équipe B gagne : le pari est perdant * S'il y a match nul : le pari est gagnant
  • In software engineering, a double-chance function is a software design pattern with a strong application in cross-platform and scalable development. Consider a graphics API with functions to DrawPoint, DrawLine, and DrawSquare. It is easy to see that DrawLine can be implemented solely in terms of DrawPoint, and DrawSquare can in turn be implemented through four calls to DrawLine. If you were porting this API to a new architecture you would have a choice: implement three different functions natively (taking more time to implement, but likely resulting in faster code), or write DrawPoint natively, and implement the others as described above using common, cross-platform, code. An important example of this approach is the X11 graphics system, which can be ported to new graphics hardware by pro
owl:sameAs
Subject
is primary topic of
έχει περίληψη
  • Chance double (en anglais double chance) est un terme fréquemment utilisé dans le monde des paris sportifs. Il désigne une technique propre aux parieurs, qui consiste à miser sur deux résultats possibles à l’issue de la rencontre. Elle est présente chez la très grande majorité des bookmakers, que ce soit via des paris en ligne ou des paris faits au sein de structures physiques. L’exemple d’une rencontre entre l’équipe A et l’équipe B. Ici, 1 désigne la victoire de l’équipe A, 2 désigne la victoire de l’équipe B et N désigne le match nul. Le parieur choisit de miser sur le chance double 1N, c’est-à-dire qu’à l’issue du match, l’équipe A est vainqueur ou bien fait match nul. Le constat : * Si l’équipe A gagne : le pari est gagnant * Si l’équipe B gagne : le pari est perdant * S'il y a match nul : le pari est gagnant Ce type de mise est notamment beaucoup utilisé pour les paris sportifs concernant le football, où les matchs nuls sont fréquents. Le pari chance double permet aux joueurs de diminuer le risque, mais en conséquence, la cote sera bien entendu moins élevé que sur un pari classique.
  • In software engineering, a double-chance function is a software design pattern with a strong application in cross-platform and scalable development. Consider a graphics API with functions to DrawPoint, DrawLine, and DrawSquare. It is easy to see that DrawLine can be implemented solely in terms of DrawPoint, and DrawSquare can in turn be implemented through four calls to DrawLine. If you were porting this API to a new architecture you would have a choice: implement three different functions natively (taking more time to implement, but likely resulting in faster code), or write DrawPoint natively, and implement the others as described above using common, cross-platform, code. An important example of this approach is the X11 graphics system, which can be ported to new graphics hardware by providing a very small number of device-dependent primitives, leaving higher level functions to a hardware-independent layer. The double-chance function is an optimal method of creating such an implementation, whereby the first draft of the port can use the "fast to market, slow to run" version with a common DrawPoint function, while later versions can be modified as "slow to market, fast to run". Where the double-chance pattern scores high is that the base API includes the self-supporting implementation given here as part of the null driver, and all other implementations are extensions of this. Consequently, the first port is, in fact, the first usable implementation. One typical implementation in C++ could be: class CBaseGfxAPI { virtual void DrawPoint(int x, int y) = 0; /* Abstract concept for the null driver */ virtual void DrawLine(int x1, int y1, int x2, int y2) { /* DrawPoint() repeated */} virtual void DrawSquare(int x1, int y1, int x2, int y2) { /* DrawLine() repeated */} }; class COriginalGfxAPI : public CBaseGfxAPI { virtual void DrawPoint(int x, int y) { /* The only necessary native calls */ } virtual void DrawLine(int x1, int y1, int x2, int y2) { /* If this function exists a native DrawLine routine will be used. Otherwise the base implementation is run. */} }; class CNewGfxAPI : public CBaseGfxAPI { virtual void DrawPoint(int x, int y) { /* The only necessary for native calls */ } }; Note that the CBaseGfxAPI::DrawPoint function is never used, per se, as any graphics call goes through one of its derived classes. So a call to CNewGfxAPI::DrawSquare would have its first chance to render a square by the CNewGfxAPI class. If no native implementation exists, then the base class is called, at which point the virtualization takes over and means that CNewGfxAPI::DrawLine is called. This gives the CNewGfxAPI class a “second chance” to use native code, if any is available. With this method it is, theoretically, possible to build an entire 3D engine (applying software rasterizing) using only one native function in the form of DrawPoint, with other functions being implemented as and when time permits. In practice this would be hopelessly slow, but it does demonstrate the possibilities for double-chance functions.
wasDerivedFrom
Wikipage page ID
  • 1749773(xsd:integer)
Wikipage revision ID
  • 956133653(xsd:integer)
Link from a Wikipage to another Wikipage
page length (characters) of wiki page
  • 4102(xsd:integer)
http://purl.org/li...ics/gold/hypernym
dbpprop:wikiPageUsesTemplate
is owl:sameAs of
is topic of
is Wikipage redirect of
is Link from a Wikipage to another Wikipage of
Alternative Linked Data Views: Sponger | iSPARQL | ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON )    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] This material is Open Knowledge Creative Commons License Valid XHTML + RDFa
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
OpenLink Virtuoso version 06.01.3127, on Linux (x86_64-pc-linux-gnu), Standard Edition
Copyright © 2009-2011 OpenLink Software